Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
1a222c49
Commit
1a222c49
authored
Jul 10, 2007
by
Pietro Abate
Browse files
[r2003-07-22 20:43:38 by cvscast] Typos
Original author: cvscast Date: 2003-07-22 20:43:39+00:00
parent
dd909de7
Changes
3
Hide whitespace changes
Inline
Side-by-side
web/manual/types_patterns.xml
View file @
1a222c49
...
...
@@ -383,8 +383,8 @@ are expressions.
They are two kinds of record types. Open record types
are written
<code>
{ %%l1%% = %%t1%%; %%...%%; %%ln%% = %%tn%%
}
</code>
, and closed record types are written
<code>
{ %%l1%% = %%t1%%; %%...%%; %%ln%% = %%tn%%
}
</code>
.
<code>
{
|
%%l1%% = %%t1%%; %%...%%; %%ln%% = %%tn%%
|
}
</code>
.
Both denote all the record values where
the labels
<code>
%%li%%
</code>
are present and the associated values
are in the corresponding type. The distinction is that that open
...
...
web/tutorial/first_functions.xml
View file @
1a222c49
...
...
@@ -195,7 +195,7 @@ add a new pattern matching branch in the definition of the function
PhoneBook
</code>
elements. This yields the following
<i>
overloaded
</i>
function:
</p><a
name=
"names3"
/>
<sample>
<![CDATA[
let names3 (ParentBook ->
[Name*] ; PhoneBook->[String*])
let names3 (ParentBook ->
[Name*] ; PhoneBook
->
[String*])
|
<parentbook>
x -> map x with
<person>
[ n _* ] -> n
|
<phonebook>
x -> map x with { name=n } -> n
]]>
</sample>
...
...
@@ -207,7 +207,7 @@ returns a list of strings. We can factorize the two branches in a unique
alternative pattern:
</p>
<sample>
<![CDATA[
let names4 (ParentBook ->
[Name*] ; PhoneBook->[String*])
let names4 (ParentBook ->
[Name*] ; PhoneBook
->
[String*])
<_>
x -> map x with (
<person>
[ n _* ] | { name=n } ) -> n
]]>
</sample>
<p>
The interface ensures that the two representations will never mix.
</p>
...
...
web/tutorial/patterns.xml
View file @
1a222c49
...
...
@@ -104,7 +104,7 @@ any, otherwise the last e-mail, if any, otherwise any telephone number, or the
string
<code>
"no contact"
</code>
:
</p>
<sample>
<![CDATA[
let preferred_contact(Person->
String)
let preferred_contact(Person
->
String)
<_>
[ _ _ ( _*?
<tel
kind=
"work"
>
x) | (_*
<email>
x) |
<tel>
x ] -> x
| _ -> "no contact"
]]>
</sample>
...
...
@@ -114,4 +114,4 @@ the only possible remaining case).
</p>
</box>
</page>
\ No newline at end of file
</page>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment