Adventures in Clojure: Nearly Constant Data

clojure

As I noted last week, the Clojure way is to keep immutable (unchanging) data separate from the mutable data. Thus, you keep the network of rooms distinct from the data structure that indicates where the player and other things are at the present time. The latter changes while the game runs, and the former doesn't.At least, that's the theory. As I showed a couple of weeks ago, you can define the world map as a single, immutable data structure, and never change it thereafter. But there are … [Read more...]

Adventures in Clojure: Saving the Day

clojure

See the previous installment here.It's a big part of the philosophy of Clojure programming that you keep mutable state (data that can change) separate from immutable state (data that cannot change). There are a number of good reasons for doing this; the one that the Clojure books usually trot out is that it makes supporting concurrency easier because you don't need to synchronize reads and writes to data that never changes.Concurrency isn't all that important to a single-user text … [Read more...]

Embrace the Cloud—But Not Too Tightly

Sunset clouds over beach

It's summer time, and I'm busy with family things. Thomas Aquinas will return in a week or two.We hear a lot about the "Cloud" these days, and I suspect many readers have only a cloudy idea of what the Cloud is.What the Cloud is, is computer hardware that you don't own that you access over the 'net to do things and store your stuff.The Cloud is incredibly useful; it's a treat to be able to move from my computer to my phone to a friend's computer, and still access my stuff.  But … [Read more...]

Adventures in Clojure: The World is Mine!

clojure

So I'm, in a rather desultory fashion, putting together a simple text adventure in the Clojure programming language. (You can find the code at GitHub, should you be interested.)The first thing you need in a text adventure game is a world to move around in. The world usually consists of a collection of rooms. Each room can have any number of links to other rooms; each link is in a particular direction. Directions include the four cardinal directions (north, south, east, and west) and … [Read more...]

Tools for Learning Clojure, Part V: A Game!

WorldMap

Previous Parts: I, II, III, IV.I've always maintained that the only way to really learn a programming language is to code up some kind of project using it: not something out of a book, but something of my own, something that's fun. For many years, my project of choice was the old fashioned text adventure. I got started with computers in the mid-1970's, when we all we had were dumb-terminals and today's beautifully 3-D rendered games were not even a dream. Text was king; and text adventure … [Read more...]

Tools for Learning Clojure, Part IV: GitHub

GitHub Octocat

In Part I, I talked about Clojure and the need for a convenient "REPL": a piece of software that lets you type input at the language engine and see its responses. In Part II I talked about Leiningen, a very cool tool that not only gives you a good REPL but also automates many other tedious aspects of development. In Part III I talked about a simple IDE for Clojure called Nightcode.And the final piece in the puzzle is GitHub.GitHub is a website that provides configuration management … [Read more...]

Tools for Learning Clojure, Part III: Nightcode

nightcode

In Part I, I talked about Clojure and the need for a convenient "REPL": a piece of software that lets you type input at the language engine and see its responses. In Part II I talked about Leiningen, a very cool tool that not only gives you a good REPL but also automates many other tedious aspects of development. (I find myself wishing very strongly that TCL, my usual language, had something like it.)So at the end of Part II, it looked like I had a solution: Leiningen gives me the REPL and … [Read more...]

Tools for Learning Clojure, Part II: Leiningen

Leiningen

In part I, I talked about Clojure and the need for a convenient "REPL": a piece of software that lets you type input at the language engine and see its responses. And I found one in an usual place: a build tool for Clojure applications and libraries.Bear with me; this is all relevant.For a working software engineer, some kind of build tool is essential. There are lots of repetitive actions involved in making a piece of software ready to run, too many to do by hand every time. A build … [Read more...]

Tools for Learning Clojure

LightTableSyntax

As I wrote on Saturday, I'm learning to program in Clojure; and being a tool user at heart I immediately went looking for the right tools for the job. Here's what I wanted:A REPL at which to experiment with Clojure code, with good command-line editing and command history. An editor in which to edit Clojure code, integrated with the REPL. An easy way to build a stand-alone application in Clojure. A solution that works on both Mac and Windows."REPL" stands for "read-eval-print … [Read more...]


CLOSE | X

HIDE | X