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

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

[Octave-bug-tracker] [bug #41651] Nested uses of evalin( 'caller', ... )


From: Michael C. Grant
Subject: [Octave-bug-tracker] [bug #41651] Nested uses of evalin( 'caller', ... )
Date: Fri, 21 Feb 2014 01:58:19 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?41651>

                 Summary: Nested uses of evalin( 'caller', ... )
                 Project: GNU Octave
            Submitted by: mcgrant
            Submitted on: Fri 21 Feb 2014 01:58:18 AM GMT
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: Michael C. Grant
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Mac OS

    _______________________________________________________

Details:

Consider the functions evalin_test1 and evalin_test2 attached.

First, look at evalin_test2:

function evalin_test2
x = 'In the workspace for evalin_test2';
disp( evalin( 'caller', 'x' ) );

This function works the same in MATLAB and Octave. Here's MATLAB's output:

>> x = 'In the global workspace';
>> evalin_test2;
In the global workspace

Now let's add a layer of nesting with evalin_test1:

function evalin_test1
x = 'In the workspace for evalin_test1';
evalin( 'caller', 'evalin_test2' );

Since evalin_test2 is evaluated in the global workspace, it should still 
give the same result. That is what happens with MATLAB:

>> x = 'In the global workspace';
>> evalin_test2;
In the global workspace

But in Octave, the nesting fails:

>> x = 'In the global workspace';
>> evalin_test2
In the global workspace
>> evalin_test1
In the workspace for evalin_test1

I know this probably sounds obscure, but I actually rely on this behavior 
somewhat critically in CVX... now I am somewhat relieved that you did not
include my parser patch in 3.8.1, because it looks like it would not have
been sufficient anyway!




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fri 21 Feb 2014 01:58:18 AM GMT  Name: evalin_test2.m  Size: 95B   By:
mcgrant

<http://savannah.gnu.org/bugs/download.php?file_id=30625>
-------------------------------------------------------
Date: Fri 21 Feb 2014 01:58:18 AM GMT  Name: evalin_test1.m  Size: 99B   By:
mcgrant

<http://savannah.gnu.org/bugs/download.php?file_id=30626>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?41651>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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