<?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>yonkeltron &#187; Lisp</title>
	<atom:link href="http://yonkeltron.com/tag/lisp/feed/" rel="self" type="application/rss+xml" />
	<link>http://yonkeltron.com</link>
	<description>Temporary Exile</description>
	<lastBuildDate>Fri, 16 Jul 2010 18:45:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>The trouble with USE</title>
		<link>http://yonkeltron.com/2009/07/15/the-trouble-with-use/</link>
		<comments>http://yonkeltron.com/2009/07/15/the-trouble-with-use/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 18:25:27 +0000</pubDate>
		<dc:creator>Jonathan Magen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[F/OSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Lisp]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://yonkeltron.com/?p=553</guid>
		<description><![CDATA[Today, I was caught a little off-guard by a question regarding the USE directive in SQL. While, it stumped me, it did give me pause to think. First and foremost, it occurred to me that part of the reason that I was caught off-guard was because, in the past, I&#8217;ve been advised to stay away ]]></description>
			<content:encoded><![CDATA[<p>Today, I was caught a little off-guard by a question regarding the USE directive in SQL. While, it stumped me, it did give me pause to think. First and foremost, it occurred to me that part of the reason that I was caught off-guard was because, in the past, I&#8217;ve been advised to stay away from USE or similar directives in any language for a variety of reasons. For example, in languages like Ada, a use directive is a perfect way to completely clobber a namespace. Regarding the usage of JavaScript&#8217;s equivalent <code>with</code> operator, guru <a href="http://www.youtube.com/watch?v=hQVTIJBZook">Douglas Crockford has dire warnings</a> about actually writing programs which use it. Note, that the <code>using</code> directive from C#, is equivalent to an <code>import</code> in other languages (Python, Java) or even a <code>require</code> (Lisp, Ruby).</p>
<p>The perils of clobbering namespaces for the sake of convenience in any language are well know. Now, in some languages, a <code>use</code> directive is not always the culprit when namespaces get clobbered. Languages which also have an <code>as</code> clause can be dangerous as well because they obscure the true origin or name of a given object. </p>
<p>Part of the reason is that using USE or one of it&#8217;s friends is dangerous due to the fact that programmers risk forgetting that they used it. This kind of error is not restricted to the USE statement, however. For example, in Lisp, global variables are typically enclosed in asterisks by convention. So what, right? Well, early on in Practical Common Lisp, Peter Seibel points out that redirecting something like *standard-output* to point to another source, it would be all too easy to forget to put it back! Just like it&#8217;s easy to screw up redirection by forgetting to put it back, USE in most languages makes it quite easy to make trivial mistakes. </p>
<p>Now, I am not suggesting that these examples are directly equivalent. I am, however, making the point that, in this day and age, we are well aware of how easy it is to make careless mistakes and USE directives only make it easier. Say we have an example instance of an SQL server and there are a couple of databases in there. We want to work with two of them (called <code>panda</code> and <code>bamboo</code>) each but we&#8217;ve got quite a lot to do with one. For an example such as this, <a href="http://dev.mysql.com/doc/refman/5.0/en/use.html">databases like MySQL, provide USE</a> only to be compatible with <a href="http://en.wikipedia.org/wiki/Sybase#Products">Sybase</a> and even then only as a utility function.</p>
<p>In any case, we&#8217;re going back to the example. We&#8217;re at the prompt and we&#8217;re going to work with with our first database, panda. So to save ourselves trouble, we go forth with a <code>USE panda;</code> and then go about our business. Then, we&#8217;re ready to go ahead and delete a whole bunch of records from bamboo so we run our <code>DELETE * FROM trees;</code> and all should be well, right? WRONG! We forgot to switch to the right database by using <code>USE bamboo;</code> so now we&#8217;re in trouble. While this is a simplistic example, the world would be hard-pressed to find a competent programmer who&#8217;s never been tripped up by the most simple of errors.</p>
<p>It is for this reason that I am wary of USE and it&#8217;s friends. Unless there is a very good reason to USE USE, I suggest that programmers be very careful AS well AS when we USE AS. Together, they can be a tricky combo.</p>
]]></content:encoded>
			<wfw:commentRss>http://yonkeltron.com/2009/07/15/the-trouble-with-use/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Understanding CLOS</title>
		<link>http://yonkeltron.com/2009/02/17/understanding-clos/</link>
		<comments>http://yonkeltron.com/2009/02/17/understanding-clos/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 13:42:43 +0000</pubDate>
		<dc:creator>Jonathan Magen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Lisp]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://yonkeltron.com/?p=487</guid>
		<description><![CDATA[I&#8217;ve been doing much messing about with Common Lisp lately and have had a hiccup or two regarding the Common Lisp Object System (CLOS). I&#8217;ve gone back and re-read the &#8220;object reorientation&#8221; chapters from PCL (which you should buy) but have gotten confused. This is nothing against PCL as it is a wonderful book but ]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing much messing about with Common Lisp lately and have had a hiccup or two regarding the Common Lisp Object System (CLOS). I&#8217;ve gone back and re-read the &#8220;object reorientation&#8221; chapters from <a href="http://gigamonkeys.com/book/">PCL</a> (which <a href="http://www.amazon.com/Practical-Common-Lisp-Peter-Seibel/dp/1590592395/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1234849288&amp;sr=1-1">you should buy</a>) but have gotten confused. This is nothing against PCL as it is a wonderful book but what can I say? I&#8217;m used to object-orientation looking more like the Python/Ruby/Smalltalk (classes) or JavaScript (prototypes).</p>
<p>So, I went digging about and found two links which I&#8217;ll be trying out.</p>
<ul>
<li><a href="http://cl-cookbook.sourceforge.net/clos-tutorial/index.html">Fundamentals of CLOS</a></li>
<li><a href="http://www.aiai.ed.ac.uk/~jeff/clos-guide.html">A brief guide to CLOS</a></li>
<li><a href="http://eval.apply.googlepages.com/guide.html">Warp speed introduction to CLOS</a> (suggested by xach)</li>
</ul>
<p>If there are any other good ones, let me know and I&#8217;ll add them.</p>
]]></content:encoded>
			<wfw:commentRss>http://yonkeltron.com/2009/02/17/understanding-clos/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
