lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

session macros


From: Han-Wen Nienhuys
Subject: session macros
Date: Mon, 27 Jan 2020 11:07:42 +0100

I've been looking at (auto)compilatoin for a bit. It fails with

;;; WARNING: compilation of
/home/hanwen/vc/lilypond/lily/share/lilypond/current/scm/chord-entry.scm
failed:
;;; unhandled constant #<procedure add-session-variable (name value)>

I'm puzzled by your macro:

(defmacro define-session (name value)
  ..
  (define (add-session-variable name value)
    (set! lilypond-declarations
          (cons (make-session-variable name value) lilypond-declarations)))
  `(,add-session-variable ',name ,value))

I understand why we need sessions, but I don't understand why this has
to be a macro, and why the macro has to define add-session-variable.

Why can't this be something like

  (define lilypond-declarations '())
  (define (define-session name value)
     (set! lilypond-declarations
          (cons (make-session-variable name value) lilypond-declarations)))


When calling the macro twice, we'll define add-session-variable twice,
which seems fishy.

-- 
Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen



reply via email to

[Prev in Thread] Current Thread [Next in Thread]