File: vocabulary.fs

package info (click to toggle)
gforth 0.7.2%2Bdfsg1-1.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,332 kB
  • ctags: 2,064
  • sloc: ansic: 8,506; sh: 3,643; lisp: 1,780; makefile: 984; yacc: 186; sed: 141; lex: 102; awk: 21
file content (28 lines) | stat: -rw-r--r-- 561 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
\ vocabulary

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

\ The program uses the following words
\ from CORE :
\ : Create , DOES> @ >r dup 0= and r> swap ; 
\ from CORE-EXT :
\ nip 
\ from BLOCK-EXT :
\ \ 
\ from EXCEPTION :
\ throw 
\ from FILE :
\ ( 
\ from SEARCH :
\ wordlist get-order set-order 

: vocabulary ( -- )
    wordlist create ,
does> ( -- )
    \ replaces the wordlist on the top of the search list with the
    \ vocabulary's wordlist
    @ >r
    get-order dup 0= -50 and throw \ search-order underflow
    nip r> swap
    set-order ;