<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000'><br><hr id="zwchr"><blockquote id="DWT415" style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Björn-Egil Dahlberg" <egil@erlang.org><br><br>
<div class="moz-cite-prefix">On 2013-01-24 18:31, Björn-Egil
Dahlberg wrote:<br>
</div>
<blockquote cite="mid:51016FEF.2050302@erlang.org">
<div class="moz-cite-prefix">On 2013-01-24 18:12, Robert Virding
wrote:<br>
</div>
<blockquote cite="mid:892582522.3039391.1359047532333.JavaMail.root@erlang-solutions.com">
<style>p { margin: 0; }</style>
<div style="font-family: times new roman,new york,times,serif;
font-size: 12pt; color: #000000">I think the OTP group made a
bad decision *indexing* binaries from zero instead of one like
the rest of erlang. It is both wrong and makes the system
inconsistent.<br>
</div>
</blockquote>
Btw, when you say "the OTP group made a bad decision", exactly who
are you referring too? Yourself? Isn't these decisions from
CS-lab? Certainly way before my time =)<br>
</blockquote>
That probably sounds a bit more irritated than intended. <br>
<br>
I'm honestly curious, who decided indexing on terms and binaries and
what was the reasoning behind it?<br>
<br>
I think I recall someone saying that binary-syntax was the last
thing out from CS-Lab?<br>
<br></blockquote><br>The decisions were made at different times.<br><br>The choice of indexing in tuples and lists (with the lists:nth function) were made very early when all Erlang work was done by the CS-lab. So they are definitely my fault, partly at least. And I still think it was a good decision. :-)<br><br>Binaries were added when Erlang was still at CS-lab, but there were no indexing operations as such. split_binary/2 ORIGINALLY had as argument the length of the first binary, but now it is the position of the split. It works the same either way. IIRC<br><br>The later BIFs binary_split/2/3 came longer after Erlang left the CS-lab and is in the hands of the OTP group and are explicitly zero indexed.<br><br>My view is that you could choose either depending on you how you swing, but choosing both is definitely the worst option. I am getting old and I value consistency. :-)<br><br>Robert<br><br><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"></blockquote></div></body></html>