diff options
| author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2015-05-12 03:27:06 +0000 |
|---|---|---|
| committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2015-05-12 03:27:06 +0000 |
| commit | f4e75c6395310fa4b119d3eaa9a4a9f8913df200 (patch) | |
| tree | 2b015c205d81fa2431f0c36d7d9e903088a56d1c /softcore/prefix.fr | |
| parent | be98e1ae3decabdd852fbe6496166aaa9acfbf9e (diff) | |
Update to ficl 4.1.0 (latest release on sourceforge)vendor/ficl/4.1.0vendor/ficl
Notes
svn path=/vendor/ficl/dist/; revision=282803
svn path=/vendor/ficl/4.1.0/; revision=282804; tag=vendor/ficl/4.1.0
Diffstat (limited to 'softcore/prefix.fr')
| -rw-r--r-- | softcore/prefix.fr | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/softcore/prefix.fr b/softcore/prefix.fr new file mode 100644 index 000000000000..3c368d66ea75 --- /dev/null +++ b/softcore/prefix.fr @@ -0,0 +1,47 @@ +\ ** +\ ** Prefix words for ficl +\ ** submitted by Larry Hastings, larry@hastings.org +\ ** +\ (jws) To make a prefix, simply create a new definition in the <prefixes> +\ wordlist. start-prefixes and end-prefixes handle the bookkeeping + +variable save-current + +: start-prefixes get-current save-current ! <prefixes> set-current ; +: end-prefixes save-current @ set-current ; +: show-prefixes <prefixes> >search words search> drop ; + +start-prefixes + +S" FICL_WANT_EXTENDED_PREFIX" ENVIRONMENT? drop [if] + +\ define " (double-quote) as an alias for s", and make it a prefix +: " postpone s" ; immediate + + +\ make .( a prefix (we just create an alias for it in the prefixes list) +: .( postpone .( ; immediate + + +\ make \ a prefix, and add // (same thing) as a prefix too +: \ postpone \ ; immediate +: // postpone \ ; immediate + + +\ ** add 0b, 0o, 0d, and 0x as prefixes +\ ** these temporarily shift the base to 2, 8, 10, and 16 respectively +\ ** and consume the next number in the input stream, pushing/compiling +\ ** as normal +\ ** +\ ** __tempbase is precompiled, see prefix.c + +: 0b 2 __tempbase ; immediate +: 0o 8 __tempbase ; immediate + +[endif] + +: 0d 10 __tempbase ; immediate +: 0x 16 __tempbase ; immediate + +end-prefixes + |
