Greenspunning ML (revisited)
- From: danb <sogwaldan@xxxxxxxxx>
- Date: Mon, 28 Apr 2008 06:28:54 -0700 (PDT)
Well, I didn't like any of the pattern-matching libraries out there,
so I wrote another one. The api is similar to Fare Rideau's fare-
matcher, with a couple extra features, but the internals are much more
straightforward, at the expense of not supporting unification at all.
Incidentally, the title of this post is derived from a message I
posted here a few months ago, forwarding a message from Fare about
fare-matcher. c.l.l had recently been engaged in a troll war with Dr.
Frog, who had claimed that pattern matching in Lisp amounted to
Greenspunning ML. The title was meant to be a parody of Dr. Frog, but
maybe some people took it otherwise (if they noticed it). Anyway,
since I so rudely inflicted such an inconsiderate title on a post
about Fare's software, the least I could do was to take a well-
deserved dose of my own medicine.
So this library is called cl-match, and it uses the same s-expression
interface to ML-style matching as does fare-matcher, but it has a
couple extra features. It allows multiple occurances of variable
names, with implied EQL comparisons, and allows branch-specific guards
to be embedded in individual branches where alternative patterns are
allowed (OR patterns). The expanded code is optimized somewhat by
testing all single-branch patterns first. There's some documentation
here:
http://www.prairienet.org/~dsb/clmatch.htm
The main page has links to a user's manual, a page on the internals,
and a download directory. Please feel free to comment, criticize,
point out bugs, etc..
--Dan
------------------------------------------------
Dan Bensen
http://www.prairienet.org/~dsb/
.
- Follow-Ups:
- Re: Greenspunning ML (revisited)
- From: Slobodan Blazeski
- Re: Greenspunning ML (revisited)
- From: Jon Harrop
- Re: Greenspunning ML (revisited)
- Prev by Date: Re: Beginner Questing: Copying File to another byte by byte
- Next by Date: Re: defconstant in SBCL
- Previous by thread: Questions about 5.2 of the HS
- Next by thread: Re: Greenspunning ML (revisited)
- Index(es):
Relevant Pages
|