To begin in D coming from Python

Luis P. Mendes luislupeXXXX at gmailXXXX.com
Tue Jul 22 08:16:48 PDT 2008


On Mon, 21 Jul 2008 12:32:12 -0400, Jarrett Billingsley wrote:

> "Luis P. Mendes" <luislupeXXXX at gmailXXXX.com> wrote in message
>> So can I define something as this kind of list: [type char, type int,
>> type float,...] ?
> 
> No.  There are structures and classes if you want to group multiple
> different types, as well as tuples, but they are not first-class objects
> as in Python and are strictly compile-time entities.
> 
> It's not that lists of varying types aren't useful, it's that the way
> you'd do it in D would be (possibly very) different from the way you'd
> do it in Python, is all.  Syntax is sugar.  It's not enough to say that
> "language X doesn't have feature Y so it's not possible to do algorithm
> Z."  It probably is possible, just not in the same way as if you had
> feature Y.
It's fine with me to have different syntax.

One of the things that caught my eye on D website is that it is said that
D combines power and performance of C, C++ with programmer productivity of
modern languages like Ruby and Python.  This is the main reason I posted 
to this group. I wanted to know from very knowledgeable peoplein D whether 
there were similar structures between D and Python (with increased 
performance), at least the ones I keep on using in Python.


Luis



More information about the Digitalmars-d mailing list