User primitives in Squeak

Ian Piumarta piumarta at
Mon Dec 22 15:34:01 UTC 1997


> I found that there are some things which make
> 1.23 MUCH less pleasant to develop such stuff on than v1.18.

You can always ignore the user primitive stuff entirely, and just carry your
primitives forward from 1.18 to 1.23 if you prefer.  The mechanism for
"intrinsic" primitives numbered from 1 to 600 (or 700, I can't remember) has
not changed since 1.18.

The UP support is unofficial, unsupported, and (originally) specific to Unix
(and maybe some versions of Andreas's Win32 ports -- since I originally did
it speficially to help Andreas make faster progress with his GL stuff), and
nobody is suggesting that you use it if you don't like it.

> 1)  User primitive fail code doesn't seem to work.
>       myMethod
>           <primitive: 1500>
>           ^'hello there!'
> If the primitive fails, I get the usual <error: primitiveFailed>
> instead of hello there.

A bug -- I'll look into it.

> 2)  I can pass only 7 parameters to the primitive.  This is
> completely unacceptable for my tasks.

This is an arbitrary limit that is trivial to increase.  Look at the
Interpreter method #userPrimitiveResponse and it should be obvious how to
increase the number of arguments that can be passed.

> 3)  In 1.18, where I write my own primitive code, I can analyse
> the arg count myself and thus develop a primitive to take variable
> number of parameters;  can I do anything similar here?

Like I said, the original primitive stuff has not changed.  You can still use
precisely the same mechanism in 1.23.

For the UPs, the above could only be done by changing the way user primitives
expect to receive their arguments.  For example, if they were prepared to be
passed an argument count and a pointer to the first argument, and then to
pick up their arguments by indirecting through this pointer with an index,
then yes -- it would be easy.

On the other hand, if the UPs want to receive arguments in a C-like fashion
then it's much harder to do in a portable manner.

I'm not particularly attached to the UP facility, implementation, philosphy,
or anything else.  If it should be done differently, or even not at all, then
change it.

> P.S.:  At the time you will be about to publish the next Unix
> release, could you send it to me just before announcing it so
> I can verify if it compiles/runs on OS/2, so you can announce
> it as a release "for Unix, including OS/2"?

No problem!


------------------------------- projet SOR -------------------------------
Ian Piumarta, INRIA Rocquencourt,          Internet: Ian.Piumarta at
BP105, 78153 Le Chesnay Cedex, FRANCE         Voice: +33 1 39 63 52 87
----------------------- Systemes a Objets Repartis -----------------------

More information about the Squeak-dev mailing list