Liste des Groupes | Revenir à cl forth |
On Tue, 30 Jul 2024 15:16:28 +0000, Stephen Pelc wrote:The standard suggests/specifies that operators such as TO behave as if
they parse. Ignore that for the moment and define
variable operator
: to 1 operator ! ; immediate
A child of VALUE is probably an immediate word that inspects OPERATOR
and compiles the fetch action if 0 or the store action if 1. This scheme
can
be extended to support a wide range of operators, such as +TO INCR DECR
and so on. MPE has used this scheme for several decades with no tech
support issues. If you really want to to be fussy and avoid the use of
the
"as if" rule for parsing, you can do something like (untested) the below
for TO. But why bother?
: to
1 operator ! ' execute
; immediate
Thank you. So instead of wasting time on parsing during compilation- or
interpretation time, the runtime action of an xVALUE (even when
compiled)
involves to walk a type-specific operator chain (a large CASE construct
in VFX). This makes them slower when compiled, but why not.
Les messages affichés proviennent d'usenet.