[Versa] statements function

Michael Olson Mike.Olson at fourthought.com
Thu Sep 15 13:09:18 MDT 2005


>
>> We still have the same problems with the "statement" function though.
>
> I don't think we should play games with argument-passing semantics for
> any function.  All function invocations should evaluate the expression
> provided for the argument, and pass the result.
>

I guess I don't see it as playing games, but defining what a filter  
expression means.  To me it is intended that a filter expression will  
have a different meaning the a pattern-expression, that's why I  
separated them.  Regardless of where it is located in a query

. < 18

to me means that it is working against a current context (that damn  
word again) node to evaluate, which further implies that where ever it  
is located it cannot be evaluated until the previous portions of the  
expression are evaluated.

This holds for the traverse operator.

Maybe it is as simple as saying

"in a traverse operator, . < 18 is short hand for (!x : $x < 18)"

Then, what I have been calling operator expressions can be promoted to  
be used else where, and they are evaluated like other expressions so  
you have

all() |- ns:age -> . < 18

translates to all resources over the age of 18 (based on what I said  
above)

and

statements(all(),ns:age,. < 18)

translates to the empty set because "." has no meaning (unless this  
query is within another query that defines dot but let's ignore that  
case for now).

and to get the same results as the filter operator you would need to do

statements(all(),ns:age,(!x : $x < 18))

I think I'm OK with this.

Mike

>
> --  
> Uche Ogbuji                               Fourthought, Inc.
> http://uche.ogbuji.net                    http://fourthought.com
> http://copia.ogbuji.net                   http://4Suite.org
> Use CSS to display XML, part 2 -  
> http://www-128.ibm.com/developerworks/edu/x-dw-x-xmlcss2-i.html
> XML Output with 4Suite & Amara -  
> http://www.xml.com/pub/a/2005/04/20/py-xml.html
> Use XSLT to prepare XML for import into OpenOffice Calc -  
> http://www.ibm.com/developerworks/xml/library/x-oocalc/
> Schema standardization for top-down semantic transparency -  
> http://www-128.ibm.com/developerworks/xml/library/x-think31.html
>
> _______________________________________________
> Versa mailing list
> Versa at lists.fourthought.com
> http://lists.fourthought.com/mailman/listinfo/versa
>
------------------------------------------------------------------------ 
-----------------
Mike Olson                                                Principal  
Consultant
mike.olson at fourthought.com                +1 720 253 4662
Fourthought, Inc.                                       
http://Fourthought.com
PO Box 270590,                                       http://4Suite.org
Louisville, CO 80027-5009, USA
XML strategy, XML tools, knowledge management



More information about the Versa mailing list