Slightly clean up the example program in main
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
(fn parse-integers (input) (-> (string) list)
|
(fn parse-integers (input) (-> (string) list)
|
||||||
(->> input
|
(->> input
|
||||||
(uiop:split-string)
|
uiop:split-string
|
||||||
(mapcar #'parse-integer*)
|
(mapcar #'parse-integer*)
|
||||||
(remove-if #'null)))
|
(remove-if #'null)))
|
||||||
|
|
||||||
@@ -39,9 +39,11 @@
|
|||||||
(let ((inp (read-integers)))
|
(let ((inp (read-integers)))
|
||||||
(while (null inp)
|
(while (null inp)
|
||||||
(format t "Need at least one integer...~%")
|
(format t "Need at least one integer...~%")
|
||||||
|
(force-output)
|
||||||
(setq inp (read-integers)))
|
(setq inp (read-integers)))
|
||||||
inp))
|
inp))
|
||||||
|
|
||||||
(defun start ()
|
(defun start ()
|
||||||
(--> (read-until-integers)
|
(--> (read-until-integers)
|
||||||
(format t "~a = ~a~%" (cons '+ _) (reduce #'+ _))))
|
(cons '+ _)
|
||||||
|
(format t "~a = ~a~%" _ (eval _))))
|
||||||
|
|||||||
Reference in New Issue
Block a user