Skip to content

Generalize Ranges to support characters and other comparable values #647

Description

@avramlevitter

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlibrariesThis is for issues related to Rhombus libraries

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions