[PD] route outputs lists instead of floats

Mathieu Bouchard matju at sympatico.ca
Tue Feb 15 01:54:40 CET 2005

On Sun, 13 Feb 2005, Ian Smith-Heisters wrote:
> Lisp is beautiful and easy to use becuase it's logical: there aren't 
> (m)any exceptions to the rules. A list can hold anything. That can be 
> nothing, atoms, or other lists. The more exceptions you add the more 
> confusing things get imho.

I think Lisp has got it the right way for lists, I mean for including the
cases of size 0 and 1. Lists and sets were invented to represent
plurality, but they nevertheless include singular (1) and nothingness (0)
because they are also valid answers to queries of the type "give me the
list of things with such property...". The Pd way appears to be that those
queries would be answered by dodging the question complaining that there
are not enough things with such property to make a "real" (plural) list.

> Of course Lisp also ends up with obnoxious things like trying to
> select an atom and it being the wrong type because it's actually a
> one-atom list.

That's a weak argument against Lisp. You can replace every occurrence of
CAR with CAR2 defined like

(defun car2 (my-list)
  (if (listp my-list)
    (car my-list)

and it's true that it would be cumbersome to do it for every function that
processes lists, but then, code that doesn't treat atoms as 1-lists tends
to work better when it comes to handling nested lists.

If I have a two-element list (A B), with both elements being lists
themselves, then if I remove B, is the result (A), or just A ? why ?
(that's where the Pd way can get really annoying, though nested lists
aren't yet implemented in Pd)

Mathieu Bouchard -=- Montréal QC Canada -=- http://artengine.ca/matju

More information about the Pd-list mailing list