diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-01-10 16:33:37 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-01-10 16:35:08 -0800 |
| commit | 0f0fb2256a46a8808794d7d4746d112278da3730 (patch) | |
| tree | 7cfb6b255beeb49705044876913e0332376b66d9 /lib | |
| parent | db552f56dc1f2c6ea19a7d39d38ac66e52ed156e (diff) | |
Major overhaul of how modules and environments work, along with some
steamlining and tweaks to the makefile. Version bump: 6.14.13.8
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/consolecolor.nom | 2 | ||||
| -rw-r--r-- | lib/file_hash.nom | 4 | ||||
| -rw-r--r-- | lib/object.nom | 2 | ||||
| -rw-r--r-- | lib/os.nom | 9 | ||||
| -rw-r--r-- | lib/things.nom | 4 |
5 files changed, 5 insertions, 16 deletions
diff --git a/lib/consolecolor.nom b/lib/consolecolor.nom index db29b9f..d1da247 100644 --- a/lib/consolecolor.nom +++ b/lib/consolecolor.nom @@ -18,7 +18,7 @@ $colors = { for $name = $colornum in $colors: $colornum = "\$colornum" - $compile.action.$name = + $(COMPILE RULES).$name = for ($compile $text): if $text: return (Lua "('\\027[\($colornum)m'..\($text as lua expr)..'\\027[0m')") diff --git a/lib/file_hash.nom b/lib/file_hash.nom index ec39e29..70446ca 100644 --- a/lib/file_hash.nom +++ b/lib/file_hash.nom @@ -2,8 +2,8 @@ # This file defines some actions for hashing files and looking up files by hash. -use "lib/os.nom" -use "lib/base64.nom" +use "lib/os" +use "lib/base64" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/lib/object.nom b/lib/object.nom index 13a9ec5..a3a8d93 100644 --- a/lib/object.nom +++ b/lib/object.nom @@ -108,7 +108,7 @@ test: return inst end, }) - _ENV[class.name:as_lua_id()] = class + \(nomsu environment name)[class.name:as_lua_id()] = class class.__index = class class.class = class class.__tostring = function(inst) @@ -2,21 +2,12 @@ # This file defines some actions that interact with the operating system and filesystem. -test: - assume (nomsu files for "core") - externally (files for $path) means: $files = (=lua "Files.list(\$path)") if $files: $files = (List $files) return $files -externally (nomsu files for $path) means: - for $nomsupath in ($package.nomsupath, all matches of "[^;]+"): - $files = (files for "\($nomsupath)/\$path") - if $files: - return $files - externally (=sh $cmd) means: lua> (" local result = io.popen(\$cmd) diff --git a/lib/things.nom b/lib/things.nom index 32942d9..84682b3 100644 --- a/lib/things.nom +++ b/lib/things.nom @@ -5,7 +5,6 @@ test: an (Empty) is a thing a (Dog) is a thing: - [$it, $its] = [Dog, Dog] ($its, set up) means: $its.barks or= 0 @@ -37,7 +36,6 @@ test: assume (($d, bark) == "Bark!") a (Corgi) is a thing: - [$it, $its] = [Corgi, Corgi] $it [set up, gets pissed off] like a (Dog) ($it, as text) means "Dogloaf \{: for $k = $v in $it: add $k = $v}" ($its, sploot) means "sploooot" @@ -61,7 +59,6 @@ test: assume (($d, bark) == "Bark! Bark!") a (Vec) is a thing with {.x, .y}: - $its = (Vec) ($its, + $other) means (Vec {.x = ($its.x + $other.x), .y = ($its.y + $other.y)}) assume ((Vec {.x = 1, .y = 2}) + (Vec {.x = 10, .y = 10})) == @@ -145,6 +142,7 @@ externally (a class named $classname with $members $(initialize $)) means: ( Lua (" , function(\$class_id) + local it, its = \$class_id, \$class_id; \$body_lua end ") |
