This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-07-30
Channels
- # admin-announcements (24)
- # beginners (27)
- # boot (32)
- # cider (9)
- # cljs-dev (2)
- # clojure (96)
- # clojure-berlin (33)
- # clojure-dev (2)
- # clojure-gamedev (2)
- # clojure-germany (1)
- # clojure-italy (8)
- # clojure-japan (2)
- # clojure-russia (21)
- # clojurescript (178)
- # clojutre (3)
- # code-reviews (4)
- # core-async (58)
- # core-logic (22)
- # core-matrix (4)
- # cursive (10)
- # datomic (131)
- # events (9)
- # ldnclj (31)
- # off-topic (57)
- # onyx (9)
- # reagent (23)
Is anybody using any error reporting service, like bugsnag, airbrake, etc with Clojure?
is there a rationale behind contains? on transients not working with clojure but working with clojurescript ?
@hlship: Re: tuples, see: http://dev.clojure.org/jira/browse/CLJ-1517?focusedCommentId=40370&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-40370
@pupeno: @franziska shameless plug: Yeller's an error reporting service (that I built/run) written in (and for) Clojure: http://yellerapp.com
tcrayford: Iāll check it out.
let me know if you need anything - I'm the founder/CEO/only dev/ops person/marketing/sales/accounting, everything (the company is just me right now), always happy to help
@leonoel that's a bug - CLJ-700
@alexmiller ok, thanks
I worked up an example of a somewhat clever use of transducers. At least I thought it was clever. I'm trying to create a canonical example of the Sieve of Eratosthenes using channels. Check it out: https://github.com/clojure/core.async/wiki/Sieve-of-Eratosthenes
I start to get Stack Overflow Errors when I increase it to (time (consume 7000 (chan-of-primes)))
hello friends, do you remember that name that we give to that type of initialisation function that can be called safely multiple times, I remember is something around "indepodent", but I think I'm writing it wrong
@wilkerlucio: idempotent
yes, thanks @meow
Does anyone know how to specify your own private :repositories
profile, whilst also ensuring s3-wagon-private
is available as a plugin with leiningen?
I'm having real problems as it seems things like the lein install
and the lein deps
subtask; don't merge those keys of your profile in -- which means private dependencies I have deployed on S3 aren't being picked up
I need to comp
transducers in a recursive loop without blowing the stack. Any suggestions?
@meow: I'm not sure it's possible. Transducers use the stack. You can't compose them to arbitrary depth. It would be the same problem with any kind of function.
It's a fundamental limitation of code-generation via composition in a runtime without tail-call stack elimination.
@stuartsierra: thanks for the tips
then the xform isn't based on comp
, it just filters against the growing list of previous primes
Is there a clojure function that takes a function and something else as arguments, and calls the function on the something else?
@spinningarrow: you mean like apply? https://clojuredocs.org/clojure.core/apply
like apply, but instead of taking a list of args as the second argument, it takes in only one value
(fn [f x] (f x))
?
@stuartsierra: yes, exactly that! is there a builtin function that does that?
very definitive. thanks!
You're welcome
what Iām trying to figure out is, if there's a condp
that looks like this:
(condp #(%1 %2) x
zero? āitās a zero!ā
nil? āitās nil!ā)
is there something better than the #(%1 %2)
?I would probably just write normal cond
and call the functions.
@spinningarrow: There is a few people who wrote themselves a condp->
@stuartsierra: fair enough I suppose. Just trying to explore different ways of writing code and seeing what looks more expressive
@rauh: that sounds interesting - anywhere I can take a look?
^ cool, thanks!
How do I iterate through a range without creating a list? for example, say I just want to print out all the numbers from 1 to 10000000 but I donāt need that list for anything, and I donāt want it in memory.
@chris: range
is lazy. It doesnāt hold anything in memory unless you keep a reference to the head of the list.
Though thereās also dotimes
if you want to explicitly do something with a counter and thatās it.
@gtrak @stuartsierra @rauh - I think I have a decent implementation now without blowing the call stack: https://github.com/clojure/core.async/wiki/Sieve-of-Eratosthenes
@meow: I think you can replace the chan-of-ints with a prime wheel: https://wiki.haskell.org/Prime_numbers_miscellaneous#Prime_Wheels
@ordnungswidrig: I don't know haskell so I might be missing something, but it seems like this might fall into the category of "there are much better ways of calculating primes than using channels."
If not, you'll have to give me a more specific suggestion. The code I've written is intentionally contrived and is using channels just because it can, not because it's the best way to find primes.
But if you've got an improvement that still uses channels I'd love to hear it. @rauh has suggested using a more general stateful transducer that uses volatile! which is new to me so I need to take a break and then learn about that.
@meow: You could substitute the volatile with a simple atom
. It'd just be tiny bit slower.
@meow: oh, the idea is not to sieve every number (chan-of-ints) but only the odd numbers, or better, every number of the form 6k+1 and 6k-1
@meow: hereās an example of a wheel in clojure https://github.com/stuarthalloway/programming-clojure/blob/master/src/examples/primes.clj
Can anyone point me to how to run a repl using a standalone uberjar I've built from my app?
@voxdolo: There is an example: https://github.com/clojure/tools.nrepl#embedding-nrepl-starting-a-server
it can be done without nrepl too
java -cp your.uber.jar clojure.main
oh, interesting. I just ended up running java -jar your.uber.jar
and it seems to behave as I'd expect it to
I'm using :gen-class
in one of my namespaces, and I'm trying to use that class in other files
Why would lein with-profiles dev pprint
show dependencies that lein with-profiles dev deps :tree
doesnāt?
malarba: off chance, but did you require
and import
it? have to have the naked require
or the import
won't work.
lvh: I'd expect that to be the other way around, with deps :tree
showing more (since it includes surrogate dependencies)
that should clear it up⦠that's caused me some heartache working on java integrations before
malabarba: puredanger goes into it a bit here: http://tech.puredanger.com/2010/06/30/using-records-from-a-different-namespace-in-clojure/
and actually, this more closely resembles what you're seeing (for the same reasons): http://kotka.de/blog/2009/11/The_Missing_Class_Phenomenon.html
@ordnungswidrig: Thanks for the info on wheels. I'll keep it in mind.