[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LAMBDA expression to the SATISFIES type specifier



Page 43 specifies that the predicate name must be a symbol because of
scoping problems.

First off, I don't see any reason to disallow lexical closures:

(deftype foo (x)
  `(satisfies ,#'(lambda (y) (eq x y))))

As for LAMBDA expressions, I would think that the same scoping rules
would apply as for DEFMACRO.  That is,

(deftype foo (x)
  '(satisfies (lambda (y) (eq x y))))

should not be expected to work any more than

(defmacro foo (x y)
  `((lambda (z) (eq x z)) ,y))

In summary, I believe that anything FUNCTIONP is valid as the predicate
in SATISFIES.  Is there some more subtle scoping problem that I have
overlooked?