Re: How to evaluate a JSON file at compile time and create a struct out of it?

2024-10-04 Thread holyzantaclara via Digitalmars-d-learn
Thank you everyone, true the compilation speed with the `static immutable string s` is unbearable for my workflow right now. Will try to generate a `.d` file that would contain a static D object instead and then compile this `.d` file.

How to evaluate a JSON file at compile time and create a struct out of it?

2024-10-04 Thread holyzantaclara via Digitalmars-d-learn
Hello hello everyone ^_^, I am new in D, and started this morning. I found a way to read a file at compile time with `-J.` and `static string content = import("my_json_file.json")` But then tried to statically evaluate with `static JSONValue j = parseJson(content)` but it fails. ```sh main