+= operator strangeness in octave 4.4 build

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

+= operator strangeness in octave 4.4 build

Richard Kirk
Hi.

I have a 4.4 source build on CenoOS 6.5. This took a bit of getting to
work, but it all seems to be up and running with one mysterious exception.

I make a local file "dummy.m" with just 3 lines...
# Increment count

count += 1;

I now try to use it to increment 'count'...

octave:1> count = 0;
octave:2> count += 1;
octave:3> count
count =  1

Okay, that worked. Now let's do that by calling dummy.m...

octave:4> dummy
error: count(61,_): but count has size 1x1
error: called from
     dummy at line 3 column 1

If I replace count += 1; with ++count; in dummy.m then it works.That is
my workaround, and I am fine with that for now. However, it used to work
in 3.4.3.

Does anyone else see this, or have I mucked up my build somehow? If it
is real, I can file a bug.

Thanks
Richard Kirk



Reply | Threaded
Open this post in threaded view
|

Re: += operator strangeness in octave 4.4 build

Richard Kirk
Found it. It seems to be a known bug that has come back in 4.2.0. But
the bug seems to be closed.

https://savannah.gnu.org/bugs/?func=detailitem&item_id=52363

On 05/10/2018 11:59 AM, Richard Kirk wrote:

>
> I have a 4.4 source build on CenoOS 6.5. This took a bit of getting to
> work, but it all seems to be up and running with one mysterious
> exception.
>
> I make a local file "dummy.m" with just 3 lines...
> # Increment count
>
> count += 1;
>
> I now try to use it to increment 'count'...
>
> octave:1> count = 0;
> octave:2> count += 1;
> octave:3> count
> count =  1
>
> Okay, that worked. Now let's do that by calling dummy.m...
>
> octave:4> dummy
> error: count(61,_): but count has size 1x1
> error: called from
>     dummy at line 3 column 1
>
> If I replace count += 1; with ++count; in dummy.m then it works.That
> is my workaround, and I am fine with that for now. However, it used to
> work in 3.4.3.
>
> Does anyone else see this, or have I mucked up my build somehow? If it
> is real, I can file a bug.
>
> Thanks
> Richard Kirk
>
>
>


--
FilmLight Ltd.   Tel: +44 (0)20 7292 0400 or 0409 224 (direct)
Artists House, Fax: +44 (0)20 7292 0401
14-15 Manette Street
London W1D 4AP



Reply | Threaded
Open this post in threaded view
|

Re: += operator strangeness in octave 4.4 build

Doug Stewart-4
In reply to this post by Richard Kirk


On Thu, May 10, 2018 at 6:59 AM, Richard Kirk <[hidden email]> wrote:
Hi.

I have a 4.4 source build on CenoOS 6.5. This took a bit of getting to work, but it all seems to be up and running with one mysterious exception.

I make a local file "dummy.m" with just 3 lines...
# Increment count

count += 1;

I now try to use it to increment 'count'...

octave:1> count = 0;
octave:2> count += 1;
octave:3> count
count =  1

Okay, that worked. Now let's do that by calling dummy.m...

octave:4> dummy
error: count(61,_): but count has size 1x1
error: called from
    dummy at line 3 column 1

If I replace count += 1; with ++count; in dummy.m then it works.That is my workaround, and I am fine with that for now. However, it used to work in 3.4.3.

Does anyone else see this, or have I mucked up my build somehow? If it is real, I can file a bug.

Thanks
Richard Kirk



I am un ubuntu 16.04 and octave 4.4.0
and I see the same problem that you see.

I looked in libinterp/parse-tree/oct-parse.in.yy
And the fix that was put there
http://hg.savannah.gnu.org/hgweb/octave/rev/d2cfaaa57677
seems to be gone!
(arround line 4000)

--
DASCertificate for 206392