<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: ParenScript</title>
	<atom:link href="http://blogs.bl0rg.net/netzstaub/2005/03/14/parenscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.bl0rg.net/netzstaub/2005/03/14/parenscript/</link>
	<description>beatz &#38; funkz</description>
	<pubDate>Sun, 06 Jul 2008 03:02:46 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: battery</title>
		<link>http://blogs.bl0rg.net/netzstaub/2005/03/14/parenscript/#comment-93490</link>
		<dc:creator>battery</dc:creator>
		<pubDate>Tue, 24 Jun 2008 12:35:34 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.bl0rg.net/netzstaub/?p=127#comment-93490</guid>
		<description>[…] Unfortunately, this isn’t the first time I’ve had this problem. Enter Six Apart. When signed up and tested, I couldn’t leave comments on my own brand new TypePad blog (tdavid.typepad.com). This was around Christmas time two years ago and it took a week or so to find out that the reason my comments were being blocked was because makeyougohmm.com was listed on an old spam service. […]</description>
		<content:encoded><![CDATA[<p>[…] Unfortunately, this isn’t the first time I’ve had this problem. Enter Six Apart. When signed up and tested, I couldn’t leave comments on my own brand new TypePad blog (tdavid.typepad.com). This was around Christmas time two years ago and it took a week or so to find out that the reason my comments were being blocked was because makeyougohmm.com was listed on an old spam service. […]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evaine</title>
		<link>http://blogs.bl0rg.net/netzstaub/2005/03/14/parenscript/#comment-89919</link>
		<dc:creator>Evaine</dc:creator>
		<pubDate>Thu, 24 Apr 2008 15:33:33 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.bl0rg.net/netzstaub/?p=127#comment-89919</guid>
		<description>Good post. You make some great points that most people do not fully understand.

"I actually have a lot of real work to do, so I had to quit my “opensource-programming” procrastination as fast as possible. That’s why I rushed the release of my Lisp to Javascript “compiler” ParenScript. Compiler is actually a very big word, as ParenScript doesn’t do much more than correctly indent a Lisp expression representing Javascript code (it does a few optimization on the way, though). I had at first written a very hackish implementation of the compiler, with an undefinite intermediary representation somehow consisting of strings and lists of strings. After I got the mess working, I decided to rewrite the compiler in a clean way. ParenScript in the version 0.1.0 actually is a lot cleaner, a few people may even understand its inner workings, but there still is a lot to do. It has been given next to none testing in a real setup. The indentation is a bit weird sometimes, and could be given a lift up. The error handling is very minimal."

I like how you explained that. Very helpful. Thanks.</description>
		<content:encoded><![CDATA[<p>Good post. You make some great points that most people do not fully understand.</p>
<p>&#8220;I actually have a lot of real work to do, so I had to quit my “opensource-programming” procrastination as fast as possible. That’s why I rushed the release of my Lisp to Javascript “compiler” ParenScript. Compiler is actually a very big word, as ParenScript doesn’t do much more than correctly indent a Lisp expression representing Javascript code (it does a few optimization on the way, though). I had at first written a very hackish implementation of the compiler, with an undefinite intermediary representation somehow consisting of strings and lists of strings. After I got the mess working, I decided to rewrite the compiler in a clean way. ParenScript in the version 0.1.0 actually is a lot cleaner, a few people may even understand its inner workings, but there still is a lot to do. It has been given next to none testing in a real setup. The indentation is a bit weird sometimes, and could be given a lift up. The error handling is very minimal.&#8221;</p>
<p>I like how you explained that. Very helpful. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Voice of Reason</title>
		<link>http://blogs.bl0rg.net/netzstaub/2005/03/14/parenscript/#comment-83353</link>
		<dc:creator>Voice of Reason</dc:creator>
		<pubDate>Fri, 21 Mar 2008 07:49:34 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.bl0rg.net/netzstaub/?p=127#comment-83353</guid>
		<description>Forgot to include the definnition of ALL-BUT-LAST:

(defun all-but-last (a-list)
  (if (cdr a-list)
    (cons (car a-list) (all-but-last (cdr a-list)))
    nil))</description>
		<content:encoded><![CDATA[<p>Forgot to include the definnition of ALL-BUT-LAST:</p>
<p>(defun all-but-last (a-list)<br />
  (if (cdr a-list)<br />
    (cons (car a-list) (all-but-last (cdr a-list)))<br />
    nil))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Voice of Reason</title>
		<link>http://blogs.bl0rg.net/netzstaub/2005/03/14/parenscript/#comment-83351</link>
		<dc:creator>Voice of Reason</dc:creator>
		<pubDate>Fri, 21 Mar 2008 06:40:48 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.bl0rg.net/netzstaub/?p=127#comment-83351</guid>
		<description>This is an interesting hack. Since you posted this, the project has been scrapped and replaced with another project called "Parenthetix", which departs radically from the original design. Parenthetix is much more Java-like (or, should I say, much more Pascal-like). It has semi-colons and a complicated grammar. Imperative programming style is much more pervasive in Parenthetix than it was in ParenScript. ParenScript can at least be adapted for functional programming, even though it doesn't do it out of the box.

I don't care for Parenthetix because it takes away the promise that ParenScript had: To make JavaScript more like Lisp.

With a few macros on the Lisp side, and a few support functions, you can eliminate many of the situations where ParenScript forces you into imperative programming. For example, the following creates a ParenScript macro that allows you to define functions that behave like Lisp functions (that is, they evaluate to a certain value, without an explicit "return" statement... the -f suffix stands for "functional"):

(defmacro+ps defun-f (name lambda-list &#38;rest body)
            `(defun ,name ,lambda-list
              ,@(reform-body body)))

;; The macro requires this function:

(defun reform-body (body)
  (if (= (length body) 1)
              `(,(append `(return ,(car body))))
              (append (all-but-last body)
                      `(,(append '(return) (last body))))))

;; There's also a lambda-f, let-f, and progn-f, but I'll leave them out for brevity.

;; You can also have a genuine Lisp "cond" (expands into
;; a hornet's nest of if's, but you get the right semantics):
(defun cond-expand (conditions)
  (if conditions
      (if (equalp (caar conditions) t)
          (cadar conditions)
          `(if ,(caar conditions)
            ,(cadar conditions)
            ,(cond-expand (cdr conditions))))))

(js:defjsmacro cond (&#38;rest conditions)
  (cond-expand conditions))

;; JavaScript has a "random", and ParenScript uses it,
;; but it has different semantics from the CL function
;; with the same name. This macro fixes that (the
;; random-state argument is ignored):
(js:defjsmacro random (num &#38;optional random-state)
  `(*math.floor (* (*math.random) ,num)))

I've spent some time trying to get a small CL program I wrote while learning Lisp to compile into runnable JavaScript with ParenScript. Certain CL functions can be implemented in ParenScript itself, such as car, cdr, find-if, nth, nthcdr,
and assoc.

The nth, car, and cdr functions have special semantics when it comes to NIL (namely, (= (nth n nil) nil)
evaluates to true, whereas (= (aref nil n) nil) is an error), and therefore, the AREF function is not equivalent to them. 

I've written a half-assed version of equalp. At least I _think_ it works.</description>
		<content:encoded><![CDATA[<p>This is an interesting hack. Since you posted this, the project has been scrapped and replaced with another project called &#8220;Parenthetix&#8221;, which departs radically from the original design. Parenthetix is much more Java-like (or, should I say, much more Pascal-like). It has semi-colons and a complicated grammar. Imperative programming style is much more pervasive in Parenthetix than it was in ParenScript. ParenScript can at least be adapted for functional programming, even though it doesn&#8217;t do it out of the box.</p>
<p>I don&#8217;t care for Parenthetix because it takes away the promise that ParenScript had: To make JavaScript more like Lisp.</p>
<p>With a few macros on the Lisp side, and a few support functions, you can eliminate many of the situations where ParenScript forces you into imperative programming. For example, the following creates a ParenScript macro that allows you to define functions that behave like Lisp functions (that is, they evaluate to a certain value, without an explicit &#8220;return&#8221; statement&#8230; the -f suffix stands for &#8220;functional&#8221;):</p>
<p>(defmacro+ps defun-f (name lambda-list &amp;rest body)<br />
            `(defun ,name ,lambda-list<br />
              ,@(reform-body body)))</p>
<p>;; The macro requires this function:</p>
<p>(defun reform-body (body)<br />
  (if (= (length body) 1)<br />
              `(,(append `(return ,(car body))))<br />
              (append (all-but-last body)<br />
                      `(,(append &#8216;(return) (last body))))))</p>
<p>;; There&#8217;s also a lambda-f, let-f, and progn-f, but I&#8217;ll leave them out for brevity.</p>
<p>;; You can also have a genuine Lisp &#8220;cond&#8221; (expands into<br />
;; a hornet&#8217;s nest of if&#8217;s, but you get the right semantics):<br />
(defun cond-expand (conditions)<br />
  (if conditions<br />
      (if (equalp (caar conditions) t)<br />
          (cadar conditions)<br />
          `(if ,(caar conditions)<br />
            ,(cadar conditions)<br />
            ,(cond-expand (cdr conditions))))))</p>
<p>(js:defjsmacro cond (&amp;rest conditions)<br />
  (cond-expand conditions))</p>
<p>;; JavaScript has a &#8220;random&#8221;, and ParenScript uses it,<br />
;; but it has different semantics from the CL function<br />
;; with the same name. This macro fixes that (the<br />
;; random-state argument is ignored):<br />
(js:defjsmacro random (num &amp;optional random-state)<br />
  `(*math.floor (* (*math.random) ,num)))</p>
<p>I&#8217;ve spent some time trying to get a small CL program I wrote while learning Lisp to compile into runnable JavaScript with ParenScript. Certain CL functions can be implemented in ParenScript itself, such as car, cdr, find-if, nth, nthcdr,<br />
and assoc.</p>
<p>The nth, car, and cdr functions have special semantics when it comes to NIL (namely, (= (nth n nil) nil)<br />
evaluates to true, whereas (= (aref nil n) nil) is an error), and therefore, the AREF function is not equivalent to them. </p>
<p>I&#8217;ve written a half-assed version of equalp. At least I _think_ it works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chiz</title>
		<link>http://blogs.bl0rg.net/netzstaub/2005/03/14/parenscript/#comment-78597</link>
		<dc:creator>chiz</dc:creator>
		<pubDate>Mon, 18 Feb 2008 13:55:28 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.bl0rg.net/netzstaub/?p=127#comment-78597</guid>
		<description>Good post. You make some great points that most people do not fully understand.

"ParenScript in the version 0.1.0 actually is a lot cleaner, a few people may even understand its inner workings, but there still is a lot to do. It has been given next to none testing in a real setup. The indentation is a bit weird sometimes, and could be given a lift up. The error handling is very minimal."

I like how you explained that. Very helpful. Thanks.</description>
		<content:encoded><![CDATA[<p>Good post. You make some great points that most people do not fully understand.</p>
<p>&#8220;ParenScript in the version 0.1.0 actually is a lot cleaner, a few people may even understand its inner workings, but there still is a lot to do. It has been given next to none testing in a real setup. The indentation is a bit weird sometimes, and could be given a lift up. The error handling is very minimal.&#8221;</p>
<p>I like how you explained that. Very helpful. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Acnezine</title>
		<link>http://blogs.bl0rg.net/netzstaub/2005/03/14/parenscript/#comment-47035</link>
		<dc:creator>Acnezine</dc:creator>
		<pubDate>Fri, 31 Aug 2007 07:00:25 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.bl0rg.net/netzstaub/?p=127#comment-47035</guid>
		<description>Nice blog !</description>
		<content:encoded><![CDATA[<p>Nice blog !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: manuel</title>
		<link>http://blogs.bl0rg.net/netzstaub/2005/03/14/parenscript/#comment-30219</link>
		<dc:creator>manuel</dc:creator>
		<pubDate>Sat, 12 May 2007 08:54:17 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.bl0rg.net/netzstaub/?p=127#comment-30219</guid>
		<description>Yeah you're right, slipped pas the spam recognition. :)</description>
		<content:encoded><![CDATA[<p>Yeah you&#8217;re right, slipped pas the spam recognition. <img src='http://blogs.bl0rg.net/netzstaub/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hexstream</title>
		<link>http://blogs.bl0rg.net/netzstaub/2005/03/14/parenscript/#comment-30179</link>
		<dc:creator>Hexstream</dc:creator>
		<pubDate>Sat, 12 May 2007 02:41:51 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.bl0rg.net/netzstaub/?p=127#comment-30179</guid>
		<description>Maybe I'm crazy, but mike's comment reads as "clever" spam.

?</description>
		<content:encoded><![CDATA[<p>Maybe I&#8217;m crazy, but mike&#8217;s comment reads as &#8220;clever&#8221; spam.</p>
<p>?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike</title>
		<link>http://blogs.bl0rg.net/netzstaub/2005/03/14/parenscript/#comment-64</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Fri, 14 Apr 2006 02:30:45 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.bl0rg.net/netzstaub/?p=127#comment-64</guid>
		<description>i found i like the style of your blog, and i also have used html tools or JavaScript tools at &lt;a href="http://www.yaodownload.com/web-authoring/" rel="nofollow"&gt;http://www.yaodownload.com/web-authoring/&lt;/a&gt; , such as HTML to AnyCode Converter , it can translate some HTML code to JavaScript, ASP or other scripts.
</description>
		<content:encoded><![CDATA[<p>i found i like the style of your blog, and i also have used html tools or JavaScript tools at <a href="http://www.yaodownload.com/web-authoring/" rel="nofollow">http://www.yaodownload.com/web-authoring/</a> , such as HTML to AnyCode Converter , it can translate some HTML code to JavaScript, ASP or other scripts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivan Toshkov</title>
		<link>http://blogs.bl0rg.net/netzstaub/2005/03/14/parenscript/#comment-63</link>
		<dc:creator>Ivan Toshkov</dc:creator>
		<pubDate>Fri, 06 May 2005 19:08:24 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.bl0rg.net/netzstaub/?p=127#comment-63</guid>
		<description>Actually, the problem is that `i = i++' leaves `i' unchanged.

I've put this bug report and the patch at &lt;a href="http://www.cliki.net/parenscript" rel="nofollow"&gt;http://www.cliki.net/parenscript&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Actually, the problem is that `i = i++&#8217; leaves `i&#8217; unchanged.</p>
<p>I&#8217;ve put this bug report and the patch at <a href="http://www.cliki.net/parenscript" rel="nofollow">http://www.cliki.net/parenscript</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
