<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156291</link>
    <title>MATLAB Central Newsreader - ML Classes - What is the right way to construct classes?</title>
    <description>Feed for thread: ML Classes - What is the right way to construct classes?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 17 Sep 2007 15:47:54 -0400</pubDate>
      <title>ML Classes - What is the right way to construct classes?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156291#392702</link>
      <author> &quot;G.A.M.</author>
      <description>I wrote my first class in Matlab recently. My impression was that I&lt;br&gt;
had to write an awful lot of repetitive (boilerplate) code. I had a&lt;br&gt;
struct with over 15 fields. It was very tedious work to make what&lt;br&gt;
should have been a simple class. Is there a code generator available&lt;br&gt;
that will write all this code given the field definitions? If not, it&lt;br&gt;
seems like there should be.&lt;br&gt;
&lt;br&gt;
And what about maintaining the class code when I need to change&lt;br&gt;
existing fields? ... I don't like the idea of having to change code in&lt;br&gt;
many different places (because it is easy to miss one of those changes&lt;br&gt;
and end up with a bug).&lt;br&gt;
&lt;br&gt;
For example, if I need to change field name, I have to do it in about&lt;br&gt;
half a dozen places. There are at least two different index.types in&lt;br&gt;
each of subsref and subsasgn, plus the get and set methods and&lt;br&gt;
constructor. Plus there are the string names that usually have to&lt;br&gt;
match the field names (but sometimes differ in case) and that doubles&lt;br&gt;
the potential for maintenance errors to arise.&lt;br&gt;
&lt;br&gt;
After writing this one class, I became concerned that this approach&lt;br&gt;
introduces tremendous code maintenance challenges. What am I&lt;br&gt;
misunderstanding? Is there a way to us OO concepts in ML without such&lt;br&gt;
tedious and error-prone code? Or is it better to just not take the OO&lt;br&gt;
approach?&lt;br&gt;
&lt;br&gt;
I volunteered to help a friend fix up some old ML code that has global&lt;br&gt;
variables everywhere and lots of duplicate code. Sometimes what should&lt;br&gt;
be the same global variable is actually two or more different vars&lt;br&gt;
with different names! And instead of creating functions, the program&lt;br&gt;
was built by copy/pasting code from one file to another, often with&lt;br&gt;
subtle changes. But the program works correctly and I don't want to&lt;br&gt;
break it as we refactor it. I'm actually enjoying working on the code,&lt;br&gt;
but I just need some advice on apply OO concepts in ML. For example,&lt;br&gt;
I'm getting rid of all the duplicate code by creating functions with&lt;br&gt;
parameters; but without applying OO concepts (such as encapsulation) I&lt;br&gt;
don't know of a good way to ensure that this refactoring doesn't&lt;br&gt;
introduce new bugs.&lt;br&gt;
&lt;br&gt;
Thanks</description>
    </item>
    <item>
      <pubDate>Mon, 17 Sep 2007 16:22:20 -0400</pubDate>
      <title>Re: ML Classes - What is the right way to construct classes?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156291#392711</link>
      <author>Peter Boettcher</author>
      <description>&quot;G.A.M.&quot; &amp;lt;x0Zero@gmail.com&amp;gt; writes:&lt;br&gt;
&lt;br&gt;
&amp;gt; I wrote my first class in Matlab recently. My impression was that I&lt;br&gt;
&amp;gt; had to write an awful lot of repetitive (boilerplate) code. I had a&lt;br&gt;
&amp;gt; struct with over 15 fields. It was very tedious work to make what&lt;br&gt;
&amp;gt; should have been a simple class. Is there a code generator available&lt;br&gt;
&amp;gt; that will write all this code given the field definitions? If not, it&lt;br&gt;
&amp;gt; seems like there should be.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; And what about maintaining the class code when I need to change&lt;br&gt;
&amp;gt; existing fields? ... I don't like the idea of having to change code in&lt;br&gt;
&amp;gt; many different places (because it is easy to miss one of those changes&lt;br&gt;
&amp;gt; and end up with a bug).&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; For example, if I need to change field name, I have to do it in about&lt;br&gt;
&amp;gt; half a dozen places. There are at least two different index.types in&lt;br&gt;
&amp;gt; each of subsref and subsasgn, plus the get and set methods and&lt;br&gt;
&amp;gt; constructor. Plus there are the string names that usually have to&lt;br&gt;
&amp;gt; match the field names (but sometimes differ in case) and that doubles&lt;br&gt;
&amp;gt; the potential for maintenance errors to arise.&lt;br&gt;
&lt;br&gt;
I don't think this is unique to MATLAB.  Even if the implementation is&lt;br&gt;
hidden from the interface, changing the implementation requires many&lt;br&gt;
changes.  Think about C++.  If you actually do all the&lt;br&gt;
implementation-hiding, then you have a member myData.  Then you have&lt;br&gt;
getMyData() and const getMyData and setMyData and clearMyData etc,&lt;br&gt;
etc, etc.  To change the name, you now have to change the name&lt;br&gt;
everywhere.&lt;br&gt;
&lt;br&gt;
Going to a full-blown class is probably only called for a very few&lt;br&gt;
sorts of objects.  Things that need constructors / destructors.&lt;br&gt;
Things that would benefit operator overloading.  Things that actually&lt;br&gt;
benefit from subclassing and inheritance.&lt;br&gt;
&lt;br&gt;
[snip]&lt;br&gt;
&lt;br&gt;
&amp;gt; I volunteered to help a friend fix up some old ML code that has global&lt;br&gt;
&amp;gt; variables everywhere and lots of duplicate code. Sometimes what should&lt;br&gt;
&amp;gt; be the same global variable is actually two or more different vars&lt;br&gt;
&amp;gt; with different names! And instead of creating functions, the program&lt;br&gt;
&amp;gt; was built by copy/pasting code from one file to another, often with&lt;br&gt;
&amp;gt; subtle changes. But the program works correctly and I don't want to&lt;br&gt;
&amp;gt; break it as we refactor it. I'm actually enjoying working on the code,&lt;br&gt;
&amp;gt; but I just need some advice on apply OO concepts in ML. For example,&lt;br&gt;
&amp;gt; I'm getting rid of all the duplicate code by creating functions with&lt;br&gt;
&amp;gt; parameters; but without applying OO concepts (such as encapsulation) I&lt;br&gt;
&amp;gt; don't know of a good way to ensure that this refactoring doesn't&lt;br&gt;
&amp;gt; introduce new bugs.&lt;br&gt;
&lt;br&gt;
In the same way that it's possible to write OO C code, you can do the&lt;br&gt;
same in MATLAB.  That's what I would suggest.&lt;br&gt;
&lt;br&gt;
Use structs to wrap data that refers to the same object.  Refactor&lt;br&gt;
into functions like you're talking about.  If any given function&lt;br&gt;
modifies an object, pass the struct back out again.  This gives you&lt;br&gt;
most the benefits you're looking for, without getting too verbose.&lt;br&gt;
&lt;br&gt;
Are you REALLY going to come back to this code later, and decide to&lt;br&gt;
change the underlying data structure?  AND need to do so without&lt;br&gt;
touching the higher-level code?  If not, then you don't need private&lt;br&gt;
data and accessors.  One less thing to break...&lt;br&gt;
&lt;br&gt;
Not breaking the code during refactoring is a different problem.  I&lt;br&gt;
don't think MATLAB classes can help you there...&lt;br&gt;
&lt;br&gt;
Just my not-so-humble opinion... &lt;br&gt;
&lt;br&gt;
-Peter</description>
    </item>
    <item>
      <pubDate>Mon, 17 Sep 2007 16:35:00 -0400</pubDate>
      <title>Re: ML Classes - What is the right way to construct classes?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156291#392713</link>
      <author> &quot;G.A.M.</author>
      <description>On Sep 17, 12:22 pm, Peter Boettcher &amp;lt;boettc...@ll.mit.edu&amp;gt; wrote:&lt;br&gt;
&amp;gt; &quot;G.A.M.&quot; &amp;lt;x0Z...@gmail.com&amp;gt; writes:&lt;br&gt;
&amp;gt; &amp;gt; I wrote my first class in Matlab recently. My impression was that I&lt;br&gt;
&amp;gt; &amp;gt; had to write an awful lot of repetitive (boilerplate) code. I had a&lt;br&gt;
&amp;gt; &amp;gt; struct with over 15 fields. It was very tedious work to make what&lt;br&gt;
&amp;gt; &amp;gt; should have been a simple class. Is there a code generator available&lt;br&gt;
&amp;gt; &amp;gt; that will write all this code given the field definitions? If not, it&lt;br&gt;
&amp;gt; &amp;gt; seems like there should be.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; And what about maintaining the class code when I need to change&lt;br&gt;
&amp;gt; &amp;gt; existing fields? ... I don't like the idea of having to change code in&lt;br&gt;
&amp;gt; &amp;gt; many different places (because it is easy to miss one of those changes&lt;br&gt;
&amp;gt; &amp;gt; and end up with a bug).&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; For example, if I need to change field name, I have to do it in about&lt;br&gt;
&amp;gt; &amp;gt; half a dozen places. There are at least two different index.types in&lt;br&gt;
&amp;gt; &amp;gt; each of subsref and subsasgn, plus the get and set methods and&lt;br&gt;
&amp;gt; &amp;gt; constructor. Plus there are the string names that usually have to&lt;br&gt;
&amp;gt; &amp;gt; match the field names (but sometimes differ in case) and that doubles&lt;br&gt;
&amp;gt; &amp;gt; the potential for maintenance errors to arise.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I don't think this is unique to MATLAB.  Even if the implementation is&lt;br&gt;
&amp;gt; hidden from the interface, changing the implementation requires many&lt;br&gt;
&amp;gt; changes.  Think about C++.  If you actually do all the&lt;br&gt;
&amp;gt; implementation-hiding, then you have a member myData.  Then you have&lt;br&gt;
&amp;gt; getMyData() and const getMyData and setMyData and clearMyData etc,&lt;br&gt;
&amp;gt; etc, etc.  To change the name, you now have to change the name&lt;br&gt;
&amp;gt; everywhere.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Going to a full-blown class is probably only called for a very few&lt;br&gt;
&amp;gt; sorts of objects.  Things that need constructors / destructors.&lt;br&gt;
&amp;gt; Things that would benefit operator overloading.  Things that actually&lt;br&gt;
&amp;gt; benefit from subclassing and inheritance.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; [snip]&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I volunteered to help a friend fix up some old ML code that has global&lt;br&gt;
&amp;gt; &amp;gt; variables everywhere and lots of duplicate code. Sometimes what should&lt;br&gt;
&amp;gt; &amp;gt; be the same global variable is actually two or more different vars&lt;br&gt;
&amp;gt; &amp;gt; with different names! And instead of creating functions, the program&lt;br&gt;
&amp;gt; &amp;gt; was built by copy/pasting code from one file to another, often with&lt;br&gt;
&amp;gt; &amp;gt; subtle changes. But the program works correctly and I don't want to&lt;br&gt;
&amp;gt; &amp;gt; break it as we refactor it. I'm actually enjoying working on the code,&lt;br&gt;
&amp;gt; &amp;gt; but I just need some advice on apply OO concepts in ML. For example,&lt;br&gt;
&amp;gt; &amp;gt; I'm getting rid of all the duplicate code by creating functions with&lt;br&gt;
&amp;gt; &amp;gt; parameters; but without applying OO concepts (such as encapsulation) I&lt;br&gt;
&amp;gt; &amp;gt; don't know of a good way to ensure that this refactoring doesn't&lt;br&gt;
&amp;gt; &amp;gt; introduce new bugs.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; In the same way that it's possible to write OO C code, you can do the&lt;br&gt;
&amp;gt; same in MATLAB.  That's what I would suggest.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Use structs to wrap data that refers to the same object.  Refactor&lt;br&gt;
&amp;gt; into functions like you're talking about.  If any given function&lt;br&gt;
&amp;gt; modifies an object, pass the struct back out again.  This gives you&lt;br&gt;
&amp;gt; most the benefits you're looking for, without getting too verbose.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Are you REALLY going to come back to this code later, and decide to&lt;br&gt;
&amp;gt; change the underlying data structure?  AND need to do so without&lt;br&gt;
&amp;gt; touching the higher-level code?  If not, then you don't need private&lt;br&gt;
&amp;gt; data and accessors.  One less thing to break...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Not breaking the code during refactoring is a different problem.  I&lt;br&gt;
&amp;gt; don't think MATLAB classes can help you there...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Just my not-so-humble opinion...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; -Peter&lt;br&gt;
&lt;br&gt;
Peter - those are good tips I can start applying right away. But one&lt;br&gt;
thing puzzles me. In the OO languages I know, I can easily separate&lt;br&gt;
the private field name from the name of the accessor property, so the&lt;br&gt;
situation you cited in your C++ example isn't something that really&lt;br&gt;
occurs. But it does occur in ML. Furthermore, in strongly typed&lt;br&gt;
languages it is easier to tell if the identifier name refers to the&lt;br&gt;
thing you are renaming - hence automated refactoring tools are&lt;br&gt;
possible (and very helpful). When field names are specified as strings&lt;br&gt;
and indentifiers, as in ML, it becomes very tricky to update the code.&lt;br&gt;
&lt;br&gt;
I wrote a project for one of my school projects using the OO approach&lt;br&gt;
in C. After that project I had a new appreciation for the features of C&lt;br&gt;
++ and I haven't gone back to C. I'm getting the impression that ML is&lt;br&gt;
more like C where using a true OO approach is pretty painful. I've&lt;br&gt;
learned how to write code in OO languages that is pretty robust and&lt;br&gt;
I'd like to learn how to do the same in ML. But it doesn't seem like&lt;br&gt;
using ML classes is going to be the way to do that.</description>
    </item>
    <item>
      <pubDate>Mon, 17 Sep 2007 17:45:16 -0400</pubDate>
      <title>Re: ML Classes - What is the right way to construct classes?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156291#392727</link>
      <author>Peter Boettcher</author>
      <description>&quot;G.A.M.&quot; &amp;lt;x0Zero@gmail.com&amp;gt; writes:&lt;br&gt;
&lt;br&gt;
&amp;gt; Peter - those are good tips I can start applying right away. But one&lt;br&gt;
&amp;gt; thing puzzles me. In the OO languages I know, I can easily separate&lt;br&gt;
&amp;gt; the private field name from the name of the accessor property, so the&lt;br&gt;
&amp;gt; situation you cited in your C++ example isn't something that really&lt;br&gt;
&amp;gt; occurs.&lt;br&gt;
&lt;br&gt;
You'll have to give me an example of this.  I don't understand what&lt;br&gt;
you mean.&lt;br&gt;
&lt;br&gt;
&amp;gt; But it does occur in ML. Furthermore, in strongly typed&lt;br&gt;
&amp;gt; languages it is easier to tell if the identifier name refers to the&lt;br&gt;
&amp;gt; thing you are renaming - hence automated refactoring tools are&lt;br&gt;
&amp;gt; possible (and very helpful). When field names are specified as strings&lt;br&gt;
&amp;gt; and indentifiers, as in ML, it becomes very tricky to update the code.&lt;br&gt;
&lt;br&gt;
Again, I'm not sure what you mean.&lt;br&gt;
&lt;br&gt;
You don't HAVE to use the get/set paradigm if you don't want.  You can&lt;br&gt;
write separate getMyData() functions if you really want to.  Is that&lt;br&gt;
what you mean?  get('mydata') inputs the requested *public* attribute&lt;br&gt;
as a string.  How is that different from encoding the public attribute&lt;br&gt;
in the name of the function itself?  Neither one needs to relate to&lt;br&gt;
the actual storage field.&lt;br&gt;
&lt;br&gt;
&amp;gt; I wrote a project for one of my school projects using the OO approach&lt;br&gt;
&amp;gt; in C. After that project I had a new appreciation for the features of C&lt;br&gt;
&amp;gt; ++ and I haven't gone back to C. I'm getting the impression that ML is&lt;br&gt;
&amp;gt; more like C where using a true OO approach is pretty painful. I've&lt;br&gt;
&amp;gt; learned how to write code in OO languages that is pretty robust and&lt;br&gt;
&amp;gt; I'd like to learn how to do the same in ML. But it doesn't seem like&lt;br&gt;
&amp;gt; using ML classes is going to be the way to do that.&lt;br&gt;
&lt;br&gt;
Again, I'll just suggest that you separate the word &quot;OO&quot; into the&lt;br&gt;
component parts.  Putting an object into a struct, and grouping it&lt;br&gt;
together with the function that operate on the struct, is OO.  Your&lt;br&gt;
code becomes &quot;oriented&quot; on the &quot;objects&quot; in the struct.  It sounds&lt;br&gt;
like you are also after other features, like interface control,&lt;br&gt;
inheritance, operator overloading, etc.  Just like in C++, doing those&lt;br&gt;
things correctly takes a pile more code, compared to a bare-bones&lt;br&gt;
class with a few public member variables.  The latter is quite&lt;br&gt;
appropriate for many applications.&lt;br&gt;
&lt;br&gt;
I'm not going to argue that the MATLAB class setup isn't clunky.  It&lt;br&gt;
is.  That's why I'm recommending that you don't even go there unless&lt;br&gt;
you need complete features for your application.&lt;br&gt;
&lt;br&gt;
-Peter</description>
    </item>
    <item>
      <pubDate>Mon, 17 Sep 2007 18:17:08 -0400</pubDate>
      <title>Re: ML Classes - What is the right way to construct classes?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156291#392733</link>
      <author>per isakson</author>
      <description>&amp;nbsp;&quot;G.A.M.&quot; &amp;lt;x0Zero@gmail.com&amp;gt; wrote in message &lt;br&gt;
&lt;br&gt;
&amp;gt; I wrote my first class in Matlab recently. &lt;br&gt;
&lt;br&gt;
Have you thought of using &quot;closures&quot; (nested functions &lt;br&gt;
together with function handles) instead? Assignments with &lt;br&gt;
Matlab objects are &quot;by value&quot;. &lt;br&gt;
&amp;lt;snip&amp;gt;&lt;br&gt;
&lt;br&gt;
&amp;gt; But the program works correctly and I don't want to&lt;br&gt;
&amp;gt; break it as we refactor it.&lt;br&gt;
&amp;nbsp;&lt;br&gt;
MUNIT (free download) at &lt;a href=&quot;http://xtargets.com&quot;&gt;http://xtargets.com&lt;/a&gt; is the best I &lt;br&gt;
have found.&lt;br&gt;
&amp;lt;snip&amp;gt;&lt;br&gt;
&lt;br&gt;
/ per</description>
    </item>
    <item>
      <pubDate>Tue, 18 Sep 2007 16:41:23 -0400</pubDate>
      <title>Re: ML Classes - What is the right way to construct classes?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156291#392929</link>
      <author> &quot;G.A.M.</author>
      <description>On Sep 17, 2:17 pm, &quot;per isakson&quot; &amp;lt;poi.nos...@bimDOTkthDOT.se&amp;gt; wrote:&lt;br&gt;
&amp;gt;  &quot;G.A.M.&quot; &amp;lt;x0Z...@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;gt; I wrote my first class in Matlab recently.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Have you thought of using &quot;closures&quot; (nested functions&lt;br&gt;
&amp;gt; together with function handles) instead? Assignments with&lt;br&gt;
&amp;gt; Matlab objects are &quot;by value&quot;.&lt;br&gt;
&amp;gt; &amp;lt;snip&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; But the program works correctly and I don't want to&lt;br&gt;
&amp;gt; &amp;gt; break it as we refactor it.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; MUNIT (free download) at&lt;a href=&quot;http://xtargets.comis&quot;&gt;http://xtargets.comis&lt;/a&gt; the best I&lt;br&gt;
&amp;gt; have found.&lt;br&gt;
&amp;gt; &amp;lt;snip&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; / per&lt;br&gt;
&lt;br&gt;
per- thanks for the link. This looks like one of the most interesting&lt;br&gt;
sites I have seen in my short time using ML. I am particularly&lt;br&gt;
intrigued by this statement:&lt;br&gt;
&lt;br&gt;
&quot;Fairly soon after I discovered nested functions I realized the dual&lt;br&gt;
between objects and NF's. An object is really just a set of nested&lt;br&gt;
functions over a common scope.&quot;&lt;br&gt;
&lt;br&gt;
I'm hoping that this statement holds the key to my original question.&lt;br&gt;
I can see a lot of possibilities in this idea.&lt;br&gt;
&lt;br&gt;
I'll take your advice and check out MUNIT. I also believe MTemplates&lt;br&gt;
may be very useful in my quest to write robust ML code.&lt;br&gt;
&lt;br&gt;
Furthermore, the site has a tutorial on &quot;Advanced Layout Management&lt;br&gt;
With Handle Graphics&quot; which answers my other question about docking my&lt;br&gt;
own windows.&lt;br&gt;
&lt;br&gt;
This is a pretty interesting post too: &lt;a href=&quot;http://xtargets.com/snippets/posts/show/71&quot;&gt;http://xtargets.com/snippets/posts/show/71&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Tue, 18 Sep 2007 19:33:20 -0400</pubDate>
      <title>Re: ML Classes - What is the right way to construct classes?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156291#392957</link>
      <author>per isakson</author>
      <description>&amp;gt; &amp;gt; &amp;lt;snip&amp;gt;&lt;br&gt;
&amp;gt; per- thanks for the link. This looks like one of the most&lt;br&gt;
&amp;gt; interesting sites I have seen in my short time using ML.&lt;br&gt;
&lt;br&gt;
ML is **not** Matlab. See&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/Metalanguage&quot;&gt;http://en.wikipedia.org/wiki/Metalanguage&lt;/a&gt; and&lt;br&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/ML_%28programming_language%29&quot;&gt;http://en.wikipedia.org/wiki/ML_%28programming_language%29&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&amp;gt;I am particularly intrigued by this statement:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Fairly soon after I discovered nested functions I &lt;br&gt;
&amp;gt; realized the dual between objects and NF's. An object is&lt;br&gt;
&amp;gt; really just a set of nested functions over a common &lt;br&gt;
&amp;gt; scope.&quot;&lt;br&gt;
&lt;br&gt;
I use this approach extensively and I recommend you to give &lt;br&gt;
it a try. In a post a couple of weeks ago I gave another &lt;br&gt;
couple of references:&lt;br&gt;
&lt;br&gt;
Subject: Re: What am I doing wrong here&lt;br&gt;
From: Per Isakson&lt;br&gt;
Date: 02 Sep, 2007 14:33:00&lt;br&gt;
&lt;br&gt;
/ per</description>
    </item>
    <item>
      <pubDate>Sat, 06 Oct 2007 02:13:17 -0400</pubDate>
      <title>Re: ML Classes - What is the right way to construct classes?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156291#395355</link>
      <author> &quot;G.A.M.</author>
      <description>On Sep 18, 3:33 pm, &quot;per isakson&quot; &amp;lt;poi.nos...@bimDOTkthDOT.se&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;lt;snip&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; per- thanks for the link. This looks like one of the most&lt;br&gt;
&amp;gt; &amp;gt; interesting sites I have seen in my short time using ML.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; ML is **not** Matlab. See&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Metalanguageandhttp://en.wikipedia.org/wiki/ML_%28programming_language%29&quot;&gt;http://en.wikipedia.org/wiki/Metalanguageandhttp://en.wikipedia.org/wiki/ML_%28programming_language%29&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;I am particularly intrigued by this statement:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &quot;Fairly soon after I discovered nested functions I&lt;br&gt;
&amp;gt; &amp;gt; realized the dual between objects and NF's. An object is&lt;br&gt;
&amp;gt; &amp;gt; really just a set of nested functions over a common&lt;br&gt;
&amp;gt; &amp;gt; scope.&quot;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I use this approach extensively and I recommend you to give&lt;br&gt;
&amp;gt; it a try. In a post a couple of weeks ago I gave another&lt;br&gt;
&amp;gt; couple of references:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Subject: Re: What am I doing wrong here&lt;br&gt;
&amp;gt; From: Per Isakson&lt;br&gt;
&amp;gt; Date: 02 Sep, 2007 14:33:00&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; / per&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Closure (computer science): &lt;a href=&quot;http://en.wikipedia.org/wiki/Closure_%28computer_science%29,&quot;&gt;http://en.wikipedia.org/wiki/Closure_%28computer_science%29,&lt;/a&gt;&lt;br&gt;
2007-09-01&lt;br&gt;
A Way to Create Reusable Tools: &lt;a href=&quot;http://blogs.mathworks.com/loren/2007/08/09/a-way-to-create-reusable-tools/&quot;&gt;http://blogs.mathworks.com/loren/2007/08/09/a-way-to-create-reusable-tools/&lt;/a&gt;&lt;br&gt;
Michael Corvin replied: &lt;a href=&quot;http://blogs.mathworks.com/loren/2007/08/09/a-way-to-create-reusable-tools/#comment-16367&quot;&gt;http://blogs.mathworks.com/loren/2007/08/09/a-way-to-create-reusable-tools/#comment-16367&lt;/a&gt;&lt;br&gt;
What am I doing wrong here (OO in Matlab):&lt;br&gt;
&lt;a href=&quot;http://groups.google.com/group/comp.soft-sys.matlab/browse_thread/thread/a849d5ad999c8394/962b1cb5b7d99220&quot;&gt;http://groups.google.com/group/comp.soft-sys.matlab/browse_thread/thread/a849d5ad999c8394/962b1cb5b7d99220&lt;/a&gt;&lt;br&gt;
THIS (or SELF) object in matlab:&lt;br&gt;
&lt;a href=&quot;http://groups.google.com/group/comp.soft-sys.matlab/browse_thread/thread/29e1ccf18a00eea8/1b8583675b327e7e&quot;&gt;http://groups.google.com/group/comp.soft-sys.matlab/browse_thread/thread/29e1ccf18a00eea8/1b8583675b327e7e&lt;/a&gt;&lt;br&gt;
Objects and Nested Functions in Matlab:&lt;br&gt;
&lt;a href=&quot;http://xtargets.com/cms/Tutorials/Matlab-Programming/Objects-Nested-Functions.html&quot;&gt;http://xtargets.com/cms/Tutorials/Matlab-Programming/Objects-Nested-Functions.html&lt;/a&gt;&lt;br&gt;
NumPy etc: &lt;a href=&quot;http://www.mathworks.cn/matlabcentral/newsreader/view_thread/134693#345566&quot;&gt;http://www.mathworks.cn/matlabcentral/newsreader/view_thread/134693#345566&lt;/a&gt;</description>
    </item>
  </channel>
</rss>

