On Tuesday, 25 January 2022 at 12:27:16 UTC, Dennis wrote:
On Tuesday, 25 January 2022 at 12:11:01 UTC, JG wrote:
Any ideas how one can achieve what is written in the subject
line?
```D
void f(T...)(auto ref T args, string file = __FILE__, int line
= __LINE__)
{
writeln(file, ":", line,
On Tuesday, 25 January 2022 at 12:27:16 UTC, Dennis wrote:
On Tuesday, 25 January 2022 at 12:11:01 UTC, JG wrote:
Any ideas how one can achieve what is written in the subject
line?
```D
void f(T...)(auto ref T args, string file = __FILE__, int line
= __LINE__)
{
writeln(file, ":", line,
On Tuesday, 25 January 2022 at 12:11:01 UTC, JG wrote:
Any ideas how one can achieve what is written in the subject
line?
```D
void f(T...)(auto ref T args, string file = __FILE__, int line =
__LINE__)
{
writeln(file, ":", line, ": ", args);
}
```
Any ideas how one can achieve what is written in the subject line?
f below does achieve this but I one would expect that it produces
significant template bloat.
g achieves the aim but isn't very elegant.
import std;
void f(string file=__FILE__,size_t line=__LINE__,R...)(R r)
{
On Tue, 10 Mar 2015 01:31:39 -0700, Jonathan M Davis via
Digitalmars-d-learn wrote:
> it's the sort of thing that could easily be decided and then not
> actually happen for ages (e.g. it was decided years ago that delete
> would be deprecated, but it still isn't).
sometimes i'm irritated by this,
On Monday, March 09, 2015 22:29:23 Meta via Digitalmars-d-learn wrote:
> On Monday, 9 March 2015 at 22:00:46 UTC, ketmar wrote:
> > i remember that deprecation was rejected. maybe this is false
> > memory,
> > though.
> >
> > btw, there are legit uses of comma, in c-style `for`, for
> > example. th
On Monday, 9 March 2015 at 22:00:46 UTC, ketmar wrote:
i remember that deprecation was rejected. maybe this is false
memory,
though.
btw, there are legit uses of comma, in c-style `for`, for
example. this
should be left intact, i think (oh, can c-style `for` be
deprecated too?!
).
I think
On Mon, 09 Mar 2015 13:18:58 -0700, Jonathan M Davis via
Digitalmars-d-learn wrote:
> On Monday, March 09, 2015 15:45:58 ketmar via Digitalmars-d-learn wrote:
>> On Mon, 09 Mar 2015 14:48:19 +, John Colvin wrote:
>>
>> > Yet another excellent example of why we should abolish the comma
>> > ope
On Monday, March 09, 2015 15:45:58 ketmar via Digitalmars-d-learn wrote:
> On Mon, 09 Mar 2015 14:48:19 +, John Colvin wrote:
>
> > Yet another excellent example of why we should abolish the comma
> > operator in D.
>
> or at least warn about it. producing a warning for such expression will
> r
On Mon, 09 Mar 2015 14:48:19 +, John Colvin wrote:
> Yet another excellent example of why we should abolish the comma
> operator in D.
or at least warn about it. producing a warning for such expression will
ring a bell in programmers head: "compiler is unhappy. i definitely doing
something
On Monday, 9 March 2015 at 14:42:35 UTC, Adam D. Ruppe wrote:
On Monday, 9 March 2015 at 14:38:41 UTC, Dennis Ritchie wrote:
(1, 2, 3).writeln; // prints 3
that's not an array, use [1,2,3] for that.
What you wrote is a parenthesis expression with comma
expressions inside. The co
On Monday, 9 March 2015 at 14:38:41 UTC, Dennis Ritchie wrote:
Hi.
Why prints only the last element?
import std.stdio;
void main() {
(1, 2, 3).writeln; // prints 3
}
I think this is a misunderstanding about UFCS.
1.writeln(2, 3);
is the same as
writeln(1, 2, 3);
and the same
Hi.
Why prints only the last element?
import std.stdio;
void main() {
(1, 2, 3).writeln; // prints 3
}
On Monday, 9 March 2015 at 14:38:41 UTC, Dennis Ritchie wrote:
(1, 2, 3).writeln; // prints 3
that's not an array, use [1,2,3] for that.
What you wrote is a parenthesis expression with comma expressions
inside. The comma operator is a bit weird: it works like a
semicolon, but in
14 matches
Mail list logo