Skip to content

Create generic function canonicalize-declaration-specifier #1

Description

@robert-strandh

This enhancement consists of writing a generic function named
CANONICALIZE-DECLARATION-SPECIFIER. It should take four parameters:

  • SYSTEM. An object representing the Common Lisp system.

  • DECLARATION-IDENTIFIER. A symbol that identifies what kind of
    declaration specifier to be canonicalized. Methods will have EQL
    specializers for this parameter. When the declaration specifier is a
    type specifier, the identifier will always be the symbol TYPE. No
    implicit type specifiers will ever be passed to this function.

  • DECLARATION-IDENTIFIER-CST. A CST that has DECLARATION-IDENTIFIER
    as its associated RAW data.

  • DECLARATION-DATA. A CST that has the CDR of the declaration
    specifier to be canonicalized as its associated RAW data.

It should return a list of CSTs representing canonicalized declaration
specifiers. A canonicalized declaration specifier is one of the
following:

  • (declaration name)
  • (dynamic-extent var)
  • (dynamic-extent (function fn))
  • (ftype type function-name)
  • (ignore var)
  • (ignore (function fn))
  • (ignorable var)
  • (ignorable (function fn))
  • (inline function-name)
  • (notinline function-name)
  • (optimize (quality value))
  • (special var)
  • (type typespec var)

plus any canonicalized declaration specifier that is specific to the
client system. The CST representing the CAR of each element of the
list should be that of the second argument to the function. The CST
representing the canonicalized declaration data should be taken from
the corresponding information in the DECLARATION-DATA CST.

In addition to the definition of the generic function itself, the
enhancement consists of writing default methods (with the SYSTEM
parameter being unspecialized) for all standard Common Lisp type
identifiers.

A set of tests should be written to verify that the function works
for all Common Lisp declaration identifiers.
[I initially accidentally wrote "type identifiers" instead of
"declaration identifiers". Sorry about that.]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions