;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;; ;;;;;;;; ;;;;;; All files in this directory and its subdirectories are ;;;;;;;; ;;;;;; copyright 1997, 1998, 1999, 2000, 2002. ;;;;;;;; ;;;;;; by Rafael D. Sorkin. All rights reserved. ;;;;;;;; ;;;;;; ;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ~/lisp/bibliotek.cmucl.l Time-stamp:< 2002-Oct-23 14:23:46 15798.59698 > ;; THIS VERSION IS SPECIFIC TO CMUCL (CMU Common Lisp) ;; LOAD THIS FILE AFTER bibliotek.TCL ;: Roster of functions, macros, aliases and types defined herein ; (mainly from elisp) ; ; load-safe (function) ; garbage-collect (function) ; natnum (type) ; fixpos (type) ; sequencep (function) ; natnump (function) (defun load-safe (name) "\ Loads a file, ignoring errors of type `simple-error'. If the file is absent, then you should get a true error. " (let (error-type) (setq error-type (type-of (cadr (multiple-value-list (ignore-errors (load (merge-pathnames name))))))) (unless (eq error-type 'simple-error) (error (format nil "An error of type `~s' occurred during loading" error-type))))) ;: Provide some functions taken from elisp (defun garbage-collect () "do a verbose garbage collection" (gc t)) (deftype natnum () " the type of the nonnegative integers" '(integer 0 *)) (deftype fixpos () " The name means the positive subset of fixnums." `(mod ,most-positive-fixnum)) ; ; (mod n) is a type the cmucl compiler recognizes, it's realy a misnomer, ; since the set is not closed under arithmetic operations. ; (This one also seems to be called `(unsigned-byte 32)' mas o menos ; but in fact it uses only 29 bits!?) (defun sequencep (x) " Is this object within the `sequence' type?" (typep x 'sequence)) ; ; In cmucl, the type `sequence' exists, but not the function `sequencep' (defun natnump (n) " Is this a non-negative integer?" (and (integerp n) (>= n 0))) ; ; this type is not pre-defined at all in cmucl ; ;; we could also recode `natnump' a la `sequencep' ;: Make `lambda' a macro ;;; Reinstate if proves to be needed in cmucl when we have a working copy again: ; (unless (fboundp 'lambda) ;;; do we really want this line?? ; ; (defmacro lambda (&rest args-forms) ; " Defining `lambda' as this macro will make lambda expressions evaluate to ; functions--as they do in elisp." ; (list 'function (cons 'lambda args-forms))) ; ; ;(macro-function 'lambda); # ; ;(symbol-function'lambda); # ;: e n d