Re: D Snippet: Reading a file to standard output on Windows Operating System. (FileScan.d)

2023-12-06 Thread BoQsc via Digitalmars-d-learn
As of recent observation the `line` in the previous implementation seem to recognise **\r** as default terminator. Making `writeln("|" ~ line ~ "|");` not possible. By correcting terminator and disabling it on `byLine` function it is possible to achieve following output to standard stream:

Re: union default initialization values

2023-12-06 Thread Nick Treleaven via Digitalmars-d-learn
On Wednesday, 6 December 2023 at 12:38:35 UTC, Nick Treleaven wrote: Correct. So I expected a NaN output for x. However, I wasn't expecting lo == 13835058055282163712 and hi == 32767 where x is of type real, or lo == 9221120237041090560 and hi = 0 where x is of type double. Based on the

Re: union default initialization values

2023-12-06 Thread Nick Treleaven via Digitalmars-d-learn
On Tuesday, 5 December 2023 at 19:47:38 UTC, confuzzled wrote: On 12/6/23 4:28 AM, Adam D Ruppe wrote: On Tuesday, 5 December 2023 at 19:24:51 UTC, confuzzled wrote: Given the following union union F {     double x;     struct {     ulong lo;     ulong hi;     } } The default value

Re: Is there a way to tell LDC2 to only check the syntax of the source file?

2023-12-06 Thread realhet via Digitalmars-d-learn
On Wednesday, 6 December 2023 at 11:53:09 UTC, realhet wrote: Hello, I've found another trick: - prepend "version(none):" in front of the source. - ignore the optional "Error: declaration expected, not `module`" message - Take seriously all the other errors, those are only syntax errors,

Anonymous function scope issue?

2023-12-06 Thread DLearner via Digitalmars-d-learn
The two little demo scripts: ``` string mxnAdd()(string strName) { return `(typeof(` ~ strName ~ `) Pld) { import core.stdc.stdlib : malloc; struct Mst { typeof(` ~ strName ~ `) Pld; int I1; } Mst*MstPtr; MstPtr =

Is there a way to tell LDC2 to only check the syntax of the source file?

2023-12-06 Thread realhet via Digitalmars-d-learn
Hello, I can turn off linking with -c I can turn off compiling with-o- How can I turn it off before the semantic passes? I'm experimenting with a nasty trink: I prepend "__undefinied__ _;" into the tested code. And if I get an error: Error: undefined identifier `__undefinied__` I