<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body smarttemplateinserted="true" bgcolor="#FFFFFF" text="#000000">
<div id="smartTemplate4-template">Hi,<br>
<br>
<p>
<blockquote type="cite">
<pre wrap=""> 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).</pre>
</blockquote>
</p>
<p><br>
</p>
<p>although some implementations have a scripting extensions,
where there actually is an assignment operator, which does both
these things.<br>
</p>
<br>
<br>
Cheers,<br>
Benito </div>
<br>
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 11/21/2016 06:40 PM, Joe Wicentowski
wrote:<br>
</div>
<blockquote
cite="mid:CAHwerk0WSE0XBwEvZiuOsWn195K6uDUg2kdPfPzGQWXWwvhq8A@mail.gmail.com"
type="cite">
<pre wrap="">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
<a class="moz-txt-link-freetext" href="https://www.google.com/search?q=%22assignment+operator%22+xquery">https://www.google.com/search?q=%22assignment+operator%22+xquery</a>.)
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
</pre>
<blockquote type="cite">
<pre wrap="">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.
</pre>
</blockquote>
<pre wrap="">
_______________________________________________
<a class="moz-txt-link-abbreviated" href="mailto:talk@x-query.com">talk@x-query.com</a>
<a class="moz-txt-link-freetext" href="http://x-query.com/mailman/listinfo/talk">http://x-query.com/mailman/listinfo/talk</a></pre>
</blockquote>
<br>
</body>
</html>