David B. Benson wrote:
> SML syntax has been described as baroque. I am interested in
> suggestions to make it less baroquen.
>
> Carl Hauser, over lunch, strongly suggests allowing ',' and ';'
> in places these symbols are currently not allowed. So one
> can write
>
> let in expr; end
>
> if one wants. Similarly, [a,b,c,] ought to be clear enough.
Yes. Just copy OCaml.
> Replacing the keyword 'handle' by 'catch' seems wise.
Again, I would just copy OCaml but also provide "try..finally".
> But
> this is not enough to treat the multiple ways that alternative
> patterns may appear, leading to compiler errors. One
> solution, of course, is simply to put
>
> let in ... end
>
> around case expressions and code ending with a 'catcher',
> i.e., handler code. Not very pretty.
You could just copy OCaml's "begin..end" and "(..)" but I liked Torben's
idea of having dangling optional "end" for many constructs.
> Another is to use
>
> case ... esac
>
> to delimit the case pattern alternatives. But
>
> catch ... hctac
>
> is hideous.
Very hideous.
> While I am going to consider Haskell-style indentation, for
> long code bodies some other solution is required, so the
> indentation needs to be optional. (Also, some do not like it.)
I don't like whitespace breaking my code semantically. I also like to
cut'n'paste code, which regularly breaks with whitespace-sensitive
languages.
Given the choice, my vote goes to whitespace-irrelevance coupled with an
IDE
that does autoindenting (like OCaml).
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?u


|