result / optional return type modifiers for functions (one for all returns)

This commit is contained in:
ProgramSnail 2023-07-29 14:48:45 +03:00
parent 68463509d8
commit 195a26f9b7
10 changed files with 74 additions and 36 deletions

View file

@ -215,5 +215,9 @@ parse_number : Unit! = {
bring ();
}
: example of or_in and or_out usage for template operators
( & ) |-> 'a |-> 'b <-| 'x <-| 'y = (|-> 'a := <-| 'x) && (|-> 'b := <-| 'y);
: example of or_in and or_out usage for template operators (tuple input and tuple output)
( & ) |-> 'a |-> 'b <-| 'x <-| 'y = ('a := 'x) && ('b := 'y);
: function, that return result ('!' not used on calls)
: useful when tuples returned
result_func! 'a 'b -> 'c -> 'd = ?? 'a == 0 => error "some error" !!=> ('c := 'a, 'd := 'b, ());