This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-02
Channels
- # admin-announcements (21)
- # announcements (1)
- # boot (128)
- # cider (18)
- # cljs-dev (10)
- # clojure (112)
- # clojure-brasil (2)
- # clojure-italy (4)
- # clojure-japan (12)
- # clojure-russia (38)
- # clojurescript (241)
- # clojutre (1)
- # datascript (2)
- # datomic (3)
- # events (1)
- # hoplon (38)
- # jobs (1)
- # ldnclj (5)
- # melbourne (8)
- # off-topic (2)
- # om (9)
- # re-frame (13)
- # reagent (43)
- # sneer-br (24)
- # sydney (3)
suddenly, i can' t make a new project with lein, while I've just done so an hour ago
I don't even know what I changed because I stopped to have a break and game a bit
could not locate clojure/data/priority_map__init.class or clojure/data/priority_map.clj on classpath
i don't think i did after my previous test, but i'm having a look
hm, i had a figwheel plugin in there. I don't think i meant to put it in there...
you could try moving profiles.clj
somewhere else and see if it's the cause of the issue
i commented the figwheel vector and it is fine now
thanks for the tip
Where can i place database connection config that specifies per env config and is git ignorable?
i like to use environ
though — and when you load environ, it looks for an EDN file at .lein-env
I’m not very familiar with the JVM. How do I refer to a jar that is a dependency of my project when specifying it as a -javaagent in the command line? is this related to the CLASSPATH?
You can access the foo-bar
field of a (deftype FooBar [foo-bar] ...)
using both (.foo-bar my-foo-bar)
and (.foo_bar my-foo-bar)
. The latter is proposed by CIDER's autocompletion (probably because that's the name of the corresponding field in the generated class). Is there any reason to prefer one over the other?
lein doc says that profiles.clj maps are recursively merged with those in project.clj but its actually overriding mine. https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md#merging
I have :profiles {:dev {:env {:y true}}} in project.clj and {:dev {:env {:x true}}} in profiles.clj, (env :x) is there but (env :y) returns nil in repl.
@afhammad yes, it will override it. See https://github.com/weavejester/environ/issues/15
It is explained in that leiningen doc as "Remember that if a profile with the same name is specified in multiple locations, only the profile with the highest "priority" is picked – no merging is done. The "priority" is – from highest to lowest –profiles.clj, project.clj, user-wide profiles, and finally system-wide profiles.". But that's missed many times, and the environ's readme doesn't help
According to https://github.com/technomancy/leiningen/blob/master/sample.project.clj, :bootclasspath true
will place the agent jar on the bootstrap classpath, but this doesn’t seem to be happening and I’m not sure how to debug it. Where should this jar be present?
@afhammad: I also stumbled upon this a while ago and documented what I ended up doing here: http://www.martinklepsch.org/posts/managing-local-and-project-wide-development-parameters-in-leiningen.html
@martinklepsch: thanks! I actually ended up doing something similar.
Is there a way to get a null transducer that’s pithier or more idiomatic than (map identity)
?
It only takes one argument and simply returns that argument. A transducer works on a collection.
No. A transducer is a function on reducing functions. It takes a reducer and returns a new reducer
I can see where you’re coming from but I think that’s a bit too liberal of an interpretation.
Also, I don’t think you can use identity
without an input whereas that’s part of what makes a transducer a transducer.
Actually, not presently. I’ve a Skype call in a couple of minutes. I’ll return after though.
if you’re supposed to compose transducers with (comp)
then identity
really ought to be the, well, identity
Though actually looking into it, while I feel (map identity)
should be equivalent to identity
, there is something slightly funky going on inside map
Other than that, you can just plug identity
into the definition of map
and it obviously simplifies to identity
on rf
@cigitia: I think (map identity)
is perfectly idiomatic. Though you could use completing
or even identity
(just like by itself) if you want
But the name completing
could be slightly misleading. Though it is an identity transducer
the required shape of a transducer is described here: http://clojure.org/transducers
pkobrien: how is identity not of that shape given that xf
must be of the 0/1/2 arity shape itself?
Is this a valid transducer?
(fn
([] (rf))
([result] (rf result))
([result input] (rf result input)))
What's somewhat confusing is that there are transducers, and there are functions that return transducers
@tcsavage: Unless you care about specifially erroring on >2 arity, then this snippet is equal to (fn [rf] rf)
it isn't a transducer in some regards, yet works like one for all practical purposes, yes?
and quite frankly, if it weren't a transducer, both map
and comp
would be rather broken
I finally got my L-system code to be transducer friendly today - big conceptual breakthrough for me - been struggling with how to leverage transducers with the darn things for days now. Old dogs, new tricks, gotta lose my OO habits, etc.
@rauh: Thanks. Not much to demo at this point other than stuff like:
(comment
(take 5 (fibonacci-sequence-basic))
(take 5 (fibonacci-sequence-stochastic))
(take 5 (generational-stochastic-sequence))
)
But I'm going to be working on turtle graphics using canvas with react and generating music via overtone
Just a simple rewriting system, but you can do a lot with it and I haven't seen any implementations that really knocked me out so I wrote one.
Like all my Clojure projects, I'm still learning a lot. But I feel like my code is getting better and is starting to come together quicker.
I'm glad you like them. I like them too a lot. They're fun. And yes, I did notice your improvements. Your code looks a lot better
[Just a brief check-in] I wonder if we’re conflating a reducing function with a transducer. I think identity
would qualify as the former but not the latter.
A reducing function is the kind of function you'd pass to reduce…
and A transducer (sometimes referred to as xform or xf) is a transformation from one reducing function to another
. (http://clojure.org/transducers)