Path: utzoo!utgpu!water!watmath!clyde!ima!think!barmar From: barmar@think.COM (Barry Margolin) Newsgroups: comp.lang.lisp Subject: Re: Disabling colons in CommonLisp Keywords: help! Message-ID: <24747@think.UUCP> Date: 1 Aug 88 19:02:13 GMT References: <2694@mind.UUCP> Sender: usenet@think.UUCP Reply-To: barmar@kulla.think.com.UUCP (Barry Margolin) Organization: Thinking Machines Corporation, Cambridge, MA Lines: 28 In article <2694@mind.UUCP> romero@mind.UUCP (Antonio Romero) writes: >So I need a solution which would allow tokens to end in colons, without >breaking the other special interpretations associated with colons. >Ideally this would be possible within the CommonLisp standard, so as to be >portable, but I'll settle for a non-portable solution if I have to. >Has anyone out there solved this one already? It will have to be non-portable, as there is no way to write what colon does within Common Lisp. The problem is that the handler for the colon character needs to back up the parser, and the Common Lisp reader macro facility doesn't provide that functionality; reader macros can only look ahead. Colon has to be built in to the reader so that it can do this. Couldn't you write an editor macro or sed script to go through your production source files and put a backslash before the colons? If you don't use colons for their Common Lisp meaning in the same files as your productions then you could bind *READTABLE* to a readtable that has colon defined as a constituent character while you load the productions. When you are loading Lisp source files you would use the regular readtable. Barry Margolin Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar