Re: Slicing conflict

2005-04-11 Thread Autrijus Tang
On Tue, Apr 12, 2005 at 12:30:42AM -0600, Luke Palmer wrote: > But in Perl 6: > > my @a = (1,2,3,4); > my @b = @a[1...]; # elements from 1 onward > say [EMAIL PROTECTED]; # should probably be 3, but with Perl 5 > semantics is Inf In Pugs (r1847), after the IType refactoring, I hav

Slicing conflict

2005-04-11 Thread Luke Palmer
In Perl 5: my @a = (1,2,3); my @b = @a[0..3]; print scalar(@b); # 4 But in Perl 6: my @a = (1,2,3,4); my @b = @a[1...]; # elements from 1 onward say [EMAIL PROTECTED]; # should probably be 3, but with Perl 5 semantics is Inf We have to break one of these. I think

Re: Question about list context for String.chars

2005-04-11 Thread Rod Adams
Matt Diephouse wrote: On Apr 12, 2005 12:20 AM, gcomnz <[EMAIL PROTECTED]> wrote: 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), but I forget h

Re: Question about list context for String.chars

2005-04-11 Thread gcomnz
> > > 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), but I forget how > > > it ended, and my brain is too fried to go hunt it down. But overall I

Re: Question about list context for String.chars

2005-04-11 Thread Matt Diephouse
On Apr 12, 2005 12:20 AM, gcomnz <[EMAIL PROTECTED]> wrote: > > 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), but I forget how > > it

Re: Question about list context for String.chars

2005-04-11 Thread 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), but I forget how > it ended, and my brain is too fried to go hunt it down. But overall I >

Re: Question about list context for String.chars

2005-04-11 Thread Rod Adams
gcomnz wrote: Hi all, 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.) # unpack @array = unpack("C

Re: Here documents as positional parameters to a function call

2005-04-11 Thread Luke Palmer
gcomnz writes: > Hey all, more pleac conversion questions: > > I can't prove with the docs that a heredoc will continue to work as > positional params to a function call, particularly where it's not the > first param: > > die "Couldn't send mail" unless send_mail < here doc here ... >

Here documents as positional parameters to a function call

2005-04-11 Thread gcomnz
Hey all, more pleac conversion questions: I can't prove with the docs that a heredoc will continue to work as positional params to a function call, particularly where it's not the first param: die "Couldn't send mail" unless send_mail <

Re: Question about list context for String.chars

2005-04-11 Thread gcomnz
> > "abc".chars would return , which I'm guessing would be > > bytesize usually. > > Fair enough. > > > "日本語".chars would return <[EMAIL PROTECTED]@語>, which can probably be > > expressed with > > UTF8? > > I think you're confusing UTF8 (which can represent ALL Unicode > characters) and "the U

Re: Question about list context for String.chars

2005-04-11 Thread Aaron Sherman
On Mon, 2005-04-11 at 15:40, gcomnz wrote: > I have to say I'm slightly confused too for some languages, > especiallyfor syllabic alphabets. At the same time, I'm pretty clear > for CJK,Syllabaries, and alphabets, or at least I hope I'm clear (I > guess I'mabout to find out), .chars just returns t

Re: Question about list context for String.chars

2005-04-11 Thread Mark Reed
On 2005-04-11 15:40, "gcomnz" <[EMAIL PROTECTED]> wrote: > "日本語".chars would return <[EMAIL PROTECTED]@語>, which can probably be expressed with UTF8? The string "日本語" is probably represented internally as UTF-8, but that should have no effect on what .chars returns, which should, indeed, be <日

Re: Whither "use English"?

2005-04-11 Thread Aaron Sherman
On Mon, 2005-04-11 at 15:00, Juerd wrote: > Aaron Sherman skribis 2005-04-11 14:49 (-0400): > > Yes, but it will be spelled: > > use $*LANG ;-) > > Seriously, is there some reason that we would not provide a > > "Language::Russian" and "Language::Nihongo"? Given Perl 6, it would even > > be qui

Re: Question about list context for String.chars

2005-04-11 Thread gcomnz
I have to say I'm slightly confused too for some languages, especially for syllabic alphabets. At the same time, I'm pretty clear for CJK, Syllabaries, and alphabets, or at least I hope I'm clear (I guess I'm about to find out), .chars just returns the right unicode level for whatever the string c

Re: Question about list context for String.chars

2005-04-11 Thread Aaron Sherman
On Mon, 2005-04-11 at 14:12, Ingo Blechschmidt wrote: > 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 al

Re: Whither "use English"?

2005-04-11 Thread Mark Reed
On 2005-04-11 15:00, "Juerd" <[EMAIL PROTECTED]> wrote: > > I'm not even sure I like the *possibility* of using non-ascii letters in > identifiers, even. I agree that it would be a nightmare if project A used presu instead of print everywhere, while project B used toon, etc. But non-ASCII iden

Re: Whither "use English"?

2005-04-11 Thread Juerd
Aaron Sherman skribis 2005-04-11 14:49 (-0400): > Yes, but it will be spelled: > use $*LANG ;-) > Seriously, is there some reason that we would not provide a > "Language::Russian" and "Language::Nihongo"? Given Perl 6, it would even > be quite valid for those modules to add aliases for all of

Re: Whither "use English"?

2005-04-11 Thread Aaron Sherman
On Mon, 2005-04-11 at 14:31, Juerd wrote: > David Vergin skribis 2005-04-11 9:44 (-0700): > > What's the word. Will there be something like "use English"? > > Yes, and it's the default :) Yes, but it will be spelled: use $*LANG ;-) Seriously, is there some reason that we would not prov

Re: Whither "use English"?

2005-04-11 Thread Juerd
David Vergin skribis 2005-04-11 9:44 (-0700): > What's the word. Will there be something like "use English"? Yes, and it's the default :) Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html

Whither "use English"?

2005-04-11 Thread David Vergin
I'm working on docs/S28draft.pod in the pugs project. And consulting perl5's perlvar.pod, the issue of "use English" comes up. AFAICT from various sources, little has been said about this NOTE: http://groups-beta.google.com/group/perl.perl6.language/msg/fa241233bcfba024: "we've already been th

Re: Question about list context for String.chars

2005-04-11 Thread Ingo Blechschmidt
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 wa

Question about list context for String.chars

2005-04-11 Thread gcomnz
Hi all, 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.) # unpack @array = unpack("C*", $string);