Re: How/where to hack DMD to generate docs for string mixed members.

2018-04-15 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, April 15, 2018 07:59:17 Stefan Koch via Digitalmars-d-learn wrote: > On Sunday, 15 April 2018 at 05:20:31 UTC, 9il wrote: > > Hey, > > > > How/where to hack DMD to generate docs for string mixed members? > > > > struct S > > { > > > > mixin(" > > > > /// > > auto bar() {}

Re: Why is the error message coming by the end of the compilation?

2018-04-15 Thread ag0aep6g via Digitalmars-d-learn
On 04/14/2018 08:56 PM, bauss wrote: I wish there was a way to give a mixin some kind of identity like: mixin("mymixin", "somecode"); Where an error message would print something like: Error in mixin("mymixin"): ... That would completely solve this issue and I wouldn't have to have

Re: isInputRange is false for non-copyable types

2018-04-15 Thread Jonathan M Davis via Digitalmars-d
On Sunday, April 15, 2018 10:14:20 Dmitry Olshansky via Digitalmars-d wrote: > On Sunday, 15 April 2018 at 06:39:43 UTC, Jonathan M Davis wrote: > > On Sunday, April 15, 2018 07:26:54 Shachar Shemesh via > > > > Digitalmars-d wrote: > >> [...] > > > > It's extremely common for range-based

[Issue 18763] New: Segfault in garbage collector

2018-04-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18763 Issue ID: 18763 Summary: Segfault in garbage collector Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P1

Re: "%s"-format template function arguments

2018-04-15 Thread ag0aep6g via Digitalmars-d-learn
On 04/15/2018 02:04 PM, vladdeSV wrote:     foo(1,2,3);     void foo(T...)(T args)     {     writefln("expected: %s", [1,2,3]);     writefln("actual: %s", args);     } The code above will output     expected: [1, 2, 3]     actual: 1 How would I go on about to print all the

Re: "%s"-format template function arguments

2018-04-15 Thread Dennis via Digitalmars-d-learn
On Sunday, 15 April 2018 at 12:04:19 UTC, vladdeSV wrote: How would I go on about to print all the arguments as I expected it, using "%s"? You can expand the template arguments into an array by putting it into square brackets: [args]. You can format an array with the default notation using

Re: "%s"-format template function arguments

2018-04-15 Thread Alex via Digitalmars-d-learn
On Sunday, 15 April 2018 at 12:04:19 UTC, vladdeSV wrote: Hello people of D-land. In a template function, I want to format all arguments as if it was an array. Se this snippet of code: foo(1,2,3); void foo(T...)(T args) { writefln("expected: %s", [1,2,3]);

Re: isInputRange is false for non-copyable types

2018-04-15 Thread Jonathan M Davis via Digitalmars-d
On Sunday, April 15, 2018 07:26:54 Shachar Shemesh via Digitalmars-d wrote: > import std.range; > import std.stdio; > > struct S { > int a; > > @disable this(this); > } > > void main() { > writeln(isInputRange!(S[])); // Prints false > } > > The reason, as far as I can tell, is that

Re: d2sqlite3 db.run, where lies the bug?

2018-04-15 Thread biozic via Digitalmars-d
On Wednesday, 11 April 2018 at 11:00:30 UTC, ag0aep6g wrote: On 04/11/2018 04:08 AM, Ralph Amissah wrote: Generous, I merely stumbled on it and shouted out, you fixed it. I would be grateful if you please file the bug and your fix. There you go: https://github.com/biozic/d2sqlite3/pull/43

Re: isInputRange is false for non-copyable types

2018-04-15 Thread Shachar Shemesh via Digitalmars-d
On 15/04/18 09:39, Jonathan M Davis wrote: It's extremely common for range-based functions to copy front. Even foreach does it. e.g. Not necessarily: foreach(ref e; [S(0), S(1), S(2)]){} While that would work with foreach, it will not work with anything that expects an inputRange (and

Re: dub 2.079.1-beta.1 test failures on Mac OSX 10.13.5 Beta

2018-04-15 Thread Thomas Mader via Digitalmars-d-announce
On Sunday, 15 April 2018 at 00:52:21 UTC, Martin Nowak wrote: Does the dub beta work for you though? Have you tried the official binary? Dub's CI tests were so far targeted at linux and might have some issues with OS dependent differences. On other platform's we've only been running

Re: isInputRange is false for non-copyable types

2018-04-15 Thread Dmitry Olshansky via Digitalmars-d
On Sunday, 15 April 2018 at 10:14:20 UTC, Dmitry Olshansky wrote: On Sunday, 15 April 2018 at 06:39:43 UTC, Jonathan M Davis wrote: On Sunday, April 15, 2018 07:26:54 Shachar Shemesh via Digitalmars-d wrote: [...] It's extremely common for range-based functions to copy front. Even foreach

File names in string mixins

2018-04-15 Thread Simen Kjærås via Digitalmars-d
In a thread[0] over on D.learn, bauss suggested adding a second argument to MixinExpressions, such that mixin("foo()", "my mixin") compiles. The use case for the extra argument is as an identifier that will be used in error messages, where the current behavior is to create a virtual file name

Re: Why is the error message coming by the end of the compilation?

2018-04-15 Thread Simen Kjærås via Digitalmars-d-learn
On Saturday, 14 April 2018 at 08:20:51 UTC, bauss wrote: The problem is I can't pragma(msg) the code I want to mixin manually since all mixins are dynamically generated. That's why my only way is to do it within that static foreach. Wat. So the compiler is able to generate the string you

Re: isInputRange is false for non-copyable types

2018-04-15 Thread Dmitry Olshansky via Digitalmars-d
On Sunday, 15 April 2018 at 06:39:43 UTC, Jonathan M Davis wrote: On Sunday, April 15, 2018 07:26:54 Shachar Shemesh via Digitalmars-d wrote: [...] It's extremely common for range-based functions to copy front. Even foreach does it. e.g. [...] Arguably it should “move” them. This would

"%s"-format template function arguments

2018-04-15 Thread vladdeSV via Digitalmars-d-learn
Hello people of D-land. In a template function, I want to format all arguments as if it was an array. Se this snippet of code: foo(1,2,3); void foo(T...)(T args) { writefln("expected: %s", [1,2,3]); writefln("actual: %s", args); } The code above will output

[Issue 15574] wrong order of linker arguments

2018-04-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15574 Remi Thebault changed: What|Removed |Added CC|

Re: How/where to hack DMD to generate docs for string mixed members.

2018-04-15 Thread Stefan Koch via Digitalmars-d-learn
On Sunday, 15 April 2018 at 05:20:31 UTC, 9il wrote: Hey, How/where to hack DMD to generate docs for string mixed members? struct S { mixin(" /// auto bar() {} "); } Best regards, Ilya Yaroshenko hmm you should be able to see docs for string mixins, if not. try using

Re: isInputRange is false for non-copyable types

2018-04-15 Thread Dmitry Olshansky via Digitalmars-d
On Sunday, 15 April 2018 at 10:39:32 UTC, Jonathan M Davis wrote: On Sunday, April 15, 2018 10:14:20 Dmitry Olshansky via Digitalmars-d wrote: On Sunday, 15 April 2018 at 06:39:43 UTC, Jonathan M Davis wrote: > On Sunday, April 15, 2018 07:26:54 Shachar Shemesh via > > Digitalmars-d wrote: >>

[Issue 18763] Segfault in garbage collector

2018-04-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18763 Basile B. changed: What|Removed |Added CC||b2.t...@gmx.com --- Comment #1

Re: Why is the error message coming by the end of the compilation?

2018-04-15 Thread bauss via Digitalmars-d-learn
On Sunday, 15 April 2018 at 10:14:56 UTC, Simen Kjærås wrote: On Saturday, 14 April 2018 at 08:20:51 UTC, bauss wrote: The problem is I can't pragma(msg) the code I want to mixin manually since all mixins are dynamically generated. That's why my only way is to do it within that static foreach.

Re: Why is the error message coming by the end of the compilation?

2018-04-15 Thread bauss via Digitalmars-d-learn
On Sunday, 15 April 2018 at 16:55:36 UTC, bauss wrote: On Sunday, 15 April 2018 at 15:55:15 UTC, ag0aep6g wrote: On 04/15/2018 05:33 PM, bauss wrote: On Sunday, 15 April 2018 at 10:27:26 UTC, ag0aep6g wrote: On 04/14/2018 08:56 PM, bauss wrote: I wish there was a way to give a mixin some kind

Re: NoCopy for overriding @disable this(this)

2018-04-15 Thread Eduard Staniloiu via Digitalmars-d
On Thursday, 12 April 2018 at 17:09:22 UTC, Shachar Shemesh wrote: On 12/04/18 18:42, Uknown wrote: On Thursday, 12 April 2018 at 12:16:53 UTC, Shachar Shemesh wrote: [...] The problem seems to be that cast is happening at compile time, as opposed to run time, as you might have already

Diamond MVC (Full-stack web-framework) - v2.9.1

2018-04-15 Thread bauss via Digitalmars-d-announce
Pleased to announce a new version of Diamond - v2.9.1 This release comes with the following: * SEO Functionality, full support for schema.org (With the most common data structures already implemented.) * placeHolder's deprecation period is over and all places using "placeHolder" must now

Re: File names in string mixins

2018-04-15 Thread bauss via Digitalmars-d
On Sunday, 15 April 2018 at 10:09:36 UTC, Simen Kjærås wrote: In a thread[0] over on D.learn, bauss suggested adding a second argument to MixinExpressions, such that mixin("foo()", "my mixin") compiles. The use case for the extra argument is as an identifier that will be used in error

[Issue 17833] compiling dmd on x86 linux fails

2018-04-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17833 Tyler Dence changed: What|Removed |Added CC||tyz...@archlinux32.org

Assoc. Array and struct with immutable member

2018-04-15 Thread Dgame via Digitalmars-d-learn
How am I supposed to insert a struct with immutable members into an assoc. array? Reduced example: struct A { immutable string name; } A[string] as; as["a"] = A("a"); // Does not work

[Issue 18763] Segfault in garbage collector

2018-04-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18763 | changed: What|Removed |Added CC||dhase...@gmail.com --- Comment #2

[Issue 18764] New: -g makes OPTLINK fail to find symbols

2018-04-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18764 Issue ID: 18764 Summary: -g makes OPTLINK fail to find symbols Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Severity: normal

[Issue 18472] [Reg 2.078] betterC: cannot use format at compile time.

2018-04-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18472 Rainer Schuetze changed: What|Removed |Added CC||r.sagita...@gmx.de

Re: Why is the error message coming by the end of the compilation?

2018-04-15 Thread ag0aep6g via Digitalmars-d-learn
On 04/15/2018 05:33 PM, bauss wrote: On Sunday, 15 April 2018 at 10:27:26 UTC, ag0aep6g wrote: On 04/14/2018 08:56 PM, bauss wrote: I wish there was a way to give a mixin some kind of identity like: mixin("mymixin", "somecode"); Where an error message would print something like: Error in

Re: Why is the error message coming by the end of the compilation?

2018-04-15 Thread bauss via Digitalmars-d-learn
On Sunday, 15 April 2018 at 15:55:15 UTC, ag0aep6g wrote: On 04/15/2018 05:33 PM, bauss wrote: On Sunday, 15 April 2018 at 10:27:26 UTC, ag0aep6g wrote: On 04/14/2018 08:56 PM, bauss wrote: I wish there was a way to give a mixin some kind of identity like: mixin("mymixin", "somecode");

Re: Assoc. Array and struct with immutable member

2018-04-15 Thread Alex via Digitalmars-d-learn
On Sunday, 15 April 2018 at 17:59:01 UTC, Dgame wrote: How am I supposed to insert a struct with immutable members into an assoc. array? Reduced example: struct A { immutable string name; } A[string] as; as["a"] = A("a"); // Does not work Via a static this() it would work. But

[Issue 18765] New: [Arrays] Docs need info on initialization of static array with element literal

2018-04-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18765 Issue ID: 18765 Summary: [Arrays] Docs need info on initialization of static array with element literal Product: D Version: D2 Hardware: All URL:

Re: Feature to get or add value to an associative array.

2018-04-15 Thread Giles Bathgate via Digitalmars-d
On Sunday, 15 April 2018 at 22:52:47 UTC, Giles Bathgate wrote: I am proposing a new function called getOrAdd in I posted details of the PR here because at least 2 people do not like the name getOrAdd (and one of those people being myself) Time for a bikeshed discussion...

[Issue 18472] [Reg 2.078] betterC: cannot use format at compile time.

2018-04-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18472 --- Comment #6 from Mike Franklin --- (In reply to Rainer Schuetze from comment #5) > Here's a simpler test case: > > module betterc; > enum b = typeid(size_t) is typeid(uint); At https://dlang.org/spec/betterc.html under the

Re: Small Buffer Optimization for string and friends

2018-04-15 Thread Per Nordlöw via Digitalmars-d
On Sunday, 8 April 2012 at 05:56:36 UTC, Andrei Alexandrescu wrote: Andrei Have anybody put together code that implements this idea in a library? That is, a small strings up to length 15 bytes unioned with a `string`.

[Issue 18034] SIMD optimization issues

2018-04-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18034 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/ba478b04139b8d4f7a42a35279f8089615156099 Fix issue 18034 - Bad codegen for OPvecfill Do not replace

Re: isInputRange is false for non-copyable types

2018-04-15 Thread Jonathan M Davis via Digitalmars-d
On Sunday, April 15, 2018 12:29:17 Dmitry Olshansky via Digitalmars-d wrote: > On Sunday, 15 April 2018 at 10:39:32 UTC, Jonathan M Davis wrote: > > So, while I'd love to have the opportunity to sit down and > > redesign the range API, I don't see how we really can - not and > > actually have it

[Issue 18762] DMD should use a unique path/filename for __stdin.o

2018-04-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18762 Vladimir Panteleev changed: What|Removed |Added CC|

Zig talk on youtube (mentions D briefly)

2018-04-15 Thread Mark via Digitalmars-d
There was a talk recently by the creator of the Zig language [1]. Zig which was mentioned on the forums a few times. The creator comes down really hard on languages with hidden memory allocations. He emphasizes correct handling of memory errors, particularly allocation fails. D is mentioned

Feature to get or add value to an associative array.

2018-04-15 Thread Giles Bathgate via Digitalmars-d
Hi, I wanted a way to lazily insert a value into an associative array, and I am proposing a new function called getOrAdd in https://github.com/dlang/druntime/pull/2162 The function provides a means to get a value corresponding to the key, but if the value doesn't exist it will evaluate the

[Issue 18472] [Reg 2.078] betterC: cannot use format at compile time.

2018-04-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18472 --- Comment #7 from Rainer Schuetze --- I think the main issue is that the compiler does not distinguish between information needed at compile time and what's necessary inside the object file. --

[Issue 18753] chunkBy compile error causes ICE

2018-04-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18753 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/d119ed9912891f133092ef0d61bbba74ca175aca Fix Issue 18753 - chunkBy compile error causes ICE

[Issue 18753] chunkBy compile error causes ICE

2018-04-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18753 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: Feature to get or add value to an associative array.

2018-04-15 Thread Jordan Wilson via Digitalmars-d
On Sunday, 15 April 2018 at 22:55:41 UTC, Giles Bathgate wrote: On Sunday, 15 April 2018 at 22:52:47 UTC, Giles Bathgate wrote: I am proposing a new function called getOrAdd in I posted details of the PR here because at least 2 people do not like the name getOrAdd (and one of those people

Re: isInputRange is false for non-copyable types

2018-04-15 Thread ag0aep6g via Digitalmars-d
On 04/16/2018 06:15 AM, Shachar Shemesh wrote: Input ranges provide no guarantees about copying the range itself. If you do it and expect *anything* (which it seems you do), you have a bug. If you need to copy the range itself, you absolutely need to require a forward range. A forward range

Aurora DirectX Bindings 12.1

2018-04-15 Thread Adam Wilson via Digitalmars-d-announce
I am happy to announce that after a prolonged hiatus the Aurora DirectX bindings have been updated to support DirectX 12.1 and DirectX 11.4. The project has been refactored to more closely align with the DirectX SDK headers and the scope is significantly increased to include the D3D Video, D2D

Re: isInputRange is false for non-copyable types

2018-04-15 Thread Shachar Shemesh via Digitalmars-d
On 16/04/18 01:28, Jonathan M Davis wrote: The fact that foreach copies the range that it's given makes using ref with anything other than arrays a bit of an iffy proposition. It will compile regardless of whether front returns by ref or not (which arguably is a bug), but it will only affect the