Version française
Home     About     Download     Resources     Contact us    
Browse thread
Strange performances
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Strange performances
On Friday 18 January 2008 17:52:06 Kuba Ober wrote:
> On Friday 18 January 2008, Edgar Friendly wrote:
> > Jacques Garrigue wrote:
> > > This is why I sent an erratum. The cause for the segfault was not the
> > > array access, but the stack overflow, which occured due to ocaml's
> > > peculiar evaluation order.
> >
> > Is there any case where ocaml's "peculiar evaluation order" results in
> > any benefit other than slightly simpler code at the compiler level?  I
> > understand that people shouldn't depend on evaluation order, but it
> > seems that people fall into this trap often.  And even extremely
> > experienced camlers (if you permit this characterization of you) forget
> > this behavior.
>
> I think that if you apply principle of least astonishment, things should be
> evaluated left-to-right. Or at least with a consistent rule.

I believe this design was chosen to give the compiler more freedom for 
optimizing but I agree that left to right is preferable.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e