> The 'eval' compiler returns a bytecode segment without a constant table. The
> 'destroy' of the Eval PMC needs to handle that.
How that? Are there no constants? Anyway, switching to a new bytecode
segment does switch the constant table too, so all compiled code ought
to have a constant table.
leo
> this patch brings Parrot m4 to terms with recent "eval" changes. The compile
> function of the 'eval' compiler now returns an Eval PMC. The m4 macro "eval"
> is a simple interpreter of integer arithmetic expressions.
Thanks, applied.
leo
Yes, there are no constants. The only thing the generated sub does, is
to return an integer value, that was computed in the C-Code.
Thus the m4 macro "eval( 1 ^ 3 )" compiles into a sub that looks in PIR
like:
.sub generated_sub
.return( 3 )
.end
Of course it would be much more simle to use a plain NCI call for this
purpose.
But I wanted to play with 'compreg' when I implemented that.
CU, Bernhard
--
**************************************************
Dipl.-Physiker Bernhard Schmalhofer
Senior Developer
Biomax Informatics AG
Lochhamer Str. 11
82152 Martinsried, Germany
Tel: +49 89 895574-839
Fax: +49 89 895574-825
eMail: Bernhard.S...@biomax.com
Website: www.biomax.com
**************************************************
> Yes, there are no constants. The only thing the generated sub does, is
> to return an integer value, that was computed in the C-Code.
> Thus the m4 macro "eval( 1 ^ 3 )" compiles into a sub that looks in PIR
> like:
> .sub generated_sub
> .return( 3 )
> .end
I see. And what about the equivalent of eval("ab" <concat> "cd") or
eval(1.3 + 2.5) ?
> CU, Bernhard
leo