D Security Team has been initiated

2018-07-10 Thread Seb via Digitalmars-d-announce
If you have a security-related concern or issue and feel like this shouldn't be discussed in public, please don't hesitate to contact us in private at: https://dlang.org/security

[Issue 19066] [REG 2.080.1] Error: `const(Object)` is used as a type with structs that have symbol named Object

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

[Issue 19066] [REG 2.080.1] Error: `const(Object)` is used as a type with structs that have symbol named Object

2018-07-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19066 --- Comment #8 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/2ff1ac05b6d523814018dec5970be117c08ff8dd Fix issue 19066 - Allow using symobls Object and object

[Issue 18861] Some links from articles directory to spec directory are wrong, giving 404 error

2018-07-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18861 Seb changed: What|Removed |Added Status|NEW |RESOLVED CC|

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Seb via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 20:57:02 UTC, Steven Schveighoffer wrote: On 7/10/18 4:02 PM, Per Nordlöw wrote: On Tuesday, 10 July 2018 at 19:27:07 UTC, Steven Schveighoffer wrote: On 7/10/18 3:01 PM, Per Nordlöw wrote: [...] Yes, call this function on startup: import etc.linux : 

Re: Should I write a DIP for Null functions?

2018-07-10 Thread Seb via Digitalmars-d
On Wednesday, 11 July 2018 at 02:20:01 UTC, 12345swordy wrote: I was think about about writing one about this as this is an "obvious" small easy feature to introduce as it practically a function that does nothing when called and that itself is quite useful. Any objections to this? Alexander

Re: Blogpost about the T.init problem

2018-07-10 Thread Ali via Digitalmars-d-announce
On Tuesday, 10 July 2018 at 13:41:56 UTC, FeepingCreature wrote: I've written up a short blogpost about the T.init issue. It is not very enthusiastic. https://medium.com/@feepingcreature/d-structs-dont-work-for-domain-data-c09332349f43 Somehow, this is the type of problem, i thought point 1

Should I write a DIP for Null functions?

2018-07-10 Thread 12345swordy via Digitalmars-d
I was think about about writing one about this as this is an "obvious" small easy feature to introduce as it practically a function that does nothing when called and that itself is quite useful. Any objections to this? Alexander

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Neia Neutuladh via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 22:53:25 UTC, kdevel wrote: extern (C) __gshared bool rt_trapExceptions; static this () { rt_trapExceptions = false; } This will catch exceptions raised in main and in static constructors that run after this one. However, if you put that code in

Re: Sutter's ISO C++ Trip Report - The best compliment is when someone else steals your ideas....

2018-07-10 Thread Walter Bright via Digitalmars-d
On 7/10/2018 12:21 PM, Timon Gehr wrote: Which threads are those? Here's one: https://digitalmars.com/d/archives/digitalmars/D/Program_logic_bugs_vs_input_environmental_errors_244143.html Have fun, it may take upwards of a week to read that one!

Re: Sutter's ISO C++ Trip Report - The best compliment is when someone else steals your ideas....

2018-07-10 Thread Walter Bright via Digitalmars-d
On 7/10/2018 8:39 AM, H. S. Teoh wrote: The saving grace to real mode DOS was that rebooting was so fast. I beg to differ. Boot time has been about the same for the last 40 years :-)

Re: Sutter's ISO C++ Trip Report - The best compliment is when someone else steals your ideas....

2018-07-10 Thread Walter Bright via Digitalmars-d
On 7/10/2018 12:21 PM, Timon Gehr wrote: On 03.07.2018 06:54, Walter Bright wrote: (I'm referring to the repeated and endless threads here where people argue that yes, they can recover from programming bugs!) Which threads are those? I'd have to google for them. Maybe try searching for

[Issue 19075] New: rt.util.random.Rand48.defaultSeed should prefer RDTSC or mach_absolute_time to ctime.time

2018-07-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19075 Issue ID: 19075 Summary: rt.util.random.Rand48.defaultSeed should prefer RDTSC or mach_absolute_time to ctime.time Product: D Version: D2 Hardware: x86_64 OS:

[Issue 19074] [REG 2.080] SIGSEGV in el_ptr (s=0x15) at dmd/backend/el.c:1760

2018-07-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19074 --- Comment #1 from Walter Bright --- https://github.com/dlang/dmd/pull/8483 --

[Issue 19074] [REG 2.080] SIGSEGV in el_ptr (s=0x15) at dmd/backend/el.c:1760

2018-07-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19074 Walter Bright changed: What|Removed |Added Keywords||ice-on-valid-code CC|

Re: Sutter's ISO C++ Trip Report - The best compliment is when someone else steals your ideas....

2018-07-10 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, 10 July 2018 16:48:41 MDT Steven Schveighoffer via Digitalmars-d wrote: > On 7/10/18 6:26 PM, Jonathan M Davis wrote: > > On Tuesday, 10 July 2018 13:21:28 MDT Timon Gehr via Digitalmars-d wrote: > >> On 03.07.2018 06:54, Walter Bright wrote: > >>> ... > >>> > >>> (I'm referring to

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread kdevel via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 22:31:54 UTC, Adam D. Ruppe wrote: Turn off rtTrapExceptions though the command line switch PR is STILL NOT MERGED https://github.com/dlang/druntime/pull/2035 extern (C) __gshared bool rt_trapExceptions; static this () { rt_trapExceptions =

Re: Copy Constructor DIP

2018-07-10 Thread Manu via Digitalmars-d
On Tue, 10 Jul 2018 at 15:23, Jonathan M Davis via Digitalmars-d wrote: > > On Tuesday, 10 July 2018 14:58:09 MDT Manu via Digitalmars-d wrote: > > 2. It looks like copy constructors are used to perform assignments > > (and not constructions)... but, there is also opAssign. What gives? > >

Re: Sutter's ISO C++ Trip Report - The best compliment is when someone else steals your ideas....

2018-07-10 Thread Steven Schveighoffer via Digitalmars-d
On 7/10/18 6:26 PM, Jonathan M Davis wrote: On Tuesday, 10 July 2018 13:21:28 MDT Timon Gehr via Digitalmars-d wrote: On 03.07.2018 06:54, Walter Bright wrote: ... (I'm referring to the repeated and endless threads here where people argue that yes, they can recover from programming bugs!)

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 21:18:01 UTC, kdevel wrote: but how do I force the runtime to generate a coredump for real post-mortem analysis? Turn off rtTrapExceptions though the command line switch PR is STILL NOT MERGED https://github.com/dlang/druntime/pull/2035 come on, people.

Re: Sutter's ISO C++ Trip Report - The best compliment is when someone else steals your ideas....

2018-07-10 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, 10 July 2018 13:21:28 MDT Timon Gehr via Digitalmars-d wrote: > On 03.07.2018 06:54, Walter Bright wrote: > > ... > > > > (I'm referring to the repeated and endless threads here where people > > argue that yes, they can recover from programming bugs!) > > Which threads are those?

Re: Copy Constructor DIP

2018-07-10 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, 10 July 2018 14:58:09 MDT Manu via Digitalmars-d wrote: > 2. It looks like copy constructors are used to perform assignments > (and not constructions)... but, there is also opAssign. What gives? > Eg: > S b = a; // <- copy construction? looks like an assignment. > And

Release D 2.081.1

2018-07-10 Thread Martin Nowak via Digitalmars-d-announce
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Glad to announce D 2.081.1. http://dlang.org/download.html This point release fixes a few issues over 2.081.0, see the changelog for more details. http://dlang.org/changelog/2.081.1.html - -Martin -BEGIN PGP SIGNATURE-

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/10/18 5:18 PM, kdevel wrote: On Tuesday, 10 July 2018 at 21:09:23 UTC, Steven Schveighoffer wrote: [...] As far as the OS is concerned, a[2 .. $] is within the process memory limit. Of course, that's an out of bounds access, so the compiler or the bounds check *should* complain. It

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Per Nordlöw via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 19:27:07 UTC, Steven Schveighoffer wrote: import etc.linux : registerMemoryErrorHandler; Needs to be: import etc.linux.memoryerror : registerMemoryErrorHandler;

Re: Blogpost about the T.init problem

2018-07-10 Thread Bastiaan Veelo via Digitalmars-d-announce
On Tuesday, 10 July 2018 at 13:41:56 UTC, FeepingCreature wrote: I've written up a short blogpost about the T.init issue. It is not very enthusiastic. https://medium.com/@feepingcreature/d-structs-dont-work-for-domain-data-c09332349f43 Have you tried giving your invariants a valid initial

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread kdevel via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 21:09:23 UTC, Steven Schveighoffer wrote: [...] As far as the OS is concerned, a[2 .. $] is within the process memory limit. Of course, that's an out of bounds access, so the compiler or the bounds check *should* complain. It complains at runtime > ./dumpme2

Re: Blogpost about the T.init problem

2018-07-10 Thread Meta via Digitalmars-d-announce
On Tuesday, 10 July 2018 at 13:41:56 UTC, FeepingCreature wrote: I've written up a short blogpost about the T.init issue. It is not very enthusiastic. https://medium.com/@feepingcreature/d-structs-dont-work-for-domain-data-c09332349f43 Related links: https://github.com/dlang/phobos/pull/6594

Re: Blogpost about the T.init problem

2018-07-10 Thread Cym13 via Digitalmars-d-announce
On Tuesday, 10 July 2018 at 13:41:56 UTC, FeepingCreature wrote: I've written up a short blogpost about the T.init issue. It is not very enthusiastic. https://medium.com/@feepingcreature/d-structs-dont-work-for-domain-data-c09332349f43 Related links: https://github.com/dlang/phobos/pull/6594

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/10/18 5:01 PM, kdevel wrote: On Tuesday, 10 July 2018 at 20:10:54 UTC, Adam D. Ruppe wrote: On Tuesday, 10 July 2018 at 19:01:22 UTC, Per Nordlöw wrote: [...] Run the program in a debugger, or run `ulimit -c unlimited` to enable core dumps [...] Works for null ptr deref but how do I

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread kdevel via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 20:10:54 UTC, Adam D. Ruppe wrote: On Tuesday, 10 July 2018 at 19:01:22 UTC, Per Nordlöw wrote: [...] Run the program in a debugger, or run `ulimit -c unlimited` to enable core dumps [...] Works for null ptr deref but how do I enforce core dumps in this code:

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/10/18 4:02 PM, Per Nordlöw wrote: On Tuesday, 10 July 2018 at 19:27:07 UTC, Steven Schveighoffer wrote: On 7/10/18 3:01 PM, Per Nordlöw wrote: Is it possible to change run-time behaviour of null-class dereferencing, on Linux, so that it gives some other diagnostics than: Program exited

Re: Copy Constructor DIP

2018-07-10 Thread Manu via Digitalmars-d
On Tue, 10 Jul 2018 at 03:50, RazvanN via Digitalmars-d wrote: > > Hi everyone! > > I managed to put together a first draft of the DIP for adding the > copy constructor to the language [1]. If anyone is interested, > please take a look. Suggestions and comments about technical > aspects and

Re: Struct destructors not available in -betterC?

2018-07-10 Thread Seb via Digitalmars-d
On Tuesday, 10 July 2018 at 19:28:34 UTC, SrMordred wrote: On Tuesday, 10 July 2018 at 19:14:26 UTC, Gary Willoughby wrote: Looking at the page on -betterC it says that struct destructors are not available. See point 11: https://dlang.org/spec/betterc.html#consequences This doesn't seem to

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-10 Thread Seb via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso wrote: I'm specifically thinking of the GNU Octave codebase: http://hg.savannah.gnu.org/hgweb/octave/file/@ It's a fairly old and complicated C++ codebase. I would like to see if I could slowly introduce some D in it,

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Seb via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 19:01:22 UTC, Per Nordlöw wrote: Is it possible to change run-time behaviour of null-class dereferencing, on Linux, so that it gives some other diagnostics than: Program exited with code -11 Does DMD and LDC provide different alternatives here? On a Systemd

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 19:01:22 UTC, Per Nordlöw wrote: Is it possible to change run-time behaviour of null-class dereferencing, on Linux, so that it gives some other diagnostics than: Run the program in a debugger, or run `ulimit -c unlimited` to enable core dumps so you can run a

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Per Nordlöw via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 19:27:07 UTC, Steven Schveighoffer wrote: On 7/10/18 3:01 PM, Per Nordlöw wrote: Is it possible to change run-time behaviour of null-class dereferencing, on Linux, so that it gives some other diagnostics than: Program exited with code -11 Does DMD and LDC provide

Re: Struct destructors not available in -betterC?

2018-07-10 Thread SrMordred via Digitalmars-d
On Tuesday, 10 July 2018 at 19:14:26 UTC, Gary Willoughby wrote: Looking at the page on -betterC it says that struct destructors are not available. See point 11: https://dlang.org/spec/betterc.html#consequences This doesn't seem to be true as I'm using them with no problem. Yep, the docs

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/10/18 3:01 PM, Per Nordlöw wrote: Is it possible to change run-time behaviour of null-class dereferencing, on Linux, so that it gives some other diagnostics than: Program exited with code -11 Does DMD and LDC provide different alternatives here? Yes, call this function on startup:

Re: Sutter's ISO C++ Trip Report - The best compliment is when someone else steals your ideas....

2018-07-10 Thread Timon Gehr via Digitalmars-d
On 03.07.2018 06:54, Walter Bright wrote: ... (I'm referring to the repeated and endless threads here where people argue that yes, they can recover from programming bugs!) Which threads are those?

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-10 Thread Jordi Gutiérrez Hermoso via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 19:57:55 UTC, jmh530 wrote: I'm not sure adding D to the GNU Octave code base is necessarily the biggest value add... I'm daydreaming of being able to rewrite all of Octave in D. I just was trying to think of where to start.

Struct destructors not available in -betterC?

2018-07-10 Thread Gary Willoughby via Digitalmars-d
Looking at the page on -betterC it says that struct destructors are not available. See point 11: https://dlang.org/spec/betterc.html#consequences This doesn't seem to be true as I'm using them with no problem.

Better diagnostics for null classes dereferencing

2018-07-10 Thread Per Nordlöw via Digitalmars-d-learn
Is it possible to change run-time behaviour of null-class dereferencing, on Linux, so that it gives some other diagnostics than: Program exited with code -11 Does DMD and LDC provide different alternatives here?

[Issue 19074] New: [REG 2.080] SIGSEGV in el_ptr (s=0x15) at dmd/backend/el.c:1760

2018-07-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19074 Issue ID: 19074 Summary: [REG 2.080] SIGSEGV in el_ptr (s=0x15) at dmd/backend/el.c:1760 Product: D Version: D2 Hardware: All OS: All Status: NEW

[Issue 18954] extern(C++) ICE when `cppmangle` is used

2018-07-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18954 Manu changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Issue 18954] extern(C++) ICE when `cppmangle` is used

2018-07-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18954 --- Comment #5 from Manu --- I just tried to repro with 2.081.1b, this issue as logged above seems to be resolved. This variant persists though: test.d: -- extern (C++, std) {

Re: I have a plan.. I really DO

2018-07-10 Thread H. S. Teoh via Digitalmars-d-announce
On Tue, Jul 10, 2018 at 05:25:11PM +, Yuxuan Shui via Digitalmars-d-announce wrote: > On Friday, 6 July 2018 at 21:15:46 UTC, H. S. Teoh wrote: [...] > > Of course, for someone looking for an excuse not to use D, they will > > always find another reason why this is not sufficient. But that

Re: Troubles creating templated inout objects

2018-07-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/10/18 10:34 AM, Timoses wrote: How do I create an inout object with template parameters? Take following code: import std.stdio; import std.traits; struct S {     int[] arr; } interface I {     inout(I) opIndex(size_t idx) inout; }

Re: I have a plan.. I really DO

2018-07-10 Thread SrMordred via Digitalmars-d-announce
On Tuesday, 10 July 2018 at 17:44:59 UTC, Adam D. Ruppe wrote: On Tuesday, 10 July 2018 at 17:39:06 UTC, SrMordred wrote: After the GC.collect you now get 1GB of memory usage. http://dpldocs.info/experimental-docs/core.memory.GC.minimize.html yeah I was looking to this right now on the

Re: I have a plan.. I really DO

2018-07-10 Thread Adam D. Ruppe via Digitalmars-d-announce
On Tuesday, 10 July 2018 at 17:39:06 UTC, SrMordred wrote: After the GC.collect you now get 1GB of memory usage. http://dpldocs.info/experimental-docs/core.memory.GC.minimize.html

Re: I have a plan.. I really DO

2018-07-10 Thread SrMordred via Digitalmars-d-announce
On Tuesday, 10 July 2018 at 17:03:01 UTC, H. S. Teoh wrote: AFAIK, the current GC does not release memory back to the OS. So you won't see the memory footprint decrease. However, it does free up memory for subsequent allocations. T if you put another int[] x; x.length = 1024 * 1024 *

Re: I have a plan.. I really DO

2018-07-10 Thread Yuxuan Shui via Digitalmars-d-announce
On Friday, 6 July 2018 at 21:15:46 UTC, H. S. Teoh wrote: On Fri, Jul 06, 2018 at 08:16:36PM +, Ecstatic Coder via Digitalmars-d-announce wrote: [...] I've never said that this is something smart to do. I'm just saying that this code can perfectly be executed once in a C++ game frame

Re: I have a plan.. I really DO

2018-07-10 Thread H. S. Teoh via Digitalmars-d-announce
On Tue, Jul 10, 2018 at 04:07:01PM +, SrMordred via Digitalmars-d-announce wrote: > > As I've already repeated twice, this is not true in D. You *can* > > predict precisely when the GC runs a collection cycle by calling > > GC.disable and then calling GC.collect according to *your* own > >

Re: I have a plan.. I really DO

2018-07-10 Thread SrMordred via Digitalmars-d-announce
As I've already repeated twice, this is not true in D. You *can* predict precisely when the GC runs a collection cycle by calling GC.disable and then calling GC.collect according to *your* own schedule. This is not just a theoretical thing. I have actually done this in my own projects, and

Re: Sutter's ISO C++ Trip Report - The best compliment is when someone else steals your ideas....

2018-07-10 Thread H. S. Teoh via Digitalmars-d
On Mon, Jul 09, 2018 at 11:37:59PM -0700, Walter Bright via Digitalmars-d wrote: > On 7/9/2018 6:50 PM, John Carter wrote: > > Nothing creates flaky and unreliable systems more than allowing them > > to wobble on past the first point where you already know that things > > are wrong. > > Things

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-10 Thread Timoses via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 14:58:42 UTC, vino.B wrote: Hi Alex, I am getting the output as tuples of multiple arrays, but the requirement is to get the all the tuple in a single array like the below so that we can perform sorting and printing the output is easy. Something along the way

D Boston Meetup - 7/26

2018-07-10 Thread Steven Schveighoffer via Digitalmars-d-announce
Hi all, We are going to set up a little coding session/gathering for D in the Capital One Cafe in Back bay [1] on July 26th (Thursday) starting at 6 pm. So far it looks like Sameer, myself and Andrei will be there. Please stop by if you want to hang out, chat about our favorite language, or

Re: Blogpost about the T.init problem

2018-07-10 Thread Dukc via Digitalmars-d-announce
On Tuesday, 10 July 2018 at 13:41:56 UTC, FeepingCreature wrote: I've written up a short blogpost about the T.init issue. I believe that whoever wrote that spec meant that the invariant WOULD not need to hold if MyDomainData.init WAS called, but that MyDomainData.init must not be called if

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-10 Thread vino.B via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 14:50:53 UTC, Alex wrote: On Tuesday, 10 July 2018 at 14:38:03 UTC, vino.B wrote: Hi Alex, The reason the I am storing the output of "PFresult.toRange" to another array "rData" is that the output of the PFresult.toRange is different each time we execute the

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-10 Thread Alex via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 14:38:03 UTC, vino.B wrote: Hi Alex, The reason the I am storing the output of "PFresult.toRange" to another array "rData" is that the output of the PFresult.toRange is different each time we execute the code.(Data is correct) but the way the it output is

[Issue 19073] New: core.internal.hash should not bitwise hash representations of floating point numbers

2018-07-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19073 Issue ID: 19073 Summary: core.internal.hash should not bitwise hash representations of floating point numbers Product: D Version: D2 Hardware: All OS: All

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-10 Thread vino.B via Digitalmars-d-learn
On Monday, 9 July 2018 at 18:07:49 UTC, Alex wrote: On Monday, 9 July 2018 at 17:26:30 UTC, vino.B wrote: Request Help: void process(alias coRoutine, T...)(Array!string Dirlst, T params) { ReturnType!coRoutine rData; / This line is not working alias scRType =

Troubles creating templated inout objects

2018-07-10 Thread Timoses via Digitalmars-d-learn
How do I create an inout object with template parameters? Take following code: import std.stdio; import std.traits; struct S { int[] arr; } interface I { inout(I) opIndex(size_t idx) inout; }

Re: Copy Constructor DIP

2018-07-10 Thread FeepingCreature via Digitalmars-d
On Tuesday, 10 July 2018 at 13:38:33 UTC, Jonathan M Davis wrote: He thought that it was critical that the invariant be valid when opAssign was called - and there are cases where that's arguably true - but since it doesn't work once you try to do fancier stuff like emplace, I'm of the opinion

Re: Copy Constructor DIP

2018-07-10 Thread Uknown via Digitalmars-d
On Tuesday, 10 July 2018 at 14:28:09 UTC, FeepingCreature wrote: On Tuesday, 10 July 2018 at 13:38:33 UTC, Jonathan M Davis wrote: [...] Using types with an invalid T.init feels like playing musical chairs with a crash. You can shuffle things around, and make some parts work, but *something*

Re: Sutter's ISO C++ Trip Report - The best compliment is when someone else steals your ideas....

2018-07-10 Thread wjoe via Digitalmars-d
On Sunday, 8 July 2018 at 20:55:15 UTC, John Carter wrote: On Saturday, 7 July 2018 at 01:18:21 UTC, wjoe wrote: But that's not how D works. It throws an Error which can be caught. If people are allowed to do something they assume it's legitimate. It should be a compile time error to catch

Re: guard clause style static if

2018-07-10 Thread kdevel via Digitalmars-d-learn
On Saturday, 7 July 2018 at 11:56:40 UTC, rikki cattermole wrote: void bar (T ...) (T args) if (T.length == 0) { return; [...] } void bar (T ...) (T args) if (T.length > 0) { writeln (args [0]); return bar (args [1 .. $]); } This is a version without a

Re: Normalize void

2018-07-10 Thread Mr.Bingo via Digitalmars-d
On Tuesday, 10 July 2018 at 13:28:42 UTC, Yuxuan Shui wrote: On Tuesday, 10 July 2018 at 11:37:25 UTC, ag0aep6g wrote: On 07/10/2018 11:56 AM, Yuxuan Shui wrote: Possible alternatives: * struct Void {}. Takes 1 byte, not as ideal * alias Void = AliasSeq!(). Doesn't work as template argument.

Re: Copy Constructor DIP

2018-07-10 Thread Andrei Alexandrescu via Digitalmars-d
On 07/10/2018 06:52 AM, Guillaume Piolat wrote: On Tuesday, 10 July 2018 at 10:47:04 UTC, RazvanN wrote: Hi everyone! I managed to put together a first draft of the DIP for adding the copy constructor to the language [1]. If anyone is interested, please take a look. Suggestions and comments

Re: vibe.d: problematic "Non-@safe methods are deprecated in REST interfaces"

2018-07-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, 10 July 2018 07:24:43 MDT WebFreak001 via Digitalmars-d-learn wrote: > On Tuesday, 10 July 2018 at 13:14:24 UTC, Piotr Mitana wrote: > > Hello, > > > > I've recently started building a little REST application on > > vibe.d. I decided to use the "database" library, as I need to > >

Blogpost about the T.init problem

2018-07-10 Thread FeepingCreature via Digitalmars-d-announce
I've written up a short blogpost about the T.init issue. It is not very enthusiastic. https://medium.com/@feepingcreature/d-structs-dont-work-for-domain-data-c09332349f43 Related links: https://github.com/dlang/phobos/pull/6594 problem with T.init and toString

Re: Copy Constructor DIP

2018-07-10 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, 10 July 2018 06:34:34 MDT Guillaume Piolat via Digitalmars-d wrote: > On Tuesday, 10 July 2018 at 11:58:53 UTC, Jonathan M Davis wrote: > >> Does it allow to remove the "T.init must always be valid for > >> structs" rule? > > > > Why would it? init is the state of the object before

Re: guard clause style static if

2018-07-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/10/18 7:38 AM, kdevel wrote: On Tuesday, 10 July 2018 at 00:11:27 UTC, Steven Schveighoffer wrote: On 7/7/18 7:28 AM, kdevel wrote: It appears not to be possible to use static if in "guard clause style" as in     void bar (T ...) (T args)     {    static if (args.length == 0)    

Re: Normalize void

2018-07-10 Thread Yuxuan Shui via Digitalmars-d
On Tuesday, 10 July 2018 at 11:37:25 UTC, ag0aep6g wrote: On 07/10/2018 11:56 AM, Yuxuan Shui wrote: Possible alternatives: * struct Void {}. Takes 1 byte, not as ideal * alias Void = AliasSeq!(). Doesn't work as template argument. i.e.   SomeTemplate!Void; // actually become

[Issue 18343] Crash when importing empty module and package in subfolder

2018-07-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18343 Vladimir Panteleev changed: What|Removed |Added Hardware|x86_64 |All OS|Linux

Re: vibe.d: problematic "Non-@safe methods are deprecated in REST interfaces"

2018-07-10 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 13:14:24 UTC, Piotr Mitana wrote: Hello, I've recently started building a little REST application on vibe.d. I decided to use the "database" library, as I need to communicate with the PostgreSQL instance. During the compilation I see the deprecation warning:

vibe.d: problematic "Non-@safe methods are deprecated in REST interfaces"

2018-07-10 Thread Piotr Mitana via Digitalmars-d-learn
Hello, I've recently started building a little REST application on vibe.d. I decided to use the "database" library, as I need to communicate with the PostgreSQL instance. During the compilation I see the deprecation warning: "Non-@safe methods are deprecated in REST interfaces" So two

Re: guard clause style static if

2018-07-10 Thread Timoses via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 12:10:27 UTC, Jonathan M Davis wrote: On Tuesday, 10 July 2018 05:38:33 MDT kdevel via Digitalmars-d-learn wrote: I would like to suggest an extension of the language by introducing static return Expression_opt; which shall have the effect of a return plus

Re: guard clause style static if

2018-07-10 Thread Timoses via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 12:05:11 UTC, kdevel wrote: On Saturday, 7 July 2018 at 13:12:59 UTC, Alex wrote: The site you cited for the guard clause above (c2.com) works at runtime. ? static if works at compile team and only inserts code into the final code for run-time depending on the

Re: Copy Constructor DIP

2018-07-10 Thread Guillaume Piolat via Digitalmars-d
On Tuesday, 10 July 2018 at 11:58:53 UTC, Jonathan M Davis wrote: Does it allow to remove the "T.init must always be valid for structs" rule? Why would it? init is the state of the object before any constructor runs, and quite a few things rely on it. The fact that we've allowed default

Re: Copy Constructor DIP

2018-07-10 Thread rikki cattermole via Digitalmars-d
I'm not keen on the added attribute. Something along the lines of: this(this; ref Foo foo) {} might look a little better no? And now no super special attribute to worry about parsing.

Re: guard clause style static if

2018-07-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, 10 July 2018 05:38:33 MDT kdevel via Digitalmars-d-learn wrote: > I would like to suggest an extension of the language by > introducing > > static return Expression_opt; > > which shall have the effect of a return plus that the remaining > lines in the current block are treated as

Re: guard clause style static if

2018-07-10 Thread kdevel via Digitalmars-d-learn
On Saturday, 7 July 2018 at 13:12:59 UTC, Alex wrote: The site you cited for the guard clause above (c2.com) works at runtime. ? The intention is to shorten the paths inside a function, I think. Therefore, a static "guard clause" is a contradiction, if I understand it correctly. The term

Re: guard clause style static if

2018-07-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, 10 July 2018 05:52:59 MDT kdevel via Digitalmars-d-learn wrote: > On Saturday, 7 July 2018 at 13:03:32 UTC, rikki cattermole wrote: > > void func() { > > > > return; > > > > func2(); > > > > } > > > > Which is clearly an error. Hence why you need to add else block. > > There is

Re: Copy Constructor DIP

2018-07-10 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, 10 July 2018 04:52:18 MDT Guillaume Piolat via Digitalmars-d wrote: > On Tuesday, 10 July 2018 at 10:47:04 UTC, RazvanN wrote: > > Hi everyone! > > > > I managed to put together a first draft of the DIP for adding > > the copy constructor to the language [1]. If anyone is > >

Re: guard clause style static if

2018-07-10 Thread kdevel via Digitalmars-d-learn
On Saturday, 7 July 2018 at 13:03:32 UTC, rikki cattermole wrote: void func() { return; func2(); } Which is clearly an error. Hence why you need to add else block. There is no error in this generated code because func2 is unreachable. That there is a state/stage during

Re: guard clause style static if

2018-07-10 Thread kdevel via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 00:11:27 UTC, Steven Schveighoffer wrote: On 7/7/18 7:28 AM, kdevel wrote: It appears not to be possible to use static if in "guard clause style" as in    void bar (T ...) (T args)    {   static if (args.length == 0) return;   writeln (args

Re: Normalize void

2018-07-10 Thread ag0aep6g via Digitalmars-d
On 07/10/2018 11:56 AM, Yuxuan Shui wrote: Possible alternatives: * struct Void {}. Takes 1 byte, not as ideal * alias Void = AliasSeq!(). Doesn't work as template argument. i.e.   SomeTemplate!Void; // actually become SomeTemplate!() What about `void[0]`? It's a proper type. You can

Re: mir-optim v0.0.1: betterC nonlinear least squares

2018-07-10 Thread jmh530 via Digitalmars-d-announce
On Tuesday, 10 July 2018 at 02:10:56 UTC, 9il wrote: The algorigbms from https://github.com/JuliaNLSolvers are good candidates. No plans to implement them for now, but PRs are wellcome. Dlangscience has headers for the nlopt and glpk C libraries that I've used in the past. ipopt is another

Re: Copy Constructor DIP

2018-07-10 Thread Guillaume Piolat via Digitalmars-d
On Tuesday, 10 July 2018 at 10:47:04 UTC, RazvanN wrote: Hi everyone! I managed to put together a first draft of the DIP for adding the copy constructor to the language [1]. If anyone is interested, please take a look. Suggestions and comments about technical aspects and wording are all

Re: I have a plan.. I really DO

2018-07-10 Thread bauss via Digitalmars-d-announce
On Friday, 6 July 2018 at 23:27:57 UTC, RhyS wrote: Total 1336 packages found. 3359 total shards D has had a major release. Crystal has had a minor release. Total 1339 packages 3382 total shards This is a really weak point, because it doesn't show the quality of the packages. Just

Copy Constructor DIP

2018-07-10 Thread RazvanN via Digitalmars-d
Hi everyone! I managed to put together a first draft of the DIP for adding the copy constructor to the language [1]. If anyone is interested, please take a look. Suggestions and comments about technical aspects and wording are all welcome. Thanks, RazvanN [1]

Re: Normalize void

2018-07-10 Thread Yuxuan Shui via Digitalmars-d
On Tuesday, 10 July 2018 at 09:50:45 UTC, Yuxuan Shui wrote: Suppose I want to create a type to contain either a return value or an error, I could probably do something like this: [...] Breaking changes: void[] x; pragma(msg, x[0].sizeof); // now 0?

Re: Normalize void

2018-07-10 Thread Yuxuan Shui via Digitalmars-d
On Tuesday, 10 July 2018 at 09:50:45 UTC, Yuxuan Shui wrote: Suppose I want to create a type to contain either a return value or an error, I could probably do something like this: [...] Possible alternatives: * struct Void {}. Takes 1 byte, not as ideal * alias Void = AliasSeq!(). Doesn't

Normalize void

2018-07-10 Thread Yuxuan Shui via Digitalmars-d
Suppose I want to create a type to contain either a return value or an error, I could probably do something like this: struct Result(T, E) { bool is_err; union { T result; E error; } } This will probably work fine, unless I don't need an

Re: BetterC and TypeInfo Question

2018-07-10 Thread ARaspiK via Digitalmars-d-learn
On Friday, 23 June 2017 at 04:03:04 UTC, Adam D. Ruppe wrote: On Friday, 23 June 2017 at 02:49:27 UTC, Mike wrote: My approaches are right now for -betterC to be a filthy hack to get it working quick, and I still have a bunch of ways I want to improve the implementation and compiler interface

Deploy your own Dub Registry to Heroku via one click

2018-07-10 Thread Seb via Digitalmars-d-announce
Ever wanted to run your own Dub registry and were too lazy to set it up? It's now one click away. Simply go to the Dub Registry (https://github.com/dlang/dub-registry) and press "Deploy to Heroku". Provided you have a Heroku account, everything else will automagically work. Note that Heroku

Re: T.init, struct destructors and invariants - should they be called?

2018-07-10 Thread FeepingCreature via Digitalmars-d
On Tuesday, 10 July 2018 at 00:01:28 UTC, Steven Schveighoffer wrote: On 7/7/18 11:06 PM, FeepingCreature wrote: On Friday, 6 July 2018 at 23:37:30 UTC, Simen Kjærås wrote: As for alignment, GC, and possibly other things, the code was not intended as a complete implementation of Nullable, only

Re: Sutter's ISO C++ Trip Report - The best compliment is when someone else steals your ideas....

2018-07-10 Thread Walter Bright via Digitalmars-d
On 7/9/2018 6:50 PM, John Carter wrote: Nothing creates flaky and unreliable systems more than allowing them to wobble on past the first point where you already know that things are wrong. Things got so bad with real mode DOS development that I rebooted the system every time my program

  1   2   >