Re: Thinktank: CI's, compiler lists, and project automation

2018-03-04 Thread Jacob Carlborg via Digitalmars-d
On 2018-03-04 08:05, Nick Sabalausky (Abscissa) wrote: 3. Release of DMD 2.081.0 occurs. "dmd" now points to 2.081.0. Unless .travis.yml has been manually updated, it still contains:   - dmd  # Ie, dmd-2.081.0, now   # WTF?!?! dmd-2.080.0 is no longer being tested   - dmd-2.079.0  

[Issue 17785] Add a page detailing all undefined behavior to the language specification

2018-03-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17785 --- Comment #2 from ZombineDev --- Thanks Walter, much appreciated! --

[Issue 17785] Add a page detailing all undefined behavior to the language specification

2018-03-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17785 Walter Bright changed: What|Removed |Added CC|

[Issue 16037] assigning delegate to a scope variable shouldn't allocate closure

2018-03-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16037 Carsten Blüggel changed: What|Removed |Added CC||chi...@posteo.net --

[Issue 18016] using uninitialized value is considered @safe but has undefined behavior

2018-03-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18016 --- Comment #5 from Walter Bright --- https://github.com/dlang/dlang.org/pull/2260 --

[Issue 17785] Add a page detailing all undefined behavior to the language specification

2018-03-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17785 --- Comment #3 from ZombineDev --- Thanks Walter, much appreciated! --

[Issue 18547] Win32: throwing exception in fiber crashes application

2018-03-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18547 Rainer Schuetze changed: What|Removed |Added Keywords||pull

[Issue 5270] Using a scope delegate allows memory corruption in safe mode

2018-03-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5270 --- Comment #10 from anonymous4 --- (In reply to Walter Bright from comment #6) > This check is limited to @safe code to avoid breaking too much existing code. For the record: escaping scoped data should stay allowed is

[Issue 15399] unaligned pointers are not @safe

2018-03-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15399 --- Comment #7 from ag0ae...@gmail.com --- (In reply to Walter Bright from comment #6) > (In reply to ag0aep6g from comment #5) > > Reopening because these very slight variations are still accepted: > > > > 1) hosts[n] = Unaligned(0, new Victim); >

Re: Opt-in non-null class references?

2018-03-04 Thread aliak via Digitalmars-d
On Saturday, 3 March 2018 at 20:52:25 UTC, SimonN wrote: The pitfall here is that all structs must be default-constructible, and then all of the fields have the static init value: class A { this(int) { } } void main() { NonNull!A a; assert (a.value is null); }

Re: State of D: The survey is killing man, way too much

2018-03-04 Thread 0xFFFFFFFF via Digitalmars-d
On Saturday, 3 March 2018 at 17:42:25 UTC, David Gileadi wrote: On 3/3/18 8:08 AM, 0x wrote: The D survey is killing maan! Those are lots of questions in there If I ever get hold of the people behind it... Is it a coincidence that your user handle is "negative one"? ;) Oh,

[Issue 3720] Taking address of member functions possible without an instance

2018-03-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3720 --- Comment #17 from FeepingCreature --- Right, but I think it's more of a syntax issue. Taking the address of a member function without a this pointer may in rare cases be useful, but I don't see what purpose it serves

Re: State of D: The survey is killing man, way too much

2018-03-04 Thread Abdulhaq via Digitalmars-d
On Saturday, 3 March 2018 at 19:46:38 UTC, Jonathan Marler wrote: On Saturday, 3 March 2018 at 17:42:25 UTC, David Gileadi wrote: On 3/3/18 8:08 AM, 0x wrote: The D survey is killing maan! Those are lots of questions in there If I ever get hold of the people behind it... Is it a

howto run unittest of a single module in dub driven project?

2018-03-04 Thread Arjan via Digitalmars-d-learn
Is it somehow possible to only run the unittests of a single d file within a dub project? Of course without resorting to typing the complete commandline with all versions includes switches etc.

Re: howto run unittest of a single module in dub driven project?

2018-03-04 Thread Basile B. via Digitalmars-d-learn
On Sunday, 4 March 2018 at 10:43:06 UTC, Arjan wrote: Is it somehow possible to only run the unittests of a single d file within a dub project? Of course without resorting to typing the complete commandline with all versions includes switches etc. In Coedit yes. 1/ The path to the other

Template Class With Default Values

2018-03-04 Thread bauss via Digitalmars-d-learn
Why is the following not working? class Foo(string baz = "baz") { mixin("int " ~ baz ~ ";"); } class Bar : Foo { } Shouldn't it implicit do, without me having to do it manually? class Bar : Foo!"baz" { } ... What's the reason you can't specify default values for template parameters on

[Issue 14618] can break immutable with inout and a delegate

2018-03-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14618 --- Comment #4 from ag0ae...@gmail.com --- (In reply to Walter Bright from comment #2) > If I prepend: > > @safe: > > to the code: [...] >Error: cannot take address of local x in @safe function main Compile with `-dip1000` and add `scope` to

Re: DIP 1006 - Preliminary Review Round 1

2018-03-04 Thread rjframe via Digitalmars-d
On Sat, 03 Mar 2018 20:30:31 -0800, Walter Bright wrote: > The default is that they're all on. So to just have one on, first turn > them all off then turn on the desired ones. Would I be correct to interpret this as "turn them all off with -release"? E.g., "dmd -check=in a.d" is unnecessary;

[Issue 17448] Move semantics cause memory corruption and cryptic bugs

2018-03-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17448 Tomer Filiba (weka) changed: What|Removed |Added Status|RESOLVED|REOPENED

isInputRange copied verbatim produces a different result than isInputRange from std.range

2018-03-04 Thread aliak via Digitalmars-d-learn
Hi, I have a custom type D with front/popFront/empty implemented as free functions, but isInputRange returns false. I copied the implementation of isInputRange, and that custom implementation returns true... anyone know what's going on here? === import std.stdio, std.range, std.traits; //

Re: State of D: The survey is killing man, way too much

2018-03-04 Thread 0xFFFFFFFF via Digitalmars-d
On Saturday, 3 March 2018 at 19:46:38 UTC, Jonathan Marler wrote: On Saturday, 3 March 2018 at 17:42:25 UTC, David Gileadi wrote: On 3/3/18 8:08 AM, 0x wrote: The D survey is killing maan! Those are lots of questions in there If I ever get hold of the people behind it... Is it a

Re: Opt-in non-null class references?

2018-03-04 Thread SimonN via Digitalmars-d
On Sunday, 4 March 2018 at 12:03:32 UTC, aliak wrote: Maybe this part can be fixed with: struct NonNull(T) if (isPointer!T || is(T == class)) { @disable opAssign(V)(V v) {} // no no no void opAssign(V)(NonNull!V other) { // only this allowed. Interesting approach -- I'll keep it on the

Re: Template Class With Default Values

2018-03-04 Thread bauss via Digitalmars-d-learn
On Sunday, 4 March 2018 at 11:57:12 UTC, Jonathan M Davis wrote: On Sunday, March 04, 2018 11:35:23 bauss via Digitalmars-d-learn wrote: Why is the following not working? class Foo(string baz = "baz") { mixin("int " ~ baz ~ ";"); } class Bar : Foo { } Shouldn't it implicit do, without

Re: Template Class With Default Values

2018-03-04 Thread bauss via Digitalmars-d-learn
On Sunday, 4 March 2018 at 11:59:52 UTC, Mike Parker wrote: On Sunday, 4 March 2018 at 11:35:23 UTC, bauss wrote: Why is the following not working? class Foo(string baz = "baz") { mixin("int " ~ baz ~ ";"); } class Bar : Foo { } Shouldn't it implicit do, without me having to do it

Re: State of D 2018 Survey

2018-03-04 Thread Kagamin via Digitalmars-d-announce
But seriously, Stack overflow is a reputation-based system, it very hostile from the very start, when you don't have enough reputation for pretty much everything, and SO vehemently nags you about this on every possible occasion, even baiting you to use functionality only to later tell that you

Re: State of D 2018 Survey

2018-03-04 Thread Bastiaan Veelo via Digitalmars-d-announce
On Sunday, 4 March 2018 at 15:13:28 UTC, Kagamin wrote: But seriously, Stack overflow is a reputation-based system, it very hostile from the very start [...] Very true.

[Issue 17448] Move semantics cause memory corruption and cryptic bugs

2018-03-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17448 --- Comment #22 from Tomer Filiba (weka) --- void delegate() callback; struct S { int x; @disable this(this); this(int x) { this.x = x; callback = } void inc() { x++; } } auto f() {

Re: State of D 2018 Survey

2018-03-04 Thread meppl via Digitalmars-d-announce
On Wednesday, 28 February 2018 at 13:41:56 UTC, Mike Parker wrote: https://seb134.typeform.com/to/H1GTak I might have overseen it, but in the survey I missed the feature "being able to allocate withing @nogc-CTFE-functions". Some people want to promote a @nogc library and they cant use

Re: Template Class With Default Values

2018-03-04 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, March 04, 2018 11:35:23 bauss via Digitalmars-d-learn wrote: > Why is the following not working? > > class Foo(string baz = "baz") > { > mixin("int " ~ baz ~ ";"); > } > > class Bar : Foo > { > } > > Shouldn't it implicit do, without me having to do it manually? > > class Bar :

Re: Template Class With Default Values

2018-03-04 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 4 March 2018 at 11:35:23 UTC, bauss wrote: Why is the following not working? class Foo(string baz = "baz") { mixin("int " ~ baz ~ ";"); } class Bar : Foo { } Shouldn't it implicit do, without me having to do it manually? class Bar : Foo!"baz" { } class Bar : Foo!() { }

Re: Opt-in non-null class references?

2018-03-04 Thread aliak via Digitalmars-d
On Saturday, 3 March 2018 at 19:20:26 UTC, arturg wrote: On Saturday, 3 March 2018 at 18:28:42 UTC, aliak wrote: On Friday, 2 March 2018 at 19:47:23 UTC, SimonN wrote: If you know of other ways though I'm all ears :) Cheers maybe not exactly what you want, but here are some templates i

Re: howto run unittest of a single module in dub driven project?

2018-03-04 Thread Basile B. via Digitalmars-d-learn
On Sunday, 4 March 2018 at 11:38:37 UTC, Basile B. wrote: On Sunday, 4 March 2018 at 10:43:06 UTC, Arjan wrote: [...] In Coedit yes. 1/ The path to the other source (usually the path>/src/ or /source/) folder must be registered in the library manager. 2/ Menu "Compilation" item "Run file

Re: isInputRange copied verbatim produces a different result than isInputRange from std.range

2018-03-04 Thread aliak via Digitalmars-d-learn
On Sunday, 4 March 2018 at 13:17:30 UTC, Adam D. Ruppe wrote: On Sunday, 4 March 2018 at 12:57:41 UTC, aliak wrote: @property int front(D d) { return 2; } @property bool empty(D d) { return false; } void popFront(D d) {} Those functions are in scope for your function, but not inside

What's the proper way to add a local file dependence to dub?

2018-03-04 Thread Marc via Digitalmars-d-learn
then copy it to sources folder? let's say I have a small library folder at C:\mylibrary\D where I want to use dir.d from it. How do I add that file dependence to dub? But I do not want to that file be passed directly to dmd, I want to that file be copied to application's source folder (so

Re: howto run unittest of a single module in dub driven project?

2018-03-04 Thread Basile B. via Digitalmars-d-learn
On Sunday, 4 March 2018 at 12:22:35 UTC, Basile B. wrote: On Sunday, 4 March 2018 at 11:38:37 UTC, Basile B. wrote: On Sunday, 4 March 2018 at 10:43:06 UTC, Arjan wrote: [...] In Coedit yes. 1/ The path to the other source (usually the path>/src/ or /source/) folder must be registered in

[Issue 15774] cant write import std.range; twice

2018-03-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15774 ag0ae...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED CC|

Any crash reporter for D?

2018-03-04 Thread Marc via Digitalmars-d-learn
Does anyone knows about any crash repórter library for D? there's nothing I couldn't find at code packages. Something as simple and easy to use like this C#'s https://archive.codeplex.com/?p=crashreporterdotnet

Re: State of D 2018 Survey

2018-03-04 Thread Martin Tschierschke via Digitalmars-d-announce
On Sunday, 4 March 2018 at 17:26:50 UTC, bauss wrote: On Sunday, 4 March 2018 at 15:13:28 UTC, Kagamin wrote: But seriously, Stack overflow is a reputation-based system, it very hostile from the very start, when you don't have enough reputation for pretty much everything, and SO vehemently

[Issue 18549] name gets overwritten in template definition

2018-03-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18549 ag0ae...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED CC|

Re: What's the proper way to add a local file dependence to dub?

2018-03-04 Thread bauss via Digitalmars-d-learn
On Sunday, 4 March 2018 at 16:46:56 UTC, Marc wrote: then copy it to sources folder? let's say I have a small library folder at C:\mylibrary\D where I want to use dir.d from it. How do I add that file dependence to dub? But I do not want to that file be passed directly to dmd, I want to that

Re: State of D 2018 Survey

2018-03-04 Thread bauss via Digitalmars-d-announce
On Sunday, 4 March 2018 at 17:26:50 UTC, bauss wrote: On Sunday, 4 March 2018 at 15:13:28 UTC, Kagamin wrote: But seriously, Stack overflow is a reputation-based system, it very hostile from the very start, when you don't have enough reputation for pretty much everything, and SO vehemently

Re: State of D 2018 Survey

2018-03-04 Thread bauss via Digitalmars-d-announce
On Sunday, 4 March 2018 at 15:13:28 UTC, Kagamin wrote: But seriously, Stack overflow is a reputation-based system, it very hostile from the very start, when you don't have enough reputation for pretty much everything, and SO vehemently nags you about this on every possible occasion, even

Re: isInputRange copied verbatim produces a different result than isInputRange from std.range

2018-03-04 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 4 March 2018 at 12:57:41 UTC, aliak wrote: @property int front(D d) { return 2; } @property bool empty(D d) { return false; } void popFront(D d) {} Those functions are in scope for your function, but not inside std.range. in other words std.range hasn't imported your module, so

Fastest way to zero a slice of memory

2018-03-04 Thread Nordlöw via Digitalmars-d-learn
When zeroing a slice of memory (either stack or heap) such as enum n = 100; ubyte[n] chunk; should I use `memset` such as memset(chunk.ptr, 0, n/2); // zero first half or an array assignment such as chunk[0 .. n/2] = 0; // zero first half or are they equivalent in release

Re: Fastest way to zero a slice of memory

2018-03-04 Thread bauss via Digitalmars-d-learn
On Sunday, 4 March 2018 at 15:23:41 UTC, Nordlöw wrote: When zeroing a slice of memory (either stack or heap) such as enum n = 100; ubyte[n] chunk; should I use `memset` such as memset(chunk.ptr, 0, n/2); // zero first half or an array assignment such as chunk[0 .. n/2] = 0;

Re: State of D 2018 Survey

2018-03-04 Thread Kagamin via Digitalmars-d-announce
On Friday, 2 March 2018 at 12:01:33 UTC, Russel Winder wrote: So having D2.999 is fine per se, but advertises a lack of change and a lack of ambition since the language name is D not D2. D just doesn't follow semver. If it did, we would have D79 now, nothing else even comes close to this.

Re: DIP 1006 - Preliminary Review Round 1

2018-03-04 Thread Timon Gehr via Digitalmars-d
On 04.03.2018 21:40, Walter Bright wrote: On 3/4/2018 4:05 AM, rjframe wrote: Would I be correct to interpret this as "turn them all off with -release"? Array bounds checking is left on with -release. Not necessarily. If the code contains an explicit assertion that the index is in bounds,

Re: State of D 2018 Survey

2018-03-04 Thread Kagamin via Digitalmars-d-announce
On Sunday, 4 March 2018 at 17:26:50 UTC, bauss wrote: It's also very strict and probably have of the posts within Learn here wouldn't be allowed there. It's the most hilarious aspect. Apparently questions about design don't belong there. As if the moderators don't even know about the

Re: State of D: The survey is killing man, way too much

2018-03-04 Thread Kagamin via Digitalmars-d
On Saturday, 3 March 2018 at 15:08:32 UTC, 0x wrote: The D survey is killing maan! Those are lots of questions in there If I ever get hold of the people behind it... Ehh? No, autism is cute, just take it easy and skip questions you don't like, you can also jump them by pressing up

Re: Template Class With Default Values

2018-03-04 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, March 04, 2018 14:43:41 bauss via Digitalmars-d-learn wrote: > On Sunday, 4 March 2018 at 11:57:12 UTC, Jonathan M Davis wrote: > > On Sunday, March 04, 2018 11:35:23 bauss via > > > > Digitalmars-d-learn wrote: > >> Why is the following not working? > >> > >> class Foo(string baz =

Re: isInputRange copied verbatim produces a different result than isInputRange from std.range

2018-03-04 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, March 04, 2018 21:03:23 arturg via Digitalmars-d-learn wrote: > On Sunday, 4 March 2018 at 19:58:14 UTC, ag0aep6g wrote: > > On 03/04/2018 08:54 PM, aliak wrote: > >> wait a minute... so I can't use any std.range functions on a > >> type if I add the range primitives as free functions?

Re: DIP 1006 - Preliminary Review Round 1

2018-03-04 Thread Walter Bright via Digitalmars-d
On 3/4/2018 1:16 PM, Timon Gehr wrote: On 04.03.2018 21:40, Walter Bright wrote: On 3/4/2018 4:05 AM, rjframe wrote: Would I be correct to interpret this as "turn them all off with -release"? Array bounds checking is left on with -release. Not necessarily. If the code contains an explicit

Re: Get function argument name?

2018-03-04 Thread JN via Digitalmars-d-learn
On Sunday, 4 March 2018 at 21:12:44 UTC, arturg wrote: you can pass it by alias: import std.stdio; void main(string[] args) { int x; printName!(x); } void printName(alias var)() { writeln(__traits(identifier, var), " ", var); } Well, it works. But I am confused now, why. Isn't

Re: Get function argument name?

2018-03-04 Thread bauss via Digitalmars-d-learn
On Sunday, 4 March 2018 at 21:48:53 UTC, JN wrote: On Sunday, 4 March 2018 at 21:12:44 UTC, arturg wrote: you can pass it by alias: import std.stdio; void main(string[] args) { int x; printName!(x); } void printName(alias var)() { writeln(__traits(identifier, var), " ", var); }

Re: isInputRange copied verbatim produces a different result than isInputRange from std.range

2018-03-04 Thread arturg via Digitalmars-d-learn
On Sunday, 4 March 2018 at 21:47:43 UTC, Jonathan M Davis wrote: On Sunday, March 04, 2018 21:03:23 arturg via Digitalmars-d-learn wrote: isn't this what DIP 1005 tried to solve? No. What DIP 1005 was trying to solve was avoiding having to have imports used by your function signature or

[Issue 18553] New: Inline assembler: CR2, CR3 control registers not available in 64-bit code

2018-03-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18553 Issue ID: 18553 Summary: Inline assembler: CR2, CR3 control registers not available in 64-bit code Product: D Version: D2 Hardware: x86_64 OS: Linux

Re: importing std.array: empty in a struct messes things up

2018-03-04 Thread ag0aep6g via Digitalmars-d-learn
On 03/04/2018 08:17 PM, Dennis wrote: I was making a stack interface for an array: ``` struct Stack(T) {     import std.array: empty;     T[] stack;     alias stack this; } void main() {     Stack!int stack;     bool x = stack.empty; } ``` My expectation is that you can now call `empty` on

Re: Which Multithreading Solution?

2018-03-04 Thread Adam Wilson via Digitalmars-d-learn
On 3/4/18 11:31, Drew Phil wrote: Hey there! I'm trying to figure out which of D's many multithreading options to use for my application. I'm making a game that runs at 60 frames per second that can also run user-made Lua scripts. I would like to have the Lua scripts run in a separate thread so

Re: DIP 1006 - Preliminary Review Round 1

2018-03-04 Thread Walter Bright via Digitalmars-d
On 3/4/2018 4:05 AM, rjframe wrote: Would I be correct to interpret this as "turn them all off with -release"? Array bounds checking is left on with -release.

Re: importing std.array: empty in a struct messes things up

2018-03-04 Thread arturg via Digitalmars-d-learn
On Sunday, 4 March 2018 at 20:07:06 UTC, visitor wrote: On Sunday, 4 March 2018 at 19:53:59 UTC, ag0aep6g wrote: On 03/04/2018 08:45 PM, ag0aep6g wrote: I don't know what's going on here. The error message doesn't make sense to me. Might be a bug in the compiler. This one works: struct

[Issue 18554] New: `tupleof` ignoring `private` shouldn't be accepted in @safe code

2018-03-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18554 Issue ID: 18554 Summary: `tupleof` ignoring `private` shouldn't be accepted in @safe code Product: D Version: D2 Hardware: All OS: All Status: NEW

Get function argument name?

2018-03-04 Thread JN via Digitalmars-d-learn
Imagine a function like this: void printValue(T)(string name, T value) { writeln(name, " = ", value); } int x = 10; printValue("x", x); is it somehow possible to convert that printValue into a mixin or something, so I could do something like: printValue(x); and it will figure out the "x"

importing std.array: empty in a struct messes things up

2018-03-04 Thread Dennis via Digitalmars-d-learn
I was making a stack interface for an array: ``` struct Stack(T) { import std.array: empty; T[] stack; alias stack this; } void main() { Stack!int stack; bool x = stack.empty; } ``` My expectation is that you can now call `empty` on a stack instance since I imported it in

Which Multithreading Solution?

2018-03-04 Thread Drew Phil via Digitalmars-d-learn
Hey there! I'm trying to figure out which of D's many multithreading options to use for my application. I'm making a game that runs at 60 frames per second that can also run user-made Lua scripts. I would like to have the Lua scripts run in a separate thread so they can't delay frames if

Re: importing std.array: empty in a struct messes things up

2018-03-04 Thread ag0aep6g via Digitalmars-d-learn
On 03/04/2018 08:45 PM, ag0aep6g wrote: I don't know what's going on here. The error message doesn't make sense to me. Might be a bug in the compiler. This one works: struct Stack(T) { T[] stack; alias stack this; bool empty() {return empty(stack);} /* not using UFCS */

Re: isInputRange copied verbatim produces a different result than isInputRange from std.range

2018-03-04 Thread aliak via Digitalmars-d-learn
On Sunday, 4 March 2018 at 13:17:30 UTC, Adam D. Ruppe wrote: On Sunday, 4 March 2018 at 12:57:41 UTC, aliak wrote: @property int front(D d) { return 2; } @property bool empty(D d) { return false; } void popFront(D d) {} Those functions are in scope for your function, but not inside

Re: importing std.array: empty in a struct messes things up

2018-03-04 Thread arturg via Digitalmars-d-learn
I had the same issue, happens with any conflicting selective import. It seems to work if you dont use selective imports, but importing it inside the function if possible is a better option.

Re: isInputRange copied verbatim produces a different result than isInputRange from std.range

2018-03-04 Thread ag0aep6g via Digitalmars-d-learn
On 03/04/2018 08:54 PM, aliak wrote: wait a minute... so I can't use any std.range functions on a type if I add the range primitives as free functions? O.o Yes. In other words: You can't implement range primitives as free functions. Because std.range (and std.algorithm, etc.) doesn't know

Re: importing std.array: empty in a struct messes things up

2018-03-04 Thread visitor via Digitalmars-d-learn
On Sunday, 4 March 2018 at 19:53:59 UTC, ag0aep6g wrote: On 03/04/2018 08:45 PM, ag0aep6g wrote: I don't know what's going on here. The error message doesn't make sense to me. Might be a bug in the compiler. This one works: struct Stack(T) { T[] stack; alias stack this; bool

Re: tupleof vs @safe

2018-03-04 Thread ag0aep6g via Digitalmars-d
On 03/03/2018 12:22 AM, ag0aep6g wrote: So am I missing something or should `tupleof` not be allowed to ignore `private` in `@safe` code? Filed an issue: https://issues.dlang.org/show_bug.cgi?id=18554

Re: isInputRange copied verbatim produces a different result than isInputRange from std.range

2018-03-04 Thread arturg via Digitalmars-d-learn
On Sunday, 4 March 2018 at 19:58:14 UTC, ag0aep6g wrote: On 03/04/2018 08:54 PM, aliak wrote: wait a minute... so I can't use any std.range functions on a type if I add the range primitives as free functions? O.o Yes. In other words: You can't implement range primitives as free functions.

Re: Get function argument name?

2018-03-04 Thread arturg via Digitalmars-d-learn
On Sunday, 4 March 2018 at 21:03:04 UTC, JN wrote: Imagine a function like this: void printValue(T)(string name, T value) { writeln(name, " = ", value); } int x = 10; printValue("x", x); is it somehow possible to convert that printValue into a mixin or something, so I could do something

Re: Get function argument name?

2018-03-04 Thread Timothee Cour via Digitalmars-d-learn
`printName(alias var)()` is not a great solution, eg: doesn't work with expressions, doesn't work with variadics, introduces template bloat. https://github.com/dlang/dmd/pull/7821 introduces __traits(getCallerSource, symbol) which will allow what you want. On Sun, Mar 4, 2018 at 1:53 PM, bauss

Re: State of D 2018 Survey

2018-03-04 Thread bauss via Digitalmars-d-announce
On Sunday, 4 March 2018 at 18:52:36 UTC, Martin Tschierschke wrote: On Sunday, 4 March 2018 at 17:26:50 UTC, bauss wrote: On Sunday, 4 March 2018 at 15:13:28 UTC, Kagamin wrote: But seriously, Stack overflow is a reputation-based system, it very hostile from the very start, when you don't have

help me with dpldocs - how to filter 3rd party libs

2018-03-04 Thread Adam D. Ruppe via Digitalmars-d
So the dpldocs scraper right now pulls all the .d files out of a repo and tries to build docs for them. But in some cases, there's a lot of added dependencies in there that can cause the built to time out. For example, take a look at dlangui: http://dlangui.dpldocs.info/dlangui.html Notice

LDC 1.8.0

2018-03-04 Thread kinke via Digitalmars-d-announce
Hi everyone, on behalf of the LDC team, I'm glad to announce LDC 1.8. The highlights of this version in a nutshell: * Based on D 2.078.3. * New switch `-link-defaultlib-shared` to link against shared druntime/Phobos. * Plugins support, compatible with existing Clang plugins. * Support for

Re: State of D 2018 Survey

2018-03-04 Thread bachmeier via Digitalmars-d-announce
On Sunday, 4 March 2018 at 18:52:36 UTC, Martin Tschierschke wrote: What about trying to start an own "D Exchange"? I like the possibility to vote for good questions and answers. There are many gems inside the forum, but not so easy to find as in the stack exchange based forums. That

Storing guardPageSize in Fiber

2018-03-04 Thread Johan Engelen via Digitalmars-d
Hi all, Currently, `guardPageSize` is not stored in core.thread.Fiber. It's only used during construction, so it's currently not necessary to store it. However, for Fiber stack usage tracking, I need it elsewhere too. Is it agreeable to add an m_guardPageSize member to Fiber to store the

is it possible to put some DDOC after auto generated blocks like unittest examples?

2018-03-04 Thread arturg via Digitalmars-d-learn
/// void fun(){} ///$(TABLE $(TR $(TD Back to:) $(TD href="#fun">Declaration) $(TD $(LINK2 #top, Top unittest { } it basically should look like this: Declaration void fun() Example --- --- [Back to:] [Declaration] [Top] and if i replace the embbeded html with $(LINK2 #fun,

Re: DIP 1006 - Preliminary Review Round 1

2018-03-04 Thread Timon Gehr via Digitalmars-d
On 04.03.2018 22:49, Walter Bright wrote: On 3/4/2018 1:16 PM, Timon Gehr wrote: On 04.03.2018 21:40, Walter Bright wrote: On 3/4/2018 4:05 AM, rjframe wrote: Would I be correct to interpret this as "turn them all off with -release"? Array bounds checking is left on with -release. Not

Re: help me with dpldocs - how to filter 3rd party libs

2018-03-04 Thread Norm via Digitalmars-d
On Sunday, 4 March 2018 at 22:24:58 UTC, Adam D. Ruppe wrote: So the dpldocs scraper right now pulls all the .d files out of a repo and tries to build docs for them. But in some cases, there's a lot of added dependencies in there that can cause the built to time out. For example, take a look

Re: help me with dpldocs - how to filter 3rd party libs

2018-03-04 Thread Adam D. Ruppe via Digitalmars-d
On Sunday, 4 March 2018 at 23:18:25 UTC, Norm wrote: Can you run dub describe and parse the output, which is JSON I think. It used to indicate a role for each source file under each configuration, one of which is "unusedSource". I don't see any info like that when I run it here... :(

Re: help me with dpldocs - how to filter 3rd party libs

2018-03-04 Thread Norm via Digitalmars-d
On Sunday, 4 March 2018 at 23:31:56 UTC, Adam D. Ruppe wrote: On Sunday, 4 March 2018 at 23:18:25 UTC, Norm wrote: Can you run dub describe and parse the output, which is JSON I think. It used to indicate a role for each source file under each configuration, one of which is "unusedSource". I

Interesting article from JVM world - Conservative GC: Is It Really That Bad?

2018-03-04 Thread Nikolay via Digitalmars-d
These guys have independent JVM implementation and used Conservative GC for many years. As I can see it it is very similar to d-runtime GC. But their conclusion is: "sooner or later the absence of knowledge about the liveness of local variables will lead to problems in production that just

Re: Speed of math function atan: comparison D and C++

2018-03-04 Thread rikki cattermole via Digitalmars-d-learn
On 05/03/2018 6:35 PM, J-S Caux wrote: I'm considering shifting a large existing C++ codebase into D (it's a scientific code making much use of functions like atan, log etc). I've compared the raw speed of atan between C++ (Apple LLVM version 7.3.0 (clang-703.0.29)) and D (dmd v2.079.0, also

Re: Interesting article from JVM world - Conservative GC: Is It Really That Bad?

2018-03-04 Thread Ali via Digitalmars-d
On Monday, 5 March 2018 at 02:53:49 UTC, 12345swordy wrote: On Monday, 5 March 2018 at 02:42:48 UTC, Nikolay wrote: These guys have independent JVM implementation and used Conservative GC for many years. As I can see it it is very similar to d-runtime GC. But their conclusion is: "sooner or

Re: Speed of math function atan: comparison D and C++

2018-03-04 Thread J-S Caux via Digitalmars-d-learn
On Monday, 5 March 2018 at 05:40:09 UTC, rikki cattermole wrote: On 05/03/2018 6:35 PM, J-S Caux wrote: I'm considering shifting a large existing C++ codebase into D (it's a scientific code making much use of functions like atan, log etc). I've compared the raw speed of atan between C++

Re: Speed of math function atan: comparison D and C++

2018-03-04 Thread Era Scarecrow via Digitalmars-d-learn
On Monday, 5 March 2018 at 05:40:09 UTC, rikki cattermole wrote: atan should work out to only be a few instructions (inline assembly) from what I've looked at in the source. Also you should post the code you used for each. Should be 3-4 instructions. Load input to the FPU (Optional?

Re: VibeD Rest Interface Generator

2018-03-04 Thread aberba via Digitalmars-d-learn
On Saturday, 3 March 2018 at 02:32:11 UTC, Mario wrote: So I've been learning D since the day 11 (I posted for first time here) and now I've decided to try Vibe.D to make my company API. The fact is that I've achieved to do it (according to the provided code) and it works! But it shows a

Re: UDK : Comment sont levés les "Mappable keys"

2018-03-04 Thread Ali via Digitalmars-d
On Monday, 5 March 2018 at 02:12:07 UTC, Adam Levine wrote: Bonjour à tous Alors voilà, quelqu'un saurait-il comment sont levé les évènements des touches appuyées pour UDK? Nous voudrions pouvoir utiliser un nouveau périphérique autre que la souris, le clavier ... : En l’occurrence la

UDK : Comment sont levés les "Mappable keys"

2018-03-04 Thread Adam Levine via Digitalmars-d
Bonjour à tous Alors voilà, quelqu'un saurait-il comment sont levé les évènements des touches appuyées pour UDK? Nous voudrions pouvoir utiliser un nouveau périphérique autre que la souris, le clavier ... : En l’occurrence la Kinect. Nous avons développé notre API qui permet d'exploiter la

Re: Speed of math function atan: comparison D and C++

2018-03-04 Thread rikki cattermole via Digitalmars-d-learn
On 05/03/2018 7:01 PM, J-S Caux wrote: On Monday, 5 March 2018 at 05:40:09 UTC, rikki cattermole wrote: On 05/03/2018 6:35 PM, J-S Caux wrote: I'm considering shifting a large existing C++ codebase into D (it's a scientific code making much use of functions like atan, log etc). I've compared

Re: LDC 1.8.0

2018-03-04 Thread Johannes Loher via Digitalmars-d-announce
On Sunday, 4 March 2018 at 22:37:21 UTC, kinke wrote: Hi everyone, on behalf of the LDC team, I'm glad to announce LDC 1.8. The highlights of this version in a nutshell: * Based on D 2.078.3. * New switch `-link-defaultlib-shared` to link against shared druntime/Phobos. * Plugins support,

Re: Interesting article from JVM world - Conservative GC: Is It Really That Bad?

2018-03-04 Thread 12345swordy via Digitalmars-d
On Monday, 5 March 2018 at 02:42:48 UTC, Nikolay wrote: These guys have independent JVM implementation and used Conservative GC for many years. As I can see it it is very similar to d-runtime GC. But their conclusion is: "sooner or later the absence of knowledge about the liveness of local

Re: DIP 1006 - Preliminary Review Round 1

2018-03-04 Thread Kagamin via Digitalmars-d
On Sunday, 4 March 2018 at 12:05:08 UTC, rjframe wrote: E.g., "dmd -check=in a.d" is unnecessary; it's equivalent to "dmd a.d" "dmd -release -check=in a.d" turns off all checks except in contracts. I think, -check should specify hierarchic modes like in the DIP, that would work independently

[Issue 18555] New: getSymbolsByUDA has strange behaviour on modules

2018-03-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18555 Issue ID: 18555 Summary: getSymbolsByUDA has strange behaviour on modules Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Severity: regression

Re: Interesting article from JVM world - Conservative GC: Is It Really That Bad?

2018-03-04 Thread Dmitry Olshansky via Digitalmars-d
On Monday, 5 March 2018 at 02:42:48 UTC, Nikolay wrote: These guys have independent JVM implementation and used Conservative GC for many years. As I can see it it is very similar to d-runtime GC. But their conclusion is: "sooner or later the absence of knowledge about the liveness of local

[Issue 18556] New: alias this breaks emplace

2018-03-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18556 Issue ID: 18556 Summary: alias this breaks emplace Product: D Version: D2 Hardware: x86_64 OS: Windows Status: NEW Severity: normal Priority: P1

Speed of math function atan: comparison D and C++

2018-03-04 Thread J-S Caux via Digitalmars-d-learn
I'm considering shifting a large existing C++ codebase into D (it's a scientific code making much use of functions like atan, log etc). I've compared the raw speed of atan between C++ (Apple LLVM version 7.3.0 (clang-703.0.29)) and D (dmd v2.079.0, also ldc2 1.7.0) by doing long loops of

Re: Thinktank: CI's, compiler lists, and project automation

2018-03-04 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 03/05/2018 02:42 AM, Nick Sabalausky (Abscissa) wrote: On 03/04/2018 02:05 AM, Nick Sabalausky (Abscissa) wrote: On 03/03/2018 10:22 AM, Jacob Carlborg wrote: You should get an email notification about failed builds [1] [2], Weird. Never worked for me. Will have to check into that.

  1   2   >