You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The signature of parseJSONStream() constrains the input type to InputRange, but it seems like it actually requires a ForwardRange due to the calls to std.algorithm.skipOver() in lexer.d.
I was trying to call parseJSONStream() on a range of ubyte from a file (without reading the entire file into memory), using the basic approach:
auto fileRange = File("input.json").byChunk(4096).joiner;
auto tokens = parseJSONStream(fileRange);
This fails with a type error: std_data_json-0.18.2/std_data_json/source/stdx/data/json/lexer.d(341,29): Error: template std.algorithm.searching.skipOver cannot deduce function from argument types !()(Result, string)
Is there better way to do this? Probably at the least, the template constraints for parseJSONStream() should be changed to ForwardRange, but support for InputRanges would allow incremental parsing from a file.
The signature of
parseJSONStream()
constrains the input type toInputRange
, but it seems like it actually requires aForwardRange
due to the calls to std.algorithm.skipOver() in lexer.d.I was trying to call
parseJSONStream()
on a range of ubyte from a file (without reading the entire file into memory), using the basic approach:This fails with a type error:
std_data_json-0.18.2/std_data_json/source/stdx/data/json/lexer.d(341,29): Error: template std.algorithm.searching.skipOver cannot deduce function from argument types !()(Result, string)
Is there better way to do this? Probably at the least, the template constraints for
parseJSONStream()
should be changed toForwardRange
, but support for InputRanges would allow incremental parsing from a file.Also, here is a related open forum thread: http://forum.dlang.org/thread/[email protected]
The text was updated successfully, but these errors were encountered: