Lvalue Str::words iterator
by Ingo Blechschmidt other posts by this author
Jun 15 2005 10:15AM messages near this date
Re: PATCH: S04 - unary C<=> is not slurpy
|
Re: Lvalue Str::words iterator
Hi,
as Larry mentioned in another thread that he wants a "different notation
for word
splitting" (http://www.nntp.perl.org/group/perl.perl6.language/21874),
how about that, similar to Haskell's "words" function:
# Str::words should return a list of words, without whitespace.
my $str = " hi my name is ingo ";
my @words = words $str;
say join ",", @words; # "hi,my,name,is,ingo";
# The list returned should contain lvalueable objects (idea courtesy
# of wolverian):
my $str = " hi my name is ingo ";
$str.words .= map:{ ucfirst };
say $str; # " Hi My Name Is Ingo "
# Note: The whitespace was preserved!
Comments?
--Ingo
--
Linux, the choice of a GNU | We are Pentium of Borg. Division is futile.
generation on a dual AMD | You will be approximated.
Athlon! |
Thread:
Ingo Blechschmidt
Juerd
Ingo Blechschmidt
Juerd
Larry Wall
Ingo Blechschmidt
Juerd
|