racket / racket/rhombus

Generalize Ranges to support characters and other comparable values

Open
#647 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement libraries
Dominant language
Racket
Stars
601
Forks
74
Avg merge
2d 10h
Merged PRs (30d)
5

Description

Many other languages support the concept of a range that can be any sequence that meets simple criteria, beyond just integer sequences. I was looking to use a shorthand to create a list of characters from 'a' to 'z' but ranges only supports Integers, which means I needed to do

Range.from_to_inclusive(Char"a".to_int(), Char"z".to_int()).to_list().map(Char.from_int)

This could also apply to other kinds of sequences, such as dates.

Contributor guide

No contributing guide indexed for this repository

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 existing Range implementation and its tests, then review how integer ranges are represented and converted to lists. Clarify the supported comparable values and sequence semantics before defining done criteria, including whether character and date ranges are both required.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.