Re: Why does stringof not like functions with arguments?

2020-07-31 Thread Chad Joan via Digitalmars-d-learn
On Thursday, 10 August 2017 at 14:51:22 UTC, Meta wrote: On Wednesday, 9 August 2017 at 01:39:07 UTC, Jason Brady wrote: Why does the following code error out with: app.d(12,10): Error: function app.FunctionWithArguments (uint i) is not callable using argument types () Code: import

Re: Why does stringof not like functions with arguments?

2017-08-10 Thread Meta via Digitalmars-d-learn
On Thursday, 10 August 2017 at 15:55:41 UTC, Jason Brady wrote: Wow. That makes perfect sense. I forgot stringof works only with expressions It works with symbols too. See the following: template test(){} pragma(msg, test.stringof);

Re: Why does stringof not like functions with arguments?

2017-08-10 Thread Jason Brady via Digitalmars-d-learn
On Thursday, 10 August 2017 at 14:51:22 UTC, Meta wrote: Welcome to optional parentheses hell. Please enjoy your stay. Because function calls in D can optionally omit the parens, `FunctionWithArguments.stringof` is actually attempting to call `FunctionWithArguments` without any arguments,

Re: Why does stringof not like functions with arguments?

2017-08-10 Thread Meta via Digitalmars-d-learn
On Wednesday, 9 August 2017 at 01:39:07 UTC, Jason Brady wrote: Why does the following code error out with: app.d(12,10): Error: function app.FunctionWithArguments (uint i) is not callable using argument types () Code: import std.stdio; void FunctionWithoutArguments() { } void

Re: Why does stringof not like functions with arguments?

2017-08-09 Thread Biotronic via Digitalmars-d-learn
On Wednesday, 9 August 2017 at 01:39:07 UTC, Jason Brady wrote: Why does the following code error out with: app.d(12,10): Error: function app.FunctionWithArguments (uint i) is not callable using argument types () Like Olivier said, stringof expects a valid expression. There are a few other

Re: Why does stringof not like functions with arguments?

2017-08-09 Thread Olivier FAURE via Digitalmars-d-learn
On Wednesday, 9 August 2017 at 01:39:07 UTC, Jason Brady wrote: Why does the following code error out with: app.d(12,10): Error: function app.FunctionWithArguments (uint i) is not callable using argument types () Code: import std.stdio; void FunctionWithoutArguments() { } void