Skip to content

Commit

Permalink
Represent missing self user as nil, not unbound in rudel.el
Browse files Browse the repository at this point in the history
* rudel.el (rudel-client-session::self): changed type to allow null
  value; added writer method `rudel-set-self'
  (rudel-client-session::rudel-unsubscribed-documents): check for self
  being nil instead of the slot :self being bound
  • Loading branch information
scymtym committed Jul 10, 2010
1 parent fbf8ca6 commit 83401c0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions rudel.el
Expand Up @@ -259,8 +259,10 @@ WHICH is compared to the result of KEY using TEST."
"The connection used for communication by this
session.")
(self :initarg :self
:type rudel-user-child
:type (or null rudel-user-child)
:initform nil
:reader rudel-self
:writer rudel-set-self
:documentation
"Points into USERS to the user object representing
the local user"))
Expand All @@ -286,10 +288,10 @@ client perspective.")

(defmethod rudel-unsubscribed-documents ((this rudel-client-session))
"Return documents in THIS to which the self user is not subscribed."
(unless (slot-boundp this :self)
(error "Cannot find unsubscribed documents unless slot self is bound"))

(with-slots (documents self) this
(unless self
(error "Cannot find unsubscribed documents without self user"))

(remove-if
(lambda (document)
(with-slots (subscribed) document
Expand Down

0 comments on commit 83401c0

Please sign in to comment.