<?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="2006/02/4c3947fbf7a2d35c0dee767bba62dfa0"
  from="Basile STARYNKEVITCH &lt;basile@s...&gt;"
  author="Basile STARYNKEVITCH"
  date="2006-02-13T19:29:37"
  subject="(quasi FAQ) object, variants, .... Unbound type parameter [..]"
  prev="2006/02/90d9e4642462c7664427ec1e4375a828"
  next="2006/02/ee7c18da8116e31dd45fc11796083127"
  next-in-thread="2006/02/ee7c18da8116e31dd45fc11796083127"
  prev-thread="2006/02/90d9e4642462c7664427ec1e4375a828"
  next-thread="2006/02/e2ac6157fdcc6fcaefdce3f8dd56911d"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="(quasi FAQ) object, variants, .... Unbound type parameter [..]">
<msg 
  url="2006/02/4c3947fbf7a2d35c0dee767bba62dfa0"
  from="Basile STARYNKEVITCH &lt;basile@s...&gt;"
  author="Basile STARYNKEVITCH"
  date="2006-02-13T19:29:37"
  subject="(quasi FAQ) object, variants, .... Unbound type parameter [..]">
<msg 
  url="2006/02/ee7c18da8116e31dd45fc11796083127"
  from="Martin Jambon &lt;martin_jambon@e...&gt;"
  author="Martin Jambon"
  date="2006-02-13T20:43:37"
  subject="Re: [Caml-list] (quasi FAQ) object, variants, .... Unbound type parameter [..]">
</msg>
<msg 
  url="2006/02/13a2523f313929ab46731a5fb41a7742"
  from="Jacques Garrigue &lt;garrigue@m...&gt;"
  author="Jacques Garrigue"
  date="2006-02-14T00:03:00"
  subject="Re: [Caml-list] (quasi FAQ) object, variants, .... Unbound type parameter [..]">
</msg>
</msg>
</thread>

<contents>

Hello All,

I'm a bit ashamed to ask such a quasi FAQ, but I don't understand why
the following does not compile


  class virtual ['VarT,'NodeT] myclass = object(self)
    method virtual v : 'VarT
    method virtual n : 'NodeT
  end;;

  type 
    'a vart = [&gt; `NothingV | `IntegerV of int | `NodeV of 'a nodet ]
  and
    'a nodet = Empty | LeafI of int | ObLeaf of 'a instancet | Node of nodet list
  and
    'a instancet = ('a,nodet) myclass constraint 'a = 'a vart


I'm getting the following error

File "ess.ml", line 8, characters 12-66:
Unbound type parameter [..]

which is positionned inside the bracket [] of vart line.

Sorry for asking such a nearly FAQ; I thought that this would be a
nearly canical example of the use of constraint.

The real context of all this is some scriptable Wiki-like application
which contains a (dynamically typed) interpreter (quasi scheme
semantics with some ml-like or ada-like syntax). The actual need is to
box in an open variant type (like vart above) all the "special" values
of the interpreter.


Again, my apologies for asking a nearly FAQ... (I googled a bit, but
did not understood the relation between the answers &amp; my question).

Regards

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/ 
email: basile&lt;at&gt;starynkevitch&lt;dot&gt;net 
aliases: basile&lt;at&gt;tunes&lt;dot&gt;org = bstarynk&lt;at&gt;nerim&lt;dot&gt;net
8, rue de la Faïencerie, 92340 Bourg La Reine, France

</contents>

</message>

