Re: cross operator and empty list

2008-04-12 Thread Moritz Lenz
[EMAIL PROTECTED] wrote: > Technically the Cartesian cross operator doesn't have an identity value. It has. The set which contains only the emty set, or in perl terms ([]); Or am I missing something? Cheers, Moritz -- Moritz Lenz http://moritz.faui2k3.org/ | http://perl-6.de/ signature.asc

Re: slurpy scalar parameter?

2008-04-12 Thread Larry Wall
On Sat, Apr 12, 2008 at 02:10:48AM -0400, Ryan Richter wrote: : On Sat, Apr 12, 2008 at 05:06:53AM -, John M. Dlugosz wrote: : > What is the difference between: : > : > sub head(*$head, [EMAIL PROTECTED]) : > : > and : > : > sub head($head?, [EMAIL PROTECTED]) : > : : If you call head(@f

Re: quick ones on subs

2008-04-12 Thread Larry Wall
On Sat, Apr 12, 2008 at 04:58:57AM -, John M. Dlugosz wrote: : In S06, a wrong word: : : "Alternately, optional fields may be marked by supplying a default value. " : should be parameters, not fields. : : Now here is my question: : Params are bound in declaration order, not call order, and ma

Re: What is the "self pragma"?

2008-04-12 Thread Larry Wall
On Sat, Apr 12, 2008 at 04:49:39AM -, John M. Dlugosz wrote: : In S06, "A method's invocant always has the alias self. Other styles of self can be declared with the self pragma." : : What is the self pragma, and what are other styles of self, prey tell? Seemingly a placeholder for future gen

Re: Symbolic references and OUTER

2008-04-12 Thread Larry Wall
On Fri, Apr 11, 2008 at 05:08:58PM -0400, Bob Rogers wrote: : I don't see that this is any harder; unless I'm misunderstanding you, : this is just another normal closure usage case. The OUTER scope is : always the one defined by outersub, no matter how many calls back in the : dynamic chain it mig

Re: What is the "self pragma"?

2008-04-12 Thread Juerd Waalboer
Larry Wall skribis 2008-04-12 9:26 (-0700): > Now that people have gotten used to self.foo and $.foo, it may be > that the demand for the pragma has fallen off a bit... :) I hope it has. Perl 6 would be less confusing without this pragma. -- Met vriendelijke groet, Kind regards, Korajn saluto

Re: What is the "self pragma"?

2008-04-12 Thread Mark J. Reed
On Sat, Apr 12, 2008 at 2:18 PM, Juerd Waalboer <[EMAIL PROTECTED]> wrote: > Larry Wall skribis 2008-04-12 9:26 (-0700): > > > Now that people have gotten used to self.foo and $.foo, it may be > > that the demand for the pragma has fallen off a bit... :) > > I hope it has. Perl 6 would be less

Question (mistake?) in S06 "Multidimensional argument list binding"

2008-04-12 Thread John M. Dlugosz
The section contrasts sub foo (*@@slice) { ... } sub foo (\$slice) { ... } but he latter is never explained anywhere. Did you mean to use | instead of \ in that section? If not, what am I missing?

Re: quick ones on subs

2008-04-12 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: What gives (in the sense of breaking) is the notion that you can do multiple dispatch on randomly ordered arguments. That's the main reason we invented proto multis, so that the compiler can rearrange supposedly randomly ordered arguments into positio

Help understanding syntax in S06 "Unpacking tree node parameters"

2008-04-12 Thread John M. Dlugosz
multi traverse ( NAry $top ( :kids [$eldest, [EMAIL PROTECTED] ) ) { The inner signature is :( :kids [$eldest, [EMAIL PROTECTED] ) This starts out like a named-only parameter, :xx or :xx($yy) but then there is a space and an array. :xx @yy I don't follow that.

Clarify "Design by Contract"

2008-04-12 Thread John M. Dlugosz
PRE/POST on methods: " When applied to a method, the semantics provide support for the "Design by Contract" style of OO programming: a precondition of a particular method is met if all the PRE blocks associated with that method return true. Otherwise, the precondition is met if all of the paren

Re: quick ones on subs

2008-04-12 Thread Larry Wall
On Sat, Apr 12, 2008 at 08:00:19PM -0500, John M. Dlugosz wrote: > Larry Wall larry-at-wall.org |Perl 6| wrote: >> What gives (in the sense of breaking) is the notion that you can do >> multiple dispatch on randomly ordered arguments. That's the main >> reason we invented proto multis, so that the

Q on function returning

2008-04-12 Thread John M. Dlugosz
In S06, it is explained how the parameter list to 'return' is preserved as a Capture. So, what is the role of the inner and outer return types that are declared on the function?

'returns' vs 'of'

2008-04-12 Thread John M. Dlugosz
I don't like the assignments of 'returns' and 'of'. I think it is easily confused. I've written foo (Int $x) returns Int in examples and nobody noticed. As formal documentation, that scans right as the outer perceived return value type. But no, it's supposed to be foo (Int $x) of Int inst

Idea: infir types of constants

2008-04-12 Thread John M. Dlugosz
Just surfing, I noticed something about the "D" programming language: " The types of constants need not be specified explicitly as the compiler infers their types from the right-hand sides of assignments. const fact_7 = Factorial!(7); " Now in