#clojure log - Feb 14 2014

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

13:50 sdegutis: Wow, #clojure-social is really growing quickly

13:50 Pretty happening place lately.

13:51 TimMc: It's like a rave in there.

13:51 bbloom: i'm not falling for it :-P

13:52 TimMc: mdeboard: I appreciate your "Chat" pun.

13:52 mdeboard: TimMc: Hey, thanks.

13:52 It was like I hadn't said it at all until you observed it

13:53 ddima: lastlog mdeboard 5

13:53 argh, haven't seen it either

13:53 Raynes: sdegutis: I started a very unpopular clojure-offtopic channel once.

13:53 Nice to see someone else might be succeeding.

13:54 TimMc: (inc mdeboard)

13:54 lazybot: ⇒ 4

13:54 mdeboard: I have points? deary me

13:55 Raynes: $join #clojure-social

13:55 lazybot: Raynes: It is not the case that you don't not unhave insufficient privileges to do this.

13:55 sdegutis: Raynes: it's really you succeeding, you had the idea and the guts to push it forward, all i had was timing

13:55 Raynes: $login

13:55 sdegutis: (inc Raynes)

13:55 lazybot: You've been logged in.

13:55 ⇒ 42

13:55 Raynes: $join #clojure-social

13:55 $botsnack

13:55 lazybot: Raynes: Thanks! Om nom nom!!

13:56 amalloy: Raynes: i mentioned #clojure-casual. that was yours, right?

13:56 sdegutis: thanks Raynes

13:56 Raynes: amalloy: Yes.

13:56 I mean

13:56 I think I made that channel.

13:56 I can't honestly remember.

13:58 ddima: suddenly, silence :)

14:00 sdegutis: Is there a good pretty-print library that prints things how they usually look in emacs? i.e. maps have each key-value pairs on their own lines, biggish lists/vectors are one line per element, etc

14:00 amalloy: sdegutis: how they look in emacs? like as source code, or as repl output?

14:01 sdegutis: As source code.

14:01 michaniskin: sdegutis: have you tried (clojure.pprint/write your-form :dispatch clojure.pprint/code-dispatch)

14:01 amalloy: there's basically just clojure.pprint, and i think bbloom's...what is it, fipp?

14:01 sdegutis: clojure.pprint/pprint doesn't print maps this way, and FIPP doesn't print them as ideally either

14:01 michaniskin: hmmm

14:02 amalloy: in fairness, i don't write maps that way as source code *either*

14:02 sdegutis: I asked bbloom about fipp here: https://github.com/slagyr/speclj/issues/45

14:02 But I didn't get far with his last suggestion.

14:02 bbloom: sdegutis: you just want a naive indenter, right?

14:02 ie not a pretty printer

14:03 sdegutis: Actually yeah that's probably a better description.

14:03 bbloom: you can write one of those brain dead easily

14:04 sdegutis: Hmm maybe I will... maybe I will.

14:04 bbloom: you can also write an alternative backend for fipp's pretty "documents" that operates on the operation stream

14:04 not that that buys you much, since the code to produce and serialize the documents is like ~150 lines

14:05 sdegutis: Hmm

14:05 Thanks

14:12 simard: would ClojureScript + node.js make a proper, safe sandbox ?

14:13 Raynes: selinux makes a proper, safe sandboxz.

14:14 pbostrom: indentation question for the channel: https://gist.github.com/pbostrom/9006986 do you prefer baz1 or baz2?

14:14 I think I prefer baz1, but that's not the default for clojure-mode

14:15 sorry, I prefer baz2, but that's not the default

14:15 danneu: indent all the args the same

14:15 bbloom: pbostrom: both need a linebreak before arg3

14:15 gfredericks: I just saw #{some? if-some when-some} for the first time

14:16 justin_smith: baz1, because baz2 looks like (some-thing-arg2) is a body rather than a second argbument, which is misleading

14:16 danneu: baz2 is generally reserved for forms where the first few args are special. like (GET "/" []\n)

14:16 devn: gfredericks: wait what

14:16 gfredericks: they seem to go along with some-> in having to do with non-nilness

14:16 which is interesting because clojure.core/some seems to be about traditional truthiness instead

14:16 ,(some identity [nil false true])

14:16 clojurebot: true

14:17 gfredericks: devn: new in 1.6

14:17 sdegutis: simard: probably, that's how Lighttable works

14:17 devn: gfredericks: interesting

14:17 gfredericks: ,(map some? [true false nil])

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

14:17 devn: ,*clojure-version*

14:17 clojurebot: {:interim true, :major 1, :minor 6, :incremental 0, :qualifier "master"}

14:17 gfredericks: I guess it's quite recent

14:17 I was just reading alex's email

14:17 devn: yeah i just pulled it up as well

14:17 cemerick: pbostrom: you can make clojure-mode indent like baz

14:18 Bronsa: gfredericks: landed today

14:18 https://github.com/clojure/clojure/commit/762db740f12690e668dbfb636ce5ef0a378190ee

14:19 gfredericks: it's like the word "namespace"

14:19 pbostrom: cemerick: I've seen that, just wondering why it's not the default, the reason I bring it up is I noticed that David Nolen's Om tutorials use baz2 indentation

14:19 Bronsa: I think that if-some and when-some are terrible names for how they actually behave

14:19 I'd think if-some would behave like if-not rather than like if-let

14:20 cemerick: pbostrom: formatting is a bikeshed almost like no other

14:21 gfredericks: Bronsa: oh that hadn't even occured to me; weird

14:21 cemerick: I personally think anything other than always-2-spaces isn't worth the PITA and inconsistencies across projects, but...

14:21 danneu: pbostrom: those dom forms are indented like baz2 because they have a "body"

14:21 Bronsa: gfredericks: if-some-let would have been a terrible name aswell, but at least not a wrong one :/

14:22 gfredericks: we need a highly-configurable auto-formatter, where the configurability is applied to each project

14:22 Bronsa: clojure is a fascinating mix of eyebrow raising and useful

14:22 cemerick: gfredericks: insanity

14:22 gfredericks: cemerick: for which sort of reason?

14:23 cemerick: gfredericks: it's just not important. Stuff like gofmt is exactly the right approach.

14:23 dnolen_: anything other than baz2 is an abomination

14:23 :)

14:24 cemerick: Consistency is really important to maximizing readability. If things shift around on a per-project basis, or formatting depends on stuff only known at runtime, it's a trail of tears.

14:24 danneu: too soon

14:24 cemerick: danneu: ?

14:25 aperiodic: does anyone know how to yank text that fireplace has echoed to the command line area below the status line?

14:25 cemerick: See, this entire conversation simply wouldn't exist if cljfmt existed. :-)

14:25 michaniskin: cemerick: why not just make it?

14:26 cemerick: michaniskin: Yeah, I just had that thought, and dismissed it 2s later. I burn enough time on shit like that already. ;-)

14:26 danneu: 'just', they said

14:26 pbostrom: I think I'm going to have to side with baz2 going forward, whitespace is our most valuable resource and must be conserved

14:26 michaniskin: yup, this is my point

14:27 hyPiRion: what is baz2, for the uninformed?

14:27 cemerick: *someone* will — maybe paired with one of the linters going around these days — and baz2 will be the way things get formatted, since it's the only option without a runtime around

14:27 danneu: pbostrom: i think it's misleading when a plain ol function call places unnecessary emphasis on its first argument. (+ 1 2 3)

14:28 Also, it's jarring when you only indent some of the args

14:28 cemerick: hyPiRion: an example out of a paste; always-2-spaces when indenting, nothing special for macros, etc

14:28 pbostrom: hyPiRion: always 2 space indent: https://gist.github.com/pbostrom/9006986

14:29 michaniskin: emacs already does the job for me

14:30 sdegutis: (inc emacs)

14:30 lazybot: ⇒ 2

14:31 hyPiRion: so like https://www.refheap.com/38782 ?

14:31 Or is it just for parens?

14:32 pbostrom: just for parens

14:32 cemerick: hyPiRion: https://github.com/clojure-emacs/clojure-mode/commit/38dded9c19e50769ad3070350257a6e501460ce8

14:32 michaniskin: also my bicycle is of a strange shape and size

14:32 so when we design this shed we need to take that into account

14:34 hyPiRion: and this is for consistency?

14:34 michaniskin: we may also want to store a bikeshed in our bikeshed someday, so we should make something sufficiently general to suppor that

14:34 simard: Raynes: what is the status of Clojail ?

14:34 devn: BikeshedCallbackUtilsBikeshed

14:35 sdegutis: What's the status on clojuredocs.org for 1.5.1?

14:35 Raynes: simard: It's still maintained.

14:35 devn: BikeshedCallbackUtilsBikeshedComparatorPool

14:35 TimMc: michaniskin: I think the trim should be painted a different color from the siding.

14:35 None of that foolish consistency for me, thank you.

14:35 devn: ConfigurationInvocationIdentifierBikeshedPoolComparator

14:36 cemerick: hyPiRion: yeah, my motivations are consistency, non-reliance on runtime info, and not taking a beating when using long fn-position symbols

14:36 esp. long hosty field/method names

14:39 pbostrom: anyway, sorry to start a bikeshedding discussion; I guess I've just had more experience with long names making the code look like crap than not being able to distinguish the sigificance of args

14:40 bbloom: pbostrom: so use more namespaces and shorter names in each namespace :-)

14:40 if you have a very long function name, that's a hint that you need to simplify your program

14:40 often (not always) anyway

14:41 s

14:41 dnolen_: pbostrom: most Clojure code that uses standard Emacs clojure-mode indentation is fugly. That's my problem with it :)

14:42 cemerick: I didn't know that indentation feature existed, thanks - I've been this manually for a while now

14:42 been doing

14:43 pbostrom: dnolen_: I tend to agree, I mostly just wanted some validation that I wasn't crazy :)

14:45 cemerick: dnolen_: yeah, it was one of the first things I did upon starting to use emacs. Shame it's not in the README anymore. :-|

14:45 dnolen_: *manually*? :-O

14:45 dnolen_: cemerick: yep, labor of love

14:49 sdegutis: Is there a better idiom for this? (if-let [x (get-x)] (if (:enabled x) x)))

14:49 hyPiRion: https://www.refheap.com/38831 <- and the OCD-programmers screamed out in pain.

14:49 dnolen_: sdegutis: is that the if-some that landed in 1.6?

14:50 isn't

14:50 sdegutis: Never heard of it.

14:50 Is 1.6 out now?

14:50 llasram: hyPiRion: AAAHHH FIX IT

14:50 sdegutis: re dnolen_

14:51 llasram: sdegutis: beta1 is out as of like an hour ago

14:51 sdegutis: nice

14:51 llasram: Keep with the times, man

14:51 sdegutis: lol, 43 mins late to the party

14:52 llasram: I'll already switched all my production code and redeployed

14:52 sdegutis: To /all/ the nodes!?

14:52 llasram: (kidding, if there was any doubt)

14:52 sdegutis: :P

14:52 abp: sdegutis: dnolen_: nope that would only do an explicit nil-check on x

14:52 sdegutis: Oops, sorry for the off-topic banter.

14:53 Will keep it in #clojure-social.

14:53 amalloy: (let [x (get-x)] (and x (:enabled x) x))? seems kinda silly though

14:53 bbloom: omg. unsigned-bit-shift-right finally made it!? w00t lol

14:53 TimMc: Haha, really?

14:54 sdegutis: amalloy: Agreed.

14:54 amalloy: bbloom: there's a lot of cool stuff going into 1.6

14:54 TimMc: lies, no way

14:54 sdegutis: Wait a minute.

14:54 coventry: If I :cljs/quit from an austin repl, should I expect it to start again with (cemerick.austin.repls/cljs-repl repl-env)?

14:54 sdegutis: (let [x (get-x)] (and (:enabled x) x))

14:54 cemerick: coventry: No.

14:54 bbloom: amalloy: i'm looking at the changelist. want to point out some of your favorites?

14:54 sdegutis: That should work fine.

14:54 amalloy: sdegutis: well, that might call (:enabled false), and i can't remember if that works or breaks

14:55 sdegutis: Hmm good point.

14:55 amalloy: &(:enabled false)

14:55 lazybot: ⇒ nil

14:55 sdegutis: ,(:enabled false)

14:55 clojurebot: nil

14:55 abp: hey cemerick, do you have any idea what needs to be done for austin to support :optimizations :none or should it already?

14:55 sdegutis: Finally clojurebot and lazybot agree on something!

14:56 cemerick: abp: There's a closed issue on that topic. It doesn't.

14:56 amalloy: bbloom: http://dev.clojure.org/jira/browse/CLJ-908 https://github.com/clojure/clojure/commit/0b73494c3c855e54b1da591eeb687f24f608f346 http://dev.clojure.org/jira/browse/CLJ-1200 http://dev.clojure.org/jira/browse/CLJ-1175 are my favorites

14:56 and http://dev.clojure.org/jira/browse/CLJ-1184 is a funny one

14:56 abp: cemerick: oh sorry to bother you

14:56 cemerick: abp: no worries :-)

14:57 TimMc: amalloy: Aw, that last one was fun.

14:57 I'll miss it

14:57 bbloom: cool

14:57 sdegutis: Wait, defrecord and deftype was marked as "alpha" in Clojure 1.5.x?

14:58 llasram: Were you using them in production code? Geez man

14:58 cemerick: abp: see https://github.com/cemerick/austin/pull/45 and https://github.com/cemerick/austin/issues/43

14:58 cark: that's living on the edge

14:58 cemerick: abp: and more discussion on :none here https://github.com/cemerick/clojurescript.test/issues/37

14:59 I don't really see much use in supporting :none

14:59 pjstadig: sdegutis: you're clojure card will be revoked momentarily

14:59 ahhhh

14:59 your

14:59 cemerick: at least in the tools I use / maintain

14:59 pjstadig: my grammar card has been revoked

14:59 llasram: heh

14:59 coventry: cemerick: I love austin, but to use it I need to restart my jvm repl a lot. If I leave an austin repl open for a while and come back to it, it's often the case that it hangs on my next entry. I can kill the thread with C-c C-b and :cljs/quit but restarting, even with a new repl-env, usually doesn't work: Further commands just hang. Is there any way I can figure out where it's hanging and why?

14:59 TimMc: ,*clojure-version*

14:59 clojurebot: {:interim true, :major 1, :minor 6, :incremental 0, :qualifier "master"}

14:59 TimMc: &*clojure-version*

15:00 lazybot: ⇒ {:major 1, :minor 4, :incremental 0, :qualifier nil}

15:00 cemerick: coventry: any chance you're using cider with ac-nrepl?

15:00 amalloy: TimMc: lazybot likes it in the past

15:00 Raynes: lazybot's owners are too lazy to upgrade.

15:00 * muhoo forks lazybot to productivebot

15:00 pjstadig: 1.4 is my favorite vintage

15:00 cark: does lazybot use records ?

15:00 Raynes: muhoo: eagerbot

15:01 muhoo: like a puppy

15:01 Raynes: cark: What would it use records for?

15:01 cark: i don't know

15:01 * ystael prefers strictbot

15:01 coventry: cemerick: Nope.

15:02 amalloy: Raynes: we could use records just to make technomancy mad

15:02 muhoo: ok, pet peeve time. i've long since gotten tired of unreadable spew in nrepl-emacs eval output, but my hack around that is miserablet

15:02 Raynes: muhoo: nrepl-emacs?

15:02 You mean cider?

15:02 dnolen_: cemerick: not supporting :none + :source-map seems like a bad idea to me, but I'm not maintaining clojurescript.test either

15:02 cemerick: coventry: ok, nm then. You're not the first to report hangs, but I don't really have a theory on what might cause it.

15:02 muhoo: i basically wrap (->> dostuff (urepl/massive-spew "/tmp/foo.edn")) and then auto-revert /tmp/foo.edn

15:02 Raynes: i refuse to accept its new name :-P

15:03 coventry: Is there any way to get a traceback when you kil a thread with C-c C-b?

15:03 muhoo: but there are many things that suck about that hack. has someone already come up with a better one?

15:03 cark: hum while talking about testing and clojurescript ...how does one go about testing async code in clojurescript ?

15:03 coventry: cemerick: OK, thanks.

15:04 muhoo: also, last i looked at the cider code, it seemed.... not as solid as nrepl, so i'm sticking with old nrepl for now

15:04 cemerick: dnolen_: the trouble is various tools need to be pointed at a file to evaluate; :none just sprays stuff into a folder.

15:05 dnolen_: cemerick: for some definition of "spray". Everything gets written out based on namespaces.

15:05 muhoo: where massive-spew is clojure prettyprint with depth and length bound to massive numbers

15:06 anwyay, i'll get out of the way and let the cljs guys get on with fixing austin for now instead :-)

15:06 amalloy: muhoo: slime/swank for life

15:06 muhoo: amalloy: i fear it.

15:07 cemerick: dnolen_: Right, but, e.g. cljs.test needs to feed paths to e.g. node, phantomjs, etc. I'd need to find all of the deps and linearize them; just running :whitespace or whatever is effectively that already.

15:07 amalloy: well, i wouldn't advise actually switching to slime/swank

15:08 dnolen_: cemerick: of course, I'm not saying it's not convenient, and certainly making :none work in CLJS was a pain in the butt - but it's provides the only truly accurate source mapping. Seems important when your tests go wrong is all.

15:09 cemerick: muhoo: I have a strict smokey-the-bear policy on 'fixing austin': "Only YOU can fix Austin!" :-P

15:09 dnolen_: can you expand on "truly accurate"?

15:09 s/expand/unpack

15:10 dnolen_: cemerick: :none doesn't require source map merging

15:10 abp: dnolen_: so performance wise it's not much of a difference?

15:10 cemerick: FWIW, the only times I've used source maps have been with :whitespace *shrug* Maybe I got lucky.

15:10 dnolen_: cemerick: anything required me to write some gymnastic code to take two source maps and produce one.

15:11 cemerick: dnolen_: OK, I'll keep that in mind.

15:12 If it bites me, I'll dig in more, but I'll be looking for a patch from an interested party until then.

15:13 abp: dnolen_: ok just read the ticket on clojurescipt.test nvm

15:16 lgs32a: what is your usual clojurescript/emacs setup. can I already eval things that they are reflected in the browser like lighttable offers?

15:16 abp: lgs32a: not as 'easy', but yes: https://github.com/cemerick/austin/tree/master/browser-connected-repl-sample

15:19 lgs32a: abp: great that seems to have improved a lot since the last time

15:20 bbloom: http://stackoverflow.com/questions/13065166/c11-tagged-tuple lol

15:20 craz.

15:22 stuartsierra: "Fairly easy to throw something together …" followed by 50 lines of template code.

15:22 abp: stuartsierra: about what i was to say :)

15:23 bbloom: stuartsierra: most entertaining, that code includes the implementation of a persistent array list!

15:24 gtrak: and people complain about parentheses

15:24 abp: gtrak: i think those aren't c++ programmers, at least they wouldn't admit it in the same sentence :)

15:24 bbloom: that answer is basically the definition of greenspun's tenth rule

15:25 gtrak: yea, C++ people would say lisp is slow, it'll never work.

15:25 sdegutis: I love how we're more on-topic here now that the noisy chatter is in #clojure-social

15:25 lgs32a: I just use paredit in emacs mostly.

15:25 abp: gtrak: lol, right

15:26 sdegutis: lgs32a: With nREPL to eval things in my buffers. That's basically all.

15:27 I know CIDER deprecates nREPL but I don't like upgrading my emacs setup, it works just fine the way it is, and I already know all the current bugs and how to work around them, I don't want to learn that for new ones.

15:27 I mean nrepl.el

15:28 lgs32a: sdegutils: I am heaviliy using emacs myself. which cljs setup are using, austin as well?

15:28 gtrak: sdegutis: I fixed the M-. on protocols bug, maybe that'll put you over the edge. :-)

15:28 abp: sdegutis: well, i upgraded by now and it works very well, but then i don't know what bugs you mean

15:28 sdegutis: I don't use goto-definition, I gave up on that long ago, I just use sd/git-grep

15:29 sd/git-grep = https://gist.github.com/sdegutis/9008529

15:29 gtrak: i don't know what that means, and I have projects that don't use git

15:29 sdegutis: I've never heard of that.

15:30 llasram: Projects that don't use git?

15:30 Is that legal?

15:30 ~guards

15:30 clojurebot: SEIZE HIM!

15:34 yazirian: Sheesh. Next it'll be projects written in not-emacs.

15:34 gtrak: yazirian: I wish :-)

15:35 pjstadig: yazirian: don't joke like that

15:35 lgs32a: abp: thank you again, I am now evaling cljs in the nRepl buffer :)

15:35 muhoo: *sigh* so nobody has come up with anything for pretty-printing [nrepl|cider] eval output?

15:36 gtrak: muhoo: sounds like a great middleware

15:36 muhoo: with syntax highlighting, etc? please, don't make me write elisp.

15:37 Raynes: I hate the "NEVER UPGRADE!" attitude :(

15:37 gtrak: hrm.. well, clojure-mode already has that, you could open up a buffer that contains the formatted code, and it would highlight for you.

15:37 cemerick: lgs, abp: If you just want to run CLJS in a browser, then you can use the `exec` REPL with :exec-cmds ["google-chrome"] (or whatever exec strings will launch a browser on your system)

15:37 muhoo: gtrak: that's what i do, and it's a pretty miserable hak

15:37 gtrak: that would be the elisp part.

15:37 the middleware would be to simply run 'pprint' on the backend.

15:37 so we don't have to reinvent it in elisp

15:38 I've heard talk of refactoring tools as middleware, too.

15:38 maybe they can all work together on code forms somehow

15:38 lgs32a: cemeric: thanks

15:39 abp: lgs32a: np, glad you can work

15:39 muhoo: gtrak: i guess i'll have to grok the inner plumbing of nrepl|cider and figure out how to call clojure code from inside elisp, on the results coming back from the clojure process, before displaying it in the buffer (i.e. to pretty-print it) then from there i can run clojure-mode on the buffer to highlight... feels like it'll be ugly.

15:40 gtrak: muhoo: I've been writing some minimal elisp along the way to cljs auto-completion, if it's something I can tackle myself, I'd do it.

15:40 TimMc: muhoo: Bug gfredericks about writing his data structure visualizer.

15:40 muhoo: gtrak: hmm, got anything up on github? maybe i can read it and get some clues

15:40 gtrak: first step would be a cider issue, I can show you what I got, yea.

15:41 muhoo: TimMc: thx, will do

15:41 gtrak: muhoo: check out https://github.com/clojure-emacs/cider/commit/56dc504a38333e4b7c8b9cf3ee639b3b800fcb5e and https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/info.clj

15:42 making it a real op would mean we can avoid building a string to eval in straight elisp, and it's portable.

15:42 to light-table, ccw or whatever

15:44 the more advanced elisp stuff is still over my head for now

15:44 but bbatsov's offered to help

15:46 muhoo: gtrak: wow, nice. i have to understand the nrepl protocol more.

15:47 also you're doing some advanced gymnastics on the ns meta AFAICT, have to think about that more too

15:48 gtrak: muhoo: ah, that's because the vars are what have file/line meta, not the ns itself, so I grab the first. I stole it from somewhere else.

15:55 dnolen_: abp: source maps + anything other than :none is going to be relatively slow.

16:16 effy: does the tutorial for pedestal still exist somewhere, i seem to have 404 on github for the provided link in the readme.md

16:26 ToBeReplaced: What is an example showing the difference between "when-some" and "when-let"?

16:26 amalloy: (when-some [x false] x)?

16:26 should return false, where a when-let would have returned nil

16:27 ToBeReplaced: amalloy: thanks, yeah, when-some/if-some are for nilness checks, if-some/if-let for truthiness checks

16:38 RMacy: man I hate emacs.

16:38 oops wrong chan

16:39 michaniskin: awkwarddd

16:39 hahaha

16:39 RMacy: ;-)

16:41 effy: /tcpnuke RMacy

16:41 arf :(

16:42 RMacy: jus trollin

16:43 effy: remember when "nuke" was actually a thing on irc ? :)

16:43 * effy feel old now

16:46 sdegutis: i do not.

16:59 i love how quite #clojure is right now

16:59 *quiet

17:00 <3

17:01 amalloy: huh, i'm surprised to see http://dev.clojure.org/jira/browse/CLJ-1179 was declined

17:01 makes distnict? a time bomb in like every use case that exists

17:01 Raynes: Yikes.

17:03 amalloy: quick, everyone open a new ticket for this issue. he's bound to not notice one of them

17:04 fowlslegs: Hey all! Would anyone care to look at my second Clojure program of any significant size? It deconstructs words in terms of morphemes. It is not yet complete, as the comment at the top of the file explains, but it has enough components to test. If anyone would care to provide feedback and suggestions on the parts that are done or could help me with the part that isn't I would very much appreciate that. Here it is: https://github.com/fowlsleg

17:04 bbloom: amalloy: hm, seems weird that he would decline it unless there was a reason... i wonder... does it not make sense as a monoid for some reason?

17:04 hyPiRion: amalloy: http://dev.clojure.org/jira/browse/JDBC-31 is one of the cases where it blew up

17:04 amalloy: bbloom: it's not a monoid at all

17:04 it's just a function for which zero args makes sense

17:05 ToBeReplaced: when is (apply distinct? coll) a good idea?

17:05 bbloom: amalloy: ah, right, it's not built from a binary operation at all

17:06 ToBeReplaced: i guess i'd rather see (distinct-elements? coll) and (distinct? x & more)

17:06 amalloy: ToBeReplaced: whenever you want to see if the elements of a collection are all distinct?

17:07 ToBeReplaced: amalloy: yeah i mean... feels like that's an input-sanitization problem usually, right?

17:07 michaniskin: fowlslegs: do you know that you can put docstrings into defn like this: https://github.com/tailrecursion/boot.core/blob/master/src/tailrecursion/boot/core.clj#L154

17:07 bbloom: maybe it's just undefined what it means for [] to be distinct? i mean, i guess it kinda makes sense to be true

17:07 ToBeReplaced: i guess i'm struggling to see how often "sequential and distinct" is a requirement

17:08 amalloy: bbloom: it's obviously true. a collection is distinct if no two elements are equal, and no disproof exists for an empty collection

17:08 just like ##(every? even? []) is true because there's no odd element in that list

17:08 lazybot: ⇒ true

17:09 bbloom: amalloy: ok, that makes sense to me. i'm just trying to think it through

17:09 michaniskin: avoiding spurious arity exceptions is always a good idea

17:09 bbloom: *shrug* would be interesting to see rich's comment

17:09 michaniskin: (+) for instance

17:09 amalloy: michaniskin: well, that one's even more correct, because of the monoids bbloom mentioned

17:10 bbloom: do those crazy category theorist folks have a word for non-monoidal variadic operations?

17:10 alandipert: unsound

17:10 amalloy: they probably call it a function

17:10 bbloom: surely they couldn't use such a simple word :-P

17:12 surely there must be some parallelization of distinct? that is interesting to math folks...

17:12 amalloy: i mean, from the theoretical-math standpoint, i think a function is just a relation between A and B, where A is a set of "input" lists. a variadic function is one where all elements of A aren't the same length

17:13 ToBeReplaced: bbloom: how could there be?

17:13 hyPiRion: A variadic function is just sugar for a function taking a list, at least as last parameter

17:13 bbloom: ToBeReplaced: dunno, but i'm interesting now :-P

17:14 michaniskin: distinct? is implemented as loop/recur

17:14 ToBeReplaced: i'm wondering if "distinct?" was/is a bad idea -- maybe we should be doing something like (every-pair not= coll)

17:15 hyPiRion: ToBeReplaced: Yeah, let's go from O(n log n) to O(n²)

17:15 bbloom: hyPiRion: i think he means successive pairs

17:15 ToBeReplaced: hyPiRion: yeah clearly not every-pair... idk what term to use

17:15 hyPiRion: bbloom: well, that's not going to work as expected tehn?

17:16 bbloom: hyPiRion: only works on sorted inputs

17:16 michaniskin: and it returns nil when coll is empty

17:16 hyPiRion: yeah, that could work, but only if they could be sorted in the first place

17:17 fowlslegs: michaniskin: yes, I have seen that. I used ^{:doc "documentation"} in case I wanted to add other var metadata.

17:17 bbloom: s/interesting/interested/ # heh, i must have sounded like an ego maniac

17:19 ToBeReplaced: bbloom: i can imagine things like (relatively-prime x & more) being implemented in terms of a (some-kind-of-pair-i-don't-know-the-name-of #(= (gcd %1 %2) 1) coll)

17:20 that would be inefficient for other reasons... maybe there's no other check that's worthwhile than equality

17:20 muhoo: am i missing something obvious on how to use instaparse for recursive parsing? i.e. a structure "AxyzBCCABCCCABfgCCABC" where the structure of the finished record is [:A :B :Cs] i want the C's concatenated into one record, and the xyz's and fg's are garbage i want filtered out first?

17:20 ToBeReplaced: so maybe distinct? does make a lot of sense having the comparison tied to the "pairing"

17:22 hyPiRion: So distinct? is essentially "there's no i, j, i != j such that x[i] = x[j]"?

17:22 Then it makes sense to add in the empty set again. *shrug*

17:25 bbloom: *shrug* no idea, i feel like at a community we should get a few "huh? can you explain it like i'm 5?" tokens for the BDFL.... sometimes we might learn something, other times he might go "oh, no, you're right"

17:26 then we can link to that whenever these questions come up

17:26 michaniskin: (:refer-clojure :exclude [distinct?]) works fine too

17:31 ToBeReplaced: is (apply distinct? coll) frequently faster than (= (count (into #{} coll)) (count coll))?

17:31 seems like checking count should be faster for true values, slower on some falses -- maybe that's better for sanitization uses (and are there other uses?)

17:33 hyPiRion: Well, I dunno

17:33 michaniskin: in cljs you might want to avoid creating sets like that unnecessarily because of GC issues

17:33 dnolen_: ToBeReplaced: you could of course look at the source of distinct, it's fail fast

17:34 er distinct?, and it uses a set

17:35 michaniskin: hm yeah it does

17:36 dnolen_: michaniskin: sets are just wrappers around array maps at small sizes, so I don't think they have GC issues significantly different from array maps.

17:37 at small sizes, and at large sizes they just wrap persistent hash maps

17:38 ToBeReplaced: dnolen_: yeah, so it's fail-fast, so if the duplicate is found early in the seq, it returns faster. if it's found later, you would have been better off just converting to a set first so you don't have to create the intermediate sets

17:42 hyPiRion: You could probably squeeze out a bit more perf. by making the set transient, but last time I tried that I got issues with the `contains?` function.

17:42 yeah, http://dev.clojure.org/jira/browse/CLJ-700 <-

17:43 ToBeReplaced: i guess the perf discussion doesn't belong in the discussion about the vararg distinct? anyway... if anyone had a performance need there they could deal with it themselves i'm sure

17:44 i'm just stepping back and wondering if it should have been (distinct? x y & more) or maybe (distinct? coll) or maybe even (distinct? coll :fail-fast true)

17:45 michaniskin: the contains? test is interesting, vs (let [xs* (conj xs x)] (if (= xs xs*) false (recur xs* etc)))

17:46 hyPiRion: ToBeReplaced: Why would you want fail-fast set to false to begin with?

17:46 ToBeReplaced: hyPiRion: wouldn't need it with contains? on transients, as you've indicated

17:53 amalloy: ToBeReplaced: that into #{}/count solution is a *lot* slower than (apply distinct? (repeat 1))

17:54 and i doubt that there's any input at all where it's faster

17:54 ToBeReplaced: amalloy: same speed as (apply distinct? (range)) ;)

17:54 amalloy: (range 10000) it should be much faster

17:55 amalloy: no way. both of them end up building a 10k-element set, of course. distinct? returns true immediately thereafter, whereas your count solution walks over the input seq again to count it

17:55 &(time (apply distinct? (range 100000)))

17:55 lazybot: ⇒ "Elapsed time: 212.566351 msecs" true

17:56 amalloy: &(time ((fn [xs] (= (count (set xs)) (count xs))) (range 100000)))

17:56 lazybot: ⇒ "Elapsed time: 265.760353 msecs" true

17:56 hyPiRion: amalloy: The difference is mainly in transient usage. Count is constant on sets.

17:56 amalloy: hyPiRion: but not on seqs

17:57 he's counting the input seq again after already walking it once

17:57 hyPiRion: oh, right.

17:58 ToBeReplaced: amalloy: on that exact test you just did i still see a diff after jvm warmup, i think the intermediate sets might dominate the extra walk, but it's a moot point

17:58 amalloy: and transients support .contains, so if using transients were really a substantial speedup, distinct? could use them

17:58 ToBeReplaced: amalloy: distinct? is better nearly always now (possibly always), and it would be even saucier with transients

17:59 hyPiRion: amalloy: http://dev.clojure.org/jira/browse/CLJ-700

17:59 amalloy: so then the count/count solution is never any better

17:59 ToBeReplaced: amalloy: agreed

18:00 amalloy: hyPiRion: contains? doesn't work, because it's for persistent collections. but .contains does

18:00 ITransientSet/contains

18:02 it used to be broken for empty transient collections, but that got fixed ni 1.5 iirc

18:07 ToBeReplaced: i show a 17% speedup using transients

18:07 (defn distinct2? [x y & more] (if (not= x y) (loop [s (transient #{x y}) [x & etc :as xs] more] (if xs (if (.contains ^clojure.lang.ITransientSet s x) false (recur (conj! s x) etc)) true)) false))

18:08 17% on (range 100000), at least

18:09 bbloom: ToBeReplaced: try it 10,000 times on a 10 item collection

18:09 hyPiRion: hehe

18:10 ToBeReplaced: (time (dotimes [_ 100000] (apply distinct2? (range 10)))) "Elapsed time: 914.680138 msecs"

18:10 (time (dotimes [_ 100000] (apply distinct? (range 10)))) "Elapsed time: 996.225312 msecs"

18:10 amalloy: sure, totally believable. improvements to distinct? would be lovely. and i like that version. just don't "improve" it by using count :)

18:11 xuser: the :gen-class that is added when doing 'lein new app proj' is not needed for lein run right?

18:12 amalloy: incidentally, i realized something interesting just now: ##(apply distinct? (list* 1 2 (lazy-seq (throw (Exception. "Why did you even evaluate this?")))))

18:12 technomancy: xuser: that's right

18:12 lazybot: java.lang.Exception: Why did you even evaluate this?

18:12 muhoo: lol lazybot

18:13 my guess is: repl eager evaluation?

18:13 amalloy: muhoo: nah

18:13 xuser: technomancy: is it there in case you want invoke the app with java instead of lein?

18:13 amalloy: it's because (let [[x & args] [1]] args) is guaranteed to return nil, rather than ()

18:14 technomancy: xuser: yeah, exactly. though it's really only strictly required for `java -jar ...`

18:14 ToBeReplaced: bbloom: slightly faster over (repeatedly 10 #(rand-int 10)) as well

18:14 technomancy: xuser: you can use `java -cp myjar.jar clojure.main -m my.ns` without any AOT

18:14 hyPiRion: amalloy: I thought it was because it had to, you know, go over the whole list to check for distinctness.

18:14 bbloom: ToBeReplaced: okiedokie, then submit a patch or something

18:14 amalloy: hyPiRion: of course not, we already had that discussion: ##(apply distinct? (repeat 1))

18:14 lazybot: ⇒ false

18:15 hyPiRion: amalloy: I mean, considering 1 != 2, it has to check later values.

18:15 amalloy: oh. haha, okay, i did get that part wrong

18:15 but if you switch to 1 and 1 it's still thrown

18:15 hyPiRion: right

18:15 xuser: technomancy: got it, thanks

18:15 muhoo: ,(doc distinct?)

18:15 clojurebot: "([x] [x y] [x y & more]); Returns true if no two of the arguments are ="

18:15 technomancy: xuser: np

18:16 muhoo: docs don't say it's eager, but makes sense it would have to be

18:16 ToBeReplaced: bbloom: won't be me, no CA, but seems like an easy patch for anyone looking to start contributing!

18:19 ben-o: can someone tell me what this means in clojure #^Somename?

18:20 dnolen_: ben-o: old type hint style

18:20 ben-o: so is there a new way- i.e. is it just ^

18:21 dnolen_: ben-o: yep

18:21 ben-o: dnolen_: cool- thanks!

18:26 sdegutis: I totally agree that if-some, some? and when-some should be renamed to use "exists"

18:26 or 'exist' etc

18:26 dnolen_: sdegutis: nobody seem to realize this ship already sailed

18:27 some-> and some->>

18:27 sdegutis: Yes I understand that's your point, I just disagree.

18:27 There's still hope.

18:27 That battle may be lost, but the war isn't over.

18:27 DomKM: dnolen_: some-> and some->> are both variadic. They operate over a group of things

18:28 dnolen_: I'd say the ship is pulling out of harbor but if this patch lands then it will fully sailed ;)

18:31 seangrove: Yeah, a bit frustrating to see the overloading of `some`, feels akward and unnecessary

18:31 abp: sdegutis: DomKM: dnolen_: probably the some/nil relationship should be cleared in the docs once and for all. Thats around the corner and in certain heads since 1.5.

18:31 hyPiRion: DomKM: huh, no? It operates on a single instance, short-circuiting the remaining thread forms if it is nil.

18:31 seangrove: That said, Hickey doesn't seem like the type to rush a decision like this into core, so I'm sure he (and the others) have given it plenty of thought

18:32 abp: and if <anyone> would like to search for the when->/some-> mailing list explanations/irc discussions from a while ago, i tried earlier but didn't find them to calm this discussion down :)

18:33 DomKM: hyPiRion: I might be misreading the docs (or they could be incorrect) but it looks like it tests for not-nil for the result each threaded form, not just the initial expression

18:34 hyPiRion: DomKM: yeah, but it's on a single instance only. It's not checking whether there is a value in a collection which is nil

18:37 (some-> a b c d) is equivalent with (if (some? a) (let [b# (b a)] (if (some? b#) ...

18:39 DomKM: hyPiRion: I realize they don't operate on colls, I meant that they operate on many...things (language fails me here). They do assemble them into a single form but it doesn't change the fact that they are meant to operate on a group. The real inconsistency between some and some-> is that the former tests for logical truth while the latter tests for not-nil.

18:43 hyPiRion: DomKM: yeah, the inconsistency I agree with. But the "operate on a group" part for `some->` is related to the `->` part of the macro, not the `some` part.

18:44 For me, the "issue" here is `some`, which probably should've been named something altogether in the first place

18:44 *something else

18:55 amalloy: yeah, the name `some` is perfect for a function which does almost-but-not-quite what `some` does

18:56 it would be great if (some even? [1 3 5 8]) returned 8

18:57 gws: yeah when i first started out i was reaching for `any`

19:03 seangrove: Today we attempt to go from Om 1.4 => 4.0

19:03 Let's see how it goes

19:10 Hrme, looks like maybe the behavior of :refer changed in clojurecsript 2156

19:12 dnolen_: Any changes around :refer in ns declarations?

19:16 Looks like LT has the same problems with 2156: https://groups.google.com/forum/#!topic/light-table-discussion/ODw8JD-T_Ns

19:19 dnolen_: seangrove: not that I'm aware of

19:20 seangrove: dnolen_: Pulling in master to see if I can trace down why the analyzer thinks the definitions are missing

19:28 Uhg, can't remember how to get my projuect to use my local copy of clojurescript

19:29 dnolen_: seangrove: you need to clojurescript on :source-paths that's it

19:29 "need to put"

19:31 seangrove: I'm curious how to recreate, I've seen some spurious warnings, but not what's been described in that post

19:31 seangrove: dnolen_: It's the first thing that came up in the upgrade to om 4.0, changing the clojurescript version. Will try to track it down

19:32 dnolen_: seangrove: thanks

19:33 abp: seangrove: what you been snarky? :)

19:34 seangrove: or are you continously mistyping oms version-nrs, would be even better.

19:35 seangrove: abp: Well, we're currently on 1.4, and it's stable enough for us, so sure, I consider it spiritually equivalent to 4.0 ;)

19:38 abp: seangrove: so it's been stable enough to not even consider leading zeros as a reality? :) Thats quite amazing

19:39 seangrove: abp: Probably unlikely for everyone, but it was spiritually very similar to what we were about to build out ourselves anyway, and miles above what we were using right beforehand

19:40 abp: seangrove: dnolen_ quite believable but being snarky now, its probably time for a changelog on cljs :x

19:41 seangrove: abp: I could get behind that. There's one that goes out on the ml, not sure if it's in the repo as well

19:41 abp: seangrove: dnolen_ is doing/creating quite unbelievable things all the time :) and i thank him whoelheartedly all the time

19:43 seangrove: yeah but theres no changelog and condensing all the time in mind whats allready there is quite hard even if following closeely

19:56 seangrove: dnolen_: Strangely enough, it's introduced by this commit: https://github.com/clojure/clojurescript/commit/b8cf302b1500e88e0602e72fa6aec6f7328a1a00

19:59 dnolen_: seangrove: yes, that's for sure, though that does catch a lot of errors that were being missed before.

20:00 seangrove: the issue is deeper and that's what I'd like to resolve.

20:10 Morgawr: mm.. I just got a nice server I can use to play around with clojure and pedestal, I don't know much about pedestal itself but I wanted to run the web server as port 80 but that only works if I'm root

20:10 and I don't want to run it as root, what's the proper way of doing it?

20:11 technomancy: Morgawr: you typically put nginx in front of it

20:12 Morgawr: technomancy: I'm not too familiar with nginx either (I'm a newb with web dev), I've only used a bit of apache.. if I get this right, I just tell nginx to reroute all the traffic from port 80 to my pedestal service?

20:12 technomancy: pretty much

20:13 Morgawr: ah okay, thanks

20:13 I'll check a man page or something to see how to do it ;)

20:13 seangrove: Morgawr: Might be nice to start out with Heroku first

20:13 technomancy: oh right; there is that too

20:13 almost forgot

20:13 Try my product!

20:13 seangrove: And then switch to something nicer when you're more experienced because the Clojure build servers in the back of technomancy's van are burning out

20:13 Morgawr: seangrove: isn't heroku just a cloud host service thingy?

20:14 I mean, I already have a few servers here and there, I do mostly sysadm stuff (not much with web-related frontend) so I'm not a total newb

20:14 seangrove: Morgawr: Yes...?

20:14 If you want to play with Clojure and not sysadmin stuff, then use Heroku to start out with

20:14 Morgawr: I have a free server I can play around with so I'm just trying to host a couple of clojure services and play with pedestal

20:14 technomancy: heroku doesn't really help with the "I just got a new server and I need something cool to use it for" problem =D

20:14 Morgawr: seangrove: nah, it's fun :P

20:14 seangrove: Morgawr: But then again, hosting it on your own server isn't too bad

20:15 Morgawr: technomancy: exactly! haha

20:15 pretty much I just want to use this server cause it's been lying around for months idle

20:15 poor thing :(

20:15 technomancy: fwiw I would start with a basic ring app instead though

20:15 pedestal doesn't strike me as a great introduction to web programming

20:16 * seangrove nods

20:16 Morgawr: probably :P

20:17 danneu: I would use Heroku just because I need to look up the boilerplate for /etc/nginx/sites_available/mysite.com

20:17 wouldnt*

20:17 i'll gist mine

20:18 Morgawr: http://www.reddit.com/r/Clojure/comments/1mrsmx/whats_the_common_way_to_use_ring/ccciqhx

20:21 Morgawr: danneu: great, thanks!

20:21 for now I wrote my simple nginx script and it redirects properly, I'll check that thread out though

20:21 thank you guys :)

20:24 danneu: Speaking of pedestal, http://pedestal.io seems to just redirect to the github repo now

20:25 Morgawr: yeah, not sure what happened :D

20:25 D:

20:26 dnolen_: danneu: Morgawr: I think the pedestal team is more or less giving up on pedestal app and re-assessing how pedestal should be architected given immutable data friendly client rendering layers like React.

20:26 danneu: that's cool news

20:26 or rather i look forward to see what happens

20:27 Morgawr: ah, nice

20:27 danneu: Morgawr: have you ever used clojure for web dev before?

20:27 Morgawr: just small stuff

20:28 I'm using clojure for game development, so the whole web-related world is a bit unfamiliar (yet fascinating) to me

20:30 seangrove: I think I am *fundamentally* misunderstanding this concept https://news.ycombinator.com/item?id=7241638

20:31 dnolen_: seangrove: groan

20:32 bbloom: seangrove: i hate this idea that dynamic typing makes it harder to reason about programs.... as if that were inherit

20:32 seangrove: crappy type systems (both static AND dynamic) are what makes it harder to reason about programs

20:32 technomancy: bbloom: what

20:32 bbloom: case in point: see javascript's terrible type system

20:33 technomancy: removing invariants which are guaranteed to hold for any state of a given program has no negative effect on how easy it is to reason about that program's execution?

20:34 kinda seems axiomatic to me

20:35 seangrove: dnolen_: It would be pretty nice to be able to set logging categories for the cljs compiler, so I can see all the of the ns analyses, the file loading, etc. selectively

20:35 bbloom: technomancy: that's no what i'm saying

20:36 technomancy: 1) compare reasoning about ruby programs vs reasoning about clojure programs. clearly it is easier to reason about types sensibly in clojure

20:36 technomancy: bbloom: ah, you're arguing that the difference in magnitude between "good dynamic" and "good static" is much smaller than that between "bad dynamic" and "good dynamic"?

20:36 danneu: Morgawr: what's the next thing you want to play/experiment with

20:37 bbloom: technomancy: close enough to the point i'm making that we'll go with that

20:37 Morgawr: danneu: the future! :P

20:38 nah, I think for the moment I'll experiment with my bed cause it's 2:33am and I'm a bit tired but who knows.. :P

20:38 night guys, thanks for the help

20:38 bbloom: technomancy: was going to add 2) there is a difference between difficulty of reasoning and burden of reasoning

20:38 danneu: Morgawr: https://github.com/swannodette/om-sync is pretty cool

20:39 technomancy: bbloom: as in it may be difficult to reason about certain factors, but not necessarily the factors that affect day-to-day problems?

20:39 sounds ... reasonable

20:39 ( •_•) ( -_-)~⌐■-■ (⌐■_■)>

20:43 danneu: i'll take "bad dynamic" over "bad mutable" though

20:44 bbloom: danneu: i think bad dynamic basically simply means mutable :-P

20:44 danneu: exactly

20:44 bbloom: danneu: or i guess bad dynamic must be highly mutable

20:44 heh

20:45 danneu: i've never really worked with a static typing system outside of superficial exposure to languages like Java. core.typed has been my first serious effort.

20:48 logic_prog: is there a function which atkes (1) a map, and (2) a set, and only takes the elements of map whose key is in the set?

20:49 bbloom: (doc select-keys)

20:49 clojurebot: "([map keyseq]); Returns a map containing only those entries in map whose key is in keys"

20:49 logic_prog: ,(select-keys {:a 1 :b 2} #{:a})

20:49 clojurebot: {:a 1}

20:49 logic_prog: (inc bbloom)

20:49 lazybot: ⇒ 27

20:49 logic_prog: what? that is too high

20:49 (dec bbloom) ;; taxes

20:49 lazybot: ⇒ 26

20:50 logic_prog: (inc bbloom)

20:50 lazybot: ⇒ 27

20:50 * bbloom opens a karma account in the cayman islands

20:50 logic_prog: ,(select-keys {:a 1 :b 2} [:a])

20:50 clojurebot: {:a 1}

20:53 logic_prog: for is a "long-form" of map. Is there a "long-form" of filter ?

20:53 i.e. something like (for-filter [i lst] (... pred on i ...))

20:53 bbloom: logic_prog: for has :when syntax, use in conjunction with into

20:54 logic_prog: bbloom: that works; thanks!

20:54 * bbloom clears throat

20:55 * bbloom sticks out his grubby karma grabbing hands and gestures "gimmie"

20:55 AmnesiousFunes: I noticed that Clojure/Clojurescript keywords can include chevrons; is that a relatively recent change or a well-established rule?

20:56 bbloom: AmnesiousFunes: do you mean inside the keywords? or before them? if the later, you're seeing metadata

20:56 AmnesiousFunes: http://clojure.org/metadata

20:56 AmnesiousFunes: bbloom: Inside

20:56 as in :valid->keyword

20:56 bbloom: ,:that^true

20:56 clojurebot: :that

20:57 bbloom: AmnesiousFunes: oh, those symbols

20:57 i thought you meant ^

20:57 AmnesiousFunes: Sorry, lapsus on my side, yes.

20:57 bbloom: < and > have been since the very beginning

20:57 consider:

20:57 ,(< 5 10)

20:57 clojurebot: true

20:57 bbloom: keywords are (for the most part) just colon prefixed symbols

20:58 AmnesiousFunes: Thanks.

20:58 seangrove: dnolen_: Bizarre. It seems like the ns that're being required are put last in the compilation list...

20:59 dnolen_: seangrove: shouldn't matter, dependencies are *analyzed* first

20:59 seangrove: to me this looks like an analysis bug

20:59 seangrove: dnolen_: Yes, sorry, I meant they're showing up last in the analysis stage

21:00 Let me make sure I'm on the latest before I go further and confirm

21:00 dnolen_: seangrove: k that's weird, but probably a simple issue somewhere

21:04 logic_prog: I'm trying, in cljs, to use http://clojuredocs.org/clojure_core/clojure.set/difference by doing (:require [cljs.set]) ... but apparently I don't have cljs.set

21:04 is clojure.set available in cljs ?

21:05 https://github.com/clojure/clojurescript/blob/master/src/cljs/clojure/set.cljs

21:05 hmm, maybe I should include clojure.set, even from cljs land

21:12 dnolen_: logic_prog: the namespace is clojure.set

21:12 akurilin2: Hey guys, anybody aware of a "within range" function already in the default libs for testing if a floating point number is "close enough"?

21:12 logic_prog: dnolen_: yeah. Is this by intention or a mistake?

21:12 dnolen_: logic_prog: by intention as far as I know

21:13 logic_prog: most of the clojure.foo namespaces predate my involvement in the project

21:13 logic_prog: dnolen_: This appears inconsistent to me. Am I misunderstanding something ? i.e. clojure.core.async -> cljs.core.async

21:13 dnolen_: logic_prog: it's not consistent, but it's also not going to change

21:13 logic_prog: dnolen_: okay, nothing else to discuss :-) // thanks for clarifying it

21:19 iorekz: Hello, how would you not repeat (get-data) here ?

21:19 (go (loop [res (<! (get-data))] (when (:success res) (timeout) (recur (<! (get-data))))))

21:23 danneu: iorekz: i do. but what's (timeout) for?

21:23 perhaps you mean (<! (timeout 1000))

21:23 iorekz: I cut for simplicity but it's (<! (timeout 5000))

21:24 in my case

21:24 danneu: also, (go (loop ...)) can be just (async/go-loop [res ...] ...)

21:24 iorekz: ho ok

21:24 thanks

21:25 and for the rest you would (let [repeat #(get-data)] before

21:26 or there is another control form im missing

21:26 danneu: not sure what you mean

21:26 also, easier to post code about:blank

21:26 https://www.refheap.com/

21:31 iorekz: ok

21:31 here it is danneu https://www.refheap.com/9d49ef7480e6461263981b1c6

21:31 so back to my original question : how not to repeat get-data

21:34 seangrove: dnolen_: So can namespaces be analyzed in any order, or should analyzing a ns declaration cause a recursive analysis of all :required/:used namespaces?

21:34 noonian: iorekz: i don't think you can if get-data only ever puts a single value on the channel it returns, if it returns a channel that will continue to get values you could bind res outside the go-loop and just take from res as you recur

21:34 dnolen_: seangrove: currently there's logic there such that dependencies are analyzed before analyzing the file under consideration.

21:35 seangrove: It looks like it's just analyzing the namespaces in alphabetical order, regardless of dependency chains

21:36 dnolen_: Here's a bit of output from compiling our code base https://www.refheap.com/c646454876371f2b254850ba3

21:36 And the change to (defmethod parse 'ns...)

21:37 Does that look sane? Trying to prune branches here

21:37 (almost all of the namespaces :require zensight.client.utils)

21:38 dnolen_: seangrove: look at line 1127, that's what analyzes the deps first

21:38 seangrove: also perhaps check-uses is broken?

21:38 line 1130

21:39 iorekz: noonian: I see, thanks

21:40 noonian: no problem

21:41 seangrove: dnolen_: check-uses seems right, env doesn't have the libs loaded under [::namespaces lib]

21:41 dnolen_: seangrove: but check-deps should handle that case

21:41 seangrove: analyze-deps does a check with (io/resource relpath), and that seems to generally return false though

21:42 dnolen_: That's where the warning is coming from

21:42 dnolen_: seangrove: (io/resource relpath) sounds like the source of the problem then.

21:42 just need to determine why that isn't working

21:45 seangrove: dnolen_: Maybe. I'm grasping at straws, I'll come back around to it tomorrow.

21:45 dnolen_: seangrove: if (io/resource relpath) is returning false, something is definitely wrong

21:46 seangrove: that should only fail w/ non CLJS libs

21:49 seangrove: dnolen_: Maybe it's the relpath that's being generated, and the way we have our files named

21:51 dnolen_: seangrove: yes would be nice to determine what's going on - let me know - again I haven't encountered these issues with 2156 myself.

21:52 seangrove: dnolen_: We have a file in src/cljs/useful.cljs with the ns (zensight.client.useful), and a lein cljsbuild source-paths of ["src/cljs"], maybe that's the underlying cause here?

21:52 dnolen_: seangrove: not going to work

21:52 need to follow classpath conventions

21:52 seangrove: Crazy, it's worked up until now

21:53 Let me see if there's a quick way to test it

21:53 dnolen_: seangrove: only by pure luck

21:53 seangrove: dnolen_: Willing to believe it

21:53 dnolen_: seangrove: not documented behavior at all

21:53 seangrove: dnolen_: Warnings could be far gentler though

21:53 dnolen_: seangrove: the problem is CLJS has a bad compilation strategy

21:53 it just finds all .cljs files under a directory

21:54 instead of looking at main namespace and following dependencies

21:54 there's already a ticket for this and it's the future

21:54 I would like to deprecate the current behavior

21:55 seangrove: dnolen_: That sounds right to me. What would be the right namespace for src/cljs/useful.cljs, (ns cljs.useful) ?

21:57 dnolen_: seangrove: the convention is identical to CLJ

21:57 src/cljs/zensight/client/useful.cljs

21:58 seangrove: Ok, let me try that (I stuffed it alongside our clj code)

22:01 dnolen_: Yeup, that did it. Seems like the compiler turned much more sensitive to the correct path conventions. Totally reasonable, would be 1.) good to document it now 2.) better to warn or throw an error when the ns declaration of a file doesn't match the expectation.

22:01 That was horrific.

22:01 dnolen_: Is #2 easy enough to do? If so, I'll make a patch tomorrow

22:02 dnolen_: seangrove: #2 is possible but we should only do this if it's a ClojureScript file, the location of goog Closure doesn't follow the classpath conventino

22:02 convention

22:03 seangrove: hmmm... Alright, I'll take a look at it tomorrow. Would love to see that throw an error to prevent unexpected behavior. Good to enforce a little discipline

22:03 dnolen_: seangrove: I've tried something like this before, there are subtleties that need to be checked so I didn't do it myself.

22:04 seangrove: The subtleties being js vs cljs source? Otherwise the cljs ns declaration should be predictable

22:07 dnolen_: seangrove: we need to consider non cljs files is all

22:07 seangrove: http://dev.clojure.org/jira/browse/CLJS-615

22:07 this ticket is close to have a comprehensive patch for these problems.

22:08 but I point out the issues in the last comment.

22:09 seangrove: dnolen_: Great, looks like a great patch to check out. I'll see if I can get it over the line

22:16 dnolen_: What was om/bind deprecated in favor of?

22:21 Nevermind, I'll just take that stuff out, not really necessary

22:24 dnolen_: seangrove: om/bind is just not needed anymore

22:24 seangrove: it was there because of om/read and that's gone

22:25 seangrove: dnolen_: Ok, just updating to the latest Om, want to make sure I'm giving a talk on 0.4.0 and not 0.1.4

22:31 insamniac: earthquake?

22:31 anyone else feel that?

22:33 awkward

22:36 TEttinger: insamniac, what country/state?

22:36 in US the USGS has a good reporting service

22:36 insamniac: Augusta, GA

22:36 TEttinger: not the masters!

22:36 insamniac: Funny that I'm from California though

22:39 danneu: For years, my forum has been hit by the admins of a "competing" forum where they PM my users with an advertisement for their forum.

22:39 All that time i was using vBulletin. But i rewrote my forum in Clojure and can do whatever I want to stop it.

22:40 My first idea is to just hide all PMs that contain their link or a unique sentence in their boilerplate so they think they are actually sending PMs

22:41 TEttinger: insamniac: it's more likely it's either a very small earthquake that is very close, or some kind of other ground event like a sinkhole. sweet dreams! http://earthquake.usgs.gov/earthquakes/map/

22:42 danneu, or change their link

22:43 to a link to the rickroll video or something relatively harmless

22:44 danneu: On vBulletin, we would just add links to the censored words list which was an awful solution

22:44 There are infinite url shorteners

22:49 TEttinger: you can however follow the link in your forum

22:52 danneu: Yeah, that's Phase 2

22:54 jph-: danneu, or disallow new users from posting links until the account has reached a certain age or certain post count

22:55 danneu: oh yeah, they actually just post text links.

22:55 which makes phase2 too hard

22:55 jph-: so google.com vs http://google.com ?

22:55 TEttinger: link detection?

22:56 jph-: heck make PMs restricted until account has minimum age/post count

22:57 danneu: yeah, turns out they are persistent

22:57 they take that kind of stuff as a challenge or something.

22:58 at least by hiding PMs they'll think they're killin it and hopefully won't notice that they're not actually showing up

22:58 jph-: add in captcha

22:58 oh yeh

22:58 danneu: jph-: theyre humans

22:58 they're probably the website's admins

22:58 jph-: what is that called when you let them post but the post is actually hidden?

22:58 shadowbanning?

22:58 TEttinger: you could be smart about it and detect when enough links redirect to the same place

22:58 danneu: shadowbanning? hellbanning?

22:59 jph-: have you done anything re matching account with IPs?

23:00 danneu: yeah, i had that on vbulletin (every post's IP is intersected with all IPs used by banned users) but now i'll be able to shadowban them

23:01 TEttinger: I would just build up a DB of links posted, if any match known spammer sites, block them

23:02 (apply str (take 1000 (slurp "http://bit.ly/1c8bTuG"))) will follow the link (here, to the docs for a clojure game lib)

23:02 danneu: i guess i'd need to eat false positives for tht

23:02 TEttinger: you can rewrite the history

23:05 I'm kinda curious what these annoying sorts think they'll gain from PMing users and telling them to come to their forum

23:06 danneu: They've been at it for years https://www.google.com/search?q=coloholics+spam

23:21 right1: does anyone know of problems with ring's text handling

23:21 i have some japanese characters that are getting turned into question marks

23:23 jph-: right1, google search for ring unicode turn up any hits?

23:24 right1: clojuredocs for ring say it shouldget set to utf-8

23:24 i tried adding a :charset "UTF-8" to my response map

23:25 http://www.evernote.com/shard/s385/sh/9006ba2b-5390-4509-944e-e7c8a8ae54db/40ee51bbadf26c072c617725f98cd2eb

23:26 TEttinger: right1, are you on windows by any chance?

23:26 right1: ember app on left, spit output json from cheshire on right (before it goes to the response map)

23:26 yes, i am on windows and i use japanese locale

23:26 oh, speaking of which, i have an amusing video related to that

23:26 TEttinger: I wonder if something's going through an ANSI-encoded terminal

23:27 right1: may be

23:27 i ran some of this data through rails and it destroyed my strings

23:27 went from 漢字 to ??%%%%@$$$%?:??

23:27 lazybot: right1: What are you, crazy? Of course not!

23:27 right1: http://www.youtube.com/watch?v=0okmEqTKiDY

23:28 TEttinger: oh maybe

23:28 check the lower right of that screenshot

23:28 ANSI as UTF-8

23:28 right1: oh

23:29 i changed the encoding on notepad++ to just UTF-8 and the japanese is fine

23:29 ill have to try running this on my mac sometime

23:31 TEttinger: right1, so it works now?

23:31 right1: no, not at all

23:31 inthe application it is very broken

23:32 TEttinger: what's the encoding of the webpage you took that screenshot of?

23:33 right1: oh i just looked in my network tool and i have latin-1 coming back

23:33 ...

23:33 TEttinger: you can set that in the HTML, right?

23:34 right1: oh... i can't add a :charset to the response map, i have to append charset to content type's value directly in the header

23:35 http://www.evernote.com/shard/s385/sh/6038d8db-4100-4398-ad06-9c9e170056a1/813d1df6a8bcf995705ff356bf4431f1

23:35 well, now i know...

23:35 `cbp: does anyone know where did percent-encode go in ring 1.2

23:36 TEttinger: looks like it works now, right1, that's good

23:36 `cbp: there's no ring.util.codec ns anymore

23:36 right1: thx

23:37 TEttinger: https://github.com/ring-clojure/ring-codec/blob/1.0.0/src/ring/util/codec.clj#L31

23:37 it's in ring-codec, `cbp, which seems split off

23:37 np right1

23:37 `cbp: thanks TEttinger

23:37 TEttinger: np `cbp

23:46 logic_prog: ,(select {:a 1 :b 2 :c 3} #{:a :b})

23:46 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: select in this context, compiling:(NO_SOURCE_PATH:0:0)>

23:48 Raynes: The select is a lie.

23:49 logic_prog: is this channel logged?

23:49 bbloom told me how to select a list of elements from a map, i.e. (magic-func map list-of-keys)

23:49 but, being a dumbass, I forgot the function name

23:51 inc(bbloom)

23:51 (inc bbloom)

23:51 lazybot: ⇒ 28

23:51 logic_prog: bbloom: pls help again with (... {:a 1 :b 2 :c 3} [:a :b]) ==> {;a 1 :b 2}

23:52 `cbp: man not a single percentage encode matches the silly twitter api one

23:54 jph-: logic_prog, i believe there's a channel log that is available online

23:54 search for #clojure

23:55 logic_prog: select-keys !

23:55 (inc jph-)

23:55 lazybot: ⇒ 1

23:55 logic_prog: http://clojure-log.n01se.net/ in case anyone is curious

23:55 jph-: ,(select-keys {:a 1 :b 2} [:a])

23:55 clojurebot: {:a 1}

23:55 amalloy: also http://logs.lazybot.org/irc.freenode.net, logic_prog

23:56 logic_prog: hmm, looks like lazybot only cares about clojure

23:56 (inc lazybot)

23:56 lazybot: ⇒ 21

23:56 logic_prog: (inc amalloy)

23:56 lazybot: ⇒ 84

23:56 logic_prog: whoa

23:57 amalloy: hey, my karma is exactly four times lazybot's. nicely managed, logic_prog

23:57 (inc logic_prog)

23:57 lazybot: ⇒ 3

23:58 logic_prog: we should move to a world where instead of (inc ... )

23:58 we tip with dogecoins :-)

23:59 it'd make us half-a-$0.01 -illionaires

23:59 `cbp: I will tip those who have no private functions on their open sources

23:59 amalloy: i would rather lose all my karma than receive any dogecoins

Logging service provided by n01se.net