Re: pattern-matching in LISP?
- From: Jon Harrop <jon@xxxxxxxxxxxxxxxxx>
- Date: Thu, 21 Jun 2007 23:16:04 +0100
Andy Freeman wrote:
On May 12, 10:24 am, Jon Harrop <j...@xxxxxxxxxxxxxxxxx> wrote:
let f(a, (b, c)) = ((a, b), c);;
(defun f (v) (cons (cons (car v) (cadr v)) (cddr v)))
http://www.lisp.org/HyperSpec/Body/mac_destructuring-bind.html
That would be even longer and just as unnecessarily obfuscated.
No. Lisp predates ML by a long way and lacks most of its features,
including pattern matching.
Wrong.
As you can see, you won't get a useful response if you ask Lispers about any
of the language features that they don't use. Best case, you'll get an
ad-hoc, informally-specified and bug-ridden implementation of half of an ML
pattern matcher.
Anyone wanting to learn about ML-style pattern matching would be much better
off asking in a group related to any language that integrates a decent
pattern matcher (Standard ML, F#, OCaml, Haskell etc.) and not Lisp, or by
reading introductory material:
http://www.ffconsultancy.com/products/ocaml_for_scientists/chapter1.html?cll
http://www.ffconsultancy.com/products/ocaml_journal/free/introduction.html?cll
http://www.ffconsultancy.com/ocaml/benefits/pattern_matching.html?cll
http://www.ffconsultancy.com/ocaml/benefits/parsing.html?cll
http://www.ffconsultancy.com/ocaml/benefits/symbolic.html?cll
http://www.ffconsultancy.com/ocaml/benefits/interpreter.html?cll
Folks who want to work the ML way are free to do so.
By using ML, yes.
To make an informed choice of language, you need to know the differences
between the languages. RB-tree rebalancing and symbolic rewriting are two
examples where languages with integrated pattern matching excel compared to
Lisp, both in terms of clarity and performance.
If you want to show Lisp in a good light, do not mention pattern matching.
--
Dr Jon D Harrop, Flying Frog Consultancy
The OCaml Journal
http://www.ffconsultancy.com/products/ocaml_journal/?usenet
.
- Follow-Ups:
- Re: pattern-matching in LISP?
- From: Rainer Joswig
- Re: pattern-matching in LISP?
- References:
- Re: pattern-matching in LISP?
- From: Andy Freeman
- Re: pattern-matching in LISP?
- Prev by Date: Re: The Lisp experience - 19-year old college student asks for help in #lisp, has to wait half an hour for a response; asks in #python, gets the answer in 6 minutes. Gives up on Lisp... "I'll wait for Arc, thanks."
- Next by Date: Re: Documentation of a Specific Method
- Previous by thread: Re: pattern-matching in LISP?
- Next by thread: Re: pattern-matching in LISP?
- Index(es):
Relevant Pages
|