Search Results for: Prints
it a name with def: def cube (x) { return x^3 } following the function name is its prototype, which lists the names of the function's parameters. the parameter values are filled in by the arguments passed by the function's caller. def is_pythagorean_triple (a, b, c) { return a^2 + b^2 == c^2 } # prints
is_pythagorean_triple( 3, 4, 5 ) you can return a function from another function: def get_handler (c) { def add (a, b) { return a + b } def sub (a, b) { return a - b } def mul (a, b) { return a * b } def div (a, b) { return a / b } const ops = byte^ [ '+': add, '-': sub, '*': mul, '/': div, ] return ops[ c ] } # prints...
http://www.vcode.org/
it a name with def: def cube (x) { return x^3 } following the function name is its prototype, which lists the names of the function's parameters. the parameter values are filled in by the arguments passed by the function's caller. def is_pythagorean_triple (a, b, c) { return a^2 + b^2 == c^2 } # prints
is_pythagorean_triple( 3, 4, 5 ) you can return a function from another function: def get_handler (c) { def add (a, b) { return a + b } def sub (a, b) { return a - b } def mul (a, b) { return a * b } def div (a, b) { return a / b } const ops = byte^ [ '+': add, '-': sub, '*': mul, '/': div, ] return ops[ c ] } # prints...
https://www.vcode.org/