Message from discussion
Question about list context for String.chars
Newsgroups: perl.perl6.language
Path: g2news1.google.com!news4.google.com!newsfeed.stanford.edu!nntp.perl.org
Return-Path: <gco...@gmail.com>
Mailing-List: contact perl6-language-h...@perl.org; run by ezmlm
Delivered-To: mailing list perl6-langu...@perl.org
Received: (qmail 523 invoked from network); 12 Apr 2005 04:20:34 -0000
Received: from x1a.develooper.com (HELO x1.develooper.com) (216.52.237.111)
by lists.develooper.com with SMTP; 12 Apr 2005 04:20:34 -0000
Received: (qmail 30929 invoked by uid 225); 12 Apr 2005 04:20:34 -0000
Delivered-To: perl6-langu...@perl.org
Received: (qmail 30924 invoked by alias); 12 Apr 2005 04:20:33 -0000
X-Spam-Status: No, hits=-2.5 required=8.0
tests=BAYES_00,RCVD_BY_IP
X-Spam-Check-By: la.mx.develooper.com
Received-SPF: pass (x1.develooper.com: domain of gco...@gmail.com designates 64.233.170.206 as permitted sender)
Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (64.233.170.206)
by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Mon, 11 Apr 2005 21:20:31 -0700
Received: by rproxy.gmail.com with SMTP id 1so7582rny
for <perl6-langu...@perl.org>; Mon, 11 Apr 2005 21:20:27 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
s=beta; d=gmail.com;
h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references;
b=KSnsYfZ8FP5kIUAFs/kekWyBh/u3aMnU38y6LTUYc4DI6OneJH9WxSOrC3saR9h0lx7OD/roJhRrrwLEZmPpsde7G77XWl7dXSoBRKu6oQ396sJfv9HwcY4wwl5SDQKL7CpoomV6MQyq0JSOJP6at1WnI/ynqJ3nQDy1mrApsuw=
Received: by 10.38.8.31 with SMTP id 31mr141867rnh;
Mon, 11 Apr 2005 21:20:27 -0700 (PDT)
Received: by 10.38.8.68 with HTTP; Mon, 11 Apr 2005 21:20:27 -0700 (PDT)
Message-ID: <fb0779770504112120257a6d7f@mail.gmail.com>
Date: Mon, 11 Apr 2005 21:20:27 -0700
Reply-To: gcomnz <gco...@gmail.com>
To: Rod Adams <r...@rodadams.net>
Subject: Re: Question about list context for String.chars
Cc: perl6-langu...@perl.org
In-Reply-To: <425B4740.5030809@rodadams.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
References: <fb07797705041111035357f...@mail.gmail.com>
<425B4740.5030...@rodadams.net>
Approved: n...@nntp.perl.org
From: gco...@gmail.com (Gcomnz)
> 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:
>=20
> @array =3D $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?