using the t-test, walk through possible inferential APIs, considering whether it...
[CommonLispStat.git] / Doc / README.CL-based-design.txt
blobc66f75c6ed473d8e7487f96e7619ad336a2b8f92
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
6 exported commands. 
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
13 specified, i.e. 
14 (load-lisp-stat-package package-to-load
15                         package-space-to-infect)
17 (default is ls-user)
19 ;;;;;;;;;;;;;;;;;;;;;;;;;;; SOME CL EXAMPLES and GUIDANCE.
21 #+nil(progn
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."
41     (check-type a number)
42     (check-type b number)
43     (check-type c number)
44     (locally (declare (number a b c))
45       (- (* b b) (* 4 a c)))) =>  CAREFUL-DISCRIMINANT
46   (careful-discriminant 1 2/3 -2) =>  76/9
48   )
53  (defun testme (&key (a 3) (b (+ a 3)))
54    b)
56  (testme)
57  (testme :a 2)
58  (testme :b 4)
59  (testme :a 2 :b (* a 5))
64  (defun testme (&key (a 3) (b (+ a 3)))
65    b)
67  (testme)
68  (testme :a 2)
69  (testme :b 4)
70  (testme :a 2 :b (* a 5))