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
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
# 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
# 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
{
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
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
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
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 :
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
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
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
On Jun 27, 2015 8:05 PM, "Brent Laabs" wrote:
>
> http://design.perl6.org/S99.html#LTA
Ah, I almost guessed right!
Best,
-Tom
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
13 matches
Mail list logo