Re: LangSpec: Statements and Blocks

2001-09-05 Thread Bryan C . Warnock
It's still largely incomplete, and getting a little weighty, so v.2 is up on my web page: http://members.home.net/bcwarno/Perl6/ref/statements.txt I'm sure I didn't cover all the corrections from the first go round, so if I missed anything, gently poke me in the side. What's been added? B

Re: Labels

2001-09-05 Thread Michael G Schwern
On Wed, Sep 05, 2001 at 09:02:00PM -0400, Bryan C. Warnock wrote: > Hmm is this such a good thing? Using goto LABEL? No. ;) Would be nice if Perl warned one about multiple labels of the same name in the same call stack, though. > my $a = 0; > GORK: while( 1 ) { > print "Rin ";

Labels

2001-09-05 Thread Bryan C . Warnock
Hmm is this such a good thing? my $a = 0; GORK: while( 1 ) { print "Rin "; GORK: if ( 1 ) { print "Tin "; goto GORK if $b ^= 1; print "\n"; next GORK; } } -- Bryan C. Warnock [EMAIL PROTECTED]

Re: CLOS multiple dispatch

2001-09-05 Thread David L. Nicol
Dan Sugalski wrote: [... massive sniping snippage ...] > The problem I was talking about was those cases where we have a good but > not perfect match at compile time. In the case you gave, we assume that @A > are full of fish, so dispatch to the "multiple fish parameter" version of > list_medica

Re: An overview of the Parrot interpreter

2001-09-05 Thread Piers Cawley
Dan Sugalski <[EMAIL PROTECTED]> writes: > At 10:32 AM 9/4/2001 +0100, Piers Cawley wrote: > > > * Methods get their parameters passed in as a list in PMC register 0, > > > * unless we can unambiguously figure out their prototype at > > > * compilation time > > > >Will the subroutine know how it

RE: An overview of the Parrot interpreter

2001-09-05 Thread Dan Sugalski
At 11:17 AM 9/5/2001 -0700, Hong Zhang wrote: >Howerver, I like to point out one hidden overhead of register opcode is >decoding the parameter. The add instrction of stack machine does not have >args, but for register machine, it has 3 arguments. I skipped the decoding step in the machine design

RE: An overview of the Parrot interpreter

2001-09-05 Thread Hong Zhang
> If you really want a comparison, here's one. Take this loop: > > i = 0; > while (i < 1000) { >i = i + 7; > } > > with the ops executed in the loop marked with pipes. The corresponding > parrot code would be: > > getaddr P0, i > store P0, 0 >

RE: An overview of the Parrot interpreter

2001-09-05 Thread Hong Zhang
> True, but it is easier to generate FAST code for a register machine. > A stack machine forces a lot of book-keeping either run-time inc/dec of sp, > or alternatively compile-time what-is-offset-now stuff. The latter is a real > pain if you are trying to issue multiple instructions at once. I

Re: An overview of the Parrot interpreter

2001-09-05 Thread Dan Sugalski
[I'm answering these out of order--sorry. Already answered elsewhere bits snipped] At 02:28 PM 9/5/2001 +0200, Paolo Molaro wrote: >On 09/04/01 Dan Sugalski wrote: > > > More on this point later in the mail. > > >There's a reason for that: register virtual machines are more complex > > >and more

Re: An overview of the Parrot interpreter

2001-09-05 Thread Uri Guttman
> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes: >> stack machine -> post-order walk of the tree >> >> reg machine -> instruction selection -> register allocation -> DS> So what? That happens exactly once, in the compilation phase. Yes, it means DS> compilation will be somewhat

Re: What's up with %MY?

2001-09-05 Thread Ken Fox
[EMAIL PROTECTED] wrote: > Clearly caller() isn't what we want here, but I'm not > quite sure what would be the correct incantation. I've always assumed that a BEGIN block's caller() will be the compiler. This makes it easy for the compiler to lie about %MY:: and use the lexical scope being compi

Re: An overview of the Parrot interpreter

2001-09-05 Thread Dan Sugalski
At 03:19 PM 9/5/2001 +0200, Paolo Molaro wrote: >On 09/04/01 Uri Guttman wrote: > > does it really matter about comprehension? this is not going to be used > > by the unwashed masses. a stack machine is easier to describe (hence all > > the freshman CS projects :), but as dan has said, there isn't

RE: What's up with %MY?

2001-09-05 Thread Dave Mitchell
Dan Sugalski <[EMAIL PROTECTED]> wrote > >my $x = 1; > >{ > > my $x = 2; > > delete $MY::{'$x'}; > > print $x; > > $mysub = sub {$x}; > >} > > > >print $mysub->(); > > > >People seem agreed that print $x should do the equivalent of > > throw "lexical '$x' no longer in scope

RE: What's up with %MY?

2001-09-05 Thread Dan Sugalski
At 01:45 PM 9/5/2001 +0100, Dave Mitchell wrote: >can I just clarify something about delete: > >my $x = 1; >{ > my $x = 2; > delete $MY::{'$x'}; > print $x; > $mysub = sub {$x}; >} > >print $mysub->(); > >People seem agreed that print $x should do the equivalent of > throw

Re: An overview of the Parrot interpreter

2001-09-05 Thread Paolo Molaro
On 09/04/01 Uri Guttman wrote: > does it really matter about comprehension? this is not going to be used > by the unwashed masses. a stack machine is easier to describe (hence all > the freshman CS projects :), but as dan has said, there isn't much > mental difference if you have done any serious

RE: What's up with %MY?

2001-09-05 Thread Dave Mitchell
can I just clarify something about delete: my $x = 1; { my $x = 2; delete $MY::{'$x'}; print $x; $mysub = sub {$x}; } print $mysub->(); People seem agreed that print $x should do the equivalent of throw "lexical '$x' no longer in scope" rather than printing 1, but what s

RE: What's up with %MY?

2001-09-05 Thread Dave Mitchell
Garrett Goebel <[EMAIL PROTECTED]> wrote > From: Dave Mitchell [mailto:[EMAIL PROTECTED]] > > sub Foo::import { > > my %m = caller(1).{MY}; # or whatever > > %m{'$x'} = 1; > > } ... > > sub f { > > my $x = 9; > > use Foo; # does $x become 1, or $x redefined, or runtime > >

Re: An overview of the Parrot interpreter

2001-09-05 Thread Paolo Molaro
On 09/04/01 Dan Sugalski wrote: > Regardless, it's the way we're going to go for now. If it turns out to be a > performance dog then we'll go with a stack-based system. Initial > indications look pretty good, though. Care to share some numbers/code for that? > >You're right that optimization r

Re: debugger API PDD, v1.1

2001-09-05 Thread Simon Cozens
On Wed, Sep 05, 2001 at 08:32:36PM +1000, Rick Welykochy wrote: > Dave Storrs wrote: > [schnippe] > > =head3 Generating Code on the Fly > > What's this =head3 stuff? My pod processor barfs on it :) Then update it. :)

Re: debugger API PDD, v1.1

2001-09-05 Thread Rick Welykochy
Dave Storrs wrote: [schnippe] > =head3 Generating Code on the Fly What's this =head3 stuff? My pod processor barfs on it :) > Aye, here's the rub. _ Rick Welykochy || Praxis Services Pty Limited "One of the main advantages of the 'dot-bomb' downtur

Re: What's up with %MY?

2001-09-05 Thread Robin Houston
Ken Fox wrote: > Modifying the caller's environment: > > $lexscope = caller().{MY}; > $lexscope{'&die'} = &die_hard; > > is especially annoying because it means that I can't > trust lexical variables anymore. You think you can trust them now? :-) The PadWalker module (on CPAN) allows a su