From 67d25d837ac55f28a366c0a3b262e439a6e75fc3 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 19 Aug 2017 12:15:28 +0200 Subject: Add AmForth --- amforth-6.5/examples/forward-declarations.frt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 amforth-6.5/examples/forward-declarations.frt (limited to 'amforth-6.5/examples/forward-declarations.frt') diff --git a/amforth-6.5/examples/forward-declarations.frt b/amforth-6.5/examples/forward-declarations.frt new file mode 100644 index 0000000..274edf4 --- /dev/null +++ b/amforth-6.5/examples/forward-declarations.frt @@ -0,0 +1,23 @@ +: forward: + dp + create + , + \ save more information? + does> + \ get the current name and + \ lookup the dictionary. get the + \ XT and replace the dictionary entry in the + \ *caller* with it. After that execute it too + \ next code is executed only once if successful + dup 1- swap @i here iplace here count ( copy to temporary ram) + find-name if \ unless some wordlist voodoo is in place... + swap over = abort" found only forward declaration." + dup r@ 1- !i execute + else + \ can only happen if search wordlist has changed + true abort" unresolved forward declaration" + then +; + + + -- cgit v1.2.3