I think it better to extend the radix of `string->number` and
`number->string` to 2...36(inclusive) for now, and take more time to
think about bigger ranges.

I'm not sure about a good convention for a bigger radix, like 60.
(number->string 100 60 #:symbols '("01" "02" ... "59") #:separator ":")
(number->string 100 60 #:symbols "0123...9ABC...Zabc...z!\"#$%&/()=...")

Gustavo


By the way, the output of `number->string` for fractions is both
obvious and unexpected

(number->string (/ 1000 3) 8) ;=> "1750/3"
(number->string (/ 1 64) 8) ;=> "1/100"

I think it needs an explicit example in the documentation.


On Tue, Dec 27, 2016 at 6:57 PM, Robby Findler
<ro...@eecs.northwestern.edu> wrote:
> The main thing I worry about is that there are standard conventions
> that we're missing from other language families. Would someone mind
> investigating a few other, popular languages to see what they do so
> that can be taken into account? And perhaps pointing to the docs or
> showing some example code? (If we don't like what they do, we don't
> have to do it that way, but gratuitous difference seems unwise.)
>
> Robby
>
>
> On Tue, Dec 27, 2016 at 3:54 PM, Vincent St-Amour
> <stamo...@eecs.northwestern.edu> wrote:
>> I don't see any reason why not, and it doesn't seem (by the discussion)
>> that anyone is strongly against.
>>
>> Would you be interested in submitting a pull request to extend
>> `string->number`? You'd probably want to extend `number->string` as
>> well, and possibly others.
>>
>> Vincent
>>
>>
>>
>> On Thu, 22 Dec 2016 05:51:06 -0500,
>> Dmitry Igrishin wrote:
>>>
>>> >> Why restricting it to 36?
>>> >
>>> >
>>> > I guess that the original poster implied 10 digits + 26 Latin letters for
>>> > notation.
>>> True. And this notation is used in standard numeric conversion
>>> functions in C, C++ and Common Lisp. So, I think it's reasonable to
>>> use it in Racket.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "Racket Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to racket-users+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to