Opened 11 years ago

Closed 10 years ago

#465 closed defect (fixed)

Shorthand type declarations.

Reported by: stassats Owned by: gb
Priority: normal Milestone:
Component: Compiler Version: trunk
Keywords: Cc:

Description

According to the <a href=""http://www.lispworks.com/reference/HyperSpec/Body/03_cca.htm">CLHS 3.3.3.1</a> type declarations can be shortened, but CCL gives a warning:

(proclaim '((array character) *foo*)) ; Warning: Unknown declaration specifier(s) in ((ARRAY CHARACTER) *FOO*)

Change History (5)

comment:1 Changed 11 years ago by rme

Interesting. 3.3.3.1 says that a type specifier can be used as a declaration identifier, but according to the glossary entry for a declaration identifier, a declaration identifier is a symbol.

http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_d.htm#declaration_identifier

r10605 allows globally-known type names as declaration identifiers, but (presumably) per the glossary entry, requires the declaration identifier to be a symbol.

comment:2 Changed 11 years ago by gb

I think that the intent of http://www.lispworks.com/documentation/HyperSpec/Issues/iss349_w.htm was to allow any type declaration to be used (and to disallow the introduction of types that conflicted with declaration names.)

It's not clear that any of that made it into the spec, however.

comment:3 Changed 11 years ago by trittweiler

CLHS 3.3.2 says

[A declaration specifier] is a list whose car is a declaration identifier, and whose cdr is data interpreted according to rules specific to the declaration identifier.

So a declaration identifier is basically just the CAR of a declaration specifier. Which, as 3.3.3.1 specifies, can also be a type specifier. Which in turn can be symbols, lists, or _even classes_ (4.3.2).

comment:4 Changed 11 years ago by gb

  • Status changed from new to assigned

Sigh. The spec contradicts itself about this; neither accepting compound type specifiers as declaration identifiers or rejecting them is any more or less compliant with the spec as written than the other behavior would be.

That said, it's pretty clear that the intent of X3J13 was to allow any type specifier to be used as a declaration identifier, and it's pretty clear that the practical advantages of doing so outweigh any disadvantages.

comment:5 Changed 10 years ago by rme

  • Resolution set to fixed
  • Status changed from assigned to closed

r12131 allows compound type specifiers as declaration identifiers

Note: See TracTickets for help on using tickets.