From d80736ab6e8e3cad2f1a30c6eaba2d6883dbe967 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 26 Aug 2017 20:31:40 +0200 Subject: Remove AmForth --- amforth-6.5/examples/literacy.frt | 49 --------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 amforth-6.5/examples/literacy.frt (limited to 'amforth-6.5/examples/literacy.frt') diff --git a/amforth-6.5/examples/literacy.frt b/amforth-6.5/examples/literacy.frt deleted file mode 100644 index b9b0bd9..0000000 --- a/amforth-6.5/examples/literacy.frt +++ /dev/null @@ -1,49 +0,0 @@ -\ from Newsgroups: comp.lang.forth -\ Date: Sun, 28 Dec 2014 14:12:44 -0800 (PST) -\ Message-ID: -\ Subject: String literacy -\ From: Julian Fondren -\ Adapted to most recent recognizer RFD - - -\ Also, notice how I intend code by two spaces? That makes it very -\ clear what's code and what's me talking about code, without the -\ reader having to keep switching between two files, say. It also -\ allows me to tie documentation and source together in such a way -\ that one will seldom be supplied without the other. You could -\ even organize your code into 'blocks', with corresponding 'shadow -\ blocks' ... well, once again, let's just do it: - -\ This is the entire contents of literate.fs: - - ' noop ' noop ' noop recognizer: r:noop - : literacy-recognizer ( c-addr u -- r:noop | r:fail ) - 2drop source s" " string-prefix? if r:fail else 0 parse 2drop r:noop then ; - - \ place it at the top of the recognizer stack - forth-recognizers get-recognizers - 1+ ' literacy-recognizer swap - forth-recognizers set-recognizers - -And the entire rest of my post will be the contents of a file -named hello.fs, which makes use of it: - ---- hello.fs begins next line --- - require literate.fs - -Having required literate.fs, the rest of this file is commentary unless -intended by two spaces. - -For example, Forth will pass over the following: - -: hello ( -- ) cr ." Hello!" ; - -But will compile and execute these indented statements: - - : goodbye ( -- ) - cr ." Good bye." ; - - goodbye bye bye bye - -(This behavior is also seen interactively.) - -- cgit v1.2.3