#clojure log - Aug 21 2012

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:03 saurik: jkkramer: yes, I know how to bypass the error for my specific case with this one specific version of clojure. what I am trying to find out is why clojure's defrecord has this behavior, as it means that new versions of clojure might cause scripts that use defrecord to break solely due to "a new function was added to clojure.core"

0:04 jkkramer: saurik: it's not specific to defrecord, it's just how vars work. you'd get the same effect use def or defn

0:05 saurik: no, you get a warning.

0:05 user=> (def test 4)

0:05 WARNING: test already refers to: #'clojure.core/test in namespace: user, being replaced by: #'user/test

0:05 #'user/test

0:05 user=> test

0:05 4

0:06 jkkramer: that looks like the same warning you pasted from defrecord

0:06 saurik: no, defrecord had an error

0:06 02:42:42 < saurik> (defrecord test []) -> "ClassCastException clojure.lang.Var cannot be cast to java.lang.Class clojure.lang.Namespace.referenceClass (Namespace.java:129)" ...

0:06 jkkramer: ah, missed that

0:06 saurik: it might be that there is a different way of using defrecord that avoids this problem, hence my comment in that same paragraph "am I doing something wrong?"

0:10 jkkramer: fwiw, the convention is to use capitalized names for records, which would help reduce the chances of conflict. but fundamentally, there's not much you can do except test your code against new versions

0:10 if you are keen on receiving a warning instead of an error, you could dig into defrecord's internals and see if a patch is feasible

0:10 seaword: Is it acceptable to forgo the hyphenated naming convention of clojure when working with hash maps submitted from a form in the browser? E.g., my html form fields have names like "first_name" and "last_name" so when I receive the hash map of form params I'll be accessing them like: (:first_name form).

0:11 As opposed to the convention of (:first-name form)

0:22 amalloy: seaword: yes, it's probably best to just use the conventions for whatever protocol you're using. two things, though: (1) you *will* forget and wonder why (:first-name x) is nil, and (2) i think HTML is ambivalent re: - vs _, and in fact favors -. i'd mostly suggest using _ for unenlightened things like ruby or js, which can't express names with hyphens

0:24 saurik: to expand on jkkramer's point: (defrecord blah) creates a java class named blah, so it's recommended to use java naming idioms for records. eg, Test instead of test for that reason

0:24 which, happily, avoids conflicting with anything in clojure.core

0:26 * jkkramer recently switched to using hyphens in html field names

0:26 * jkkramer also hates using the shift key

0:35 cemerick: anyone have advice for someone whose browser-repl is thoroughly unrepsonsive?

0:35 copy/pasting the code / interactions from https://github.com/clojure/clojurescript/wiki/The-REPL-and-Evaluation-Environments yields no joy, unfortunately.

0:47 amalloy: cemerick: solution: learn to derive joy from simply following instructions on the internet

0:48 cemerick: tl;dr: I wasn't able to get it working at all, but boy, it sure was fun to try!

0:51 wmealing_: heh

0:52 cemerick: I got it, thanks to xeqi. You can't load the HTML that opens the browser repl connection from disk.

0:52 xeqi: hurray!

0:52 tomoj: I ran into https://gist.github.com/3d6d4b1ca0a777dfa27b on calling cemerick.piggieback/cljs-repl

0:53 cemerick: I see that's discussed further on down the page, but…oh well.

0:53 tomoj: guessing that's cus I'm using edge clojure

0:53 er, clojurescript

0:53 cemerick: tomoj: you probably don't have piggieback set up at the right level in your nREPL stack. What does your project.clj look like?

0:55 tomoj: https://gist.github.com/913cfd6840a205b1acfd

0:56 cemerick: xeqi: thanks again. browser-repl instructions going into the piggieback readme now. :-D

0:56 xeqi: cemerick: bug report - :cljs/quit doesn't change the prompt back

0:56 cemerick: tomoj: hrm, that should work…

0:57 tomoj: do a `lein deps :tree`; what version of nREPL do you have?

0:58 muhoo: cemerick: i've had the same problem with browser repl in piggieback

0:58 cemerick: xeqi: Yeah, I had that working, and busted it again somehow. Could you file an issue?

0:58 muhoo: which one?

0:58 muhoo: totally unresponsive

0:58 cemerick: muhoo: are you loading the html page from disk or from localhost:9000?

0:59 muhoo: the html page was loaded through noir

0:59 the repl was connecting to localhost:9000

0:59 tomoj: cemerick: 0.2.0-beta8 https://gist.github.com/78ce693affc9cd330249

1:00 cemerick: tomoj: bump up to [org.clojure/tools.nrepl "0.2.0-SNAPSHOT"], and give that a roll (you may need to add the OSS snapshots repo to your project.clj)

1:01 muhoo: I'll bet the static resources the browser repl needs aren't getting served up properly. Check the :static-dir arg for cljs.repl.browser/repl-env

1:02 I had that issue too, as I'm currently still compiling dummy cljs files in my clone of the cljs project.

1:02 muhoo: good point, will check. thanks.

1:03 cemerick: so I needed :static-dir ["/Users/chas/dev/clojure/cljs/" "/Users/chas/dev/clojure/cljs/out/"], but you'll need to figure out what the right paths are for how things are set up in your noir app.

1:03 michaelr525: good morning

1:04 tomoj: cemerick: same error https://gist.github.com/64bb750b903629b210eb

1:04 michaelr525: anyone knows how to make pprint work when called from a program which is running from 'lein run'?'

1:04 tomoj: is it feasible that nrepl.el should be able to e.g. C-c C-k a cljs file and load up the dependencies?

1:05 I had ignored nrepl almost completely, not having noticed nrepl.el until just a while ago

1:06 cemerick: tomoj: how are you starting your REPL?

1:06 eduard: how to store byte array to file?

1:06 tomoj: cemerick: lein2 repl, then (cemerick.piggieback/cljs-repl)

1:07 cemerick: hrm

1:07 tomoj: which version of lein?

1:07 tomoj: 2.0.0-preview7

1:09 technomancy: michaelr525: we were just discussing allowing that earlier

1:09 michaelr525: your best bet for now is probably configleaf

1:09 xeqi: tomoj: the :nrepl-handler requires preview8 I think

1:10 michaelr525: technomancy: config leaf?!

1:10 cemerick: tomoj: ah-ha; you need lein master or -preview8; the piggieback middleware isn't being applied at all

1:10 technomancy: config leaf!

1:10 tomoj: thanks

1:10 michaelr525: technomancy: i thought of maybe doing (println (with-out-str (pprint)))

1:10 technomancy: because println does work

1:10 muhoo: config leaf?

1:10 tomoj: missed that in the readme..

1:11 would be surprised but delighted if nrepl.el+cljs with piggieback was already mostly functional

1:11 technomancy: michaelr525: oh, sorry; I thought you meant the leiningen pprint plugin

1:11 michaelr525: you want (:require [clojure.pprint :refer [pprint]]) in the ns macro

1:12 xeqi: cemerick: after your readme updates I'll check and file a bug on the prompt

1:13 cemerick: tomoj: Note that the nREPL config bits in lein are changing somewhat (much simpler/shorter) post-preview8. But, yes, it's all coming together I think. :-)

1:13 xeqi: They'll likely need to wait until late tomorrow; the piggieback stuff depends on getting all of the nREPL/reply/lein backlog pushed through, which isn't gonna happen tonight.

1:14 But yeah, thanks. :-D

1:14 michaelr525: technomancy: hmm.. i use (use [clojure.pprint] :only [pprint]) today and it doesn't print anything, maybe because of leiningen 1.7?

1:15 technomancy: michaelr525: no, the version of leiningen is irrelevant

1:15 tomoj: holy crap it works

1:15 had to switch into clojure-mode to get C-c C-k though, hmm

1:15 technomancy: michaelr525: (:use [clojure.pprint :only [pprint]]) would be better

1:15 tomoj: nrepl.el master has a number of important fixes

1:15 supposedly a release is coming soon?

1:16 tomoj: when I installed from elpa I was thinking it the back of my head "I'm going to go get master anyway.."

1:16 technomancy: haha

1:16 welcome to the bleeding edge

1:16 michaelr525: technomancy: yeah, that's what i'm doing here

1:17 tomoj: just amazing to type some clojure in emacs and see js source...

1:18 xeqi: tomoj: it is, though I mis M-.

1:19 tomoj: I saw it in the nrepl.el readme and hoped..

1:19 but yesterday I was using cljsbuild auto and google chrome's console..

1:20 xeqi: I think its a matter of implementing the right nrepl ops for the cljs repl

1:23 muhoo: cemerick: :static-dir didn't fix it. firebug shows it is in fact pulling up the static resources though

1:23 cemerick: muhoo: there should be a bunch…?

1:23 muhoo: https://www.refheap.com/paste/4519

1:24 cemerick: i.e. if there's just one, then something's borked

1:24 I can't say I know what that is. :-)

1:24 muhoo: http://bace.s3.amazonaws.com/replinteraction.jpg

1:25 i can try :-) it looks like nrepl is never sending anything to the browser

1:25 cemerick: I'm guessing that's not working? I have 71 requests upon opening the browser-repl connection.

1:25 xeqi: muhoo: sometimes it ignores the first input line for me after starting the browser repl

1:25 cemerick: But then, I'm a total noob here.

1:26 muhoo: yeah, this is all bleeding edge it seems

1:26 cemerick: quite

1:26 xeqi: what's M-.?

1:28 muhoo: i did some research tho. when working, the interation between cljsrepl and browser is this: https://www.refheap.com/paste/4013

1:28 xeqi: cemerick: nrepl.el's jump-to

1:28 looks like I was wrong on the nrepl op guess

1:29 https://github.com/kingtim/nrepl.el/blob/master/nrepl.el#L311

1:29 though I remember seeing something funny about them with one of the commands

1:29 cemerick: Some introspection middleware is definitely in demand.

1:30 technomancy: the server side impl of jump-to is trivial

1:30 muhoo: cemerick: did you make any progress on the problem of how to insert something into the middle of a middleware chain?

1:30 cemerick: Dabbing together sexps everywhere is no way to live.

1:30 muhoo: it seems like a hard problem, maybe even an achilles heel of the composable function handler approach to middlewares in general

1:30 cemerick: muhoo: Yup, done and implemented on nREPL master. Will be landing in lein master tomorrow-ish.

1:30 technomancy: the most annoying stuff to piece together server-side in nrepl.el is reload

1:31 cemerick: muhoo: it is, by no means, a bulletproof impl. But, it works well enough, and properly shifts the configuration burden onto middleware authors instead of onto users.

1:32 muhoo: fantastic, thanks for that.

1:33 technomancy: s/server-side/clojure-side from the client/

1:33 cemerick: Can anyone replicate this? https://gist.github.com/3317393 Clean cljs clone, FWIW.

1:46 tomoj: cemerick: replicated

1:46 cemerick: oh, excellent

1:47 xeqi: cemerick: I also get it when running ./script/repl from cljs master

1:47 cemerick: I get it through piggieback too.

1:49 tomoj, xeqi: http://dev.clojure.org/jira/browse/CLJS-358

1:49 tomoj: working on trying browser repl now

1:50 xeqi: ah, I can replicate though piggieback

1:50 I must of misunderstood when you asked the other day

1:51 Bahman: Hi all!

1:52 cemerick: It's also curious that you can only be using either Rhino or browser-repl at the same time.

1:56 s/the same/one

1:59 thanks again xeqi; saved my sanity back there. :-)

2:01 xeqi: np, thanks for making the plumbing so the browser repl can work from nrepl.el

2:01 tomoj: hmm

2:01 xeqi: ah, he quit

2:01 tomoj: how?

2:01 clojurebot: with style and grace

2:02 tomoj: I start a browser repl env on 3000, get a repl prompt, and the browser is talking to localhost:3000, but when I type something in the repl there is always no output

2:02 and no response from the browser

2:04 xeqi: tomoj: oh, I thought you had it working earlier

2:04 tomoj: only with rhino

2:05 xeqi: ah

2:05 are you serving the html from a server, or trying to browse it from the filesystem?

2:05 tomoj: local apache

2:06 on localhost, repl env on localhost:3000

2:06 xeqi: k, try a second input line in the repl, it seems to ignore the first one for me

2:06 tomoj: no luck

2:06 I noticed I have :whitespace in the browser-side, default :simple for the repl env

2:07 xeqi: the cljs (repl/connect ..) has the right port in it?

2:08 tomoj: yeah

2:09 xeqi: oh,, looks like the readme was updated on a branch - https://github.com/cemerick/piggieback/tree/0.0.2#browser-repl

2:10 tomoj: what is this out/goog/base.js?

2:11 xeqi: thats an output from using the cljs compiler directly

2:11 lein-cljsbuild does it differently

2:11 tomoj: ah

2:12 xeqi: but the importatn part is the cljs-repl startup command

2:12 using that but with 3000 for the port?

2:13 tomoj: I'm using https://gist.github.com/3412542

2:14 xeqi: hmm.. thats basically what I was using

2:16 firebug will show me a connection waiting for a response when the browser is connected

2:16 tomoj: I see that too

2:18 hmm, it works with straight `lein2 repl`

2:18 just in emacs nothing gets sent to the browser

2:19 muhoo: heh, he just added the browser-env stuff now. nice.

2:20 xeqi: hmm, at least thats a good start

2:20 I'm using nrepl.el from elpa in case it makes a difference

2:20 tomoj: oh, me too, I forgot to go grab master

2:22 xeqi: are you sending a form to eval before or after connecting the browser?

2:22 tomoj: after

2:24 xeqi: `lein repl :headless` + M-x nrepl or M-x nrepl-jack-in ?

2:24 tomoj: no :headless, M-x nrepl

2:24 M-x nrepl-jack-in seemed to hang for me

2:27 xeqi: do you have a stacktrace from lein? sometimes I get one

2:27 when I don't have everything connected right

2:27 tomoj: nope

2:29 well, something made it work

2:29 xeqi: heh

2:29 tomoj: either :headless, upgrading piggieback to the latest on 0.0.2 branch

2:29 ..or master nrepl.el

2:29 thanks for the help

2:31 hmm, except now I get no output from println

2:32 xeqi: I think it was the :headless, I get a non-responsive repl without it

2:42 tomoj: I see it sending it to the browser, but not showing up in console.log :/

2:42 not sure what happens to printlns

2:42 tomoj: I think clojure.repl.browser tries to make it go to the repl (not console.log)

2:43 trying to figure out a *print-fn* for console.log now

2:43 since whatever clojure.repl.browser is trying doesn't work for me right now..

2:45 xeqi: I see a mailing list entry from a couple weeks ago mentioning nrepl.el just swallows stdout

2:48 you're right on the browser sending it back, I had my post params vs responses confused

2:48 which means I need to sleep, but glad its mostly working

3:29 tomoj: hmm, as soon as I (in-ns 'foo), nrepl.el stops working

4:43 kral: namaste

5:03 muhoo: heh, no the cljs repl has it backwards really. POST responses are NEW commands coming from the repl. POSTs are the browser responding back

5:04 the POST hangs, waiting for the repl to give a new command. when it does, the browser execs the js that was sent, and sends the reply as a new POST

5:04 and that one then hangs, waiting. it's goofy, and websockets would be a lot nicer

5:10 Raynes: muhoo: Stop writing clojurescript.

5:10 Write more Clojure.

5:23 muhoo: why?

5:23 clojurebot: why is Why

5:24 muhoo: ,logging

5:24 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: logging in this context, compiling:(NO_SOURCE_PATH:0)>

5:24 muhoo: logging?

5:24 fubar?

5:24 clgv: ~logging

5:24 clojurebot: Excuse me?

5:24 clgv: clojurebot: logging?

5:24 clojurebot: Cool story bro.

5:24 clgv: he has no clue ;)

5:25 muhoo: Raynes: the project i've got will likely not involve clojure, but *may* involve cljs, if i can get it working and sell the idea

5:47 nz-: so if I have understood correctly nrepl+nrepl.el is roughly equivalent to slime+clojure-swank (or slime+ritz)

5:50 talios: nz- - kiwi?

5:50 * talios deidles

5:50 nz-: talios: ?

5:50 talios: nz- - thats my understanding on nrepl yes. only better.

5:51 just wondering if the nick is also indicative of you living here in NZ :)

5:51 nz-: almost exactly opposite side of the globe ;)

5:52 talios: oh well - I won't try pimp you with a job then :)

5:52 nz-: ok

5:52 talios: man its hard to find good java people, even harder finding any with a functional bent

5:53 need to convince brehaut into moving up :)

5:54 nz-: a few years ago I might have moved ;)

5:54 talios: Right, now where did I put that time machine

5:56 magopian: talios: you live in NZ? and you have job openings? :D

5:57 talios: magopian - you make it sound strange. looking for OSGi/REST/Clojure(or functional) peoples

5:58 magopian: talios: i make it sound strange? in what way? sorry if that's the case, english is not my mother language ;)

5:58 (well, in fact, it's my mother's mother language, but not mine, does that make any sense? :)

5:59 talios: what company do you work for?

6:00 talios: magopian - http://smxemail.com - hosted email/anti-spam/cloud-pass

6:00 althou its more meta-paas

6:01 magopian: how nice is it to work there?

6:01 nz-: they published new nrepl-el just now, and M-x package-install nrepl doesn't work

6:02 magopian: and do you know if it's possible to work remotely?

6:02 talios: low key, mostly relaxed, fairly casual environment, small company (20ish employees )

6:02 magopian: low key? what does that mean?

6:02 talios: casual/relaxed

6:02 magopian: ok ;)

6:03 talios: I wish we were more open to remote working, management don't really seem keen on it tho

6:03 nz-: ah, i need to do M-x package-refresh-contents first

6:03 magopian: mmmm

6:04 talios: do you have job descriptions? or anything else that could help me see if my profile could fit?

6:05 i'm just a clojure noob, started playing with it (with 4clojure mostly) a few weeks ago, so if you're looking for experienced devs, i'll have to pass ;)

6:05 experienced _clojure_ devs (i'm experienced in other languages, mainly python)

6:05 talios: magopian - just found the job add - http://www.seek.co.nz/Job/java-developer-architect-global-audience/in/auckland-auckland-central/22929764

6:06 borkdude: goat moaning

6:07 the-kenny: I'm currently flashed by nrepl.el. It's so awesome.

6:07 talios: 'lo borkdude

6:07 magopian: talios: mmm i'm not the good profile :/

6:10 talios: thanks anyway for the links !

6:11 (i'd love to live in NZ one day... or at least visit it !)

6:18 nz-: nrepl looks good

6:18 and time to make it work has been a couple of magnitudes faster that with swank-clojure

6:23 the-kenny: nz-: Yeah, it's about time for a good alternative to Slime

6:31 nz-: now i just should learn to use repl when coding

6:40 how to jump from stack trace to code in nrepl?

6:40 in nrepl.el that is

6:52 the-kenny: I don't think you can (yet)

6:54 azkesz: ,'hi

6:54 clojurebot: hi

7:14 clj_newb_2384: is anyone here famiilar with lamina.core ?

7:14 I dont' have a particular question; but I'm curious about the ideas behind it

7:18 llasram: clj_newb_2384: ztellman has given a presentation on lamina: http://www.infoq.com/presentations/Event-Driven-Programming-in-Clojure

7:18 clj_newb_2384: llasram: ha!, I'm actually watching that right now

7:19 llasram: Well, that's what I've got :-)

7:19 clj_newb_2384: the deadlock example is pretty cute

7:19 (that a finite thread pool + data dependency + alignment of the stars = deadlock)

7:19 are you familiar with lamina.core?

7:19 i've come across it while studying aleph (the websocket server)

7:20 llasram: Not much. I saw the version of this talk he gave at Strange Loop, and dug into lamina a bit while using aleph for a toy async implementation of the 9P protocol

7:22 It does have a lot of cool idea in it though. Definitely expresses a lot of thought on how to do async

7:25 clj_newb_2384: 9P as in plan 9?

7:27 llasram: Yeah -- Plan 9's IPC protocol. I use wmii, which uses Plan 9 IPC to let arbitrary external programs control it

7:30 clj_newb_2384: wtf

7:30 lamina channels are _transactional_

7:30 that's amazing

7:30 tsdh: I have some defrecord or deftype Foo implementing some IFoo protocol. Now, I do (def x (->Foo)) at the REPL. When I recompile the namespace declaring the defrecord/deftype, I cannot call any protocol method on my x instance anymore. Is that a case of "don't do that"?

7:31 llasram: tsdh: It's less of a "don't do that" than "a known limitation." But yeah, the only real solution is "don't do that"

7:32 Whenever you re-compile a protocol definition, you re-bind the var to a new value defining the protocol, and everything gets sad

7:32 tsdh: llasram: I guessed that.

7:33 llasram: Ok, cool

7:33 tsdh: llasram: Well, no problem for normal runtime, but a pain in the ass for experimenting at the repl...

7:34 llasram: So probably it's a good habit to place protocols and records in their own namespaces.

7:35 llasram: That's one solution. I've found that it isn't too bad in practice, because I usually have one of two kinds of protocols: (a) ones in their own namespace, where I rarely need to revisit & recompile the file, or (b) ones where every reference to the protocol is in the same namespace, so all references get recompiled too whenever I re-define the protocol

7:38 tsdh: llasram: Well, (b) basically applies to the problematic protocol here, except that there's this one record instance at the REPL. ;-)

7:39 But no problem, I'll simply place the protocols and records into an own namespace.

7:39 clj_newb_2384: llasram: is it possible to get the slides of the talk?

7:40 (re lamina.core)

7:43 llasram: The StrangeLoop 2011 slides are all up in a github repo, yes! https://github.com/strangeloop/2011-slides/blob/0780f9c766832b8da682e226d04bb4649475e40a/Tellman-EventDrivenProgrammingInClojure.pdf?raw=true

8:05 Frozenlock: I have a weird need here.... is it possible to use a clojure repl from a machine you connect to using ssh? Swank maybe too much... but using the lein repl perhaps?

8:06 llasram: ssh to the box, then run lein repl... ? :-)

8:09 Frozenlock: llasram: that simple? I'm almost scared...

8:09 llasram: Well, that was kind of joke :-). I'm not 100% certain of your meaning

8:09 Frozenlock: No no, that makes sense...

8:10 llasram: You can obv just run `lein repl` in an SSH session, but you can also use SSH port-fowarding to forward connectinos to a swank server or headless nrepl session over SSH

8:10 Frozenlock: However lein will not be installed on the machine, can I use it to download a project dependencies without installing it?

8:11 Oh that would be marvelous! I need to read more about SSH and learn how to do that :)

8:11 Thanks for pointing this out!

8:11 llasram: Ah, so this is where it gets more interesting. So is the machine running a Clojure application, and you want to be able to get a REPL in the context of the deployed application?

8:12 ejackson: Frozenlock: I do this as llasram suggests, but I embed a swank server into my app

8:13 this works even if you deploy to tomcat or whatever

8:13 Frozenlock: Of course!

8:13 Then uberjar and send the jar to the remote machine to run it!

8:13 ejackson: or uberwar even

8:14 llasram: For web apps, you might also want to check out https://github.com/cemerick/drawbridge . I haven't used it myself yet, but looks quite interesting

8:14 ejackson: seriously cool

8:18 clj_newb_2384: I like the remote repl more than uberwar

8:18 since uberwar takes cime to ceate whereas repl is isntant

8:19 ejackson: clj_newb_2384: depends on process. I have CI that builds and deploys the uberwar backstage.

8:20 but yeah, for fiddling about, lein ring server-headless is fast

8:21 freiksenet: is there any reason why trees that form a base of clojure data structures branch at 32?

8:21 except for java int size

8:26 gfredericks: freiksenet: java int size is unrelated

8:26 32 is 5 bits wide, not 32 bits

8:27 assuming you agree it should be a power of 2, then presumably you'd want whatever width is optimal for performance. For some unimportant low-level reason, 32 must be.

8:27 freiksenet: gfredericks: sure, and 6 bits are 64 for example.

8:28 gfredericks: there was a talk at the last conj that I think mentioned cache lines

8:28 freiksenet: ok, I see

8:29 hugod: nz-: which version of ritz was giving you problems with load-file?

8:37 nz-: hugod: 0.3.2

8:37 hugod: error was MalformedURLException: no protocol

8:38 hugod: nz-: was the source file in a jar?

8:39 nz-: no, it was open in my emacs buffer

8:39 then again, it seemed to work sometimes

8:39 hugod: (files in a jar can be open in your emacs buffers)

8:40 nz-: i believe it was a normal file on the disk

8:40 magopian: finally found the time to watch http://www.infoq.com/presentations/Value-Values

8:40 awesome ;)

8:43 hugod: nz-: btw, if you're interested in helping with debugger support for nrepl, the 0.4.0-SNAPSHOT lein-ritz plugin gives you a `lein ritz-nrepl :headless` command to start an nrepl server with debugger support, though you'll need the nrepl-ritz emacs package from melpa

8:44 nz-: hugod: so i did following steps: goto some clojure file in emacs, lein ritz, M-x slime-connect, M-x inferior-list, in clojure buffer C-c C-l

8:45 no protocol: /home/jsyrjala/projects/ruuvitracker/ruuvitracker_server/src/ruuvi_server/parse.clj [Thrown java.net.MalformedURLException]

8:46 hugod: nz-: ok, thanks, I'll try and repro here - I've never used inferior-lisp

8:47 nz-: hugod: so how do you use slime then?

8:47 hugod: nz-: `M-x slime-connect` brings up a repl

8:47 Bronsa: is clojure.org down?

8:48 Fossi: not for me

8:49 nz-: hugod: slime-connect doesn't open anything for me

8:50 ejackson: hugod: I'm glad I'm not the only curmudgeon around :)

8:50 hugod: nz-: that's strange - do you have any emacs config for slime?

8:50 nz-: hugod: (require 'slime)

8:50 just that

8:50 in .emacs

8:51 hugod: ejackson: hey, emacs has so many configuration possibilities, it's easy to mess up

8:52 ejackson: hugod: i'm with you. I got it working now leave it the hell alone !

8:52 nz-: hugod: thing with debugger is that i am new to this repl thing, and besides i practically never use debugger even with java code

8:52 hugod: nz-: try adding something like (add-hook 'slime-load-hook 'my-slime-setup)(defun my-slime-setup () (slime-setup '(slime-repl)))

8:54 nz-: ritz' main purpose is to add the debugger

8:55 nz-: ok, there is a sprinner mouse cursor

8:55 hugod: ejackson: yeah, I periodically attack my .emacs files and it usually takes a while to straighten them out again

8:57 nz-: user=> clojure.lang.ArityException: Wrong number of args (1) passed to: ritz$breakpoint-kill

8:58 hugod: that is from lein ritz process

8:58 qerub: What to people use to conditionally apply functions to possibly-nil values? I often use (defn try [f x] (if (not (nil? x)) (f x) x)), but I guess that is not idiomatic.

8:59 ejackson: qerub: check out fnil

8:59 nz-: ,(doc fnil)

8:59 clojurebot: "([f x] [f x y] [f x y z]); Takes a function f, and returns a function that calls f, replacing a nil first argument to f with the supplied value x. Higher arity versions can replace arguments in the second and third positions (y, z). Note that the function f can take any number of arguments, not just the one(s) being nil-patched."

8:59 hugod: nz-> that was while trying to remove a breakpoint from the filters listed in M-x slime-selector f?

9:00 ejackson: qerub: the other thing I do is use -?> and -?>> from core.incubator. Different, but also nil handling

9:00 nz-: hugod: I just executed slime-connect, then was long pause (where I didn't do anything), then the exception

9:01 ,((fnil identity 42) nil)

9:01 clojurebot: 42

9:01 nz-: ,((fnil identity 42) 99)

9:01 clojurebot: 99

9:01 qerub: ejackson: fnil is a good replacement if there's a good default value one can substitute nil with, but there isn't always.

9:02 ejackson: Yeah, those are fine. Too bad they aren't in core…

9:02 nz-: ,((fnil identity 42) 99 "f2")

9:02 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core$identity>

9:02 gfredericks: qerub: yeah I don't think fnil is what you were asking about

9:03 ejackson: gfredericks: is there a direct translation ?

9:03 qerub: Say in Haskell, I'd use fmap.

9:03 gfredericks: there might be something in flatland/useful

9:03 and it's certainly easy enough to define your own, at least for the single arity case

9:04 hugod: nz-: there is no call to breakpoint-kill in ritz - the only way it can be invoked is in slime through the selector screen - so I am at a loss as to how you could have got that exception

9:07 nz-: maybe I have version mismatch or something

9:15 qerub: ejackson, gfredericks: Thanks for the pointers to core.incubator and flatland/useful.

9:16 gfredericks: flatland/useful is the usefullest thing I never use

9:16 beffbernard: Anyone know how to get the hostname from within noir/compojure? I'm trying to build a link that is in the contents of an email I'm sending

9:17 ejackson: i'd never come across it, thanks.

9:17 michaelr`: beffbernard: you can get it from the headers

9:18 beffbernard: (GET "/" {{host "host"} :headers})

9:18 beffbernard: michaelr: ok

9:18 michaelr`: ^^^ compojure syntax, i'm not sure about noir

9:22 _nmmn: http://agile.dzone.com/news/one-night-clojure-makes-scala ehehe

9:28 beffbernard: michaelr: ((:headers (req/ring-request)) "host") in noir

9:28 oops.. ((:headers (ring.requestring-request)) "host")

9:28 oops again.. ((:headers (ring.request/ring-request)) "host")

9:28 ozzloy: run it in a repl first

9:29 beffbernard: FFS.. ((:headers (noir.request/ring-request)) "host")

9:30 michaelr`: beffbernard: should be easier using some destructuring form in the route definition, no?

9:31 beffbernard: michaelr: It wasn't available

9:31 Unless I used middleware

9:32 (defpage "/someendpoint" {:as params} (println params)) didn't include any header info

9:32 michaelr`: hmm

9:34 duck11231: what if you try (defpage "/someendpoint" params ...) don't know if that changes anything, but that's how I get the full request with compojure

9:35 jsabeaudry: ,(Float. "0.2")

9:35 clojurebot: 0.2

9:35 duck11231: If it's just normal destructuring, it probably wouldn't change anything, though

9:35 jsabeaudry: ,(map Float. ["0.2" "0.4"])

9:35 clojurebot: #<CompilerException java.lang.RuntimeException: java.lang.ClassNotFoundException: Float., compiling:(NO_SOURCE_PATH:0)>

9:35 jsabeaudry: Why can't I do the second one?

9:37 pauls_: jsabeaudry: Isn't the first one a cast and the second an attempt at mapping a function?

9:37 joegallo: jsabeaudry: Float. is not a normal clojure function. You could (map #(Float. %) ...) though.

9:37 jsabeaudry: pauls_, I thought the first one is a call to the constructor

9:38 joegallo, Alright, I guess I'll do that, thanks for the pointer

9:39 pauls_: jsabeaudry: I would've thought so as well, but it's the only reason I can think of that it's not working, although joegallo has the best explanation so far

9:39 jsabeaudry: Probably there is some black magic involved regarding "functions" ending with "."

9:40 I'll blame the nasty java leaking through

9:41 duck11231: also that dot form is a macro of sorts, IIRC

9:42 bitwalker: Ah yeah that's it, the dot is a special form

9:45 joegallo: ,(macroexpand-1 '(.getLong (Float. 1)))

9:46 clojurebot: (. (Float. 1) getLong)

9:46 joegallo: ,(macroexpand '(Float. 1))

9:46 clojurebot: (new Float 1)

9:46 clgv: ,(macroexpand-1 '(Float. 1))

9:46 clojurebot: (new Float 1)

9:46 joegallo: yup

9:46 clgv: lol^^

9:46 jsabeaudry: ahhhh! the mystery is solved!

9:53 clgv: ,(read-string "(Float. 1)")

9:53 clojurebot: (Float. 1)

9:54 clgv: ok it's really a macro-like special form. could have been reader magic as well ;)

9:54 jsabeaudry: ,(let [Popo. (fn [] (println "a"))] (Popo.))

9:55 clojurebot: #<CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: Popo, compiling:(NO_SOURCE_PATH:0)>

9:55 hyPiRion: ,(macroexpand-1 '(new Float 1))

9:55 clojurebot: (new Float 1)

9:55 jsabeaudry: ,(let [Popo, (fn [] (println "a"))] (Popo,))

9:55 clojurebot: a

9:55 hyPiRion: ,((partial new Float) 1)

9:55 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: new in this context, compiling:(NO_SOURCE_PATH:0)>

9:55 hyPiRion: hurr.

9:55 clgv: new is a special form

9:56 ,(doc new)

9:56 clojurebot: I don't understand.

9:56 clgv: &(doc new)

9:56 lazybot: ⇒ "Special: new; The args, if any, are evaluated from left to right, and\n passed to the constructor of the class named by Classname. The\n constructed object is returned."

9:58 hyPiRion: ,(#(new Float %) 1)

9:58 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: No matching ctor found for class java.lang.Float>

9:58 hyPiRion: Certainly is restrictive.

9:59 gfredericks: ,(.floatValue 1)

9:59 clojurebot: 1.0

9:59 hyPiRion: ,(#(new Float %) 1.0)

9:59 clojurebot: 1.0

9:59 hyPiRion: Figures.

10:01 chouser: It is, but there the restriction isn't arbitrary. In order to generate efficient JVM bytecode, these things have to be known at the time the 'new' or '.' form is compiled

10:03 clgv: ,(#(new Float ^Integer %) 1)

10:03 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: No matching ctor found for class java.lang.Float>

10:04 clgv: ,(#(new Float ^String %) "1")

10:04 clojurebot: 1.0

10:04 hyPiRion: clgv: There's no constructor for integers.

10:04 clgv: just checked that ;)

10:14 robermann: Anyone here using CCW + Eclipse and doing "File->new->project-> Leiningen->Leiningen project" successfully?

10:14 (Eclipse "Juno")

10:22 mytrile: robermann: I don't use Eclipse, but I've just created a lein project without a probelm

10:24 robermann: mytrile: in my setup Eclipse creates an empty "project"/directory - that is, without any "src"-like subfolders

10:25 mytrile: robermann: I have Eclipse IDE for Java Developers and installed CCW through the market place

10:25 robermann: me too :) Are you using lein 2?

10:26 clgv: robermann: CCW only uses lein2

10:28 robermann: I have a "Leiningen 2.0.0-preview8 on Java 1.7.0 Java HotSpot(TM) 64-Bit Server VM" version

10:28 clgv: It worked some weeks ago with 0.9.0

10:30 robermann: Do you know if the CCW plugin calls the "lein" command in a subprocess? Because doing by command line "lein new myprj" works correctly.

10:30 clgv: robermann: I think it uses lein as library

10:34 robermann: though laurent mentioned something that it will look for the most recent installed leiningen. I dont know if it is already implemented like that

10:34 robermann: clgv: ok thanks

10:36 acheng: was Raynes kidding about LightTable failing to save files? or is this an issue that is hard-coded to affect only Raynes?

11:06 duck11231: Changelog: Detect when users is Raynes, disable saving. Raynes writes enough code as it is.

11:09 nz-: is there way to force fetching dependencies while lein repl? something like (fetch-deps [clojure/core.cache "0.0.2") (use 'clojure/core.cache') ... do stuff with core.cache

11:10 clgv: nz-: pomegranate can do something like that

11:11 nz-: clgv: thanks

11:20 acheng: well, i just tried LightTable. connected to an existing project that was managed with leiningen. was only able to see my project.clj file.

11:31 clj_newb_2389298: iis tehre somethign like "incanter in action" "the joy of incanter" or "programming incanter" ?

11:31 I so despearte need such a book I'd even be willing to pay for it rather than google for a pdf

11:32 clgv: clj_newb_2389298: nope. what do you struggle with?

11:32 clj_newb_2389298: clgv: nothing relaly, I just want a intense tutorial to pick up everything there is to know about incanter

11:32 rather than learn it bit by bit

11:33 clgv: there are some blog entries on http://data-sorcery.org/ and clojuredocs is pretty useful as well

11:34 clj_newb_2389298: http://data-sorcery.org/contents/

11:35 acheng: oh my LightTable issue might be a duplicate of #86 from solussd

11:35 solussd: acheng: yay! duplication!

11:35 clj_newb_2389298: http://incanter.org/docs/incanter-cheat-sheet.pdf

11:35 clgv: solussd: I thought thats called reproducable ;)

11:35 clj_newb_2389298: is this all there is to incanter?

11:36 solussd: clgv: yay! the duplicatable issue is reproducable!

11:36 clgv: clj_newb_2389298: unlikely since that cheatsheet is from 2009

11:36 solussd: it means I'm not [necessarily] crazy

11:36 acheng: you have a point. i should file a ticket and then we can call it a duplicate

11:36 clgv: solussd: where are those tickets listed?

11:37 solussd: lighttable github page

11:37 https://github.com/Kodowa/Light-Table-Playground/issues?state=open

11:40 acheng: s/reproducable/reproducible

11:41 i've added a comment to your ticket to say it's real

11:42 clgv: oh its on github now ^^

11:45 acheng: XSD XML validation... should i just use javax.xml.validation or is there a clojure way?

11:48 garjola: good morning

11:49 I am migrating a project from lein1 to lein2 and I don't know how to update the line containing ":hooks [leiningen.hooks.classpath]". Any idea?

11:49 duck11231: acheng: I doubt there is anything in clojure that's going to compete with the native java version

11:51 acheng: duck11231: makes sense. sheer number of iterations and usage

11:51 duck11231: OTOH there's plenty of clojure improvements in other domains

11:54 garjola: isn't there a tool that takes an old project.clj and produces a new one for lein2?

11:55 garjola: acheng: yes, lein precate. I have use that, but there is still one bit missing.

11:55 I used to use (robert.hooke/add-hook #'leiningen.classpath/get-classpath

11:55 (fn [get-classpath project]

11:55 (conj (get-classpath project)

11:55 my-class-path)))

11:56 to set the classpath with a hook in project.clj

11:56 acheng: garjola: i have :profiles {:dev {:dependencies [[robert/hooke "1.1.2"]]}}

11:56 garjola: is that related?

11:58 garjola: acheng: I have the same here, but I if I keep the line :hooks [leiningen.hooks.classpath] and run lein deps I get Error: cannot resolve leiningen.hooks.classpath hook

11:59 and that did work with lein1

11:59 acheng: garjola: is that line necessary? i remember dropping something when i migrated.

12:00 garjola: acheng: I need it since in leiningen/hooks/classpath.clj I have the definition of the classpath I need

12:01 I guess lein2 uses hooks differently, but I don't understand what happens

12:01 acheng: garjola: i have the same file so i can point to sqljdbc4.jar...

12:02 garjola: and i have no :hooks in my project.clj

12:02 garjola: acheng: and how is this file found by leiningen?

12:02 acheng: garjola: granted, i do have exceptions when i start connecting to my DBs but it still works. :-P

12:03 garjola: i wonder if it is even used. i have an entry in :dependencies for [com.microsoft.sqlserver/sqljdbc4 "4.0"] ...

12:04 garjola: acheng: I guess that it is not used, but in my case I need to add some local jars to the classpath

12:08 acheng: garjola: can you "deploy" them locally to your repository as a resource that can be named under :dependencies ?

12:08 garjola: I have just seen that there's a #leiningen channel. I am going to ask there. Thanks acheng!

12:35 gtrak: what the heck does this mean? Class clojure.core$bean$fn__5177$fn__5178 can not access a member of class org.apache.hadoop.fs.RawLocalFileSystem$RawLocalFileStatus with modifiers "public"

12:35 Bronsa: MMM

12:36 I can't get rid of a reflection warning even type-hinting

12:36 http://sprunge.us/QIFL what am I doing wrong?

12:36 nDuff: gtrak: ...so, I have a ticket and patch for that, if it is what I'm thinking...

12:37 gtrak: See http://dev.clojure.org/jira/browse/CLJ-978

12:37 gtrak: hmm, looks like it's an inner class that extends a public class

12:37 nDuff: *nod*.

12:38 See the patch; you can easily enough just make your own my-bean that has it applied.

12:39 (could you vote for it by the way? I'd _hope_, at least, that JIRA votes have some kind of effect in prioritizing fixes to actually be reviewed and merged)

12:39 gtrak: voted :-)

12:39 chouser: Bronsa: do you mean .poll ?

12:40 Bronsa: chouser: i just noticed

12:40 damn.

12:40 thanks :)

12:40 chouser: :-)

12:42 gtrak: nDuff: this is why I ask things

12:44 chouser: rawlocalfilestatus does not appear to be public

12:46 gtrak: its superclass is indeed public, FileStatus

12:47 chouser: ah, and the class it extends is public, so calling the parent class's method would work?

12:48 gtrak: yea

12:50 TimMc: I believe this is one of those things that Checkstyle yells about: Classes whose instances are available at a higher visibility level via an API.

12:54 gtrak: if only java had default copy constructors...

12:54 I could just slice it and bean that

12:55 * gtrak washes my tongue

12:56 nDuff: chouser: Exactly -- that's what the patch I have attached to the ticket _does_ in the case.

12:56 TimMc: ...and it's a very valid complaint (forces an unreasonably slow codepath), but at the same time, bean _is_ mostly intended to allow inspection of objects from 3rd-party code, and 3rd-party code not behaving well is something of a fact of life.

12:57 chouser: nDuff: and proxy depends on this to work correctly in some cases?

12:57 nDuff: chouser: ...well, proxy would need it to work correctly in those cases, yes; as gtrak discovered, it presently just fails.

12:57 chouser: ...notably, the same approach is taken by the introspection API in Apache Commons

12:57 gtrak: is there a simpler way to generate the getter calls from keywords?

12:58 I feel like I've seen such a macro somewhere

13:06 technomancy: yay, nrepl.el release

13:11 SegFaultAX|work2: Good morning.

13:20 gtrak: nDuff: that bean patch works for me

13:20 (inc nDuff)

13:20 lazybot: ⇒ 2

13:20 gtrak: (dec java)

13:20 lazybot: ⇒ -1

13:22 emezeske: Whoa, I can cast judgement on programming languages? Awesome.

13:22 (dec java)

13:22 lazybot: ⇒ -2

13:22 emezeske: (inc clojure)

13:22 lazybot: ⇒ 6

13:23 S11001001: (dec java)

13:23 lazybot: ⇒ -3

13:24 scriptor: (inc php)

13:24 lazybot: ⇒ 1

13:24 _nmmn: (dec java)

13:24 lazybot: ⇒ -4

13:24 SegFaultAX|work2: (inc python)

13:24 lazybot: ⇒ 1

13:25 _nmmn: (inc erlang)

13:25 lazybot: ⇒ 1

13:25 S11001001: (dec lazybot)

13:25 lazybot: ⇒ 5

13:25 SegFaultAX|work2: (inc haskell)

13:25 lazybot: ⇒ 1

13:25 mattmoss: (inc befunge)

13:25 lazybot: ⇒ 1

13:26 SegFaultAX|work2: (inc brainfuck)

13:26 lazybot: ⇒ 1

13:26 SegFaultAX|work2: Wait, huh? :)

13:26 mattmoss: lol

13:28 emezeske: (dec php)

13:28 lazybot: ⇒ 0

13:28 scriptor: heh

13:28 emezeske: scriptor: inc php? you madman!

13:28 SegFaultAX|work2: You monster.

13:29 mattmoss: Fiend!

13:29 _fogus_: php

13:30 ,php

13:30 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: php in this context, compiling:(NO_SOURCE_PATH:0)>

13:30 _fogus_: how do I see php's score?

13:30 hyPiRion: $karma php

13:30 lazybot: php has karma 0.

13:30 _fogus_: thanks

13:30 mattmoss: $karma clojure

13:30 lazybot: clojure has karma 6.

13:30 hyPiRion: (inc clojure)

13:30 lazybot: ⇒ 7

13:30 hyPiRion: ,'(inc clojure)

13:30 vpetro: $karma python

13:30 lazybot: python has karma 1.

13:30 mattmoss: Somehow, I expected it to be higher.

13:30 clojurebot: (inc clojure)

13:30 lazybot: ⇒ 8

13:31 _fogus_: $karma scala

13:31 lazybot: scala has karma 0.

13:31 vpetro: $karma haskell

13:31 lazybot: haskell has karma 1.

13:31 _fogus_: $karma _fogus_

13:31 lazybot: _fogus_ has karma 0.

13:31 mattmoss: Way to make bots have a conversation.

13:31 mk: you can also message the bots privately

13:32 hyPiRion: mattmoss: lazybot have the ⇒ symbol, killing trampolines ;(

13:32 mattmoss: Well, it's a one-way conversation. <insert sexist joke here>

13:32 robermann: clgv and others interested: FYI the issue with CCW and Eclipse Juno seems to be a bug. I followed up this: http://code.google.com/p/counterclockwise/issues/detail?id=396&sort=-id

13:41 muhoo: (inc nrepl.el)

13:41 lazybot: ⇒ 1

14:14 brad`: quit

14:22 chouser: technomancy: Having trouble using a dep via checkouts that has a data_readers.clj in it.

14:23 I think the .jar and the symlink are both on the classpath, so clojure sees the data_readers.clj twice, complains about a conflict, and refuses to start.

14:23 technomancy: chouser: yeah, that's a known bug in clojure

14:23 chouser: oh

14:23 technomancy: http://dev.clojure.org/jira/browse/CLJ-1034

14:23 chouser: sure 'nuf

14:23 technomancy: "conflict"

14:23 _fogus_: chouser: what dep is causing the issue?

14:24 chouser: _fogus_: internal

14:24 _fogus_: k

14:24 chouser: would it be silly for lein checkouts to remove the jar from the classpath?

14:25 oh, I bet it doesn't know which symlink goes with which jar

14:25 technomancy: yeah, it would be pretty complicated to work around from leiningen itself; would obviously rather see it fixed in Clojure =)

14:25 _fogus_: This must be what caused my experiments with core.contracts literals to explode Hudson

14:26 firesofmay: Hey Can anyone tell me how would I run my tests written in clj-webdriver run in parallel?

14:26 technomancy: given that the patch is already there

14:31 hcumberdale: Hi there ;)

14:33 naeg: hi

14:35 devinus: i'm getting this stacktrace with the latest lein-ring

14:41 gtrak: why does the repl sometimes say 'Evaluation Aborted' and hide the exception? I've managed to work around it with this: (defmacro unhide-exception [& body] `(try (do ~@body) (catch Exception e# e#))). If I rethrow it, it'll also hide the exception.

14:43 gfredericks: gtrak: you can at least access the hidden exception with *e

14:44 gtrak: ah, you're right

14:44 hard to remember

14:44 what's the difference though between things slime decides to show or not?

14:46 metajack: gtrak: i run into the same problem all the time. it seems that slime just gets into a wonky state. usually once it happens, it happens until i restart the repl

15:12 acheng: i have a sqlkorma question at refheap.com/paste/4528

15:19 ah nevermind

15:21 (specified foreign key with :fk in case anyone wonders what my mistake was)

15:21 Raynes: As a general rule, you don't figure it out yourself until you've asked a bunch of people and gotten no answer for 10 minutes.

15:21 acheng: (or rather what the fix was)

15:25 Raynes: so the best way to help someone become awesome at figuring stuff out is to totally ignore them

15:25 Raynes: In my experience. :P

15:25 That said, I don't follow my own rules. I would have answered you had I known anything about korma.

15:26 m0smith: or perhaps the effort of forming a problem into a question gets one thinking in the right direction

15:26 acheng: i have something new to figure out. i probably will fail until i make it public.

15:26 Raynes: Thus is life.

15:27 m0smith: any seesaw people about?

15:28 acheng: m0smith: seesaw user

15:28 m0smith: oh wait. i want you to be awesome too

15:28 m0smith: acheng: I am trying to understand the CSS-ish selectors

15:29 Question that leads to awesomeness: Can I use a vector as an :id and still be able to select it using 'select'

15:29 ?

15:30 jamesdoig: are zookeeper or avout considered good ways to coordinate configuration over multiple instances of applications ?

15:30 mattmoss: Comment on this, plz. https://gist.github.com/3418356

15:31 I may be doing stupid, non-functional things because I think in C++.

15:31 acheng: m0smith: dunno. you could try it

15:32 emezeske: jamesdoig: Small amounts of config data is definitely one of the normal use cases for zookeeper.

15:32 xeqi: does the new nrepl.el release tab complete namespaced functions?

15:33 m0smith: acheng: I will

15:33 acheng: m0smith: sorry. i shouldn't have assumed you were not already awesome. you very well could be.

15:33 m0smith: Awesome is as awesome does -- Forest Gump

15:35 nz-: xeqi: yes

15:36 xeqi: blah, I get an exception

15:37 well, let me check a different project to make sure its not an nrepl-middleware issue

15:37 nz-: din't notice the namespaced part

15:38 m0smith: mattmoss: what are you trying to do? looks like some sort of pooling

15:38 xeqi: hmm, works there.. must be a piggieback/nrepl-middleware issue

15:39 nz-: thanks for letting me know it was suppose to work :)

15:40 mattmoss: m0smith: it is (or should be) a simple integer generator... for unique ids... will return a number in [0, limit] that hasn't already been used

15:40 nz-: well at least this works (require '(foo [bar :as bar])); ba<tab-complete>/my<tab-complete>

15:40 emezeske: mattmoss: You seem to already know that that code is not in a functional style -- what are you looking for?

15:40 mattmoss: Suggestions on how to make it more functional?

15:41 mattmoss: emezeske: Yeah... I feel like I'm over-"engineering" the problem.

15:42 emezeske: mattmoss: My general suggestion would be to write a pure function that takes as an argument the current pool state, and returns a new pool state

15:42 mattmoss: Then to implement request-handle using that pure function.

15:42 nz-: xeqi: tab completing for example (java.util.ArrayList.) works, but you must each part of the name complete separately

15:43 xeqi: nz-: thanks

15:44 mattmoss: emezeske: I'll give that a shot... thanks for idea.

15:45 emezeske: mattmoss: Sure thing. That tends to be a common pattern for mutability in clojure -- pure functions for the logic, wrapped by functions that perform mutation.

15:48 carlosgaldino: can someone explain to me why on the function `brother` it needs to add `fresh` or `all` so the function will behave as expected doing a logical AND between `sibling` and `male`

15:48 here: https://gist.github.com/3219448

15:52 SegFaultAX|work2: carlosgaldino: More importantly, are you working with the lineage in Game of Thrones? :)

15:52 xeqi: carlosgaldino: defn returns the value of the last form. without fresh or all it would just be the last goal

15:52 muhoo: has anyone looked into replacing the janky xhr/xpc based cljs browser communication with websockets? it looks like google closure supports it

15:54 carlosgaldino: xeqi: that was something that I thought but I wanted to be sure that core.logic didn't add any magic. that's cool

15:54 SegFaultAX|work2: it was because of this: http://www.reddit.com/r/dailyprogrammer/comments/v3afh/6152012_challenge_65_intermediate/

15:54 clojurebot: http://clojure.org is timeless.

15:54 SegFaultAX|work2: carlosgaldino: Yea, I tracked that down. Awesome!

15:55 carlosgaldino: SegFaultAX|work2: but that's not my code. I'm trying to learn clojure and thought that would be good to start solving this problem of GoT

15:55 naeg: what is the right way to call a function e.g. 4 times?

15:55 dnolen: carlosgaldino: xeqi is correct. core.logic doesn't redefine defn. There are some good reasons for a defg tho and that might come sometime in the future.

15:55 xeqi: carlosgaldino: yeah, defn comes from clojure; but core.logic does define defne/defna and such that act diffently

15:57 (doc dotimes)

15:57 clojurebot: "([bindings & body]); bindings => name n Repeatedly executes body (presumably for side-effects) with name bound to integers from 0 through n-1."

15:57 carlosgaldino: dnolen: xeqi awesome! thanks

15:58 dnolen: although I'm just a beginner in the clojure world, I think the defg would be nice to have.

15:58 chouser: dnolen: resist the urge as long as possible.

15:58 ...is my opinion. :-)

15:59 dnolen: carlosgaldino: needs some thought, implicit defn + all is not a good enough reason.

15:59 chouser: definitely :)

15:59 carlosgaldino: being to able to properly visualize core.logic search trees is more compelling. When that gets sorted out we might see defg.

16:00 mattmoss: emezeske: Improved version, methinks. https://gist.github.com/3418356

16:00 chouser: functions are the interfaces between components, and as long as I see "(defn foo [a b c] ...)' I know a lot about that interface. If I see "(my/defn foo [a b c] ...)" that could be anything, and I have to go learn about how "my" is *implemented* before even understanding how to *call* the thing.

16:00 xeqi: oof, is there a flag to pass too `mvn install` so clojure will build with openjdk?

16:01 Bronsa_: is calling `hash` always the same as calling `.hashCode`?

16:02 carlosgaldino: dnolen: oh, ok. I get it. yeah, lots of implicit stuff going on is usually bad. I come from ruby/rails and lots of people have trouble with this kind of stuff

16:02 Raynes: $cd hash

16:02 lazybot: clojure.core/hash-set: http://clojuredocs.org/v/1538

16:02 clojure.core/hash: http://clojuredocs.org/v/1824

16:02 clojure.core/hash-combine: http://clojuredocs.org/v/1969

16:02 scriptor: Bronsa_: it calls this: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Util.java#L113

16:02 (hash) that is

16:02 Raynes: So yes.

16:02 Bronsa_: mmm

16:02 Raynes: It is the same as calling hashCode except that it handles nil.

16:03 scriptor: browsing the source is pretty easy for when you have implementation questions

16:03 Bronsa_: then why https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/ASeq.java#L63-83

16:03 dnolen: chouser: yep. it probably won't be defg - we already have defne, people are getting familiar with that.

16:03 zerokarmaleft: carlosgaldino: yea, i wrote that gist back when i had the only read the first couple chapters of TRS and Bratko's book

16:03 Bronsa_: what's the point of hasheq then?

16:05 carlosgaldino: zerokarmaleft: do you say this about both comments I left on it?

16:06 zerokarmaleft: but it's good. I never wrote anything on clojure and started with that problem because I saw your solution.

16:07 zerokarmaleft: carlosgaldino: that should work

16:07 emezeske: mattmoss: That's definitely cleaner!

16:08 mattmoss: A minor nit is that I would probably pass @pool to unique-handle instead of pool

16:09 mattmoss: emezeske: Ya, good call.

16:10 zerokarmaleft: carlosgaldino: heh, yea i see i created some logical variables for some of those relations for no reason

16:10 mattmoss: emezeske: Thanks for the comments!

16:14 zerokarmaleft: wow, github blew up

16:14 scriptor: it did?

16:15 Bronsa_: uea

16:15 emezeske: mattmoss: No prob.

16:15 Bronsa_: yeah*

16:15 scriptor: huh, loading fine for me...

16:15 but I saw the status blog

16:16 algernon: the header on the status blog is nicely blinking red and green.

16:18 scriptor: ah, it's back

16:19 acheng: flowers for algernon

16:21 Raynes: Your observational skills amaze me.

16:23 acheng: korma question: if i use "has-one", and then do a query using "with" any duplicate column names get suffixed with "_2" ... the docs say to use "has-many" insetad and the children will come along in a collection. except when i make that single change, my collection comes back empty. why?

16:26 Raynes: i'm getting ignored. but i don't think i'm getting any more awesome.

16:28 mmitchell: is there a clojure.core function for inverting a map?

16:28 Bronsa_: maps are not ordered

16:28 mmitchell: Bronsa_: I mean a transformation like: {:id 1} => {1 :id}

16:28 dnolen_: acheng: http://groups.google.com/group/sqlkorma

16:29 gfredericks: ,((fn invert-map [m] (zipmap (vals m) (keys m))) {:id 1 :foo 398})

16:29 clojurebot: {1 :id, 398 :foo}

16:29 trptcolin: ,(doc clojure.set/map-invert)

16:29 clojurebot: Titim gan ?ir? ort.

16:29 dnolen_: mmitchell: clojure.set/map-invert

16:29 acheng: dnolen_: thanks

16:29 mmitchell: there we go

16:29 thanks

16:30 gfredericks: why on earth is that in clojure.set?

16:33 dnolen_: gfredericks: because it's used by clojure.set/join?

16:34 technomancy: exposing something like that for general use strikes me as non-clojurey given how hard clojure tries to keep you from doing things that will cause you O(n) grief

16:35 trptcolin: even beyond algorithmic complexity, what are the guarantees when you invert something like {:a 1 :b 2 :c 1}

16:36 gfredericks: it'll be dependent on the map seq ordering

16:36 i.e. you don't want to depend on it

16:36 trptcolin: well yeah :)

16:36 gfredericks: I agree it's a bit weird that it exists

16:38 ozzloy: anyone in here going to this: http://www.meetup.com/ClojureDC/events/76541552/ ?

16:38 Cr8: I've on occasion actually wanted that, but more often than not I want to actually so something sane when I've got {:a 1 :b 2 :c 1}

16:38 *do

16:40 aperiodic: if you didn't want to depend on consistent ordering for the keys & vals fns, you could do (into {} (for [[k v] m] [v k]))

16:41 Cr8: that clobbers dupicate keys though

16:41 xeqi: I hate version ranges :/

16:42 aperiodic: oh, good call

16:44 Cr8: ,(apply (partial merge-with into) (map (fn [[k v]] {v #{k}}) {:a 1 :b 2 :c 1}))

16:44 clojurebot: {2 #{:b}, 1 #{:a :c}}

16:44 Cr8: probably a better way to do that.

16:45 but it is at least reversible

16:46 hiredman: ,(group-by val {:a 1 :b 2 :c 2})

16:46 clojurebot: {1 [[:a 1]], 2 [[:c 2] [:b 2]]}

16:47 Cr8: there we go

16:56 naeg: someone using IntelliJ IDEA with the clojure plugin?

16:57 zaargy: everyone uses emacs. hth.

16:57 naeg: I don't like emacs :S and I don't really like eclipse either

16:58 (even though I never tried it out with clojure)

16:58 scriptor: how long did you try emacs for?

16:59 naeg: couple of months, because I had to

16:59 (VIM guy)

16:59 djanatyn: Is penumbra the best library for making 2D games in clojure right now?

16:59 brainproxy: protip: never send enilve some html that has a <legend> tag nested inside a <form> tag, but not also inside a <fieldset> tag ... weird things happen

16:59 djanatyn: I've never used OpenGL before; I'm used to SDL and SDL wrappers like pygame.

16:59 scriptor: naeg: tried vimclojure?

17:00 djanatyn: Are there any libraries more like SDL?

17:00 dnolen_: djanatyn: could probably be useful for making games, but mostly focuses on wrapping LWJGL.

17:00 naeg: scriptor: not yet, still looking around. by now considering vimclojure, eclipse + ccw and intellij with clojure plugin

17:01 brainproxy: naeg: did you look into prelude for emacs? it helped make my experience and transition smoother

17:02 dnolen_: looking forward to the core.logic unsession

17:02 :)

17:02 naeg: to be honest, I don't even want to get used to using emacs :/

17:02 beat me to it, I'll consider emacs too

17:03 dnolen_: brainproxy: yeah! should be fun. hopefully will make core.logic seem considerably less "magical"

17:03 scriptor: naeg: I'm a vim guy too, but emacs hasn't been too hard to learn

17:04 naeg: scriptor: I'm not scared of learning it, I rather fear that I won't like it

17:04 * djanatyn uses emacs + clojure-mode with evil-mode

17:05 brainproxy: naeg: i'm another convert from vim/macvim to emacs

17:05 it wasn't easy at first, I wondered if I would end up hating it

17:05 * naeg is surrounded by traitors

17:05 scriptor: heh, I still use both

17:06 naeg: currently I'm trying out stuff with the new light table playground

17:06 that's OK for me while learning, ocassionally doing something "bigger" like conways

17:56 technomancy: protip: you want vary-meta, not with-meta.

17:58 dnolen_: technomancy: sounds like kibit rule worth adding

18:14 technomancy: I'm boycotting kibit until they fix the when bug =\

18:15 Raynes: I need to integrate kibit with the refheaps.

18:15 Killer feature, anybody?

18:15 emezeske: technomancy: Is the "when bug" the "use when instead of if for single clause" thing?

18:15 technomancy: emezeske: yeah: https://github.com/jonase/kibit/issues/2

18:16 emezeske: technomancy: :)

18:16 O_o rather

18:18 Raynes: technomancy: I don't think I understand your fascination with single branch ifs.

18:19 It's silly to associate ifs with return values when you can just as easily need to perform side effects in if branches as well.

18:19 technomancy: obviously if is the more general form

18:19 it can be used either functionally or side-effectily.

18:19 when, on the other hand, is more specific

18:20 casion: Raynes: isn't this about encouraging idiomatic code though?

18:20 using 'when' would be more explicit in some cases

18:20 Raynes: I don't think what he is against is unidiomatic.

18:21 technomancy: I'm not against using if for side-effects, I'm against using when for return values.

18:21 because when is a more specific construct than if

18:21 Raynes: I realize.

18:21 technomancy: I'm also against using and for side-effects

18:21 Raynes: But I don't think you have a good argument.

18:21 technomancy: the parallel isn't between when and if, it's between when and and

18:22 maybe people get confused because cond is a still more general form, and cond *is* about the number of branches

18:25 anyway, this isn't even specific to clojure; it's a lisp tradition that goes years back.

18:25 and having clojure code that's less concerned than CL about separating side-effects vs return values is just wrong.

18:37 SegFaultAX|work2: Is cond usually defined in terms of if or vice versa? Does it matter?

18:37 amalloy: i don't think it matters

18:37 technomancy: I think in the original lisp cond was the special form, but in Clojure it's if.

18:37 Bronsa: afaik cond is defined in terms of if

18:38 SegFaultAX|work2: It /seems/ like it'd be easier to implement if in terms of cond.

18:38 Since cond is much more general.

18:39 hyPiRion: Cond is like if, 

18:39 saurik: SegFaultAX|work2: its just nested ifs, so to the extent to which "easier" matters, it isn't that hard either way: (cond a b c d :else e) (if a b (if c d e))

18:40 SegFaultAX|work2: saurik: Right. I'm just wondering which is traditionally implemented as a special form. As technomancy said earlier, in Clojure it's `if`

18:40 hyPiRion: ^^ what I live by.

18:40 SegFaultAX|work2: saurik: But you're right (and that's my point): once you have one form the other is trivial.

18:40 saurik: sure, I was just responding to the "/seems/ like it'd be easier to implement" comment.

18:41 SegFaultAX|work2: saurik: Well, the if version requires nesting of forms. The cond form doesn't.

18:41 Which is why I said it seemed simpler.

18:41 In the end it doesn't matter. Just a general query. :)

18:42 hyPiRion: Well, really, they are both equivalent.

18:43 SegFaultAX|work2: In CL, cond is the special form, no?

18:44 hyPiRion: SegFaultAX|work2: True

18:44 SegFaultAX|work2: Does the Scheme standard dictate that detail?

18:44 jballanc: anyone available to help troubleshoot an issue with some reducers?

18:44 hyPiRion: But it doesn't really matter - you can create one given the other via macros.

18:44 amalloy: ~anyone

18:44 clojurebot: Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."

18:45 jballanc: :)

18:45 I just figured reducers were obscure enough at this point it might help to pre-ask

18:46 saurik: SegFaultAX|work2: in clisp if is a special form and cond is a macro

18:46 jballanc: so I have a simple scrabble solver that brute-forces its way through the dictionary

18:46 here's the core: https://github.com/jballanc/scrabbler/blob/master/src/scrabbler/bruteforce.clj

18:46 hyPiRion: jballanc: Just fire off the problem :)

18:46 saurik: [29]> (macroexpand '(cond (true 0)))

18:46 (IF TRUE 0 NIL) ;

18:47 hyPiRion: ,(macroexpand-1 '(cond (true 0)))

18:47 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: cond requires an even number of forms>

18:47 jballanc: but if I change line #23 to "fold" instead of "reduce", I keep getting a PersistentHashMap cannot be cast to IFn error

18:47 saurik: hyPiRion: clojure has different cond syntax

18:47 hyPiRion: ,(macroexpand-1 '(cond true 0))

18:47 clojurebot: (if true 0 (clojure.core/cond))

18:48 jballanc: the backtrace points to here: https://github.com/clojure/clojure/blob/master/src/clj/clojure/core/reducers.clj#L48

18:49 but I can't figure out how my map got inside the call to fjinvoke

18:50 the backtrace: https://gist.github.com/3420099

18:56 oh wait...is this a bug? https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/PersistentHashMap.java#L197

18:56 wait...nevermind...root is not a map

19:10 oh wait...ok, I think I see it

19:10 so, it seems you can't "fold" inside of a function that's going to be "folded"

19:10 this line: https://github.com/clojure/clojure/blob/master/src/clj/clojure/core/reducers.clj#L47

19:11 ^ that *should* evaluate to false when I do my initial fold...but since I'm folding inside of a fold, I'm inside of the outer fold's ForkJoinPool

19:11 and it evaluates to true instead

19:11 hmm...

19:22 arohner_: is there a built in fn that returns (defn ??? [f seq] [(filter f seq) (filter (not f) seq)])?

19:22 technomancy: arohner_: (juxt filter remove)

19:22 amalloy: (juxt filter remove)

19:22 arohner_: oh, very nice

19:22 technomancy: amalloy: too slow bro

19:23 emezeske: technomancy vs amalloy quick draw duel

19:23 technomancy: emezeske: it's the dvorak

19:23 amalloy: ,(println "(dec amalloy)")

19:23 clojurebot: (dec amalloy)

19:23 lazybot: ⇒ 26

19:23 emezeske: technomancy: hahaha

19:23 * technomancy blows a puff of smoke from the tip of his fingerguns

19:24 amalloy: technomancy: i was struggling with whether to mention contrib/separate, or the version in useful

19:24 emezeske: amalloy: seppuku, huh?

19:25 technomancy: indecision; it gets you every time

19:25 amalloy: clojurebot: separate is (juxt filter remove)

19:25 clojurebot: Ack. Ack.

19:25 amalloy: shortcut for next time this gets asked!

19:25 technomancy: amalloy: but as you know, juxt is supposedly a terrible thing for teaching OOP programmers

19:25 amalloy: is it?

19:25 * technomancy discovered this recently

19:26 technomancy: https://mobile.twitter.com/marick/status/234456740031254528

19:26 who knew, right?

19:26 amalloy: i stopped following marick a while ago: too much noise

19:29 * jballanc sighs

19:29 jballanc: looks like I need to find a printer...and international postage

19:29 emezeske: I've had people tell me I'm a jerk for suggesting juxt to newbs before

19:30 amalloy: ~juxt

19:30 clojurebot: juxt is a little hard to grok but it's the best thing ever

19:30 emezeske: Apparently everyone assumes newcomers are incapable of learning?

19:30 amalloy: obviously. otherwise they'd already know everything

19:30 emezeske: whoa

19:30 I just saw a tear in spacetime for a second

19:31 hyPiRion: ~separate

19:31 clojurebot: separate is in clojure.contrib.seq-utils, but just use (juxt filter remove) instead

19:31 technomancy: ~botsnack

19:31 clojurebot: Thanks! Can I have chocolate next time

19:31 hyPiRion: sweet.

19:31 ~chocolate

19:31 clojurebot: Cool story bro.

19:31 amalloy: oh haha, i think i taught him that one too. now i feel silly for teaching him the new one

19:32 clojurebot: forget separate |is| (juxt filter remove)

19:32 clojurebot: I forgot that separate is (juxt filter remove)

19:32 hyPiRion: hah

19:32 ~separate

19:32 clojurebot: separate is in clojure.contrib.seq-utils, but just use (juxt filter remove) instead

19:32 hyPiRion: well, clojurebot is an elephant apparently.

19:34 jballanc: anyone know if it's possible to join clojure-dev without signing a contributor agreement?

19:34 emezeske: jballanc: Don't think so.

19:34 SegFaultAX|work2: How can I write this better?

19:34 ,((fn [& rest] (->> rest (apply map vector) (apply concat) (apply hash-map))) [:a :b :c] [1 2 3])

19:35 clojurebot: {:a 1, :c 3, :b 2}

19:35 hyPiRion: jballanc: I think the CA is rather okay to write

19:35 jballanc: not worried about writing it

19:35 hyPiRion: ,(zipmap [:a :b :c] [1 2 3])

19:35 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ?? in this context, compiling:(NO_SOURCE_PATH:0)>

19:35 SegFaultAX|work2: hyPiRion: Can't use zipmap

19:35 hyPiRion: (4clojure)

19:36 jballanc: worried about the 2 weeks the post would take to get from me to NC

19:36 hyPiRion: Ah.

19:36 SegFaultAX|work2: Should have specified that in my initial problem statement.

19:36 muhoo: this is a subliminal message. cljs browser repl over websockets. this has been a subliminal message.

19:37 jballanc: no chance of an electronic CA submission?

19:37 hyPiRion: (->> (interleave [:a :b :c] [1 2 3])) (partition 2) (into {}))

19:37 ,(->> (interleave [:a :b :c] [1 2 3])) (partition 2) (into {}))

19:37 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: clojure.lang.ArityException: Wrong number of args (1) passed to: core$--GT>

19:37 technomancy: jballanc: it's been suggested before, but apparently to deaf ears

19:37 hyPiRion: h

19:37 jballanc: :(

19:37 technomancy: scala's CA is submitted via github oauth

19:38 hyPiRion: Oh.

19:38 Bronsa: My CA took 1 month to get to NC

19:38 emezeske: For my most recent job, ALL of my paperwork was electronic, NDA, employment agreement, everything

19:38 You'd think that the CA could be too :(

19:38 technomancy: muhoo: how about a cljs repl over regular sockets?

19:39 muhoo: trying to get a repl in gjs was a complete mess

19:39 jballanc: well, between finding a printer and time for the post, I think at this point I'd be better off hand delivering it at the Conj

19:39 technomancy: jballanc: clojure isn't exactly well-known for being welcoming to potential contributors, unfortunately

19:41 hyPiRion: technomancy: Is there anything else, apart from the CA, that hinders new people from contributing?

19:43 technomancy: hyPiRion: sure, the refusal to accept pull requests, the insistence that everything go through jira, and the fact that it takes ages for submitted patches to get attention.

19:44 even among regular contributors the workflows and policies around jira aren't understood.

19:44 hyPiRion: Hm.

19:45 saurik: ,(apply hash-map (interleave [:a :b :c] [1 2 3]))

19:45 clojurebot: {:a 1, :c 3, :b 2}

19:46 saurik: ,((comp (partial apply hash-map) interleave) [:a :b :c] [1 2 3])

19:46 clojurebot: {:a 1, :c 3, :b 2}

19:48 saurik: SegFaultAX|work2: ^ (in case you otherwise might miss it when you get back)

19:49 SegFaultAX|work2: saurik: Actually that's pretty close to what I came up with in the end.

19:49 saurik: I ended up replacing [& rest] with [keys vals], then interleave + apply hash-map.

19:49 saurik: I just didn't consider at first that it doesn't make sense to supply more than 2 seqs to this function.

19:55 amalloy: &(into {} (map vector [:a :b :c] [1 2 3])) ;; another option

19:55 lazybot: ⇒ {:a 1, :b 2, :c 3}

19:56 hyPiRion: ,(= (map vector [:a :b :c] [1 2 3]) (partition 2 (interleave [:a :b :c ] [1 2 3])))

19:56 clojurebot: true

19:56 hyPiRion: ,(into {} (partition 2 (interleave [:a :b :c ] [1 2 3])))

19:56 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.util.Map$Entry>

19:56 hyPiRion: hurr.

19:56 saurik: ,(= '(1) [1])

19:56 clojurebot: true

19:56 saurik: hyPiRion: into {} needs to take a vector, partition returns a list

19:56 hyPiRion: Do the entries have to be vectors?

19:57 SegFaultAX|work2: What about this group-by alternative? https://www.refheap.com/paste/4536

19:57 hyPiRion: so ##(into {} (list 1 2)) will fail.

19:57 lazybot: java.lang.RuntimeException: Unable to resolve symbol:   in this context

19:57 amalloy: hyPiRion: yes; you can conj a vector-pair onto a map, but not a list-pair

19:57 hyPiRion: so ##(into {} (list 1 2)) will fail.

19:57 lazybot: java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long

19:58 amalloy: saurik: into {} takes any kind of seq; the values *within* the seq need to be vectors

19:58 &(into {} (map vec (partition 2 (interleave [:a :b :c ] [1 2 3]))))

19:58 lazybot: ⇒ {:a 1, :b 2, :c 3}

19:58 muhoo: technomancy: i was thinking of the communication berween

19:58 Bronsa: why does it have to be a vector?

19:58 hyPiRion: ,(into {} (list (list 1 2)))

19:58 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.Map$Entry>

19:58 amalloy: this is because of some grossness in clojure's implementation of conj

19:58 muhoo: the compiler/repl and the browser

19:58 saurik: sorry, correct. I realized that after I said it, but didn't believe it would be important until I saw how hyPiRion interpreted it

19:59 kenneth: hey, can you make a macro that will expand `hello` to `(println "hello world")` for example?

19:59 muhoo: technomancy: websockets vs. xhr posts

19:59 technomancy: muhoo: yeah, I was just surprised how difficult it was to get a basic repl going even in an environment that wasn't subject to all the crazy sandboxing that a browser has to deal with

20:00 especially vs how easy a socket-repl is to implement in Clojure

20:00 all the existing tooling I could find assumes a browser

20:00 anyway, it looked hard, so I wandered off

20:01 muhoo: it's something i could do in a couple weeks or months work, buht probably you, cemerick, and emezeske could do in like a day

20:02 technomancy: nah; I'm in way over my head when it comes to JS runtimes

20:02 muhoo: the js isn't the hard part, just the messy part

20:02 technomancy: well, learning a new runtime is always hard

20:02 emezeske: muhoo: Haha, I can't speak for cemerick, but I think you are vastly overestimating my abilities :)

20:03 technomancy: much harder than learning a new language

20:03 saurik: kenneth: the closest you can get to a symbol macro is something like with-symbol-macros (which you then have to wrap around your code, as it relies on manually doing a code walk) https://github.com/clojure/tools.macro/

20:05 kenneth: saurik: hmm… i see, that won't do for my intended use case (adding tools to the repl that don't require parens)

20:06 saurik: btw, are you the same saurik that hacks iPhone?

20:06 saurik: yes

20:06 kenneth: cool stuff!

20:07 muhoo: i distinguish "hard" from "complicated". some things are not taxing of reasoning and thinking, only of memory and patience to understand the brokenness. other things are just cognitively hard to grasp.

20:11 kenneth: muhoo: doing twenty pull ups is not complicated, but pretty hard :)

20:17 xeqi: technomancy: have you seen piggieback? or are you meaning more like cli calling V8/node/whatever?

20:18 technomancy: xeqi: I was trying to embed it in gjs, the JS engine used by gnome3

20:18 piggieback is specific to the browser repl, right?

20:18 currently anyway?

20:18 xeqi: it had the rhino engine first

20:18 but the browser repl pretty much dropped in

20:18 technomancy: oh, huh

20:19 well I also lost interest due to realizing that I didn't really want much out of gnome3 that xmonad didn't already provide =)

20:19 xeqi: but I'm not sure how much it would help for ne wruntimes like that

20:19 haha

20:19 I've been interested in the lein-gnome thing, but have the same problem

20:20 technomancy: yeah, I want to run a dynamic clojurescript-powered desktop, it's just so much work compared to xmonad where everything is already perfect =)

20:20 xeqi: gnome2 + xmonad works well as a local maximum, and I don't feel like making a large jump

20:43 gfredericks: clojurescript isn't very dynamic

20:49 xeqi: gfredericks: ?

20:53 gfredericks: xeqi: I just thought technomancy's comment was interesting since cljs isn't dynamic

20:53 xeqi: what do you mean by "dynamic"?

20:54 gfredericks: well you should probably have eval for one

20:55 eggsby: guys how do I use clojurescript to build a decently simple web app without using noir and a boatload of js interop?

20:55 gfredericks: effort?

20:55 xeqi: ah, as in running without the jvm based compiler portion

20:56 gfredericks: xeqi: right

20:56 eggsby: gfredericks: I played with clojurescript this weekend, all the pinot stuff seemed to only work if you used it with noir, the only other option was to use the google closure calls via js interop, is there a way I'm missing?

20:56 xeqi: eggsby: have you seen jayq?

20:56 emezeske: eggsby: jayq

20:57 eggsby: But in general, even if you use something like jayq or domina or enfocus or something, expect to do some interop

20:58 eggsby: what is "(def $interface ($ :#interface))

20:58 doing

20:58 specifically the :#interface bit

20:59 gfredericks: I expect that's like $("#interface") in JS

20:59 :#interface is just a keyword

20:59 eggsby: aaaah got confused, thought it was some sort of type hint style thing... derp

20:59 :)

21:01 I'll try jayq, thanks xeqi gfredericks

21:02 aperiodic: eggsby: have you checked out C2? the todoMVC demo is pretty nice: https://github.com/lynaghk/c2-demos/tree/master/todoMVC

21:03 eggsby: I've read about c2 aperiodic but I haven't used it... the idea of just tying data structures to the dom is nice

21:03 aperiodic: eggsby: yeah, it's quite pleasant to not have to be mucking about with the DOM yourself

21:09 eggsby: dang I didn't even realize that cljs supported atoms... thanks for this demo aperiodic

21:34 Kowboy: clj-http or http.async.client?

21:43 frio: i haven't used http.async.client, but ive found clj-http unfailingly excellent

22:28 Raynes: http://langref.org/clojure/unsolved Is it just me, or this website completely blown to crap when you scroll down?

22:30 francis: its not just you

22:30 llasram: Looks like poor escaping practices + spam fun times to me

22:30 alpheus: I would like to use java.nio.file.Files, which I think only comes with Java SE 7u6. Should that work OK with Clojure 1.4?

22:31 francis: Has anyone gotten up and running with lein2 lately and run into an EOF error?

22:31 Raynes: IIRC, Clojure is tested against Java 7.

22:31 (along with several other java versions)

22:33 alpheus: My need for java.nio.file.Files is creating "hard" links on a Unix filesystem. Is there another way of doing this that I've missed?

22:34 francis: duh, nevermind - don't have java installed

22:36 samflores: Hi, folks. Noob question: is there a way to preload my project so clojure.test doesn't suffer the jvm start up time in every single run?

22:38 brehaut: lein interactive ?

22:38 int for short

22:38 well, lein int

22:39 samflores: is it a plugin?

22:39 brehaut: no

22:39 wait, you are using lein right?

22:40 samflores: yep :) I'm just stating to learn Clojure and I'm running tests with lein test

22:40 xeqi: lein interactive is lein1 only

22:40 brehaut: oh

22:40 my bad

22:40 samflores: oh, that's why I can't find it

22:41 xeqi: unfortunatly there isn't anything that will quicken `lein test`

22:41 samflores: that's sad

22:41 xeqi: there are some thoughts on having a background jvm, possibly with jark, but no action that way yet

22:41 I use a repl when wanting to run them quickly

22:43 wmealing_: samflores: check out midje lazytest for some awesome

22:45 xeqi: using preview8 and lein-cljsbuild together I'm getting https://www.refheap.com/paste/4540

22:46 samflores: wmealing_: I'll take a look. thanks

22:56 emezeske: xeqi: I think the latest Leiningen 2 preview changed something backwards-incompatibly

22:56 xeqi: yeah, I figured it was gonna require a cljsbuild update

22:56 emezeske: xeqi: There's already an issue open; I need to test it against the latest Leiningen 2 preview and bring it up to date

23:17 xeqi: is there a good app for clojurescript demos?

23:17 * to use for

23:29 dhm: xeqi: take a look at http://clojurescriptone.com/

23:33 xeqi: heh, I suppose I should have expected that

23:43 cjfrisz: Did the way records are imported change in the latest 1.5.0 alpha?

23:44 I suddenly had code break when I did it the old way

23:45 As in, I required the namespace and then imported the record types

23:45 Now I can't compile unless I take the require out and just do the import directly

23:57 * grizlo42 flips table

23:57 grizlo42: why can't i load the json api in my repl?

23:57 FileNotFoundException Could not locate clojure/data/json__init.class or clojure/data/json.clj on classpath: clojure.lang.RT.load (RT.java:432)

23:58 xeqi: how are you starting your repl?

23:59 grizlo42: java -cp ~/applications/clojure-1.4.0/clojure-1.4.0.jar clojure.main

23:59 * grizlo42 is not a java person

23:59 xeqi: clojure.data.json is a seperate jar

Logging service provided by n01se.net