[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #47687] automatic broadcasting for assignment
From: |
Carnë Draug |
Subject: |
[Octave-bug-tracker] [bug #47687] automatic broadcasting for assignment operations |
Date: |
Sat, 16 Apr 2016 19:24:58 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.7.1 |
Follow-up Comment #8, bug #47687 (project octave):
@Lachlan
> [...] When you distinguish "local" from "the scope of the function", what is
the difference? Does "local" mean just the current stack frame and "scope"
mean the stack frame and all descendants?
Indeed, local usually means local to the function. But some years ago,
warning has an option named "local" which only affects the current stack frame
and downstream. You are well aware that warning states are global, but if you
don't know about the "local" option", see the effect here:
function trigger_warn ()
5 / 0;
endfunction
function foo ()
disp ("trigger warning in subfunction");
trigger_warn ();
disp ("'locally' disable warning and cause warning in sub-function");
warning ("off", "Octave:divide-by-zero", "local");
trigger_warn ();
endfunction
warning ("query", "Octave:divide-by-zero")
foo ()
warning ("query", "Octave:divide-by-zero")
Which generates:
octave> warning ("query", "Octave:divide-by-zero")
ans =
scalar structure containing the fields:
identifier = Octave:divide-by-zero
state = on
octave> foo ()
trigger warning in subfunction
warning: division by zero
warning: called from
trigger_warn at line 2 column 5
foo at line 3 column 3
'locally' disable warning and cause warning in sub-function
octave> warning ("query", "Octave:divide-by-zero")
ans =
scalar structure containing the fields:
identifier = Octave:divide-by-zero
state = on
This reduced the use of unwind_protect blocks. The use of word "local" for
this option was unfortunate (there are several other like this, try 'lookfor
("-all", '"local"')').
So when I said 'scope of the caller only (different from the "local" option in
warning)', I mean only the current stack frame.
> [...] suggesting "underline /", "underline *" etc for operations with
broadcast. Any other combination of symbols would be fine. [...] Was that
discussed at OctConf too?
No, only whether we should place the warnings back or remove the language
extension warning.
> On an unrelated note, how would you feel about putting these "to-do" items
in the task list, instead of the bug list?
I wrote a long text explaining that was not good because you can't move items
between trackers. Seems Like I was wrong. The only thing I'll point out is
that I feel less people subscribed to the task and patch tracker (based on the
reduced number of replies I get when I report there). I'll move this to the
task tracker.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?47687>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #47687] automatic broadcasting for assignment operations, Carnë Draug, 2016/04/13
- [Octave-bug-tracker] [bug #47687] automatic broadcasting for assignment operations, Lachlan Andrew, 2016/04/13
- [Octave-bug-tracker] [bug #47687] automatic broadcasting for assignment operations, Michael Godfrey, 2016/04/13
- [Octave-bug-tracker] [bug #47687] automatic broadcasting for assignment operations, Lachlan Andrew, 2016/04/14
- [Octave-bug-tracker] [bug #47687] automatic broadcasting for assignment operations, Carnë Draug, 2016/04/14
- [Octave-bug-tracker] [bug #47687] automatic broadcasting for assignment operations, Lachlan Andrew, 2016/04/14
- [Octave-bug-tracker] [bug #47687] automatic broadcasting for assignment operations, Lachlan Andrew, 2016/04/14
- [Octave-bug-tracker] [bug #47687] automatic broadcasting for assignment operations, Michael Godfrey, 2016/04/15
- [Octave-bug-tracker] [bug #47687] automatic broadcasting for assignment operations,
Carnë Draug <=