In the REPL, there are functions that you always want to have handy, no
matter which namespace you are in.  One way of achieving this is to put
these functions into a namespace with a short name, like `.`, so you can
refer to them easily.  The original idea came from Gary Fredericks, who
also wrote dot-slash[1], which I discovered after writing this.

The `lein-shorthand` plugin[2] lets you declare such a namespace in your
leiningen profiles.

e.g.
    {:user
      {:dependencies [[alembic "0.3.2"]]
       :plugins [[com.palletops/lein-shorthand "0.4.0"]]
       :shorthand {. [alembic.still/distill alembic.still/lein]}}}

This would allow you to use `(./lein deps :tree)` to run the lein deps
task from any namespace, using alembic[3].

See the README for full details, including how to make the shorthand
functions load the required namespaces lazily, on first use.

Hugo

[1] https://github.com/gfredericks/dot-slash
[2] https://github.com/palletops/lein-shorthand
[3] https://github.com/pallet/alembic

Attachment: signature.asc
Description: PGP signature

Reply via email to