Related articles |
---|
Indenting vs begin/end maatwerk@euronet.nl (1995-07-06) |
Re: Indenting vs begin/end rfg@rahul.net (Ronald F. Guilmette) (1995-07-11) |
Re: Indenting vs begin/end jpsecher@diku.dk (Jens Peter Secher) (1995-07-12) |
Re: Indenting vs begin/end cef@geodesic.com (Charles Fiterman) (1995-07-17) |
Re: Indenting vs begin/end nahshon@vnet.ibm.com (1995-07-14) |
Newsgroups: | comp.compilers |
From: | Jens Peter Secher <jpsecher@diku.dk> |
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
http://www.cs.kun.nl/~clean/
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)
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]
Neat, huh?
--
J.P. (jpsecher@diku.dk) (I *hate* signatures...)
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.