-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp-utils.lisp
52 lines (42 loc) · 1.74 KB
/
app-utils.lisp
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
45
46
47
48
49
50
51
;; -*-lisp-*-
(defpackage :money-thing.app-utils
(:use :cl)
(:export :internal-disable-debugger)
(:export :internal-quit))
(in-package :money-thing.app-utils)
(defun internal-disable-debugger ()
(labels
((internal-exit (c h)
(declare (ignore h))
(format t "~a~%" c)
(internal-quit)))
(setf *debugger-hook* #'internal-exit)))
(defun internal-quit (&optional code)
"Taken from the cliki"
;; This group from "clocc-port/ext.lisp"
#+allegro (excl:exit code)
#+clisp (#+lisp=cl ext:quit #-lisp=cl lisp:quit code)
#+cmu (ext:quit code)
#+cormanlisp (win32:exitprocess code)
#+gcl (lisp:bye code) ; XXX Or is it LISP::QUIT?
#+lispworks (lw:quit :status code)
#+lucid (lcl:quit code)
#+sbcl (sb-ext:exit :code code)
;; This group from Maxima
#+kcl (lisp::bye) ; XXX Does this take an arg?
#+scl (ext:quit code) ; XXX Pretty sure this *does*.
#+(or openmcl mcl) (ccl::quit)
#+abcl (cl-user::quit)
#+ecl (si:quit)
;; This group from <[email protected]>
#+poplog (poplog::bye) ; XXX Does this take an arg?
#-(or allegro clisp cmu cormanlisp gcl lispworks lucid sbcl
kcl scl openmcl mcl abcl ecl)
(error 'not-implemented :proc (list 'quit code)))
;;; filename/path utilities
(defun make-pathname-in-homedir (fname)
"Return a pathname relative to the user's home directory."
(merge-pathnames fname (make-pathname :directory (pathname-directory (user-homedir-pathname)))))
(defun make-pathname-in-lisp-subdir (fname)
"Return a pathname relative to the Lisp source code subtree in the user's home directory."
(merge-pathnames fname (make-pathname-in-homedir "SourceCode/lisp/")))