In keeping with the FLOSSmanuals methodology, we need a story to tell
when introducing lists. I have the intro done, but now we need a
story (i.e. developing an example program). I was thinking that a
story involving only lists of numbers would be a good place to start.
Anyone have any ideas on that? Here's what's there so far:
http://en.flossmanuals.net/bin/view/PureData/Lists
.hc
http://at.or.at/hans/
Hallo, Hans-Christoph Steiner hat gesagt: // Hans-Christoph Steiner wrote:
In keeping with the FLOSSmanuals methodology, we need a story to tell
when introducing lists. I have the intro done, but now we need a story (i.e. developing an example program). I was thinking that a story involving only lists of numbers would be a good place to start.
Sorry for not being able to contribute much currently (I'm moving houses) but I think a neat usecase for lists and meta messages (which are important to explain in that context as well) could be the ADSR envelope. Its parameters are a list of four (rsp. five with level) numbers. It can be very useful to be able to set a ADSR by passing complete lists. It can also be useful to set the parameters with meta-messages like "A 20, D 30, S 76, R 300".
Here's an implementation of an adsr that relies heavily on list-processing: http://footils.org/cms/weblog/2009/mar/21/adsr-envelopes-pd/
I would also strongly recommend to use a consistent terminology for lists that are not lists in the Pd sense: I would call them meta-messages just like Miller does, and if there's ambiguity the manual should call proper lists "list-messages".
In the Lists-chapter at http://en.flossmanuals.net/bin/view/PureData/Lists it may be useful to also use a non-commutative math object like [/] or [-] with list-input, because that's a useful trick to quickly get the inverse or complement of a number: [1 $1(---[/ ]
Frank
On 06/04/2009, at 8.49, Frank Barknecht wrote:
I would also strongly recommend to use a consistent terminology for
lists that are not lists in the Pd sense: I would call them meta-messages just
like Miller does, and if there's ambiguity the manual should call proper lists "list-messages".
So "A 20, D 30, S 76, R 300" is a meta-message while "list A 20, D
30, S 76, R 300" is a list-message?
Hallo, Steffen Juul hat gesagt: // Steffen Juul wrote:
On 06/04/2009, at 8.49, Frank Barknecht wrote:
I would also strongly recommend to use a consistent terminology for
lists that are not lists in the Pd sense: I would call them meta-messages just
like Miller does, and if there's ambiguity the manual should call proper lists "list-messages".So "A 20, D 30, S 76, R 300" is a meta-message while "list A 20, D 30, S 76, R 300" is a list-message?
Almost: "A 20" is a meta message, while "list A 20" is a list message. "list A 20, D 30, S 76, R 300" is a list-message followed by 3 meta-messages. :)
Frank
So is it a bug that [20 foo(--[print] posts "20 foo" instead of "list 20 foo?"
-Jonathan
--- On Mon, 4/6/09, Frank Barknecht fbar@footils.org wrote:
From: Frank Barknecht fbar@footils.org Subject: Re: [PD] a story for Lists To: "pd list" pd-list@iem.at Date: Monday, April 6, 2009, 10:54 AM Hallo, Steffen Juul hat gesagt: // Steffen Juul wrote:
On 06/04/2009, at 8.49, Frank Barknecht wrote:
I would also strongly recommend to use a
consistent terminology for
lists that are not lists in the Pd sense: I would call them
meta-messages just
like Miller does, and if there's ambiguity the manual
should call proper lists
"list-messages".
So "A 20, D 30, S 76, R 300" is a
meta-message while "list A 20, D 30, S
76, R 300" is a list-message?
Almost: "A 20" is a meta message, while "list A 20" is a list message. "list A 20, D 30, S 76, R 300" is a list-message followed by 3 meta-messages. :)
Ciao
Frank
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
--- On Mon, 4/6/09, IOhannes m zmoelnig zmoelnig@iem.at wrote:
From: IOhannes m zmoelnig zmoelnig@iem.at Subject: Re: [PD] a story for Lists To: "pd list" pd-list@iem.at Date: Monday, April 6, 2009, 11:41 AM Jonathan Wilkes wrote:
So is it a bug that [20 foo(--[print] posts "20
foo" instead of "list 20 foo?"
no it's a feature to not confuse the noob (at the cost of confusing post-noobs)
It wouldn't confuse anyone at all if there were no meta-messages.
-Jonathan
fgmasdr IOhannes _______________________________________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hallo, Jonathan Wilkes hat gesagt: // Jonathan Wilkes wrote:
It wouldn't confuse anyone at all if there were no meta-messages.
Then Pd objects would only be able to handle bang, float, list and symbol messages (and some selected others like Gem lists) - but no "set", "open", "read", "reset", "stop", "rewind", "start" or any other messages to call custom methods. Then you'd probably have to add separate inlets for each of these and that would be even worse. [textfile] would have 9 inlets. Good luck with memorizing these.
Frank
--- On Tue, 4/7/09, Frank Barknecht fbar@footils.org wrote:
From: Frank Barknecht fbar@footils.org Subject: Re: [PD] a story for Lists To: pd-list@iem.at Date: Tuesday, April 7, 2009, 8:54 AM Hallo, Jonathan Wilkes hat gesagt: // Jonathan Wilkes wrote:
It wouldn't confuse anyone at all if there were no
meta-messages.
Then Pd objects would only be able to handle bang, float, list and symbol messages (and some selected others like Gem lists) - but no "set", "open", "read", "reset", "stop", "rewind", "start" or any other messages to call custom methods. Then you'd probably have to add separate inlets for each of these and that would be even worse. [textfile] would have 9 inlets. Good luck with memorizing these.
Oops, there was supposed to be a second part to that, which is a question: So why couldn't meta-messages all be lists, and whatever part of Pd it is that checks for meta-messages just checks the first item of the incoming list for "set", "add2", etc.?
-Jonathan
Ciao
Frank
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Jonathan Wilkes wrote:
Oops, there was supposed to be a second part to that, which is a question: So why couldn't meta-messages all be lists, and whatever part of Pd it is that checks for meta-messages just checks the first item of the incoming list for "set", "add2", etc.?
basically because it is like it is. i guess that if someone (not completely naive; and with an eye on language-design and not just tool-design) would go and re-invent the wheel, they would make lists just lists. without any special "selector" (just the first element of the list).
as things stand, you have to either accept things how they are or look for an alternative. changing the way list works will be destructive to all but the most trivial patches out there.
on a sidenote: why has your mail so very long lines?
mfga.sdr IOhannes
--- On Tue, 4/7/09, IOhannes m zmoelnig zmoelnig@iem.at wrote:
From: IOhannes m zmoelnig zmoelnig@iem.at Subject: Re: [PD] a story for Lists To: jancsika@yahoo.com Cc: pd-list@iem.at Date: Tuesday, April 7, 2009, 12:08 PM Jonathan Wilkes wrote:
Oops, there was supposed to be a second part to that,
which is a question: So why couldn't meta-messages all be lists, and whatever part of Pd it is that checks for meta-messages just checks the first item of the incoming list for "set", "add2", etc.?
basically because it is like it is. i guess that if someone (not completely naive; and with an eye on language-design and not just tool-design) would go and re-invent the wheel, they would make lists just lists. without any special "selector" (just the first element of the list).
as things stand, you have to either accept things how they are or look for an alternative. changing the way list works will be destructive to all but the most trivial patches out there.
on a sidenote: why has your mail so very long lines?
Oh man, I have no idea! My messages look normal in yahoo mail, but in the archive they are one line per paragraph. Normally I just type into the text area and wrapping is handled automatically.
Anyone know a way to fix this in yahoo mail?
-Jonathan
mfga.sdr IOhannes
On Apr 7, 2009, at 6:08 AM, IOhannes m zmoelnig wrote:
Jonathan Wilkes wrote:
Oops, there was supposed to be a second part to that, which is a
question: So why couldn't meta-messages all be lists, and whatever
part of Pd it is that checks for meta-messages just checks the
first item of the incoming list for "set", "add2", etc.?basically because it is like it is. i guess that if someone (not completely naive; and with an eye on
language-design and not just tool-design) would go and re-invent the
wheel, they would make lists just lists. without any special
"selector" (just the first element of the list).as things stand, you have to either accept things how they are or
look for an alternative. changing the way list works will be destructive to all but the most
trivial patches out there.
I think it would be possible to make a library that treated every
message with more than one element as a list. It would be a library
of pack, unpack, prepend, append, route, etc. But then you could use
that library to have easier list handling, but still have backwards
compatibilty. Some day... maybe someone can beat me to it!
.hc
All information should be free. - the hacker ethic
Hallo, Hans-Christoph Steiner hat gesagt: // Hans-Christoph Steiner wrote:
I think it would be possible to make a library that treated every
message with more than one element as a list. It would be a library of pack, unpack, prepend, append, route, etc.
Like [list append], [list prepend], [list split], [list length], ...? :)
Note that none of these support meta-messages to call custom methods.
Frank Barknecht Do You RjDj.me? _ ______footils.org__
Hallo, IOhannes m zmoelnig hat gesagt: // IOhannes m zmoelnig wrote:
basically because it is like it is. i guess that if someone (not completely naive; and with an eye on
language-design and not just tool-design) would go and re-invent the
wheel, they would make lists just lists. without any special "selector"
(just the first element of the list).
But if you drop the current selectors and use the first element of any list as selector, you just have reinvented selectors, haven't you? ;)
Btw. there seems to be a trend to do just that, but to avoid the selector problem, additional inlets are used. The [list]-family works like that (every meta-info is passed through right inlets), and rjlib uses the last inlet as a special method inlet that accepts both meta-messages and list-messages, whose first element is taken as method call (an idea taken over from Memento/RRADical)
Frank Barknecht Do You RjDj.me? _ ______footils.org__
Frank Barknecht wrote:
Hallo, IOhannes m zmoelnig hat gesagt: // IOhannes m zmoelnig wrote:
basically because it is like it is. i guess that if someone (not completely naive; and with an eye on
language-design and not just tool-design) would go and re-invent the
wheel, they would make lists just lists. without any special "selector"
(just the first element of the list).But if you drop the current selectors and use the first element of any list as selector, you just have reinvented selectors, haven't you? ;)
no. or yes, but selectors need not be symbols, and there would be no special selectors, that implictely define the tail of the list.
somehow functional languages like lisp manage to do well with lists and dealing the head of a list (selector) in various special ways without making the head be different from the elements of the tail.
fgmadsr IOhannes
On Apr 8, 2009, at 6:51 AM, IOhannes m zmoelnig wrote:
Frank Barknecht wrote:
Hallo, IOhannes m zmoelnig hat gesagt: // IOhannes m zmoelnig wrote:
basically because it is like it is. i guess that if someone (not completely naive; and with an eye on
language-design and not just tool-design) would go and re-invent
the wheel, they would make lists just lists. without any special
"selector" (just the first element of the list).But if you drop the current selectors and use the first element of
any list as selector, you just have reinvented selectors, haven't you? ;)no. or yes, but selectors need not be symbols, and there would be no
special selectors, that implictely define the tail of the list.somehow functional languages like lisp manage to do well with lists
and dealing the head of a list (selector) in various special ways
without making the head be different from the elements of the tail.
On Apr 8, 2009, at 2:32 AM, Frank Barknecht wrote:
Like [list append], [list prepend], [list split], [list
length], ...? :)
This is kind of the opposite of what we mean, I think. It forces the
"list" on everything. It is a library built around that one concept
then, which is good. But I think, like IOhannes says above, that it
should be possible to ditch the "float" and "symbol" selectors, since
Pd is already setting the type of each atom, then call any message
with more than one atom a "list" and also drop the "list" selector.
Then something like [route symbol float list] would just sort data,
without stripping off any atoms from the message, but [route foo bar]
would still look for the first atom, and if it finds it, strip it off
and route it.
.hc
I have the audacity to believe that peoples everywhere can have three
meals a day for their bodies, education and culture for their minds,
and dignity, equality and freedom for their spirits. - Martin
Luther King, Jr.
On Wed, 8 Apr 2009, IOhannes m zmoelnig wrote:
somehow functional languages like lisp manage to do well with lists and dealing the head of a list (selector) in various special ways without making the head be different from the elements of the tail.
Lists in LISP have little to do with Pd's lists.
LISP always guaranteed the CONS operation to take O(1) time and O(1) space. In Pd, this is impossible to do with messages. Pd messages look like LISP's vectors instead (except Pd messages are stack-allocated).
On top of that, LISP's values have Pd's atoms as their closest equivalent, and from that perspective, Pd doesn't have any lists (nor vectors), but that's only a symptom of having implemented messages before lists and having then implemented lists using messages.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec
On Tue, 7 Apr 2009, IOhannes m zmoelnig wrote:
Jonathan Wilkes wrote:
Oops, there was supposed to be a second part to that, which is a question: So why couldn't meta-messages all be lists,
basically because it is like it is. i guess that if someone (not completely naive; and with an eye on language-design and not just tool-design) would go and re-invent the wheel, they would make lists just lists. without any special "selector" (just the first element of the list).
Ah, perhaps you, as the maintainer of GEM, could tell us how all those "open"/"set"/etc would be, if Pd were redesigned from scratch the way you'd enjoy. I'm certainly curious about it.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec
Hallo, Jonathan Wilkes hat gesagt: // Jonathan Wilkes wrote:
So is it a bug that [20 foo(--[print] posts "20 foo" instead of "list 20 foo?"
Message-rule #1: Never believe anything [print] prints.
Message-rule #2: messages starting with a number don't need any other selector like "list" or "float", they are always float-messages when they only have one element or list-messages when they have more elements.
Frank
I think that part makes sense. I think this is the bug:
[list 20 foo( | [print]
This prints: "20 foo" it should print "list 20 foo"
.hc
On Apr 6, 2009, at 5:30 AM, Jonathan Wilkes wrote:
So is it a bug that [20 foo(--[print] posts "20 foo" instead of
"list 20 foo?"-Jonathan
--- On Mon, 4/6/09, Frank Barknecht fbar@footils.org wrote:
From: Frank Barknecht fbar@footils.org Subject: Re: [PD] a story for Lists To: "pd list" pd-list@iem.at Date: Monday, April 6, 2009, 10:54 AM Hallo, Steffen Juul hat gesagt: // Steffen Juul wrote:
On 06/04/2009, at 8.49, Frank Barknecht wrote:
I would also strongly recommend to use a
consistent terminology for
lists that are not lists in the Pd sense: I would call them
meta-messages just
like Miller does, and if there's ambiguity the manual
should call proper lists
"list-messages".
So "A 20, D 30, S 76, R 300" is a
meta-message while "list A 20, D 30, S
76, R 300" is a list-message?
Almost: "A 20" is a meta message, while "list A 20" is a list message. "list A 20, D 30, S 76, R 300" is a list-message followed by 3 meta-messages. :)
Ciao
Frank
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
Mistrust authority - promote decentralization. - the hacker ethic