Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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

since:

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