help-octave
[Top][All Lists]
Advanced

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

Re: Sourcing global variables in unit tests


From: Pavel Hofman
Subject: Re: Sourcing global variables in unit tests
Date: Fri, 19 Apr 2019 08:21:00 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

Hi Kai,

Dne 16. 04. 19 v 15:34 Kai Torben Ohlhus napsal(a):
On Tue, Apr 16, 2019 at 9:10 PM Pavel Hofman <address@hidden <mailto:address@hidden>> wrote:

Thank you for the example.  This makes your problem clearer to me.  You should avoid the syntax

    global A = 1;

This is a convenient Octave extension, that does not exist in Matlab. The problem is, that if a global variable A already exists, any consecutive initializations will be ignored (see [1]):

I see, thanks a lot for the info. It is a pitty such clumsy syntax is the correct one. Honestly, I hesitate whether easier testing is worth cluttering my code with the two-liners.

Best regards,

Pavel.



reply via email to

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