How to imporve D-translation of these Python list comprehensions ?

bauss jj_1337 at live.dk
Thu Feb 1 14:36:48 UTC 2018


On Thursday, 1 February 2018 at 11:59:23 UTC, Russel Winder wrote:
> On Mon, 2018-01-15 at 21:13 +0000, lobo via Digitalmars-d-learn 
> wrote:
>> On Monday, 15 January 2018 at 19:05:52 UTC, xenon325 wrote:
>> > A workmate has recently shown this piece of code to show how 
>> > nice Python is (we are mostly C and growing C++ shop):
>> > 
>> > [...]
>> 
>> Well if that is what they can do in Python I'd hate to see 
>> their C++! They have done a great job making Python code read 
>> like Perl. This looks like something you'd see in an 
>> assignment at uni; "Decipher this Python code and port to your 
>> language of choice" :)
>
> Apart from the slur on Perl, I have to agree with this. Using a 
> dreadful bit of Python code is the start of a downward spiral 
> of expectation and programming in other languages.
>
> As noted earlier, I am working on a nicer rendering of this 
> algorithm, and will be happy to share if people are interested.

I'd be interested in seeing the result.


More information about the Digitalmars-d-learn mailing list