-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update utils; enum + kpairs #413
Conversation
2603b81
to
b5ad58a
Compare
...should we add kpairs to tablex then? |
This comment was marked as resolved.
This comment was marked as resolved.
Putting it in |
we could move all of them; I think @stevedonovan made an effort to decouple them, such that most would rely only on |
Thinking about it some more, it does make sense it's in utils. I'd probably just use |
we can also add them to |
I don't think we need an alias, but a nod in the tablex documentation to the additional table related utilities in utils in case one comes searching for them might be useful. |
@alerque any specific reason you don't like an alias? There's already plenty of them, see the file module for example. (an Alias might also make the docs easier, since we can attach Ldoc comments to an alias) |
If there is already precedent to get docs then okay, just go for it. My personal dislike of multiple aliases for the same code path is rooted in history with other projects where the difficulty of refactoring things later goes up the more ways there are of accessing the same code. For example in this case when looking for uses in a code base you can't just grep the Lua code for |
To be fair, we don't call |
Iterates over all non-integer keys (inverse of 'ipairs'
3811fe6
to
c89a8b0
Compare
merging this for now, at some point (before 2.0) we probably need to revisit some of the function in utils anyway, and the module separation (interdependencies) |
### Summary #### 1.13.1 (2022-Jul-22) - fix: `warn` unquoted argument [#439](lunarmodules/Penlight#439) #### 1.13.0 (2022-Jul-22) - fix: `xml.parse` returned nonsense when given a file name [#431](lunarmodules/Penlight#431) - feat: `app.require_here` now follows symlink'd main modules to their directory [#423](lunarmodules/Penlight#423) - fix: `pretty.write` invalid order function for sorting [#430](lunarmodules/Penlight#430) - fix: `compat.warn` raised write guard warning in OpenResty [#414](lunarmodules/Penlight#414) - feat: `utils.enum` now accepts hash tables, to enable better error handling [#413](lunarmodules/Penlight#413) - feat: `utils.kpairs` new iterator over all non-integer keys [#413](lunarmodules/Penlight#413) - fix: `warn` use rawget to not trigger strict-checkers [#437](lunarmodules/Penlight#437) - fix: `lapp` provides the file name when using the default argument [#427](lunarmodules/Penlight#427) - fix: `lapp` positional arguments now allow digits after the first character [#428](lunarmodules/Penlight#428) - fix: `path.isdir` windows root directories (including drive letter) were not considered valid [#436](lunarmodules/Penlight#436)
### Summary #### 1.13.1 (2022-Jul-22) - fix: `warn` unquoted argument [#439](lunarmodules/Penlight#439) #### 1.13.0 (2022-Jul-22) - fix: `xml.parse` returned nonsense when given a file name [#431](lunarmodules/Penlight#431) - feat: `app.require_here` now follows symlink'd main modules to their directory [#423](lunarmodules/Penlight#423) - fix: `pretty.write` invalid order function for sorting [#430](lunarmodules/Penlight#430) - fix: `compat.warn` raised write guard warning in OpenResty [#414](lunarmodules/Penlight#414) - feat: `utils.enum` now accepts hash tables, to enable better error handling [#413](lunarmodules/Penlight#413) - feat: `utils.kpairs` new iterator over all non-integer keys [#413](lunarmodules/Penlight#413) - fix: `warn` use rawget to not trigger strict-checkers [#437](lunarmodules/Penlight#437) - fix: `lapp` provides the file name when using the default argument [#427](lunarmodules/Penlight#427) - fix: `lapp` positional arguments now allow digits after the first character [#428](lunarmodules/Penlight#428) - fix: `path.isdir` windows root directories (including drive letter) were not considered valid [#436](lunarmodules/Penlight#436)
### Summary #### 1.13.1 (2022-Jul-22) - fix: `warn` unquoted argument [#439](lunarmodules/Penlight#439) #### 1.13.0 (2022-Jul-22) - fix: `xml.parse` returned nonsense when given a file name [#431](lunarmodules/Penlight#431) - feat: `app.require_here` now follows symlink'd main modules to their directory [#423](lunarmodules/Penlight#423) - fix: `pretty.write` invalid order function for sorting [#430](lunarmodules/Penlight#430) - fix: `compat.warn` raised write guard warning in OpenResty [#414](lunarmodules/Penlight#414) - feat: `utils.enum` now accepts hash tables, to enable better error handling [#413](lunarmodules/Penlight#413) - feat: `utils.kpairs` new iterator over all non-integer keys [#413](lunarmodules/Penlight#413) - fix: `warn` use rawget to not trigger strict-checkers [#437](lunarmodules/Penlight#437) - fix: `lapp` provides the file name when using the default argument [#427](lunarmodules/Penlight#427) - fix: `lapp` positional arguments now allow digits after the first character [#428](lunarmodules/Penlight#428) - fix: `path.isdir` windows root directories (including drive letter) were not considered valid [#436](lunarmodules/Penlight#436)
adds:
utils.enum
accept hash tables as wellutils.kpairs
iterator over all non-integer keys (inverse of ipairs)