January 17, 2016

Lisp Finally Clicked

I’ve been meaning to write this post for a couple of weeks now. There is a story told among programming language enthusiasts that programming as an art only “clicks” once a programmer understands the Lisp programming language. I finally feel like I’ve reached that point. Although I don’t think I’m an amazing programmer, I finally feel like I understand the difference between languages (like Python and Lisp), and why Lisp is often considered so much more flexible and powerful (at least in theory) than a language like Python or C. ...

November 17, 2015

The Clojure “Reductions” Function

Tonight, while attempting a problem at 4 Clojure (problem number omitted so as not to give too many hints), I was struck by the following problem: What if I need a Clojure function which can take a sequence of functions and can sequentially call them on some seed value? I’m specifically looking at something like: (defn some-fun [seed-val & funs] ; Keep passing the calculated value through, while also appending to sequence (list ((first funs) seed-val) ((second funs) ((first funs) seed-val)) . ...

November 5, 2015

Clojure Zippers Emulate Object-Oriented Programming?

Yesterday, I posted about using Clojure zippers to solve the problem of automatically generating a Table of Contents. During my work with Clojure’s implementation of zippers, I noticed something interesting. The zipper function creates (and returns) a new zipper object. Its parameters are the following (lifted straight from the documentation): branch? – a function that takes a node of the zipper and returns a true/false if it is capable of having children (even if it currently does not). ...

November 4, 2015

Implementing a Table of Contents Using Zippers

As I continue my forays with Clojure, I’m finding it enjoyable (if not entirely productive) to hack with it on Cryogen, a nifty little blog generator I already discussed recently. On Sunday I had the privilege of making my first pull request. The essence of the PR was to fix a couple of bugs with the existing implementation of the logic for generating a Table of Contents for a given blog post, and also replace a less robust algorithm (for real-life use cases) with a more robust one. ...

October 28, 2015

F Sharp vs Clojure Toy Problem Shootout

As a continuation of my forays in interesting and less industrially-oriented programming languages, I decided to compare F Sharp against Clojure for a relatively simple programming problem, and to compare how the two felt in terms of programming ease, friendliness, and how they each viewed the problem. The Problem The problem is a relatively one from Reddit’s “Daily Programmer” subreddit, called JSON Treasure Hunt: given a random, unstructured JSON object, traverse the object looking for a specific terminal value (in this case, a string “dailyprogrammer”). ...

© Jeff Rabinowitz, 2023