aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-09-26 13:57:13 -0700
committerBruce Hill <bruce@bruce-hill.com>2018-09-26 13:57:13 -0700
commitdcff9ecfcf0c3f81cc22bacd082472ea744c9070 (patch)
tree48f0c1ec3b6c42112f7e9d9ea40e1855ab3d598e
parentb43432e647fbb3bb76aa2836e3899d5e407c50f9 (diff)
Fix for calling function with non-literal list.
-rw-r--r--core/metaprogramming.nom6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/metaprogramming.nom b/core/metaprogramming.nom
index f92fb0c..00151d5 100644
--- a/core/metaprogramming.nom
+++ b/core/metaprogramming.nom
@@ -91,7 +91,11 @@ lua> "\
compile [call %fn with %args] to:
lua> "\
..local lua = LuaCode.Value(tree.source, nomsu:compile(\%fn), "(")
- lua:concat_append(table.map(\%args, function(a) return nomsu:compile(a) end), ", ")
+ if \%args.type == 'List' then
+ lua:concat_append(table.map(\%args, function(a) return nomsu:compile(a) end), ", ")
+ else
+ lua:append('unpack(', nomsu:compile(\%args), ')')
+ end
lua:append(")")
return lua"