On Wednesday, 9 February 2022 at 16:37:22 UTC, Ali Çehreli wrote:
On 2/9/22 01:07, bauss wrote:
> It will not run at compile-time because csvText is a runtime
variable.
> It should be enum to be accessible at compile-time.
Yes. For the sake of completeness, any expression needed at
compile tim
On 2/9/22 08:37, Ali Çehreli wrote:
> In any case, some people may find a compile-time file parsing example
> that I included in a presentation:
That should mean "may find interesting". And I've just realized that the
chapter link is off in that video. This is the beginning of that section:
On 2/9/22 01:07, bauss wrote:
> It will not run at compile-time because csvText is a runtime variable.
> It should be enum to be accessible at compile-time.
Yes. For the sake of completeness, any expression needed at compile time
will be (attempted to be) executed at compile time. For example,
On Wednesday, 9 February 2022 at 10:25:34 UTC, bauss wrote:
Is it guaranteed that the value is initialized at compiletime
however?
yes, D guarentees this at 100%.
On Wednesday, 9 February 2022 at 10:01:15 UTC, Anonymouse wrote:
On Wednesday, 9 February 2022 at 08:12:52 UTC, Vindex wrote:
[...]
I would do this.
```
import std;
alias Record = Tuple!(string, string, string);
static immutable string[][] table = () {
string[][] table;
string csvTe
On Wednesday, 9 February 2022 at 10:01:15 UTC, Anonymouse wrote:
On Wednesday, 9 February 2022 at 08:12:52 UTC, Vindex wrote:
Will the loop (foreach) run at compile time? How can I make it
work at compile time?
```
import std.csv, std.stdio;
alias Record = Tuple!(string, string, string);
imm
On Wednesday, 9 February 2022 at 08:12:52 UTC, Vindex wrote:
Will the loop (foreach) run at compile time? How can I make it
work at compile time?
```
import std.csv, std.stdio;
alias Record = Tuple!(string, string, string);
immutable string[][] table;
shared static this() {
string csvTex
On Wednesday, 9 February 2022 at 08:12:52 UTC, Vindex wrote:
Will the loop (foreach) run at compile time? How can I make it
work at compile time?
```
import std.csv, std.stdio;
alias Record = Tuple!(string, string, string);
immutable string[][] table;
shared static this() {
string csvTex
Will the loop (foreach) run at compile time? How can I make it
work at compile time?
```
import std.csv, std.stdio;
alias Record = Tuple!(string, string, string);
immutable string[][] table;
shared static this() {
string csvText = import("file.csv");
foreach (record; csvReader!Record(