m2ym/optima — pull request #30 by sykopomp (2012-07-17 16:19:00+00:00)
Title: Only access slots mentioned in the match.

Slots are not necessarily bound. Prior to this patch, all slots were
involved in a match, regardless of whether they were mentioned in the
pattern. Thus, the following code failed with SLOT-UNBOUND:

(defclass foo () (x))

(match (make-instance 'foo)
((class foo) (print "Hooray, we got a foo!")))

The above code should now work as expected.

It may be prudent to add a SLOT-UNBOUND subpattern for slots, to match
instances when given slots are unbound. At the same time, this is already
possible through guards:

(match (make-instance 'foo)
((and instance (class foo) (when (not (slot-boundp instance 'x))))
(print "unbound!")))

So it's not that big a deal.