|
From: | Lukas-Fabian Moser |
Subject: | Re: Optional arguments for scheme functions |
Date: | Sun, 26 Apr 2020 10:41:27 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
Am 26.04.20 um 10:30 schrieb Thomas Morley:
However, when I swap integer? for positive? (to reflect the fact that only a positive integer should be acceptable) it breaks, telling me the argument at position 1 is of the wrong type (it’s music, not a positive number). Why doesn’t scheme’s handling of optional arguments work when using the positive? predicate?I've no clue why positive? fails here. Though, for integers >= 0 we have the index? predicate, which works in your function.
Well, positive? does not seem to like being called with anything else than a number:
(positive? "I'm a string") fails as well.I'm not sure as to why that is the case; but anyway, this shows that the problem does not come from LilyPond.
Best Lukas
[Prev in Thread] | Current Thread | [Next in Thread] |