http://d.puremagic.com/issues/show_bug.cgi?id=8106
--- Comment #17 from Manu turkey...@gmail.com 2012-06-26 01:06:12 PDT ---
(In reply to comment #15)
2. adding a parameters to traits, so that:
__traits(parameters, foo)
returns a tuple that includes types, identifiers, and default
http://d.puremagic.com/issues/show_bug.cgi?id=8106
--- Comment #15 from Walter Bright bugzi...@digitalmars.com 2012-06-25
19:32:45 PDT ---
How about:
1. reverting the
is(typeof(foo) P == function)
to the old 2.059 behavior of being a type tuple only.
2. adding a parameters to traits,
http://d.puremagic.com/issues/show_bug.cgi?id=8106
--- Comment #11 from Manu turkey...@gmail.com 2012-06-14 01:26:44 PDT ---
(In reply to comment #7)
Suppose I made this work:
-
template ParameterTypeTuple(alias foo)
I.e. the default argument is propagated to the
http://d.puremagic.com/issues/show_bug.cgi?id=8106
--- Comment #12 from Walter Bright bugzi...@digitalmars.com 2012-06-14
07:14:50 PDT ---
(In reply to comment #11)
(In reply to comment #7)
I.e. the default argument is propagated to the tuple. Will that work for
you?
That would be
http://d.puremagic.com/issues/show_bug.cgi?id=8106
--- Comment #13 from Manu turkey...@gmail.com 2012-06-14 08:03:11 PDT ---
(In reply to comment #12)
(In reply to comment #11)
(In reply to comment #7)
pragma(msg, typeof(bar));
pragma(msg, PT[1]);
It's not clear to me what those
http://d.puremagic.com/issues/show_bug.cgi?id=8106
--- Comment #4 from Walter Bright bugzi...@digitalmars.com 2012-06-13
14:55:42 PDT ---
I have a patch for this specific case, but it's a kludge, not a general
solution.
The problem is that the context of the typeof(x) is not the context of
http://d.puremagic.com/issues/show_bug.cgi?id=8106
--- Comment #5 from Manu turkey...@gmail.com 2012-06-13 15:50:11 PDT ---
(In reply to comment #4)
Can you post an example of why you need this? Perhaps there's another way.
It's difficult for me to extract a concrete example (a very large
http://d.puremagic.com/issues/show_bug.cgi?id=8106
--- Comment #6 from Walter Bright bugzi...@digitalmars.com 2012-06-13
20:05:42 PDT ---
Ok, I suggest abandoning this .stringof proposal as unworkable. Instead, how
about a traits that gives the default arguments as an expression tuple?
Also,
http://d.puremagic.com/issues/show_bug.cgi?id=8106
--- Comment #7 from Walter Bright bugzi...@digitalmars.com 2012-06-13
20:50:27 PDT ---
Suppose I made this work:
-
template ParameterTypeTuple(alias foo)
{
static if (is(typeof(foo) P == function))
alias P
http://d.puremagic.com/issues/show_bug.cgi?id=8106
--- Comment #8 from Walter Bright bugzi...@digitalmars.com 2012-06-13
22:23:21 PDT ---
Note that the default argument can be retrieved using something like:
PT[1] getDefault(PT a) { return a[1]; }
--
Configure issuemail:
http://d.puremagic.com/issues/show_bug.cgi?id=8106
--- Comment #9 from Walter Bright bugzi...@digitalmars.com 2012-06-13
22:35:21 PDT ---
Or better:
PT[1] getDefault(PT[1..2] a) { return a[0]; }
An example:
-
import std.stdio;
template ParameterTypeTuple(alias foo)
{
http://d.puremagic.com/issues/show_bug.cgi?id=8106
Walter Bright bugzi...@digitalmars.com changed:
What|Removed |Added
Status|NEW |RESOLVED
http://d.puremagic.com/issues/show_bug.cgi?id=8106
Walter Bright bugzi...@digitalmars.com changed:
What|Removed |Added
CC|
http://d.puremagic.com/issues/show_bug.cgi?id=8106
--- Comment #3 from Manu turkey...@gmail.com 2012-06-12 17:24:20 PDT ---
(In reply to comment #2)
Can you please verify the behavior you are seeing?
Sorry, that should have a typeof():
pragma(msg, typeof(func).stringof);
- void(Colour c =
http://d.puremagic.com/issues/show_bug.cgi?id=8106
Manu turkey...@gmail.com changed:
What|Removed |Added
Severity|normal |major
--- Comment #1 from
15 matches
Mail list logo