develooper Front page | perl.perl6.language | Postings from April 2005

Re: Question about list context for String.chars

Thread Previous | Thread Next
From:
Ingo Blechschmidt
Date:
April 11, 2005 11:14
Subject:
Re: Question about list context for String.chars
Message ID:
d3eeha$uti$1@sea.gmane.org
Hi,

gcomnz wrote:
> I'm writing a bunch of examples for perl 6 pleac and it seems rather
> natural to expect $string.chars to return a list of unicode chars in
> list context, however I can't find anything to confirm that. (The
> other alternatives being split and unpack.)

I like that.

If one wanted to have the *number* of chars/graphemes/whatever, one
could still use the cheap unary "+" operator.

And .keys, .values, .pairs, etc. don't return a plain number, but actual
contents, too (consistency!).


--Ingo

-- 
Linux, the choice of a GNU | Wissen ist Wissen, wo man es findet.  
generation on a dual AMD   | 
Athlon!                    | 


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About