From: Robert Harley
Subject: Re: static typing considered harmful
Date: 
Message-ID: <64v9q1$jpg$1@goldenapple.srv.cs.cmu.edu>
Juliusz Chroboczek <ยทยทยท@dcs.ed.ac.uk> writes:
>[crossposted to comp.lang.ml: we need a good flamewar]

Actually, we don't.


>[...]
>I started to give an example about a searching function which returns
>a string on success and NIL on failure.
>
>  `I'd just raise an exception on failure!' (that's ML-speak for
>  throwing out of a scope)
>
>I then realised that because ML is strongly typed, ML programmers are
>likely to use techniques that we don't need in Lisp.  And, sure
>enough, looking back at the code I wrote back in my ML days, it is
>full of exception catching.  [...]

You could return a string option, None | Some of string.

Exceptions are not "needed" in such a situation in ML.


-- Rob.