On Thursday, 19 November 2020 at 14:34:38 UTC, Adam D. Ruppe
wrote:
On Thursday, 19 November 2020 at 00:20:50 UTC, Dibyendu
Majumdar wrote:
Okay thanks. Bad idea IMO.
That's kinda how I see C taking the address of various things
implicitly.
To be honest it seems irrelevant what C does.
On Thursday, 19 November 2020 at 14:34:38 UTC, Adam D. Ruppe
wrote:
On Thursday, 19 November 2020 at 00:20:50 UTC, Dibyendu
Majumdar wrote:
Okay thanks. Bad idea IMO.
That's kinda how I see C taking the address of various things
implicitly.
good example
On Thursday, 19 November 2020 at 00:20:50 UTC, Dibyendu Majumdar
wrote:
Okay thanks. Bad idea IMO.
That's kinda how I see C taking the address of various things
implicitly.
On Thursday, 19 November 2020 at 00:07:12 UTC, Dibyendu Majumdar
wrote:
I have simple test program:
import core.stdc.stdio : printf;
void test() {
int* a;
printf("a == null %d\n", a == null);
}
int function() fp = test;
extern (C) void main() {
fp();
}
Why do I get:
\d\dmd-2.092
On Thursday, 19 November 2020 at 09:23:25 UTC, Jacob Carlborg
wrote:
Yes, calling `writeln` like that is a bad idea. That was a bad
example.
But the actual reason is, this is how D implements properties
[1]. Any function that doesn't take an argument can be called
without parentheses. Any fun
On Thursday, 19 November 2020 at 01:42:16 UTC, Mike Parker wrote:
On Thursday, 19 November 2020 at 00:20:50 UTC, Dibyendu
Majumdar wrote:
On Thursday, 19 November 2020 at 00:18:54 UTC, rikki
cattermole wrote:
You don't need the brackets to call a function (and with a
little help from UFCS):
On Thursday, 19 November 2020 at 00:20:50 UTC, Dibyendu Majumdar
wrote:
On Thursday, 19 November 2020 at 00:18:54 UTC, rikki cattermole
You don't need the brackets to call a function (and with a
little help from UFCS):
void main() {
import std.stdio;
"Hello!".writeln
On Thursday, 19 November 2020 at 00:20:50 UTC, Dibyendu Majumdar
wrote:
On Thursday, 19 November 2020 at 00:18:54 UTC, rikki cattermole
wrote:
You don't need the brackets to call a function (and with a
little help from UFCS):
void main() {
import std.stdio;
"Hello!
On Thursday, 19 November 2020 at 00:18:54 UTC, rikki cattermole
wrote:
You don't need the brackets to call a function (and with a
little help from UFCS):
void main() {
import std.stdio;
"Hello!".writeln;
writeln;
}
Okay thanks. Bad idea IMO.
On 19/11/2020 1:11 PM, Dibyendu Majumdar wrote:
On Thursday, 19 November 2020 at 00:08:59 UTC, Adam D. Ruppe wrote:
On Thursday, 19 November 2020 at 00:07:12 UTC, Dibyendu Majumdar wrote:
int function() fp = test;
This tries to *call* the function test and assign its return value to fp.
Re
On Thursday, 19 November 2020 at 00:08:59 UTC, Adam D. Ruppe
wrote:
On Thursday, 19 November 2020 at 00:07:12 UTC, Dibyendu
Majumdar wrote:
int function() fp = test;
You want &test to get the address.
Okay that works. Thanks
On Thursday, 19 November 2020 at 00:08:59 UTC, Adam D. Ruppe
wrote:
On Thursday, 19 November 2020 at 00:07:12 UTC, Dibyendu
Majumdar wrote:
int function() fp = test;
This tries to *call* the function test and assign its return
value to fp.
Really? why does it do that?
You want &test to
On Thursday, 19 November 2020 at 00:07:12 UTC, Dibyendu Majumdar
wrote:
int function() fp = test;
This tries to *call* the function test and assign its return
value to fp.
You want &test to get the address.
I have simple test program:
import core.stdc.stdio : printf;
void test() {
int* a;
printf("a == null %d\n", a == null);
}
int function() fp = test;
extern (C) void main() {
fp();
}
Why do I get:
\d\dmd-2.092.1\windows\bin64\dmd.exe -betterC tests.d
tests.d(5): Error: printf canno
14 matches
Mail list logo