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"
:b
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 deadline
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
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 a
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 functi
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 becaus
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 r
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 wrote:
> What's wron
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 functions so
> treating th
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 have to keep that in
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 you
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 de
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 ans
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>
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 experience
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
doin
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
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 clojure@goo
18 matches
Mail list logo