Multiple return values

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);

  1. 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, 

jailang 2019 pixeldroid
programming pages theme v0.5.21 (