[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Prefix, not postfix

The SRFI specifies a new kind of datatype, the keyword. Any symbol
can be turned into a keyword by adding a colon to the end.

I think this is a bad idea.

Everywhere else in Scheme, I can recognize the kind of an object
by looking at the start of the name, never by looking at the end.
Postfix is only used as a convention to signify a mutating
operator or predicates. But in that case, the kind of object
doesn't change due to the postfix syntax - it's still an operator.

I don't think that the argument put forth in the SRFI, according
to which a postfix colon is used because that does not conflict
with R5RS, is a good reason to decrease consistency and

The only remaining argument I can think of in favor of the postfix
colon is that it's more natural to write "foo: bar" - but the same
way Scheme prefers to use prefix math operators for consistence
instead of using the "more natural" infix syntax, I think using
":foo bar" is more consistent with the rest of Scheme.

The ":foo" syntax has precedence in many Scheme implementations,
as stated in the SRFI itself. If we want to standardize on a
keyword datatype and syntax, we should make it consistent with
Scheme, and not just "compatible with R5RS".

Semi-long posting, short summary: If we do indeed have to
standardize keywords, please use prefix colons. :-)

        -- Jorgen

((email . "forcer@forcix.cx") (www . "http://www.forcix.cx/";)
 (gpg   . "1024D/028AF63C")   (irc . "nick forcer on IRCnet"))