[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

What is an integer? (was: Re: 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

What is an integer? (was: Re:  XML Quiz)
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]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.