Re: Record-type predicate
John Cowan 18 Jul 2016 15:23 UTC
Marc Nieper-Wißkirchen scripsit:
> The record-type predicate has to be a procedure in order to function
> as a genuine predicate. If we don't want to index these functions in
> (weak) hash tables, I don't see a way to get meta-data about a
> procedure other than calling it. But this may be disastrous if an
> unknown procedure is called.
There's no *portable* way to get metadata out of a procedure. But at
least some Scheme implementations do associate metadata with procedure
objects. SRFI 102 (withdrawn) is about providing arity (number of
arguments) metadata, and Chicken allows the creation of procedures with an
associated slot for metadata, though the slot is not present by default.
--
John Cowan http://www.ccil.org/~cowan xxxxxx@ccil.org
Unless it was by accident that I had offended someone, I never apologized.
--Quentin Crisp