aboutsummaryrefslogtreecommitdiff
path: root/core/operators.nom
diff options
context:
space:
mode:
Diffstat (limited to 'core/operators.nom')
-rw-r--r--core/operators.nom10
1 files changed, 2 insertions, 8 deletions
diff --git a/core/operators.nom b/core/operators.nom
index 706909c..56e89cb 100644
--- a/core/operators.nom
+++ b/core/operators.nom
@@ -163,14 +163,8 @@ immediately
# Unary operators
compile [- %] to: Lua value "(- \(% as lua expr))"
compile [not %] to: Lua value "(not \(% as lua expr))"
- compile [length of %list] to
- # A bit of a hack so that luajit works properly.
- Lua value ".."
- (function(l)
- local mt = getmetatable(l);
- if mt and mt.__len then return mt.__len(l) end
- return #l
- end)(\(%list as lua expr))
+ # Using custom "len()" instead of Lua's "#" operator for compatibility with luajit.
+ compile [length of %list] to: Lua value "len(\(%list as lua expr))"
# Update operators
immediately