lisp/polish.lisp

9 lines
240 B
Common Lisp
Raw Normal View History

2024-12-16 14:34:52 -05:00
(load "utils.lisp")
(defun unpole (xs)
(if (inq (car xs) + - * / ^)
(mvbind (lhs rest) (unpole (cdr xs))
(mvbind (rhs rest) (unpole rest)
(values (list (car xs) lhs rhs) rest)))
(values (car xs) (cdr xs))))