* [r6rs] #\x0 is a perfectly valid character datum representation
@ 2010-06-21 8:12 Marco Maggi
2010-06-21 19:26 ` Andy Wingo
0 siblings, 1 reply; 7+ messages in thread
From: Marco Maggi @ 2010-06-21 8:12 UTC (permalink / raw)
To: bug-guile
The following R6RS program:
(import (rnrs))
#\x0
fails with:
;;; note: source file proof.sps
;;; newer than compiled /home/marco/.cache/guile/ccache/2.0-0.R-LE-4/home/marco/var/tmp/proof.sps.go
Backtrace:
In ice-9/boot-9.scm:
170: 10 [catch #t #<catch-closure 96b6610> ...]
In unknown file:
?: 9 [catch-closure]
In ice-9/boot-9.scm:
62: 8 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
389: 7 [eval # #]
In ice-9/boot-9.scm:
1858: 6 [save-module-excursion #<procedure 9758840 at ice-9/boot-9.scm:1871:3 ()>]
1149: 5 [load "proof.sps" #f]
1051: 4 [%start-stack load-stack ...]
1056: 3 [#<procedure 97587b0 ()>]
In unknown file:
?: 2 [primitive-load "proof.sps"]
In ice-9/boot-9.scm:
115: 1 [#<procedure 95aa2f8 at ice-9/boot-9.scm:109:6 (thrown-k . args)> read-error ...]
In unknown file:
?: 0 [catch-closure read-error "scm_lreadr" ...]
ERROR: In procedure scm_lreadr:
ERROR: proof.sps:5:5: unknown character name x0
on a i686-pc-linux-gnu using commit
8d10ccae79ff46f0ebea92ba36acfaebafba8d86.
It looks like the hex notation for characters is not
recognised by the reader.
--
Marco Maggi
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [r6rs] #\x0 is a perfectly valid character datum representation
2010-06-21 8:12 Marco Maggi
@ 2010-06-21 19:26 ` Andy Wingo
2010-06-21 20:27 ` Mike Gran
0 siblings, 1 reply; 7+ messages in thread
From: Andy Wingo @ 2010-06-21 19:26 UTC (permalink / raw)
To: Marco Maggi; +Cc: bug-guile, Mike Gran
On Mon 21 Jun 2010 10:12, Marco Maggi <marco.maggi-ipsu@poste.it> writes:
> #\x0
Add (read-enable 'r6rs-hex-escapes) to your guile init file.
Mike: is there a more sensible default than the one we have?
Thanks,
Andy
--
http://wingolog.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [r6rs] #\x0 is a perfectly valid character datum representation
2010-06-21 19:26 ` Andy Wingo
@ 2010-06-21 20:27 ` Mike Gran
2010-06-21 20:36 ` Andy Wingo
0 siblings, 1 reply; 7+ messages in thread
From: Mike Gran @ 2010-06-21 20:27 UTC (permalink / raw)
To: Andy Wingo, Marco Maggi; +Cc: bug-guile
> From: Andy Wingo wingo@pobox.com
>> #\x0
> Add (read-enable 'r6rs-hex-escapes) to your
> guile init file.
> Mike: is there a more sensible default than the one we
> have?
The idea behind not enabling it by default is because the
r6rs *string* escapes are not backwards compatible with
the hex escapes used with Guile 1.8.x.
"Hello \x57orld" vs "Hello \x57;orld"
There is no perfect way to have both Guile 1.8.x and r6rs
*string* hex escapes at the same time. You could hack something
together, but, there would be corner cases where it
might be invalid. That's why it was made a reader option.
But, r6rs hex *character* escapes and Guile 1.8.x octal
character escapes could logically coexist without confusion.
But, it might be confusing to have r6rs hex character escapes
that work by default while r6rs string escapes don't work by
default.
Thanks,
Mike
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [r6rs] #\x0 is a perfectly valid character datum representation
2010-06-21 20:27 ` Mike Gran
@ 2010-06-21 20:36 ` Andy Wingo
2010-06-21 20:42 ` Mike Gran
0 siblings, 1 reply; 7+ messages in thread
From: Andy Wingo @ 2010-06-21 20:36 UTC (permalink / raw)
To: Mike Gran; +Cc: bug-guile
Hi Mike,
Thanks for the explanation :-)
On Mon 21 Jun 2010 22:27, Mike Gran <spk121@yahoo.com> writes:
> r6rs hex *character* escapes and Guile 1.8.x octal character escapes
> could logically coexist without confusion.
Let's do that. Shall you, or shall I?
> But, it might be confusing to have r6rs hex character escapes
> that work by default while r6rs string escapes don't work by
> default.
Well, we'll document this then, and perhaps revisit this in a couple
years.
Andy
--
http://wingolog.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [r6rs] #\x0 is a perfectly valid character datum representation
2010-06-21 20:36 ` Andy Wingo
@ 2010-06-21 20:42 ` Mike Gran
0 siblings, 0 replies; 7+ messages in thread
From: Mike Gran @ 2010-06-21 20:42 UTC (permalink / raw)
To: Andy Wingo; +Cc: bug-guile
> From: Andy Wingo wingo@pobox.com
> Hi Mike,
> Thanks for the explanation :-)
>> r6rs hex *character* escapes and Guile 1.8.x octal
>> character escapes could logically coexist without confusion.
> Let's do that. Shall you, or shall I?
It would happen more quickly if you did it.
You'd just have to remove the SCM_R6RS_ESCAPES_P
from the following line of scm_read_character() in read.c
969 if (cp == 'x' && (charname_len > 1) && SCM_R6RS_ESCAPES_P)
Thanks,
Mike
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [r6rs] #\x0 is a perfectly valid character datum representation
@ 2010-07-17 11:22 Mike Gran
2010-07-17 11:38 ` Andy Wingo
0 siblings, 1 reply; 7+ messages in thread
From: Mike Gran @ 2010-07-17 11:22 UTC (permalink / raw)
To: Andy Wingo; +Cc: bug-guile
> >> r6rs hex *character* escapes and Guile 1.8.x octal
> >> character escapes could logically coexist without confusion.
>
> > Let's do that. Shall you, or shall I?
I pushed this change into git.
Thanks,
Mike
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [r6rs] #\x0 is a perfectly valid character datum representation
2010-07-17 11:22 [r6rs] #\x0 is a perfectly valid character datum representation Mike Gran
@ 2010-07-17 11:38 ` Andy Wingo
0 siblings, 0 replies; 7+ messages in thread
From: Andy Wingo @ 2010-07-17 11:38 UTC (permalink / raw)
To: Mike Gran; +Cc: bug-guile
Hi,
On Sat 17 Jul 2010 13:22, Mike Gran <spk121@yahoo.com> writes:
>> >> r6rs hex *character* escapes and Guile 1.8.x octal
>
>> >> character escapes could logically coexist without confusion.
>>
>> > Let's do that. Shall you, or shall I?
>
> I pushed this change into git.
Thanks a lot!
Andy
--
http://wingolog.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-07-17 11:38 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-17 11:22 [r6rs] #\x0 is a perfectly valid character datum representation Mike Gran
2010-07-17 11:38 ` Andy Wingo
-- strict thread matches above, loose matches on Subject: below --
2010-06-21 8:12 Marco Maggi
2010-06-21 19:26 ` Andy Wingo
2010-06-21 20:27 ` Mike Gran
2010-06-21 20:36 ` Andy Wingo
2010-06-21 20:42 ` Mike Gran
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).