Typed Python?

Jacek Generowicz jacek.generowicz at cern.ch
Thu Jul 8 09:04:30 EDT 2004


Ville Vainio <ville at spammers.com> writes:

> >>>>> "Jakub" == Jakub Fast <kfast at poczta.onet.pl> writes:
> 
>     >> Currying:                     lambda x,y : f(x,y,1,2)
>     Jakub> lambda x: lambda y: f(x,y,1,2)?
> 
>     Jakub> but then
>     Jakub> (lambda x: lambda y: f(x,y,1,2))(3, 4)
> 
>     Jakub> won't work.
> 
> Of course it won't. It's the difference b/w taking 1 and 2 parameters.

Which is pretty much the point of currying.

> (lambda x: lambda y: f(x,y,1,2))(3)(4)
> 
> will work.
> 
> I guess you will see that e.g in haskell
> 
> f 1 2 
> 
> does exactly this:
> 
> ((f 1) 2 )
> 
>     Jakub> so much for currying?
> 
> Well, no.

Well, yes.

In Haskell, both

    f 1

and

   f 1 2

will work, while in Python you have to install the plumbing yourself
every time.

You can write object-oriented programs in C ... but you have to
intstall the plumbing yourself every time. C supports object
orientation to about the same extent that Python supports currying.

You seem to be consistently implying (I just followed up another of
your posts, which implies similar sentiments) that built-in features
of other languages offer them no advantages over Python, because you
can simulate them all in Python. Why don't you take that line of
thought to its logical conclusion and program in a Turing Machine ?

Python offers no advantages over a Turing Machine, because you can
simulate all of Python's features in a Turing Machine.



More information about the Python-list mailing list