We are forking D

Walter Bright newshound2 at digitalmars.com
Sun Jan 7 20:19:43 UTC 2024


On 1/7/2024 11:52 AM, brianush1 wrote:
> Not arsd.sqlite, nor any other library, defines their own interpolated strings. 
> Importing a library does not and cannot change the behavior of interpolated 
> strings, that is a misunderstanding. Library functions simple take in the 
> interpolated string using a vararg template and do literally *whatever they want 
> with it,* since they're given all the information about the interpolated string, 
> including the evaluated expressions that were inside the string.

Thanks for the clarification. I had indeed misunderstood it.

So that means db.execi() is the template that adjusts how the call to sql is 
made. (I had assumed it was part of the sql api, rather than a wrapper.)

This makes it no different than DIP1027 in that regard.

It is not really necessary to have a marker to say if an argument is a literal 
or a variable. Consider this program:

```
import std.stdio;

void main()
{
     writeln("hello".stringof);
     string foo = "betty";
     writeln(foo.stringof);
}
```

Which, when run, prints:

"hello"
foo

and so a template, by using .stringof, can determine if a tuple element is a 
string literal or a variable.


More information about the Digitalmars-d mailing list