Stupid little iota of an idea

Jonathan M Davis jmdavisProg at gmx.com
Fri Feb 11 18:05:22 PST 2011


On Friday, February 11, 2011 17:02:18 Michel Fortin wrote:
> On 2011-02-11 19:55:05 -0500, bearophile <bearophileHUGS at lycos.com> said:
> > I am not going to invent a new wonderful name for it, sorry :-) My
> > votes, in decreasing order of preference:
> > 1) By far, a syntax like a..b:c, or missing that, a syntax like a..b
> 
> No one noticed yet that the a..b:c syntax causes ambiguity? Tell me,
> how do you rewrite this using the new proposed syntax:
> 
> 	auto aa = [iota(a, b, c): 1, iota(d, e): 2];
> 
> > 3) If you refuse the word "range", then my third choice is "interval".
> > It's as cleas as range, but it's a bit worse because it's longer.
> 
> Interval is clear only as long as there's no step value mentioned.
> Having a step value is quite a stretch from the usual notion of an
> interval.
> 
> I like a lot so's suggestion "walk". I'm not sure it's much clearer
> than iota though.

Honestly, I'd prefer iota to walk or interval. I see walk and I think about 
walkLength. It certainly isn't enough to tell me what the function does. 
interval is slightly better, but as you mention, the step value muddles that 
abstraction. While iota isn't clear, it _does_ have the advantage that you're 
not going to _mis_understand what it does based on its name, and it is _highly_ 
memorable. It's also short, which is nice. genSequence is pretty much the only 
thing that I've been able to think of that I like at all, but I'm perfectly fine 
with keeping iota, honestly. It's short, and I'll actually remember it, even if 
I don't use it all of the time.

The thing about this kind of voting though is that it's likely that all of the 
folks who dislike the status quo will comment/complain and vote, whereas the 
people who don't really care or who actually really like the status quo mostly 
probably already stop reading this thread and won't say anything. So, it will 
look like the consensus is that the status quo is bad even if the majority 
actually don't agree. So, if we want to actually vote on this, then we should 
come up with a set of suggestions for the name and then start a new thread vote 
the vote. Personally, I'd just as soon leave iota as-is.

- Jonathan M Davis


More information about the Digitalmars-d mailing list