You may specify, for each slot in a structure, just which categories of users are allowed to read or write that slot, using a fixed system of four user categories:
]defstruct
.
The point of the class category is to allow the creation of structures which are owned (and counted against the space quota) of a user, but which are maintained by code written by another user.
For example, in a game context it may be desirable for each player to own a per-player state structure containing score and location, but not for each player to be able to randomly update score and location.
As examples, we show first the extreme case of
defining a structure type blackhole
whose
single hadron
slot is completely
inaccessable (you'll need to be root to have this
work properly)
root: [ 'blackhole 'hadron :rootMayRead nil :rootMayWrite nil :userMayRead nil :userMayWrite nil :classMayRead nil :classMayWrite nil :worldMayRead nil :worldMayWrite nil | ]defstruct
and then a structure type blackboard
whose
single slate
slot is both readable and writable
by everyone
root: [ 'blackboard 'slate :worldMayRead t :worldMayWrite t | ]defstruct
and finally a structure type spacewar
with
slots readable by the user but only modifiable by
the class:
root: [ 'spacewar 'score :initval 0 :userMayRead t :userMayWrite nil :classMayRead t :classMayWrite t :worldMayRead nil :worldMayWrite nil 'x-loc :initval 0.0 :userMayRead t :userMayWrite nil :classMayRead t :classMayWrite t :worldMayRead nil :worldMayWrite nil 'y-loc :initval 0.0 :userMayRead t :userMayWrite nil :classMayRead t :classMayWrite t :worldMayRead nil :worldMayWrite nil | ]defstruct
Go to the first, previous, next, last section, table of contents.