Mercurial > hg > octave-lyh
diff src/pt-fcn-handle.cc @ 14085:4e8f23ccadce stable
test: Use internal prefix "__" for %!functions to avoid polluting workspace
symbol table until bug #34497 has been resolved.
* cellfun.cc, dassl.cc, lsode.cc, qr.cc, quad.cc, data.cc, ov-fcn-handle.cc,
pt-fcn-handle.cc: Use internal prefix "__" for %!functions to avoid polluting
workspace symbol table until bug #34497 has been resolved.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Wed, 21 Dec 2011 09:44:46 -0800 |
parents | 2a8dcb5b3a00 |
children | 72c96de7a403 |
line wrap: on
line diff
--- a/src/pt-fcn-handle.cc +++ b/src/pt-fcn-handle.cc @@ -141,22 +141,24 @@ } /* -%!function r = f2 (f, x) +%!function r = __f2 (f, x) %! r = f (x); -%!function f = f1 (k) -%! f = @(x) f2 (@(y) y-k, x); +%!endfunction +%!function f = __f1 (k) +%! f = @(x) __f2 (@(y) y-k, x); +%!endfunction + +%!assert ((__f1 (3)) (10) == 7) + %!test -%! assert ((f1 (3)) (10) == 7) -%! -%!shared g %! g = @(t) feval (@(x) t*x, 2); -%!assert (g(0.5) == 1) -%! -%!shared f, g, h +%! assert (g(0.5) == 1); + +%!test %! h = @(x) sin (x); %! g = @(f, x) h (x); %! f = @() g (@(x) h, pi); -%!assert (f () == sin (pi)) +%! assert (f () == sin (pi)); */ octave_value_list