From: Tim Vaughan Date: Tue, 25 Oct 2016 04:03:54 +0000 (+1300) Subject: Added load primitive. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=scheme.forth.jl.git;a=commitdiff_plain;h=1a74d57182085535faef901d6940874bea3ad3c6 Added load primitive. --- diff --git a/fact.scm b/fact.scm deleted file mode 100644 index 0991511..0000000 --- a/fact.scm +++ /dev/null @@ -1,8 +0,0 @@ -; Demo scheme source file. - -(define (fact n) - (if (= n 0) - 1 - (* n (fact (- n 1))))) - -; Done! diff --git a/scheme.4th b/scheme.4th index 7626be8..0a237da 100644 --- a/scheme.4th +++ b/scheme.4th @@ -1433,6 +1433,15 @@ include scheme-primitives.4th again ; +:noname ( args -- finalResult ) + 2dup 1 ensure-arg-count + car string-type ensure-arg-type + + drop pair-type + pad charlist>cstr + pad swap load +; make-primitive load + \ }}} \ ---- REPL ---- @@ -1460,9 +1469,6 @@ include scheme-primitives.4th again ; -: test s" fact.scm" ; -test load 2drop - forth definitions \ vim:fdm=marker