Targeting C

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Oct 23 09:09:59 PDT 2009


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.)


Andrei



More information about the Digitalmars-d mailing list