[xquery-talk] operations on derived numeric type

David Lee dlee at calldei.com
Fri Aug 30 09:52:59 PDT 2013


Just use
  $x/1  instead  :)


----------------------------------------
David A. Lee
dlee at calldei.com
http://www.xmlsh.org

-----Original Message-----
From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Michael Sokolov
Sent: Friday, August 30, 2013 7:58 AM
To: David Carlisle
Cc: talk at x-query.com
Subject: Re: [xquery-talk] operations on derived numeric type

On 08/30/2013 10:45 AM, David Carlisle wrote:
> On 30/08/2013 15:07, Michael Sokolov wrote:
>> PS how many times will I forget that $x-1 is parsed as a variable 
>> name. A token allowed in a symbol *and* as an operator makes no 
>> sense.  Old argument I'm sure.
>
> for variables it could (perhaps) have been different but it's more 
> consistent to keep all identifiers based on the XML Name production, 
> and the fact that x-1 is parsed as the element name x-1 but x -1 is 
> parsed as the value of the element x minus 1 caused a lot of headaches 
> in the design of xpath1, but couldn't really be avoided given that x-1 
> is a legal element name. It's not really any different to the 
> difference between $x div 1 and $xdiv1.
>
> David
It is different because of conventional expectations about operators being represented by punctuation characters.  If only we had ÷ on our keyboards!

-Mike
_______________________________________________
talk at x-query.com
http://x-query.com/mailman/listinfo/talk



More information about the talk mailing list