<?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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>An eclectic-pencil blog &#187; programming tip</title>
	<atom:link href="http://plymouthreliable.com/blog/index.php/category/software-development/programming-tip/feed/" rel="self" type="application/rss+xml" />
	<link>http://plymouthreliable.com/blog</link>
	<description>A software developer&#039;s blog on all things Curl Surge RTE, Smalltalk Seaside, ICON UNICON, ObjectIcon, Rebol, Logtalk</description>
	<lastBuildDate>Mon, 10 May 2010 17:29:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Really cool Curl</title>
		<link>http://plymouthreliable.com/blog/2007/09/13/really-cool-curl/</link>
		<comments>http://plymouthreliable.com/blog/2007/09/13/really-cool-curl/#comments</comments>
		<pubDate>Thu, 13 Sep 2007 22:08:28 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Curl Surge]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[Tool tip]]></category>
		<category><![CDATA[programming tip]]></category>

		<guid isPermaLink="false">http://plymouthreliable.com/blog/2007/09/13/really-cool-curl/</guid>
		<description><![CDATA[I was pointing out JSForth to a developer on-line (Forth interpreter in JavaScript) which I thought was cool but then I see this in Curl: a folding coding window in a web page.
Here is the Curl 5.0 code for the applet:

{curl 5.0 applet}
{curl-file-attributes character-encoding = "windows-latin-1"}
{applet manifest = "manifest.mcurl"}

{include "./utils/guide-header.scurl"}
{include "./utils/support.scurl"}

   {x-example-ref
  [...]]]></description>
			<content:encoded><![CDATA[<p>I was pointing out JSForth to a developer on-line (Forth interpreter in JavaScript) which I thought was cool but then I see this in Curl: a folding coding window in a web page.</p>
<p>Here is the Curl 5.0 code for the applet:</p>
<blockquote><pre><code>
{curl 5.0 applet}
{curl-file-attributes character-encoding = "windows-latin-1"}
{applet manifest = "manifest.mcurl"}

{include "./utils/guide-header.scurl"}
{include "./utils/support.scurl"}

   {x-example-ref
        title = "Folding Tree example",
        {url "./examples/RIA_with_Curl.curl"}
    }</code></pre>
</blockquote>
<p>What this does is create a labeled hotspot on my page: with one click an entire Curl client-side scripting environment opens.  The running example is there; the code that is running is there; buttons to execute, save applet; revert changes; close popup &#8211; and the panel allows editing the script.</p>
<p>Clicking on &#8216;Execute&#8217; causes a popup version of the script to run with your changes.</p>
<p>I had seen this cool way of working with code as part of the <a href="http://eclectic-pencil.blogspot.com/2007/07/example-is-curl-developers-example.html">example</a> macro</p>
<blockquote><p>{example<br />
   &#8230;<br />
}
</p></blockquote>
<p>What was new was the &#8216;expandable&#8217; and &#8216;collapsible&#8217;.</p>
<p>I cannot imagine this being more concise in JavaFX or in Groovy. Here is the Curl procedure from the include file:</p>
<blockquote><pre><code>
|| Copyright (C) 1998-2006, Sumisho Computer Systems Corp.
|| All Rights Reserved.
{define-proc {x-example-ref
                 title:String = {message Example},
                 href:Url, ...}:Visual
    let display:Graphic = {example-ref title = title, href, ...}
    {for-each-graphic
        {proc {g:Graphic}:void
            {type-switch g
             case g:TextEditPanel do
                || consume right click, so TreeControl ignores it
                {g.add-event-handler
                    {on e:PointerPress do
                        {if e.button == right-button then
                            {e.consume}}}}}},
        display}
    {return
        {text-width-display
            {expandable
                border-width = 2px,
                {bold {value title}},
                display}}}
}
|| *** calls the following ***
{define-proc public {example-ref
                        loc:Url,
                        title:#String = null,
                        base-url:Url = {get-base-url},
                        manifest:ComponentManifest =
                           {get-default-manifest},
                        package:OpenPackage =
                            {OpenPackage
                                CURL.IMPLICIT.APPLET,
                                CURL.IDE.DOCUMENTATION,
                                manifest = manifest},
                        ...
                    }:Graphic
    let result:any =
        {try
            {evaluate
                base-url = loc,
                package = package,
                {format "\{example title = %w,\n %s\}",
                    title,
                    {read-from loc}}}
         catch e:Exception do
            {paragraph
                Error in {bold {value loc}}:{br}
                {text color = "red", {value e}}}}
    {return {Frame result, ...}}
}
</code></pre>
</blockquote>
<p>It is perfectly readable.  When you see &#8216;&#8230;&#8217; inside <strong>{ }</strong> what you are seeing are <strong>rest</strong> arguments, or unnamed arguments for variable parameter procedure calls.  And then again in the </p>
<blockquote><p>{ return {Frame result, &#8230;} }</p></blockquote>
<p> &#8211; these are not code elisions!  The critical <strong>{example }</strong> macro is in the <em>evaluate</em> block.  Dynamic language fans will note that the result is their preferred type: <strong>any</strong>.</p>
<p>And to learn to use this<em> expand/collapse &#8216;live&#8217; code environment/widget</em> all I had to do was right-click on a folding code-editor page in the Curl Documentation Viewer which is itself Curl.  I copied in the files to include for my applet and set a few imports in my &#8216;manifest.mcurl&#8217; file.  No CLASSPATH to look at, no question of which JARs are where.  No JavaScript library required. As cool as Smalltalk, Strongtalk or the XOTcl IDE.</p>
<p>To see one in action, you will need the XML Document Model for Curl 5.0 from <a href="http://www.curl.com">curl.com</a><br />
Just install the RTE, then the IDE and then the XDM.  Open your Documentation Viewer and search for &#8216;WSDK XML Document Model&#8217; or just &#8216;<em>build-xml</em>&#8216;</p>
<p>The <em>proc</em> identifies an anonymous procedure and we pass in what Groovy calls a &#8216;closure&#8217; at <em>on e:PointerPress do</em> or what would likely be an inner class Listener in Java.</p>
<p>If you know something as cool using FLASH with ActionScript, post a snippet or a link to same.<br />
Of course you could do this using AJAX with Prototype and Scriptaculous.  But I got this page out in a matter of minutes.  Oh yes, Sun says JavaFX is not about &#8216;throwing up pages&#8217; &#8230;</p>
<p>Imagine that you are working on a problematic page.  You drop in a gem like this and now you are displaying and experimenting with your code.  Only <a href="http://www.seaside.st">Seaside</a> for Smalltalk can rival this as far as I am aware but that requires some understanding of Smalltalk.  I love Seaside, but I know of nothing that can beat this.  Of course <a href="http://www.rebol.com">Rebol</a> 3.0 is on the way &#8230;</p>
<p>As for snide remarks from Sun in their JavaFX promo, there are quick ways to throw up a web page&#8230; I like <a href="http://www.blocknote.net">blocknote</a> and there is the Meta/HyperCard Revolution product or even MS Word or FrontPage in a pinch&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://plymouthreliable.com/blog/2007/09/13/really-cool-curl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LRcurl Curlr, LcurlR and (CURL) parentheses</title>
		<link>http://plymouthreliable.com/blog/2007/06/17/lrcurl-curlr-lcurlr-and-curl-parentheses/</link>
		<comments>http://plymouthreliable.com/blog/2007/06/17/lrcurl-curlr-lcurlr-and-curl-parentheses/#comments</comments>
		<pubDate>Mon, 18 Jun 2007 02:11:39 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Curl Surge]]></category>
		<category><![CDATA[Software development]]></category>
		<category><![CDATA[Tool tip]]></category>
		<category><![CDATA[programming tip]]></category>

		<guid isPermaLink="false">http://plymouthreliable.com/blog/2007/06/17/lrcurl-curlr-lcurlr-and-curl-parentheses/</guid>
		<description><![CDATA[LRcurl would be the application of a Right and then a Left curly brace to a CURL expression.
Curl is proud to be LISP-like without the parentheses.
But it is sometimes less than clear how parentheses are to be interpreted in CURL.
It is clear enough how parentheses affect the application of mathematical operators.
But consider this: {let t1:int, [...]]]></description>
			<content:encoded><![CDATA[<p>LRcurl would be the application of a Right and then a Left curly brace to a CURL expression.</p>
<p>Curl is proud to be LISP-like without the parentheses.</p>
<p>But it is sometimes less than clear how parentheses are to be interpreted in CURL.</p>
<p>It is clear enough how parentheses affect the application of mathematical operators.</p>
<p>But consider this: {let t1:int, t2:int = 42}</p>
<p>You may be aware that this leaves the value of t1 as zero.</p>
<p>So consider this: {set (t1, t2) = (1, 2)} </p>
<p>How are we to understand this as a CURL assignment statement?</p>
<p>The index to the on-line CURL documentation is resoundingly silent on the rationale for this syntax.</p>
<p>Set with parentheses is a fact.  Is it because () is an operator?</p>
<p>But why should it not be the case that after {set (t1, t2) =  42}  both t1 and t2 are 42 instead of this being a syntax error?</p>
<p>In the case of {set (t1, t2) =  {my_func}} we know that the number of values returned by my_func must be two values.</p>
<p>You may want to guess at these values: {let t3:int, t4:int = (3,4)}</p>
<p>If you guessed 0 and 3, can you also tell me why this was not also a syntax error?  It is enough to make my curly hair, well, curl left then right.<br />
LcurlR</p>
]]></content:encoded>
			<wfw:commentRss>http://plymouthreliable.com/blog/2007/06/17/lrcurl-curlr-lcurlr-and-curl-parentheses/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Joys of JavaScript</title>
		<link>http://plymouthreliable.com/blog/2007/06/14/joys-of-javascript/</link>
		<comments>http://plymouthreliable.com/blog/2007/06/14/joys-of-javascript/#comments</comments>
		<pubDate>Thu, 14 Jun 2007 17:53:15 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Software development]]></category>
		<category><![CDATA[programming tip]]></category>

		<guid isPermaLink="false">http://plymouthreliable.com/blog/2007/06/14/joys-of-javascript/</guid>
		<description><![CDATA[There is a web interpreter for JavaScript at www.squarefree.com which is just terrific.  The up-arrow cmd history requires a backspace to edit ( at least in Opera ) but it is otherwise great.
It is the next best thing to running JavaScript persisted in a Smalltalk image.
But if you like a cool REPL for JS [...]]]></description>
			<content:encoded><![CDATA[<p>There is a web interpreter for JavaScript at <a href="http://www.squarefree.com/shell/shell.html">www.squarefree.com</a> which is just terrific.  The up-arrow cmd history requires a backspace to edit ( at least in <em>Opera</em> ) but it is otherwise great.</p>
<p>It is the next best thing to running JavaScript persisted in a Smalltalk image.</p>
<p>But if you like a cool REPL for JS and are running even VisualStudio 2003 on .NET then you must compile the <em>JScript</em> <strong>ijs</strong> shell from the <a href="http://listeningtoreason.blogspot.com/2007/03/simple-javascript-command-line.html">ListeningToReason</a> blog.</p>
<p>Test either shell with</p>
<blockquote><p>typeof Object(42)</p></blockquote>
<p>and </p>
<blockquote><p>Object(42).toString().length</p></blockquote>
<p>or anything which you suspect might choke a toy Read-Eval-Print-Loop for JS.</p>
<p>Afterall, maybe you will find your inner Self in a LiveScript</p>
]]></content:encoded>
			<wfw:commentRss>http://plymouthreliable.com/blog/2007/06/14/joys-of-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Scaling the outer walls:  Oz/Mozart, osc and ozengine</title>
		<link>http://plymouthreliable.com/blog/2007/06/13/scaling-the-outer-walls-ozmozart-osc-and-ozengine/</link>
		<comments>http://plymouthreliable.com/blog/2007/06/13/scaling-the-outer-walls-ozmozart-osc-and-ozengine/#comments</comments>
		<pubDate>Wed, 13 Jun 2007 20:40:19 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Oz-Mozart]]></category>
		<category><![CDATA[Software development]]></category>
		<category><![CDATA[Tool tip]]></category>
		<category><![CDATA[programming tip]]></category>

		<guid isPermaLink="false">http://plymouthreliable.com/blog/2007/06/13/scaling-the-outer-walls-ozmozart-osc-and-ozengine/</guid>
		<description><![CDATA[Positive: There is an Oz tutorial started at eclectic
Warning: since Unicode there is no longer a single quote and a dbl-quote character: just as the left-Alt key was never the same scan code as the right-Alt key.  In all that follows, copy the code into a reliable ANSI code editor and flip all &#8217;single&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p>Positive: There is an Oz tutorial started at <a href="http://www.plymouthreliable.com/blog/ozmozart-tutorial">eclectic</a><br/><br />
Warning: since Unicode there is no longer a single quote and a dbl-quote character: just as the left-Alt key was never the same scan code as the right-Alt key.  In all that follows, copy the code into a reliable ANSI code editor and flip all &#8217;single&#8217; quotes to an ANSI apostrophe as on an American ASCII QWERTY keyboard and all dbl quotes to a SHIFT-apostrophe.  Otherwise you are left with left single quotes, right-single quotes, left-dbl-quotes and right-dbl-quotes which will cause errors in Mozart.  Do not use &#8216;back-tick&#8217; (unshifted-~) as your apostrophe character.</p>
<p>You should not have to be a Prolog programmer to learn Oz, but short of being one already, what sense could you make of the errors you will encounter trying to follow the introduction to compiling an Oz application?  The &#8216;Aufhebung&#8217; issue again.  Or you must almost know it just to learn it.</p>
<p>Here goes.</p>
<p>In Rebol you would just script it so:<br />
<blockquote>write %dump.txt read http://localhost:8080/perl/get_env.prl</p></blockquote>
<p>But in Oz you will need to compile to a functor, so let&#8217;s get started on the tutorial&#8217;s Webget.oz</p>
<p>You will need to wrap the file as a functor, so we start with<br />
<blockquote>functor</p>
<p>end</p></blockquote>
<p>We will open STDIN and STDOUT so we need Open and this will be an Application so we will import both:<br />
<blockquote>functor<br />
import<br />
&nbsp;&nbsp;&nbsp;Application<br />
&nbsp;&nbsp;&nbsp;Open<br />
end
</p></blockquote>
<p>What follows is the code from the tutorial which will <strong>not</strong> compile (<strong>not</strong> in OPI, <strong>not</strong> on a cmd line):<br />
<blockquote>
<pre><code>
functor
import
  Application
  Open
define
   Args = {Application.getArgs record('in'(single type:string)
                                  'out'(single type:string))}
   Status = try
	I={New Open.file init(url:  Args.'in')}
	O={New Open.file init(name: Args.'out'
        flags:[write create truncate])}
	in
	  local
	      proc { Copy}
	          S={I read(list:$)}
	       in
	          if S=="" then
	             {O write(vs:S)} { Copy}
	          end
	       end
	    in
	{ Copy}
    end
	catch _ then 1
	end
{Application.exit Status}
end</code></pre>
</blockquote>
<p>The warning we will receive will be an <strong>arity mismatch</strong> for <em>Copy</em>.<br />
I experimented with {CopyWWW _} and with {CopyWWW X} in place of {Copy}<br />
Running <em>ozc -c</em> in <strong>TextPad</strong> compiles succesfully by using <em>{Copy _}</em> in the first 2 occurences of <em>{Copy}</em>.  Ditto for selecting &#8216;Compile File&#8217; on the emacs <em>oz</em> menu.<br />
Now on to compiling that <em>oza</em> file.<br />
To get the <em>oza</em> file I had to use a cmd session: </p>
<blockquote><p>ozc -c Webget.oz -o Webget.oza</p></blockquote>
<p>Otherwise compiling (in TextPad or emacs) gave me just Webget.ozf<br />
Now I could run the ozengine against a web page: </p>
<blockquote><p><code>ozengine Webget.oza --in http://localhost:8080/perl/get_env.prl --out dump.txt</code></p></blockquote>
<p>The program will only exit with CTRL-C CTRL-C and leaves file handles open but if you are content to run it just once </p>
<blockquote><p>type dump.txt</p></blockquote>
<p>Oops&#8230; no file?</p>
<p>We back track by revisiting the code.</p>
<blockquote><pre><code>
functor
import
  Application
  Open
  Show           ; we will try to Show Status
define
   Args = {Application.getArgs record(
                'in'(single type:string)
                'out'(single type:string))}  ;; variable names are words
   Status = try
	In={New Open.file init(url:  Args.'in')}
	Out={New Open.file init(name: Args.'out'
        flags:[write create truncate])}
	in
	  local
	      proc { Copy}
	          Str={In read(list:$)}   ;; lhs var name is now a word
	       in
	          if Str=="" then
	             {Out write(vs:Str)} { Copy}
	          end
                     {In close}
                     {Out close}
	       end
	    in
	{ Copy}
    end
               0   ;; this was a missing ZERO as in 'success' ?
                    ;; (given that a ONE follows next on error)
	catch _ then
                    {Show Status}
                    1   ;; any exception is failure -
                        ;; was the file readonly?
	end
{Application.exit Status}     ;; Status remains unknown
end</code></pre>
</blockquote>
<p>Now we compile without ARITY issues &#8230; but still fail to write a file &#8230;</p>
<p>So now to look at <a href="http://www.info.ucl.ac.be/~pvr/ds/mitbook.html">file IO</a>.</p>
<p>Hmm.  The file io.oz offered for our edification has no error handling.</p>
<p>We try Webget2.oz for local disk files as follows:
<pre><code>
<blockquote>functor
import
   Application Open
define
   Args = {Application.getArgs record('in' (single type:string)
                                                'out' (single type:string))}
   Status = try
	In={New Open.file init(name: Args.'in')}
	Out={New Open.file init(name: Args.'out'
        flags:[write create truncate])}
	in
	  local
	      proc { Copy }
	          Str={In read(list:$)}
	       in
	          if Str=="" then
	             {Out write(vs:Str)}
	             { Copy }
	          end
	          {In close}
	          {Out close}
	       end
	    in
	{ Copy }
    end
    0
	catch _ then
		1
	end
{Application.exit Status}
end</code></pre>
</blockquote>
<p>Which works great so the issue is reading the URL &#8230; It comes up in the browser and Rebol reads it fine as follows:</p>
<blockquote><p>write %dump.txt &#8220;&#8221; ; we nix that file<br />
write %dump.txt read http://localhost:8080/perl/get_env.prl</p></blockquote>
<p>in a Rebol shell. So   </p>
<blockquote><p>if Str\=&#8221;" then</p></blockquote>
<p> must be non-terminating for some URL&#8217;s on Win32.  So we will read the whole URL first.<br />
Now, <a href="http://www.mozart-oz.org/documentation/loop/node1.html#label1">how to iterate over a list</a> &#8230; and then we start back at <a href="http://www.mozart-oz.org/documentation/base/index.html">Lists</a> and progress to the list <a href="http://www.mozart-oz.org/documentation/base/index.html">module</a></p>
]]></content:encoded>
			<wfw:commentRss>http://plymouthreliable.com/blog/2007/06/13/scaling-the-outer-walls-ozmozart-osc-and-ozengine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scripting with Tcl on MS Windows</title>
		<link>http://plymouthreliable.com/blog/2007/06/13/scripting-with-tcl-on-ms-windows-2/</link>
		<comments>http://plymouthreliable.com/blog/2007/06/13/scripting-with-tcl-on-ms-windows-2/#comments</comments>
		<pubDate>Wed, 13 Jun 2007 17:18:21 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[programming tip]]></category>

		<guid isPermaLink="false">http://plymouthreliable.com/blog/2007/06/13/scripting-with-tcl-on-ms-windows-2/</guid>
		<description><![CDATA[If you use a Tcl shell such as tclsh84.exe for any scripting, you will want rlwrap.
What you get is not just prior commands a keystroke away with the up-arrow key, you also get the command history from previous sessions which you have aleady closed.
rlwrap is a &#8216;readline&#8217; wrapper for most any console application ( I [...]]]></description>
			<content:encoded><![CDATA[<p>If you use a <strong>Tcl</strong> shell such as <em>tclsh84.exe</em> for any scripting, you will want <strong>rlwrap</strong>.</p>
<p>What you get is not just prior commands a keystroke away with the up-arrow key, you also get the command history from previous sessions which you have aleady closed.</p>
<p><em>rlwrap</em> is a &#8216;readline&#8217; wrapper for most any console application ( I used to use it for <em>io</em>, the language, before I built my own shell.)</p>
<p>My <em>tclsh.bat</em> is as follows:</p>
<blockquote><p>@echo off<br />
i:<br />
cd \scripts\tcl<br />
i:\usr\bin\rlwrap tclsh84.exe</p></blockquote>
<p>One little note: the first edition of Brent Welch&#8217;s &#8216;Practical Programming in Tcl and Tk&#8217; was about 400+ pages.  I picked up a new 3rd edition on abebooks.com for pennies &#8211; but it rang in at about 800 pages.  Almost perlish by page count, but you are getting so much more <img src='http://plymouthreliable.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>One nice thing: while the book has not blank pages at the back for my automatic pencil, it does have some 20 blank pages scattered through the book.  Don&#8217;t tell Rich Tennant.  Of course a guy with some toxic rubber cement could always paste in a few choice 5th Wave &#8216;toons.</p>
]]></content:encoded>
			<wfw:commentRss>http://plymouthreliable.com/blog/2007/06/13/scripting-with-tcl-on-ms-windows-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rebol CGI gremlin under Apache2</title>
		<link>http://plymouthreliable.com/blog/2007/06/11/rebol-cgi-gremlin-under-apache2/</link>
		<comments>http://plymouthreliable.com/blog/2007/06/11/rebol-cgi-gremlin-under-apache2/#comments</comments>
		<pubDate>Mon, 11 Jun 2007 21:00:35 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Rebol]]></category>
		<category><![CDATA[programming tip]]></category>

		<guid isPermaLink="false">http://plymouthreliable.com/blog/2007/06/11/rebol-cgi-gremlin-under-apache2/</guid>
		<description><![CDATA[Very little is required to run Rebol CGI scripts under Apache&#8217;s HTTP server if you are already running Perl or PHP scripts.
What spooked me was a peculiar echo in my HTML page of 
Content-Type: html/text
 which I could not shake.
There was an explanation.  On my first test I used the singularly unimaginative file name [...]]]></description>
			<content:encoded><![CDATA[<p>Very little is required to run <em>Rebol</em> CGI scripts under Apache&#8217;s HTTP server if you are already running <em>Perl</em> or <em>PHP</em> scripts.</p>
<p>What spooked me was a peculiar echo in my HTML page of </p>
<blockquote><p><code>Content-Type: html/text</code></p></blockquote>
<p> which I could not shake.</p>
<p>There was an explanation.  On my first test I used the singularly unimaginative file name of <em>rebol.r</em> just to be sure that I did not need to use a CGI file extension, e.g., <em>rebol.cgi</em></p>
<p>Because my initial <em>rebol.r</em> worked fine, I went on to try <em>test_002.r</em> and my problems began &#8230;</p>
<p>It turns out that even in a <em>/cgi-bin</em> directory, if <strong>Rebol</strong> finds a file called <em>Rebol.r</em> then that file is executed before your own file.</p>
<p>Now this could be useful as a default header for all <em>rebol</em> CGI scripts in that directory.  But if a script contains its own </p>
<blockquote><p>prin &#8220;Content-Type: text/html&#8221;</p></blockquote>
<p> the ghost will have been inserted into the machine.</p>
<p>Once I had renamed <em>rebol.r</em> to <em>rebol_0001.r</em> all was well. The following test script works fine:</p>
<blockquote><p><code>#!I:/rebol/core/rebol.exe -cswq<br />
Rebol [<br />
	Title: "CGI test 004"<br />
]<br />
prin "content-type: text/html^/^/"</p>
<p>comment {filename is rebol_004.r<br />
		test URl is http://localhost:8080/cgi-bin/Rebol_004.r<br />
}</p>
<p>html32: make string! 2048</p>
<p>emitr: func [dat] [repend html32 dat]</p>
<p>emitr [{ html header goes here}	]</p>
<p>	emitr [{ some dynamic html goes here<br />
		}]</p>
<p>	emitr: [{closing html tags go here}]</p>
<p>prin html32</code></p></blockquote>
<p>On with Rebolting Web Pages!</p>
]]></content:encoded>
			<wfw:commentRss>http://plymouthreliable.com/blog/2007/06/11/rebol-cgi-gremlin-under-apache2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Obol (Sufrin/Oxford) interpreter</title>
		<link>http://plymouthreliable.com/blog/2007/06/07/the-obol-sufrinoxford-interpreter/</link>
		<comments>http://plymouthreliable.com/blog/2007/06/07/the-obol-sufrinoxford-interpreter/#comments</comments>
		<pubDate>Fri, 08 Jun 2007 01:00:50 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[programming tip]]></category>

		<guid isPermaLink="false">http://plymouthreliable.com/blog/2007/06/07/the-obol-sufrinoxford-interpreter/</guid>
		<description><![CDATA[Bernard Sufrin of Oxford has an interpreted language available for the JVM. His Obol language can be used in conjunction with Java rather as one uses Jython scripts.
About the only information available is a PDF.  My interest was in the Obol shell.  I have added a disambiguation page to Wikipedia to differentiate Sufrin&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Bernard Sufrin of Oxford has an interpreted language available for the JVM. His <a href="http://web.comlab.ox.ac.uk/oucl/work/bernard.sufrin/">Obol</a> language can be used in conjunction with Java rather as one uses Jython scripts.<br />
About the only information available is a <a href="http://users.ox.ac.uk/~wadh2045/obol.pdf">PDF</a>.  My interest was in the Obol shell.  I have added a disambiguation page to Wikipedia to differentiate Sufrin&#8217;s <em>Obol</em> from the other two: the <em>Tromso</em> Obol and the <em>Berkeley</em> Obol. These days &#8216;Rio&#8217; is about as overloaded a project name as &#8216;Obol&#8217;.</p>
<p>Passing <em>Obol</em> any arg other than -w would seem to result in a console-only interpreter, e.g., </p>
<blockquote><p>I:\Obol>java -cp . -jar Obol.jar -h</p></blockquote>
<p>If you load a GUI script, e.g., </p>
<blockquote><p>I:\Obol>java -cp . -jar Obol.jar .\Examples\swing.ob</p></blockquote>
<p>you may see warnings.  In this respect Obol scripting is rather like Perl </p>
<blockquote><p>if ()  {<br />
&#8230;} else</p></blockquote>
<p>where <em>else</em> follows on the same line as the closing brace.</p>
<p>In the case of Obol, this means that   </p>
<blockquote><p>let jb=JButton(&#8220;Test Button&#8221;) in<br />
  { jb.addActionListener<br />
    (java.awt.event.ActionListener.new<br />
     {| actionPerformed event = </p></blockquote>
<p>must be re-written as</p>
<blockquote><p>  let jb=JButton(&#8220;Test Button&#8221;) in<br />
  { jb.addActionListener<br />
    (java.awt.event.ActionListener.new {|<br />
        actionPerformed event =  { &#8230;</p></blockquote>
<p>and the warnings disappear.</p>
<p>For more of Sufrin&#8217;s work and ideas see his <a href="http://jape.comlab.ox.ac.uk:8080/sufrin/PUBLIC/projects.html">projects</a> page on Scala and such.</p>
<p>And if the obol is under your tongue &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://plymouthreliable.com/blog/2007/06/07/the-obol-sufrinoxford-interpreter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl amok</title>
		<link>http://plymouthreliable.com/blog/2007/05/20/perl-amok/</link>
		<comments>http://plymouthreliable.com/blog/2007/05/20/perl-amok/#comments</comments>
		<pubDate>Mon, 21 May 2007 00:27:24 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Software development]]></category>
		<category><![CDATA[programming tip]]></category>

		<guid isPermaLink="false">http://plymouthreliable.com/blog/2007/05/20/perl-amok/</guid>
		<description><![CDATA[The &#8216;camel&#8217; book has become a little too thick, given what I just saw on my console.
I:\Tags_Project>perl tags_test002.prl
Creating pipe &#8220;PipeInTags&#8221;.
Can&#8217;t locate auto/Win32/Pipe/connect.al in @INC (@INC contains: [...]
What this means of course is that I have a typo.
I have typed
$PipeInTags->console()
where I should have typed
$PipeInTags->Console()
Perl cannot report that a string of text has a possible match in [...]]]></description>
			<content:encoded><![CDATA[<p>The &#8216;camel&#8217; book has become a little too thick, given what I just saw on my console.</p>
<blockquote><p>I:\Tags_Project>perl tags_test002.prl<br />
Creating pipe &#8220;PipeInTags&#8221;.<br />
Can&#8217;t locate auto/Win32/Pipe/connect.al in @INC (@INC contains: [...]</p></blockquote>
<p>What this means of course is that I have a typo.<br />
I have typed</p>
<blockquote><p>$PipeInTags->console()</p></blockquote>
<p>where I should have typed</p>
<blockquote><p>$PipeInTags-><strong>C</strong>onsole()</p></blockquote>
<p>Perl cannot report that a string of text has a possible match in a PM in the same string with a leading Cap.  Perl.</p>
<p>Perhaps a unix utility run amok.  If Ruby is Smalltalk-as-perl where Objective-C is Smalltalk-as-Next-C then perhaps Ruby is the answer.  But not for this task.  Because <em>Tclx</em> remains buggy, I am left with Perl.  </p>
<p>Many implementations of Smalltalk do not do much better with typos, which doubtless is why Unit testing started as SUnit (<strong>Dolphin 6</strong> does quite well.)  </p>
<p>MTF. </p>
<p>More to follow on Perl and the IDE.</p>
]]></content:encoded>
			<wfw:commentRss>http://plymouthreliable.com/blog/2007/05/20/perl-amok/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby and Gnome2 aka gtk2 and the iconv.dll</title>
		<link>http://plymouthreliable.com/blog/2007/05/09/ruby-and-gnome2-aka-gtk2-and-the-iconvdll/</link>
		<comments>http://plymouthreliable.com/blog/2007/05/09/ruby-and-gnome2-aka-gtk2-and-the-iconvdll/#comments</comments>
		<pubDate>Wed, 09 May 2007 19:08:31 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[programming tip]]></category>

		<guid isPermaLink="false">http://plymouthreliable.com/blog/2007/05/09/ruby-and-gnome2-aka-gtk2-and-the-iconvdll/</guid>
		<description><![CDATA[My heart went out to the author of a mail list request for suggestions:
&#8220;I encountered the current problem I&#8217;m having about a year ago and thought I had figured what was wrong but can&#8217;t seem to remember how to fix it.&#8221;
Naturally after installing Gnome2, the simple ruby
require &#8216;gtk2&#8242; 
failed.
I began slowly, conservatively, moving gtk2 site-ruby [...]]]></description>
			<content:encoded><![CDATA[<p>My heart went out to the author of a mail list request for suggestions:</p>
<blockquote><p>&#8220;I encountered the current problem I&#8217;m having about a year ago and thought I had figured what was wrong but can&#8217;t seem to remember how to fix it.&#8221;</p></blockquote>
<p>Naturally after installing Gnome2, the simple ruby</p>
<blockquote><p>require &#8216;gtk2&#8242; </p></blockquote>
<p>failed.</p>
<p>I began slowly, conservatively, moving gtk2 site-ruby into my dev ruby tree. </p>
<p>I finally got to the iconv.dll <em>missing entry-point</em> error.</p>
<p>Here is my tip if you find that your ruby/bin already has an iconv.dll</p>
<p>In ruby/bin create a safety dir and move your current iconv.exe and iconv.dll into that backup area.</p>
<p>Now copy from the the gnome2/bin into ruby/bin</p>
<p>You should now get a reassuring true when you require &#8216;gtk2&#8242;</p>
<p>There are good tips on rubyscript2exe elsewhere on the web.</p>
]]></content:encoded>
			<wfw:commentRss>http://plymouthreliable.com/blog/2007/05/09/ruby-and-gnome2-aka-gtk2-and-the-iconvdll/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When the Io frontend won&#8217;t come back &#8230; an Io language tip</title>
		<link>http://plymouthreliable.com/blog/2007/05/07/when-the-io-frontend-wont-come-back-and-io-language-tip/</link>
		<comments>http://plymouthreliable.com/blog/2007/05/07/when-the-io-frontend-wont-come-back-and-io-language-tip/#comments</comments>
		<pubDate>Mon, 07 May 2007 16:21:57 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[programming tip]]></category>

		<guid isPermaLink="false">http://plymouthreliable.com/blog/2007/05/07/when-the-io-frontend-wont-come-back-and-io-language-tip/</guid>
		<description><![CDATA[If you are in the default frontend to Io, the language, and happen to revert to Smalltalk for a moment as in
CleverObj := KludgedObj clone.
and then find that you cannot recover without the offending &#8216;period&#8217; with
CleverObj := KludgedObj clone
because now there is another error one line below the first &#8230;
Don&#8217;t panic!
Just enter
diddly
or
nil
or
whaddevvvah
and watch that error [...]]]></description>
			<content:encoded><![CDATA[<p>If you are in the default frontend to Io, the language, and happen to revert to Smalltalk for a moment as in</p>
<blockquote><p>CleverObj := KludgedObj clone.</p></blockquote>
<p>and then find that you cannot recover without the offending &#8216;period&#8217; with</p>
<blockquote><p>CleverObj := KludgedObj clone</p></blockquote>
<p>because now there is another error one line below the first &#8230;</p>
<p>Don&#8217;t panic!</p>
<p>Just enter</p>
<blockquote><p>diddly</p></blockquote>
<p>or</p>
<blockquote><p>nil</p></blockquote>
<p>or</p>
<blockquote><p>whaddevvvah</p></blockquote>
<p>and watch that error trump the previous exception.</p>
<p>Now you can happily clone again.</p>
<p>This seems to depend on the Win32 shell that I am running Io in, so you may never see this glitch &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://plymouthreliable.com/blog/2007/05/07/when-the-io-frontend-wont-come-back-and-io-language-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.462 seconds -->
