Cy is for cymbolic cyxpressions
Cy likes when fundamental parts of the language nobody talks about are made clear, for instance:
- Here is how function cells work:
;; make a dummy function that prints something
(defmacro p (s)
(lambda ()
(print s)
(terpri)))
(funcall (p "here goes"))
(setf (symbol-function 'foo) (p "in the function cell"))
(foo)
(setf (symbol-function 'foo) (p "re-assigned the function cell"))
(foo)
(setf (symbol-function 'foo) (p "the global function cell for foo"))
(flet ((foo () (p "local function cell")))
(foo)
(setf (symbol-function 'foo) (p "oops! assigned the global function cell"))
(foo))
(print "back in the global context")
(terpri)
(foo)
;; still no idea how to catch COMPILE time warnings
;; such as sbcl which detects setting a function cell to a number type
(catch 'noprob
(handler-bind
((simple-type-error #'(lambda (c)
(declare (ignore c))
(print 'yay)
(throw 'noprob nil))))
(setf (symbol-function 'foo) 23)))
(terpri)