Opened 8 years ago

Closed 7 years ago

#1066 closed enhancement (duplicate)

improve coercion to difficult complex types

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


Welcome to Clozure Common Lisp Version 1.8  (LinuxX8632)!
? (deftype foo () '(complex double-float))
? (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 (1)

coercionfix.patch (1.3 KB) - added by Bike 8 years ago.
patch to coerce and coerce-to-complex take two

Download all attachments as: .zip

Change History (2)

Changed 8 years ago by Bike

patch to coerce and coerce-to-complex take two

comment:1 Changed 7 years ago by rme

  • Resolution set to duplicate
  • Status changed from new to closed

ticket:1218 (which was fixed) is a duplicate of this

Note: See TracTickets for help on using tickets.