Re: [Factor-talk] Restricting number bases conversion to 36

2016-10-24 Thread John Benediktsson
I agree. Also that's a great example. 


> On Oct 24, 2016, at 7:12 AM, Jon Harper  wrote:
> 
> Hi list,
> From the docs, http://docs.factorcode.org/content/article-number-strings.html
> "Integers can be converted to and from arbitrary bases."
> 
> Indeed, we have:
> IN: scratchpad 1835084090 9830 >base print
> i♥u
> 
> and it round trips fine !
> IN: scratchpad 1835084090 9830 [ >base ] [ base> ] bi .
> 1835084090
> 
> So that's a bit silly and I think we could limit like most other languages 
> the base to 36 and throw invalid-radix like we do for bases < 2 .
> 
> What do you think ?
> 
> Jon
> --
> Check out the vibrant tech community on one of the world's most 
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Restricting number bases conversion to 36

2016-10-24 Thread Jon Harper
Hi list,
>From the docs,
http://docs.factorcode.org/content/article-number-strings.html
"Integers can be converted to and from arbitrary bases."

Indeed, we have:
IN: scratchpad 1835084090 9830 >base print
i♥u

and it round trips fine !
IN: scratchpad 1835084090 9830 [ >base ] [ base> ] bi .
1835084090

So that's a bit silly and I think we could limit like most other languages
the base to 36 and throw invalid-radix like we do for bases < 2 .

What do you think ?

Jon
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk