Files
corelang/lambdas.kl
2022-05-27 15:18:07 +02:00

40 lines
798 B
Plaintext

/*
@todo!!!
I think it might be better to try doing order indepent decls
as well as the tree transformations in the backend code
plus some cleanups before adding more complications to the code
*/
type :: int
if_stmt :: (cond: int): type
CONSTANT :: 10
thing := 10
if i := thing + cond, cond + CONSTANT
return i + CONSTANT
else if cond - CONSTANT
return i - CONSTANT
else
return CONSTANT
add_10 :: (size: int): int
// @todo: before the generation c pass, each stage should have it's own
// tree transformation phase, where it yanks functions etc.
add_20 :: (new_size: int): int
return 20
constant :: 20; result := constant + 10
return result
return_constant :: (): int
constant :: 10
return constant
returning_void :: (insert: int)
return