'help switch' has invalid example, or parser error

John W. Eaton jwe at octave.org
Wed Jul 15 21:02:14 CDT 2009


On 14-Jul-2009, Rob Mahurin wrote:

| In 3.2.0, pasting the example from 'help switch' fails with
| 
| >   syntax error
| >
| > >>>            case {"Yes" "yes" "YES" "y" "Y"}
| >                                ^
| 
| 
| I don't know whether the example is wrong, or whether the parser is  
| wrong to require a comma.  Note that
| 
| > x = {"Yes" "yes" "YES" "y" "Y"};
| > switch yesno; case x; ...
| 
| 
| is accepted.

This problem seems to be fixed in the current sources.  I think the
patches to fix it were

  http://hg.savannah.gnu.org/hgweb/octave/rev/29563379fa9b
  http://hg.savannah.gnu.org/hgweb/octave/rev/70e0d3b1f26f

These changesets also appear to be applied to the 3.2.x release
branch.

jwe


More information about the Bug-octave mailing list