Post Reply 
DOSUBS with binary operations
05-15-2022, 08:48 PM
Post: #5
RE: DOSUBS with binary operations
(05-15-2022 06:27 PM)John Keith Wrote:  You can however use :: * DTAG DOLIST which has a slight speed advantage at the cost of obscurity.

I was running:
Code:
:: DUP
DTAG

And I just got DUP on the stack.
Then I ran TYPE on it to get 19 which means:
Built-in command

Or then with * I got 18 which means:
Built-in function

Somehow I've always thought that a program (i.e. \<< … \>>) is similar to quote (or ') in Lisp.
But as it turns out, we can do the same by adding an empty tag to a built-in function or command and then removing it again using the DTAG command.
In both cases the immediate execution is postponed, which is what we want.

Thanks for your explanation: that was enlightening.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: DOSUBS with binary operations - Thomas Klemm - 05-15-2022 08:48 PM



User(s) browsing this thread: 1 Guest(s)