D code length vs other languages
Paolo Invernizzi
paolo.invernizzi at gmail.com
Fri Dec 6 20:09:46 UTC 2019
On Friday, 6 December 2019 at 18:53:22 UTC, Jonathan Marler wrote:
> On Friday, 6 December 2019 at 18:25:20 UTC, Craig Dillabaugh
> wrote:
>> On Friday, 6 December 2019 at 08:47:59 UTC, Paolo Invernizzi
>> wrote:
>>> On Thursday, 5 December 2019 at 22:28:53 UTC, Adam D. Ruppe
>> clip
>>>
>>> Yesterday happened to me to translate a modest size python
>>> script into D, to incorporate it in a product, and it was a
>>> pleasant experience.
>>>
>>> The port was really really easy ... but I'm starting to miss
>>> list comprehension ...
>>>
>>> Anyway, point taken!
>>
>> Wouldn't it be fairly easy to write some sort simple library
>> that gives you list comprehensions in D. It wouldn't be a
>> nice as the python syntax, but it should be doable no?
>
> You could do that, or you could use a UFCS chain as well. More
> flexible than list comprehensions.
Maybe you are both right ... and maybe I've written too much
Python code in the past years and indeed, UFCS chains are a
killer future of D: every list comprehension was turned into a
nice UFCS chain.
Let's forget about that: the point is still taken by D,
converting python code in D code is a pleasant experience!
More information about the Digitalmars-d
mailing list