Targeting C
Pelle Månsson
pelle.mansson at gmail.com
Fri Oct 23 12:05:24 PDT 2009
Leandro Lucarella wrote:
> Andrei Alexandrescu, el 23 de octubre a las 11:09 me escribiste:
>> Bill Baxter wrote:
>>> On Fri, Oct 23, 2009 at 5:13 AM, Andrei Alexandrescu
>>> <SeeWebsiteForEmail at erdani.org> wrote:
>>>> Yigal Chripun wrote:
>>>>> On 23/10/2009 13:02, bearophile wrote:
>>>>>> Chris Nicholson-Sauls:
>>>>>>
>>>>>>> I prefer this (Scala):
>>>>>>> list = list ++ (0 to 10)
>>>>>> That's quite less readable. Scala sometimes has some unreadable syntax.
>>>>>> Python has taught me how much useful a readable syntax is :-)
>>>>>> Designing languages requires to find a balance between several different
>>>>>> and opposed needs.
>>>>>>
>>>>>> Bye,
>>>>>> bearophile
>>>>> how about this hypothetical syntax:
>>>>>
>>>>> list ~= [0..10];
>>>> I'm not sure what the type of "list" is supposed to be, but this works today
>>>> for arrays:
>>>>
>>>> list ~= array(iota(0, 10));
>>> While we're not on the subject....
>>> "Iota" is right up there with "inSitu".
>>> I know it has a precedent elsewhere, but it sounds about as user
>>> friendly as monads. It just sounds like the language it trying to be
>>> snooty. Like "if you don't even know what iota is, you're clearly not
>>> qualified to join our little D club. Maybe you should try Java... or
>>> Logo". Compare that to Python where it's called "range", something
>>> every Joe the Programmer can certainly grok without having to get a
>>> Greek to English dictionary.
>> Given that "range" is already taken, what name do you think would work best?
>>
>> (I sometimes deliberately prefer less-used names because the more
>> used ones often come with baggage and ambiguities (as is the case
>> with "range"). Case in point, "in-situ" is more informative than
>> "in-place" because the former suggests emplacement of a substructure
>> within a larger structure. So to me an "in-situ" class member inside
>> a class has a clear meaning that the member sits right there within
>> the class. But anyhow I will use in-place from now on.)
>
> I don't see "range" taken inside the range module. I think it even makes
> sense, iota() is the more primitive range ever, so why don't just call it
> range()? :)
>
This was my thought as well.
I don't know if it fares well in the ambiguity department, though.
More information about the Digitalmars-d
mailing list