unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: rm@fabula.de
Cc: "Lars J. Aas" <larsa@sim.no>, Keith Wright <kwright@gis.net>,
	mvo@zagadka.ping.de, guile-user@gnu.org
Subject: Re: defining new character names?
Date: Wed, 21 Aug 2002 11:54:22 +0200	[thread overview]
Message-ID: <20020821095422.GC23971@www> (raw)
In-Reply-To: <uw565y4lhlx.fsf@saturn.math.uni-magdeburg.de>

On Wed, Aug 21, 2002 at 10:51:38AM +0200, Matthias Koeppe wrote:
[...]
> 
> It would break everything.

I agree with that (see previous post)

[...]

> As I wrote before, I believe you are misunderstanding the role of the
> #\ read syntax.  It is not meant as a syntax for character constants;
> rather it is a way to specify literal characters, like
> 
>        #\c

Hmm, what's the difference between 'character constant' and 'literal characters'
for you? The way i understand the '#\...' read extension, it also provides a
mean to ease writing hard-to-write/read character constants (like tab,
space, dc1, page, null etc.). Since it's really hard to read the following
code:
 
   (if (eq? the-char #\
   ) (display 'yes))

there is the convenience of writing:
  
  (if (eq? the-char #\newline) (display 'yes))

Now, the notion of 'hard to read/write' character is different for different
users (not _only_ vim users, french/german accented characters can be tricky
too :), so why not extend guiles read options to tailor the set of "named"
characters to the users needs?


> There is also no special syntax for string constants, or integer
> constants in Guile; there only is read syntax for literal strings, like

Are you focusing on the 'constant'-ness?

>         "Error"

_is_ constant, afaik.
and so is 314159265

> and literal numbers, 
> 
>         314159265.
> 
> If you want to create a named constant, you simply do
> 
>    (define error-message "Error")
>    (define scaled-pi 314159265)

No. 'error-message' is not constant after that:

   (set! error-message 'moep?)

> In the same way, you do
>    
>    (define paren-close-char #\051)
> 
> or
> 
>    (define paren-close-char (integer->char 41))
> 
> What I think _would_ be useful for Guile is a new DEFINE form that
> creates constant variables, like DEFINE-CONSTANT, so you could say
>         
>    (define-constant paren-close-char (integer->char 41)).
> 
> This may serve useful for compiler optimizations, because the compiler
> (if any) could assume that the value of the variable never changes.

Yes, but that's an enirely different topic ....

  Ralf

> Regards,
> 
> -- 
> Matthias K?ppe -- http://www.math.uni-magdeburg.de/~mkoeppe
> 
> 
> _______________________________________________
> Guile-user mailing list
> Guile-user@gnu.org
> http://mail.gnu.org/mailman/listinfo/guile-user


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


  parent reply	other threads:[~2002-08-21  9:54 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020821095422.GC23971@www \
    --to=rm@fabula.de \
    --cc=guile-user@gnu.org \
    --cc=kwright@gis.net \
    --cc=larsa@sim.no \
    --cc=mvo@zagadka.ping.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).