From 9e69646e7bfa770418456980c9145ba1fea820a2 Mon Sep 17 00:00:00 2001 From: Iqbal Ansari Date: Wed, 17 Aug 2016 00:31:31 +0530 Subject: [PATCH] Remove the need to quote symbols in switch-mal-type --- common_lisp/printer.lisp | 18 +++++++++--------- common_lisp/types.lisp | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/common_lisp/printer.lisp b/common_lisp/printer.lisp index c7279d81..a6f123fb 100644 --- a/common_lisp/printer.lisp +++ b/common_lisp/printer.lisp @@ -33,15 +33,15 @@ (defun pr-str (ast) (when ast (let ((repr (switch-mal-type ast - ('types:number (format nil "~d" (types:mal-value ast))) - ('types:boolean (if (types:mal-value ast) "true" "false")) - ('types:nil "nil") - ('types:string (format nil "~s" (types:mal-value ast))) - ('types:symbol (format nil "~a" (types:mal-value ast))) - ('types:keyword (format nil ":~a" (types:mal-value ast))) - ('types:list (pr-mal-sequence "(" ast ")")) - ('types:vector (pr-mal-sequence "[" ast "]")) - ('types:hash-map (pr-mal-hash-map ast)))) + (types:number (format nil "~d" (types:mal-value ast))) + (types:boolean (if (types:mal-value ast) "true" "false")) + (types:nil "nil") + (types:string (format nil "~s" (types:mal-value ast))) + (types:symbol (format nil "~a" (types:mal-value ast))) + (types:keyword (format nil ":~a" (types:mal-value ast))) + (types:list (pr-mal-sequence "(" ast ")")) + (types:vector (pr-mal-sequence "[" ast "]")) + (types:hash-map (pr-mal-hash-map ast)))) (meta (pr-str (types:mal-meta ast)))) (if meta (format nil "(with-meta ~a ~a)" repr meta) diff --git a/common_lisp/types.lisp b/common_lisp/types.lisp index f736c9e5..0b0a7e94 100644 --- a/common_lisp/types.lisp +++ b/common_lisp/types.lisp @@ -80,6 +80,6 @@ `(let ((type (types:mal-type ,ast))) (cond ,@(mapcar (lambda (form) - (list (list 'equal (car form) 'type) + (list (list 'equal (list 'quote (car form)) 'type) (cadr form))) forms)))) -- 2.20.1