lilypond-devel
[Top][All Lists]
Advanced

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

Re: Geting the list of MIDI instrument names


From: Reinhold Kainhofer
Subject: Re: Geting the list of MIDI instrument names
Date: Wed, 20 Feb 2008 18:38:22 +0100
User-agent: KMail/1.9.6

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Dienstag, 19. Februar 2008 schrieb Ralf Mattes:
> BTW, I think there is a bug in your invocation of 'format - the stream
> parameter is missing. And you don't need 'display, #t as a stream
> designator resolves to (current-output-port). Substitute #t with
> (current-error-port) to send the list to standard error.

Well, you are right that it can be done simpler:
#(map (lambda (x) (format #t "~s~%" (car x))) instrument-names-alist)

However, the "missing" #t is not a bug, rather a missing optimization. format 
without a stream designator returns the formatted string, so in this case one 
really needs a display. However, if you add the stram designator directly to 
format, it's much shorter (unfortunately, both books on scheme that I have 
borrowed from the library don't list this, so I didn't know about this until 
now....).

Reinhold
- -- 
- ------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: address@hidden, http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer maintainer
 * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHvGWPTqjEwhXvPN0RAvjxAKCoks6PhIW5ZGfpkTiznx4sN63UtACg1zro
BDIDuouM+Pq9ac4ZFINdYpQ=
=tZ6w
-----END PGP SIGNATURE-----




reply via email to

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