Yet another terrible compile time argument proposal

Nickolay Bukreyev buknik95 at ya.ru
Sun Jan 14 22:02:21 UTC 2024


Oops, I forgot to update my pros/cons. They are not comparing 
against the proposal described in this thread.

On Sunday, 14 January 2024 at 21:27:44 UTC, Steven Schveighoffer 
wrote:
> ```d
> void foo(T)(T x, enum string s)
> {
>    pragma(msg, s); // s is compile-time
> }
> ```

The syntax looks nice (there’s nothing to remove, you know). 
You’ve already quoted my thoughts about the semantics.

I think I have a challenge. Can you write a function that accepts 
an arbitrary number of key-value pairs? All keys should be 
compile-time strings; all values should be runtime ints; keys and 
values should alternate.

```d
int value1, value2;
foo("key1", value1, "key2", value2);
```


More information about the Digitalmars-d mailing list