2 \ ** Prefix words for ficl
3 \ ** submitted by Larry Hastings, larry@hastings.org
5 \ (jws) To make a prefix, simply create a new definition in the <prefixes>
6 \ wordlist. start-prefixes and end-prefixes handle the bookkeeping
10 : start-prefixes get-current save-current ! <prefixes> set-current ;
11 : end-prefixes save-current @ set-current ;
12 : show-prefixes <prefixes> >search words search> drop ;
16 S" FICL_WANT_EXTENDED_PREFIX" ENVIRONMENT? drop [if]
18 \ define " (double-quote) as an alias for s", and make it a prefix
19 : " postpone s" ; immediate
22 \ make .( a prefix (we just create an alias for it in the prefixes list)
23 : .( postpone .( ; immediate
26 \ make \ a prefix, and add // (same thing) as a prefix too
27 : \ postpone \ ; immediate
28 : // postpone \ ; immediate
31 \ ** add 0b, 0o, 0d, 0x and $ as prefixes
32 \ ** these temporarily shift the base to 2, 8, 10, and 16 respectively
33 \ ** and consume the next number in the input stream, pushing/compiling
36 \ ** __tempbase is precompiled, see prefix.c
38 : 0b 2 __tempbase ; immediate
39 : 0o 8 __tempbase ; immediate
43 : 0d 10 __tempbase ; immediate
44 : 0x 16 __tempbase ; immediate
45 : $ 16 __tempbase ; immediate