On 24 December 2014 at 11:26, Jonathan S. Shapiro <[email protected]> wrote: > On Tue, Dec 23, 2014 at 4:00 PM, William ML Leslie > <[email protected]> wrote: > It seems to me that the default should be by-value capture. The more > interesting question is whether it's worth the bother to introduce an > overriding construct of some form. I see two ways to do this: > > let captured mutable x = initializer in ... > > > or some annotation at the lambda itself indicating the type of capture it > means to be doing. Hard to say which is cleaner, though in either case I > think the iterator pattern should be using a fresh variable. BitC is trying > to favor non-imperative constructs where possible. One advantage to the "let > captured" construct is that it tells you explicitly that the mutable value > isn't shallow.
Is the existing box (ref) not sufficient? -- William Leslie Notice: Likely much of this email is, by the nature of copyright, covered under copyright law. You absolutely MAY reproduce any part of it in accordance with the copyright law of the nation you are reading this in. Any attempt to DENY YOU THOSE RIGHTS would be illegal without prior contractual agreement. _______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
