Data update

This commit is contained in:
Ingy döt Net 2025-02-27 18:35:13 -05:00
parent 8e4e15fa56
commit 72eb4943cb
1853 changed files with 35514 additions and 9441 deletions

View file

@ -1,6 +1,6 @@
fun showVariable = <text variable|writeLine(variable + ": '" + Runtime.get(variable) + "'")
fun showVariable ← <text variable|writeLine(variable, ": '", Runtime.get(variable), "'")
showVariable("SystemDrive")
showVariable("USERNAME")
# we can get the environment variables as a map
Map variables = Runtime.variables()
Map variables Runtime.variables()
writeLine(variables["TEMP"])

View file

@ -1,6 +0,0 @@
/* Environment_variables.wren */
class Environ {
foreign static variable(name)
}
System.print(Environ.variable("SHELL"))

View file

@ -1,25 +0,0 @@
/* Environment_variables.go */
package main
import (
wren "github.com/crazyinfin8/WrenGo"
"os"
)
type any = interface{}
func getEnvironVariable(vm *wren.VM, parameters []any) (any, error) {
name := parameters[1].(string)
return os.Getenv(name), nil
}
func main() {
vm := wren.NewVM()
fileName := "Environment_variables.wren"
methodMap := wren.MethodMap{"static variable(_)": getEnvironVariable}
classMap := wren.ClassMap{"Environ": wren.NewClass(nil, nil, methodMap)}
module := wren.NewModule(classMap)
vm.SetModule(fileName, module)
vm.InterpretFile(fileName)
vm.Free()
}

View file

@ -0,0 +1,3 @@
import "os" for Environ
System.print(Environ.get("SHELL"))