Re: Learning Lisp in Linux?



namekuseijin <namekuseijin@xxxxxxxxx> wrote on Wed, 31 Oct 2007:
On 30 out, 22:38, Don Geddis <d...@xxxxxxxxxx> wrote:
Now tell me why any kind of recursion is "the natural way" to express
iteration. Like WHILE or DOLIST or MAPCAR.

this is as natural...
...an imperative construct as one can in a functional expression.

But back up another level: what is the benefit of only using functional
expressions?

If the real algorithm is naturally imperative, your example may be the most
natural possible expression in a functional style. But there is an even MORE
natural expression in a straight imperative style. But what benefit have you
gained by obfuscating the code in order to reformulate it in a functional
style?

How does reformulating these things into a recursive algorithm improve
anything?

In Scheme and other functional languages they improve users being able to
design naturally recursive solutions recursively without fear of stack
overflows

Don't forget: we're talking about naturally _iterative_ algorithms, which
are being rewritten into a recursive style. You haven't provided any benefit
for this rewriting.

There are other algorithms were are indeed naturally recursive. And Common
Lisp programmers generally write those algorithms in a recursive style.

But CL programmers tend to write iterative algorithms in an iterative style.
I'm still waiting for you to explain why a recursive style should be used
for _all_ these algorithms.

and to schew the evil imperative paradigm in favor of more modern
approaches of software development by means of side-effect free functions
being composed together.

Tell me more about this "evil" paradigm. Sounds productive and fun!

(Or, if you want to try to be serious: eliminate your argumentative words
like "evil" and "modern", and just calmly explain the ACTUAL BENEFITS that a
programmer will see by adopting your suggested approach.)

-- Don
_______________________________________________________________________________
Don Geddis http://don.geddis.org/ don@xxxxxxxxxx
Patriotism is supporting your country all the time, and your government when
it deserves it. -- Mark Twain
.



Relevant Pages

  • Re: Delegates, Generic Methods and algorithms - Functional versus Procedural
    ... I was reading another post and saw an argument that brought ... Collections Algorithms class. ... functional coding as a way of separating action, iteration and data. ... provide the delegate? ...
    (microsoft.public.dotnet.languages.csharp)
  • Delegates, Generic Methods and algorithms - Functional versus Procedural
    ... I was reading another post and saw an argument that brought ... Collections Algorithms class. ... functional coding as a way of separating action, iteration and data. ... provide the delegate? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Does capitalism have a future?
    ... iteration being used to design such things as computer software and ... The algorithms are programed to self-modify, ... our economic system has to adjust ... that human effort is no longer needed or desired, ...
    (alt.politics)
  • Re: CoBOL moved to OO
    ... > there algorithms that can be coded more easily as recursive expressions versus ... > algorithm in recursion and not think it in iteration and that is why the ...
    (comp.lang.cobol)

Loading