From 709f6ae9830e6bd5a4ac84da06083178af6bc7a3 Mon Sep 17 00:00:00 2001 From: David Vazquez Date: Mon, 24 Dec 2012 02:58:03 +0000 Subject: [PATCH] FUNCTIONP and printer for FUNCTION --- lispstrack.lisp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lispstrack.lisp b/lispstrack.lisp index 7f7d99d..b677491 100644 --- a/lispstrack.lisp +++ b/lispstrack.lisp @@ -970,6 +970,11 @@ (compile-bool (concat "(" (ls-compile key env fenv) " in " (ls-compile object env fenv) ")"))) +(define-compilation functionp (x) + (compile-bool + (concat "(typeof " (ls-compile x env fenv) " == 'function')"))) + + (defun macrop (x) (and (symbolp x) (eq (binding-type (lookup-function x *fenv*)) 'macro))) @@ -1031,6 +1036,7 @@ ((symbolp form) (symbol-name form)) ((integerp form) (integer-to-string form)) ((stringp form) (concat "\"" (escape-string form) "\"")) + ((functionp form) (concat "#")) ((listp form) (concat "(" (join (mapcar #'print-to-string form) -- 1.7.10.4