Re: psyntax and compiler extension required

Matthias Radestock <[email protected]>
Newsgroups gmane.comp.java.sisc.devel
Organization LShift Ltd
Message-ID <[email protected]>
Scott Miller wrote:

> (letrec ([(a b) (values 1 2)] [c 1]) (+ a b c))
> LetrecExp creates a 3 element env
> AppExp and friends load vlr with ({1, 2}, 3)

Well spotted; we only need to create a vlr big enough to hold the results.

> MVLetrecEval recognizes sisc.data.Values instances (possibly constructed 
>   this way from the Compiler), and copies them into successive env 
>   slots, then loads (+ a b c) into nxp
> 
>>MVLetrecEval would have to be given information on what vlr positions to 
>>expand and how many values to expect for each. That could just be a 
>>number array of size exprs.length (i.e. the number of binding 
>>expressions) with the numbers indicating how many values to expect.
> 
> Yes.  The compiler should be able to easily do this.

Indeed. The only reason we need this info, rather than blindly expanding 
any Values we encounter, is safety, i.e. catching cases where the 
expression supplies an incorrect number of values.


Matthias.



-------------------------------------------------------
This SF.net email is sponsored by: If flattening out C++ or Java
code to make your application fit in a relational database is painful, 
don't do it! Check out ObjectStore. Now part of Progress Software.
http://www.objectstore.net/sourceforge
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.