<?xml version="1.0" encoding="UTF-8"?>
<post>
  <body>I'm not going to write much to add to the "chain":http://jeff.dallien.net/posts/analysis-paralysis tonight, other than to say that "prologblog.com":http://prologblog.com is now up and running. The "server code":http://github.com/jdallien/prologblog is on GitHub. As is the "code that generates the first post":http://github.com/jdallien/prologblog/posts/first_post.pl. The site's not pretty, and the list of things to do is a mile long, but the basic goal has been achieved, the site is running on a Prolog application.

I'll go through the code and explain each part in subsequent posts, but here is a small introduction. This piece of code gathers all the *post/1* predicates and flattens them into a single list. Using this method, new posts can been added to the system just by loading another source file with one or more post predicates into the interpreter. I'll be using this method to add posts until I get some form of database access working.

&lt;div class="CodeRay"&gt;&lt;source:ruby&gt;
all_posts(List) :-
  setof(Post, post(Post), TempList),
  flatten(TempList, List).
&lt;/source&gt;&lt;/div&gt;&lt;br/&gt;To make this work properly the main server source file has to declare that the *post/1* predicates can be found in multiple files, using the "multifile/1":http://gollem.science.uva.nl/SWI-Prolog/Manual/dynamic.html#multifile/1 predicate:
&lt;div class="CodeRay"&gt;&lt;source:ruby&gt;
:- multifile post/1.
&lt;/source&gt;&lt;/div&gt;&lt;br/&gt;Next up is adding some CSS to make the site look nicer, and working on a RSS feed. Feel free to try to break the Prolog Blog site with weird parameters and malformed requests, just be sure to "let me know":mailto:jeff@dallien.net what happens.
&lt;br /&gt;</body>
  <created-at type="datetime">2009-03-16T01:13:00-04:00</created-at>
  <id type="integer">39</id>
  <published type="boolean">true</published>
  <title>prologblog.com is up and running</title>
  <updated-at type="datetime">2009-03-16T01:47:48-04:00</updated-at>
  <url-title>prologblogcom-is-up-and-running</url-title>
</post>
