From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p2HA8U03006356 for ; Thu, 17 Mar 2011 11:08:31 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AksCAF56gU1KfVK2kGdsb2JhbACEPqEGCBQBAQEBCQkNBxQEIak0igI8gh6FFC+IWwEBAwWEZ3cEjF6IeTo X-IronPort-AV: E=Sophos;i="4.63,198,1299452400"; d="scan'208";a="90621804" Received: from mail-wy0-f182.google.com ([74.125.82.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 17 Mar 2011 11:08:25 +0100 Received: by wyf23 with SMTP id 23so4018012wyf.27 for ; Thu, 17 Mar 2011 03:08:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=Crir/lzqF6TYv9QEy2SF4St/TozPLgMj/G3opmqdaoI=; b=I0D/Kbgtx+PJinPHo3P9H0P1AgB3tPAasZsXyHQ+9goYELcmRIbzEKg9wfOdYXwf05 kfbVqQJMKf6rTWURh2anjEDgQbEvUeVCRyD3tE0H5yjrXEP2SGxAVsPCtuIxNfQO6h21 swycSnBnFtlff03ZQqKfgaiM1sAsgYY+YumKo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=D/NwQAuK5HV965IUBecsPedXahLYVCnH1OCA4JN3SROhfG44M0doYITH5qYmbpn1wX PXb0cT3Ag9rhHEg3Z5K3+akUSt8K8N/WQqROKIglu4iM7Ch1VdUtDudPC0ufQIZDa2xa cnE3f+TgN9gMSdlBuLsls6Ad0j1NHoFqAqpV0= MIME-Version: 1.0 Received: by 10.216.52.78 with SMTP id d56mr1192591wec.44.1300356504514; Thu, 17 Mar 2011 03:08:24 -0700 (PDT) Received: by 10.216.74.5 with HTTP; Thu, 17 Mar 2011 03:08:24 -0700 (PDT) Date: Thu, 17 Mar 2011 11:08:24 +0100 Message-ID: From: Pierre-Alexandre Voye To: caml-list Content-Type: multipart/alternative; boundary=0016e6dbe6dc8872b7049eaad79c Subject: [Caml-list] Define class and sum type in one time --0016e6dbe6dc8872b7049eaad79c Content-Type: text/plain; charset=UTF-8 Hi everyone, i'm trying to write a generic hierarchical finite state machine, and I have a syntax problem which stop me. I want to define an object which use, somewhere a sum type. The compiler answer "Syntax Error" Here a simple example of my problem : class machin = object(self) val mutable valeur = 0 method getValeur = valeur end and truc = Machin of (int->int) | Recur of truc;; And the answer : Error: Syntax error which point on the "of" after "Machin" Is there a way to solve this problem ? In advance, thank you very much Pierre-Alexandre -- --------------------- Isaac Project - http://www.lisaac.org/ --0016e6dbe6dc8872b7049eaad79c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi everyone, i'm trying to write a generic hierarchical finite state ma= chine, and I have a syntax problem which stop me.
I want to define an ob= ject which use, somewhere a sum type.
The compiler answer "Syntax = Error"

Here a simple example of my problem :

class machin =3D object(se= lf)
=C2=A0 val mutable valeur =3D 0
=C2=A0 method getValeur =3D valeu= r
end
and
truc =3D Machin of (int->int) | Recur of truc;;
=
And the answer :
Error: Syntax error
=C2=A0which point=C2=A0 on the "of" after = "Machin"

Is there a way to solve this problem ?

In = advance, thank you very much

Pierre-Alexandre
-- ---------------------
Isaac Project - http://www.lisaac.org/
--0016e6dbe6dc8872b7049eaad79c--