[ANN] lein-shorthand - a leiningen plugin to create namespaces with short names for use in the REPL

2014-09-24 Thread Hugo Duncan

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


signature.asc
Description: PGP signature


Re: `remove-ns' prevents namespace from being reloaded by `require' in clj 1.5.1 and 1.6

2014-09-23 Thread Hugo Duncan

laurent.pe...@gmail.com writes:

 Le mardi 23 septembre 2014, Stuart Sierra the.stuart.sie...@gmail.com a
 écrit :

 I'm not sure I understand what you mean.

 `remove-ns` does not remove the namespace from the set of loaded
 namespaces kept by `require`.  tools.namespace
 https://github.com/clojure/tools.namespace has a hack
 https://github.com/clojure/tools.namespace/blob/a166936bd757b71348c7c1608569fc0fcb1318bd/src/main/clojure/clojure/tools/namespace/reload.clj#L19
 to work around this.


 Can this be fixed for clojure 1.7 (integrate clojure.namespace hack into
 'remove-ns)? Or is there a reason I can't see right now in favor of the
 current behavior?

Or a new function added, e.g. `unload-ns`, that combines remove-ns with
updating the ref.

Hugo


signature.asc
Description: PGP signature


Re: `remove-ns' prevents namespace from being reloaded by `require' in clj 1.5.1 and 1.6

2014-09-23 Thread Hugo Duncan

laurent.pe...@gmail.com writes:

 Just a question so my understanding levels up: are there usecases where one
 would use the current behavior of removing a namespace not also removing it
 from *loaded-libs* (and thus preventing it from being required without
 :reload) ?

You can create namespaces without touching `require`, so I think it is
reasonable to expect you can remove them too, without any side effects
that will affect what `require` does.

Hugo


signature.asc
Description: PGP signature


Re: Sente 1.0.0 (was: [ANN] Taoensso library updates / 2014 September

2014-09-06 Thread Hugo Duncan

s...@corfield.org writes:

 Is that an intentional change? I ask because you claimed the release was 
 major but non-breaking - and this seems to be a breaking change...?

Did you change `start-chsk-router-loop!` to `start-chsk-router!`?  The
former maintains the previous event handler signature (and is thus
non-breaking), but the later requires the new signature.

Hugo


signature.asc
Description: PGP signature


[ANN] leaven and bakery - lightweight components for clojure and clojurescript

2014-09-03 Thread Hugo Duncan

leaven [1] is a component library, much like Stuart Sierra's component,
only it works for both clojure and clojurescript and is simpler.

bakery [2] is a library of leaven components, for both clojure and
clojurescript.

An example web app [3] uses httpkit, sente, weasel, storage-atom,
secretary, om-bootstrap, among other libraries.

Leaven doesn't mix system definition with system instantiation.  It uses
an explicit system definition, defsystem, that constructs a component
containing sub-components.  The dependency ordering between components
is explicit in defsystem.  Constructing an instance of the system is
done by creating an instance of the record defsystem defines.

Additional protocols can be implemented on your system in the body of
the defsystem.


[1] https://github.com/palletops/leaven[1]
[2] https://github.com/palletops/bakery[2]
[3] https://github.com/palletops/bakery/example-web-app[3]


signature.asc
Description: PGP signature


Re: [ANN] leaven and bakery - lightweight components for clojure and clojurescript

2014-09-03 Thread Hugo Duncan

The links in my previous post seem to not be correct:

[1] https://github.com/palletops/leaven
[2] https://github.com/palletops/bakery
[3] https://github.com/palletops/bakery/example-web-app


signature.asc
Description: PGP signature


Re: [ANN] leaven and bakery - lightweight components for clojure and clojurescript

2014-09-03 Thread Hugo Duncan

dsblakewat...@gmail.com writes:

 I'm not sure your [3] URL works.

Try https://github.com/palletops/bakery/tree/develop/example-web-app


signature.asc
Description: PGP signature


Re: [ANN] leaven and bakery - lightweight components for clojure and clojurescript

2014-09-03 Thread Hugo Duncan

dsblakewat...@gmail.com writes:

 Yeah, I worked back to the original to find the web-app. I note that the
 repo seems to default to develop, which results in a lot of errors when I
 try to lein repl in example-web-app. (Missing clojars which are, in
 fact, missing.)

A `lein install` at the top level of bakery should allow you to run on
develop.

 When I switch branch to the master, I don't get those errors, but the
 process hangs on Compiling 'target/cljs-test/testable.js, then times out.
 I tried doing a lein cljsbuild once prior, then found that lein repl
 would work.

Thanks for the feedback.  I've updated the README accordingly.

Hugo


signature.asc
Description: PGP signature


Re: [ANN] leaven and bakery - lightweight components for clojure and clojurescript

2014-09-03 Thread Hugo Duncan

ja...@booleanknot.com writes:

 If I'm understanding right, the main difference between Leaven and
 Component is that Leaven uses *defsystem* to specify an explicit start/stop
 ordering, while Component uses its *using* function to define dependencies
 between components, and works out the ordering itself.

Indeed.  The result is a system definition that is open to extension via
other protocols, and that can be instantiated without having to specify
the dependencies between components at the same time, which feels more
natural to me.  I could be convinced about adding some sort of
declarative description of inter-component dependencies to defsystem,
but I'm not sure it is really necessary.

Also, the fact it works with clojurescript.

 Also, while this is a really minor thing, the naming of ILifeCycle kinda
 bugs me. The I prefix is an abbreviation for Interface, but ILifeCycle
 is a protocol.

Having used Om a fair bit recently, I was influenced by the naming of
the protocols there.

Hugo


signature.asc
Description: PGP signature


Re: timbre logging, java libs

2014-07-25 Thread Hugo Duncan

craft.br...@gmail.com writes:

 Is there any good way to use timbre in a project with java libs, e.g. c3p0,
 that use java logging APIs?

You might want to look at:

  http://ptaoussanis.github.io/timbre/taoensso.timbre.tools.logging.html
  https://github.com/palletops/log-config#user-content-timbre-and-java-logging

If you set up tools.logging to use your preferred java logging
implementation, then timbre can log to it.

Hugo


signature.asc
Description: PGP signature


[ANN] Criterium 0.4.2 released

2013-08-28 Thread Hugo Duncan

Criterium 0.4.2 has been released [1], and is on clojars.

The only update is to issue a warning if TieredStopAtLevel is found in
the JVM arguments.  Hopefully this will help alert people trying to
optimise code using lein's default JVM arguments.

Criterium measures the computation time of an expression. It is designed
to address some of the pitfalls of benchmarking, and benchmarking on the
JVM in particular.

Hugo

[1] https://github.com/hugoduncan/criterium


signature.asc
Description: PGP signature


Re: Multiple Clojure contexts in the same JVM

2013-08-20 Thread Hugo Duncan
David Pollak feeder.of.the.be...@gmail.com writes:

 I have an application where I need multiple independent Clojure contexts
 running in the same JVM.

Classlojure [1] can do this for you, taking care of correct
initialisation, and evaluation.

[1] https://github.com/flatland/classlojure


pgpjGCdyjK4nh.pgp
Description: PGP signature


Re: ritz-nrepl starts up slowly?

2013-05-16 Thread Hugo Duncan
yizhen wei yizhenwe...@gmail.com writes:

 I found that my ritz-nrepl takes 25 plus seconds to start. While the nrepl 
 would only take 10 secs.

The difference is mainly due to the extra jvm process that is started.

 I also noticed that the lein ritz-nrepl (or M-x nrepl-ritz-jack-in inside 
 of emacs) would start 3 java processes which consumes total of 800mb 
 memory. 

One vm is from lein, and can be removed by invoking lein with trampoline.

The extra process that is started is used to control the debugger.  I've
not looked at all into optimising the memory footprint of the debugger
vm, and I would be surprised if it couldn't be improved.

 But after I close the server in terminal (or emacs), only 2 of them 
 are closed, and I have to explicitly kill the remaining one.

The killing of the user process is currently not very reliable.

Hugo

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[ANN] Alembic, a library for adding dependencies to your REPL classpath

2013-04-29 Thread Hugo Duncan

Alembic [1] is a library for adding dependencies to your REPL classpath.

It adds minimal dependencies to your project, while still allowing
resolving of dependencies from clojars, etc.  It builds on top of lein,
pomegranate and classlojure.

It records added dependencies, so you can query them for adding to
project.clj.

Alembic will warn if transitive dependencies have conflicting versions.

A blog post on alembic gives some more details [2]

Hugo

[1] https://github.com/pallet/alembic
[2] http://palletops.com/alembic-clojure-classpath-control/

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ANN: no.disassemble, a runtime bytecode disassembler

2013-03-30 Thread Hugo Duncan
Gary Trakhman gary.trakh...@gmail.com writes:

 I made a little proof of concept last night.  You could always look at 
 bytecode that clojure emits in few ways, you can either hack the compiler 
 yourself, or force AOT in your project and use javap.  The first approach 
 is a bit intrusive, and the second has a somewhat annoying turnaround time, 
 and won't work for any code that calls eval at runtime.

 This takes another approach.  It uses java's Instrumentation stuff, to 
 provide a hook into all classloading past the point at which it's loaded, 
 where I store off all the bytes of defined classes into a big 
 ConcurrentHashMap.  Then I use eclipse.jdt.core's disassembler 
 functionality to print out the bytecode.

The Ritz' disassembler uses jpda to access the bytecode.  Not yet ported to
ritz-nrepl though.

Hugo

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] Amazonica: Clojure client for the entire AWS api

2013-03-26 Thread Hugo Duncan
Michael Cohen mcohe...@gmail.com writes:

 Well, of course everything is handled via reflection, which has a cost. The 
 question is, can you afford the cost. 

Or can the cost be confined to compile time...

 In general, I think most of the AWS 
 apis really aren't concerned with performance, e.g. EC2, and you're not 
 making (many) repeated calls. 

 In general though I think for AWS reflection would not be an issue.

I think the dynamic use of reflection would be enough to put me off
using this in something like pallet, for example.

Hugo

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Is it possible to set breakpoint using nrepl-ritz?

2013-03-24 Thread Hugo Duncan
intronic m...@pheasant.co.nz writes:


  Is it possible to set breakpoint using nrepl-ritz? 

 It is using the latest development code (C-c C-x C-b on the line to 
 break at).  A release should be out containing this in the next few 
 days. 


 Can you explain how to use the latest dev code?

 Looking at project.clj files on github.com/pallet/ritz, there is a version 
 0.7.1-SNAPSHOT
 but i dont find this version in clojars.org.
 I tried git cloning pallet/ritz with the thought to make symlinks in my 
 project checkouts dir, but I cant figure out how to make the right symlinks 
 into the pallet/ritz nested project structure.

I need to release the latest dev code, but I would like to make the
breakpoint handling a little more robust first.

I shalln't be releasing snapshot jars to clojars, but you can build them
locally with a `lein install` from the top level of the ritz project
clone.

 Also - slime with common lisp can parse compile errors giving shortcut keys 
 to jump to the code refered to by the compiler error message. Is this 
 possible with nrepl/ritz?

That capability is in nrepl.el 1.7.

Hugo

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Redefinition of datatypes

2013-03-22 Thread Hugo Duncan
Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com writes:

 Now that ClojureWest has finished, I'll gently bump this thread :)

 Thanks,
 Ambrose

Ambrose,

I had a quick look at this.  I tried running with zi:test, and it
complained about a missing dependency on tools.macro.  Adding that as a
test scoped dependency and running again gives me:

  [ERROR] InvocationTargetException: java.lang.StringIndexOutOfBoundsException: 
String index out of range: 1, 
compiling:(clojure/core/typed/test/mini_kanren.clj:575:3)

The original error seems to have something to do with the core.contracts
expansion.  Defining TopFilter and BotFilter with c.core/defrecord (and
defining appropriate type predicate functions) seems to get further.

Hugo

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Is it possible to set breakpoint using nrepl-ritz?

2013-03-16 Thread Hugo Duncan
Warren Lynn wrn.l...@gmail.com writes:

 It is using the latest development code (C-c C-x C-b on the line to 
 break at).  A release should be out containing this in the next few 
 days. 

 Hugo 


 I was eager to use the line debugging commands but had no success. After 
 M-x nrepl-ritz-jack-in, I loaded a clojure file (just the simple hello 
 world generated by lein new), and set a breakpoint at a line with M-x 
 nrepl-ritz-line-breakpoint. Now, when I run this function in the nrepl 
 buffer, it just hangs and never returns. Without setting the breakpoint 
 everything works fine. Anybody has succeeded on using  the debugger? Thanks.

You'll need to set nrepl-ritz-break-on-exception for breakpoints to work
properly at the moment.  This should be a temporary restriction.

 BTW, it seems nrepl-ritz can also hang on other comands. For example, when 
 I run M-x nrepl-ritz-apropos and input core, it just hangs (but with 
 input map, it works).

Could you create an issue for this.

Thanks

Hugo

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Is it possible to set breakpoint using nrepl-ritz?

2013-03-13 Thread Hugo Duncan
xumingming64398966xumingming64398...@gmail.com writes:

 Is it possible to set breakpoint using nrepl-ritz?

It is using the latest development code (C-c C-x C-b on the line to
break at).  A release should be out containing this in the next few
days.

Hugo

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Wrong clojure version depending on lein dependencies

2013-03-04 Thread Hugo Duncan
Meikel Brandmeyer (kotarak) m...@kotka.de writes:

 Hi,

 Am Montag, 4. März 2013 13:00:31 UTC+1 schrieb Wolodja Wentland:

 It is up to a community to fix things that are broken in their toolset and 
 Do not use version ranges is IMHO the wrong answer. 

 Huge +1.

Fixing version ranges seems like a good idea (e.g. I just ended up with
commons-logging on the classpath, I think due to clojure 1.5.0 being
released).  Maven's answer to these issues seems to be use
dependencyManagement [1].

I still think the valid use cases of version ranges are quite limited
though.  When does using version ranges make sense? Or thinking from a
lein perspective, what features does lein need to provide for specifying
dependency versions, and are version ranges the best way of expressing
these?

Hugo

[1] 
http://www.sonatype.com/books/mvnref-book/reference/pom-relationships-sect-project-dependencies.html#pom-relationships-sect-version-ranges

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] clj-nio2 0.1.0

2013-02-28 Thread Hugo Duncan

Hi Jürgen,

I was just looking for a nice filesystem watcher!

Jürgen Hötzel juer...@hoetzel.info writes:

-  Implementation of * clojure.java.io/Coercions * and *
clojure.java.io/IOFactory* protocols for NIO.2 paths.

Does this differ from https://github.com/pjstadig/nio?

Hugo

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: nrepl-ritz setup (missing dependency dynapath)

2013-02-18 Thread Hugo Duncan
Dima B dimath...@gmail.com writes:

 I've been going through all the instruction on the nrepl-ritz page 
 (https://github.com/pallet/ritz/tree/develop/nrepl) as well as nrepl-ritz 
 threads and I can't seem to get it working due to a mysterious dependency 
 problem on dynapath.

Which version of ritz?

 Adding [org.tcrawley/dynapath 0.2.1] explicitly into :dependencies list 
 into ~/.lein/profiles.clj doesn't help.

The dependency is [dynapath 0.1.0], which is on clojars.

Hugo

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: nrepl-ritz setup (missing dependency dynapath)

2013-02-18 Thread Hugo Duncan
Toby Crawley t...@tcrawley.org writes:

 * I can release a new version that is compatible with 0.1.0 and 0.2.x,
   requiring you do depend on it (and possibly exclude other versions)
 * I can update ritz to use 0.2.1, and Hugo can make a new release (if he
   is amenable to that). As far as I know, ritz is the only project that
   depends on 0.1.0.

 I'd prefer to do the latter, because that would be the proper fix, but
 don't want to burden Hugo.

Thanks for finding the cause.

The latter is fine by me.  It is about time we had another ritz release for
nrepl.el 1.6 anyway.

Hugo

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: nrepl-ritz setup (missing dependency dynapath)

2013-02-18 Thread Hugo Duncan
Toby Crawley t...@tcrawley.org writes:

 Hugo Duncan writes:

 The latter is fine by me.  It is about time we had another ritz release for
 nrepl.el 1.6 anyway.

 I'll send you a PR in a few minutes.

Thanks.

Released in ritz 0.7.0

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Pretty-printing `lein test`s output?

2013-02-15 Thread Hugo Duncan
Sean Corfield seancorfi...@gmail.com writes:

 You'll find your workflow greatly improved by using nrepl (or
 slime/swank) and running tests directly from Emacs - and that applies
 whether you're using bare clojure.test, midje or expectations.

For nrepl.el, via clojure-test-mode, There is an pull request [1] to add
inspection of test failures using pretty printing.  The pull request
also adds inspection of test failures using ediff to compare actual and
expected.

[1] https://github.com/technomancy/clojure-mode/pull/139

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: multiple nrepl sessions in emacs

2013-02-12 Thread Hugo Duncan
Leonardo Borges leonardoborges...@gmail.com writes:

 Is there an efficient way to work with multiple nrepl sessions in
 emacs? I hope I'm just missing something obvious.

nrepl.el master has support for this [1].  Should be available via
MELPA.


Hugo

[1] https://github.com/kingtim/nrepl.el/pull/238
[2] https://github.com/kingtim/nrepl.el#installation

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Hooking into doc and source

2013-01-31 Thread Hugo Duncan
phillip.l...@newcastle.ac.uk (Phillip Lord) writes:

 I'm build a library which provides a DSL for building ontologies.
 Underneath this backs onto a Java API. The library works by provide some
 macros, which create Java objects then intern them into the local
 namespace. 

 With the documentation, I can just add this to the metadata. But there
 is a problem; I also need this in the underlying Java objects, so that
 when the ontology is serialised, all the documentation goes with it. So
 now I have the documentation in two places. 

Could you initialise the var metadata using the docstring pulled from
the java object. You would probably need your macros to generate
alter-var-root forms to add the metadata.

Hugo

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: What people want from Clojure error messages

2013-01-26 Thread Hugo Duncan
Brian Marick mar...@exampler.com writes:

 I've also noticed that the messages that come from botched
 macroexpansions are often not useful in that they contain no clues
 about the original source, and sometimes not even a useful reference
 to the original namespace.

If these are macros that are under your control, and they are generating
new forms, you may be able to improve this by explicitly propagating
:line and :file metadata from the input form onto the generated form.

Hugo

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Java annotations on functions, in conjunction with gen-class?

2013-01-26 Thread Hugo Duncan
Ryan Cole r...@rycole.com writes:

 Hi all, beginner here,

 I'm trying to write a Minecraft plugin in Clojure, and use AOT so that the 
 Minecraft server can load it right up. I've got this much going, and all as 
 well. The server expect some of my functions in a class that I'm extending 
 to use an appropriate annotation on the function.

 How do I add these annotations? I've Googled around and see that it looks 
 like support for this was added back in 2010, so I'm sure it's possible. 
 Maybe I've seen the solution but didn't realize that it was a solution. 
 Clojure still looks pretty alien to me, so crazy things like this are rough 
 to search for and realize when the answer is in front of me.


Annotations are added as metadata to functions in a deftype definition.
Something like this (untested):

(deftype MyType []
   SomeInterface
   (^{EventHandler {}} onPlayerLogin [event] ...))

For some examples of using annotations:

https://github.com/pallet/clojure-maven/blob/develop/mojo/src/main/clojure/clojure/maven/mojo/defmojo.clj#L45
https://github.com/pallet/zi/blob/develop/src/main/clojure/zi/test.clj#L109

I'm afraid it's not very friendly code if you're new to clojure.

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Is contributing to clojurescript is intentionally made hard ?

2013-01-18 Thread Hugo Duncan
Sean Corfield seancorfi...@gmail.com writes:

 My understanding is that with pull requests it becomes much harder to
 provide accountability for Intellectual Property which is a legal
 concern, and that's why we have a Contributor's Agreement. 

I wonder if the availability of http://www.clahub.com/ changes anything...

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Can't get ritz-swank working

2013-01-02 Thread Hugo Duncan
Michael Bradley, Jr. michaelsbradle...@gmail.com writes:

 Long story short, after I run `slime-connect` in Emacs, I get a warning: 
 Versions differ: 2010-11-13 (slime) vs. 20101113 (swank). After choosing 
 to continue, I'm told a connection has been established, but no REPL 
 appears, and I can't seem to bring one up manually.

You need to add `(slime-setup '(slime-repl)) in a slime-load-hook.  That
needs adding to the readme.

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: A Working nrepl-ritz Setup?

2012-12-08 Thread Hugo Duncan
Charles  Comstock dgti...@gmail.com writes:

 Note that unlike the docs listed at ritz/nrepl, I also needed to add an 
 explicit dependency for clojure-complete 0.2.2. I also needed to use the 
 MELPA version of nrepl, nrepl-ritz. I still encounter some sort of issue 
 where it appears that the documentation querying functions, find-doc, and 
 doc and the like are not being properly brought into the repl namespace, 
 which breaks ctrl-d d until I manually bring that into the namespace. I'm 
 not quite certain what was causing that problem and have yet to find 
 a permanent fix.

Both these issues are probably caused by nrepl-ritz.el not being
loaded. Does a manual M-: (require 'nrepl-ritz) fix these?

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: A Working nrepl-ritz Setup?

2012-12-05 Thread Hugo Duncan
Timothy Washington twash...@gmail.com writes:


 1) I start from an empty *~/.emacs.d/*
 2) I then populate init.el from the example in
 ritz/nreplhttps://github.com/pallet/ritz/tree/develop/nrepl

 3) I open a lein project and run `*M-x nrepl-ritz-jack-in*`

 **) The error I get back is:

 *error in process sentinel: Could not start nREPL server: 'ritz-nrepl' is
 not a task. See 'lein help'.*

This is actually a lein message, and it is saying that the lein-ritz
plugin is not in the :plugins vector of a lein profile. There is an
example of setting this up in ~/.lein/profiles.clj on the page you
linked.

HTH,

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: A Working nrepl-ritz Setup?

2012-12-05 Thread Hugo Duncan
Timothy Washington twash...@gmail.com writes:

 Yes, I updated *~/.emacs.d/init.el* and *~/.lein/profiles*, as outlined
 on that page. But somehow nrepl server thinks *'ritz-nrepl' is not a task*.

Does running `lein ritz-nrepl` from a shell within your project
directory work?

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure expression benchmarks

2012-11-24 Thread Hugo Duncan

Andy Fingerhut andy.finger...@gmail.com writes:

 I've just published some results of measuring the run time of many Clojure 
 expressions on 5 different JVMs and over a dozen different Clojure versions 
 at the link below.


 http://jafingerhut.github.com/clojure-benchmarks-results/Clojure-expression-benchmarks.html

Some interesting charts in there!

Great to see criterium put to good use. I just released the version of
criterium that includes your changes as 0.3.1.

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


[ANN] lein-sha-version plugin for leiningen project version based on git SHA

2012-11-20 Thread Hugo Duncan

lein-sha-version is a leiningen plugin that sets the project version
based on the git SHA of the HEAD of the current branch. 

It can be used to create jars with a fixed version, but without the
trappings of a full release version. It provides a simple way of doing
SNAPSHOT type releases without the disadvantage of having SNAPSHOT
resolve to a moving target version.

It is a leiningen middleware, and does not provide any leiningen
task. It does not modify the project.clj file.

See https://github.com/pallet/lein-sha-version for usage.

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: [ANN] lein-sha-version plugin for leiningen project version based on git SHA

2012-11-20 Thread Hugo Duncan
Lee Hinman matthew.hin...@gmail.com writes:

 Hugo Duncan writes:

 lein-sha-version is a leiningen plugin that sets the project version
 based on the git SHA of the HEAD of the current branch. 

 It can be used to create jars with a fixed version, but without the
 trappings of a full release version. It provides a simple way of doing
 SNAPSHOT type releases without the disadvantage of having SNAPSHOT
 resolve to a moving target version.

 Out of curiosity, doesn't maven's snapshot pining already do this?

You can pin usage of a snapshot based on upload timestamp. The lifetime
of SNAPSHOT artifacts is however controlled by the repo policies, so a
particular (timestamped) version of SNAPSHOT jar can disappear at any
time. 

Jars produced when using this plugin would be considered release jars in
the maven repo world.

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Smarter code reloading with tools.namespace 0.2.0

2012-10-16 Thread Hugo Duncan
Timothy Washington twash...@gmail.com writes:

 2) Running emacs with nrepl.el. I fire up *M-x nrepl-ritz-jack-in*

ritz-repl-utils includes a namespace dependency graph in
ritz.repl-utils.namespaces.  It doesn't yet include a refresh type
function, but that would be straightforward to add on top of a call to
`(transitive-dependencies (direct-dependencies))`.

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: ritz / nrepl.el / cljsbuild auto / cljsbuild repl-listen ... in same session?

2012-10-15 Thread Hugo Duncan
Timothy Washington twash...@gmail.com writes:

 I have a ritz and nrepl.el session running. I'd also like to be able to

 *i)* auto compile cljs (lein cljsbuild auto) and
 *ii)* have a browser repl (lein trampoline cljsbuild repl-listen) in the
 same session.

The latest ritz has a M-x nrepl-ritz-lein command, that allows you to
run lein commands in your project vm.

 I can do them in separate sessions. But it would be nice to have it all
 inside of an nrepl-ritz-jack-in session. Is this at all possible?
 Essentially it would involve running those lein tasks from the nrepl. But
 I'm not sure how to do that. I've tried *(require 'leiningen.cljsbuild)* ,
 but that namespace is not on the classpath.

It may be more appropriate to have a middleware for `cljsbuild auto` and
for `cljsbuild repl-listen`. For example, we could inspect the
project.clj file sent to the project middleware in [1] (which
currently provides support for switching projects inside a REPL), and
automatically start these.

If you think this is useful, maybe you could add this as an issue to ritz [2].

Hugo


[1] https://github.com/pallet/ritz/tree/develop/nrepl-project
[2] https://github.com/pallet/ritz/issues

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: ANN Ritz 0.5.0

2012-10-05 Thread Hugo Duncan
bruce li leilmy...@gmail.com writes:

 I'm trying ritz and having some issues with SLDB that really confused 
 me. When I switch on the slime-break-on-exception, it seems it sometimes 
 doesn't work. The SLDB buffer won't pop up and I sometimes can see the 
 exceptions in the terminal (but sometimes not :(  ).

Probably https://github.com/pallet/ritz/issues/51

 By the way, it seems ritz 0.5.0 does not work with Lein 1. I'm wondering if 
 Ritz is planned to support Lein 2 only from then on?

I broke it unintentionally - I wonder how many are still using lein1.
Continuing to support lein 1 is obviously more complicated, but should
be feasible.

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: ANN Ritz 0.5.0

2012-09-24 Thread Hugo Duncan

Adrian,

adrians nman...@gmail.com writes:

 I'm trying to get ritz-nrepl going with the latest lein2 and nrepl.el from 
 Melpa. I think I've followed the instructions on the project page, yet I 
 get this, when I nrepl-ritz-jack-in:

 error in process sentinel: Could not start nREPL server: Exception in thread 
 main java.lang.ClassNotFoundException: com.sun.jdi.VirtualMachine
...

 The same exception is thrown if I invoke ritz-nrepl from the command-line. 
 I'm using jdk 1.7.0_07 with Windows 7 64 bit, if that helps. Any clue as to 
 what's going wrong?

The error is saying that it hasn't been able to find the jdk's tools.jar file.

This is issue https://github.com/pallet/ritz/issues/53, which is now
fixed and will be in the next release.

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: ANN Ritz 0.5.0

2012-09-24 Thread Hugo Duncan

Tim,


Timothy Washington twash...@gmail.com writes:

 I was following the instructions on the ritz-nrepl
 pagehttps://github.com/pallet/ritz/tree/develop/nrepl. And
 I get the error below, when executing the *M-x nrepl-ritz-jack-in*
 command.

...

 Caused by: java.lang.RuntimeException: Unable to resolve symbol: ex-info in
 this context
 at clojure.lang.Util.runtimeException(Util.java:156)
 at clojure.lang.Compiler.resolveIn(Compiler.java:6720)
 at clojure.lang.Compiler.resolve(Compiler.java:6664)
 at clojure.lang.Compiler.analyzeSymbol(Compiler.java:6625)
 at clojure.lang.Compiler.analyze(Compiler.java:6198)
 ... 171 more

This seems to be an issue with clojure 1.4 not being used in the
controlling vm, and should have been fixed by
https://github.com/pallet/ritz/issues/53, which will be included in the
next release.

 You mention that this is meant to be used in tandem with nrepl.el (*
 nrepl-jack-in*)? Because it looks like a parallel tool (*nrepl-ritz-jack-in*).

You should be able to invoke nrepl-ritz-jack-in once nrepl-ritz.el is
installed.

 Could you run through a typical workflow of setting and using the *M-x
 nrepl-ritz-break-on-exception* command? I just want to make sure that I'm
 grokking how to use it.

After running  'M-x nrepl-ritz-break-on-exception', you should get the
debugger activated on an exception. So, entering something like
(throw (Exception. Hello)) at the repl should result in a debugger
buffer being displayed, showing you a stacktrace.

Hope that helps,

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: ANN Ritz 0.5.0

2012-09-21 Thread Hugo Duncan

Stefan,

sthueb...@googlemail.com (Stefan Hübner) writes:

 a) Are you planning on updating Zi for this new release?

Yes. It might take a few days.

 b) How can ritz-nrepl or (preferably) ritz-swank be embedded in an
 application?

I just added instructions [1] to the ritz-swank README. I've not
actually tried this yet, but this is essentially how the lein ritz
plugin starts ritz-swank.

Hugo

[1] https://github.com/pallet/ritz/tree/develop/swank#embedding

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: slime-ritz help needed on clean emacs 24.2.1 new setup

2012-09-20 Thread Hugo Duncan
sal salka...@gmail.com writes:

 i am able to run clojure-jack-in and start swank server

Are you able to use the repl?

 , but never see the 
 command slime-mode, slime-connect in emacs.

Not sure what you mean by this. Are these commands not available once
the repl is running? The jack-in process is responsible for loading
slime which provides these.

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


ANN Ritz 0.5.0

2012-09-19 Thread Hugo Duncan

Ritz provides a clojure debugger for nREPL.el and SLIME, other nREPL
middleware, and a general repl-utils library.

0.5.0 adds several new features.

 * load-project will load the project for buffer you are currently
   visiting. This allows you to switch projects in an existing repl.

 * reload-project will reload the current project. If you have added
   dependencies to the project, these will be added to the classpath. If
   you have removed dependencies, the classpath will be updated
   appropriately and all user namespaces cleared.

 * lein will allow you to use the REPL vm to run lein command for you
   current project.

The commands above should be prefixed with slime-ritz-, or nrepl-ritz-
as appropriate.

ritz-nrepl works with the recent nrepl.el 0.1.4 release.

Change log: https://github.com/pallet/ritz/blob/develop/ReleaseNotes.md

Project: https://github.com/pallet

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: ANN Ritz 0.4.1

2012-09-08 Thread Hugo Duncan
Denis Labaye denis.lab...@gmail.com writes:

 On Fri, Sep 7, 2012 at 9:11 PM, Hugo Duncan h...@hugoduncan.org wrote:


 Ritz is a collection of repl servers, middleware and repl utility
 functions, supporting nREPL and swank/slime. The repl utilities can be
 used from any repl.


 Does ritz/swank replace lein-swank?

The equivalent of lein-swank is lein-ritz [1].

At the moment there is no simple way of starting ritz without the
debugger (`lein ritz 4005 localhost :server-ns ritz.swank.repl` is the
not so simple way of doing this).

The jack-in instructions should probably also be given more prominence
in the README.

Hugo

[1] https://github.com/pallet/ritz/tree/develop/swank

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: ANN ritz 0.4.0 release with nREPL debugger support

2012-09-07 Thread Hugo Duncan
sthueb...@googlemail.com (Stefan Hübner) writes:

 Hugo Duncan h...@hugoduncan.org writes:

 * ritz-swank corresponds to the previous ritz functionality and provides
   a swank server with debugger capabilities.

 Also: the Zi maven plugin has not catched up with ritz 0.4.0. I was
 trying to force it to use ritz-swank-0.4.0 but got an exception when
 doing 'mvn zi:ritz':

This should be fixed in zi 0.5.3, which I just pushed.

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


ANN Zi 0.5.4

2012-09-07 Thread Hugo Duncan

Zi is a maven plugin for working with clojure. 

The 0.5.4 release adds support for the following goals:

* nrepl Launches a vanilla nREPL server

* ritz-nrepl Launches an nREPL server with debugger.

* ritz Launches a swank server with debugger. Now supports ritz-swank 0.4.1.

The project can be found at https://github.com/pallet/zi

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


ANN Ritz 0.4.1

2012-09-07 Thread Hugo Duncan

Ritz is a collection of repl servers, middleware and repl utility
functions, supporting nREPL and swank/slime. The repl utilities can be
used from any repl.

The 0.4.1 release is mainly a bug fix release.

* Fixes an issue with in-ns not working correctly

* Fixes jack-in support for ritz-swank

* Fixes breakpoint support

Many thanks to Jeff Palmucci and @cola_zero.


Ritz is on github: https://github.com/pallet/ritz



Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: ANN Zi 0.5.4

2012-09-07 Thread Hugo Duncan

Hello Tom,

Tom Hickey thic...@gmail.com writes:

 I'm not able to get the latest version of Zi to work. It seems to be having 
 a problem resolving a couple of it's dependencies:

 [ERROR] Failed to execute goal org.cloudhoist.plugin:zi:0.5.4:compile 
 (default-cli) on project test: Execution default-cli of goal 
 org.cloudhoist.plugin:zi:0.5.4:compile failed: Plugin 
 org.cloudhoist.plugin:zi:0.5.4 or one of its dependencies could not be 
 resolved: The following artifacts could not be resolved: 
 classlojure:classlojure:jar:0.6.5, 
 leiningen-core:leiningen-core:jar:2.0.0-preview4

 pom and maven stacktrace can be found here: https://gist.github.com/3669520

Thanks for the detailed report.

This suggests that clojars isn't being picked up. Adding it as a
pluginRepository to the pom as a workaround seems to get things moving.

pluginRepository
  idclojars/id
  urlhttp://clojars.org/repo/url
/pluginRepository

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: ANN Zi 0.5.4

2012-09-07 Thread Hugo Duncan
Tom Hickey thic...@gmail.com writes:

 I'm not able to get the latest version of Zi to work. It seems to be having 
 a problem resolving a couple of it's dependencies:

 [ERROR] Failed to execute goal org.cloudhoist.plugin:zi:0.5.4:compile 
 (default-cli) on project test: Execution default-cli of goal 
 org.cloudhoist.plugin:zi:0.5.4:compile failed: Plugin 
 org.cloudhoist.plugin:zi:0.5.4 or one of its dependencies could not be 
 resolved: The following artifacts could not be resolved: 
 classlojure:classlojure:jar:0.6.5, 
 leiningen-core:leiningen-core:jar:2.0.0-preview4

I've just pushed zi 0.5.5 which should fix this.

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: redefining multimethods at the repl

2012-09-05 Thread Hugo Duncan
Stuart Halloway stuart.hallo...@gmail.com writes:

 Are there other things like this that cause people to restart REPL 
 unnecessarily? I would like to identify the whole list of such things and 
 kill them.

Maybe related. Ritz has slime-load-file hooked up to code that tries to
remove dead vars from a namespace. i.e. if you remove a var from your
source and reload the file, it will notice that the var is no longer
there and remove it.

It does this by setting a flag in the metadata of every var in the
namespace before loading, then loads the file, then examines which vars
still have the flag set.

This works very well except for defonce'd vars, which are removed by the
above logic. One way to solve this would be for defonce, and any other
def form with the same semantics, to set a marker keyword, :defonce say,
on the metadata of the vars they define.

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


ANN ritz 0.4.0 release with nREPL debugger support

2012-09-05 Thread Hugo Duncan

ritz started life as a swank server for emacs SLIME. With this release
it has evolved into several components:

* ritz-nrepl provides both nREPL middleware, that can be used in any
  nREPL server (and any client), and a debugger for use with nrepl.el,
  the emacs client for nREPL. The nrepl middleware provide the complete,
  doc, javadoc, apropos and describe-symbol nREPL operations.

* ritz-swank corresponds to the previous ritz functionality and provides
  a swank server with debugger capabilities.

* ritz-debugger provides a library for using the JVM JPDA debugger
  classes from clojure.

* ritz-repl-utils provides a library of functions, used to provide
  common repl behaviour between ritz-nrepl and ritz-swank. This is also
  independent of emacs.

The project can be found at https://github.com/pallet/ritz

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


ANN Pallet 0.7.2

2012-09-04 Thread Hugo Duncan

Pallet is a library for infrastructure management, covering
provisioning, configuration management and deployment.

Pallet 0.7.2 is mainly a bug fix release. It addresses a number of
issues around the usage of the lein plugin which were causing problems
for some people following the first steps instructions.  

The first step instructions have also been extended to cover more of
basic pallet usage.

Release notes:
https://github.com/pallet/pallet/blob/support/0.7.x/ReleaseNotes.md

First steps: http://palletops.com/doc/first-steps/

Documentation: http://palletops.com

Updates are posted on Twitter @palletops 

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


ANN lein-set-version 0.2.0

2012-09-04 Thread Hugo Duncan

lein-set-version is a Leiningen plugin to update your project version.

Apart from updating project.clj, you can configure the update of other
project files, such as the README.

lein-set-version also updates versions of sub-projects in :dependencies
when run with lein-sub.

Usage and configuration documented at
https://github.com/pallet/lein-set-version

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Rich added set-agent-send(-off)-executor! and send-via functions

2012-08-17 Thread Hugo Duncan



mnicky markus.mas...@gmail.com writes:

 I have some great news: 
 https://github.com/clojure/clojure/commit/f5f4faf95051f794c9bfa0315e4457b600c84cef
  
 :)

Good news indeed.

Sounds like a good time to plug a little library I wrote to create
executors: https://github.com/pallet/pallet-thread

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: aot compilation: minimise the scope of the resulting classes

2012-05-22 Thread Hugo Duncan
Phil Hagelberg p...@hagelb.org writes:

 On Mon, May 21, 2012 at 10:56 AM, Philip Aston phil...@mail.com wrote:
 I'd like to compile the bare minimum, even if this means some sort of
 thunk in Bootstrap. How can I do this?

 One solution is to call require at runtime inside function bodies
 rather than at the top-level. Then to call the functions from the
 runtime-required namespace, use the resolve function.

Another is to use :impl-ns option in genclass and implement the java class in a 
separate
namespace (assuming you are using genclass).

Hugo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Parallel SSH and system monitoring in Clojure

2012-03-20 Thread Hugo Duncan
Chris McBride cmm7...@gmail.com writes:

I releases two simple clojure libraries to help running commands
 via SSH on multiple servers. Hopefully someone will find it useful.

You might also be interested in Pallet [1], which executes via SSH.

[1] http://palletops.com

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Literate programming in emacs - any experience?

2012-02-01 Thread Hugo Duncan
Colin Yates colin.ya...@gmail.com writes:

 Has anybody got any real world usage reports regarding using literate 
 programming in emacs?  In particular, does paredit and slime work inside 
 the clojure fragments when using org.babel for example?

For the update in Pallet docs [1], we've been using Jekyll with
markdown. To edit code blocks within the markdown, I've been using
mumamo [2] in emacs, with a variant of jekyll-mumamo.el [3]. An example
of what markdown with clojure blocks looks like is the how-to for using
a server-rack with Pallet [4] (unfortunately, Jekyll doesn't use the
same fencing for code blocks as GitHub).

SLIME works fully within the code blocks. For example C-x C-e can be
used to evaluate expressions. Paredit also works.

Obviously this is not a full literate programming environment, but
someone might find it useful.

Hugo


[1] http://palletops.com/doc/
[2] http://ourcomments.org/Emacs/nXhtml/doc/nxhtml.html
[3] https://gist.github.com/1666286
[4] 
https://raw.github.com/pallet/pallet.github.com/master/doc/how-tos/_posts/2012-01-26-using-pallet-with-existing-servers.md

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Literate programming in emacs - any experience?

2012-02-01 Thread Hugo Duncan
Mark Engelberg mark.engelb...@gmail.com writes:

 On Wed, Feb 1, 2012 at 5:38 AM, Hugo Duncan duncan.h...@gmail.com wrote:
 SLIME works fully within the code blocks. For example C-x C-e can be
 used to evaluate expressions. Paredit also works.

 My understanding is that unless you use C-c C-k to evaluate the entire
 file (which I don't think works in a literate program) the expressions
 evaluate in a way that doesn't provide Clojure with line numbers,
 making stacktraces even more obtuse.  Am I wrong, or has anyone found
 a way around this issue?

I use ritz [1], which keeps track of of both repl source forms, and sets
correct line numbers when compiling functions with C-c C-c. 

Each REPL source form is numbered, and you can list them with M-x
slime-list-repl-forms.

When running a function compiled from a markdown file with C-c C-c
(which is M-x slime-compile-defun), any exception ends up showing the
line number in the markdown file. eg.

  Backtrace:
0: user$f.invoke (2012-01-14-script.md:27)

Also, exceptions land you in the debugger, so it is quite easy to see
where a problem is occurring.


[1] https://github.com/pallet/ritz

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Literate programming in emacs - any experience?

2012-02-01 Thread Hugo Duncan
Fogus mefo...@gmail.com writes:

 I would love to see your .emacs setup around these tools.

I'll put together a blog post - my .emacs files could do with a cleanup,
so this sounds like a good excuse to get it done.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Using clojure.java.shell for long running tasks

2011-11-16 Thread Hugo Duncan
I took a slightly different approach to this, in pallet.shell, and added
an :async flag that returns the streams and the process

https://github.com/pallet/pallet/blob/master/src/pallet/shell.clj

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Pallet meetup during conj

2011-10-28 Thread Hugo Duncan

Hi all,

There will be an informal gathering of pallet users during the conj. Come
and talk with us, whether your just wondering what pallet can do, want to
hear how others are using pallet, if you have feedback and comments for
improving pallet, or you just want to say hello!

RSVP here: http://www.meetup.com/Pallet-Users-Group/events/38415062/

Apologies if this is seen as OT, but we started a meetup group [1] for
this before the extracurricular spreadsheet appeared, and want to reach
pallet users who are on this list.

Looking forward to meeting you at the conj!

--
Hugo Duncan

[1] http://www.meetup.com/Pallet-Users-Group

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: How to attach debugger on clojure's repl ?

2011-09-23 Thread Hugo Duncan

On Fri, 23 Sep 2011 08:00:36 -0400, Sam Aaron samaa...@gmail.com wrote:



On 23 Sep 2011, at 06:14, Glen Stampoultzis wrote:



Ritz looks really nice the setup seems complicated.  I haven't had much  
luck setting it up unfortunately.


Hopefully we can simplify the process. The setup hasn't been the main  
priority yet.



* Modified my global cake project.clj file to look as follows:


I've not actually tried running ritz from cake recently. Which version of  
cake?



(defproject global 0.0.0
  :description Don't rename this project, but you can change the  
version if you want.

  :dependencies [[clojure 1.3.0-RC0]]
  :dev-dependencies [[ritz 0.1.8-SNAPSHOT]])


I've also not tried running with 1.3.0-RC0.

* The ritz README talks about making sure tools.clj is in the classpath.  
However, it appears on OS X there is no tools.jar:


tools.jar doesn't exist for the mac jdk. I'll add an explicit comment to  
the readme.



* I created a blank project with `cake new foo`
* cd into foo
* Ran `cake ritz` to get the error unknown task: ritz.

I'm unsure where to go from here. How do I teach cake about the ritz  
task? Am I missing any specific steps? Is not having tools.jar available  
on OS X an issue?


I imagine this is some issue preventing the cake task from loading.  I  
believe cake logs its output somewhere - maybe you could check the cake  
logs for ritz related messages?


I'll try taking a look later today.

I'd be very happy to write up a Getting Started tutorial on the ritz  
wiki if I can get things working.


I'll gladly take you up on that :)

Hugo

--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: How to attach debugger on clojure's repl ?

2011-09-23 Thread Hugo Duncan
On Fri, 23 Sep 2011 08:14:43 -0400, Scott Jaderholm jaderh...@gmail.com  
wrote:


I don't think it looks for tools.jar specifically, it probably just uses  
the
classes in there so as long as they're on the classpath you should be  
fine.
I wouldn't worry about it unless you see an error saying it can't find  
some

classes that googling reveals are in tools.jar.


Correct.


The README doesn't mention any cake plugins, that's why cake ritz isn't
working.


There is a cake task. It hasn't seen a lot of use as far as I know, but  
was working at one point. Cake has however seen a lot of instability  
recently (from my occasional usage at least). In this case I suspect 1.3  
RC0 is causing the task not to load.


If cake supports lein plugins then maybe you didn't do lein plugin  
install ritz 0.1.7.


I would recommend 0.1.8-SNAPSHOT. The main difference is in how exceptions  
are selected for breaking into the debugger, which remains the main  
sticking point for ritz development at the moment. I'm itching for a  
clojure.match release so I can use it for this. [1]



Perhaps use lein or the maven plugin instead.


The maven plugin is zi [2]

Hugo

[1] https://github.com/pallet/ritz/issues/14
[2] https://github.com/pallet/zi

--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Generating Bash scripts from Clojure

2011-09-14 Thread Hugo Duncan
On Wed, 14 Sep 2011 15:34:25 -0400, Denis Labaye denis.lab...@gmail.com  
wrote:


I played with it a little bit, can't make the latest version (0.7) to  
work, only the 0.5.


The current version will require you use (with-script-language  
:pallet.stevedore.bash/bash …) to specify bash as the target language


So far it seems pretty cool. I am not sure yet how to unit test the  
clojure bash scripts but the repl is much more confortable than the  
raw bash shell.


The stevedore tests might provide inspiration.


And by the way the marginalia doc is awesome !


Thanks. There is also:
  http://pallet.github.com/pallet/reference/reference_script.html

(which needs updating and moving to go with the rest of the stevedore docs)

--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Build tool for mixed Clojure/Java projects

2011-07-04 Thread Hugo Duncan
On Mon, 04 Jul 2011 03:14:01 -0400, Konrad Hinsen  
konrad.hin...@fastmail.net wrote:


AOT compilation: My case is probably a bit complex in this respect. I  
need AOT compilation only because I want to produce an executable jar,  
so there is at least one namespace that must be AOT compiled. For  
building that executable jar, it doesn't matter if everything else is  
AOT compiled as well. But I want to be able to build a standard library  
jar with just the Clojure code to make sure it works with future Clojure  
releases. One solution would be to have two completely different builds,  
one for the executable jar and one for the library version, but using  
the same set of source code files.


You might be able to use the :impl-ns option in gen-class to limit the  
extent of AOT compilation.


--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure 1.3 Beta 1

2011-06-24 Thread Hugo Duncan
On Fri, 24 Jun 2011 16:53:13 -0400, Stuart Sierra  
the.stuart.sie...@gmail.com wrote:



So, if you are currently using Clojure 1.2, your upgrade path might look
something like this:

 1. Find the new contrib library you need


I am wondering how best to handle current contrib functionality, such as  
clojure.contrib.reflect, that is being absorbed into 1.3 and does not have  
a standalone contrib equivalent. Any suggestions?


I'm not sure how many of these there are. At least in the case of  
clojure.contrib.reflect, the code is both short and standalone, so could  
easily be copied to a project specific namespace.


--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: swank-clj 0.1.0 - a refactored swank-clojure, with sldb support

2011-05-23 Thread Hugo Duncan

On Sun, 22 May 2011 16:59:24 -0400, Sam Aaron samaa...@gmail.com wrote:


Very cool!


Thanks.

Out of interest, how do swank-clj and swank-clojure (with merged in cdt  
stuff) compare?


I would have to let others comment on the user experience, not having used  
the cdt support in swank-clojure.  From reading the code, I see two  
differences.


i) swank-clj uses SLDB vs the use of GUD in swank-clojure,

ii) swank-clj starts two jvms, one for the debugger and one for the  
debuggee. If I understand correctly, CDT uses a single jvm process.


In swank-clj at the moment, a swank server runs in both jvms, but I am  
working towards being able to run using just JPDA/JDI to talk to the  
debugee. At that point it will be possible to attach the debugger to any  
jvm process running with debugging enabled.



--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: swank-clj 0.1.0 - a refactored swank-clojure, with sldb support

2011-05-23 Thread Hugo Duncan

On Sun, 22 May 2011 18:09:50 -0400, Jason Wolfe ja...@w01fe.com wrote:


1.  The usual repl entry point is not used, and so, e.g., (set! *warn-
on-reflection* true) fails.


Thanks, I raised an issue to track this  
https://github.com/hugoduncan/swank-clj/issues/8



2.  I could not figure out a way to browse exception chains.
Typically the real stack trace for an exception is reached by
repeatedly calling .getCause on the exception until the innermost
exception is reached, but right now I can't see how to access causes
in the swank-clj debugger.  For example try:


There is no support for exception chains. The reasoning behind this is  
that swank-clj can catch the original exception, before it gets caught and  
re-thrown in the program. At the moment, there is some rigid filtering of  
exceptions that means in some cases the original exception is not caught.


I am hoping that improved (user modifiable) filtering of exceptions based  
on thrown type, throw location and catch location, will obviate the need  
for handling exception chains in the interface.  Does that sound  
reasonable?



If you want, I'm happy to help out on these.  Thanks for the great
work!


All help appreciated - if you can, I would prefer pull requests from  
feature branches. There is lots to be done, especially around adding test  
cases to get the project to the point where we can make changes with  
confidence.


Raising issues for broken slime features would also be useful.

--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


swank-clj 0.1.0 - a refactored swank-clojure, with sldb support

2011-05-11 Thread Hugo Duncan

For the intrepid, the first release of swank-clj is out.

This is a refactored swank-clojure, and features sldb integration.

Some highlights:

* line based breakpoints
* stepping
* exception restarts

See the readme at https://github.com/hugoduncan/swank-clj

--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Aw: defnk pre- and post-conditions

2011-04-26 Thread Hugo Duncan

On Tue, 26 Apr 2011 07:27:52 -0400, Meikel Brandmeyer m...@kotka.de wrote:


clojure supports keyword arguments for a quote some time now.

(defn foo
  [positional1 ... positionalN  {:keys [kw1 ... kwn]}]
  ...)


This is used extensively in Pallet but has a couple of drawbacks.

  - Repetition of keywords to specify defaults
  - Repetition of keywords and defaults in doc strings
  - The defaulted argument values are not available as a map
  - No flag for presence of specified keyword (à la CL)

Inspired by a discussion [1] on supporting shFlags in stevedore, I drafted  
a defnkw [2] that allows for the following syntax:


(defnkw foo
  My foo
  [positional1 … positionalN
 [[kw1 description1 default1]
   [kw2 description2]]]
  …)

and automatically generates a suffix to the doc string.

(doc foo) =
My foo
- kw1 description1. Default default1.
- kw2 description2.

The formatting of the generated doc string can obviously be improved, and  
it is not obvious to me what syntax to use for naming the keyword option  
map (:as). This approach would allow defaulted values to be merged back  
into the option map.  Support for presence flags would require an extra  
element in the specification vector (e.g. [description default flag?])


An alternative would be to use a more defnk like syntax:

(defnkw foo
  My foo
  [positional1 … positionalN
 :kw1 [description1 default1]
  :kw2 description2]
  …)


I would be interested in any comments.


[1] https://github.com/pallet/stevedore/pull/1
[2]  
https://github.com/pallet/common/blob/feature%2Fdefn-for-kw-args/src/pallet/common/core.clj

--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


ANN: pallet.thread-expr, a macro lib for use with - argument threading

2011-04-21 Thread Hugo Duncan
By popular demand (well at least two requests), pallet.thread-expr is now  
an independent lib, extracted from pallet.


The library provides a number of macros for use within a - expression.

A couple of examples:

(- 2
  (arg- [x]
(* (inc x
 = 6

(- 1
  (for- [x [1 2 3]]
(+ x)))
 = 7

Github: https://github.com/pallet/thread-expr
Autodoc:  http://pallet.github.com/thread-expr/autodoc/index.html
Marginalia: http://pallet.github.com/thread-expr/marginalia/uberdoc.html

--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: lein deps error, please help...

2011-04-21 Thread Hugo Duncan

On Thu, 21 Apr 2011 20:24:15 -0400, uMany elm...@gmail.com wrote:


when I try lein deps at a test-project
with this
I got this long error message:
tmp/test-project$ lein deps
Downloading:
org/clojure/clojure/1.2.0-master-SNAPSHOT/clojure-1.2.0-master-SNAPSHOT.jar
from clojure-snapshots
Downloading:
org/clojure/clojure/1.2.0-master-SNAPSHOT/clojure-1.2.0-master-SNAPSHOT.jar
from clojars
Downloading:
org/clojure/clojure-contrib/1.2.0-SNAPSHOT/clojure-contrib-1.2.0-SNAPSHOT.jar
from clojure-snapshots
Downloading:
org/clojure/clojure-contrib/1.2.0-SNAPSHOT/clojure-contrib-1.2.0-SNAPSHOT.jar
from clojars
An error has occurred while processing the Maven artifact tasks.
 Diagnosis:


It looks like you have dependencies on clojure-1.2.0-SNAPSHOT and  
clojure-contrib-1.2.0-SNAPSHOT.  Try removing the -SNAPSHOT from these  
in your project.clj file.


In the maven/jar world a SNAPSHOT refers to a interim, development version  
of jar, and can disappear at any time.  Clojure 1.2 has been available as  
a release version for quite a while now.


--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: You should fix this before next release!

2011-04-15 Thread Hugo Duncan
On Fri, 15 Apr 2011 09:28:39 -0400, Stuart Sierra  
the.stuart.sie...@gmail.com wrote:


If you're referring to clojure-contrib in its current, monolithic form,  
it is all deprecated.  New development is happening in new, per-library

repositories at http://github.com/clojure


A couple of questions to help consider how/when to move to these new repos:

Is there a policy as regards whether the new per-library repos will run  
against clojure 1.2?


Are all contrib libs going to move to new repos? if some existing contrib  
libs will not be moved to new repos, will they be ported to 1.3?


--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


clojure 1.3 testbuild1, enlive, and dependency ranges

2011-03-11 Thread Hugo Duncan

Hi,

I have a project that depends on enlive, which uses a dependency range in  
its clojure dependency.  This seems to cause all possible versions of  
clojure to be pulled down, including clojure-1.3.0-testbuild1-SNAPSHOT,  
which is broken (parent pom is in a release repo which isn't listed in the  
testbuild1 pom).  This in turn breaks my build.


At the moment the only remedy I can see is to re-package enlive to remove  
the dependency range.  Anyone have any other ideas?


--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: clojure 1.3 testbuild1, enlive, and dependency ranges

2011-03-11 Thread Hugo Duncan
On Fri, 11 Mar 2011 16:40:46 -0500, Stuart Sierra  
the.stuart.sie...@gmail.com wrote:



I created the testbuild-* artifacts, but they were never uploaded to the
Maven Central Repository.  I had previously deleted the staging  
repositories

from oss.sonatype.org, and today I deleted the remaining
1.3.0-testbuild*-SNAPSHOT artifacts from oss.sonatype.org.


Many thanks for this.


FYI, you can also exclude transitive dependencies with Maven/Leiningen.

In Leiningen, like this:
https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L35

In Maven, like this:
http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html#Dependency_Exclusions


I should have mentioned that I had tried both these before posting, and  
they don't seem to help in this case. All clojure version artifacts were  
still being downloaded.


--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: noob question: pallet, crane, which criteria to choose which one ?

2011-02-24 Thread Hugo Duncan
On Thu, 24 Feb 2011 06:29:13 -0500, Laurent PETIT  
laurent.pe...@gmail.com wrote:



 * deliver to pre-production:
   * input = git commit hash, maven version of some tooling artifacts
which are java artifacts, invoked via an mvn java execute target once the
right git revision has been checked out
   * output = publish the app state (created locally from the derived  
git

content) to a directory in the server, run a shell script on the server
which finishes the install, and, if everything went well, tag the commit,
and push the tag to the reference repo from which the content had been
initially pulled from



Would trying to use pallet or crane seem overkill ?


Laurent,

Pallet would certainly be capable of automating the workflow you  
describe.  From what you describe a shell script invoked by an ssh command  
could probably do the job too.  In pallet it might look something like  
this (unchecked):


  (def release-dir /usr/local/myapp)

  (defn push-preproduction*
 Crate function to publish a specific commit
 [request tag version artifacts]
 (exec-script/exec-checked-script
request
(format Checkout version %s version) ; message for logging, etc
(cd src)
(git checkout ~version)
(mvn exec:java something ~@artifacts)
(cp app-state ~release-dir)
(finish-install)
(git tag ~tag)
(git push --tags)))

  (def push-production
 Crate function to extract data from the environment,
  and publish it
 [request]
 (push-preproduction*
   request
   (environment/get-for request [:userdata :tag])
   (environment/get-for request [:userdata :version])
   (environment/get-for request [:userdata :artifacts])

  ;; define phases on a Server group, linking the
  ;; publish phase to the push-production crate function
  (def server (make-node server {}
   :publish push-preproduction))

  ;; Function to publish a specific version.  Uses the node definitions
  ;; from config.clj
  (def publish
 [request tag version  artifacts]
 (let [service (compute/compute-service-from-config-file :nl)]
   (core/lift server
  :phase publish
  :compute service
  :environment {:userdata {:tag tag
   :version version
   :artifacts artifacts}})

Set up ~/.pallet/config.clj, specifying details of the existing machine,  
and that it should be in the server group


  (defpallet
:providers
 {:nl {:provider node-list
   :node-list [[server server 192.168.2.37
:ubuntu :os-version 10.04]]
   :environment {:user {:username user :no-sudo true)

and invoked via

  (publish tag commitish artifact1 artifact2)


Whether pallet is overkill or not, I think, is dependent on whether you  
think your requirements will grow.  Using this as an exercise to learn  
pallet would be time well spent if you think you will want to automate  
more in the future.


But, I'm biased.

--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: searching for a good name thread-let, thread-with, thread-thru

2011-02-04 Thread Hugo Duncan
On Fri, 04 Feb 2011 15:05:39 -0500, B Smith-Mannschott  
bsmith.o...@gmail.com wrote:



What should I name this thing? I'm concerned that thread is
confusing due to its dual meaning. let seems in line with clojure
conventions.

(thread-let [x ...] ...)
(thread-with [x ...] ...)
(thread-through [x ...] ...)
(let- [x ...] ...)



I used let- for a slightly different version of this in pallet

(- 3
  (let- [x 1 y 2]
(+ x y)))
 = 6

which enables a general let in the middle of a threaded expression.

https://github.com/pallet/pallet/blob/master/src/pallet/thread_expr.clj

--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


The failing test cases in c.c.logging

2010-09-17 Thread Hugo Duncan
While debugging tests (hudson only failures) in pallet, I noticed that  
there was some interaction between my tests, as if they were running in  
parallel.  To solve the issues I added binding calls inside each test  
case, which solved my issues.


The c.c.logging test cases failures look similar, so might I suggest  
adding a binding for log/*logging-agent* inside each of the failing tests.


I am unable to explain why there is an interaction.

--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Slime, debug-repl clojure debugging toolkit

2010-07-23 Thread Hugo Duncan

On Fri, 23 Jul 2010 02:35:13 -0400, Krukow karl.kru...@gmail.com wrote:


So I guess the problem is in swank/break.


Should be fixed in 1.3.0-SNAPSHOT now.

--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Suggestions for a file and line implicit argument in macros

2010-07-14 Thread Hugo Duncan
On Wed, 14 Jul 2010 11:21:51 -0400, Nicolas Oury nicolas.o...@gmail.com  
wrote:


Would two implicit arguments file and line be useful for others, or I  
am

the only one that needs something like that?


I would definitely find it useful (e.g. in pallet to tie generated bash  
script back to clojure source).


--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Benchmarking clojure code

2010-07-01 Thread Hugo Duncan
On Thu, 01 Jul 2010 13:44:25 -0400, Mike Meyer  
mwm-keyword-googlegroups.620...@mired.org wrote:



Is anyone using anything more sophisticated than clojure.core/time for
benchmarking clojure code?


I wrote a benchmarking lib at http://github.com/hugoduncan/criterium

The references in the README are worth checking.

You might also find Lau's blog post of interest:  
http://www.bestinclass.dk/index.clj/2010/03/functional-fluid-dynamics-in-clojure.html


--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Benchmarking clojure code

2010-07-01 Thread Hugo Duncan
On Thu, 01 Jul 2010 15:51:28 -0400, Mike Meyer  
mwm-keyword-googlegroups.620...@mired.org wrote:



This looks nice, but doesn't work with 1.1 :-(. Do you know the last
commit that did?


I'm not sure that I would be too confident on the correctness of any  
version that ran on 1.1.



Better yet, can I talk you into posting a 1.1 jar file to the
downloads area, maybe along with a 1.2 RC, so users who aren't
comfortable with the Java infrastructure
(http://www.mired.org/home/mwm/papers/simple-clojure.html) can play
along?


I would need to take the time to backport the lib from its existing  
state.  As far as I remember there is only very light defrecord usage to  
contend with.  I'm afraid it is not high priority for me at the moment.


I would also wonder how significant the loop overhead is, especially for  
comparing implementations of the same function, which would then have  
similar loop overhead.  It is interesting to time Thread/sleep calls with  
different sleep periods (not that sleep is going to be accurate itself,  
but a regression of loop count versus Criterium's measured time and the  
sleep time might be interesting).


Another issue with timing fast, simple functions is that jit can optimise  
a calculation to a constant if it is simple enough.


My major concern with Criterium would rather be on the percentage garbage  
collection time reported.  There still needs to be work done on removing  
the allocation of result structures from the body of the timed results.  I  
would expect that to have a bigger impact than the loop overhead.


Hugo


--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: State of Clojure web development

2010-06-23 Thread Hugo Duncan
On Wed, 23 Jun 2010 17:23:16 -0400, James Reeves  
weavejes...@googlemail.com wrote:



1. Have you written, or are you writing, a web application that uses
Clojure? What does it do?


I'm writing cloudhoist.com, a cross cloud management console and api, that  
lets you start and stop nodes on Amazon, Rackspace, etc, configure them  
with your favourite stacks (eg, tomcat, mysql, couchdb), deploy you apps  
and carry out admin actions.



2. Which libraries or frameworks are you using? Which versions?


Ring, moustache, enlive, scriptjure, clutch.  All latest versions. Jetty,  
tomcat, nginx.



3. What made you choose Clojure to develop web applications in? What
are the strengths of Clojure web development?


It's a lisp, with all that entails, and it deploys nicely on the JVM.


4. What do you think are the current weaknesses of web development in
Clojure? What could be improved?


I am interested in using clojure for client side coding.  Ring friendly  
authentication and authorisation libs would be nice (I rolled my own). I  
miss rails' named routes, but am sure something better will materialise  
for clojure.



5. Anything else you want to comment on?


Thanks to everyone for their work in this area!

--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Enhanced Primitive Support

2010-06-18 Thread Hugo Duncan
On Fri, 18 Jun 2010 09:20:35 -0400, Rich Hickey richhic...@gmail.com  
wrote:


On Jun 18, 2010, at 8:56 AM, Konrad Hinsen wrote:


On 18.06.2010, at 14:49, Rich Hickey wrote:

I don't see a way around this fundamental dichotomy. The semantics for  
+ should be unified, and the operator that makes the other choice  
needs to be called something else, or placed somewhere else.


If you are doing a lot of work with whichever semantic requires decorated  
use, then it is going to seem awkward.  A namespace based solution would  
allow natural use of whichever semantic was appropriate for the domain  
you are coding.  It would still require an explicit choice - pulling in a  
different namespace.


- how will someone 'protect' themselves from libraries written using  
fastmath?


If I understand correctly, that is still an issue, whatever syntax is  
chosen.



- similar looking code will change semantics when the ns switch is made


The switch is explicit.

- seems dangerous as it might violate the presumptions of the original  
authors.


Not sure I understand this. Presumably if you change your selected  
semantics within a namespace, you had better be sure of how that affects  
all the functions in that namespace.



--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Help needed - Weird behavior

2010-05-25 Thread Hugo Duncan
On Tue, 25 May 2010 15:33:20 -0400, Sean Devlin francoisdev...@gmail.com  
wrote:



I'm experimenting w/ protocols * proxy (I have an Abstract Base Class
I need).  So far everything is awesome, then I get some first rate
wierdness:

http://gist.github.com/413571

Why does me unit-div fn work right, but my unit-mult fn totally go
haywire?

Confused.



(apply * [(unit 1 area)]) is maybe the problem

--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Running Clojure scripts in Maven

2010-05-19 Thread Hugo Duncan

On Wed, 19 May 2010 11:14:15 -0400, Geoff geoff.sal...@gmail.com wrote:


This is cool. What I'd really like to do though is run some of the
clojure code belonging to the project during the build. I'm toying
with a webapp that runs on google appengine and I'd like to bake
some pages to produce static html/css/js files at build time using the
same templates and everything that the dynamic parts of the webapp
will use once it's deployed.


Geoff, Glad to hear you have got gae working smoothly for you.


It looks like your clojure-maven-plugin is using the classloader of
the plugin class when running the clojure. Could it also add the
clojure source directories in there some how? Maybe using a new
URLClassLoader with the plugin classloader as the parent. This might
only work if it's running after the compile phase. Not sure of the
maven classloader intricacies here.


I realised this shortly after posting. As you say, it requires a  
classloader with the relavent classpath elements. When the plugin  
extractor runs, the dependencies have not been resolved, so to get these  
elements, code is required to resolve the project.  I have some clojure  
code elsewhere that resolves a project, but I am not sure if it is doing  
it the proper way.  Once resolved it should be simple to set up the  
classloader.  If you're interested I could send you the clojure code.



On May 16, 11:26 am, Jason Smith ja...@lilypepper.com wrote:

On May 16, 7:22 am, Hugo Duncan hugodun...@users.sourceforge.net
wrote:

 ...

 In case you are interested, I recently implemented some of the   
infrastructure to allow you to writemavenplugins in clojure. A simple   
 example that just logs basedir is here:


http://github.com/hugoduncan/clojure-mojo-example/blob/master/src/mai...

 The annotation support isn't complete yet, but the simple example  
works.


 --
 Hugo Duncan

On a related note, I was wondering if anyone had taken a stab at
Clojure stub generation.  That is, on the generate-sources phase,
you generate .java files that stub out the classes you mean to create
in Clojure.  Javac comes along, sees the stubs, and can compile all
the classes together.

Then, once Javac has done its work, you run Clojure to replace the
stubbed .class files with the real thing.  Solves the chicken-and-
egg problem quite nicely.

The stubs would contain Javadoc, annotations, and generics
(eventually...), allowing Java frameworks to easily consume classes
compiled from Clojure.  That is, it would work with the compile-time
annotation processor from Java 5 and 6, and it would also work  
withMavenplugins, since they use Javadoc (inMaven2, at least) for

annotations.  I had imagined thatMavenplugins would just sort of
fall out from having a good stub generator.

Has anyone talked about doing something like this???

This is how the Groovy cross-compiler works, and how GMaven (the
GroovyMavenplugin) performs cross compilation.  Of course, it should
be much easier to do with Clojure.  With Groovy you have to worry
about all the intricacies of  ANTLR, but parsing in Clojure is dead
simple.  Theoretically you should just have to look for the correct
function names and metadata and spit out Java source.

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with  
your first post.

To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group  
athttp://groups.google.com/group/clojure?hl=en





--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Error when tried to compile with C-c C-k in emacs.

2010-05-17 Thread Hugo Duncan

On Mon, 17 May 2010 10:38:43 -0400, grav mikk...@gmail.com wrote:


clojure-mode 1.7.1
slime 20100404
slime-repl 20100404
swank-clojure 1.1.0


You'll need swank-clojure 1.2.1 to work with that version of slime.

--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Running Clojure scripts in Maven

2010-05-16 Thread Hugo Duncan
On Sat, 15 May 2010 21:54:55 -0400, Jason Smith ja...@lilypepper.com  
wrote:



http://sandflea.googlecode.com/svn/site/SNAPSHOT/maven-clojure-plugin/example-execute-simple.html

I was originally going to try to put this into *clojure-maven-plugin*,
but realized that there are lots of subtleties to cover that would be
difficult as a sub-contributor.  So I have created
sandflea.clojure:maven-clojure-plugin.  It currently has one goal,
*execute*, that lets you execute Clojure scripts at any lifecycle
state in the Maven build, with in-process access to various Maven
objects (project, session, log, etc.).


In case you are interested, I recently implemented some of the  
infrastructure to allow you to write maven plugins in clojure. A simple  
example that just logs basedir is here:


http://github.com/hugoduncan/clojure-mojo-example/blob/master/src/main/clojure/maven/clojure/example/plugin.clj

The annotation support isn't complete yet, but the simple example works.

--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Error when tried to compile with C-c C-k in emacs.

2010-04-08 Thread Hugo Duncan
On Thu, 08 Apr 2010 18:32:56 -0400, Stefan Kamphausen  
ska2...@googlemail.com wrote:



you're using a rather recent checkout of CVS SLIME.  They added
keyword args to compile-file-for-emacs which is currently not
understood on the clojure swank side.  The quickest way to fix that
would be changing that part of SLIME.  Yes, this is ugly.


This is fixed in swank-clojure and is available in 1.2-SNAPSHOT.  I use  
SLIME 2010-03-10.



In the long run the Clojure community should either create an
official fork of SLIME (and try to port the good stuff, that happens
in SLIME) or try to work closer together with the fine SLIME folks.  I
don't think that we should risk losing the Emacs users, because they
may be very happy to find a usable way of leveraging Java's wealth
without having to type Java ;-)  And the frequency of Emacs-setup-
related posts in the near past should tell us that things are not too
well right now.  Ho-humm (or what did the Ents say?)


The autodoc and hyperdoc branches in technomancy's swank-clojure  
repository implement recent slime features, and require testing with ELPA  
slime before they can be merged.  Volunteers?


--
Hugo Duncan

--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Datatypes and protocols - update

2009-12-09 Thread Hugo Duncan
On Mon, 07 Dec 2009 12:07:12 -0500, Laurent PETIT  
laurent.pe...@gmail.com wrote:

 2009/12/7 Hugo Duncan hugodun...@users.sourceforge.net

 On Mon, 07 Dec 2009 06:53:38 -0500, Rich Hickey richhic...@gmail.com
 wrote:

  Yes, methods are not really functions. Thinking about them as closures
  over the object is a good way to go - you can see that analogy in play
  when you consider recur, which works with these methods, but could not
  rebind 'this'. The recur case sealed the deal in the decision not to
  include 'this' in the argument lists.

 I had a quick play with protocols, and the biggest problem I had getting
 started was realising that the signature of a method definition in
 defprotocol was different to the signature required to implement the  
 same
 method in deftype.  FWIW, I found it very non-intuitive.

 And now that you've got it, do you still feel this  non-intuitive.
 Because I had the same feeling first: I thought I would never rembember  
 how things work and why put 'this-like args there, and not there ...
 But now that everything clicked in place, I feel the last status of  
 what Rich achieved to do the most natural and intuitive.


I'll no doubt get used to it :-)  A couple of things that would have  
helped me get it:

 From the deftype doc:

  Thus methods for protocols will take one fewer arguments than do the  
protocol functions.

would (at least for me) be clearer as:

  Thus methods for protocols are implemented with one fewer argument than  
in the protocol function definitions.


The example of a deftype protocol implementation that is in the  
defprotocol doc string could be repeated in the deftype doc string.


 Basically, what helped me was along the lines of what Konrad said :
  * defprotocol and extend are purely functional : so you have to  
 specify
 every argument, including the object the functions acts upon.
  * deftype with embedded protocol definition for the type, or reify, in  
 the
 contrary, do not define pure functions. They define methods. You cannot  
 get
 them as values and pass them around like higher-order functions, for
 example. And you must know this fact, it cannot be an implementation  
 detail.
 So, since you know this fact, you remember that you're in a method
 definition (in the general sense of object oriented languages : method  
 of a
 class) and, as you do with e.g. java, C#, ... , when definining methods,  
 you
 do not add the target of the method as an implicit argument.

 The big advantage I see to this is that once you get it, you don't have
 anymore to remember where 'this is explicit and where it's implicit: it's
 intuitive.
 The other big advantage is that the use of recur inside these
 functions/methods bodies continue to match exactly the signature of the
 function/method (otherwise you would have had to remember that, e.g. in
 methods defined via deftype, you must place an explicit this argument  
 in
 the method arg list, but not place it in the recur calls ... :-( )

That explanation certainly helps describe and clarify the reasons for the  
difference. I still find it counter-intuitive that the definition follows  
the syntax of the functional world, and the implementation that of an  
object orientated world.  However, I can't think of any suggestion to  
resolve this, and as you say it does reflect the reality of the situation,  
so I'll get used to it :-)

--
Hugo Duncan

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Datatypes and protocols - update

2009-12-07 Thread Hugo Duncan
On Mon, 07 Dec 2009 06:53:38 -0500, Rich Hickey richhic...@gmail.com  
wrote:

 Yes, methods are not really functions. Thinking about them as closures
 over the object is a good way to go - you can see that analogy in play
 when you consider recur, which works with these methods, but could not
 rebind 'this'. The recur case sealed the deal in the decision not to
 include 'this' in the argument lists.

I had a quick play with protocols, and the biggest problem I had getting  
started was realising that the signature of a method definition in  
defprotocol was different to the signature required to implement the same  
method in deftype.  FWIW, I found it very non-intuitive.

--
Hugo Duncan

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Strange little difference with the reader and the java float parsers

2009-11-27 Thread Hugo Duncan
On Fri, 27 Nov 2009 14:50:27 -0500, Nathan Cunningham  
penguin2...@gmail.com wrote:

 Apparently there are cases where read will return a slightly different
 float then the Float constructor will. For example:

 (- (new Float 1786.28) (read-string 1786.28))
 2.929687502728484E-5

read-string returns a Double for me...

--
Hugo Duncan

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en