From 8a97d64adef87a9f12824c5653bc5182b9a4f06d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Mon, 23 Mar 2026 09:29:01 -0300 Subject: Turn literal into a function --- extra.lisp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extra.lisp b/extra.lisp index 9805ca0..fc19da8 100644 --- a/extra.lisp +++ b/extra.lisp @@ -16,7 +16,7 @@ (if x (cons x xs) x)) nothing))) -(defmacro literal (word) +(defun literal (word) (when (not (stringp word)) (error "Literal only accepts strings as input.")) (let ((binding-list '()) @@ -26,8 +26,8 @@ (let ((name (gensym))) (push name name-list) (push `(,name (unit ,c)) binding-list)))) - `(comp ,(reverse binding-list) - ,(cons 'list (reverse name-list))))) + (eval `(comp ,(reverse binding-list) + ,(cons 'list (reverse name-list)))))) (declaim (ftype (function (parser parser &optional parser) parser) within)) (defun within (left p &optional right) -- cgit v1.2.3