Re: Best way to handle settings files (ini file syntax or similar)

2013-02-28 Thread Stephan Schiffels
Am 27.02.13 21:36, schrieb Dicebot: For anything even remotely complex I would have probably chosen JSON, either new std.json pending for review (not current std.json!) or vibe.data.json from vibed.org project. Which std.json are you referring to? There is no std.json2 or something in the

joiner and map, strange behavior

2013-03-12 Thread Stephan Schiffels
Hi, I am struggling with understanding this behavior. In the code below, the function getVec is called 8 times, but it should be called only 4 times (once for each call inside of map). Any explanations? Stephan import std.stdio; import std.algorithm; import std.array; int[] getVec(size_t

Re: joiner and map, strange behavior

2013-03-12 Thread Stephan Schiffels
On Tuesday, 12 March 2013 at 17:43:43 UTC, bearophile wrote: Stephan Schiffels: I am struggling with understanding this behavior. In the code below, the function getVec is called 8 times, but it should be called only 4 times (once for each call inside of map). Any explanations? Maybe it's

Re: joiner and map, strange behavior

2013-03-12 Thread Stephan Schiffels
Am 12.03.13 20:22, schrieb Timon Gehr: On 03/12/2013 06:51 PM, Stephan Schiffels wrote: ... Thanks, I had a brief look at std.algorithm.joiner but couldn't find anything obvious, maybe I should look deeper into it. ... I guess it is because of the following: Eg (similar code occurs two

open a range of files - segfault

2013-05-22 Thread Stephan Schiffels
Hi, this code crashes with a segfault. I need help to understand what might be wrong with it. import std.array; import std.algorithm; void main() { auto names = [file1.txt, file2.txt, file3.txt]; // let these files exist auto files = names.map!(f = File(f, r))().array(); } Thanks,

Re: open a range of files - segfault

2013-05-22 Thread Stephan Schiffels
On Wednesday, 22 May 2013 at 11:09:49 UTC, John Colvin wrote: On Wednesday, 22 May 2013 at 11:07:39 UTC, bearophile wrote: Stephan Schiffels: this code crashes with a segfault. I need help to understand what might be wrong with it. import std.array; import std.algorithm; void main() { auto

this() immutable

2013-06-13 Thread Stephan Schiffels
Hi, I have some problems with adopting my code to a breaking change introduced in version 2.063. Apparently, now it's not anymore possible to instantiate an immutable object via: auto object = new immutable(SomeClass)(contructor_args...); without also defining either

Re: this() immutable

2013-06-13 Thread Stephan Schiffels
On Thursday, 13 June 2013 at 12:29:57 UTC, Simen Kjaeraas wrote: On Thu, 13 Jun 2013 14:17:22 +0200, Stephan Schiffels stephan_schiff...@mac.com wrote: For example, is there a way of instantiating an object normally (i.e. mutable), and then later freeze it to immutable via a simple cast

std.range.chunk without length

2013-10-29 Thread Stephan Schiffels
Hi, I'd like a version of std.range.chunk that does not require the range to have the length property. As an example, consider a file that you would like parse by lines and always lump together four lines, i.e. import std.stdio; void main() { auto range = File(test.txt, r).byLine();

Re: std.range.chunk without length

2013-10-31 Thread Stephan Schiffels
On Wednesday, 30 October 2013 at 20:43:54 UTC, qznc wrote: On Wednesday, 30 October 2013 at 00:20:12 UTC, Stephan Schiffels wrote: Hi, I'd like a version of std.range.chunk that does not require the range to have the length property. As an example, consider a file that you would like parse

Re: std.range.chunk without length

2014-02-13 Thread Stephan Schiffels
On Thursday, 31 October 2013 at 10:35:54 UTC, Stephan Schiffels wrote: On Wednesday, 30 October 2013 at 20:43:54 UTC, qznc wrote: On Wednesday, 30 October 2013 at 00:20:12 UTC, Stephan Schiffels wrote: Hi, I'd like a version of std.range.chunk that does not require the range to have

Re: std.range.chunk without length

2014-02-18 Thread Stephan Schiffels
On Thursday, 13 February 2014 at 17:41:37 UTC, monarch_dodra wrote: On Thursday, 13 February 2014 at 14:45:44 UTC, bearophile wrote: Stephan Schiffels: It would be actually easy to implement chunks without the save function, by using an internal buffer, which would however make

stack trace output on exception

2014-07-08 Thread Stephan Schiffels via Digitalmars-d-learn
Hi, I am using dmd with version: DMD64 D Compiler v2.065-devel-db2a73d My program throws a custom exception with a custom error message at some point. The stack trace (below) is very uninformative. Is there a way to output the function names of each position in the stack? I already compile

Re: stack trace output on exception

2014-07-08 Thread Stephan Schiffels via Digitalmars-d-learn
Ah nice. That worked. Thanks! 2014-07-08 9:25 GMT+02:00 JR via Digitalmars-d-learn digitalmars-d-learn@puremagic.com: On Tuesday, 8 July 2014 at 07:11:26 UTC, Stephan Schiffels wrote: Hi, I am using dmd with version: DMD64 D Compiler v2.065-devel-db2a73d My program throws a custom