Parinfer in Replete

November 20, 2015

Replete makes for a convenient ClojureScript REPL that you can carry around with you in your iOS device. But, man is it hard to enter forms on the iOS keyboard. We've been considering extending the keyboard to add an extra row with parentheses keys, brackets and other frequently used characters, but that hasn't happened yet.

In the meanwhile, Shaun LeBron has come out with Parinfer. My simplified take on Parinfer is that it is a bit like Paredit in that it attempts to help manage closing parens and other similar delimiters. But, it takes an interesting approach in that it essentially infers where the closing braces should go.

It took me a while to realize this, but this implicit inference as opposed to the explicit barf / slurp approach taken by Paredit could potentially help with the problem of entering Lisp forms on mobile devices—where you don't really have the ability to invoke key combinations with modifiers, etc.

So, I decided to give it a shot in Replete. It turns out that Shaun did a really great job at making Parinfer's API super easy to code against. It manifests itself as a few pure functions that you pass text and other data to, and get data back. This made it practically trivial to hook into Replete (which involves Objective-C and Swift code). This made it real easy get it up and running in order to see how it works and how it feels to actually use on a real device.

Here is a demo showing what it currently looks like:



Tags: ClojureScript Replete