You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Blocks will take parameters, for example by specifying them using with before them.
For example now a factorial would look like this:
fn factorial(x: i32)
{
var result: i32 = 1;
var i = x;
{
if i == 0
goto return;
result = result * i;
i = i - 1
loop;
}
return: result
}
When loop takes parameters, it could look like this:
fn factorial(x: i32)
{
with result: i32 = 1, i = x;
{
if i == 0
goto return;
loop result * i, i - 1;
}
return: result
}
(I don't think, these with-parameters should be exposed after the loop, but if return parameters are not exposed, but then we would need other features like #3 to make it useful)
The text was updated successfully, but these errors were encountered:
Blocks will take parameters, for example by specifying them using
with
before them.For example now a factorial would look like this:
When
loop
takes parameters, it could look like this:(I don't think, these
with
-parameters should be exposed after the loop, but ifreturn
parameters are not exposed, but then we would need other features like #3 to make it useful)The text was updated successfully, but these errors were encountered: