On 2003-11-25 at 19:53:09, Piers Cawley wrote:
> Is that how Ruby does it then?
=begin RubyDigression
Ruby's String class has the methods sub (replace once) and gsub
(replace all), which leave the invocant alone and return the
result of the substitution, and sub! and gsub!, which modify the
invoc
"Mark J. Reed" <[EMAIL PROTECTED]> writes:
> On 2003-11-25 at 18:17:04, Piers Cawley wrote:
>>aString replace: aPattern with: aString.
>>
>>aString replaceAll: aPattern with: aString.
>
> Stop! Stop that at once! No small talk; we're here for
> serious discussions!
>
> :)
>
>> Except...
On 2003-11-25 at 18:17:04, Piers Cawley wrote:
>aString replace: aPattern with: aString.
>
>aString replaceAll: aPattern with: aString.
Stop! Stop that at once! No small talk; we're here for
serious discussions!
:)
> Except... the second argument isn't strictly a string because it's
>
Jonathan Scott Duff <[EMAIL PROTECTED]> writes:
> On Wed, Nov 19, 2003 at 08:23:30PM +, Smylers wrote:
>> This, however, is irritating:
>>
>> my @new = map { s:e/$pattern/$replacement/; $_ } @old;
>>
>> I forget the C<; $_> far more often than I like to admit and end up with
>> an array of
David Chan writes:
> Hmmm. When doing multiple substitutions, it would be nice to avoid a
> hard-to-read nested function call which reads backwards, a la python:
>
> return re.sub('>','>',re.sub('<','<',re.sub('&','&',text)))
>
> ... but to also avoid multiple statements like this:
>
> my $
[EMAIL PROTECTED] wrote:
> Smylers wrote:
>> This, however, is irritating:
>>
>> my @new = map { s:e/$pattern/$replacement/; $_ } @old;
>>
>> So I'd like a more elegant way of writing that -- but I don't think
>> making the return value of C more complicated (and duplicating
>> data in the proces
On Fri, Nov 21, 2003 at 01:26:18PM +, Piers Cawley wrote:
: Simon Cozens <[EMAIL PROTECTED]> writes:
:
: > [EMAIL PROTECTED] (Luke Palmer) writes:
: >> $substituted = ($text ~~ s/$pattern/$replacement/) but nothing;
: >
: > Surely "no buts"? :)
: >
: >> What I really want is a functional v
Simon Cozens <[EMAIL PROTECTED]> writes:
> [EMAIL PROTECTED] (Luke Palmer) writes:
>> $substituted = ($text ~~ s/$pattern/$replacement/) but nothing;
>
> Surely "no buts"? :)
>
>> What I really want is a functional version of s///. Like:
>> my $substituted = $text.s(/$pattern/, { $replace
* A. Pagaltzis <[EMAIL PROTECTED]> [2003-11-21 13:16]:
> But that without nested for modifiers (will those work?) this
> isn't be applicable in the middle of a map map map map chain..
I shouldn't edit my stuff so heavily.. what a mess.
--
Regards,
Aristotle
"If you can't laugh at yourself, you
* Smylers <[EMAIL PROTECTED]> [2003-11-20 11:50]:
> This, however, is irritating:
>
> my @new = map { s:e/$pattern/$replacement/; $_ } @old;
>
> I forget the C<; $_> far more often than I like to admit and
> end up with an array of integers instead of modified strings.
> So I'd like a more eleg
[EMAIL PROTECTED] (Luke Palmer) writes:
> $substituted = ($text ~~ s/$pattern/$replacement/) but nothing;
Surely "no buts"? :)
> What I really want is a functional version of s///. Like:
> my $substituted = $text.s(/$pattern/, { $replacement });
> Without modifying $text.
$rubyometer++;
Luke Palmer <[EMAIL PROTECTED]> writes:
> Smylers writes:
>> Perl 5 C currently returns the number of substitutions made.
>> This has its uses, so Perl 6 C should probably continue to do
>> this.
>>
>> Can we have a return value that stringifies to the result of the
>> substitution but numifies to
Smylers writes:
> Piers Cawley writes:
>
> > Stèphane Payrard <[EMAIL PROTECTED]> writes:
> >
> > > s/// in string context should return the string after substituion.
> >
> > Surely it should return the string after substitution, but with an
>
On Wed, Nov 19, 2003 at 08:23:30PM +, Smylers wrote:
> This, however, is irritating:
>
> my @new = map { s:e/$pattern/$replacement/; $_ } @old;
>
> I forget the C<; $_> far more often than I like to admit and end up with
> an array of integers instead of modified strings.
That one gets m
Piers Cawley writes:
> Stéphane Payrard <[EMAIL PROTECTED]> writes:
>
> > s/// in string context should return the string after substituion.
>
> Surely it should return the string after substitution, but with an
> appropriate 'but true' or 'but false
[EMAIL PROTECTED] (Allison Randal) writes:
> We talked about this today. Our current thought is to retroactively
> write the Synopses and keep those up-to-date (with notes in the outdated
> parts of the A's and E's pointing to the relevant section of the
> S's).
To be honest, I don't care how it's
Simon wrote:
>
> How should we go about bringing A3 up to match current reality? It is, after
> all, over two years old now.
We talked about this today. Our current thought is to retroactively
write the Synopses and keep those up-to-date (with notes in the outdated
parts of the A's and E's pointi
On Wed, Nov 19, 2003 at 06:17:33PM +, Simon Cozens wrote:
> [EMAIL PROTECTED] (Larry Wall) writes:
> > Sigh. There's no =~ operator in Perl 6.
>
> How should we go about bringing A3 up to match current reality? It is, after
> all, over two years old now.
Isn't Allison the maintainer? Just p
[EMAIL PROTECTED] (Larry Wall) writes:
> Sigh. There's no =~ operator in Perl 6.
How should we go about bringing A3 up to match current reality? It is, after
all, over two years old now.
--
End July 2001 - Alpha release for demonstration at TPC
On Wed, Nov 19, 2003 at 09:03:38AM -0500, Austin Hastings wrote:
:
:
: > -Original Message-
: > From: Joe Gottman [mailto:[EMAIL PROTECTED]
: > Sent: Tuesday, November 18, 2003 9:58 PM
: > To: Perl6
: > Subject: Re: [perl] RE: s/// in string context should re
> -Original Message-
> From: Joe Gottman [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 18, 2003 9:58 PM
> To: Perl6
> Subject: Re: [perl] RE: s/// in string context should return the string
>
>
> - Original Message -
> From: "Austin Ha
"Joe Gottman" <[EMAIL PROTECTED]> writes:
> - Original Message -
> From: "Austin Hastings" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Tuesday, November 18, 2003 3:04 PM
> Subject: [perl] RE:
Stéphane Payrard <[EMAIL PROTECTED]> writes:
> s/// in string context should return the string after substituion.
> It seems obvious to me but I mention it because I can't find it
> in the apocalypses.
Surely it should return the string after substitution, but with an
a
- Original Message -
From: "Austin Hastings" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, November 18, 2003 3:04 PM
Subject: [perl] RE: s/// in string context should return the string
> As a "Bvalue" whe
As a "Bvalue" where possible, so they can cascade and nest.
=Austin
> -Original Message-
> From: Stephane Payrard [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 18, 2003 12:19 PM
> To: [EMAIL PROTECTED]
> Subject: s/// in string context should return th
s/// in string context should return the string after substituion.
It seems obvious to me but I mention it because I can't find it
in the apocalypses.
--
stef
26 matches
Mail list logo