Archive for the ‘lisp’ Category

New article: Configuring Emacs

Thursday, October 24th, 2013

I just published my Emacs configuration as an article. Contains interesting stuff on Emacs, OrgMode, Clojure and other things.

New zeekat website design

Thursday, May 9th, 2013

This week, I re-implemented my main website. The text on the old one needed to be revised heavily (in fact I removed almost all of it except a short bio and some longer articles) and I wanted to experiment with a more colorful look. I need to revise the stylesheet a bit more to give a better experience on small screens (mobile), but so far I’m pleased with the result.

The new site html is generated completely by emacs’ org-mode project publishing functionality (the old one used a custom bunch of perl scripts generating from HTML snippets and perl POD documents). This hopefully means it’ll be easier to add and revise content, and it also provides nice syntax highlighting for any code snippets I put in my articles.

The whole switchover was pretty smooth, especially once I wrote a bit of elisp to roughly prepare conversion from POD formatting to org:


(defun pod2org
(point mark)
"Rougly convert region from pod syntax to org-mode"
(interactive "r")
(replace-regexp "C<\\([^>]+\\)>" "=\\1=" nil point mark)
(replace-regexp "I<\\([^>]+\\)>" "/\\1/" nil point mark)
(replace-regexp "B<\\([^>]+\\)>" "*\\1*" nil point mark)
(replace-regexp "^=head1 \\(.*\\)" "* \\1" nil point mark)
(replace-regexp "^=head2 \\(.*\\)" "** \\1" nil point mark)
(replace-regexp "^=head3 \\(.*\\)" "*** \\1" nil point mark)
(replace-regexp "^=head4 \\(.*\\)" "**** \\1" nil point mark)
(replace-regexp "^=head5 \\(.*\\)" "***** \\1" nil point mark))

Very basic, but pretty useful.

Now, I’m considering replacing WordPress for this blog with org-mode too. That probably requires a bit more investigation. I want to keep at least the tags/categories feature and related rss feeds, and I’m not sure if that’s available for org at the moment.

See the incredible emacs config.

Saturday, November 3rd, 2012

Because people asked: my current emacs configuration is at https://github.com/joodie/emacs-config

Note that it will not work as is, as it depends on my local file tree and specific installs from marmalade. So it’s mostly useful as a raw bucket of references to interesting stuff. Oh, and it includes my personal color theme, which may be an interesting example of emacs 24′s new color-theme functionalities.

October Amsterdam Clojure this saturday

Thursday, October 25th, 2012

This saturday, all day. I’ll be giving an updated version of my “functional clojure: sequences” talk in the morning.

Clojure-refactoring gets a little love, a new release and a new maintainer.

Monday, October 24th, 2011

clojure-refactoring, the Emacs/SLIME based toolkit for doing refactoring wasn’t getting enough love and attention, so I fixed a few things. Tom Crayford unfortunately doesn’t have the time to work on it any further so I’m taking over as the maintainer. Inspect the code at the new “official” repository.

For now, I’m focused on fixing parsing issues first, then installing ease (I’m thinking about packaging everything Emacs-related on marmalade but that depends on what’s the easiest way to get stuff integrated for the user on the Emacs and Clojure sides). I’ve already removed the dependencies on out-dated libraries. Basically, everything I need to make the current functionality reliable enough for production use. Next up is support for clojure 1.3, probably, if that needs any work (I’m running 1.2 in production everywhere for now).

For the further future, I’d like this code to be useful for other editors/APIs/tools, so the SLIME/swank/Emacs specific stuff probably has to be separated out at some point. Some more refactorings will also be useful.

For now, version 0.6.1 is on clojars. Get it while it’s hot.

Announcement: pretzel – clojure predicate functions

Tuesday, April 5th, 2011

I’m working on pretzel right now. It’s a basic library that can be used to combine predicates and also holds a bunch of tests on string content.

Code and documentation is on github.

Announcement: flutter-decline-demo – validation and form generation on compojure

Saturday, April 2nd, 2011

Some people indicated they wanted some example code for my clj-decline
(validation) and flutter (form generation) libraries. So today I wrote
a simple demo application that uses both.

Get the code at github.

Announcement: flutter – clojure / hiccup form fields

Saturday, March 26th, 2011

I’ve been working on flutter, a library for saner form generation today. First (pretty basic) release was done on clojars. Still working on many details, including more-or-less full-coverage tests.

Get the code on github.

Also see the announcement on the clojure group.

Announcement: ring-persistent-cookies

Saturday, March 12th, 2011

Just released a minimal library to generate persistent cookies for ring.middleware.cookies.

It’s at github and clojars.org.

Announcement: clj-decline – validation sucks.

Saturday, March 12th, 2011

I pushed a new validation library for clojure to github yesterday. Check out clj-decline.

Why another validation library?

Well, why does validation suck so much?

Of course, dealing with user input is annoying anyway. But validation libraries always seem to want to do things in just the wrong way for the project you’re working on.

Let me count the ways:

  • They do too much. Session management? XSS detection? Javascript validation? Form definitions? Bollocks. It will never work with the code I’ve already got running in production and I’m not going to drag in all of it just to get the core validation functions, assuming I can even use them in my app.
  • Also, validation does not mean “force this input into another type”. That’s not validation. Stick it somewhere else.
  • They assume too much. If you can only validate a single value in a map, you’re useless. I need to check if a frobniz has either two wheebles or an odd number of crinks, and don’t try to stop me.
  • I might need to validate something that isn’t a map. Maybe I want to check two maps. Maybe I need to check a single string or a file upload.
  • They still assume too much. This may come as a shock, but not everyone speaks English on this planet. I have to support multiple languages in the same web app. Give me more options than pre-defined strings for errors, you lousy piece of American imperialist software! People of the earth, throw off your shackles and your “reality” TV shows!

    Ahem.

  • Macros, macros, macros all over the place. Yes, macros are cool, but no, I don’t want to stick every validation in a named var. If I wanted that, I could (def some-name (make-validation …)) so I don’t need your macro anyway. I want to use closures that validate for this specific user and now you’ve stopped me.
  • Don’t be passive agressive. Validation is a user-centric feature. If I wanted to tell the user only their first error, I’d use exceptions. Don’t force the user to submit their form twenty times until they’ve fixed all their mistakes. Give them as much information as possible so they know what’s going on.

    So, how does clj-decline fix all that?

    It doesn’t. It just stays away from most of the above. clj-decline is simple. It validates arguments and returns errors. Everything else is up to the user or some other library. It’s completely functional, has no macros, no built-in predicates, nothing binds it to a web framework or anything else, and errors / messages can be anything you like. The only decision I made is that errors are grouped by key (which can also be anything you like).

    Enjoy!

    Joost.