Re: merits of Lisp vs Python



André Thieme wrote:
Jon Harrop schrieb:
That is already a lot more than a "couple of macros" and it is still a
long way from the functionality provided by the pattern matchers bundled
with any of the languages I listed.

A complete pattern matcher will be several screens full of code, because
it really isn't the easiest thing to do.

The pattern matchers in ML compilers are thousands of lines of code, yes.

The good thing is that it can
be added to lisp as a library, without changing the sources to the
compiler.

You can get the semantics but not the performance because ML pattern
matchers can leverage the compiler's internal run-time representations of
values.

I don't know how easy it would be to add a macro system to ML
from inside the system...

You can run camlp4 interactively or as a preprocessor for compiled code.

--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists/index.html?usenet
.



Relevant Pages

  • Re: merits of Lisp vs Python
    ... long way from the functionality provided by the pattern matchers bundled ... with any of the languages I listed. ... The pattern matchers in ML compilers are thousands of lines of code, ...
    (comp.lang.lisp)
  • Re: Does ANSI Common Lisp have pattern matching?
    ... in languages that support it. ... if statements / pattern matchers and add new branches to handle the new ... That's what dynamic dispatch / OOP is there for to solve this particular ... in CLOS the situation is not that pressing: ...
    (comp.lang.lisp)