From bug-octave-request at bevo dot che dot wisc dot edu Thu Jan 22 21:36:56 2004 Subject: STR2NUM and nasty side effects From: "John W. Eaton" To: Schloegl Alois Cc: bug-octave at bevo dot che dot wisc dot edu Date: Thu, 22 Jan 2004 21:36:00 -0600 On 19-Jan-2004, Schloegl Alois wrote: | I was analyzing some ascii files, which contain some configuration | information. Unexpectingly, the working directory has suddenly | changed. | | I tracked the problem down to STR2NUM. STR2NUM is using EVAL. OK, maybe this is undesirable. But if we are going to change str2num, then I would prefer to have an interface that is compatible with Matlab. I noticed that Matlab's documentation says that str2num uses eval and that it could evaluate functions which produce side effects, though I was unable to come up with an example that did. In any case, it also claims that str2double avoids the use of eval, so perhaps we should have both str2num and str2double that are compatible? jwe ------------------------------------------------------------- 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 -------------------------------------------------------------