;;; startup.lisp --- Lisp implementation configuration -*- mode: lisp -*- ;;; Copyright (C) 2023 Sean Whitton ;;; This file is free software; you can redistribute it and/or modify ;;; it under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3, or (at your option) ;;; any later version. ;;; This file is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; You should have received a copy of the GNU General Public License ;;; along with this program. If not, see . (require "asdf") (in-package :cl-user) #+package-local-nicknames (let ((cl-user-file (merge-pathnames "src/dotfiles/lib-src/cl-user.lisp" (user-homedir-pathname))) (cl-user-systems '(#:alexandria #:anaphora #:cl-ppcre #:consfigurator #:named-readtables #:cl-interpol))) ;; We have to have them all the systems available in order to be able to ;; load cl-user.lisp, such that all packages are defined for the reader, and ;; all macro definitions are loaded for the compiler. (when (and (uiop:file-exists-p cl-user-file) (every (lambda (s) (asdf:find-system s nil)) cl-user-systems)) (mapc #'asdf:load-system cl-user-systems) (mapc #'use-package '(#:alexandria #:anaphora)) (uiop:symbol-call '#:uiop/package-local-nicknames '#:add-package-local-nickname '#:re '#:cl-ppcre) ;; Import everything in UIOP that can be imported without name conflicts. (do-external-symbols (symbol :uiop) (handler-case (import symbol) (package-error ()))) (dolist (cons '((#:consfigurator #:multiple-value-mapcan #:lines #:unlines #:words #:unwords))) (let ((package (car cons))) (import (mapcar (lambda (s) (find-symbol (symbol-name s) package)) (cdr cons))))) ;; Idea is to be free to build it up programmatically in cl-user.lisp. (unless (uiop:symbol-call '#:named-readtables '#:find-readtable :cl-user) (uiop:symbol-call '#:named-readtables '#:make-readtable :cl-user :merge '(:consfigurator))) ;; Load Swank if we have it in order to update its associations between ;; readtables and packages. (when (asdf:find-system "swank" nil) (asdf:load-system "swank")) ;; Want output indicating we had all the libraries. (load cl-user-file :verbose t))) ;;;; SBCL configuration #+sbcl (progn ;; Enable DROP-THEM restart for when we delete symbols from the exports list ;; in a DEFPACKAGE and then reevaluate that DEFPACKAGE. (setq *on-package-variance* '(:error t)))