Commit 0da1445b authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2004-04-23 21:54:08 by beppe] Stressed the fact that ":" must be surrounded by blanks

Original author: beppe
Date: 2004-04-23 21:54:08+00:00
parent 039b16b2
......@@ -123,15 +123,25 @@ an alternative notation, which is lighter for several arguments
</p>
<sample><![CDATA[
fun %%f%% (%%p1%% : %%t1%%, %%...%%, %%pn:tn%%) : %%s%% = %%e%%
fun %%f%% (%%p1%% : %%t1%%, %%...%%, %%pn : tn%%) : %%s%% = %%e%%
]]></sample>
<p>
which is strictly equivalent to:
(note the blank spaces around the colons which are mandatory when the
pattern is a variable
<footnote>
The reason why the blank spaces are mandatory with variables is that the XML
recommendation allows colons to occur in variables ("names" in XML terminology:
see section on <a href="namespaces.html">namespaces</a>), so the blanks disambiguate
the variables. Actually only the blank on the right handside is necessary:
CDuce accepts <code>fun %%f%% (%%x1%% :%%t1%%, %%...%%, %%xn :tn%%):%%s%% =
%%e%%</code>, as well (see also <a
href="tutorial_getting_started.html#bnote1">this paragraph</a> on
<code>let</code> declarations in the tutorial).</footnote>) which is strictly
equivalent to:
</p>
<sample><![CDATA[
fun %%f%% ((%%t1%%,%%...%%,%%tn%%) -> %%s%%) (%%p1%%,%%...%%,%%pn%%) -> %%e%%
]]></sample>
<p>
The standard notation for local binding a function is:
</p>
......
......@@ -115,7 +115,13 @@ The form <code>let x&amp;%%t%% = %%e%% in %%e'%%</code> is used so often that we
<sample><![CDATA[
let x : %%t%% = %%e%% in %%e'%%
]]></sample>
Note the blank spaces around the colon: this is because the XML recommendation allows colons to occur in identifiers: see the section on <a href="namespaces.html">namespaces</a> (the same holds to for the functional arrow <code>-></code> which must be surrounded by blanks).
Note the blank spaces around the colons
<footnote>
Actually only the first blank is necessary. CDuce accepts <code>let x :%%t%% = %%e%% in %%e'%%</code>,
as well
</footnote>.
This is because the XML recommendation allows colons to occur in identifiers: see the User's Manual section on <a href="namespaces.html">namespaces</a>. (the same holds to for the functional arrow symbol <code>-></code> which must be surrounded by blanks and by colons in the formal parameters of a function: see <a
href="manual_expressions.html#bnote1">this paragraph</a> of the User's manual).
</box>
<box title="XML documents" link="xml">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment