<div dir="ltr">Hi Andrew,<div><br></div><div style>How base 1 works? Could you explain to me please? Is it number or digits after dash?</div><div style><br></div><div style>Best regards,</div><div style>Max</div></div><div class="gmail_extra">

<br clear="all"><div><div>Best regards,</div><div>Max</div><br></div>
<br><br><div class="gmail_quote">On Sun, Jun 2, 2013 at 11:22 PM, Andrew Pennebaker <span dir="ltr"><<a href="mailto:andrew.pennebaker@gmail.com" target="_blank">andrew.pennebaker@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">Could we extend the # integer syntax to support base 1? It would be cool if 1#11111111 worked, instead of doing this:<div><br></div><div><div>$ erl</div><div>Erlang R15B03 (erts-5.9.3.1) [source] [64-bit] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:false] [dtrace]</div>


<div><br></div><div>Eshell V5.9.3.1  (abort with ^G)</div><div>1> 2#1000.</div><div>8</div><div>2> 1#11111111.</div><div>* 1: illegal base '1'</div><div>2> #11111111.</div><div>* 1: syntax error before: 11111111</div>


<div><br></div><div>To be sure, base 1 isn't used that often in practice. But neither is base 3, 13, or 37, so it seems a little strange why the range of base literals is [2, 36]. If we apply the principle of "least surprise", I think it would be a good idea to also accept base 1.</div>


<div><br></div><div>At worst, this would add one more complexity step; if we can't use the current base conversion algorithm for base 1, then adding one more match case and summing the number of 1's to follow would be trivial enough to implement.</div>


<div><br></div><div>What do you think?</div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div></div>Cheers,<div><br></div><div>Andrew Pennebaker</div><div><a href="http://www.yellosoft.us" target="_blank">www.yellosoft.us</a></div>


</font></span></div></div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>