Thu, 03 Sep 2009
Chicken 4.1.0 on Cygwin
Weird: after compiling and installing chicken with:
make PLATFORM=cygwin PREFIX=/sw/versions/cygwin/chicken/4.1.0 make PLATFORM=cygwin PREFIX=/sw/versions/cygwin/chicken/4.1.0 install
I had to copy /sw/versions/cygwin/chicken/4.1.0/lib/*.a to /sw/versions/cygwin/checkin/4.1.0/bin before it could link things properly. (I first noticed this while doing a $ chicken-install ncurses.)
Fri, 15 Aug 2008
Fun with Lisp: notf and cdrf
Archives
I actually use these in Emacs Lisp, for which you'd need a (require 'cl)), but the define-modify-macro is originally from Common Lisp.
These are trivial, but useful.
(define-modify-macro notf (&rest args) not) (setq x nil) (notf x) x ;;=> t (notf x) x ;;=> nil (setq x ‘(a (b (c t)))) (notf (car (cdr (cadadr x)))) x ;;=> (a (b (c nil))) (notf (car (cdr (cadadr x)))) x ;;=> (a (b (c t))) (setq x [1 2 3 t 5]) (notf (aref x 3)) x ;;=> [1 2 3 nil 5] (notf (aref x 3)) x ;;=> [1 2 3 t 5] (define-modify-macro cdrf (&rest args) cdr) (setq x ‘(:a :b :c :d 1 2 3)) (defun frob (keyword) ‘nothing-now) (while (member (car x) ‘(:a :b :c :d)) (frob (car x)) (cdrf x)) x ;;=> (1 2 3)