>I'd rather drop this special syntax in favor of a simple function:
I fully agree. Another pro for it: You can pass it as an argument to 
another function. (Maybe that's what you meant by "more convenient"?)

I'm not sure whether I want `range 1 5` to return `[1,2,3,4,5]` or 
`[1,2,3,4]` though. Most languages use the latter, but most people better 
understand the former.

On Thursday, August 4, 2016 at 3:21:55 PM UTC-5, Richard Feldman wrote:
>
> Currently the way you do ranges (like, say, to create the list [ 1, 2, 3, 
> 4, 5 ]) is this:
>
> [ 1..5 ]
>
> This comes up super infrequently, and whenever it does, it's hard to 
> Google for - when you want to know things like "can I use variables in 
> there?" "is [1..5] going to give me 1,2,3,4,5 or 1,2,3,4?" etc.
>
> I'd rather drop this special syntax in favor of a simple function:
>
> List.range : number -> number -> List number
>
> It'd make for one less piece of syntax to learn, would simplify the 
> compiler, and personally I'd find it more convenient to use than the 
> special syntax. This way when I want to know how it works I can look it up 
> in the List docs like normal!
>
> Thoughts?
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to