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)
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'
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.
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
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;