[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

Re: [zzdev] Re: Named primitives (was: Re: [zzdev] I cannot compile!)

Tuomas Lukka wrote:
> > P.P.S. Oh yes: Of course scripting engines should subclass ZZCommand so
> > that scripts can be called as usual UI callbacks. If we change the ZOb
> > interface a bit, this could also be used for inter-language calls. -b.
> How?

By having a readParams method which takes a number of parameters as well
as a cell. That is, we pass a hashtable whose keys are structparam
identifiers and whose values are values for the structparams. readParams
then first reads the params from the structure (if not null, of course),
and then reads the params from the hashtable (that way, a param in the
hashtable can "override" a param in the structure).

A scripting language can then represent the params in any format it desires.

BTW: With this system, the dir action storing could work as follows:
- calling the dir action without a direction clones it next to the dir
action cell
- calling the cursor move action looks next to the dir action cell for
an action to execute (just as it does now), and then calls that action,
overriding the direction structparam.

- Benja