[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: defining new character names?
From: |
Lynn Winebarger |
Subject: |
Re: defining new character names? |
Date: |
Wed, 21 Aug 2002 14:47:26 -0500 |
On Wednesday 21 August 2002 14:06, address@hidden wrote:
> Still, the name is not really, um, wisely chosen.
I'm not married to it.
> There's no reason
> for not expressing the functions effect in its name.
>
> (name-of-char #\tab) => 'tab
> (symbol->char 'newline) => #\12
> (name-char! #\12 #\newline)
Fine by me.
> > [ ugliness deleted]
> I'd feel uneasy with _that_. Here #\separator is not used as a character
> constant but rather as a symbolic constant.
No, here `separator' is a variable in a completely different namespace
from Scheme variables. I'm not sure why you consider it a constant of any
sort, symbolic or otherwise. One character names and numeric representations
- those should be considered constants.
> Those are semantically different
> things. Also, your use would imply that the following works:
>
> (define (bla blub)
> (char-name 'separator #\tab)
> (display (format "~s~s~s" a #\separator b)) (newline))
>
> which will probably _not_ do what you expect it to do since #\separator
> in the display statement will be expanded during _read_ time (when the
> program code gets parsed by guile), so the call to 'char-name' at runtime
> will not affect it.
True enough.
> We need to be carefull here to not mix two very different things. Extending
> guiles set of named character constants and maybe making this names changeable
> (not a bad thing in my opinion) and, otoh, mixing character constants with
> symbolic constants (irritating and not neccessary IMHO).
>
I would say you're interacting with the reader's evaluation of
identifiers in the
#\ language (a very simple language, you're either a constant or an identifier
that
directly corresponds to a constant). You could even change it so that the
reader
parses character names into different types of objects than characters, and
delay
evaluation of them until execution.
Lynn
- Re: defining new character names?, (continued)
- Re: defining new character names?, Lynn Winebarger, 2002/08/21
- Re: defining new character names?, Keith Wright, 2002/08/21
- Re: defining new character names?, Marius Vollmer, 2002/08/21
- Re: defining new character names?, Keith Wright, 2002/08/22
- Re: defining new character names?, Lynn Winebarger, 2002/08/22
- Re: defining new character names?, rm, 2002/08/22
- Re: defining new character names?, Lynn Winebarger, 2002/08/22