From d6233646bdfc0119ce528c206dbacc69ef28942e Mon Sep 17 00:00:00 2001 From: Alexander M Pickering Date: Sat, 21 Dec 2024 14:02:14 -0600 Subject: Update moonscript example --- html/index.html | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/html/index.html b/html/index.html index 53a724c..48c86bf 100644 --- a/html/index.html +++ b/html/index.html @@ -63,7 +63,7 @@ os.execute("notepad.exe " .. note_filename)
$ lua note.lua my first note
-

Run lua --help for more options for the command line tool, and the Lua Manual for extensive documentation of the Lua programming language. Also note LuaJIT's extensions

+

Run lua --help for more options for the command line tool, and see the Lua Manual for extensive documentation of the Lua programming language and standard libraries. Also note LuaJIT's extensions

Installing Superpowers

@@ -103,15 +103,20 @@ print(green .. "> implying you need modules")
$ luarocks install moonscript
-
class World
-  greet: => print("Hello, world!")
+
class Person
+	name: "Alex"
+	greet: => print("Hello, " .. @name)
+
+class World extends Person
+	name: "World"
 
 with World!
-  \greet!
+ \greet! +
$ moon example.moon
-Hello, world!
+Hello, World!

@@ -126,8 +131,7 @@ Hello, world!
$ luarocks install tl
-

-local function keys<K,V>(xs: {K:V}):{K}
+					
local function keys<K,V>(xs: {K:V}):{K}
   local ks = {}
   for k, _ in pairs(xs) do
     table.insert(ks, k)
-- 
cgit v1.2.3-55-g6feb