IppClub / IppClub/YueScript

About new table appending idiom

Open
#77 7 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

It help will help me reduce a lot of typing and typo error.
But I sometime use lua with other language like C# that count not from 1 but from 0. When create table that map with C# data with would be difficult with current idiom.
If idiom can be change for handle that case it would be great.

I think change to something like this would be better, handle more cases, more readable and distinguishable code. EX:

items #+= obj -- compile to: items[#items+1] = obj
items #= obj -- compile to: items[#items] = obj
items #-= obj -- compile to: items[#items-1] = obj

Thanks and regards!

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

Start by reviewing the existing table-appending idiom and how the issue's proposed operators would be parsed and compiled. Determine the intended behavior for zero-based and one-based indexing, then verify that the syntax remains readable and that the generated assignments work for each case.

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.