On Fri, Jan 31, 2020 at 7:20 PM Linus Björnstam
<linus.bjorns...@veryfast.biz> wrote:
> I don't really understand your question. With defmacro and syntax-case you 
> can run arbitrary code. If you just output code that does module-define! that 
> won't be run until runtime, and thus you cannot depend on the result of that 
> module-define! during expansion. You can however wrap it in an eval-when to 
> solve that issue. That allows you to specify when code gets run. With 
> module-define! I personally find it all a bit icky, but I usually stay as far 
> away from phasing as I can :)

 eval-when looks like it might be a solution to the puzzle , but
honestly, the doc at

https://www.gnu.org/software/guile/manual/html_node/Eval-When.html

has me mystified.  When I run the example through guile 2.2 and
display *compilation-date*,

I get a different answer each time. Shouldn't it be a fixed timestamp
(of when the compile happened?)

[hanwen@localhost lilypond]$ guile2.2 e.scm
;;; note: source file /home/hanwen/vc/lilypond/e.scm
;;;       newer than compiled
/home/hanwen/.cache/guile/ccache/2.2-LE-8-3.A/home/hanwen/vc/lilypond/e.scm.go
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/hanwen/vc/lilypond/e.scm
;;; compiled 
/home/hanwen/.cache/guile/ccache/2.2-LE-8-3.A/home/hanwen/vc/lilypond/e.scm.go
Fri Jan 31 20:15:57+0100 2020
[hanwen@localhost lilypond]$ guile2.2 e.scm
Fri Jan 31 20:15:58+0100 2020
[hanwen@localhost lilypond]$ guile2.2 e.scm
Fri Jan 31 20:16:00+0100 2020

-- 
Han-Wen Nienhuys - hanw...@gmail.com - http://www.xs4all.nl/~hanwen

Reply via email to