Comments
This commit is contained in:
@@ -509,6 +509,12 @@ struct Ast_For : Ast {
|
|||||||
|
|
||||||
struct Ast_Lambda : Ast_Expr {
|
struct Ast_Lambda : Ast_Expr {
|
||||||
Array<Ast_Decl *> args;
|
Array<Ast_Decl *> args;
|
||||||
|
|
||||||
|
// :Multiple arguments
|
||||||
|
// @todo: maybe disallow multiple arguments in current form
|
||||||
|
// and use polimorphism. Then we could make var unpacking,
|
||||||
|
// unpack structs making it more powerful
|
||||||
|
|
||||||
// @cleanup @refactor: return value shouldn't be a array of expressions.
|
// @cleanup @refactor: return value shouldn't be a array of expressions.
|
||||||
// It should be a single expression. So probably need a special type
|
// It should be a single expression. So probably need a special type
|
||||||
// for that.
|
// for that.
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ Array :: struct($T: Type)
|
|||||||
len: int
|
len: int
|
||||||
cap: int
|
cap: int
|
||||||
|
|
||||||
|
Tuple :: struct($A: Type, $B: Type)
|
||||||
|
a: A
|
||||||
|
b: B
|
||||||
|
|
||||||
make_array :: (a: *int, count: int): Array(int)
|
make_array :: (a: *int, count: int): Array(int)
|
||||||
result := Array(int) {
|
result := Array(int) {
|
||||||
data = a,
|
data = a,
|
||||||
@@ -31,6 +35,12 @@ make_array :: (a: *int, count: int): Array(int)
|
|||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
// :Multiple arguments
|
||||||
|
// @todo: maybe disallow multiple arguments in current form
|
||||||
|
// and use polimorphism. Then we could make var unpacking,
|
||||||
|
// unpack structs making it more powerful
|
||||||
|
multiple_args :: (): Tuple(int, F32)
|
||||||
|
return {32, 32}
|
||||||
|
|
||||||
main :: (argc: int, argv: **char): int
|
main :: (argc: int, argv: **char): int
|
||||||
buff: *int
|
buff: *int
|
||||||
@@ -40,4 +50,6 @@ main :: (argc: int, argv: **char): int
|
|||||||
fourth: Array(F32)
|
fourth: Array(F32)
|
||||||
fifth: Array(F32)
|
fifth: Array(F32)
|
||||||
|
|
||||||
|
a,b := multiple_args()
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
Reference in New Issue
Block a user