I am putting together a modification of a library that contains an existing cl-defstruct
definition, and I am having problems redefining it after its initial evaluation.
Q: How can I replace the old definition with the new one? [It would be nice if I could wrap it in something so that eval-buffer
, eval-region
, and/or require
will be sufficient to force its re-definition.]
BEFORE:
(cl-defstruct
(undo-tree-node
(:type vector) ; create unnamed struct
(:constructor nil)
(:constructor undo-tree-make-node
(previous undo
&optional redo
&aux
(timestamp (current-time))
(branch 0)))
(:constructor undo-tree-make-node-backwards
(next-node undo
&optional redo
&aux
(next (list next-node))
(timestamp (current-time))
(branch 0)))
(:copier nil))
previous next undo redo timestamp branch meta-data)
AFTER: Adding the word count
at the very end.
(cl-defstruct
(undo-tree-node
(:type vector) ; create unnamed struct
(:constructor nil)
(:constructor undo-tree-make-node
(previous undo
&optional redo
&aux
(timestamp (current-time))
(branch 0)))
(:constructor undo-tree-make-node-backwards
(next-node undo
&optional redo
&aux
(next (list next-node))
(timestamp (current-time))
(branch 0)))
(:copier nil))
previous next undo redo timestamp branch meta-data count)
defun
. If it doesn't, please report it as a bug. – Stefan Apr 26 '17 at 14:49cl-defstruct
creates a bunch of inlined functions, redefining updates those definitions but not their call sites. – npostavs Apr 26 '17 at 15:15