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", :
> $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
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:
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,
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, bl
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
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
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"
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 thoug
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
aforemen
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
--
http://convolution.
11 matches
Mail list logo