m2ym / optima

Optimized Pattern Matching Library for Common Lisp
271 stars 19 forks source link

(STRUCTURE ...) pattern gets PREDICATE name wrong #104

Closed nklein closed 10 years ago

nklein commented 10 years ago

The (STRUCTURE ...) pattern assumes that the predicate for a struct with conc-name FOO will be FOOP instead of FOO-P. It does this with accessors, too.

(defstruct foo a b c)
(optima:match (make-foo)
   ((structure foo a b c) t))

This looks for predicate FOOP and readers FOOA, FOOB, and FOOC when it should look for predicate FOO-P and readers FOO-A, FOO-B, and FOO-C.

nklein commented 10 years ago

Hmmm... My apologies. I see that this is the way it's documented. And, now I see why that makes sense.