Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gendl
gendl
Commits
39885076
Commit
39885076
authored
Oct 08, 2021
by
Dave Cooper
Browse files
added new restore-root! function
parent
a9f01770
Pipeline
#5049
passed with stages
in 14 minutes and 38 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
base/rest/source/vanilla-mixin.lisp
View file @
39885076
...
...
@@ -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
)))
#+
nil
;;
;; restore-tree! has been sunsetted.
;;
(
"Void. Restores all settable-slots in this instance, and
recursively in all descendant instances, to their default values."
restore-tree!
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment