Recently Written · git

Forthe

Forth-like DSL.

git clone https://github.com/equwal/Forthe

Log | Files | Refs


commit 9a9eef29928431347cecb19eef84cbd840ea7ffd
Spenser Truex <spensertruexonline@gmail.com>
2018-12-05 20:44:08 -0800

Bug.

 eforth.el | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/eforth.el b/eforth.el
index 27df4a4..5549223 100644
--- a/eforth.el
+++ b/eforth.el
@@ -2,20 +2,20 @@
   (let ((l))
     (dolist (i list-of-lists (nreverse l))
       (push (list it i) l))))
-(defmacro inner-eforth (lang list)
+(defun inner-eforth (lang list)
   "Forth without a return stack."
-  `(progn ,@(let ((s) (l))
-	      (dolist (i list (nreverse (add-to-each 'funcall l)))
-		(if (assoc i lang)
-		    (let ((fn (cdr (assoc i lang))))
-		      (if s
-			  (progn (push `(lambda () (funcall #',fn ,@s)) l)
-				 (setf s nil))
-			(push `(lambda () (,fn)) l)))
-		  (push i s))))))
+  (progn (let ((s) (l))
+	   (dolist (i list (nreverse (add-to-each 'funcall l)))
+	     (if (assoc i lang)
+		 (let ((fn (cdr (assoc i lang))))
+		   (if s
+		       (progn (apply (symbol-function fn) s) (setf s nil))
+		     (funcall (symbol-function fn))))
+	       (push i s))))))
 (defmacro eforth (lang list)
-  `(inner-eforth ,(cadr lang) ,list))
-(eforth '((ff . find-file)) ("~/bogus/" ff))
+  `(inner-eforth ,lang ',list))
+(defvar *my-env* '((ff . find-file)))
+(eforth *my-env* ("~/bogus/" ff))
 (eforth '((d . split-window-below))
 	(d))
 (defun 8pan ()