Var args sort of working, but I feel like all this stuff will need to get yanked out
or tested and refactored
This commit is contained in:
@@ -1,11 +1,26 @@
|
||||
|
||||
VariadicArguments :: (string: *char, args: ..)
|
||||
pass
|
||||
|
||||
AnyArguments :: (values: []Any)
|
||||
for values
|
||||
Assert(it.type == S64)
|
||||
Assert(*(values[0].data->*S64) == 10)
|
||||
Assert(*(values[1].data->*S64) == 20)
|
||||
|
||||
printf :: #foreign (string: *char, args: ..): int
|
||||
|
||||
main :: (): int
|
||||
a := 10
|
||||
b := 20
|
||||
values := []Any{a, b}
|
||||
|
||||
printf("Test %d", {a})
|
||||
|
||||
for values
|
||||
Assert(it.type == S64)
|
||||
AnyArguments({a,b})
|
||||
VariadicArguments("Test", args = {a+b,b})
|
||||
|
||||
Assert(*(values[0].data->*S64) == 10)
|
||||
Assert(*(values[1].data->*S64) == 20)
|
||||
|
||||
Reference in New Issue
Block a user