From help-octave-request at bevo dot che dot wisc dot edu Wed Dec 20 15:58:45 2000 Subject: Re: anonymous functions? From: "Johan Kullstam" To: help-octave at bevo dot che dot wisc dot edu Date: 20 Dec 2000 17:00:53 -0500 Han-Wen Nienhuys writes: > 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. if you like lisp, you might want to try matlisp. -- J o h a n K u l l s t a m [kullstam at ne dot mediaone dot net] Don't Fear the Penguin! ------------------------------------------------------------- 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 -------------------------------------------------------------