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:
James Shubin
2018-02-25 19:09:21 -05:00
parent 6370f0cb95
commit df1e50e599
8 changed files with 98 additions and 29 deletions

10
examples/lang/env1.mcl Normal file
View 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
View 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
View File

@@ -0,0 +1,3 @@
pkg "cowsay" {
state => "installed",
}