Article View: comp.lang.functional
Article #661Re: SML Pretty-printing
From: George Beshers
Date: Tue, 06 Oct 1992 19:21
Date: Tue, 06 Oct 1992 19:21
27 lines
1335 bytes
1335 bytes
# datatype foo = Alpha of int | Beta of real | Gamma of string; # datatype bar = Happy of int | Dopey of real | Grumpy of string; # # fun testcase (x,y) = # case x of # Alpha _ => () # | Beta _ => # case y of # Happy _ => () # | Dopey _ => () # | Grumpy _ => () # | Gamma _ => (); (* Hmmm... *) # Any SML compiler which accepts this is wrong, i.e., as I read the rules an error message should be generated (sorry I can't quote the rule numbers as the definition is at home). However, having made the mistake, I agree that this bit of SML syntax is a mis-feature. In general, if a syntax is designed for small examples then closing brackets can `be safely omitted'. When the examples start to get large the `safely' is invalidated. The time spent (and the in elegance of) esac, fi, nf, etc. is negligible compared with problems of mis-interpretation.
Technical Details
Message-ID:
<1asp0dINN44j@argo.hks.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!noc.near.net!argo.hks.com!argo.hks.com!newsReferences:
<91849@netnews.upenn.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!noc.near.net!argo.hks.com!argo.hks.com!news From: beshers@tsavo.hks.com (George Beshers) Newsgroups: comp.lang.functional Subject: Re: SML Pretty-printing Date: 6 Oct 1992 19:21:49 GMT Organization: HKS, Inc. Lines: 28 Distribution: world Message-ID: <1asp0dINN44j@argo.hks.com> References: <91849@netnews.upenn.edu> Reply-To: beshers@hks.com NNTP-Posting-Host: tsavo.hks.com