On Thursday, 22 July 2021 at 18:16:54 UTC, Tejas wrote:
On Thursday, 22 July 2021 at 18:06:07 UTC, Paul Backus wrote:
On Thursday, 22 July 2021 at 17:38:09 UTC, Tejas wrote:
Why does this work?
```d
import std;
void main()
{
mixin("int") a;
writeln(a);
}
```
You can mix in a type:
h
On Thursday, 22 July 2021 at 18:06:07 UTC, Paul Backus wrote:
On Thursday, 22 July 2021 at 17:38:09 UTC, Tejas wrote:
Why does this work?
```d
import std;
void main()
{
mixin("int") a;
writeln(a);
}
```
You can mix in a type:
https://dlang.org/spec/type.html#mixin_types
Looks like
On Thursday, 22 July 2021 at 17:38:09 UTC, Tejas wrote:
Why does this work?
```d
import std;
void main()
{
mixin("int") a;
writeln(a);
}
```
You can mix in a type:
https://dlang.org/spec/type.html#mixin_types
On Thursday, 22 July 2021 at 05:57:02 UTC, jfondren wrote:
On Thursday, 22 July 2021 at 03:43:44 UTC, someone wrote:
... it compiles no-more: Error: found `End of File` when
expecting `}` following compound statement
... what I am doing wrong ?
You'll get the same error from this code:
```d
On Thursday, 22 July 2021 at 08:16:43 UTC, Patrick Schluter wrote:
What an unreadable mess. Sorry.
Indeed LoL !!!
I would have done something like that:
```d
mixin(format!
`case r"%1$s"d :
classTickerCustom%1$s lobjTicker%1$s = new
classTickerCustom%1$s (lstrSymbolID);
On Thursday, 22 July 2021 at 05:57:02 UTC, jfondren wrote:
Each individual string has to compile on its own. You'll have
to concatenate strings and then mixin them.
I forgot about that !
On Thursday, 22 July 2021 at 05:57:02 UTC, jfondren wrote:
On Thursday, 22 July 2021 at 03:43:44 UTC, someone wrote:
... it compiles no-more: Error: found `End of File` when
expecting `}` following compound statement
... what I am doing wrong ?
You'll get the same error from this code:
```d
On Thursday, 22 July 2021 at 03:43:44 UTC, someone wrote:
```
Now, if uncomment those two innocuous commented lines for the
if (true == true) block:
```d
labelSwitch: switch (lstrExchangeID) {
static foreach (sstrExchangeID; gstrExchangeIDs) {
mixin(r"case r"d, `"`, sstrExchangeID, `"`,
On Thursday, 22 July 2021 at 03:43:44 UTC, someone wrote:
... it compiles no-more: Error: found `End of File` when
expecting `}` following compound statement
... what I am doing wrong ?
You'll get the same error from this code:
```d
unittest {
mixin("{");
mixin("}");
}
```
https://d
The following code chunk compiles perfectly:
```d
labelSwitch: switch (lstrExchangeID) {
static foreach (sstrExchangeID; gstrExchangeIDs) {
mixin(r"case r"d, `"`, sstrExchangeID, `"`, r"d : "d);
mixin(r"classTickerCustom"d, sstrExchangeID, r" lobjTicker"d,
sstrExchangeID, r" = new classT
10 matches
Mail list logo