"With" for records
Steve Barham
steve at ethx.net
Fri Jun 10 16:46:48 UTC 2022
> This should remind people of the *compact constructor* in a record; the
> body is allowed to freely mutate the special variables (who also don't
> have obvious declarations), and their terminal values determine the
> state of the record.
>
> Just as we were able to do record patterns without having full-blown
> deconstructors, we can do with expressions on records as well, because
> (a) we still have a canonical ctor, (b) we have accessors, and (c) we
> know the names of the components.
…
> with the X and Y values of the operand. Their values are committed at
> the end of the block using the canonical constructor.
Is it correct to say the canonical constructor here? Would the compact constructor not be a better choice, as it gives implementors access to validate the new values to be committed?
Cheers,
Steve
(apologies for the not replying to the thread; I subscribed to the list just recently, and don’t know that I can poke Mailman into sending me past messages so that I can reply to them)
More information about the amber-spec-observers
mailing list