Skip to content

Commit

Permalink
Substantial reengineering, some incompatible
Browse files Browse the repository at this point in the history
defpackage is now a shim for define-package.  define-package is
extensible.  The system is now in multiple files, finally.
  • Loading branch information
tfeb committed Aug 9, 2023
1 parent c89e89c commit b709848
Show file tree
Hide file tree
Showing 8 changed files with 705 additions and 294 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 1998-2002, 2020-2022 Tim Bradshaw
Copyright 1998-2002, 2020-2023 Tim Bradshaw

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
283 changes: 242 additions & 41 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.0
4.0.0
26 changes: 26 additions & 0 deletions cometh.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
;;;; Define the CL/CONDUITS package and a user package.
;;;
;;; There used to be elaborate EVAL-WHEN hair here when this was all
;;; in one file. No more!
;;;

(in-package :org.tfeb.conduit-packages)

(define-package :org.tfeb.cl/conduits
;; This is CL but with conduits. It doesn't include any of the
;; fancy stuff
(:use)
(:nicknames :org.tfeb.clc)
(:extends/excluding :cl
#:export #:unexport #:defpackage
#:delete-package #:rename-package)
(:extends/including :org.tfeb.conduit-packages
#:export #:unexport #:defpackage
#:delete-package #:rename-package))

(define-package :org.tfeb.cl-user/conduits
;; CL-USER but with conduits
(:nicknames :org.tfeb.clc-user)
(:use :org.tfeb.clc))

(provide :org.tfeb.conduit-packages)
27 changes: 17 additions & 10 deletions define-conduit-package.lisp → define-package.lisp
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
;;;; Just the basic facts ma'am
;;;

(defpackage :org.tfeb.conduit-packages/define-conduit-package
(:use :org.tfeb.clc :org.tfeb.conduit-packages)
#+org.tfeb.tools.require-module
(org.tfeb.tools.require-module:needs
(:org.tfeb.conduit-packages :compile t))

(org.tfeb.clc:defpackage :org.tfeb.conduit-packages/define-package
;; This is a package you can use in other packages: it exposes
;; conduit packages by shims rather than by the CL names. It is
;; itself a conduit, but not a pure one as it seemed absurd to
;; define a separate inplementation package
(:use :org.tfeb.clc)
(:extends/excluding :org.tfeb.conduit-packages
;; Extend conduit packages without the symbols which would clash
;; with CL
#:export #:unexport #:defpackage #:delete-package #:rename-package)
(:export
#:recompute-conduits
#:define-conduit-package
;; shims
#:delete-conduit-package
#:rename-conduit-package
#:export-from-conduit-package
#:unexport-from-conduit-package))

(in-package :org.tfeb.conduit-packages/define-conduit-package)
(in-package :org.tfeb.conduit-packages/define-package)

(provide :org.tfeb.conduit-packages/define-conduit-package)

(defmacro define-conduit-package (name &body clauses)
"A shim around the conduit packages DEFPACKAGE"
`(defpackage ,name ,@clauses))
(provide :org.tfeb.conduit-packages/define-package)

(defun delete-conduit-package (pack/name)
"A shim around the conduit packages DELETE-PACKAGE"
Expand Down
Loading

0 comments on commit b709848

Please sign in to comment.