Re: MV Keys




"Jon Heggland" <heggland@xxxxxxxxxxx> wrote in message
news:MPG.1e6fa30f17a25f9598976d@xxxxxxxxxxxxxxx
In article <3bla025sc4m8u59a7qoc09bipjtnh5tmuk@xxxxxxx>,
invalid@xxxxxxxxxxx says...
I don't agree with this. Strings are (IMHO) scalar types because they
can be sorted.

Anything can be sorted. You just have to define an order. The order of
strings is essentially arbitrary, and you can sort lists of characters
the same way you sort strings.

However, mathematical operations on them, except for
comparison operators, are not possible. But there are other
operations, such as concatenation and substring, which are.

What is a mathematical operation, and why are they important in this
context? Any list can support concatenation and "subbing"---what point
are you trying to make?

Also, the characters by themselves are meaningless much as the bits in
a number by themselves are meaningless. It is the order of the bits,
and the order of the characters, that give the number or string any
meaning. Therefore, if you consider VARCHAR to be a compound type, you
would have to say that DECIMAL is, too. And with real compound types
such as lists or arrays, it is the elements themselves, and not the
collection of elements, which gives the type semantic meaning.

I'd say the meaning is primarily in the mind of the human using the
system. But I agree(?) that DECIMAL may indeed be considered compound. I
can use an int32 as an array of bits, each bit with a "meaning" in
itself---and I can likewise use a string as an array of characters. It
is just a matter of perspective, of mindset. The computer can't tell the
difference.

But I'm not a mathematician, so I couldn't say what it takes to prove
whether something is a scalar type or not. Is there a formal
definition?

Exactly my question. I don't think there can be, but I may be wrong. :)

Doesn't the determination of whether a type is scalar or not depend upon the
universe of discourse? I think that a string is a scalar if any of the
following statements hold: (1) individual character values don't belong to
the universe of discourse, (2) the meaning of the individual character
values aren't directly augmented by the attribute name, (3) the meaning of
the individual character values aren't augmented by their position in the
list, or (4) it is only the permutation of character values that has meaning
with respect to the containing relation. For example, the elements in a
list of birth dates aren't just dates, they're birth dates; the numbers in a
coordinate aren't just numbers, they're longitude and lattitude. I think
that some of those properties could be applied to other types as well,
though I can't think of an example just now.

--
Jon


.



Relevant Pages

  • Re: VERY simple question about "?"
    ... (it produces the integer code for a character), ... don't see the equivalence between a string delimiter, or a character ... I am not sure what you mean by "change meaning". ...
    (comp.lang.ruby)
  • Re: Newbie - need a small push on recursion / higher order procedures
    ... And kept repeating the mantra 'build lists with cons'. ... If the problem was create a list containing the string values of the ... cons the first character onto ... a procedure called substring with the little knowledge of Scheme that I ...
    (comp.lang.scheme)
  • Re: MV Keys
    ... I think that a string is a scalar if ALL of the ... which gives the type semantic meaning. ... character values aren't directly augmented by the attribute name, ...
    (comp.databases.theory)
  • Re: Newbie - need a small push on recursion / higher order procedures
    ... And kept repeating the mantra 'build lists with cons'. ... If the problem was create a list containing the string values of the ... cons the first character onto ...
    (comp.lang.scheme)
  • Re: String manipulation in Prolog
    ... Normally a string is a list of character-codes. ... >> as a chunk of characters you can use atoms. ... Strings (lists) are very different. ... They are great for working at the character level. ...
    (comp.lang.prolog)

Loading