unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Nala Ginrut <nalaginrut@gmail.com>
To: "Linus Björnstam" <linus.internet@fastmail.se>
Cc: Taylan Kammer <taylan.kammer@gmail.com>, guile-user@gnu.org
Subject: Re: global vars and #:declarative? (was [critical bug] The set! doesn't work in indirect reference)
Date: Sun, 22 Sep 2024 11:34:14 +0900	[thread overview]
Message-ID: <CAPjoZocoYAvFKVR0+JVCch8SpQ22LrmtbTGi7zZ4kme+XyPupg@mail.gmail.com> (raw)
In-Reply-To: <2a5a4250-a62f-478b-8bd7-ba03b52ec0ac@app.fastmail.com>

@Linus!
I think it's similar to a getter/setter, but I think making it a function
will be safer.

@Tayland Thanks for the hint! I didn't know this trick of parameter!


On Fri, Sep 20, 2024 at 1:41 PM Linus Björnstam <linus.internet@fastmail.se>
wrote:

>
> On Thu, 19 Sep 2024, at 17:33, Taylan Kammer wrote:
> > On
> > If I'm not mistaken: Using a local variable is often more efficient
> > than using a global variable, so if you needed to micro-optimize code
> > for maximum efficiency, you would want to do this
> > There's one potential issue with using parameters like this: Their
> > value is thread-local. If you change a parameter's value from one
> > thread, with the setting syntax above (calling it on a value), it will
> > never become visible to other threads that are currently executing.
>
> You could implement a macro with boxes and identifier macros that lets you
> define "non-declarative" variables that hides the box operations from the
> users.  That should be simple, but might make some issues downstream if
> they start doing macro voodoo.
>
>


  reply	other threads:[~2024-09-22  2:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-19  2:36 global vars and #:declarative? (was [critical bug] The set! doesn't work in indirect reference) Nala Ginrut
2024-09-19  6:56 ` Dr. Arne Babenhauserheide
2024-09-19 12:30   ` Nala Ginrut
2024-09-19 15:33     ` Taylan Kammer
2024-09-20  4:40       ` Linus Björnstam
2024-09-22  2:34         ` Nala Ginrut [this message]
2024-09-22 18:57           ` Linus Björnstam

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=CAPjoZocoYAvFKVR0+JVCch8SpQ22LrmtbTGi7zZ4kme+XyPupg@mail.gmail.com \
    --to=nalaginrut@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=linus.internet@fastmail.se \
    --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).