Perl 6.x , please offer PREPEND as well as APPEND
- From: "Mr P" <MisterPerl@xxxxxxxxx>
- Date: 31 Jan 2006 06:43:39 -0800
Dear Damian, Larry, et al:
The asymetric PREPEND and APPEND should be addressed in 6.x:
# append a string, very nice
$song .= ' Her Majesty The Queen';
# prepend a string - YUK, ugly, [1]
$song = ' Her Majesty The Queen ' . $song;
# new and improved prepend a string - YAY, posh
$song =. 'Her Majesty The Queen ';
# or to be consistent with other $a x= $b syntax, perhaps something
like...
$song |= 'Her Majesty The Queen ';
******************************************************
If you offer tea you should serve crumpets as well!
Thank-You for your kind attention,
Mr P
[1] - every mathmatician or logician has to flinch everytime they
encounter this syntax. As programmers we understand what it's up to of
course, but in general terms:
a = b + a
is ONLY true for b=0, (or b='' in the case of a string) which in our
case is NOT true.
.
- Follow-Ups:
- Re: Perl 6.x , please offer PREPEND as well as APPEND
- From: xhoster
- Re: Perl 6.x , please offer PREPEND as well as APPEND
- From: Paul Lalli
- Re: Perl 6.x , please offer PREPEND as well as APPEND
- Prev by Date: Re: why doesn't sort properly?
- Next by Date: Re: Substitutions in matched patterns?
- Previous by thread: Substitutions in matched patterns?
- Next by thread: Re: Perl 6.x , please offer PREPEND as well as APPEND
- Index(es):
Relevant Pages
|