Metamethod operator
Open
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 613
- Forks
- 45
- PR merge metrics
- No merged PRs in 30d
Description
Hi!
I have a feature suggestion for Yuescript:
# metamethod operator
a = close: true, close#: => print "out of scope"
b = add#: (left, right) -> right - left
c = key1: true, #:add, key2: true
d, e = a.close, a#.close
f = a#\close(1)
Compiles to
local a = setmetatable({close = true}, {__close = function(self) return print("out of scope") end})
local b = setmetatable({}, {__add = function(left, right) return right - left})
local c = setmetatable({key1 = true, key2 = true}, {__add = add})
local d, e = a.close, getmetatable(a).__close
local f = getmetatable(a).__close(a, 1)
thanks!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. Start by locating the compiler handling metamethods, table construction, and property access, then use the proposed YueScript examples and expected Lua output as the acceptance reference.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100