From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: rm@fabula.de Newsgroups: gmane.lisp.guile.user Subject: Re: defining new character names? Date: Tue, 20 Aug 2002 12:18:07 +0200 Sender: guile-user-admin@gnu.org Message-ID: <20020820101807.GC21968@www> References: <20020819100733.GA6177@sim.no> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1029837987 7111 127.0.0.1 (20 Aug 2002 10:06:27 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 20 Aug 2002 10:06:27 +0000 (UTC) Cc: "Lars J. Aas" , guile-user@gnu.org Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17h5u4-0001q8-00 for ; Tue, 20 Aug 2002 12:06:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17h5v6-0003r5-00; Tue, 20 Aug 2002 06:07:28 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17h5sy-0003iH-00 for guile-user@gnu.org; Tue, 20 Aug 2002 06:05:16 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17h5sw-0003i5-00 for guile-user@gnu.org; Tue, 20 Aug 2002 06:05:16 -0400 Original-Received: from www.elogos.de ([212.18.192.92]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17h5sw-0003hx-00 for guile-user@gnu.org; Tue, 20 Aug 2002 06:05:14 -0400 Original-Received: by www.elogos.de (Postfix, from userid 5001) id CC194104902; Tue, 20 Aug 2002 12:18:07 +0200 (CEST) Original-To: Matthias Koeppe Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.24i Errors-To: guile-user-admin@gnu.org X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.user:815 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:815 On Tue, Aug 20, 2002 at 10:20:05AM +0200, Matthias Koeppe wrote: > "Lars J. Aas" writes: > > > I'd like to be able to do something like this: > > > > (define-character "paren-close" #\051) ; 051 is ")" > > > > and then later > > > > (string-index line #\paren-close) > > > > I can of course define a normal variable for this, but then > > it won't shine from the usage that it is a character in the > > way the above does. > > Why not use the name `paren-close-character' then. Because the first solution is read syntax: it's clear that #\paren-close is a character constant. > #\ is read-syntax for literal character constants. It is not a "type > annotation". (If you define constant numeric variables like `pi', the > name will not start with a digit either.) Yes, but scheme provides a special syntax for character constants. I have to admit that i toyed with the idea of extending guiles scm_charnames[] array in chars.c myself. My idea was to extend the table to use the names also used for ISO 8879 character entities (mostly known from their use in HTML pages). Since such entities are specific to an encoding it would make sense to make the table extensible (i guess this would need to be done by extending the read-options inter- face). > > I think it's a bad idea to change the language only to make sure that > a simplistic editor implementation works with it. File a bug report > with vim instead; I'm sure it is easy to fix. Yes, if this would be just to accomodate vi(m) this would be a bad idea, but this sounds like a reasonable extension to guile (after all: why #\dc3 but not #\copy ?) Ralf Mattes _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user