Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
16
Task/Call-a-function/Ecstasy/call-a-function-7.ecstasy
Normal file
16
Task/Call-a-function/Ecstasy/call-a-function-7.ecstasy
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
module ObtainReturnValues {
|
||||
(Int, String, Dec) foo() {
|
||||
return 3, "hello!", 9.87;
|
||||
}
|
||||
|
||||
void run() {
|
||||
foo(); // ignore return values
|
||||
Int i1 = foo(); // only use first returned value
|
||||
(Int i2, String s2) = foo(); // only use first two returned values
|
||||
(Int i3, String s3, Dec d3) = foo(); // use all returned values
|
||||
Tuple<Int, String, Dec> t = foo(); // alternatively, get the tuple instead
|
||||
|
||||
@Inject Console console;
|
||||
console.print($"{i3=}, {s3=}, {d3=}, {t=}");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue