Re: Beta D 2.072.1-b1

2016-11-27 Thread deadalnix via Digitalmars-d-announce
On Tuesday, 22 November 2016 at 12:54:12 UTC, Martin Nowak wrote: First beta for the 2.072.1 point release. This version resolves a number of regressions and bugs in the 2.072.0 release. http://dlang.org/download.html#dmd_beta http://dlang.org/changelog/2.072.1.html Please report any bugs

Re: D IDE - Coedit 3 first beta

2016-11-27 Thread Bauss via Digitalmars-d-announce
On Tuesday, 22 November 2016 at 23:38:53 UTC, Basile B. wrote: - Changelog: https://gist.github.com/BBasile/5dfb21fd6bd5848922867633eb4136f5 - Github release page: https://github.com/BBasile/Coedit/releases/tag/3_beta_1 Note that this announce is short on purpose. It's a pre-release, however

D programming jobs site

2016-11-27 Thread Walter Bright via Digitalmars-d-announce
https://www.jobsinnew.tech/langs/d/

Re: DIP1004: Inherited Constructors

2016-11-27 Thread rikki cattermole via Digitalmars-d-announce
On 28/11/2016 3:38 PM, Dicebot wrote: DIP 1004 is merged to the queue and open for public informal feedback. PR: https://github.com/dlang/DIPs/pull/42 Initial merged document: https://github.com/dlang/DIPs/blob/master/DIPs/DIP1004.md If you want the change to be approved and have ideas how to

Re: how to debug exceptions/asserts thrown in module constructors?

2016-11-27 Thread Basile B. via Digitalmars-d-learn
On Monday, 28 November 2016 at 02:52:02 UTC, Basile B. wrote: On Sunday, 27 November 2016 at 22:19:26 UTC, Timothee Cour wrote: Adding ``` b _d_throwc #does nothing ``` Don't ask me why I wouldn't be able to answer. The only thing that I can say is that it's probably related to one of the

Re: how to debug exceptions/asserts thrown in module constructors?

2016-11-27 Thread Basile B. via Digitalmars-d-learn
On Sunday, 27 November 2016 at 22:19:26 UTC, Timothee Cour wrote: Adding ``` b _d_throwc #does nothing ``` Try instead "b _d_throwdwarf". Changes made earlier this year to EH made _d_throwc obsolete. The equivalent is now _d_throwdwarf. Don't ask me why I wouldn't be able to answer.

Re: Using the result of a comma expression is deprecated

2016-11-27 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 27 November 2016 at 16:32:26 UTC, Suliman wrote: Looks like you forgot a call to format before the opening parenthesis. should be: string sqlinsert = format(`INSERT INTO usersshapes (userlogin, uploading_date, geometry_type, data) VALUES ('%s', '%s', '%s', '%s') `, login,

DIP1004: Inherited Constructors

2016-11-27 Thread Dicebot via Digitalmars-d-announce
DIP 1004 is merged to the queue and open for public informal feedback. PR: https://github.com/dlang/DIPs/pull/42 Initial merged document: https://github.com/dlang/DIPs/blob/master/DIPs/DIP1004.md If you want the change to be approved and have ideas how to improve it to better match on

Re: DIP 1003: remove `body` as a keyword

2016-11-27 Thread Dicebot via Digitalmars-d-announce
On 11/24/2016 05:29 PM, WM.H wrote: > On Saturday, 19 November 2016 at 21:16:15 UTC, Dicebot wrote: >> DIP 1003 is merged to the queue and open for public informal feedback. >> >> PR: https://github.com/dlang/DIPs/pull/48 >> Initial merged document: >>

Re: DIP 1003: remove `body` as a keyword

2016-11-27 Thread Dicebot via Digitalmars-d-announce
On 11/21/2016 01:33 PM, Sönke Ludwig wrote: > For this whole proposal to work out, though, I think the old syntax will > have to stay supported without deprecations, because the amount of > breakage (the deprecation path won't change that) will otherwise > probably be huge. Making "body" optional

Re: ESA's Schiaparelli Mars probe crashed because of integer overflow

2016-11-27 Thread Walter Bright via Digitalmars-d
On 11/27/2016 1:21 PM, Era Scarecrow wrote: With them pushing self-driving cars, if that gets off the ground we will be having a lot of accidents. Some will inevitably be due to overflows, misinformation from Google servers. Frankly, Google needs to hire some engineers from the aviation

Re: Creating array of structs being used in C interface

2016-11-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 27 November 2016 at 23:25:57 UTC, Nicholas Wilson wrote: `_D10neo4jTypes17neo4j_map_entry_t6__initZ`, or Unions are supposed to be default initialised with the first member, a ulong and thus should be zero initialised. Right, but neo4j_map_entry_t is a struct and that's the one it

Re: Creating array of structs being used in C interface

2016-11-27 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 27 November 2016 at 13:54:54 UTC, Adam D. Ruppe wrote: On Sunday, 27 November 2016 at 12:59:32 UTC, Timoses wrote: [...] It is a linker problem because you didn't link to it... D structs have an initializer, even if they are used for interfacing with C. This is a small blob of

Re: how to debug exceptions/asserts thrown in module constructors?

2016-11-27 Thread timotheecour via Digitalmars-d-learn
UPDATE: * b Loader.d:123 didn't help either: error: parsing line table prologue at 0x (parsing ended around 0x Breakpoint 1: where = mybinary.temp`D4gtkc6Loader6Linker12_staticDtor3FZv, address = 0x000100315410 (process exited despite breakpoint); dmd's dwarf debug info

Re: how to debug exceptions/asserts thrown in module constructors?

2016-11-27 Thread Timothee Cour via Digitalmars-d-learn
UPDATE: * b Loader.d:123 didn't help either: error: parsing line table prologue at 0x (parsing ended around 0x Breakpoint 1: where = mybinary.temp`D4gtkc6Loader6Linker12_staticDtor3FZv, address = 0x000100315410 (process exited despite breakpoint); dmd's dwarf debug info seems

Re: non-constant expression ["foo":5, "bar":10, "baz":2000]

2016-11-27 Thread John Colvin via Digitalmars-d-learn
On Saturday, 26 November 2016 at 17:37:57 UTC, Paolo Invernizzi wrote: This is stated in documentation [1]: immutable long[string] aa = [ "foo": 5, "bar": 10, "baz": 2000 ]; unittest { assert(aa["foo"] == 5); assert(aa["bar"] == 10); assert(aa["baz"] == 2000); } But results

how to debug exceptions/asserts thrown in module constructors?

2016-11-27 Thread Timothee Cour via Digitalmars-d-learn
in the process of trying to debug https://github.com/BlackEdder/ggplotd/issues/32 I would like to get a stracktrace and/or put a breakpoint before exception is thrown: ``` lldb $binary r (lldb) Process 34168 resuming

Re: Parsing a string to instantiate classes at runtime

2016-11-27 Thread ag0aep6g via Digitalmars-d-learn
On 11/27/2016 10:19 PM, Marduk wrote: On Sunday, 27 November 2016 at 21:10:30 UTC, ag0aep6g wrote: Can you link that post, please? I can't imagine what "dynamic mixin" could refer to. Sure, it's here: http://forum.dlang.org/post/xmnnsdiuwyjrhkasy...@forum.dlang.org Ok, that's a

Re: non-constant expression ["foo":5, "bar":10, "baz":2000]

2016-11-27 Thread Paolo Invernizzi via Digitalmars-d-learn
On Saturday, 26 November 2016 at 19:57:21 UTC, Adam D. Ruppe wrote: On Saturday, 26 November 2016 at 17:37:57 UTC, Paolo Invernizzi wrote: This is stated in documentation [1]: What's the link? This is a known limitation, it has never worked. The docs should reflect that, though some day, it

Re: ESA's Schiaparelli Mars probe crashed because of integer overflow

2016-11-27 Thread Era Scarecrow via Digitalmars-d
On Sunday, 27 November 2016 at 05:43:11 UTC, Shachar Shemesh wrote: THIS ONLY APPLIES TO CIVILIAN AIRCRAFTS This level of standard does not apply to: * Military aircrafts * Spaceships * Auto car industry * Medical equipment I'm sure there's more With them pushing self-driving cars, if that

Re: ESA's Schiaparelli Mars probe crashed because of integer overflow

2016-11-27 Thread lobo via Digitalmars-d
On Sunday, 27 November 2016 at 05:43:11 UTC, Shachar Shemesh wrote: On 26/11/16 07:50, Walter Bright wrote: I'd like to know what really happened with the code. But as someone who has worked on flight critical systems for airliners, the designs are required to account for any single failure

Re: Parsing a string to instantiate classes at runtime

2016-11-27 Thread Marduk via Digitalmars-d-learn
On Sunday, 27 November 2016 at 21:10:30 UTC, ag0aep6g wrote: Can you link that post, please? I can't imagine what "dynamic mixin" could refer to. Sure, it's here: http://forum.dlang.org/post/xmnnsdiuwyjrhkasy...@forum.dlang.org In that thread they also mention Object.factory, but the

Re: Parsing a string to instantiate classes at runtime

2016-11-27 Thread ag0aep6g via Digitalmars-d-learn
On 11/27/2016 10:02 PM, Marduk wrote: I read in an old post in these forums that with a dynamic mixin it is possible to add structures and classes at runtime. I searched "dynamic mixin" but I did not find more information. Can you link that post, please? I can't imagine what "dynamic mixin"

Re: Instantiating a class with different types at runtime

2016-11-27 Thread ag0aep6g via Digitalmars-d-learn
On 11/27/2016 09:52 PM, Marduk wrote: class Example { this(Type_left x, Type_right y) { this.left = x; this.right = y; } Type_left left; Type_right right; } Such that at runtime I can instantiate it with different types: new Example(int a, int b); new

Parsing a string to instantiate classes at runtime

2016-11-27 Thread Marduk via Digitalmars-d-learn
Dear all, I would like to write a program that: 1. Receives a string from the UI 2. Parses the string 3. Instantiates classes, whose names are contained in the string, passing parts of the string as constructor arguments. From my experience with other programming languages, I suppose I need

Re: Instantiating a class with different types at runtime

2016-11-27 Thread Namespace via Digitalmars-d-learn
On Sunday, 27 November 2016 at 20:52:06 UTC, Marduk wrote: Dear all, I would like to have a kind of template class like the following: class Example { this(Type_left x, Type_right y) { this.left = x; this.right = y; } Type_left left; Type_right right; }

Instantiating a class with different types at runtime

2016-11-27 Thread Marduk via Digitalmars-d-learn
Dear all, I would like to have a kind of template class like the following: class Example { this(Type_left x, Type_right y) { this.left = x; this.right = y; } Type_left left; Type_right right; } Such that at runtime I can instantiate it with different types:

Re: Using the result of a comma expression is deprecated

2016-11-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 27 November 2016 at 16:42:17 UTC, Suliman wrote: Am I right understand that `scope(exit)` should be always at top, otherwise it would not work (it's very strange because by the docs it's calling every time when function out of the scopes)? No, scope(exit) queues the thing for

Re: Creating array of structs being used in C interface

2016-11-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 27 November 2016 at 15:56:13 UTC, Stefan Koch wrote: Does your answer also explain why it works when I move the mytypes.d into the source/ folder? dub will link it in when it is in the source folder. exactly.

std.net.curl application throws an exception

2016-11-27 Thread Erdem via Digitalmars-d-learn
try to compile this program from std.net.curl import std.net.curl, std.stdio; void main() { auto range1 = byLineAsync("www.google.com"); auto range2 = byLineAsync("www.wikipedia.org"); foreach (line; byLineAsync("dlang.org")) writeln(line); foreach (line; range1)

Re: Using the result of a comma expression is deprecated

2016-11-27 Thread Suliman via Digitalmars-d-learn
As an aside, for security reasons you should use a prepared statement. Even if it's server-side code and there is no any iteration with user data (they come as JSON) Also, this is a decent usecase for scope(exit) but it should be put earlier in the function. Am I right understand that

Re: Using the result of a comma expression is deprecated

2016-11-27 Thread Suliman via Digitalmars-d-learn
Looks like you forgot a call to format before the opening parenthesis. should be: string sqlinsert = format(`INSERT INTO usersshapes (userlogin, uploading_date, geometry_type, data) VALUES ('%s', '%s', '%s', '%s') `, login, uploading_date, geometry_type, data); because what ends up happening

Re: Creating array of structs being used in C interface

2016-11-27 Thread Stefan Koch via Digitalmars-d-learn
On Sunday, 27 November 2016 at 15:23:33 UTC, Timoses wrote: On Sunday, 27 November 2016 at 14:27:54 UTC, Adam D. Ruppe wrote: That's because int is zero initialized by default and thus doesn't need anything more than a call to zero memory function, and double isn't (it is NaN), so it gets an

Re: Creating array of structs being used in C interface

2016-11-27 Thread Timoses via Digitalmars-d-learn
On Sunday, 27 November 2016 at 14:27:54 UTC, Adam D. Ruppe wrote: That's because int is zero initialized by default and thus doesn't need anything more than a call to zero memory function, and double isn't (it is NaN), so it gets an initializer data blob. If you make it = 0 it might work, but

Re: A simplification of the RvalueRef idiom

2016-11-27 Thread Nick Treleaven via Digitalmars-d-learn
On Friday, 25 November 2016 at 17:21:52 UTC, Nick Treleaven wrote: I've started documenting it now, will post a PR soon. https://github.com/dlang/dlang.org/pull/1519

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-11-27 Thread jmh530 via Digitalmars-d
On Sunday, 27 November 2016 at 06:46:20 UTC, Ilya Yaroshenko wrote: LAPACK API will be a part of Mir GLAS https://github.com/libmir/mir-glas --Ilya Great. I might have asked before, apologies if so.

Re: Fixing implicit copies of InputRanges [was: Re: Mir Random [WIP]]

2016-11-27 Thread Jonathan M Davis via Digitalmars-d
On Saturday, November 26, 2016 12:24:47 Andrei Alexandrescu via Digitalmars- d wrote: > On 11/26/2016 01:55 AM, Martin Nowak wrote: > > On Saturday, 26 November 2016 at 06:46:19 UTC, Martin Nowak wrote: > >> Maybe non-copyability needs to become a requirement for InputRanges. > > > > Could have an

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-11-27 Thread Ilya Yaroshenko via Digitalmars-d
On Sunday, 27 November 2016 at 13:58:29 UTC, Guillaume Piolat wrote: On Sunday, 27 November 2016 at 13:35:48 UTC, Andrei Alexandrescu wrote: A useful intermediate step is to have these "[shared] static this" ctor call a function instead, so that programs without druntime can call them too.

Re: Creating array of structs being used in C interface

2016-11-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 27 November 2016 at 14:12:31 UTC, Timoses wrote: If I change the union's variable type to "int" (or any other) it compiles just fine. So the problem seems to be the "double" value. That's because int is zero initialized by default and thus doesn't need anything more than a call to

Re: Creating array of structs being used in C interface

2016-11-27 Thread Timoses via Digitalmars-d-learn
On Sunday, 27 November 2016 at 13:22:36 UTC, Nicholas Wilson wrote: The missing symbol is the struct initialiser for neo4j_map_entry_t. Not sure why is not being generated (it should), possibly because of the union. That seems like a bug please report it. http://issues.dlang.org/ Thanks

[Issue 16799] New: try-catch blocks fail to catch exception in druntime unittests

2016-11-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16799 Issue ID: 16799 Summary: try-catch blocks fail to catch exception in druntime unittests Product: D Version: D2 Hardware: x86_64 OS: All Status: NEW

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-11-27 Thread Guillaume Piolat via Digitalmars-d
On Sunday, 27 November 2016 at 13:35:48 UTC, Andrei Alexandrescu wrote: A useful intermediate step is to have these "[shared] static this" ctor call a function instead, so that programs without druntime can call them too. That would be progress. Andrei Same story for core.cpuid which

Re: Creating array of structs being used in C interface

2016-11-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 27 November 2016 at 12:59:32 UTC, Timoses wrote: Why is it a linker problem? I'm not linking to the c interface but merely using D structs... It is a linker problem because you didn't link to it... D structs have an initializer, even if they are used for interfacing with C. This

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-11-27 Thread Andrei Alexandrescu via Digitalmars-d
On 11/27/2016 08:28 AM, Guillaume Piolat wrote: On Saturday, 26 November 2016 at 20:13:36 UTC, Andrei Alexandrescu wrote: Congrats! Also thanks for using the Boost license which would allow backporting the improvements to Phobos. Who'd be up for it? Also I'm thinking of removing std.random's

Re: [Bench!][Mir] +54%..+185% performance boost for Mersenne Twister.

2016-11-27 Thread Guillaume Piolat via Digitalmars-d
On Saturday, 26 November 2016 at 20:13:36 UTC, Andrei Alexandrescu wrote: Congrats! Also thanks for using the Boost license which would allow backporting the improvements to Phobos. Who'd be up for it? Also I'm thinking of removing std.random's dependency on druntime, e.g. by removing the

Re: Creating array of structs being used in C interface

2016-11-27 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 27 November 2016 at 12:59:32 UTC, Timoses wrote: Hi there, I've got a problem interfacing to a C library. The following structs are used by the library's .d file that I've written. struct neo4j_map_entry_t { neo4j_value_t key; neo4j_value_t value; };

Creating array of structs being used in C interface

2016-11-27 Thread Timoses via Digitalmars-d-learn
Hi there, I've got a problem interfacing to a C library. The following structs are used by the library's .d file that I've written. struct neo4j_map_entry_t { neo4j_value_t key; neo4j_value_t value; }; struct neo4j_value_t { uint8_t _vt_off; uint8_t

[Issue 16709] [Reg 2.068] Error: common.to at common.d conflicts with common.to at common.d

2016-11-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16709 Martin Nowak changed: What|Removed |Added CC||c...@dawg.eu

Re: Using the result of a comma expression is deprecated

2016-11-27 Thread Erik van Velzen via Digitalmars-d-learn
On Sunday, 27 November 2016 at 12:13:03 UTC, Nicholas Wilson wrote: On Sunday, 27 November 2016 at 11:49:25 UTC, Suliman wrote: On Sunday, 27 November 2016 at 11:21:58 UTC, drug007 wrote: void dbInsert(string login, string uploading_date, string geometry_type, string data) {

Re: Using the result of a comma expression is deprecated

2016-11-27 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 27 November 2016 at 11:49:25 UTC, Suliman wrote: On Sunday, 27 November 2016 at 11:21:58 UTC, drug007 wrote: On 27.11.2016 14:07, Suliman wrote: I am getting deprecation message: "Using the result of a comma expression is deprecated" on this code: string sqlinsert = (`INSERT INTO

Re: Using the result of a comma expression is deprecated

2016-11-27 Thread Suliman via Digitalmars-d-learn
On Sunday, 27 November 2016 at 11:21:58 UTC, drug007 wrote: On 27.11.2016 14:07, Suliman wrote: I am getting deprecation message: "Using the result of a comma expression is deprecated" on this code: string sqlinsert = (`INSERT INTO usersshapes (userlogin, uploading_date, geometry_type,

Re: Using the result of a comma expression is deprecated

2016-11-27 Thread drug007 via Digitalmars-d-learn
On 27.11.2016 14:07, Suliman wrote: I am getting deprecation message: "Using the result of a comma expression is deprecated" on this code: string sqlinsert = (`INSERT INTO usersshapes (userlogin, uploading_date, geometry_type, data) VALUES ('%s', '%s', '%s', '%s') `, login, uploading_date,

Using the result of a comma expression is deprecated

2016-11-27 Thread Suliman via Digitalmars-d-learn
I am getting deprecation message: "Using the result of a comma expression is deprecated" on this code: string sqlinsert = (`INSERT INTO usersshapes (userlogin, uploading_date, geometry_type, data) VALUES ('%s', '%s', '%s', '%s') `, login, uploading_date, geometry_type, data); What's wrong

[Issue 16798] Extend -Ipath switch to -Imodule=path so path heirarchy doesn't have to match package heirarchy

2016-11-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16798 --- Comment #1 from Walter Bright --- https://github.com/dlang/dmd/pull/6286 --

Re: Given two AliasSeq (A and B) and template T, how to make AliasSeq!(T!(A[0], B[0]) ... T!(A[n], B[n])) ?

2016-11-27 Thread Tofu Ninja via Digitalmars-d-learn
On Sunday, 27 November 2016 at 07:38:53 UTC, Nicholas Wilson wrote: Whoops it would help if I read your question. You want to use Iota in conjunction with staticMap. alias pairs(int N, alias a, alias b) = AliasSeq(a[N],b[N]); alias C = staticMap!(T,staticMap(pairs,Iota!N)); That didn't