- (if (ly:undead? lilypond-declarations)
- (ly:error (_ "define-session-public used after session start")))
- (let ((var (make-variable value)))
- (module-add! (current-module) name var)
- (set! lilypond-exports (acons name var lilypond-exports))))
- `(,add-session-variable ',name ,value))
+ (set! lilypond-exports
+ (acons name (make-session-variable name value) lilypond-exports)))
+ `(begin
+ ;; this is a bit icky: we place the variable right into every
+ ;; parser module so that both set! and define will affect the
+ ;; original variable in the (lily) module. However, we _also_
+ ;; export it normally from (lily) for the sake of other modules
+ ;; not sharing the name space of the parser.
+ (,add-session-variable ',name ,value)
+ (export ,name)))