Commit 6b49354f authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2003-09-23 11:22:30 by cvscast] Empty log message

Original author: cvscast
Date: 2003-09-23 11:24:05+00:00
parent 330ca302
......@@ -38,8 +38,8 @@ attribute is missing, the default value of "true" is presumed.
</p>
<p>
But what if we have two optional attributes? The naive solution would be
to write
<i>three</i> cases in the above function:
to write the
<i>four</i> possible cases:
</p>
<sample><![CDATA[
type Sample = <sample lineno=?"true"|"false" highlight=?"true"|"false">String
......@@ -48,7 +48,7 @@ let content (Sample -> String)
| <sample highlight="false" lineno="false">_ -> "lineno=false, highlight=false"
| <sample lineno="false">_ -> "lineno=false, highlight=true"
| <sample highlight="false">_ -> "lineno=true, highlight=false"
| <sample>_ -> "lineno=true,, highlight=true,"
| <sample>_ -> "lineno=true, highlight=true,"
]]></sample>
<p>
......@@ -61,9 +61,9 @@ is to resort to intersection and default patterns as follows:
</p>
<sample><![CDATA[
let content (Sample -> String)
| <sample ( ({ highlight = h } | (h := "true"))
&({ lineno = l } | (l := "true")) )>_
-> ['lineno=' l ', highlight= ' h]
| <sample ( ({ highlight = h } | (h {{:=}} "true"))
{{&}}({ lineno = l } | (l {{:=}} "true")) )>_
-> ['lineno=' l ', highlight=' h]
]]></sample>
<p>
......
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