Skip to content

Commit

Permalink
Merge pull request #58 from 40ants/export-object-package
Browse files Browse the repository at this point in the history
Export object-package generic function.
  • Loading branch information
svetlyak40wt authored Jan 5, 2025
2 parents 2d54e0e + 80680b1 commit e35c362
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
3 changes: 3 additions & 0 deletions full/doc.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
#:height
#:width
#:local-image)
(:import-from #:40ants-doc/object-package
#:object-package)
(:export #:@index
#:@readme
#:@changelog))
Expand Down Expand Up @@ -657,6 +659,7 @@ See full list of changes in the 40ANTS-DOC/CHANGELOG::@CHANGELOG section.
(define-locative-type macro)
(exportable-locative-type-p generic-function)
(locate-object generic-function)
(object-package generic-function)
(locate-error function)
(canonical-reference generic-function)
(find-source generic-function)
Expand Down
5 changes: 0 additions & 5 deletions full/object-package-impl.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
(in-package #:40ants-doc-full/object-package-impl)


(defmethod object-package ((object t))
(warn "Unable to figure out *package* for object ~S"
object)
nil)

(defmethod object-package ((object symbol))
(symbol-package object))

Expand Down
9 changes: 9 additions & 0 deletions src/changelog.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,15 @@
"CLEAN-URLS"
;; These objects are not documented yet:
"40ANTS-DOC/COMMONDOC/XREF:XREF"))
(0.22.0 2025-01-05
"* Exported 40ANTS-DOC/OBJECT-PACKAGE:OBJECT-PACKAGE generic-function.
Define a method for it if you have created a new locative type
and encounter a warning like this:
```
WARNING:
Unable to figure out *package* for object #<40ANTS-DOC/LOCATIVES::DIAGRAM {1012A10B53}>
```")
(0.21.0 2025-01-05
"* Changed a way how images are processed. New behaviour should be backward compatible,
but now it is possible. But now 40ANTS-DOC-FULL/COMMONDOC/IMAGE:LOCAL-IMAGE function
Expand Down
8 changes: 7 additions & 1 deletion src/object-package.lisp
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
(uiop:define-package #:40ants-doc/object-package
(:use #:cl))
(:use #:cl)
(:export #:object-package))
(in-package #:40ants-doc/object-package)


(defgeneric object-package (object)
(:documentation "Should return a package object where locative object was defined.
This package will be bound to *PACKAGE* when processing the documentation piece
using 40ANTS-DOC-FULL/COMMONDOC/BUILDER:TO-COMMONDOC generic-function.")

(:method ((object t))
(warn "Unable to figure out *package* for object ~S"
object)
Expand Down

0 comments on commit e35c362

Please sign in to comment.