|
57 | 57 | :prop (format nil "~a" exp) |
58 | 58 | :truth (truth-table exp))) |
59 | 59 |
|
60 | | -(defun update-table (table exp) |
61 | | - (setf (prop table) (format nil "~a" exp)) |
62 | | - (setf (truth table) (truth-table exp))) |
63 | | - |
64 | | -(defgeneric update-proposition (table exp)) |
| 60 | +(defgeneric update-table (table exp)) |
65 | 61 |
|
66 | | -(defmethod update-proposition (table (exp list)) |
67 | | - (update-table table exp) |
| 62 | +(defmethod update-table (table (exp list)) |
| 63 | + (setf (prop table) (format nil "~a" exp)) |
| 64 | + (setf (truth table) (truth-table exp)) |
68 | 65 | (update table)) |
69 | 66 |
|
70 | | -(defmethod update-proposition (table (string string)) |
71 | | - (update-proposition |
72 | | - table |
73 | | - (parse-string string))) |
| 67 | +(defmethod update-table (table (exp string)) |
| 68 | + (update-table |
| 69 | + table |
| 70 | + (parse-string exp))) |
74 | 71 |
|
75 | 72 | (defmethod render ((table table)) |
76 | 73 | (with-html |
77 | 74 | (:h1 "Lisp Inference Truth Table System") |
78 | 75 | (with-html-form (:POST (lambda (&key prop &allow-other-keys) |
79 | | - (update-proposition table prop))) |
| 76 | + (update-table table prop))) |
80 | 77 | (:input :type "text" |
81 | 78 | :name "prop" |
82 | 79 | :placeholder (prop table)) |
|
87 | 84 | (:p "Some notes: " |
88 | 85 | (:ul |
89 | 86 | (loop for note in *notes* |
90 | | - do (:li (render note))))) |
| 87 | + do (:li (render-note note))))) |
91 | 88 | (:span "Source: " |
92 | 89 | (:a :href "https://github.com/ryukinix/lisp-inference" |
93 | 90 | "ryukinix/lisp-inference")) |
|
96 | 93 | (:a :href |
97 | 94 | "https://lerax.me/lisp-inference" "lerax.me/lisp-inference")))) |
98 | 95 |
|
99 | | -(defmethod render ((string string)) |
| 96 | +(defun render-note (string) |
100 | 97 | (with-html |
101 | 98 | (:pre string))) |
102 | 99 |
|
|
0 commit comments