Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: Array of Functions Date: Sat, 15 Nov 2014 00:21:13 +0200 Organization: A noiseless patient Spider Lines: 21 Message-ID: <871tp5mnja.fsf@elektro.pacujo.net> References: <42b534f0-aeef-411f-80c5-db5d20c80b55@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="ff5cf27ef3d5b31f034d3b72bdc27a41"; logging-data="16371"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/OAYmvhp6WRb/DHiFf9PH" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:XARvVSw/cVzommdWHQaClSvonHk= sha1:b+63NNWPqgarnORUie0FHNiaciw= Xref: csiph.com comp.lang.python:80787 Richard Riehle : > 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