On Fri, Sep 30, 2011 at 10:10 PM, Alaric Snell-Pym <[email protected]> wrote: > > On 09/30/2011 02:07 PM, Alex Shinn wrote: >> On Fri, Sep 30, 2011 at 5:34 PM, Alaric Snell-Pym >> <[email protected]> wrote: >>> >>> On 09/29/2011 05:25 PM, Andre van Tonder wrote: >>> >>>> On a system that that invokes a compiler on the argument of EVAL, the >>>> compiler >>>> may depend on the textual representation of the code '(cons 1 2). It may >>>> even >>>> do certain optimizations and rewritings based on the textual >>>> representation. >>>> Again, having procedure objects in here confuses levels and can cause >>>> problems >>>> for such a compiler. >>> >>> Does it really? Can anyone point to an implementation of EVAL that can't >>> cope with this? >> >> Chicken's inline egg would not support this. That's intended >> for inline C code, but could be modified and used as an EVAL >> replacement. > > I'll discount that one, then, as it merely "could be" :-)
>From the latest trunk of inline egg: #;1> (define fib-src '(lambda (n) (let fib ((n n)) (if (< n 2) 1 (+ (fib (- n 1)) (fib (- n 2))))))) #;2> (define f1 (eval fib-src)) #;3> (define f2 (inline-eval fib-src)) #;4> (time (f1 35)) 14.805s CPU time, 3.301s GC time (major), 1048714 mutations, 1734/275003 GCs (major/minor) 14930352 #;5> (time (f2 35)) 1.132s CPU time, 0.139s GC time (major), 107560 mutations, 72/29328 GCs (major/minor) 14930352 -- Alex _______________________________________________ Scheme-reports mailing list [email protected] http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports
