How to access a map from a vararg list.
If the function does process the TypeInfo array and gets an argument
with TypeInfo_AssociativeArray, I don't see a way to access the map
content without writing code, that has knowledge of the internal map
storage. I need to understand how the runtime for AA is implemented, to
access the content.
I used this way ...
1. cast the vararg pointer to some kind of map, e.g. ubyte[ubyte]
2. foreach over the map with inout value
3. get the address of the value => p.
4. It is know, that the key follows the value: p - "used key size" get
the key address
5. Get the value address with adding the size of key from the TypeInfo
Is there a better way? (more portable and less pointer arithmethic)

How to access a map from a vararg list.
If the function does process the TypeInfo array and gets an argument
with TypeInfo_AssociativeArray, I don't see a way to access the map
content without writing code, that has knowledge of the internal map
storage. I need to understand how the runtime for AA is implemented, to
access the content.
I used this way ...
1. cast the vararg pointer to some kind of map, e.g. ubyte[ubyte]
2. foreach over the map with inout value
3. get the address of the value => p.
4. It is know, that the key follows the value: p - "used key size" get
the key address
5. Get the value address with adding the size of key from the TypeInfo
Is there a better way? (more portable and less pointer arithmethic)

Is this a feature missing from the D language?
Better access to variadic stuff.

Runtime variadics are really kind of hacky in just about any systems
programming language. You'll notice that most scripting languages and VM'ed
languages (Python, Ruby?, Java, .Net) pass instead an array of Object, since
Object can hold anything.
Runtime variadics are also slow and possibly unsafe, since you have to do
all your typechecking and dispatch at runtime, and if you don't do it right,
you could end up with a malfunctioning function (or at the very least, one
that doesn't follow i.e. the same conversion rules as the language).
A very nice alternative to runtime variadics is to use a variadic template
function. This gives you a list of the argument types at compile time,
giving you the opportunity to write much more efficient code, at the expense
of code bloat, since you technically now have a different overload of the
function for every different list of parameter types. Templated functions
also can't be virtual.
A nice alternative would be, once D2 gets opImplicitCastFrom (is that what
it's called?) implemented, to have a Variant type and use a variadic array
of those:
void func(Variant[] args...)
{
foreach(arg; args)
{
// if it's an int, do something...
}
}
// implicitly constructs a Variant struct out of each param
func(3, "hi", new Object());
Then you get virtualizability, ease of calling, no code bloat, and even
though you still have to determine types at runtime, it'll likely be a lot
more straightforward as a variant type will probably have methods to check
if it can be cast to certain types, etc.