[nem-pl] Re: [nem-bug] [Nemerle 0000188]: try-in-unless syntax

Michal Moskal malekith at pld-linux.org
Tue Jul 6 13:32:58 CEST 2004


On Tue, Jul 06, 2004 at 12:55:15PM +0200, "Paweł W. Olszta" wrote:
> feedback at nemerle.org wrote:
> 
> >try {
> >  def f = open_file ();
> >} catch {
> >  | nothing => ...
> >  | _ : Io =>  ...
> >}
> 
> What about:
> 
> def f = try { open_file () } catch { _ : Io => ... }
                                                 ^^^

What's here?

def f = try { open_file () } catch { _ : Io => null };
if (f != null) { ... } else { ... }

This is ugly.

> This is so perlish:
> 
> $f = open_file () || die

Rather:

$f = open_file() || return;

-- 
: Michal Moskal :: http://www.kernel.pl/~malekith :: GCS !tv h e>+++ b++
: ::: Logic is a nice contrast to the Real World. :: UL++++$ C++ E--- a?




More information about the devel-pl mailing list