Article View: comp.lang.functional
Article #624Re: Why functional languages?
From: Brian Boutel
Date: Fri, 02 Oct 1992 08:14
Date: Fri, 02 Oct 1992 08:14
47 lines
2391 bytes
2391 bytes
In article <farrell.718005712@coral>, farrell@coral.cs.jcu.edu.au (John Farrell) writes:
|> In <BvGz2u.2rv.1@cs.cmu.edu> spot@CS.CMU.EDU (Scott Draves) writes:
|> >i've written a lot of SML and lisp code, and my experience is that
|> >syntax (especially ()s) is not a problem in lisp, but that i do have
|> >problems (understanding and writing) SML.
|>
|> Sorry, I just don't believe you. To me, Lisp has the most disgusting syntax
|> imaginable. However I don't like the ML/Haskell convention of using
|> "let x = y in z" rather than "z where x = y", I like to read programs top down
|> rather than bottom up. I have considered having a PC opinion about this
|> syntax, i.e. you like what you're used to, but I honestly believe that Lisp
|> syntax is inherently evil.
|>
|> John
I don't believe him either, John, but just to pick up on the let/where business:
Consider
let x = y in if a then b else c
and
if a then b else let x = y in c
Now consider
if a then b else c where x = y
To which of the let forms does this correspond?
It's ambiguous, and an arbitrary decision has to be made as to which parse to
use. This is dangerous, as a wrong assumption can result in a syntactically
correct program with entirely the wrong meaning.
So, the let form if better, because it's safer. Otherwise, it's just personal
preference, which is not a very good way to design a language, expecially where
there's a committee with varying preferences!
BTW, Haskell has a where form as well, but it's part of the equation syntax, not
the expression syntax, so it doesn't cause any problems.
--brian
--
Internet: brian@comp.vuw.ac.nz
Postal: Brian Boutel, Computer Science Dept, Victoria University of Wellington,
PO Box 600, Wellington, New Zealand
Phone: +64 4 471-5328 Fax: +64 4 495-5232
Technical Details
Message-ID:
<BvHIwz.9HM@comp.vuw.ac.nz>Path:
arc1-ca.pugleaf.net!sparky!uunet!decwrl!waikato.ac.nz!comp.vuw.ac.nz!brianReferences:
<TMB.92Sep28144424@arolla.idiap.ch> <annius.717696151@freyr> <farrell.718005712@coral>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!decwrl!waikato.ac.nz!comp.vuw.ac.nz!brian Newsgroups: comp.lang.functional Subject: Re: Why functional languages? Message-ID: <BvHIwz.9HM@comp.vuw.ac.nz> From: brian@comp.vuw.ac.nz (Brian Boutel) Date: Fri, 2 Oct 1992 08:14:59 GMT Sender: news@comp.vuw.ac.nz (News Admin) References: <TMB.92Sep28144424@arolla.idiap.ch> <annius.717696151@freyr> <farrell.718005712@coral> Organization: Dept. of Comp. Sci., Victoria Uni. of Wellington, New Zealand. Nntp-Posting-Host: circa.comp.vuw.ac.nz Lines: 47