Files
KOS_qrcodes/programs/develop/SPForth/src/compiler/spf_modules.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

37 lines
862 B
Forth
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
( Working with forth modules
Copyright [C] 2000 D.Yakimov day@forth.org.ru
)
: MODULE: ( "name" -- old-current )
\ start a forth module
\ åÓÌÉ ÔÁËÏÊ ÍÏÄÕÌØ ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ, ÐÒÏÄÏÌÖÉÔØ ËÏÍÐÉÌÑÃÉÀ × ÎÅÇÏ
>IN @ ['] ' CATCH
IF >IN ! VOCABULARY GET-CURRENT
ALSO LATEST NAME> EXECUTE DEFINITIONS
ELSE
NIP GET-CURRENT SWAP ALSO EXECUTE DEFINITIONS
THEN
;
: EXPORT ( old-current -- old-current )
\ export some module definitions
DUP SET-CURRENT
;
: ;MODULE ( old-current -- )
\ finish the module
SET-CURRENT PREVIOUS
;
: {{ ( "name" -- )
\ ëÌÁÄÅÔ × ORDER wordlist, Ë-ÙÊ ÄÁÓÔ "name"
\ ÉÌÉ vocabulary ÅÓÌÉ "name" - vocabulary
DEPTH >R
ALSO ' EXECUTE
DEPTH R> <> IF \ wid on the stack?
CONTEXT ! THEN
; IMMEDIATE
: }}
PREVIOUS
; IMMEDIATE