Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Males, Sebastian
wacc_examples
Commits
f76218fe
Commit
f76218fe
authored
Mar 12, 2021
by
Males, Sebastian
Browse files
Fix compilation errors of lambda valid tests
parent
cd08864c
Changes
3
Hide whitespace changes
Inline
Side-by-side
valid/function/lambdas/callLambdaInALoop.wacc
View file @
f76218fe
# Call lambdas repetitively
#
# Output:
# 0
# 1
# 2
# 3
# 4
#
# Program:
begin
int n = 5
int n = 5
;
int i = 0 ;
while i < n do
println call (\() -> i)() ;
i = i + 1;
done ;
int r = call (\(int i) -> i)(i) ;
println r ;
i = i + 1
done
end
valid/function/lambdas/lambdaInsideFunction.wacc
View file @
f76218fe
...
...
@@ -6,8 +6,9 @@
# Program:
begin
int f(int x, int y) is
return call (\(int x, int y) -> x * y)(x,y)
int r = call (\(int x, int y) -> x * y)(x,y);
return r
end
int y = f(2,3)
int y =
call
f(2,3)
;
print y
end
\ No newline at end of file
valid/function/lambdas/lambdaWithManyArgs.wacc
View file @
f76218fe
...
...
@@ -6,5 +6,6 @@
# Program:
begin
print call (\(int x, int y, bool z, bool a, bool b, string c) -> x + y)(2, 3, false, false, true, "hello")
int r = call (\(int x, int y, bool z, bool a, bool b, string c) -> x + y)(2, 3, false, false, true, "hello");
print r
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment