<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Release R2008a Available</title>
	<atom:link href="http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/</link>
	<description>Loren Shure works on design of the MATLAB language at MathWorks. She writes here about once a week on MATLAB programming and related topics.</description>
	<lastBuildDate>Thu, 09 Feb 2012 04:19:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Dave Foti</title>
		<link>http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/#comment-29534</link>
		<dc:creator>Dave Foti</dc:creator>
		<pubDate>Mon, 23 Jun 2008 17:25:03 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/#comment-29534</guid>
		<description>Constant properties may not be changed from the initial value specified in the property declaration.  There are a couple of reasons why MATLAB works the way it does.  First, MATLAB has longstanding rules that variables always take precedent over the names of functions and classes and that assignment statements introduce a variable if one doesn&#039;t already exist.  Thus, any expression of the form &quot;A.B = C&quot; will introduce a new variable A that is a struct array containing a field B whose value is C.  If &quot;A.B = C&quot; could refer to a static property of class A, then class A would take precedent over variable A and this would be a very significant incompatibility with prior releases of MATLAB.  It would mean that an m-file containing the assignment statement &quot;A.B = C&quot; could have its meaning changed by the introduction of a class named A somewhere on the MATLAB path.  MATLAB programmers have always been able to rely on assignment statements introducing variables that shadow any other use of the same name.

Second, we have observed that static data is rarely used in other classes except as private data within the class or as public constants.  For example, a survey of several Java class libraries found that all public static fields were also final.  In MATLAB, Constant properties can be used like &quot;public final static&quot; fields in Java.  For data internal to a class, MATLAB already has persistent variables that can be created inside of private or protected methods or local functions privately used by a class.  There are also good reasons to avoid static data in MATLAB where possible.  If a class has static data, it can be difficult to use the same class in multiple applications because the static data can be a source of conflicts among applications.  In some other languages, this is less of an issue because different applications are separately compiled into executables running in different processes with different copies of class static data.  In MATLAB, frequently many different applications may be running in the same process and environment with a single copy of each class.</description>
		<content:encoded><![CDATA[<p>Constant properties may not be changed from the initial value specified in the property declaration.  There are a couple of reasons why MATLAB works the way it does.  First, MATLAB has longstanding rules that variables always take precedent over the names of functions and classes and that assignment statements introduce a variable if one doesn&#8217;t already exist.  Thus, any expression of the form &#8220;A.B = C&#8221; will introduce a new variable A that is a struct array containing a field B whose value is C.  If &#8220;A.B = C&#8221; could refer to a static property of class A, then class A would take precedent over variable A and this would be a very significant incompatibility with prior releases of MATLAB.  It would mean that an m-file containing the assignment statement &#8220;A.B = C&#8221; could have its meaning changed by the introduction of a class named A somewhere on the MATLAB path.  MATLAB programmers have always been able to rely on assignment statements introducing variables that shadow any other use of the same name.</p>
<p>Second, we have observed that static data is rarely used in other classes except as private data within the class or as public constants.  For example, a survey of several Java class libraries found that all public static fields were also final.  In MATLAB, Constant properties can be used like &#8220;public final static&#8221; fields in Java.  For data internal to a class, MATLAB already has persistent variables that can be created inside of private or protected methods or local functions privately used by a class.  There are also good reasons to avoid static data in MATLAB where possible.  If a class has static data, it can be difficult to use the same class in multiple applications because the static data can be a source of conflicts among applications.  In some other languages, this is less of an issue because different applications are separately compiled into executables running in different processes with different copies of class static data.  In MATLAB, frequently many different applications may be running in the same process and environment with a single copy of each class.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lee</title>
		<link>http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/#comment-29533</link>
		<dc:creator>Lee</dc:creator>
		<pubDate>Mon, 23 Jun 2008 15:48:41 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/#comment-29533</guid>
		<description>Any progress on this question of static properties?  One can clearly define them, for example here is a classdef file:

---------------------------
classdef myClass
  properties (Static)
    x = 1 ;
  end
  methods (Static)
    function f(val)
      myClass.x = val ;
    end
  end
end
---------------------------

and the get method works:

---------------------------
&gt; myClass.x
ans = 1
---------------------------

but the set method does not work, either on the command-line or via a static method function!

Thanks,
Lee</description>
		<content:encoded><![CDATA[<p>Any progress on this question of static properties?  One can clearly define them, for example here is a classdef file:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
classdef myClass<br />
  properties (Static)<br />
    x = 1 ;<br />
  end<br />
  methods (Static)<br />
    function f(val)<br />
      myClass.x = val ;<br />
    end<br />
  end<br />
end<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>and the get method works:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&gt; myClass.x<br />
ans = 1<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>but the set method does not work, either on the command-line or via a static method function!</p>
<p>Thanks,<br />
Lee</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arthur</title>
		<link>http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/#comment-29333</link>
		<dc:creator>Arthur</dc:creator>
		<pubDate>Wed, 28 May 2008 21:52:41 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/#comment-29333</guid>
		<description>Many thanks for your responses, Nausheen.

I haven&#039;t figured out how to make a class property that can be modified/assigned. Using the &quot;Constant&quot; attribute on a property, like you mentioned, makes the value unchangeable. 

As an example:

classdef myclass
   properties (Constant, SetAccess=public)
       prop=1; % initial value
   end
   methods
       function set1(obj,val)
           obj.prop=val;
       end
   end
   methods (Static,Access=public)
       function set2(val)
           myclass.prop=val;
       end
   end
end 

... and then I try to use use the class to modify my property:

&gt;&gt; myclass
ans = 
myclass
properties:
    prop: 1
list of methods
&gt;&gt; myclass.set2(10)
&gt;&gt; myclass
ans = 
myclass
properties:
    prop: 1
list of methods
&gt;&gt; obj=myclass()
obj = 
myclass
properties:
    prop: 1
list of methods
&gt;&gt; obj.set1(10)
??? Setting the &#039;prop&#039; property of the &#039;myclass&#039; class is not allowed.

Error in ==&gt; myclass&gt;myclass.set1 at 7
           obj.prop=val;


None of my attempts have been successful. This behavior is consistent with my idea of a constant (never ever changing). Yet, in the documentation under the heading &quot;Defining Named Constants,&quot; it says, &quot;Note that setting the Constant attribute to true effectively sets the SetAccess to private, so that the values of the properties cannot be changed outside of the class.&quot; That implies that one should be able to change the value of a constant from within a class&#039;s method as I tried, and it also implies a conflict with my combination of &quot;Constant&quot; and &quot;SetAccess=public&quot; above. 

Is there a way to modify my example to implement a class property whose value is publicly changeable (i.e. myclass.prop=10), yet uniform across all instances of the class?</description>
		<content:encoded><![CDATA[<p>Many thanks for your responses, Nausheen.</p>
<p>I haven&#8217;t figured out how to make a class property that can be modified/assigned. Using the &#8220;Constant&#8221; attribute on a property, like you mentioned, makes the value unchangeable. </p>
<p>As an example:</p>
<p>classdef myclass<br />
   properties (Constant, SetAccess=public)<br />
       prop=1; % initial value<br />
   end<br />
   methods<br />
       function set1(obj,val)<br />
           obj.prop=val;<br />
       end<br />
   end<br />
   methods (Static,Access=public)<br />
       function set2(val)<br />
           myclass.prop=val;<br />
       end<br />
   end<br />
end </p>
<p>&#8230; and then I try to use use the class to modify my property:</p>
<p>&gt;&gt; myclass<br />
ans =<br />
myclass<br />
properties:<br />
    prop: 1<br />
list of methods<br />
&gt;&gt; myclass.set2(10)<br />
&gt;&gt; myclass<br />
ans =<br />
myclass<br />
properties:<br />
    prop: 1<br />
list of methods<br />
&gt;&gt; obj=myclass()<br />
obj =<br />
myclass<br />
properties:<br />
    prop: 1<br />
list of methods<br />
&gt;&gt; obj.set1(10)<br />
??? Setting the &#8216;prop&#8217; property of the &#8216;myclass&#8217; class is not allowed.</p>
<p>Error in ==&gt; myclass&gt;myclass.set1 at 7<br />
           obj.prop=val;</p>
<p>None of my attempts have been successful. This behavior is consistent with my idea of a constant (never ever changing). Yet, in the documentation under the heading &#8220;Defining Named Constants,&#8221; it says, &#8220;Note that setting the Constant attribute to true effectively sets the SetAccess to private, so that the values of the properties cannot be changed outside of the class.&#8221; That implies that one should be able to change the value of a constant from within a class&#8217;s method as I tried, and it also implies a conflict with my combination of &#8220;Constant&#8221; and &#8220;SetAccess=public&#8221; above. </p>
<p>Is there a way to modify my example to implement a class property whose value is publicly changeable (i.e. myclass.prop=10), yet uniform across all instances of the class?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nausheen Moulana</title>
		<link>http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/#comment-29329</link>
		<dc:creator>Nausheen Moulana</dc:creator>
		<pubDate>Wed, 28 May 2008 18:04:54 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/#comment-29329</guid>
		<description>Hi Arthur:

Both class and class instance(object) properties can be scoped by the public/protected/private qualifier.  Static properties are associated with a class and are declared public to access them outside the class.  So, I am not sure why you say that public/protected/private options are not implemented for class properties.  Could you clarify? 

The ambiguity in property names isn&#039;t unique to static properties.  Mistakes with typos could be avoided with the help of an affordance like tab-completion for properties which we are looking to provide in the future. 

OOP in MATLAB isn&#039;t modeled after any particular language but several languages including Java, C++, and C# have had an impact on its design.  We will continue to evolve our offering in this area.  

Nausheen</description>
		<content:encoded><![CDATA[<p>Hi Arthur:</p>
<p>Both class and class instance(object) properties can be scoped by the public/protected/private qualifier.  Static properties are associated with a class and are declared public to access them outside the class.  So, I am not sure why you say that public/protected/private options are not implemented for class properties.  Could you clarify? </p>
<p>The ambiguity in property names isn&#8217;t unique to static properties.  Mistakes with typos could be avoided with the help of an affordance like tab-completion for properties which we are looking to provide in the future. </p>
<p>OOP in MATLAB isn&#8217;t modeled after any particular language but several languages including Java, C++, and C# have had an impact on its design.  We will continue to evolve our offering in this area.  </p>
<p>Nausheen</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arthur</title>
		<link>http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/#comment-29315</link>
		<dc:creator>Arthur</dc:creator>
		<pubDate>Tue, 27 May 2008 21:09:54 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/#comment-29315</guid>
		<description>Hi Nausheen, 

Thanks for the correction. That helps! I must have attempted to modify my constant property with an object method when I tried. Is there a particular reason that public static variables are not allowed? Obviously they can be controlled from outside a class using static get and set methods, but it seems peculiar that public/private/protected options would be implemented for object properites and not class properties. In playing with 2008a, it does seem like there would be some tricky ambiguities or hard-to-find errors if a user could assign a public static class property (e.g. classname.propname=10;), and instead, due to a type-o (e.g. classnam.propname=10;), got a new struct in the workspace named &quot;classnam.&quot;

Is the direction of MATLAB&#039;s new OOP features modeled after any existing languages (e.g. Java, C#, Python)? Should users expect additions to the OOP feature set in future releases?</description>
		<content:encoded><![CDATA[<p>Hi Nausheen, </p>
<p>Thanks for the correction. That helps! I must have attempted to modify my constant property with an object method when I tried. Is there a particular reason that public static variables are not allowed? Obviously they can be controlled from outside a class using static get and set methods, but it seems peculiar that public/private/protected options would be implemented for object properites and not class properties. In playing with 2008a, it does seem like there would be some tricky ambiguities or hard-to-find errors if a user could assign a public static class property (e.g. classname.propname=10;), and instead, due to a type-o (e.g. classnam.propname=10;), got a new struct in the workspace named &#8220;classnam.&#8221;</p>
<p>Is the direction of MATLAB&#8217;s new OOP features modeled after any existing languages (e.g. Java, C#, Python)? Should users expect additions to the OOP feature set in future releases?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nausheen Moulana</title>
		<link>http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/#comment-29312</link>
		<dc:creator>Nausheen Moulana</dc:creator>
		<pubDate>Tue, 27 May 2008 14:13:54 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/#comment-29312</guid>
		<description>Hi Arthur:

You can define static properties by setting the Constant attribute for properties to true.  The values can only be changed by a static method of the class with static properties. 

Hope this helps.
Nausheen</description>
		<content:encoded><![CDATA[<p>Hi Arthur:</p>
<p>You can define static properties by setting the Constant attribute for properties to true.  The values can only be changed by a static method of the class with static properties. </p>
<p>Hope this helps.<br />
Nausheen</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arthur</title>
		<link>http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/#comment-29302</link>
		<dc:creator>Arthur</dc:creator>
		<pubDate>Mon, 26 May 2008 21:48:04 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/#comment-29302</guid>
		<description>I love the idea of the new OOP developments. It eliminates a lot of the code that I write over and over, like get- and set- methods. 

I just got a trial of 2008a, so I&#039;ve only gotten my feet wet. Meta-classes, abstract declarations, dynamic properties, and the dot-sytnax for calling methods (e.g. obj.method(var) instead of method(obj,var)) are all great features for making tools that are easy to use and maintain. The ability to declare static methods for a class is a godsend.

The first glaring omission I see is static properties. Why weren&#039;t they included with the new OOP? Am I missing something?

-Arthur</description>
		<content:encoded><![CDATA[<p>I love the idea of the new OOP developments. It eliminates a lot of the code that I write over and over, like get- and set- methods. </p>
<p>I just got a trial of 2008a, so I&#8217;ve only gotten my feet wet. Meta-classes, abstract declarations, dynamic properties, and the dot-sytnax for calling methods (e.g. obj.method(var) instead of method(obj,var)) are all great features for making tools that are easy to use and maintain. The ability to declare static methods for a class is a godsend.</p>
<p>The first glaring omission I see is static properties. Why weren&#8217;t they included with the new OOP? Am I missing something?</p>
<p>-Arthur</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/#comment-28534</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Sat, 26 Apr 2008 11:09:32 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/#comment-28534</guid>
		<description>Rod-

You can find out information about platform support &lt;a href=&quot;http://www.mathworks.com/support/sysreq/current_release/&quot; rel=&quot;nofollow&quot;&gt;here &lt;/a&gt;.

--Loren</description>
		<content:encoded><![CDATA[<p>Rod-</p>
<p>You can find out information about platform support <a href="http://www.mathworks.com/support/sysreq/current_release/" rel="nofollow">here </a>.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rod</title>
		<link>http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/#comment-28517</link>
		<dc:creator>Rod</dc:creator>
		<pubDate>Fri, 25 Apr 2008 16:58:20 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/#comment-28517</guid>
		<description>I am a long time Matlab user on FreeBSD OS, and for each new Matlab release I hope to see Matlab fully supported of FreeBSD.
Since Matlab6.5 I cannot get Matlab working on FreeBSD through the Linux emulation.</description>
		<content:encoded><![CDATA[<p>I am a long time Matlab user on FreeBSD OS, and for each new Matlab release I hope to see Matlab fully supported of FreeBSD.<br />
Since Matlab6.5 I cannot get Matlab working on FreeBSD through the Linux emulation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcel</title>
		<link>http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/#comment-28323</link>
		<dc:creator>Marcel</dc:creator>
		<pubDate>Wed, 16 Apr 2008 22:20:55 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/#comment-28323</guid>
		<description>Right, I pasted the class definition into the previous post but this doesn&#039;t seem to be supported. The point is; I just subclass from double, define a constructor with contents: obj = obj@double(g) and a function neighbours(obj,v) with contents ne = find(obj(v,:) &#124; obj(:,v)&#039;);

The above results are then obtained...</description>
		<content:encoded><![CDATA[<p>Right, I pasted the class definition into the previous post but this doesn&#8217;t seem to be supported. The point is; I just subclass from double, define a constructor with contents: obj = obj@double(g) and a function neighbours(obj,v) with contents ne = find(obj(v,:) | obj(:,v)&#8217;);</p>
<p>The above results are then obtained&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

