Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Functional > Re: Better synt...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 17 Topic 2768 of 2841
Post > Topic >>

Re: Better syntax for a Standard ML derivative

by Jon Harrop <usenet@[EMAIL PROTECTED] > Feb 12, 2008 at 08:22 PM

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




 17 Posts in Topic:
Better syntax for a Standard ML derivative
"David B. Benson&quo  2008-02-11 17:42:18 
Re: Better syntax for a Standard ML derivative
Paul Rubin <http://phr  2008-02-11 18:24:30 
Re: Better syntax for a Standard ML derivative
torbenm@[EMAIL PROTECTED]  2008-02-19 18:17:38 
Re: Better syntax for a Standard ML derivative
"David B. Benson&quo  2008-02-12 11:02:55 
Re: Better syntax for a Standard ML derivative
Paul Rubin <http://phr  2008-02-12 12:55:35 
Re: Better syntax for a Standard ML derivative
Jon Harrop <usenet@[EM  2008-02-12 20:22:44 
Re: Better syntax for a Standard ML derivative
"David B. Benson&quo  2008-02-12 16:32:28 
Re: Better syntax for a Standard ML derivative
Paul Rubin <http://phr  2008-02-12 16:42:18 
Re: Better syntax for a Standard ML derivative
"David B. Benson&quo  2008-02-12 17:53:04 
Re: Better syntax for a Standard ML derivative
Donn Cave <donn@[EMAIL  2008-02-14 10:02:03 
Re: Better syntax for a Standard ML derivative
"David B. Benson&quo  2008-02-14 11:55:30 
Re: Better syntax for a Standard ML derivative
"David B. Benson&quo  2008-02-19 11:34:49 
Re: Better syntax for a Standard ML derivative
Paul Rubin <http://phr  2008-02-19 12:21:40 
Re: Better syntax for a Standard ML derivative
"David B. Benson&quo  2008-02-19 13:54:23 
Re: Better syntax for a Standard ML derivative
Paul Rubin <http://phr  2008-02-19 14:06:41 
Re: Better syntax for a Standard ML derivative
"David B. Benson&quo  2008-02-19 14:48:40 
Re: Better syntax for a Standard ML derivative
"David B. Benson&quo  2008-02-19 14:50:59 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri May 16 8:39:58 CDT 2008.