feat: dictionary object created with debugging info

This commit is contained in:
noether 2026-08-17 00:11:35 -03:00
commit adb557857e
2 changed files with 19 additions and 1 deletions

View file

@ -1,5 +1,18 @@
(in-package :monastery)
;; instance of the object
(defclass dictionary ()
((pointer :initarg :pointer :reader dictionary-pointer)
(dict-path :initarg :dict-path :reader dictionary-path)
(closedp :initform nil :reader dictionary-closed-p)
(operation-count :initform 0 :reader dictionary-operation-count)
(created-at :initform (get-universal-time) :reader dictionary-created-at)))
(defmethod print-object ((d dictionary) stream)
(print-unreadable-object (d stream :type t :identity t)
(format stream "~A (~A)" (slot-value d 'dict-path)
(slot-value d 'closedp))))
;; conditions
;;; dict-error is the general interface error, when handling conditions

View file

@ -3,8 +3,13 @@
(:export
#:dict-init #:dict-close #:with-dict
; error
#:dict-error #:dict-initialization-error #:dict-operation-error
#:dict-error-message))
#:dict-error-message
;dict object
#:dictionary-closed-p #:dictionary-path #:dictionary-operation-count
#:dictionary-created-at))
(in-package :monastery)