<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="Tiki CMS/Groupware via FeedCreator 1.7.2" -->
<?xml-stylesheet href="http://projectnibble.org/tikiwiki/lib/rss/rss-style.css" type="text/css"?>
<rss version="0.91">
    <channel>
        <title>Tiki RSS feed for blog: Project Nibble</title>
        <description></description>
        <link>http://projectnibble.org/tikiwiki/tiki-blog_rss.php?blogId=1</link>
        <lastBuildDate>Sat, 25 May 2013 03:29:50 +0100</lastBuildDate>
        <generator>Tiki CMS/Groupware via FeedCreator 1.7.2</generator>
        <image>
            <url>http://projectnibble.org/tikiwiki/img/tiki.jpg</url>
            <title>tikiwiki logo</title>
            <link>http://projectnibble.org/tikiwiki/tiki-index.php</link>
            <description><![CDATA[Feed provided by http://projectnibble.org/tikiwiki/tiki-index.php. Click to visit.]]></description>
        </image>
        <language>en-us</language>
        <item>
            <title>Nibble v0.9.8 released: Class support!</title>
            <link>http://projectnibble.org/tikiwiki/tiki-view_blog_post.php?blogId=1&amp;postId=27</link>
            <description><![CDATA[<a class="wiki"  href="http://sourceforge.net/project/showfiles.php?group_id=176945&package_id=203634&release_id=512609">download Nibble</a><br />
<hr />
<br />
Finally, Nibble is ready to support native classes. So far, the scripting engine only supported (un)compiled Java classes, and class behavior through prototyping.<br />
<br />
The new class system is a Java like but simpler class, that utilizes prototyping behind the scene. It provides some benefits over mere prototyping though that come natural to the classic class entity:<br />
<ul><li> regular class notation, including the keywords <code>class</code> and <code>extends</code>
</li><li> private and public methods or constructors
</li><li> private and public and/or final properties
</li><li> static or instance methods/properties
</li><li> inheriting mechanism and polymorphism
</li><li> strong typing
</li></ul>
<br />
<div style='margin-bottom:-5em;margin-top:-1.5em;'><table width="100%"><tr><td><div class='cbox' style=' background:#f0f0f0;'><div class='cbox-title'>native class example</div><div class='cbox-data' style=" background:#f0f0f0;"><pre class="javascript"><span style="color: #003366; font-weight: bold;">class</span> Greeting <span style="color: #66cc66;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">private</span> final greet;
&nbsp;
	<span style="color: #003366; font-weight: bold;">public</span> Greeting<span style="color: #66cc66;">&#40;</span>final String greet<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">greet</span> = greet;
	<span style="color: #66cc66;">&#125;</span>;
&nbsp;
	<span style="color: #003366; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> greet<span style="color: #66cc66;">&#40;</span>Object who<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		trace<span style="color: #66cc66;">&#40;</span>greet + who<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>;
<span style="color: #66cc66;">&#125;</span>;</pre></div></div></td></tr></table><br /><br />
</div><br />
<br />
<b>Read more</b><br />
<ul><ul><li> <a title="Classes in NibbleScript" href='tiki-index.php?page=Classes+in+NibbleScript#class' class='wiki'>Prototype based class</a>
</li></ul></ul>
<br />
<hr />
<br />
Shadowed by the fresh support for native classes is a new keyword... <code>require</code>. The require directive indicates that the scriptfile with the require statement needs another file; with require you can indicate dependencies not unlike the import statement. For example, if you defined a class somewhere in nibblescript, but use it in other files, you want to make sure the class declaration is parsed before the scripts that use it (or you might get a data type unknown exception).<br />
<br />
<b>Read more</b><br />
<ul><ul><li> <a title="Keywords" href='tiki-index.php?page=Keywords#require' class='wiki'>keyword require</a>
</li></ul></ul>
]]></description>
            <author>Benny Bottema &lt;b(DOT)bottema(AT)projectnibble(DOT)org&gt;</author>
            <pubDate>Thu, 31 May 2007 21:08:21 +0100</pubDate>
        </item>
        <item>
            <title>Nibble v0.9.7 released: Getting Robust</title>
            <link>http://projectnibble.org/tikiwiki/tiki-view_blog_post.php?blogId=1&amp;postId=15</link>
            <description><![CDATA[A lot has happened since the last release... Well, the last release was some time ago, true, but it was worthwile in my opinion. Nibble has been enhanced so much that you can copy 'n paste almost any ECMAScript code (ie. Javascript or Actionscript) and run the same code in Nibblescript with some small changes (mostly variable declarations, since Nibble does this Java style).<br />
<br />
Since this is one of the larger releases so far, I'll go into some detail regarding the new features.<br />
<hr />
<br />
<a name='New_for_loop_constructions'></a><h4>New for-loop constructions</h4>
To begin with, Nibble has gotten a couple of new loop constructions: <a class="wiki"  href="http://projectnibble.org/tikiwiki/tiki-index.php?page=Looping#foreach">for..each</a>, and <a class="wiki"  href="http://projectnibble.org/tikiwiki/tiki-index.php?page=Looping#forin">for..in</a>. With for..each you can conveniently iterate over an array or collection<br />
<br />
<div style='margin-bottom:-5em;margin-top:-1.5em;'><table width="100%"><tr><td><div class='cbox' style=' background:#f0f0f0;'><div class='cbox-title'>for..each example</div><div class='cbox-data' style=" background:#f0f0f0;"><pre class="javascript">List records = <span style="color: #66cc66;">&#91;</span><span style="color: #3366CC;">&quot;one&quot;</span>, <span style="color: #3366CC;">&quot;two&quot;</span>, <span style="color: #3366CC;">&quot;three&quot;</span><span style="color: #66cc66;">&#93;</span>;
&nbsp;
<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #66cc66;">&#40;</span>Object <span style="color: #000066; font-weight: bold;">item</span> : records<span style="color: #66cc66;">&#41;</span> 
    trace<span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #66cc66;">&#41;</span>; 
&nbsp;
<span style="color: #009900; font-style: italic;">// traces:</span>
<span style="color: #009900; font-style: italic;">// one</span>
<span style="color: #009900; font-style: italic;">// two</span>
<span style="color: #009900; font-style: italic;">// three</span></pre></div></div></td></tr></table><br /><br />
</div><br />
<br />
With for..in you can iterate over any object's properties and methods. In addition to these new for loops, all loops now also support the <code>break</code> and <code>continue</code> statements as well as an empty <code>return</code>.<br />
<br />
<div style='margin-bottom:-5em;margin-top:-1.5em;'><table width="100%"><tr><td><div class='cbox' style=' background:#f0f0f0;'><div class='cbox-title'>for..in example</div><div class='cbox-data' style=" background:#f0f0f0;"><pre class="javascript">Dynamic person = <span style="color: #66cc66;">&#123;</span>firstName:<span style="color: #3366CC;">&quot;Joe&quot;</span>, age:<span style="color: #CC0000;">32</span>, city:<span style="color: #3366CC;">&quot;Madrid&quot;</span><span style="color: #66cc66;">&#125;</span>; 
<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #66cc66;">&#40;</span>String prop <span style="color: #000066; font-weight: bold;">in</span> person<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> 
    trace<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;person.&quot;</span> + prop + <span style="color: #3366CC;">&quot; = &quot;</span> + person<span style="color: #66cc66;">&#91;</span>prop<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>; 
<span style="color: #66cc66;">&#125;</span>;
&nbsp;
<span style="color: #009900; font-style: italic;">// traces:</span>
<span style="color: #009900; font-style: italic;">// myObject.firstName = Joe </span>
<span style="color: #009900; font-style: italic;">// myObject.age = 32 </span>
<span style="color: #009900; font-style: italic;">// myObject.city = Madrid</span></pre></div></div></td></tr></table><br /><br />
</div><br />
<br />
<a name='Array_accessors'></a><h4>Array accessors</h4>
Another great new feature that is closely related to being a dynamic scripting language is the array accessor support. You know how you normally access properties and methods using a dot . and then the identifier? Well, you can now also access such a property as if the object owning it were an array:<br />
<br />
<div style='margin-bottom:-5em;margin-top:-1.5em;'><table width="100%"><tr><td><div class='cbox' style=' background:#f0f0f0;'><div class='cbox-title'>example of array accessor</div><div class='cbox-data' style=" background:#f0f0f0;"><pre class="javascript">Dynamic person = <span style="color: #003366; font-weight: bold;">new</span> Dynamic<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #009900; font-style: italic;">// dot accessor</span>
person.<span style="color: #006600;">age</span> = <span style="color: #CC0000;">10</span>;
trace<span style="color: #66cc66;">&#40;</span>person.<span style="color: #006600;">age</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #009900; font-style: italic;">// array accessor</span>
person<span style="color: #66cc66;">&#91;</span><span style="color: #3366CC;">&quot;age&quot;</span><span style="color: #66cc66;">&#93;</span> = <span style="color: #CC0000;">10</span>;
trace<span style="color: #66cc66;">&#40;</span>person<span style="color: #66cc66;">&#91;</span><span style="color: #3366CC;">&quot;age&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div></td></tr></table><br /><br />
</div><br />
<br />
On a sidenote, you can combine this with the <code>for..in</code> loop to list all the properties of an object:<br />
<br />
<div style='margin-bottom:-5em;margin-top:-1.5em;'><table width="100%"><tr><td><div class='cbox' style=' background:#f0f0f0;'><div class='cbox-data' style=" background:#f0f0f0;"><pre class="javascript"><span style="color: #000066; font-weight: bold;">for</span> <span style="color: #66cc66;">&#40;</span>String prop <span style="color: #000066; font-weight: bold;">in</span> person<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	trace<span style="color: #66cc66;">&#40;</span>person<span style="color: #66cc66;">&#91;</span>prop<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>;</pre></div></div></td></tr></table><br /><br />
</div><br />
<br />
<a name='New_Operator_instanceof'></a><h4>New Operator instanceof</h4>
Nibble now has the instanceof operator know from both Java and ECMAScript. You can use <code>instanceof</code> to test wether an object is an instance of a certain data type:<br />
<br />
<div style='margin-bottom:-5em;margin-top:-1.5em;'><table width="100%"><tr><td><div class='cbox' style=' background:#f0f0f0;'><div class='cbox-title'>example of instanceof</div><div class='cbox-data' style=" background:#f0f0f0;"><pre class="javascript">trace<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;text string&quot;</span> <span style="color: #000066; font-weight: bold;">instanceof</span> String<span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// traces &quot;true&quot;</span>
trace<span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> Dynamic<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #000066; font-weight: bold;">instanceof</span> Dynamic<span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// traces &quot;true&quot;</span>
trace<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;">12345</span> <span style="color: #000066; font-weight: bold;">instanceof</span> Number<span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// traces &quot;true&quot;</span>
trace<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;">12345</span> <span style="color: #000066; font-weight: bold;">instanceof</span> String<span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// traces &quot;false&quot;</span></pre></div></div></td></tr></table><br /><br />
</div><br />
<br />
<a name='Object_initializer_for_Dynamics'></a><h4>Object initializer for Dynamics</h4>
Nibble already knew support for implicit array construction (ie. <code>ArrayList list = ["one", 2, 3, new Object()]</code>), but now Nibble also supports implicit <a title="Dynamic" href='tiki-index.php?page=Dynamic' class='wiki'>Dynamic</a> construction, which works pretty much according to ECMA's specification. It only works for a <code>Dynamic</code>, because that is Nibble's version of ECMA's dynamic Object where you can assign any property to.<br />
<br />
Take a look:<br />
<br />
<div style='margin-bottom:-5em;margin-top:-1.5em;'><table width="100%"><tr><td><div class='cbox' style=' background:#f0f0f0;'><div class='cbox-title'>example of implicit Dynamic constructor</div><div class='cbox-data' style=" background:#f0f0f0;"><pre class="javascript">Dynamic person = <span style="color: #66cc66;">&#123;</span><span style="color: #000066;">name</span>:<span style="color: #3366CC;">&quot;Jack&quot;</span>, age:<span style="color: #CC0000;">28</span><span style="color: #66cc66;">&#125;</span>;
trace<span style="color: #66cc66;">&#40;</span>person.<span style="color: #006600;">age</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// traces: 28</span></pre></div></div></td></tr></table><br /><br />
</div><br />
<br />
<a name='Automatic_common_types_conversion'></a><h4>Automatic common types conversion</h4>
Known from Javascript and Actionscript, you can pass a Number to a method that accepts a String and it will be converted for you. Even better, Nibble will try to convert many common data types to each other, including boolean values. Both for orphan methods, dynamic (anonymous) methods and Java methods!<br />
<br />
<div style='margin-bottom:-5em;margin-top:-1.5em;'><table width="100%"><tr><td><div class='cbox' style=' background:#f0f0f0;'><div class='cbox-title'>automatic common types conversion</div><div class='cbox-data' style=" background:#f0f0f0;"><pre class="javascript">Dynamic dyn = <span style="color: #003366; font-weight: bold;">new</span> Dynamic<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
dyn.<span style="color: #006600;">foo</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>Boolean b<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">return</span> b;
<span style="color: #66cc66;">&#125;</span>;
&nbsp;
<span style="color: #009900; font-style: italic;">// converting from String to boolean</span>
trace<span style="color: #66cc66;">&#40;</span>dyn.<span style="color: #006600;">foo</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;0&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
trace<span style="color: #66cc66;">&#40;</span>dyn.<span style="color: #006600;">foo</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #009900; font-style: italic;">// traces:</span>
<span style="color: #009900; font-style: italic;">// false</span>
<span style="color: #009900; font-style: italic;">// true</span></pre></div></div></td></tr></table><br /><br />
</div><br />
<br />
<a name='Other_small_stuff'></a><h4>Other small stuff</h4>
Though Java methods are so called 'bound' methods (scope is fixed to the owner), you can now assign them to variables in NibbleScript<a href="tiki-editpage.php?page=NibbleScript" title="Create page: NibbleScript" class="wiki wikinew">?</a> and pass them around. In fact, you can do this with dynamic (anonymous) methods on Dynamic s as well. Methods from a Dynamic are not bound: they are executed in the context of their current (Dynamic) owner.<br />
<br />
Various bugfixes, optimizations and for Nibble developers many comment updates and tweaks, and cleaned up all thrown exceptions in the Parser and related classes.<br />
<br />
For a full changelog, check the changelog included in the sourcefiles <a class="wiki"  href="http://downloads.sourceforge.net/nibble/nibble_v0.9.7.zip">here</a>.<br />
<hr />
]]></description>
            <author>Benny Bottema &lt;b(DOT)bottema(AT)projectnibble(DOT)org&gt;</author>
            <pubDate>Sat, 31 Mar 2007 22:03:33 +0100</pubDate>
        </item>
        <item>
            <title>Nibble's codebase analyzed by ohloh.net</title>
            <link>http://projectnibble.org/tikiwiki/tiki-view_blog_post.php?blogId=1&amp;postId=11</link>
            <description><![CDATA[I've submitted the codebase of the Nibble Script Engine with Ohloh for analyzes. You can see the results here:<br />
<a class="wiki"  href="http://www.ohloh.net/projects/4580">http://www.ohloh.net/projects/4580</a><br />
<br />
The analyzes provides a visual map of CVS commits, codebase indication and comment indication.<br />
<br />
<div style='margin-bottom:-5em;margin-top:-1.5em;'><table width="100%"><tr><td><div class='cbox' style=' background:#ffffce;'><div class='cbox-data' style=" background:#ffffce;">Nibble belongs in the top third of projects being <i>Well-commented</i>!<br /></div></div></td></tr></table></div><br /><br />
<br />
<br />
<img src='tiki-view_blog_post_image.php?imgId=2' alt='Bottema's contributions' link="http://www.ohloh.net/projects/4580/contributors/27455" /><br />
]]></description>
            <author>Benny Bottema &lt;b(DOT)bottema(AT)projectnibble(DOT)org&gt;</author>
            <pubDate>Sun, 04 Mar 2007 11:03:47 +0100</pubDate>
        </item>
        <item>
            <title>Nibble v0.9.6 released: Prototypes away!</title>
            <link>http://projectnibble.org/tikiwiki/tiki-view_blog_post.php?blogId=1&amp;postId=10</link>
            <description><![CDATA[This release is all about one new feature added to the Nibble Script Engine: <a class="wiki"  href="http://en.wikipedia.org/wiki/Prototype-based_programming">Prototype-based programming</a>. In short, it does what <a class="wiki"  href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">ECMA-262</a>'s prototype does functionally.<br />
<br />
It started when Nibble needed a way to pool shared functions. For example when you made a function that creates a new Dynamic and assigns default getter/setter methods to it: every time you called that function, a new object was made with new instances of the same method with the same parsed code statements, and this ate your memory like biscuits and it had to stop. The prototype provides this shared pool where methods are executed within a certain context (the scope, or 'this'). Incidentally, this also made it feasible to go ahead and implement OO like capability in Nibble, which is a great step forward.<br />
<br />
<div style='margin-bottom:-5em;margin-top:-1.5em;'><table width="100%"><tr><td><div class='cbox' style=' background:#d8e4f1;'><div class='cbox-title'>info</div><div class='cbox-data' style=" background:#d8e4f1;">This concept is nothing new though; popular scripting languages such as Javascript and Actionscript <a class="wiki"  href="http://www.javascriptkit.com/javatutors/oopjs2.shtml">have had</a> this <a class="wiki"  href="http://www.actionscript.org/resources/articles/72/1/OOP-and-inheritance-in-Flash/Page1.html">for ages</a>.<br /></div></div></td></tr></table></div><br /><br />
<br />
<br />
Here's an example of OO programming with prototyping in Nibblescript:<br />
<br />
<div style='margin-bottom:-5em;margin-top:-1.5em;'><table width="100%"><tr><td><div class='cbox' style=' background:#f0f0f0;'><div class='cbox-title'>OOP with NS prototyping</div><div class='cbox-data' style=" background:#f0f0f0;"><pre class="javascript"><span style="color: #009900; font-style: italic;">// define superclass MyBaseClass</span>
Dynamic MyBaseClass = <span style="color: #003366; font-weight: bold;">new</span> Dynamic<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
MyBaseClass.<span style="color: #006600;">foo</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>String msg<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">&quot;MyBaseClass &quot;</span> + msg;
<span style="color: #66cc66;">&#125;</span>;
&nbsp;
<span style="color: #009900; font-style: italic;">// define subclass MySubClass</span>
Dynamic MySubClass = <span style="color: #003366; font-weight: bold;">new</span> Dynamic<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
MySubClass.<span style="color: #006600;">prototype</span> = MyBaseClass; <span style="color: #009900; font-style: italic;">// set superclass</span>
MySubClass.<span style="color: #006600;">foo</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>String msg<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">&quot;MySubClass &quot;</span> + <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">prototype</span>.<span style="color: #006600;">foo</span><span style="color: #66cc66;">&#40;</span>msg<span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// super.foo()</span>
<span style="color: #66cc66;">&#125;</span>;
&nbsp;
<span style="color: #009900; font-style: italic;">// create an instance of MySubClass</span>
Dynamic instance = <span style="color: #003366; font-weight: bold;">new</span> Dynamic<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
instance.<span style="color: #006600;">prototype</span> = MySubClass; <span style="color: #009900; font-style: italic;">// set superclass</span>
trace<span style="color: #66cc66;">&#40;</span>instance.<span style="color: #006600;">foo</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;test&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #009900; font-style: italic;">// traces: &quot;MySubClass MyBaseClass test&quot;</span></pre></div></div></td></tr></table><br /><br />
</div><br />
<br />
The Dynamic class actually has a overloaded constructor where you can just pas the superclass into:<br />
<br />
<div style='margin-bottom:-5em;margin-top:-1.5em;'><table width="100%"><tr><td><div class='cbox' style=' background:#f0f0f0;'><div class='cbox-title'>two ways of setting a prototype</div><div class='cbox-data' style=" background:#f0f0f0;"><pre class="javascript"><span style="color: #009900; font-style: italic;">// old way:</span>
Dynamic instance = <span style="color: #003366; font-weight: bold;">new</span> Dynamic<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
instance.<span style="color: #006600;">prototype</span> = MyClass;
&nbsp;
<span style="color: #009900; font-style: italic;">// new way:</span>
Dynamic instance = <span style="color: #003366; font-weight: bold;">new</span> Dynamic<span style="color: #66cc66;">&#40;</span>MyClass<span style="color: #66cc66;">&#41;</span>;</pre></div></div></td></tr></table><br /><br />
</div><br />
<br />
<a name='_a_class_wiki_href_http_sourceforge_net_project_showfiles_php_group_id_176945_package_id_203634_release_id_490962_download_Nibble_v0_9_6_a_'></a><h3><a class="wiki"  href="http://sourceforge.net/project/showfiles.php?group_id=176945&package_id=203634&release_id=490962">download Nibble v0.9.6</a></h3>
]]></description>
            <author>Benny Bottema &lt;b(DOT)bottema(AT)projectnibble(DOT)org&gt;</author>
            <pubDate>Sat, 03 Mar 2007 22:00:07 +0100</pubDate>
        </item>
        <item>
            <title>Project Nibble website went live!</title>
            <link>http://projectnibble.org/tikiwiki/tiki-view_blog_post.php?blogId=1&amp;postId=9</link>
            <description><![CDATA[<a name='2007_03_03_00_13'></a><h5>2007-03-03 00:13</h5>
<hr />
Nibble now lives on <a class="wiki"  href="http://www.projectnibble.org">http://www.projectnibble.org</a><br />
<br />
Not only that, Project Nibble is now backed by a Wiki site (TikiWiki based), which is awesome, because small edits are extremely easy to make on the fly by anyone, and there are automated facilities for blogs, articles, FAQ, RSS etc.<br />
<br />
Over the course of the next months, documentation on projectnibble.org will grow and I'll be reporting on everything Nibble can do or mean for you.<br />
<br />
<a class="wiki"  href="http://www.projectnibble.org">http://www.projectnibble.org</a><br />
]]></description>
            <author>Benny Bottema &lt;b(DOT)bottema(AT)projectnibble(DOT)org&gt;</author>
            <pubDate>Sat, 03 Mar 2007 10:33:32 +0100</pubDate>
        </item>
        <item>
            <title>Nibble v0.9.5 released: Ever smooth</title>
            <link>http://projectnibble.org/tikiwiki/tiki-view_blog_post.php?blogId=1&amp;postId=8</link>
            <description><![CDATA[<a name='2007_02_18_23_56'></a><h5>2007-02-18 23:56</h5>
<hr />
Today's release is all about little details. Various features have been added, enhanced or moved. Also a list of bugfixes have been covered that showed up in 'real life use' of the script engine.<br />
<br />
Among other things, one of the biggest added features is how the script engine looks for methods on a Java object, for example when you call a constructor of some class from Nibblescript; in addition to autoboxing and autocasting to supertypes, Nibble will try to match interface types as well and as last resort will try to autoconvert many common types (ie. int 5 to String "5").<br />
<br />
Another interesting small utility that has been added is the concept of 'assumptions'. Assumptions are like Java's assertions except used for logic instead of mere testing and with more control over what kind of Exception is thrown and with what message.<br />
<br />
<div style='margin-bottom:-5em;margin-top:-1.5em;'><table width="100%"><tr><td><div class='cbox' style=' background:#f0f0f0;'><div class='cbox-title'>example</div><div class='cbox-data' style=" background:#f0f0f0;"><pre class="javascript"><span style="color: #009900; font-style: italic;">// this fragment will throw an error of type MyException  </span>
boolean myBool = <span style="color: #003366; font-weight: bold;">false</span>;  
assume<span style="color: #66cc66;">&#40;</span>myBool, MyException.<span style="color: #003366; font-weight: bold;">class</span>, <span style="color: #3366CC;">&quot;boolean wasn't true!&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div></td></tr></table><br /><br />
</div><br />
<br />
For more information on the progress that lead to this release please visit the developers forum:<br />
<a class="wiki"  href="http://sourceforge.net/forum/forum.php?thread_id=1655031&amp;forum_id=610497">http://sourceforge.net/forum/forum.php?thread_id=1655031&amp;forum_id=610497</a><br />
]]></description>
            <author>Benny Bottema &lt;b(DOT)bottema(AT)projectnibble(DOT)org&gt;</author>
            <pubDate>Sat, 03 Mar 2007 10:32:28 +0100</pubDate>
        </item>
        <item>
            <title>Nibble v0.9.4 released: Javadoc included</title>
            <link>http://projectnibble.org/tikiwiki/tiki-view_blog_post.php?blogId=1&amp;postId=7</link>
            <description><![CDATA[<a name='2007_02_05_23_37'></a><h5>2007-02-05 23:37</h5>
<hr />
<br />
Included in Nibble v0.9.4 is a complete Javadoc for developers (private version) and end-users (public version).<br />
<br />
Here's the changelog for this release:<br />
<br />
<ul><li> fixed for-loop so third parameter is optional
</li><li> fixed for-loop, while and do-while so local parameter stack is reset every loop
</li><li> fixed reflection bug when invoking method of public interface implemented by a private inner class
</li><li> added setter for external .java/.class classloader to search for classes that are imported in NS.
</li><li> fixed some comments
</li><li> renamed interface ILocalStack to VariableCollection<a href="tiki-editpage.php?page=VariableCollection" title="Create page: VariableCollection" class="wiki wikinew">?</a> and changed all references to 'local' to 'variable'
</li><li> changed thrown Exception from VariableCollection<a href="tiki-editpage.php?page=VariableCollection" title="Create page: VariableCollection" class="wiki wikinew">?</a> to runtime exception
</li><li> updated ALL javadoc entries and applied consistency and some semantics (, {@link}, etc.)
</li><li> performed a complete (and first) Eclipse cleanup swoop
</li><li> updated DynamicMethod<a href="tiki-editpage.php?page=DynamicMethod" title="Create page: DynamicMethod" class="wiki wikinew">?</a> so that you can create inline method variables with it in Java:
</li></ul>
<br />
<div style='margin-bottom:-5em;margin-top:-1.5em;'><table width="100%"><tr><td><div class='cbox' style=' background:#f0f0f0;'><div class='cbox-title'>example</div><div class='cbox-data' style=" background:#f0f0f0;"><pre class="javascript"><span style="color: #009900; font-style: italic;">/**  
 * This java method declares a method variable and executes this inline...  
 */</span>  
<span style="color: #003366; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> testDynamicMethod<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>  
	<span style="color: #009900; font-style: italic;">// declare method</span>
	final String arguments = <span style="color: #3366CC;">&quot;arguments: &quot;</span>;
	DynamicMethod foo = <span style="color: #003366; font-weight: bold;">new</span> DynamicMethod<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>  
		<span style="color: #003366; font-weight: bold;">public</span> String invoke<span style="color: #66cc66;">&#40;</span>Object scope, Object<span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> args<span style="color: #66cc66;">&#41;</span> throws Exception <span style="color: #66cc66;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">return</span> arguments + args;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>;
&nbsp;
	<span style="color: #009900; font-style: italic;">// call method</span>
	String result = foo.<span style="color: #006600;">invoke</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">null</span>, <span style="color: #003366; font-weight: bold;">new</span> Object<span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> args <span style="color: #66cc66;">&#123;</span> <span style="color: #CC0000;">1</span>, <span style="color: #CC0000;">2</span>, <span style="color: #CC0000;">3</span> <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
	System.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span>result<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>;</pre></div></div></td></tr></table><br /><br />
</div><br />
]]></description>
            <author>Benny Bottema &lt;b(DOT)bottema(AT)projectnibble(DOT)org&gt;</author>
            <pubDate>Sat, 03 Mar 2007 10:30:35 +0100</pubDate>
        </item>
        <item>
            <title>Nibble v0.9.3 released: Nibble overhaul</title>
            <link>http://projectnibble.org/tikiwiki/tiki-view_blog_post.php?blogId=1&amp;postId=6</link>
            <description><![CDATA[<a name='2007_01_21_17_21'></a><h5>2007-01-21 17:21</h5>
<hr />
Nibble has had some major surgery done. Most classes have been renamed to be more sensible and various problems have been solved.<br />
<br />
Perhaps the biggest operation was reworking how scope works in Nibble; dynamic functions now work with scope(s) correctly. Also, you can now use the keyword 'this' and stuff like that and variable/method lookup has been fixed (both tweaked for native support and dynamic language support).<br />
<br />
I'm very happy with this release as it is a major step forward towards a full-grown scripting engine. Now people with programming skills as well as beginners or scripters can start working with Nibble.<br />
<br />
Next up: adding common libraries for beginning scripters? I guess this is sensible, since both Actionscript and Javascript have this; Nibblescript currently only supports all Java libraries and a couple of global Nibblescript methods.<br />
<br />
If you have some ideas, don't hesitate to mail me, use the forums or submit a feature request!<br />
]]></description>
            <author>Benny Bottema &lt;b(DOT)bottema(AT)projectnibble(DOT)org&gt;</author>
            <pubDate>Sat, 03 Mar 2007 10:23:42 +0100</pubDate>
        </item>
        <item>
            <title>Nibble v0.9.2 released: Nibble went dynamic!</title>
            <link>http://projectnibble.org/tikiwiki/tiki-view_blog_post.php?blogId=1&amp;postId=5</link>
            <description><![CDATA[<a name='2007_01_18_22_42'></a><h5>2007-01-18 22:42</h5>
<hr />
Well, more dynamic anyway. In addition to dynamic properties, Nibble now supports dynamic functions as well. Functions can be assigned to variables after which those variables can be called like functions.<br />
<br />
<div style='margin-bottom:-5em;margin-top:-1.5em;'><table width="100%"><tr><td><div class='cbox' style=' background:#f0f0f0;'><div class='cbox-title'>example</div><div class='cbox-data' style=" background:#f0f0f0;"><pre class="javascript">Dynamic person = <span style="color: #003366; font-weight: bold;">new</span> Dynamic<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; 
	person.<span style="color: #006600;">eat</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>food<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> 
	trace<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;hmm... &quot;</span> + food.<span style="color: #006600;">getName</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>; 
<span style="color: #66cc66;">&#125;</span>; 
&nbsp;
Dynamic apple = <span style="color: #003366; font-weight: bold;">new</span> Dynamic<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; 
	apple.<span style="color: #006600;">getName</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> 
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">&quot;apple&quot;</span>; 
<span style="color: #66cc66;">&#125;</span>; 
&nbsp;
person.<span style="color: #006600;">eat</span><span style="color: #66cc66;">&#40;</span>apple<span style="color: #66cc66;">&#41;</span>; 
<span style="color: #009900; font-style: italic;">// traces: &quot;hmm... apple&quot;</span></pre></div></div></td></tr></table><br /><br />
</div><br />
<br />
This feature is still in development though; scoping doesn't work properly for dynamic functions yet.<br />
]]></description>
            <author>Benny Bottema &lt;b(DOT)bottema(AT)projectnibble(DOT)org&gt;</author>
            <pubDate>Sat, 03 Mar 2007 10:22:42 +0100</pubDate>
        </item>
        <item>
            <title>XML and the Dynamic object concept merged</title>
            <link>http://projectnibble.org/tikiwiki/tiki-view_blog_post.php?blogId=1&amp;postId=4</link>
            <description><![CDATA[<a name='2007_01_14_23_3'></a><h5>2007-01-14 23:3</h5>
<hr />
In short, the Dynamic object acts like a Javascript object, in that you can dynamically add properties to an instance. This is extremely powerful for dynamic languages like Javascript, Actionscript and now up to a point Nibblescript.<br />
<br />
Combine the dynamic object with XML and you can get an Object representation of the XML datatree. It's a little bit like JAXB, except without the need for complex schema's, DTD's or other stuff. Plus, you don't need to generate stub classes up front (which also means memory footprints for the classes involved reduce to only one class: Dynamic).<br />
<br />
In Java, this Dynamic object get be somewhat handy as it works with getProperty(name, value) and setProperty(...) (so specific setters/getters are generalized). In Nibblescript however, it's a whole lot better, since the JReflect class - in charge of locating properties/methods etc. - automatically calls setProperty/getProperty on any object of type Dynamic.<br />
<br />
Here's an example:<br />
<br />
<div style='margin-bottom:-5em;margin-top:-1.5em;'><table width="100%"><tr><td><div class='cbox' style=' background:#FFFFFF;'><div class='cbox-title'>books.xml</div><div class='cbox-data' style=" background:#FFFFFF;"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;books<span style="font-weight: bold; color: black;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;book</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;1&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span> 
		<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;name<span style="font-weight: bold; color: black;">&gt;</span></span></span>Ajax Design Patterns<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/name<span style="font-weight: bold; color: black;">&gt;</span></span></span> 
		<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;author<span style="font-weight: bold; color: black;">&gt;</span></span></span>Michael Mahemoff<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/author<span style="font-weight: bold; color: black;">&gt;</span></span></span> 
		<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;price<span style="font-weight: bold; color: black;">&gt;</span></span></span>30<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/price<span style="font-weight: bold; color: black;">&gt;</span></span></span> 
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/book<span style="font-weight: bold; color: black;">&gt;</span></span></span> 
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;book</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;2&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span> 
		<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;name<span style="font-weight: bold; color: black;">&gt;</span></span></span>Head First Design Patterns<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/name<span style="font-weight: bold; color: black;">&gt;</span></span></span> 
		<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;author<span style="font-weight: bold; color: black;">&gt;</span></span></span>Eric Freeman<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/author<span style="font-weight: bold; color: black;">&gt;</span></span></span> 
		<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;price<span style="font-weight: bold; color: black;">&gt;</span></span></span>40<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/price<span style="font-weight: bold; color: black;">&gt;</span></span></span> 
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/book<span style="font-weight: bold; color: black;">&gt;</span></span></span> 
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/books<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div></td></tr></table><br /><br />
</div><br />
<br />
<div style='margin-bottom:-5em;margin-top:-1.5em;'><table width="100%"><tr><td><div class='cbox' style=' background:#f0f0f0;'><div class='cbox-title'>readbooks.ns</div><div class='cbox-data' style=" background:#f0f0f0;"><pre class="javascript"><span style="color: #003366; font-weight: bold;">import</span> java.<span style="color: #006600;">util</span>.<span style="color: #006600;">*</span>; 
&nbsp;
Dynamic shelf = <span style="color: #003366; font-weight: bold;">new</span> XMLToDynamic<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">toDynamic</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;scripts<span style="color: #000099; font-weight: bold;">\b</span>ooks.xml&quot;</span><span style="color: #66cc66;">&#41;</span>; 
Dynamic book2 = shelf.<span style="color: #006600;">books</span>.<span style="color: #006600;">book</span>.<span style="color: #006600;">get</span><span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #66cc66;">&#41;</span>; 
&nbsp;
trace<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;id: &quot;</span> + book2.<span style="color: #006600;">attributes</span>.<span style="color: #006600;">id</span><span style="color: #66cc66;">&#41;</span>; 
trace<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot; name: &quot;</span> + book2.<span style="color: #000066;">name</span><span style="color: #66cc66;">&#41;</span>; 
trace<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot; author: &quot;</span> + book2.<span style="color: #006600;">author</span><span style="color: #66cc66;">&#41;</span>; 
trace<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot; price: &quot;</span> + book2.<span style="color: #006600;">price</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div></td></tr></table><br /><br />
</div><br />
<div style='margin-bottom:-5em;margin-top:-1.5em;'><table width="100%"><tr><td><div class='cbox' style=' background:#d8e4f1;'><div class='cbox-data' style=" background:#d8e4f1;">In case you were wondering, 'trace' is a global Nibble method added to the class ScriptLibrary<a href="tiki-editpage.php?page=ScriptLibrary" title="Create page: ScriptLibrary" class="wiki wikinew">?</a>.java. <i>System.out.println()</i> would've worked as well.<br /></div></div></td></tr></table></div><br /><br />
<br />
<br />
<div style='margin-bottom:-5em;margin-top:-1.5em;'><table width="100%"><tr><td><div class='cbox' style=' background:#f0f0f0;'><div class='cbox-title'>result in the console</div><div class='cbox-data' style=" background:#f0f0f0;"><pre class="javascript">id: <span style="color: #CC0000;">2</span> 
 <span style="color: #000066;">name</span>: Head First Design Patterns 
 author: Eric Freeman 
 price: <span style="color: #CC0000;">40</span></pre></div></div></td></tr></table><br /><br />
</div><br />
]]></description>
            <author>Benny Bottema &lt;b(DOT)bottema(AT)projectnibble(DOT)org&gt;</author>
            <pubDate>Sat, 03 Mar 2007 10:19:56 +0100</pubDate>
        </item>
    </channel>
</rss>
