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/utils.nom | |
| parent | e4660b169c14d24c3ec373b197e8b9469d200d50 (diff) | |
massive overhaul, compiler kinda works.
Diffstat (limited to 'lib/utils.nom')
| -rw-r--r-- | lib/utils.nom | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/lib/utils.nom b/lib/utils.nom index b1e104b..1afc33a 100644 --- a/lib/utils.nom +++ b/lib/utils.nom @@ -44,22 +44,10 @@ macro [say %str] =: ".."|nomsu:writeln(nomsu.utils.repr_if_not_string(\%str as lua\)) # Number ranges -macro [%start up to %stop] =: ".." - |nomsu.utils.range(\%start as lua\, \%stop as lua\-1) -macro [%start thru %stop, %start through %stop] =: ".." - |nomsu.utils.range(\%start as lua\, \%stop as lua\) -macro [%start down to %stop] =: ".." - |nomsu.utils.range(\%start as lua\, \%stop as lua\+1,-1) -macro [%start down thru %stop, %start down through %stop] =: ".." - |nomsu.utils.range(\%start as lua\, \%stop as lua\,-1) -macro [%start up to %stop via %step] =: ".." - |nomsu.utils.range(\%start as lua\,\%stop as lua\-1,vars.step) -macro [%start thru %stop via %step, %start through %stop via %step] =: ".." - |nomsu.utils.range(\%start as lua\,\%stop as lua\,vars.step) -macro [%start down to %stop via %step] =: ".." - |nomsu.utils.range(\%start as lua\,\%stop as lua\+1,-vars.step) -macro [%start down thru %stop via %step, %start down through %stop via %step] =: ".." - |nomsu.utils.range(\%start as lua\,\%stop as lua\,-vars.step) +macro [%start to %stop] =: ".." + |nomsu.utils.range(\%start as lua\, \%stop as lua\) +macro [%start to %stop by %step, %start to %stop via %step] =: ".." + |nomsu.utils.range(\%start as lua\, \%stop as lua\, \%step as lua\) # Common utility functions macro [random number, random, rand] =: "math.random()" |
