Path: news.mathworks.com!not-for-mail
From: "Yuri Geshelin" <geshelin@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: eval, feval, global
Date: Mon, 31 Mar 2008 14:21:01 +0000 (UTC)
Organization: Bedford Institute of Oceanography
Lines: 34
Message-ID: <fsqs0d$ljr$1@fred.mathworks.com>
References: <fsebf0$43u$1@fred.mathworks.com> <fsp7th$j9u$1@fred.mathworks.com> <fspak3$787$1@fred.mathworks.com>
Reply-To: "Yuri Geshelin" <geshelin@hotmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1206973261 22139 172.30.248.35 (31 Mar 2008 14:21:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 31 Mar 2008 14:21:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1149396
Xref: news.mathworks.com comp.soft-sys.matlab:460087



> In the example I posted above, if foobarfaz has to pass 
parameters as inputs 
> to foo and baz, then any changes to the parameters in foo 
won't affect baz 
> unless they are returned from foo and the modified 
parameters passed into 
> baz.
> 

Steve, do you suggest to use only input / output args as a 
way of communication between functions? This may present 
another problem, but first I want to make sure I don't 
misunderstand you.

In any case, if all we are talking about is the neat 
organization of such communication, then I don't see why I 
cannot still use globals in the following way:

global common_block_01 common_block_02 ...

where each of common_block_xx is a structure with many 
fields. This way, you focus on what you are doing. To make 
it yet more secure, I can name those variables 
my_project_common_block_01 my_project_common_block_02 ...

If someone decides to make use of my function, he / she 
will simply ignore these globals (or deliberately make use 
of them).

(I was raised on fortran :) )

Yuri