unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Global variables and declarative modules
@ 2024-11-01 15:22 Tommi Höynälänmaa
  0 siblings, 0 replies; only message in thread
From: Tommi Höynälänmaa @ 2024-11-01 15:22 UTC (permalink / raw)
  To: guile-user

Suppose we have module a that defines a global variable:

---

(define-module (a))

(export my-global-var)

(define my-global-var #f)

---

and module b that uses the global variable and changes it:

---

(define-module (b))

(use-modules (a))

(define (my-proc)

     (set! my-global-var 100)

     (display my-global-variable))

---

Is it so that module a can't be marked declarative?

      - Tommi Höynälänmaa

-- 
Kotisivu / Homepage: http://www.iki.fi/tohoyn/
Sähköposti / E-Mail: tommi.hoynalanmaa@iki.fi
GPG-sormenjälki / GPG fingerprint:
55F4 2477 7155 3528 5CB2 2B7A BB86 1FDE 4046 0F83
FT, Debian-ylläpitäjä / PhD, Debian Maintainer




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-11-01 15:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-01 15:22 Global variables and declarative modules Tommi Höynälänmaa

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