accepting values on the command line

2017-07-01 Thread Gabor Szabo
I was hoping to wrote a simple script that would accept a bunch of filenames on the command line so I wrote: #!/usr/bin/env perl6 use v6; multi sub MAIN(@files) { say @files.perl; } $ perl6 code.pl6 Usage: code.pl6 $ perl6 code.pl6 abc Usage: code.pl6 $ perl6 code.pl6 abc def Usag

[perl #131684] Iterator and Supply might fail early if Nil is sent on a channel

2017-07-01 Thread via RT
# New Ticket Created by Jan-Olof Hendig # Please include the string: [perl #131684] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=131684 > This is a vulnerability and should probably be fixed. Discussion here: https://irclog

Re: accepting values on the command line

2017-07-01 Thread Elizabeth Mattijsen
> On 1 Jul 2017, at 15:15, Gabor Szabo wrote: > > I was hoping to wrote a simple script that would accept a bunch of > filenames on the command line so I wrote: > > #!/usr/bin/env perl6 > use v6; > > multi sub MAIN(@files) { >say @files.perl; > } This signature will only accept an Iterabl

[perl #131686] [BUG] [X] @list-of-lists misbehaves with list of one list

2017-07-01 Thread via RT
# New Ticket Created by Michael Schaap # Please include the string: [perl #131686] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=131686 > This is OK: > say [X] ((1,2,3), (4,5,6)); ((1 4) (1 5) (1 6) (2 4) (2 5) (2 6) (3 4)

[perl #131686] [BUG] [X] @list-of-lists misbehaves with list of one list

2017-07-01 Thread Aleks-Daniel Jakimenko-Aleksejev via RT
I think this is related: https://github.com/perl6/doc/issues/1400 On 2017-07-01 12:25:39, pe...@mscha.org wrote: > This is OK: > > > say [X] ((1,2,3), (4,5,6)); > ((1 4) (1 5) (1 6) (2 4) (2 5) (2 6) (3 4) (3 5) (3 6)) > > say [X*] ((1,2,3), (4,5,6)); > (4 5 6 8 10 12 12 15 18) > > ... but this is

Re: [perl #131686] [BUG] [X] @list-of-lists misbehaves with list of one list

2017-07-01 Thread Michael Schaap
That may indeed explain why it works the way it does, but that doesn't mean it isn't a bug. IMO it certainly is; [X] and [X*] don't work as advertised. Let me explain how I found this bug. I'm generating a list of divisors for a number. I already have the prime factorization of that number,

Re: [perl #131686] [BUG] [X] @list-of-lists misbehaves with list of one list

2017-07-01 Thread Michael Schaap via RT
That may indeed explain why it works the way it does, but that doesn't mean it isn't a bug. IMO it certainly is; [X] and [X*] don't work as advertised. Let me explain how I found this bug. I'm generating a list of divisors for a number. I already have the prime factorization of that number, a

[perl #131686] [BUG] [X] @list-of-lists misbehaves with list of one list

2017-07-01 Thread Aleks-Daniel Jakimenko-Aleksejev via RT
I'd agree that it is a bug, yes. Well, the reason why it happens might be justified, but this is probably one of the fattest traps I've seen so far. I really think we should come up with a way to eliminate this trap somehow. Not sure how, but there must be a way and I really recommend anybody readi

Re: accepting values on the command line

2017-07-01 Thread Gabor Szabo
On Sat, Jul 1, 2017 at 4:30 PM, Elizabeth Mattijsen wrote: > >> On 1 Jul 2017, at 15:15, Gabor Szabo wrote: >> >> I was hoping to wrote a simple script that would accept a bunch of >> filenames on the command line so I wrote: >> >> #!/usr/bin/env perl6 >> use v6; >> >> multi sub MAIN(@files) { >>