Re: Types for Perl 6: request for comments

2015-06-27 Thread Brent Laabs
On Fri, Jun 26, 2015 at 4:32 AM, Giuseppe Castagna < g...@pps.univ-paris-diderot.fr> wrote: > > >> my $sub = do { >> proto foo (|) { * } >> multi foo (Int $x) { $x + 1 } >> multi foo (Str $y) { $y ~ 'a' } >> >> &foo; >> } >> > > Oh yes, nice ... I think I will add it in my paper (a

Re: [perl #125486] Autogenerated signature does not set multi-invocant bit

2015-06-27 Thread Elizabeth Mattijsen
Fixed with 1a743f9d756a314143 > On 25 Jun 2015, at 14:23, Elizabeth Mattijsen (via RT) > wrote: > > # New Ticket Created by Elizabeth Mattijsen > # Please include the string: [perl #125486] > # in the subject line of all future correspondence about this issue. > # https://rt.perl.org/Ticket

[perl #125494] compiler fails silently at this file

2015-06-27 Thread via RT
# New Ticket Created by equinox # Please include the string: [perl #125494] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=125494 > Hi, see https://gist.github.com/jaffa4/11847e6d373f9ddfba34 Execute it perl6-m.bat Long.p

[perl #125495] Missing file/line information

2015-06-27 Thread via RT
# New Ticket Created by # Please include the string: [perl #125495] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=125495 > No file/line information given for this obsoletion warning: --cut here-- class Test::More {

Re: [perl #125495] Missing file/line information

2015-06-27 Thread Elizabeth Mattijsen
Fixed by bbe2ffa17698594c6cf76f > On 27 Jun 2015, at 21:49, (via RT) wrote: > > # New Ticket Created by > # Please include the string: [perl #125495] > # in the subject line of all future correspondence about this issue. > # https://rt.perl.org/Ticket/Display.html?id=125495 > > > > No fil

Sub args: choose one of two?

2015-06-27 Thread Tom Browder
I'm trying to take advantage of the MAIN suroutine to handle most all of my routine command line arg handling. One idiom I use a lot is for the user to choose only one of two args, but one must be chosen. Reading S06, I don't yet see a way to do that without dropping back to handling the @*ARGV a

Re: Types for Perl 6: request for comments

2015-06-27 Thread yary
These two variations on Brent's work the same as the original- what subtle differences happen by adding "anon" or "my" to the declarations? my $sub_anon = do { anon proto foo (|) { * } multi foo (Int $x) { $x + 1 } multi foo (Str $y) { $y ~ 'a' } &foo; } my $sub_my = do { my

Re: Sub args: choose one of two?

2015-06-27 Thread yary
This "sort of" works, in that it does the right thing when you give one correct arg, and fails when you give neither arg or both args. The error message is good when you give both args, but LTA with no args. # Require either named arg "need" or named arg "hope", but not both multi sub MAIN (Int :

Re: Sub args: choose one of two?

2015-06-27 Thread Tom Browder
On Jun 27, 2015 7:39 PM, "yary" wrote: > > This "sort of" works, in that it does the right thing when you give one > correct arg, and fails when you give neither arg or both args. The error > message is good when you give both args, but LTA with no args. Thanks, Yary, Good use of multi which I pa

Re: Types for Perl 6: request for comments

2015-06-27 Thread Brent Laabs
Subs are lexical by default, so adding my to the function declarators does nothing. Not sure what anon is doing there. My guess is that anon in sink context does nothing, and Rakudo just builds another proto for foo when it sees the first multi. Protos are optional (but not in the compiler itsel

Re: Sub args: choose one of two?

2015-06-27 Thread Brent Laabs
http://design.perl6.org/S99.html#LTA On Sat, Jun 27, 2015 at 5:57 PM, Tom Browder wrote: > On Jun 27, 2015 7:39 PM, "yary" wrote: > > > > This "sort of" works, in that it does the right thing when you give one > > correct arg, and fails when you give neither arg or both args. The error > > mess

Re: Sub args: choose one of two?

2015-06-27 Thread Tom Browder
On Jun 27, 2015 8:05 PM, "Brent Laabs" wrote: > > http://design.perl6.org/S99.html#LTA Ah, I almost guessed right! Best, -Tom

Re: Types for Perl 6: request for comments

2015-06-27 Thread yary
The anon does something. For example this code prints "bob" my $routine = proto bar (|) { * }; multi bar (Int $x) { $x - 2 } multi bar (Str $y) { $y ~ 'b' } say $routine('bo'); but change the first line to "my $routine = anon proto bar (|) { * };" and you get an error Cannot call 'bar'; none of