Re: Access Violation Tracking

2014-11-07 Thread ketmar via Digitalmars-d-learn
On Fri, 7 Nov 2014 22:58:38 -0800 "H. S. Teoh via Digitalmars-d-learn" wrote: > Some time ago deadalnix gave a neat (if scary) hack where the signal > handler overwrites its return address on the stack to redirect the code > to a handler that operates outside signal handler context, so it has no

Re: Access Violation Tracking

2014-11-07 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Nov 08, 2014 at 08:50:20AM +0200, ketmar via Digitalmars-d-learn wrote: > On Fri, 07 Nov 2014 13:52:33 + > "Nordlöw" via Digitalmars-d-learn > wrote: > > > On Friday, 7 November 2014 at 03:22:59 UTC, ketmar via > > Digitalmars-d-learn wrote: > > > crash+coredump is alot more useful t

Re: Access Violation Tracking

2014-11-07 Thread ketmar via Digitalmars-d-learn
On Sat, 08 Nov 2014 06:23:39 + Nikolay via Digitalmars-d-learn wrote: > I think, it is problem. Dland on windows gives stacktrace without > any problem. In general it is expected behavior for many people > from different languages (Java, C#). So from my point of view it > is bad idea has c

Re: Access Violation Tracking

2014-11-07 Thread ketmar via Digitalmars-d-learn
On Fri, 07 Nov 2014 13:52:33 + "Nordlöw" via Digitalmars-d-learn wrote: > On Friday, 7 November 2014 at 03:22:59 UTC, ketmar via > Digitalmars-d-learn wrote: > > crash+coredump is alot more useful than intercepting error > > and... > > trying to recover from undefined state? or just exit to

Re: Access Violation Tracking

2014-11-07 Thread Nikolay via Digitalmars-d-learn
i also developed a habit of writing assert()s before dereferencing pointers first time (including class refs) in appropriate places, so i'll got that stack trace for free. ;-) and i never turning off that asserts in "release builds". About null pointer deref & core dump I think, it is prob

Re: D1: Error: function ... cannot have an in contract when overriden function

2014-11-07 Thread Adam D. Ruppe via Digitalmars-d-learn
If it is just that one error, you could always just comment out the in contract and recompile.

D1: Error: function ... cannot have an in contract when overriden function

2014-11-07 Thread jicman via Digitalmars-d-learn
Greetings! I am trying to compile dfl with the latest version of D1. I am stuck in this error: c:\D\import\dfl\button.d(381): Error: function dfl.button.Button.text cannot have e an in contract when overriden function dfl.control.Control.text does not have an in contract This is the line

Re: std.array.array and immutable elements

2014-11-07 Thread John Colvin via Digitalmars-d-learn
On Friday, 7 November 2014 at 14:33:00 UTC, Jack Applegame wrote: DMD64 D Compiler v2.066.1 Why second call doesn't compile? import std.array; import std.algorithm; class Foo { bool flag; } void main() { immutable(Foo)[] foos; foreach(i; 0..5) foos ~= new Foo; // compiles

Re: std.array.array and immutable elements

2014-11-07 Thread ketmar via Digitalmars-d-learn
On Fri, 07 Nov 2014 15:18:24 + anonymous via Digitalmars-d-learn wrote: > On Friday, 7 November 2014 at 14:57:56 UTC, ketmar via > Digitalmars-d-learn wrote: > > `map` cannot return range with immutable elements, 'cause they > > are > > obviously generated by program, and therefore aren't >

Re: std.array.array and immutable elements

2014-11-07 Thread anonymous via Digitalmars-d-learn
On Friday, 7 November 2014 at 14:57:56 UTC, ketmar via Digitalmars-d-learn wrote: `map` cannot return range with immutable elements, 'cause they are obviously generated by program, and therefore aren't "immutable". That's not true. Runtime generated values can be immutable just fine. And it's

Re: std.array.array and immutable elements

2014-11-07 Thread ketmar via Digitalmars-d-learn
On Fri, 07 Nov 2014 14:32:57 + Jack Applegame via Digitalmars-d-learn wrote: > import std.array; > import std.algorithm; > > class Foo { > bool flag; > } > void main() { >immutable(Foo)[] foos; >foreach(i; 0..5) foos ~= new Foo; > >// compiles, typeof(bar1) == immuta

Re: std.array.array and immutable elements

2014-11-07 Thread ketmar via Digitalmars-d-learn
On Fri, 07 Nov 2014 14:32:57 + Jack Applegame via Digitalmars-d-learn wrote: ah, sorry, my bad, 'const' will not work to, for the same reason. signature.asc Description: PGP signature

std.array.array and immutable elements

2014-11-07 Thread Jack Applegame via Digitalmars-d-learn
DMD64 D Compiler v2.066.1 Why second call doesn't compile? import std.array; import std.algorithm; class Foo { bool flag; } void main() { immutable(Foo)[] foos; foreach(i; 0..5) foos ~= new Foo; // compiles, typeof(bar1) == immutable(Foo)[] auto bar1 = array(foos.filter!

Re: Access Violation Tracking

2014-11-07 Thread ketmar via Digitalmars-d-learn
On Fri, 07 Nov 2014 13:52:33 + "Nordlöw" via Digitalmars-d-learn wrote: > On Friday, 7 November 2014 at 03:22:59 UTC, ketmar via > Digitalmars-d-learn wrote: > > crash+coredump is alot more useful than intercepting error > > and... > > trying to recover from undefined state? or just exit to

Re: Access Violation Tracking

2014-11-07 Thread ketmar via Digitalmars-d-learn
On Fri, 07 Nov 2014 08:49:34 -0500 Steven Schveighoffer via Digitalmars-d-learn wrote: > On 11/6/14 11:43 PM, ketmar via Digitalmars-d-learn wrote: > > On Thu, 06 Nov 2014 22:45:23 -0500 > > Steven Schveighoffer via Digitalmars-d-learn > > wrote: > > > >> In an environment that you don't control

Re: Access Violation Tracking

2014-11-07 Thread Nordlöw
On Friday, 7 November 2014 at 03:22:59 UTC, ketmar via Digitalmars-d-learn wrote: crash+coredump is alot more useful than intercepting error and... trying to recover from undefined state? or just exit to OS, losing valuable information about a crash? Together with the DUB package backtrace th

Re: Access Violation Tracking

2014-11-07 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/6/14 11:43 PM, ketmar via Digitalmars-d-learn wrote: On Thu, 06 Nov 2014 22:45:23 -0500 Steven Schveighoffer via Digitalmars-d-learn wrote: In an environment that you don't control, the default behavior is likely to print "Segmentation Fault" and exit. No core dump, no nothing. This lea

Re: transversal sum

2014-11-07 Thread John Colvin via Digitalmars-d-learn
On Friday, 7 November 2014 at 10:58:58 UTC, Marc Schütz wrote: On Thursday, 6 November 2014 at 22:40:58 UTC, John Colvin wrote: this should be a textbook case for std.range.transposed, but I can't seem to get it to work. Ah, I didn't know this existed. Apparently it's not yet released, that's

Re: Audio file read/write?

2014-11-07 Thread ponce via Digitalmars-d-learn
COn Friday, 7 November 2014 at 02:58:15 UTC, Daren Scot Wilson wrote: What's the current recommended way to read and write audio files? I don't need to play it on the speakers or deal with anything real time - just read a file's data into an array, fiddle with it, and write it out to a file.

Re: transversal sum

2014-11-07 Thread bearophile via Digitalmars-d-learn
Marc Schütz: auto sums = input .transposed .map!(a => a.sum); And that part is better written: .map!sum; I also suggest to align the leading dot to the precedent line: auto sums = input .transposed .map!

Re: transversal sum

2014-11-07 Thread bearophile via Digitalmars-d-learn
Marc Schütz: int[][] input = new int[][2]; input[0] = [1, 2, 3, 4]; input[1] = [5, 6, 7, 8]; writeln(input); auto sums = input .transposed .map!(a => a.sum); writeln(sums); } Output: [[1, 2, 3, 4], [5, 6,

Re: Intended behavior or bug (private vs public static)

2014-11-07 Thread Andre via Digitalmars-d-learn
Thanks a lot. I will create a bug report. Kind regards André On Friday, 7 November 2014 at 06:09:02 UTC, Jonathan M Davis via Digitalmars-d-learn wrote: That looks like a bug. All you have to do is change the order of the two function declarations or rename the non-static one to something

Re: transversal sum

2014-11-07 Thread via Digitalmars-d-learn
On Thursday, 6 November 2014 at 22:40:58 UTC, John Colvin wrote: this should be a textbook case for std.range.transposed, but I can't seem to get it to work. Ah, I didn't know this existed. Apparently it's not yet released, that's why it's not in the official documentation. With DMD and Phob