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

Multi-value return #508

Closed arakov closed 1 year ago

arakov commented 4 years ago

The language should support multi-value return, Tuple<T1,...> template should be used. Something like this

singleton Helper
{
       int, string getPair()
             = (1, "abc");   
}
arakov commented 1 year ago

The following code demonstrates the multi assign:

public program()
{
    var t := (1,"abc");

    console.printLine("Item1=",t.Item1,", Item2=", t.Item2);

    var a;
    var b;

    a,b := t;
    console.printLine("a=",a,", b=", t.Item2);
}
arakov commented 1 year ago

The issue is done in 6.0.3 version