s |
focus search bar ( enter to select, ▲ / ▼ to change selection) |
g e |
go to examples |
g m |
go to modules |
g o |
go to overview |
g r |
go to reference |
h |
toggle this help ( esc also exits) |
Functions in Jai may return multiple values, and multiple variables may be assigned the result of a function. 1
foo :: () -> int, int {
return 3, 5;
}
x : int;
y : int;
x, y = foo();
printf("x is %d; y is %d.\n", x, y);
here’s what multiple return values are like. I’ve got some function foo :: () -> int, int
. It takes no arguments, and it returns, instead of one int, it returns two ints. It returns int, int
, and I’m going to return 3, 5;
. I’ve got an int x
and an int y
, and you can take both values by just saying x,y = foo();
.
“Arguments and Return Values” YouTube, uploaded by Jonathan Blow, Mar 10, 2015, https://youtu.be/CttIYXCUeVY?t=1539 ⮌
jailang
2019 pixeldroid
https://github.com/pixeldroid/jailang |
programming pages theme v0.5.21 (https://github.com/pixeldroid/programming-pages) |
s |
focus search bar ( enter to select, ▲ / ▼ to change selection) |
g e |
go to examples |
g m |
go to modules |
g o |
go to overview |
g r |
go to reference |
h |
toggle this help ( esc also exits) |