> Since multiple arguments (and especially the hidden-type 'self' argument,
> and closure environments) seem to require this &0 .. &n annotation scheme, I
> think that sort of violates the aesthetic-preference argument motivating you
> here. To my eyes, blocks *definitely* look better,

So here we have an &, or a &1, in the accessor definition (once),
versus wrapping your computation in a block, on every single use of
the accessor.

> Could you elaborate on why accessors-by-blocks are un-composable?

Calling them uncomposable was too strong, I guess. If you need to
access two data structures, you'll be passing a block that closes over
A to the accessor of B, and then calling the accessor of A inside that
block with yet another block.

Let's leave my code in for now, and play with both approaches. I am
quite confident that access-by-reference will prove to be more
pleasant.

> They seem to work well in languages that use them, no?

I've never used a language that does this. Examples?
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to