Re: Dynamically calling shared objects from statically build executable allowed

2020-02-10 Thread Ernesto Castellotti via Digitalmars-d-learn
On Monday, 10 February 2020 at 19:00:36 UTC, Andre Pany wrote: On Monday, 10 February 2020 at 13:14:50 UTC, Ernesto Castellotti wrote: On Monday, 10 February 2020 at 04:41:31 UTC, Andre Pany wrote: Is this a bug with LDC and DMD, or is it not allowed to dynamically call a SO from a statically

about const ref

2020-02-10 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
I need to be sure about "const ref". Based on the following function, does it mean: Type can be string or an integral type. (a) k1 is not copied on function calls (b) k1 cannot be modified inside function Please correct me if I am wrong. Can storage class "in" be used to satisfy (a) and (b)?

Re: GtkD on Windows: notes + question

2020-02-10 Thread mark via Digitalmars-d-learn
On Sunday, 9 February 2020 at 14:08:02 UTC, Daniel Kozak wrote: "lflags-windows": ["/SUBSYSTEM:WINDOWS", "/ENTRY:mainCRTStartup"], [snip] Is there a way to avoid the console Window, at least for release builds? Thank you! Your solution I guess is for dub.json. For those using dub.sdl the

Re: GtkD on Windows: notes + question

2020-02-10 Thread mark via Digitalmars-d-learn
On Sunday, 9 February 2020 at 14:08:02 UTC, Daniel Kozak wrote: "lflags-windows": ["/SUBSYSTEM:WINDOWS", "/ENTRY:mainCRTStartup"], [snip] Is there a way to avoid the console Window, at least for release builds? Thank you! Your solution I guess is for dub.json. For those using dub.sdl the

Re: Dynamically calling shared objects from statically build executable allowed

2020-02-10 Thread Ernesto Castellotti via Digitalmars-d-learn
On Monday, 10 February 2020 at 04:41:31 UTC, Andre Pany wrote: Is this a bug with LDC and DMD, or is it not allowed to dynamically call a SO from a statically build executable on linux On Unix systems it is not possible to dynamically load a library shared by a static executable, I don't

Re: Is it possible to use DMD as a library to compile strings at runtime?

2020-02-10 Thread Basile B. via Digitalmars-d-learn
On Friday, 31 January 2020 at 14:25:30 UTC, Basile B. wrote: On Friday, 31 January 2020 at 11:19:37 UTC, Saurabh Das wrote: I see that DUB has DMD as a library package, but I was not able to understand how to use it. Is it possible to use DMD as a library within a D program to compile a

Re: Is it possible to use DMD as a library to compile strings at runtime?

2020-02-10 Thread Basile B. via Digitalmars-d-learn
On Monday, 10 February 2020 at 12:31:03 UTC, Basile B. wrote: On Friday, 31 January 2020 at 14:25:30 UTC, Basile B. wrote: [...] about [1] (llvm) I've made a better binding this weekend: https://gitlab.com/basile.b/llvmd-d Seriouly I cant believe that at some point in the past I translated

Default value for member class

2020-02-10 Thread JN via Digitalmars-d-learn
class IntValue { int x = 5; } class Foo { IntValue val = new IntValue(); } void main() { Foo f1 = new Foo(); Foo f2 = new Foo(); assert(f1.val == f2.val); } Is this expected? Or should each Foo have their own IntValue object? They're equal right now, changing one changes

Re: Default value for member class

2020-02-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 10 February 2020 at 18:18:16 UTC, JN wrote: Is this expected? Yes, it is per the spec, though new users find it weird. Maybe we should change this but any static initializer is run at CTFE. Then the *static pointer* is put into the static initializer, which is just copied over

Re: Default value for member class

2020-02-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/10/20 1:18 PM, JN wrote: class IntValue {     int x = 5; } class Foo {     IntValue val = new IntValue(); } void main() {     Foo f1 = new Foo();     Foo f2 = new Foo();     assert(f1.val == f2.val); } Is this expected? Define "expected" ;) It's been this way for a while

Re: Dynamically calling shared objects from statically build executable allowed

2020-02-10 Thread Andre Pany via Digitalmars-d-learn
On Monday, 10 February 2020 at 13:14:50 UTC, Ernesto Castellotti wrote: On Monday, 10 February 2020 at 04:41:31 UTC, Andre Pany wrote: Is this a bug with LDC and DMD, or is it not allowed to dynamically call a SO from a statically build executable on linux On Unix systems it is not possible