# HG changeset patch # User jwe # Date 863730823 0 # Node ID 49de012386386b383cd6d050695610a84957636e # Parent d6ba658ac4ae1a900afb1a9aaaebe325ac13c5fe [project @ 1997-05-15 21:13:42 by jwe] diff -r d6ba658ac4ae -r 49de01238638 src/ChangeLog --- a/src/ChangeLog Thu May 15 20:46:34 1997 +0000 +++ b/src/ChangeLog Thu May 15 21:13:43 1997 +0000 @@ -1,5 +1,8 @@ Thu May 15 11:48:10 1997 John W. Eaton + * variables.cc (bind_ans): Only bind ans and print result if value + is defined. + * defun.cc: New file. Move functions for installing objects in the symbol table here from variables.cc. diff -r d6ba658ac4ae -r 49de01238638 src/pt-exp.cc --- a/src/pt-exp.cc Thu May 15 20:46:34 1997 +0000 +++ b/src/pt-exp.cc Thu May 15 21:13:43 1997 +0000 @@ -913,7 +913,7 @@ ult.assign (octave_value::asn_eq, tmp); } else - error ("element number %d undefined in return list", k+1); + error ("element number %d undefined in return list", k); if (error_state) eval_error (); diff -r d6ba658ac4ae -r 49de01238638 src/variables.cc --- a/src/variables.cc Thu May 15 20:46:34 1997 +0000 +++ b/src/variables.cc Thu May 15 21:13:43 1997 +0000 @@ -1469,10 +1469,13 @@ { static symbol_record *sr = global_sym_tab->lookup ("ans", true); - sr->define (val); + if (val.is_defined ()) + { + sr->define (val); - if (print) - val.print_with_name (octave_stdout, "ans"); + if (print) + val.print_with_name (octave_stdout, "ans"); + } } void