TASEmulators / TASEmulators/BizHawk

Stop returning Lua tables with 0-indexing

Open
#4,329 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

re: Lua API/scripting Waiting on dev consensus
Dominant language
C#
Stars
2.8k
Forks
468
PR merge metrics
No merged PRs in 30d

Description

These are non-idiomatic and annoying to work with (though IMO the normal 1-indexed tables are also annoying).
Switching a function's indexing is a breaking change, so we should plan to change them all at once. The candidates are:

  • client.getavailabletools()
  • comm.mmfReadBytes(string, int)
  • event.availableScopes()
  • memory.getmemorydomainlist()
  • (deprecated) memory.readbyterange(long, int, string?)/mainmemory.readbyterange(long, int)
  • movie.getcomments()/movie.getsubtitles()
  • tastudio.getbranches()/tastudio.getselection()

Contributor guide

Open the contributing guide

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 locating the implementations and tests for client.getavailabletools(), comm.mmfReadBytes(), event.availableScopes(), memory domain and byte-range functions, movie comments and subtitles, and tastudio branch and selection functions. Review how each result is exposed to Lua and identify the existing indexing expectations. Done means all listed functions consistently stop returning 0-indexed tables, with coverage for the changed behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, lua
Domain
api
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.