<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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>Rebol Tutorial</title>
	<atom:link href="http://reboltutorial.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://reboltutorial.com</link>
	<description>Rebol Programming - Learn Rebol with Real-World Examples</description>
	<pubDate>Sat, 13 Mar 2010 20:53:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Backup to FTP Server with this free script</title>
		<link>http://reboltutorial.com/blog/backup-to-ftp-server-with-this-free-script/</link>
		<comments>http://reboltutorial.com/blog/backup-to-ftp-server-with-this-free-script/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 07:59:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[All]]></category>

		<category><![CDATA[Automation]]></category>

		<category><![CDATA[Backup]]></category>

		<category><![CDATA[Beginner]]></category>

		<category><![CDATA[FTP]]></category>

		<category><![CDATA[Shell]]></category>

		<category><![CDATA[Tools]]></category>

		<category><![CDATA[copy folder]]></category>

		<category><![CDATA[Free Script]]></category>

		<category><![CDATA[Freeware]]></category>

		<guid isPermaLink="false">http://reboltutorial.com/?p=6665</guid>
		<description><![CDATA[There are many great FTP Client Freewares like Filezilla but uploading the same folders again and again is a pain in a hass. So this little Script is a real time-saver as it will allow you to automate your backup or upload to FTP Server. I didn&#8217;t have to invent it as it&#8217;s the same [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://reboltutorial.com/files/2010/03/ftp-backup.gif" alt="ftp-backup" width="120" height="90" class="alignleft size-full wp-image-6670" />There are many great FTP Client Freewares like Filezilla but uploading the same folders again and again is a pain in a hass. So this little Script is a real time-saver as it will allow you to automate your backup or upload to FTP Server. I didn&#8217;t have to invent it as it&#8217;s the same <a href="http://www.rebol.net/cookbook/recipes/0011.html">copy-dir</a> script that exists on <a href="http://www.rebol.net/cookbook/index.html">Rebol Cookbook</a> with a verbose refinement: I just tested that it really works with FTP :). So here it is:</p>
<pre><code>
ftp-backup: func [local-folder ftp-folder /verbose /local i] [

    i: 0
    if not exists? ftp-folder [
      make-dir/deep ftp-folder
        either verbose [
          print form [ftp-folder "folder created ..."]
        ][
          print i
        ]
    ]
    foreach file read local-folder [
        i: i + 1
        either find file "/" [
            ftp-backup local-folder/:file ftp-folder/:file
        ][
            either verbose [
              print file
            ][
              print i
            ]
            write/binary ftp-folder/:file read/binary local-folder/:file
        ]
    ]
]
</code></pre>
<p>To use it for example on <a href="http://reboltutorial.com/dreamhost-hosting">Dreamhost</a> FTP Server for example, type:</p>
<pre><code>
ftp-copy %"/c/install/wordpress/" ftp://ftpuser:ftppassword@maindomain.com/reboltutorial.com/
</code></pre>
<p>Note: to have ftp-backup available at startup, store it in <a href="http://reboltutorial.com/blog/what-is-my-userr-and-where-is-it-stored/">user.r</a>. </p>
<div class='wp_likes' id='wp_likes_post-6665'>
<div style='display:none' class='text'><b>0</b> people like this post.</div>
<div><a href=' javascript:wp_likes.like(6665)' class='like' title='like this post'>Like</a>&nbsp;<img class='loader' src='http://reboltutorial.com/wp-content/plugins/wp-likes/images/spinner.gif' alt=''/></div>
</div>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark this</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http://reboltutorial.com/blog/backup-to-ftp-server-with-this-free-script/&amp;submitHeadline=Backup+to+FTP+Server+with+this+free+script&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://reboltutorial.com/blog/backup-to-ftp-server-with-this-free-script/&amp;title=Backup+to+FTP+Server+with+this+free+script" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://reboltutorial.com/blog/backup-to-ftp-server-with-this-free-script/&amp;title=Backup+to+FTP+Server+with+this+free+script" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://reboltutorial.com/blog/backup-to-ftp-server-with-this-free-script/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://reboltutorial.com/blog/backup-to-ftp-server-with-this-free-script/&amp;title=Backup+to+FTP+Server+with+this+free+script" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://reboltutorial.com/blog/backup-to-ftp-server-with-this-free-script/&amp;bm_description=Backup+to+FTP+Server+with+this+free+script" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http://reboltutorial.com/blog/backup-to-ftp-server-with-this-free-script/&amp;T=Backup+to+FTP+Server+with+this+free+script" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://reboltutorial.com/blog/backup-to-ftp-server-with-this-free-script/&amp;title=Backup+to+FTP+Server+with+this+free+script" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://reboltutorial.com/blog/backup-to-ftp-server-with-this-free-script/&amp;title=Backup+to+FTP+Server+with+this+free+script" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://reboltutorial.com/blog/backup-to-ftp-server-with-this-free-script/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http://reboltutorial.com/blog/backup-to-ftp-server-with-this-free-script/" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Backup+to+FTP+Server+with+this+free+script+@+http://reboltutorial.com/blog/backup-to-ftp-server-with-this-free-script/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://reboltutorial.com/blog/backup-to-ftp-server-with-this-free-script/&amp;t=Backup+to+FTP+Server+with+this+free+script" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://reboltutorial.com/blog/backup-to-ftp-server-with-this-free-script/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Parsing Optional Html Tag Attributes using none keyword</title>
		<link>http://reboltutorial.com/blog/parsing-optional-html-tag-attributes-using-none-keyword/</link>
		<comments>http://reboltutorial.com/blog/parsing-optional-html-tag-attributes-using-none-keyword/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 20:15:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[HTML]]></category>

		<category><![CDATA[Parsing]]></category>

		<category><![CDATA[Parse]]></category>

		<guid isPermaLink="false">http://reboltutorial.com/?p=6652</guid>
		<description><![CDATA[You really hate Regular Expressions and discovered the power of Parse with our simple parse tutorials. Nevertheless after a while, you feel frustrated because even after reading the excellent manual, you&#8217;re still lacking some real world examples. So here&#8217;s an example for using none with Parse. 
Let&#8217;s say you want to parse this:

content: {&#60;tag attribute1=&#34;valueattribute1&#34; [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://reboltutorial.com/files/2010/03/html.gif" alt="html" width="120" height="90" class="alignleft size-full wp-image-6656" />You really hate Regular Expressions and discovered the power of Parse with our <a href="http://reboltutorial.com/blog/tag/parse/">simple parse tutorials</a>. Nevertheless after a while, you feel frustrated because even after reading the <a href="http://www.rebol.com/docs/core23/rebolcore-15.html" target="_blank">excellent manual</a>, you&#8217;re still lacking some real world examples. So here&#8217;s an example for using none with <strong>Parse</strong>. </p>
<p>Let&#8217;s say you want to parse this:</p>
<pre class="brush: html;">
content: {&lt;tag attribute1=&quot;valueattribute1&quot; attribute2=&quot;valueattribute2&quot;&gt;
&lt;/tag&gt;
&lt;tag attribute2=&quot;valueattribute21&quot; attribute1=&quot;valueattribute11&quot; &gt;
&lt;/tag&gt;
}
</pre>
<p>or</p>
<pre class="brush: html;">
content: {&lt;tag attribute1=&quot;valueattribute1&quot; attribute2=&quot;valueattribute2&quot;&gt;
&lt;/tag&gt;
&lt;tag attribute2=&quot;valueattribute21&quot;&gt;
&lt;/tag&gt;
}
</pre>
<p>If you try this rule &#8230;</p>
<pre class="brush: php;">
attribute1: [{attribute1=&quot;} copy valueattribute1 to {&quot;} thru {&quot;}]
attribute2: [{attribute2=&quot;} copy valueattribute2 to {&quot;} thru {&quot;}]

attributes-rule: [attribute1 attribute2 (print valueattribute1 print valueattribute2 )
| attribute2 attribute1(print valueattribute2 print valueattribute1)
]

rule: [any [to {&lt;tag } thru {&lt;tag } attributes-rule {&gt;} to {&lt;/tag&gt;} thru {&lt;/tag&gt;}] to end]
</pre>
<p>&#8230; the second content won&#8217;t fully parse. Instead you have to add none keywords like this:</p>
<pre class="brush: php;">

attribute1: [{attribute1=&quot;} copy valueattribute1 to {&quot;} thru {&quot;}]
attribute2: [{attribute2=&quot;} copy valueattribute2 to {&quot;} thru {&quot;}]

attributes-rule: [[attribute1 | none] [attribute2 | none] (print valueattribute1 print valueattribute2
valueattribute1: none valueattribute2: none)
| [attribute2 | none] [attribute1 | none] (print valueattribute2 print valueattribute1
valueattribute1: none valueattribute2: none
)
| none
]

rule: [any [to {&lt;tag } thru {&lt;tag } attributes-rule {&gt;} to {&lt;/tag&gt;} thru {&lt;/tag&gt;}] to end]
</pre>
<p>If you test content 2 with last rule, you should get</p>
<pre><code>
&gt;&gt; parse content rule
valueattribute1
valueattribute2
none
valueattribute21
== true
&gt;&gt;
</code></pre>
</p>
<div class='wp_likes' id='wp_likes_post-6652'>
<div style='display:none' class='text'><b>0</b> people like this post.</div>
<div><a href=' javascript:wp_likes.like(6652)' class='like' title='like this post'>Like</a>&nbsp;<img class='loader' src='http://reboltutorial.com/wp-content/plugins/wp-likes/images/spinner.gif' alt=''/></div>
</div>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark this</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http://reboltutorial.com/blog/parsing-optional-html-tag-attributes-using-none-keyword/&amp;submitHeadline=Parsing+Optional+Html+Tag+Attributes+using+none+keyword&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://reboltutorial.com/blog/parsing-optional-html-tag-attributes-using-none-keyword/&amp;title=Parsing+Optional+Html+Tag+Attributes+using+none+keyword" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://reboltutorial.com/blog/parsing-optional-html-tag-attributes-using-none-keyword/&amp;title=Parsing+Optional+Html+Tag+Attributes+using+none+keyword" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://reboltutorial.com/blog/parsing-optional-html-tag-attributes-using-none-keyword/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://reboltutorial.com/blog/parsing-optional-html-tag-attributes-using-none-keyword/&amp;title=Parsing+Optional+Html+Tag+Attributes+using+none+keyword" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://reboltutorial.com/blog/parsing-optional-html-tag-attributes-using-none-keyword/&amp;bm_description=Parsing+Optional+Html+Tag+Attributes+using+none+keyword" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http://reboltutorial.com/blog/parsing-optional-html-tag-attributes-using-none-keyword/&amp;T=Parsing+Optional+Html+Tag+Attributes+using+none+keyword" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://reboltutorial.com/blog/parsing-optional-html-tag-attributes-using-none-keyword/&amp;title=Parsing+Optional+Html+Tag+Attributes+using+none+keyword" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://reboltutorial.com/blog/parsing-optional-html-tag-attributes-using-none-keyword/&amp;title=Parsing+Optional+Html+Tag+Attributes+using+none+keyword" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://reboltutorial.com/blog/parsing-optional-html-tag-attributes-using-none-keyword/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http://reboltutorial.com/blog/parsing-optional-html-tag-attributes-using-none-keyword/" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Parsing+Optional+Html+Tag+Attributes+using+none+keyword+@+http://reboltutorial.com/blog/parsing-optional-html-tag-attributes-using-none-keyword/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://reboltutorial.com/blog/parsing-optional-html-tag-attributes-using-none-keyword/&amp;t=Parsing+Optional+Html+Tag+Attributes+using+none+keyword" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://reboltutorial.com/blog/parsing-optional-html-tag-attributes-using-none-keyword/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to create a Program Launcher (using Rebol Bind Function)</title>
		<link>http://reboltutorial.com/blog/how-to-create-a-program-launcher/</link>
		<comments>http://reboltutorial.com/blog/how-to-create-a-program-launcher/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 15:28:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[All]]></category>

		<category><![CDATA[Concept]]></category>

		<category><![CDATA[Expert]]></category>

		<category><![CDATA[Helper Function]]></category>

		<category><![CDATA[Shell]]></category>

		<category><![CDATA[Syntax]]></category>

		<category><![CDATA[Tools]]></category>

		<category><![CDATA[bind function]]></category>

		<category><![CDATA[call function]]></category>

		<category><![CDATA[select function]]></category>

		<guid isPermaLink="false">http://reboltutorial.com/?p=6602</guid>
		<description><![CDATA[I have a personal productivity problem as I have a bunch of programs all over the place on my Desktop or in my Program Files Menu. I tried many launchers freewares but none really satisfied me so I finally decided to use Rebol Shell as my launcher. It&#8217;s also a great example of a context [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://reboltutorial.com/files/2010/01/launcher.gif" alt="launcher" width="120" height="90" class="alignleft size-full wp-image-6619" />I have a personal productivity problem as I have a bunch of programs all over the place on my Desktop or in my Program Files Menu. I tried many launchers freewares but none really satisfied me so I finally decided to use Rebol Shell as my launcher. It&#8217;s also a great example of a context when you need to use the Bind function in Rebol.</p>
<p>So let&#8217;s say I have a list of programs I want to launch by just typing a keyword in Rebol Shell. For example, Notepad would launch my favorite notepad2 program in c:\program files\notepad2\notepad2.exe. So I created a file list shell.list.txt to store them as a sample:</p>
<pre class="brush: php;">&quot;notepad&quot; &quot;c:\program files\notepad2\notepad2.exe&quot;
&quot;calc&quot; &quot;c:\windows\system32\calc.exe&quot;
&quot;WebDevExpress&quot; &quot;C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\VWDExpress.exe&quot;
</pre>
<p>If this file is located in data sub-directory within the current directory (generally the directory of the current script that is executing), it will be loaded into a Rebol block with this instruction:</p>
<pre><code>
shell.list: load %data/shell.list.txt
</code></pre>
<p>Then the run function will refer to it to get the real path with the Rebol Select function:</p>
<pre><code>
Run: func[exe-path][
  if/else not none? it: select shell.list exe-path [
	call quote it
  ][
        ;in case keyword cannot be found, one supposes it's the full path
	call quote exe-path
  ]
]
</code></pre>
<p>Copy and paste it into Rebol Console along with this mock data:</p>
<pre><code>
shell.list: ["notepad" "c:\program files\notepad2\notepad2.exe"
"calc" "c:\windows\system32\calc.exe"
"WebDevExpress" "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\VWDExpress.exe"]
</code></pre>
<p>So that you can test it by typing</p>
<pre><code>
run "c:\windows\system32\calc.exe"
</code></pre>
<p>or just the keyword</p>
<pre><code>
calc
</code></pre>
<p>This latter won&#8217;t work. Why? Because calc has not yet been defined as a command in Rebol. To do so, you would create a calc function like this:</p>
<pre><code>
calc: func[][
    run "c:\windows\system32\calc.exe"
]
</code></pre>
<p>Copy and paste the code above and test calc again, this time it should work.</p>
<p>Now, it would be tedious to define each keyword by creating a new function by hand whereas the procedure is rather generic. So naturally you&#8217;d like to use a dynamic generator function to do this for you something like this:</p>
<pre><code>
foreach [name path] shell.list [
	func-body: to-block <a href="http://www.rebol.com/docs/words/wrejoin.html" target='_blank' rel='nofollow'>rejoin</a> ['run " " {"}  name {"}]
	set (to-word name) make function! [] func-body
]
</code></pre>
<p>If you execute the code above, you could see that it created notepad and calc functions by using the rebol source command:</p>
<pre><code>
&gt;&gt; source notepad
notepad: func [][run "notepad"]
&gt;&gt; source calc
calc: func [][run "calc"]
&gt;&gt;
</code></pre>
<p>Now if you want to test the calc keyword again, you would get this bad &#8220;surprise&#8221;:</p>
<pre><code>
&gt;&gt; calc
** Script Error: run word has no context
** Where: calc
** Near: run "calc"
</code></pre>
<p>because run is an unknown word within the context of func-body you created at runtime within the foreach loop. So you have to bind run to the func-body context by using the bind function like this:</p>
<pre><code>
set (to-word name) make function! [] bind func-body 'run
</code></pre>
<p>so that you can copy and paste the foreach loop once again:</p>
<pre><code>
foreach [name path] shell.list [
	func-body: to-block <a href="http://www.rebol.com/docs/words/wrejoin.html" target='_blank' rel='nofollow'>rejoin</a> ['run " " {"}  name {"}]
	set (to-word name) make function! [] bind func-body 'run
]
</code></pre>
<p>Finally typing the calc keyword in Rebol Console should launch the calculator !</p>
<p>To have all this automatically at Rebol launch, put these functions in <a href="http://reboltutorial.com/blog/what-is-my-userr-and-where-is-it-stored/">User.r</a>. </p>
<div class='wp_likes' id='wp_likes_post-6602'>
<div style='display:none' class='text'><b>0</b> people like this post.</div>
<div><a href=' javascript:wp_likes.like(6602)' class='like' title='like this post'>Like</a>&nbsp;<img class='loader' src='http://reboltutorial.com/wp-content/plugins/wp-likes/images/spinner.gif' alt=''/></div>
</div>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark this</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http://reboltutorial.com/blog/how-to-create-a-program-launcher/&amp;submitHeadline=How+to+create+a+Program+Launcher+%28using+Rebol+Bind+Function%29&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://reboltutorial.com/blog/how-to-create-a-program-launcher/&amp;title=How+to+create+a+Program+Launcher+%28using+Rebol+Bind+Function%29" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://reboltutorial.com/blog/how-to-create-a-program-launcher/&amp;title=How+to+create+a+Program+Launcher+%28using+Rebol+Bind+Function%29" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://reboltutorial.com/blog/how-to-create-a-program-launcher/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://reboltutorial.com/blog/how-to-create-a-program-launcher/&amp;title=How+to+create+a+Program+Launcher+%28using+Rebol+Bind+Function%29" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://reboltutorial.com/blog/how-to-create-a-program-launcher/&amp;bm_description=How+to+create+a+Program+Launcher+%28using+Rebol+Bind+Function%29" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http://reboltutorial.com/blog/how-to-create-a-program-launcher/&amp;T=How+to+create+a+Program+Launcher+%28using+Rebol+Bind+Function%29" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://reboltutorial.com/blog/how-to-create-a-program-launcher/&amp;title=How+to+create+a+Program+Launcher+%28using+Rebol+Bind+Function%29" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://reboltutorial.com/blog/how-to-create-a-program-launcher/&amp;title=How+to+create+a+Program+Launcher+%28using+Rebol+Bind+Function%29" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://reboltutorial.com/blog/how-to-create-a-program-launcher/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http://reboltutorial.com/blog/how-to-create-a-program-launcher/" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+How+to+create+a+Program+Launcher+%28using+Rebol+Bind+Function%29+@+http://reboltutorial.com/blog/how-to-create-a-program-launcher/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://reboltutorial.com/blog/how-to-create-a-program-launcher/&amp;t=How+to+create+a+Program+Launcher+%28using+Rebol+Bind+Function%29" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://reboltutorial.com/blog/how-to-create-a-program-launcher/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rebol Essentials: Free Rebol Ebook</title>
		<link>http://reboltutorial.com/blog/free-rebol-ebook/</link>
		<comments>http://reboltutorial.com/blog/free-rebol-ebook/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 02:23:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[All]]></category>

		<category><![CDATA[Beginner]]></category>

		<category><![CDATA[E-Learning]]></category>

		<category><![CDATA[book]]></category>

		<category><![CDATA[Free]]></category>

		<guid isPermaLink="false">http://reboltutorial.com/?p=6593</guid>
		<description><![CDATA[If you&#8217;re looking for a free rebol ebook and type this on Google, you won&#8217;t find any, whereas there is one excellent here, so to boost it on the search engine, I have created this post.
It&#8217;s a gentle but rather complete course to Rebol language which will give you a good background to understand other [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://reboltutorial.com/files/2010/01/free-rebol-ebook.png" alt="free-rebol-ebook" width="249" height="350" class="alignleft size-full wp-image-6594" />If you&#8217;re looking for a <strong>free rebol ebook</strong> and type this on Google, you won&#8217;t find any, whereas there is one excellent <a href="http://vpavlu.plain.at/REBOL/tutorial/">here</a>, so to boost it on the search engine, I have created this post.</p>
<p>It&#8217;s a gentle but rather complete course to Rebol language which will give you a good background to understand other books like <a href="http://reboltutorial.com/blog/book-review-rebol-a-programmers-guide/">the one from Olivier Auverlot and Peter Wood</a> or tutorials on <a href="http://reboltutorial.com">rebol tutorial</a> or elsewhere like the excellent <a href="http://musiclessonz.com/rebol_tutorial.html" target="_blank" rel="nofollow">musiclessonz</a> now <a href="http://re-bol.com/" target="_blank" rel="nofollow">re-bol.com</a>.  </p>
<div class='wp_likes' id='wp_likes_post-6593'>
<div style='display:none' class='text'><b>0</b> people like this post.</div>
<div><a href=' javascript:wp_likes.like(6593)' class='like' title='like this post'>Like</a>&nbsp;<img class='loader' src='http://reboltutorial.com/wp-content/plugins/wp-likes/images/spinner.gif' alt=''/></div>
</div>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark this</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http://reboltutorial.com/blog/free-rebol-ebook/&amp;submitHeadline=Rebol+Essentials%3A+Free+Rebol+Ebook&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://reboltutorial.com/blog/free-rebol-ebook/&amp;title=Rebol+Essentials%3A+Free+Rebol+Ebook" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://reboltutorial.com/blog/free-rebol-ebook/&amp;title=Rebol+Essentials%3A+Free+Rebol+Ebook" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://reboltutorial.com/blog/free-rebol-ebook/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://reboltutorial.com/blog/free-rebol-ebook/&amp;title=Rebol+Essentials%3A+Free+Rebol+Ebook" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://reboltutorial.com/blog/free-rebol-ebook/&amp;bm_description=Rebol+Essentials%3A+Free+Rebol+Ebook" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http://reboltutorial.com/blog/free-rebol-ebook/&amp;T=Rebol+Essentials%3A+Free+Rebol+Ebook" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://reboltutorial.com/blog/free-rebol-ebook/&amp;title=Rebol+Essentials%3A+Free+Rebol+Ebook" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://reboltutorial.com/blog/free-rebol-ebook/&amp;title=Rebol+Essentials%3A+Free+Rebol+Ebook" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://reboltutorial.com/blog/free-rebol-ebook/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http://reboltutorial.com/blog/free-rebol-ebook/" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Rebol+Essentials%3A+Free+Rebol+Ebook+@+http://reboltutorial.com/blog/free-rebol-ebook/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://reboltutorial.com/blog/free-rebol-ebook/&amp;t=Rebol+Essentials%3A+Free+Rebol+Ebook" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://reboltutorial.com/blog/free-rebol-ebook/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Prepare for the next Big Bang Release: ODBC (use Rebol with MS Access Wow !!!),SSL/HTTPS,&#8230;</title>
		<link>http://reboltutorial.com/blog/prepare-for-the-next-big-bang-release-odbc-use-rebol-with-ms-access-wow-sslhttps/</link>
		<comments>http://reboltutorial.com/blog/prepare-for-the-next-big-bang-release-odbc-use-rebol-with-ms-access-wow-sslhttps/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 23:56:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[All]]></category>

		<category><![CDATA[Announcement]]></category>

		<category><![CDATA[Internet]]></category>

		<category><![CDATA[HTTPS]]></category>

		<category><![CDATA[NEWS]]></category>

		<category><![CDATA[ODBC]]></category>

		<category><![CDATA[Release]]></category>

		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://reboltutorial.com/?p=6558</guid>
		<description><![CDATA[I know I&#8217;ve been a bit harsh lately  but you all know I&#8217;m well intentioned and that you should always take my critics positively. But when time comes when I see something great, well I won&#8217;t restrain myself from telling it. 
And a few days ago, HostileFork has whispered me that in a future [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://reboltutorial.com/files/2010/01/news.gif" alt="news" width="120" height="90" class="alignleft size-full wp-image-6559" />I know I&#8217;ve been a bit harsh lately <img src='http://reboltutorial.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> but you all know I&#8217;m well intentioned and that you should always take my critics positively. But when time comes when I see something great, well I won&#8217;t restrain myself from telling it. </p>
<p>And a few days ago, <a href="http://hostilefork.com/">HostileFork</a> has whispered me that in a future release of Rebol 2, you will have nothing less than ODBC, SSL/HTTPS, in fact it is as if you had Rebol Command for FREE. That is not only great, that is unexpected so I say <em>Wow</em> to RT!</p>
<p>What you can do with ODBC ? Well you can edit MS Access Database with your Rebol 500Ko (instead of dozens of megabytes just for the GUI part, of course the data size will stay as big) or you can use secure SSL with twitter API and other webservices, only imagination is the limit :).</p>
<p>Just have all of us to wait for it except if you join <a href="http://www.altme.com">Altme World</a> or <a href="http://www.qtask.com/">Qtask</a> at the moment as it is in beta stage.</p>
<p>Update January 19th: From the link given by Petr<br />
<a href="http://www.rebol.com/docs/v2-7.html">http://www.rebol.com/docs/v2-7.html</a></p>
<p>    * View/Pro features enabled: allowing <a href="http://www.rebol.com/docs/ssl.html">SSL</a>, <a href="http://www.rebol.com/docs/database.html">ODBC</a>, and <a href="http://www.rebol.com/docs/encryption.html">encryption</a><br />
    * Adds R2/Forward mezzanine functions (from Brian Hawley)<br />
    * Re-enables installation and proper view-root startup (appdata dir on Win32)<br />
    * Install and uninstall added to ViewTop GUI panels<br />
    * Fixes LOAD with PORTS that return strings to be loaded as blocks.<br />
    * Fixes Decode-CGI for url-encoded variables (e.g. used by Flash)<br />
    * Fixes Strict-not-equal? of integers and adds != and !== operators </p>
<div class='wp_likes' id='wp_likes_post-6558'>
<div style='display:none' class='text'><b>0</b> people like this post.</div>
<div><a href=' javascript:wp_likes.like(6558)' class='like' title='like this post'>Like</a>&nbsp;<img class='loader' src='http://reboltutorial.com/wp-content/plugins/wp-likes/images/spinner.gif' alt=''/></div>
</div>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark this</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http://reboltutorial.com/blog/prepare-for-the-next-big-bang-release-odbc-use-rebol-with-ms-access-wow-sslhttps/&amp;submitHeadline=Prepare+for+the+next+Big+Bang+Release%3A+ODBC+%28use+Rebol+with+MS+Access+Wow+%21%21%21%29%2CSSL%2FHTTPS%2C%26%238230%3B&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://reboltutorial.com/blog/prepare-for-the-next-big-bang-release-odbc-use-rebol-with-ms-access-wow-sslhttps/&amp;title=Prepare+for+the+next+Big+Bang+Release%3A+ODBC+%28use+Rebol+with+MS+Access+Wow+%21%21%21%29%2CSSL%2FHTTPS%2C%26%238230%3B" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://reboltutorial.com/blog/prepare-for-the-next-big-bang-release-odbc-use-rebol-with-ms-access-wow-sslhttps/&amp;title=Prepare+for+the+next+Big+Bang+Release%3A+ODBC+%28use+Rebol+with+MS+Access+Wow+%21%21%21%29%2CSSL%2FHTTPS%2C%26%238230%3B" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://reboltutorial.com/blog/prepare-for-the-next-big-bang-release-odbc-use-rebol-with-ms-access-wow-sslhttps/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://reboltutorial.com/blog/prepare-for-the-next-big-bang-release-odbc-use-rebol-with-ms-access-wow-sslhttps/&amp;title=Prepare+for+the+next+Big+Bang+Release%3A+ODBC+%28use+Rebol+with+MS+Access+Wow+%21%21%21%29%2CSSL%2FHTTPS%2C%26%238230%3B" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://reboltutorial.com/blog/prepare-for-the-next-big-bang-release-odbc-use-rebol-with-ms-access-wow-sslhttps/&amp;bm_description=Prepare+for+the+next+Big+Bang+Release%3A+ODBC+%28use+Rebol+with+MS+Access+Wow+%21%21%21%29%2CSSL%2FHTTPS%2C%26%238230%3B" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http://reboltutorial.com/blog/prepare-for-the-next-big-bang-release-odbc-use-rebol-with-ms-access-wow-sslhttps/&amp;T=Prepare+for+the+next+Big+Bang+Release%3A+ODBC+%28use+Rebol+with+MS+Access+Wow+%21%21%21%29%2CSSL%2FHTTPS%2C%26%238230%3B" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://reboltutorial.com/blog/prepare-for-the-next-big-bang-release-odbc-use-rebol-with-ms-access-wow-sslhttps/&amp;title=Prepare+for+the+next+Big+Bang+Release%3A+ODBC+%28use+Rebol+with+MS+Access+Wow+%21%21%21%29%2CSSL%2FHTTPS%2C%26%238230%3B" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://reboltutorial.com/blog/prepare-for-the-next-big-bang-release-odbc-use-rebol-with-ms-access-wow-sslhttps/&amp;title=Prepare+for+the+next+Big+Bang+Release%3A+ODBC+%28use+Rebol+with+MS+Access+Wow+%21%21%21%29%2CSSL%2FHTTPS%2C%26%238230%3B" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://reboltutorial.com/blog/prepare-for-the-next-big-bang-release-odbc-use-rebol-with-ms-access-wow-sslhttps/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http://reboltutorial.com/blog/prepare-for-the-next-big-bang-release-odbc-use-rebol-with-ms-access-wow-sslhttps/" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Prepare+for+the+next+Big+Bang+Release%3A+ODBC+%28use+Rebol+with+MS+Access+Wow+%21%21%21%29%2CSSL%2FHTTPS%2C%26%238230%3B+@+http://reboltutorial.com/blog/prepare-for-the-next-big-bang-release-odbc-use-rebol-with-ms-access-wow-sslhttps/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://reboltutorial.com/blog/prepare-for-the-next-big-bang-release-odbc-use-rebol-with-ms-access-wow-sslhttps/&amp;t=Prepare+for+the+next+Big+Bang+Release%3A+ODBC+%28use+Rebol+with+MS+Access+Wow+%21%21%21%29%2CSSL%2FHTTPS%2C%26%238230%3B" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://reboltutorial.com/blog/prepare-for-the-next-big-bang-release-odbc-use-rebol-with-ms-access-wow-sslhttps/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to pass Arguments from PHP to Rebol CGI (PHP/REBOL RPC)</title>
		<link>http://reboltutorial.com/blog/how-to-pass-arguments-from-php-to-rebol-cgi-phprebol-rpc/</link>
		<comments>http://reboltutorial.com/blog/how-to-pass-arguments-from-php-to-rebol-cgi-phprebol-rpc/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 11:31:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[All]]></category>

		<category><![CDATA[Internet]]></category>

		<category><![CDATA[Interoperability]]></category>

		<category><![CDATA[Language]]></category>

		<category><![CDATA[Protocol]]></category>

		<category><![CDATA[Web Services]]></category>

		<category><![CDATA[cgi]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://reboltutorial.com/?p=6352</guid>
		<description><![CDATA[PHP is everywhere, it has a huge Ecosystem of Libraries (like User&#8217;s Session Management, Security, &#8230;) which are still lacking in REBOL (though Rebol has all the network protocols and the very nice Parse to process strings, building a well-organised reusable framework takes time), so it makes sense to use PHP as Front-End to the [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://reboltutorial.com/files/2009/12/php.gif" alt="php" width="127" height="147" class="alignleft size-full wp-image-6360" />PHP is everywhere, it has a huge <a href="http://reboltutorial.com/blog/r3/" target="_blank">Ecosystem of Libraries (like User&#8217;s Session Management, Security, &#8230;) which are still lacking in REBOL</a> (though Rebol has all the network protocols and the very nice Parse to process strings, building a well-organised reusable framework takes time), so it makes sense to use PHP as Front-End to the External World by wrapping REBOL Objects - which would be considered to reside in the Business Layer in an Enterprise Application Architecture - and communicate between the two using a kind of <a href="http://en.wikipedia.org/wiki/Remote_procedure_call" target="_blank">RPC</a> - instead of Web Services for better performance and integration when we can have control of both sides.</p>
<p>We have in fact already seen <a href="http://reboltutorial.com/blog/how-to-include-rebol-cgi-within-php/" target="_blank">how to call a Rebol CGI from PHP</a>, it&#8217;s now time to look at message passing from PHP to Rebol (the return message stays the same: the output of Linux/Windows standard I/O).</p>
<p>Let&#8217;s take the example of a search form. Instead of posting to Rebol CGI from the html form embedded in an HTML Page like this:</p>
<pre class="brush: html;">
	&lt;form method=&quot;get&quot; id=&quot;searchform_bottom&quot; action=&quot;search.cgi&quot;&gt;
            &lt;div&gt;
                &lt;input type=&quot;text&quot; value=&quot;&quot; size=&quot;41&quot; name=&quot;s&quot; /&gt;
				&lt;input type=&quot;submit&quot; id=&quot;searchsubmit_bottom&quot; value=&quot;Search&quot; /&gt;

            &lt;/div&gt;
        &lt;/form&gt;
</pre>
<p>We would put the form in an index.php page and call the same index.php from the form</p>
<pre class="brush: html;">
	&lt;form method=&quot;get&quot; id=&quot;searchform_bottom&quot; action=&quot;index.php&quot;&gt;
            &lt;div&gt;
                &lt;input type=&quot;text&quot; value=&quot;&quot; size=&quot;41&quot; name=&quot;s&quot; /&gt;
				&lt;input type=&quot;submit&quot; id=&quot;searchsubmit_bottom&quot; value=&quot;Search&quot; /&gt;

            &lt;/div&gt;
        &lt;/form&gt;
</pre>
<p>then within index.php we would test for the existence of the $_GET['s'] variable or not and forward to search.cgi passing the search term and any other other parameters we want by separating them with space, for example below, we also pass the command &#8220;search&#8221; at the end (this could be usefull if we have several kind of actions):</p>
<pre class="brush: php;">
&lt;?php
if (!isset($_GET['s'])) {
  $command= './cgi-bin/index.cgi';
  echo system($command);
}
else {
  $searchterm = $_GET['s'];
  $command= './search.cgi '. '&quot;' . $searchterm . '&quot;' . ' ' . '&quot;' . 'search' . '&quot;';
  echo system($command);
}
?&gt;
</pre>
<p>On Rebol&#8217;s side we just have to pick the search term from the first element of system/options/args block (Rebol&#8217;s array):</p>
<pre><code>
#!/home/yourhostingaccount/yourdomain/rebol/rebol -c
REBOL [Title: "Search"]
  command-line: system/options/args
  search-term: pick command-line  1
]
</code></pre>
<p>If we want we could even make the script work in both context RPC or CGI by testing system/options/cgi/remote-addr:</p>
<pre><code>
#!/home/yourhostingaccount/yourdomain/rebol/rebol -c
REBOL [Title: "Search"]

test-remote: system/options/cgi/remote-addr;
;write/<a href="http://www.rebol.com/docs/words/wappend.html" target='_blank' rel='nofollow'>append</a>/lines %log.txt mold test-remote
;write/<a href="http://www.rebol.com/docs/words/wappend.html" target='_blank' rel='nofollow'>append</a>/lines %log.txt mold system/options/args

if/else (none? test-remote) [
  command-line: system/options/args
  search-term: pick command-line  1
][
  print "content-type: text/html^/"
  ;==========================
  do %cgi.lib.r
  cgi: get-cgi
  ;write/<a href="http://www.rebol.com/docs/words/wappend.html" target='_blank' rel='nofollow'>append</a>/lines %log.txt mold cgi
  ;==========================
  search-term: cgi/s
  ;write %log.txt search-term
]
</code></pre>
<p>Of course this is just the basis of RPC between PHP and Rebol. A more standard serialization format could be defined furthermore using Rebol format or any other like JSON.</p>
<p>This is simple and flexible so that mixing PHP and Rebol should be a pleasure for both lovers of one language or the other while ripping the benefits from both sides : no more languages war :).</p>
<p><img src="http://reboltutorial.com/files/2009/12/php.jpg" alt="php" width="0" height="0" class="alignleft size-full wp-image-6369" /> </p>
<div class='wp_likes' id='wp_likes_post-6352'>
<div style='display:none' class='text'><b>0</b> people like this post.</div>
<div><a href=' javascript:wp_likes.like(6352)' class='like' title='like this post'>Like</a>&nbsp;<img class='loader' src='http://reboltutorial.com/wp-content/plugins/wp-likes/images/spinner.gif' alt=''/></div>
</div>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark this</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http://reboltutorial.com/blog/how-to-pass-arguments-from-php-to-rebol-cgi-phprebol-rpc/&amp;submitHeadline=How+to+pass+Arguments+from+PHP+to+Rebol+CGI+%28PHP%2FREBOL+RPC%29&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://reboltutorial.com/blog/how-to-pass-arguments-from-php-to-rebol-cgi-phprebol-rpc/&amp;title=How+to+pass+Arguments+from+PHP+to+Rebol+CGI+%28PHP%2FREBOL+RPC%29" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://reboltutorial.com/blog/how-to-pass-arguments-from-php-to-rebol-cgi-phprebol-rpc/&amp;title=How+to+pass+Arguments+from+PHP+to+Rebol+CGI+%28PHP%2FREBOL+RPC%29" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://reboltutorial.com/blog/how-to-pass-arguments-from-php-to-rebol-cgi-phprebol-rpc/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://reboltutorial.com/blog/how-to-pass-arguments-from-php-to-rebol-cgi-phprebol-rpc/&amp;title=How+to+pass+Arguments+from+PHP+to+Rebol+CGI+%28PHP%2FREBOL+RPC%29" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://reboltutorial.com/blog/how-to-pass-arguments-from-php-to-rebol-cgi-phprebol-rpc/&amp;bm_description=How+to+pass+Arguments+from+PHP+to+Rebol+CGI+%28PHP%2FREBOL+RPC%29" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http://reboltutorial.com/blog/how-to-pass-arguments-from-php-to-rebol-cgi-phprebol-rpc/&amp;T=How+to+pass+Arguments+from+PHP+to+Rebol+CGI+%28PHP%2FREBOL+RPC%29" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://reboltutorial.com/blog/how-to-pass-arguments-from-php-to-rebol-cgi-phprebol-rpc/&amp;title=How+to+pass+Arguments+from+PHP+to+Rebol+CGI+%28PHP%2FREBOL+RPC%29" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://reboltutorial.com/blog/how-to-pass-arguments-from-php-to-rebol-cgi-phprebol-rpc/&amp;title=How+to+pass+Arguments+from+PHP+to+Rebol+CGI+%28PHP%2FREBOL+RPC%29" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://reboltutorial.com/blog/how-to-pass-arguments-from-php-to-rebol-cgi-phprebol-rpc/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http://reboltutorial.com/blog/how-to-pass-arguments-from-php-to-rebol-cgi-phprebol-rpc/" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+How+to+pass+Arguments+from+PHP+to+Rebol+CGI+%28PHP%2FREBOL+RPC%29+@+http://reboltutorial.com/blog/how-to-pass-arguments-from-php-to-rebol-cgi-phprebol-rpc/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://reboltutorial.com/blog/how-to-pass-arguments-from-php-to-rebol-cgi-phprebol-rpc/&amp;t=How+to+pass+Arguments+from+PHP+to+Rebol+CGI+%28PHP%2FREBOL+RPC%29" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://reboltutorial.com/blog/how-to-pass-arguments-from-php-to-rebol-cgi-phprebol-rpc/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Why Rebol is the most Misunderstood Language and Not Javascript anymore</title>
		<link>http://reboltutorial.com/blog/why-rebol-is-the-most-misunderstood-language-and-not-javascript-anymore/</link>
		<comments>http://reboltutorial.com/blog/why-rebol-is-the-most-misunderstood-language-and-not-javascript-anymore/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 16:47:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[All]]></category>

		<category><![CDATA[Business]]></category>

		<category><![CDATA[Marketing]]></category>

		<guid isPermaLink="false">http://reboltutorial.com/?p=6314</guid>
		<description><![CDATA[I was new to Rebol nearly one year ago (I didn&#8217;t count past years as I just didn&#8217;t try to go really deep into the language), since this is the end of the year, I can now try to tell what I think about it.
I will inspire from Douglas Crockford, who told that Rebol had [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://reboltutorial.com/files/2009/12/strategy.jpg" alt="strategy" width="120" height="89" class="alignleft size-full wp-image-6326" />I was new to Rebol nearly one year ago (I didn&#8217;t count past years as I just didn&#8217;t try to go really deep into the language), since this is the end of the year, I can now try to tell what I think about it.</p>
<p>I will inspire from Douglas Crockford, who told that <a href="http://reboltutorial.com/blog/it-marketing/" target="_blank">Rebol had been part of JSON inspiration</a> and who has written in the past this famous article on Javascript: <a href="http://www.crockford.com/javascript/javascript.html" target="_blank">&#8220;Why Javascript is the most misunderstood language&#8221;</a>, since Javascript has now won a huge gain in respect, the most misunderstood language is now Rebol. Is it for the same reasons ?</p>
<p><strong>The Name</strong></p>
<p><strong>Rebol</strong> is the acronym of <strong>Relative Expression Based Object Language</strong> and also associated with the &#8220;Rebolution&#8221; slogan. Nice name and slogan which would perfectly suit the Geeks mentality. So for me the problem didn&#8217;t come from the name, it did come from the unrealistic goal to pretend that Rebol could be everywhere. Instead of showing how on Real World Projects, there were just bold claims. This is Marketing 101: Don&#8217;t tell, Show. The World is still waiting for the Rebolution to demonstrate let&#8217;s say that a Twitter clone in Rebol could support massive concurrent users :).</p>
<p><strong><del datetime="2009-12-22T15:47:54+00:00">Lisp in C&#8217;s Clothing</del> (for Javascript) - Lisp without Clunky Parenthesis</strong><br />
Rebol is explicitely descending from Lisp with a much more expressive syntax. That was also a good point for Rebol so why did it fail to attract people on that ? Rebol didn&#8217;t target IT professionals, it did try to target the average hobbyists pretending that the language was easy. In truth on the surface Rebol is easy but as you try to go deeper, things become harder because in concepts, Lisp and <a href="http://reboltutorial.com/blog/map-reduce-functions-in-rebol-towards-massive-parallel-functional-programming-part-i/" target="_blank">Functional Programming</a> mixed with <a href="http://reboltutorial.com/blog/reflection/" target="_blank">OOP</a> is not for the faint-hearted. Instead of explaining the hard concepts, all documentation tend to just explain the easy ones, guarding the &#8220;secrets&#8221; for the &#8220;smarts&#8221; who would dare to ask the right questions. Whereas <a href="http://reboltutorial.com/blog/create-rebol-gui/" target='_blank' rel='nofollow'>VID</a>/<a href="http://www.antigrain.com/" target="_blank" rel="nofollow">AGG</a> are really the Gems in Rebol with the <a href="http://www.rebol.com/docs/core23/rebolcore-15.html" target='_blank' rel='nofollow'>Parse Function</a>, the <a href="http://reboltutorial.com/blog/create-rebol-gui/" target='_blank' rel='nofollow'>VID</a> documentation is the most lacking on that point so that even attempting to create a simple centered dialog box is difficult not because it&#8217;s impossible but because it isn&#8217;t explained anywhere, you have to try to understand by yourself by looking at the source code of the editor (supposing you discovered how) and in fact I encountered some problem that is still unsolved. As for <a href="http://www.antigrain.com/" target="_blank" rel="nofollow">AGG</a> of course, you can expect even less - to say the least :).</p>
<p><strong>Not Opensource</strong> I&#8217;m not so much naïve as to believe that the Opensource movement is only a spontaneous group of benevolent people because in Economics History, deflating the price of goods is a well-known scheme from the Big Capitalists to kill their numerous small competitors before they soar the price again or drive the investment towards another large scale sector they will be the only one to control (Oil in the past, Cloud-Computing tomorrow) so I&#8217;m not the one who would blindly say: go Opensource. The reason to go Opensource is due to this huge Marketing Scheme that these same Software Giants Oligopoly  have setup behind the scene that is killing yourself financially little by little if you don&#8217;t want to follow the same path. Not going Opensource means a Heavy Cost for promoting your product because you cannot make free publicity. Since Marketing Cost is much larger in proportion than Production Cost for many successfull companies, you won&#8217;t be able to finance any growth. Not going fully Opensource or at least not giving &#8220;enough&#8221; to the Opensource Product from the commercial product is not a clear message for the Opensource lovers, that may be yet another mistake.</p>
<p><strong>Targeting Language/Virtual OS Platform Market</strong>. Yesterday Rebol&#8217;s ambition was to be an Ubiquitous Language or maybe worst to be a Virtual OS Platform. A Language has no perceived value today only Reusable Frameworks and Libraries (look at Jquery and its <a href="http://events.jquery.com/jquery-conference-2009/" target="_blank">sponsors</a> once again or PHP Zend Framework). OS Platforms are only for the Big Names, we know them already: Java VM (not the language) and .NET (once again not the languages). Instead of creating an &#8220;IronRebol&#8221; like an IronPython, IronRuby, Clojure or Scala, Rebol still pretends to be multiplatform. Being Multiplatform without being able to integrate with the two main Virtual OS Platforms is not really multiplatform in my opinion. This is for me the number One Strategic error. Not exploiting the Ecosystem of Dynamic Languages that are now openly favored by both the Giants Sun and Microsoft (see <a href="http://en.wikipedia.org/wiki/Dynamic_Language_Runtime" target="_blank">Microsoft DLR initiative</a> for example) will be a huge mistake because as usual time is your number One Ennemy and the door may close soon as the Winners will be emerging from this new Competitive race. And I almost forget that this also would save hugely on Marketing cost.</p>
<p>There are many other things, some I said in other articles or section but to make things short, I will now jump to the conclusion: Rebol is worth a look for sure and I will continue to do so, but its Business Strategy is just not really marketable in its current state. A 180° turn is needed, so not easy but not quite impossible yet, I still believe :).</p>
<div><b>1</b> people like this post.</div>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark this</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http://reboltutorial.com/blog/why-rebol-is-the-most-misunderstood-language-and-not-javascript-anymore/&amp;submitHeadline=Why+Rebol+is+the+most+Misunderstood+Language+and+Not+Javascript+anymore&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://reboltutorial.com/blog/why-rebol-is-the-most-misunderstood-language-and-not-javascript-anymore/&amp;title=Why+Rebol+is+the+most+Misunderstood+Language+and+Not+Javascript+anymore" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://reboltutorial.com/blog/why-rebol-is-the-most-misunderstood-language-and-not-javascript-anymore/&amp;title=Why+Rebol+is+the+most+Misunderstood+Language+and+Not+Javascript+anymore" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://reboltutorial.com/blog/why-rebol-is-the-most-misunderstood-language-and-not-javascript-anymore/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://reboltutorial.com/blog/why-rebol-is-the-most-misunderstood-language-and-not-javascript-anymore/&amp;title=Why+Rebol+is+the+most+Misunderstood+Language+and+Not+Javascript+anymore" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://reboltutorial.com/blog/why-rebol-is-the-most-misunderstood-language-and-not-javascript-anymore/&amp;bm_description=Why+Rebol+is+the+most+Misunderstood+Language+and+Not+Javascript+anymore" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http://reboltutorial.com/blog/why-rebol-is-the-most-misunderstood-language-and-not-javascript-anymore/&amp;T=Why+Rebol+is+the+most+Misunderstood+Language+and+Not+Javascript+anymore" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://reboltutorial.com/blog/why-rebol-is-the-most-misunderstood-language-and-not-javascript-anymore/&amp;title=Why+Rebol+is+the+most+Misunderstood+Language+and+Not+Javascript+anymore" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://reboltutorial.com/blog/why-rebol-is-the-most-misunderstood-language-and-not-javascript-anymore/&amp;title=Why+Rebol+is+the+most+Misunderstood+Language+and+Not+Javascript+anymore" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://reboltutorial.com/blog/why-rebol-is-the-most-misunderstood-language-and-not-javascript-anymore/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http://reboltutorial.com/blog/why-rebol-is-the-most-misunderstood-language-and-not-javascript-anymore/" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Why+Rebol+is+the+most+Misunderstood+Language+and+Not+Javascript+anymore+@+http://reboltutorial.com/blog/why-rebol-is-the-most-misunderstood-language-and-not-javascript-anymore/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://reboltutorial.com/blog/why-rebol-is-the-most-misunderstood-language-and-not-javascript-anymore/&amp;t=Why+Rebol+is+the+most+Misunderstood+Language+and+Not+Javascript+anymore" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://reboltutorial.com/blog/why-rebol-is-the-most-misunderstood-language-and-not-javascript-anymore/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Protecting against Other Libraries Hell and set-once function</title>
		<link>http://reboltutorial.com/blog/protecting-against-other-libraries-hell/</link>
		<comments>http://reboltutorial.com/blog/protecting-against-other-libraries-hell/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 19:51:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[All]]></category>

		<category><![CDATA[Helper Function]]></category>

		<guid isPermaLink="false">http://reboltutorial.com/?p=6243</guid>
		<description><![CDATA[Rebol has a Protect function which allows your function to be redefined either by yourself or someone else. For example, I have a bunch of libraries that I preload in user.r like the zip library, when testing another script, I don&#8217;t want that my own zip library risks to be overrided so I can use [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://reboltutorial.com/files/2009/12/hell.jpg" alt="hell" width="120" height="90" class="alignleft size-full wp-image-6256" />Rebol has a Protect function which allows your function to be redefined either by yourself or someone else. For example, I have a bunch of libraries that I preload in <a href="http://reboltutorial.com/blog/what-is-my-userr-and-where-is-it-stored/" target='_blank' rel='nofollow'>user.r</a> like the zip library, when testing another script, I don&#8217;t want that my own zip library risks to be overrided so I can use the protect function like this:</p>
<pre><code>
protect 'zip
</code></pre>
<p>The problem is I may myself need this library somewhere else by reloading it in some script and this will create this disgracefull interruption:</p>
<pre><code>
** Script Error: Word zip is protected, cannot modify
</code></pre>
<p>So as to avoid this problem, I have created this <strong>set-once</strong> function:</p>
<pre><code>
set-once: func[word [word!] value /verbose][
    if/else error? error: try [set word value][
        disarm error
        if verbose [
            print [ "cannot set" word]
            none
        ]
    ][value]
]
</code></pre>
<p>This function will either return the value or none if the word is protected:</p>
<pre><code>
&gt;&gt; set-once/verbose 'zip "test"
cannot set zip
== none
&gt;&gt;
</code></pre>
<p>This doesn&#8217;t solve all problems and the best would be to override the set function but it will be for next time as it&#8217;s too tedious to do so in current version of Rebol when there are multiple refinements (see <a href="http://reboltutorial.com/blog/creating-a-natural-syntax-style-with-the-implicit-it-variable-and-how-to-override-the-native-functions/" target="_blank">here</a>).
 </p>
<div class='wp_likes' id='wp_likes_post-6243'>
<div style='display:none' class='text'><b>0</b> people like this post.</div>
<div><a href=' javascript:wp_likes.like(6243)' class='like' title='like this post'>Like</a>&nbsp;<img class='loader' src='http://reboltutorial.com/wp-content/plugins/wp-likes/images/spinner.gif' alt=''/></div>
</div>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark this</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http://reboltutorial.com/blog/protecting-against-other-libraries-hell/&amp;submitHeadline=Protecting+against+Other+Libraries+Hell+and+set-once+function&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://reboltutorial.com/blog/protecting-against-other-libraries-hell/&amp;title=Protecting+against+Other+Libraries+Hell+and+set-once+function" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://reboltutorial.com/blog/protecting-against-other-libraries-hell/&amp;title=Protecting+against+Other+Libraries+Hell+and+set-once+function" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://reboltutorial.com/blog/protecting-against-other-libraries-hell/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://reboltutorial.com/blog/protecting-against-other-libraries-hell/&amp;title=Protecting+against+Other+Libraries+Hell+and+set-once+function" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://reboltutorial.com/blog/protecting-against-other-libraries-hell/&amp;bm_description=Protecting+against+Other+Libraries+Hell+and+set-once+function" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http://reboltutorial.com/blog/protecting-against-other-libraries-hell/&amp;T=Protecting+against+Other+Libraries+Hell+and+set-once+function" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://reboltutorial.com/blog/protecting-against-other-libraries-hell/&amp;title=Protecting+against+Other+Libraries+Hell+and+set-once+function" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://reboltutorial.com/blog/protecting-against-other-libraries-hell/&amp;title=Protecting+against+Other+Libraries+Hell+and+set-once+function" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://reboltutorial.com/blog/protecting-against-other-libraries-hell/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http://reboltutorial.com/blog/protecting-against-other-libraries-hell/" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Protecting+against+Other+Libraries+Hell+and+set-once+function+@+http://reboltutorial.com/blog/protecting-against-other-libraries-hell/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://reboltutorial.com/blog/protecting-against-other-libraries-hell/&amp;t=Protecting+against+Other+Libraries+Hell+and+set-once+function" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://reboltutorial.com/blog/protecting-against-other-libraries-hell/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A nice interactive editor to create Javascript Objects Fast (with or without Object Prototype)</title>
		<link>http://reboltutorial.com/blog/a-nice-interactive-editor-to-create-javascript-objects-fast/</link>
		<comments>http://reboltutorial.com/blog/a-nice-interactive-editor-to-create-javascript-objects-fast/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 15:16:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Agility]]></category>

		<category><![CDATA[All]]></category>

		<category><![CDATA[Code Generation]]></category>

		<category><![CDATA[Console]]></category>

		<category><![CDATA[Domain Specific Language]]></category>

		<category><![CDATA[Helper Function]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[framework]]></category>

		<guid isPermaLink="false">http://reboltutorial.com/?p=6218</guid>
		<description><![CDATA[As David Crockford puts it JavaScript&#8217;s syntax looks like &#8220;C-like syntax, including curly braces and the clunky for statement&#8221;. So here&#8217;s a nice interactive editor to alleviate the clunly stuffs by allowing you to create a Javascript Object by just typing:

to-js Product

or for a more refined version (see at the end of the article):

to-js/prototype Product

where [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://reboltutorial.com/files/2009/12/javascript-object.jpg" alt="javascript-object" width="120" height="90" class="alignleft size-full wp-image-6221" />As <a href="http://javascript.crockford.com/javascript.html" target="_blank">David Crockford</a> puts it JavaScript&#8217;s syntax looks like <strong>&#8220;C-like syntax, including curly braces and the clunky for statement&#8221;</strong>. So here&#8217;s a nice interactive editor to alleviate the clunly stuffs by allowing you to create a Javascript Object by just typing:</p>
<pre><code>
to-js Product
</code></pre>
<p>or for a more refined version (see at the end of the article):</p>
<pre><code>
to-js/prototype Product
</code></pre>
<p>where Product is just an example of an Object you will create by typing minimistically:</p>
<pre><code>
Class Product [
   Id: 1
   ProductName: "Orange"
]
</code></pre>
<p>The result will be copied directly to the clipboard with a nicely indented javascript code:</p>
<pre class="brush: javascript;">
function Product() {

	this.Id=1;
	this.ProductName=&quot;Orange&quot;;

	this.getId = function() {
		return this.Id;
	}

	this.getProductName = function() {
		return this.ProductName;
	}

}
</pre>
<p>The source code to generate js code is below and you can adapt it furthermore to suit your own coding style (see at the end a more refined version for prototype):</p>
<pre><code>
to-js: func['ObjectName [Word!] /local Obj body javascript-code][

  if not value? 'class [
      ;load oop library
      do http://reboltutorial.com/oop
  ]

  Obj: get ObjectName
  Body: third Obj

  javascript-code: <a href="http://www.rebol.com/docs/words/wrejoin.html" target='_blank' rel='nofollow'>rejoin</a> [
    "function " ObjectName "() {"
     newline newline
  ]

  Foreach [property value] Body [
    if (type? value) = string! [
        value: <a href="http://www.rebol.com/docs/words/wrejoin.html" target='_blank' rel='nofollow'>rejoin</a> [{"} value {"}]
    ]
    <a href="http://www.rebol.com/docs/words/wappend.html" target='_blank' rel='nofollow'>append</a> javascript-code <a href="http://www.rebol.com/docs/words/wrejoin.html" target='_blank' rel='nofollow'>rejoin</a> [
      tab "this." property "=" value ";" newline
    ]
  ]

  <a href="http://www.rebol.com/docs/words/wappend.html" target='_blank' rel='nofollow'>append</a> javascript-code <a href="http://www.rebol.com/docs/words/wrejoin.html" target='_blank' rel='nofollow'>rejoin</a> [newline]

  Foreach [property value] Body [
    <a href="http://www.rebol.com/docs/words/wappend.html" target='_blank' rel='nofollow'>append</a> javascript-code <a href="http://www.rebol.com/docs/words/wrejoin.html" target='_blank' rel='nofollow'>rejoin</a> [
      tab "this.get" property " = function() {" newline
      tab tab "return this." property ";" newline
      tab "}"
      newline
      newline
    ]
  ]

  <a href="http://www.rebol.com/docs/words/wappend.html" target='_blank' rel='nofollow'>append</a> javascript-code <a href="http://www.rebol.com/docs/words/wrejoin.html" target='_blank' rel='nofollow'>rejoin</a> ["}" newline]

  write clipboard:// javascript-code
]
</code></pre>
<p>The instruction  </p>
<pre><code>
do http://reboltutorial.com/oop
</code></pre>
<p>loads our <a href="http://reboltutorial.com/blog/creating-a-class-based-oop-language-adding-class-constructors-support/" target="_blank">class</a> and <a href="http://reboltutorial.com/blog/how-dynamically-extend-an-object/" target="_blank">extend function</a> to create our Product as already seen:</p>
<pre><code>
Class Product [
   Id: 1
   ProductName: "Orange"
]
</code></pre>
<p>Or add properties dynamically to your object before converting it with to-js:</p>
<pre><code>
extend Product [
    CategoryId: 1
]
to-js Product
</code></pre>
<p>which will then copy this js snippet to the clipboard:</p>
<pre class="brush: javascript;">
function Product() {

	this.Id=1;
	this.ProductName=&quot;Orange&quot;;
	this.CategoryId=1;

	this.getId = function() {
		return this.Id;
	}

	this.getProductName = function() {
		return this.ProductName;
	}

	this.getCategoryId = function() {
		return this.CategoryId;
	}

}
</pre>
<p>A more refined version of the script is to accept the prototype (or proto for shortcut) to be able to output the prototype syntax version:</p>
<pre><code>
to-js: func['ObjectName [Word!] /proto /Prototype /local Obj body javascript-code][

  if not value? 'class [
      ;load oop library
      do http://reboltutorial.com/oop
  ]

  Obj: get ObjectName
  Body: third Obj

  javascript-code: <a href="http://www.rebol.com/docs/words/wrejoin.html" target='_blank' rel='nofollow'>rejoin</a> [
    "function " ObjectName "() {"
     newline newline
  ]

  Foreach [property value] Body [
    if (type? value) = string! [
        value: <a href="http://www.rebol.com/docs/words/wrejoin.html" target='_blank' rel='nofollow'>rejoin</a> [{"} value {"}]
    ]
    <a href="http://www.rebol.com/docs/words/wappend.html" target='_blank' rel='nofollow'>append</a> javascript-code <a href="http://www.rebol.com/docs/words/wrejoin.html" target='_blank' rel='nofollow'>rejoin</a> [
      tab if/else (not any [proto prototype])
      [ "this"][rejoin [ObjectName ".prototype"]] "." property "=" value ";"
      newline
    ]
  ]

  <a href="http://www.rebol.com/docs/words/wappend.html" target='_blank' rel='nofollow'>append</a> javascript-code <a href="http://www.rebol.com/docs/words/wrejoin.html" target='_blank' rel='nofollow'>rejoin</a> [newline]

  Foreach [property value] Body [
    <a href="http://www.rebol.com/docs/words/wappend.html" target='_blank' rel='nofollow'>append</a> javascript-code <a href="http://www.rebol.com/docs/words/wrejoin.html" target='_blank' rel='nofollow'>rejoin</a> [
      tab if/else (not any [proto prototype])
      [ "this"][rejoin [ObjectName ".prototype"]]
      ".get" property " = function() {" newline
      tab tab "return this." property ";" newline
      tab "}"
      newline
      newline
    ]

  ]

  <a href="http://www.rebol.com/docs/words/wappend.html" target='_blank' rel='nofollow'>append</a> javascript-code <a href="http://www.rebol.com/docs/words/wrejoin.html" target='_blank' rel='nofollow'>rejoin</a> ["}" newline]

  write clipboard:// javascript-code
]

</code></pre>
<p>Output:</p>
<pre class="brush: javascript;">
function product() {

	product.prototype.Id=1;
	product.prototype.ProductName=&quot;Orange&quot;;

	product.prototype.getId = function() {
		return this.Id;
	}

	product.prototype.getProductName = function() {
		return this.ProductName;
	}

}
</pre>
<p>For a tutorial on Javascript OOP see for example <a href="http://www.phpmadesimple.info/2008/04/27/object-oriented-programming-with-javascript-before-prototype-jquery-or-extjs/" target="_blank" rel="nofollow">this article</a> or <a href="http://www.phpdevblog.net/2009/09/oop-in-javascript-part-1-writing-classes.html" target="_blank">this article</a>. </p>
<div><b>1</b> people like this post.</div>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark this</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http://reboltutorial.com/blog/a-nice-interactive-editor-to-create-javascript-objects-fast/&amp;submitHeadline=A+nice+interactive+editor+to+create+Javascript+Objects+Fast+%28with+or+without+Object+Prototype%29&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://reboltutorial.com/blog/a-nice-interactive-editor-to-create-javascript-objects-fast/&amp;title=A+nice+interactive+editor+to+create+Javascript+Objects+Fast+%28with+or+without+Object+Prototype%29" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://reboltutorial.com/blog/a-nice-interactive-editor-to-create-javascript-objects-fast/&amp;title=A+nice+interactive+editor+to+create+Javascript+Objects+Fast+%28with+or+without+Object+Prototype%29" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://reboltutorial.com/blog/a-nice-interactive-editor-to-create-javascript-objects-fast/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://reboltutorial.com/blog/a-nice-interactive-editor-to-create-javascript-objects-fast/&amp;title=A+nice+interactive+editor+to+create+Javascript+Objects+Fast+%28with+or+without+Object+Prototype%29" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://reboltutorial.com/blog/a-nice-interactive-editor-to-create-javascript-objects-fast/&amp;bm_description=A+nice+interactive+editor+to+create+Javascript+Objects+Fast+%28with+or+without+Object+Prototype%29" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http://reboltutorial.com/blog/a-nice-interactive-editor-to-create-javascript-objects-fast/&amp;T=A+nice+interactive+editor+to+create+Javascript+Objects+Fast+%28with+or+without+Object+Prototype%29" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://reboltutorial.com/blog/a-nice-interactive-editor-to-create-javascript-objects-fast/&amp;title=A+nice+interactive+editor+to+create+Javascript+Objects+Fast+%28with+or+without+Object+Prototype%29" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://reboltutorial.com/blog/a-nice-interactive-editor-to-create-javascript-objects-fast/&amp;title=A+nice+interactive+editor+to+create+Javascript+Objects+Fast+%28with+or+without+Object+Prototype%29" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://reboltutorial.com/blog/a-nice-interactive-editor-to-create-javascript-objects-fast/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http://reboltutorial.com/blog/a-nice-interactive-editor-to-create-javascript-objects-fast/" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+A+nice+interactive+editor+to+create+Javascript+Objects+Fast+%28with+or+without+Object+Prototype%29+@+http://reboltutorial.com/blog/a-nice-interactive-editor-to-create-javascript-objects-fast/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://reboltutorial.com/blog/a-nice-interactive-editor-to-create-javascript-objects-fast/&amp;t=A+nice+interactive+editor+to+create+Javascript+Objects+Fast+%28with+or+without+Object+Prototype%29" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://reboltutorial.com/blog/a-nice-interactive-editor-to-create-javascript-objects-fast/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to read and parse your environment variables (System32, Java_Home, Classpath, Path&#8230;)</title>
		<link>http://reboltutorial.com/blog/how-to-read-and-parse-your-environment-variables-system32-java_home-classpath-path/</link>
		<comments>http://reboltutorial.com/blog/how-to-read-and-parse-your-environment-variables-system32-java_home-classpath-path/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 17:04:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[All]]></category>

		<category><![CDATA[Configuration]]></category>

		<category><![CDATA[Console]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[Setup]]></category>

		<category><![CDATA[Shell]]></category>

		<category><![CDATA[Syntax]]></category>

		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://reboltutorial.com/?p=6137</guid>
		<description><![CDATA[Rebol has a native get-env function to read environment variables. For example, to test if your JAVA_HOME  (JDK installation directory), CLASSPATH (for Java imports), CATALINA_HOME (for Tomcat) environment variables have been set, type in Rebol Console :

get-env "JAVA_HOME"
get-env "CLASSPATH"
get-env "JRE_HOME"
get-env "CATALINA_HOME"

To parse your environment variable, just use parse/all (do not forget /all otherwise space [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://reboltutorial.com/files/2009/12/environment.jpg" alt="environment" width="120" height="90" class="alignleft size-full wp-image-6147" />Rebol has a native <a href="www.rebol.com/r3/docs/functions/get-env.html" target="_blank" rel="nofollow">get-env</a> function to read environment variables. For example, to test if your JAVA_HOME  (JDK installation directory), CLASSPATH (for Java imports), CATALINA_HOME (for Tomcat) environment variables have been set, type in Rebol Console :</p>
<pre><code>
get-env "JAVA_HOME"
get-env "CLASSPATH"
get-env "JRE_HOME"
get-env "CATALINA_HOME"
</code></pre>
<p>To parse your environment variable, just use parse/all (do not forget /all otherwise space will be also taken as delimiter):</p>
<pre><code>
parse/all get-env "CLASSPATH" ";"
</code></pre>
<p>which will output something like this:</p>
<pre><code>
&gt;&gt; parse/all get-env "CLASSPATH" ";"
== ["." {t:\tomcat\lib\servlet.jar}]
</code></pre>
<p>So if you want to check that you did have current path &#8220;.&#8221; in your classpath, you would check it like this (do not omit /all refinement once again):</p>
<pre><code>
if none? find (parse/all get-env "CLASSPATH" ";") "." [
    print "Don't forget to add current path to your CLASSPATH ! "
]
</code></pre>
<p>Same if you want to check that you have added javac, java, PHP or whatever in your PATH environment variable:</p>
<pre><code>
if none? find (parse/all get-env "PATH" ";") "jdk" [
    print "Don't forget to add Javac dir in your PATH ! "
]

if none? find (parse/all get-env "PATH" ";") "jre" [
    print "Don't forget to add Java dir in your PATH ! "
]

if none? find (parse/all get-env "PATH" ";") "PHP" [
    print "Don't forget to add PHP dir in your PATH ! "
]
</code></pre>
<p>To ease the syntax, you can put this function in  your <a href="http://reboltutorial.com/blog/what-is-my-userr-and-where-is-it-stored/" target='_blank' rel='nofollow'>user.r</a> file:</p>
<pre><code>
check-env-path: func[what /local result][
    if/else none? result: find (parse/all get-env "PATH" ";") what [
        print [ <a href="http://www.rebol.com/docs/words/wrejoin.html" target='_blank' rel='nofollow'>rejoin</a> [{"} what {"}] "not found in your PATH Environment Variable ! "]
    ][print result]
]
</code></pre>
<p>and call it like this:</p>
<pre><code>
check-env-path "PHP"
</code></pre>
<p>which would output for example:</p>
<pre><code>
&gt;&gt; check-env-path "PHP"
"PHP" not found in your PATH Environment Variable !
&gt;&gt;
</code></pre>
<p>For a list of Windows Environment variables see <a href="http://vistaonwindows.com/environment_variables.html" target="_blank" rel="nofollow">Vista Environment Variables</a> and <a href="http://vlaurie.com/computers2/Articles/environment.htm" target="_blank" rel="nofollow">XP Environment Variables</a> (TEMP or TMP variable, &#8230;). For example, APPDATA may contain your Rebol <a href="http://reboltutorial.com/blog/what-is-my-userr-and-where-is-it-stored/" target="_blank">user.r</a> file depending on the version of Rebol and OS.</p>
<p>To get the path of Windows/System32 use this trick (does function is synonym of func without the need to pass arguments):</p>
<pre><code>
system32-dir: does [
    path: get-env "COMSPEC"
    until [(rest: back remove back tail path) =  "\"]
    head rest
]
</code></pre>
<p>So if want to call the Environment Variables Control Panel from Rebol Console, you could create this function:</p>
<pre><code>
env-panel: does[
    call <a href="http://www.rebol.com/docs/words/wrejoin.html" target='_blank' rel='nofollow'>rejoin</a> [ {"}  system32-dir "SystemPropertiesAdvanced.exe"  {"}]
]
</code></pre>
<p>And to call ODBC32 from Rebol Console, you could create this function:</p>
<pre><code>
ODBC32: does [
    call <a href="http://www.rebol.com/docs/words/wrejoin.html" target='_blank' rel='nofollow'>rejoin</a> [ {"}  system32-dir "odbcad32.exe"  {"}]
]
</code></pre>
</p>
<div class='wp_likes' id='wp_likes_post-6137'>
<div style='display:none' class='text'><b>0</b> people like this post.</div>
<div><a href=' javascript:wp_likes.like(6137)' class='like' title='like this post'>Like</a>&nbsp;<img class='loader' src='http://reboltutorial.com/wp-content/plugins/wp-likes/images/spinner.gif' alt=''/></div>
</div>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark this</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http://reboltutorial.com/blog/how-to-read-and-parse-your-environment-variables-system32-java_home-classpath-path/&amp;submitHeadline=How+to+read+and+parse+your+environment+variables+%28System32%2C+Java_Home%2C+Classpath%2C+Path%26%238230%3B%29&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://reboltutorial.com/blog/how-to-read-and-parse-your-environment-variables-system32-java_home-classpath-path/&amp;title=How+to+read+and+parse+your+environment+variables+%28System32%2C+Java_Home%2C+Classpath%2C+Path%26%238230%3B%29" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://reboltutorial.com/blog/how-to-read-and-parse-your-environment-variables-system32-java_home-classpath-path/&amp;title=How+to+read+and+parse+your+environment+variables+%28System32%2C+Java_Home%2C+Classpath%2C+Path%26%238230%3B%29" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://reboltutorial.com/blog/how-to-read-and-parse-your-environment-variables-system32-java_home-classpath-path/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://reboltutorial.com/blog/how-to-read-and-parse-your-environment-variables-system32-java_home-classpath-path/&amp;title=How+to+read+and+parse+your+environment+variables+%28System32%2C+Java_Home%2C+Classpath%2C+Path%26%238230%3B%29" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://reboltutorial.com/blog/how-to-read-and-parse-your-environment-variables-system32-java_home-classpath-path/&amp;bm_description=How+to+read+and+parse+your+environment+variables+%28System32%2C+Java_Home%2C+Classpath%2C+Path%26%238230%3B%29" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http://reboltutorial.com/blog/how-to-read-and-parse-your-environment-variables-system32-java_home-classpath-path/&amp;T=How+to+read+and+parse+your+environment+variables+%28System32%2C+Java_Home%2C+Classpath%2C+Path%26%238230%3B%29" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://reboltutorial.com/blog/how-to-read-and-parse-your-environment-variables-system32-java_home-classpath-path/&amp;title=How+to+read+and+parse+your+environment+variables+%28System32%2C+Java_Home%2C+Classpath%2C+Path%26%238230%3B%29" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://reboltutorial.com/blog/how-to-read-and-parse-your-environment-variables-system32-java_home-classpath-path/&amp;title=How+to+read+and+parse+your+environment+variables+%28System32%2C+Java_Home%2C+Classpath%2C+Path%26%238230%3B%29" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://reboltutorial.com/blog/how-to-read-and-parse-your-environment-variables-system32-java_home-classpath-path/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http://reboltutorial.com/blog/how-to-read-and-parse-your-environment-variables-system32-java_home-classpath-path/" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+How+to+read+and+parse+your+environment+variables+%28System32%2C+Java_Home%2C+Classpath%2C+Path%26%238230%3B%29+@+http://reboltutorial.com/blog/how-to-read-and-parse-your-environment-variables-system32-java_home-classpath-path/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://reboltutorial.com/blog/how-to-read-and-parse-your-environment-variables-system32-java_home-classpath-path/&amp;t=How+to+read+and+parse+your+environment+variables+%28System32%2C+Java_Home%2C+Classpath%2C+Path%26%238230%3B%29" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://reboltutorial.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://reboltutorial.com/blog/how-to-read-and-parse-your-environment-variables-system32-java_home-classpath-path/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
