Re: nested function overloading

2022-06-22 Thread monkyyy via Digitalmars-d-learn
On Monday, 20 June 2022 at 13:20:51 UTC, Steven Schveighoffer wrote: And you can also use an inner struct to define overloaded functions. I believe templates make a better bandaid ```d void main(){ template bar(){ void bar_(int){} void bar_(float){}

Re: Static Initialization of Structs syntax

2022-06-22 Thread Antonio via Digitalmars-d-learn
On Wednesday, 22 June 2022 at 09:41:55 UTC, Antonio wrote: I'm so sorry, I know that the above example doesn't work: ```d main(){ Struct PersonDTO { string name; string surname; } void create(PersonDTO personData){ // ... } create( {name: "Peter", surname: "Ustinov"} );

Re: Static Initialization of Structs syntax

2022-06-22 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 22 June 2022 at 11:19:59 UTC, Antonio wrote: I see now: DIP 1033 will solve this (i.e., using named arguments in struct constructor... similar to how dart/flutter works) That would be DIP 1030: https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1030.md Max

get debug information for Deprecation warning

2022-06-22 Thread test123 via Digitalmars-d-learn
When I get Deprecation warning from template, I can not find the root cause of the problem. ```sh Deprecation: argument `_param_1` for format specification `"%d"` must be `int`, not `ulong` ``` Is there a options to turn the Deprecation warning into assert error, so I can know the

Static Initialization of Structs syntax

2022-06-22 Thread Antonio via Digitalmars-d-learn
I'm so sorry, I know that the above example doesn't work: ```d main(){ Struct PersonDTO { string name; string surname; } void create(PersonDTO personData){ // ... } create( {name: "Peter", surname: "Ustinov"} ); } ``` -Is it there any alternative to initialize "inline"

Re: nested function overloading

2022-06-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/22/22 2:05 AM, monkyyy wrote: On Monday, 20 June 2022 at 13:20:51 UTC, Steven Schveighoffer wrote: And you can also use an inner struct to define overloaded functions. I believe templates make a better bandaid ```d void main(){ template bar(){     void bar_(int){}     void

Python <==> d call both ways example (with PyD and autowrap)?

2022-06-22 Thread mw via Digitalmars-d-learn
Hi, I know with PyD, D can call Python, and with autowrap, Python can call a D .dll, I'm just wondering if someone can show an example that Python <==> d can call both ways? esp. show passing D objects to Python and then call its member function there, and vice versa. Thanks.

Re: Python <==> d call both ways example (with PyD and autowrap)?

2022-06-22 Thread mw via Digitalmars-d-learn
On Thursday, 23 June 2022 at 02:35:25 UTC, Tejas wrote: IIRC the best you can do is embed a Python interpreter inside a D program https://pyd.readthedocs.io/en/latest/embed.html Thanks. I tried something like this: https://github.com/symmetryinvestments/autowrap/issues/314 Although

Re: Python <==> d call both ways example (with PyD and autowrap)?

2022-06-22 Thread Jordan Wilson via Digitalmars-d-learn
On Wednesday, 22 June 2022 at 16:02:00 UTC, mw wrote: Hi, I know with PyD, D can call Python, and with autowrap, Python can call a D .dll, I'm just wondering if someone can show an example that Python <==> d can call both ways? esp. show passing D objects to Python and then call its member

Re: Python <==> d call both ways example (with PyD and autowrap)?

2022-06-22 Thread Marvin via Digitalmars-d-learn
On Wednesday, 22 June 2022 at 16:02:00 UTC, mw wrote: Hi, I know with PyD, D can call Python, and with autowrap, Python can call a D .dll, I'm just wondering if someone can show an example that Python <==> d can call both ways? esp. show passing D objects to Python and then call its member

Re: Python <==> d call both ways example (with PyD and autowrap)?

2022-06-22 Thread Tejas via Digitalmars-d-learn
On Wednesday, 22 June 2022 at 16:02:00 UTC, mw wrote: Hi, I know with PyD, D can call Python, and with autowrap, Python can call a D .dll, I'm just wondering if someone can show an example that Python <==> d can call both ways? esp. show passing D objects to Python and then call its member