[PD] symbolarray

Frank Barknecht fbar at footils.org
Mon Apr 20 15:32:52 CEST 2009


Hallo,
Chris McCormick hat gesagt: // Chris McCormick wrote:

> On Fri, Apr 17, 2009 at 03:52:33PM +0200, Frank Barknecht wrote:
> > Now we still need maps/hashes.
> 
> Maybe this is something close:
> <http://lists.puredata.info/pipermail/pd-list/2008-03/060712.html>

Yeah, but I was thinking of something faster than walking around in a textfile
would be. :) The really nice thing about data structure arrays is that they are
very fast. The not so nice things are that they only accept integers for lookup
and that the structure of the thing they store has to be predefined.

What I would love would be a "map" type field for [struct] so you could say: 

[struct item float i]

[struct example map items item]

just like for the "array" field. But now the index to lookup a map element
would be a symbol key.

The setter could look like this: 

            [symbol key(
            | 
            [mapelement example items]
 [100\      | 
 |          |
 [set item i]

and a getter like this:

 [symbol key(
 | 
 [mapelement example items]
 |  
 [get item i]
 | 
 [100\

All in analogy to [element] for arrays

Ciao
-- 
Frank




More information about the Pd-list mailing list