Re: global vars and #:declarative? (was [critical bug] The set! doesn't work in indirect reference)

Nala Ginrut <[email protected]>
Newsgroups gmane.lisp.guile.user
Message-ID <CAPjoZocoYAvFKVR0+JVCch8SpQ22LrmtbTGi7zZ4kme+XyPupg@mail.gmail.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 <[email protected]>
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.
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.