[Openmcl-devel] deftype bug?

Gary Byers gb at clozure.com
Thu Mar 18 03:11:26 UTC 2010


It's being handled incorrectly; preserving the left-to-right/short-circuit
order of the AND specifier's subforms is only one of the things that goes
wrong there.



On Wed, 17 Mar 2010, Paul Krueger wrote:

> The following looks like a bug to me. It is a much-simplified example
> of what I encountered. Shouldn't the use of "list" as part of the type
> definition preclude the error that occurs? CLTL is very explicit about
> that, but I couldn't find corresponding language in the hyper-spec, so
> perhaps something changed along the way. Note that using "cons"
> instead  of "list" works as expected.
>
> I also upgraded to 1.5-dev-r13523M-trunk and got the same result. Am I
> missing something?
>
> Paul
>
> Welcome to Clozure Common Lisp Version 1.5-dev-r13388M-trunk
> (DarwinX8664)!
> ? (defun length3 (thing)
>     (eql (list-length thing) 3))
> LENGTH3
> ? (deftype list3 ()
>     '(and list (satisfies length3)))
> LIST3
> ? (deftype lst3 ()
>     '(and cons (satisfies length3)))
> LST3
> ? (setf arr (make-array '(3)))
> #(0 0 0)
> ? (typep arr 'lst3)
> NIL
> ? (typep arr 'list3)
> > Error: value #<SIMPLE-VECTOR 3> is not of the expected type LIST.
> > While executing: LIST-LENGTH, in process Listener(6).
> > Type cmd-. to abort, cmd-\ for a list of available restarts.
> > Type :? for other options.
> 1 > (typep arr 'list)
> NIL
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
>



More information about the Openmcl-devel mailing list