Adds item only if not already present $Id$
0001 function o = add_if_absent(o, item, data) 0002 % Adds item only if not already present 0003 % 0004 % $Id$ 0005 0006 if nargin < 2 0007 error('Need name of item to add'); 0008 end 0009 if nargin < 3 0010 error('Need data to put into item'); 0011 end 0012 if ~item_exists(o, item) 0013 o = add_item(o, item, data); 0014 end