[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exposing `scm_i_mem2number ()'

From: Ludovic Courtès
Subject: Re: Exposing `scm_i_mem2number ()'
Date: Thu, 16 Mar 2006 11:07:52 +0100
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)


About `scm_c_locale_string_to_number ()'...

address@hidden (Ludovic Courtès) writes:

> While writing it, it occurred to me that R5RS does not make it clear
> whether `string->number' converts from a number's external
> representation or not.

As discussed in [0], while R5RS does not explicitly state that
`string->number' converts from a number's external representation, it
makes a connection with `number->string' which in turn explicitly
converts to a number's external representation:

  - procedure: number->string z
  - procedure: number->string z radix
      RADIX must be an exact integer, either 2, 8, 10, or 16.  If
      omitted, RADIX defaults to 10.  The procedure `number->string'
      takes a number and a radix and returns as a string an external
      representation of the given number in the given radix such that

      (let ((number NUMBER)
            (radix RADIX))
        (eqv? number
              (string->number (number->string number

      is true.  It is an error if no possible result makes this
      expression true.

So the additional bit of documentation I suggested in my previous post
(stating that `locale' in `scm_c_locale_string_to_number ()' has nothing
to do with the number representation) is acceptable.

Can someone comment on it or commit it?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]