Re: procedure-body
Matthias Radestock <[email protected]>
| Newsgroups | gmane.comp.java.sisc.devel |
|---|---|
| Organization | LShift Ltd |
| Message-ID | <[email protected]> |
Turadg Aleahmad wrote: > Hi. > > I'm porting some code to SISC that makes use of STk's |procedure-body| function. The docs <http://kaolin.unice.fr/STk/Doc/STk.pdf> describe it: > > (procedure-body procedure <proc>) > returns the body of procedure <proc>. If procedure <proc> is not a closure, procedure-body returns #f. > (define (f a b) (+ a (* b 2))) > (procedure-body f) ⇒ (lambda (a b) (+ a (* b 2))) > (procedure-body car) ⇒ #f > > There is no such function in SISC, correct? Is it possible to write one? Any pointers? > sisc.expr.Closure contains the compiled versions of the body. It's printable but may not be particularly readable. One possible solution could be to * modifiy the compiler so the procedure body s-expr gets stored in the LambdaExp, * add that information as a procedure property (which is an annotation) to the Closure when it gets created by LambdaExp. Matthias ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf