Re: Functional Programming and python

2013-10-01 Thread Chris Angelico
On Tue, Oct 1, 2013 at 11:36 AM, rusi rustompm...@gmail.com wrote: (But I do sometimes yearn for a goto.) Ha! In Scheme, a tail call IS a goto with parameter re-assignment Precisely. In fact, tail call optimization basically consists of that exact rewrite. I'm absolutely fine with it being

Re: Functional Programming and python

2013-10-01 Thread Neil Cerutti
On 2013-10-01, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Mon, 30 Sep 2013 18:36:28 +, Neil Cerutti quoted: Why can??t lambda forms contain statements? Gah! Please fix your news client! (I see you're using slrn.) The \x92 bytes found in your message are

Re: Functional Programming and python

2013-10-01 Thread Piet van Oostrum
Antoon Pardon antoon.par...@rece.vub.ac.be writes: Op 30-09-13 20:55, Piet van Oostrum schreef: Franck Ditter nob...@nowhere.org writes: Good approach of FP in Python, but two points make me crazy : 1. Tail recursion is not optimized. We are in 2013, why ? This is known technology (since

Re: Functional Programming and python

2013-09-30 Thread Franck Ditter
In article ba94102b-18b6-4850-ac85-032b0fe2f...@googlegroups.com, rusi rustompm...@gmail.com wrote: Combining your two questions -- Recently: What minimum should a person know before saying I know Python And earlier this On Sunday, August 4, 2013 10:00:35 PM UTC+5:30, Aseem Bansal wrote:

Re: Functional Programming and python

2013-09-30 Thread Chris Angelico
On Tue, Oct 1, 2013 at 3:04 AM, Franck Ditter nob...@nowhere.org wrote: 1. Tail recursion is not optimized. We are in 2013, why ? This is known technology (since 1960). And don't answer with good programmers don't use recursion, this is bullshit. I've yet to see any value in having the

Re: Functional Programming and python

2013-09-30 Thread Neil Cerutti
On 2013-09-30, Franck Ditter nob...@nowhere.org wrote: In article ba94102b-18b6-4850-ac85-032b0fe2f...@googlegroups.com, rusi rustompm...@gmail.com wrote: I touched upon these in two blog-posts: 1. http://blog.languager.org/2013/06/functional-programming-invades.html 2.

Re: Functional Programming and python

2013-09-30 Thread Piet van Oostrum
Franck Ditter nob...@nowhere.org writes: Good approach of FP in Python, but two points make me crazy : 1. Tail recursion is not optimized. We are in 2013, why ? This is known technology (since 1960). And don't answer with good programmers don't use recursion, this is bullshit. Tail

Re: Functional Programming and python

2013-09-30 Thread Antoon Pardon
Op 30-09-13 19:04, Franck Ditter schreef: Good approach of FP in Python, but two points make me crazy : 1. Tail recursion is not optimized. We are in 2013, why ? This is known technology (since 1960). And don't answer with good programmers don't use recursion, this is bullshit. Guido

Re: Functional Programming and python

2013-09-30 Thread Antoon Pardon
Op 30-09-13 20:55, Piet van Oostrum schreef: Franck Ditter nob...@nowhere.org writes: Good approach of FP in Python, but two points make me crazy : 1. Tail recursion is not optimized. We are in 2013, why ? This is known technology (since 1960). And don't answer with good programmers don't use

Re: Functional Programming and python

2013-09-30 Thread Tim Chase
On 2013-09-30 19:04, Franck Ditter wrote: two points make me crazy : 1. Tail recursion is not optimized. We are in 2013, why ? This is known technology (since 1960). And don't answer with good programmers don't use recursion, I seem to recall hearing that the primary reason it hadn't been

Re: Functional Programming and python

2013-09-30 Thread Steven D'Aprano
On Mon, 30 Sep 2013 18:36:28 +, Neil Cerutti quoted: Why can’t lambda forms contain statements? Gah! Please fix your news client! (I see you're using slrn.) The \x92 bytes found in your message are apostrophes (technically: right single quotation marks), encoded using the legacy

Re: Functional Programming and python

2013-09-30 Thread Steven D'Aprano
On Mon, 30 Sep 2013 19:04:32 +0200, Franck Ditter wrote: Good approach of FP in Python, but two points make me crazy : 1. Tail recursion is not optimized. We are in 2013, why ? This is known technology (since 1960). And don't answer with good programmers don't use recursion, this is bullshit.

Re: Functional Programming and python

2013-09-30 Thread Terry Reedy
On 9/30/2013 5:02 PM, Tim Chase wrote: On 2013-09-30 19:04, Franck Ditter wrote: two points make me crazy : 1. Tail recursion is not optimized. We are in 2013, why ? This is known technology (since 1960). And don't answer with good programmers don't use recursion, I seem to recall hearing

Re: Functional Programming and python

2013-09-30 Thread alex23
On 1/10/2013 3:04 AM, Franck Ditter wrote: 1. Tail recursion is not optimized. We are in 2013, why ? This is known technology (since 1960). And don't answer with good programmers don't use recursion, this is bullshit. Here's an article Guido wrote explaining his reasoning:

Re: Functional Programming and python

2013-09-30 Thread rusi
On Tuesday, October 1, 2013 6:11:18 AM UTC+5:30, Steven D'Aprano wrote: On Mon, 30 Sep 2013 19:04:32 +0200, Franck Ditter wrote: 2. Lambda-expression body is limited to one expression. Why ? Nobody has come up with syntax that is unambiguous, would allow multiple statements in an

Re: Functional Programming and python

2013-09-24 Thread Jussi Piitulainen
Vito De Tullio writes: rusi wrote: [Not everything said there is correct; eg python supports currying better [than haskell which is surprising considering that Haskell's surname is [Curry!] AFAIK python does not support currying at all (if not via some decorators or something like

Re: Functional Programming and python

2013-09-24 Thread rusi
On Monday, September 23, 2013 11:54:53 PM UTC+5:30, Vito De Tullio wrote: rusi wrote: [Not everything said there is correct; eg python supports currying better [than haskell which is surprising considering that Haskell's surname is [Curry!] AFAIK python does not support currying at

Re: Functional Programming and python

2013-09-24 Thread Jussi Piitulainen
rusi writes: Without resorting to lambdas/new-functions: With functools.partial one can freeze any subset of a function(callable's) parameters. In Haskell one can only freeze the first parameter or at most with a right section the second You have an f of type A - B - C - D - E in

Re: Functional Programming and python

2013-09-24 Thread rusi
On Tuesday, September 24, 2013 1:12:51 PM UTC+5:30, Jussi Piitulainen wrote: rusi writes: Without resorting to lambdas/new-functions: With functools.partial one can freeze any subset of a function(callable's) parameters. In Haskell one can only freeze the first parameter or at

Re: Functional Programming and python

2013-09-24 Thread Jussi Piitulainen
rusi writes: On Tuesday, September 24, 2013 1:12:51 PM UTC+5:30, Jussi Piitulainen wrote: rusi writes: Without resorting to lambdas/new-functions: With functools.partial one can freeze any subset of a function(callable's) parameters. In Haskell one can only freeze the first

Re: Functional Programming and python

2013-09-24 Thread rusi
On Tuesday, September 24, 2013 8:21:19 PM UTC+5:30, Jussi Piitulainen wrote: Would the type system get in the way of providing some analogous function in Haskell? I don't know. Yes. The haskell curry curry f x y = f (x,y) is really only curry2 curry3 would be curry3 f x y z = f (x,y,z) and so

Re: Functional Programming and python

2013-09-24 Thread Chris Angelico
On Wed, Sep 25, 2013 at 1:07 AM, rusi rustompm...@gmail.com wrote: And this is an old conundrum in programming language design: In C printf is easy to write and NOT put into the language but into external libraries In Pascal, writeln cannot be outside the language because as a user defined

Re: Functional Programming and python

2013-09-24 Thread rusi
On Tuesday, September 24, 2013 8:56:21 PM UTC+5:30, Chris Angelico wrote: On Wed, Sep 25, 2013 at 1:07 AM, rusi wrote: And this is an old conundrum in programming language design: In C printf is easy to write and NOT put into the language but into external libraries In Pascal,

Re: Functional Programming and python

2013-09-23 Thread Vito De Tullio
rusi wrote: [Not everything said there is correct; eg python supports currying better [than haskell which is surprising considering that Haskell's surname is [Curry!] AFAIK python does not support currying at all (if not via some decorators or something like that). Instead every function in

Functional Programming and python

2013-09-22 Thread rusi
Combining your two questions -- Recently: What minimum should a person know before saying I know Python And earlier this On Sunday, August 4, 2013 10:00:35 PM UTC+5:30, Aseem Bansal wrote: If there is an issue in place for improving the lambda forms then that's good. I wanted a link about