On Wed, Jun 29, 2011 at 11:58:55AM +0200, c. wrote:
> 
> On 29 Jun 2011, at 11:02, Olaf Till wrote:
> 
> > I'd try to clarify first if indeed having a single return point is
> > considered mandatory
> 
> It sure isn't mandatory in Octave-Forge where coding guidelines are not as 
> strict as in Octave core.
> On the other hand I do find it useful when debugging ...
> 
> > or if garbling the workspace if returning from
> > within a block could be considered a bug in Octave.
> 
> This should probably be discussed on the Octave maintainers ML, I am not 
> qualified enough to answer this question.
> 
> > It worked with
> > previous Octave versions, and surely cell2cell is not the only place
> > where such a way to return was chosen.
> 
> I would like to clarify that I don't think multiple return points where the 
> CAUSE of the bug,
> it is a completely legitimate choice and should work.
> I just changed the structure to make it easier FOR ME to understand the 
> function flow, and it happened that
> this removed the error which I, therefore, presume was in one of the lines of 
> code that I changed. 
> 
> Although I did not learn what exactly the error was, as I had a working 
> version of the function I went on 
> and proposed the patch.
> 
> I agree that studying further to understand the real source of the error is a 
> better approach and encourage you to do so.
> 
> > Olaf
> c.

It occured to me that with your example the returns within the blocks
weren't supposed to be met at all, but only 

  Cell retval (rdims);

...

  return octave_value (retval);

in the outer function block. And cell2cell should have nothing to do
with Octaves workspace variables anyway. I'd guess that no mistake in
the code of cell2cell caused the "garbling", and I don't have current
tip of Octave installed ... maybe one could find a minimal example
that triggers that possible bug in Octaves unstable version, but I'll
probably won't have time for this at the moment.

Olaf

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to