Re: Type BOOLEAN

Edi Weitz <[email protected]>
Newsgroups gmane.lisp.clsql.devel
Message-ID <[email protected]>
On Tue, 8 Jun 2004 19:13:56 -0600, Kevin Rosenberg <kevin-HJRc7zDS/[email protected]> wrote:

> To the degree, that "declaration are assertations", it's not okay to
> lie to Lisp. This is implementation specific, of course. OpenMCL,
> for example, computes a slot named ccl:type-predicate for each
> effective-slot-definition. It uses this predicate to check values
> stored with (setf slot-value-using-class).

Yes, sorry, that was of course just plain dumb of me. I think CMUCL
19a with Gerd's PCL might do something similar.

> I have arranged a hook in sql/metaclasses.lisp named
> compute-lisp-type-from-slot-specification where it's possible to
> change the actual lisp type for a :type attribute in a slot. So, it
> is possible to have ":type boolean" actually translate to lisp as
> ":type t". While possible, I've tried to stick as much to Lisp
> semantics as possible such that: (typep slot-value slot-type) => t
>
> As stated, I've thought about this issue and I'll be glad to discuss
> it further.

How about having a user-specified slot-type GENERALIZED-BOOLEAN which
translates to the CL type T but is stored as

  (if val "t" "f")

in the database?

Cheers,
Edi.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.