2 CL based design needs to consider the packaging components, to ensure
3 that the final packaging works.
5 Some guidelines: packages should have methods which self-describe
8 We can do this via lisp functions -- need a macro to provide
9 reflection of this information.
11 can we load packages and add symbols to an existing package --
12 i.e. want to be able to load into curent package or another package as
14 (load-lisp-stat-package package-to-load
15 package-space-to-infect)
19 ;;;;;;;;;;;;;;;;;;;;;;;;;;; SOME CL EXAMPLES and GUIDANCE.
22 ;; REVIEW: general Lisp use guidance
24 (fdefinition 'make-matrix)
25 (documentation 'make-matrix 'function)
27 #| Examples from CLHS, a bit of guidance.
29 ;; This function assumes its callers have checked the types of the
30 ;; arguments, and authorizes the compiler to build in that assumption.
31 (defun discriminant (a b c)
32 (declare (number a b c))
33 "Compute the discriminant for a quadratic equation."
34 (- (* b b) (* 4 a c))) => DISCRIMINANT
35 (discriminant 1 2/3 -2) => 76/9
37 ;; This function assumes its callers have not checked the types of the
38 ;; arguments, and performs explicit type checks before making any assumptions.
39 (defun careful-discriminant (a b c)
40 "Compute the discriminant for a quadratic equation."
44 (locally (declare (number a b c))
45 (- (* b b) (* 4 a c)))) => CAREFUL-DISCRIMINANT
46 (careful-discriminant 1 2/3 -2) => 76/9
53 (defun testme (&key (a 3) (b (+ a 3)))
59 (testme :a 2 :b (* a 5))
64 (defun testme (&key (a 3) (b (+ a 3)))
70 (testme :a 2 :b (* a 5))