Is there a way to bulky feed?

2009-07-09 Thread Xiao Yafeng
My question is: could I write below code in perl6: my @a = <1 2 3 4>; my @b[2]; for @a -> @b {;} # 2 loops like for @a -> $b[0],$b[1]{;} my @a = <1 2 3 4>; my @b; for @a -> @b {;} # 1 loop

Re: Is there a way to bulky feed?

2009-07-09 Thread yary
On Wed, Jul 8, 2009 at 8:45 PM, Xiao Yafeng wrote: > Any thoughts? > First let's fix the whitespace in your post so it's easier to read- My question is: could I write below code in perl6: # 2 loops like for @a -> $b[0],$b[1] {;} my @a = <1 2 3 4>; my @b[2]; for @a ->@b {;} my @a = <1 2 3 4>;

Re-thinking file test operations

2009-07-09 Thread Moritz Lenz
Hi, Somehow the current file test syntax, 'filename' ~~ :e, looks like a not well-though-out translation of Perl 5's syntax, -e 'filename'. Apart from totally feeling wrong to me, there are a few points I can put my finger on: 1) $file ~~ :s returns a number, although smartmatching usually retur

Re: Re-thinking file test operations

2009-07-09 Thread Aristotle Pagaltzis
* Moritz Lenz [2009-07-10 00:25]: > stat($str, :e)# let multi dispatch handle it for us This gets my vote. -- Aristotle Pagaltzis //

Re: Re-thinking file test operations

2009-07-09 Thread Mark J. Reed
A few months ago (or maybe more) I proposed making pathnames their own type, distinct from (or perhas a subclass of) strings, but easily constructed from strings, maybe with an operator. Having those 29 single-letter methods on such a class would not bug me as much as having them on Str. On 7/9/0

Re: Re-thinking file test operations

2009-07-09 Thread Darren Duncan
Mark J. Reed wrote: A few months ago (or maybe more) I proposed making pathnames their own type, distinct from (or perhas a subclass of) strings, but easily constructed from strings, maybe with an operator. Having those 29 single-letter methods on such a class would not bug me as much as having

Re: Re-thinking file test operations

2009-07-09 Thread Brandon S. Allbery KF8NH
On Jul 9, 2009, at 18:22 , Moritz Lenz wrote: Somehow the current file test syntax, 'filename' ~~ :e, looks like a not well-though-out translation of Perl 5's syntax, -e 'filename'. That would be because it is; originally the filetests were perl5- style, but pugs refused to parse them becaus

Re-thinking file test operations

2009-07-09 Thread Buddha Buck
Resent to list as I intended to in the first place On Thu, Jul 9, 2009 at 9:32 PM, Darren Duncan wrote: > Mark J. Reed wrote: >> >> A few months ago (or maybe more) I proposed making pathnames their own >> type, distinct from (or perhas a subclass of) strings, but easily >> constructed from st

Re: Re-thinking file test operations

2009-07-09 Thread Darren Duncan
Buddha Buck wrote: On Thu, Jul 9, 2009 at 9:32 PM, Darren Duncan wrote: Mark J. Reed wrote: A few months ago (or maybe more) I proposed making pathnames their own type, distinct from (or perhas a subclass of) strings, but easily constructed from strings, maybe with an operator. Having those 29

Re: Re-thinking file test operations

2009-07-09 Thread Timothy S. Nelson
On Thu, 9 Jul 2009, Mark J. Reed wrote: A few months ago (or maybe more) I proposed making pathnames their own type, distinct from (or perhas a subclass of) strings, but easily constructed from strings, maybe with an operator. Having those 29 single-letter methods on such a class would not bug