lilypond-user
[Top][All Lists]
Advanced

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

Re: [Scheme coding] turning a list into a markup/string


From: David Kastrup
Subject: Re: [Scheme coding] turning a list into a markup/string
Date: Wed, 22 Jan 2020 13:41:02 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Kieren MacMillan <address@hidden> writes:

> Hi David,
>
>> I'd use (lambda (d) (format "~@d" d)) here myself
>
> Good to learn that tool!
>
>> but it does differ in writing +0 (in case that's undesired).
>
> It is.
>
>> If one wants to avoid an unnecessary string-append, one can go
>> (lambda (d) (let ((s number->string d))
>>              (if (positive? s) (string-append "+" s) s)))
>
> I assume you’re missing a set of parentheses? Shouldn’t it rather be
>
>     (lambda (d) (let ((s (number->string d)))
>
> ?

Oops.  Yes.

-- 
David Kastrup



reply via email to

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