jackfirth / jackfirth/resyntax

Keeping marked lists sorted

Open
#499 0 comments 1 reaction 1 assignee View on GitHub

Nobody has claimed this yet.

autopilot-candidate new lint
Dominant language
Racket
Stars
70
Forks
11
PR merge metrics
No merged PRs in 30d

Description

It should be possible to tell Resyntax to keep specific collections in sorted order. This could be done with a keep-sorted macro by making a Resyntax rule that looks for a syntax property added by the macro. The first form in the list should be ignored so that this works with any collection, like (list ...), (set ...), or (vector ...). The comparator used could also be customizable by the keep-sorted macro, but it has to be something that operates on the syntax objects contained, not their values.

#lang resyntax/test

test: "unsorted marked list should be resorted"
--------------------
#lang racket
(keep-sorted (list apple orange banana))
--------------------
--------------------
#lang racket
(keep-sorted (list apple banana orange))
--------------------

It should be a macro so that other macros can expand to it. I want this so that define-refactoring-suite can specify that the list of refactoring rules should always be written in sorted order.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.