Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #56 +/- ##
==========================================
- Coverage 97.14% 96.93% -0.21%
==========================================
Files 4 4
Lines 420 424 +4
==========================================
+ Hits 408 411 +3
- Misses 12 13 +1 ☔ View full report in Codecov by Sentry. |
|
Thanks for working on this! In principle this looks great. What do you think about creating a single module level metatable? ...maybe with some identifying content, Bonus points for adding a specl example to verify it works as designed! |
|
Indeed a module level metatable would be a bit cheaper, but mind that empty sequences are not usually predominant. |
Merely adding an option to load() to distinguish empty sequences from empty mappings in the returned Lua table.
Otherwise both would be represented by an empty Lua table. This is by the way still the case, however for an empty
sequence, the Lua table will have an attached empty metatable. This presence can be tested with getmetatable().
So even with the option distinct_sequence set to true, any existing application code will not be affected unless it is
attaching metatables to (some components of) the returned Lua table.