<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/01/fa33962c45f49aeaef30c5b8c07a5fec"
  from="Mike Potanin &lt;potanin@m...&gt;"
  author="Mike Potanin"
  date="2003-01-29T16:35:48"
  subject="Re: [Caml-list] AST and &quot;when&quot;"
  prev="2003/01/0494f07a636297e85ad88a73700c7d84"
  next="2003/01/d0b66887cf76a8cb2fdfb72cd5b70f0f"
  prev-in-thread="2003/01/0494f07a636297e85ad88a73700c7d84"
  prev-thread="2003/01/d0f887ae26f1c4bf6ade216977deba32"
  next-thread="2003/01/92e294ab72bc62127ee9455ff8c411e8"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] AST and &quot;when&quot;">
<msg 
  url="2003/01/fb18c346f65204d6f3afadad83bd0f03"
  from="Mike Potanin &lt;potanin@m...&gt;"
  author="Mike Potanin"
  date="2003-01-29T11:04:06"
  subject="[Caml-list] AST and &quot;when&quot;">
<msg 
  url="2003/01/735ed9e71e88a4cf46dcfe0566d1b115"
  from="Olivier Andrieu &lt;andrieu@i...&gt;"
  author="Olivier Andrieu"
  date="2003-01-29T14:33:56"
  subject="Re: [Caml-list] AST and &quot;when&quot;">
<msg 
  url="2003/01/922b2da371598713ba9e6dd461b9df4a"
  from="Mike Potanin &lt;potanin@m...&gt;"
  author="Mike Potanin"
  date="2003-01-29T15:17:21"
  subject="Re: [Caml-list] AST and &quot;when&quot;">
<msg 
  url="2003/01/0494f07a636297e85ad88a73700c7d84"
  from="Olivier Andrieu &lt;andrieu@i...&gt;"
  author="Olivier Andrieu"
  date="2003-01-29T15:43:30"
  subject="Re: [Caml-list] AST and &quot;when&quot;">
<msg 
  url="2003/01/fa33962c45f49aeaef30c5b8c07a5fec"
  from="Mike Potanin &lt;potanin@m...&gt;"
  author="Mike Potanin"
  date="2003-01-29T16:35:48"
  subject="Re: [Caml-list] AST and &quot;when&quot;">
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
On Wed, 29 Jan 2003, Olivier Andrieu wrote:

Whether I can make "formula" quotation so it compile
 match e with
  &lt;:formula&lt; sin(@x) ^ 2 + cos(@x) ^ 2 &gt;&gt; -&gt; &lt;:formula&lt; 1 &gt;&gt;
to
 match e with
  (Sum [(Pow1 (Sin x) 2); (Pow1 (Cos x_temp) 2)]) when x==x_temp
     -&gt; Const 1
Or I mast write
 match e with
  &lt;:formula&lt; sin(@x) ^ 2 + cos(@y) ^ 2 &gt;&gt; when x==y
     -&gt; &lt;:formula&lt; 1 &gt;&gt;

&gt;  Mike Potanin [Wednesday 29 January 2003] :
&gt;
&gt; I don't think so: in `a when a&lt;0', only the first `a' is a pattern,
&gt; the when + expr is part of the `match' (or `try' or `function')
&gt; construct which is at the expression level.
&gt;
&gt;  &gt; (MLast.PaLid ((0, 0), "a"),
&gt;  &gt;   Some
&gt;  &gt;    (MLast.ExApp ((0, 0),
&gt;  &gt;      MLast.ExApp ((0, 0), MLast.ExLid ((0, 0), "&lt;"),
&gt;  &gt;       MLast.ExLid ((0, 0), "a")),
&gt;  &gt;      MLast.ExInt ((0, 0), "0")))
&gt;
&gt; that's not a single pattern (MLast.patt), that's a tuple of type
&gt; `MLast.patt * MLast.expr option'

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

