From help-octave-request at bevo dot che dot wisc dot edu Wed Dec 20 12:03:51 2000 Subject: Re: anonymous functions? From: Han-Wen Nienhuys To: etienne at isr dot ist dot utl dot pt Cc: help-octave at bevo dot che dot wisc dot edu Date: Wed, 20 Dec 2000 19:05:27 +0100 etienne at anonimo dot isr dot ist dot utl dot pt writes: > eval (["function p = my_prod(t)\n"\ > " p = f(t) * g(t);\n"\ > "endfunction\n"]); > > but f(t) will not be visible (see the man pages on local and global > variables); by default, all vars are local. As far as I can tell, the only way to do what I want involves crude hacks (assembling strings, and loading or evalling them). In that case, I'll revert to using Mathematica (sorry). > Also, you don't get an anonymous func : it's called "my_prod". (note > that "prod" is a builtin function). Do you usually program in perl (a > good language for anonymous functions)? Usually in Scheme or Python. -- Han-Wen Nienhuys | hanwen at cs dot uu dot nl| | http://www.cs.uu.nl/~hanwen/ ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------