Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When does "1..10" make sense?

Tags:

syntax

I have a vague memory of a programming language where 1..10 meant "the range 1 inclusive to 10 exclusive", similar to python's range(1, 10), but I haven't the foggiest which, and this doesn't particularly lend itself to searches. Any help?

If the answer's "python", please forgive me. I know very little python.

like image 351
amara Avatar asked Nov 28 '22 15:11

amara


2 Answers

Pascal supports that syntax. You can actually use this as a type, and I believe it's also used in specifying array bounds. (I'm not sure how much of this is standard Pascal and how much is Turbo Pascal extensions.)

like image 83
Laurence Gonsalves Avatar answered Feb 15 '23 02:02

Laurence Gonsalves


Haskell does it.

like image 31
Michael J. Barber Avatar answered Feb 15 '23 02:02

Michael J. Barber