fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

11K
active users

Question for ☯️ kings & queens 👑 ! Are there an alternative to clojure's alter-var-root clojuredocs.org/clojure.core/w in scheme?

Imagine I have a module `(X)` with `(define a 1) (define-public (f x) (+ x a))` and module `(Y)` that has `#:use-module (X)`. In `(Y)` want to alter a from `(X)` in a way that would also affect `f`. Example: (being in module `(Y)`): `(alter! a 2) (equal? (f 3) 5) => `

CC @wingo @rml @cwebber

clojuredocs.orgwith-redefs - clojure.core | ClojureDocs - Community-Powered Clojure Documentation and Examples

@shegeley @rml @cwebber most schemers are republicans, in the anti-monarchist sense :) but if the intended use case is global monkeypatching, then in guile `set!` is your tool. if `a` is exported, then just `set!` on `a`. if not, `(set! (@@ (X) a) new-val)`

@monkey1 @wingo @rml @cwebber

I'm not sure about this formulation. I want to update `x` from `(X)` "globally": in a way that everything from `(X)` that'd have `x` referenced would also update it to the new value.