From: "Dr. Arne Babenhauserheide" <arne_bab@web.de>
To: Taylan Kammer <taylan.kammer@gmail.com>
Cc: guile-user@gnu.org
Subject: Re: define anywhere
Date: Sat, 05 Jun 2021 10:50:29 +0200 [thread overview]
Message-ID: <875yysae5m.fsf@web.de> (raw)
In-Reply-To: <4b467d1c-284a-7881-0662-cd68aa0ac503@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 950 bytes --]
Taylan Kammer <taylan.kammer@gmail.com> writes:
> On 05.06.2021 00:27, Damien Mattei wrote:
>> hello,
>> i'm was considering that i want to be able to define a variable anywhere in
>> code, the way Python do. Few scheme can do that (Bigloo i know)
>> ( the list here is not exact:
>> https://www.reddit.com/r/scheme/comments/b73fdz/placement_of_define_inside_lambda_bodies_in/
>> )
>> is it possible in guile to do it? i do not know, so could it be added to
>> the language specification for future release?
>>
>> regards,
>> Damien
>>
>
> It's possible since 3.0, see here:
>
> https://www.gnu.org/software/guile/manual/html_node/Internal-Definitions.html#Internal-Definitions
It is currently possible almost anywhere:
Works:
(define (a) (when #f #t) (define a 'b) a)
Does not work:
(define (a) (when #t (define a 'b) a))
Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]
next prev parent reply other threads:[~2021-06-05 8:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-04 22:27 define anywhere Damien Mattei
2021-06-05 2:10 ` Taylan Kammer
2021-06-05 8:50 ` Dr. Arne Babenhauserheide [this message]
2021-06-05 15:23 ` Linus Björnstam
2021-06-06 8:09 ` Linus Björnstam
2021-06-06 12:02 ` Dr. Arne Babenhauserheide
2021-06-06 13:36 ` Linus Björnstam
2021-06-06 16:45 ` Dr. Arne Babenhauserheide
2021-06-11 8:08 ` Damien Mattei
[not found] ` <CADEOadcwk1D9of6C1owQQSqFNRvUmA=wJKSngySbGsfdDUzoMw@mail.gmail.com>
[not found] ` <28842df5-d82b-4819-b7ad-2148265f7a83@www.fastmail.com>
2021-06-09 9:29 ` Damien Mattei
2021-06-09 10:11 ` Linus Björnstam
2021-06-11 8:15 ` Damien Mattei
2021-06-11 8:07 ` Damien Mattei
2021-06-11 23:43 ` Damien Mattei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875yysae5m.fsf@web.de \
--to=arne_bab@web.de \
--cc=guile-user@gnu.org \
--cc=taylan.kammer@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).