caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Define class and sum type in one time
@ 2011-03-17 10:08 Pierre-Alexandre Voye
  2011-03-17 10:33 ` [Caml-list] " Pierre-Alexandre Voye
  0 siblings, 1 reply; 11+ messages in thread
From: Pierre-Alexandre Voye @ 2011-03-17 10:08 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 626 bytes --]

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/

[-- Attachment #2: Type: text/html, Size: 803 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-03-18 17:17 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-17 10:08 [Caml-list] Define class and sum type in one time Pierre-Alexandre Voye
2011-03-17 10:33 ` [Caml-list] " Pierre-Alexandre Voye
2011-03-17 10:47   ` Guillaume Yziquel
2011-03-17 10:50     ` Pierre-Alexandre Voye
2011-03-17 11:01       ` David Rajchenbach-Teller
2011-03-17 11:14         ` David Rajchenbach-Teller
2011-03-17 11:05       ` Guillaume Yziquel
2011-03-17 13:44         ` Gabriel Scherer
     [not found]         ` <1080649473.122478.1300369493351.JavaMail.root@zmbs4.inria.fr>
2011-03-17 13:54           ` Fabrice Le Fessant
2011-03-18 17:16       ` Gerd Stolpmann
     [not found]     ` <350217430.1223639.1300359057593.JavaMail.root@zmbs3.inria.fr>
2011-03-17 11:02       ` Paolo Herms

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).