Re: A few questions

2009-07-12 Thread Moritz Lenz
Minimiscience wrote: > I tried to find the answers to these in the Synopses, but I couldn't. > Plan B is to ask the mailing list. > > - What does the "first" method/subroutine return when no elements of > the list match? Does it return the empty list? Does the return value > count as un

Re: A few questions

2009-07-12 Thread yary
On Sun, Jul 12, 2009 at 9:29 AM, Minimiscience wrote: > On Jul 12, 2009, at 12:07 AM, Chas. Owens wrote: >> >> Since grep is defined as returning a list of matching elements and first >> is >> defined as being the same as grep, I would say that it returns an empty >> list >> if nothing matches.  Th

Re: A few questions

2009-07-12 Thread Minimiscience
On Jul 12, 2009, at 9:46 AM, Patrick R. Michaud wrote: ".?method" seems to work for me in Rakudo: $ cat x my $x = undef; say ($x.?foo).perl; $ ./perl6 x undef This doesn't work when the variable is assigned to a typed container: #!/usr/bin/env perl6 use v6; my Str

Re: A few questions

2009-07-12 Thread Minimiscience
On Jul 12, 2009, at 12:07 AM, Chas. Owens wrote: Since grep is defined as returning a list of matching elements and first is defined as being the same as grep, I would say that it returns an empty list if nothing matches. The empty list is one of the false values. Does the empty list count

Re: A few questions

2009-07-12 Thread Patrick R. Michaud
On Sun, Jul 12, 2009 at 12:07:14AM -0400, Chas. Owens wrote: > On Sat, Jul 11, 2009 at 22:02, Minimiscience wrote: > >  - How does one declare multiple variables of the same type with a single > > "my" statement?  Is it "my Int ($x, $y);", "my(Int $x, Int $y);", or > > something else?  Are the pare

Re: A few questions

2009-07-11 Thread Chas. Owens
On Sat, Jul 11, 2009 at 22:02, Minimiscience wrote: > I tried to find the answers to these in the Synopses, but I couldn't.  Plan > B is to ask the mailing list. > >  - What does the "first" method/subroutine return when no elements of the > list match?  Does it return the empty list?  Does the ret