Liste des Groupes | Revenir à cl forth |
I was impressed with the Behringer solution.<snipped>
(I didn't care about the politically correct solution.)
====================================
: local{ R> SWAP DUP >R @ >R >R ;
: }global R> R> R> ! >R ;
=================
But I can do you one better.
Remember the word ;: from colorforth. That is actually a coroutine call.
I call it CO. (Present in ciforth since the year 00)
With CO the example becomeCouldn't find the source for either CO or ;: but I got some primitive, high level form of co-routine in 4tH:
---------------------------------------
: LOCAL R> SWAP DUP >R @ >R >R CO R> R> ! ;
VARIABLE A
VARIABLE B
: divide
A LOCAL
B LOCAL
B ! A ! A @ B @ /
. CR
;
15 3 divide
---------------------------------------
This saves a definition and a word-of-code, and a line for every
LOCAL used. Now that is closer to what Chuck Moore would have used.
Remember for Moore CO aka ;: is a standard word.
CO is not standard but it should be, and it is elementary as hell.
Les messages affichés proviennent d'usenet.