I'm preparing some patches for courses that I teach and I noticed behaviour in [route] that I found unexpected or at least inconsistent.
Attached is a patch that demonstrates the problem.
In short: when mixing types of arguments for [route], the object will fail to properly route a float if the float is preceded by a symbol argument. For example: [route 12 nobug] will route 12 properly [route bug 12] will send any incoming 12 to its last ('undefined') output
This is with Pd Extended 0.42.5 on Mac OS 10.6.6
Is this a bug or am I overlooking something?
Rene
This is not a bug. Just do something like this to avoid any problem :
[route number number number ...]/[route word word word ...] ++
Jack
Le dimanche 27 février 2011 à 22:46 +0200, rene beekman a écrit :
I'm preparing some patches for courses that I teach and I noticed behaviour in [route] that I found unexpected or at least inconsistent.
Attached is a patch that demonstrates the problem.
In short: when mixing types of arguments for [route], the object will fail to properly route a float if the float is preceded by a symbol argument. For example: [route 12 nobug] will route 12 properly [route bug 12] will send any incoming 12 to its last ('undefined') output
This is with Pd Extended 0.42.5 on Mac OS 10.6.6
Is this a bug or am I overlooking something?
Rene
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
The first paragraph of route-help states:
"which maybe numbers or symbols (but not a mixture of the two unless the datatypes are defined explicitly)"
Its the answer. See the help patch.
On Sun, Feb 27, 2011 at 10:40 PM, Jack jack@rybn.org wrote:
This is not a bug. Just do something like this to avoid any problem :
[route number number number ...]/[route word word word ...] ++
Jack
Le dimanche 27 février 2011 à 22:46 +0200, rene beekman a écrit :
I'm preparing some patches for courses that I teach and I noticed behaviour in [route] that I found unexpected or at least inconsistent.
Attached is a patch that demonstrates the problem.
In short: when mixing types of arguments for [route], the object will fail to properly route a float if the float is preceded by a symbol argument. For example: [route 12 nobug] will route 12 properly [route bug 12] will send any incoming 12 to its last ('undefined') output
This is with Pd Extended 0.42.5 on Mac OS 10.6.6
Is this a bug or am I overlooking something?
Rene
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
In your quote of Miller's help patch you left off half the sentence. Here's the full quote:
"Route checks the first element of a message against each of its arguments, which may be numbers or symbols (but not a mixture of the two.)"*
The part before the comma is wrong-- that's not how [route] works. The reality is:
the selector against its arguments. Subsequent args are assumed to be symbol atoms (and if you try to use a float as a subsequent arg it will be treated as an empty symbol). 2) If the first arg is a float, then [route] is put in "list" mode and checks the first element of an incoming list against its arguments. Subsequent args are assumed to be floats (and if you try to use a symbol it will be treated as the value "0").
So what you quoted is the answer, as long as the questioner magically realizes to ignore everything before the comma.
-Jonathan
--- On Sun, 2/27/11, Pedro Lopes pedro.lopes@ist.utl.pt wrote:
From: Pedro Lopes pedro.lopes@ist.utl.pt Subject: Re: [PD] unexpected behaviour in [route] To: "Jack" jack@rybn.org Cc: pd-list@iem.at, "rene beekman" r@raakvlak.net Date: Sunday, February 27, 2011, 11:49 PM
The first paragraph of route-help states: "which maybe numbers or symbols (but not a mixture of the two unless the datatypes are defined explicitly)" Its the answer.
See the help patch.
On Sun, Feb 27, 2011 at 10:40 PM, Jack jack@rybn.org wrote:
This is not a bug.
Just do something like this to avoid any problem :
[route number number number ...]/[route word word word ...]
++
Jack
Le dimanche 27 février 2011 à 22:46 +0200, rene beekman a écrit :
I'm preparing some patches for courses that I teach and I noticed
behaviour in [route] that I found unexpected or at least inconsistent.
Attached is a patch that demonstrates the problem.
In short: when mixing types of arguments for [route], the object will
fail to properly route a float if the float is preceded by a symbol
argument.
For example:
[route 12 nobug] will route 12 properly
[route bug 12] will send any incoming 12 to its last ('undefined')
output
This is with Pd Extended 0.42.5 on Mac OS 10.6.6
Is this a bug or am I overlooking something?
Rene
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Sun, 27 Feb 2011, Jonathan Wilkes wrote:
"Route checks the first element of a message against each of its arguments, [...] The part before the comma is wrong-- that's not how [route] works. The reality is: 1) If the first arg is a symbol atom, then [route] is put in "selector" mode and checks the selector against its arguments.
Yeah, that's the sort of confusion that the original manual would brew, and then it led to things like Nova (by Tim Blechmann) and Zengarden, both of which don't even have selectors internally.
Zengarden's $1 in message boxes is not compatible with Pd's : in message "hello world", "symbol $1" says "symbol hello" instead of "symbol world".
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
Hi,
I took the liberty to expand the OP's patch hopefully clearing some doubts (warning fairly wide window).
Lorenzo
Mathieu Bouchard wrote:
On Sun, 27 Feb 2011, Jonathan Wilkes wrote:
"Route checks the first element of a message against each of its arguments, [...] The part before the comma is wrong-- that's not how [route] works. The reality is: 1) If the first arg is a symbol atom, then [route] is put in "selector" mode and checks the selector against its arguments.
Yeah, that's the sort of confusion that the original manual would brew, and then it led to things like Nova (by Tim Blechmann) and Zengarden, both of which don't even have selectors internally.
Zengarden's $1 in message boxes is not compatible with Pd's : in message "hello world", "symbol $1" says "symbol hello" instead of "symbol world".
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Sun, 27 Feb 2011, rene beekman wrote:
I'm preparing some patches for courses that I teach and I noticed behaviour in [route] that I found unexpected or at least inconsistent. Attached is a patch that demonstrates the problem. In short: when mixing types of arguments for [route], the object will fail to properly route a float if the float is preceded by a symbol argument. For example: [route 12 nobug] will route 12 properly [route bug 12] will send any incoming 12 to its last ('undefined') output
Ah, forgot to say, I once patched [route] to allow both at once, but no-one was interested in it.
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC