Re: Json

2017-11-19 Thread Mafi via Digitalmars-d-learn
On Saturday, 18 November 2017 at 14:25:58 UTC, kerdemdemir wrote: I am using vibe.d's json(http://vibed.org/api/vibe.data.json/) module without a problem and really happy with it. There are also some examples(https://github.com/vibe-d/vibe.d/tree/master/examples/json). If you are using "dub"

Json

2017-11-17 Thread Mafi via Digitalmars-d-learn
What is the current best practice for parsing JSON in D? What library (on code.dlang.org) should I use? I do not want to (de-)serialize structs. Instead I want a simple DOM-API. Thank you very much :)

Re: Output-Range and char

2017-04-23 Thread Mafi via Digitalmars-d-learn
On Sunday, 23 April 2017 at 12:03:58 UTC, Ali Çehreli wrote: On 04/23/2017 04:17 AM, Mafi wrote: /opt/compilers/dmd2/include/std/range/primitives.d(351): Error: static assert "Cannot put a char into a char[]." Appender recommended: import std.format, std.stdio, std.array; void main() {

Output-Range and char

2017-04-23 Thread Mafi via Digitalmars-d-learn
Hi there, every time I want to use output-ranges again they seem to be broken in a different way (e.g. value/reference semantics). This time it is char types and encoding. How do I make formattedWrite work with a char buffer? I tried the following code and it fails with a *static assert*; it

Re: Unexpected behavior when casting away immutable

2015-09-23 Thread Mafi via Digitalmars-d-learn
On Wednesday, 23 September 2015 at 05:24:05 UTC, John Colvin wrote: On Wednesday, 23 September 2015 at 03:39:02 UTC, Mike Parker wrote: ... ``` immutable int x = 10; int* px = cast(int*) *px = 9; writeln(x); ``` It prints 10, where I expected 9. This is on Windows. I'm curious if anyone