Quantcast
Channel: Cadence Technology Forums
Viewing all articles
Browse latest Browse all 62914

Forum Post: RE: Assigning key/value pair in disembodied property list

$
0
0
Disembodied property lists are a long-standing simple way of representing structured data in lists, one of the primitive datatypes in SKILL. They are not intended for general purpose key-value pairs - the only keys that are supported are symbols. If you need a data structure that can handle other object types as keys, then you can use hash tables (which have been in SKILL for over 25 years, so are not exactly new). DPLs are not really so good for arbitrary keys - they're mostly for objects with a small number of keys. Property lists on symbols are used for some operations, but because they are tied to the symbol containing them, they are mostly used for settings where you don't have a variable number of objects. I use them from time to time to represent persistent state (although a better way is to use SKILL++ lexical scoping and the closures that offers). Note you can also use the -> operator with symbols and hash tables. So doing: data=makeTable('data nil) data->value=10 data->suit="clubs" data->?? Or: data2='mySymbol data2->value=10 data2->suit="hearts" data2->?? mySymbol.suit mySymbol.?? Regards, Andrew.

Viewing all articles
Browse latest Browse all 62914

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>