Fork me on GitHub
#clojure
<
2016-12-14
>
Alex Miller (Clojure team)05:12:56

There are almost 7000 people signed up for this slack that haven’t yet filled out the State of Clojure survey. Takes about 5-10 minutes. https://www.surveymonkey.com/r/clojure2016

iku00088805:12:17

@alexmiller Just out of curiosity, how did you derive that number?

iku00088805:12:41

(Already answered the survey btw!)

seancorfield06:12:03

@iku000888 Slack shows you how many members are here (8,182 in total, 7,990 on this channel), and Survey Monkey shows Alex how many people have responded so a bit of subtraction... 🙂

seancorfield06:12:44

(mind you, about 1,000 people completing the survey already is pretty good -- keep spreading it far and wide folks!)

iku00088806:12:05

@seancorfield Oh, ok. I thought there was some linkage between survey monkey and slack 🙂

iku00088806:12:14

(Just imagined out of how many ppl who responded to the survey are actually subscribed to this chan...)

seancorfield06:12:10

(and there are bound to be some respondents to the survey who aren't on this Slack -- imagine that! heresy! 🙂 )

mpenet07:12:46

lots of people signin and never come back as well

agile_geek07:12:06

@seancorfield I know a few Clojure dev's who don't have an account here. 😄

lxsameer09:12:59

is there any good clojure code analyzer around ?

agile_geek09:12:50

@lxsameer to analyse for what? There are linters , for instance https://github.com/jonase/eastwood and squiggly clojure enables in editor linting for emacs https://github.com/clojure-emacs/squiggly-clojure

triss10:12:31

so if I have a list [:a :a :a :b :a :a :b] and I only want to remove one :b from it how would I go about that?

triss10:12:05

(remove #{:b} [:a :a :b :a :b]) removes all the :bs

triss10:12:34

I only want to remove one.

triss10:12:26

what’s the simplest/most efficient means?

yenda10:12:05

intresting the answer is almost what I had in my repl and was about to past 😄

yenda10:12:33

note that you get a list back and not a vector

triss10:12:25

thanks @yenda. That;s almost what I’ve got now.

triss10:12:37

a list is fine for what I’m up to. Cheers!

genec15:12:52

clojure newbie question - Would like to try out clojure by porting a simple simulation game with a desktop GUI from Python, any suggestions as to the GUI library to use? thanks.

mikepjb15:12:06

if you have lein setup it should be as easy as entering lein new quil simple-simulation-game-project into your terminal

tbaldridge15:12:45

@genec, JavaFX2 is actually pretty nice for a UI. It comes with all modern versions of Java, and it's rendered via OpenGL.

tbaldridge15:12:01

Depending on your needs, it may or may not be a good fit

genec15:12:45

@mikepjb thanks for the suggest, Quil does look like a great way to get started. The only thing that's missing for me is the ability to add controls to the UI. I see it can handle keyboard and mouse input, but I'll need to add some simple controls to the UI too. (textbox, sliders, buttons, etc.)

genec15:12:29

@tbaldridge thanks, I'm hoping to find something that makes the GUI easier to work with, ie. like ELM's update msg->model-> model'

tbaldridge15:12:00

Gives you a React like API around the OOP gook of JavaFX2

genec16:12:57

@tbaldridge thank you for the link to fn-fx, will take a look at it

genec16:12:32

@tbaldridge that looks really nice. any chance you'll be at winter lambdaconf in crested butte?

gdeer8116:12:22

@tbaldridge that's cool. I got into Clojure by playing with seesaw (the Swing wrapper) so I have a soft spot for these kinds of libraries 🐼

genec16:12:04

here's a link to re-frame from the re-frame/reagent/react/Electron talk, which is pretty good. https://github.com/Day8/re-frame

tankthinks18:12:20

@genec re-frame is influenced by Elm … we’re using it to build a UI now … I like it a lot

tankthinks18:12:46

I have to run to a meeting but I’m happy to talk about my experience

jkrmr19:12:14

What’s up? So I know some emacs Lisp. I’d like to learn Clojure. First response to this gets to tell me what to build as a first project.

robert-stuttaford19:12:55

if you want to start really simple, to grapple with the immutable data structures, i’ve found modelling the game of poker to be fantastic

robert-stuttaford19:12:18

make a deck, shuffle it, and manage the state transition of a deck into a smaller deck and several hands

robert-stuttaford19:12:31

you cover a surprising amount of ground with this

robert-stuttaford19:12:10

then you can write a function that assesses if a hand has any wins in it

jrheard20:12:26

that’s a really good suggestion for a first project

jrheard20:12:08

once you’re done with it, you could consider looking up what clojure.spec is, and either annotating your poker project with it or using it on your next project

genec20:12:39

@tankthinks I'd really like to hear more about your use of re-frame. I'm just looking to build a simple front end as easily as possible for a simulation to handle the setup and running of the model.

lvh20:12:06

Any suggestions for efficiently finding the longest suffix (given a list of suffices) for a given string?

lvh20:12:23

I’m guessing it’s “build a regular expression object” but I have no idea if it’s smart enough to do that cleverly

lvh20:12:41

I think e.g. PyPy’s regex jit notices that you have a DFA regex and also that you’re only matching from the end

lvh20:12:16

I don’t think Java’s is that smart

lvh20:12:40

I guess I can flip it myself and use a radix tree

gfredericks20:12:30

@lvh I doubt the regex engine is smart enough

gfredericks20:12:09

I read through most of the regex code once and all I remember is dispair

lvh20:12:31

more so than the usual baseline level of existential anguish you mean

lvh20:12:41

well, I can always rub some ztellman on it

shaun-mahood21:12:12

@genec @tankthinks There's a #re-frame channel with quite a few active users if you want to discuss further

genec22:12:57

@shaun-mahood thanks, I'll check it out

lvh22:12:34

If I want to enforce that a particular kind of computation happens at compile time, do I have to shove it in a macro?

bfabry22:12:40

things other than macros are evaluated at compile time, top-level forms, the right-hand side of a def, etc

bfabry22:12:20

if you want it evaluated at compile time and inserted into the body of something that's not then that's where macros come in

tbaldridge23:12:07

@bfabry there's nothing special about the right hand side of a def, it's also runtime executed

tbaldridge23:12:41

@lvh what are you trying to accomplish? The lines between compiled and runtime are a bit vague in a lisp.

bfabry23:12:32

@tbaldridge I think the vagueness of compiled and runtime in a lisp is leading to confusion there, but I meant the form on the right hand side of a def is evaluated when the def is evaluated, unlike defn

bfabry23:12:36

ie

boot.user=> (def a (println "foo"))
foo
#'boot.user/a
boot.user=> (defn b [] (println "foo"))
#'boot.user/b

ccann23:12:34

just added core.async “0.2.395” to my project and was greeted with Exception in thread "main" java.lang.IllegalAccessError: resolve-sym does not exist, compiling:(clojure/tools/analyzer/jvm.clj:1:1) anyone seen this clash before?

tbaldridge23:12:02

what version of clojure are you using?

tbaldridge23:12:19

and what other libs are you using? core.match, etc.?

ccann23:12:42

happens with 1.8+ (that’s what I’m using, having checked the others)

ccann23:12:03

I’m using a bunch of other libs but lein deps :tree only shows core async using tools analyzer jvm

ccann23:12:42

:dependencies [[org.clojure/clojure "1.9.0-alpha14"]
                 [org.clojure/core.async "0.2.395"]
                 [org.clojure/data.json "0.2.6"]
                 [org.clojure/data.codec "0.1.0"]
                 [prismatic/schema "1.1.3"]
                 [ring "1.5.0"]
                 [metosin/compojure-api "1.1.9"]
                 [ring/ring-json "0.4.0"]
                 [org.apache.xmlgraphics/fop "2.1"]
                 [org.apache.xmlgraphics/batik-transcoder "1.8"]
                 [org.apache.xmlgraphics/batik-codec "1.8"]
                 [http-kit "2.2.0"]
                 [ring/ring-mock "0.3.0"]
                 [org.apache.pdfbox/pdfbox "2.0.3"]
                 [com.taoensso/timbre "4.7.4"]
                 [camel-snake-kebab “0.4.0”]]