From: <car...@us...> - 2012-03-12 15:06:57
|
Revision: 9821 http://octave.svn.sourceforge.net/octave/?rev=9821&view=rev Author: carandraug Date: 2012-03-12 15:06:46 +0000 (Mon, 12 Mar 2012) Log Message: ----------- map: deprecating function in favour of cellfun or arrayfun Modified Paths: -------------- trunk/octave-forge/main/miscellaneous/NEWS trunk/octave-forge/main/miscellaneous/inst/apply.m trunk/octave-forge/main/miscellaneous/inst/map.m Modified: trunk/octave-forge/main/miscellaneous/NEWS =================================================================== --- trunk/octave-forge/main/miscellaneous/NEWS 2012-03-12 14:39:15 UTC (rev 9820) +++ trunk/octave-forge/main/miscellaneous/NEWS 2012-03-12 15:06:46 UTC (rev 9821) @@ -19,8 +19,8 @@ ** The function clip was imported from the audio package. - ** The function `apply' has been deprecated. `cellfun' and `arrayfun' from - octave core should be used instead. + ** The functions `apply' and `map' have been deprecated. `cellfun' and + `arrayfun' from octave core should be used instead. ** The function `partarray' has been removed. `mat2cell' from octave core should be used instead. Modified: trunk/octave-forge/main/miscellaneous/inst/apply.m =================================================================== --- trunk/octave-forge/main/miscellaneous/inst/apply.m 2012-03-12 14:39:15 UTC (rev 9820) +++ trunk/octave-forge/main/miscellaneous/inst/apply.m 2012-03-12 15:06:46 UTC (rev 9821) @@ -59,9 +59,7 @@ if (! warned) warned = true; warning ("Octave:deprecated-function", - "apply.m has been deprecated, and will be removed in the future.") - warning ("Octave:deprecated-function", - "Use `arrayfun' or `cellfun' instead."); + "apply has been deprecated, and will be removed in the future. Use `arrayfun' or `cellfun' instead."); endif if (nargin == 0) @@ -70,7 +68,7 @@ elseif( nargin < 2) if iscell(fun_handle) for idx=1:length(fun_handle) - rval(idx)=feval(@feval,fun_handle{idx}); + rval(idx)=feval(@feval,fun_handle{idx}); end else rval=feval(@feval,fun_handle); Modified: trunk/octave-forge/main/miscellaneous/inst/map.m =================================================================== --- trunk/octave-forge/main/miscellaneous/inst/map.m 2012-03-12 14:39:15 UTC (rev 9820) +++ trunk/octave-forge/main/miscellaneous/inst/map.m 2012-03-12 15:06:46 UTC (rev 9821) @@ -62,6 +62,13 @@ function return_type = map (fun_handle, data_struct, varargin) + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "map has been deprecated, and will be removed in the future. Use `arrayfun' or `cellfun' instead."); + endif + if (nargin < 2) print_usage; elseif (!(isnumeric (data_struct) || iscell (data_struct))) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |