Can we do compile time reading part of a file using import?
data.pulverizer at gmail.com
Sun Oct 25 13:56:38 UTC 2020
On Sunday, 25 October 2020 at 12:16:36 UTC, Jacob Carlborg wrote:
> On 2020-10-23 18:42, data pulverizer wrote:
> You could always have the build tool split up the file in
> multiple smaller files and read one of the smaller files with
> the import expression.
Thanks. My current solution is to have a metadata file where all
the type information is stored and then the data file separately.
I should have been clearer when I asked if there was something I
was missing, like whether there is another way to do compile time
read without reading the whole file. I think the feature I
suggested is a useful one to bear in mind for future versions of
D. It would save on preprocessing large files before reading
them. I don't know how `import` for file reads works at the
moment, and correct me if I'm wrong but it doesn't seem to me
that it would be a big deal to make the change.
More information about the Digitalmars-d-learn