File tree 5 files changed +21
-49
lines changed
5 files changed +21
-49
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ RUN ecl --load quicklisp.lisp \
15
15
RUN echo | ecl --load /home/janice/quicklisp/setup.lisp --eval '(ql:add-to-init-file)'
16
16
RUN echo | sbcl --load /home/janice/quicklisp/setup.lisp --eval '(ql:add-to-init-file)' --quit
17
17
18
+ RUN sbcl --eval '(ql-dist:install-dist "http://dist.ultralisp.org/" :prompt nil)'
19
+
18
20
ENV LISP_HOME=/home/janice/quicklisp/local-projects
19
21
WORKDIR /home/janice/hbook
20
22
Original file line number Diff line number Diff line change 5
5
:license " FIXME"
6
6
:serial t
7
7
:in-order-to ((asdf :test-op (asdf :test-op :hbook/test )))
8
- :depends-on (:arrows
9
- ; ; FIXME: Though not an explicit run-time dependency,
10
- ; ; for some reason I needed to add this for GitHub
11
- ; ; Action CI build to succeed. This merits more
12
- ; ; investigation:
13
- :1am )
8
+ :depends-on (:cl-oju :1am )
14
9
:components ((:module " src"
15
10
:serial t
16
11
:components ((:file " package" )
20
15
:description " FIXME"
21
16
:author " FIXME"
22
17
:license " FIXME"
23
- :depends-on (:hbook :1am )
18
+ :depends-on (:hbook :1am :cl-oju )
24
19
:serial t
25
20
:components ((:module " test"
26
21
:serial t
Original file line number Diff line number Diff line change 1
1
(in-package # :hbook)
2
2
3
3
; ; Utilities
4
- (defmacro comment (&rest x)
5
- (declare (ignore x)))
6
-
7
4
(defun minmax (list )
8
5
(loop for el in list
9
6
maximizing el into max
138
135
do (setf acc (dn acc))
139
136
finally (return acc)))
140
137
138
+ (defmacro comment (&rest x)
139
+ (declare (ignore x)))
140
+
141
141
(comment
142
142
(dr 1 )
143
143
(dr 2 )
Original file line number Diff line number Diff line change 1
1
(defpackage :hbook.test
2
- (:use :cl :1am :hbook )
2
+ (:use :cl :1am :hbook :cl-oju )
3
3
(:export :run-tests ))
Original file line number Diff line number Diff line change 1
1
(defpackage :hbook.test
2
- (:use :cl :1am :hbook )
2
+ (:use :cl :1am :hbook :cl-oju )
3
3
(:export :run-tests ))
4
4
5
5
(in-package # :hbook.test)
29
29
(loop for el in ' (2 3 4 5 6 7 8 9 10 11 12 )
30
30
collect (bin-index 11 2 12 el)))))
31
31
32
- ; ; TODO: Use cl-oju?
33
- (defun take (n l)
34
- "
35
- Take the first `n` items from `l`.
36
- "
37
- (subseq l 0 n))
32
+ (eval-when (:compile-toplevel :load-toplevel :execute )
33
+ (defun apply-bindings (bindings case expr)
34
+ "
35
+ (apply-bindings '(x y) '(2 3) '(+ x y))
38
36
39
- (defun partition-n (cell-size step-size lst)
40
- "
41
- Analog of Clojure's `partition` function with explicit
42
- step size and padding value.
43
-
44
- (partition-n 2 2 '(eenie meanie
45
- miney moe))
46
- ;;=>
47
- '((EENIE MEANIE) (MINEY MOE))
48
- "
49
- (let ((ret nil ))
50
- (loop for cell on lst
51
- by #' (lambda (lst1) (nthcdr step-size lst1))
52
- do (let ((this (take cell-size cell)))
53
- (when (= (length (the list this))
54
- (the fixnum cell-size))
55
- (push (take cell-size cell) ret))))
56
- (nreverse ret)))
57
-
58
- (defun apply-bindings (bindings case expr)
59
- "
60
- (apply-bindings '(x y) '(2 3) '(+ x y))
61
-
62
- ;;=>
63
- '(+ 2 3)
64
- "
65
- (loop with ret = expr
66
- for b in bindings
67
- for c in case
68
- do (setf ret (subst c b ret))
69
- finally (return ret)))
37
+ ;;=>
38
+ '(+ 2 3)
39
+ "
40
+ (loop with ret = expr
41
+ for b in bindings
42
+ for c in case
43
+ do (setf ret (subst c b ret))
44
+ finally (return ret))))
70
45
71
46
(defmacro are (argv expr &rest cases)
72
47
"
You can’t perform that action at this time.
0 commit comments