Add support for printing functions
authorIqbal Ansari <iqbalansari02@yahoo.com>
Wed, 17 Aug 2016 18:31:44 +0000 (00:01 +0530)
committerIqbal Ansari <iqbalansari02@yahoo.com>
Sat, 27 Aug 2016 12:43:33 +0000 (18:13 +0530)
common_lisp/printer.lisp
common_lisp/types.lisp

index 7a1021f..18a3c1c 100644 (file)
@@ -42,4 +42,5 @@
       (types:list (pr-mal-sequence "(" ast ")"))
       (types:vector (pr-mal-sequence "[" ast "]"))
       (types:hash-map (pr-mal-hash-map ast))
+      (types:fn "#<function>")
       (types:builtin-fn "#<builtin function>"))))
index 3853ac4..34979b9 100644 (file)
 (define-mal-type symbol)
 (define-mal-type keyword)
 (define-mal-type string)
+;; TODO true, false and nil should ideally be singleton
 (define-mal-type boolean)
+(define-mal-type nil)
+
 (define-mal-type list)
 (define-mal-type vector)
 (define-mal-type hash-map)
-(define-mal-type nil)
+
+(define-mal-type fn)
 (define-mal-type builtin-fn)
 
 ;; Generic type