lilypond-user
[Top][All Lists]
Advanced

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

Re: Passing along variable-number arguments


From: David Kastrup
Subject: Re: Passing along variable-number arguments
Date: Tue, 02 Feb 2016 08:34:44 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Urs Liska <address@hidden> writes:

> Am 02.02.2016 um 00:44 schrieb David Kastrup:
>> Urs Liska <address@hidden> writes:
>>
>>> In this code "format" receives "fmt" (the format strings) and "vals" -
>>> the *list* of arguments.
>>> How should I modify this so "format" doesn't parenthesize the output and
>>> also works with more than one argument and placeholder in the format string?
>> (apply format fmt vals)
>>
>
> Argh, I *knew* it was that simply. I'm astonished how far I can get with
> Scheme while still falling over these basics.
> Thanks for not noticeably raising the eyebrows.

It doesn't seem that basic to some.  I've replaced dozens of instances
of what amounts to code like

(apply format (cons fmt vals))

since people did not appear to trust passing more than the final list
argument to format.

-- 
David Kastrup



reply via email to

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