[
Lists Home |
Date Index |
Thread Index
]
From: "Miles Sabin" <miles@milessabin.com>
> Robin Berjon wrote,
> > if there's anything to learn from programming languages, it's clear
> > that it should *never* be enforced, and *never* be made necessary.
>
> Au contraire ... with programming languages typing should _always_ be
> enforced and _always_ be necessary. If that causes you grief, then
> you're probably using the wrong language.
I think we need to draw the line between different kinds of "typelessness".
There is
* late binding (where the information needed for typing is only available
at the last minute)
* reflection (where the object carries its type information around)
* casting (where the language or some context forces a thing to be
treated a certain type)
* generic operations (where, rather than a thing having no type, it
is deemed to have some very generic operations, such as equality testing
only)
* dynamic typing, where a value is looked at, and the type is selected from
it according to lexical hints
* typelessness, at an extreme where an operation occurs without any
checking on some kind of memory location or a pointer.
The occurrences of these in XML might be
* late binding, such as in XML Schemas when you may access base
types very late
* reflection, such as using xsi:type to figure out the type
* casting, such as where a query treats some text as a particular type
* generic operations, pretty much what XML is without XML Schemas,
wander around trees and look a strings.
* dynamic typing, such as the = operation in XSLT
I don't really see any typelessness at work in XML: it seems to be a property
of languages rather than data.
Cheers
Rick Jelliffe
|