lang: funcs: Add math pow function and a few examples
Just a few small things I think should be committed.
This commit is contained in:
10
examples/lang/env1.mcl
Normal file
10
examples/lang/env1.mcl
Normal file
@@ -0,0 +1,10 @@
|
||||
$env = env()
|
||||
$m = maplookup($env, "GOPATH", "")
|
||||
|
||||
print "print0" {
|
||||
msg => if hasenv("GOPATH") {
|
||||
printf("GOPATH is: %s", $m)
|
||||
} else {
|
||||
"GOPATH is missing!"
|
||||
},
|
||||
}
|
||||
3
examples/lang/math2.mcl
Normal file
3
examples/lang/math2.mcl
Normal file
@@ -0,0 +1,3 @@
|
||||
print "print0" {
|
||||
msg => printf("13.0 ^ 4.2 is: %f", pow(13.0, 4.2)),
|
||||
}
|
||||
3
examples/lang/pkg1.mcl
Normal file
3
examples/lang/pkg1.mcl
Normal file
@@ -0,0 +1,3 @@
|
||||
pkg "cowsay" {
|
||||
state => "installed",
|
||||
}
|
||||
Reference in New Issue
Block a user