[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
What is an integer? (was: Re: [xml-dev] XML Quiz)
- From: "C. M. Sperberg-McQueen" <cmsmcq@blackmesatech.com>
- To: Roger L Costello <costello@mitre.org>
- Date: Sun, 26 Mar 2023 11:20:53 -0600
Roger L Costello <costello@mitre.org> writes:
> Is '4' '4' an integer?
>
> Clearly it is not. It is a string that consists of two characters.
If you are going to make fine distinctions of this kind, then you will
do better to be more careful. What you exhibit in your question is, in
the notations that shape most readers' instincts in this area, not a
string but a pair of single-character strings.
> Recap:
> 1. 44 is not an integer. It is a string.
No, on the contrary, in ordinary usage 44 is quite clearly an integer,
and the string "44" is a numeral, one of many ways of writing down the
number whose other names include (11 * 4) and (21+21).
> 2. XML does not contain integers (or floats or booleans or URLs or
> anything else). XML only contains a sequence of characters.
You seem to be assuming a particular definition of XML that allows you
to see what an XML document is and what it's not, but so far you haven't
shared that definition with your readers. Is your definition based on
anything that can be found in the XML spec?
What does the XML spec say an XML document is?
What you say about the role of a schema seems plausible enough (assuming
that the validator is invoked in a way that leads it to validate the
element you show against the element declaration you show), as far as it
goes; it's an instance of quite a general rule: bits are assigned
meaning based largely on context.
It's also an instance of an even more general observation: nothing in
our machines ever contains an integer (or for that matter a string of
characters), since integers are abstract objects and machines are
physical objects. Our machines only ever contain and operate on
representations of things like integers. It is convenient to exploit
metonymy and allow ourselves to speak of a particular field of bits as
"being" an integer rather than "representing" an integer, but that is
just a manner of speaking, not a coherent account of
programming-language semantics. If we are interested in speaking
precisely and carefully, then it is just as much a mistake to think that
a 64-bit field consisting of 58 zeroes followed by the bits 1, 0, 1, 1,
0, 0 in that order "is" an integer as it is to thing that two adjact
eight-bit fields each containing the bit string 00110100 "is" an
integer.
--
C. M. Sperberg-McQueen
Black Mesa Technologies LLC
http://blackmesatech.com
- References:
- XML Quiz
- From: Roger L Costello <costello@mitre.org>
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]