[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: global vars and #:declarative? (was [critical bug] The set! doesn't
From: |
Nala Ginrut |
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 |
@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.
>
>