On 08/20/2013 12:39 PM, Dmitry Bogatov wrote: > It seems following is invalid: > > (let ((a 2)) > (define (foo x) (+ a x))) > > I prefer to reduce scope of variable as much as possible, so > I find this restriction unconvinent. Is is part of standard or technical > limitation? Is it any workaround?
use a lambda form rather than a define: (letrec ((a 2) (foo (lambda (x) (+ a x)))) (foo 3)) > > Please, keep in CC, I am not subscribed. > > -- > Best regards, Dmitry Bogatov <kact...@gnu.org>, > Free Software supporter and netiquette guardian. > git clone git://kaction.name/rc-files.git --depth 1 > GPG: 54B7F00D > Html mail and proprietary format attachments are forwarded to /dev/null.