PlutoLang / Pluto

A superset of Lua 5.4 with a focus on general-purpose programming.
https://pluto-lang.org
MIT License
388 stars 26 forks source link

Add table.slice & table.countvalues #958

Closed well-in-that-case closed 1 month ago

well-in-that-case commented 1 month ago

table.slice mimics the semantics of string.sub. (so it supports negative indices and whatnot)

Closes #955 Closes #553

Sainan commented 1 month ago

I do understand the reason for calling it sub, but I think it's generally more understandable to say "slice" when it comes to arrays, whereas in strings "substring" is more commonplace.

Sainan commented 1 month ago

Otherwise LGTM