[PD] symbolarray

lsw lsw at floppy35.de
Mon Apr 20 18:10:48 CEST 2009


Hi Frank,

unfortunatily pd has next to no string functions (without externals).
Otherwise it shouldn't be too hard, to write a hashfunction
that retrieves a numeric hash for a given symbol, which could
be used as struct index.
At least something like get_character_of_symbol_at_position
and get_ascii_value_of_character would be needed to do so.

All the best,
Lsw~

Am 20.04.2009, 15:32 Uhr, schrieb Frank Barknecht <fbar at footils.org>:

> 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

-- 
~




More information about the Pd-list mailing list