Map - OtakoidTony/OtLang GitHub Wiki
<decl_map> ::= "map" <identifier> ":" NEWLINE
"input" ":" NEWLINE
<decl_var>*
"run":
<var> "->" <expr>
"output" ":" NEWLINE
<decl_var>*
map map1:
input:
x:type=int, value=x
run:
x->2x
output:
x:type=int
map map2:
input:
x:type=str, value=x
run:
"Hello World!"->"Nice to meet you!"
not "Hello World!"->"There is no world!"
output:
x:type=str