pattern-matching in LISP?
- From: Chris Schumacher <kensu__@xxxxxxxxxxx>
- Date: Sat, 28 Apr 2007 22:15:56 GMT
I noticed that in the functional language ML there is a way to break a
function's input into various forms in the function header.
For instance:
split(a::b::c) (where :: is ML's equivalent of cons)
This also allows an interesting kind of function overloading where you can
contain several function definitions in a single declaration, each keyed by
the format of the input.
I attempted to do something similar in LISP, using:
defun ( split (cons A B) )
But it didn't appear to work. Does LISP have pattern-matching capabilities
as well?
I'd be sad if it didn't, because I like LISP a lot more than ML. :)
-==Kensu==-
.
- Follow-Ups:
- Re: pattern-matching in LISP?
- From: Alan Crowe
- Re: pattern-matching in LISP?
- From: Matthias Benkard
- Re: pattern-matching in LISP?
- From: Kent M Pitman
- Re: pattern-matching in LISP?
- From: Vagif Verdi
- Re: pattern-matching in LISP?
- From: Pascal Costanza
- Re: pattern-matching in LISP?
- Prev by Date: Re: programmatically determine if argument is list compatible to a given lambda list
- Next by Date: Opposite of ~^ FORMAT Directive
- Previous by thread: programmatically determine if argument is list compatible to a given lambda list
- Next by thread: Re: pattern-matching in LISP?
- Index(es):
Relevant Pages
|
|