Hi Jon,

> I just noticed that in 32-bit PicoLisp (pre? 12 1234) returns the
> symbol "1234", while in ersatz the same (pre? 12 1234) returns the
> number 1234. The latter is what the docs describes.

Well, this is indeed not very clear. Strictly speaking, the docs define
the return value only for symbolic arguments:

   : (pre? "ab" 'abcd)
   -> abcd

   : (pre? "ab" "abcd")
   -> "abcd"

However, most functions that expect a symbol name to operate upon,
silently convert non-symbolic arguments to transient symbols internally
before performing the desired task.

This has purely practical reasons. The argument may also be a number or
a list (e.g. a 'chop'ped symbol), so that it it not necessary to 'pack'
it explicitly. You can, for example, (open <num>) on a numeric file name
(e.g. as the result of a computation).

You find many of such cases in if you look for 'evSym' (in the C
sources) or 'evSymX_E', 'evSymY_E', 'evSymE_E, or 'xSymE_E' (in the
assembly sources).

Ersatz is a bit wrong in this regard. But due to the different internal
mechanisms this doesn't work out well.

> I have not tested this in 64-bit PicoLisp.

It gives the same results as pil32.

♪♫ Alex
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to