[Top][All Lists]

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

Re: Control of score visibility based on variables

From: Lukas-Fabian Moser
Subject: Re: Control of score visibility based on variables
Date: Thu, 3 Dec 2020 17:45:09 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Hi Matthew,

Am 03.12.20 um 01:50 schrieb Matthew Fong:
... and I will have use of question? Didn't know about that!

In fact, that's just an arbitrary name for a variable! (And, to be honest, I wasn't completely happy with my choice.)

So, the following would work just the same:

scoreIf = #(define-void-function (some-condition score) (scheme? ly:score?)
    (if some-condition (add-score score)))

I would have liked to use "condition" or "cond", but these are reserved words in Guile, if I'm not mistaken. Maybe "print-it" would be a nice name: "if print-it (add-score score)" seems to be quite self-explanatory.

As for the ? in "question?": By convention, names ending in "?" are used for "predicates", that is, functions returning only #t or #f as values. I seem to remember that some people extend this convention and use the ? also for variables that should contain boolean values (#t/#f), and that's what I did here.


reply via email to

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