Compiler: Added dispatcher for variant functions. (EXPERIMENTAL!) This is the first attempt at a generic dispatcher for variant functions. It seems to work for the trivial cases: | Pike v7.9 release 5 running Hilfe v3.5 (Incremental Pike Frontend) | > class foo { | >> variant int bar(int a) { return a*2; } | >> variant string bar(string s) { return "FOO" + s + "FOO"; } | >> variant string bar() { return "FOO"; } | >> } | > typeof(foo()->bar); | (1) Result: function( : string) | function(int : int) | function(string : string) | > foo()->bar(17); | (2) Result: 34 | > foo()->bar("BAR"); | (3) Result: "FOOBARFOO" | > foo()->bar(); | (4) Result: "FOO" | > foo()->bar(1.2); | Compiler Error: 1: Bad argument 1 to bar. | Compiler Error: 1: Expected: string | int. | Compiler Error: 1: Got : float. | > foo()->bar((mixed)1.2); | Invalid arguments to bar()! | HilfeInput:1: HilfeInput()->foo()->bar(1.2) | HilfeInput:1: HilfeInput()->___HilfeWrapper() Note that it is probably broken for more complicated cases. Such cases include when the variants have differing modifiers (including when one of the variants lack the variant modifier).