IRC channel logs

2018-06-13.log

back to list of logs

<megane>hugo: interesting. when i compile it (guile (GNU Guile) 2.0.11) i get an error
<megane>ERROR: Throw to key `vm-error' with args `(vm-run "Unrewindable partial continuation" (#<vm-continuation 13ec9e0>))'.
<megane>sorry. not compile, just by running 'guile test.scm'
<megane>i tried it with 2.2.3 and it works
<megane>i thought i was misunderstanding something
<megane>hugo: thanks
<megane>(reset (λ () (shift k (list (k 1))))) <- shouldn't this return (list (lambda () 1))? i get a procedure returning '(1) on 2.2.3
***Raimondii is now known as Raimondi
<rain1>megane: no it's giving the correct result
<rain1>evaluation doesn't happen under a binder
<megane>rain1: what's a binder? is reset or prompt a binder?
<rain1>lambda
<megane>ok
<rain1>(reset (lambda () ...)) will necessarily return a procedure, no matter whats inside
<megane>is this normal shift/reset semantics or a guile thing?
<rain1>that's standard
<rain1>(define x (reset (λ () (cons 'x (shift k (list (k 1)))))))
<rain1>here's an example that might help
<rain1>(x) will produce ((x . 1))
<rain1>so there is like an implicit reset under the binder
<rain1>(define x (reset (λ () (reset (cons 'x (shift k (list (k 1))))))))
<rain1>gives the same result
<megane>ok. i see. now the results i'm seeing start to make sense
<rain1>sorry that was wrong
<megane>i wonder why it works this way and not the way i thought..
<rain1>lambda doesn't have an implicit reset
<megane>hmm!
<rain1>it's the REPL itself doing that
<rain1>you can distinguish those 2 expressions by trying (list 'a 'b (x) 'c)
<rain1>there are a couple different sets of delimited continuation operators, maybe you're used to a different pair
<megane>rain1: i only "know" shift/reset
<rain1>yeah they're the only ones I use too
<megane>btw i get no difference between those two x definitions
<megane>just running 'guile file.scm' here
<megane>oh sorry. i copied the same thing twice :P
<megane>yeah, now there's a difference
<megane>i think i got led astray by the example (reset (lambda () (shift k (k 1)))), where it seems like the continuation is (lambda () []), but actually is something else
<megane>rain1: thanks for the help!
<rain1>youre welcome
<rain1>yeah the interaction with binders is quite subtle
<rain1>it takes a while toget a good intuition for the evaluation contexts at play
<ArneBab>hugo: I’m here with my non-work account. When I post from work, I cannot do long discussions.
<hugo>ArneBab: ok. What is your other account?
<ArneBab>hugo: my other account is whatever freenode.net assigns me
<ArneBab>typically I call myself ArneBab_work
<hugo>Ok. Where we discussing somuthing? I don't find anything with a quick look in the log
<ison111>I'm not sure how I should be including files in guile. The way I'm currently doing it seems to give results as if some files were not re-compiled after being changed.
<ison111>My specific use case is for example File1.scm defines a function "func1". Then say File2.scm calls (func1). If I run it it works just fine but if I change func1 then the code in File2.scm behaves as before the change was made
<ison111>I have to deleve ~/.cache/guile to make it work
<ison111>s/deleve/delete/
<ison111>Forgot to mention that both File1.scm and File2.scm are being included inside a parent program.
<janneke>ison111: make File1.scm a module: (define-module (File1) #:export (func1))
<janneke>File2 uses that module
<janneke>ison111: see node "6.20 Modules" in the manual
<ison111>janneke: I tried that earlier and I think I was getting the same problem. Could it maybe have something to do with the path to File2 being built dynamically?
<ison111>janneke: Basically there are several directories each with their own "File2" and the user passes in which directory they want on the command line, then the file is loaded like (load (string-append dir "/File2"))
<ison111>I tried using (include) at first but it was complaining about the string-append. I wonder if load also has some trouble with it as far as detecting whether a file needs to be recompiled or not
<janneke>ison111: i would advise using modules, and call resolve-modulee in this case
<janneke>*resolve-module
<ison111>Ok I'll give that a try, thanks.
<hugo>Also, 'add-to-load-path' allows you to add directories where modules can be placed