guile-user
[Top][All Lists]
Advanced

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

Re: expression and definition context in Scheme


From: Maxime Devos
Subject: Re: expression and definition context in Scheme
Date: Sat, 27 Aug 2022 21:20:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0


On 27-08-2022 21:02, Damien Mattei wrote:
in fact just allow 'define that act locally ,see my comment below

I do not know what semantics you want.

    Also, even if (begin ...) and (let () ...) where unified, it would
    be a shame to lose the ability to only have some definitions
    temporarily:

    (define foo 0)

    (let ((foo 0))
      whatever-something-using-the-inner-foo)

    something-using-the-outer-foo-again

i do not propose foo to overwrite the global one

In that example, (define foo) might be global, but it might as well have been

(let ((foo 0))
  (let ((foo 0))
    whatever-something-user-the-inner-foo)
  something-using-the-outer-foo-again)

or

(let ()
  (define foo 0)
  (let ((foo 0))
    whatever-something-user-the-inner-foo)
  something-using-the-outer-foo-again)

I did not assume anything about global/local and wrote nothing about overwriting.
, just to allow local define that have a local (in the block) range.

If with 'block' you mean the local (let ...) form, then this is already the case.

If not, maybe you are asking for Python-like lexical variables, but you have asked about that in the past -- it's a valid choice, but not Scheme.

If something else, you need to be much less vague and much more precise on what you want.

Greetings,
Maxime.

Attachment: OpenPGP_0x49E3EE22191725EE.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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