cy
Cy is a Person though perhaps to a questionable degree, who likes programming to be simple and easy. Cy is not a very happy Person as a consequence.

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)
  • asdf stores compiled .fasl files in ~/.cache/common-lisp/ by default
  • You can make a .fasl from a .lisp file, by (compile-file "name.lisp")
  • This is the difference between let and symbol-macrolet:
  • (defun make-side-effect () (let ((i 0)) (lambda () (setq i (+ i 1))))) (setf (symbol-function 'i) (make-side-effect)) (print (list (i) (i) (i))) (let ((ii (i))) (print (list ii ii ii))) (symbol-macrolet ((ii (i))) (print (list ii ii ii))) (print '(Q E D))