10

in which we cater to those with an allergic reaction to parentheses

 3 years ago
source link: https://technomancy.us/165
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

A lot of people have been talking about how parentheses are such a big barrier to adoption of Clojure these days. Apparently they're pretty intimidating when you're used to a language with a lot of curly braces and things. While I can't do anything about Clojure itself, I realized we could make some changes to Leiningen that would allow newcomers to return to the comfort of XML. My latest plugin is called lein-xml, and it lets you write this:

<?xml version="1.0" encoding="UTF-8"?>
<project>
  <groupId>org.leiningen</groupId>
  <artifactId>sample</artifactId>
  <version>0.1.0-SNAPSHOT</version>
  <description>Just some kind of sample thing</description>
  <url>https://github.com/technomancy/lein-xml</url>
  <licenses>
    <license>
      <name>Eclipse Public License</name>
      <url>http://www.eclipse.org/legal/epl-v10.html</url>
    </license>
  </licenses>
  <dependencies>
    <dependency>
      <groupId>org.clojure</groupId>
      <artifactId>clojure</artifactId>
      <version>1.5.1</version>
    </dependency>
    <dependency>
      <groupId>slamhound</groupId>
      <artifactId>slamhound</artifactId>
      <version>1.3.3</version>
    </dependency>
  </dependencies>
</project>

...instead of this bewildering, unfamiliar invocation:

(defproject org.leiningen/sample "0.1.0-SNAPSHOT"
  :description "Just some kind of sample thing"
  :url "https://github.com/technomancy/lein-xml"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [slamhound "1.3.3"]])

I know it probably won't be used by anyone who has spent much time with Clojure, but for newcomers hopefully this will remove one of the big blockers for enterprise developers trying out Clojure.

« older | 2013-04-01T20:42:59Z | newer »

All posts | Résumé | Projects | Talks | Colophon | Technomancy is © 2004 – 2020 Phil Hagelberg


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK