diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2017-09-24 20:20:27 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2017-09-24 20:20:27 -0700 |
| commit | af3274ca9237a08093009e87955e30ab5f473f12 (patch) | |
| tree | 46c249d6b42ac51111c7e198a10b8dad09b17923 /lib/collections.nom | |
| parent | e4660b169c14d24c3ec373b197e8b9469d200d50 (diff) | |
massive overhaul, compiler kinda works.
Diffstat (limited to 'lib/collections.nom')
| -rw-r--r-- | lib/collections.nom | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/collections.nom b/lib/collections.nom index 09fff10..c7cc10d 100644 --- a/lib/collections.nom +++ b/lib/collections.nom @@ -57,8 +57,8 @@ macro [..] %list doesn't have index %index, %list does not have index %index ..=: ".."|(\%list as lua\[\%index as lua\] ~= nil) -macro [length of %list, size of %list, number of %list, len %list] =: - ".."|#(\%list as lua\) +macro [length of %list, size of %list, size %list, number of %list, len %list] =: + ".."|nomsu.utils.size(\%list as lua\) # Chained lookup macro [%list ->* %indices] =: @@ -143,7 +143,7 @@ macro [%expression for all %iterable] =: ".."|(function(game, vars) | local comprehension = {} | for i,value in ipairs(\%iterable as lua\) do - | vars.it = value + | vars[''] = value | comprehension[i] = \%expression as lua\ | end | return comprehension @@ -152,7 +152,7 @@ macro [%expression for all %iterable] =: # TODO: maybe make a generator/coroutine? #.. Dict comprehensions can be accomplished okay by doing: - dict ([new_key using (%it's "key"), new_value using (%it's "value")] for all (entries in %dict)) + dict ([new_key using (%'s "key"), new_value using (%'s "value")] for all (entries in %dict)) or something similar # TODO: fix compiler bugs pass |
