ricardoboss / STEP

The STEP programming language
http://step-lang.dev/
MIT License
5 stars 1 forks source link

`range` function #122

Open ricardoboss opened 9 months ago

ricardoboss commented 9 months ago

A range function to return a list of numbers starting from start and count up to end using step steps between numbers.

Example usage:

list digits = range(0, 9, 1) // 1 could be the default for step
println(digits) // [0, 1, 3, 4, 5, 6, 7, 8, 9]

list fractions = range(0, 1, 0.1)
println(fractions) // [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]

start and end should be inclusive, although that is debatable.

ricardoboss commented 8 months ago

The function should be created in the StepLang.Framework.Pure namespace. If you need any more guidance, I will try to help :)

ricardoboss commented 8 months ago

@denizkirbiyik