-
Notifications
You must be signed in to change notification settings - Fork 2
/
.sbclrc
44 lines (35 loc) · 1.1 KB
/
.sbclrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
;;; -*- mode: lisp-mode -*-
;;; The following lines added by ql:add-to-init-file:
(defmacro when-let (binding &body body)
"Bind `binding` and execute `body`, short-circuiting on `nil`.
This macro combines `when` and `let`. It takes a binding and binds
it like `let` before executing `body`, but if the binding's value
evaluates to `nil`, then `nil` is returned.
Examples:
(when-let ((a 1))
(list a))
; =>
(1)
(when-let ((a nil))
(list a))
; =>
NIL
src: http://stevelosh.com/blog/2018/07/fun-with-macros-if-let/
"
(destructuring-bind ((symbol value)) binding
`(let ((,symbol ,value))
(when ,symbol
,@body))))
(defparameter *lerax-local-projects*
'("~/common-lisp/"
"~/.roswell/local-projects/")
"My custom local-projects directories")
#-quicklisp
(when-let ((quicklisp-init (merge-pathnames ".quicklisp/setup.lisp"
(user-homedir-pathname))))
(load quicklisp-init))
(mapcar
(lambda (x)
(when-let ((f (probe-file x)))
(pushnew f asdf:*central-registry*)))
*lerax-local-projects*)