diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-09-06 12:46:39 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-09-06 12:48:16 -0700 |
| commit | a35d010dfe2b2769cf13ae508952c279aecb3aac (patch) | |
| tree | 69ce1fcd0123832599d2766d361a8a8b43fcfb4b /core/operators.nom | |
| parent | e1bc075bb5319b3903f66e141810dcb9ef53042e (diff) | |
Removed the mandatory "_" prefix for Nomsu variables, renamed "list" and
"dict" to "List" and "Dict", or in Nomsu's environment, "_List" and
"_Dict", removed uuid.lua and replaced it with core/id.nom for handling
IDs.
Diffstat (limited to 'core/operators.nom')
| -rw-r--r-- | core/operators.nom | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/core/operators.nom b/core/operators.nom index 7e30705..9395d9d 100644 --- a/core/operators.nom +++ b/core/operators.nom @@ -19,28 +19,6 @@ compile [%a is %b, %a == %b] to (..) compile [%a isn't %b, %a is not %b, %a not= %b, %a != %b] to (..) Lua value "(\(%a as lua expr) ~= \(%b as lua expr))" -# For strict identity checking, use (%x's id) is (%y's id) -test: - assume (([] == []) and (([] 's id) != ([] 's id))) -lua> ".." - do - local new_uuid = require('uuid') - local NaN_surrogate = {} - local nil_surrogate = {} - IDS = setmetatable({}, { - __mode = "k", - __index = function(self, key) - if key == nil then return self[nil_surrogate] - elseif key ~= key then return self[NaN_surrogate] end - local id = new_uuid() - self[key] = id - return id - end - }) - end - -compile [% 's id, id of %] to (Lua value "IDS[\(% as lua expr)]") - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ test: |
