Re: is there a way to embed python 3.7 code in D program?

2019-05-13 Thread evilrat via Digitalmars-d-learn
On Monday, 13 May 2019 at 21:29:18 UTC, Danny Arends wrote: "ImportError: No module named 'stuff'" How do I make the py_import file from pyd find the stuff.py file ? On Linux PYTHONPATH doesn't have current directory by default, so a hacky way to do it is to add it to PYTHONPATH prior to

Re: is there a way to embed python 3.7 code in D program?

2019-05-13 Thread Danny Arends via Digitalmars-d-learn
On Monday, 13 May 2019 at 09:03:02 UTC, evilrat wrote: On Monday, 13 May 2019 at 03:06:07 UTC, evilrat wrote: https://github.com/Superbelko/pyd-min Here. Super minimal example, ptvsd can be commented out as well, it is there entirely for debugging. Pardon me, somehow I was completely misr

CTFE in imported static initializers

2019-05-13 Thread Steven Schveighoffer via Digitalmars-d-learn
I have just discovered an interesting behavior, and I'm wondering if this behavior is intentional or even necessary. Let's say I have this module called mod2.d: module mod2; string buildModData() { string result; foreach(i; 0 .. 1) result = result ~ "lots and lots and lots

Re: windowsx.h

2019-05-13 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-05-12 17:07:40 +, rikki cattermole said: Yes. But a generated binding may not be good enough as it is. You may need to modify it. Well, my gift of second sight is pretty much non-existing, so I don't have a clue what would need to be modified... -- Robert M. Münch http://www.sap

Re: C Style char**

2019-05-13 Thread Doug Clayton via Digitalmars-d-learn
On Monday, 13 May 2019 at 09:56:19 UTC, evilrat wrote: On Monday, 13 May 2019 at 09:24:34 UTC, Doug Clayton wrote: [...] You don't need to cast it, arrays have .ptr property to get pointer to first element, and in @safe you just &arr[0] instead, or so I think. If you are using static/liter

Re: C Style char**

2019-05-13 Thread evilrat via Digitalmars-d-learn
On Monday, 13 May 2019 at 09:24:34 UTC, Doug Clayton wrote: Hi All, First time poster :) I'm working on getting a binding to Vulkan working properly in D, but I've run into a roadblock. The good news is that the binding seems to work fine, but I'm having an issue getting a parameter that nee

Re: Framework design, initialization and framework usage

2019-05-13 Thread ztop via Digitalmars-d-learn
On Sunday, 12 May 2019 at 17:33:16 UTC, kdevel wrote: On Wednesday, 8 May 2019 at 09:15:41 UTC, Ron Tarrant wrote: On Wednesday, 8 May 2019 at 06:30:56 UTC, Robert M. Münch wrote: Our focus is executable size (I'm an old school guy) and speed. What about correctness? [...] For some simple

C Style char**

2019-05-13 Thread Doug Clayton via Digitalmars-d-learn
Hi All, First time poster :) I'm working on getting a binding to Vulkan working properly in D, but I've run into a roadblock. The good news is that the binding seems to work fine, but I'm having an issue getting a parameter that needs an input of a const(char*)* to receive all of the members

Re: is there a way to embed python 3.7 code in D program?

2019-05-13 Thread evilrat via Digitalmars-d-learn
On Monday, 13 May 2019 at 03:06:07 UTC, evilrat wrote: https://github.com/Superbelko/pyd-min Here. Super minimal example, ptvsd can be commented out as well, it is there entirely for debugging. Pardon me, somehow I was completely misread the original question... Well, maybe someone else

Re: LDC2 and classic profiling

2019-05-13 Thread Denis Feklushkin via Digitalmars-d-learn
On Sunday, 12 May 2019 at 17:24:24 UTC, Johan Engelen wrote: Excellent. I think dub -v will output the exact commands that dub is executing. Looks like some parts are not compiled with the compile flag, and some other parts are? Got it! -v displays only one ldc2 execution with -fprofile-i

Re: is there a way to embed python 3.7 code in D program?

2019-05-13 Thread Russel Winder via Digitalmars-d-learn
On Sun, 2019-05-12 at 20:06 +, torea via Digitalmars-d-learn wrote: > Hi, > > I'd like to use D for the "brain" of a small robot (Anki vector) > whose API is coded in Python 3.6+. > I had a look at Pyd but it's limited to python 2.7... PyD works entirely fine for me using Python 3.7. I am u