Re: Greenspunning ML (revisited)
- From: Marco Antoniotti <marcoxa@xxxxxxxxx>
- Date: Wed, 30 Apr 2008 04:10:47 -0700 (PDT)
On Apr 28, 8:23 pm, Jon Harrop <j...@xxxxxxxxxxxxxxxxx> wrote:
danb wrote:
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.
Can you implement proper decision-tree-based optimizations by augmenting
Lisp with some kind of closed algebraic data types equivalent to ML's
variant types?
Yes. It can be done.
That is where the enormous performance advantages lie...
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..
ML's pattern matching was designed to make it easy to convey
statically-checked constraints. I assume your Lisp implementation makes no
attempt to provide any static assurances at all. In which case, you may
find it more productive to Greenspun Mathematica's pattern matching
instead.
Of course the OP library does not implement the full blown unification
based ML type checking algorithm. It is because pattern (unification)
matching is a component (arguably the most important) of static type
checking. In other words, they are different things.
Cheers
--
Marco
.
- References:
- Greenspunning ML (revisited)
- From: danb
- Re: Greenspunning ML (revisited)
- From: Jon Harrop
- Greenspunning ML (revisited)
- Prev by Date: Re: Iteration in lisp
- Next by Date: hierarchical data in clips
- Previous by thread: Re: Greenspunning ML (revisited)
- Next by thread: Re: Greenspunning ML (revisited)
- Index(es):
Relevant Pages
|