Re: Setting variables in declarative modules

"Thompson, David" <[email protected]>
Newsgroups gmane.lisp.guile.user
Message-ID <CAJ=RwfZVcimua4EeNSWn4LR5k-SJ1_dt+ukA0=vNRWt+Z5-9dw@mail.gmail.com>
Hi Tommi,

On Thu, Oct 31, 2024 at 10:30 PM Tommi Höynälänmaa
<[email protected]> wrote:
>
> Suppose that I have the following code in a Guile module:
> ---
> (define fw-proc #f)
>
> (define (my-proc x)
>     (display (fw-proc x)))
>
> (define (fw-proc x)
>     (cons x x))
> ---
>
> Can I declare the module as declarative?

Yes, this is fine. If you put this in a module file and compile it,
Guile does not issue any warnings. `define` is not `set!`. (Modules
are declarative by default, btw.)

- Dave
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.