Skip to content

Advanced Ranges #11

@atahabaki

Description

@atahabaki

Detailed documentation of #10 's Range functionality.

  • numerical ranges
  • unicode ranges (for version 1.0 not necessary)

Numerical Ranges:

{1..3;0=}
# combinations
0 01
1 02
2 03

if the one of the boundaries are not defined consider it is 0:

{..3;0=}
# combinations
0 00
1 01
2 02
3 03
{3..;=0}
# combinations
0 30
1 20
2 10
3 00

padding with custom chars:

{3..;=_}
# combinations
0 3_
1 2_
2 1_
3 0_

you can stack paddings:

{..2;__=}
# combinations
0 __0
1 __1
2 __2

Incrementing and decrementing:

{2..10;0=;+2} => [02,04,06,08,10]
# combinations
0 02
1 04
2 06
3 08
4 10
{10..;0=;-2} => [10,08,06,04,02,00]
# combinations
0 10
1 08
2 06
3 04
4 02
5 00

Unicode Ranges:

{a..c} => [a,b,c]
# combinations
0 a
1 b
2 c

But this brings the question of how should we implement the accented characters?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions