Oddbean new post about | logout

Notes by Grigory Shepelev | export

 Short video intro into my guile scheme project hatis (Hackable text input system). Currently in very early pre-pre-pre alpha dev/research stage 

https://youtu.be/Yq88C7y5goM
#wayland #guile #guix #hatis #text 
 Colors of mid-autumn 
 Anyone using #weston with #guix? I 
 on, newermind. #sway will do the trick. I just need wayland compositor with `zwp_input_method` interface support 
 nostr:npub1ced3sw6n2hehffgalr4re0e0u83t5l9raj3avyf6g5lu0v3fvn2sssvlf2 nostr:npub1cwwjvpgyj5fy8tdk... 
 @4c603b88 @c39d2605 @462ebf4c @338f82ef probably the answer given was toatally correct. set! and stuff will work in repl, but won't when launched in the testing env that I just set up. 
 @4c603b88 @c39d2605 @462ebf4c @338f82ef 

yep. the problem was totally in the testing env 
 @4c603b88 @c39d2605 @462ebf4c @338f82ef 

it won't update setted variable's value in all procedures of `(X)` that uses `x`. `(define (square r pi) (* r r pi))` <-- here pi will stay 3.14 when `square` will be called from `(Y)` 
 @4c603b88 @c39d2605 @462ebf4c @338f82ef probably the answer given was toatally correct. set! and stuff will work in repl, but won't when launched in the testing env that I just set up. 
 nostr:npub1ced3sw6n2hehffgalr4re0e0u83t5l9raj3avyf6g5lu0v3fvn2sssvlf2 nostr:npub1cwwjvpgyj5fy8tdk... 
 @4c603b88 @c39d2605 @462ebf4c @338f82ef 

it won't update setted variable's value in all procedures of `(X)` that uses `x`. `(define (square r pi) (* r r pi))` <-- here pi will stay 3.14 when `square` will be called from `(Y)` 
 nostr:npub1ced3sw6n2hehffgalr4re0e0u83t5l9raj3avyf6g5lu0v3fvn2sssvlf2 nostr:npub1cwwjvpgyj5fy8tdk... 
 @338f82ef @c39d2605 @4c603b88 @462ebf4c 

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. 
 nostr:npub1ced3sw6n2hehffgalr4re0e0u83t5l9raj3avyf6g5lu0v3fvn2sssvlf2 nostr:npub1f3srhzp5z8qwchfd... 
 @c39d2605 won't help :( 
 nostr:npub1ced3sw6n2hehffgalr4re0e0u83t5l9raj3avyf6g5lu0v3fvn2sssvlf2 nostr:npub1f3srhzp5z8qwchfd... 
 @c39d2605 @4c603b88 @462ebf4c set! Won't affect `f` from `X` 
 Question for #scheme ☯️  kings & queens 👑 ! Are there an alternative to clojure's alter-var-root https://clojuredocs.org/clojure.core/with-redefs 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) => #t`

CC @c39d2605 @4c603b88 @462ebf4c 
 @c39d2605 @4c603b88 @462ebf4c 
@338f82ef

Imagine that you have a module already written by someone that does the job you want to, but there is only one variable (example `(define pi 3.14)` ) that you want just override but otherwise would like everything to work as previously. Wouldn't like to copy-paste a one of code