Commit a64290e5 authored by Bernd Paysan's avatar Bernd Paysan

make intsem: more intuitive

parent 3b3e6f2b
Pipeline #866 passed with stage
in 9 minutes and 56 seconds
...@@ -25,14 +25,16 @@ ...@@ -25,14 +25,16 @@
\ :noname ." compiling" ; \ :noname ." compiling" ;
\ : foo ." interpreting" ; set-compsem \ : foo ." interpreting" ; set-compsem
: intsem: ( xt "name" -- ) : intsem: ( -- )
\G defines a word, which has a special compilation semantics \G changes the current semantics to be the non-default compilation
\G provided as @var{xt} on the stack \G semantics, and adds another interpretation semantics to the last
[n:d nip ['] execute ;] >r \G definition
: r> set->comp ; [: ['] execute ;] set->comp
int-[: [: nip >r vt, wrap! r> [n:d nip ;] set->int ;]
colon-sys-xt-offset stick ;
\ silly example: \ silly example:
\ :noname ." compiling" ; intsem: foo ." interpreting" ; \ : foo ." compiling" ; intsem: ." interpreting" ;
: compsem: ( -- ) : compsem: ( -- )
\G adds a non default compilation semantics to the last \G adds a non default compilation semantics to the last
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment