From c8487c61a760a5dc2844e02312920e795b2f0ba7 Mon Sep 17 00:00:00 2001 From: Francois-Rene Rideau <tunes@google.com> Date: Wed, 2 Oct 2013 23:48:18 -0400 Subject: [PATCH] Update debug.lisp: uiop vs asdf/driver, ability to load slime afterwards, etc. --- uiop/contrib/debug.lisp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/uiop/contrib/debug.lisp b/uiop/contrib/debug.lisp index e3d05d53..17534e2e 100644 --- a/uiop/contrib/debug.lisp +++ b/uiop/contrib/debug.lisp @@ -11,21 +11,21 @@ #| ;;; If ASDF is already loaded, ;;; you can load these utilities in the current package as follows: -(d:asdf-debug) -;; which if you left the :D nickname to asdf/driver is short for: -(asdf/utility::asdf-debug) +(uiop:uiop-debug) +;; which is the same as: +(uiop/utility:uiop-debug) ;; The above macro can be configured to load any other debugging utility ;; that you may prefer to this one, with your customizations, ;; by setting the variable -;; asdf-utility:*asdf-debug-utility* +;; uiop/utility:*uiop-debug-utility* ;; to a form that evaluates to a designator of the pathname to your file. ;; For instance, on a home directory shared via NFS with different names ;; on different machines, with your debug file in ~/lisp/debug-utils.lisp ;; you could in your ~/.sbclrc have the following configuration setting: (require :asdf) -(setf asdf/utility:*asdf-debug-utility* - '(asdf/pathname:subpathname (asdf/os:user-homedir) "lisp/debug-utils.lisp")) +(setf uiop/utility:*uiop-debug-utility* + '(uiop/pathname:subpathname (uiop/os:user-homedir) "lisp/debug-utils.lisp")) ;;; If ASDF is not loaded (for instance, when debugging ASDF itself), ;;; Try the below, fixing the pathname to point to this file: @@ -102,21 +102,17 @@ The macro expansion has relatively low overhead in space of time." ;;; Quick definitions for use at the REPL (defun w (&rest x) (format t "~&~{~S~^ ~}~%" x)) ;Write, space separated + LF (defun a (&rest x) (format t "~&~{~A~}~%" x)) ;print Anything, no separator, LF -(defun e (x) (cons x (ignore-errors (list (eval x))))) ;eValuate +(defun e (x) (cons x (ignore-errors (list (eval x))))) ;Evaluate (defmacro x (x) `(format t "~&~S => ~S~%" ',x ,x)) ;eXamine +(defun i (&rest x) (apply (read-from-string "swank:inspect-in-emacs") x)) ; SLIME inspection +(defun ra (&rest x) (require :cl-ppcre) (apply (read-from-string "cl-ppcre:regex-apropos") x)) (defmacro !a (&rest foo) ; define! Alias `(progn ,@(loop :for (alias name) :on foo :by #'cddr :collect (if (macro-function name) `(defmacro ,alias (&rest x) `(,',name ,@x)) `(defun ,alias (&rest x) (apply ',name x)))))) - -;;; common aliases -(!a +(!a ;;; common aliases d describe ap apropos !p defparameter m1 macroexpand-1) - -;;; SLIME integration -(when (find-package :swank) - (eval (read-from-string "(!a i swank:inspect-in-emacs)"))) -- GitLab