Skip to content

[#38] Make possible to return value and tuple of values Indigo statements

Ilya Peresadin requested to merge pva/statements-return-vals into master

Problem: we can't return values from statements in Indigo as it's possible in functional languages. This is not so easy, as it may seem. For instance, if you return expression which refers to an variable (or variable itself), which has been created in a statement scope, it may cause possible error because a variable won't exist after the scope is left.

Solution: implement inspection of returning values, and compute an expressions on the top of the stack before leave a statement scope.

Edited by Ilya Peresadin

Merge request reports