#clojure log - Jun 18 2013

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

0:07 minikomi: I do not own a car. Tokyo public transport is good.

0:08 robink: amalloy: Seems not to work.

0:09 SegFaultAX: minikomi: I wish I could say the same for San Francisco and the surrounding suburbs.

0:10 minikomi: Plus, the legal blood alcohol limit for drivers is 0.

0:11 SegFaultAX: minikomi: I'm glad I don't have to say the same for SF and the suburbs. :D

0:11 minikomi: haha

0:13 amalloy: robink: a call to the macro m will work if, and only if, the (m) is within the lexical scope of the macrolet. (macrolet ... (m)) works, (macrolet ...) (m) doesn't; it really is that simple

0:13 robink: amalloy: I get that. That's not my problem.

0:13 amalloy: The problem is defining the macro within macrolet as including a type.

0:14 amalloy: I'm looking at a gist you posted (https://gist.github.com/amalloy/5084918) and trying to figure out how it works.

0:14 amalloy: The difference, I suppose, is that I'm not calling the macro directly, since I'm defining another dispatch for print-method.

0:15 amalloy: That's all I want. An extra print-method dispatch limited to a scope.

0:15 amalloy: that's not possible

0:15 robink: amalloy: Ah, OK then

0:15 amalloy: multimethods are global and permanent

0:15 robink: amalloy: Aha

0:15 amalloy: So even (defmacro ^{:private true}) won't limit its evaluation to a namespace?

0:15 SegFaultAX: robink: As a rule, most things that start with def create or modify a top-level var.

0:16 amalloy: you keep saying macro, but apparently you only care about a multimethod

0:16 i can't answer your questions, because they seem totally disconnected from what you want

0:16 robink: SegFaultAX: Well, def creates a namespace-level var, not a global. The macro I'm defining is evaluated from other namespaces.

0:17 amalloy: My question, specifically, is whether or not it's possible to have multimethod dispatch behavior limited to a scope or namespace.

0:17 amalloy: no

0:17 robink: amalloy: OK then

0:17 SegFaultAX: Wouldn't that kinda defeat part of the purpose?

0:18 amalloy: SegFaultAX: meh. it's easy to imagine two functions which both want to extend the printer in mutually-exclusive ways

0:18 clojurebot: functions are maps

0:19 SegFaultAX: clojurebot: Thanks!

0:19 clojurebot: RickInGA: Thanks; the queue is empty now, though I'm sure it'll fill up at ClojureWest again.

0:19 amalloy: but it's okay, because f only ever writes data to clients expecting f's extensions, and similarly for g

0:19 robink: SegFaultAX: Not if I want different behavior for a method dependent on what namespace or scope I happen to be in.

0:20 amalloy: It's actually not a big deal. I just wanted the default pretty-printing for a type when I'm in the user namespace, and the ability to emit the tagged value when I'm in my parser namespace.

0:20 amalloy: Nothing is broken.

0:37 rlb: devn: found it - https://github.com/runa-dev/cliopatra

0:59 futile: ,[(some nil? [1 2 3]) (some nil? [1 nil 3])]

0:59 clojurebot: [nil true]

0:59 futile: Works for me.

1:00 Howdy.

1:03 (Who keeps spreading the lie that Python doesn't have closures except in the limited form of its lambda keyword?)

1:10 arcatan: (prolly people who don't know closures very well, or who haven't coded much in Python)

1:13 brehaut: or people who learnt python prior to 2.1 or 2.2

1:14 2.2 was the first version with closures

1:14 http://en.wikipedia.org/wiki/Python_syntax_and_semantics#Closures

1:18 amalloy: http://math.andrej.com/2009/04/09/pythons-lambda-is-broken/ is all i know about python's closures

1:19 brehaut: amalloy: you can create a closure with a named function in python

1:19 HashNuke: hey all.

1:19 brehaut: theres some historical wackiness about scopes that i think 3 might resolve, and also having no way to declare a variable other than assignment creates weird rules about  scope

1:22 HashNuke: I've been doing the Clojure Koans. I found this https://gist.github.com/HashNuke/a6bedbe3d3c97f5c04c6 in the recursion chapter. What do the arguments passed to the loop function mean?

1:24 brehaut: amalloy: that article is wrong; its the behaviour of list comprehensions that are broken there, not lambda

1:25 amalloy: brehaut: are you sure? last time i checked, for loops behave the same

1:25 brehaut: amalloy: right; its closuring over a mutable variable

1:25 and list comps in python < 3 are just a mangled for loop

1:26 they dont introduce a fresh variable for each iteration (and infact, the variable bleeds outside the scope of the list comp!)

1:27 amalloy: if you had def counter (init):\n def inner():\n init += 1\n return init

1:27 you'd expect init to keep incrementing each time the resulting counter is called

1:28 i forgot a return too

1:29 also stupid scoping shenanigans

1:43 minikomi: wha?

2:41 samrat: HashNuke_: they're default bindings

2:42 HashNuke_: samrat: I think i understood. so the list of args i pass will be assigned the respective values… like [x 1 y 2 z 3].

2:42 samrat: HashNuke_: correct

2:42 HashNuke_: samrat: Thanks

3:00 gta: getting nrepl to work

3:01 hi ppl

3:08 n_b: What's the closest thing in clojure to repeatM_ in Haskell? It's essentially do something n times and ignore the result, without binding the index to anything; (dotimes [_ n] ) ?

3:22 Raynes: n_b: What's wrong with dotimes?

3:41 supersym: can someone shed some light on `lein deps :tree` and why it would think these are confusing/different?

3:41 WARNING!!! possible confusing dependencies found: [org.clojure/tools.namespace "0.2.3"] overrides [org.clojure/tools.namespace "0.2.3"]

3:42 to me they seem the same, I assume they aren't (nested both in different pkgs), is lein wrong? Or what should I do? :)

4:51 rodnaph: does anyone know the current state of clojurescript source mapping?

4:52 mpenet: rodnaph: "almost, but not yet" I think

4:52 rodnaph: cool, know of any docs on how to try out what's there? my google-fu turns up nothing...

4:52 mpenet: I am not sure it's in master yet, you could try asking dnolen_

4:54 rodnaph: https://github.com/clojure/clojurescript/commit/5b7623873ff8713a556f3b52fe1912c98ac8bbc5

4:55 seems to have landed. i'll ping dnolen_ when he's online, thanks.

4:57 tomjack: it's not ready yet

4:58 he said something like we need more support from the reader.. or something

4:59 mikethepurple: Guys, is there a way to get an html file not as source but as browser-loaded contents?

5:00 OR, which seems more simple, get the javascript variables - but also, after running the scripts

5:01 rodnaph: mikethepurple: dev tools, elements, copy root el as html? can't think of a clojure way though... ;)

5:05 mikethepurple: I have a web-based page with query-string url which builds a google map, gets directions, counts time to get from point to point (which it gets from the query string), puts it in a variable and shows it in the bottom of the page. Can't figure out how to USE this variable

5:05 Blows my mind a bit

5:06 I am ridicoulosly russian, so tell me first, if you do get the question :)

5:08 rodnaph: mikethepurple: is this a clojurescript app?

5:11 mikethepurple: nope

5:15 rodnaph: you might get some more help in a #javascript or #googlemaps channel, or for the framework/library you're using if there is one.

5:17 mikethepurple: But this is obviously a clojure issue - in fact i need to find a way to evaluate html/javascript code in this language. I bet there are not too many guys in #javascript who do know what the hell clojure is. But if i don't get help in a few minutes i will surely try

5:18 vijaykiran: mikethepurple: how about using a JavaFX WebView - not sure if it has API to grab the rendered data though

5:19 murtaza52: for a code in a leningen project, what is its relative path - the path of the project, or the path of the source file

5:19 vijaykiran: murtaza52: AFAIK - it is the path of the project

5:20 mikethepurple: Wil try. if that works (or anything else though), i can share the solution here, if anybody wills

5:20 murtaza52: vijaykiran: thanks

5:20 vijaykiran: murtaza52: you can just rev up the repl, create a temp file without path and print its abs path

5:20 mikethepurple: http://docs.oracle.com/javafx/2/webview/jfxpub-webview.htm

5:21 mikethepurple: Yeah, already found that thing

5:21 vijaykiran: mikethepurple: another option would be to use selenium

5:22 mikethepurple: should be easier than webpane

5:23 mikethepurple: Wow, there is even a clojure api for that thing, thanks

5:24 Morgawr: this might be a stupid question but.. is there a better way of using the "not" operator in if/cond/when statements? I always find myself typing (not (nil? (something something)))

5:24 it feels very verbose

5:26 schmir: Morgawr: there's if-not and when-not

5:26 rodnaph: mikethepurple: sorry, misunderstood. sounded like you were just asking about a normal web app :)

5:27 mikethepurple: nooope, that is the whole point :)

5:28 also, i am not new in Clojure, but i am in IRC, how the hell do you mention - /to?

5:28 Morgawr: schmir: ah, that makes it better, thanks

5:29 vijaykiran: mikethepurple: mention ?

5:31 Anderkent: mikethepurple: /msg Nick content

5:34 mikethepurple: thx

5:52 Well, i figured out that selenium just opens the browser and tests something with it

5:54 murtaza52: what is the easiest way to create a new file, or overwrite an existing file in clojure

5:58 answering my question - spit

6:16 supersym: hm

6:16 ah..ok... now I got it :P

7:25 murtaza52: how do I print the current path in repl

7:28 clgv: murtaza52: ##(System/getProperty "user.dir")

7:28 lazybot: java.security.AccessControlException: access denied (java.util.PropertyPermission user.dir read)

7:28 clgv: ,(System/getProperty "user.dir")

7:28 clojurebot: #<SecurityException java.lang.SecurityException: denied>

7:29 clgv: hmm ok, even clojurebot secures "his private parts" :P

7:39 murtaza52: clgv: thanks

7:39 just wondering how does clojurebot work ?

7:45 clgv: murtaza52: an IRC bot that ready what is written here an reacts on particular syntax or words. you can let it eval clojure forms by prepending "," and "&" for lazybot

7:45 ,(+ 1 2)

7:45 clojurebot: 3

7:45 clgv: &(+ 1 2)

7:45 lazybot: ⇒ 3

7:46 clgv: $seen Raynes

7:46 lazybot: Raynes was last seen talking on #4clojure 3 hours and 24 minutes ago.

7:46 murtaza52: so IRC has provision for attaching bots to specific channels ?

7:46 clgv: and something like that ^^

7:46 murtaza52: this is amazing

7:47 $seen murtaza52

7:47 lazybot: murtaza52 was last seen talking on #clojure 17 milliseconds ago.

7:47 murtaza52: any other synta it supports ?

7:47 clgv: $find inc [1 2 3] [2 3 4]

7:50 $findfn inc [1 2 3] [2 3 4]

7:51 lazybot: []

7:51 clgv: $findfn 3 5 8

7:51 lazybot: [clojure.core/+ clojure.core/unchecked-add clojure.core/+' clojure.core/unchecked-add-int]

7:51 Anderkent: $findfn [2 3 4] inc [1 2 3]

7:51 lazybot: []

7:51 Anderkent: huh

7:52 clgv: Anderkent: I was shooting for `map but somehow that did not work

7:52 Anderkent: yeah so was i

7:52 the result goes first doesnt it

7:52 clgv: no. the result goes last

7:52 Bronsa: $findfn [2 3] inc

7:52 clgv: param1 ... paramN result

7:52 Bronsa: $findfn [2 3] inc [3 4]

7:52 lazybot: []

7:52 Anderkent: is that different with the bot than findfn.core?

7:52 lazybot: []

7:52 Bronsa: durr

7:52 $findfn inc [2 3] [3 4]

7:52 clgv: Anderkent: never used findfn.core ;)

7:53 lazybot: []

7:53 Bronsa: mh?

7:53 clojurebot: slamhound is for reconstructing your ns forms from scratch: https://github.com/technomancy/slamhound

7:53 Bronsa: why isn't it returing mapv

7:53 Anderkent: $findfn nil '()

7:53 murtaza52: what is $findfn doing?

7:53 clgv: &(clojure-version)

7:53 lazybot: ⇒ "1.4.0"

7:53 [clojure.core/distinct clojure.core/lazy-cat clojure.core/sequence clojure.core/vec clojure.core/concat clojure.core/seque clojure.core/drop-last clojure.core/reverse clojure.core/cycle clojure.core/rest clojure.core/lazy-seq clojure.core/flatten clojure.core/sort]

7:53 clgv: oh ok ^^

7:54 Anderkent: $findfn inc [1 2 3] (2 3 4)

7:54 lazybot: java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn

7:54 clgv: $findfn inc (2 3) (3 4)

7:54 lazybot: java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn

7:54 Anderkent: $findfn inc [1 2 3] '(2 3 4)

7:54 :D

7:54 lazybot: []

7:54 clgv: $findfn inc '(2 3) '(3 4)

7:54 Anderkent: huh

7:54 lazybot: []

7:54 murtaza52: how do I extract a file name from a string

7:54 clgv: seems broken

7:54 murtaza52: ,(-> (split "b.cl" #".") first)

7:54 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: split in this context, compiling:(NO_SOURCE_PATH:0:0)>

7:54 Bronsa: no, map returns a lazyseq

7:54 Anderkent: murtaza52: make a File out of it then ask it about its name

7:54 Bronsa: '(3 4) is a PersistentList

7:54 murtaza52: ,(-> (clojure.core/split "b.cl" #".") first)

7:54 clojurebot: #<CompilerException java.lang.RuntimeException: No such var: clojure.core/split, compiling:(NO_SOURCE_PATH:0:0)>

7:55 Anderkent: Bronsa: but they should pass equality checks

7:55 murtaza52: ,(require 'clojure.string)

7:55 clojurebot: nil

7:55 murtaza52: ,(-> (clojure.core/split "b.cl" #".") first)

7:55 clojurebot: #<CompilerException java.lang.RuntimeException: No such var: clojure.core/split, compiling:(NO_SOURCE_PATH:0:0)>

7:55 murtaza52: ,(-> (clojure.string/split "b.cl" #".") first)

7:55 clojurebot: nil

7:55 Anderkent: murtaza52: you must escape . in regular exprs

7:56 murtaza52: why doesnt the split work in this case ?

7:56 ,(-> (clojure.string/split "b.cl" #"\.") first)

7:56 clojurebot: "b"

7:56 murtaza52: thanks

7:56 Anderkent: but don't do that

7:57 murtaza52: any suggestions for a better way ?

7:57 jtoy: why would I get this error when the file exists and I have permission (I am testing as root): IOException error=2, No such file or directory java.lang.UNIXProcess.forkAndExec (UNIXProcess.java:-2)

7:58 Anderkent: ,(import 'org.apache.commons.io.FilenameUtils)

7:58 clojurebot: #<ClassNotFoundException java.lang.ClassNotFoundException: org.apache.commons.io.FilenameUtils>

7:58 Anderkent: aww

7:58 that's the easiest way :D

7:58 jtoy: all I am doing is appending data to a file: (with-open [wrtr (writer "/etc/hosts" :append true)] (.write wrtr data))

7:59 Anderkent: murtaza52: you want to do (.getName (File. filename)) and then find the *last* dot in it and take everything before that

7:59 jtoy: I've tried this on a couple of files and I get the same error, so i think i must be doing something else wrong?

8:02 murtaza52: ,(->> (split "b.cl.ab" #"\.") drop-last (interpose ".") (apply str))

8:02 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: split in this context, compiling:(NO_SOURCE_PATH:0:0)>

8:03 murtaza52: Anderkent: why instantiate the File object ?

8:03 Anderkent: murtaza52: because that's the only reliable way of getting the base name from a path. Unless you're guaranteed there's no / in your string?

8:05 murtaza52: thanks

8:07 Anderkent: unfortunately it doesnt -> cleanly because of the orger of args ;/ split takes string first, join takes separator first -.-

8:08 loz: hi

8:11 murtaza52: Anderkent: java.nio.File ?

8:13 loz: how can i compile cljs files without project?

8:14 Anderkent: murtaza52: sure, if you prefer. java.nio.file.Path is what you want hen

8:14 murtaza52: nope I was asking, what to use ?

8:14 Anderkent: java.io.File

8:16 murtaza52: https://www.refheap.com/15870

8:17 save the obvious typos (that should be fixed now), it should work

8:18 vijaykiran: loz: Did you try using cljsc - https://github.com/clojure/clojurescript/wiki/Quick-Start ?

8:19 jtoy: ?

8:20 murtaza52: Anderkent: thanks

8:28 loz: vijaykiran: should i specify all files at once?

8:28 vijaykiran: loz: I haven't used it myself - but from the docs it looks like it will compile all the files in a dir

8:29 loz: vijaykiran: okey, gonna try it

8:29 thx

8:29 jtoy: how would you remove the block #BEGIN .... #END from a file in clojure?

8:41 Anderkent: jtoy: all of such blocks anywhere in a file?

8:50 jtoy: ugly loop solution: https://www.refheap.com/15872

8:51 vijaykiran: jtoy: slurp into a string do a regex find replace

8:52 Anderkent: isn't line-seq should work in place of split-lines ... right ?

8:59 clgv: jtoy: if speed is not too crucial you can use replace with a regular expression

9:00 what vijaykiran said... ^^

9:21 piranha: cemerick: (re: friend) there is something I can't grasp from docs and can't simply find by googling - if :credentials-fn decided that password is incorrect, how do I know that and how do I show an error to user?

9:21 maybe there is an example somewhere or something...

9:26 dnolen_: basic & advanced core.match usage http://github.com/clojure/core.match/wiki/Basic-usage http://github.com/clojure/core.match/wiki/Advanced-usage

9:38 xeqi: piranha: which workflow?

9:38 piranha: xeqi: interactive-form

9:39 xeqi: piranha: it does a redirection to the :login-uri w/ query parameters login_failed and username. Your handler for that route can check for them and show an error

9:40 piranha: hmhm, strange, because I'm not seeing this

9:40 xeqi: it redirects me to the page I came from ('/', since I submit from there), but with empty query-string (so the url is '/?')

9:41 xeqi: piranha: do you have a custom :login-failure-handler ?

9:42 piranha: xeqi: no, I don't...

9:54 tupi: what is null? in clojure

9:54 i mean the corresponding function

9:57 dbushenko: nil?

9:57 clojurebot: ⟹ "Returns the metadata of obj, returns nil if there is no metadata."

10:00 IamDrowsy: why does clojurebot talks about the docstring of meta when "nil?" is asked?

10:01 hyPiRion: well, clojurebot is sentient somehow

10:01 I don't think it's repeatable

10:01 nil?

10:01 clojurebot: ⟹ "Returns the metadata of obj, returns nil if there is no metadata."

10:01 hyPiRion: what.

10:01 pos?

10:01 clojurebot: (def transpose (partial apply map vector))

10:02 hyPiRion: neg?

10:02 clojurebot: :negative/num-1 + :positive/num-1 = :zero/zero

10:02 tupi: tx. greetings all. i still can not make my 5 lines clojure script working because of this 'headless' problem. here is a paste, help greatly appriciated: http://paste.lisp.org/display/137651

10:11 i of course realize it is a java problem, but surely i am not the first facing it, am i ?

10:18 vijaykiran: tupi: Did you check the warnings/docs here - http://fiji.sc/Headless ?

10:19 tupi: "Naturally, these plugins will still try to instantiate GUI elements when being called in headless mode, failing."

10:20 tupi: while you are at it - you should switch to clojure 1.5.1 :)

10:24 loz: any of cljs developers here?

10:27 dbushenko: loz: whad do u mean? developers who use cljs or who implement it?

10:28 loz: developers who can add one feature

10:29 or explain that i dont need it)

10:29 dbushenko: ^

10:32 murtaza52: Anderkent: I have a java.nio.file.Path, how do i get its string path. I will then (slurp) the file on the path.

10:33 this is what I am doing right now - (-> p .toUri .toString (split #"file://") second)

10:34 however the path it is returning is the absolute-project-path + file-name. However its not taking into consideration any folders I may have in the project, thus the slurp fails

10:37 solussd: does anybody know why 'resolve' doesn't exist in clojurescript? Do I have an alternative to construct a symbol from a string?

10:38 llasram: ,(symbol "like-this?")

10:38 clojurebot: like-this?

10:41 solussd: like this ,((resolve (symbol "+")) 7 8)

10:41 supersym: so you want awt.headless?

10:41 solussd: ,((resolve (symbol "+")) 7 8)

10:41 clojurebot: 15

10:41 tupi: vijaykiran: tx. i use clojure 1.4 because i m on debian testing and that's what's available here for now [did not want the hassle to install clojure manually]. imagej/fiji have been so badly designed that it is almost impossible to use what has been developed has a library. i thank you for the link though

10:42 Anderkent: solussd: clojurescript doesnt have vars. You can try something like treating the namespace object as an array

10:42 llasram: solussd: (a) Yeah, you can't do that in Clojurescript because AFAIK namespaces etc are purely compile-time constructs. (b) You should generally only be doing that in JVM Clojure if you're writing e.g. tooling which manipulates namespaces

10:42 vijaykiran: tupi: You can try processing.org if it has methods for your usecase

10:42 tupi: when i run fiji [it still uses clojure 1.3] i get warnings that i should run the way i pasted here above ... and i don't want to depend on fiji actually, just use imagej 'library' ...

10:42 Anderkent: solussd: but it might not work if your code is optimized in compilation and the symbol is not properly exported

10:43 llasram: solussd: What's your goal at a higher level?

10:44 solussd: I think I'll just write a few more lines of codoe and stop trying to be so clever. ;) I just stumbled upon the lack of resolve and wondered why

10:44 Anderkent: yeah. In the online playground (aget cljs.user "foo") seems to work

10:44 but I do not recommend actually doing that :)

10:45 tupi: supersym: any hint is welcome

10:47 supersym: i try to get the 5 lines clojure script that i paste to work :)

10:47 solussd: ackk! clojurescript doesn't have "case" either... I guess that makes sense since the semantics of it probably arent supported

10:48 wait.. yes they are.

10:48 where's my case?

10:48 Anderkent: solussd: I think it has been added to cljs

10:48 but they can't guarantee constnat time dispatch on as many things as clojure can

10:48 solussd: grepping core.cljs doesnt show it

10:49 Anderkent: hm, you might be right. dnolen claims it was added in http://stackoverflow.com/questions/9453117/has-anyone-a-case-implementation-for-clojurescript

10:50 but he also recommends using (condp = x ...)

10:50 solussd: interesting.

10:50 hmm, cant find condp either. :D

10:51 Anderkent: case works in the online repl

10:54 solussd: what online repl? doesn't work on Himera: Compilation error: TypeError: 'undefined' is not an object (evaluating 'cljs.user.case$.call')

10:54 Anderkent: clojurescript.net

10:54 https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/core.clj seems to have (defmacro case)

10:55 solussd: interesting.

10:55 where the heck are case and condp in the source?

10:56 Anderkent: in the file I just linked

10:56 I'm not sure what the directory structure of clojurescript repo means (the clj/cljs dir under src)

10:58 solussd: ah, I was looking in cljs/cljs/core.cljs

10:58 case is there, and it's a macro

11:03 clj_newb_2345: anyone recommend a tutorial on webgl + clojurescript? :-)

11:08 bbloom: clj_newb_2345: why not just look at two separate tutorials? there is nothing special about clojurescript plus any particular web tech

11:10 justin_smith: murtaza52: try (slurp (clojure.java.io/resource ...))

11:11 murtaza52: the problem is the path I am receiving doesnt have the subfolder in the project, it only has the project path + file name.

11:11 any ideas what could be causing it?

11:12 justin_smith: murtaza52: I am not sure, but io/resource is designed for abstracting over the weird ways the jvm provides resources in compiled projects, and in my experience saves me from many of those confusing behaviors

11:13 arcatan: ambrosebs: https://github.com/clojure/jvm.tools.analyzer/blob/master/epl.html I think you don't want to have the github layout in there :)

11:13 justin_smith: for example io/resource works when the file is on the filesystem, or if it is compiled in a jar with the rest of the project, etc. without having to change my code

11:13 murtaza52: it could be that the file you are asking for is in a folder in the classpath, and so it is providing the path relative to that classpath

11:14 (or resource path, same diff)

11:14 ambrosebs: arcatan: whoops!

11:16 murtaza52: I am using the java.nio.file for watching a folder for any changes, and it returns me a Path object for anything that has changed,

11:16 justin_smith: if (comp slurp io/resource) does not work, maybe (comp slurp io/file) will?

11:18 murtaza52: let me look at java.io/resource, however my problem is in getting the path in the first place. The past is being handed to me as a java.nio.file.Path object.

11:21 justin_smith: OK, I am certain there is a conversion that can be done between java.nio.file.Path and something slurp can take "Default implementations are provided for Reader, BufferedReader, InputStream, File, URI, URL, Socket, byte arrays, character arrays, and String."

11:21 (that is from the doc for clojure.java.io/reader, which is what slurp tells you to look at to see what it can open)

11:22 Anderkent: justin_smith: (File. my-path)

11:22 actually let me make sure that's true :D

11:22 ah

11:22 (.toFile path)

11:23 justin_smith: murtaza52: yeah, Anderkent has your answer there

11:24 but if your code would ever run from inside a jar with that file also inside the packed jar, resource is the better way to do it (it does fs/jar stuff transperently)

11:25 Anderkent: justin_smith: i think directory watching means using file access, not classpath resources

11:25 justin_smith: oh, duh

11:25 yeah

11:25 Anderkent: don't think you can watch classpath resource like dirs

11:25 justin_smith: of course :)

11:26 murtaza52: so I can slurp (.toFile path) ?

11:26 Anderkent: yeah

11:30 murtaza52: I think the slurp works, but it trows an error bcoz its not able to find the file. It must not be getting the subfolder path

11:32 justin_smith: some file operations succeed even if the file does not exist (ie. java.io.File) - your class may act like that too

11:32 you can write to it, but of course not read it

11:42 murtaza52: where can I find any docs on clojure.java.io ?

11:43 justin_smith: http://richhickey.github.io/clojure/clojure.java.io-api.html

11:44 that may be out of date? but I don't think it has changed much since then

11:46 noncom: how can I enable jQuery in my ClojureScript files? I have installed jayq, dowloaded closure-compatible jquery-1.9.1, put in the cljs compiler externs path enable :use of jayq namespaces in my namespace and still I get jQuery is not defined

11:47 algernon: murtaza52: http://clojure.github.io/clojure/clojure.java.io-api.html

11:51 dnolen_: noncom: how are you trying to reference jQuery in your CLJS?

11:54 noncom: dnolen_: just as it says on the jayq readme page. then, when i try to load the page in the browser, the javascript console says the error

11:54 dnolen_: noncom: did you search for other projects that use jayq?

11:55 pbostrom: noncom: you probably need to include the jquery library in your html page

11:56 noncom: dnolen_: did a little search but did not find a complete project. all i find is a similar code. even here http://squirrel.pl/blog/2012/10/16/hello-clojurescript-with-jquery/

11:57 dnolen_: noncom: no idea then, try on the ClojureScript ML as well

11:58 noncom: pbostrom: if i include it on my page, i get this: Uncaught TypeError: Cannot read property 'boxModel' of undefined, which I assume that I get because there is something wrong somewhere after i include it manually... Ithought jayq takes care, but nevertheless, manual way does not help much

12:00 dnolen_: google finds nothing on ClojureScript ML...

12:00 what is it?

12:00 dnolen_: noncom: sorry the ClojureScript google group

12:00 noncom: oh

12:00 ok

12:01 bbloom: ML = mailing list

12:03 pbostrom: noncom: my 2-cents is to simplify your setup: no GClosure optimization, include jquery lib externally in html script tag, once that is working, you can try to use advanced optimzation with externs

12:04 noncom: yeah, i guess, i'll go try variants...

12:04 Tuplanolla: It's possible to write a docstring for a namespace, but not read it?

12:06 jcromartie: I'd really like to contribute a recipe to the Clojure Cookbook. I won't lie… I'd really just like my name in that book. :)

12:06 Anderkent: ,(meta (find-ns 'clojure.core))

12:06 jcromartie: I've always been a fan of the Cookbook series

12:06 clojurebot: {:doc "Fundamental library of the Clojure language"}

12:06 Anderkent: Tuplanolla: ^

12:07 rkneufeld: jcromartie: An idea alone will garner you a place in the contributors listing ;) Though you're welcome to help more.

12:09 noncom: what jQuery version would you recommend to use with ClojureScript as of now?

12:10 dnolen_: rkneufeld: btw, have you tried the latest CLJS release, did that address the namespace keyword issue for you?

12:10 bbloom: noncom: whatever jquery version is recommended with google closure advanced optimizations, which i think is all the latest ones

12:11 noncom: bblom: the latest closure-ported is 1.9.1, but jQuery now has 2.x.x already.. I guess I'll use 1.9.1 then...

12:11 sry keyboard missyng keys

12:13 bbloom: noncom: i'm pretty sure jquery is maintaining both 1.9.x and 2.x.x simultaneously. the 2.x.x series is for reduced file size via dropping older browser support

12:14 noncom: bbloom: yeah, looks like.. also, their most recent 1.x.x is 1.10.1... but I think that would not change much for me, I need only basic functionality

12:14 jcromartie: rkneufeld: if I am ready to write a recipe, could I just do it, or do I need to have an accepted idea first?

12:16 noncom: turned out what: i was using the closure-adapted version for reference in the <script> tag, which is wrong - that thing is not jQuery at all. So I was misunderstanding what closure-enabled compilation is.

12:17 turns out that that thing is sorta meta for the actual js file

12:18 my another question: is there any automation tag available for project.clj so that it recompiles all cljs each time it recompiles it's own sources? currently i am keeping a separate 'lein cljsbuild auto' terminal around..

12:32 rkneufeld: dnolen_: I have not, I can't say I have ever installed from source locally.

12:32 jcromartie: You're welcome to write any recipe you please. (Was there something that gave you the impression you needed approval first - I'd like to remove it if there was)

12:32 dnolen_: rkneufeld: oh right, we haven't done a release that include that

12:33 jcromartie: rkneufeld: no, nothing indicated a need for approval, but there are no instructions for actually writing and committing a recipe

12:33 rkneufeld: jcromartie: I'll try to make that more clear then

12:33 jcromartie: rkneufeld: but I deduced it from the git log

12:34 i.e. make a directory /<chapter>/<recipe>/<recipe>.asciidoc

12:34 rkneufeld: jcromartie: Had you seen https://github.com/clojure-cookbook/clojure-cookbook/blob/master/CONTRIBUTING.md ?

12:35 jcromartie: rkneufeld: yes

12:36 rkneufeld: jcromartie: good to know, I'll make an issue for me to remember to fix that this week

12:36 jcromartie: rkneufeld: or I can take a shot

12:37 rkneufeld: jcromartie: For some reason I hadn't even considered contributions against the instructions itself ;)

12:38 gfredericks: AOT results in deps being bundled in your jar even when you're not uberjaring?

12:42 technomancy: gfredericks: this is why we don't AOT

12:42 in libraries

12:42 S11001001: gfredericks: only the compiled classfiles; lein has clean options

12:42 gfredericks: very good

12:43 so generating a class is unavoidable in this case I think. But I imagine I can keep the deps out via runtime loading

12:44 S11001001: I think it's :clean-non-project-classes

12:44 technomancy: yeah, but that has issues with protocols

12:44 better to resolve at runtime

12:47 jcromartie: rkneufeld: will both of these forms be accepted? /<chapter>[/<section>]/<recipe>/<recipe>.asciidoc OR /<chapter>[/<section>]/<recipe>.asciidoc

12:49 dnolen_: anyone use the ClojureScript browser REPL functionality without firing up a separate HTTP server?

12:50 jcromartie: dnolen_: is that possible without eval?

12:50 dnolen_: jcromartie: what do you mean?

12:50 rkneufeld: jcromartie: From Luke, "Right now it has to be /chapter/section/recipe/recipe. But that's not an inherent requirement; I could tweak the build script to recognize the simplified case and expand it to the "normal" case. But I want to make sure that reciples with additional resources (images, code, etc) have a tidy place to put it. A recipe without those is an exception, not the norm, from my point of view."

12:50 jcromartie: dnolen_: perhaps I misunderstood

12:51 dnolen_: you mean without a HTTP server to serve the HTML hosting the browser REPL… sorry

12:51 dnolen_: I'm mostly asking as cemerick has an interesting patch that greatly improves the browser REPL experience at the expense of breaking anyone who relies on the current behavior

12:51 jcromartie: yeah

12:51 jcromartie: rkneufeld: got it, that's what I thought

12:51 rkneufeld: both exist at the moment

12:52 malyn: dnolen_: I tried it for a bit, but ultimately found that Compojure + piggieback gave me more flexibility.

12:52 rkneufeld: jcromartie: It may be the case we've been lax in letting people submit without a subfolder. I *think* they won't actually render properly, so I'm going to make an issue to support both

12:53 dnolen_: malyn: thanks for the feedback, others?

12:53 jcromartie: yeah, but the canonical directory structure you just mentioned makes much more sense

12:57 rkneufeld: jcromartie: Good stuff, that's nice and succinct

13:20 Bronsa: ,(. (identity Object) toString)

13:20 clojurebot: "class java.lang.Object"

13:20 Bronsa: wut.

13:21 llasram: Bronsa: ?

13:22 Bronsa: oh nvm I'm an idiot.

13:31 Morgawr: dnolen_ (or any other clojurescript gurus), is there a way to use this https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply javascript function (the JS apply) inside clojurescript?

13:31 I tried using something like (.apply + [1 2 3 4 5]) and it returns 0

13:32 tomjack: why would you want to do that?

13:32 but you need to pass the 'this', try (.apply + nil [1 2 3 4 5])

13:32 dnolen_: Morgawr: you need to pass an *array*

13:32 tomjack: oh, heh, yeah

13:32 dnolen_: (.apply + (array 1 2 3 4 5))

13:32 tomjack: (.apply + nil (array 1 2 3 4 5)) ?

13:33 Morgawr: it doesn't seem to be working

13:33 (.apply + (array 1 2 3 4 5)) -> 0

13:33 (.apply + nil (array 1 2 3 4 5)) -> [1 2 3 4 5 6

13:33 ]

13:33 (well, without the 6 of course hehe)

13:34 dnolen_: Morgawr: + isn't a function in JS anyhow

13:34 Morgawr: so I don't really see the point

13:34 just use apply

13:34 Chousuke: Morgawr: if you just want to apply clojurescript functions, use apply

13:34 Morgawr: I just wanted to test the js version of "apply"

13:34 I don't want to use the clojurescript version

13:35 dnolen_: (.apply + nil (array 1 2 3 4 5))

13:35 Morgawr: okay, sorry nevermind, I used (array [1 2 3 4 5]), with (array 1 2 3 4 5) it works properly

13:35 dnolen_: Morgawr: ^

13:35 Morgawr: my bad :(

13:35 thanks dnolen_ and tomjack

13:36 dnolen_: Morgawr: it definitely needs to work for interop reasons

13:37 Morgawr: I assume the ClojureScript "apply" is mapped on top of the javascript apply for proper datatypes?

13:37 dnolen_: Morgawr: what do you mean?

13:38 Morgawr: ClojureScript only use primitive apply if there are not other options

13:38 Morgawr: yes, that's what I meant

13:41 dnolen_: I'm asking because I tried using (apply + (array 1 2 3 4 5 ...etcetc) ) and it is slower than using (.apply + nil (array 1 2 3 4 5 ...etcetc)), shouldn't ClojureScript be using the native apply instead?

13:42 dnolen_: Morgawr: no

13:43 Morgawr: if you need primitive apply use it

13:44 Morgawr: I'm not questioning the cljs implementation, I'm just curious. What is the advantage of using Clojure's apply on a native Javascript array instead of using Javascript's apply?

13:44 kyled2: i haven't used clojure script before, but maybe this has to do with types of variable? ie, a large number will overflow if using primitive +

13:45 dnolen_: Morgawr: apply is not as simple as it seems - if you want to understand you need to look at the implementation and consider both the semantics of Clojure and how we try to preserve it.

13:45 Morgawr: kyled2: the + (aka the function) is still the clojure one, I'm just talking about the way to apply it

13:45 kyled2: oh, my misunderstanding

13:46 dnolen_: malyn: neat post!

13:46 Morgawr: dnolen_: yeah, I'm reading the implemention, it's fairly complex. The overall difference I see in semanics is that the clojure apply is mapped on multiple non-vector arguments [f a b c d & args] whereas the javascript one is just (f [args]). Wouldn't it be better to map the clojure one on top of the javascript one taking care of putting the arguments inside a vector? (This is, for native javascript types like Array, not for other seqs which might be

13:47 malyn: dnolen_: Thanks! I really had a lot of fun working on that project. I can't wait to share the next article (almost written, just doing some editing..) on my REPL-oriented development flow.

13:47 dnolen_: Morgawr: what if you don't have an array

13:47 ?

13:47 Morgawr: you mean (apply + 1 2) ?

13:48 dnolen_: (apply + '(1 2))

13:48 `fogus: Morgawr: I wrote most of the apply functionality

13:48 Morgawr: well, as I said, I'd test for native javascript types and use the native implementation only on those (like Array)

13:48 `fogus: The biggest thing to be aware of is that Clojure's apply preserves laziness

13:49 dnolen_: Morgawr: we could check for that, but it's not a useful optimization for most ClojureScript programs

13:49 Morgawr: `fogus: can native javascript types be lazy in ClojureScript? I never really used actual Arrays before in CLJS so I don't know how they behave

13:49 dnolen_: Morgawr: if you want to use arrays, use .apply

13:49 Morgawr: yes, of course, I was just putting it there as a suggestion (or just wondering about implementation choices)

13:50 `fogus: Morgawr: Not that I'm aware of

13:50 Chousuke: Morgawr: everything that is "javascript" in clojurescript behaves exactly as it would in plain javascript

13:50 Morgawr: I'll wrap performance-sensitive parts of my code around (.apply ) using non-lazy datatypes (I don't need laziness in this part of my code)

13:51 the idea is, test if it's a lazy-seq, if it is not and it's a native Javascript type instead, use the native apply. If it's lazy or a clojure datatype, use what it's being used now

13:51 `fogus: In fact, the first versions of apply delegated down to .apply, but as soon as something lazy was passed you'd hit real issues

13:51 (the infinite kind)

13:52 Morgawr: yes, of course, but I think splitting the function in two parts would benefit performance

13:52 although I'd need to do proper benchmarking before saying more, really

13:52 Chousuke: have you actually found performance to be lacking?

13:52 `fogus: But wouldn't that check need to happen every time?

13:53 futile: ok

13:54 Morgawr: Chousuke: yes, I'm making a game in ClojureScript and I'm testing how many actors I can spawn on-screen, etc etc and it seems that most of the time is spent on apply (and apply-related functions, like partial) when the number of entities grows very large

13:54 obviously now I need to optimize that to use native javascript types

13:54 dnolen_: Morgawr: just to understand philosophically what we prioritize when we optimize - we want idiomatic Clojure to be fast in ClojureScript. for everything else we just make sure we don't get in the way - drop down if you need to.

13:54 Morgawr: also `fogus, I'd say a datatype test would be faster in the long run

13:55 dnolen_: I see, that makes sense

13:55 `fogus: Morgawr: You might be right, but like you said testing is in order

13:55 Morgawr: it's just a bit of a pain in the ass to wrap everything around native datatypes but I guess I can do that

13:55 Chousuke: Morgawr: using apply a lot might be a symptom, not the actual cause of slowness though.

13:56 hard to guess though

13:56 Morgawr: Chousuke: well, I'm using apply every update iteration of the main game loop to map logic with components, I can't really avoid it if I want to keep modularity

13:56 xeqi: rkneufeld: do you have any thoughts on whats desired for the testing section for cc?

13:56 rkneufeld: xeqi: nothing solid yet

14:00 dnolen_: Morgawr: also there may very well be performance bugs in apply, I've done a lot of work in making it faster

14:01 Morgawr: oddly in CLJS (reduce + ...) is faster than (apply + ...) on (into [] (range 1000000))

14:01 it's the opposite in Clojure

14:02 Morgawr: but in general I wouldn't use apply at all on the critical path

14:02 not even native apply

14:02 http://jsperf.com/function-calls-direct-vs-apply-vs-call-vs-bind/6

14:04 futile: technomancy: would you say that test2's spec strayed away from the simplicity we were all aiming for on that one fine day? https://github.com/evanescence/test2/blob/master/SPEC.md

14:04 perhaps I'm just crazy and it really is just fine

14:05 Morgawr: dnolen_: interesting stuff, I'll reconsider the structure of my code and see if I can optimize it further

14:07 technomancy: futile: maybe. the group stuff looks more complicated. it's hard to compare from the spec because people writing tests won't be using the spec; an apples-to-apples comparison only makes sense by looking at what actual tests look like

14:07 the data structures section looks solid

14:07 oh, except the :time field

14:07 you probably want to call that :duration

14:08 personally I don't get the point of :pending; that kind of stuff is handled nicely by TODO comments IME

14:08 but whatever

14:09 ohpauleez: I would rename it to :duration_ms

14:09 Bronsa: ew that underscore

14:09 arcatan: what does it mean for a test to be pending?

14:09 ohpauleez: sorry haha, I didn't mean that

14:09 TimMc: kebab case, please

14:09 ohpauleez: :duration-ms

14:09 technomancy: ohpauleez: ms is pretty much default for integer timestamps on the JVM though

14:09 Bronsa: :)

14:09 pepijnde-: TimMc, wat?

14:10 rurumate: I'm having a hard time getting started with typed clojure. This is my first attempt: http://pastie.org/8056377 Now the following line, in a unit test, should not compile, but it does. What's missing? (is (lines/lines-intersect? (lines/hline 0 1 1) (lines/hline 1 0 1)))

14:10 ohpauleez: technomancy: Totally agree, but with Java Time, it becomes ns resolution

14:10 technomancy: arcatan: yeah, IMO it doesn't belong in the results. it's not about whether the tests passed or failed; it's about whether the test or implementation is complete

14:10 TimMc: pepijnde-: ⟜-kebab-case-

14:10 technomancy: ohpauleez: Joda?

14:10 cemerick: wherefore are thou, units

14:10 ohpauleez: no

14:10 Java Time

14:10 in JVM 8

14:10 technomancy: oh, the new JSR

14:10 arcatan: technomancy: oh, right

14:10 TimMc: pepijnde-: As opposed to CamelCase

14:11 technomancy: ohpauleez: cool; I didn't know that

14:11 ohpauleez: cemerick: !!! it's been forever

14:11 pepijnde-: TimMc, yes, why is it called kebab?

14:11 TimMc: It looks like a shish kebab.

14:12 Albeit, a fairly poorly made one.

14:12 technomancy: futile: I thought you wanted to get rid of Definers in favour of just defn

14:12 are they optional?

14:12 cemerick: ohpauleez: what up!

14:13 technomancy: futile: the discover phase needs to be able to take args

14:13 futile: technomancy: i only put :pending in there because speclj (out of all 4 major ones) has that feature

14:13 technomancy: yeah, definers are optional, since you can just do (defn ^:test my-test-1 [] ...)

14:13 technomancy: cool; probably want to call that out

14:13 pepijnde-: TimMc, I would say sate-case, but I guess any things-on-stick work.

14:13 futile: technomancy: but definers are handy since people like me want to name them with strings, not symbols

14:14 technomancy: meh

14:14 TimMc: things-on-a-stick-case, I like it

14:14 futile: technomancy: and about the discoverer taking args: the discoverer is currently built into test2, and passed as an opaque function for the Runner to use

14:14 technomancy: in general calling out required vs optional helps describe the scope

14:15 futile: so it's a thunk you generate?

14:15 futile: technomancy: oh man, thunk takes me back to that week i spend playing with chicken scheme. this is all it is: https://github.com/evanescence/test2/blob/master/src/test2/run.clj#L28

14:16 technomancy: the reason for having the Discoverer built-in is so that peoples test suites remain mostly compatible with one another.

14:16 technomancy: if one person defined all their tests with (defn ^:test my-test[] ...) and another with (defn ^:spec my-spec[]...) then there'd be chaos

14:16 ie widespread incompatibility of things.

14:17 technomancy: I don't really see how that's your problem

14:17 I guess you're trying to do a lot more than just a next-gen clojure.test at this point?

14:18 futile: technomancy: my goal all along was to eliminate the problem that caused us to need four different auto-runners

14:18 https://github.com/slagyr/speclj/blob/master/src/speclj/run/vigilant.clj https://github.com/jakemcc/lein-autoexpect https://github.com/marick/Midje/blob/master/src/midje/repl.clj#L445 https://github.com/aphyr/prism

14:19 technomancy: but its super-related to clojure.test, whose goal seemed to be a simple but extensible testing lib.

14:20 technomancy: I suspect that the auto-run stuff can be handled in a way that treats tasks opaquely

14:20 futile: technomancy: in reality, if clojure.test was extensible in the way it needed to be, midje and expectations probably would have just been written as extensions to it in the first place

14:20 not that we could have known that at the time, these things only become known through experience and time

14:20 (ie nobodys fault)

14:21 cemerick: never underestimate what a programmer with free time will do ;-)

14:21 technomancy: sure; but that kind of thing could be done as a macro that emits a ^:test-tagged defn

14:21 futile: true

14:21 technomancy: it shouldn't stop you from standardizing on something more concrete

14:22 futile: technomancy: ok agreed. but im not really sure what you're ultimately saying

14:23 technomancy: then lets say test2 is just a successor to clojure.test and doesnt have any other goals.

14:23 technomancy: maybe replacing `lein test` would be more specific

14:23 since the selector stuff is in there too

14:24 anyway, I think you should describe how the args get to the discovery phase

14:25 futile: technomancy: oh yeah thats here:

14:25 technomancy: https://github.com/evanescence/test2/wiki#running-tests-from-the-command-line

14:25 most of that page talks about that.

14:26 technomancy: so why is a matcher different from a discoverer?

14:26 futile: technomancy: its really just part of the built-in discoverer. but even so, i dont know what you're suggesting

14:27 technomancy: its built into test2.run/-main, and i dont really know how to make that any more flexible while still being convenient.

14:28 asteve: does anyone have experience in making the vim-clojure-static plugin run only for clojure file types?

14:36 arcatan: asteve: as opposed to what?

14:36 futile: technomancy: oh I think I see the problem: it's not obvious that the spec is meant mostly for extension authors, people who want to write a new Definer or Asserter or Runner, etc, not really meant for everyday users.

14:37 technomancy: the wiki would be where everyday users would learn about (1) how to use the few built-in things, and (2) what extensions are currently available to do what

14:37 technomancy: futile: hm; yeah, I understand the need for the spec to be short and descriptive

14:38 asteve: arcatan: well, I develop in ruby and clojure and the indentation is not the same; if I enable the vim-clojure-static plugin it attempts to format my ruby files in clojure form

14:38 I'd like to turn on vim-clojure-static for only .clj filetypes

14:38 arcatan: asteve: oh, interesting. surely it shouldn't work that way.

14:40 asteve: https://github.com/guns/vim-clojure-static/blob/master/ftdetect/clojure.vim looking at this, it should auto-enable itself only for Clojure

14:41 asteve: hmmm

14:43 arcatan: asteve: if you open a ruby file, what does set filetype? say?

14:43 asteve: filetype=ruby

14:44 filetype=clojure, for .clj files

14:44 arcatan: yeah

14:49 patchwork: My project is suddenly failing to start!

14:49 jackson checksum?

14:49 Could not transfer metadata org.codehaus.jackson:jackson-mapper-asl/maven-metadata.xml from/to central (http://repo1.maven.org/maven2/): Checksum validation failed, expected c09b3634e82c52c906ef592e967ab609fbbcec62 but is 2a14c1a0b7c1ced8a9f78d8f68380ba3904829a2

14:49 What is up with that?

14:49 How do I start my project?

14:50 Also, why is it trying to download every version of every jackson jar? This is weird

14:53 Looks like cheshire was using version ranges

14:53 !!!

14:54 Raynes: Dear God, say it isn't so.

14:54 patchwork: Well, it isn't anymore

14:54 Raynes: When was it?

14:54 patchwork: But the version this old project has does

14:55 arcatan: asteve: unfortunately i don't have any great ideas, but hopefully you can figure it out

14:56 dakrone: patchwork: what? cheshire should never have been doing that

14:57 asteve: arcatan: ya, thanks, I need to get work done so I guess I'll revisit the problem in the future; I appreciate your help

15:02 wei_: how do I do this in clojurescript: window.location.hash = "";

15:07 Morgawr: wei_: require goog.dom and do (let [window (goog.dom/getWindow)] (set! (.-hash (.-location window)) ""))

15:07 at least, I think that's how it should work, I've never done nested .- assignments before, though

15:08 wei_: Margawr: thanks. there's no shorter way to do nested assignments?

15:09 bbloom: wei_: i think .. works

15:09 (doc ..)

15:09 clojurebot: "([x form] [x form & more]); form => fieldName-symbol or (instanceMethodName-symbol args*) Expands into a member access (.) of the first member on the first argument, followed by the next member on the result, etc. For instance: (.. System (getProperties) (get \"os.name\")) expands to: (. (. System (getProperties)) (get \"os.name\")) but is easier to write, read, and understand."

15:09 wei_: bbloom: oh cool, thanks

15:10 Morgawr: bbloom: does that work in cljs, though? I mean, isn't .- different from .?

15:11 (I never used .. before so I don't really know)

15:11 bbloom: (.. x -foo -bar) probably?

15:22 cemerick: dnolen_: re: match: if possible, it'd be nice if :else could be on any row. e.g. if the default case is very simple or a no-op of some kind, then having that up top can help with reading.

15:25 dnolen_: cemerick: I'm not sure I understand, putting an :else on any row will prevent anything below it from being tested

15:25 cemerick: also doesn't really line up with cond

15:26 cemerick: actually - I never tried that with cond

15:26 cemerick: so are you saying you do this w/ cond sometimes?

15:27 wei_: bbloom: (set! js/window.location.hash "") seems to work too

15:27 cemerick: dnolen_: no, not with cond; but, I almost always invert if to if-not if that'll put the shorter expression first

15:27 dnolen_: My core.match clauses tend to be *waaay* larger than anything cond I ever write :-)

15:28 bbloom: wei_: ehhh i guess that's fine. technically that isn't guaranteed to always work. enough people do it that it'll probably remain supported indefinitely, so i wouldn't worry about it

15:28 cemerick: s/anything/any

15:29 wei_: I like it because it looks cleaner. thanks for the disclaimer!

15:35 noncom: weavejester: hey, remember i could not imagine a use case for the otherwise wonderful concept library reagi? i think now i got one!

15:35 weavejester: noncom: Oh?

15:35 dnolen_: cemerick: I'm still missing what you're asking for, gist?

15:35 noncom: the trick was that the library presumes much stronger application components decoupling than i was using

15:36 i mean i think that it would be great for gluing application parts that are totally uncoupled

15:36 hoangelos: I have a clojure app I'm maintaining that's having trouble with it's interface to jsvc, and I'm not sure what to look for in clojure on where that might be done.

15:36 cemerick: dnolen_: (match [thing] :else thing ...match clauses per usual...)

15:37 futile: weavejester: I'm probably way off on this one, but could you just implement reagi's streams as a lazy-seq subclass, making all normal clojure.core/{map,reduce,etc} functions work with it?

15:37 noncom: for example, now i have the jme3 wrapper with the jme3 world running and i have a second "head" - a processing applet with a control panel for the world

15:37 it looks like better it would be separate programs, connected over udp or tcp

15:38 but i think that their communication bus is better made with something like reagi

15:38 weavejester: noncom: It does seem like a way of loosely-coupling components that would be strongly-coupled if callbacks were used.

15:38 jcromartie: My recipe is shaping up to be similar to another recipe, but it's substantially different. Should I edit the other recipe to make them both more relevant to each other?

15:39 dnolen_: cemerick: yes but I don't understand the point - is this for debugging?

15:39 patchwork: How do I prevent lein checking checksums? A jackson checksum is busted and it is bringing down my whole project

15:39 noncom: yeah, right! and if i later split them for network then still reagi concept holds. although it would have to implement networking implicitly

15:40 amalloy: patchwork: what if it's busted because someone hacked maven and installed malware on top of jackson?

15:40 cemerick: dnolen_: solely a readability preference

15:40 dnolen_: cemerick: oh, no way :)

15:40 patchwork: amalloy: Sure, so how do I start my project?

15:40 weavejester: futile: I don't think so… because seqs block when they run out of data

15:41 amalloy: patchwork: depend on a working version of jackson instead of a possibly-compromised one?

15:41 futile: weavejester: oh

15:41 cemerick: dnolen_: well, see, if I fessed up about that _all_ the time, then I'd never be able to slip stuff by sometimes ;-)

15:41 dnolen_: cemerick: pattern matching is top down left right - and the point is to more or less follow cond & case

15:41 patchwork: amalloy: I am not depending on it, three different libs are depending on it (according to mvn dependency:tree)

15:41 dnolen_: cemerick: good try :D

15:41 hiredman: patchwork: what checksum? if it is the md5sum the most likely thing is you have a corrupted download in your .m2, have you tried clearing jackson out of your .m2?

15:41 patchwork: (not depending on it directly I should say)

15:42 hiredman: I cleared out my .m2, same issue

15:42 weavejester: noncom: Networking implicitly?

15:42 futile: weavejester: but the subclass would return nil if it has no new events, an event if it has one, etc, and just keep pretending it has more? oh never mind theres probably a lot more to it than i can see from here

15:42 hoangelos: jsvc and clojure anyone?

15:42 hiredman: hoangelos: there is no verb in that question

15:42 cemerick: dnolen_: the idea came after squinting hard at a long match form that had an :else clause as well as a bunch of conds for different patterns that also had :elses.

15:43 futile: this wikipedia article seems to indicate that the purpose of wikipedia is to give future survivors the ability to reproduce 2010 in its entirety if it comes down to it: http://en.wikipedia.org/wiki/Final_(Java)

15:43 amalloy: (inc hiredman)

15:43 lazybot: ⇒ 17

15:43 noncom: weavejester: well, i might be missing something, but seems like theoretically nothing holds against making reagi network-capable.

15:43 alandipert: anyone have an example of how to AOT an ns w/ lein, but just for tests?

15:43 cemerick: just FYI :-)

15:43 weavejester: futile: That would break the contract seqs have, if a seq's tail could change

15:43 futile: weavejester: ah, i see.

15:43 hoangelos: hiredman: asked a question with a verb already. I'll ask it again. I need some guidance to know if 1) clojure has a jsvc interface 2) how do you implement it.

15:43 cemerick: alandipert: you want the test ns AOT'd, but nothing else?

15:44 weavejester: noncom: No, definitely not. I think you could easily feed an event-stream into a TCP socket with a small protocol.

15:44 alandipert: cemerick: correct, want to test what java* expands to when it's used in an ns that gets AOT'd

15:44 hoangelos: hiredman: have an app for my dayjob in clojure and it's apparently answering start() requests just not stop(), so we're trying to figure out where to add the stop() code.

15:44 hiredman: patchwork: if you specify a specific jackson version in your project.clj it should take precedence over whatever other versions specify, but I would recommend instead tracking down what is causing the checksum failure

15:44 alandipert: cemerick: or rather, test the implementation of that expansion

15:44 weavejester: noncom: I mean, there's definitely nothing stopping you :)

15:44 alandipert: cemerick: java* does different stuff at macro time when clojure.core/*compile-files*

15:45 hiredman: hoangelos: "clojure" the programming language does not have a jsvc interface

15:45 cemerick: alandipert: hard. Lein has the AOT-without-non-project-namespaces thing, which you might be able to adapt? Nothing out of the box, tho.

15:45 hiredman: hoangelos: but you app may have a custom one, or may be using a library someone wrote to provide one

15:45 patchwork: hiredman: The jar that is posted on maven central for that version is empty

15:46 futile: irc is addicting

15:46 hiredman: hoangelos: so you'll need to find that custom code or library

15:46 futile: must.. get.. free!

15:46 hiredman: patchwork: :(

15:46 patchwork: what version?

15:46 patchwork: hiredman: How do I fix that?

15:46 hoangelos: hiredman: thanks

15:47 noncom: weavejester: i think, i will take on this when it comes to that point in my app. pretty interesting thing, yeah. i always liked being free when distributed, like with nrepl. and when i'll need that functionality, then reagi base will suit not to start from the ground..

15:47 hiredman: patchwork: I think I already said something about "if you specify a specific version..."

15:47 alandipert: cemerick: sounds trixty. i'm now more confident that it works ;-)

15:47 cemerick: alandipert: Automated user testing'll smooth it out.

15:47 hiredman: patchwork: but regarding maven central maybe get up in their face on the jackson mailing list?

15:48 noncom: at least it will help me stick to the concept coz otherwise i am very prone to impurities

15:48 we'll see..

15:48 * alandipert ponders a lein-turk plugin

15:48 amalloy: futile: <3 applyconcat.com

15:49 it should provide some examples of flatten-gone-wrong, and apply-concat used where mapcat should have been used instead

15:50 weavejester: noncom: I'm still experimenting with it myself. It's requiring me to think a little differently about how I structure things, but I'm at the point where it seems like I understand enough for it to seem beneficial.

15:50 futile: amalloy: user-editable repository of bad clojure sounds fun

15:50 know of any pre-made tools i could use for this off-hand?

15:51 amalloy: futile: http://www.wikipedia.org/

15:51 futile: sadly i'd probably have to write it in sinatra so that it would be fast on a free heroku instance

15:51 gfredericks: amalloy: did you know about http://dev.clojure.org/jira/browse/CLJ-1218?

15:52 amalloy: or, really, https://github.com/ztellman/lamina/wiki

15:52 futile: amalloy: actually sounds like you're just describing refheap.com

15:52 amalloy: gfredericks: i was. i was going to mention it to you last night when you were running into problems with it, but i was busy

15:53 noncom: weavejester: what helped me personally is to think on a different scale, a greater scale. greater systems definitely benefit from this much much more. something like erlang actors come to mind. i mean.. this kind of bus it provides - it best used among highly isolated elements, which is usually the case of big systems

15:55 weavejester: noncom: To me it seems to work on the small scale as well.

15:55 noncom: Like, I have a GUI window for picking resources to place down in the world

15:56 noncom: Clicking on a resource does two things: change the player's currently selected resource, and close the window (i.e. shift the game state from resource-choosing to resource-placing)

15:56 gfredericks: amalloy: I feel like concat being variadic is just awkward in the first place

15:57 weavejester: noncom: Normally I'd have one callback do both those things

15:57 amalloy: gfredericks: well, you want it to be variadic, you just don't want the performance optimization that depends on knowing how many sequences it's getting

15:57 weavejester: noncom: But Reagi forces me to separate them into two streams

15:58 noncom: At first it seemed a huge pain, but then I started noticing benefits to how my application was structured.

15:59 noncom: Because everything is very isolated, the structure is very flat and easy to extend.

15:59 hoangelos: what about integrating a clojure app with windows via procrun? Does anyone have examples of what needs to be done to implement a hook for procrun in clojure to get windows service to start and stop a clojure app?

16:01 noncom: weavejester: indeed, but i guess that it is you who thinks more in a functional/pure way than me. my pov is that this measure of decoupling that it enforces makes two what was one before. i see the same thing you do, but coming from a different direction.

16:02 weavejester: noncom: I definitely see a lot of parallels with imperative vs. functional, when comparing callbacks vs. FRP

16:02 Which now that I say it, kinda sounds obvious :)

16:05 noncom: weavejester: it's funny :) collecting understandings of other people helps building an active base for a concept. great now that you share your vision - since i did not see it like this before.

16:18 futile: Does it make sense to write for javascript being disabled anymore, when your audience is mostly technical users and some business types?

16:26 technomancy: aren't technical users the most likely to disable js?

16:27 callen: technomancy: yeah, that's also why nobody cares.

16:27 technomancy: because it's not like they don't know how to enable it again.

16:27 technomancy: "Oh, he's a programmer, so he's probably not blind I guess"

16:27 callen: futile: assume JS, but don't be one of those jackasses where the content can't get loaded without JS.

16:27 futile: it's pretty stupid not to render content-oriented pages without the content.

16:28 technomancy: I'm an advocate of progressive enhancement, meaning the content comes with the initial page load, not an async JS fetch.

16:28 technomancy: but that doesn't mean not using JS at all.

16:28 technomancy: I agree

16:28 callen: having said that, progressive enhancement only makes sense with content-centric pages.

16:28 if it's an "app", that goes out the window.

16:29 futile: another thing to consider is that mobile clients are increasingly popular, on those platforms the number of HTTP requests are what are punishing on those connections. Forcing another HTTP call to get the content independent of the original page in JS is going to be slower than just sending a static page.

16:30 futile: trouche

16:30 tupi: how do i get the length of a list ?

16:30 futile: i like github's new look, came out a few days ago

16:30 callen: tupi: did you even google?

16:30 futile: tupi: ##(count [1 2 3])

16:30 lazybot: ⇒ 3

16:30 tupi: (length '(1 2 3))

16:30

16:30 hyPiRion: tupi: count

16:30 futile: callen: yes he probably did

16:31 amalloy: $findfn '[a b c] 3

16:31 callen: I sincerely doubt it.

16:31 lazybot: []

16:31 tupi: i did, and it's named length in lisp/scheme since ever i programmed :)

16:31 amalloy: wtf lazybot

16:31 callen: first result on Google: http://stackoverflow.com/questions/8632495/clojure-length-of-sequence

16:31 futile: callen: give people the benefit of the doubt in the most charitable spirit, and things will go well

16:31 hyPiRion: callen: Now, now, this is not the way to introduce new Clojurians to #clojure.

16:32 amalloy: Raynes: did findfn break recently? he's just been returning [] for a while

16:32 hyPiRion: $findfn [1 2 0] 3

16:32 lazybot: [clojure.core/count]

16:32 callen: amalloy: not for hyPiRion apparently.

16:32 Raynes: amalloy: I'd hope not, since none of that has changed at all.

16:32 tupi: it's fine, all i need is some few boostrap quick answer, tx all

16:32 callen: $findfn [1 2 3] 6

16:32 futile: hyPiRion: callen's probably just distracted, he probably would normally introduce them gentler

16:32 lazybot: []

16:32 callen: actually I know of a lisp comparison cheatsheet that would help

16:32 h/o

16:33 hyPiRion: amalloy: I think it's doing (= (??? '(quote [a b c])) 3) i.e. not evaling the args

16:33 callen: tupi: http://hyperpolyglot.org/lisp

16:33 tupi: tx

16:33 callen: tupi: you can reference whatever lisp or scheme you're familiar with, then contrast with Clojure.

16:33 amalloy: hyPiRion: i don't remember it implicitly quoting before, though

16:33 hyPiRion: $findfn [1 2 0] '3

16:33 lazybot: [clojure.core/count]

16:34 hyPiRion: huh.

16:34 amalloy: and i wrote the dang thing

16:34 tupi: neet i'll had a guile column

16:34 malyn: I tried to use findfn on my local machine the other day and it returned nothing (and then the next call was a SecurityException, I think?). Do I need some other prereqs on my machine before using it..?

16:34 callen: how did it...oh right.

16:34 malyn: config maybe?

16:34 hyPiRion: amalloy: humm, look at this

16:34 $findfn '[a b c] 3

16:35 callen: malyn: it has a sandbox that needs perms I think.

16:35 lazybot: []

16:35 hyPiRion: $findfn '[1 2 0] 3

16:35 lazybot: [clojure.core/count]

16:35 callen: trippy.

16:35 TimMc: technomancy: I bet these folks would like to use Syme: http://instantserver.io/

16:35 malyn: callen: Ah, okay, that sounds right based on what the exception was telling me. How do I set up the sandbox?

16:35 callen: malyn: I don't actually have answers, I just make vague guesses on IRC that are right 80% of the time.

16:35 malyn: but I make an excellent rubber ducky.

16:36 malyn: I moonlight as a zen master.

16:36 futile: hmm what's a better idea for applyconcat.com?

16:36 mindbender1: how do I get cljs compiler to re-read my macros file? I suspect the momoize function in cljs.closure is inteferring somehow. This has bitten me before.

16:36 callen: futile: what is applyconcat.com?

16:37 futile: (1) not a blog, nobody reads blogs (2) not refheap, that exists already

16:37 callen: just a domain i bought cuz (apply your-fn (apply concat my-args)) is ugly

16:37 TimMc: &(slurp (java.net.URL. "http://applyconcat.com/&quot;))

16:37 lazybot: java.security.AccessControlException: access denied (java.net.SocketPermission applyconcat.com:80 connect,resolve)

16:37 TimMc: ah well

16:38 malyn: Hmm... the first invocation returns an empty list and then the second one throws an AccessControlException (createClassLoader).

16:38 futile: (3) not a cheatsheet for clojure, that already exists (4) not a public wiki for clojure, nobody likes wikis (5) maybe an updated clojuredocs.org?

16:38 mindbender1: I had to maunally turn the darn thing off

16:38 TimMc: futile: An email domain.

16:39 futile: no, everybody uses @gmail.com

16:39 except kids who use @yahoo.com and grandmas who use @sbcglobal.net

16:40 amalloy: hyPiRion: i bet Raynes broke it when he extracted findfn from lazybot into its own library. i can't tell quite what the problem is, but https://github.com/Raynes/findfn/blob/master/src/findfn/core.clj#L39-L41 looks like in and out are being treated differently

16:40 TimMc: futile: gmail.com is the next hotmail.com

16:40 futile: TimMc: and the last one

16:40 callen: futile: I am the only person that likes wikis. dafuq.

16:41 amalloy: it looks to me like input args are being eval'd, but output args aren't. except that doesn't seem to match up with lazybot's actual behavior

16:41 TimMc: I don't understand why people *like* locking their identity to a free service that could go away at any time.

16:41 futile: TimMc: cuz it works perfect for what you need. thats why @hotmail.com died out, cuz it sucked. gmail doesnt.

16:41 callen: futile: Updating clojuredocs.org is already a project, you should contribute to that.

16:41 futile: TimMc: because (1) its free, (2) its not going away any time soon, (3) if it does go away something just as good or better will come along and probably still be free

16:41 callen: sure, but that doesnt solve the problem of having an empty domain

16:41 TimMc: And then you lose your email address.

16:42 jcromartie: callen: do tell me more...

16:42 ToxicFrog: TimMc: because the alternatives are (1) lock your identity to a pay service that could go away at any time or (2) host your own domain and email server

16:42 futile: TimMc: oh well. happens.

16:42 ToxicFrog: which, you could lose at any time.

16:42 TimMc: That's such a weird attitude.

16:42 Bronsa: TimMc: I doubt gmail is going to disappear any time soon.

16:42 futile: TimMc: permanence is just an illusion

16:42 technomancy: once Google turns evil you won't need an email address anyway

16:42 callen: jcromartie: https://github.com/clojuredocs/ <--- futile

16:42 technomancy: we'll be back to telegraph

16:42 callen: technomancy: not very cyberpunk of you.

16:42 TimMc: ToxicFrog: Nonsense, brainonfire.net delegates its MX records to cotse.net. In the past it delegated to lavabit, and before that to gmail.

16:42 Painless transition, too.

16:42 jcromartie: callen: specifically clojuredocs2?

16:42 technomancy: callen: I'm more steampunk

16:43 callen: technomancy: if Google turns evil, we'll make our own virtual-verse with virtual-couriers!

16:43 jcromartie: I'm not specifically anything, that's just the extant clojuredocs replacement project I'm aware of.

16:43 hyPiRion: technomancy: I'll just query the NSA database, so whenever you need me, just call someone (doesn't matter who) and tell me what to do.

16:43 futile: TimMc: your own servers will eventually break or go away or you'll just stop wanting to support them.

16:43 TimMc: I don't have servers, silly.

16:43 callen: far as I know, it's abandoned, but somebody could pick it up and take it the rest of the way.

16:43 futile: TimMc: free servers will eventually go away and be replaced by other ones

16:43 TimMc: That's what DNS is for.

16:43 futile: TimMc: pay servers will too

16:43 technomancy: futile: MX recoooooords

16:43 futile: TimMc: dns will eventually go away

16:44 TimMc: futile: I don't think you understand internet.

16:44 futile: TimMc: in 2070 the internet will be way different

16:44 hyPiRion: human speech will eventually go away

16:44 technomancy: as long as I can still connect to freenode I'll be happy

16:44 futile: hyPiRion: not in our lifetimes

16:44 hyPiRion: we won't need it anymore, so why bother

16:44 antares_: futile: we as species may or may not exist by 2070

16:44 philandstuff: i remember when the internet was all fields

16:44 futile: technomancy: you mean "as long as i can chat with people i know".. who cares what software it uses?

16:44 mikerod: ,(inc antares_ )

16:45 jcromartie: philandstuff: before they paved paradise.com and put up a parked domain?

16:45 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: antares_ in this context, compiling:(NO_SOURCE_PATH:0:0)>

16:45 Morgawr: dnolen_: I was reading the clojurescript implementation of "into-array", basically it's either [aseq] (1 param) or [type aseq] (2 params) but in the case of 1 parameter it just calls (into-array nil aseq) and the version with 2 parameters doesn't use the first one, why is that?

16:45 futile: technomancy: ircds are a thing of the past man, ____ is where its at in 2050

16:45 etc etc

16:46 all im getting at is that yes, im locked into gmail. but who cares, we're all locked into all the things we need. you're locked into unix-based OSes and elecrtronic vehicles etc

16:46 antares_: by the way, I was *just* talking to the author of the new clojuredocs.org about what's left to be done

16:46 futile: but my point is boring so bye

16:46 antares_: and as I learn more specifics, I will write a blog post

16:46 futile: nobody reads blogs

16:46 Bronsa: I do

16:46 hyPiRion: ^

16:46 futile: i wrote tons of useful, smart blogs, and nobody read them.

16:46 antares_: futile: you are too hip to talk to, bye-bye

16:46 clojurewerkz.org maintainers decided to suspend new projects and work on reviving clojuredocs.org next

16:46 futile: tons of people write smart useful blogs and i never even find out they exist.

16:47 antares_: we will see how much work it turns out to be

16:47 * futile will shut up now

16:47 antares_: but since it's Clojure codebases now we will probably get some help

16:47 well, probably very little since nobody reads blogs ;)

16:48 jcromartie: antares_: where does the new work happen?

16:48 antares_: jcromartie: github.com/clojuredocs

16:49 I am trying to rename repos to be more descriptive

16:49 jcromartie: yes but WHICH ONE

16:49 ok

16:49 callen: dude, I just sent you that.

16:50 jcromartie: clojuredocs2, it says in the desc: "Next-gen clojuredocs importer, API, and website.

16:50 jcromartie: that's what I thought, but the last commit was 7 months ago

16:51 antares_: jcromartie: how about now? https://github.com/clojuredocs/

16:51 callen: jcromartie: I was equally dubious, but apparently, I didn't "understand OSS"

16:51 antares_: jcromartie: so what?

16:51 jcromartie: there we go :)

16:51 antares_: jcromartie: should we all just give up and live with the 1.3-locked clojuredocs.org we have today?

16:51 jcromartie: or should we do something about it?

16:51 callen: I don't think that's the only alternative to an abandoned website.

16:52 antares_: I did not say it is the only one

16:52 but I'm going to work on this one

16:52 jcromartie: antares_: of course not, but it sounded as if the work to replace Clojuredocs was active and ongoing

16:52 antares_: jcromartie: well, I just talked to the person who left it off 6 months ago

16:52 jcromartie: OK that makes more sense

16:53 antares_: I can't jump writing code immediately because I have no idea where things stand

16:53 futile: why isn't clojuredocs.org updated to clojure5?

16:53 \cc callen

16:53 callen: Clojure 1.5*

16:54 futile: yeah that.

16:54 antares_: futile: because as it is written, it makes it really hard to reimport new functions for another version

16:54 futile: antares_: oh so it needs a rewrite?

16:54 callen: lolwut

16:54 * callen nopes the fuck out

16:54 futile: dang. i just wrote about rewrites being a bad idea on my blog that nobody ever looks at: https://gist.github.com/evanescence/5801213

16:54 callen: trap spider project.

16:55 antares_: futile: it needs a proper metadata import tool (so you can import stuff from a given Clojure release)

16:55 jcromartie: futile: I can't read your blog because I'm not cool enough

16:55 futile: jcromartie: quite the opposite: you're too cool.

16:55 jcromartie: oh well that's good news

16:55 futile: everybody's too cool to read my blogs.

16:55 antares_: if you realize a project has a lot of limitations, a rewrite is fine

16:56 also, clojuredocs.org today is a rails app

16:56 futile: whoa

16:56 antares_: I'm sure most of Clojure community members dream of hacking on an ancient rails app

16:56 jcromartie: futile: is your blog just that Gist?

16:56 antares_: but apparently not everybody

16:56 futile: jcromartie: it is now

16:56 antares_: so maybe doing it in Clojure would attract a few more hands

16:56 futile: it used to be real blogs at applyconcat.com

16:56 but nobody read them so

16:56 no point keeping them up for nobody to ever read.

16:57 callen: futile: dude, stop talking about yourself/your blog.

16:57 clojurebot: borkdude: but Fay is the hot thing atm

16:57 antares_: jcromartie: so, if you are interested in helping out, we can continue in #clojure-doc

16:57 futile: callen: fine

16:57 hyPiRion: futile: http://nathanmarz.com/blog/you-should-blog-even-if-you-have-no-readers.html

16:57 llasram: Man, I cannot get around this "blog" == "blog post" lingo. I realize it's an actual active usage, but just sounds weird to me

16:57 Roxxi: Is there a library that acts as a equivalent to Ruby's configliere library (to read batches of yaml files?)

16:57 futile: hyPiRion: says that guy, with a blog nobody reads.

16:57 callen: llasram: post to a blog, a blog post is a noun, blog is a verb and a noun.

16:58 technomancy: Roxxi: carica and environ are your best choices

16:58 callen: hyPiRion: he doesn't know who Marz is, give up.

16:58 dobladez: ,(rand-nth ['environ 'configleaf 'reconfig 'cconf 'clj-configurator 'milieu 'carica 'nomad 'clonfig])

16:58 clojurebot: milieu

16:58 Roxxi: Thanks technomancy!

16:58 technomancy: err--carica if you specifically want files

16:58 dobladez: Roxxi: pick one of the above :-)

16:58 hyPiRion: futile: That is an ad hominem, I think it would be wiser to explain why one disagree with what he states.

16:59 futile: hyPiRion: wisdom is not my forte

16:59 technomancy: at least he's honest

16:59 hyPiRion: It is not too late

16:59 Quick, to the knowledge tower

16:59 futile: hyPiRion: heh, no. fearing God is the beginning of wisdom.

17:00 * futile slowly backs out of the room, being the sole theist in here

17:01 technomancy: technically there's no rule that says you can't do that in the tower

17:01 hyPiRion: futile: I know there are more theists in here

17:01 amalloy: i agree with nathan, really. for the few months i was actually blogging things, it helped me get a better understanding of the things i was writing about

17:01 technomancy: amalloy: not to mention getting better at writing itself. which is hard.

17:02 futile: (1) writing makes you more arrogant, because you start thinking you know something somebody else doesn't, which is never true

17:02 callen: says the guy from a religious tradition of scribes.

17:02 futile: (2) writing wastes time, because almost always, somebody else already wrote about it and better than you have

17:02 amalloy: futile: you sure you haven't already topped out on (1)? you've decided you're better than everyone who blogs

17:02 technomancy: yes, although i like to think i'm quite good at writing

17:02 callen: can we stop talking about blogs and personal stuff that doesn't matter?

17:02 technomancy: amalloy: well you won't stay good if you don't practice

17:03 amalloy: true

17:03 futile: (3) even if you passed #1 and #2, you're probably trying to convince someone of something anyway, and people dont like being convinced so its a waste of time

17:03 amalloy: technomancy: i usually include an entire novel in every github issue/pull-req/commit-message

17:03 futile: amalloy: im better than nobody, and im sorry if ive ever gave the impression i think otherwise

17:04 the only way ive gotten better at writing is by writing emails to my boss who (1) knows more than me, (2) doesnt have time to read emails, (3) doesnt care about most of the stuff i have to say.

17:04 that helps me really get to the point.

17:04 oh and writing documentation for my OSS projects, for mainly the same reasons.

17:04 callen: futile: you should spend less time on IRC and more time coding.

17:04 futile: callen: noted

17:05 if i had written this in a blog instead of irc, nobody would have read it, even though i think its useful. at least this way they did.

17:05 oh wait, i fell into #1 and #3 just now. crap.

17:05 brehaut: far out is (1) wrong. the single hardest thing about blogging is getting over the fact that knowing that everyone already knows what i am are about to write about, and actually writing it

17:06 futile: brehaut: maybe that just means you're wrong about #1, not #1 being wrong: maybe you should stop blogging

17:06 technomancy: protip: preface every blog post with "I'm writing this primarily so I can look back on it five years from now and get a hearty chuckle. That said [...]"

17:06 callen: sometimes some unique details and twists come through anyway - those can end up rescuing somebody searching for an answer to something.

17:07 futile: anyway this has been the little wisdom i have, if any.

17:07 so whatever. take it or leave it.

17:07 brehaut: technomancy: time to backroynm 'blog'

17:07 puredanger: I regularly google something and find the answer in a blog post I wrote 3 yrs earlier and forgot about

17:07 so clearly my blog has been of value to my future self

17:08 amalloy: puredanger: that was why i started blogging: someone said to regard it as a (public) note to my future self

17:08 callen: puredanger: I've done that before. deeply satisfying.

17:09 puredanger: I knew to check my own blog though because I remember I'd written it.

17:09 remembered*

17:09 puredanger: apparently my memory is even worse than I thought it was :)

17:09 callen: puredanger: more likely, you have a larger surface area

17:09 puredanger: I don't blog often.

17:09 amalloy: mostly my blogs haven't helped me personally, but i can often answer someone's question with, eg, $google amalloy blog-title, instead of composing a fresh new answer

17:10 callen: amalloy: keep going that route and you'll end up like tokenadult on HN.

17:11 hyPiRion: alias amalloy stackoverflow

17:11 Except I expect a better written question/problem from amalloy

17:12 callen: hyPiRion: Except

17:14 weavejester: do you blog?

17:15 brehaut: callen: http://www.booleanknot.com/blog/

17:17 callen: brehaut: I know his brand, I was being silly and including him on the earlier convo.

17:17 amalloy: speaking of useful blogs, brehaut's blogs are well worth reading

17:18 brehaut: thanks amalloy

17:18 callen: brehaut: liiiiiiiink?

17:18 brehaut: http://brehaut.net/

17:18 hyPiRion: well that was surprising. I thought it would end it .com

17:19 s/end it/end in/

17:22 tomjack: hmm, I wonder if it is normal for the yourkit UI to lock up completely on a cpu tracing snapshot, pegging a core

17:23 futile: i find blogs useful for learning what people generally think

17:25 like, as a whole.

17:26 for instance, a very small but growing group of python users is switching to golang and advocating it as the future. a very small but growing group of ruby users are switching to clojure and saying its the future, but many are still using it like it's ruby.

17:26 and a huge minority is still saying erlang/haskell/CL is where it has been at, is at, and will continue to be at so just shut up and join us

17:27 callen: futile: why don't people like wikis?

17:27 futile: i learned all this by reading blogs.

17:27 callen: i dunno, people mostly just use it as read-only instead of read/write

17:28 callen: it's fine if most people use it was read-only, as long as the ability to contribute exists for those that care.

17:28 use it as*

17:28 futile: ok

17:28 callen: I guess what I don't understand is how reading a wiki harms the reader.

17:28 or for that matter, the contributor.

17:28 futile: callen: it probably doesnt

17:29 who said it does?

17:29 callen: so where does the opposition to wikis come from?

17:29 futile: Everybody I've mentioned my idea for a clojure wiki to has been hostile.

17:29 futile: which is particularly strange given that there's EmacsWiki and a lot of people in clj should be familiar with how useful that is.

17:29 futile: callen: i hate emacswiki

17:29 callen: then again i liked wikemacs

17:29 callen: really? it's been a lifesaver for me again and again.

17:30 ah well. that aside.

17:30 futile: granted, i used emacswiki over and over to pull little snippets out of

17:30 callen: Right, see?

17:30 futile: but it was the wrong tool for the job.

17:30 callen: and there's a lot of surface area to Clojure that could be covered with a wiki.

17:30 futile: i hate it on principle. if they had done it right in the first place we wouldnt need an emacswiki

17:30 callen: you're really just convincing me I should put up that wiki.

17:30 futile: callen: melpa + github is a way better solution for most tweaking.

17:30 callen: package management wasn't standard until very recently.

17:31 for years everybody had to rely on the wiki.

17:31 futile: callen: i guess the few things left that emacswiki has that cant be repos could probably be in a wiki

17:31 like wikemacs

17:31 callen: ok here

17:31 ill give you applyconcat.com

17:31 callen: EmacsWiki isn't exclusively about stashing code, it's about discussing and documenting too.

17:31 futile: then you can put up a wiki on it for clojure

17:31 callen: futile: I don't think there's any need for that, I own clojurewiki.com lol

17:31 futile: fff

17:32 tomjack: hmm, yourkit shows a very deep tree of just -incs

17:32 I wonder if this is normal divergence due to a bug or a perf problem ala gfredericks

17:32 callen: tomjack: submit a bug report?

17:33 amalloy: i'm just going to start calling all my performance problems "an instance of the gfredericks problem"

17:33 futile: callen: im the wrong person to get feedback on ideas. everything i say is wrong.

17:33 the only expertise i have is in being wrong.

17:34 tomjack: I wonder if there is anything that can be done to make profiling core.logic programs easier

17:34 technomancy: "one wiki good; two wikis baaaaaad"

17:34 dnolen_: tomjack: I wonder that sometimes too

17:34 Bronsa: (what is the gfredericks problem?)

17:35 callen: technomancy: there is no wiki at present.

17:35 technomancy: JIRA doesn't count!

17:35 tomjack: Bronsa: in certain cases where -inc is unnecessary, it causes really bad performance

17:35 amalloy: Bronsa: i think it refers to an issue he discovered where core.logic's fair-something-or-other converts DFS to BFS, leading to exploring more branches of a tree than necessary?

17:36 dnolen_: amalloy: the characterization isn't *quite* accurate ...

17:36 technomancy: callen: fair. I like the contribution style of clojure-docs.org though

17:37 callen: technomancy: you mean clojure-doc.org?

17:37 technomancy: two clicks to merge a no-brainer change; more involved changes have a discussion around them in the pull request

17:37 tomjack: similarly core.async go-blocks should be interesting to profile :(

17:37 technomancy: callen: you know, that thing what my browser auto-completes to when I start typing what I mean

17:37 callen: technomancy: I'm not a fan of adding that much friction.

17:37 tomjack: feels kinda like we need some meta-profiling tool which lets us stick our own notions of 'method' in

17:38 profiling/debugging

17:38 technomancy: callen: ironically there's a bunch of gunk on the official wiki's Emacs article I can't delete because it allows anonymous comments

17:38 they didn't really make sense back then, but now they're even more nonsensical because they're all about slime

17:39 mindbender1: modernize

17:39 dnolen_: imagine a recursive goal conde with 3 branches that all succeed

17:39 by the time you've called it recursive 20 times you have 3^20 leaves to explore

17:40 callen: I can't believe I'm saying this, but I'm eye'ing zip-select enviously.

17:40 technomancy: that's sorta why I want a pure wiki, so things can be edited and renewed

17:41 technomancy: no comments or anything else, pure wiki.

17:41 technomancy: callen: talk pages suck compared to pull requests though

17:41 well, talk pages can be hilarious

17:41 dnolen_: so the -incs are only bad if you know you have a small finite space to explore and you need to make many recursive calls

17:41 as is the case when enumerating finite domains

17:42 technomancy: but not great for following a contribution as it matures

17:42 tomjack: know any tricks for debugging divergence?

17:42 callen: technomancy: I'm not saying a pure wiki is ideal in all capacities, but I think it fits a use-case that isn't being served very well.

17:42 dnolen_: I'm not sure gfredericks result means much for other core.logic programs

17:42 callen: technomancy: I'm open to refinements upon things like talk pages.

17:42 technomancy: what's missing?

17:42 tomjack: I tend to stick trace-s in blindly in an attempt to figure out what is diverging, then have to kill the jvm because there's so much useless output flooding emacs

17:43 dnolen_: tomjack: yeah nrepl kinda sucks for debugging this, SLIME was better

17:43 callen: technomancy: low friction accumulation of collective knowledge

17:43 tomjack: luckily I am in slime still :)

17:43 dnolen_: nrepl becomes unresponsive when there is a lot of printing

17:43 tomjack: heh nice

17:43 callen: technomancy: there's a lot of stuff that gets tossed around here, sometimes reptitively, that isn't getting retained.

17:43 tomjack: but still have to kill the JVM sometimes :(

17:43 * Bronsa still uses slime too

17:43 technomancy: callen: what topics?

17:44 dnolen_: tomjack: hmm, I don't really have general advice on tracking divergence - I've just learned what to look for

17:44 callen: technomancy: zippers could use a more elaborate "tour". There are recurring subjects on here that merit getting retained.

17:44 dnolen_: tomjack: fresh vars and recursive goals need to be examined carefully

17:45 tomjack: I would love to see some sort of instrumentation tool though

17:45 technomancy: callen: so documentation for projects that don't have good official docs?

17:45 dnolen_: tomjack: like run this core.logic program for 10s and show me intelligently where the search time was mostly spent

17:45 callen: technomancy: I don't think documentation is a good way of putting it. More like hybrid docs/cookbook.

17:45 dnolen_: tomjack: something like a tree representation

17:47 tomjack: yeah that would be brilliant, wonder how it could work

17:49 dnolen_: tomjack: another option would maybe be some support for modes ...

17:50 tomjack: and automatic delaying of moded goals that are not sufficiently instantiated ...

17:50 tomjack: oh, d'oh, I'm just an idiot

17:51 dnolen_: tomjack: what'd you do?

17:51 tomjack: tried to generate applications before writing the part where you generate args to apply

17:51 so divergence makes perfect sense..

17:52 papachan: ,(reduce #(assoc % (keyword (str %2)) %2) {} (seq "1234"))

17:52 clojurebot: {:4 \4, :3 \3, :2 \2, :1 \1}

17:52 papachan: how i can put a count keyword

17:52 ?

18:04 fsmunoz: technomancy: sorry to bother you yet again, but the other day you provided me with an incantation envolving lein deploy in order to take a jar I have and put it in a private repo; I am trying to do it now and it compains about a missing pom.xml, am I correct to assume that I should create a pom.xml myself prior to invoking the command?

18:05 technomancy: fsmunoz: yeah, you can do `lein new dummy`, edit project.clj, and run `lein pom` to get one

18:06 fsmunoz: brilliant, ty

18:20 seangrove: I'm trying to generate answers for the 24 card game using core.logic http://rosettacode.org/wiki/24_game

18:20 This works for the solutions I've manually specified: https://www.refheap.com/15891

18:21 Which is pretty awesome, admittedly

18:21 But I'm trying to express the rules more abstractly, where I don't have to specify every possibly way that numbers can be combined/grouped

18:22 For example, I can also specify [(== q (+ a (* b c d)))], which is allowable

18:23 But I'm at a lost about how to compose them properly

18:24 Also, I can only express one-step solutions... perhaps I need to recurse...

18:24 Well, if someone with some experience with core.logic comes around at some point, I'd love some tips

18:27 dnolen_: seangrove: so what do you want to be variable, the list of operations?

18:27 seangrove: dnolen_: Yes

18:28 In this case I'm generating a,b,c, and d, but really I would be given them and try to see what operations could be applied that produce 24

18:28 dnolen_: seangrove: are you always given 4 numbers?

18:29 seangrove: dnolen_: yes

18:29 But it can be a multi-step solution as well

18:29 dnolen_: seangrove: what do you mean multi-step?

18:30 seangrove: (== (+ (* 6 3) (/ 12 2)) 24)

18:30 dnolen_: seangrove: oh yeah sure

18:30 callen: if I have multiple children (who are siblings to each other) in a tree I am running through a zipper, is there a way to select one of the siblings using the core clojure.zip machinery?

18:34 dnolen_: seangrove: this sounds pretty similar to the numbers game which was posted on the Clojure ML a while back

18:35 seangrove: dnolen_: I don't see it anywhere, do you remember the subject?

18:35 dnolen_: "Countdown numbers game in clojure.core.logic"

18:36 is the name of the thread

18:36 seangrove: Will check it out, thanks

18:37 By the way, core.logic is certainly nifty, fun to play around with

18:37 Thanks for all the work on it

18:38 dnolen_: seangrove: glad you like it!

18:51 akhudek: callen: sure, you just walk down to that node and you can iterate though the children

18:52 callen: akhudek: I've already got a function that does that, but it's a vanilla seq and not part of the zipper context thingy.

18:52 akhudek: callen: I guess it's not clear to me exactly what you are trying to do.

18:54 callen: (-> [:a [:b [:c]] [:d [:e]] z/down (z/select :d)) => [:d [:e]]

18:54 akhudek: something more or less like that, which I sorta have, but again, it steps outside of the zipper context.

18:54 I need something that's part of the zipper call chain ideally.

18:56 akhudek: so select just selects the child with first node being :d?

18:58 futile: rewrites are never the answer. but sometimes they are, right?

18:58 akhudek: callen: select could easily be written with z/right

19:05 * futile cant do this

19:12 akhudek: futile: you do it!

19:12 fsmunoz: Is it possible to put the result of (reify ...) in a separate function? I mean, going from (.setCallback client (reify ...)) to (.setCallback client my-callback)?

19:13 futile: akhudek: uhh

19:13 no

19:13 technomancy: fsmunoz: yeah, reified objects are first-class

19:14 you can pass them around just like any other value

19:16 fsmunoz: technomancy: ummm... my first instinct was to do something like (defn- my-callback [] (reify ...)) (.setCallback client my-callback), but got Cannot cast user$mqtt_callback to org.eclipse.paho.client.mqttv3.MqttCallback

19:17 futile: ,(doc riefy)

19:17 clojurebot: Huh?

19:17 futile: ,(doc reify)

19:17 clojurebot: "([& opts+specs]); reify is a macro with the following structure: (reify options* specs*) Currently there are no options. Each spec consists of the protocol or interface name followed by zero or more method bodies: protocol-or-interface-or-Object (methodName [args+] body)* Methods should be supplied for all methods of the desired protocol(s) and interface(s). You can also define overrides for meth...

19:17 futile: fsmunoz: you probably forgot the protocol

19:17 fsmunoz: (mqtt is,btw, very simple to use, I was surprised, 10 lines of code and off goes the message)

19:18 callen: akhudek: that's more or less what I'm working towards.

19:18 fsmunoz: futile: http://paste.lisp.org/display/137662

19:19 gdev: this morning on my white board at work I wrote out a function that used reify. I had at least 15 people stop and ask if reify was a real word. everybody else probably googled it. lesson of the day: learn Clojure, expand your vocabulary

19:19 futile: fsmunoz: dunno bud

19:19 fsmunoz: I'll reread reify docs though (although I only really "got it" by example.

19:19 futile: ty though, appreciated.

19:19 futile: k

19:25 * futile can do this!

19:27 technomancy: fsmunoz: it looks like you're passing a function instead of calling it?

19:29 * fsmunoz goes look

19:29 fsmunoz: Swett baby jesus

19:29 I blame it on the Java code I'm using as reference :P

19:30 technomancy: ty, that fixes it of course.

19:33 futile: fsmunoz: >:|

19:34 fsmunoz: futile: tell me about it, sorry to waste all your time.

19:34 futile: thats not what

19:34 but never mind. i shouldnt have said anything.

19:35 m supposed to just turn the other cheek.

19:35 * futile goes away

19:36 francis_wolke: How do you go about getting the seq of symbols passed via closure? eg: ((fn ...) (fn [x] x)) => '(fn [x] x)

19:36 gzmask: clojurescript, how do i do dom.style.display = 'none'? I tried (def (.-display (.-style (d/sel "#dom"))) "none") and it says presisten type error

19:38 amalloy: francis_wolke: there is no set of characters you could replace "..." with and get that result

19:38 futile: How do you say "x contains [:a :a :b :b] but in any order"?

19:38 in normal Clojure

19:39 My normal set-approach doesn't work here, since it can have duplicates.

19:39 francis_wolke: futile: frequencies

19:39 futile: oh right, thanks.

19:39 (inc francis_wolke)

19:39 lazybot: ⇒ 1

19:41 ztellman: amalloy: … => [_] '(fn [x] x)

19:42 francis_wolke: ztellman: what does [_] stand for?

19:42 ztellman: francis_wolke: _ is a convention for "I don't care what the value is"

19:43 it was just a dumb joke, I'm saying that if you always return '(fn [x] x), you can get the desired output

19:43 patchwork: ztellman: The trivial case is the best case!

19:43 futile: ,_

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

19:44 futile: ,(%)

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

19:44 futile: ,#(%)

19:44 clojurebot: #<sandbox$eval83$fn__84 sandbox$eval83$fn__84@fac455>

19:44 futile: uh oh

19:44 think im about to invent swearjure

19:44 ,(#(%) #())

19:44 clojurebot: ()

19:44 futile: huh!?

19:44 ,(#())

19:44 clojurebot: ()

19:45 futile: oh

19:45 ,(#(%) (#(%) #()))

19:45 ztellman: #() => (fn [] ())

19:45 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList$EmptyList cannot be cast to clojure.lang.IFn>

19:45 futile: ztellman: ahhhh

19:45 ,()

19:45 clojurebot: ()

19:45 futile: ,(type ())

19:45 clojurebot: clojure.lang.PersistentList$EmptyList

19:45 futile: lame.

19:45 ,clojure.lang.PersistentList/EmptyList

19:45 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to find static field: EmptyList in class clojure.lang.PersistentList, compiling:(NO_SOURCE_PATH:0:0)>

19:46 futile: hmph

19:46 life is weird.

19:46 akrikos: indeed

19:46 patchwork: ,clojure.lang.PersistentList$EmptyList

19:46 clojurebot: clojure.lang.PersistentList$EmptyList

19:47 futile: ,(= () clojure.lang.PersistentList$EmptyList)

19:47 clojurebot: false

19:47 futile: uhh

19:47 (inc akrikos)

19:47 lazybot: ⇒ 1

19:47 akhudek: callen: if you are doing things with zippers, the library I released a few days ago may be of interest https://github.com/akhudek/zip-visit

19:47 futile: who.. WHO ARE YOU!?

19:48 akrikos: futile: a lurker?

19:48 futile: but you know.. so .. much

19:48 * futile is possibly dead

19:49 akrikos: It's always something I said

19:49 * akrikos sighs

19:50 francis_wolke: having seen this `inc` business it appears that there is now some sort of ranking system built into lazybot?

19:50 TimMc: Karma module.

19:50 It's just silliness.

19:50 francis_wolke: Cool

19:53 Raynes: francis_wolke: If you get to 100, TimMc buys you a Tesla.

19:54 francis_wolke: Raynes: Well I better get to learning some more computer science then.

19:55 Raynes: TimMc: This is how you get 'em to learn. Promise them things and then break them in two when they achieve their goals.

19:56 amalloy: hang on, a tesla? i'm not *that* far away. TimMc, i hereby consider Raynes's claim binding

19:56 technomancy: francis_wolke: that's not necessary; good jokes will do fine.

19:56 papachan: ,(identical? '() clojure.lang.PersistentList$EmptyList)

19:56 clojurebot: false

19:56 Bronsa: (inc amalloy)

19:56 lazybot: ⇒ 61

19:56 Raynes: (inc amalloy)

19:56 lazybot: ⇒ 62

19:56 Bronsa: heh.

19:56 Raynes: Bronsa: o/

19:57 Bronsa: Raynes: \o

19:57 hyPiRion: (inc amalloy)

19:57 lazybot: ⇒ 63

19:57 hyPiRion: Let's do this

19:58 Bronsa: papachan: ##(clojure.lang.PersistentList/EMPTY)

19:58 lazybot: ⇒ ()

19:58 papachan: Bronsa: ooh yes

20:03 TimMc: Raynes: I step away from the channel for 8 minutes, and this is what happens.

20:03 *12

20:03 Raynes: I've made promises on your behalf. You can thank me later, Tim.

20:04 TimMc: Raynes: And now it's up to me to (deliver) them. Great.

20:04 callen: (realized? tesla) => nil

20:04 * callen scowls at TimMc

20:04 TimMc: amalloy: Don't get your hopes up, I'll just hack into lazybot if you get close.

20:05 mthvedt: the tesla is actually a $10 tesla coil

20:05 TimMc: shhhh

20:05 that was the backup plan

20:05 amalloy: TimMc: "hack" is such an overstatement compared to how hard it would be

20:05 TimMc: I'll use VB and everything.

20:05 mthvedt: timmc: will there be a gui?

20:05 nothingtoseehere: (dec amalloy)

20:05 lazybot: ⇒ 62

20:06 TimMc: mthvedt: There's always a GUI.

20:07 Raynes: Written in VB6.

20:09 hyPiRion: Hmm

20:09 hyPiRion/botsnack#1

20:09 lazybot: ,(println (+ 1 2)) ; -- https://github.com/hyPiRion/botsnack/issues/1 is open

20:09 clojurebot: 3\n

20:09 hyPiRion: Woo!

20:09 Now what can I use this for.

20:11 amalloy: hyPiRion: free webhosting, with ISPs github+lazybot

20:13 Raynes: hyPiRion: https://github.com/hyPiRion/lein-shell/blob/master/src/leiningen/shell.clj wtf you traitor

20:13 hyPiRion: y u no conch

20:13 Having had a one fraction of a second glance at the code, I'm going to declare it would have made this significantly easier.

20:13 And now being an expert on the subject, I demand a rewrite.

20:14 technomancy: Raynes: that file is just a copy-paste from lein

20:14 hyPiRion: what technomancy said

20:15 Raynes: technomancy: wtf you traitor!

20:15 * technomancy flees to Hong Kong

20:23 fsmunoz: Is there something for emacs that shows documentation for Java methods, etc?

20:24 technomancy: fsmunoz: you can get a list of the methods and signatures, but for more detail than that you need a browser

20:25 fsmunoz: technomancy: is it through the Display JavaDoc faciliy in nREPL I imagine?

20:25 ^it is

20:26 technomancy: fsmunoz: not sure. I use Javert; I rarely need full Javadoc

20:26 https://github.com/technomancy/javert

20:26 fsmunoz: noted, ty.

20:29 hyPiRion: Man, it's so weird that Java has no way of sending a file descriptor from one jvm process to another

20:30 callen: Raynes: sorry, I'm the only person that uses conch.

20:30 Raynes: callen: Well, I use it too.

20:30 callen: Raynes: btw: (first (first (filter #(= :sports (first (second %))) (map-indexed vector (-> tree z/vector-zip z/down z/rights)))))

20:30 Raynes: sort of the answer to what I was talking about earlier. Did you ever find anything relevant in laser.zip?

20:31 Raynes: callen: I think the problem is that a) not everyone knows it exists b) people are far more concerned with backwards compatibility with java.shell than is rational.

20:31 callen: I never looked. I assumed you were going to.

20:31 callen: woooops.

20:31 derp.

20:31 justin_smith: hyPiRion: other languages can share fds between processes? I thought fds somehow belonged to the process that opened them (ie. every processes' fd 1 is stdout (or is it stdin I forget))

20:31 hyPiRion: justin_smith: yeah, it was a bad attempt at irony

20:32 justin_smith: oh, ok

20:32 callen: ;; END DAVIDNESS <--- lol

20:32 hyPiRion: It would make Leiningen I/O so easier.

20:33 justin_smith: parents in pure c can pass fds to child processes

20:33 hyPiRion: justin_smith: it is possible in c though, but it's not easy nor portable

20:33 justin_smith: (on unix that is)

20:33 hyPiRion: yeah

20:34 n_b: callen: is there any reason not to use ffirst there?

20:35 callen: n_b: laziness.

20:35 Raynes: hyPiRion: I'm on volume 8 of The Sandman btw. Would have finished it by now, but I've been cramming the California driver's manual (which is an excellent piece of fiction btw) at every available opportunity.

20:35 callen: Raynes: Gaiman?

20:35 hyPiRion: callen: of course

20:35 Raynes: callen: Yes.

20:36 hyPiRion: Raynes: Oh nice. How far in the California driver's manual are you now?

20:37 n_b: I don't follow; isn't ffirst literally implemented as (fn [x] (first (first x)))? I still have problems with properly understanding laziness so I don't quite understand what the difference would be here

20:37 Raynes: hyPiRion: About 3 quarters. Will finish tonight and tomorrow.

20:37 hyPiRion: At this point, I'm pretty sure I'm an expert at LA traffic laws.

20:37 hyPiRion: n_b: I thought he meant laziness as in "oh, forgot ffirst was in the lib"

20:38 callen: Raynes: good stuff.

20:38 n_b: hyPiRion: That was my first thought, but I always err on the side of "I'm an idiot"

20:39 callen: n_b: what hyPiRion said.

20:40 mthvedt: la has traffic laws?

20:41 hyPiRion: Raynes: Oh, there's a test about traffic laws and signs, but no driver's test?

20:41 Raynes: hyPiRion: There is a behind-the-wheel test, but I'm not sure if I have to take it or not. It's vague. I have an out-of-state license that is expired. I may or may not have to.

20:43 tomjack: getting a stackoverflow during occurs-check https://www.refheap.com/5431c7d187479e60e34ac15ad

20:43 hyPiRion: Ah, that confirmed what I just tried to comprehend (It's vague).

20:43 tomjack: that's the IPersistentCollection occurs-check-term

20:43 but when I log out the collection there, it's never deep

20:43 so how could I be blowing the stack?

20:48 hmm, logging v and x gives an awful lot of stuff like this https://www.refheap.com/4a75b624c28b98cee23f009f1

21:07 I stuck a (binding [*ocs* (conj *ocs* [v x])] ...) in IPC's occurs-check-term and got this trace https://www.refheap.com/2cbd3c2763286f592be385218

21:07 guessing that means I'm doing something horribly wrong..

21:10 actually I guess these are deep, they just look shallow because of the lvars

22:00 Zamarok: Can I define a function that refers to a variable, then define the variable below that function?

22:00 brehaut: you can define a var with declare in that way, but not a lexical variable

22:01 Zamarok: A lexical variable being one defined with 'def'?

22:01 brehaut: there is also a special case for mutually recursive functions with letfn

22:01 callen: technomancy: that JVM thread is a troll, right?

22:01 brehaut: no, thats a var, lexicals are defined with arguments or lets

22:01 a Var sorry

22:01 capital v

22:04 Zamarok: @brehaut https://gist.github.com/zfogg/5811139

22:05 That's my problem... so I shouldn't define 'primes' with 'def' in that scenario?

22:05 Sorry, the terminology is a bit confusing.. new to Clojure/Lisp

22:05 brehaut: Zamarok: you can predecalre primes with declare

22:05 (declare primes)

22:05 Zamarok: Ahh ok, that's what you meant

22:05 brehaut: yes

22:06 although why primes cant just be declared above prime-factors escapes me

22:06 as it doesnt depend on it

22:06 Zamarok: Well, that was the obvious solution.. but I like to find out why things go wrong before just fixing it

22:06 Thanks for your help, works great now

22:07 brehaut: clojure is single pass by design

22:09 Zamarok: i might be wrong, but i think you dont need lazy-cat there either

22:09 concat would be fine

22:10 (lazy-cat delays evaluating the expressions as well as producing a lazy seq, but concat does still produce a lazy seq)

22:10 tjb1982: cemerick: may I ask you a question about Friend?

22:11 Zamarok: Are you sure? Then wouldn't my definition of primes take forever to evaluate?

22:11 cemerick: tjb1982: shoot

22:12 Zamarok: Oh, it doesn't.. you're right, awesome

22:12 tjb1982: I have a form the user POSTs to create an account. When the account is created, I'd like to just have them be signed in. I tried something like this: ((friend/authenticate (ring/redirect (str "/" username)) (load-credentials username)) request)

22:12 cemerick: ^

22:12 cemerick: yeah, that's not going to work :-)

22:13 tjb1982: what is the right way?

22:14 cemerick: tjb1982: use `merge-authentication` to add to a ring response map what your workflow _would return_ if the user had just logged in https://github.com/cemerick/friend/blob/master/src/cemerick/friend.clj#L57

22:14 callen: tjb1982: is this just basic user auth?

22:14 tjb1982: yeah, just the interactive form

22:15 callen: tjb1982: github.com/bitemyapp/neubite I have sessions + user auth in that example CMS

22:16 tjb1982: cemerick: callen: thank you both. That should get me squared away

22:17 cemerick: tjb1982, callen: patch welcome to http://friend-demo.herokuapp.com demonstrating that sort of pattern

22:24 arohner: ,(Math/log 3)

22:25 clojurebot: 1.0986122886681098

22:25 arohner: why does that work?

22:25 Math/log is declared as log(Double) -> Double

22:25 is clojure implicitly casting?

22:25 hyPiRion: yes

22:27 tjb1982: cemerick: this worked `(friend/merge-authentication (ring/redirect (str "/" username)) (load-credentials username))` Thanks again. I'd love to submit something to help out with the demos. I'll let you know when/if I get it together.

22:28 cemerick: tjb1982: looks good. I'll look forward to it :-)

22:33 bbloom: ,(Math/log 3N)

22:33 clojurebot: 1.0986122886681098

22:33 bbloom: arohner: hmm :-)

22:36 tomjack: &(Math/log (proxy [java.lang.Number] [] (doubleValue [] 10)))

22:36 lazybot: java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to clojure.lang.DynamicClassLoader

22:36 tomjack: ..interesting

22:45 amalloy: tomjack: the proxy macro does some side-effecty stuff at macroexpand time, and lazybot macroexpands by hand at runtime

22:46 like, proxy looks at Compiler/LOADER to decide how to generate bytecode

22:47 tomjack: ah, makes sense, gotta macroexpand by hand to be safe

22:57 is the variarity even possible? https://www.refheap.com/60cdbcee3335f0a33028e98ac

22:57 I guess it's gotta be

23:03 can't see how to do it without a macro

23:05 Raynes: amalloy: TIL lazybot has hands.

23:05 Maybe it has...

23:05 wait for it...

23:05 http://www.youtube.com/watch?v=Pmv8aQKO6k0

23:16 xpe: Hi, I'm wrapping some functions from https://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math3/util/ArithmeticUtils.html -- take factorial and factorialDouble -- is there a clean way to do this in Clojure without having to have two names? the former returns a long, the latter returns a double. The arguments are the same.

23:17 My guess is that two functions are needed

23:21 bbloom: xpe: yes. use two names

23:22 xpe: bbloom: thanks. I figured unless Clojure could pick a function based on a desired (type hinted) return type, I would need two.

23:23 bbloom: xpe: technically, it's a feature the JVM supports to overload by return type

23:23 xpe: but java can't, so it's kinda a bad idea to utilize it

23:24 for example, java.lang.reflect will barf on it, iirc

23:24 gfredericks: bbloom: what? We can use polymorphic constants?

23:24 xpe: ah, interesting. So Clojure can do something like what I mentioned?

23:25 bbloom: http://www.drmaciver.com/2008/08/a-curious-fact-about-overloading-in-scala/

23:25 read the comments too

23:26 xpe: bbloom: I read that, thanks. Two functions are fine for me :)

23:35 argent0: using (:require [lanterna.screen :as s]) in my core namesapce. i can call s functions and methods if i use 'lein repl' but I get a [Thrown class java.lang.NoSuchMethodError] if i use 'lein swank' and slimv. Any clue of what could be failing?

23:54 murtaza52: I want to slurp a file. I have the dir names and the file name [a b c]. How do I use clojure.java.io to read this file via slurp ?

23:55 brehaut: (apply file path)

23:55 murtaza52: ^ using clojure.java.io/file ?

23:55 i hope you can slurp from a file

23:56 murtaza52: yup

23:59 puredanger: /help

Logging service provided by n01se.net