Skip to content

fix(mojo-syntax): add string indexing and universal std. prefix corrections#5

Closed
conorbronsdon wants to merge 1 commit intomodular:mainfrom
conorbronsdon:fix/mojo-syntax-string-indexing-and-std-prefix
Closed

fix(mojo-syntax): add string indexing and universal std. prefix corrections#5
conorbronsdon wants to merge 1 commit intomodular:mainfrom
conorbronsdon:fix/mojo-syntax-string-indexing-and-std-prefix

Conversation

@conorbronsdon
Copy link
Copy Markdown
Member

Summary

  • Add s[i]s[byte=i] and slice syntax to the removed-syntax table
  • Add from sys/os/pathlib importfrom std.sys/os/pathlib import to the removed-syntax table
  • Add blanket rule: all stdlib imports require std. prefix
  • Add prominent WRONG/CORRECT examples for string indexing in the Strings section

Why

These were the #1 and #3 most common compilation failures in a structured evaluation building a real Mojo CLI project (HTTP client with Python FFI). The byte= keyword requirement and universal std. prefix rule are mentioned in prose but not in the high-signal WRONG/CORRECT tables that agents check first.

Test plan

  • Verify skill file parses correctly as markdown
  • Test with Claude Code: generate a Mojo project that does string manipulation — confirm agent uses byte= syntax
  • Test with Claude Code: generate stdlib imports — confirm agent uses std. prefix for all modules

🤖 Generated with Claude Code

…moved-syntax table

String indexing with byte= keyword and stdlib import prefix are the most
common compilation failures for Python developers new to Mojo. This adds
them prominently to the removed-syntax table and Strings section.

Findings from a structured skills evaluation building a real CLI project.
@conorbronsdon
Copy link
Copy Markdown
Member Author

Closing in favor of modularml/modular#81589, which lands the same changes via Copybara export. These PRs were part of a structured skills eval — the findings are documented there.

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