From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Julian Graham" Newsgroups: gmane.lisp.guile.user Subject: srfi-88 keyword / symbol ambiguity Date: Sun, 20 Jul 2008 16:35:43 -0400 Message-ID: <2bc5f8210807201335v3f2ceaf0lb250c35b54ff4727@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_8906_18175819.1216586143688" X-Trace: ger.gmane.org 1216586163 14830 80.91.229.12 (20 Jul 2008 20:36:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Jul 2008 20:36:03 +0000 (UTC) To: "Guile User" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Jul 20 22:36:52 2008 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KKfeE-0000au-4M for guile-user@m.gmane.org; Sun, 20 Jul 2008 22:36:50 +0200 Original-Received: from localhost ([127.0.0.1]:32903 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KKfdK-0005Kb-Oj for guile-user@m.gmane.org; Sun, 20 Jul 2008 16:35:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KKfdE-0005J7-2f for guile-user@gnu.org; Sun, 20 Jul 2008 16:35:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KKfdC-0005Gz-Gl for guile-user@gnu.org; Sun, 20 Jul 2008 16:35:47 -0400 Original-Received: from [199.232.76.173] (port=44709 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KKfdC-0005Ge-7s for guile-user@gnu.org; Sun, 20 Jul 2008 16:35:46 -0400 Original-Received: from ug-out-1314.google.com ([66.249.92.175]:54245) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KKfdB-0007iB-PT for guile-user@gnu.org; Sun, 20 Jul 2008 16:35:46 -0400 Original-Received: by ug-out-1314.google.com with SMTP id l31so206866ugc.48 for ; Sun, 20 Jul 2008 13:35:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=mNqNm81WdrIz8l8KLa8di+znEvJVHgOkMyVZJcspTdc=; b=hD5K/EU1oMVgtDZOuzVs3R5YAlfMtJN33dtRZC7eP+GG5YZJRmEYkQJUL9P+UYlMA3 ow1vA+5yBT37GI//VFbfnNBGtal3CMIOP5OmDMxtkdbCCbYCD7spPwDUt95DZDDBqa+f LWiKDEn4dDgrWmVgNajiCvteV3MdVq/Z7xhz0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=lTz8iqBKpGzNbXfjy3T7uYs2vBHxcowyzDgfR9bdX1vkHWgQom0X08iEKtHgRN16jx QTY3ujdVRGrDghv2pGUB4aslhY+sybXqOmSZyjrju8D7RxSlg9X3LYysM3hGwCTP+nH4 3vpiIw94/XvHDI6b0K3VbTozndC3P8yXWF0jc= Original-Received: by 10.67.87.6 with SMTP id p6mr1199880ugl.14.1216586143688; Sun, 20 Jul 2008 13:35:43 -0700 (PDT) Original-Received: by 10.66.237.3 with HTTP; Sun, 20 Jul 2008 13:35:43 -0700 (PDT) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:6681 Archived-At: ------=_Part_8906_18175819.1216586143688 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, 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:) #t guile> (keyword? 'foo:) #t guile> (symbol->string 'foo:) Backtrace: 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. Regards, Julian ------=_Part_8906_18175819.1216586143688 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Hi,

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:)
#t
guile> (keyword? 'foo:)
#t
guile> (symbol->string 'foo:)

Backtrace:
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.


Regards,
Julian
------=_Part_8906_18175819.1216586143688--