File: defer.fs

package info (click to toggle)
gforth 0.5.0-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,776 kB
  • ctags: 927
  • sloc: ansic: 4,142; sh: 1,938; lisp: 1,366; makefile: 661; sed: 141
file content (21 lines) | stat: -rw-r--r-- 411 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
\ deferred words and perform

\ This file is in the public domain. NO WARRANTY.

: noop ;

: perform ( ? addr -- ? )
    @ execute ;

: defer ( "name" -- )
    create ['] noop , \ you should not rely on initialization with noop
does> ( ? -- ? )
    perform ;

: <is> ( xt "name" -- )
    ' >body ! ;

: [is] ( compilation: "name" -- ; run-time: xt -- )
    ' >body postpone Literal postpone ! ; immediate