octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #36743] Octave:language-extension warning warn


From: Carnë Draug
Subject: [Octave-bug-tracker] [bug #36743] Octave:language-extension warning warns about Octave's own files
Date: Sat, 19 Sep 2015 01:23:52 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.2.1

Follow-up Comment #11, bug #36743 (project octave):

> I wasn't aware that automatic broadcasting used a different syntax. [...]

A misunderstanding over the meaning of "syntax".  Yes, it is not a separate
symbol for automatic broadcasting.  My point was why should we treat automatic
broadcasting different from everything else that we do different from Matlab.

> You also refer to "doing input checking". As far as I can see, that is
impossible. [...]

I mean to check the sizes of your vectors before doing your operations.  Or to
just reshape them (which is what most often happens).  All of Octave plays
with the same "rules" as you, so this is perfectly possible.

If your functions expect two vectors, your functions should check if they are
of the right size and throw an error if they are not.

> [...] As it stands, it will fail the next time I assume that length(c)=2, at
a place far from where the real error is.

You should have checked if `a` and `b` where both vectors of same shape.  If
you are typing at the interpreter, you will catch the error pretty soon. If
this is a function part of some library, it should perform input checking.

> automatic broadcasting (...) is something that we should have the option of
being warned about.

The warnings were during 3.6 and 3.8.  That's a 2 years warning.

>> If the reason is that you didn't saw warnings back in 3.8 [...]
> No, I did see warnings back in 3.8, as I wanted.

I meant that you didn't saw warnings about use of broadcasting from inside
core functions.  And that's because the code in core and in packages disabled
the warnings locally. Automatic broadcasting is Octave valid syntax so
functions should not have to disable it.

-----

Sounds to me, like the only thing you want is to enable the automatic
broadcasting warning only. This is nothing to do with Matlab compatibility and
a small part of the original bug report. It is about a syntax that you don't
like and where you trip too often.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?36743>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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