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

Exposing monomorphic predicates/accessors



I am considering extending the syntax to expose monomorphic predicates and accessors in addition to the current polymorphic versions. This may be useful, definitely for performance and perhaps also for expressiveness. For example, having a monomorphic just-point? predicate would allow one to test for instances of the point type that do not belong to a proper subtype, something that is currently not expressible. The monomorphic predicates would all be mutually disjoint. What I had in mind was, in addition to the existing variants, something like the following:

  (define-record-type point (make-point x y) (point? just-point?)
    (x (point.x just-point.x) (point.x-set! just-point.x-set!))
    (y (point.y just-point.y) (point.y-set! just-point.y-set!)))

Rather messy-looking, though.  Any suggestions or thoughts?

Andre