Re: Contextual::Return (was Re: could 'given' blocks have a return value?)

2006-08-31 Thread Juerd
Damian Conway skribis 2006-08-31 9:08 (+1000): return want.rw ?? $lvalue :: want.count == 2 ?? (7,11) :: want.item ?? 42 :: want.list ?? 1..10 ::die Bad context; s:g/::/!!/ # :) Juerd --

Re: derived class generators and introspection

2006-08-31 Thread Nigel Hamilton
Rather, the proposal is focusing on what users of these data structures would / could see. The idea is that relational structures have the same ease of use and flexability that things like hashes or arrays or sequences or sets do now. They can of course just be stored in RAM like the

Naming the method form of s///

2006-08-31 Thread Mark J. Reed
According to S05, the string method equivalent of the s/// operator is named subst. (Just going by the spec here; the method doesn't exist yet in Pugs). I anticipate typos galore from the near-collision of names between subst and substr; perhaps replace would be a better name, even though it

Re: Naming the method form of s///

2006-08-31 Thread Juerd
Mark J. Reed skribis 2006-08-31 9:45 (-0400): According to S05, the string method equivalent of the s/// operator is named subst. (Just going by the spec here; the method doesn't exist yet in Pugs). I anticipate typos galore from the near-collision of names between subst and substr; perhaps

Re: Naming the method form of s///

2006-08-31 Thread Mark J. Reed
On 8/31/06, Juerd [EMAIL PROTECTED] wrote: Another issue is how we're going to pass arguments to this method. s/// has very special syntax, that I don't think we can easily replicate. S05 says it's $str.subst(regex, string-or-block); presumably the flags would go on the regex? I personally

Re: Naming the method form of s///

2006-08-31 Thread Sage La Torra
On 8/31/06, Mark J. Reed [EMAIL PROTECTED] wrote: I anticipate typos galore from the near-collision of names between subst and substr; perhaps replace would be a better name, even though it breaks the mnemonic association with s///? Perhaps the long name substitute would work? While it does

Re: Naming the method form of s///

2006-08-31 Thread Juerd
Mark J. Reed skribis 2006-08-31 10:29 (-0400): Another issue is how we're going to pass arguments to this method. s/// has very special syntax, that I don't think we can easily replicate. S05 says it's $str.subst(regex, string-or-block); presumably the flags would go on the regex? Ah, block.

Re: Naming the method form of s///

2006-08-31 Thread Luke Palmer
On 8/31/06, Juerd [EMAIL PROTECTED] wrote: Still, though, How would you specify :g? It doesn't make a lot of sense on rx// -- just like you can't use it with qr// in Perl 5. It is a good point that it doesn't belong on the regex. Perhaps: $foo.subst(/bar/, baz, :g) That seems to work,

Re: Naming the method form of s///

2006-08-31 Thread jerry gay
On 8/31/06, Luke Palmer [EMAIL PROTECTED] wrote: On 8/31/06, Juerd [EMAIL PROTECTED] wrote: Still, though, How would you specify :g? It doesn't make a lot of sense on rx// -- just like you can't use it with qr// in Perl 5. It is a good point that it doesn't belong on the regex. Perhaps:

Re: Naming the method form of s///

2006-08-31 Thread Michael Snoyman
$foo.subst(:g, /bar/, baz) i seem to recall $foo.subst(/:g bar/, baz) is valid syntax already. If I'm not mistaken, the aversion to that syntax- as implied earlier in this thread- was that the :g is really a modifier on the substitution, not on the matching. (Please correct me

Re: Naming the method form of s///

2006-08-31 Thread Jonathan Lang
Luke Palmer wrote: On 8/31/06, Juerd [EMAIL PROTECTED] wrote: Still, though, How would you specify :g? It doesn't make a lot of sense on rx// -- just like you can't use it with qr// in Perl 5. It is a good point that it doesn't belong on the regex. Perhaps: $foo.subst(/bar/, baz, :g)