[Bese-devel] default argument to (setf session.value(

Attila Lendvai attila.lendvai at gmail.com
Sat Oct 28 21:58:56 UTC 2006


On 10/27/06, Henrik Hjelte <henrik at evahjelte.com> wrote:
>
> Attila, you recently removed the "default" argument to (setf
> session.value). As it stands now the documentation is outdated, see
> below, and get-session-value and (setf get-session-value) needs updating
> too. Of course I could have fixed this, but I don't have the full
> picture and I thought you might want to read Marcos comment again and
> decide if the change is what you wanted (cosmetic change?).
>

i remember that i've changed it to get rid of a warning and seems like this
should also changed similarly:

(defun (setf get-session-value) (value key
                 &optional
                 (default nil)
                 (session (context.session *context*)))
  "Convience wrapper around (setf session.value).

SESSION defaults to the current session."
  (setf (session.value key session default) value))

i've tried hard to think about the bad sideffects of this change but
couldn't come up with any.

UCW> (session.value 'foo s 42)
42
NIL
UCW> (session.value 'foo s)
NIL
NIL
UCW> (setf (session.value 'foo s) 42)
42
UCW> (incf (session.value 'foo s))
43
UCW> (session.value 'foo s 42)
43
T
UCW>

if noone yells, i'll push some further cleanup.

-- 
- attila

"- The truth is that I've been too considerate, and so became
unintentionally cruel...
- I understand.
- No, you don't understand! We don't speak the same language!"
(Ingmar Bergman - Smultronstället)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/bese-devel/attachments/20061028/5abede8f/attachment.html>


More information about the bese-devel mailing list