Data update
This commit is contained in:
parent
8e4e15fa56
commit
72eb4943cb
1853 changed files with 35514 additions and 9441 deletions
|
|
@ -1,6 +0,0 @@
|
|||
/* Hostname.wren */
|
||||
class Host {
|
||||
foreign static name() // the code for this is provided by Go
|
||||
}
|
||||
|
||||
System.print(Host.name())
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
/* Hostname.go */
|
||||
package main
|
||||
|
||||
import (
|
||||
wren "github.com/crazyinfin8/WrenGo"
|
||||
"os"
|
||||
)
|
||||
|
||||
type any = interface{}
|
||||
|
||||
func hostname(vm *wren.VM, parameters []any) (any, error) {
|
||||
name, _ := os.Hostname()
|
||||
return name, nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
vm := wren.NewVM()
|
||||
fileName := "Hostname.wren"
|
||||
methodMap := wren.MethodMap{"static name()": hostname}
|
||||
classMap := wren.ClassMap{"Host": wren.NewClass(nil, nil, methodMap)}
|
||||
module := wren.NewModule(classMap)
|
||||
vm.SetModule(fileName, module)
|
||||
vm.InterpretFile(fileName)
|
||||
vm.Free()
|
||||
}
|
||||
3
Task/Hostname/Wren/hostname.wren
Normal file
3
Task/Hostname/Wren/hostname.wren
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import "os" for Platform
|
||||
|
||||
System.print(Platform.hostName)
|
||||
Loading…
Add table
Add a link
Reference in a new issue