<?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: Defining Getters and Setters in NodeJS</title>
	<atom:link href="http://blog.james-carr.org/2010/07/19/defining-getters-and-setters-in-nodejs/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.james-carr.org/2010/07/19/defining-getters-and-setters-in-nodejs/</link>
	<description>Rants and Musings of an Agile Developer</description>
	<lastBuildDate>Thu, 26 Jan 2012 11:54:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
	<item>
		<title>By: Luke Smith</title>
		<link>http://blog.james-carr.org/2010/07/19/defining-getters-and-setters-in-nodejs/#comment-141166</link>
		<dc:creator>Luke Smith</dc:creator>
		<pubDate>Tue, 20 Jul 2010 05:01:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.james-carr.org/?p=882#comment-141166</guid>
		<description>Another syntax supported by ES5 and NodeJS is
&lt;code&gt;
var obj = {
    _foo: &quot;unset&quot;,

    get foo() {
        return this._foo;
    },

    set foo(val) {
        this._foo = &quot;Value of foo is now &quot; + val;
    }
};

sys.puts(obj.val); // &quot;unset&quot;
o.foo = &quot;a new value&quot;;
sys.puts(obj.val); // &quot;Value of foo is now a new value&quot;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Another syntax supported by ES5 and NodeJS is<br />
<code><br />
var obj = {<br />
    _foo: "unset",</p>
<p>    get foo() {<br />
        return this._foo;<br />
    },</p>
<p>    set foo(val) {<br />
        this._foo = "Value of foo is now " + val;<br />
    }<br />
};</p>
<p>sys.puts(obj.val); // "unset"<br />
o.foo = "a new value";<br />
sys.puts(obj.val); // "Value of foo is now a new value"</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>

