Re: Setting the GtkD Include Path in dexed?

2019-03-13 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 12 March 2019 at 15:48:14 UTC, Ron Tarrant wrote: I managed to get dexed to compile a single-file dub project, but for completeness sake, I'm also trying to configure it to use dmd (non-dub) to compile GtkD projects using Compilation (menu) > Compile File and Run. To that end, I

Re: Setting the GtkD Include Path in dexed?

2019-03-13 Thread Ron Tarrant via Digitalmars-d-learn
On Tuesday, 12 March 2019 at 21:54:36 UTC, JN wrote: How about Project -> Project editor -> Categories -> Other -> dmdOtherOptions ? I take it this starts in the Project menu? I found Project Editor in the Project menu, but the rest eludes me. Can't find it.

Re: Strange appender behavior

2019-03-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 13 March 2019 at 13:03:27 UTC, tchaloupka wrote: Is this expected?: You never called the constructor, which means it was lazy initialized... but that was done inside one of the functions, which received the Appender by value. So when it set its internal pointer, it was inside

Re: Strange appender behavior

2019-03-13 Thread Andrea Fontana via Digitalmars-d-learn
On Wednesday, 13 March 2019 at 13:03:27 UTC, tchaloupka wrote: Is this expected?: ``` import std.stdio; import std.algorithm; import std.array; void main() { auto d = Appender!string(); //auto d = appender!string(); // works string[] arr = ["foo", "bar", "baz"];

Strange appender behavior

2019-03-13 Thread tchaloupka via Digitalmars-d-learn
Is this expected?: ``` import std.stdio; import std.algorithm; import std.array; void main() { auto d = Appender!string(); //auto d = appender!string(); // works string[] arr = ["foo", "bar", "baz"]; arr.joiner("\n").copy(d); writeln(d.data); } ``` Using Appender outpust

Why this template code does not compile?

2019-03-13 Thread Victor Porton via Digitalmars-d-learn
Why this template code does not compile? /// module runnable; import std.meta; import std.typecons; template FieldInfo(argT, string argName) { template FieldInfo(Nullable!argT argDefault = Nullable!argT()) { } } alias processFields(T, string name) = AliasSeq!(FieldInfo!(T,

Re: Why this template code does not compile?

2019-03-13 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 13 March 2019 at 17:38:02 UTC, Victor Porton wrote: Why this template code does not compile? /// module runnable; import std.meta; import std.typecons; template FieldInfo(argT, string argName) { template FieldInfo(Nullable!argT argDefault = Nullable!argT()) { } }

Re: Returning reference: why this works?

2019-03-13 Thread Johan Engelen via Digitalmars-d-learn
On Wednesday, 13 March 2019 at 20:57:13 UTC, Denis Feklushkin wrote: import std.stdio; struct S { int x; } ref S func1(ref S i) // i is reference { return i; } ref S func2(S i) // i is not reference { return func1(i); // Works! Possibility to return reference to local object i?

Returning reference: why this works?

2019-03-13 Thread Denis Feklushkin via Digitalmars-d-learn
import std.stdio; struct S { int x; } ref S func1(ref S i) // i is reference { return i; } ref S func2(S i) // i is not reference { return func1(i); // Works! Possibility to return reference to local object i? //return i; // Error: returning i escapes a reference to parameter i }

Re: Returning reference: why this works?

2019-03-13 Thread Denis Feklushkin via Digitalmars-d-learn
On Wednesday, 13 March 2019 at 21:04:01 UTC, Johan Engelen wrote: On Wednesday, 13 March 2019 at 20:57:13 UTC, Denis Feklushkin wrote: import std.stdio; struct S { int x; } ref S func1(ref S i) // i is reference { return i; } ref S func2(S i) // i is not reference { return func1(i); //