unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* (number? '1e311)
@ 2008-11-01 14:22 Bill Schottstaedt
  2008-11-19 21:48 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Bill Schottstaedt @ 2008-11-01 14:22 UTC (permalink / raw)
  To: bug-guile

I think number? should not signal an error -- it should
return either #t or #f:

guile> (number? '1e310)
ERROR: In procedure string->number:
ERROR: Value out of range: 310
ABORT: (out-of-range)
guile> ERROR: In procedure scm_read_expression:
ERROR: standard input:1:17: unexpected ")"
ABORT: (read-error)

Also, the error message should mention that the value 
in question is an exponent (this can be non-obvious in actual
code).






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

* Re: (number? '1e311)
  2008-11-01 14:22 (number? '1e311) Bill Schottstaedt
@ 2008-11-19 21:48 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2008-11-19 21:48 UTC (permalink / raw)
  To: bug-guile

Hi,

Sorry for the late reply.

"Bill Schottstaedt" <bil@ccrma.Stanford.EDU> writes:

> I think number? should not signal an error -- it should
> return either #t or #f:
>
> guile> (number? '1e310)
> ERROR: In procedure string->number:
> ERROR: Value out of range: 310
> ABORT: (out-of-range)
> guile> ERROR: In procedure scm_read_expression:
> ERROR: standard input:1:17: unexpected ")"
> ABORT: (read-error)

The error is not raised by `number?', it's raised by the reader, which
uses `string->number' internally.

Thanks,
Ludo'.





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

end of thread, other threads:[~2008-11-19 21:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-01 14:22 (number? '1e311) Bill Schottstaedt
2008-11-19 21:48 ` Ludovic Courtès

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).