Re: One-pass parsing and forward type references

2010-02-01 Thread Jon Lang
Larry Wall wrote: > But also note that there are several other ways to predeclare > types implicitly.  The 'use', 'require', and 'need' declarations > all introduce a module name that is assumed to be a type name. Just to clarify: it's possible to define a module within a file, rather than as a fi

Re: One-pass parsing and forward type references

2010-02-01 Thread Larry Wall
On Tue, Feb 02, 2010 at 12:23:50AM +0100, Carl Mäsak wrote: : Another thing I started thinking about: if Perl 6 professes to be able : to put on the hat -- syntactically and semantically -- of most any : other programming language out there, through the use of a simple 'use : Language::Java' or 'us

Re: One-pass parsing and forward type references

2010-02-01 Thread Carl Mäsak
Larry (>): > [Long exposition on the philosophy of predeclaration] > > Hope this helps, or I just wasted a lot of time.  :-) It did help. Thanks. A comment on one part, though: > But I also think that type recursion is likelier to indicate a design > error than function recursion [...] I do too

Re: One-pass parsing and forward type references

2010-02-01 Thread Larry Wall
On Mon, Feb 01, 2010 at 03:55:15PM -0500, Solomon Foster wrote: : On Mon, Feb 1, 2010 at 3:46 PM, Patrick R. Michaud wrote: : > On Mon, Feb 01, 2010 at 05:55:47PM +0100, Carl Mäsak wrote: : >> Is it allowed to do 'class B { ... }' several times in different files : >> before finally declaring the

Re: One-pass parsing and forward type references

2010-02-01 Thread Patrick R. Michaud
On Mon, Feb 01, 2010 at 05:56:09PM +0100, Jan Ingvoldstad wrote: > On Mon, Feb 1, 2010 at 17:46, Patrick R. Michaud wrote: > > There's a third way: > > > >class B { ... }# introduce B as a class name without definition > > class A { sub foo { B::bar } } > > > >class B { sub bar { A

Re: One-pass parsing and forward type references

2010-02-01 Thread Solomon Foster
On Mon, Feb 1, 2010 at 3:46 PM, Patrick R. Michaud wrote: > On Mon, Feb 01, 2010 at 05:55:47PM +0100, Carl Mäsak wrote: >> Is it allowed to do 'class B { ... }' several times in different files >> before finally declaring the real B? If so, then I'd consider it >> equivalent to my proposed keyword

Re: One-pass parsing and forward type references

2010-02-01 Thread Patrick R. Michaud
On Mon, Feb 01, 2010 at 05:55:47PM +0100, Carl Mäsak wrote: > Is it allowed to do 'class B { ... }' several times in different files > before finally declaring the real B? If so, then I'd consider it > equivalent to my proposed keyword, and thus there'd be no need for the > latter. Yes. And "decl

r29605 - docs/Perl6/Spec

2010-02-01 Thread pugs-commits
Author: lwall Date: 2010-02-01 21:33:47 +0100 (Mon, 01 Feb 2010) New Revision: 29605 Modified: docs/Perl6/Spec/S02-bits.pod docs/Perl6/Spec/S03-operators.pod docs/Perl6/Spec/S04-control.pod Log: [S02,S03,S04] more @@ removal; some s/Capture/Parcel/ cleanup Modified: docs/Perl6/Spec/S02-

r29604 - docs/Perl6/Spec

2010-02-01 Thread pugs-commits
Author: lwall Date: 2010-02-01 21:14:16 +0100 (Mon, 01 Feb 2010) New Revision: 29604 Modified: docs/Perl6/Spec/S02-bits.pod docs/Perl6/Spec/S06-routines.pod Log: [S02,S06] continue de-confusing flat and eager Modified: docs/Perl6/Spec/S02-bits.pod ==

Re: One-pass parsing and forward type references

2010-02-01 Thread Larry Wall
On Mon, Feb 01, 2010 at 10:10:11AM -0800, yary wrote: : A slight digression on a point of fact- : : On Mon, Feb 1, 2010 at 9:32 AM, Larry Wall wrote: : ... : > You are correct that the one-pass parsing is non-negotiable; this is : > how humans think, even when dealing with unknown names. : : It'

Re: One-pass parsing and forward type references

2010-02-01 Thread yary
A slight digression on a point of fact- On Mon, Feb 1, 2010 at 9:32 AM, Larry Wall wrote: ... > You are correct that the one-pass parsing is non-negotiable; this is > how humans think, even when dealing with unknown names. It's common for people to read a passage twice when encountering somethin

Re: One-pass parsing and forward type references

2010-02-01 Thread Matthew Wilson
On Mon, Feb 1, 2010 at 9:32 AM, Larry Wall wrote: > But I also think that type recursion is likelier to indicate a design > error than function recursion, so I'm not sure how far down this road > we want to go.  We could, for instance, create a new type name every I was going to say "I use self-r

Re: One-pass parsing and forward type references

2010-02-01 Thread Larry Wall
Please don't assume that rakudo's idiosyncracies and design fossils are canonical. STD does better namespace management in some respects, particularly in accepting the approved predeclaration form: class Foo {...} (and rakudo might now accept this too). You don't want to use augment for thi

Announce: Rakudo Perl 6 Development Release #25 ("Minneapolis")

2010-02-01 Thread Patrick R. Michaud
[This notice is going out a bit late; the release was indeed produced on time, but I was delayed in sending out this notice. With apologies for the delay... --Pm] On behalf of the Rakudo development team, I'm pleased to announce the January 2010 development release of Rakudo Perl #25 "Minneapolis

Re: One-pass parsing and forward type references

2010-02-01 Thread Jan Ingvoldstad
On Mon, Feb 1, 2010 at 17:46, Patrick R. Michaud wrote: > There's a third way: > >class B { ... }# introduce B as a class name without definition > class A { sub foo { B::bar } } > >class B { sub bar { A::foo } } > > The first line is a literal "..." in the body of the class -- it

Re: One-pass parsing and forward type references

2010-02-01 Thread Carl Mäsak
Patrick (>), Carl (>>): >> I found two ways. Either one uses C (the language construct >> formerly known as C): >> >>   class B {} >>   class A { sub foo { B::bar } } >>   augment class B { sub bar { A::foo } } >> >> ...or one may use the C<::> notation to index a type using a string value: >> >>  

Re: One-pass parsing and forward type references

2010-02-01 Thread Patrick R. Michaud
On Sun, Jan 31, 2010 at 06:35:14PM +0100, Carl Mäsak wrote: > I found two ways. Either one uses C (the language construct > formerly known as C): > > class B {} > class A { sub foo { B::bar } } > augment class B { sub bar { A::foo } } > > ...or one may use the C<::> notation to index a type

Re: One-pass parsing and forward type references

2010-02-01 Thread Carl Mäsak
Moritz (>), Carl (>>): >> But on another level, the level of types, Perl 6 makes it fairly >> *un*natural that the type C refers to the type C, which in >> turn refers to the type C. > > True, and that has also been bothering me quite a bit. > > The "solution" is to always write ::Typename instead

Re: One-pass parsing and forward type references

2010-02-01 Thread Moritz Lenz
Carl Mäsak wrote: > But on another level, the level of types, Perl 6 makes it fairly > *un*natural that the type C refers to the type C, which in > turn refers to the type C. True, and that has also been bothering me quite a bit. The "solution" is to always write ::Typename instead of Typename...