<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: What Conditions (Exceptions) are Really About</title>
	<atom:link href="http://danweinreb.org/blog/what-conditions-exceptions-are-really-about/feed" rel="self" type="application/rss+xml" />
	<link>http://danweinreb.org/blog/what-conditions-exceptions-are-really-about</link>
	<description>Software and Innovation</description>
	<lastBuildDate>Sun, 10 Jul 2011 14:13:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Daniel Weinreb</title>
		<link>http://danweinreb.org/blog/what-conditions-exceptions-are-really-about/comment-page-1#comment-497</link>
		<dc:creator>Daniel Weinreb</dc:creator>
		<pubDate>Mon, 01 Sep 2008 20:24:36 +0000</pubDate>
		<guid isPermaLink="false">http://dlweinreb.wordpress.com/?p=27#comment-497</guid>
		<description><![CDATA[Vinay: That&#039;s a great list of books.  You&#039;re quite right that a good next step is to read some high-quality Common Lisp source code.  May I suggest as a starting point the open-source libraries written by Edi Weitz?  See http://www.weitz.de/.  If anyone else has some good suggestions, please post replies here!

Yes, there are a lot of independent consultants working in Common Lisp.  There is some information about jobs in my survey paper at http://common-lisp.net/~dlw/LispSurvey.html.  You might also get in touch with the people at Clozure, at www.clozure.com, who do a lot of Common Lisp consulting work and often bring together consultants and clients who need consultants.]]></description>
		<content:encoded><![CDATA[<p>Vinay: That&#8217;s a great list of books.  You&#8217;re quite right that a good next step is to read some high-quality Common Lisp source code.  May I suggest as a starting point the open-source libraries written by Edi Weitz?  See <a href="http://www.weitz.de/" rel="nofollow">http://www.weitz.de/</a>.  If anyone else has some good suggestions, please post replies here!</p>
<p>Yes, there are a lot of independent consultants working in Common Lisp.  There is some information about jobs in my survey paper at <a href="http://common-lisp.net/~dlw/LispSurvey.html" rel="nofollow">http://common-lisp.net/~dlw/LispSurvey.html</a>.  You might also get in touch with the people at Clozure, at <a href="http://www.clozure.com" rel="nofollow">http://www.clozure.com</a>, who do a lot of Common Lisp consulting work and often bring together consultants and clients who need consultants.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vinay</title>
		<link>http://danweinreb.org/blog/what-conditions-exceptions-are-really-about/comment-page-1#comment-453</link>
		<dc:creator>Vinay</dc:creator>
		<pubDate>Sun, 17 Aug 2008 09:11:41 +0000</pubDate>
		<guid isPermaLink="false">http://dlweinreb.wordpress.com/?p=27#comment-453</guid>
		<description><![CDATA[Hi Dan,

I&#039;ve been following your blog since the beginning, and really look forward to every new post ...

I&#039;ve been learning Lisp / Scheme over the last three years ... 

So far, I&#039;ve worked my way through the following books :

- Structure and Interpretation of Computer Programs
- ANSI common Lisp
- Paradigms of AI Programming (In process)
- LISP in small Pieces
- Essentials of Programming Languages (In Process)

I really enjoy reading Lisp / Scheme code. The style of code that Lisp allows is truely unique and completely different from what Ive ever seen before. I&#039;m a programmer for 10+ years now, and I&#039;ve mostly written and read code in C, C++ and Java. 

I write this mail to ask you a few specific questions:

- I like learning about a language by reading code written in it. I&#039;ve done this for C, C++ and Java. (There&#039;s no shortage of code in these languages). For Lisp, what would you suggest someone to read ? to understand the common idioms, good style, effective use ?

- Work : I&#039;ve been working in the consulting industry since the beginning of my career. Its been over 10 years now. I&#039;ve been thinking ... Is it possible to work as an independent consultant working on Lisp ?

- Any other suggestions on how I can sharpen my skills on Lisp programming / AI ?

I hope to hear from you soon.

Regards,

Vinay]]></description>
		<content:encoded><![CDATA[<p>Hi Dan,</p>
<p>I&#8217;ve been following your blog since the beginning, and really look forward to every new post &#8230;</p>
<p>I&#8217;ve been learning Lisp / Scheme over the last three years &#8230; </p>
<p>So far, I&#8217;ve worked my way through the following books :</p>
<p>- Structure and Interpretation of Computer Programs<br />
- ANSI common Lisp<br />
- Paradigms of AI Programming (In process)<br />
- LISP in small Pieces<br />
- Essentials of Programming Languages (In Process)</p>
<p>I really enjoy reading Lisp / Scheme code. The style of code that Lisp allows is truely unique and completely different from what Ive ever seen before. I&#8217;m a programmer for 10+ years now, and I&#8217;ve mostly written and read code in C, C++ and Java. </p>
<p>I write this mail to ask you a few specific questions:</p>
<p>- I like learning about a language by reading code written in it. I&#8217;ve done this for C, C++ and Java. (There&#8217;s no shortage of code in these languages). For Lisp, what would you suggest someone to read ? to understand the common idioms, good style, effective use ?</p>
<p>- Work : I&#8217;ve been working in the consulting industry since the beginning of my career. Its been over 10 years now. I&#8217;ve been thinking &#8230; Is it possible to work as an independent consultant working on Lisp ?</p>
<p>- Any other suggestions on how I can sharpen my skills on Lisp programming / AI ?</p>
<p>I hope to hear from you soon.</p>
<p>Regards,</p>
<p>Vinay</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ascription is an Anathema to any Enthusiasm &#187; Blog Archive &#187; Conditions in Common Lisp</title>
		<link>http://danweinreb.org/blog/what-conditions-exceptions-are-really-about/comment-page-1#comment-372</link>
		<dc:creator>Ascription is an Anathema to any Enthusiasm &#187; Blog Archive &#187; Conditions in Common Lisp</dc:creator>
		<pubDate>Tue, 06 May 2008 20:30:30 +0000</pubDate>
		<guid isPermaLink="false">http://dlweinreb.wordpress.com/?p=27#comment-372</guid>
		<description><![CDATA[[...] Weinreb wrote a long blog post recently outlining what Common Lisp&#8217;s &#8220;Conditions (exceptions) are really about.&#8221;  He argues, and I won&#8217;t disagree, that they provide a clean, even elegant, way to [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Weinreb wrote a long blog post recently outlining what Common Lisp&#8217;s &#8220;Conditions (exceptions) are really about.&#8221;  He argues, and I won&#8217;t disagree, that they provide a clean, even elegant, way to [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: unClog &#187; On speaking conditionally</title>
		<link>http://danweinreb.org/blog/what-conditions-exceptions-are-really-about/comment-page-1#comment-371</link>
		<dc:creator>unClog &#187; On speaking conditionally</dc:creator>
		<pubDate>Mon, 31 Mar 2008 21:09:44 +0000</pubDate>
		<guid isPermaLink="false">http://dlweinreb.wordpress.com/?p=27#comment-371</guid>
		<description><![CDATA[[...] if you haven&#8217;t read what Dan Weinreb has to say about the Common Lisp Condition System then, well, you should [...]]]></description>
		<content:encoded><![CDATA[<p>[...] if you haven&#8217;t read what Dan Weinreb has to say about the Common Lisp Condition System then, well, you should [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikael Jansson &#187; Blog Archive &#187; Links for 2008-03-24</title>
		<link>http://danweinreb.org/blog/what-conditions-exceptions-are-really-about/comment-page-1#comment-370</link>
		<dc:creator>Mikael Jansson &#187; Blog Archive &#187; Links for 2008-03-24</dc:creator>
		<pubDate>Fri, 28 Mar 2008 19:48:09 +0000</pubDate>
		<guid isPermaLink="false">http://dlweinreb.wordpress.com/?p=27#comment-370</guid>
		<description><![CDATA[[...] Conditions in Lisp explained          reddit_url=&#039;http://mikael.jansson.be/journal/2008/03/24-links&#039;; reddit_title=&#039;Links for 2008-03-24&#039;;    digg_url=&#039;http://mikael.jansson.be/journal/2008/03/24-links&#039;; //digg_skin=&#039;compact&#039;; digg_title = &#039;Links for 2008-03-24&#039;;    ShareThis [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Conditions in Lisp explained          reddit_url=&#8217;http://mikael.jansson.be/journal/2008/03/24-links&#8217;; reddit_title=&#8217;Links for 2008-03-24&#8242;;    digg_url=&#8217;http://mikael.jansson.be/journal/2008/03/24-links&#8217;; //digg_skin=&#8217;compact&#8217;; digg_title = &#8216;Links for 2008-03-24&#8242;;    ShareThis [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dlweinreb</title>
		<link>http://danweinreb.org/blog/what-conditions-exceptions-are-really-about/comment-page-1#comment-369</link>
		<dc:creator>dlweinreb</dc:creator>
		<pubDate>Fri, 28 Mar 2008 12:55:01 +0000</pubDate>
		<guid isPermaLink="false">http://dlweinreb.wordpress.com/?p=27#comment-369</guid>
		<description><![CDATA[I have consulted with Kent Pitman, who knows more than anybody else about Lisp conditions and the official language definitions.

David Moon: I believe that the problem here lies in the differences between Zetalisp and X3J13 Common Lisp.  In the latter, which is what I was talking about (and I should have made that clearer -- sorry!), there really isn&#039;t any semantic distinction between the classes error, serious-condition, and condition. They are useful only as conventions/mnemonics for people who think that you can say something about whether a particular condition class is, in and of itself, an &quot;error&quot;.  That, of course, depends on what you mean by &quot;error&quot;, a word that I have intentionally avoided.

There are some conditions that, for all practical purposes, always indicate a bug, such as trying to compute the car of an array.  While it is remotely conceivable that a program might do that on purpose, including in its contract the condition that that would signal, it would almost certainly be poor programming style.  However, in my opinion, indexing off the end of an array is not, per se, a bug.  You can write a linear search that&#039;s slightly faster by letting Lisp itself check for the &quot;I&#039;ve reached the end of the array&quot; circumstance, rather than coding it yourself.

(Note: if the array is easy to modify, a better trick is to store a copy of the desired value at the end of the array, so that you&#039;re guaranteed to find it, and then you can omit the length check.  But in many cases that&#039;s not possible, and it&#039;s not thread safe, and so on.  But I digress.)

What you&#039;re definitely right about is that I have not yet considered Lisp&#039;s ability do do &quot;handler-bind&quot;, which is very important.  I&#039;ll talk about that in a future post.  &quot;signal&quot; can also be interesting, but I don&#039;t think I&#039;ve ever actually used it.

You are right about the contract of +.  Thanks for the correction.

The HyperSpec is annoyingly unspecific sometimes about unusual behaviors.  Just recently I was asked whether the :junk-allowed t option of parse-integer means that if you give parse-integer a string, it should return nil rather than signaling.  The spec is not clear on that, although it tends to suggest that it should signal, which is what I would choose if I were the spec writer.  But I wish these things were spelled out more clearly; and it would be even nicer if it specified exactly what condition class were signaled in such cases.

If we ever get to define a new Lisp, and we have enough time and resources to do all this (X3J13 did not), and we don&#039;t have to subject ourselves to a design-by-huge-committee process (such as X3 requires), I hope we&#039;d get this all right.  Java&#039;s standard does  much better job in this respect.  But writing good standards is very difficult and time-consuming.  I helped a with the Java spec and it was clear that Guy Steele and Bill Joy worked very long and hard on it.  They also had the advantage of having Guy Steele, a great writer, and particularly a clear and deep thinker when it comes to programming languages.]]></description>
		<content:encoded><![CDATA[<p>I have consulted with Kent Pitman, who knows more than anybody else about Lisp conditions and the official language definitions.</p>
<p>David Moon: I believe that the problem here lies in the differences between Zetalisp and X3J13 Common Lisp.  In the latter, which is what I was talking about (and I should have made that clearer &#8212; sorry!), there really isn&#8217;t any semantic distinction between the classes error, serious-condition, and condition. They are useful only as conventions/mnemonics for people who think that you can say something about whether a particular condition class is, in and of itself, an &#8220;error&#8221;.  That, of course, depends on what you mean by &#8220;error&#8221;, a word that I have intentionally avoided.</p>
<p>There are some conditions that, for all practical purposes, always indicate a bug, such as trying to compute the car of an array.  While it is remotely conceivable that a program might do that on purpose, including in its contract the condition that that would signal, it would almost certainly be poor programming style.  However, in my opinion, indexing off the end of an array is not, per se, a bug.  You can write a linear search that&#8217;s slightly faster by letting Lisp itself check for the &#8220;I&#8217;ve reached the end of the array&#8221; circumstance, rather than coding it yourself.</p>
<p>(Note: if the array is easy to modify, a better trick is to store a copy of the desired value at the end of the array, so that you&#8217;re guaranteed to find it, and then you can omit the length check.  But in many cases that&#8217;s not possible, and it&#8217;s not thread safe, and so on.  But I digress.)</p>
<p>What you&#8217;re definitely right about is that I have not yet considered Lisp&#8217;s ability do do &#8220;handler-bind&#8221;, which is very important.  I&#8217;ll talk about that in a future post.  &#8220;signal&#8221; can also be interesting, but I don&#8217;t think I&#8217;ve ever actually used it.</p>
<p>You are right about the contract of +.  Thanks for the correction.</p>
<p>The HyperSpec is annoyingly unspecific sometimes about unusual behaviors.  Just recently I was asked whether the :junk-allowed t option of parse-integer means that if you give parse-integer a string, it should return nil rather than signaling.  The spec is not clear on that, although it tends to suggest that it should signal, which is what I would choose if I were the spec writer.  But I wish these things were spelled out more clearly; and it would be even nicer if it specified exactly what condition class were signaled in such cases.</p>
<p>If we ever get to define a new Lisp, and we have enough time and resources to do all this (X3J13 did not), and we don&#8217;t have to subject ourselves to a design-by-huge-committee process (such as X3 requires), I hope we&#8217;d get this all right.  Java&#8217;s standard does  much better job in this respect.  But writing good standards is very difficult and time-consuming.  I helped a with the Java spec and it was clear that Guy Steele and Bill Joy worked very long and hard on it.  They also had the advantage of having Guy Steele, a great writer, and particularly a clear and deep thinker when it comes to programming languages.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dlweinreb</title>
		<link>http://danweinreb.org/blog/what-conditions-exceptions-are-really-about/comment-page-1#comment-368</link>
		<dc:creator>dlweinreb</dc:creator>
		<pubDate>Thu, 27 Mar 2008 10:38:51 +0000</pubDate>
		<guid isPermaLink="false">http://dlweinreb.wordpress.com/?p=27#comment-368</guid>
		<description><![CDATA[Will: When I was first learning to program in PL/I in 1974, standard advice was that it was a bad idea to use procedures (functions), because they were much too slow.

If you are forced to code in a language or operating environment in which the implementation of conditions/exceptions is very slow, then, of course, you have good reason to avoid using them in any performance-critical area.

Most software obeys the old 80/20 rule, or even 90/10 or 95/5: 5% of the code occupies 95% of the execution time. In such a situation, you&#039;d have to go back to using error codes or special returned values or multiple values, rather than exceptions, to denote unusual outcomes, in that part of the code. With any luck, you can use exceptions in the rest of the code.

One of the things I was going to talk about in the future was performance, especially the different characteristics of Lisp vs. Java performance. But I thought I should run some benchmarks to make sure I know what I&#039;m talking about. I think I know what I&#039;ll find, but one thing I&#039;ve learned over decades of software development is that benchmark results are very often surprising.  Measure, don&#039;t guess.]]></description>
		<content:encoded><![CDATA[<p>Will: When I was first learning to program in PL/I in 1974, standard advice was that it was a bad idea to use procedures (functions), because they were much too slow.</p>
<p>If you are forced to code in a language or operating environment in which the implementation of conditions/exceptions is very slow, then, of course, you have good reason to avoid using them in any performance-critical area.</p>
<p>Most software obeys the old 80/20 rule, or even 90/10 or 95/5: 5% of the code occupies 95% of the execution time. In such a situation, you&#8217;d have to go back to using error codes or special returned values or multiple values, rather than exceptions, to denote unusual outcomes, in that part of the code. With any luck, you can use exceptions in the rest of the code.</p>
<p>One of the things I was going to talk about in the future was performance, especially the different characteristics of Lisp vs. Java performance. But I thought I should run some benchmarks to make sure I know what I&#8217;m talking about. I think I know what I&#8217;ll find, but one thing I&#8217;ve learned over decades of software development is that benchmark results are very often surprising.  Measure, don&#8217;t guess.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Will Watts</title>
		<link>http://danweinreb.org/blog/what-conditions-exceptions-are-really-about/comment-page-1#comment-367</link>
		<dc:creator>Will Watts</dc:creator>
		<pubDate>Thu, 27 Mar 2008 08:22:16 +0000</pubDate>
		<guid isPermaLink="false">http://dlweinreb.wordpress.com/?p=27#comment-367</guid>
		<description><![CDATA[I was interested by your challenge of Eckel&#039;s description of exceptional conditions:

&quot;With an exceptional condition, you cannot continue processing because you don’t have the information necessary to deal with the problem in the current context. All you can do is jump out of the current context and relegate that problem to a higher context. This is what happens when you throw an exception.&quot;

Borland&#039;s Delphi Pascal compiler had a well-established exception model, not unlike Java&#039;s but without exception specifications for functions. When Borland ported its compiler from Windows to Linux (the Kylix compiler), it was found that Linux&#039;s model of exception handling was very different from Windows. In particular it was about two orders of magnitude slower in execution.

When Windows programs were recompiled under Linux - and this included Borland&#039;s own core Delphi libraries - they were unsurprisngly found to be much slower. At the time, the advice from Borland (or at least their then chief designer Danny Thorpe at a talk he gave) was that this indicated that programmers had been abusing the exception mechanism by using them for &#039;non exceptional circumstances&#039;. An exception (said Thorpe) should only be something that happens rarely; Borland felt entitled to incorporate this assumption into the design of its compiler. You, the Kylix customer, should recode where exceptions were frequently thrown, to avoid them.

Of course, Kylix has not been a very successful product... ;-) but I wondered what you thought of this point of view. It has certainly guided the way I have coded things ever since, and seems to be a fairly useful rule of thumb.]]></description>
		<content:encoded><![CDATA[<p>I was interested by your challenge of Eckel&#8217;s description of exceptional conditions:</p>
<p>&#8220;With an exceptional condition, you cannot continue processing because you don’t have the information necessary to deal with the problem in the current context. All you can do is jump out of the current context and relegate that problem to a higher context. This is what happens when you throw an exception.&#8221;</p>
<p>Borland&#8217;s Delphi Pascal compiler had a well-established exception model, not unlike Java&#8217;s but without exception specifications for functions. When Borland ported its compiler from Windows to Linux (the Kylix compiler), it was found that Linux&#8217;s model of exception handling was very different from Windows. In particular it was about two orders of magnitude slower in execution.</p>
<p>When Windows programs were recompiled under Linux &#8211; and this included Borland&#8217;s own core Delphi libraries &#8211; they were unsurprisngly found to be much slower. At the time, the advice from Borland (or at least their then chief designer Danny Thorpe at a talk he gave) was that this indicated that programmers had been abusing the exception mechanism by using them for &#8216;non exceptional circumstances&#8217;. An exception (said Thorpe) should only be something that happens rarely; Borland felt entitled to incorporate this assumption into the design of its compiler. You, the Kylix customer, should recode where exceptions were frequently thrown, to avoid them.</p>
<p>Of course, Kylix has not been a very successful product&#8230; <img src='http://danweinreb.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  but I wondered what you thought of this point of view. It has certainly guided the way I have coded things ever since, and seems to be a fairly useful rule of thumb.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Fogel</title>
		<link>http://danweinreb.org/blog/what-conditions-exceptions-are-really-about/comment-page-1#comment-366</link>
		<dc:creator>Karl Fogel</dc:creator>
		<pubDate>Wed, 26 Mar 2008 14:46:47 +0000</pubDate>
		<guid isPermaLink="false">http://dlweinreb.wordpress.com/?p=27#comment-366</guid>
		<description><![CDATA[Excellent and enlightening essay.  It would have been a bit easier to read if the quotes from Bruce Eckel had been formatted as quotes (I couldn&#039;t tell where they ended, and could only tell where they began because you introduced them with a separate paragraph), and if the code examples had been screen-formatted and monospace, so that indentation and line-breaks were preserved.]]></description>
		<content:encoded><![CDATA[<p>Excellent and enlightening essay.  It would have been a bit easier to read if the quotes from Bruce Eckel had been formatted as quotes (I couldn&#8217;t tell where they ended, and could only tell where they began because you introduced them with a separate paragraph), and if the code examples had been screen-formatted and monospace, so that indentation and line-breaks were preserved.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dlweinreb</title>
		<link>http://danweinreb.org/blog/what-conditions-exceptions-are-really-about/comment-page-1#comment-365</link>
		<dc:creator>dlweinreb</dc:creator>
		<pubDate>Tue, 25 Mar 2008 11:29:09 +0000</pubDate>
		<guid isPermaLink="false">http://dlweinreb.wordpress.com/?p=27#comment-365</guid>
		<description><![CDATA[I will provide an accurate answer to Dave Moon, after making very sure what the right reply is.  There are some subtle issues here, possibly depending on the differences between three dialects of Lisp: Zetalisp, Common Lisp the Language 2nd Edition, and ANSI Standard X3J13 Common Lisp. Stand by.]]></description>
		<content:encoded><![CDATA[<p>I will provide an accurate answer to Dave Moon, after making very sure what the right reply is.  There are some subtle issues here, possibly depending on the differences between three dialects of Lisp: Zetalisp, Common Lisp the Language 2nd Edition, and ANSI Standard X3J13 Common Lisp. Stand by.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
