ELENA-LANG / elena-lang

ELENA is a general-purpose language with late binding. It is multi-paradigm, combining features of functional and object-oriented programming. Rich set of tools are provided to deal with message dispatching : multi-methods, message qualifying, generic message handlers, run-time interfaces
https://elena-lang.github.io/
MIT License
236 stars 26 forks source link

constructor with variadic argument list #505

Closed arakov closed 4 years ago

arakov commented 4 years ago

Currently constructors with variadic arguments cannot be invoked indirectly:

public Group
{
    constructor load(params object[] objects)
    {
    }
}

public program()
{
    var g := Group;

    g.load(1,2) // MethodNotFoundException is raised
}
arakov commented 4 years ago

One possible solution is to generate a handler for all possible arguments lists - e.g. load[1], load[2], load[3], ...

Alternatively - custom dispatcher

arakov commented 4 years ago

done