Hi.

It seems like what you want is what in other languages would be called a
delegate or closure (function signature). This is not entirely possible in
AS3, end even what is possible requires to much work to be really useful.
So, please vote:
http://bugs.adobe.com/jira/browse/ASL-32
:)
However, maybe in your situation, I'd go for a single dictionary, like this:

*pseudocode *

Dictionary<Function, ArrayList<Type>> d = new Dictionary<Function,
ArrayList<Type>>();
d.Add( foo, [String, Integer]); // foo is a function reference

Or, in AS3 terms:

var d : Dictionary = new Dictionary();

function foo( a : String, b : int ) : void
{
    trace( a, b );
}

d[foo] = new <Class>[String, int];

This would be the easiest way to "remember" what function parameters type
was and select the proper function based on that.

Best.

Oleg

Reply via email to