<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<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"
type="cite">
<style type="text/css">p { margin: 0; }</style>
<div style="font-family: times new roman,new york,times,serif;
font-size: 12pt; color: #000000">
<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;">
<div class="gmail_quote"><br>
<div id="DWT4000">Some of the stuff in our stdlib, like
providing zero-index based access everywhere is hard to
"backport" to Erlang. And other stuff like the Enum
module, which is a bunch of functions meant to work on any
enumerable data structure, like lists, dicts, etc,
requires protocols.</div>
</div>
</blockquote>
<br>
What is it with zero-based indexes that make people so morbidly
fascinated by them. If you are talking *offsets* then I agree
that zero-based is fine, it's saying how far away something is
from a some point. But here we are talking *indexes*, you know
like first, second, third, etc. No indexes start at one! And
don' go on about how C does it because C doesn't have arrays and
indexes it has pointers and offsets, foo[3] is just syntactic
sugar for *foo+3. And don't go on about how much easier it is to
count from zero, I don't buy that, we can all add and subtract
one without problems. Or at least I hope so.<br>
<br>
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>
<br>
I can see your point. I tend to think of indexing binaries as
"indexing char arrays" and everything else as "indexing erlang
terms".<br>
<br>
<blockquote
cite="mid:892582522.3039391.1359047532333.JavaMail.root@erlang-solutions.com"
type="cite">
<div style="font-family: times new roman,new york,times,serif;
font-size: 12pt; color: #000000"><br>
So to go on about this but there are some sensible things you
can criticize Erlang for and indexing from one is not one of
them. (And not really the syntax either, and this comes from the
creator of LFE)<br>
</div>
</blockquote>
<br>
IMHO: I think not having zero-based indexing in Erlang was a *big*
mistake. I can see where it comes from, but still .. it's a pain
knowing that I have to do +1/-1 to make certain algorithms function
properly.<br>
<br>
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>
<br>
// Björn-Egil<br>
</body>
</html>