[Top][All Lists]

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

srfi-88 keyword / symbol ambiguity

From: Julian Graham
Subject: srfi-88 keyword / symbol ambiguity
Date: Sun, 20 Jul 2008 16:35:43 -0400


It looks like the changes to the reader to support SRFI-88-style keywords lead to some ambiguities when it comes to whether a token is a symbol or a keyword.  Specifically, it's no longer possible to create a symbol via quoting if that symbol ends in a colon:

guile> (use-modules (srfi srfi-88))
guile> (keyword? foo:)
guile> (keyword? 'foo:)
guile> (symbol->string 'foo:)

In standard input:
   6: 0* [symbol->string {#:foo}]

standard input:6:1: In procedure symbol->string in _expression_ (symbol->string (begin #)):
standard input:6:1: Wrong type argument in position 1 (expecting symbol): #:foo
ABORT: (wrong-type-arg)

This is particularly bad because it breaks a lot of code that calls `use-modules' with the :prefix or :rename syntax -- from looking at some of the core libraries, it seems like it's pretty common to use rename-prefixes that end in a colon.  So, for example, the ice-9 debugger modules don't work after loading `(srfi srfi-88)'.

I'm not sure yet what the fix would be -- maybe the reader should avoid converting a token into a postfix-style keyword if it's obvious from the read state that a symbol is desired (i.e., the quote character is prefixed), but that probably doesn't cover all the possibilities.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]