classdef class_delete_method < handle
  properties
    value
  endproperties

  methods
    function self = class_delete_method (val)
      if (nargin < 1)
        val = 0;
      endif
      self.value = val;
    endfunction

    function delete (self)
      if (isinteger (self.value))
        fprintf (stderr, 'int\n');
      endif
      fprintf (stderr, '');
      assignin ("base", "saved_value", self.value);
    endfunction

    function ret = subsref (self, idx)
      ret = self.value;
    endfunction
  endmethods
endclassdef
