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

Re: Question about list context for String.chars

Thread Previous | Thread Next
From:
gcomnz
Date:
April 11, 2005 21:20
Subject:
Re: Question about list context for String.chars
Message ID:
fb0779770504112120257a6d7f@mail.gmail.com
> Rod wrote:
> However, I do like the idea of treating a string as an array of chars. I
> remember some discussion a while back about making [] on strings do
> something useful (but not the same thing as C<substr>), but I forget how
> it ended, and my brain is too fried to go hunt it down. But overall I
> like that idea. Then you could just say:
> 
>     @array = $string[];

This all sounds nice and simple. My only question then is what about
the instances where you specifically need the array of graphs, codes,
bytes, or whatever? If we can do one, why not all?

I recall that a good point Larry made previously is not to bend over
backward to let C programmers still think like C programmers in Perl
(sorry if my munging didn't get that just right). And to be honest I
only came up with this question for the cookbook (pleac) examples, but
I'm guessing there's some reasonable use for all this stuff outside of
the C-thinking world?

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