Thu 02 Aug 2012 12:40:25 AM UTC, comment #6:
Functions in demo blocks are allowed now that support for nested functions has been added to Octave. The code which tested and prevented declaring functions in demo blocks has been removed in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/dda73cb60ac5).
|
Wed 01 Aug 2012 04:48:51 PM UTC, comment #5:
That change seems OK to me.
Thanks.
|
Wed 01 Aug 2012 04:45:31 PM UTC, comment #4:
John, the issue in this bug report has gone away thanks to support for nested functions. I am thinking of removing the code which tests for the presence of a function within a demo block and reports an error if a function is found. Is there any objection?
I think I will leave the code which checks for functions in %!test blocks so that there is still a preference to use the %!function/%!endfunction syntax. I think forcing the programmer to be explicit about creating a shared test function is not a bad idea.
|
Mon 19 Dec 2011 02:25:07 AM UTC, comment #3:
I have committed a changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/80bda7c4f012) which prevents embedded functions within %!test and %!demo blocks. This will stop the segmentation faults and the warning message points directs coders to the syntax which does work (%!function/%!endfunction). The root cause fix is still to address how subfunctions are handled in Octave.
|
Thu 11 Aug 2011 12:40:11 PM UTC, comment #2:
Thanks. I thought I had seen something like this report earlier, but I didn't search for it. I've linked these two bug reports.
|
Thu 11 Aug 2011 05:21:14 AM UTC, comment #1:
The same happens id 'test' is used instead of 'demo':
I think this bug is related to the one reported in
http://savannah.gnu.org/bugs/?32843
here is the backtrace of the crash in this case:
|
Wed 10 Aug 2011 03:52:39 PM UTC, original submission:
Given a demo block in a .m file that contains a function definition, executing demo for that .m file three times will crash Octave. The demo block can be as simple as
Here is a stack trace of the crash:
|