Closed aartaka closed 1 year ago
Another point:
- How to you distinguish options from slots? Could check if first element is a keyword or a symbol, but we should see what the standard allows here.
Keyword checking is safe, I guess. defclass
doc says:
Slot-name--a symbol. The slot-name argument is a symbol that is syntactically valid for use as a variable name.
And then, keywords cannot be variables, at least. Spinneret uses keywords as macro names, and you can defun
a keyword function, which is not cool, but slot name... I'm not sure—keywords are not valid boundp
variable names, at least (҂⌣̀_⌣́)
Uh oh, that's bad. CCL and ECL both allow keywords as slot names.
Closing as not-implementable-reliably then.
So we mostly stick to the overall structure of
defclass
with ourdefine-class
, which is cool. but then there's an extra layer of parentheses to slot definitions we have:While this is consistent with historic form, it would be cool to drop this extra layer. Several problems with it:
(slot-a 5)
and(slot-a slot-b slot-c)
. Maybe even impossible.I'm extremely uncertain about this, but if we make it deterministic enough, then why not have it?