Re: Interpolated strings?

2024-12-16 Thread Juraj via Digitalmars-d-learn
On Monday, 16 December 2024 at 20:33:27 UTC, Andy Valencia wrote: string x = i"Message $(s) has value $(i)" ```d import std.conv : text; string x = i"Message $(s) has value $(i)".text; ``` [Documentation](https://dlang.org/spec/istring.html#tostring) Juraj

Re: Unexpected result with -betterC

2024-11-03 Thread Juraj via Digitalmars-d-learn
On Sunday, 3 November 2024 at 20:04:19 UTC, DLearner wrote: On Sunday, 3 November 2024 at 19:47:31 UTC, monkyyy wrote: [...] Id expect this to fail, but nothing I see in yours ```d string foo="foo"; foo~="bar"; ``` []'s are both slices and dynamic arrays depending on use, theres a debate abo

Re: Any way to automatically convert structs on return?

2024-08-02 Thread Juraj via Digitalmars-d-learn
On Thursday, 1 August 2024 at 07:25:53 UTC, Emma wrote: ```d Option!int something() { return None(); // Error: cannot implicitly convert expression `None()` of type `None` to `Option!int` } ``` Not D per se, but you can check Adam D. Ruppe's current work. If I am not mistaken, the thing yo