Syntax test 1 func add_numbers Int a Int b Int return code ... func multi_return Int a Int b [Int String] return Syntax test 2 func add_numbers Int a Int b return Int code ... func multi_return Int a Int b return [Int String] Syntax test 3 func Int add_numbers Int a Int b code ... func [Int String] multi_return Int a Int b - Avoids possibly confusing "return" keyword in definition - Similar to how other languages do it - Similar to the syntax at the call-site - Grepping for functions becomes slightly harder but still easy: grep -E '^func.* add_numbers$' - Possibly harder to visually scan the source code. - Type inferrence: - Type-inferred functions do not specify the returns - No distinction between type-inferred 0-return and 0-arg 0-return funcs. - The `code` keyword is still required for type-inferred functions - Could have an explicit "void" keyword: `void`, `[]`, ... - Or could do it similar to Pascal with `func` and `proc`. - Or the Ada way and have mutation = no return. - No obvious way to document the return value. But it could be solve with the following convention. And in simple cases, only a "Returns ..." line might be needed. func [Int String] multi_return # Converts the arguments to .... # # Returns the ... Int a # ... Int b # ... Syntax test 4: func Int add_numbers Int a Int b code ... Syntax test 5: func Int add_numbers | Int a | Int b code ... Syntax test 6: func add_numbers param Int a param Int b return Int code ... Possible short syntax with type-inference (not for cross-module use): func add_numbers a b -> sum code ... func multi_return a b -> num str code ... Sections or goto or something else? ----------------------------------- Sections: func f Int x Int y code ... goto work section work ... section end ... Goto (how can it work without `end`?) func f Int x Int y code ... for a in arr if x == 0 if a == y goto t ... target t Goto syntax 1: if a == y goto t ... target t Goto syntax 2: if a == y goto t ... --->t Flow-goto syntax 1: block if a == y goto t ... section t ... Allow `section` in all block statements? Disallow it at the top level? Should goto into a block be allowed? goto inside ... block section inside ...