On Tue, Aug 20, 2013 at 12:39 PM, Dmitry Bogatov <KAction@gnu.org> 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?


The problem is that you have an invalid `let` form. You need an expression besides `define`.

Something like this would be valid:

(let ((a 2))
  (define (foo x) (+ a x))
  (foo 4))
 

Please, keep in CC, I am not subscribed.

--
Best regards, Dmitry Bogatov <KAction@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.

- Dave Thompson