unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* defining new character names?
@ 2002-08-19 10:07 Lars J. Aas
  2002-08-19 23:36 ` Marius Vollmer
  2002-08-20  8:20 ` Matthias Koeppe
  0 siblings, 2 replies; 29+ messages in thread
From: Lars J. Aas @ 2002-08-19 10:07 UTC (permalink / raw)


  Hi folks,

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.

I've looked in libguile/chars.{c,h} and the guile docs, but
didn't find any obvious way to do this.  Is it possible?

The reason i'd like to do this is that inserting #\) in the
scheme file makes the vim "%" command unusable over those
blocks (and it's not as easy on the eye either), and there was
no alternate name for that char other than using the octal
ascii value.

Cheers,

  Lars J


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 29+ messages in thread
* Re: defining new character names?
@ 2002-08-21 15:24 Lynn Winebarger
  2002-08-21 17:33 ` Keith Wright
  0 siblings, 1 reply; 29+ messages in thread
From: Lynn Winebarger @ 2002-08-21 15:24 UTC (permalink / raw)


On Wednesday 21 August 2002 03:12, Lars J. Aas wrote:
> The most "transparent" solution
> would be to allow
> 
>   (define #\paren-close #\051)
> 
> [If the first token looks like a character constant, the second must
> be one too?]  Would that be possible to implement without any overhead
> on the define implementation?  Would it break something?

     Given the raging debate on this, I'll point out that Chez Scheme
has a function char-name that does this job.  
(char-name #\space) => 'space
(char-name 'space) => #\space
(char-name 'sym) => #f
(char-name #\b) => #f

(char-name 'paren-close #\051) => unspecified
(char-name #\paren-close) => 'paren-close

    Seems like a pretty good solution to me.
    
Lynn


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2002-09-01 16:49 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-19 10:07 defining new character names? Lars J. Aas
2002-08-19 23:36 ` Marius Vollmer
2002-08-20  3:40   ` Keith Wright
2002-08-21  4:01     ` Keith Wright
2002-08-21  8:12     ` Lars J. Aas
2002-08-21  8:43       ` rm
2002-08-21  8:51       ` Matthias Koeppe
2002-08-21  9:17         ` Lars J. Aas
2002-08-21  9:54         ` rm
2002-08-27 15:09           ` Matthias Koeppe
2002-09-01 16:24   ` Rob Browning
2002-09-01 16:49     ` Marius Vollmer
2002-08-20  8:20 ` Matthias Koeppe
2002-08-20 10:18   ` rm
2002-08-21  9:20     ` Matthias Koeppe
2002-08-21 10:00       ` rm
2002-08-21 18:01       ` Marius Vollmer
  -- strict thread matches above, loose matches on Subject: below --
2002-08-21 15:24 Lynn Winebarger
2002-08-21 17:33 ` Keith Wright
2002-08-21 18:27   ` Lynn Winebarger
2002-08-21 19:06     ` rm
2002-08-21 19:47       ` Lynn Winebarger
2002-08-21 23:04       ` Keith Wright
2002-08-21 23:07       ` Keith Wright
2002-08-21 19:40     ` Marius Vollmer
2002-08-22  4:12     ` Keith Wright
2002-08-22  5:16       ` Lynn Winebarger
2002-08-22  7:42         ` rm
2002-08-22  8:39           ` Lynn Winebarger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).