next up previous contents index
Next: File handling Up: The workspace Previous: Concept of variables   Contents   Index

Property Lists

Now, you can define property lists with XLogo. Each list has a specific name and contains some key-value couples.

For example, we can consider a property list named ''car``. It should contain the key ''color`` associated to the value ''red``, or the key ''type`` and the value ''4x4``.

To handle these lists, we can use the following primitives:
Let's return to the property list called ''car``.
# Filling property list 
pprop "car "color "red
pprop "car "type "4x4
pprop "car "vendor "Citroën

# Display one value
print gprop "car "color
red

# Display all elements
print plist "car
color red type 4x4 vendor Citroën


next up previous contents index
Next: File handling Up: The workspace Previous: Concept of variables   Contents   Index
Loïc 2008-06-08