To begin in D coming from Python
Jarrett Billingsley
kb3ctd2 at yahoo.com
Mon Jul 21 09:32:12 PDT 2008
"Luis P. Mendes" <luislupeXXXX at gmailXXXX.com> wrote in message
news:g62b67$299b$3 at digitalmars.com...
>> If you are on Windows I warmly suggest you to learn the D 1.x version,
>> like the DMD compiler V.1.033.
> I use exclusively Linux. Should I stick with version 1 still?
I'm not sure what connection bearophile was making between what OS you use
and what version of D to use. D2 is in alpha, no matter what OS you're
using, and most/all libraries are written for D1, so you're probably better
off using D1 unless you really, really want some of the new features in D2.
> 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.
More information about the Digitalmars-d
mailing list