Re: Indenting vs begin/end

Jens Peter Secher <>
Wed, 12 Jul 1995 15:11:00 GMT

          From comp.compilers

Related articles
Indenting vs begin/end (1995-07-06)
Re: Indenting vs begin/end (Ronald F. Guilmette) (1995-07-11)
Re: Indenting vs begin/end (Jens Peter Secher) (1995-07-12)
Re: Indenting vs begin/end (Charles Fiterman) (1995-07-17)
Re: Indenting vs begin/end (1995-07-14)
| List of all articles for this month |

Newsgroups: comp.compilers
From: Jens Peter Secher <>
Keywords: syntax, design
Organization: Department of Computer Science, U of Copenhagen
References: 95-07-062
Date: Wed, 12 Jul 1995 15:11:00 GMT

Take a look at the Clean 1.0 system report somewhere at

In this language you can optionally leave out begin/ends, brackets,
etc. but then you have obey certain "off-side" rules (like in the
language Miranda).

This means that the function definition

primes = sieve (gen 2); where {
    sieve [p:x] = [p:sieve (filter p x)]; gen n = [n:gen (n+1)];
    filter p [a:x] | a mod p == 0 = filter p x; | otherwise = [a:filter p x];

is equal to

primes = sieve (gen 2)
      sieve [p:x] = [p:sieve(filter p x)]
      gen n = [n:gen (n+1)]
      filter p [a:x]
              | a mod p == 0 = filter p x
              | otherwise = [a:filter p x]

Neat, huh?
J.P. ( (I *hate* signatures...)


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.