Re: Question regarding mir.csv.

2023-11-01 Thread Sergey via Digitalmars-d-learn
On Wednesday, 1 November 2023 at 20:49:16 UTC, Zz wrote: Hi, Currently using std.csv and would like to do the following using mir.csv. auto data = std.csv.csvReader!Layout(input).array; Are there any examples out there on using mir.csv? Regards, Zz you can find some examples in source cod

Question regarding mir.csv.

2023-11-01 Thread Zz via Digitalmars-d-learn
Hi, Currently using std.csv and would like to do the following using mir.csv. auto data = std.csv.csvReader!Layout(input).array; Are there any examples out there on using mir.csv? Regards, Zz

Re: Function Overloading

2023-11-01 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 31 October 2023 at 20:09:44 UTC, Salih Dincer wrote: [...] is it possible to do something like `alias add = this;`? ```d struct Calculate {   int memory; string result;    auto toString() => result;    // alias add = this;     import std.string : format;    this(stri

Re: Weird bug in std.logger? Possible memory corruption

2023-11-01 Thread Arafel via Digitalmars-d-learn
On 1/11/23 18:26, Christian Köstlin wrote: It's really weird: https://run.dlang.io/is/fIBR2n I think I might have found out the issue. It's indeed related to the lazy parameter and reentrance. The usual logger functions consist of three parts: a header, the message, and the "finalizer". [1]

Re: Weird bug in std.logger? Possible memory corruption

2023-11-01 Thread matheus via Digitalmars-d-learn
On Wednesday, 1 November 2023 at 17:26:42 UTC, Christian Köstlin wrote: ... It's really weird: https://run.dlang.io/is/fIBR2n Interesting because I wrote a similar test as you did. And that increment (Or lack of) called my attention, If I can I'll try and take a look at that (std.logger) info

Re: Weird bug in std.logger? Possible memory corruption

2023-11-01 Thread Christian Köstlin via Digitalmars-d-learn
On Wednesday, 1 November 2023 at 14:15:55 UTC, matheus wrote: On Tuesday, 31 October 2023 at 21:19:34 UTC, Arafel wrote: ... Assigning the value to a variable works as expected: ```d import std.logger : info; void main() { auto s = foo(); info(s); } auto foo() { info("In foo");

Re: Weird RDMD error when trying to import source file from subfolder.

2023-11-01 Thread Julian Fondren via Digitalmars-d-learn
On Wednesday, 1 November 2023 at 16:24:04 UTC, BoQsc wrote: **Error:** ``` rdmd testimport.d testimport.d(2): Error: module `next` from file waffle\next.d must be imported with 'import next;' ``` You import 'waffle.next', but the module is inferred to be 'next'. If put `module waffle.next;`

Weird RDMD error when trying to import source file from subfolder.

2023-11-01 Thread BoQsc via Digitalmars-d-learn
I'm unable to import a `.d` source file from a subfolder. Now this happens only with `rdmd`. The `dmd -i -run` works perfectly. I'm currently on Windows 10 operating system. **./testimport.d**: ``` import std; import waffle.next; void main(){ writeln("test", testing); } ``` **./waf

Re: Weird bug in std.logger? Possible memory corruption

2023-11-01 Thread matheus via Digitalmars-d-learn
On Tuesday, 31 October 2023 at 21:19:34 UTC, Arafel wrote: ... Assigning the value to a variable works as expected: ```d import std.logger : info; void main() { auto s = foo(); info(s); } auto foo() { info("In foo"); return "Hello, world."; } ``` ... Unless you do: stri

Re: Weird bug in std.logger? Possible memory corruption

2023-11-01 Thread Arafel via Digitalmars-d-learn
I can only imagine that it's related to the logging functions taking lazy arguments, although I cannot see why it would be a problem in a simple case like this. I've been thinking a bit more about it, and it must be indeed because of the lazy argument. `foo()` is an argument to `info`, but i