|
From: | Tobia Conforto |
Subject: | Re: [Chicken-users] Evaluating lists with scoped let's and applying scoped macros to lists |
Date: | Fri, 13 Feb 2009 12:40:12 +0100 |
Christoph Angerer wrote:
(define (interpret prog) (let [(myadd +) (mymul *)] (eval prog))) (display (interpret '(myadd 4 (mymul 5 2))))
This cannot possibly work.The symbol myadd is lexically scoped to the let block. The invocation of interpret is *outside* the let block. Period.
What you are looking for is an enhanced version of (eval) that can accept a user-defined environment. You will find it in unit environments: http://chicken.wiki.br/environments
Tobia
[Prev in Thread] | Current Thread | [Next in Thread] |