m...@vex.net (Mark Brader) writes:
> Mark Brader:
>> > No! We're talking about expressions in English!
>
> Peter Moylan:
>> As I read it, your "these languages" referred to C, C++, Python and
>> (prpbably) Java, mentioned by Bertel.
>
> Of course. But the context was:
>
> David Kleinecke:
> >>> The more or less standard for mathematics and computer science is that
> >>> "the list of numbers starting at 7 and ending at 17" means those numbers
> >>> n such that 7 <= n < 17. But this definition is not yet established...
>
> Mark Brader:
> >> I don't believe it. I have never seen a phrasing like that in
> >> technical usage, and if I did, I'd take it to mean that 7 and 17
> >> were both included in the list.
>
> Bertel Lund Hansen:
> > How much standard it is, I don't know, but in several programming
> > languages it certainly is the case: C, C++, Python and (prpbably) Java.
>
> In other words, Bertel was claiming that the expression David cited --
> "the list of numbers starting at 7 and ending at 17" -- exists in those
> programming languages.
>
> Not an *equivalent* expression, *that* expression, because that's the
> one whose meaning was being disputed.
That's not how I interpret Bertel at all. I interpret his "it" as "an
idiomatic expression defining a numerical range by specifying the upper
and lower bounds, and where the upper bound is included", contrasting
against "an idiomatic expression defining a numerical range by
specifying the upper and lower bounds, and where the upper bound is
excluded".
I'd claim that C doesn't have such an expression. It may have
upper-bound-excluded semantics in several contexts, but it doesn't have
an idiomatic expression for such ranges per se.
Python's range fits the bill, it is such an expression..
Perl's start..end syntax also fits the bill, and adopts the included
upper bound.
$ perl -e 'print 1..5'
12345
eLisp likewise:
(number-sequence 1 5)
(1 2 3 4 5)
Phil
--
We are no longer hunters and nomads. No longer awed and frightened, as we have
gained some understanding of the world in which we live. As such, we can cast
aside childish remnants from the dawn of our civilization.
-- NotSanguine on SoylentNews, after Eugen Weber in /The Western Tradition/