On Fri, Feb 15, 2008 at 11:23:26PM -0800, [EMAIL PROTECTED] wrote:
On Fri, Feb 15, 2008 at 10:00:43PM -0800, Andrew Lentvorski wrote:
It is not just you.  Many people complain about the impedance mismatch
between Lisp and algorithms.  Lisp maps to recursive/tree algorithsm
very well.  Iterative and decision algorithms, not so much.

Of course, doing tree-based algorithms in Java and C tends to be a
painful experience.

Why must this be so?  If I'm not mistaken, Java and C have recursion
and Common Lisp has iterative syntactic sugar.  So why can't everyone
by happy doing both kinds in each language?

I've found the Common Lisp iterative support to be more than adequate for
iterative programming, but it does take some getting used to.  There is
also a nagging though in the back of my mind that I shouldn't be writing
that way.  Reading through numerous Lisp books that don't have a problem
with iteration and assignment has helped with that.

What I find much more constraining about C, and other similar languages is
the lack of closures.  Closures and classes are similar conceptually, in
that they capture a set of state.  But, they both tend to focus on a
particular style of programming.  Even when programming CLOS, there seems
to be more of a focus on the methods than on the data stored in the class.

Last night, I had a D'oh moment with Common Lisp, when rereading the
language specification I ran across an unfamiliar term, looked it up, and
realized it was language support for functionality I'd been spending the
evening trying to write myself.  Common Lisp seems to definitely have some
unusual terms.  Instead of array aliasing or slices, they call them
displaced arrays.

David

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to