Re: procedure-body

Turadg Aleahmad <[email protected]>
Newsgroups gmane.comp.java.sisc.devel
Message-ID <[email protected]>
[email protected] wrote:

>>(define (f a b) (+ a (* b 2)))
>>    
>>
>>(procedure-body f) => (lambda (a b) (+ a (* b 2)))
>>    
>>
>Your best bet is to modify the optimizer, or create your own, that emits 
>the following code:
>
>(define lhs (lambda formals body)) =>
>(define lhs (let ([tmp (lambda formals xbody)])
>              (procedure-property tmp 'body 'xbody)
>              tmp))
>
After talking with Matthias on #sisc I understand this much better but I 
still have a long way to go, I think.

1. You suggest that I write a case for the match in |opt| that handles 
"(define lhs (lambda formals body))"?
2. Where did xbody come from? 
3. Did you mean that handler should use |set-procedure-property| ?  
Otherwise, how is the property set?
4. What's the match expression? "((define ,lhs ,[lambda formals body])" ?
5. Do I need a separate case for "(define (foo bar) (shoo bar))" ?  I 
need to have the 'body property on those too.
6. Do I need to modify both |opt| and |scan|?

-Turadg




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
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.