Print definition of a function in Forth

862 Views Asked by At

When a word is already defined in Forth, is there a way to print its definition?

I've heard that many of Forth's built-in functions such as emit, drop, etc. are defined in terms of the language itself, and I'd like to be able to look at their definitions.

1

There are 1 best solutions below

0
On BEST ANSWER

You can usually use

see emit

Which in Gforth gives you something like:

: (emit)
  outfile-id emit-file drop ;
latestxt
Defer emit
IS emit
 ok