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
syntax annoyance
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-03-22 (06:00)
From: j h woodyatt <jhw@c...>
Subject: syntax annoyance
everyone--

You know what?

> # type r = { x : int; y: int };;
> type r = { x : int; y : int; }
> # Some { x = 0; y = 1 };;
> - : r option = Some {x = 0; y = 1}
> # Some object method x = 0 method y = 1 end;;
> Syntax error
> # Some (object method x = 0 method y = 1 end);;
> - : < x : int; y : int > option = Some <obj>

It seems to me that the parentheses are sorta redundant, and it would  
be nice if they could be elided.  It's weird that the "r option" case  
works without additional parentheses and the "<obj> option" requires  
them.

Just venting.  Thanks for listening.


—
j h woodyatt <jhw@conjury.org>