Re: $^a, $^b, and friends

2002-04-06 Thread Rafael Garcia-Suarez
Larry Wall wrote in perl.perl6.language : > > Such a grammar switching routine could operate either over a lexical > scope or over the rest of the file. The only restriction is that > one module not clobber the grammar of a different module. > > Basically, we're trying to make the opposite mist

Re: Tail Recursion optimization

2002-04-06 Thread Jonathan E. Paton
> : Piers Cawley writes: > : > : So, here I am working on a Scheme interpreter in Perl 6, and I'm > : trying to write it in a (for want of a better description) > : 'Scheme-like' fashion with lots of recursion. > : > : The trouble is, unless Perl6 is going to be guaranteed to do > : optimization

Re: Tail Recursion optimization

2002-04-06 Thread Piers Cawley
"Jonathan E. Paton" <[EMAIL PROTECTED]> writes: >> : Piers Cawley writes: >> : >> : So, here I am working on a Scheme interpreter in Perl 6, and I'm >> : trying to write it in a (for want of a better description) >> : 'Scheme-like' fashion with lots of recursion. >> : >> : The trouble is, unles

Re: Tail Recursion optimization

2002-04-06 Thread Jonathan E. Paton
> >> : Piers Cawley writes: > >> : ... > >> : The trouble is, unless Perl6 is going to be guaranteed to do > >> : optimization of tail calls, this is going to lead to horribly slow > >> : code. So, do I bite the bullet and recast some of the functions in an > >> : iterative vein, or do I trust t

Re: $^a, $^b, and friends

2002-04-06 Thread Dan Sugalski
At 2:34 PM -0700 4/5/02, Luke Palmer wrote: > > You can do anything you like if you mess with the parser. Changing >> the rules for recognizing an identifier would be trivial. > >Does this refer to messing with the parser... compile time (that is, when >Perl compiles, not when Perl is compiled)

Re: Tail Recursion optimization

2002-04-06 Thread Dan Sugalski
At 11:45 PM +0100 4/5/02, Piers Cawley wrote: >So, here I am working on a Scheme interpreter in Perl 6, and I'm >trying to write it in a (for want of a better description) >'Scheme-like' fashion with lots of recursion. > >The trouble is, unless Perl6 is going to be guaranteed to do >optimization o

Re: Questions about private variables

2002-04-06 Thread Larry Wall
Piers Cawley writes: : Um... there'd be a syntax error before that. "\\=" should be "//=" surely? The //= operator is spelled \\= on Windows. ;-) Larry

Re: $^a, $^b, and friends

2002-04-06 Thread Larry Wall
Rafael Garcia-Suarez writes: : Larry Wall wrote in perl.perl6.language : : > : > Such a grammar switching routine could operate either over a lexical : > scope or over the rest of the file. The only restriction is that : > one module not clobber the grammar of a different module. : > : > Basica

Re: Tail Recursion optimization

2002-04-06 Thread Larry Wall
=?iso-8859-1?q?Jonathan=20E.=20Paton?= writes: : > : Piers Cawley writes: : > : : > : So, here I am working on a Scheme interpreter in Perl 6, and I'm : > : trying to write it in a (for want of a better description) : > : 'Scheme-like' fashion with lots of recursion. : > : : > : The trouble is,

Re: Tail Recursion optimization

2002-04-06 Thread Larry Wall
=?iso-8859-1?q?Jonathan=20E.=20Paton?= writes: : Anything that touches string evaluation (Perl5's eval"") could harbour : caller(), this wouldn't matter unless there was a way to proprogate : exceptions out of an eval"" - and I bet someone already has the : appropriate RPC written. Well, eval pes

Re: Tail Recursion optimization

2002-04-06 Thread Piers Cawley
Dan Sugalski <[EMAIL PROTECTED]> writes: > At 11:45 PM +0100 4/5/02, Piers Cawley wrote: >>So, here I am working on a Scheme interpreter in Perl 6, and I'm >>trying to write it in a (for want of a better description) >>'Scheme-like' fashion with lots of recursion. >> >>The trouble is, unless Perl

Re: $^a, $^b, and friends

2002-04-06 Thread Piers Cawley
Larry Wall <[EMAIL PROTECTED]> writes: > Rafael Garcia-Suarez writes: > : Larry Wall wrote in perl.perl6.language : > : > > : > Such a grammar switching routine could operate either over a lexical > : > scope or over the rest of the file. The only restriction is that > : > one module not clobbe

Re: $^a, $^b, and friends

2002-04-06 Thread Larry Wall
Piers Cawley writes: : In a use.perl post not far away I sketched out something like the following: : : module foo is Mixin { : : sub category($category, &block) { : &block.abstract_syntax_tree.walk_with -> $node { : when AST::Method { : .attrib(cat

Re: $^a, $^b, and friends

2002-04-06 Thread Rafael Garcia-Suarez
Dan Sugalski wrote in perl.perl6.language : > > Don't forget, we already change parsing rules at compile time. Perl's > got three (maybe four) different sets of rules as it is: > >*) Normal perl >*) Regexes >*) Double-quoted strings >*) Single-quoted strings > > Adding another,

Re: $^a, $^b, and friends

2002-04-06 Thread Rafael Garcia-Suarez
Larry Wall wrote : > > It's not clear that the lexer is a separate entity any more. Lexers > were originally invented as a way of abstracting out part of the > grammar so that it could be done in a separate pass, and to simplify > the grammar for the poor overworked parser. Indeed. Another bene

Re: $^a, $^b, and friends

2002-04-06 Thread Piers Cawley
Larry Wall <[EMAIL PROTECTED]> writes: > Piers Cawley writes: > : In a use.perl post not far away I sketched out something like the following: > : > : module foo is Mixin { > : > : sub category($category, &block) { > : &block.abstract_syntax_tree.walk_with -> $node { > :

Re: Ex4 smart match question

2002-04-06 Thread Damian Conway
John A asked: > > This new turbo-charged 'smart match' operator will also work on arrays, > > hashes, and lists: > It's very cool--but why is it $key =~ %hash but $value =~ @array rather > than one way or the other? Because it's *both* ways. Perl 6's C<=~> operator is reversible. So you can

Re: classes, interfaces, properties and 'is'

2002-04-06 Thread Damian Conway
Melvin Smith wrote: > I see the potential for another Perl 'non-warning' bug, where > someone typed: > > class Appliance { > ...mucho lines of code... > } > > class Toaster is appliance { > ... > } That's probably an "Undefined property 'appliance' ascribed to class Toaster" error. > It sca

Re: Ex4 smart match question

2002-04-06 Thread Peter Scott
At 10:34 AM 4/7/02 +1000, Damian Conway wrote: > > It's very cool--but why is it $key =~ %hash but $value =~ @array rather > > than one way or the other? > >Because it's *both* ways. Perl 6's C<=~> operator is reversible. > >So you can write: > > $key =~ %hash > >or: > > %hash =~ $

Unary dot

2002-04-06 Thread Piers Cawley
Whilst I've been hacking the perl 6 scheme interpreter I've found myself using code like the following method get_token( $self: ) { given $self.get_char { when !defined { fail IOException: msg=> "EOF" } when /\s/ { $self.get_token } when '(' { $the_left_paren }