Commit 39885076 authored by Dave Cooper's avatar Dave Cooper
Browse files

added new restore-root! function

parent a9f01770
Pipeline #5049 passed with stages
in 14 minutes and 38 seconds
......@@ -319,7 +319,31 @@ the <tt>follow-root-path</tt> GDL function to return the actual instance."
(nreverse result))))
(the (restore-slot-defaults! settables))))
("Multiple Values: Total root-paths affected and total slots
affected. Reverts any \"remembered\" bashed slots, starting from the
root, to their default values. Note that any call to `set-slot!` or
`set-slots!` or any use of web form-controls will result in
\"remembered values\". Note that there is a `:remember?` keyword
argument to `set-slot!` which defaults to `t` but if you specify it as
`nil`, you can bash values without having them \"remembered\" and such
slots would not be affected by this function." restore-root! ()
(let ((root-paths 0)(messages 0))
(dolist (entry (gdl-acc::%version-tree% (the root)))
(destructuring-bind (root-path &rest plist) entry
(when plist
(incf root-paths)
(let ((node (with-error-handling () (the root (follow-root-path root-path)))))
(when node
(dolist (key (plist-keys plist))
(incf messages)
(with-error-handling () (the-object node (restore-slot-default! key)))))))))
(setf (gdl-acc::%version-tree% (the root)) nil) (values root-paths messages)))
;; restore-tree! has been sunsetted.
("Void. Restores all settable-slots in this instance, and
recursively in all descendant instances, to their default values."
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment