Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 1, 2025

  • Add syntax-path->string function to convert syntax paths to string representation
  • Add string->syntax-path function to parse strings back to syntax paths
  • Add comprehensive tests for both conversion functions
  • Export new functions from the module
  • Run existing tests to ensure no regressions
  • Address code review feedback (remove redundant type check, fix terminology)
  • Simplify syntax-path->string using #:before-first parameter
  • Enhance error tests with detailed error message assertions
  • Update contract to promise immutable-string? return type
Original prompt

This section details on the original issue you should resolve

<issue_title>Add string representation of syntax paths</issue_title>
<issue_description>Syntax paths that don't contain hash keys are serializable as plain text, unlike syntax objects themselves. This can be useful in a variety of ways: storing paths in databases, writing paths to the console, showing paths in GUIs, etc. A canonical string form of syntax paths seems like a useful thing to implement. Here's a proposed syntax:

  • / for the empty syntax path, which represents the root of a syntax object.
  • /0 for (syntax-path (list 0)) (the leftmost subexpression of the root)
  • /0/1/2 for (syntax-path (list 0 1 2))

The conversion functions should be named syntax-path->string and string->syntax-path. Syntax path strings shouldn't be allowed to end in / except for the root syntax path.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add string representation for syntax paths Add string representation of syntax paths Nov 2, 2025
Copilot AI requested a review from jackfirth November 2, 2025 00:11
Copy link
Owner

@jackfirth jackfirth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jackfirth jackfirth marked this pull request as ready for review November 2, 2025 00:32
Copy link
Owner

@jackfirth jackfirth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coveralls
Copy link

Pull Request Test Coverage Report for Build #109

Details

  • 33 of 33 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 92.903%

Totals Coverage Status
Change from base Build #107: 0.02%
Covered Lines: 14412
Relevant Lines: 15513

💛 - Coveralls

@jackfirth jackfirth enabled auto-merge (squash) November 2, 2025 00:55
@jackfirth jackfirth merged commit 5ef2416 into master Nov 2, 2025
6 checks passed
@jackfirth jackfirth deleted the copilot/add-string-representation-syntax-paths-again branch November 2, 2025 01:02
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.

Add string representation of syntax paths

3 participants