caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* syntax annoyance
@ 2006-03-22  6:00 j h woodyatt
  2006-03-22  8:20 ` [Caml-list] " Jacques Garrigue
  0 siblings, 1 reply; 2+ messages in thread
From: j h woodyatt @ 2006-03-22  6:00 UTC (permalink / raw)
  To: The Caml Trade

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>




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

* Re: [Caml-list] syntax annoyance
  2006-03-22  6:00 syntax annoyance j h woodyatt
@ 2006-03-22  8:20 ` Jacques Garrigue
  0 siblings, 0 replies; 2+ messages in thread
From: Jacques Garrigue @ 2006-03-22  8:20 UTC (permalink / raw)
  To: jhw; +Cc: caml-list

From: j h woodyatt <jhw@conjury.org>

> > # 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.

Look at the above two lines, and tell me which one is more readable :-)
I hesitated a while before deciding the priority, particularly
considering that the similar looking "begin ... end" doesn't need
parentheses. But I concluded that you don't want _too_ many
parentheses-like constructs in the language.

Jacques Garrigue


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

end of thread, other threads:[~2006-03-22  8:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-22  6:00 syntax annoyance j h woodyatt
2006-03-22  8:20 ` [Caml-list] " Jacques Garrigue

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).