From christine.schwartz at ptsem.edu Tue Nov 1 10:52:18 2016 From: christine.schwartz at ptsem.edu (Schwartz, Christine) Date: Tue, 1 Nov 2016 17:52:18 +0000 Subject: [xquery-talk] Unusual XPath syntax question In-Reply-To: References: <9A3223ADEBFC75488A09810F4478FE4A01AB1777C7@Exchange01.pts-eden.org> <5E7CC9AC-248A-478D-8CAD-50E2B5ADD478@saxonica.com> Message-ID: <9A3223ADEBFC75488A09810F4478FE4A01AB178CFC@Exchange01.pts-eden.org> Thank you to everyone who answered my question yesterday. I?m glad to know that ?./.? is the same as ?.? except that the longer version will throw an error if the context item is not a node. Since we are teaching beginners, I?m going to suggest to my colleague that we use the shorter version ?.? in the example. Also, sorry I wrote to the XQuery list for an XSLT question. I?m just not subscribed to an XSLT list, but really should be. After years of using XQuery as my ?hammer? I?m starting to use XSLT more when appropriate. Best, Chris Christine Schwartz Metadata Librarian and XML Database Administrator Princeton Theological Seminary Library From: W.S. Hager [mailto:wshager at gmail.com] Sent: Monday, October 31, 2016 6:12 PM To: Michael Kay Cc: Schwartz, Christine ; talk at x-query.com Subject: Re: [xquery-talk] Unusual XPath syntax question I just love to do .[1][1][1][1][1][1][1] Op 31 okt. 2016 19:19 schreef "Michael Kay" >: I agree with the other respondents: apart from giving an error if the context item is not a node, "./." is precisely equivalent to ".". (Not sure why an XSLT question is appearing on the XQuery list...) There's a certain fondness for verbosity in some parts of the XSLT user community. It's quite common to see "./price" where "price" would serve perfectly well, or "price/text()" for "price"; or xsl:element and xsl:attribute used where literal result elements would do the job, or (my favourite gripe) where would serve the purpose better. And of course we've all seen things like . I think some XSLT programmers must be paid by the yard; alternatively the language attracts those who love the sourd of their own keyboard. But "./." isn't an expansion I have seen before. Michael Kay Saxonica > On 31 Oct 2016, at 16:52, Schwartz, Christine > wrote: > > Hi, > > I'm hoping someone on this list can clarify my conundrum. > > I'm working with a colleague on a writing project and one of his examples uses this XPath syntax "./." in the starts-with() function within an XSLT stylesheet. I don't know what "./." means. I would think that "." alone would be sufficient to refer to the context node. > > Here's the example: > > > > > > > . > > > > > . > > > > > . > > > > > . > > Thanks, > > Chris > > Christine Schwartz > Metadata Librarian and XML Database Administrator > Princeton Theological Seminary > Library > P.O. Box 821 > Princeton, NJ 08542 > christine.schwartz at ptsem.edu > (609) 497-7938 > > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk -------------- next part -------------- An HTML attachment was scrubbed... URL: From ghislain.fourny at gmail.com Wed Nov 2 02:21:11 2016 From: ghislain.fourny at gmail.com (Ghislain Fourny) Date: Wed, 2 Nov 2016 10:21:11 +0100 Subject: [xquery-talk] Unusual XPath syntax question In-Reply-To: <9A3223ADEBFC75488A09810F4478FE4A01AB178CFC@Exchange01.pts-eden.org> References: <9A3223ADEBFC75488A09810F4478FE4A01AB1777C7@Exchange01.pts-eden.org> <5E7CC9AC-248A-478D-8CAD-50E2B5ADD478@saxonica.com> <9A3223ADEBFC75488A09810F4478FE4A01AB178CFC@Exchange01.pts-eden.org> Message-ID: <710FBCF7-9800-4983-AE0B-8D8D7A601288@gmail.com> Hi Christine, For your defence: this was technically an XPath question, and as such that is also relevant to XQuery :-) Kind regards, Ghislain > On 1 Nov 2016, at 18:52, Schwartz, Christine wrote: > > Thank you to everyone who answered my question yesterday. I?m glad to know that ?./.? is the same as ?.? except that the longer version will throw an error if the context item is not a node. Since we are teaching beginners, I?m going to suggest to my colleague that we use the shorter version ?.? in the example. > > Also, sorry I wrote to the XQuery list for an XSLT question. I?m just not subscribed to an XSLT list, but really should be. After years of using XQuery as my ?hammer? I?m starting to use XSLT more when appropriate. > > Best, > > Chris > > > Christine Schwartz > Metadata Librarian and XML Database Administrator > Princeton Theological Seminary Library > > > > > From: W.S. Hager [mailto:wshager at gmail.com] > Sent: Monday, October 31, 2016 6:12 PM > To: Michael Kay > Cc: Schwartz, Christine ; talk at x-query.com > Subject: Re: [xquery-talk] Unusual XPath syntax question > > I just love to do .[1][1][1][1][1][1][1] > > > Op 31 okt. 2016 19:19 schreef "Michael Kay" : > I agree with the other respondents: apart from giving an error if the context item is not a node, "./." is precisely equivalent to ".". > > (Not sure why an XSLT question is appearing on the XQuery list...) > > There's a certain fondness for verbosity in some parts of the XSLT user community. It's quite common to see "./price" where "price" would serve perfectly well, or "price/text()" for "price"; or xsl:element and xsl:attribute used where literal result elements would do the job, or (my favourite gripe) > > > > > > where would serve the purpose better. > > And of course we've all seen things like . > > I think some XSLT programmers must be paid by the yard; alternatively the language attracts those who love the sourd of their own keyboard. But "./." isn't an expansion I have seen before. > > Michael Kay > Saxonica > > > On 31 Oct 2016, at 16:52, Schwartz, Christine wrote: > > > > Hi, > > > > I'm hoping someone on this list can clarify my conundrum. > > > > I'm working with a colleague on a writing project and one of his examples uses this XPath syntax "./." in the starts-with() function within an XSLT stylesheet. I don't know what "./." means. I would think that "." alone would be sufficient to refer to the context node. > > > > Here's the example: > > > > > > > > > > > > > > . > > > > > > > > > > . > > > > > > > > > > . > > > > > > > > > > . > > > > Thanks, > > > > Chris > > > > Christine Schwartz > > Metadata Librarian and XML Database Administrator > > Princeton Theological Seminary > > Library > > P.O. Box 821 > > Princeton, NJ 08542 > > christine.schwartz at ptsem.edu > > (609) 497-7938 > > > > > > > > _______________________________________________ > > talk at x-query.com > > http://x-query.com/mailman/listinfo/talk > > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From benito at benibela.de Sun Nov 20 07:02:00 2016 From: benito at benibela.de (Benito van der Zander) Date: Sun, 20 Nov 2016 16:02:00 +0100 Subject: [xquery-talk] [ANN] Xidel 0.9.6 released Message-ID: Hello, Xidel is a command line tool to download X/HTML pages or access JSON-APIs and extract data from there. It supports XPath 3.0, XQuery 3.0 + JSONiq expressions, compatibility modes for older XPath/XQuery versions as well as CSS 3 selectors and pattern-matching templates. The 0.9.6 version * disables all extensions on an xquery version declaration unless a version code like "3.0-xidel" or "3.0-jsoniq" is used. * #!xidel in the first line is ignored, so it can be used for executable XQuery scripts. * adds a function x:request for HTTP or follow-like requests inside a query. It is similar to the EXPath http-client module, but uses a map for options rather than an XML element. * new functions: x:argc, x:argv, x:integer, x:integer-to-base. Latter two can e.g. handle hexadecimal numbers. * fixes that entities were not decoded, if --output-encoding was not set * improves default encoding settings when converting between Windows terminal encoding and utf8 for piped files * a new JSON parser with two distinct modes: input formats json/json-strict for accepting/rejecting invalid JSON * JSON output is prettified. * has various fixes, performance improvements and internal restructuring You can learn more on the homepage here: http://www.videlibri.de/xidel.html Benito -------------- next part -------------- An HTML attachment was scrubbed... URL: From joewiz at gmail.com Sun Nov 20 15:59:23 2016 From: joewiz at gmail.com (Joe Wicentowski) Date: Sun, 20 Nov 2016 18:59:23 -0500 Subject: [xquery-talk] := Message-ID: Hi all, I could've sworn that ":=" had a name like "binding operator," but as far as I can see from the XPath or XQuery specs, it gives no name or description to this symbol other than appearances in EBNFs for LetBinding, GroupingSpec, VarDecl, and ContextItemDecl -- as a literal ":=". Does ":=" really have no name or plain English description in the spec? If so, this is surprising given its prominence in the let clause. Having one would certainly be very useful when teaching the language. Thanks, Joe From ghislain.fourny at gmail.com Sun Nov 20 22:24:04 2016 From: ghislain.fourny at gmail.com (Ghislain Fourny) Date: Mon, 21 Nov 2016 06:24:04 +0000 Subject: [xquery-talk] := In-Reply-To: References: Message-ID: Hi Joe, Syntactically, ":=" is not an operator because it does not produce an output sequence of items like "+" or "and" or "/". It is part of let and group-by clauses (which produce tuples) as well as variable and context item declarations (which contribute to the dynamic context). >From a pedagogical perspective, I would simply call it a variable binding, the important part being not to call it "assignment" to make clear that it is a functional and declarative language. I hope these 2 cents help! Kind regards, Ghislain On Mon, Nov 21, 2016 at 1:01 AM Joe Wicentowski wrote: > Hi all, > > I could've sworn that ":=" had a name like "binding operator," but as far > as I can see from the XPath or XQuery specs, it gives no name or > description to this symbol other than appearances in EBNFs for LetBinding, > GroupingSpec, VarDecl, and ContextItemDecl -- as a literal ":=". > > Does ":=" really have no name or plain English description in the spec? > > If so, this is surprising given its prominence in the let clause. Having > one would certainly be very useful when teaching the language. > > Thanks, > Joe > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joewiz at gmail.com Mon Nov 21 09:40:26 2016 From: joewiz at gmail.com (Joe Wicentowski) Date: Mon, 21 Nov 2016 12:40:26 -0500 Subject: [xquery-talk] := In-Reply-To: References: Message-ID: Hi Ghislain, Thanks very much for your reply! If ":=" is not an "operator," by your helpful definition, then is there a category like "symbol," "delimiter," or at worst, "thingy," that it *does* rightly belong to? I'm looking to fill in the blank in the following sentence, which builds on your summary: ":=" has no formal name in the XPath and XQuery specifications but is used extensively in clauses and declarations that bind variables. Specifically, it is used in let and group-by clauses (which produce tuples) as well as variable and context item declarations (which contribute to the dynamic context). Rather than leaving this important symbol nameless, let's call it the "binding ____." I'm also thinking of a parenthetical note or footnote like this: You may find some resources that somewhat misleadingly define ":=" as the "assignment operator," a phrase that is not found in any XQuery or XPath specification. Calling ":=" the "assignment operator" is incorrect in two respects. First, ":=" is involved in the *binding*, not *assigning*, of values to variables?an important distinction in functional and declarative languages like XQuery, in which a variable, once bound to a value, cannot be altered, or reassigned a different value. Second, the ":=" cannot be described as an *operator* because it does not produce an output sequence of items, in contrast to operators like "+" (an arithmetic operator), "and" (a boolean operator), and "/" (an operator for connecting steps in a path expression). (For some resources that use the term "assignment operator," see via https://www.google.com/search?q=%22assignment+operator%22+xquery.) It's funny, "/" didn't have a name in XPath 1.0, but got one in XPath 3.0 - "path operator." Perhaps it's time for ":=" to get a name? Thanks again, Joe > Syntactically, ":=" is not an operator because it does not produce an output > sequence of items like "+" or "and" or "/". It is part of let and group-by > clauses (which produce tuples) as well as variable and context item > declarations (which contribute to the dynamic context). > > From a pedagogical perspective, I would simply call it a variable binding, > the important part being not to call it "assignment" to make clear that it > is a functional and declarative language. From mike at saxonica.com Mon Nov 21 10:02:38 2016 From: mike at saxonica.com (Michael Kay) Date: Mon, 21 Nov 2016 18:02:38 +0000 Subject: [xquery-talk] := In-Reply-To: References: Message-ID: <3A185E0E-83EC-4C43-BE51-9E4525EDB0FD@saxonica.com> Actually most of the symbols in the language don't have names. For example "+" doesn't have a name. The */?/+ symbols that can follow an ItemType are collectively referred to as OccurrenceIndicators, but they don't have individual names. Most of the time we talk about symbols, we refer to them by the names of the characters that are used to spell them. The dollar sign that prefixes a variable name is just a dollar sign, so I guess that ":=" is just "colon-equals". When you're writing tutorials, documentation, etc, it's always a tough call whether to stick rigidly to the terminology of the spec or to introduce terms of your own. I'll go either way depending on the merits of the case. Usually I try to stick to standard terminology but if the terminology in the spec is really bad then I'll introduce something new (for example I reckoned that no-one except the most avid spec-readers would know what an error message referring to a "transform expression" was talking about, so I called it a "copy-modify expression" instead). Personally I find the distinction between assignment and binding rather precious. After all, we use the terms "variable" and "function" in both procedural and functional language to mean somewhat different things, and no-one minds. When I come to a new language, I find it easier if most of the terminology is familiar, even if the properties of the objects or operations that the terms refer to are a bit different. Michael Kay Saxonica > On 21 Nov 2016, at 17:40, Joe Wicentowski wrote: > > Hi Ghislain, > > Thanks very much for your reply! If ":=" is not an "operator," by > your helpful definition, then is there a category like "symbol," > "delimiter," or at worst, "thingy," that it *does* rightly belong to? > I'm looking to fill in the blank in the following sentence, which > builds on your summary: > > ":=" has no formal name in the XPath and XQuery specifications but > is used extensively in clauses and declarations that bind variables. > Specifically, it is used in let and group-by clauses (which produce > tuples) as well as variable and context item declarations (which > contribute to the dynamic context). Rather than leaving this important > symbol nameless, let's call it the "binding ____." > > I'm also thinking of a parenthetical note or footnote like this: > > You may find some resources that somewhat misleadingly define ":=" > as the "assignment operator," a phrase that is not found in any XQuery > or XPath specification. Calling ":=" the "assignment operator" is > incorrect in two respects. First, ":=" is involved in the *binding*, > not *assigning*, of values to variables?an important distinction in > functional and declarative languages like XQuery, in which a variable, > once bound to a value, cannot be altered, or reassigned a different > value. Second, the ":=" cannot be described as an *operator* because > it does not produce an output sequence of items, in contrast to > operators like "+" (an arithmetic operator), "and" (a boolean > operator), and "/" (an operator for connecting steps in a path > expression). > > (For some resources that use the term "assignment operator," see via > https://www.google.com/search?q=%22assignment+operator%22+xquery.) > > It's funny, "/" didn't have a name in XPath 1.0, but got one in XPath > 3.0 - "path operator." Perhaps it's time for ":=" to get a name? > > Thanks again, > Joe > >> Syntactically, ":=" is not an operator because it does not produce an output >> sequence of items like "+" or "and" or "/". It is part of let and group-by >> clauses (which produce tuples) as well as variable and context item >> declarations (which contribute to the dynamic context). >> >> From a pedagogical perspective, I would simply call it a variable binding, >> the important part being not to call it "assignment" to make clear that it >> is a functional and declarative language. > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From joewiz at gmail.com Mon Nov 21 10:29:35 2016 From: joewiz at gmail.com (Joe Wicentowski) Date: Mon, 21 Nov 2016 13:29:35 -0500 Subject: [xquery-talk] := In-Reply-To: <3A185E0E-83EC-4C43-BE51-9E4525EDB0FD@saxonica.com> References: <3A185E0E-83EC-4C43-BE51-9E4525EDB0FD@saxonica.com> Message-ID: Hi Mike, > Actually most of the symbols in the language don't have names. For example "+" doesn't have a name. Fair point. But it is at least possible to track down or piece together a plain English description of the "+" operator, e.g., at https://www.w3.org/TR/xpath-functions-31/#func-numeric-add. Similarly, the dollar sign that prefixes a variable name is explained in plain English at https://www.w3.org/TR/xquery-31/#id-variables. I'm okay with calling ":=" "colon-equals" or even not giving it a name. But unlike the other unnamed symbols, ":=" has no plain English definition, only an indirect, tertiary definition by way of the EBNF notation for clauses that use it. I'm not saying that the spec is obligated to provide a name or plain English description for all symbols, but it does strike me that an agreed-upon description for this one - prominent in the L of XQuery's signature expression - would be useful to provide to people learning the language. Thanks, Joe From liam at w3.org Mon Nov 21 12:01:13 2016 From: liam at w3.org (Liam R. E. Quin) Date: Mon, 21 Nov 2016 15:01:13 -0500 Subject: [xquery-talk] := In-Reply-To: References: <3A185E0E-83EC-4C43-BE51-9E4525EDB0FD@saxonica.com> Message-ID: <1479758473.29052.115.camel@w3.org> On Mon, 2016-11-21 at 13:29 -0500, Joe Wicentowski wrote: > Hi Mike, > > > > > Actually most of the symbols in the language don't have names. For > > example "+" doesn't have a name. > > Fair point. But it is at least possible to track down or piece > together a plain English description of the "+" operator, The - sign, however, has multiple uses as do ( and ) and so does the full stop: referring to a full stop (or "period") in 3.14159 isn't usual terminology and referring to a decimal point in $person/socks[. = "black"] is both confusing and technically incorrect. For my part I prefer to teach people using as little jargon as possible and only add names for things when we're going to be referring to them a lot. It's probably more useful for people to understand that := generally appears in binding expressions, in which a name on the left is associated with something on the right, than to delve into the grammar. But a lot depends on your teaching style and the audience, and I haven't taught XQuery particularly. If you'd like to give := a name, e.g. "the greybeard symbol", please feel free to file a comment against XQuery 3.1 and/or XPath 3.1 (there's instruections in the editors' drafts e.g. at https://www.w3.org/XML/Group/qtspecs/specifications/xquery-31/html/xque ry-31.html and the "Status" sections has pointers to bugzilla. If it will help people in teaching we could add a note. But I think we'd want to hear from multiple people, as this is the first request I've seen. Of course, as Mike Kay suggested, you could also invent your own name for it (sideways double-i?) and use that too! Thanks, Liam -- Liam R. E. Quin The World Wide Web Consortium (W3C) From jmdyck at ibiblio.org Mon Nov 21 12:40:03 2016 From: jmdyck at ibiblio.org (Michael Dyck) Date: Mon, 21 Nov 2016 15:40:03 -0500 Subject: [xquery-talk] := In-Reply-To: References: Message-ID: On 16-11-21 12:40 PM, Joe Wicentowski wrote: > > Thanks very much for your reply! If ":=" is not an "operator," by > your helpful definition, then is there a category like "symbol," > "delimiter," or at worst, "thingy," that it *does* rightly belong to? Yup, Appendix A lets you call it a "symbol". (More specifically, a "terminal symbol" or a "delimiting terminal symbol", but those are too cumbersome for the blank in your sample sentence.) -Michael From benito at benibela.de Mon Nov 21 13:19:18 2016 From: benito at benibela.de (Benito van der Zander) Date: Mon, 21 Nov 2016 22:19:18 +0100 Subject: [xquery-talk] := In-Reply-To: References: Message-ID: <6821fd1e-bcb1-c377-b5a1-62c5304a9b28@benibela.de> Hi, > You may find some resources that somewhat misleadingly define ":=" > as the "assignment operator," a phrase that is not found in any XQuery > or XPath specification. Calling ":=" the "assignment operator" is > incorrect in two respects. First, ":=" is involved in the *binding*, > not *assigning*, of values to variables?an important distinction in > functional and declarative languages like XQuery, in which a variable, > once bound to a value, cannot be altered, or reassigned a different > value. Second, the ":=" cannot be described as an *operator* because > it does not produce an output sequence of items, in contrast to > operators like "+" (an arithmetic operator), "and" (a boolean > operator), and "/" (an operator for connecting steps in a path > expression). although some implementations have a scripting extensions, where there actually is an assignment operator, which does both these things. Cheers, Benito On 11/21/2016 06:40 PM, Joe Wicentowski wrote: > Hi Ghislain, > > Thanks very much for your reply! If ":=" is not an "operator," by > your helpful definition, then is there a category like "symbol," > "delimiter," or at worst, "thingy," that it *does* rightly belong to? > I'm looking to fill in the blank in the following sentence, which > builds on your summary: > > ":=" has no formal name in the XPath and XQuery specifications but > is used extensively in clauses and declarations that bind variables. > Specifically, it is used in let and group-by clauses (which produce > tuples) as well as variable and context item declarations (which > contribute to the dynamic context). Rather than leaving this important > symbol nameless, let's call it the "binding ____." > > I'm also thinking of a parenthetical note or footnote like this: > > You may find some resources that somewhat misleadingly define ":=" > as the "assignment operator," a phrase that is not found in any XQuery > or XPath specification. Calling ":=" the "assignment operator" is > incorrect in two respects. First, ":=" is involved in the *binding*, > not *assigning*, of values to variables?an important distinction in > functional and declarative languages like XQuery, in which a variable, > once bound to a value, cannot be altered, or reassigned a different > value. Second, the ":=" cannot be described as an *operator* because > it does not produce an output sequence of items, in contrast to > operators like "+" (an arithmetic operator), "and" (a boolean > operator), and "/" (an operator for connecting steps in a path > expression). > > (For some resources that use the term "assignment operator," see via > https://www.google.com/search?q=%22assignment+operator%22+xquery.) > > It's funny, "/" didn't have a name in XPath 1.0, but got one in XPath > 3.0 - "path operator." Perhaps it's time for ":=" to get a name? > > Thanks again, > Joe > >> Syntactically, ":=" is not an operator because it does not produce an output >> sequence of items like "+" or "and" or "/". It is part of let and group-by >> clauses (which produce tuples) as well as variable and context item >> declarations (which contribute to the dynamic context). >> >> From a pedagogical perspective, I would simply call it a variable binding, >> the important part being not to call it "assignment" to make clear that it >> is a functional and declarative language. > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk -------------- next part -------------- An HTML attachment was scrubbed... URL: From ghislain.fourny at gmail.com Mon Nov 21 23:15:01 2016 From: ghislain.fourny at gmail.com (Ghislain Fourny) Date: Tue, 22 Nov 2016 07:15:01 +0000 Subject: [xquery-talk] := In-Reply-To: <6821fd1e-bcb1-c377-b5a1-62c5304a9b28@benibela.de> References: <6821fd1e-bcb1-c377-b5a1-62c5304a9b28@benibela.de> Message-ID: Hi Benito, Yes, that's true. The semantics for scripting is different even though the same symbol is used. This is mostly the reason why I distinguish between binding and assignment for pedagogical purposes, although I do agree with Mike's point that in the end understanding the semantics of a language matters more than the terminology used. In some scripting extensions, Zorba's for example, assignments are statements, and mean that there is a change of snapshot following a side effect (actually changing the value of a variable), and this side effect is subsequently visible everywhere else in the program (for example through a global variable). This is different from a binding, in that binding a value to a variable merely organizes dynamic contexts in various scopes in which other expressions are evaluated. I visualize the difference like so: side effects due to assignments propagate linearly, left-to-right, in time, whereas variable bindings propagate top-down in an arborescent manner, in a functional way. Kind regards, Ghislain On Mon, Nov 21, 2016 at 10:12 PM Benito van der Zander wrote: > Hi, > > > You may find some resources that somewhat misleadingly define ":=" > as the "assignment operator," a phrase that is not found in any XQuery > or XPath specification. Calling ":=" the "assignment operator" is > incorrect in two respects. First, ":=" is involved in the *binding*, > not *assigning*, of values to variables?an important distinction in > functional and declarative languages like XQuery, in which a variable, > once bound to a value, cannot be altered, or reassigned a different > value. Second, the ":=" cannot be described as an *operator* because > it does not produce an output sequence of items, in contrast to > operators like "+" (an arithmetic operator), "and" (a boolean > operator), and "/" (an operator for connecting steps in a path > expression). > > > although some implementations have a scripting extensions, where there > actually is an assignment operator, which does both these things. > > > > Cheers, > Benito > > > > On 11/21/2016 06:40 PM, Joe Wicentowski wrote: > > Hi Ghislain, > > Thanks very much for your reply! If ":=" is not an "operator," by > your helpful definition, then is there a category like "symbol," > "delimiter," or at worst, "thingy," that it *does* rightly belong to? > I'm looking to fill in the blank in the following sentence, which > builds on your summary: > > ":=" has no formal name in the XPath and XQuery specifications but > is used extensively in clauses and declarations that bind variables. > Specifically, it is used in let and group-by clauses (which produce > tuples) as well as variable and context item declarations (which > contribute to the dynamic context). Rather than leaving this important > symbol nameless, let's call it the "binding ____." > > I'm also thinking of a parenthetical note or footnote like this: > > You may find some resources that somewhat misleadingly define ":=" > as the "assignment operator," a phrase that is not found in any XQuery > or XPath specification. Calling ":=" the "assignment operator" is > incorrect in two respects. First, ":=" is involved in the *binding*, > not *assigning*, of values to variables?an important distinction in > functional and declarative languages like XQuery, in which a variable, > once bound to a value, cannot be altered, or reassigned a different > value. Second, the ":=" cannot be described as an *operator* because > it does not produce an output sequence of items, in contrast to > operators like "+" (an arithmetic operator), "and" (a boolean > operator), and "/" (an operator for connecting steps in a path > expression). > > (For some resources that use the term "assignment operator," see viahttps://www.google.com/search?q=%22assignment+operator%22+xquery.) > > It's funny, "/" didn't have a name in XPath 1.0, but got one in XPath > 3.0 - "path operator." Perhaps it's time for ":=" to get a name? > > Thanks again, > Joe > > > Syntactically, ":=" is not an operator because it does not produce an output > sequence of items like "+" or "and" or "/". It is part of let and group-by > clauses (which produce tuples) as well as variable and context item > declarations (which contribute to the dynamic context). > > From a pedagogical perspective, I would simply call it a variable binding, > the important part being not to call it "assignment" to make clear that it > is a functional and declarative language. > > > _______________________________________________talk at x-query.comhttp://x-query.com/mailman/listinfo/talk > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: