Recently Written · git

recentlywritten

my writings (done recently)

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

Log | Files | Refs


git/Forthe/commit/4660cfbea38ef909abd2074af84b32bda8a9a0d8.html (4717 bytes)

1 <!DOCTYPE html>
2 <html lang="en"><head><meta charset="UTF-8" />
3 <meta name="viewport" content="width=device-width, initial-scale=1" />
4 <title>Forthe 4660cfbe - Recently Written</title>
5 <link rel="stylesheet" href="../../stagit.css" />
6 </head><body>
7 <div id="top"><a href="../../../index.html">Recently Written</a> &middot; <a href="../../index.html">git</a></div>
8 <h1>Forthe</h1><span class="desc">Forth-like DSL.</span><p class="url">git clone https://github.com/equwal/Forthe</p><p><a href="../../Forthe/index.html">Log</a> | <a href="../../Forthe/files.html">Files</a> | <a href="../../Forthe/refs.html">Refs</a></p><hr/>
9 <div id="content">
10 <pre>commit 4660cfbea38ef909abd2074af84b32bda8a9a0d8
11 Spenser Truex &lt;spensertruexonline@gmail.com&gt;
12 2018-12-16 11:23:29 -0800
13 
14 labels-&gt;flet for lexical binding.
15 
16 </pre><pre> eforth.el | 52 ++++++++++++++++++++++++++--------------------------
17  1 file changed, 26 insertions(+), 26 deletions(-)
18 </pre><pre>diff --git a/eforth.el b/eforth.el
19 index 06a2ae7..67a55b7 100644
20 --- a/eforth.el
21 +++ b/eforth.el
22 <span class="h">@@ -5,39 +5,39 @@</span>
23  (defun inner-eforth (lang list)
24    &quot;Forth without a return stack.&quot;
25    (let ((s))
26 <span class="d">-    (labels ((fn (fn) (if (functionp fn)</span>
27 <span class="d">-			  fn</span>
28 <span class="d">-			  (symbol-function fn))))</span>
29 <span class="a">+    (cl-flet ((fn (fn) (if (functionp fn)</span>
30 <span class="a">+                           fn</span>
31 <span class="a">+                         (symbol-function fn))))</span>
32        (dolist (i list)
33 <span class="d">-	(if (assoc i lang)</span>
34 <span class="d">-	    (let ((fn (cdr (assoc i lang))))</span>
35 <span class="d">-	      (if s</span>
36 <span class="d">-		  (progn (apply (fn fn) s) (setf s nil))</span>
37 <span class="d">-		(funcall (fn fn))))</span>
38 <span class="d">-	  (push i s))))))</span>
39 <span class="a">+        (if (assoc i lang)</span>
40 <span class="a">+            (let ((fn (cdr (assoc i lang))))</span>
41 <span class="a">+              (if s</span>
42 <span class="a">+                  (progn (apply (fn fn) s) (setf s nil))</span>
43 <span class="a">+                (funcall (fn fn))))</span>
44 <span class="a">+          (push i s))))))</span>
45  (defmacro eforth (lang list)
46    `(inner-eforth ,lang &#x27;,list))
47  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
48  ;; (defvar *my-env* &#x27;((ff . find-file)))        ;;
49 <span class="d">-;; (eforth *my-env* (&quot;~/bogus/&quot; ff))	        ;;</span>
50 <span class="d">-;; (eforth &#x27;((d . split-window-below))	        ;;</span>
51 <span class="d">-;; 	(d))				        ;;</span>
52 <span class="a">+;; (eforth *my-env* (&quot;~/bogus/&quot; ff))            ;;</span>
53 <span class="a">+;; (eforth &#x27;((d . split-window-below))          ;;</span>
54 <span class="a">+;;      (d))                                    ;;</span>
55  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
56  (defun 8pan ()
57    (interactive)
58    (eforth &#x27;((n . (lambda () (switch-to-buffer nil)))
59 <span class="d">-	   (d . split-window-below)</span>
60 <span class="d">-	   (r . split-window-right)</span>
61 <span class="d">-	   (wr . windmove-right)</span>
62 <span class="d">-	   (wl . windmove-left)</span>
63 <span class="d">-	   (wd . windmove-down)</span>
64 <span class="d">-	   (wu . windmove-up)</span>
65 <span class="d">-	   (del . delete-other-windows)</span>
66 <span class="d">-	   (cf . make-frame-command)</span>
67 <span class="d">-	   (nf . other-frame))</span>
68 <span class="d">-	  ;; (cf nf del r r wr wr r d wr d wl wl d wl d wr n wr n wr n wl wl wl wd n</span>
69 <span class="d">-	  ;;     wr n wr n wr n wl wl wl wu nf)</span>
70 <span class="d">-	  (cf del r r wr wr r d wr d wl wl d wl d</span>
71 <span class="d">-	       n wr n wr n wr n wd n wl n wl n wl n wu)</span>
72 <span class="d">-	  ))</span>
73 <span class="a">+           (d . split-window-below)</span>
74 <span class="a">+           (r . split-window-right)</span>
75 <span class="a">+           (wr . windmove-right)</span>
76 <span class="a">+           (wl . windmove-left)</span>
77 <span class="a">+           (wd . windmove-down)</span>
78 <span class="a">+           (wu . windmove-up)</span>
79 <span class="a">+           (del . delete-other-windows)</span>
80 <span class="a">+           (cf . make-frame-command)</span>
81 <span class="a">+           (nf . other-frame))</span>
82 <span class="a">+          ;; (cf nf del r r wr wr r d wr d wl wl d wl d wr n wr n wr n wl wl wl wd n</span>
83 <span class="a">+          ;;     wr n wr n wr n wl wl wl wu nf)</span>
84 <span class="a">+          (cf del r r wr wr r d wr d wl wl d wl d</span>
85 <span class="a">+               n wr n wr n wr n wd n wl n wl n wl n wu)</span>
86 <span class="a">+          ))</span>
87  (provide &#x27;eforth)</pre>
88 </div></body></html>