Login
User name:
Password:
Remember me 
Powered by BlogHarbor
Powered by BlogHarbor
Re: Comparability
by Dimitre Novatchev
Thanks for these "easy ways". Why on Earth is it necessary to raise an error when comparing *for equality* items of incompatible type? If they are of incompatible type, this already means that there's *no* way they can be equal. It seems to me, that whoever imposed raising eror in this case tried to enforce a kind of religion on the developers using XPath. This is a specific example where static type-checking is overdone and clearly does not help (but obstructs). To what result? So that now we have to rely on word of mouth (sorry, Mike), even if this comes from Michael Kay himself, and subconsciously "feel guilty" -- not knowing even for what... :( Yes, having a sequence of incompatibly typed items is not a good practice, like having an array of Object, but maybe sometimes there are cases when we are forced to accept that we do not know the type in advance. XPath 2.0 does not have Haskell's "type class" facility, so one is forced to use item()* in this case or not to specify a type at all. It is good to have a backdoor and I thank Mike for achieving this. However, should I "feel guilty" for using this backdoor? FXSL has a set of type-processing functions that can determine dynamically the type of an item and return it as a string or return the constructor function for this type. This could be used to determine type (in)compatibility in case the backdoors Mike points out did not exist. Cheers, Dimitre Novatchev
Post comment:
  Receive comment notifications for this article
Subject: 
Comment: 
Comment verification:

Please enter the text you see inside the graphic to post your comment:
This blog does not allow anonymous comments. Please provide your username and password along with your comment.
Login information:
Username: 
Password: 
If you would like to post contact information on your comment, please enter your information into the optional fields below:
Contact information:
URL:  example: http://yourdomain.com