I sent Miller an idea the other day about making data structures more expressive. Basically allowing subpatches (including abstractions) to be defined as a field of a struct. [struct ex1 float y float i glist foo pd-bar] <-- glist field "foo" using [pd bar] as a template So let's say you make a ds array using [struct ex1] above as the template for the elements. Now when you [setsize] to 40, each element has an associated "foo" field which is actually a subpatch. To define a "subpatch template" for foo, you'd just put [pd bar] in the same subpatch as [struct ex1]. The real power of this would come by being able to access the other ds fields from within the "foo" subpatch. So maybe having some objects for getting a scalar's data from "within" the scalar: [getmy y i] <-- used within the "foo" subpatch, this will output the values of the fields when banged. [setmy y i] <-- same for setting. (Since we're already inside the scalar there's no need for sending pointers.) [notify] <-- output "change", "select", etc. messages only when they refer to this scalar Local variables! Deleting abstraction instances with [setsize]! The possibilities are endless! I have no idea how to program any of this! -Jonathan --- On Tue, 5/11/10, Joćo Pais <jmmmpais@googlemail.com> wrote:
|