octave-maintainers
[Top][All Lists]
Advanced

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

Re: AW: AW: AW: AW: Re: AW: textscan (Contd.)


From: Philip Nienhuis
Subject: Re: AW: AW: AW: AW: Re: AW: textscan (Contd.)
Date: Fri, 04 May 2012 19:32:02 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100701 SeaMonkey/2.0.6

(Maintainers list:
Alexander Graf and I had a private e-mail exchange about textscan bugs that yesterday finally have been fixed (see bugs #36356 and #36392) but not pushed yet. From this point on I think the discussion may be useful for a somewhat broader audience as it displays more ML textscan corner case idiosyncrasies - see previous dicussions, e.g. here: https://mailman.cae.wisc.edu/pipermail/octave-maintainers/2011-October/025443.html )

==================

Thanks, Alexander, for your prompt reply.

Your ML results show that there's another bug in textscan and one in strread.m while processing litterals, see below:

Graf, Alexander wrote:
Philip Nienhuis wrote:

Could you please tell me what ML returns for the following
statements (I'm not at work until Tuesday 15 May, so I can't
check myself):
Hi,

cell (1, 3)

ans =

     []    []    []

octave:2> cell (1, 3)
ans =
{
  [1,1] = [](0x0)
  [1,2] = [](0x0)
  [1,3] = [](0x0)
}

cell (0, 3)

ans =

    Empty cell array: 0-by-3

octave:1> cell (0, 3)
ans = {}(0x3)

My conclusion:
ML and Octave do largely the same but display it differently. Which confirms your conclusion that for your scripts, Octave's textscan now performs similar to ML's textscan.
That means: 2 bugs squashed. Good.

C = textscan (' ', '%f %f')

??? Error using ==>  textscan
First input can not be empty.

octave:3> C = textscan (' ', '%f %f')
C =
{
  [1,1] = [](0x1)
  [1,2] = [](0x1)
}

Apparantly a ML bug. Or more politely put: undocumented behaviour.
The leading whitespace should have been simply ignored.

D = textscan ([char(10)], '%f %f')

D =

     [0x1 double]    [0x1 double]

octave:4> D = textscan ([char(10)], '%f %f')
error: textscan: subscript indices must be either positive integers or logicals
error: called from:
error: C:\Programs\Octave\Octave3.6.1_gcc4.6.2\share\octave\3.6.1\m\io\textscan.m at line 256, column 12

*** Wow, another bug in textscan.


E = textscan (['Empty'], 'Empty%f %f')

E =

     [NaN]    [NaN]

Probably another ML bug.
The command doesn't really differ from the previous one except for a leading litteral, so IMO it should return the same output.

octave:4> E = textscan (['Empty'], 'Empty%f %f')
warning: strread: unable to parse text or file with given format string
error: some elements undefined in return list
error: called from:
error: C:\Programs\Octave\Octave3.6.1_gcc4.6.2\share\octave\3.6.1\m\io\textscan.m at line 266, column 9

Ah... another strread.m bug.

E = textscan (['Empty' char(10)], 'Empty%f %f')

E =

     [NaN]    [NaN]

Octave:
same as above.

So, some more home work for me......

BTW what ML version do you use?

Thanks very much for your cooperation.
I have the fixes ready, hopefully I can upload them this evening, if not it'll be two weeks from now (as from early tomorrow I'll be away until mid May).

Philip


reply via email to

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