Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!dkuug!diku!thorinn From: thorinn@diku.dk (Lars Henrik Mathiesen) Newsgroups: comp.lang.functional Subject: Re: concrete syntax (was: "off-side rule") Keywords: whitespace Message-ID: <1991Jan29.180552.13482@odin.diku.dk> Date: 29 Jan 91 18:05:52 GMT References: <4842@skye.cs.ed.ac.uk> <4167@osc.COM> <43322@ut-emx.uucp> Sender: news@odin.diku.dk (Netnews System) Distribution: comp Organization: Department of Computer Science, U of Copenhagen Lines: 35 dll@ut-emx.uucp (Don Loflin) writes: >Basically, explicit statement delimitation is probably a good idea, but >block delimitation should use whitespace. In off-side rule languages, >you do run into the problem of indenting yourself off the page. You >could avoid that, but still reap the benefits of the off-side rule by >using it only for block delimitation. I also suggest a modification >to the rule such that the amout of white space in the first line of a >block determines the amount that delimits. By definition (Landin's) a syntactic entity governed by the off-side rule extends up to a line less indented than its _first_token_. It gets a little tiresome to see repeated suggestions that it should be modified to do what it has always done. (There is a widespread _style_ in Miranda that starts off-side blocks without going to a new line. It looks nice in typeset examples....) Further, both Miranda and Haskell use the off-side rule for a very limited number of syntactic constructs. Haskell comes quite close to your block-only idea, but allows implicit ``statement'' delimiters by returning to the indentation of the first line in the ``block''. Miranda wants to use the off-side rule to separate the uses of "=" as definition and equality, so it's a little weird. (Guess where the three off-side blocks are in foo x y = 0, if e = 1, otherwise where e = x = y .) Lastly, occam is not a functional language, and it doesn't use Landin's off-side rule. Criticism should go to comp.sys.transputer, if anywhere. -- Lars Mathiesen, DIKU, U of Copenhagen, Denmark [uunet!]mcsun!diku!thorinn Institute of Datalogy -- we're scientists, not engineers. thorinn@diku.dk