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

Re: [zzdev] Primitive commands



On 20000826T235340+0300, Tuomas Lukka wrote:
> Benjamin and AJ, please explain and coordinate your respective views about
> connecting commands (in any language) to cells... 

Primitives in Thales Clang:

I've already partially implemented the following for Thales Clang.
I've shown the design to Ted and I think we both agree it's the best
compromise between the traditional "text in cells" binding, which is
not good, and "magical cells" binding, which is not persistent:

All Thales Clang primitives are on one rank along d.thales-primitives
whose headcell is the space homecell.  Each primitive is connected
posward along d.thales-primitive-binding to a cell containing a magic
string that identifies the primitive.

Procedures in Thales Clang:

A procedure in Thales Clang is represented by an "identity cell" that lies
on a rank along d.thales-syntactic-form whose headcell somehow (probably
using a similar mechanism as primitives) identifies the other cells on
the rank as being procedures.  The identity cell is then connected to a
list of formal parameters and to a Thales Clang expression that is the
procedure body.

Thales Clang programs:

This is still to be designed.  The basic idea is to have programs to be
wrapped-up procedures.   Firing up a program will probably initialize
a procedure context where the program procedure is then evaluated.
Since the program is a procedure, it can get any number of positional
parameters but not easily any keyword parameters, and it can return a
cell reference (I'm thinking of ignoring the return value of the main
procedure).

> We need something that works now and expands non-painfully for several
> different clangs... and we should explicitly spec it somewhere.

Well, some Clangs (such as Thales Clang) will know only positional
parameters for procedures, so the ZOb method is not very good for those.

Personally I'd like to have Thales Clang working before we commit to a
design here.

-- 
%%% Antti-Juhani Kaijanaho % gaia@xxxxxx % http://www.iki.fi/gaia/ %%%