Compile-time reflection
Kirk McDonald
kirklin.mcdonald at gmail.com
Mon Jul 2 17:32:18 PDT 2007
BCS wrote:
> Reply to Kirk,
>
>> void foo() {}
>> void foo(int i) {}
>> void foo(int i, int j, int k=20) {}
>> The first thing a compile-time reflection mechanism needs is a way to,
>> given a symbol, derive a tuple of the signatures of the function
>> overloads.
>
> [...]
>
>>
>> foo.tupleof => Tuple!(void function(), void function(int), void
>> function(int, int, int))
>>
>
> Why have this give a type tuple? I'd have it give alias to the overloads
> them selves.
>
>
Aliases operate on symbols. All of those functions have the same symbol.
An alias to a specific overload is nonsensical.
--
Kirk McDonald
http://kirkmcdonald.blogspot.com
Pyd: Connecting D and Python
http://pyd.dsource.org
More information about the Digitalmars-d
mailing list