<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Cadar's weblog</title>
	<atom:link href="http://cadaro.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://cadaro.wordpress.com</link>
	<description>A blog about Lisp Flavoured Erlang. LFE brings powerful macros to a robust language, Erlang.</description>
	<lastBuildDate>Sun, 03 May 2009 10:52:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='cadaro.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Cadar's weblog</title>
		<link>http://cadaro.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://cadaro.wordpress.com/osd.xml" title="Cadar&#039;s weblog" />
	<atom:link rel='hub' href='http://cadaro.wordpress.com/?pushpress=hub'/>
		<item>
		<title>LFE &#8211; Quick start</title>
		<link>http://cadaro.wordpress.com/2008/08/25/lfe-quick-start/</link>
		<comments>http://cadaro.wordpress.com/2008/08/25/lfe-quick-start/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 08:16:38 +0000</pubDate>
		<dc:creator>cadaro</dc:creator>
				<category><![CDATA[LFE]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[Lisp]]></category>

		<guid isPermaLink="false">http://cadaro.wordpress.com/?p=3</guid>
		<description><![CDATA[This blog post will get you up and running with LFE in ~30 seconds. This will only prepare your computer for some serious fun. So don&#8217;t expect too much. Short about LFE. LFE is Erlang with Lisp syntax. It will twist your brain. Specially when you get a bit tired. So keep an eye on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cadaro.wordpress.com&amp;blog=4608450&amp;post=3&amp;subd=cadaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://cadaro.files.wordpress.com/2008/09/img_2851.jpg"><img class="alignright size-medium wp-image-145" title="img_2851" src="http://cadaro.files.wordpress.com/2008/09/img_2851.jpg?w=300&#038;h=225" alt="" width="300" height="225" /></a><br />
<em> This blog post will get you up and running with LFE in ~30 seconds. This will only prepare your computer for some serious fun. So don&#8217;t expect too much.</em></p>
<p><strong>Short about LFE. </strong><br />
LFE is Erlang with Lisp syntax. It will twist your brain. Specially when you get a bit tired. So keep an eye on your focus. Just remember. It is more Erlang than Lisp. But with some nice features.</p>
<p>The one I&#8217;m going to mention is macros. Macros are very powerful. If it was only for macros, we would install LFE just for that. (A macro is a function that first create the code, then run it in the last step. No arguments are evaluated. Compared to normal functions.) Ok. enough about that. Later we will get a better understanding. First we need to install it.</p>
<p><strong>Install Erlang</strong><br />
At the moment, Ubuntu&#8217;s Erlang version is 5.5.5. And is not working with current LFE. (Use &#8220;erl +V&#8221;, this will display version text.) To build latest and greatest version of Erlang, copy-paste this into your terminal.</p>
<pre>sudo apt-get install build-essential libncurses5-dev libssl-dev m4 git-core
wget http://www.erlang.org/download/otp_src_R13B.tar.gz
tar xvf otp_src_R13B.tar.gz
cd otp_src_R13B
./configure
make
sudo make install</pre>
<p>If all looks ok. Then it&#8217;s time for LFE.</p>
<p><strong>Install LFE</strong><br />
Again, copy and paste.</p>
<pre>git clone git://github.com/rvirding/lfe.git ~/lfe</pre>
<p><strong>lfe-mode in emacs</strong><br />
To make emacs recognize lfe files. We need to make emacs aware of LFE. Paste this into .emacs.</p>
<pre>;; lfe-mode
(when (load "~/lfe/src/lfe-mode.el" t)
  (setq auto-mode-alist
        (cons '("\\.lfe\\'" . lfe-mode) auto-mode-alist)))</pre>
<p><strong>Hello world</strong><br />
Next step is to create your first program in LFE. Save this to a file called myhello.lfe.</p>
<pre>(defmodule myhello
  (export (start 0)))

(defun start ()
  (: io format '"Hello World!~n"))</pre>
<p>If you are used to Erlang you will see some familiar things.</p>
<ol>
<li>Module definition with export. That tells what functions are callable from the outside. The zero stands for zero arguments.</li>
<li>Erlang string syntax for line feed (~n).</li>
</ol>
<p>What&#8217;s interesting here is the colon. With colon you can call all Erlang BIFs (built-in functions). Else we can&#8217;t print out &#8220;Hello World&#8221;.</p>
<p>To make it easy I prepared this in a github project. You can just clone my hello-lfe and type make and make test.</p>
<pre>cd
git clone git://github.com/cadar/hello-lfe.git
cd hello-lfe
make
make start</pre>
<p>If all steps before this was success full. This will print &#8220;Hello world!&#8221;</p>
<p>I hope you see how easy it is. And how near you are total world domination. *my fingers are shivering*</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cadaro.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cadaro.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cadaro.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cadaro.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cadaro.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cadaro.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cadaro.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cadaro.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cadaro.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cadaro.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cadaro.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cadaro.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cadaro.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cadaro.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cadaro.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cadaro.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cadaro.wordpress.com&amp;blog=4608450&amp;post=3&amp;subd=cadaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cadaro.wordpress.com/2008/08/25/lfe-quick-start/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cb89b89a4c23232d8f1f56cb4e409ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cadar</media:title>
		</media:content>

		<media:content url="http://cadaro.files.wordpress.com/2008/09/img_2851.jpg?w=300" medium="image">
			<media:title type="html">img_2851</media:title>
		</media:content>
	</item>
	</channel>
</rss>
