Path: news.mathworks.com!newsfeed-00.mathworks.com!kanaga.switch.ch!switch.ch!feeder.news-service.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!.POSTED!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Error in MIN and MAX
Date: Sun, 30 May 2010 21:16:36 -0500
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <htv6af$nmb$1@news.eternal-september.org>
References: <htrjji$34i$1@fred.mathworks.com> <hts20o$vt$1@fred.mathworks.com> <htt5bg$fli$1@fred.mathworks.com> <httm7f$14t$1@fred.mathworks.com> <httojr$f0t$1@news.eternal-september.org> <htu2ol$ank$1@fred.mathworks.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 31 May 2010 02:18:57 +0000 (UTC)
Injection-Info: mx01.eternal-september.org; posting-host="+o+6hChWtT2SwFkflj892w";
	logging-data="24267"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18QyXjqxPPzjw4O4tCWPvmA"
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
In-Reply-To: <HIDDEN>
Cancel-Lock: sha1:I9SHBBgIZHga4l3W/vYEEMMS6QI=
Xref: news.mathworks.com comp.soft-sys.matlab:640767

Matt J wrote:
> dpb <none@non.net> wrote in message 
> <httojr$f0t$1@news.eternal-september.org>...
> 
>> > I'm actually a bit dumbfounded by how often this occurs. If you're > 
>> trying to use the same name for two different things (function and > 
>> variable), I tend to think that you really don't know what's going on 
>> in > your code.
>>
>> OTOH, given the size of the ML namespace, in some ways my surprise is 
>> it doesn't happen even more often... :)
> 
> No, the save of the Matlab namespace is not relevant. It is perfectly 
> harmless to use i, j, min, max, etc... as variable names as long as you 
> don't then try to use them as functions later on in the same workspace.
> The problem only occurs when people deliberately try to use the same 
> name for 2 different things in the same mfile.

Well, I think the namespace size _does_ have quite a lot to do with it 
myself just from the likelihood standpoint of a name collision.

That aliasing is ok from Matlab syntax standpoint just makes the error 
more difficult to catch when it happens.

--