Re: Incomplete With Destructuring Lists

2017-05-11 Thread Mars0i
There is also this sort of solution: (def xs (range 9)) (let [ [[a b c] mid3 [d e f]] (partition 3 xs) ] [a b c mid3 d e f]) => (0 1 2 (3 4 5) 6 7 8) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to

Reducers exception when calling into

2017-05-11 Thread Alex Miller
The symptoms sound like you are running into a case where there are multiple protocol branches that apply - this is a case where the behavior is undefined and can vary between JVM executions. Looks like it's going down the seq reduce path. I'm not at a computer to check more precisely what the

Reducers exception when calling into

2017-05-11 Thread Matt Grimm
Hi, I've run into a bizarre issue with reducers that is consistently reproducible, but only on one set of systems. On a separate system with the same OS and java, the error is not reproducible. The exception messages seem to indicate that I've tried to access a reducible like a seq before

Contract Clojure Developer Position (Mandarin Fluency) in Santa Clara, CA

2017-05-11 Thread Kevin
Distributed System/Clojure Senior/Staff Software Engineer (Contract to possible hire) The main requirement for this position is strong experience with Clojure and Java on Linux. Must be fluent in Mandarin for technical communication (written and verbal). May consider limited Clojure

Re: def with function call - how often executed?

2017-05-11 Thread Alan Thompson
When clojure reads this, it immediately evaluates `(+ 1 2)` => 3 so your code looks like: (def x 3) So subsequent references to `x` just get the pre-computed value of 3 and don't know how it was derived. Alan On Thu, May 11, 2017 at 9:58 AM, Kevin Kleinfelter < kleinfelter.gro...@gmail.com>

Re: How to Create Clojure `defn` Functions automatically?

2017-05-11 Thread Alan Thompson
Actually someone else wrote the original CLJS question (1): http://stackoverflow.com/questions/43897632/mapped-calls-to-clojurescript-macro It was marked as a duplicate of this question (2): http://stackoverflow.com/questions/43897632/mapped-calls-to-clojurescript-macro This one also had an

def with function call - how often executed?

2017-05-11 Thread Kevin Kleinfelter
If I write a def with a function call, such as: (def x (+ 1 2)) and I use x a gazillion times in my code, does Clojure execute the function ("+" in this case) on each use? Clearly, with (+ 1 2) it doesn't really matter, but if it is an expensive function such as reading a file it is a big

Re: How to Create Clojure `defn` Functions automatically?

2017-05-11 Thread Timothy Baldridge
I assume this is a real problem you are encountering since you wrote the original Stack Overflow questions. As Dragan mentioned, this example doesn't warrant such a complex solution, maps and keywords *are* function, so all you really need is `foo` as a getter. Or even if they weren't functions

Re: How to Create Clojure `defn` Functions automatically?

2017-05-11 Thread Alan Thompson
Since the original question was in CLJS, which has neither `intern` nor `eval`, does that mean the macro mapping another macro approach is the only solution there? On Thu, May 11, 2017 at 9:18 AM, Alan Thompson wrote: > I like the idea of using `eval` and `memoize`. I'll

Re: How to Create Clojure `defn` Functions automatically?

2017-05-11 Thread Alan Thompson
I like the idea of using `eval` and `memoize`. I'll have to keep that in mind. Alan On Thu, May 11, 2017 at 7:58 AM, Timothy Baldridge wrote: > This is a somewhat weird answer to a overcomplicated problem. As > mentioned, the data is a map to start with, and maps are

Re: How to Create Clojure `defn` Functions automatically?

2017-05-11 Thread Alan Thompson
The original question ( http://stackoverflow.com/questions/43897632/mapped-calls-to-clojurescript-macro) was about automatically generating callback functions for CLJS. Perhaps I oversimplified it too much for the example. Alan On Thu, May 11, 2017 at 1:55 AM, Dragan Djuric

Re: How to Create Clojure `defn` Functions automatically?

2017-05-11 Thread Dragan Djuric
That's why I avoided to answer the main question. In my experience, whenever I thought I needed some weirdly complicated stuff like the one in the example, there existed much simpler solution that used regular techniques. So, when I encounter similar problems the first thing I do is to try to

[Job] Software Engineer at Puppet

2017-05-11 Thread Russell Mull
My team, which works on https://github.com/puppetlabs/puppetdb, is hiring a software engineer. We mostly use Clojure. https://puppet.com/company/careers/jobs?gh_jid=685071 (The page says Portland, but we're gladly open to anyone in US time zones) - Russell -- You received this message

Re: How to Create Clojure `defn` Functions automatically?

2017-05-11 Thread Timothy Baldridge
This is a somewhat weird answer to a overcomplicated problem. As mentioned, the data is a map to start with, and maps are functions so treating the maps as data is probably the best approach. And like Dragan, I'm unsure why this example doesn't use `(data :able)`. When I do need to generate

[ANN] irresponsible/anarchy (business logic engine driven by tabular data) v0.2.0

2017-05-11 Thread James Laver
The Irresponsible Clojure Guild is pleased to announce a new version of the 'anarchy' business logic engine. This version features better resistance against nil-returning predicates and completely rewritten documentation that is hopefully significantly easier to understand. The docs are still

Re: How to Create Clojure `defn` Functions automatically?

2017-05-11 Thread Dragan Djuric
What's wrong with (foo :able) => "Adelicious!" and (:able foo) => "Adelicious!"? On Thursday, May 11, 2017 at 9:20:19 AM UTC+2, Alan Thompson wrote: > > A recent question on StackOverflow raised the question of the best way to > automatically generate functions. Suppose you want to automate the

Workshop on Functional Art, Music, Modelling and Design (Sep 9, Oxford): Call for Papers and Performances

2017-05-11 Thread Michael Sperber
Clojure submissions are very welcome at the FARM! 5th ACM SIGPLAN International Workshop on Functional Art, Music, Modelling and Design Oxford, UK, September, 9th 2017 Call for Papers and Performances Key Dates: Paper submission deadline June 1, 2017 Performance submission

How to Create Clojure `defn` Functions automatically?

2017-05-11 Thread Alan Thompson
A recent question on StackOverflow raised the question of the best way to automatically generate functions. Suppose you want to automate the creation of code like this: (def foo {:able"Adelicious!" :baker "Barbrallicious!" :charlie "Charlizable"}) (def bar {:able"Apple"