Skip to content

Commit a6616da

Browse files
committed
Uses "read-from-string" to parse the input as a list
1 parent 36cd465 commit a6616da

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

web/webapp.lisp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@
4242

4343
(defun parse-string (string)
4444
"Translate string to a list expression"
45-
(mapcar (lambda (x)
46-
(intern (string-upcase x) :lisp-inference))
47-
(str:words string)))
45+
(if (and (str:starts-with-p "(" string)
46+
(str:ends-with-p ")" string))
47+
(read-from-string string)
48+
(read-from-string (str:concat "(" string ")"))))
4849

4950
(defun trim-paren (string)
5051
(string-trim '(#\( #\)) string))

0 commit comments

Comments
 (0)