Re: Unwanted warnings (was Re: Something wrong with str.reverse)

2010-07-31 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 7/31/10 23:26 , David Green wrote: > On 2010-06-18, at 10:48 am, Larry Wall wrote: >>0123; # warns >>0123; # ok! # suppresses this warning here >>0123; # OK! # suppresses this warning from now on >

Unwanted warnings (was Re: Something wrong with str.reverse)

2010-07-31 Thread David Green
On 2010-06-18, at 10:48 am, Larry Wall wrote: > If you make it the default to not warn, then the people who really need the > warnings will almost never turn them on. If you make it default to warn, > then people will have to turn off the warnings forever. Doesn't the site-policy policy help he

Re: Something wrong with str.reverse

2010-06-22 Thread Leon Timmermans
On Mon, Jun 21, 2010 at 3:37 PM, Patrick R. Michaud wrote: > On Mon, Jun 21, 2010 at 09:47:37AM +0100, Smylers wrote: > > On the other hand, many of our other list-y methods also work on > scalars (treating them as a list of 1 element -- essentially a no-op): > .join, .sort, .any, .all, .rotate, .

Re: Something wrong with str.reverse

2010-06-22 Thread Will Coleda
On Tue, Jun 22, 2010 at 4:40 AM, David Landgren wrote: > On 22/06/2010 09:07, Richard Hainsworth wrote: >> >> I was going to suggest this too after reading PM's post. I would suggest >> that for whatever reason a list operator was used on a scalar, including >> a hold over form another language (R

Re: Something wrong with str.reverse

2010-06-22 Thread Smylers
David Landgren writes: > On 22/06/2010 09:07, Richard Hainsworth wrote: > > > I was going to suggest this too after reading PM's post. I would > > suggest that for whatever reason a list operator was used on a > > scalar, including a hold over form another language (Ruby and > > perl5), a warning

Re: Something wrong with str.reverse

2010-06-22 Thread David Landgren
On 22/06/2010 09:07, Richard Hainsworth wrote: I was going to suggest this too after reading PM's post. I would suggest that for whatever reason a list operator was used on a scalar, including a hold over form another language (Ruby and perl5), a warning should be issued. Most likely to be an err

Re: Something wrong with str.reverse

2010-06-22 Thread Richard Hainsworth
I was going to suggest this too after reading PM's post. I would suggest that for whatever reason a list operator was used on a scalar, including a hold over form another language (Ruby and perl5), a warning should be issued. Most likely to be an error. On 06/21/2010 11:05 PM, yary wrote: War

Re: Something wrong with str.reverse

2010-06-21 Thread yary
Warning on using any list-y op on a scalar seems like a good idea, and the fact that the idea arose after a perl5 misunderstanding now looks like a "red herring". That is, while warning on "only" reverse-on-a-scalar may be a bad idea and perl5 specific, I'd vote for warning on all apparent mis-uses

Re: Something wrong with str.reverse

2010-06-21 Thread Jan Ingvoldstad
On Mon, Jun 21, 2010 at 10:47, Smylers wrote: > Larry Wall writes: > > > On Fri, Jun 18, 2010 at 11:21:52AM +0200, Jan Ingvoldstad wrote: > > > > : On Fri, Jun 18, 2010 at 11:15, Smylers wrote: > > : > > : > For the benefit of Perl 5 programmers used to string reverse it > > : > would be nice to

Re: Something wrong with str.reverse

2010-06-21 Thread Patrick R. Michaud
On Mon, Jun 21, 2010 at 09:47:37AM +0100, Smylers wrote: > Larry Wall writes: > > On Fri, Jun 18, 2010 at 11:21:52AM +0200, Jan Ingvoldstad wrote: > > : On Fri, Jun 18, 2010 at 11:15, Smylers wrote: > > : > > : > For the benefit of Perl 5 programmers used to string reverse it > > : > would be nic

Re: Something wrong with str.reverse

2010-06-21 Thread Smylers
Larry Wall writes: > On Fri, Jun 18, 2010 at 11:21:52AM +0200, Jan Ingvoldstad wrote: > > : On Fri, Jun 18, 2010 at 11:15, Smylers wrote: > : > : > For the benefit of Perl 5 programmers used to string reverse it > : > would be nice to have a warning if reverse is invoked with exactly > : > one

Re: Something wrong with str.reverse

2010-06-18 Thread Larry Wall
On Fri, Jun 18, 2010 at 11:21:52AM +0200, Jan Ingvoldstad wrote: : On Fri, Jun 18, 2010 at 11:15, Smylers wrote: : : > : > For the benefit of Perl 5 programmers used to string reverse it would be : > nice to have a warning if reverse is invoked with exactly one string : > argument (but not with a

Re: Something wrong with str.reverse

2010-06-18 Thread Jan Ingvoldstad
On Fri, Jun 18, 2010 at 11:15, Smylers wrote: > > For the benefit of Perl 5 programmers used to string reverse it would be > nice to have a warning if reverse is invoked with exactly one string > argument (but not with an array which happens to contain a string as its > only element). > Perhaps

Re: Something wrong with str.reverse

2010-06-18 Thread Smylers
Moritz Lenz writes: > Richard Hainsworth wrote: > > > I dont think the specification regarding 'reverse' has ever changed. > > Actually it has changed. ... In Perl we usually have one operator per > operation. ... reverse() violated that principle, by doing several > different operations dependi

Re: Something wrong with str.reverse

2010-06-18 Thread Moritz Lenz
Richard Hainsworth wrote: > I dont think the specification regarding 'reverse' has ever changed. Actually it has changed. If my memory serves me right, .flip is not older than one or many one and a half years. The story is rather simple: In Perl we usually have one operator per operation. For exa

Re: Something wrong with str.reverse

2010-06-17 Thread Hongwen Qiu
于 2010年06月18日 13:50, Richard Hainsworth 写道: 'flip' has more uses than just for strings. For example, it flips the key/value in a pair. Hence, my %h = Z 1,2,3,4; # a neat way of specifying a hash in terms of two lists say (map { .flip }, %h).perl; # the .perl gives you more information about

Re: Something wrong with str.reverse

2010-06-17 Thread Richard Hainsworth
I dont think the specification regarding 'reverse' has ever changed. 'flip' has more uses than just for strings. For example, it flips the key/value in a pair. Hence, my %h = Z 1,2,3,4; # a neat way of specifying a hash in terms of two lists say (map { .flip }, %h).perl; # the .perl gives yo

Re: Something wrong with str.reverse

2010-06-17 Thread Richard Hainsworth
Nothing wrong with 'reverse', its acting exactly as specified. 'reverse' changes the order of a list. A string is considered a single entity in perl(6), unlike other languages where a string is an array of characters. So in order to get 'reverse' to work on a string, it first needs to be tur

Re: Something wrong with str.reverse

2010-06-17 Thread Hongwen Qiu
于 2010年06月18日 13:32, Xi Yang 写道: > Thanks!So the API has changed permanently? I think so. The "reverse" is for arrays, and "flip" is for Strings.

RE: Something wrong with str.reverse

2010-06-17 Thread Xi Yang
Thanks!So the API has changed permanently? > Date: Fri, 18 Jun 2010 13:29:11 +0800 > From: qiuhong...@gmail.com > To: perl6-us...@perl.org > Subject: Re: Something wrong with str.reverse > > 于 2010年06月18日 13:25, Xi Yang 写道: > > I'm using rakudo 2010_05, w

Re: Something wrong with str.reverse

2010-06-17 Thread Hongwen Qiu
于 2010年06月18日 13:25, Xi Yang 写道: > I'm using rakudo 2010_05, with parrot 2.4.0. I found the $str.reverse just > don't work at all: > $ perl6 -e 'my $str="abcde"; say $str; say $str.reverse;'abcdeabcde Use say $str.flip;

Something wrong with str.reverse

2010-06-17 Thread Xi Yang
I'm using rakudo 2010_05, with parrot 2.4.0. I found the $str.reverse just don't work at all: $ perl6 -e 'my $str="abcde"; say $str; say $str.reverse;'abcdeabcde _ Hotmail: Powerful Free email