octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #57229] embedded.cc example in examples/code s


From: Rik
Subject: [Octave-bug-tracker] [bug #57229] embedded.cc example in examples/code starts an interactive interpreter
Date: Thu, 14 Nov 2019 14:52:48 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Follow-up Comment #2, bug #57229 (project octave):

Adding jwe to the CC list since this is probably only resolvable with his
help.

This might be quite simple.  It may be that the API has changed and it is the
example code in embedded.cc that needs to change.

I can get this to work if I make this change


diff -r 7e6836784575 examples/code/embedded.cc
--- a/examples/code/embedded.cc Thu Nov 14 11:14:25 2019 -0800
+++ b/examples/code/embedded.cc Thu Nov 14 11:49:43 2019 -0800
@@ -39,7 +39,9 @@ main (void)
 
       // Tell the interpreter that we're ready to execute commands:
 
-      int status = interpreter.execute ();
+      interpreter.initialize ();
+      int status = 0;
+      //int status = interpreter.execute ();
 
       if (status != 0)
         {


It seems that the member function execute both calls initialize() and runs the
interactive version.

If embedded.cc is going to change then the prototype for initialize() should
probably also be changed to return an exit code rather than void.  After
initialization, the code in embedded.cc is


if (status != 0)
  {
    std::cerr << "creating embedded Octave interpreter failed!"
              << std::endl;
    return status;
  }


which relies on a status indication output.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57229>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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