Slime inspector customization

Gitsis Christos cgitsis at
Sat Jan 14 22:44:58 UTC 2017


Here follows Common Lisp code, using a datastore library named

    (ql:quickload :bknr.datastore)

    (defclass userdata (bknr.datastore:store-object)
      ((email :initarg :email
     :index-type bknr.indices:unique-index
     :index-values all-users)
       (name :initarg :name))
      (:metaclass bknr.datastore:persistent-class))

    (let ((object-subsystem (make-instance
      (make-instance 'bknr.datastore:store
    :directory *default-pathname-defaults*
                     :subsystems (list object-subsystem)))

    (make-instance 'userdata :email "m at" :name "Maria")
    (make-instance 'userdata :email "k at" :name "Katerina")

    (setf (slot-value (first (all-users)) 'name) "Elena")
    ; Attempt to modify persistent slot NAME of #<USERDATA ID: 0> outside
of a transaction
    ;   [Condition of type

    (bknr.datastore:with-transaction ()
      (setf (slot-value (first (all-users)) 'name) "Elena"))
    ; runs successfully, the above wrap in with-transaction () is necessary

I use the Slime inspector to view the datastore, so in the minibuffer after
C-c C-I Inspect value (evaluated):
I input

I can see the data but not edit it in the slime inspector, because the same
condition is thrown as above.

Can the slime inspector be customized in a way that it wraps calls to setf
inside transactions?

PS: if you run the above code, a directory named "current" will be created
in your lisp's working directory. It saves the datastore on disk.

Thank you,
Christos Gitsis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the slime-devel mailing list