[Scilab-users] Scilab 6 - Problem with scope and nested lists

classic Classic list List threaded Threaded
7 messages Options
Arvid Rosén Arvid Rosén
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] Scilab 6 - Problem with scope and nested lists

Hi!

 

We have found a tricky issue when moving over from Scilab 5 to Scilab 6 in my organization. We have a lot of code which works with nested lists, and functions modifying those lists. However, when a function is called with some nested lists as an input argument, the body of that function can change the value of the variable in the calling scope. This was not the case in Scilab 5, and the issue is super tricky to hunt down in our quite extensive code base. Below is a short example of the problem, and how to reproduce it.

 

I have also filed a bug report here: https://bugzilla.scilab.org/show_bug.cgi?id=16556

 

Is anyone else seeing this problem? And do you have any workarounds or other suggestions?

 

Cheers,

Arvid

 

------

 

// Define variables

testArray = list();

for i=1:1:10

    testArray($+1) = list();

    for j=1:1:10

        testArray(i)($+1) = [];

        testArray(i)(j).testMember = 1;

    end

end

testArrayOrig = testArray;

 

// Define functions

function outArray = testFunc(inArray)

    for i=1:1:10

        for j=1:1:10

            inArray(i)(j).testMember = 5

        end

    end

    outArray = inArray;

endfunction

 

// Send the variable as argument to the function

if %t

    testArrayOut = testFunc2(testArray);

 

    if testArrayOut(1)(1).testMember == testArray(1)(1).testMember

        error("Error! inputArgument was changed by function");

    end

end


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Re: Scilab 6 - Problem with scope and nested lists

Hello,

I think that this is a sufficiently serious issue to diserve a report in bugzilla.scilab.org. But could you prepare a more compact example ?

S.

Le 16/10/2020 à 13:35, Arvid Rosén a écrit :

Hi!

 

We have found a tricky issue when moving over from Scilab 5 to Scilab 6 in my organization. We have a lot of code which works with nested lists, and functions modifying those lists. However, when a function is called with some nested lists as an input argument, the body of that function can change the value of the variable in the calling scope. This was not the case in Scilab 5, and the issue is super tricky to hunt down in our quite extensive code base. Below is a short example of the problem, and how to reproduce it.

 

I have also filed a bug report here: https://bugzilla.scilab.org/show_bug.cgi?id=16556

 

Is anyone else seeing this problem? And do you have any workarounds or other suggestions?

 

Cheers,

Arvid

 

------

 

// Define variables

testArray = list();

for i=1:1:10

    testArray($+1) = list();

    for j=1:1:10

        testArray(i)($+1) = [];

        testArray(i)(j).testMember = 1;

    end

end

testArrayOrig = testArray;

 

// Define functions

function outArray = testFunc(inArray)

    for i=1:1:10

        for j=1:1:10

            inArray(i)(j).testMember = 5

        end

    end

    outArray = inArray;

endfunction

 

// Send the variable as argument to the function

if %t

    testArrayOut = testFunc2(testArray);

 

    if testArrayOut(1)(1).testMember == testArray(1)(1).testMember

        error("Error! inputArgument was changed by function");

    end

end


_______________________________________________
users mailing list
[hidden email]
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Arvid Rosén Arvid Rosén
Reply | Threaded
Open this post in threaded view
|

Re: Scilab 6 - Problem with scope and nested lists

Hi,

 

I already filed a report here:

 https://bugzilla.scilab.org/show_bug.cgi?id=16556

 

Do you want a more compact example than that?

 

Here is an even more slimmed version.

Cheers,

Arvid

 

----------

 

// Define variables

testArray = list(list([]));

testArray(1)(1).testMember = 1;

testArrayOrig = testArray;

 

// Define function

function outArray = testFunc(inArray)

    inArray(1)(1).testMember = 5

    outArray = inArray;

endfunction

 

// Send the variable as argument to the function

testArrayOut = testFunc(testArray);

 

if testArrayOut(1)(1).testMember == testArray(1)(1).testMember

    error("Error! inputArgument was changed by function");

end

 

 

-- 

 

From: Scilab Users List <[hidden email]> on behalf of Stéphane Mottelet <[hidden email]>
Reply to: Users mailing list for Scilab <[hidden email]>
Date: Friday, 16 October 2020 at 13:40
To: "[hidden email]" <[hidden email]>
Subject: Re: [Scilab-users] Scilab 6 - Problem with scope and nested lists

 

Hello,

I think that this is a sufficiently serious issue to diserve a report in bugzilla.scilab.org. But could you prepare a more compact example ?

S.

Le 16/10/2020 à 13:35, Arvid Rosén a écrit :

Hi!

 

We have found a tricky issue when moving over from Scilab 5 to Scilab 6 in my organization. We have a lot of code which works with nested lists, and functions modifying those lists. However, when a function is called with some nested lists as an input argument, the body of that function can change the value of the variable in the calling scope. This was not the case in Scilab 5, and the issue is super tricky to hunt down in our quite extensive code base. Below is a short example of the problem, and how to reproduce it.

 

I have also filed a bug report here: https://bugzilla.scilab.org/show_bug.cgi?id=16556

 

Is anyone else seeing this problem? And do you have any workarounds or other suggestions?

 

Cheers,

Arvid

 

------

 

// Define variables

testArray = list();

for i=1:1:10

    testArray($+1) = list();

    for j=1:1:10

        testArray(i)($+1) = [];

        testArray(i)(j).testMember = 1;

    end

end

testArrayOrig = testArray;

 

// Define functions

function outArray = testFunc(inArray)

    for i=1:1:10

        for j=1:1:10

            inArray(i)(j).testMember = 5

        end

    end

    outArray = inArray;

endfunction

 

// Send the variable as argument to the function

if %t

    testArrayOut = testFunc2(testArray);

 

    if testArrayOut(1)(1).testMember == testArray(1)(1).testMember

        error("Error! inputArgument was changed by function");

    end

end



_______________________________________________
users mailing list
[hidden email]
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

-->


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Re: Scilab 6 - Problem with scope and nested lists

Your test mix struct and lists can you reproduce it without using a struct ?

Le 16/10/2020 à 14:15, Arvid Rosén a écrit :

Hi,

 

I already filed a report here:

 https://bugzilla.scilab.org/show_bug.cgi?id=16556

 

Do you want a more compact example than that?

 

Here is an even more slimmed version.

Cheers,

Arvid

 

----------

 

// Define variables

testArray = list(list([]));

testArray(1)(1).testMember = 1;

testArrayOrig = testArray;

 

// Define function

function outArray = testFunc(inArray)

    inArray(1)(1).testMember = 5

    outArray = inArray;

endfunction

 

// Send the variable as argument to the function

testArrayOut = testFunc(testArray);

 

if testArrayOut(1)(1).testMember == testArray(1)(1).testMember

    error("Error! inputArgument was changed by function");

end

 

 

-- 

 

From: Scilab Users List [hidden email] on behalf of Stéphane Mottelet [hidden email]
Reply to: Users mailing list for Scilab [hidden email]
Date: Friday, 16 October 2020 at 13:40
To: [hidden email] [hidden email]
Subject: Re: [Scilab-users] Scilab 6 - Problem with scope and nested lists

 

Hello,

I think that this is a sufficiently serious issue to diserve a report in bugzilla.scilab.org. But could you prepare a more compact example ?

S.

Le 16/10/2020 à 13:35, Arvid Rosén a écrit :

Hi!

 

We have found a tricky issue when moving over from Scilab 5 to Scilab 6 in my organization. We have a lot of code which works with nested lists, and functions modifying those lists. However, when a function is called with some nested lists as an input argument, the body of that function can change the value of the variable in the calling scope. This was not the case in Scilab 5, and the issue is super tricky to hunt down in our quite extensive code base. Below is a short example of the problem, and how to reproduce it.

 

I have also filed a bug report here: https://bugzilla.scilab.org/show_bug.cgi?id=16556

 

Is anyone else seeing this problem? And do you have any workarounds or other suggestions?

 

Cheers,

Arvid

 

------

 

// Define variables

testArray = list();

for i=1:1:10

    testArray($+1) = list();

    for j=1:1:10

        testArray(i)($+1) = [];

        testArray(i)(j).testMember = 1;

    end

end

testArrayOrig = testArray;

 

// Define functions

function outArray = testFunc(inArray)

    for i=1:1:10

        for j=1:1:10

            inArray(i)(j).testMember = 5

        end

    end

    outArray = inArray;

endfunction

 

// Send the variable as argument to the function

if %t

    testArrayOut = testFunc2(testArray);

 

    if testArrayOut(1)(1).testMember == testArray(1)(1).testMember

        error("Error! inputArgument was changed by function");

    end

end



_______________________________________________
users mailing list
[hidden email]
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

-->


_______________________________________________
users mailing list
[hidden email]
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Arvid Rosén Arvid Rosén
Reply | Threaded
Open this post in threaded view
|

Re: Scilab 6 - Problem with scope and nested lists

Hi,

 

The minimal case I posted mimics the situation where the problem was found. Removing the struct, and using just to levels of lists, does not trigger the same problem. I have played around with this a bit, and yet haven’t found a smaller case to trigger the issue.

 

Cheers,

Arvid

 

 

From: Scilab Users List <[hidden email]> on behalf of Stéphane Mottelet <[hidden email]>
Reply to: Users mailing list for Scilab <[hidden email]>
Date: Friday, 16 October 2020 at 14:20
To: "[hidden email]" <[hidden email]>
Subject: Re: [Scilab-users] Scilab 6 - Problem with scope and nested lists

 

Your test mix struct and lists can you reproduce it without using a struct ?

Le 16/10/2020 à 14:15, Arvid Rosén a écrit :

Hi,

 

I already filed a report here:

 https://bugzilla.scilab.org/show_bug.cgi?id=16556

 

Do you want a more compact example than that?

 

Here is an even more slimmed version.


Cheers,

Arvid

 

----------

 

// Define variables

testArray = list(list([]));

testArray(1)(1).testMember = 1;

testArrayOrig = testArray;

 

// Define function

function outArray = testFunc(inArray)

    inArray(1)(1).testMember = 5

    outArray = inArray;

endfunction

 

// Send the variable as argument to the function

testArrayOut = testFunc(testArray);

 

if testArrayOut(1)(1).testMember == testArray(1)(1).testMember

    error("Error! inputArgument was changed by function");

end

 

 

-- 

 

From: Scilab Users List [hidden email] on behalf of Stéphane Mottelet [hidden email]
Reply to: Users mailing list for Scilab [hidden email]
Date: Friday, 16 October 2020 at 13:40
To: [hidden email] [hidden email]
Subject: Re: [Scilab-users] Scilab 6 - Problem with scope and nested lists

 

Hello,

I think that this is a sufficiently serious issue to diserve a report in bugzilla.scilab.org. But could you prepare a more compact example ?

S.

Le 16/10/2020 à 13:35, Arvid Rosén a écrit :

Hi!

 

We have found a tricky issue when moving over from Scilab 5 to Scilab 6 in my organization. We have a lot of code which works with nested lists, and functions modifying those lists. However, when a function is called with some nested lists as an input argument, the body of that function can change the value of the variable in the calling scope. This was not the case in Scilab 5, and the issue is super tricky to hunt down in our quite extensive code base. Below is a short example of the problem, and how to reproduce it.

 

I have also filed a bug report here: https://bugzilla.scilab.org/show_bug.cgi?id=16556

 

Is anyone else seeing this problem? And do you have any workarounds or other suggestions?

 

Cheers,

Arvid

 

------

 

// Define variables

testArray = list();

for i=1:1:10

    testArray($+1) = list();

    for j=1:1:10

        testArray(i)($+1) = [];

        testArray(i)(j).testMember = 1;

    end

end

testArrayOrig = testArray;

 

// Define functions

function outArray = testFunc(inArray)

    for i=1:1:10

        for j=1:1:10

            inArray(i)(j).testMember = 5

        end

    end

    outArray = inArray;

endfunction

 

// Send the variable as argument to the function

if %t

    testArrayOut = testFunc2(testArray);

 

    if testArrayOut(1)(1).testMember == testArray(1)(1).testMember

        error("Error! inputArgument was changed by function");

    end

end




_______________________________________________
users mailing list
[hidden email]
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

-->



_______________________________________________
users mailing list
[hidden email]
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

-->


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Re: Scilab 6 - Problem with scope and nested lists

OK. To me, this is a problem in the recursive insertion, which is built-in for most native types since Scilab 6.

S.

Le 16/10/2020 à 14:55, Arvid Rosén a écrit :

Hi,

 

The minimal case I posted mimics the situation where the problem was found. Removing the struct, and using just to levels of lists, does not trigger the same problem. I have played around with this a bit, and yet haven’t found a smaller case to trigger the issue.

 

Cheers,

Arvid

 

 

From: Scilab Users List [hidden email] on behalf of Stéphane Mottelet [hidden email]
Reply to: Users mailing list for Scilab [hidden email]
Date: Friday, 16 October 2020 at 14:20
To: [hidden email] [hidden email]
Subject: Re: [Scilab-users] Scilab 6 - Problem with scope and nested lists

 

Your test mix struct and lists can you reproduce it without using a struct ?

Le 16/10/2020 à 14:15, Arvid Rosén a écrit :

Hi,

 

I already filed a report here:

 https://bugzilla.scilab.org/show_bug.cgi?id=16556

 

Do you want a more compact example than that?

 

Here is an even more slimmed version.


Cheers,

Arvid

 

----------

 

// Define variables

testArray = list(list([]));

testArray(1)(1).testMember = 1;

testArrayOrig = testArray;

 

// Define function

function outArray = testFunc(inArray)

    inArray(1)(1).testMember = 5

    outArray = inArray;

endfunction

 

// Send the variable as argument to the function

testArrayOut = testFunc(testArray);

 

if testArrayOut(1)(1).testMember == testArray(1)(1).testMember

    error("Error! inputArgument was changed by function");

end

 

 

-- 

 

From: Scilab Users List [hidden email] on behalf of Stéphane Mottelet [hidden email]
Reply to: Users mailing list for Scilab [hidden email]
Date: Friday, 16 October 2020 at 13:40
To: [hidden email] [hidden email]
Subject: Re: [Scilab-users] Scilab 6 - Problem with scope and nested lists

 

Hello,

I think that this is a sufficiently serious issue to diserve a report in bugzilla.scilab.org. But could you prepare a more compact example ?

S.

Le 16/10/2020 à 13:35, Arvid Rosén a écrit :

Hi!

 

We have found a tricky issue when moving over from Scilab 5 to Scilab 6 in my organization. We have a lot of code which works with nested lists, and functions modifying those lists. However, when a function is called with some nested lists as an input argument, the body of that function can change the value of the variable in the calling scope. This was not the case in Scilab 5, and the issue is super tricky to hunt down in our quite extensive code base. Below is a short example of the problem, and how to reproduce it.

 

I have also filed a bug report here: https://bugzilla.scilab.org/show_bug.cgi?id=16556

 

Is anyone else seeing this problem? And do you have any workarounds or other suggestions?

 

Cheers,

Arvid

 

------

 

// Define variables

testArray = list();

for i=1:1:10

    testArray($+1) = list();

    for j=1:1:10

        testArray(i)($+1) = [];

        testArray(i)(j).testMember = 1;

    end

end

testArrayOrig = testArray;

 

// Define functions

function outArray = testFunc(inArray)

    for i=1:1:10

        for j=1:1:10

            inArray(i)(j).testMember = 5

        end

    end

    outArray = inArray;

endfunction

 

// Send the variable as argument to the function

if %t

    testArrayOut = testFunc2(testArray);

 

    if testArrayOut(1)(1).testMember == testArray(1)(1).testMember

        error("Error! inputArgument was changed by function");

    end

end




_______________________________________________
users mailing list
[hidden email]
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

-->



_______________________________________________
users mailing list
[hidden email]
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

-->


_______________________________________________
users mailing list
[hidden email]
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Arvid Rosén Arvid Rosén
Reply | Threaded
Open this post in threaded view
|

Re: Scilab 6 - Problem with scope and nested lists

Hi again,

 

I believe you are onto something. This actually works!

 

Cheers,

Arvid

 

---

// Define variables

testArray = list(list([]));

testArray(1)(1).testMember = 1;

testArrayOrig = testArray;

 

// Define function

function outArray = testFunc(inArray)

    X = inArray(1)(1);

    X.testMember = 5;

    inArray(1)(1) = X;

    outArray = inArray;

endfunction

 

// Send the variable as argument to the function

testArrayOut = testFunc(testArray);

 

if testArrayOut(1)(1).testMember == testArray(1)(1).testMember

    error("Error! inputArgument was changed by function");

end

 

 

 

From: Scilab Users List <[hidden email]> on behalf of Stéphane Mottelet <[hidden email]>
Reply to: Users mailing list for Scilab <[hidden email]>
Date: Friday, 16 October 2020 at 15:14
To: "[hidden email]" <[hidden email]>
Subject: Re: [Scilab-users] Scilab 6 - Problem with scope and nested lists

 

OK. To me, this is a problem in the recursive insertion, which is built-in for most native types since Scilab 6.

S.

Le 16/10/2020 à 14:55, Arvid Rosén a écrit :

Hi,

 

The minimal case I posted mimics the situation where the problem was found. Removing the struct, and using just to levels of lists, does not trigger the same problem. I have played around with this a bit, and yet haven’t found a smaller case to trigger the issue.

 

Cheers,

Arvid

 

 

From: Scilab Users List [hidden email] on behalf of Stéphane Mottelet [hidden email]
Reply to: Users mailing list for Scilab [hidden email]
Date: Friday, 16 October 2020 at 14:20
To: [hidden email] [hidden email]
Subject: Re: [Scilab-users] Scilab 6 - Problem with scope and nested lists

 

Your test mix struct and lists can you reproduce it without using a struct ?

Le 16/10/2020 à 14:15, Arvid Rosén a écrit :

Hi,

 

I already filed a report here:

 https://bugzilla.scilab.org/show_bug.cgi?id=16556

 

Do you want a more compact example than that?

 

Here is an even more slimmed version.



Cheers,

Arvid

 

----------

 

// Define variables

testArray = list(list([]));

testArray(1)(1).testMember = 1;

testArrayOrig = testArray;

 

// Define function

function outArray = testFunc(inArray)

    inArray(1)(1).testMember = 5

    outArray = inArray;

endfunction

 

// Send the variable as argument to the function

testArrayOut = testFunc(testArray);

 

if testArrayOut(1)(1).testMember == testArray(1)(1).testMember

    error("Error! inputArgument was changed by function");

end

 

 

-- 

 

From: Scilab Users List [hidden email] on behalf of Stéphane Mottelet [hidden email]
Reply to: Users mailing list for Scilab [hidden email]
Date: Friday, 16 October 2020 at 13:40
To: [hidden email] [hidden email]
Subject: Re: [Scilab-users] Scilab 6 - Problem with scope and nested lists

 

Hello,

I think that this is a sufficiently serious issue to diserve a report in bugzilla.scilab.org. But could you prepare a more compact example ?

S.

Le 16/10/2020 à 13:35, Arvid Rosén a écrit :

Hi!

 

We have found a tricky issue when moving over from Scilab 5 to Scilab 6 in my organization. We have a lot of code which works with nested lists, and functions modifying those lists. However, when a function is called with some nested lists as an input argument, the body of that function can change the value of the variable in the calling scope. This was not the case in Scilab 5, and the issue is super tricky to hunt down in our quite extensive code base. Below is a short example of the problem, and how to reproduce it.

 

I have also filed a bug report here: https://bugzilla.scilab.org/show_bug.cgi?id=16556

 

Is anyone else seeing this problem? And do you have any workarounds or other suggestions?

 

Cheers,

Arvid

 

------

 

// Define variables

testArray = list();

for i=1:1:10

    testArray($+1) = list();

    for j=1:1:10

        testArray(i)($+1) = [];

        testArray(i)(j).testMember = 1;

    end

end

testArrayOrig = testArray;

 

// Define functions

function outArray = testFunc(inArray)

    for i=1:1:10

        for j=1:1:10

            inArray(i)(j).testMember = 5

        end

    end

    outArray = inArray;

endfunction

 

// Send the variable as argument to the function

if %t

    testArrayOut = testFunc2(testArray);

 

    if testArrayOut(1)(1).testMember == testArray(1)(1).testMember

        error("Error! inputArgument was changed by function");

    end

end





_______________________________________________
users mailing list
[hidden email]
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

-->




_______________________________________________
users mailing list
[hidden email]
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

-->



_______________________________________________
users mailing list
[hidden email]
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

-->


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users