Re: Can we do compile time reading part of a file using import?

2020-10-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/23/20 12:42 PM, data pulverizer wrote: Hi all, the `import` function allows a file to be read at compile time, which opens up great opportunities for (mostly binary) file IO, where data types can be coded into files - the user doesn't need to know data types ahead of time. As specified

Re: Can we do compile time reading part of a file using import?

2020-10-26 Thread Jacob Carlborg via Digitalmars-d-learn
On Sunday, 25 October 2020 at 16:50:09 UTC, Jack wrote: Which build tool are you refering to? an existing one or build one oneself to do this job? It should work with any build tool that has hooks to execute arbitrary commands. -- /Jacob Carlborg

Re: Can we do compile time reading part of a file using import?

2020-10-25 Thread Jack via Digitalmars-d-learn
On Friday, 23 October 2020 at 16:42:00 UTC, data pulverizer wrote: Hi all, the `import` function allows a file to be read at compile time, which opens up great opportunities for (mostly binary) file IO, where data types can be coded into files - the user doesn't need to know data types ahead

Re: Can we do compile time reading part of a file using import?

2020-10-25 Thread Jack via Digitalmars-d-learn
On Sunday, 25 October 2020 at 12:16:36 UTC, Jacob Carlborg wrote: On 2020-10-23 18:42, data pulverizer wrote: For me it's not make-or-break, it just something very useful and I think has clear use case. Please let me know if there are aspects or alternatives I am missing. You could always

Re: Can we do compile time reading part of a file using import?

2020-10-25 Thread data pulverizer via Digitalmars-d-learn
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

Re: Can we do compile time reading part of a file using import?

2020-10-25 Thread Jacob Carlborg via Digitalmars-d-learn
On 2020-10-23 18:42, data pulverizer wrote: For me it's not make-or-break, it just something very useful and I think has clear use case. Please let me know if there are aspects or alternatives I am missing. You could always have the build tool split up the file in multiple smaller files and

Can we do compile time reading part of a file using import?

2020-10-23 Thread data pulverizer via Digitalmars-d-learn
Hi all, the `import` function allows a file to be read at compile time, which opens up great opportunities for (mostly binary) file IO, where data types can be coded into files - the user doesn't need to know data types ahead of time. As specified in my old blog article: