mirror of
https://codeberg.org/ProgramSnail/lang.git
synced 2025-12-05 22:48:43 +00:00
result / optional return type modifiers for functions (one for all returns)
This commit is contained in:
parent
68463509d8
commit
195a26f9b7
10 changed files with 74 additions and 36 deletions
|
|
@ -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, ());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue