IppClub / IppClub/YueScript

Metamethod operator

Open
#41 23 comments 1 reaction 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.