From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Why does everyone hate 'eval'?
Date: Thu, 11 Dec 2008 20:15:05 +0000 (UTC)
Organization: Xoran Technologies
Lines: 7
Message-ID: <ghrsc8$194$>
References: <ghrlim$oqo$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1229026505 1316 (11 Dec 2008 20:15:05 GMT)
NNTP-Posting-Date: Thu, 11 Dec 2008 20:15:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: comp.soft-sys.matlab:506418

The one time that I have found eval() indispensible is in creating overloaded subsref/subsasgn methods for classes.

Calling subsref()/subsasgn() by themselves is known to produce unpredictable behavior because of dispatching rules, but if you execute the equivalent expression using eval this tends not to happen.