Permalink
Browse files

Represent missing self user as nil, not unbound in rudel.el

* 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...
1 parent fbf8ca6 commit 83401c0112bdd278bbbe8a6f0466445549ef075e @scymtym scymtym committed Jul 10, 2010
Showing with 6 additions and 4 deletions.
  1. +6 −4 rudel.el
View
@@ -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"))
@@ -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

0 comments on commit 83401c0

Please sign in to comment.