Fork me on GitHub
#clojure
<
2016-05-26
>
wei02:05:27

would be convenient if there was an inclusive take-while, (take-while-inclusive (complement #{5}) (range)) => (0 1 2 3 4 5)

Alex Miller (Clojure team)03:05:46

There is a ticket for that as take-until if you want to vote for it

ghadi03:05:54

CLJ-1906 (productions/successions) IMHO is a better replacement for CLJ-1451

hiredman04:05:44

ghadi: doseq machines are great for nerd sniping

vikeri06:05:03

@bensu: True, I just bailed out with an Any for now.

mariogintili07:05:36

what's a good book on clojure?

mariogintili07:05:50

or where could I get a nice, long and detailed list of good cljure books?

jasonbell07:05:49

@mariogintili: This was very helpful (and still is) for me - http://www.braveclojure.com

slotkenov07:05:32

I was going to mention that as well 🙂 Haven’t read it myself, but would choose that book if I would start reading on Clojure now 🙂

mariogintili07:05:54

I'm looking for some book that walks through implementing a full project

mariogintili07:05:00

or something of the sort

mariogintili07:05:04

or maybe multiple small projects?

nilrecurring07:05:32

OMG we just hit 6000 people

slotkenov07:05:58

Another book that I am going to read now is: The Joy of Clojure

slotkenov07:05:04

But that’s not hands on I believe

jasonbell08:05:47

@mariogintili: I wouldn’t say a “full project” but it certainly gives you all the building blocks I can think of. If you want to learn from full projects then I would suggest looking at github repos. Mastodon C open source a lot of their projects, lots to learn from there - https://github.com/mastodonc - that’s where I learn 🙂

jasonbell08:05:17

The O’Reilly books Clojure Programming and the Clojure Cookbook http://shop.oreilly.com/product/0636920013754.do http://shop.oreilly.com/product/0636920029786.do and if you’re heading into data science then Clojure for Data Science is excellent https://www.packtpub.com/big-data-and-business-intelligence/clojure-data-science

mariogintili08:05:33

@jasonbell more like a one man startup 😂

mariogintili08:05:48

well I'm working as a senior full stack web developer

mariogintili08:05:52

I know ruby and javascript

mariogintili08:05:00

and I finished the clojure koans recently

mariogintili08:05:15

i'm doing a course on machine learning...but they use python because of the jupyter notebook...which I think its fair

mariogintili08:05:19

but ideally I'd use clojure for that

mariogintili08:05:26

and I like the language so far

jasonbell08:05:28

@mariogintili: <<more like a one man startup>> lol - if only you knew…. my boss will love that.

jasonbell08:05:54

@mariogintili: I prefer doing machine learning stuff on Clojure, using Java libraries. Python is certainly good for it too though.

jasonbell08:05:20

@mariogintili: it sounds like you’re going in the right direction, plus there’s plenty of great people here. good luck!

mariogintili08:05:36

is the java ecosystem and developed as python's?

jasonbell08:05:08

I’d says so, but I’ve been using java since 1995.

mariogintili08:05:20

in the scope of machine learning

mariogintili08:05:23

actually there is a kernel for clojure

mariogintili08:05:34

I'll start there

mariogintili08:05:32

in case you guys are curious, I'm doing Udacity's ML course. I'm recording my notes here: https://github.com/mariogintili/machine-learnist/blob/master/chapters/001.md#about-artificial-intelligence 😄

patrkris08:05:53

Hi Everyone. The announcement of clojure.spec made me wonder whether test.check is useful for functions with side-effects or is it mostly for testing pure functions?

tap08:05:02

Some side-effects don't cause any harm so I think it depends

acron09:05:18

Is there a way to create a output stream which writes to a string?

pesterhazy12:05:52

@acron, or just use StringerWriter directly (-> (java.io.StringWriter.) (.write "boom") str)

pesterhazy12:05:09

rather (-> (doto (java.io.StringWriter.) (.write "boom")) str)

donyorm13:05:15

so I'm working a web app with luminus, but my javascript (not using clojurescript right now) file seems to not update when I edit it. Any idea why that wouldn't work? Testing in Firefox and using Selmer for templates (that is what generates the javascript link)

blackxored15:05:04

Yo, had about enough of mutable class-based madness and I might be looking to try clojure, I'm curious on how long would it take to be proficient with it, and surpass the pet language and actually use it in a real job?

arkh15:05:12

the biggest leap for me was thinking functionally (clojure was my first lisp). After that, it was a shorter time to really understand the impact of immutable data (and when to introduce mutable construcst instead)

blackxored15:05:18

Would love to hear your experiences just saying

arkh15:05:23

I use it primarily for web-based things (via clojurescript) and web back-end things

arkh15:05:28

it took me some months to unlearn/relearn things in the beginning

arkh15:05:54

it's been my favorite language for 5+ years though

arkh15:05:09

I don't have a job where I can use it full-time nor do I live somewhere where that's a possibility so maybe someone in a larger city can speak to its professional opportunities

danboykis15:05:31

is anyone playing with clojure.spec to validate config files?

blackxored17:05:08

Anybody else wants to share an insight? 😄

chris-andrews17:05:01

Not exactly the same, but I jumped from javascript to clojurescript and felt like writing clojurescript was easier after about 1 month

tdaudelin17:05:47

There are many resources available to help you become proficient in clojure quickly, this blog provides a great list: https://notamonadtutorial.com/how-to-earn-your-clojure-white-belt-7e7db68a71e5

mvaline17:05:24

similar experience to @chris-andrews After trying to write more functional javascript for node/frontend, Making the leap to clojure(script) I became pretty productive within a few weeks. The syntax is so simple that all you have to focus on is the thinking in a more functional manner.

blackxored17:05:15

I've read good things about Om Next, which is basically the next step of what i'm doing with React/Redux/Immutable

blackxored17:05:33

One of the reasons I'm interested in Clojure, but I will mainly use it for backend dev though

mvaline17:05:17

yeah I came from using React/Redux/Immutable and if you enjoy that architecture using something similar in clojurescript I find to be much more enjoyable

tdaudelin17:05:04

The hardest part for me was learning/configuring emacs for clojure development. There are plenty of other editor / IDE options out there, but personally I really wanted to go with emacs

blackxored17:05:25

I'd go with IntelliJ if I decide to jump in

mvaline17:05:48

yeah I stuck with my current editor but learning to use the repl effectively for development was a hurdle for me

blackxored17:05:50

A couple of things do scare me though, community support in forms of libraries and stuff, and tooling

blackxored17:05:16

Not so much for the functional thinking because I kinda have a background

josh_tackett17:05:22

Here is a hard one for you guys. I am running a piece of code stored in redis. This piece of code is evaled and executed at run time, but I need to use an external library (specifically clj-time). How can I use this library with code that is stored in redis and evaled and ran at run time?

blackxored17:05:45

Oh and evals #justkidding 😄

blackxored17:05:51

I couldn't help myself

chris-andrews17:05:21

Yeah the tooling has a big impact on how you pick things up

josh_tackett17:05:53

still not sure how to make this work

chris-andrews17:05:03

The cursive editor is built on IntelliJ, so I would think that would be a good resource for you

blackxored17:05:21

Yeah I already have it installed

surreal.analysis17:05:08

@josh_tackett: try

(eval (str “(require '[clj-time.core :as t]) “ code-from-redis))

surreal.analysis18:05:14

@josh_tackett: Just checking - did that successfully fix your issue?

josh_tackett18:05:49

will tell you tonight!

lewix19:05:02

since it's a counseling session...

lewix19:05:20

@octo221: I'm a bit more than two weeks sober

lewix19:05:54

@mvaline: more enjoyable - really? I still prefer react/redux so far, I haven't been able to reproduce my level of productivity just yet. As far as Emacs goes, I just use Vim

lewix19:05:30

@octo221: I tried IntelliJ, It didn't sink well with me so I went back to mother theresa - vim

mvaline19:05:34

@lewix: I use vim as well, since it was my preferred editor before. I definitely enjoy react/redux, but I enjoy reagent/re-frame more simply because its clojure and not JS. I wouldnt say I'm more productive (pretty close though), but definitely more enjoyable developer experience so far just because I find clojure easier to reason about the actual code.

lewix19:05:01

interesting

jswart20:05:28

spacemacs fills the vim niche in clojure land for me

josh_tackett20:05:22

"on-create": "(require '[clj-time.core :as t]) (fn [existing-data parsed-fields] (let [month (second (clojure.string/split (str (t/today) ) #\"-\")) day (last (clojure.string/split (str (t/today) ) #\"-\"))] (str month\"/\"day\"- \"(get parsed-fields \"Description\"))))",

surreal.analysis20:05:59

What error messages are you getting? Any?

josh_tackett20:05:22

none, just not running the code

surreal.analysis20:05:28

What are you expecting it to do? It’s just defining a function as far as I can tell

josh_tackett20:05:43

then run that function with arguments

josh_tackett20:05:02

((eval (read-string dependency-macro)) existing-data parsed-fields)

josh_tackett20:05:13

the string function in redis is the dependency macro

roberto20:05:19

what should (read-string dependency-macro) return?

jswart20:05:12

@josh_tackett: why do you need the actual code in redis, rather than something to tell you what code to run?

josh_tackett20:05:13

because if you store in redis then you can change redis on the fly without recompiling, and redeploying the code on the server

jswart20:05:08

What is the code that you have to change this often?

tdaudelin20:05:42

In general, I've found execing code that comes from an external source to be a terrible design choice, especially if that code is not under version control or if it is supplied by users

surreal.analysis21:05:51

@josh_tackett: I agree that in general, you should probably not be running the code from an external source. But if you still wanted to do that, you want to use the function load-string instead of read-string

surreal.analysis21:05:19

And then there’s no need to eval

surreal.analysis21:05:10

user> ((load-string (str "(require '[clj-time.core :as time]) (fn [existing-data parsed-fields] (prn (time/now)) (prn existing-data))")) "any" "data")
#object[org.joda.time.DateTime 0x708bd528 "2016-05-26T21:36:54.610Z"]
“any”