Re: Does ANSI Common Lisp have pattern matching?
- From: Pascal Costanza <pc@xxxxxxxxx>
- Date: Wed, 09 May 2007 09:11:39 +0200
Jon Harrop wrote:
Pascal Costanza wrote:Jon Harrop wrote:The fact is, pattern matching is more common that mapcar. It isA pattern matcher is essentially a glorified if statement.
ubiquitous in languages that support it. I think that warrants putting a
standard pattern matcher in the next version of Lisp.
No, because "if" statements do not deconstruct. Pattern matching replaces
if/cond/car/cdr/destructuring-bind with a single unified construct that
encourages high-level programming, making for simpler and faster code.
What part of "glorified" is it that you didn't understand?
Pattern matchers are indeed more useful for languages with static type systems where at runtime you
cannot refer to the type of a value anymore.
Scheme and F# are obvious counter examples. F# provides run-time type
information yet pattern matching remains ubiquituous, precisely because it
is so useful and cannot be represented using dynamic dispatch and types.
How do you know that anything in F# is ubiquitous? It only exists for three years now...
I have no experience from CLOS but, from what I have heard, it is extremely
slow.
Maybe you should check your hearing, then.
Pascal
--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
.
- Follow-Ups:
- Re: Does ANSI Common Lisp have pattern matching?
- From: Jon Harrop
- Re: Does ANSI Common Lisp have pattern matching?
- References:
- Does ANSI Common Lisp have pattern matching?
- From: Alan Crowe
- Re: Does ANSI Common Lisp have pattern matching?
- From: Jon Harrop
- Re: Does ANSI Common Lisp have pattern matching?
- From: Andy Freeman
- Re: Does ANSI Common Lisp have pattern matching?
- From: Jon Harrop
- Re: Does ANSI Common Lisp have pattern matching?
- From: Tim Bradshaw
- Re: Does ANSI Common Lisp have pattern matching?
- From: Jon Harrop
- Re: Does ANSI Common Lisp have pattern matching?
- From: Andy Freeman
- Re: Does ANSI Common Lisp have pattern matching?
- From: Jon Harrop
- Re: Does ANSI Common Lisp have pattern matching?
- From: Pascal Costanza
- Re: Does ANSI Common Lisp have pattern matching?
- From: Jon Harrop
- Does ANSI Common Lisp have pattern matching?
- Prev by Date: Re: Delimited continuations in (Common) Lisp
- Next by Date: Re: How Lisp's Nested Notation Limits The Language's Utility
- Previous by thread: Re: Does ANSI Common Lisp have pattern matching?
- Next by thread: Re: Does ANSI Common Lisp have pattern matching?
- Index(es):
Relevant Pages
|
Loading