Skip to content

Support string method calls - #134

Open
csnover wants to merge 1 commit into
kyren:masterfrom
csnover:string-methods
Open

Support string method calls#134
csnover wants to merge 1 commit into
kyren:masterfrom
csnover:string-methods

Conversation

@csnover

@csnover csnover commented Oct 3, 2025

Copy link
Copy Markdown

Technically, to be 100% compatible, this should be calling through a metatable assigned to all strings which has __index pointing to the string global table. This intermediate approach works for all sane use cases without requiring so much work. (It is not possible to set a metatable on a string in PUC-Lua, but it is at least possible to call getmetatable on a string and then mess with it.)

Technically, to be 100% compatible, this should be calling through
a metatable assigned to all strings which has __index pointing to
the string global table. This intermediate approach works for all
sane use cases without requiring so much work. (It is not possible
to *set* a metatable on a string in PUC-Lua, but it is at least
possible to call `getmetatable` on a string and then mess with it.)
@ProgramCrafter

Copy link
Copy Markdown

I implemented the 100% compatible approach at ProgramCrafter@382e4cc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants