juxt

jonpither 2017-08-13T17:57:25.182967Z

Hi @chrisjd. Thanks for watching us 🙂 It's nice to know we have advocates who would like to see a consultancy using Clojure succeed.

jonpither 2017-08-13T18:03:07.213244Z

For the climate of Clojure consulting.... I don't think there is a great deal of demand for consulting simply of grounds of us using Clojure. Clojure is inherently a very simple language, and the teams that pick it up seem to go from strength to strength of their own accord (they can also hire relatively easily). Where JUXT has found greater demand is for a team that gets stuff done and has a track record of doing so, and for a consultancy that can bring innovation to a wider company. For sure we have won business from clients who are interested in Clojure and associated tech, but we have tried to widen our messaging beyond the precise tooling used.

chouser 2017-08-13T18:08:09.239311Z

I looked for a #mach and didn't see it. Didn't think to look for #juxt.

jonpither 2017-08-13T18:08:28.240860Z

yeah... probably should review that!

chouser 2017-08-13T18:09:48.247553Z

Ok, so I'm trying to write a mach entry that copies the source trees from a bunch of different lein projects into one (don't ask why!). Most of the source projects have the same layout, but a couple are odd.

chouser 2017-08-13T18:13:33.266576Z

So, I have something like: {collect {copy-tree-extra {"foo-orig/a" "foo-copy/a"}, classic-modules '[bar baz], copy-tree (merge (compute-copy-tree-for-modules classic-modules) copy-tree-extra), novelty (some (fn ...) #ref[collect copy-tree]), update! (doseq [entry #ref[collect copy-tree]] ...)}}

chouser 2017-08-13T18:15:37.277102Z

Sorry, I should format that better. Anyway, the point is I have a target whose definition depends on other targets. But this doesn't work because the ref preprocessor uses postwalk, which means that when a ref is expanded that contains other refs, only the first expansion happens, and a get a tricky-to-understand error about undeclared Var 'collect'

chouser 2017-08-13T18:16:24.280861Z

So am I misusing #refs, and should be solving this a different way?

jonpither 2017-08-13T18:17:22.285558Z

I wonder if 'props' would help: https://github.com/juxt/mach/blob/master/examples/git/Machfile.edn

jonpither 2017-08-13T18:17:57.288267Z

Using props you can define vars, and then during the update! and produces etc, the vars are used in a let binding

jonpither 2017-08-13T18:18:51.292783Z

so copy-tree in your case could go in the mach/props block...

chouser 2017-08-13T18:20:08.299779Z

ok, I can try that. Thanks!

jonpither 2017-08-13T18:20:30.301863Z

I see your point about postwalk vs prewalk - this code actually originated in Aero and it's a postwalk there also. https://github.com/juxt/aero. What you're saying does make sense though, so I'd want to ask @malcolmsparks if there's some overriding rationale behind the postwalk. Thanks for raising.

chrisjd 2017-08-13T18:31:30.357553Z

@jonpither Thanks! Interesting insight; I remember being intrigued by the emphasis that Juxt placed on the use of Clojure. From a technical perspective, the advantages of that are clear - I guess you must have the right mix of technical skills and customer relationships on board. 🙂

jonpither 2017-08-13T18:33:59.370489Z

@chrisjd Yes I think that's key - Clojure is a (not-so) secret weapon of choice, but a lot of the work we do is traditional consultancy practice (business development, risk/account management etc)

dominicm 2017-08-13T18:45:28.428326Z

@chouser we recently fixed this for #ref with aero which used a similar mechanism to this. Mach hasn't quite had the same attention for this point yet.