octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 3.2 status report


From: John W. Eaton
Subject: Re: 3.2 status report
Date: Wed, 06 Aug 2008 12:05:41 -0400

On  6-Aug-2008, Jaroslav Hajek wrote:

| The reason for this change is that Matlab's choice makes the structure
| visually useless: if you dump it on the screen, the relevant options
| are hindered by a flood of empty fields which you're completely not
| interested in (and sometimes they don't even make sense). I really
| don't understand why the Matlab people made this choice.
| Thus, there is no simple way to inspect what options a structure
| actually contains.

Other than the clutter, I'm not sure I understand what real problem
this change is trying to solve.  Can you give an example?

| -  elseif (rem (nargs, 2) && isstruct (varargin{1}))
| -    ## Set values in old from name/value pairs.
| -    retval = optimset (varargin{1}, struct (varargin{2:end}));
| -  elseif (rem (nargs, 2) == 0)
| -    ## Create struct.  Default values are replaced by those specified by
| -    ## name/value pairs.
| -    retval = optimset (optimset (), struct (varargin{:}));
|    else
| -    print_usage ();
| +    if (rem (nargs, 2) && isstruct (varargin{1}))
| +      ## Set values in old from name/value pairs.
| +      s1 = varargin{1}; op = varargin(2:end);
| +    elseif (rem (nargs, 2) == 0)
| +      ## Create struct.  Default values are replaced by those specified by
| +      ## name/value pairs.
| +      s1 = struct (); op = varargin(:);
| +    else
| +      print_usage ();
| +    endif
|    endif

Why change this from

  elseif
  elseif
  else
  endif

to

  else
    if
    elseif
    else
    endif
  endif

?

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]