guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Define in let


From: Dmitry Bogatov
Subject: Re: Define in let
Date: Wed, 21 Aug 2013 19:42:01 +0400
User-agent: mu4e 0.9.9.5; emacs 24.3.1

>> 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?
>
> Section '3.4.7 Example 2: A Shared Persistent Variable' is probably what you 
> want?
Yes, although it is a bit too verbose.
(define (foo x)
        (let ((a 2))
             (+ a x0)))
is enough for my puroses, although solution about define-values seems
intresting. Thanks all!

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

Attachment: pgpO3m_DijIjr.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]