Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #9796 > unrolled thread

Re: Aw: Re: Aw: Functional style programming in python: what will you talk about if you have an hour on this topic?

Started byAnthony Kong <anthony.hw.kong@gmail.com>
First post2011-07-18 05:20 -0700
Last post2011-07-18 16:02 -0400
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  Re: Aw: Re: Aw: Functional style programming in python: what will you talk about if you have an hour on this topic? Anthony Kong <anthony.hw.kong@gmail.com> - 2011-07-18 05:20 -0700
    Re: Aw: Re: Aw: Functional style programming in python: what will you talk about if you have an hour on this topic? Terry Reedy <tjreedy@udel.edu> - 2011-07-18 16:02 -0400

#9796 — Re: Aw: Re: Aw: Functional style programming in python: what will you talk about if you have an hour on this topic?

FromAnthony Kong <anthony.hw.kong@gmail.com>
Date2011-07-18 05:20 -0700
SubjectRe: Aw: Re: Aw: Functional style programming in python: what will you talk about if you have an hour on this topic?
Message-ID<2783b9f2-89ea-4823-ae80-6ac9686ec7ce@glegroupsg2000goo.googlegroups.com>
Thanks for all the great suggestion. 

First of all, Carl is right that it does not take much to impress a java programmer about the expressiveness of functional programming.

Covered map, reduce and filter as Rainer suggested.

Emphasized the advantages of functional style as summarised by Steve D'Aprano. 

I showcased the use of groupby() in itertools. Think about what it takes to implement similar logic in Java. Also introduced the gotcha of using groupby(): you must first sort the list in the same way you want to group them by.


Then I got ambitious and tried to introduce partial(). I basically lost everyone right there. They can understand what partial does but do not know why it can be useful. My example was too trivial and it did not help.


What is the best way to introduce partial/currying? 


[toc] | [next] | [standalone]


#9833

FromTerry Reedy <tjreedy@udel.edu>
Date2011-07-18 16:02 -0400
Message-ID<mailman.1230.1311019510.1164.python-list@python.org>
In reply to#9796
On 7/18/2011 8:20 AM, Anthony Kong wrote:
> Thanks for all the great suggestion.
>
> First of all, Carl is right that it does not take much to impress a
> java programmer about the expressiveness of functional programming.

> Covered map, reduce and filter as Rainer suggested.
>
> Emphasized the advantages of functional style as summarised by Steve
> D'Aprano.
>
> I showcased the use of groupby() in itertools. Think about what it
> takes to implement similar logic in Java. Also introduced the gotcha
> of using groupby(): you must first sort the list in the same way you
> want to group them by.
>
>
> Then I got ambitious and tried to introduce partial(). I basically
> lost everyone right there. They can understand what partial does but
> do not know why it can be useful. My example was too trivial and it
> did not help. What is the best way to introduce partial/currying?

See my response to Kurian -- Partial Function Application -- just a few
minutes ago.

-- 
Terry Jan Reedy

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web