At 6:01 AM +0200 on 6/22/99, M. Uli Kusterer wrote:

>>* Interpreter: Now that we have an interpreter running, should we be dishing
>>out the implementation of the various xTalk commands? Perhaps we could
>>establish an interface so that anyone could, for example, write a C function
>>which implements the "answer" command.
>
> I believe Anthony is working on such an interface (It's not in the current
>snapshot, but we asked him to add it some time ago).

It's in the next snapshot which is due out as soon as it runs :)

Basicly, you need a function:

        void MyFunction(QuickStack<OTVar>&input, OTVar &output);

This function is then registered based on it's HyperTalk name with a class
which handles such things.

You register using this function:
        MapFunction(const OTString &, const Function_base *);

You create a Function_base which calls a C function like this:

        news CPlusPlusFunctionCaller(void (*)(QuickStack<OTVar> &, OTVar &));

So, all in all, you'd do this:

        MapFunction("MyFunction",new CPlusPlusFunctionCaller(MyFunction));

(BTW: MapFunction is a member function...)

Also, functions will evenutally be mapped to HyperTalk ones.


>(I still have to send it to a few people,
>do you want a copy?) to see whether it's at all possible).

Please send me one -- I've got plenty of time on my hands now :)

Reply via email to