Ticket #1066 (new enhancement)

Opened 20 months ago

improve coercion to difficult complex types

Reported by: Bike Owned by:
Priority: normal Milestone:
Component: Compiler Version: 1.8
Keywords: coerce coercion complex Cc:

Description

Welcome to Clozure Common Lisp Version 1.8  (LinuxX8632)!
? (deftype foo () '(complex double-float))
FOO
? (coerce #c(2 4) '(complex double-float))
#C(2.0D0 4.0D0)
? (coerce #c(2 4) 'foo)
> Error: value #C(2 4) is not of the expected type REAL.
> While executing: COMPLEX, in process listener(1).
> Type :POP to abort, :R for a list of available restarts.
> Type :? for other options.
1 > 

Basically this happens because coerce-to-complex works on the literal type specifier instead of the canonicalized ctype. I've included a small patch to remedy this.

Attachments

coercionfix.patch Download (1.3 KB) - added by Bike 20 months ago.
patch to coerce and coerce-to-complex take two

Change History

Changed 20 months ago by Bike

patch to coerce and coerce-to-complex take two

Note: See TracTickets for help on using tickets.