[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: scm_* API extension? [was] scm_* API question
From: |
Han-Wen Nienhuys |
Subject: |
Re: scm_* API extension? [was] scm_* API question |
Date: |
Mon, 5 Aug 2002 20:12:27 +0200 |
address@hidden writes:
>
> What is an 'interpreter'? What do multiple instances of the
> interpreter have in common, what is specific to each instance? I
> think that once you know what you want from multiple interpreters, you
> can implement them easily with the features we already have. Or with
> fork.
What I want is a way to encapsulate state changes; modules give a nice
way to deal with naming variables, but not with their values. When I
have two lilypond files, one doing
f1.ly
#(set! global-foo-option #t) ;; default = #f
\score {\notes { .. } }
f2.ly
\score { \notes { ..other notes.. } }
What really happens during execution depends on the order of
execution: if you do
lilypond f1 f2
then f2 is processed with global-foo-option set to #t. If you change
the order, then f2 is processed with global-foo-option set to #f.
It would be nice if we could have some kind of copy-on-write system
for variables, so that I can reset the state of the variables before
processing each new file.
[disclaimer, I know nothing of advanced Scheme techniques, I might be
missing some basic idiom here completely.]
--
Han-Wen Nienhuys | address@hidden | http://www.cs.uu.nl/~hanwen/