English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
object constructor syntax compiler weirdness
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-11-21 (10:14)
From: Mike Lin <mikelin@m...>
Subject: Re: [Caml-list] object constructor syntax compiler weirdness
> Parentheses in class definitions are useless, so there is no reason to
> add a begin .. end construct. I suppose that the first syntax is only
> allowed as a degenerated case of
>    class c = (object ... end : ct)

Well, despite the parentheses being useless, I feel this should not be
a syntax error:

class type x = object val y : int end
>> fine
class type x = (object val y : int end)
>> syntax error


module type X = sig val y : int end
>> fine
module type X = (sig val y : int end)
>> fine