Array of Functions

Marko Rauhamaa marko at pacujo.net
Fri Nov 14 23:21:13 CET 2014


Richard Riehle <rriehle at itu.edu>:

> Example:
>
>             r1c1   r1c2  r1c3
>             r2c1   r2c2  r2c3
>             r3c1   r3c2  r3c3
>
> where r1 is row 1 and c1 is column 1. Suppose I want an array where the
> colum three is a set of functions that operates on the other two
> columns, depending on the values I set for those rows and columns? As
> noted, I can do this pretty easily in most languages (well, except for
> Java which does not support any kind of functional programming
> capability), even if I have to use pointers.

Show some code in, say, Scheme (which is among the most functional
programming languages in existence), and we'll see how we could
translate that into Python.


Marko



More information about the Python-list mailing list