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
> : 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
"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
> >> : 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
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)
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
Piers Cawley writes:
: Um... there'd be a syntax error before that. "\\=" should be "//=" surely?
The //= operator is spelled \\= on Windows.
;-)
Larry
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
=?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,
=?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
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
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
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
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,
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
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 {
> :
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
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
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 =~ $
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 }
20 matches
Mail list logo