Re: merits of Lisp vs Python



Jon Harrop schrieb:
André Thieme wrote:
Well, macros are one (big) thing that Lisp has and which many other
languages don't have. Their are other things too, and some of them are
in Python as well, which is a very nice scripting language.

I think s-exprs and EVAL are the main things that Lisp has and that other
languages don't. Note that most other languages don't have these because
they were deemed to be a bad trade-off three decades ago. ;-)

Often macros save just some bits of code. Saving one loc is not much you
might say. But think about it the other way around.
How would you like it to call doodleShooble() each time before you use
the if statement? Of course you would not like it. The good thing about
Lisp is, that you can eliminate this pattern.

You can eliminate that pattern with a HOF, of course. You don't need macros.

let if' p e1 e2 =
doodleShooble();
force (if p then e1 else e2)


I see, I expressed it in a way that make you think that a HOF could eliminate it.
I just wanted to show that it is not good to have some extra work to do.
Your idea was to abstract it away.

Let me try with my non-existant ocaml skills to explain what I mean.
Let's say you have a function f that takes a function object.
When you now call f and want to pass a throw away function you would
want to create an anonymous function.
As I understand it this can be done with "(fun arg -> arg + 1)" or
something similar.
How can you factor out the "(fun)" with a HOF?


André
--
.



Relevant Pages

  • Re: Terminology: "script" versus "program"
    ... who want to vote for Python. ... Python is much more than a "scripting language" (whatever this ... Languages that are often used to write such ... Finally, the provided process control facilities are often generalized into quite powerful support for "programming in the large", especially both object-oriented and functional programming. ...
    (comp.lang.python)
  • Re: Python is the best and most popular general purpose scripting language; the universal scripting
    ... Is Lisp a scripting language ... > scripting languages, or the accomplishment of tasks quickly and ... There are compilers for Python and interpreters for C. ...
    (comp.lang.python)
  • Re: merits of Lisp vs Python
    ... languages don't have. ... in Python as well, which is a very nice scripting language. ... Once you have s-expressions ...
    (comp.lang.lisp)
  • Re: python philosophical question - strong vs duck typing
    ... I actually stole the classification of continuums from a Python wiki ... Dynamically typed languages like Python keep, ... the coercion of floats to ints via the + operator, ... the compiler writers think so. ...
    (comp.lang.python)
  • Re: Basic inheritance question
    ... Old Java habits die slowly. ... No, seriously it isn't Java habits only, most other languages wouldn't ... That's not very far from what a Python method object does - ... reference to the current instance is to pass it as an argument to the ...
    (comp.lang.python)