s[pattern] = { doit } illegal, why?

2006-10-11 Thread Jonathan Lang
While I agree with most of the changes made to the s[]... notation, there's one oddity that I just spotted: S05 says: This is not a normal assigment, since the right side is evaluated each time the substitution matches (much like the pseudo-assignment to declarators can happen at strange

Re: s[pattern] = { doit } illegal, why?

2006-10-11 Thread Larry Wall
On Wed, Oct 11, 2006 at 05:55:45PM -0700, Jonathan Lang wrote: : While I agree with most of the changes made to the s[]... notation, : there's one oddity that I just spotted: : : S05 says: : This is not a normal assigment, since the right side is : evaluated each time the substitution matches

Re: s[pattern] = { doit } illegal, why?

2006-10-11 Thread Larry Wall
On Wed, Oct 11, 2006 at 06:29:00PM -0700, Larry Wall wrote: : s:s:g[, (\w+): (.+) ,] = - $key, $val { $key = $val }.(@()) Hmm, that won't work, since @() is a single argument. It'd have to be one of: s:s:g[, (\w+): (.+) ,] = - [$key, $val] { $key = $val }.(@()) s:s:g[, (\w+): (.+) ,]

Re: s[pattern] = { doit } illegal, why?

2006-10-11 Thread Jonathan Lang
In short, nearly every case where I'm looking to use a raw closure can be handled almost as easily by prefacing it with Cdo (if the block doesn't take parameters) or Cdo given (if it does). A bit more wordy than I'd like, but acceptable; it still reads well. Although I'd recommend pointing this