kolibrios/programs/develop/SPForth/devel/~nn/lib/ifdef.f
Kirill Lipatov (Leency) 09488af869 KolSPForth12 uploaded to SVN
git-svn-id: svn://kolibrios.org@4867 a494cfbc-eb01-0410-851d-a64ba20cac60
2014-04-21 19:22:58 +00:00

22 lines
383 B
Forth

C" [DEFINED]" FIND NIP 0=
[IF]
: [DEFINED] ( -- f ) \ "name"
NextWord SFIND IF DROP TRUE ELSE 2DROP FALSE THEN
; IMMEDIATE
: [UNDEFINED] ( -- f ) \ "name"
POSTPONE [DEFINED] 0=
; IMMEDIATE
[THEN]
: [IFDEF]
POSTPONE [DEFINED]
0= IF POSTPONE [ELSE] THEN
; IMMEDIATE
: [IFNDEF]
POSTPONE [UNDEFINED]
0= IF POSTPONE [ELSE] THEN
; IMMEDIATE