Re: PyD - accessing D class fields in Python

2021-05-18 Thread mw via Digitalmars-d-learn
On Monday, 17 May 2021 at 16:54:07 UTC, mw wrote: I filed the issue here (still no response yet): https://github.com/ariovistus/pyd/issues/152 It's fixed now: pyd version >= 0.14.1

Re: General rule when not to write ;

2021-05-18 Thread FeepingCreature via Digitalmars-d-learn
On Tuesday, 18 May 2021 at 16:27:13 UTC, Alain De Vos wrote: After each } i write a ; And let the compiler tell me it is an empty instruction. What are the general rules where ; is not needed after a } Is `;` ever needed after a `}`? I guess in `void delegate() dg = { writeln!"Hello World"; };

General rule when not to write ;

2021-05-18 Thread Alain De Vos via Digitalmars-d-learn
After each } i write a ; And let the compiler tell me it is an empty instruction. What are the general rules where ; is not needed after a }

Re: How to import the types mapresult and filterresult

2021-05-18 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 18 May 2021 at 12:15:25 UTC, Alain De Vos wrote: Something like: import X.Y.Z:mapresult ; You don't. The types returned by map, filter, and other algorithms are not public. They're "Voldemort", or anonymous, types. Instances aren't generally intended to be stored, but rather to b

How to import the types mapresult and filterresult

2021-05-18 Thread Alain De Vos via Digitalmars-d-learn
Something like: import X.Y.Z:mapresult ;

Re: How is opEquals used in toHash

2021-05-18 Thread Simen Kjærås via Digitalmars-d-learn
On Tuesday, 18 May 2021 at 10:14:26 UTC, PinDPlugga wrote: But what I do not understand is why opEquals is necessary and where in the implementation of toHash it plays its role? Since area1 and area2 have different static arrays of Points I understand why `typeid(points).getHash(&points)` would

How is opEquals used in toHash

2021-05-18 Thread PinDPlugga via Digitalmars-d-learn
In the solution to one of the exercises in Programming in D the unittests fail with respect to the toHash implementation. Here is a link to the full solution provided: https://run.dlang.io/gist/99ddf791f86aaa9d333d032166aadcb9?args=-unittest%20-main and the link to the relevant section in the b

Re: ugly and/or useless features in the language.

2021-05-18 Thread Alain De Vos via Digitalmars-d-learn
For a number it's best to have something you know how many bytes it takes in memory.

Re: ugly and/or useless features in the language.

2021-05-18 Thread Alain De Vos via Digitalmars-d-learn
Knowing the number of bytes in memory is a good thing.