Re: generating switch case from compile time sequence of functions

2019-07-14 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 14 July 2019 at 19:26:41 UTC, Sjoerd Nijboer wrote: The code it must generate for `doSwitch!(foo, bar)()` is `{ switch (int) { foo: foo(); return; bar: bar(); return; } }` I'd probably just do void doSwitch

generating switch case from compile time sequence of functions

2019-07-14 Thread Sjoerd Nijboer via Digitalmars-d-learn
I am trying to create a template function with a switch case inside it. The function signature is: `static void doSwitch(T...)(int i)` The code it must generate for `doSwitch!(foo, bar)()` is `{ switch (int) { foo: foo(); return; bar: b

Re: Substitutions with writef() or format()?

2019-07-14 Thread Ron Tarrant via Digitalmars-d-learn
On Sunday, 14 July 2019 at 13:45:38 UTC, Ron Tarrant wrote: 'Morning, all. If these lines: string currency = format("$%,.02f", 11_234_456.99); writeln(currency); Will result in: $11,234,456.99 Why don't these lines: string notCurrency = format("%,", 11_234_456); writeln(notCu

Substitutions with writef() or format()?

2019-07-14 Thread Ron Tarrant via Digitalmars-d-learn
'Morning, all. If these lines: string currency = format("$%,.02f", 11_234_456.99); writeln(currency); Will result in: $11,234,456.99 Why don't these lines: string notCurrency = format("%,", 11_234_456); writeln(notCurrency); result in: 11,234,456 ??? Instead of a range

Re: Windows segfault, need brief help

2019-07-14 Thread Boris Carvajal via Digitalmars-d-learn
On Saturday, 13 July 2019 at 16:39:51 UTC, Anonymouse wrote: Thank you! Filed as https://issues.dlang.org/show_bug.cgi?id=20048. https://github.com/dlang/druntime/pull/2675