On Saturday, 30 April 2022 at 02:22:22 UTC, Tejas wrote:
On Friday, 29 April 2022 at 16:10:52 UTC, Salih Dincer wrote:
On Friday, 29 April 2022 at 12:57:15 UTC, Steven Schveighoffer
wrote:
[...]
I see, think it can be done with mixin:
```d
template prn(alias args)
{
string prn()
{
On Friday, 29 April 2022 at 16:10:52 UTC, Salih Dincer wrote:
On Friday, 29 April 2022 at 12:57:15 UTC, Steven Schveighoffer
wrote:
[...]
I see, think it can be done with mixin:
```d
template prn(alias args)
{
string prn()
{
string result = "write(";
foreach(s; args.split("|"))
On Friday, 29 April 2022 at 12:57:15 UTC, Steven Schveighoffer
wrote:
There is no string interpolation in D. You can use a function
such as `std.conv.text` to produce a string given interleaving
strings and items. Or you can use `std.format.format` to make
it happen.
I see, think it can be
On Friday, 29 April 2022 at 15:13:08 UTC, Tejas wrote:
It's not a keyword yet it's recognised specially by the
compiler... What?
It's not really recognized by the compiler, there's a little bit
of magic to print `string` in outputted D code (e.g. error
messages) instead of
On Friday, 29 April 2022 at 12:57:15 UTC, Steven Schveighoffer
wrote:
On 4/28/22 10:48 PM, Salih Dincer wrote:
[...]
There is no string interpolation in D. You can use a function
such as `std.conv.text` to produce a string given interleaving
strings and items. Or you can use
On 4/28/22 10:48 PM, Salih Dincer wrote:
On Thursday, 9 December 2021 at 14:34:58 UTC, Steven Schveighoffer wrote:
You may want to post what you want to achieve with your code, instead
of examples of what you tried, and it may allow us to make things
clearer. You are likely using the wrong
On Thursday, 9 December 2021 at 14:34:58 UTC, Steven
Schveighoffer wrote:
You may want to post what you want to achieve with your code,
instead of examples of what you tried, and it may allow us to
make things clearer. You are likely using the wrong construct
to achieve your goals.
-Steve
On 12/8/21 7:36 PM, Salih Dincer wrote:
On Wednesday, 8 December 2021 at 23:47:07 UTC, Adam Ruppe wrote:
On Wednesday, 8 December 2021 at 23:43:48 UTC, Salih Dincer wrote:
I think you meant to say
void foo(string[] args...) {}
Not exactly...
```d
alias str = immutable(char)[];
void
On Thursday, 9 December 2021 at 00:36:29 UTC, Salih Dincer wrote:
On Wednesday, 8 December 2021 at 23:47:07 UTC, Adam Ruppe wrote:
On Wednesday, 8 December 2021 at 23:43:48 UTC, Salih Dincer
wrote:
I think you meant to say
void foo(string[] args...) {}
Not exactly...
```d
alias str =
On Wednesday, 8 December 2021 at 23:47:07 UTC, Adam Ruppe wrote:
On Wednesday, 8 December 2021 at 23:43:48 UTC, Salih Dincer
wrote:
I think you meant to say
void foo(string[] args...) {}
Not exactly...
```d
alias str = immutable(char)[];
void foo(str...)(str args) {
foreach(ref a; args)
On Wednesday, 8 December 2021 at 23:43:48 UTC, Salih Dincer wrote:
Is this not a contradiction? : and 3.1415 aren't string:
```d
void foo(string...)(string args) {
`string...` there is a user-defined identifier representing a mix
of types.
string isn't special, yo can declare your own
Hi all,
Is this not a contradiction? : and 3.1415 aren't string:
```d
void foo(string...)(string args) {
foreach(ref str; args) {
str.writeln('\t', typeof(str).stringof);
}
}
foo("Pi", "number", ':', 3.1415); /*
Pi string
number string
: char
3,1415 double
12 matches
Mail list logo