On Monday, 1 April 2024 at 18:28:16 UTC, Nick Treleaven wrote:
On Sunday, 31 March 2024 at 23:05:44 UTC, Carl Sturtivant wrote:
Yes, it's not possible to instantiate a function type.
But with extern it seems the semantics is fine as a function
is not being instantiated. It is merely
On Sunday, 31 March 2024 at 23:05:44 UTC, Carl Sturtivant wrote:
Yes, it's not possible to instantiate a function type.
But with extern it seems the semantics is fine as a function is
not being instantiated. It is merely associating a name with a
type: in what sense is this instantiation in
On Sunday, 31 March 2024 at 11:35:39 UTC, Nick Treleaven wrote:
If a function type does include identifiers, then would two
function types with the same argument types but different
identifiers compare equal using `is`?
Yes. That is the idea. Define `is` to work this way.
Yes, it's not
On Saturday, 30 March 2024 at 22:37:53 UTC, Carl Sturtivant wrote:
I'm inclined to a view that keeps more "it just works" options
open. Regard the parameter names as a part of the type (which I
am very grateful for them being currently) and just regard part
of the definition of "type equality"
On Saturday, 30 March 2024 at 22:37:53 UTC, Carl Sturtivant wrote:
Incidentally, I tried
```D
extern typeof(foo) func;
```
to say that func was an actual function (`extern` so defined
elsewhere) whose type was the type of the function `int foo(int
num, string name, int);` so I can then use
On Saturday, 30 March 2024 at 21:07:35 UTC, Nick Treleaven wrote:
Although `.stringof` on a function type does include the
parameter names, the names are not really part of the type -
see:
https://github.com/dlang/phobos/pull/3620#issuecomment-288469685
Perhaps `ParameterIdentifierTuple`
On Saturday, 30 March 2024 at 21:51:34 UTC, Nick Treleaven wrote:
On Saturday, 30 March 2024 at 21:45:34 UTC, Nick Treleaven
wrote:
On Saturday, 30 March 2024 at 21:25:45 UTC, Carl Sturtivant
wrote:
OK, so how can I get them? Am I forced to take that string
and parse it with CTFE?
Lookup the
On Saturday, 30 March 2024 at 21:45:34 UTC, Nick Treleaven wrote:
On Saturday, 30 March 2024 at 21:25:45 UTC, Carl Sturtivant
wrote:
OK, so how can I get them? Am I forced to take that string and
parse it with CTFE?
Lookup the source of ParameterIdentifierTuple and change
On Saturday, 30 March 2024 at 21:25:45 UTC, Carl Sturtivant wrote:
OK, so how can I get them? Am I forced to take that string and
parse it with CTFE?
Lookup the source of ParameterIdentifierTuple and change
`FunctionTypeOf!func` to just `func` inside the first `static if`.
On Saturday, 30 March 2024 at 21:07:35 UTC, Nick Treleaven wrote:
On Saturday, 30 March 2024 at 19:23:07 UTC, Carl Sturtivant
wrote:
$ dmd -c bug1.d
int(int num, string name, int)
["", "", ""]
bug1.d(9): Error: static assert: "wrong!"
```
Please explain. How do I get the names of the
On Saturday, 30 March 2024 at 19:23:07 UTC, Carl Sturtivant wrote:
$ dmd -c bug1.d
int(int num, string name, int)
["", "", ""]
bug1.d(9): Error: static assert: "wrong!"
```
Please explain. How do I get the names of the identifiers out
of a parameter list at compile time reliably?
Although
11 matches
Mail list logo