-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create generic function canonicalize-declaration-specifier #1
Comments
Introduction and basic use of CSTs: http://metamodular.com/concrete-syntax-tree.pdf |
Even better, go to the Documentation directory, and type `make' for the most recent version. |
Should we introduce another subclass for declaration specifer or just use expression-cst? |
A declaration is an expression (but not a form), and in fact, a |
Well, what I just wrote is not quite true. The CST library provides tools that distinguish between forms, |
Not sure I understand this. I guess information about client declarations is in the system parameter. What if an identifier is unknown? Error? Are clients expected to write methods to canonicalize their declaration specifiers or is there a default? But I think I don't understand what this function is supposed to do, because
which makes no sense since earlier it says DECLARATION-IDENTIFIER will be TYPE, and obviously the DECLARATION-DATA can't really be specialized on. This in turn makes me wonder why types are picked off earlier than client declarations, but whatever. Also methods on type specifiers does not make sense since they can be lists. |
I wrote: "A set of tests should be written to verify that the function |
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:
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.]
The text was updated successfully, but these errors were encountered: