|
From: keithv on 20 Jun 2008 14:22 Over on the tcl-core mailing list there is a long-winded discussion about using some reserved string, e.g. {NULL}, to represent sql NULL values, but this has many people concerned that it would break tcl's EIAS (Everything Is A String) property. I don't dare dip my toe into those waters (one thread is now titled "blah blah blah can't hear you") but I was wondering about EIAS. Just what is so important about EIAS? Is it more than just something historical, something beyond the fact that tcl has had this property for 20 years? Or is it something to do with "eval"-ing strings (something I rarely do now that we have {*})? I've been programming tcl for 15 years and don't really know if it's ever been an issue for me. I remember that the cognoscenti were very happy when an EIAS blight regarding floating point numbers was fixed in 8.5, but that "fix" broke all my code that used -textvariable and floating point numbers (see http://groups.google.com/group/comp.lang.tcl/msg/5aad1814c61f0723). So what am I missing? Why is EIAS so sacred? Keith
From: Eric on 20 Jun 2008 15:34 On 2008-06-20, keithv <kvetter(a)gmail.com> wrote: > Over on the tcl-core mailing list there is a > long-winded discussion about using some reserved > string, e.g. {NULL}, to represent sql NULL values, > but this has many people concerned that it would > break tcl's EIAS (Everything Is A String) property. > > I don't dare dip my toe into those waters (one > thread is now titled "blah blah blah can't hear you") > but I was wondering about EIAS. > > Just what is so important about EIAS? Is it more than > just something historical, something beyond the fact > that tcl has had this property for 20 years? Or is it > something to do with "eval"-ing strings (something I > rarely do now that we have {*})? > > I've been programming tcl for 15 years and don't > really know if it's ever been an issue for me. > > I remember that the cognoscenti were very happy when > an EIAS blight regarding floating point numbers was fixed > in 8.5, but that "fix" broke all my code that used > -textvariable and floating point numbers (see > http://groups.google.com/group/comp.lang.tcl/msg/5aad1814c61f0723). > > So what am I missing? Why is EIAS so sacred? > > Keith Because Tcl is a clear and coherent system with only 11 rules. {*} made it 12, and if they do this NULL thing it will be 13, and I can't believe that the 13th will be simple. Then what will number 14 be? I suspect I'm not alone in worrying about slippery slopes. Furthermore, NULL itself is controversial - try asking for an explanation of the benefits of NULL on comp.databases.theory . You can't use a "reserved" string to represent a NULL anyway, because then any time any string is used for anything whatsoever, you will have to check that it is not the special value, because if it is you can't use it. Full stop! If NULLs are considered essential, then anything that might be a NULL has to be a compound value, with a Boolean to say whether it's NULL or not, and an actual value which is explicitly undefined and unusable if the Boolean is true. E.
From: schlenk on 20 Jun 2008 16:37 On Jun 20, 8:22 pm, keithv <kvet...(a)gmail.com> wrote: > Just what is so important about EIAS? Is it more than > just something historical, something beyond the fact > that tcl has had this property for 20 years? Or is it > something to do with "eval"-ing strings (something I > rarely do now that we have {*})? > > I remember that the cognoscenti were very happy when > an EIAS blight regarding floating point numbers was fixed > in 8.5, but that "fix" broke all my code that used > -textvariable and floating point numbers (seehttp://groups.google.com/group/comp.lang.tcl/msg/5aad1814c61f0723). Some model-view-controller fanatics could say you used your modell data without a view that way. Putting in a format fixes it, but i agree that its not as nice as it could be. > > So what am I missing? Why is EIAS so sacred? EIAS is not really 'sacred', its just very, very fundamental. If you changed the guarantees of EIAS you would have to revisit nearly all code in the Tcl core and extensions to make it aware of the fact that EIAS isn't a universal principle. You would probably have to deprecate all the old char* based interfaces. You would have to introduce a lot of explicit conversion operations (like pythons str(), unicode(), repr(), int() etc.) and so make types explicit. You would loose the trivial serializability of Tcl values and needed extra infrastructure to support it. So basically breaking EIAS has effects in lots of surprising places. It surely could be broken, if there is a sane concept, a good reason and a new major version to do it. Neither is available right now, so breaking EIAS will probably be considered a bug in all of Tcl 8.x lifecycle. Michael
From: Donal K. Fellows on 20 Jun 2008 19:49 keithv wrote: > So what am I missing? Why is EIAS so sacred? Right now, Tcl's values can be any string (modulo fitting in memory and using only UNICODE characters up to \uffff). Sure we have Tcl_Objs, but they're really just representation caches wrapped around strings. NULL is disjoint from *all* of those values; it is no string at all. Donal.
From: keithv on 20 Jun 2008 20:09
On Jun 20, 4:37 pm, schlenk <schl...(a)uni-oldenburg.de> wrote: > On Jun 20, 8:22 pm, keithv <kvet...(a)gmail.com> wrote:> > > Just what is so important about EIAS? Is it more than > > just something historical, something beyond the fact > > that tcl has had this property for 20 years? Or is it > > something to do with "eval"-ing strings (something I > > rarely do now that we have {*})? > > > I remember that the cognoscenti were very happy when > > an EIAS blight regarding floating point numbers was fixed > > in 8.5, but that "fix" broke all my code that used > > -textvariable and floating point numbers (seehttp://groups.google.com/group/comp.lang.tcl/msg/5aad1814c61f0723). > > Some model-view-controller fanatics could say you used your modell > data without a view that way. Putting in a format fixes it, but i > agree that its not as nice as it could be. > > > So what am I missing? Why is EIAS so sacred? > > EIAS is not really 'sacred', its just very, very fundamental. > > If you changed the guarantees of EIAS you would have to > revisit nearly all code in the Tcl core and extensions > to make it aware of the fact that EIAS isn't a > universal principle. You would probably have to > deprecate all the old char* based interfaces. You would > have to introduce a lot of explicit conversion > operations (like pythons str(), unicode(), repr(), > int() etc.) and so make types explicit. You would loose > the trivial serializability of Tcl values and needed > extra infrastructure to support it. Leaving out NULLs, could you explain why? When floats broke EIAS in 8.4 I know you couldn't round trip floats into and out of strings but that really just a corner case that doesn't break much. Is it because with EIAS you can always recreate a Tcl_Obj from its string representation? If so, isn't that just an implementation detail hidden from the script writer? Keith |