[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: hook after in/do/end
- From: Tony Finch <dot@...>
- Date: Tue, 12 Jan 2010 17:29:49 +0000
On Tue, 12 Jan 2010, steve donovan wrote:
> On Tue, Jan 12, 2010 at 7:04 PM, Tony Finch <email@example.com> wrote:
> > It occurred to me that a nice way to express the hook after a lexical
> > block might be as follows, somewhat inspired by for loop iterators.
> > in env, hook do
> > block
> > end
> This would be easier than yet-another-metamethod-on-env, I must say.
> Although, the hook parameter would be optional, so 'in env do...end'
> remains (and people need never know that there are block hooks)
Yes, I said the hook is optional.
> Although checking block exit could slow down this construct, which is
> often going to be used as a convenient multiple-field assignment with
"in" blocks do not work as a multiple assignment.
f.anthony.n.finch <firstname.lastname@example.org> http://dotat.at/
GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS.
MODERATE OR GOOD.