Added load primitive.
authorTim Vaughan <tgvaughan@gmail.com>
Tue, 25 Oct 2016 04:03:54 +0000 (17:03 +1300)
committerTim Vaughan <tgvaughan@gmail.com>
Tue, 25 Oct 2016 04:03:54 +0000 (17:03 +1300)
fact.scm [deleted file]
scheme.4th

diff --git a/fact.scm b/fact.scm
deleted file mode 100644 (file)
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!
index 7626be8..0a237da 100644 (file)
@@ -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