ZenScript main repository
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

functions2.zs 486B

12345678910111213141516171819
  1. val outOfScope = 10;
  2. val fun = (a as int, b as int) as int => a + b * outOfScope;
  3. println(fun(30, 20));
  4. function apply_fn2(fn as function(value as int, othervalue as int) as int, value as int) as int {
  5. return fn(value, value);
  6. }
  7. //function scale(value as int, scale as int) as int {
  8. // val fun as function(value as int, othervalue as int) as int = ((v as int) as int => v * scale);
  9. // return apply(fun, scale);
  10. //}
  11. apply_fn2(fun, 10);
  12. //println("Value: " + scale(10, 5));