unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Marius Vollmer <mvo@zagadka.ping.de>
Cc: bug-guile@gnu.org
Subject: Re: number->string of float with radix
Date: 18 Oct 2002 23:53:09 +0200	[thread overview]
Message-ID: <87vg3z1kje.fsf@zagadka.ping.de> (raw)
In-Reply-To: <200210141055.DAA10691@cmn14.stanford.edu>

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

> standard input:1:1: Wrong type argument in position 2 (expecting INUMP): 2.0
> 
> "INUMP" is internal jargon -- "integer" or "exact integer" would be better.

Yes, I agree.  Our error messages suck generally, I'd say.  If you
want to work on this, I'd say we should define a new macro

    #define SCM_MAKE_VALIDATE2(pos, val, test, msg) \
      do { \
        SCM_ASSERT_TYPE (test, val, pos, FUNC_NAME, msg); \
      } while (0)

and then incrementally replace uses of SCM_MAKE_VALIDATE with improved
versions.  Or use SCM_ASSERT_TYPE directly.  Hmm.

> Also, I wonder about these kinds of calls:
> 
> guile> (number->string 10.5 2)
> "10.5"
> 
> It's actually not senseless to have base-2 float notation ("1010.1",
> "a.8" hex), but if Guile just returns base 10, maybe it should warn
> the caller?  Otherwise, for example, string->number does not invert
> number->string:
> 
> guile> (string->number "10.5" 2)
> #f

Yes.  We are in clear violation of R5RS here.  I'll record a bug for
this in the workbook.

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


  reply	other threads:[~2002-10-18 21:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-14 10:55 number->string of float with radix Bill Schottstaedt
2002-10-18 21:53 ` Marius Vollmer [this message]
2002-10-20 10:44   ` Bill Schottstaedt
2002-10-20 21:41     ` Marius Vollmer

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=87vg3z1kje.fsf@zagadka.ping.de \
    --to=mvo@zagadka.ping.de \
    --cc=bug-guile@gnu.org \
    /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).