Dmitry Bogatov <kact...@gnu.org> writes: > 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?
It's not a limitation, but a misunderstanding. Define creates a binding in the _current_ scope, not the top level one. -- Ian Price -- shift-reset.com "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled"