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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Ocaml compiler features
On Fri, Jan 12, 2007 at 11:37:21PM -0600, Edgar Friendly wrote:
> if y=1 then
> 	let z = 2 in
> 	print_int y;
> 	print_int z;
> else
> 	print_string "not one"

Hmmm .. changing the precedence of operators to avoid two parentheses ...
I don't think that's good.

if y=1 then (
	let z = 2 in
	print_int y;
	print_int z;
) else
	print_string "not one"

I will however add my own pet wish: a 'return' statement!  It doesn't
have to break type safety -- you should only be allowed to 'return' a
type compatible with the ordinary return type of the function.  The
alternative (using exceptions to jump out of code) is ugly, slow and
unsafe.

Rich.

-- 
Richard Jones
Red Hat UK Limited