[PD] embedded abstractions (Was: Re: Highlight modified abstraction instances with red)
claudiusmaximus at goto10.org
Tue May 15 19:38:18 CEST 2007
Georg Holzmann wrote:
> think about maybe like functions in a python script or c program or
> You can reuse the function in the whole file, but the function is also
> defined in the same file.
I don't know about Python, but C programs are limited to named
functions, you can't have anonymous functions that you define where you
need them - you end up having to define a zillion names for things you
only use once.
What would be really cool if this gets implemented in the right way, is
that you could have embedded abstractions instantiated in a subpatch of
a main patch by internal messages - should make some dynamic patching
tasks a lot easier (and quicker - I have a patch that has 256 instances
of an abstraction, takes an age to load the abstraction from hard disk
What would be even cooler is if you could create embedded abstractions
with internal messages - imagine creating abstractions as and when you
need them (with $0-names if you like, global names if you like too) that
you can use for bits and pieces - so Frank's list-abs things could
change their behaviour at runtime.
Say you had [list-foldr + 0], that sums all elements of a list, you
could send a message like "op *, seed 1" to have it clear its current
behaviour and create a new embedded abstraction to find the product of
the elements of a list. Or even have the parent patch have an embedded
abstraction $0-blah that does:
| [* 10]
"list 0 1 2 3 4 5 6 7 8 9"
[list-foldr $0-blah 0]
9876543210 -- in base 10 ;)
Give me lambda abstraction and I'm a happy programmer!
Now what about currying?
More information about the Pd-list