Re: stdx.data.json - enhancement suggestions

2015-05-02 Thread Laeeth Isharc via Digitalmars-d-learn
On Friday, 1 May 2015 at 20:04:58 UTC, Ilya Yaroshenko wrote: This line can be removed: .map!(ch = ch.idup) On Friday, 1 May 2015 at 20:02:46 UTC, Ilya Yaroshenko wrote: Current std.stdio is deprecated. This ad-hoc should works. auto json = File(fileName)

Re: stdx.data.json - enhancement suggestions

2015-05-02 Thread Laeeth Isharc via Digitalmars-d-learn
It doesn't like it. Any thoughts ? lexer.d(257): Error: safe function 'stdx.data.json.parser.JSONLexerRange!(MapResult!(__lambda3, Result), cast(LexOptions)0, __lambda31).JSONLexerRange.empty' cannot call system function 'app.lookupTickers.MapResult!(__lambda3, Result).MapResult.empty'

Re: stdx.data.json - enhancement suggestions

2015-05-02 Thread Ilya Yaroshenko via Digitalmars-d-learn
You can use std.json or create TrustedInputRangeShell template with @trasted methods: struct TrustedInputRangeShell(Range) { Range* data; auto front() @property @trusted { return (*data).front; } //etc } But I am not sure about other parseJSONStream bugs.

Re: stdx.data.json - enhancement suggestions

2015-05-01 Thread Ilya Yaroshenko via Digitalmars-d-learn
This line can be removed: .map!(ch = ch.idup) On Friday, 1 May 2015 at 20:02:46 UTC, Ilya Yaroshenko wrote: Current std.stdio is deprecated. This ad-hoc should works. auto json = File(fileName) .byChunk(1024 * 1024) //1 MB. Data cluster equals 1024 * 4

Re: stdx.data.json - enhancement suggestions

2015-05-01 Thread Ilya Yaroshenko via Digitalmars-d-learn
Current std.stdio is deprecated. This ad-hoc should works. auto json = File(fileName) .byChunk(1024 * 1024) //1 MB. Data cluster equals 1024 * 4 .map!(ch = ch.idup) .joiner .map!(b = cast(char)b) .parseJSON;