On 16/09/2011 2:10 PM, Marijn Haverbeke wrote:

The original solution proposed was to pass the accessor a block and
pass the value to that block by reference. This would cause blocks to
spring up everywhere (with all the indentation and noise that comes
with it) and be extremely un-composable. A while ago I wrote a message
to this list proposing a system whereby functions could return
references. This week, I've finally implemented that. The exact syntax
and semantics are not yet set in stone, so if you see room for
improvement, reply.

Ok. summary (mostly aesthetic) response: reading this experiment so far, even if it's semantically valid, it looks to me like it's not worth the price of admission.

When you proposed exploring this in mid-jul, I was hesitant and came around to a modest "might as well try and see if any interesting cases are legal, if you're interested"; but the discussion there was based on analysis of types only, and even then I was pretty nervous.

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, and make more sense. This has no precedent I've heard of in other languages, and will be consistently warty and hard to explain to anyone using the language.

Could you elaborate on why accessors-by-blocks are un-composable? I think they're actually a *relatively* tidy technique, since they syntactically denote stack-discipline reference lifetimes (by indentation / brace boundaries). They seem to work well in languages that use them, no?

-Graydon
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to