Re: How to call 'shared static this()' code of a D shared library?

2020-01-17 Thread Adam D. Ruppe via Digitalmars-d-learn
Did you already try rt_init? That should trigger it

How to call 'shared static this()' code of a D shared library?

2020-01-17 Thread Ali Çehreli via Digitalmars-d-learn
Simply linking my D shared library with foreign code (Python with the help of ctypes in this case) does not work. What function should I call? What about 'shared static ~this()'? And would the answer be different for 'static this()' etc.? Thank you, Ali

Re: lambda alias import

2020-01-17 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Jan 17, 2020 at 04:12:18PM -0800, Ali Çehreli via Digitalmars-d-learn wrote: > On 1/17/20 3:04 PM, Petar Kirov [ZombineDev] wrote:> On Friday, 17 January > 2020 at 21:40:05 UTC, JN wrote: > > > I think the problem comes from the way you compile and link your > > code. I you compile both

Re: lambda alias import

2020-01-17 Thread Ali Çehreli via Digitalmars-d-learn
On 1/17/20 3:04 PM, Petar Kirov [ZombineDev] wrote:> On Friday, 17 January 2020 at 21:40:05 UTC, JN wrote: > I think the problem comes from the way you compile and link your code. I > you compile both modules together like this it should work out: > > dmd -ofresult main.d stuff.d If that's the

Re: lambda alias import

2020-01-17 Thread Petar via Digitalmars-d-learn
On Friday, 17 January 2020 at 23:04:57 UTC, Petar Kirov [ZombineDev] wrote: [..] *If* you compile both modules .. [..]

Re: lambda alias import

2020-01-17 Thread Petar via Digitalmars-d-learn
On Friday, 17 January 2020 at 21:40:05 UTC, JN wrote: stuff.d: alias doStuff = () {}; main.d: import stuff; void main() { doStuff(); } DMD throws compile error: Error 42: Symbol Undefined __D5stuff9__lambda3FNaNbNiNfZv Is this expected behavior? It tripped me while trying to use

lambda alias import

2020-01-17 Thread JN via Digitalmars-d-learn
stuff.d: alias doStuff = () {}; main.d: import stuff; void main() { doStuff(); } DMD throws compile error: Error 42: Symbol Undefined __D5stuff9__lambda3FNaNbNiNfZv Is this expected behavior? It tripped me while trying to use DerelictVulkan :(

Re: How to remove whitespace from a string

2020-01-17 Thread Marcone via Digitalmars-d-learn
On Thursday, 16 January 2020 at 13:36:10 UTC, Namal wrote: Hello, what is the way to remove whitespace from a string (not only at the beginning and end).. import std; void main(){ string name = " Marvin Will "; writeln(name.replace(" ", "")); // MarvinWill }

Re: DMD docker image

2020-01-17 Thread Andre Pany via Digitalmars-d-learn
On Friday, 17 January 2020 at 16:43:17 UTC, Jan Hönig wrote: I have created a docker image. However the image size is not small (~500MB). I wonder if others have a suitable dockerfile. All i want is to install the current dmd release. Does somebody have something similar? Does somebody need

DMD docker image

2020-01-17 Thread Jan Hönig via Digitalmars-d-learn
I have created a docker image. However the image size is not small (~500MB). I wonder if others have a suitable dockerfile. All i want is to install the current dmd release. Does somebody have something similar? Does somebody need something similar? My dockerfile: ``` FROM ubuntu:latest

Re: confused about string and lambda args

2020-01-17 Thread mark via Digitalmars-d-learn
On Friday, 17 January 2020 at 07:57:16 UTC, mark wrote: On Thursday, 16 January 2020 at 17:11:11 UTC, Adam D. Ruppe wrote: [...] The string thing probably shouldn't be used anymore. I suggest you always use the => form instead. The string thing is a legacy version that was before the

Re: confused about string and lambda args

2020-01-17 Thread mark via Digitalmars-d-learn
On Thursday, 16 January 2020 at 17:11:11 UTC, Adam D. Ruppe wrote: [...] The string thing probably shouldn't be used anymore. I suggest you always use the => form instead. The string thing is a legacy version that was before the language had =>. [...] Thanks for that very clear explanation.