We are forking D

Walter Bright newshound2 at digitalmars.com
Mon Jan 8 03:05:17 UTC 2024


On 1/7/2024 6:30 PM, Walter Bright wrote:
> On 1/7/2024 3:50 PM, Timon Gehr wrote:
>> This cannot work:
>>
>> ```
>> int x=readln.strip.split.to!int;
>> db.execi(xxx!i"INSERT INTO sample VALUES ($(id), $(2*x))");
>> ```
> 
> True, you got me there. It's the 2*x that is not turnable into an alias. I'm 
> going to think about this a bit.

I wonder if what we're missing are functions that operate on tuples and return 
tuples. We almost have them in the form of:

```
template tuple(A ...) { alias tuple = A; }
```

but the compiler wants A to only consist of symbols, types and expressions that 
can be computed at compile time. This is so the name mangling will work. But 
what if we don't bother doing name mangling for this kind of template?



More information about the Digitalmars-d mailing list