Re: Computed-goto Patch

2002-03-27 Thread Melvin Smith
At 03:16 AM 3/27/2002 -0500, Michel J Lambert wrote: Doh, sorry about that. If it makes you feel any better (or worse), I was in the midst of writing up the email for fixing the pushp bug you mentioned, when up pops '[PATCH] Stack fix' in my email inbox, turning my local bug fix into a nice

Re: [PATCH] Stack bugfix

2002-03-27 Thread Melvin Smith
At 09:47 AM 3/27/2002 +0200, Peter Gibbs wrote: - Original Message - From: Melvin Smith [EMAIL PROTECTED] ../parrot reverse.pbc string.c file prints out pre-reverse call recurse depth 0 Segmentation fault (core dumped) This seems to caused by a nice timing problem - the

Re: Computed-goto Patch

2002-03-27 Thread Simon Cozens
Melvin Smith: Simon is on vacation and may or may not be doing anything with assembler, keyed aggregate, etc. I'm not on vacation yet. :) I'm not doing any more work on the assembler, but I'm leaving it to Jeff to decide whether or not to apply it. I think packfile.c will need updating when/if

Re: Topicalizers: Why does when's EXPR pay attention to topicalizer r egardless of associated variable?

2002-03-27 Thread Aaron Sherman
On Tue, 2002-03-26 at 13:19, Larry Wall wrote: Aaron Sherman writes: : Ok, so am I to take it that you could say: : : FOO: for x { : BAR: for y { : print $FOO::_; : } : } Er, I don't think so. : Or is OUTER a special-case label? It's a special case like MY::, and

Re: Perl6 Macros

2002-03-27 Thread Aaron Sherman
On Tue, 2002-03-26 at 16:26, Michel J Lambert wrote: An example of where variable capture is needed is: macro println ($a) { return EOF; print $a; print \n; EOF } for my $b (1..100) { println $b; } Ok, I don't get it. I'm willing to concede that I'm dense, but I need to

Re: Computed-goto Patch

2002-03-27 Thread Jason Gloudon
On Wed, Mar 27, 2002 at 02:55:59AM -0500, Michel J Lambert wrote: Attached is a patch to implement computed-goto on gcc, taken from the original post by Daniel Grunblatt: http:[EMAIL PROTECTED]/msg06255.html The patch is slightly broken, core_cg_ops.h in interpreter.c versus core_ops_cg.h

Re: Topicalizers: Why does when's EXPR pay attention to topicaliz er r egardless of associated variable?

2002-03-27 Thread Larry Wall
Aaron Sherman writes: : Here's an example syntax: : : FOO: for x { : BAR: for y { : my $foo_under FOO:= $_; : print $_, $foo_under; : } : } I think if we have to go through contortions to get at the outer topic by name, it's better to just name the variable on the outer loop in the

Re: Topicalizers: Why does when's EXPR pay attention to topicaliz er r egardless of associated variable?

2002-03-27 Thread Eric Roode
Larry Wall writes: I think if we have to go through contortions to get at the outer topic by name, it's better to just name the variable on the outer loop in the first place. Adding - $varname to the outer loop is safe, because it doesn't change the semantics of topicality--now that we

Re: Perl6 Macros

2002-03-27 Thread Dan Sugalski
At 10:27 AM -0500 3/27/02, Aaron Sherman wrote: I *can* see some advantage in: macro mygrep ($code is macroblock, *@list) { my @newlist = (); for @list { push @newlist, $_ if $code.(); } return @newlist; } @x = mygrep {/\S/} $fh.getlines();

Re: Topicalizers: Why does when's EXPR pay attention to topicaliz er r egardless of associated variable?

2002-03-27 Thread Larry Wall
Eric Roode writes: : Larry Wall writes: : I think if we have to go through contortions to get at the outer topic : by name, it's better to just name the variable on the outer loop in the : first place. Adding - $varname to the outer loop is safe, because it : doesn't change the semantics

Re: Perl6 Macros

2002-03-27 Thread Larry Wall
Dan Sugalski writes: : Just out of curiosity, is there anything macros (in the Lisp sense) : can do that source filters can't? Avoid reparsing the language themselves? Larry

[PATCH] keys

2002-03-27 Thread Steve Fink
I'm probably misunderstanding something, but I'm using keys for groups in regular expressions (the uses are internal and so require no assembler support), and I was getting a lot of seg faults. After taking a look, I don't understand the reason for the extra level of indirection to KEY_PAIRs. A

Re: [PATCH] keys

2002-03-27 Thread Steve Fink
On Wed, Mar 27, 2002 at 11:15:22AM -0800, Steve Fink wrote: I'll send a followup patch that updates the .ops files (mainly rx.ops) to define and use the working MAKE_KEY. And here it is. Index: core.ops === RCS file:

Re: Computed-goto Patch

2002-03-27 Thread Michel J Lambert
The patch is slightly broken, core_cg_ops.h in interpreter.c versus core_ops_cg.h everywhere else. I tried to do a global change to make it use core_ops_cg.h, following prederef's example. I must have missed this one. (Still runs, just gives a warning.) It does take a while to build the

Re: Computed-goto Patch

2002-03-27 Thread Steve Fink
On Wed, Mar 27, 2002 at 02:46:21PM -0500, Michel J Lambert wrote: My methodology in creating this patch was to first apply Daniel's patch, and then get it working. His patch had significant changes to an older version of pbc2c.pl, which I tried to apply to the newest version. I then proceeded

Re: Perl6 Macros

2002-03-27 Thread Aaron Sherman
On Wed, 2002-03-27 at 11:31, Dan Sugalski wrote: At 10:27 AM -0500 3/27/02, Aaron Sherman wrote: macro mygrep ($code is macroblock, *@list) { my newlist = (); for list { push newlist, $_ if $code.(); } return newlist; } x = mygrep

Re: Perl6 Macros

2002-03-27 Thread Michel J Lambert
An example of where variable capture is needed is: macro println ($a) { return EOF; print $a; print \n; EOF } for my $b (1..100) { println $b; } And, if we inline the sub, the only difference will be...? Okay, a bad example, in that it could be better done in other

Re: Perl6 Macros

2002-03-27 Thread Michel J Lambert
New syntax is 'qs', aka quote sub, which is similar to q, except that it interpolates all of: ${..} {..} and %{..} All subroutines which are interpolated, are interpolated as regular text, with no bindings, so that they get lexically scoped in the code they are returned as part of. Then macros

Re: Perl6 Macros

2002-03-27 Thread Aaron Sherman
First impression: Don't go there. Longer answer: On Wed, 2002-03-27 at 16:29, Michel J Lambert wrote: New syntax is 'qs', aka quote sub, which is similar to q, except that it interpolates all of: ${..} {..} and %{..} All subroutines which are interpolated, are interpolated as regular text,

Re: Perl6 Macros

2002-03-27 Thread Michel J Lambert
Basically, one of the goals of Perl6 was to allow for you to implement any perl construct, in perl. None of the operators were to use any special features that could not be done by regular subroutines. And personally, I don't see how we're going to be able to do all this lazy evaluation of

[Applied] t/pmc/.cvsignore

2002-03-27 Thread Josh Wilmes
Thanks, done. At 2:59 on 03/27/2002 EST, Michel J Lambert [EMAIL PROTECTED] wrote: The introduction make quicktest made this missing .cvsignore more apparent. Mike Lambert

Re: Perl6 Macros

2002-03-27 Thread Buddha Buck
Michel J Lambert [EMAIL PROTECTED] writes: Macros could add something to Perl, but I don't see why having a macro return a string instead of looking and acting like a subroutine would be a bad thing. In fact, as I pointed out before, you can do almost all of the scoping stuff that you

Re: Computed-goto Patch

2002-03-27 Thread Michel J Lambert
Attached are my revised files. pbc2c.pl uses Parrot::OpTrans::Compiled, and this patch uses Parrot::OpTrans::CGoto. It also fixed the issues with the last patch: - removed inadvertant keyed commenting - fixed #include name - fixed pbc2c.pl - should have unix line endings Please let me know if

deep tests for stacks.t

2002-03-27 Thread Josh Wilmes
I added some tests which push larger numbers of stack frames- this improves our coverage in register.c. However, one of the tests is failing for me. Is this something I did wrong, or did I find a bug? I'm getting weird output for the pushp and popp (deep) test. --Josh Here's the patch:

Warnings Cleanup

2002-03-27 Thread Michel J Lambert
Attached patch fixes many of the warnings you see on MSVC level 4. The ones listed below, this patch does *not* handle. core.ops and rx.ops have some warnings about the use of MAKE_KEY, and the non-use of the variables returned by MAKE_KEY. I believe Steve Fink's patch fixes these. io_win32.c

Re: deep tests for stacks.t

2002-03-27 Thread Josh Wilmes
Mike pointed out that I was missing end opcodes in there, so I added them and went ahead and committed this code to CVS. Currently test #7 is failing, but I think it's a legitimate bug- if not, I apologize for breaking the tinderbox ;) --Josh At 1:15 on 03/28/2002 EST, Josh Wilmes [EMAIL

Re: Warnings Cleanup

2002-03-27 Thread Josh Wilmes
I've applied portions of this patch. I omitted the parts which use the byte type, which isn't going to work on all platforms. --Josh At 1:46 on 03/28/2002 EST, Michel J Lambert [EMAIL PROTECTED] wrote: Attached patch fixes many of the warnings you see on MSVC level 4. The ones listed