![]() | |
#141
| |||
| |||
|
|
As long as the type of a bunch of values is well-defined, there is indeed no problem---indeed, that makes the two alternatives I outlined equivalent. However, if any attribute is a set (or list), you probably want (for convenience) to treat it as a single value of its constituent type when it contains only one value, I.e. "Jon" = { "Jon" }. A language that does this may exhibit undesirable behaviour in other places; I believe SQL has trouble with table literals because of this. |
#142
| |||
| |||
|
|
In article <1141372781.078243.197630 (AT) e56g2000cwe (DOT) googlegroups.com>, marshall.spight (AT) gmail (DOT) com says... Jon Heggland wrote: As long as the type of a bunch of values is well-defined, there is indeed no problem---indeed, that makes the two alternatives I outlined equivalent. However, if any attribute is a set (or list), you probably want (for convenience) to treat it as a single value of its constituent type when it contains only one value, I.e. "Jon" = { "Jon" }. A language that does this may exhibit undesirable behaviour in other places; I believe SQL has trouble with table literals because of this. Can you say more about this? What kind of trouble? I think Hugh Darwen has written a piece on this. I'll try to dig it up. |
#143
| |||
| |||
|
|
In article <GHgNf.26120$_S7.24277 (AT) newssvr14 (DOT) news.prodigy.com>, brian (AT) selzer-software (DOT) com says... Doesn't the determination of whether a type is scalar or not depend upon the universe of discourse? In that case, scalar-ness is not a property of a type, but a property of the use of a type in a certain context. I'd say that severely reduces the usefulness of the concept (if it *has* any usefulness to begin with . |
|
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; Speaking of dates, is date a scalar type? Its components (year, month, day) do belong to the universe of discourse in most cases. |
|
-- Jon |
#144
| |||
| |||
|
|
I don't see it that way. If you can talk intelligently about values that are contained in a list apart from that list within the constraints imposed by the universe, then the list is not atomic or scalar with respect to the universe of discourse. The list can be resolved into components that have meaning with respect to the universe independent of the list. |
|
Speaking of dates, is date a scalar type? Its components (year, month, day) do belong to the universe of discourse in most cases. Absolutely. Year, month and day are not components, they're transformations. Time is a continuum, and dates are points along that continuum. Year, month and day are functions of the number of days that have passed since a widely accepted point in time. |
#145
| |||
| |||
|
|
I don't see it that way. If you can talk intelligently about values that are contained in a list apart from that list within the constraints imposed by the universe, then the list is not atomic or scalar with respect to the universe of discourse. The list can be resolved into components that have meaning with respect to the universe independent of the list. |
#146
| |||
| |||
|
|
In article <GHgNf.26120$_S7.24277 (AT) newssvr14 (DOT) news.prodigy.com>, brian (AT) selzer-software (DOT) com says... Doesn't the determination of whether a type is scalar or not depend upon the universe of discourse? In that case, scalar-ness is not a property of a type, but a property of the use of a type in a certain context. I'd say that severely reduces the usefulness of the concept (if it *has* any usefulness to begin with .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; Speaking of dates, is date a scalar type? Its components (year, month, day) do belong to the universe of discourse in most cases. |

|
-- Jon |
#147
| |||
| |||
|
|
In article <1141324828.479189.199000 (AT) i40g2000cwc (DOT) googlegroups.com>, marshall.spight (AT) gmail (DOT) com says... Jon Heggland wrote: So it is essentially an arbitrary decision? Why make it, then? One necessarily makes a decision. The designers of SQL chose only a single unordered collection. The designers of Java chose only a single, ordered collection. (I'm referring to the array; Java has certainly thrown an impressive assortment of collections into the core API, but in-a-library is not the same thing as in-the-language; all Java collections are built on arrays and objects.) Arrays *or* objects, I think you mean. (And arrays are objects as well.) I don't really see the significance of how the collections are implemented internally; half the point of OO is to make this irrelevant anyway. And is the library/language distinction really that clear cut? Is the String class in the language or in the library? In any case, that wasn't really what I meant to ask. It seems you say that compound types breaks 1NF, but that it doesn't really matter much; and that the classification of types into compound and simple is essentially arbitrary. What, then, is the use of talking about 1NF and simple vs compound types at all? |
|
I am not a mathematician. I am a software engineer. I have to deal with implementation, so I don't necessarily want to include everything I can think of. At the same time, I want to optimize the power:complexity ratio the programmer has available. This is the same argument Date uses to espouse the relation type (or type generator) as the only compound attribute type (generator)---it introduces minimal extra complexity, since relations and relational operators have to exist anyway, and it can handle both lists and sets. ![]() |
#148
| ||||
| ||||
|
|
In article <wMUNf.17845$rL5.2737 (AT) newssvr27 (DOT) news.prodigy.net>, brian (AT) selzer-software (DOT) com says... I don't see it that way. If you can talk intelligently about values that are contained in a list apart from that list within the constraints imposed by the universe, then the list is not atomic or scalar with respect to the universe of discourse. The list can be resolved into components that have meaning with respect to the universe independent of the list. What universe? A concrete example: I can use a varchar as a string (where, for the sake of the argument, I postulate that the individual characters "have no meaning"), or as an array of characters (where they do). The DBMS doesn't know (or care) what meaning I apply to either varchar---so what is the point of the distinction? Just to say that one design (the one using varchar as an array) is probably bad, and the other is not? |
|
My point is that you can't say that a type (e.g. varchar) is scalar or not a priori; you have to say "the way varchar is used by this operation in this particular database means it's not a scalar here". Hence, scalar-ness is a property of some use of some variable of a type, not of the type as such. I think we actually agree; you do say "scalar /with respect to the universe of discourse/" (my emphasis). |
|
Speaking of dates, is date a scalar type? Its components (year, month, day) do belong to the universe of discourse in most cases. Absolutely. Year, month and day are not components, they're transformations. Time is a continuum, and dates are points along that continuum. Year, month and day are functions of the number of days that have passed since a widely accepted point in time. Or the other way around. Are substrings of strings components or transformations? What about subranges, or individual values, of arrays or lists? What is the difference? |
|
-- Jon |
#149
| |||
| |||
|
|
In article <1141320627.995968.219210 (AT) i40g2000cwc (DOT) googlegroups.com>, jog (AT) cs (DOT) nott.ac.uk says... Jon Heggland wrote: If you instead say that a "cell" can and must contain exactly one value, *but* that value may very well be a list, or a set, or a relation---then there are no problems (in theory). Neither of these. I was referring to a case where specifiying an attribute-name may map to more than one "cell" as you refer to it. i.e. not a one-one functional mapping but a generalised one-many mapping. I don't really understand. You mean several columns/attributes with the same name? Join is crucial, and depends on equality between "cells". But with multiple values, how do you define equality? Well this has to be specified to the system as with all equality matches. Is 15.0 equal to 15? Is "HELLO" equal to "Hello"? How is a date greater or less than another? These subjective equality decisions are already being made in numerous domains without significant issue.. In a sense this is no different in nature to something such as a C++ sort template where one has to specify a comparison function. Here, when a type is created one can define how comparisons are made, and I don't see a problem there. As long as the type of a bunch of values is well-defined, there is indeed no problem---indeed, that makes the two alternatives I outlined equivalent. However, if any attribute is a set (or list), you probably want (for convenience) to treat it as a single value of its constituent type when it contains only one value, I.e. "Jon" = { "Jon" }. A language that does this may exhibit undesirable behaviour in other places; I believe SQL has trouble with table literals because of this. |
|
-- Jon |
#150
| |||
| |||
|
|
In article <GHgNf.26120$_S7.24277 (AT) newssvr14 (DOT) news.prodigy.com>, brian (AT) selzer-software (DOT) com says... Doesn't the determination of whether a type is scalar or not depend upon the universe of discourse? In that case, scalar-ness is not a property of a type, but a property of the use of a type in a certain context. I'd say that severely reduces the usefulness of the concept (if it *has* any usefulness to begin with .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; Speaking of dates, is date a scalar type? Its components (year, month, day) do belong to the universe of discourse in most cases. |

|
-- Jon |
![]() |
| Thread Tools | |
| Display Modes | |
| |