bugGNU Octave - Bugs: bug #51096, publish fails when clear all is...

 
 

bug #51096: publish fails when clear all is used

Submitter:  Juan Pablo Carbajal <juanpi>
Submitted:  Tue 23 May 2017 12:52:31 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  juanpi Open/Closed:  * Closed
Release:  * 4.2.1 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 18 Aug 2017 06:50:06 PM UTC, comment #8: 

Good catch Kai. If you think that's a feature worth restoring at some point go ahead and file a new bug.

Mike Miller <mtmiller>
Group Member
Thu 17 Aug 2017 08:33:27 PM UTC, comment #7: 

I just want to document one minor regression regarding command-line functions.  The solution is to run the script (like in the example below) prior to publishing it, as the necessary command-line functions seem to be present then.


## Simple Test
#
##

1;
function c = mysum (a, b)
  c = a + b;
endfunction

c = mysum (2, 3)

##
# Saving break
#

c = mysum (2, 3)


At least we are still "better" than Matlab regarding command-line functions, such a thing does not work there.

Kai Torben Ohlhus <siko1056>
Group Member
Wed 16 Aug 2017 02:08:03 PM UTC, comment #6: 

Thank you Mike, it works perfectly for me!  A shame we cannot make a BIST for this bug, but it is only publish...


I think we can close this issue now.

Kai Torben Ohlhus <siko1056>
Group Member
Wed 16 Aug 2017 12:00:17 AM UTC, comment #5: 

I have a fix that seems to work here, but "clear all" still can't be used in Octave's test suite because global variables are used, and "clear all" wipes out any globals.

I pushed this on the default branch without a test, please test if you are affected by this, and let me know if it works or if I broke anything.

https://hg.savannah.gnu.org/hgweb/octave/rev/ab1aa0e57b72

Mike Miller <mtmiller>
Group Member
Tue 15 Aug 2017 06:44:00 PM UTC, comment #4: 

I'm working on a change to fix this, to use an inline function definition similar to the way the test function works to create local scopes. If that works for me, I think I can get rid of the triple-underscore variable names as well, since they won't be needed for disambiguation.

Mike Miller <mtmiller>
Group Member
Tue 15 Aug 2017 06:28:27 PM UTC, comment #3: 

Regarding comment #2 that is true.  Compared to Matlab my initial publish implementation only works with scripts and has a "primitive" evaluation.  But it is pure m-code!  Is there a way to create a new context, except my idea of using a functions context?

The problem of the original submission was discussed on the mailing list, just as a pointer: http://octave.1599824.n4.nabble.com/Publish-td4683415.html.

Kai Torben Ohlhus <siko1056>
Group Member
Tue 15 Aug 2017 05:45:42 PM UTC, comment #2: 

The publish function no longer errors on this example, but it does still produce a spurious output in the resulting html:


error: '___context___' undefined near line 1035 column 20
        in:

clear all
disp("Sad...")


Unfortunately this is because the subfunction that evaluates the script in question has local variables, and the script is run in the same context as that subfunction.

Mike Miller <mtmiller>
Group Member
Wed 07 Jun 2017 12:18:42 AM UTC, comment #1: 

I'm currently doing some significant refactoring of the symbol table, so maybe this will be easier to fix once that is done.

John W. Eaton <jwe>
Group administrator
Tue 23 May 2017 12:52:31 PM UTC, original submission:  

Trying to publish a script that calls makes publish fail with the error


error: 'create_output' undefined near line 375 column 17
error: called from
     publish at line 375 column 15


This is due to bug #35881

Here a short example

## A simple example
#
# This will break publish
#
clear all
disp("Sad...")


Juan Pablo Carbajal <juanpi>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by siko1056 (Updated the item)
  • -email is unavailable- added by juanpi (Submitted the item)
  • -email is unavailable- added by juanpi
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-08-16 mtmiller StatusWorks For Me Fixed
        Open/ClosedOpen Closed
    2017-08-16 siko1056 StatusReady For Test Works For Me
    2017-08-16 mtmiller StatusIn Progress Ready For Test
    2017-08-15 mtmiller StatusPostponed In Progress
    2017-06-06 siko1056 StatusNone Postponed
        Dependencies- Depends on bugs #35881
    2017-05-23 juanpi Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code