We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 36cd465 + 8523ef4 commit 0216fc3Copy full SHA for 0216fc3
web/webapp.lisp
@@ -42,12 +42,10 @@
42
43
(defun parse-string (string)
44
"Translate string to a list expression"
45
- (mapcar (lambda (x)
46
- (intern (string-upcase x) :lisp-inference))
47
- (str:words string)))
48
-
49
-(defun trim-paren (string)
50
- (string-trim '(#\( #\)) string))
+ (if (and (str:starts-with-p "(" string)
+ (str:ends-with-p ")" string))
+ (read-from-string string)
+ (read-from-string (str:concat "(" string ")"))))
51
52
(defun truth-table (exp)
53
(with-output-to-string (s)
@@ -81,7 +79,7 @@
81
79
(update-proposition table prop)))
82
80
(:input :type "text"
83
:name "prop"
84
- :placeholder (trim-paren (prop table)))
+ :placeholder (prop table))
85
(:input :type "submit"
86
:value "Eval"))
87
(:pre (truth table))
0 commit comments