Skip to content

feat: add srt builtin — sort lists and text#53

Closed
danieljohnmorris wants to merge 1 commit into
mainfrom
feature/builtin-srt
Closed

feat: add srt builtin — sort lists and text#53
danieljohnmorris wants to merge 1 commit into
mainfrom
feature/builtin-srt

Conversation

@danieljohnmorris
Copy link
Copy Markdown
Collaborator

Summary

  • Adds srt builtin that sorts lists (of numbers or text) and text strings (by character)
  • Implemented across verifier, tree-walk interpreter, and bytecode VM
  • Lists must be homogeneous (all numbers or all text); mixed lists produce a runtime error
  • Text strings are sorted by character (e.g. srt "cab" returns "abc")

Test plan

  • Verifier: accepts srt with list arg, rejects wrong type (ILO-T013)
  • Interpreter: sort number list, sort text list, sort text string
  • VM: sort number list, sort text list
  • All 858 tests pass
  • Clippy clean (no new warnings)

@danieljohnmorris
Copy link
Copy Markdown
Collaborator Author

Superseded by #56 which combines all builtins + ternary with correct opcode numbering.

@danieljohnmorris danieljohnmorris deleted the feature/builtin-srt branch March 1, 2026 19:01
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.

1 participant