Commit cc725e55 authored by Dave Cooper's avatar Dave Cooper

added new option to set-slots

parent 743b4df0
......@@ -540,11 +540,12 @@ as <tt>:settable</tt> for this to work properly. Any dependent slots in the tree
respond accordingly when they are next demanded. Note that the slots must be specified as a keyword
symbols (i.e. prepended with a colon (``:'')), otherwise they will be evaluated as variables according
to normal Lisp functional evaluation rules.
:arguments (slots-and-values \"Plist. Contains alternating slots and values to which they are to be set.\")"
:arguments (slots-and-values \"Plist. Contains alternating slots and values to which they are to be set.\"
warn-on-non-toplevel? \"Boolean. Indicates whether a warning should be issued for calling from inside the body of a cached slot. Default is t.\")"
set-slots!
(keys-and-values &key (remember? t))
(keys-and-values &key (remember? t) (warn-on-non-toplevel? t))
(mapc #'(lambda (key value)
(the (:set-slot! key value :remember? remember?)))
(the (:set-slot! key value :remember? remember? :warn-on-non-toplevel? warn-on-non-toplevel?)))
(plist-keys keys-and-values) (plist-values keys-and-values)))
(modify-attributes!
......
......@@ -60,6 +60,12 @@ by user application code.")
;; FLAG -- this is not thread-safe - you can get the same instance ID
;; if called simultaneously by two threads.
;;
;; FLAG -- we also have to protect against the (unlikely but possible)
;; case that the same number comes back twice within a second from the
;; random generator. Only way is to store the resutls and check
;; against previous results.
;;
;;
(defun make-new-instance-id (&key (max-value *max-id-value*))
(let ((*print-base* 16) (universal-time (get-universal-time))
(random (random max-value *iid-random-state*)))
......
Markdown is supported
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