lilypond-user
[Top][All Lists]
Advanced

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

Strange error from define-syntax


From: John Schlomann
Subject: Strange error from define-syntax
Date: Thu, 28 May 2020 11:13:03 -0500

Dear Ponders & Schemers,

 

I wanted to try creating a simple Scheme macro. I’ve never done this before, so I may well be going about it all wrong, but the error I get doesn’t make sense.

 

Here is a minimal non-working example:

 

\version "2.20.0"

     #(use-modules (ice-9 syncase))

 

     #(define-syntax set-default

       (syntax-rules ()

        ((set-default name value)

         (if (eqv? name 'UNDEF) name value)

       )))

 

     #(define some-setting 44)

     #(set-value some-setting 99)

     #(ly:message "some-setting = ~a\n" some-setting)

 

This gives the error:

                Wrong number of arguments to #<Music function #<procedure #f (arg)>>

 

Huh? I also tried define-syntax-rule, which came up unbound. Any insights into what I’m doing wrong would be welcome.

 

Thanks,

John

 


reply via email to

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