~ chicken-core (chicken-5) 0e9c1d4162ad3133bdaf46882c9efca8c7d6bbf0
commit 0e9c1d4162ad3133bdaf46882c9efca8c7d6bbf0 Author: Peter Bex <peter@more-magic.net> AuthorDate: Thu May 23 20:57:21 2019 +0200 Commit: Peter Bex <peter@more-magic.net> CommitDate: Thu May 23 20:57:21 2019 +0200 Clarify that keywords and symbols are distinct types diff --git a/manual/Module (chicken keyword) b/manual/Module (chicken keyword) index 7493ef5f..72038fa1 100644 --- a/manual/Module (chicken keyword) +++ b/manual/Module (chicken keyword) @@ -3,10 +3,13 @@ == Module (chicken keyword) -Keywords are special symbols prefixed with {{#:}} that evaluate to -themselves. Procedures can use keywords to accept optional named -parameters in addition to normal required parameters. Assignment to -and binding of keyword symbols is not allowed. +Keywords are written like symbols, but prefixed with {{#:}}. They +evaluate to themselves. While they behave a lot like symbols in that +they are interned when read and can be compared in constant time with +{{eq?}}, they are a distinct type. In particular, they have no plist, +they cannot be bound or assigned to and aren't {{eq?}} to a symbol +with the same spelling. Procedures can use keywords to accept +optional named parameters in addition to normal required parameters. The parameter {{keyword-style}} and the compiler/interpreter option {{-keyword-style}} can be used to allow an additional keyword syntax, @@ -38,8 +41,7 @@ Note: the {{KEYWORD}} may actually be any kind of object. <procedure>(keyword? X)</procedure> -Returns {{#t}} if {{X}} is a keyword symbol, or {{#f}} -otherwise. +Returns {{#t}} if {{X}} is a keyword, or {{#f}} otherwise. ==== keyword->stringTrap