☰
Debian Codegraph
@
0.0.26.git.2024.10.25.85e1d6c0e8-4
/
/
lang
/
interpret_test
/
TestAstFunc2
/
simple-lambda-args.txtar
☽
☼
lang/interpret_test/TestAstFunc2/simple-lambda-args.txtar
code
plain
raw
GPL-3.0
(C) 2013-2024, James Shubin and the project contributors
debian/copyright
1
-- main.mcl --
2
import "fmt"
3
4
# this should be a function as a value, iow a lambda
5
$square = func($x) {
6
$x * $x
7
}
8
9
$num = 4
10
$out = $square($num)
11
12
test [fmt.printf("%d * %d is %d", $num, $num, $out),] {}
13
-- OUTPUT --
14
Vertex: test[4 * 4 is 16]