octave-maintainers
[Top][All Lists]
Advanced

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

Correct ways to return from a dynamically loaded function?


From: Olaf Till
Subject: Correct ways to return from a dynamically loaded function?
Date: Wed, 29 Jun 2011 11:10:55 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

Hi,

Carlo told me that a certain dynamically loaded function in Octave
Forge made problems (variables lost from Octaves global workspace)
with current development version of Octave, and that these problems
did not occur if the function was changed to have a single return
point.

In the function I had multiple instances of, e.g.

  if (something)
    {
      error ("some error");
      return octave_value_list ();
    }

Is this considered a "legal" way to return? If not, is it considered
legal if the octave_value_list was defined outside the block, i.e.

  octave_value_list ret;
  if (something)
    {
      error ("some error");
      return ret;
    }

?

Olaf


reply via email to

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