ISSUE: Keyword/Expression Simplification REVISION HISTORY: 17 Feb 1994, William Lott (Gwydion) RELATED ISSUES: Symbol Literal Cleanups This proposal assumes Symbol Literal Cleanups passes. If Symbol Literal Cleanups is not accepted, this proposal will have to be adjusted to correspond to whatever takes the place of Symbol Literal Cleanups. CATEGORY: Change PROBLEM DESCRIPTION: The rules for where keywords can appear as literals in expressions are unnecessarily complex, for little gain in utility. Having to explain that: foo(keyword:) is syntactically valid while: if (var = keyword:) ... end is not is going to make the language just that much more complex to and difficult to learn by potential users. PROPOSAL: Remove the grammar statement that allows keywords to be used as expressions, reducing the expression grammar non-terminal to: expression: operand operand binop-series RATIONALE: Removing the special case for keywords as expressions will simplify the language without sacrificing any functionality. Any place a symbolic literal is needed, the #"..." syntax can be used instead. EXAMPLES: var = foo:; => syntax error, as always var = #"foo"; => #t or #f, depending on var. (foo:) = 10; => now a syntax error, was okay before. COST TO IMPLEMENTORS: Minor. Requires a few simple changes to the grammar. COST TO USERS: Requires that symbolic constants be #"foo" a few places where foo: would have otherwise worked. PERFORMANCE IMPACT: BENEFITS: Makes the language slightly easier to understand. AESTHETICS: Positive. IMPLEMENTATION NOTES: FUTURE FEATURES: DISCUSSION: VOTES: OPTIONAL AMENDMENT: Extend the property-list grammar non-terminal to: property-list: property property-list , property property: keyword expression keyword keyword RATIONALE: Some people have complained that for init-keywords, having the syntax of the keyword specification be identical to uses of the keyword in the argument list to make is good. Specifically, they prefer: define class () slot bar, init-keyword: bar:; end; to: define class () slot bar, init-keyword: #"bar"; end; This amendment allows for this by special casing property lists, as opposed to expressions. The foot-print of this special case is much smaller, and hence impacts less of the overall language. EXAMPLES: No net change to define class. COST TO IMPLEMENTORS: Minor. Requires a few simple changes to the grammar. COST TO USERS: Requires that they understand that the things in property lists can be keywords in addition to expressions. PERFORMANCE IMPACT: BENEFITS: Makes init-keyword: properties in class slots easier to read. AESTHETICS: Depends on opinion. IMPLEMENTATION NOTES: FUTURE FEATURES: DISCUSSION: VOTES: