<?xml version="1.0" encoding="UTF-8"?><feed
	xmlns="http://www.w3.org/2005/Atom"
	xmlns:thr="http://purl.org/syndication/thread/1.0"
	xml:lang="en"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" >
	<title type="text">Joey Gibson&#039;s Blog</title>
	<subtitle type="text">Java, Clojure, Scala, Ruby, Lisp, Knitting, Crocheting, Sewing, Ukulele, Electric Bass, and much more!</subtitle>

	<updated>2017-04-27T11:28:40Z</updated>

	<link rel="alternate" type="text/html" href="https://joeygibson.com" />
	<id>http://joeygibson.com/feed/atom/</id>
	<link rel="self" type="application/atom+xml" href="https://joeygibson.com/feed/atom/" />

	<generator uri="http://wordpress.com/">WordPress.com</generator>
<link rel="search" type="application/opensearchdescription+xml" href="https://joeygibson.com/osd.xml" title="Joey Gibson&#039;s Blog" />
<link rel="search" type="application/opensearchdescription+xml" href="https://s1.wp.com/opensearch.xml" title="WordPress.com" />
	<link rel='hub' href='https://joeygibson.com/?pushpress=hub' />
	<entry>
		<author>
			<name>joeygibson</name>
							<uri>http://joeygibson.com</uri>
						</author>

		<title type="html"><![CDATA[Go Dependency Managers]]></title>
		<link rel="alternate" type="text/html" href="https://joeygibson.com/2017/04/27/go-dependency-managers/" />

		<id>http://joeygibson.com/?p=2574</id>
		<updated>2017-04-27T11:28:40Z</updated>
		<published>2017-04-27T11:28:40Z</published>
		<category scheme="https://joeygibson.com" term="tech" /><category scheme="https://joeygibson.com" term="go" /><category scheme="https://joeygibson.com" term="golang" />
		<summary type="html"><![CDATA[This past Tuesday, I gave a talk at the April meeting of the  Go User Group Atlanta, discussing and comparing four different Go dependency managers. The four I discussed were godep govendor glide dep I also touched, very briefly, on gb.  The talk went pretty well, I think, and there was good discussion during it. &#8230; <a href="https://joeygibson.com/2017/04/27/go-dependency-managers/" class="more-link">Continue reading <span class="screen-reader-text">Go Dependency Managers</span></a>]]></summary>

					<content type="html" xml:base="https://joeygibson.com/2017/04/27/go-dependency-managers/"><![CDATA[<p>This past Tuesday, I gave a talk at the April meeting of the  <a href="https://www.meetup.com/Go-Users-Group-Atlanta/">Go User Group Atlanta</a>, discussing and comparing four different <a href="https://golang.org/">Go</a> dependency managers. The four I discussed were</p>
<ul>
<li><a href="https://github.com/tools/godep">godep</a></li>
<li><a href="https://github.com/kardianos/govendor">govendor</a></li>
<li><a href="https://github.com/Masterminds/glide">glide</a></li>
<li><a href="https://github.com/golang/dep">dep</a></li>
</ul>
<p>I also touched, very briefly, on <a href="https://getgb.io/">gb</a>.  The talk went pretty well, I think, and there was good discussion during it.</p>
<p>If you&#8217;re interested, here are the slides, and links to the four demo projects.</p>
<ul>
<li><a href="https://joeygibson.com/wp-content/uploads/2017/04/godependencymanagers.pdf">GoDependencyManagers.pdf</a></li>
<li><a href="https://github.com/joeygibson/dep-demo">https://github.com/joeygibson/dep-demo</a></li>
<li><a href="https://github.com/joeygibson/govendor-demo">https://github.com/joeygibson/govendor-demo</a></li>
<li><a href="https://github.com/joeygibson/glide-demo">https://github.com/joeygibson/glide-demo</a></li>
<li><a href="https://github.com/joeygibson/dep-demo">https://github.com/joeygibson/dep-demo</a></li>
</ul>
<p>And even though I didn&#8217;t use it during the presentation, I did knock up a demo of gb, which can be found at <a href="https://github.com/joeygibson/gb-demo">https://github.com/joeygibson/gb-demo</a>.</p>
]]></content>
		
			</entry>
		<entry>
		<author>
			<name>joeygibson</name>
							<uri>http://joeygibson.com</uri>
						</author>

		<title type="html"><![CDATA[Adding Vertical Stripes To A Knitting Project]]></title>
		<link rel="alternate" type="text/html" href="https://joeygibson.com/2016/03/28/adding-vertical-stripes-to-a-knitting-project/" />

		<id>http://joeygibson.com/?p=2563</id>
		<updated>2016-03-29T02:49:08Z</updated>
		<published>2016-03-29T02:49:08Z</published>
		<category scheme="https://joeygibson.com" term="general" /><category scheme="https://joeygibson.com" term="crochet" /><category scheme="https://joeygibson.com" term="knitting" /><category scheme="https://joeygibson.com" term="yarn" />
		<summary type="html"><![CDATA[I read about this technique in the latest issue of KnitScene magazine, but then forgot where I saw it. I tried to describe it in episode 9 of the Unraveling podcast, but I started having doubts about how I was explaining it. So when I edited the episode, I cut that segment out. Then, last week, Knitting &#8230; <a href="https://joeygibson.com/2016/03/28/adding-vertical-stripes-to-a-knitting-project/" class="more-link">Continue reading <span class="screen-reader-text">Adding Vertical Stripes To A Knitting&#160;Project</span></a>]]></summary>

					<content type="html" xml:base="https://joeygibson.com/2016/03/28/adding-vertical-stripes-to-a-knitting-project/"><![CDATA[<p>I read about this technique in the latest issue of <a href="http://www.interweavestore.com/knitting/knitting-magazines/knitting-magazines-knitscene" target="_blank">KnitScene</a> magazine, but then forgot where I saw it. I tried to describe it in <a href="http://www.unravelingpodcast.com/2016/03/16/episode-9-down-with-dst/" target="_blank">episode 9 of the Unraveling podcast</a>, but I started having doubts about how I was explaining it. So when I edited the episode, I cut that segment out. Then, last week, <a href="http://www.knittingdaily.com/how-to-knit/knitting-and-crochet-meet/" target="_blank">Knitting Daily published the same story</a>, so I decided to give it a try.</p>
<p>We all know that if you want to add a horizontal stripe to your knitting project, you just need to change yarns, and weave in the ends when you&#8217;re done. But what if you want to have vertical stripes? This technique actually marries knitting and crochet to solve this problem.</p>
<p>The idea is that if you&#8217;re knitting in stockinette, when you get where you want your vertical stripe, you purl that column on the knit rows, and knit it on the purl rows. This results in a trough, or channel, on the right side that is recessed. After you&#8217;ve finished all the knit work, you switch to your crochet hook. You insert the hook, front to back, at the bottom of the column, pick up your contrasting color, and pull it to the front. Then, with the loop you just pulled through still on the hook, insert the hook in the next step of the ladder, front to back, pick up the contrasting color, pull it through, and then pull it through the loop from the previous step. This is just a regular crochet slip stitch. Continue this up the ladder, until you reach the top. Cut the yarn, and weave in the ends.</p>
<p>In the sample I made, I did four rows of garter stitch at the top and bottom, and three stitches of garter on the left and right, as a border. I knitted in stockinette for the rest of it, which, I think, was fourteen stitches. When I hit the seventh and eighth columns, I purled on the knit side, and knitted on the purl side. In retrospect, I should have just done a single column; I will only do one column at a time in the future.</p>
<div align="center"><a href="https://joeygibson.com/wp-content/uploads/2016/03/img_3611.jpg"><img data-attachment-id="2564" data-permalink="https://joeygibson.com/2016/03/28/adding-vertical-stripes-to-a-knitting-project/img_3611/" data-orig-file="https://joeygibson.com/wp-content/uploads/2016/03/img_3611.jpg" data-orig-size="1280,960" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;2.2&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;iPhone 6s Plus&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1458686214&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;4.15&quot;,&quot;iso&quot;:&quot;100&quot;,&quot;shutter_speed&quot;:&quot;0.066666666666667&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="IMG_3611" data-image-description="" data-image-caption="" data-medium-file="https://joeygibson.com/wp-content/uploads/2016/03/img_3611.jpg?w=300" data-large-file="https://joeygibson.com/wp-content/uploads/2016/03/img_3611.jpg?w=676" class="wp-image-2564 size-medium alignleft" src="https://joeygibson.com/wp-content/uploads/2016/03/img_3611.jpg?w=300&#038;h=225" alt="IMG_3611" width="300" height="225" srcset="https://joeygibson.com/wp-content/uploads/2016/03/img_3611.jpg?w=300 300w, https://joeygibson.com/wp-content/uploads/2016/03/img_3611.jpg?w=600 600w, https://joeygibson.com/wp-content/uploads/2016/03/img_3611.jpg?w=150 150w" sizes="(max-width: 300px) 100vw, 300px" /></a><a href="https://joeygibson.com/wp-content/uploads/2016/03/img_3612.jpg"><img data-attachment-id="2565" data-permalink="https://joeygibson.com/2016/03/28/adding-vertical-stripes-to-a-knitting-project/img_3612/" data-orig-file="https://joeygibson.com/wp-content/uploads/2016/03/img_3612.jpg" data-orig-size="1280,960" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;2.2&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;iPhone 6s Plus&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1458686221&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;4.15&quot;,&quot;iso&quot;:&quot;100&quot;,&quot;shutter_speed&quot;:&quot;0.066666666666667&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="IMG_3612" data-image-description="" data-image-caption="" data-medium-file="https://joeygibson.com/wp-content/uploads/2016/03/img_3612.jpg?w=300" data-large-file="https://joeygibson.com/wp-content/uploads/2016/03/img_3612.jpg?w=676" class="wp-image-2565 size-medium alignleft" src="https://joeygibson.com/wp-content/uploads/2016/03/img_3612.jpg?w=300&#038;h=225" alt="IMG_3612" width="300" height="225" srcset="https://joeygibson.com/wp-content/uploads/2016/03/img_3612.jpg?w=300 300w, https://joeygibson.com/wp-content/uploads/2016/03/img_3612.jpg?w=600 600w, https://joeygibson.com/wp-content/uploads/2016/03/img_3612.jpg?w=150 150w" sizes="(max-width: 300px) 100vw, 300px" /></a></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>In the photo on the left, you can see the whole piece, with the recessed columns near the right. The photo on the right gives you a bit more perspective on how deep the column is.</p>
<p>The next step is to do the slip stitches. I failed to take a photo during the procedure, instead only taking them when I was done. You can refer to the original article to see it in action. Below are two photos showing the finished product. I didn&#8217;t weave in the ends, since it was just a test, but you would need to do that to really be finished.</p>
<div align="center"></div>
<p><a href="https://joeygibson.com/wp-content/uploads/2016/03/img_3615.jpg" rel="attachment wp-att-2568"><img data-attachment-id="2568" data-permalink="https://joeygibson.com/2016/03/28/adding-vertical-stripes-to-a-knitting-project/img_3615/" data-orig-file="https://joeygibson.com/wp-content/uploads/2016/03/img_3615.jpg" data-orig-size="1280,960" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;2.2&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;iPhone 6s Plus&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1458688041&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;4.15&quot;,&quot;iso&quot;:&quot;100&quot;,&quot;shutter_speed&quot;:&quot;0.066666666666667&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="IMG_3615" data-image-description="" data-image-caption="" data-medium-file="https://joeygibson.com/wp-content/uploads/2016/03/img_3615.jpg?w=300" data-large-file="https://joeygibson.com/wp-content/uploads/2016/03/img_3615.jpg?w=676" class="size-medium wp-image-2568 alignleft" src="https://joeygibson.com/wp-content/uploads/2016/03/img_3615.jpg?w=300&#038;h=225" alt="IMG_3615" width="300" height="225" srcset="https://joeygibson.com/wp-content/uploads/2016/03/img_3615.jpg?w=300 300w, https://joeygibson.com/wp-content/uploads/2016/03/img_3615.jpg?w=600 600w, https://joeygibson.com/wp-content/uploads/2016/03/img_3615.jpg?w=150 150w" sizes="(max-width: 300px) 100vw, 300px" /></a><a href="https://joeygibson.com/wp-content/uploads/2016/03/img_3616.jpg" rel="attachment wp-att-2569"><img loading="lazy" data-attachment-id="2569" data-permalink="https://joeygibson.com/2016/03/28/adding-vertical-stripes-to-a-knitting-project/img_3616/" data-orig-file="https://joeygibson.com/wp-content/uploads/2016/03/img_3616.jpg" data-orig-size="1280,960" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;2.2&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;iPhone 6s Plus&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1458688047&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;4.15&quot;,&quot;iso&quot;:&quot;80&quot;,&quot;shutter_speed&quot;:&quot;0.1&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="IMG_3616" data-image-description="" data-image-caption="" data-medium-file="https://joeygibson.com/wp-content/uploads/2016/03/img_3616.jpg?w=300" data-large-file="https://joeygibson.com/wp-content/uploads/2016/03/img_3616.jpg?w=676" class="size-medium wp-image-2569 alignleft" src="https://joeygibson.com/wp-content/uploads/2016/03/img_3616.jpg?w=300&#038;h=225" alt="IMG_3616" width="300" height="225" srcset="https://joeygibson.com/wp-content/uploads/2016/03/img_3616.jpg?w=300 300w, https://joeygibson.com/wp-content/uploads/2016/03/img_3616.jpg?w=600 600w, https://joeygibson.com/wp-content/uploads/2016/03/img_3616.jpg?w=150 150w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>It turned out to be harder than I expected to make this stitch look good. I&#8217;ve done a lot of crochet, but the way I had to hold the fabric, and how you pulled the yarn through, made it harder. If I do this technique again, I believe I will get a crisper stripe than I got this time.</p>
<p><a href="http://www.knittingdaily.com/how-to-knit/knitting-and-crochet-meet/" target="_blank">Go read the article</a> and give it a try.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="https://joeygibson.com/2016/03/28/adding-vertical-stripes-to-a-knitting-project/#comments" thr:count="1" />
			<link rel="replies" type="application/atom+xml" href="https://joeygibson.com/2016/03/28/adding-vertical-stripes-to-a-knitting-project/feed/atom/" thr:count="1" />
			<thr:total>1</thr:total>
			</entry>
		<entry>
		<author>
			<name>joeygibson</name>
							<uri>http://joeygibson.com</uri>
						</author>

		<title type="html"><![CDATA[Knitting Cables Is Easier Than It Looks]]></title>
		<link rel="alternate" type="text/html" href="https://joeygibson.com/2015/08/28/knitting-cables-is-easier-than-it-looks/" />

		<id>http://joeygibson.com/?p=2559</id>
		<updated>2015-09-04T22:29:30Z</updated>
		<published>2015-08-29T02:12:44Z</published>
		<category scheme="https://joeygibson.com" term="general" /><category scheme="https://joeygibson.com" term="knitting" /><category scheme="https://joeygibson.com" term="yarn" />
		<summary type="html"><![CDATA[Last Saturday, I went on a field trip with my knitting guild to Yarn Rhapsody, in Dawsonville Gainesville, GA. While we were there, I was looking at a cable knit sweater, and I remarked to one of my guild mates about how hard it looked. She looked right at me and said, &#8220;It&#8217;s so easy, you won&#8217;t &#8230; <a href="https://joeygibson.com/2015/08/28/knitting-cables-is-easier-than-it-looks/" class="more-link">Continue reading <span class="screen-reader-text">Knitting Cables Is Easier Than It&#160;Looks</span></a>]]></summary>

					<content type="html" xml:base="https://joeygibson.com/2015/08/28/knitting-cables-is-easier-than-it-looks/"><![CDATA[<p style="text-align:center;"><a href="https://flic.kr/p/xX3KzV"><img loading="lazy" src="https://live.staticflickr.com/5715/20970003931_3250a42530_z.jpg" alt="IMG_2599" width="640" height="480" /></a></p>
<p>Last Saturday, I went on a field trip with my <a href="http://www.clicksandsticks.com/" target="_blank">knitting guild</a> to <a href="http://www.yarnrhapsody.com/" target="_blank">Yarn Rhapsody</a>, in <span style="text-decoration:line-through;">Dawsonville</span> Gainesville, GA. While we were there, I was looking at a cable knit sweater, and I remarked to one of my guild mates about how hard it looked. She looked right at me and said, &#8220;It&#8217;s so easy, you won&#8217;t believe it.&#8221;</p>
<p>So Wednesday, I decided to try my hand at it. I went to Youtube, and searched for &#8220;cable knitting&#8221;, and watched <a href="https://www.youtube.com/watch?v=ly1vct5ceAc" target="_blank">the first video that came up</a>. It&#8217;s 8:15, and really showed how easy the technique is. After watching it once, I grabbed some cheap worsted weight yarn, a set of US 6 needles, my row counter, and the cable needle that came with the starter kit I bought a couple of months ago, and started knitting.</p>
<p>The actual cable technique is really simple, but the field surrounding the sample from the video does still require accurate counting. I wasn&#8217;t paying attention, and ended up completely screwing it up. I ripped it out an decided to try again, but it was late, so I set it aside until I had more time.</p>
<p>And that&#8217;s what I did today after work. The sample in the photos took me about two hours, from start to finish. I&#8217;m sure that if you were making something like a sweater, where there are parallel cables, that it would be more difficult than this little swatch, since you&#8217;d have to keep more numbers in your head, but the basics are simple.</p>
<p>This was fun to make. <a href="https://flic.kr/s/aHskiCw54n" target="_blank">Here&#8217;s the album</a>.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="https://joeygibson.com/2015/08/28/knitting-cables-is-easier-than-it-looks/#comments" thr:count="4" />
			<link rel="replies" type="application/atom+xml" href="https://joeygibson.com/2015/08/28/knitting-cables-is-easier-than-it-looks/feed/atom/" thr:count="4" />
			<thr:total>4</thr:total>
			</entry>
		<entry>
		<author>
			<name>joeygibson</name>
							<uri>http://joeygibson.com</uri>
						</author>

		<title type="html"><![CDATA[Wee Little Socks]]></title>
		<link rel="alternate" type="text/html" href="https://joeygibson.com/2015/08/25/wee-little-socks/" />

		<id>http://joeygibson.com/?p=2555</id>
		<updated>2015-08-25T04:59:09Z</updated>
		<published>2015-08-25T04:59:09Z</published>
		<category scheme="https://joeygibson.com" term="general" /><category scheme="https://joeygibson.com" term="knitting" /><category scheme="https://joeygibson.com" term="yarn" />
		<summary type="html"><![CDATA[I got the book Sensational Knitted Socks, by Charlene Schurch, from my local public library. In this book, Ms. Schurch explains the basics of sock knitting, including the parts of a sock, and the various techniques involved in creating them. The first project is what she calls a &#8220;class sock&#8221;; that is, the sock that &#8230; <a href="https://joeygibson.com/2015/08/25/wee-little-socks/" class="more-link">Continue reading <span class="screen-reader-text">Wee Little Socks</span></a>]]></summary>

					<content type="html" xml:base="https://joeygibson.com/2015/08/25/wee-little-socks/"><![CDATA[<p style="text-align:center;"><a href="https://flic.kr/p/xuZ4WX"><img loading="lazy" src="https://live.staticflickr.com/5653/20675056359_d9060c8636_z.jpg" alt="IMG_2583" width="640" height="480" /></a></p>
<p>I got the book Sensational Knitted Socks, by Charlene Schurch, from my local public library. In this book, Ms. Schurch explains the basics of sock knitting, including the parts of a sock, and the various techniques involved in creating them. The first project is what she calls a &#8220;class sock&#8221;; that is, the sock that she teaches first when she is teaching a knitting class. It&#8217;s much smaller than a regular sock, but has all the constituent parts: cuff, leg, heel flap, heel turn, gusset, foot, and toe. You cast on 32 stitches across four DPNs (double-pointed needles), five DPNs, or two sets of circular needles; less than half of what I would need for a sock for myself. I chose to use the four DPNs.</p>
<p>I&#8217;ve now knitted three of this sock. The first I did over several days spanning the last two weeks. I would make really good progress, and then something catastrophic would happen. Mostly this involved counting stitches only to discover too many, or too few, in such a way that the pattern was destroyed. Once or twice one of the needles slipped out, and before I could stop it, multiple stitches were heading for the hills. I corrected several problems, but in many cases, it was easier, and more aesthetically pleasing, just to unravel the whole thing and start over. The last time I started that first sock turned out to be the charm, and it took me about ten hours to finish it. It was decent, but had a glaringly obvious purl-where-it-should-have-been-knit row, which I didn&#8217;t notice until about ten rows ahead of it.</p>
<p>Lessons learned from this sock:</p>
<ul>
<li>be fanatical about counting stitches</li>
<li>be fanatical about checking each row, to ensure the pattern is intact</li>
</ul>
<p>I was able to do the second sock, from start to finish, in about five hours on Saturday.  The only real issue with this one was a small gap on each side of the gusset. This is a common problem when knitting socks. The biggest accomplishment with this sock was that once I started, I didn&#8217;t have to start over. And I knitted where I was supposed to knit, and purled where I was supposed to purl.</p>
<p>I started the third sock on Sunday, and was making fantastic progress, when I got distracted, lost count, lost a stitch, had it escape as I tried to fix it, and ended up unraveling and starting over. I got through the heel turn last night, and then resumed tonight. After a couple of hours, I was finished. I didn&#8217;t make any further errors, and it looks like it matches the second one.</p>
<p>Next, I&#8217;ll be moving on to an actual pair of socks, that I will actually wear.</p>
<p>You can see <a href="https://www.flickr.com/gp/joeygibson/j5T4i2" target="_blank">the full album at Flickr</a>.</p>
]]></content>
		
			</entry>
		<entry>
		<author>
			<name>joeygibson</name>
							<uri>http://joeygibson.com</uri>
						</author>

		<title type="html"><![CDATA[I&#8217;ve Taken Up Knitting and Crocheting]]></title>
		<link rel="alternate" type="text/html" href="https://joeygibson.com/2015/08/14/ive-taken-up-knitting-and-crocheting/" />

		<id>http://joeygibson.com/?p=2538</id>
		<updated>2015-08-15T01:49:00Z</updated>
		<published>2015-08-15T01:49:01Z</published>
		<category scheme="https://joeygibson.com" term="general" /><category scheme="https://joeygibson.com" term="crochet" /><category scheme="https://joeygibson.com" term="knitting" /><category scheme="https://joeygibson.com" term="yarn" />
		<summary type="html"><![CDATA[About two months ago, I decided to try crochet. I did this, mainly, so I could have a hobby that didn&#8217;t make much noise, that I could do while we were watching TV. My Rubik&#8217;s Cubes made too much noise, and crochet seemed like it would fit the bill. Shortly after I got started, two &#8230; <a href="https://joeygibson.com/2015/08/14/ive-taken-up-knitting-and-crocheting/" class="more-link">Continue reading <span class="screen-reader-text">I&#8217;ve Taken Up Knitting and&#160;Crocheting</span></a>]]></summary>

					<content type="html" xml:base="https://joeygibson.com/2015/08/14/ive-taken-up-knitting-and-crocheting/"><![CDATA[<p>About two months ago, I decided to try crochet. I did this, mainly, so I could have a hobby that didn&#8217;t make much noise, that I could do while we were watching TV. My Rubik&#8217;s Cubes made too much noise, and crochet seemed like it would fit the bill. Shortly after I got started, two of my friends were both extolling the virtues of knitting, so I decided to give that a try, too. One of those friends documents all of his work at <a href="http://www.knittingdaddy.com/">Knitting Daddy</a>.</p>
<p>I&#8217;ve been mostly alternating between arts: knit one, crochet two, etc. <img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> I&#8217;ve been posting photos of my finished objects to <a href="https://www.flickr.com/photos/joeygibson">Flickr</a>, but I am going to try to start posting here about the work, not just pictures of it.</p>
<p>Here&#8217;s what I&#8217;ve done so far. Details of all of these projects, including patterns and yarn info, can be found on my Ravelry page. I&#8217;m <a href="http://www.ravelry.com/people/joeygibson">joeygibson</a> over there.</p>
<p><strong>First Project: A Knit Scarf</strong></p>
<p>I did several test swatches before actually starting a proper project, but this is it. It took me a week to make.</p>
<p style="text-align:left;"><a href="https://flic.kr/p/vE98p8"><img loading="lazy" src="https://live.staticflickr.com/444/19465958905_fe9b736dc2_z.jpg" alt="FullSizeRender 2" width="640" height="480" /></a></p>
<p>Album: <a href="https://flic.kr/s/aHskf3eb4m">https://flic.kr/s/aHskf3eb4m</a></p>
<p><strong>Second Project: A Knit Crown</strong></p>
<p>This one was a bit silly. Several of my ukulele friends were making them, so I decided to make one, too. This one took a few days.</p>
<p><a href="https://flic.kr/p/vV7fTw"><img loading="lazy" src="https://live.staticflickr.com/307/19635341316_1912ff2ff7_z.jpg" alt="FullSizeRender 2" width="640" height="480" /></a></p>
<p>Album: <a href="https://flic.kr/s/aHskg2beCq">https://flic.kr/s/aHskg2beCq</a></p>
<p><strong>Third Project: Crochet Fingerless Gloves</strong></p>
<p>This one was interesting. I didn&#8217;t realize when I started that they were adult smalls, so there was no way they would fit any of us. I continued making them, though, just for fun. I donated them to charity the other day, so maybe someone will get some use out of them. They weren&#8217;t supposed to be this big, but I got carried away one night, and did a few too many rows. Rather than frog them, I went ahead and made the other the same length. So they are more like fingerless opera gloves.</p>
<p><a href="https://flic.kr/p/w55Tqi"><img loading="lazy" src="https://live.staticflickr.com/264/19736922445_33a28ce76b_z.jpg" alt="IMG_2476" width="480" height="640" /></a></p>
<p>Album: <a href="https://flic.kr/s/aHskgiD7Bv">https://flic.kr/s/aHskgiD7Bv</a></p>
<p><strong>Fourth Project: Knit Potato Chip Scarf</strong></p>
<p>This one took about ten days, but I love the results. I actually bought this yarn before I had a plan for what to do with it. It&#8217;s a silk blend that really looks nice up close. I&#8217;m going to enter this in the county fair, and then my wife gets to keep it.</p>
<p><a href="https://flic.kr/p/whPwqZ"><img loading="lazy" src="https://live.staticflickr.com/320/19881039609_7298c502bc_z.jpg" alt="IMG_2525" width="640" height="480" /></a></p>
<p>Album: <a href="https://flic.kr/s/aHskgriFrd">https://flic.kr/s/aHskgriFrd</a></p>
<p><strong>Fifth Project: Adorable Cthulhu</strong></p>
<p>I saw the pattern for this one and knew I had to make one. The person who posted the pattern said she crocheted it with double strands, but I just did it as a single. I figured since this was my first somewhat complicated project, I didn&#8217;t want to complicate it further by having to deal with two strands of yarn. I will make another one, eventually, with two strands.</p>
<p><a href="https://flic.kr/p/wPgwtz"><img loading="lazy" src="https://live.staticflickr.com/364/20225607551_d087c35bda_z.jpg" alt="IMG_2543" width="640" height="480" /></a></p>
<p>Album: <a href="https://flic.kr/s/aHskhpJUvr">https://flic.kr/s/aHskhpJUvr</a></p>
<p><strong>Odds &#8216;n&#8217; Ends</strong></p>
<p>These can&#8217;t really be called a project, they are just some noodling. I bought a book called <a href="http://www.amazon.com/Flowers-Leaves-Stitch-Patterns-Youll/dp/1938867599/ref=sr_1_1?s=books&amp;ie=UTF8&amp;qid=1439603273&amp;sr=1-1&amp;keywords=flowers+and+leaves+70+stitch+patterns">Flowers and Leaves: 70 Stitch Patterns You&#8217;ll Love To Knit</a>, and I&#8217;ve been working some test swatches from there. The first is a little tree.</p>
<p><a href="https://flic.kr/p/xcVzfZ"><img loading="lazy" src="https://live.staticflickr.com/391/20481994081_5dcd53dcef_z.jpg" alt="IMG_2560" width="640" height="480" /></a></p>
<p>Album: <a href="https://flic.kr/s/aHski3qHwX">https://flic.kr/s/aHski3qHwX</a></p>
<p>and the second is called &#8220;Leaves of Grass&#8221;, and sort of looks like grass.</p>
<p><a href="https://flic.kr/p/xhooKC"><img loading="lazy" src="https://live.staticflickr.com/5762/20532492746_591dda3d17_z.jpg" alt="IMG_2567" width="640" height="480" /></a></p>
<p>Album: <a href="https://flic.kr/s/aHskeGgH8W">https://flic.kr/s/aHskeGgH8W</a></p>
<p>This weekend, I&#8217;m going to start on some socks.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="https://joeygibson.com/2015/08/14/ive-taken-up-knitting-and-crocheting/#comments" thr:count="1" />
			<link rel="replies" type="application/atom+xml" href="https://joeygibson.com/2015/08/14/ive-taken-up-knitting-and-crocheting/feed/atom/" thr:count="1" />
			<thr:total>1</thr:total>
			</entry>
		<entry>
		<author>
			<name>joeygibson</name>
							<uri>http://joeygibson.com</uri>
						</author>

		<title type="html"><![CDATA[LoLClojure &#8211; Chapter 3, Continued]]></title>
		<link rel="alternate" type="text/html" href="https://joeygibson.com/2014/07/13/lolclojure-chapter-3-continued/" />

		<id>http://joeygibson.com/?p=2505</id>
		<updated>2014-07-13T04:05:15Z</updated>
		<published>2014-07-13T04:04:19Z</published>
		<category scheme="https://joeygibson.com" term="tech" /><category scheme="https://joeygibson.com" term="clojure" /><category scheme="https://joeygibson.com" term="java" /><category scheme="https://joeygibson.com" term="lisp" /><category scheme="https://joeygibson.com" term="lolclojure" />
		<summary type="html"><![CDATA[I didn&#8217;t intend to wait a month between installments, but here we are. When we left off, we were discussing a couple of implementation os exponentiation, and how to print things out. We made it up to page 35. Next, the book discusses the main Lisp data structure: the list. It discusses how Lisp assumes &#8230; <a href="https://joeygibson.com/2014/07/13/lolclojure-chapter-3-continued/" class="more-link">Continue reading <span class="screen-reader-text">LoLClojure &#8211; Chapter 3,&#160;Continued</span></a>]]></summary>

					<content type="html" xml:base="https://joeygibson.com/2014/07/13/lolclojure-chapter-3-continued/"><![CDATA[<p>I didn&#8217;t intend to wait a month between installments, but here we are. When we left off, we were discussing a couple of implementation os exponentiation, and how to print things out. We made it up to page 35.</p>
<p>Next, the book discusses the main Lisp data structure: the list. It discusses how Lisp assumes that in any list, the first item in that list is a command of some sort, and to change that behavior, you place a single quote, <code>'</code>, before the list. Clojure has the same expectation, so that if you enter this at a REPL:</p>
<pre class="brush: clojure; title: ; notranslate">(foo bar baz)</pre>
<p>you will get the following error,</p>
<p><code>CompilerException java.lang.RuntimeException: Unable to resolve symbol: foo in this context...</code></p>
<p>indicating that it tried to execute that list as a function call, but failed to find a function called &#8220;foo&#8221;. Just as in Lisp, you can quote the list by prefixing it with a single quote. Thus, this</p>
<pre class="brush: clojure; title: ; notranslate">'(foo bar baz)</pre>
<p>is now treated as data, instead of a function call. Similarly, this is a function call</p>
<pre class="brush: clojure; title: ; notranslate">(expt 2 3)</pre>
<p>is a call to the expt function, while this</p>
<pre class="brush: clojure; title: ; notranslate">'(expt 2 3)</pre>
<p>is a list with three elements.</p>
<p>Barski then goes into a length discussion about the list and its structure, specifically the cons cell. In Lisp, a cons cell is a pair of items, and its list is implemented as a linked list, with the second part of each cons cell linking to the next cons cell in the list. Clojure does not have a cons cell, and so does not implement its lists in terms of them. Lisp uses cons cells individually as simple pairs, too, and you can simulate this use by using a 2-element vector, like so</p>
<pre class="brush: clojure; title: ; notranslate">(def pair [:a :b])</pre>
<p>Beginning on page 38, Barski starts discussing the various functions that operate on lists. I will provide the Clojure equivalent functions, where possible.</p>
<h2>The cons Function</h2>
<p>In Lisp, you create cons cells using the <code>cons</code> function. The result is a cons cell with the two arguments set as the left and right portions of the cell, or just a left-side, if the right is <code>nil</code>. You can simulate this, using the <code>vector</code> function</p>
<pre class="brush: clojure; title: ; notranslate">(vector 'chicken 'cat)</pre>
<p>or as a literal vector</p>
<pre class="brush: clojure; title: ; notranslate">['chicken 'cat]</pre>
<p>Clojure does have a <code>cons</code> function, but it functions somewhat differently than its Lisp counterpart. It prepends its first argument onto its second argument, <em>which must be a list-like thing</em>, returning the result as a list. So this in Lisp</p>
<pre class="brush: clojure; title: ; notranslate">(cons 'chicken 'cat)</pre>
<p>can&#8217;t be done using Clojure&#8217;s cons function, since the second argument is not a list-like thing. If you try, you will get this error</p>
<p><code>IllegalArgumentException Don't know how to create ISeq from: clojure.lang.Symbol  clojure.lang.RT.seqFrom (RT.java:505)</code></p>
<p>If you need to create a sequence of a chicken and a cat, use one of these:</p>
<pre class="brush: clojure; title: ; notranslate">(vector 'chicken 'cat)
['chicken 'cat]
'(chicken cat)</pre>
<p>Obviously, the first two create vectors, while the last one create a list. </p>
<p>In Lisp, the empty list and <code>nil</code> are equivalent, but not so in Clojure. However, these two examples of consing a value and and empty list, and a value and nil, behave essentially the same, returning a list of just the first element.</p>
<pre class="brush: clojure; title: ; notranslate">
(cons 'chicken 'nil) ; (chicken)
(cons 'chicken ())   ; (chicken)</pre>
<p>The next three examples function effectively the same, though remember that what you are getting back is not a linked list of cons cells, as you would in Lisp. </p>
<pre class="brush: clojure; title: ; notranslate">
(cons 'pork '(beef chicken))           ; (pork beef chicken)
(cons 'beef (cons 'chicken '()))       ; (beef chicken)
(cons 'pork 
      (cons 'beef (cons 'chicken ()))) ; (pork beef chicken)</pre>
<h2>The car and cdr Functions</h2>
<p>Lisp has the basic functions <code>car</code> and <code>cdr</code> for accessing the first element of a lisp, and the remaining elements of a list, respectively. These names are directly related to the original hardware on which Lisp ran. Clojure does not have functions with these names, but it does provide its own functions that give the same results.</p>
<p>Instead of <code>car</code>, Clojure gives us <code>first</code>, which actually is a better name for what it does. It works like this</p>
<pre class="brush: clojure; title: ; notranslate">(first '(pork beef chicken)) ; pork</pre>
<p>Instead of <code>cdr</code>, Clojure actually has two functions, <code>next</code> and <code>rest</code>. With a listy thing of 2+ elements, both these function behave the same, returning everything but the first element</p>
<pre class="brush: clojure; title: ; notranslate">
(rest '(pork beef chicken)) ; (beef chicken)
(next '(port beef chicken)) ; (beef chicken)</pre>
<p>They differ, however, on what happens if there&#8217;s nothing after the first element, or the entire list is the empty list. <code>next</code> will return <code>nil</code> in both these cases, while <code>rest</code> will return an empty list. As I said, in Lisp, these are the same thing, but in Clojure, they are very different. The empty list is truthy, while nil is not</p>
<pre class="brush: clojure; title: ; notranslate">(when nil :truthy) ; nil
(when '() :truthy) ; :truthy</pre>
<h3>The c*r Functions</h3>
<p>Lisp defines combinations of <code>car</code> and <code>cdr</code> to allow you to get the second item, the third, the second item from the remainder of the remainder of a list, etc. Most CL implementations provide these functions up to four levels deep. Here&#8217;s a partial list to illustrate</p>
<pre class="brush: clojure; title: ; notranslate">
(cadr '(pork beef chicken))          ; BEEF
(cdar '((peas carrots tomatoes)
        (pork beef chicken)))        ; (CARROTS TOMATOES)
(cddr '((peas carrots tomatoes)
        (pork beef chicken) duck))   ; (DUCK)
(caddr '((peas carrots tomatoes)
         (pork beef chicken) duck))  ; DUCK
(cddar '((peas carrots tomatoes)
         (pork beef chicken) duck))  ; (TOMATOES)
(cadadr '((peas carrots tomatoes)
          (pork beef chicken) duck)) ; BEEF</pre>
<p>And let&#8217;s be honest, keeping all those &#8216;a&#8217;s and &#8216;d&#8217;s straight can be pretty confusing (at least, it is to me).</p>
<p>Since Clojure doesn&#8217;t have <code>car</code> and <code>cdr</code>, it also lacks these functions. It does have one analog function, and that is for the CL function <code>cadr</code>, which provides the car of the cdr of a list, also known as the second item. Thus, Clojure has <code>second</code> that does the same thing,</p>
<pre class="brush: clojure; title: ; notranslate">(second '(pork beef chicken)) ; beef</pre>
<p>but that&#8217;s it for built-ins. You <em>can</em> roll your own versions of these CL functions, but from what I&#8217;ve read, this is considered a code smell. Even though I don&#8217;t think you should try to implement these functions, let me show you how you <em>might</em> do it, if you wanted to.</p>
<p>Instead of explaining each one, and its possible implementation in Clojure, I&#8217;m just going to include the code for all of them in one, big blob.</p>
<pre class="brush: clojure; title: ; notranslate">
(defn cdar
  [lst]
  (rest (first lst)))

(cdar '((peas carrots tomatoes)
        (pork beef chicken)))       ; (carrots tomatoes)

(defn cddr
  [lst]
  (rest (rest lst)))

(cddr '((peas carrots tomatoes)
        (pork beef chicken) duck))  ; (duck)

(defn caddr
  [lst]
  (first (rest (rest lst))))

(caddr '((peas carrots tomatoes)
         (pork beef chicken) duck)) ; duck

(defn cddar
  [lst]
  (rest (rest (first lst))))

(cddar '((peas carrots tomatoes)
         (pork beef chicken) duck)) ; (tomatoes)

(defn cadadr
  [lst]
  (first (rest (first (rest lst)))))

(cadadr '((peas carrots tomatoes)
          (pork beef chicken) duck)) ; beef</pre>
<p>So, if you shouldn&#8217;t create analogous functions, how do you get at the elements you need? One way would be to use Clojure&#8217;s <a href="https://www.google.com/search?q=clojure+destrucuring#q=clojure+destructuring&amp;safe=off" target="_blank">destructuring</a>. I&#8217;m not going to go into a full explanation of how destructuring works, but suffice it to say that it&#8217;s a way to assign elements of a listy thing to individual locals. </p>
<p>Here&#8217;s how you could achieve the same results as <code>cdar</code></p>
<pre class="brush: clojure; title: ; notranslate">
(let [[fst] '((peas carrots tomatoes) (pork beef chicken))]
  (rest fst)) ; (carrots tomatoes) ; instead of cdar</pre>
<p>As you can see, this code assigns the first element <code>'(peas carrots tomatoes)</code> to the local <code>fst</code>. It then calls <code>rest</code> on that, which returns the remainder of that list. </p>
<p>Here, then, is a code dump of destructuring implementation of the rest of the <code>c*r</code> functions that I listed earlier.</p>
<pre class="brush: clojure; title: ; notranslate">
(let [[fst] '((peas carrots tomatoes)
              (pork beef chicken))]
  (rest fst)) ; (carrots tomatoes) ; instead of cdar

(let [[_ &amp; rst] '((peas carrots tomatoes)
                  (pork beef chicken) duck)]
  (rest rst)) ; (duck) ; instead of cddr

(let [[_ &amp; rst] '((peas carrots tomatoes)
                  (pork beef chicken) duck)
      tail (rest rst)]
  (first tail)) ; duck ; instead of caddr

(let [[fst] '((peas carrots tomatoes)
              (pork beef chicken) duck)
      tail (rest fst)]
  (rest tail)) ; (tomatoes) ; instead of cddar

(let [[_ &amp; rst] '((peas carrots tomatoes)
                  (pork beef chicken) duck)
      fst (first rst)
      tail (rest fst)]
  (first tail)) ; beef ; instead of cadadr</pre>
<h2>That&#8217;s It, For Now</h2>
<p>OK, that brings us to the end of chapter 3. I think this may be the longest post so far. I will move on to chapter 4, and will be back soon with the next installment.</p>
<p>As always, full code is available at <a href="https://github.com/joeygibson/lolclojure" target="_blank">https://github.com/joeygibson/lolclojure</a>.</p>
]]></content>
		
			</entry>
		<entry>
		<author>
			<name>joeygibson</name>
							<uri>http://joeygibson.com</uri>
						</author>

		<title type="html"><![CDATA[LoLClojure &#8211; Chapter 3]]></title>
		<link rel="alternate" type="text/html" href="https://joeygibson.com/2014/06/12/lolclojure-chapter-3/" />

		<id>http://joeygibson.com/?p=2477</id>
		<updated>2014-07-13T00:52:49Z</updated>
		<published>2014-06-13T03:13:42Z</published>
		<category scheme="https://joeygibson.com" term="tech" /><category scheme="https://joeygibson.com" term="clojure" /><category scheme="https://joeygibson.com" term="java" /><category scheme="https://joeygibson.com" term="lisp" /><category scheme="https://joeygibson.com" term="lolclojure" />
		<summary type="html"><![CDATA[Chapter three of Land of Lisp is all about Lisp syntax. This post will be sort of scattered as far as content goes, since the chapter covered a lot. Many things are the same in Clojure, but there are some serious differences. The first is how to define a function. Defining Functions In Lisp, you &#8230; <a href="https://joeygibson.com/2014/06/12/lolclojure-chapter-3/" class="more-link">Continue reading <span class="screen-reader-text">LoLClojure &#8211; Chapter&#160;3</span></a>]]></summary>

					<content type="html" xml:base="https://joeygibson.com/2014/06/12/lolclojure-chapter-3/"><![CDATA[<p>Chapter three of Land of Lisp is all about Lisp syntax. This post will be sort of scattered as far as content goes, since the chapter covered a lot. Many things are the same in Clojure, but there are some serious differences. The first is how to define a function.</p>
<h2>Defining Functions</h2>
<p>In Lisp, you use <code>defun</code>, but in Clojure, it&#8217;s <code>defn</code>. Here&#8217;s a <code>square</code> function in Lisp.</p>
<pre class="brush: clojure; title: ; notranslate">
(defun square (n) 
  (* n n))
</pre>
<p>And here&#8217;s the same function in Clojure. Notice that the function arguments are enclosed in square brackets (it&#8217;s a vector), instead of parens.</p>
<pre class="brush: clojure; title: ; notranslate">
(defn square
  &quot;Returns the square of the passed-in number&quot;
  [n]
  (* n n))
</pre>
<p>That string is known as the docstring. It stays with the function, and is available in the REPL by running the <code>doc</code> function, like this <code>(doc square)</code>. Lisp also supports docstrings in functions, but it comes after the argument list, instead of before. While docstrings are optional, I highly encourage you to include them. They can span multiple lines, and since they stay with your function, they are useful from the REPL.</p>
<h2>Equality</h2>
<p>In Lisp, there are may functions for determining equality, and you have to choose the right one for any given circumstance. Among these are <code>eq</code>, <code>equal</code>, <code>equalp</code>, and a few others. In Clojure, there&#8217;s just <code>=</code>. If you&#8217;re coming from Java, you know <code>=</code> by itself is assignment, not an equality check. For that, you have to use <code>==</code>, but even that only computes <em>reference equality</em>, and is not always what you want. In Clojure, <code>=</code> does everything you want, in every circumstance. It is your friend.</p>
<h2>Exponentiation</h2>
<p>Starting on page 34, there are a few examples using the <code>expt</code> function, which raises its first argument to the power of its second. This is a built-in function in CL, but Clojure doesn&#8217;t have one. You could use <code>Math.pow</code> from Java, but this only works with doubles, and once the numbers get really large, it switches to scientific notation.</p>
<pre class="brush: clojure; title: ; notranslate">
(Math/pow 2 2)       ; 4.0
(Math/pow 2 3)       ; 8.0
(Math/pow 2.0 3)     ; 8.0
(Math/pow 2 10)      ; 1024.0
(Math/pow 53N 53)    ; 2.4356848165022712E91
</pre>
<p>(In case you haven&#8217;t seen it, appending an <code>N</code> to a number literal causes the number to be of type <code>clojure.lang.BigInt</code>. Appending an <code>M</code> makes it a <code>java.math.BigDecimal</code>.)</p>
<p>You can write your own exponentiation function that gives better results than using the one from Java. Here are two different ways to write it. Both versions are tail-recursive, which means they won&#8217;t exhaust the stack, but the first uses a nested function, while the second is recursive on a <code>loop</code>. Here&#8217;s the nested function version</p>
<pre class="brush: clojure; title: ; notranslate">
(defn expt
  &quot;Raise x to the nth power&quot;
  [x n]
  (letfn [(rexpt [n acc]
                 (if (zero? n)
                   acc
                   (recur (dec n) (* acc x))))]
    (rexpt n 1)))
</pre>
<p>Notice the <code>letfn</code> that contains a local function called <code>rexpt</code>. This function does all the work, and is called as the last line of the main function. It takes a parameter to be used as an accumulator, and this is returned once the exponent is decremented to zero. This nested function is also a <a href="http://en.wikipedia.org/wiki/Closure_(computer_programming)" target="_blank">closure</a>, because the value of <code>x</code> is referenced directly. We don&#8217;t need to change it like we do <code>n</code>, so we just use its name.</p>
<p>Now, here is the version that uses <code>loop</code>. While CL has a <a href="http://www.gigamonkeys.com/book/loop-for-black-belts.html" target="_blank">loop macro</a>, Clojure&#8217;s loop is completely different. All it does is provide a recursion point. This means that when you use the <code>recur</code> function later, execution will jump back to where the loop call is, instead of back to the beginning of the function. The locals declared in the loop&#8217;s vector are rebound with the values specified by the <code>recur</code> call. I think this version is easier to understand than the first one.</p>
<pre class="brush: clojure; title: ; notranslate">
(defn expt
  &quot;Raise x to the nth power&quot;
  [x n]
  (loop [n n
         acc 1]
    (if (zero? n)
      acc
      (recur (dec n) (* acc x)))))
</pre>
<p>Notice that the code inside the <code>loop</code> is identical to that in the <code>rexpt</code> local function from the previous example. It&#8217;s just not wrapped inside another function. Also of note is in the <code>let</code> we assign <code>n</code> to <code>n</code>. This is a common technique, and will result in a local called <code>n</code> being assigned the value of the passed-in <code>n</code>. The local <code>n</code> can then be decremented with each recursion, without affecting the outer <code>n</code>.</p>
<p>Both of these function provide identical results.</p>
<pre class="brush: clojure; title: ; notranslate">
(expt 2 2)       ; 4
(expt 2 3)       ; 8
(expt 2.0 3)     ; 8.0
(expt 2 10)      ; 1024
(expt 53N 53)    ; 24356848165022712132477606520104725518533453128685640844505130879576720609150223301256150373
</pre>
<p>Notice that passing in an integer results in an integer. Passing in a double results in a double. And passing in a BigInt results in a very large number (Hint: scroll horizontally&#8230; it goes on for a while).</p>
<h2>Printing Things</h2>
<p>CL uses <code>(princ)</code>, <code>(prin1)</code>, <code>(print)</code>, etc., to output things to the console. In Clojure, you use <code>(print)</code> and <code>(println)</code>.</p>
<pre class="brush: clojure; title: ; notranslate">
(print &quot;He yelled \&quot;Stop that thief!\&quot; from the busy street.&quot;) ; no newline
(println &quot;He yelled \&quot;Stop that thief!\&quot; from the busy street.&quot;) ; newline
</pre>
<p><code>(print)</code> outputs the string, but does not append a newline. <code>(println)</code> appends a newline, as you would expect, given its name.</p>
<h2>To Be Continued&#8230;</h2>
<p>This has gotten very long, so I will stop now, and continue in another post. Stay tuned for Chapter Three, Part Two.</p>
]]></content>
		
			</entry>
		<entry>
		<author>
			<name>joeygibson</name>
							<uri>http://joeygibson.com</uri>
						</author>

		<title type="html"><![CDATA[LoLClojure &#8211; Locals]]></title>
		<link rel="alternate" type="text/html" href="https://joeygibson.com/2014/06/10/lolclojure-locals/" />

		<id>http://joeygibson.com/?p=2457</id>
		<updated>2014-06-13T03:15:20Z</updated>
		<published>2014-06-10T17:33:26Z</published>
		<category scheme="https://joeygibson.com" term="tech" /><category scheme="https://joeygibson.com" term="clojure" /><category scheme="https://joeygibson.com" term="java" /><category scheme="https://joeygibson.com" term="lisp" /><category scheme="https://joeygibson.com" term="lolclojure" />
		<summary type="html"><![CDATA[Just like in Lisp, Clojure uses let to define locals. The only real difference is that Clojure uses a vector of names and their bindings, whereas Lisp uses a nested list. This Lisp code looks like this in Clojure I think the Clojure way is a little easier to read. The biggest difference between the &#8230; <a href="https://joeygibson.com/2014/06/10/lolclojure-locals/" class="more-link">Continue reading <span class="screen-reader-text">LoLClojure &#8211; Locals</span></a>]]></summary>

					<content type="html" xml:base="https://joeygibson.com/2014/06/10/lolclojure-locals/"><![CDATA[<p>Just like in Lisp, Clojure uses <code>let</code> to define locals. The only real difference is that Clojure uses a vector of names and their bindings, whereas Lisp uses a nested list.</p>
<p>This Lisp code</p>
<pre class="brush: clojure; title: ; notranslate">
(let ((a 5)
	  (b 6))
  (+ a b))
</pre>
<p>looks like this in Clojure</p>
<pre class="brush: clojure; title: ; notranslate">
(let [a 5
      b 6]
  (+ a b))
</pre>
<p>I think the Clojure way is a little easier to read.</p>
<p>The biggest difference between the two is when it comes to local functions. CL has <code>flet</code> for defining local functions, and <code>labels</code> for defining local functions that need to be able to call each other (or call themselves recursively). Here&#8217;s an example of each</p>
<pre class="brush: clojure; title: ; notranslate">
;; A single local function
(flet ((f (n)
		  (+ n 10)))
  (f 5))

;; Two local functions that don't need to call each other
(flet ((f (n)
		  (+ n 10))
	   (g (n)
		  (- n 3)))
  (g (f 5)))
</pre>
<p>Here&#8217;s the equivalent code in Clojure. Note how the square brackets make things stand out a little bit more.</p>
<pre class="brush: clojure; title: ; notranslate">
(letfn [(f [n]
           (+ n 10))]
  (f 5))

(letfn [(f [n]
           (+ n 10))
        (g [n]
           (- n 3))]
  (g (f 5)))
</pre>
<p>If the functions need to reference each other, in CL you have to use <code>labels</code>, instead of <code>flet</code>. Here&#8217;s how that looks (the only difference is the form used; the arguments remain the same)</p>
<pre class="brush: clojure; title: ; notranslate">
(labels ((a (n)
			(+ n 5))
		 (b (n)
			(+ (a n) 6)))
  (b 10))
</pre>
<p>In Clojure, you don&#8217;t need to use anything other than <code>letfn</code>, because it already supports the recursive nature that <code>labels</code> provides</p>
<pre class="brush: clojure; title: ; notranslate">
(letfn [(a [n]
           (+ n 5))
        (b [n]
           (+ (a n) 6))]
  (b 10))
</pre>
<p>Finally, if you have local functions and other local bindings you need to establish, you can use a <code>let</code>, but no recursion is supported. This is sort of like CL&#8217;s <code>flet</code> but you can also use it for binding locals that are not functions</p>
<pre class="brush: clojure; title: ; notranslate">
(let [a (fn [n]
          (+ n 5))
      b (fn [n]
          (+ (a n) 6))
      c 10]
  (b c))
</pre>
<p>I think the way Clojure uses square brackets in certain places that CL uses parentheses makes the code easier to read, overall. </p>
]]></content>
		
			</entry>
		<entry>
		<author>
			<name>joeygibson</name>
							<uri>http://joeygibson.com</uri>
						</author>

		<title type="html"><![CDATA[LoLClojure &#8211; Land of Lisp In Clojure]]></title>
		<link rel="alternate" type="text/html" href="https://joeygibson.com/2014/06/09/lolclojure-land-of-lisp-in-clojure/" />

		<id>http://joeygibson.com/?p=2449</id>
		<updated>2014-06-13T03:15:28Z</updated>
		<published>2014-06-10T03:30:33Z</published>
		<category scheme="https://joeygibson.com" term="general" /><category scheme="https://joeygibson.com" term="tech" /><category scheme="https://joeygibson.com" term="clojure" /><category scheme="https://joeygibson.com" term="java" /><category scheme="https://joeygibson.com" term="lisp" /><category scheme="https://joeygibson.com" term="lolclojure" />
		<summary type="html"><![CDATA[I read Conrad Barski&#8217;s excellent book Land of Lisp a couple of years ago, and worked through all the examples using CLisp, but I thought it might be fun to go through it again, but use Clojure instead. Other people have done it already, but what&#8217;s one more, eh? As I work through the book, &#8230; <a href="https://joeygibson.com/2014/06/09/lolclojure-land-of-lisp-in-clojure/" class="more-link">Continue reading <span class="screen-reader-text">LoLClojure &#8211; Land of Lisp In&#160;Clojure</span></a>]]></summary>

					<content type="html" xml:base="https://joeygibson.com/2014/06/09/lolclojure-land-of-lisp-in-clojure/"><![CDATA[<p>I read Conrad Barski&#8217;s excellent book <a href="http://landoflisp.com/" target="_blank">Land of Lisp</a> a couple of years ago, and worked through all the examples using <a href="http://www.clisp.org/" target="_blank">CLisp</a>, but I thought it might be fun to go through it again, but use <a href="http://clojure.org/">Clojure</a> instead. Other people have done it already, but what&#8217;s one more, eh?</p>
<p>As I work through the book, I will be putting all the code on Github at <a href="https://github.com/joeygibson/lolclojure">https://github.com/joeygibson/lolclojure</a></p>
<p>So, the first example is for a program to guess a number you are thinking of. In Lisp, <code>defparameter</code> allows you to rebind values, but Clojure&#8217;s <code>def</code> is immutable. Using a <code>ref</code> gets around this, though it is a bit clunky (since <code>ref</code>s are intended for multi-threaded access.) The code is not great, and you wouldn&#8217;t write a Clojure program like this (or a Lisp program, really); it&#8217;s just to get the discussion moving. Better code is coming.</p>
<p>Anyway, here&#8217;s the number-guessing program in non-idiomatic Clojure. To run it, load it into a REPL, then execute <code>(guess-my-number)</code>. If you are so enraptured with the game that you want to play it again, execute <code>(start-over)</code> and then <code>(guess-my-number)</code>.</p>
<pre class="brush: clojure; title: ; notranslate">
(ns lolclojure.guess)

;; Using refs for these is overkill, but the original
;; used mutable global variables.
(def small (ref 1))
(def big (ref 100))

(defn guess-my-number
  &quot;This is, effectively, a binary search between the two extremes.&quot;
  []
  (Math/round (Math/floor (double (/ (+ @small @big) 2)))))

(defn smaller
  &quot;The guess was too high, so lower it.&quot;
  []
  (dosync
   (ref-set big (dec (guess-my-number)))))

(defn bigger
  &quot;The guess was too low, so raise it.&quot;
  []
  (dosync
   (ref-set small (inc (guess-my-number)))))

(defn start-over
  &quot;Reset everything and prepare to start over.&quot;
  []
  (dosync
   (ref-set small 1)
   (ref-set big 100)))
</pre>
]]></content>
		
					<link rel="replies" type="text/html" href="https://joeygibson.com/2014/06/09/lolclojure-land-of-lisp-in-clojure/#comments" thr:count="1" />
			<link rel="replies" type="application/atom+xml" href="https://joeygibson.com/2014/06/09/lolclojure-land-of-lisp-in-clojure/feed/atom/" thr:count="1" />
			<thr:total>1</thr:total>
			</entry>
		<entry>
		<author>
			<name>joeygibson</name>
							<uri>http://joeygibson.com</uri>
						</author>

		<title type="html"><![CDATA[George Carlin On Flamethrowers]]></title>
		<link rel="alternate" type="text/html" href="https://joeygibson.com/2014/03/28/george-carlin-on-flamethrowers/" />

		<id>http://joeygibson.com/?p=2445</id>
		<updated>2014-03-28T17:55:29Z</updated>
		<published>2014-03-28T17:55:29Z</published>
		<category scheme="https://joeygibson.com" term="humor" /><category scheme="https://joeygibson.com" term="george_carlin" /><category scheme="https://joeygibson.com" term="war" />
		<summary type="html"><![CDATA[My favorite George Carlin quote of all time is this: The very existence of flamethrowers proves that some time, somewhere, someone said to themselves, &#8220;You know, I want to set those people over there on fire, but I&#8217;m just not close enough to get the job done.&#8221; I laugh like a schoolgirl whenever I think &#8230; <a href="https://joeygibson.com/2014/03/28/george-carlin-on-flamethrowers/" class="more-link">Continue reading <span class="screen-reader-text">George Carlin On&#160;Flamethrowers</span></a>]]></summary>

					<content type="html" xml:base="https://joeygibson.com/2014/03/28/george-carlin-on-flamethrowers/"><![CDATA[<p>My favorite George Carlin quote of all time is this:</p>
<blockquote><p>The very existence of flamethrowers proves that some time, somewhere, someone said to themselves, &#8220;You know, I want to set those people over there on fire, but I&#8217;m just not close enough to get the job done.&#8221;</p></blockquote>
<p>I laugh like a schoolgirl whenever I think about it. And here&#8217;s a video of him doing this bit, though worded slightly differently:</p>
<div class="jetpack-video-wrapper"><iframe class="youtube-player" width="676" height="381" src="https://www.youtube.com/embed/V4nknAzQPHE?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en&#038;autohide=2&#038;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox"></iframe></div>
]]></content>
		
			</entry>
	</feed>
