GithubHelp home page GithubHelp logo

sicp-generators's Introduction

sicp-generators

A lein-generate plugin to generate test, paragraph or exercise files useful when studying SICP in Clojure. This plugin assumes you created the usual leiningen project to solve the SICP exercises or simply to follow along paragraph.

Usage

Just add:

:plugins [[lein-gen "0.2.1"]]

to your projet file and a generators section:

:generators [[sicp-generators "0.1.0"]]

Then create a test/paragraph version or test/exercise version with the following:

lein generate exercise 1-1
lein generate paragraph counting-change

The first example will create two files, src/sicp/exercises/1_1.clj and related test/sicp/exercises/1_1_test.clj. The second example will create two files, src/sicp/paragraphs/counting_change.clj and related test/sicp/paragraphs/counting_changes_test.clj

package root option

By default "sicp" is the name of the initial classpath root for generated files. To change that into something else use:

lein generate exercise 1-1 my-sicp

The additional "my-sicp" argument changes the root package of generated files (and ns declaration into: src/my_sicp/ and test/my_sicp.

test framework

By default the generated test stub uses clojure.test. You can also use midje stubs using:

lein generate exercise 1-1 my-sicp midje

resulting in the generation of a midje test stub requiring the related src file.

Help

Type

lein help generate

to see what templates and options are available.

License

Copyright © 2015 Renzo Borgatti http://reborg.net Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

sicp-generators's People

Contributors

reborg avatar

Stargazers

Vic avatar Andrey Bogoyavlenskiy avatar Vasily Kolesnikov avatar Philip Norman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.