feat: add example demonstrating module import with Cthulu and Lovecraft classes
Add two new Wren source files under example/import-module/ showing how to import and use a module. The cthulu.wren file defines a Cthulu class with a message method returning a Lovecraftian phrase, while lovecraft.wren imports the Cthulu class, instantiates it, and prints the message via IO.print.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
class Cthulu {
|
||||
message {
|
||||
return "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user