Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Why does everyone hate 'eval'?
Date: Sun, 14 Dec 2008 08:00:07 +0000 (UTC)
Organization: NTNU
Lines: 22
Message-ID: <gi2ee7$3or$1@fred.mathworks.com>
References: <ghrlim$oqo$1@fred.mathworks.com> <ghv5ut$fj7$1@fred.mathworks.com> <9e91603f-17c3-4e81-ad47-33379c3e8b95@p2g2000prf.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1229241607 3867 172.30.248.37 (14 Dec 2008 08:00:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 14 Dec 2008 08:00:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 651407
Xref: news.mathworks.com comp.soft-sys.matlab:506829

Praetorian <ashish.sadanandan@gmail.com> wrote in message <9e91603f-17c3-4e81-ad47-33379c3e8b95@p2g2000prf.googlegroups.com>...
> > Is this an answer to my question? As you can see for yourself your approa=
> ch doesn't work, like I said.
> >
> > ?yvind
> 
> What do you mean it doesn't work? I retrieved the metaclass
> information for a class whose name was stored in a string variable
> without using EVAL. Isn't that what you wanted? Anyway, Doug has a
> solution that doesn't even require string concatenation.

No, you retrieved a metaclass object for the 'char' class. This is the expected behaviour when you input a string to metaclass(). Compare the output of 
>> metaclass('?memmapfile')
to 
>> ?memmapfile
'?memmapfile' is a char object, that's the point here.

Thanks, Doug! That's the solution. Support told me there was no way around using eval here.

Well, another use of eval knocked down.

?yvind