#clojure logs

2013-06-18

00:07minikomiI do not own a car. Tokyo public transport is good.
00:08robinkamalloy: Seems not to work.
00:09SegFaultAXminikomi: I wish I could say the same for San Francisco and the surrounding suburbs.
00:10minikomiPlus, the legal blood alcohol limit for drivers is 0.
00:11SegFaultAXminikomi: I'm glad I don't have to say the same for SF and the suburbs. :D
00:11minikomihaha
00:13amalloyrobink: 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
00:13robinkamalloy: I get that. That's not my problem.
00:13robinkamalloy: The problem is defining the macro within macrolet as including a type.
00:14robinkamalloy: I'm looking at a gist you posted (https://gist.github.com/amalloy/5084918) and trying to figure out how it works.
00:14robinkamalloy: The difference, I suppose, is that I'm not calling the macro directly, since I'm defining another dispatch for print-method.
00:15robinkamalloy: That's all I want. An extra print-method dispatch limited to a scope.
00:15amalloythat's not possible
00:15robinkamalloy: Ah, OK then
00:15amalloymultimethods are global and permanent
00:15robinkamalloy: Aha
00:15robinkamalloy: So even (defmacro ^{:private true}) won't limit its evaluation to a namespace?
00:15SegFaultAXrobink: As a rule, most things that start with def create or modify a top-level var.
00:16amalloyyou keep saying macro, but apparently you only care about a multimethod
00:16amalloyi can't answer your questions, because they seem totally disconnected from what you want
00:16robinkSegFaultAX: Well, def creates a namespace-level var, not a global. The macro I'm defining is evaluated from other namespaces.
00:17robinkamalloy: My question, specifically, is whether or not it's possible to have multimethod dispatch behavior limited to a scope or namespace.
00:17amalloyno
00:17robinkamalloy: OK then
00:17SegFaultAXWouldn't that kinda defeat part of the purpose?
00:18amalloySegFaultAX: meh. it's easy to imagine two functions which both want to extend the printer in mutually-exclusive ways
00:18clojurebotfunctions are maps
00:19SegFaultAXclojurebot: Thanks!
00:19clojurebotRickInGA: Thanks; the queue is empty now, though I'm sure it'll fill up at ClojureWest again.
00:19amalloybut it's okay, because f only ever writes data to clients expecting f's extensions, and similarly for g
00:19robinkSegFaultAX: Not if I want different behavior for a method dependent on what namespace or scope I happen to be in.
00:20robinkamalloy: 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.
00:20robinkamalloy: Nothing is broken.
00:37rlbdevn: found it - https://github.com/runa-dev/cliopatra
00:59futile,[(some nil? [1 2 3]) (some nil? [1 nil 3])]
00:59clojurebot[nil true]
00:59futileWorks for me.
01:00futileHowdy.
01:03futile(Who keeps spreading the lie that Python doesn't have closures except in the limited form of its lambda keyword?)
01:10arcatan(prolly people who don't know closures very well, or who haven't coded much in Python)
01:13brehautor people who learnt python prior to 2.1 or 2.2
01:14brehaut2.2 was the first version with closures
01:14brehauthttp://en.wikipedia.org/wiki/Python_syntax_and_semantics#Closures
01:18amalloyhttp://math.andrej.com/2009/04/09/pythons-lambda-is-broken/ is all i know about python's closures
01:19brehautamalloy: you can create a closure with a named function in python
01:19HashNukehey all.
01:19brehauttheres 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
01:22HashNukeI'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?
01:24brehautamalloy: that article is wrong; its the behaviour of list comprehensions that are broken there, not lambda
01:25amalloybrehaut: are you sure? last time i checked, for loops behave the same
01:25brehautamalloy: right; its closuring over a mutable variable
01:25brehautand list comps in python < 3 are just a mangled for loop
01:26brehautthey dont introduce a fresh variable for each iteration (and infact, the variable bleeds outside the scope of the list comp!)
01:27brehautamalloy: if you had def counter (init):\n def inner():\n init += 1\n return init
01:27brehautyou'd expect init to keep incrementing each time the resulting counter is called
01:28brehauti forgot a return too
01:29brehautalso stupid scoping shenanigans
01:43minikomiwha?
02:41samratHashNuke_: they're default bindings
02:42HashNuke_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].
02:42samratHashNuke_: correct
02:42HashNuke_samrat: Thanks
03:00gtagetting nrepl to work
03:01gtahi ppl
03:08n_bWhat'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] ) ?
03:22Raynesn_b: What's wrong with dotimes?
03:41supersymcan someone shed some light on `lein deps :tree` and why it would think these are confusing/different?
03:41supersymWARNING!!! possible confusing dependencies found: [org.clojure/tools.namespace "0.2.3"] overrides [org.clojure/tools.namespace "0.2.3"]
03:42supersymto me they seem the same, I assume they aren't (nested both in different pkgs), is lein wrong? Or what should I do? :)
04:51rodnaphdoes anyone know the current state of clojurescript source mapping?
04:52mpenetrodnaph: "almost, but not yet" I think
04:52rodnaphcool, know of any docs on how to try out what's there? my google-fu turns up nothing...
04:52mpenetI am not sure it's in master yet, you could try asking dnolen_
04:54rodnaphhttps://github.com/clojure/clojurescript/commit/5b7623873ff8713a556f3b52fe1912c98ac8bbc5
04:55rodnaphseems to have landed. i'll ping dnolen_ when he's online, thanks.
04:57tomjackit's not ready yet
04:58tomjackhe said something like we need more support from the reader.. or something
04:59mikethepurpleGuys, is there a way to get an html file not as source but as browser-loaded contents?
05:00mikethepurpleOR, which seems more simple, get the javascript variables - but also, after running the scripts
05:01rodnaphmikethepurple: dev tools, elements, copy root el as html? can't think of a clojure way though... ;)
05:05mikethepurpleI 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
05:05mikethepurpleBlows my mind a bit
05:06mikethepurpleI am ridicoulosly russian, so tell me first, if you do get the question :)
05:08rodnaphmikethepurple: is this a clojurescript app?
05:11mikethepurplenope
05:15rodnaphyou might get some more help in a #javascript or #googlemaps channel, or for the framework/library you're using if there is one.
05:17mikethepurpleBut 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
05:18vijaykiranmikethepurple: how about using a JavaFX WebView - not sure if it has API to grab the rendered data though
05:19murtaza52for a code in a leningen project, what is its relative path - the path of the project, or the path of the source file
05:19vijaykiranmurtaza52: AFAIK - it is the path of the project
05:20mikethepurpleWil try. if that works (or anything else though), i can share the solution here, if anybody wills
05:20murtaza52vijaykiran: thanks
05:20vijaykiranmurtaza52: you can just rev up the repl, create a temp file without path and print its abs path
05:20vijaykiranmikethepurple: http://docs.oracle.com/javafx/2/webview/jfxpub-webview.htm
05:21mikethepurpleYeah, already found that thing
05:21vijaykiranmikethepurple: another option would be to use selenium
05:22vijaykiranmikethepurple: should be easier than webpane
05:23mikethepurpleWow, there is even a clojure api for that thing, thanks
05:24Morgawrthis 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)))
05:24Morgawrit feels very verbose
05:26schmirMorgawr: there's if-not and when-not
05:26rodnaphmikethepurple: sorry, misunderstood. sounded like you were just asking about a normal web app :)
05:27mikethepurplenooope, that is the whole point :)
05:28mikethepurplealso, i am not new in Clojure, but i am in IRC, how the hell do you mention - /to?
05:28Morgawrschmir: ah, that makes it better, thanks
05:29vijaykiranmikethepurple: mention ?
05:31Anderkentmikethepurple: /msg Nick content
05:34mikethepurplethx
05:52mikethepurpleWell, i figured out that selenium just opens the browser and tests something with it
05:54murtaza52what is the easiest way to create a new file, or overwrite an existing file in clojure
05:58murtaza52answering my question - spit
06:16supersymhm
06:16supersymah..ok... now I got it :P
07:25murtaza52how do I print the current path in repl
07:28clgvmurtaza52: ##(System/getProperty "user.dir")
07:28lazybotjava.security.AccessControlException: access denied (java.util.PropertyPermission user.dir read)
07:28clgv,(System/getProperty "user.dir")
07:28clojurebot#<SecurityException java.lang.SecurityException: denied>
07:29clgvhmm ok, even clojurebot secures "his private parts" :P
07:39murtaza52clgv: thanks
07:39murtaza52just wondering how does clojurebot work ?
07:45clgvmurtaza52: 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
07:45clgv,(+ 1 2)
07:45clojurebot3
07:45clgv&(+ 1 2)
07:45lazybot⇒ 3
07:46clgv$seen Raynes
07:46lazybotRaynes was last seen talking on #4clojure 3 hours and 24 minutes ago.
07:46murtaza52so IRC has provision for attaching bots to specific channels ?
07:46clgvand something like that ^^
07:46murtaza52this is amazing
07:47murtaza52$seen murtaza52
07:47lazybotmurtaza52 was last seen talking on #clojure 17 milliseconds ago.
07:47murtaza52any other synta it supports ?
07:47clgv$find inc [1 2 3] [2 3 4]
07:50clgv$findfn inc [1 2 3] [2 3 4]
07:51lazybot[]
07:51clgv$findfn 3 5 8
07:51lazybot[clojure.core/+ clojure.core/unchecked-add clojure.core/+' clojure.core/unchecked-add-int]
07:51Anderkent$findfn [2 3 4] inc [1 2 3]
07:51lazybot[]
07:51Anderkenthuh
07:52clgvAnderkent: I was shooting for `map but somehow that did not work
07:52Anderkentyeah so was i
07:52Anderkentthe result goes first doesnt it
07:52clgvno. the result goes last
07:52Bronsa$findfn [2 3] inc
07:52clgvparam1 ... paramN result
07:52Bronsa$findfn [2 3] inc [3 4]
07:52lazybot[]
07:52Anderkentis that different with the bot than findfn.core?
07:52lazybot[]
07:52Bronsadurr
07:52Bronsa$findfn inc [2 3] [3 4]
07:52clgvAnderkent: never used findfn.core ;)
07:53lazybot[]
07:53Bronsamh?
07:53clojurebotslamhound is for reconstructing your ns forms from scratch: https://github.com/technomancy/slamhound
07:53Bronsawhy isn't it returing mapv
07:53Anderkent$findfn nil '()
07:53murtaza52what is $findfn doing?
07:53clgv&(clojure-version)
07:53lazybot⇒ "1.4.0"
07:53lazybot[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]
07:53clgvoh ok ^^
07:54Anderkent$findfn inc [1 2 3] (2 3 4)
07:54lazybotjava.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn
07:54clgv$findfn inc (2 3) (3 4)
07:54lazybotjava.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn
07:54Anderkent$findfn inc [1 2 3] '(2 3 4)
07:54Anderkent:D
07:54lazybot[]
07:54clgv$findfn inc '(2 3) '(3 4)
07:54Anderkenthuh
07:54lazybot[]
07:54murtaza52how do I extract a file name from a string
07:54clgvseems broken
07:54murtaza52,(-> (split "b.cl" #".") first)
07:54clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: split in this context, compiling:(NO_SOURCE_PATH:0:0)>
07:54Bronsano, map returns a lazyseq
07:54Anderkentmurtaza52: make a File out of it then ask it about its name
07:54Bronsa'(3 4) is a PersistentList
07:54murtaza52,(-> (clojure.core/split "b.cl" #".") first)
07:54clojurebot#<CompilerException java.lang.RuntimeException: No such var: clojure.core/split, compiling:(NO_SOURCE_PATH:0:0)>
07:55AnderkentBronsa: but they should pass equality checks
07:55murtaza52,(require 'clojure.string)
07:55clojurebotnil
07:55murtaza52,(-> (clojure.core/split "b.cl" #".") first)
07:55clojurebot#<CompilerException java.lang.RuntimeException: No such var: clojure.core/split, compiling:(NO_SOURCE_PATH:0:0)>
07:55murtaza52,(-> (clojure.string/split "b.cl" #".") first)
07:55clojurebotnil
07:55Anderkentmurtaza52: you must escape . in regular exprs
07:56murtaza52why doesnt the split work in this case ?
07:56murtaza52,(-> (clojure.string/split "b.cl" #"\.") first)
07:56clojurebot"b"
07:56murtaza52thanks
07:56Anderkentbut don't do that
07:57murtaza52any suggestions for a better way ?
07:57jtoy 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)
07:58Anderkent,(import 'org.apache.commons.io.FilenameUtils)
07:58clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: org.apache.commons.io.FilenameUtils>
07:58Anderkentaww
07:58Anderkentthat's the easiest way :D
07:58jtoyall I am doing is appending data to a file: (with-open [wrtr (writer "/etc/hosts" :append true)] (.write wrtr data))
07:59Anderkentmurtaza52: you want to do (.getName (File. filename)) and then find the *last* dot in it and take everything before that
07:59jtoyI've tried this on a couple of files and I get the same error, so i think i must be doing something else wrong?
08:02murtaza52,(->> (split "b.cl.ab" #"\.") drop-last (interpose ".") (apply str))
08:02clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: split in this context, compiling:(NO_SOURCE_PATH:0:0)>
08:03murtaza52Anderkent: why instantiate the File object ?
08:03Anderkentmurtaza52: 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?
08:05murtaza52thanks
08:07Anderkentunfortunately it doesnt -> cleanly because of the orger of args ;/ split takes string first, join takes separator first -.-
08:08lozhi
08:11murtaza52Anderkent: java.nio.File ?
08:13lozhow can i compile cljs files without project?
08:14Anderkentmurtaza52: sure, if you prefer. java.nio.file.Path is what you want hen
08:14murtaza52nope I was asking, what to use ?
08:14Anderkentjava.io.File
08:16Anderkentmurtaza52: https://www.refheap.com/15870
08:17Anderkentsave the obvious typos (that should be fixed now), it should work
08:18vijaykiranloz: Did you try using cljsc - https://github.com/clojure/clojurescript/wiki/Quick-Start ?
08:19jtoy?
08:20murtaza52Anderkent: thanks
08:28lozvijaykiran: should i specify all files at once?
08:28vijaykiranloz: I haven't used it myself - but from the docs it looks like it will compile all the files in a dir
08:29lozvijaykiran: okey, gonna try it
08:29lozthx
08:29jtoyhow would you remove the block #BEGIN .... #END from a file in clojure?
08:41Anderkentjtoy: all of such blocks anywhere in a file?
08:50Anderkentjtoy: ugly loop solution: https://www.refheap.com/15872
08:51vijaykiranjtoy: slurp into a string do a regex find replace
08:52vijaykiranAnderkent: isn't line-seq should work in place of split-lines ... right ?
08:59clgvjtoy: if speed is not too crucial you can use replace with a regular expression
09:00clgvwhat vijaykiran said... ^^
09:21piranhacemerick: (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?
09:21piranhamaybe there is an example somewhere or something...
09:26dnolen_basic & advanced core.match usage http://github.com/clojure/core.match/wiki/Basic-usage http://github.com/clojure/core.match/wiki/Advanced-usage
09:38xeqipiranha: which workflow?
09:38piranhaxeqi: interactive-form
09:39xeqipiranha: 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
09:40piranhahmhm, strange, because I'm not seeing this
09:40piranhaxeqi: it redirects me to the page I came from ('/', since I submit from there), but with empty query-string (so the url is '/?')
09:41xeqipiranha: do you have a custom :login-failure-handler ?
09:42piranhaxeqi: no, I don't...
09:54tupiwhat is null? in clojure
09:54tupii mean the corresponding function
09:57dbushenkonil?
09:57clojurebot⟹ "Returns the metadata of obj, returns nil if there is no metadata."
10:00IamDrowsywhy does clojurebot talks about the docstring of meta when "nil?" is asked?
10:01hyPiRionwell, clojurebot is sentient somehow
10:01hyPiRionI don't think it's repeatable
10:01hyPiRionnil?
10:01clojurebot⟹ "Returns the metadata of obj, returns nil if there is no metadata."
10:01hyPiRionwhat.
10:01hyPiRionpos?
10:01clojurebot(def transpose (partial apply map vector))
10:02hyPiRionneg?
10:02clojurebot:negative/num-1 + :positive/num-1 = :zero/zero
10:02tupitx. 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:11tupii of course realize it is a java problem, but surely i am not the first facing it, am i ?
10:18vijaykirantupi: Did you check the warnings/docs here - http://fiji.sc/Headless ?
10:19vijaykirantupi: "Naturally, these plugins will still try to instantiate GUI elements when being called in headless mode, failing."
10:20vijaykirantupi: while you are at it - you should switch to clojure 1.5.1 :)
10:24lozany of cljs developers here?
10:27dbushenkoloz: whad do u mean? developers who use cljs or who implement it?
10:28lozdevelopers who can add one feature
10:29lozor explain that i dont need it)
10:29lozdbushenko: ^
10:32murtaza52Anderkent: I have a java.nio.file.Path, how do i get its string path. I will then (slurp) the file on the path.
10:33murtaza52this is what I am doing right now - (-> p .toUri .toString (split #"file://") second)
10:34murtaza52however 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:37solussddoes anybody know why 'resolve' doesn't exist in clojurescript? Do I have an alternative to construct a symbol from a string?
10:38llasram,(symbol "like-this?")
10:38clojurebotlike-this?
10:41solussdlike this ,((resolve (symbol "+")) 7 8)
10:41supersymso you want awt.headless?
10:41solussd,((resolve (symbol "+")) 7 8)
10:41clojurebot15
10:41tupivijaykiran: 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:42Anderkentsolussd: clojurescript doesnt have vars. You can try something like treating the namespace object as an array
10:42llasramsolussd: (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:42vijaykirantupi: You can try processing.org if it has methods for your usecase
10:42tupiwhen 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:42Anderkentsolussd: but it might not work if your code is optimized in compilation and the symbol is not properly exported
10:43llasramsolussd: What's your goal at a higher level?
10:44solussdI 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:44Anderkentyeah. In the online playground (aget cljs.user "foo") seems to work
10:44Anderkentbut I do not recommend actually doing that :)
10:45tupisupersym: any hint is welcome
10:47tupisupersym: i try to get the 5 lines clojure script that i paste to work :)
10:47solussdackk! clojurescript doesn't have "case" either... I guess that makes sense since the semantics of it probably arent supported
10:48solussdwait.. yes they are.
10:48solussdwhere's my case?
10:48Anderkentsolussd: I think it has been added to cljs
10:48Anderkentbut they can't guarantee constnat time dispatch on as many things as clojure can
10:48solussdgrepping core.cljs doesnt show it
10:49Anderkenthm, you might be right. dnolen claims it was added in http://stackoverflow.com/questions/9453117/has-anyone-a-case-implementation-for-clojurescript
10:50Anderkentbut he also recommends using (condp = x ...)
10:50solussdinteresting.
10:50solussdhmm, cant find condp either. :D
10:51Anderkentcase works in the online repl
10:54solussdwhat online repl? doesn't work on Himera: Compilation error: TypeError: 'undefined' is not an object (evaluating 'cljs.user.case$.call')
10:54Anderkentclojurescript.net
10:54Anderkenthttps://github.com/clojure/clojurescript/blob/master/src/clj/cljs/core.clj seems to have (defmacro case)
10:55solussdinteresting.
10:55solussdwhere the heck are case and condp in the source?
10:56Anderkentin the file I just linked
10:56AnderkentI'm not sure what the directory structure of clojurescript repo means (the clj/cljs dir under src)
10:58solussdah, I was looking in cljs/cljs/core.cljs
10:58solussdcase is there, and it's a macro
11:03clj_newb_2345anyone recommend a tutorial on webgl + clojurescript? :-)
11:08bbloomclj_newb_2345: why not just look at two separate tutorials? there is nothing special about clojurescript plus any particular web tech
11:10justin_smithmurtaza52: try (slurp (clojure.java.io/resource ...))
11:11murtaza52the problem is the path I am receiving doesnt have the subfolder in the project, it only has the project path + file name.
11:11murtaza52any ideas what could be causing it?
11:12justin_smithmurtaza52: 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:13arcatanambrosebs: 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:13justin_smithfor 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:13justin_smithmurtaza52: 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:14justin_smith(or resource path, same diff)
11:14ambrosebsarcatan: whoops!
11:16murtaza52I 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:16justin_smithif (comp slurp io/resource) does not work, maybe (comp slurp io/file) will?
11:18murtaza52let 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:21justin_smithOK, 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:21justin_smith(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:22Anderkentjustin_smith: (File. my-path)
11:22Anderkentactually let me make sure that's true :D
11:22Anderkentah
11:22Anderkent(.toFile path)
11:23justin_smithmurtaza52: yeah, Anderkent has your answer there
11:24justin_smithbut 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:25Anderkentjustin_smith: i think directory watching means using file access, not classpath resources
11:25justin_smithoh, duh
11:25justin_smithyeah
11:25Anderkentdon't think you can watch classpath resource like dirs
11:25justin_smithof course :)
11:26murtaza52so I can slurp (.toFile path) ?
11:26Anderkentyeah
11:30murtaza52I 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:32justin_smithsome file operations succeed even if the file does not exist (ie. java.io.File) - your class may act like that too
11:32justin_smithyou can write to it, but of course not read it
11:42murtaza52where can I find any docs on clojure.java.io ?
11:43justin_smithhttp://richhickey.github.io/clojure/clojure.java.io-api.html
11:44justin_smiththat may be out of date? but I don't think it has changed much since then
11:46noncomhow 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:47algernonmurtaza52: http://clojure.github.io/clojure/clojure.java.io-api.html
11:51dnolen_noncom: how are you trying to reference jQuery in your CLJS?
11:54noncomdnolen_: 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:54dnolen_noncom: did you search for other projects that use jayq?
11:55pbostromnoncom: you probably need to include the jquery library in your html page
11:56noncomdnolen_: 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:57dnolen_noncom: no idea then, try on the ClojureScript ML as well
11:58noncompbostrom: 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:00noncomdnolen_: google finds nothing on ClojureScript ML...
12:00noncomwhat is it?
12:00dnolen_noncom: sorry the ClojureScript google group
12:00noncomoh
12:00noncomok
12:01bbloomML = mailing list
12:03pbostromnoncom: 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:04noncomyeah, i guess, i'll go try variants...
12:04TuplanollaIt's possible to write a docstring for a namespace, but not read it?
12:06jcromartieI'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:06Anderkent,(meta (find-ns 'clojure.core))
12:06jcromartieI've always been a fan of the Cookbook series
12:06clojurebot{:doc "Fundamental library of the Clojure language"}
12:06AnderkentTuplanolla: ^
12:07rkneufeldjcromartie: An idea alone will garner you a place in the contributors listing ;) Though you're welcome to help more.
12:09noncomwhat jQuery version would you recommend to use with ClojureScript as of now?
12:10dnolen_rkneufeld: btw, have you tried the latest CLJS release, did that address the namespace keyword issue for you?
12:10bbloomnoncom: whatever jquery version is recommended with google closure advanced optimizations, which i think is all the latest ones
12:11noncombblom: 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:11noncomsry keyboard missyng keys
12:13bbloomnoncom: 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:14noncombbloom: 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:14jcromartierkneufeld: if I am ready to write a recipe, could I just do it, or do I need to have an accepted idea first?
12:16noncomturned 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:17noncomturns out that that thing is sorta meta for the actual js file
12:18noncommy 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:32rkneufelddnolen_: I have not, I can't say I have ever installed from source locally.
12:32rkneufeldjcromartie: 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:32dnolen_rkneufeld: oh right, we haven't done a release that include that
12:33jcromartierkneufeld: no, nothing indicated a need for approval, but there are no instructions for actually writing and committing a recipe
12:33rkneufeldjcromartie: I'll try to make that more clear then
12:33jcromartierkneufeld: but I deduced it from the git log
12:34jcromartiei.e. make a directory /<chapter>/<recipe>/<recipe>.asciidoc
12:34rkneufeldjcromartie: Had you seen https://github.com/clojure-cookbook/clojure-cookbook/blob/master/CONTRIBUTING.md ?
12:35jcromartierkneufeld: yes
12:36rkneufeldjcromartie: good to know, I'll make an issue for me to remember to fix that this week
12:36jcromartierkneufeld: or I can take a shot
12:37rkneufeldjcromartie: For some reason I hadn't even considered contributions against the instructions itself ;)
12:38gfredericksAOT results in deps being bundled in your jar even when you're not uberjaring?
12:42technomancygfredericks: this is why we don't AOT
12:42technomancyin libraries
12:42S11001001gfredericks: only the compiled classfiles; lein has clean options
12:42gfredericksvery good
12:43gfredericksso generating a class is unavoidable in this case I think. But I imagine I can keep the deps out via runtime loading
12:44S11001001I think it's :clean-non-project-classes
12:44technomancyyeah, but that has issues with protocols
12:44technomancybetter to resolve at runtime
12:47jcromartierkneufeld: will both of these forms be accepted? /<chapter>[/<section>]/<recipe>/<recipe>.asciidoc OR /<chapter>[/<section>]/<recipe>.asciidoc
12:49dnolen_anyone use the ClojureScript browser REPL functionality without firing up a separate HTTP server?
12:50jcromartiednolen_: is that possible without eval?
12:50dnolen_jcromartie: what do you mean?
12:50rkneufeldjcromartie: 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:50jcromartiednolen_: perhaps I misunderstood
12:51jcromartiednolen_: you mean without a HTTP server to serve the HTML hosting the browser REPL… sorry
12:51dnolen_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:51dnolen_jcromartie: yeah
12:51jcromartierkneufeld: got it, that's what I thought
12:51jcromartierkneufeld: both exist at the moment
12:52malyndnolen_: I tried it for a bit, but ultimately found that Compojure + piggieback gave me more flexibility.
12:52rkneufeldjcromartie: 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:53dnolen_malyn: thanks for the feedback, others?
12:53jcromartieyeah, but the canonical directory structure you just mentioned makes much more sense
12:57rkneufeldjcromartie: Good stuff, that's nice and succinct
13:20Bronsa,(. (identity Object) toString)
13:20clojurebot"class java.lang.Object"
13:20Bronsawut.
13:21llasramBronsa: ?
13:22Bronsaoh nvm I'm an idiot.
13:31Morgawrdnolen_ (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:31MorgawrI tried using something like (.apply + [1 2 3 4 5]) and it returns 0
13:32tomjackwhy would you want to do that?
13:32tomjackbut you need to pass the 'this', try (.apply + nil [1 2 3 4 5])
13:32dnolen_Morgawr: you need to pass an *array*
13:32tomjackoh, heh, yeah
13:32dnolen_(.apply + (array 1 2 3 4 5))
13:32tomjack(.apply + nil (array 1 2 3 4 5)) ?
13:33Morgawrit doesn't seem to be working
13:33Morgawr(.apply + (array 1 2 3 4 5)) -> 0
13:33Morgawr(.apply + nil (array 1 2 3 4 5)) -> [1 2 3 4 5 6
13:33Morgawr]
13:33Morgawr(well, without the 6 of course hehe)
13:34dnolen_Morgawr: + isn't a function in JS anyhow
13:34dnolen_Morgawr: so I don't really see the point
13:34dnolen_just use apply
13:34ChousukeMorgawr: if you just want to apply clojurescript functions, use apply
13:34MorgawrI just wanted to test the js version of "apply"
13:34MorgawrI don't want to use the clojurescript version
13:35dnolen_(.apply + nil (array 1 2 3 4 5))
13:35Morgawrokay, sorry nevermind, I used (array [1 2 3 4 5]), with (array 1 2 3 4 5) it works properly
13:35dnolen_Morgawr: ^
13:35Morgawrmy bad :(
13:35Morgawrthanks dnolen_ and tomjack
13:36dnolen_Morgawr: it definitely needs to work for interop reasons
13:37MorgawrI assume the ClojureScript "apply" is mapped on top of the javascript apply for proper datatypes?
13:37dnolen_Morgawr: what do you mean?
13:38dnolen_Morgawr: ClojureScript only use primitive apply if there are not other options
13:38Morgawryes, that's what I meant
13:41Morgawrdnolen_: 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:42dnolen_Morgawr: no
13:43dnolen_Morgawr: if you need primitive apply use it
13:44MorgawrI'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:44kyled2i 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:45dnolen_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:45Morgawrkyled2: the + (aka the function) is still the clojure one, I'm just talking about the way to apply it
13:45kyled2oh, my misunderstanding
13:46dnolen_malyn: neat post!
13:46Morgawrdnolen_: 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:47malyndnolen_: 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:47dnolen_Morgawr: what if you don't have an array
13:47dnolen_?
13:47Morgawryou mean (apply + 1 2) ?
13:48dnolen_(apply + '(1 2))
13:48`fogusMorgawr: I wrote most of the apply functionality
13:48Morgawrwell, as I said, I'd test for native javascript types and use the native implementation only on those (like Array)
13:48`fogusThe biggest thing to be aware of is that Clojure's apply preserves laziness
13:49dnolen_Morgawr: we could check for that, but it's not a useful optimization for most ClojureScript programs
13:49Morgawr`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:49dnolen_Morgawr: if you want to use arrays, use .apply
13:49Morgawryes, of course, I was just putting it there as a suggestion (or just wondering about implementation choices)
13:50`fogusMorgawr: Not that I'm aware of
13:50ChousukeMorgawr: everything that is "javascript" in clojurescript behaves exactly as it would in plain javascript
13:50MorgawrI'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:51Morgawrthe 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`fogusIn 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`fogus(the infinite kind)
13:52Morgawryes, of course, but I think splitting the function in two parts would benefit performance
13:52Morgawralthough I'd need to do proper benchmarking before saying more, really
13:52Chousukehave you actually found performance to be lacking?
13:52`fogusBut wouldn't that check need to happen every time?
13:53futileok
13:54MorgawrChousuke: 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:54Morgawrobviously now I need to optimize that to use native javascript types
13:54dnolen_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:54Morgawralso `fogus, I'd say a datatype test would be faster in the long run
13:55Morgawrdnolen_: I see, that makes sense
13:55`fogusMorgawr: You might be right, but like you said testing is in order
13:55Morgawrit's just a bit of a pain in the ass to wrap everything around native datatypes but I guess I can do that
13:55ChousukeMorgawr: using apply a lot might be a symptom, not the actual cause of slowness though.
13:56Chousukehard to guess though
13:56MorgawrChousuke: 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:56xeqirkneufeld: do you have any thoughts on whats desired for the testing section for cc?
13:56rkneufeldxeqi: nothing solid yet
14:00dnolen_Morgawr: also there may very well be performance bugs in apply, I've done a lot of work in making it faster
14:01dnolen_Morgawr: oddly in CLJS (reduce + ...) is faster than (apply + ...) on (into [] (range 1000000))
14:01dnolen_it's the opposite in Clojure
14:02dnolen_Morgawr: but in general I wouldn't use apply at all on the critical path
14:02dnolen_not even native apply
14:02dnolen_http://jsperf.com/function-calls-direct-vs-apply-vs-call-vs-bind/6
14:04futiletechnomancy: 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:04futileperhaps I'm just crazy and it really is just fine
14:05Morgawrdnolen_: interesting stuff, I'll reconsider the structure of my code and see if I can optimize it further
14:07technomancyfutile: 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:07technomancythe data structures section looks solid
14:07technomancyoh, except the :time field
14:07technomancyyou probably want to call that :duration
14:08technomancypersonally I don't get the point of :pending; that kind of stuff is handled nicely by TODO comments IME
14:08technomancybut whatever
14:09ohpauleezI would rename it to :duration_ms
14:09Bronsaew that underscore
14:09arcatanwhat does it mean for a test to be pending?
14:09ohpauleezsorry haha, I didn't mean that
14:09TimMckebab case, please
14:09ohpauleez:duration-ms
14:09technomancyohpauleez: ms is pretty much default for integer timestamps on the JVM though
14:09Bronsa:)
14:09pepijnde-TimMc, wat?
14:10rurumateI'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:10ohpauleeztechnomancy: Totally agree, but with Java Time, it becomes ns resolution
14:10technomancyarcatan: 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:10TimMcpepijnde-: ⟜-kebab-case-
14:10technomancyohpauleez: Joda?
14:10cemerickwherefore are thou, units
14:10ohpauleezno
14:10ohpauleezJava Time
14:10ohpauleezin JVM 8
14:10technomancyoh, the new JSR
14:10arcatantechnomancy: oh, right
14:10TimMcpepijnde-: As opposed to CamelCase
14:11technomancyohpauleez: cool; I didn't know that
14:11ohpauleezcemerick: !!! it's been forever
14:11pepijnde-TimMc, yes, why is it called kebab?
14:11TimMcIt looks like a shish kebab.
14:12TimMcAlbeit, a fairly poorly made one.
14:12technomancyfutile: I thought you wanted to get rid of Definers in favour of just defn
14:12technomancyare they optional?
14:12cemerickohpauleez: what up!
14:13technomancyfutile: the discover phase needs to be able to take args
14:13futiletechnomancy: i only put :pending in there because speclj (out of all 4 major ones) has that feature
14:13futiletechnomancy: yeah, definers are optional, since you can just do (defn ^:test my-test-1 [] ...)
14:13technomancycool; probably want to call that out
14:13pepijnde-TimMc, I would say sate-case, but I guess any things-on-stick work.
14:13futiletechnomancy: but definers are handy since people like me want to name them with strings, not symbols
14:14technomancymeh
14:14TimMcthings-on-a-stick-case, I like it
14:14futiletechnomancy: 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:14technomancyin general calling out required vs optional helps describe the scope
14:15technomancyfutile: so it's a thunk you generate?
14:15futiletechnomancy: 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:16futiletechnomancy: the reason for having the Discoverer built-in is so that peoples test suites remain mostly compatible with one another.
14:16futiletechnomancy: 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:16futileie widespread incompatibility of things.
14:17technomancyI don't really see how that's your problem
14:17technomancyI guess you're trying to do a lot more than just a next-gen clojure.test at this point?
14:18futiletechnomancy: my goal all along was to eliminate the problem that caused us to need four different auto-runners
14:18futilehttps://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:19futiletechnomancy: but its super-related to clojure.test, whose goal seemed to be a simple but extensible testing lib.
14:20technomancyI suspect that the auto-run stuff can be handled in a way that treats tasks opaquely
14:20futiletechnomancy: 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:20futilenot that we could have known that at the time, these things only become known through experience and time
14:20futile(ie nobodys fault)
14:21cemericknever underestimate what a programmer with free time will do ;-)
14:21technomancysure; but that kind of thing could be done as a macro that emits a ^:test-tagged defn
14:21futiletrue
14:21technomancyit shouldn't stop you from standardizing on something more concrete
14:22futiletechnomancy: ok agreed. but im not really sure what you're ultimately saying
14:23futiletechnomancy: then lets say test2 is just a successor to clojure.test and doesnt have any other goals.
14:23technomancymaybe replacing `lein test` would be more specific
14:23technomancysince the selector stuff is in there too
14:24technomancyanyway, I think you should describe how the args get to the discovery phase
14:25futiletechnomancy: oh yeah thats here:
14:25futiletechnomancy: https://github.com/evanescence/test2/wiki#running-tests-from-the-command-line
14:25futilemost of that page talks about that.
14:26technomancyso why is a matcher different from a discoverer?
14:26futiletechnomancy: its really just part of the built-in discoverer. but even so, i dont know what you're suggesting
14:27futiletechnomancy: its built into test2.run/-main, and i dont really know how to make that any more flexible while still being convenient.
14:28astevedoes anyone have experience in making the vim-clojure-static plugin run only for clojure file types?
14:36arcatanasteve: as opposed to what?
14:36futiletechnomancy: 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:37futiletechnomancy: 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:37technomancyfutile: hm; yeah, I understand the need for the spec to be short and descriptive
14:38astevearcatan: 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:38asteveI'd like to turn on vim-clojure-static for only .clj filetypes
14:38arcatanasteve: oh, interesting. surely it shouldn't work that way.
14:40arcatanasteve: https://github.com/guns/vim-clojure-static/blob/master/ftdetect/clojure.vim looking at this, it should auto-enable itself only for Clojure
14:41astevehmmm
14:43arcatanasteve: if you open a ruby file, what does set filetype? say?
14:43asteve filetype=ruby
14:44asteve filetype=clojure, for .clj files
14:44arcatanyeah
14:49patchworkMy project is suddenly failing to start!
14:49patchworkjackson checksum?
14:49patchworkCould 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:49patchworkWhat is up with that?
14:49patchworkHow do I start my project?
14:50patchworkAlso, why is it trying to download every version of every jackson jar? This is weird
14:53patchworkLooks like cheshire was using version ranges
14:53patchwork!!!
14:54RaynesDear God, say it isn't so.
14:54patchworkWell, it isn't anymore
14:54RaynesWhen was it?
14:54patchworkBut the version this old project has does
14:55arcatanasteve: unfortunately i don't have any great ideas, but hopefully you can figure it out
14:56dakronepatchwork: what? cheshire should never have been doing that
14:57astevearcatan: ya, thanks, I need to get work done so I guess I'll revisit the problem in the future; I appreciate your help
15:02wei_how do I do this in clojurescript: window.location.hash = "";
15:07Morgawrwei_: require goog.dom and do (let [window (goog.dom/getWindow)] (set! (.-hash (.-location window)) ""))
15:07Morgawrat least, I think that's how it should work, I've never done nested .- assignments before, though
15:08wei_Margawr: thanks. there's no shorter way to do nested assignments?
15:09bbloomwei_: i think .. works
15:09bbloom(doc ..)
15:09clojurebot"([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:09wei_bbloom: oh cool, thanks
15:10Morgawrbbloom: does that work in cljs, though? I mean, isn't .- different from .?
15:11Morgawr(I never used .. before so I don't really know)
15:11bbloom(.. x -foo -bar) probably?
15:22cemerickdnolen_: 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:25dnolen_cemerick: I'm not sure I understand, putting an :else on any row will prevent anything below it from being tested
15:25dnolen_cemerick: also doesn't really line up with cond
15:26dnolen_cemerick: actually - I never tried that with cond
15:26dnolen_cemerick: so are you saying you do this w/ cond sometimes?
15:27wei_bbloom: (set! js/window.location.hash "") seems to work too
15:27cemerickdnolen_: no, not with cond; but, I almost always invert if to if-not if that'll put the shorter expression first
15:27cemerickdnolen_: My core.match clauses tend to be *waaay* larger than anything cond I ever write :-)
15:28bbloomwei_: 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:28cemericks/anything/any
15:29wei_I like it because it looks cleaner. thanks for the disclaimer!
15:35noncomweavejester: hey, remember i could not imagine a use case for the otherwise wonderful concept library reagi? i think now i got one!
15:35weavejesternoncom: Oh?
15:35dnolen_cemerick: I'm still missing what you're asking for, gist?
15:35noncomthe trick was that the library presumes much stronger application components decoupling than i was using
15:36noncomi mean i think that it would be great for gluing application parts that are totally uncoupled
15:36hoangelosI 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:36cemerickdnolen_: (match [thing] :else thing ...match clauses per usual...)
15:37futileweavejester: 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:37noncomfor 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:37noncomit looks like better it would be separate programs, connected over udp or tcp
15:38noncombut i think that their communication bus is better made with something like reagi
15:38weavejesternoncom: It does seem like a way of loosely-coupling components that would be strongly-coupled if callbacks were used.
15:38jcromartieMy 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:39dnolen_cemerick: yes but I don't understand the point - is this for debugging?
15:39patchworkHow do I prevent lein checking checksums? A jackson checksum is busted and it is bringing down my whole project
15:39noncomyeah, right! and if i later split them for network then still reagi concept holds. although it would have to implement networking implicitly
15:40amalloypatchwork: what if it's busted because someone hacked maven and installed malware on top of jackson?
15:40cemerickdnolen_: solely a readability preference
15:40dnolen_cemerick: oh, no way :)
15:40patchworkamalloy: Sure, so how do I start my project?
15:40weavejesterfutile: I don't think so… because seqs block when they run out of data
15:41amalloypatchwork: depend on a working version of jackson instead of a possibly-compromised one?
15:41futileweavejester: oh
15:41cemerickdnolen_: well, see, if I fessed up about that _all_ the time, then I'd never be able to slip stuff by sometimes ;-)
15:41dnolen_cemerick: pattern matching is top down left right - and the point is to more or less follow cond & case
15:41patchworkamalloy: I am not depending on it, three different libs are depending on it (according to mvn dependency:tree)
15:41dnolen_cemerick: good try :D
15:41hiredmanpatchwork: 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:41patchwork(not depending on it directly I should say)
15:42patchworkhiredman: I cleared out my .m2, same issue
15:42weavejesternoncom: Networking implicitly?
15:42futileweavejester: 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:42hoangelosjsvc and clojure anyone?
15:42hiredmanhoangelos: there is no verb in that question
15:42cemerickdnolen_: 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:43futilethis 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:43amalloy(inc hiredman)
15:43lazybot⇒ 17
15:43noncomweavejester: well, i might be missing something, but seems like theoretically nothing holds against making reagi network-capable.
15:43alandipertanyone have an example of how to AOT an ns w/ lein, but just for tests?
15:43cemerickjust FYI :-)
15:43weavejesterfutile: That would break the contract seqs have, if a seq's tail could change
15:43futileweavejester: ah, i see.
15:43hoangeloshiredman: 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:43cemerickalandipert: you want the test ns AOT'd, but nothing else?
15:44weavejesternoncom: No, definitely not. I think you could easily feed an event-stream into a TCP socket with a small protocol.
15:44alandipertcemerick: correct, want to test what java* expands to when it's used in an ns that gets AOT'd
15:44hoangeloshiredman: 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:44hiredmanpatchwork: 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:44alandipertcemerick: or rather, test the implementation of that expansion
15:44weavejesternoncom: I mean, there's definitely nothing stopping you :)
15:44alandipertcemerick: java* does different stuff at macro time when clojure.core/*compile-files*
15:45hiredmanhoangelos: "clojure" the programming language does not have a jsvc interface
15:45cemerickalandipert: hard. Lein has the AOT-without-non-project-namespaces thing, which you might be able to adapt? Nothing out of the box, tho.
15:45hiredmanhoangelos: but you app may have a custom one, or may be using a library someone wrote to provide one
15:45patchworkhiredman: The jar that is posted on maven central for that version is empty
15:46futileirc is addicting
15:46hiredmanhoangelos: so you'll need to find that custom code or library
15:46futilemust.. get.. free!
15:46hiredmanpatchwork: :(
15:46hiredmanpatchwork: what version?
15:46patchworkhiredman: How do I fix that?
15:46hoangeloshiredman: thanks
15:47noncomweavejester: 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:47hiredmanpatchwork: I think I already said something about "if you specify a specific version..."
15:47alandipertcemerick: sounds trixty. i'm now more confident that it works ;-)
15:47cemerickalandipert: Automated user testing'll smooth it out.
15:47hiredmanpatchwork: but regarding maven central maybe get up in their face on the jackson mailing list?
15:48noncomat least it will help me stick to the concept coz otherwise i am very prone to impurities
15:48noncomwe'll see..
15:48amalloyfutile: <3 applyconcat.com
15:49amalloyit should provide some examples of flatten-gone-wrong, and apply-concat used where mapcat should have been used instead
15:50weavejesternoncom: 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:50futileamalloy: user-editable repository of bad clojure sounds fun
15:50futileknow of any pre-made tools i could use for this off-hand?
15:51amalloyfutile: http://www.wikipedia.org/
15:51futilesadly i'd probably have to write it in sinatra so that it would be fast on a free heroku instance
15:51gfredericksamalloy: did you know about http://dev.clojure.org/jira/browse/CLJ-1218?
15:52amalloyor, really, https://github.com/ztellman/lamina/wiki
15:52futileamalloy: actually sounds like you're just describing refheap.com
15:52amalloygfredericks: 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:53noncomweavejester: 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:55weavejesternoncom: To me it seems to work on the small scale as well.
15:55weavejesternoncom: Like, I have a GUI window for picking resources to place down in the world
15:56weavejesternoncom: 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:56gfredericksamalloy: I feel like concat being variadic is just awkward in the first place
15:57weavejesternoncom: Normally I'd have one callback do both those things
15:57amalloygfredericks: 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:57weavejesternoncom: But Reagi forces me to separate them into two streams
15:58weavejesternoncom: At first it seemed a huge pain, but then I started noticing benefits to how my application was structured.
15:59weavejesternoncom: Because everything is very isolated, the structure is very flat and easy to extend.
15:59hoangeloswhat 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:01noncomweavejester: 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:02weavejesternoncom: I definitely see a lot of parallels with imperative vs. functional, when comparing callbacks vs. FRP
16:02weavejesterWhich now that I say it, kinda sounds obvious :)
16:05noncomweavejester: 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:18futileDoes it make sense to write for javascript being disabled anymore, when your audience is mostly technical users and some business types?
16:26technomancyaren't technical users the most likely to disable js?
16:27callentechnomancy: yeah, that's also why nobody cares.
16:27callentechnomancy: because it's not like they don't know how to enable it again.
16:27technomancy"Oh, he's a programmer, so he's probably not blind I guess"
16:27callenfutile: assume JS, but don't be one of those jackasses where the content can't get loaded without JS.
16:27callenfutile: it's pretty stupid not to render content-oriented pages without the content.
16:28callentechnomancy: I'm an advocate of progressive enhancement, meaning the content comes with the initial page load, not an async JS fetch.
16:28callentechnomancy: but that doesn't mean not using JS at all.
16:28technomancyI agree
16:28callenhaving said that, progressive enhancement only makes sense with content-centric pages.
16:28callenif it's an "app", that goes out the window.
16:29callenfutile: 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:30futiletrouche
16:30tupihow do i get the length of a list ?
16:30futilei like github's new look, came out a few days ago
16:30callentupi: did you even google?
16:30futiletupi: ##(count [1 2 3])
16:30lazybot⇒ 3
16:30tupi(length '(1 2 3))
16:30tupi
16:30hyPiRiontupi: count
16:30futilecallen: yes he probably did
16:31amalloy$findfn '[a b c] 3
16:31callenI sincerely doubt it.
16:31lazybot[]
16:31tupii did, and it's named length in lisp/scheme since ever i programmed :)
16:31amalloywtf lazybot
16:31callenfirst result on Google: http://stackoverflow.com/questions/8632495/clojure-length-of-sequence
16:31futilecallen: give people the benefit of the doubt in the most charitable spirit, and things will go well
16:31hyPiRioncallen: Now, now, this is not the way to introduce new Clojurians to #clojure.
16:32amalloyRaynes: did findfn break recently? he's just been returning [] for a while
16:32hyPiRion$findfn [1 2 0] 3
16:32lazybot[clojure.core/count]
16:32callenamalloy: not for hyPiRion apparently.
16:32Raynesamalloy: I'd hope not, since none of that has changed at all.
16:32tupiit's fine, all i need is some few boostrap quick answer, tx all
16:32callen$findfn [1 2 3] 6
16:32futilehyPiRion: callen's probably just distracted, he probably would normally introduce them gentler
16:32lazybot[]
16:32callenactually I know of a lisp comparison cheatsheet that would help
16:32callenh/o
16:33hyPiRionamalloy: I think it's doing (= (??? '(quote [a b c])) 3) i.e. not evaling the args
16:33callentupi: http://hyperpolyglot.org/lisp
16:33tupitx
16:33callentupi: you can reference whatever lisp or scheme you're familiar with, then contrast with Clojure.
16:33amalloyhyPiRion: i don't remember it implicitly quoting before, though
16:33hyPiRion$findfn [1 2 0] '3
16:33lazybot[clojure.core/count]
16:34hyPiRionhuh.
16:34amalloyand i wrote the dang thing
16:34tupineet i'll had a guile column
16:34malynI 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:34callenhow did it...oh right.
16:34callenmalyn: config maybe?
16:34hyPiRionamalloy: humm, look at this
16:34hyPiRion$findfn '[a b c] 3
16:35callenmalyn: it has a sandbox that needs perms I think.
16:35lazybot[]
16:35hyPiRion$findfn '[1 2 0] 3
16:35lazybot[clojure.core/count]
16:35callentrippy.
16:35TimMctechnomancy: I bet these folks would like to use Syme: http://instantserver.io/
16:35malyncallen: Ah, okay, that sounds right based on what the exception was telling me. How do I set up the sandbox?
16:35callenmalyn: I don't actually have answers, I just make vague guesses on IRC that are right 80% of the time.
16:35callenmalyn: but I make an excellent rubber ducky.
16:36callenmalyn: I moonlight as a zen master.
16:36futilehmm what's a better idea for applyconcat.com?
16:36mindbender1how 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:36callenfutile: what is applyconcat.com?
16:37futile(1) not a blog, nobody reads blogs (2) not refheap, that exists already
16:37futilecallen: just a domain i bought cuz (apply your-fn (apply concat my-args)) is ugly
16:37TimMc&(slurp (java.net.URL. "http://applyconcat.com/&quot;))
16:37lazybotjava.security.AccessControlException: access denied (java.net.SocketPermission applyconcat.com:80 connect,resolve)
16:37TimMcah well
16:38malynHmm... the first invocation returns an empty list and then the second one throws an AccessControlException (createClassLoader).
16:38futile(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:38mindbender1I had to maunally turn the darn thing off
16:38TimMcfutile: An email domain.
16:39futileno, everybody uses @gmail.com
16:39futileexcept kids who use @yahoo.com and grandmas who use @sbcglobal.net
16:40amalloyhyPiRion: 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:40TimMcfutile: gmail.com is the next hotmail.com
16:40futileTimMc: and the last one
16:40callenfutile: I am the only person that likes wikis. dafuq.
16:41amalloyit 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:41TimMcI don't understand why people *like* locking their identity to a free service that could go away at any time.
16:41futileTimMc: cuz it works perfect for what you need. thats why @hotmail.com died out, cuz it sucked. gmail doesnt.
16:41callenfutile: Updating clojuredocs.org is already a project, you should contribute to that.
16:41futileTimMc: 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:41futilecallen: sure, but that doesnt solve the problem of having an empty domain
16:41TimMcAnd then you lose your email address.
16:42jcromartiecallen: do tell me more...
16:42ToxicFrogTimMc: 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:42futileTimMc: oh well. happens.
16:42futileToxicFrog: which, you could lose at any time.
16:42TimMcThat's such a weird attitude.
16:42BronsaTimMc: I doubt gmail is going to disappear any time soon.
16:42futileTimMc: permanence is just an illusion
16:42technomancyonce Google turns evil you won't need an email address anyway
16:42callenjcromartie: https://github.com/clojuredocs/ <--- futile
16:42technomancywe'll be back to telegraph
16:42callentechnomancy: not very cyberpunk of you.
16:42TimMcToxicFrog: Nonsense, brainonfire.net delegates its MX records to cotse.net. In the past it delegated to lavabit, and before that to gmail.
16:42TimMcPainless transition, too.
16:42jcromartiecallen: specifically clojuredocs2?
16:42technomancycallen: I'm more steampunk
16:43callentechnomancy: if Google turns evil, we'll make our own virtual-verse with virtual-couriers!
16:43callenjcromartie: I'm not specifically anything, that's just the extant clojuredocs replacement project I'm aware of.
16:43hyPiRiontechnomancy: 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:43futileTimMc: your own servers will eventually break or go away or you'll just stop wanting to support them.
16:43TimMcI don't have servers, silly.
16:43callenfar as I know, it's abandoned, but somebody could pick it up and take it the rest of the way.
16:43futileTimMc: free servers will eventually go away and be replaced by other ones
16:43TimMcThat's what DNS is for.
16:43futileTimMc: pay servers will too
16:43technomancyfutile: MX recoooooords
16:43futileTimMc: dns will eventually go away
16:44TimMcfutile: I don't think you understand internet.
16:44futileTimMc: in 2070 the internet will be way different
16:44hyPiRionhuman speech will eventually go away
16:44technomancyas long as I can still connect to freenode I'll be happy
16:44futilehyPiRion: not in our lifetimes
16:44hyPiRionwe won't need it anymore, so why bother
16:44antares_futile: we as species may or may not exist by 2070
16:44philandstuffi remember when the internet was all fields
16:44futiletechnomancy: you mean "as long as i can chat with people i know".. who cares what software it uses?
16:44mikerod,(inc antares_ )
16:45jcromartiephilandstuff: before they paved paradise.com and put up a parked domain?
16:45clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: antares_ in this context, compiling:(NO_SOURCE_PATH:0:0)>
16:45Morgawrdnolen_: 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:45futiletechnomancy: ircds are a thing of the past man, ____ is where its at in 2050
16:45futileetc etc
16:46futileall 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:46antares_by the way, I was *just* talking to the author of the new clojuredocs.org about what's left to be done
16:46futilebut my point is boring so bye
16:46antares_and as I learn more specifics, I will write a blog post
16:46futilenobody reads blogs
16:46BronsaI do
16:46hyPiRion^
16:46futilei wrote tons of useful, smart blogs, and nobody read them.
16:46antares_futile: you are too hip to talk to, bye-bye
16:46antares_clojurewerkz.org maintainers decided to suspend new projects and work on reviving clojuredocs.org next
16:46futiletons of people write smart useful blogs and i never even find out they exist.
16:47antares_we will see how much work it turns out to be
16:47antares_but since it's Clojure codebases now we will probably get some help
16:47antares_well, probably very little since nobody reads blogs ;)
16:48jcromartieantares_: where does the new work happen?
16:48antares_jcromartie: github.com/clojuredocs
16:49antares_I am trying to rename repos to be more descriptive
16:49jcromartieyes but WHICH ONE
16:49jcromartieok
16:49callendude, I just sent you that.
16:50callenjcromartie: clojuredocs2, it says in the desc: "Next-gen clojuredocs importer, API, and website.
16:50jcromartiethat's what I thought, but the last commit was 7 months ago
16:51antares_jcromartie: how about now? https://github.com/clojuredocs/
16:51callenjcromartie: I was equally dubious, but apparently, I didn't "understand OSS"
16:51antares_jcromartie: so what?
16:51jcromartiethere we go :)
16:51antares_jcromartie: should we all just give up and live with the 1.3-locked clojuredocs.org we have today?
16:51antares_jcromartie: or should we do something about it?
16:51callenI don't think that's the only alternative to an abandoned website.
16:52antares_I did not say it is the only one
16:52antares_but I'm going to work on this one
16:52jcromartieantares_: of course not, but it sounded as if the work to replace Clojuredocs was active and ongoing
16:52antares_jcromartie: well, I just talked to the person who left it off 6 months ago
16:52jcromartieOK that makes more sense
16:53antares_I can't jump writing code immediately because I have no idea where things stand
16:53futilewhy isn't clojuredocs.org updated to clojure5?
16:53futile\cc callen
16:53callenClojure 1.5*
16:54futileyeah that.
16:54antares_futile: because as it is written, it makes it really hard to reimport new functions for another version
16:54futileantares_: oh so it needs a rewrite?
16:54callenlolwut
16:54futiledang. i just wrote about rewrites being a bad idea on my blog that nobody ever looks at: https://gist.github.com/evanescence/5801213
16:54callentrap spider project.
16:55antares_futile: it needs a proper metadata import tool (so you can import stuff from a given Clojure release)
16:55jcromartiefutile: I can't read your blog because I'm not cool enough
16:55futilejcromartie: quite the opposite: you're too cool.
16:55jcromartieoh well that's good news
16:55futileeverybody's too cool to read my blogs.
16:55antares_if you realize a project has a lot of limitations, a rewrite is fine
16:56antares_also, clojuredocs.org today is a rails app
16:56futilewhoa
16:56antares_I'm sure most of Clojure community members dream of hacking on an ancient rails app
16:56jcromartiefutile: is your blog just that Gist?
16:56antares_but apparently not everybody
16:56futilejcromartie: it is now
16:56antares_so maybe doing it in Clojure would attract a few more hands
16:56futileit used to be real blogs at applyconcat.com
16:56futilebut nobody read them so
16:56futileno point keeping them up for nobody to ever read.
16:57callenfutile: dude, stop talking about yourself/your blog.
16:57clojurebotborkdude: but Fay is the hot thing atm
16:57antares_jcromartie: so, if you are interested in helping out, we can continue in #clojure-doc
16:57futilecallen: fine
16:57hyPiRionfutile: http://nathanmarz.com/blog/you-should-blog-even-if-you-have-no-readers.html
16:57llasramMan, I cannot get around this "blog" == "blog post" lingo. I realize it's an actual active usage, but just sounds weird to me
16:57RoxxiIs there a library that acts as a equivalent to Ruby's configliere library (to read batches of yaml files?)
16:57futilehyPiRion: says that guy, with a blog nobody reads.
16:57callenllasram: post to a blog, a blog post is a noun, blog is a verb and a noun.
16:58technomancyRoxxi: carica and environ are your best choices
16:58callenhyPiRion: he doesn't know who Marz is, give up.
16:58dobladez,(rand-nth ['environ 'configleaf 'reconfig 'cconf 'clj-configurator 'milieu 'carica 'nomad 'clonfig])
16:58clojurebotmilieu
16:58RoxxiThanks technomancy!
16:58technomancyerr--carica if you specifically want files
16:58dobladezRoxxi: pick one of the above :-)
16:58hyPiRionfutile: That is an ad hominem, I think it would be wiser to explain why one disagree with what he states.
16:59futilehyPiRion: wisdom is not my forte
16:59technomancyat least he's honest
16:59hyPiRionIt is not too late
16:59hyPiRionQuick, to the knowledge tower
16:59futilehyPiRion: heh, no. fearing God is the beginning of wisdom.
17:01technomancytechnically there's no rule that says you can't do that in the tower
17:01hyPiRionfutile: I know there are more theists in here
17:01amalloyi 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:01technomancyamalloy: not to mention getting better at writing itself. which is hard.
17:02futile(1) writing makes you more arrogant, because you start thinking you know something somebody else doesn't, which is never true
17:02callensays the guy from a religious tradition of scribes.
17:02futile(2) writing wastes time, because almost always, somebody else already wrote about it and better than you have
17:02amalloyfutile: you sure you haven't already topped out on (1)? you've decided you're better than everyone who blogs
17:02amalloytechnomancy: yes, although i like to think i'm quite good at writing
17:02callencan we stop talking about blogs and personal stuff that doesn't matter?
17:02technomancyamalloy: well you won't stay good if you don't practice
17:03amalloytrue
17:03futile(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:03amalloytechnomancy: i usually include an entire novel in every github issue/pull-req/commit-message
17:03futileamalloy: im better than nobody, and im sorry if ive ever gave the impression i think otherwise
17:04futilethe 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:04futilethat helps me really get to the point.
17:04futileoh and writing documentation for my OSS projects, for mainly the same reasons.
17:04callenfutile: you should spend less time on IRC and more time coding.
17:04futilecallen: noted
17:05futileif 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:05futileoh wait, i fell into #1 and #3 just now. crap.
17:05brehautfar 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:06futilebrehaut: maybe that just means you're wrong about #1, not #1 being wrong: maybe you should stop blogging
17:06technomancyprotip: 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:06callensometimes some unique details and twists come through anyway - those can end up rescuing somebody searching for an answer to something.
17:07futileanyway this has been the little wisdom i have, if any.
17:07futileso whatever. take it or leave it.
17:07brehauttechnomancy: time to backroynm 'blog'
17:07puredangerI regularly google something and find the answer in a blog post I wrote 3 yrs earlier and forgot about
17:07puredangerso clearly my blog has been of value to my future self
17:08amalloypuredanger: that was why i started blogging: someone said to regard it as a (public) note to my future self
17:08callenpuredanger: I've done that before. deeply satisfying.
17:09callenpuredanger: I knew to check my own blog though because I remember I'd written it.
17:09callenremembered*
17:09puredangerapparently my memory is even worse than I thought it was :)
17:09callenpuredanger: more likely, you have a larger surface area
17:09callenpuredanger: I don't blog often.
17:09amalloymostly 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:10callenamalloy: keep going that route and you'll end up like tokenadult on HN.
17:11hyPiRionalias amalloy stackoverflow
17:11hyPiRionExcept I expect a better written question/problem from amalloy
17:12callenhyPiRion: Except
17:14callenweavejester: do you blog?
17:15brehautcallen: http://www.booleanknot.com/blog/
17:17callenbrehaut: I know his brand, I was being silly and including him on the earlier convo.
17:17amalloyspeaking of useful blogs, brehaut's blogs are well worth reading
17:18brehautthanks amalloy
17:18callenbrehaut: liiiiiiiink?
17:18brehauthttp://brehaut.net/
17:18hyPiRionwell that was surprising. I thought it would end it .com
17:19hyPiRions/end it/end in/
17:22tomjackhmm, I wonder if it is normal for the yourkit UI to lock up completely on a cpu tracing snapshot, pegging a core
17:23futilei find blogs useful for learning what people generally think
17:25futilelike, as a whole.
17:26futilefor 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:26futileand 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:27callenfutile: why don't people like wikis?
17:27futilei learned all this by reading blogs.
17:27futilecallen: i dunno, people mostly just use it as read-only instead of read/write
17:28callenit's fine if most people use it was read-only, as long as the ability to contribute exists for those that care.
17:28callenuse it as*
17:28futileok
17:28callenI guess what I don't understand is how reading a wiki harms the reader.
17:28callenor for that matter, the contributor.
17:28futilecallen: it probably doesnt
17:29futilewho said it does?
17:29callenso where does the opposition to wikis come from?
17:29callenfutile: Everybody I've mentioned my idea for a clojure wiki to has been hostile.
17:29callenfutile: 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:29futilecallen: i hate emacswiki
17:29futilecallen: then again i liked wikemacs
17:29callenreally? it's been a lifesaver for me again and again.
17:30callenah well. that aside.
17:30futilegranted, i used emacswiki over and over to pull little snippets out of
17:30callenRight, see?
17:30futilebut it was the wrong tool for the job.
17:30callenand there's a lot of surface area to Clojure that could be covered with a wiki.
17:30futilei hate it on principle. if they had done it right in the first place we wouldnt need an emacswiki
17:30callenyou're really just convincing me I should put up that wiki.
17:30futilecallen: melpa + github is a way better solution for most tweaking.
17:30callenpackage management wasn't standard until very recently.
17:31callenfor years everybody had to rely on the wiki.
17:31futilecallen: i guess the few things left that emacswiki has that cant be repos could probably be in a wiki
17:31futilelike wikemacs
17:31futilecallen: ok here
17:31futileill give you applyconcat.com
17:31callenEmacsWiki isn't exclusively about stashing code, it's about discussing and documenting too.
17:31futilethen you can put up a wiki on it for clojure
17:31callenfutile: I don't think there's any need for that, I own clojurewiki.com lol
17:31futilefff
17:32tomjackhmm, yourkit shows a very deep tree of just -incs
17:32tomjackI wonder if this is normal divergence due to a bug or a perf problem ala gfredericks
17:32callentomjack: submit a bug report?
17:33amalloyi'm just going to start calling all my performance problems "an instance of the gfredericks problem"
17:33futilecallen: im the wrong person to get feedback on ideas. everything i say is wrong.
17:33futilethe only expertise i have is in being wrong.
17:34tomjackI wonder if there is anything that can be done to make profiling core.logic programs easier
17:34technomancy"one wiki good; two wikis baaaaaad"
17:34dnolen_tomjack: I wonder that sometimes too
17:34Bronsa(what is the gfredericks problem?)
17:35callentechnomancy: there is no wiki at present.
17:35callentechnomancy: JIRA doesn't count!
17:35tomjackBronsa: in certain cases where -inc is unnecessary, it causes really bad performance
17:35amalloyBronsa: 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:36dnolen_amalloy: the characterization isn't *quite* accurate ...
17:36technomancycallen: fair. I like the contribution style of clojure-docs.org though
17:37callentechnomancy: you mean clojure-doc.org?
17:37technomancytwo clicks to merge a no-brainer change; more involved changes have a discussion around them in the pull request
17:37tomjacksimilarly core.async go-blocks should be interesting to profile :(
17:37technomancycallen: you know, that thing what my browser auto-completes to when I start typing what I mean
17:37callentechnomancy: I'm not a fan of adding that much friction.
17:37tomjackfeels kinda like we need some meta-profiling tool which lets us stick our own notions of 'method' in
17:38tomjackprofiling/debugging
17:38technomancycallen: ironically there's a bunch of gunk on the official wiki's Emacs article I can't delete because it allows anonymous comments
17:38technomancythey didn't really make sense back then, but now they're even more nonsensical because they're all about slime
17:39mindbender1modernize
17:39dnolen_imagine a recursive goal conde with 3 branches that all succeed
17:39dnolen_by the time you've called it recursive 20 times you have 3^20 leaves to explore
17:40callenI can't believe I'm saying this, but I'm eye'ing zip-select enviously.
17:40callentechnomancy: that's sorta why I want a pure wiki, so things can be edited and renewed
17:41callentechnomancy: no comments or anything else, pure wiki.
17:41technomancycallen: talk pages suck compared to pull requests though
17:41technomancywell, talk pages can be hilarious
17:41dnolen_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:41dnolen_as is the case when enumerating finite domains
17:42technomancybut not great for following a contribution as it matures
17:42tomjackknow any tricks for debugging divergence?
17:42callentechnomancy: 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:42dnolen_I'm not sure gfredericks result means much for other core.logic programs
17:42callentechnomancy: I'm open to refinements upon things like talk pages.
17:42technomancywhat's missing?
17:42tomjackI 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:43dnolen_tomjack: yeah nrepl kinda sucks for debugging this, SLIME was better
17:43callentechnomancy: low friction accumulation of collective knowledge
17:43tomjackluckily I am in slime still :)
17:43dnolen_nrepl becomes unresponsive when there is a lot of printing
17:43dnolen_tomjack: heh nice
17:43callentechnomancy: there's a lot of stuff that gets tossed around here, sometimes reptitively, that isn't getting retained.
17:43tomjackbut still have to kill the JVM sometimes :(
17:43technomancycallen: what topics?
17:44dnolen_tomjack: hmm, I don't really have general advice on tracking divergence - I've just learned what to look for
17:44callentechnomancy: zippers could use a more elaborate "tour". There are recurring subjects on here that merit getting retained.
17:44dnolen_tomjack: fresh vars and recursive goals need to be examined carefully
17:45dnolen_tomjack: I would love to see some sort of instrumentation tool though
17:45technomancycallen: so documentation for projects that don't have good official docs?
17:45dnolen_tomjack: like run this core.logic program for 10s and show me intelligently where the search time was mostly spent
17:45callentechnomancy: I don't think documentation is a good way of putting it. More like hybrid docs/cookbook.
17:45dnolen_tomjack: something like a tree representation
17:47tomjackyeah that would be brilliant, wonder how it could work
17:49dnolen_tomjack: another option would maybe be some support for modes ...
17:50dnolen_tomjack: and automatic delaying of moded goals that are not sufficiently instantiated ...
17:50tomjackoh, d'oh, I'm just an idiot
17:51dnolen_tomjack: what'd you do?
17:51tomjacktried to generate applications before writing the part where you generate args to apply
17:51tomjackso divergence makes perfect sense..
17:52papachan,(reduce #(assoc % (keyword (str %2)) %2) {} (seq "1234"))
17:52clojurebot{:4 \4, :3 \3, :2 \2, :1 \1}
17:52papachanhow i can put a count keyword
17:52papachan?
18:04fsmunoztechnomancy: 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:05technomancyfsmunoz: yeah, you can do `lein new dummy`, edit project.clj, and run `lein pom` to get one
18:06fsmunozbrilliant, ty
18:20seangroveI'm trying to generate answers for the 24 card game using core.logic http://rosettacode.org/wiki/24_game
18:20seangroveThis works for the solutions I've manually specified: https://www.refheap.com/15891
18:21seangroveWhich is pretty awesome, admittedly
18:21seangroveBut 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:22seangroveFor example, I can also specify [(== q (+ a (* b c d)))], which is allowable
18:23seangroveBut I'm at a lost about how to compose them properly
18:24seangroveAlso, I can only express one-step solutions... perhaps I need to recurse...
18:24seangroveWell, if someone with some experience with core.logic comes around at some point, I'd love some tips
18:27dnolen_seangrove: so what do you want to be variable, the list of operations?
18:27seangrovednolen_: Yes
18:28seangroveIn 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:28dnolen_seangrove: are you always given 4 numbers?
18:29seangrovednolen_: yes
18:29seangroveBut it can be a multi-step solution as well
18:29dnolen_seangrove: what do you mean multi-step?
18:30seangrove(== (+ (* 6 3) (/ 12 2)) 24)
18:30dnolen_seangrove: oh yeah sure
18:30callenif 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:34dnolen_seangrove: this sounds pretty similar to the numbers game which was posted on the Clojure ML a while back
18:35seangrovednolen_: I don't see it anywhere, do you remember the subject?
18:35dnolen_"Countdown numbers game in clojure.core.logic"
18:36dnolen_is the name of the thread
18:36seangroveWill check it out, thanks
18:37seangroveBy the way, core.logic is certainly nifty, fun to play around with
18:37seangroveThanks for all the work on it
18:38dnolen_seangrove: glad you like it!
18:51akhudekcallen: sure, you just walk down to that node and you can iterate though the children
18:52callenakhudek: I've already got a function that does that, but it's a vanilla seq and not part of the zipper context thingy.
18:52akhudekcallen: I guess it's not clear to me exactly what you are trying to do.
18:54callen(-> [:a [:b [:c]] [:d [:e]] z/down (z/select :d)) => [:d [:e]]
18:54callenakhudek: something more or less like that, which I sorta have, but again, it steps outside of the zipper context.
18:54callenI need something that's part of the zipper call chain ideally.
18:56akhudekso select just selects the child with first node being :d?
18:58futilerewrites are never the answer. but sometimes they are, right?
18:58akhudekcallen: select could easily be written with z/right
19:12akhudekfutile: you do it!
19:12fsmunozIs 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:13futileakhudek: uhh
19:13futileno
19:13technomancyfsmunoz: yeah, reified objects are first-class
19:14technomancyyou can pass them around just like any other value
19:16fsmunoztechnomancy: 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:17futile,(doc riefy)
19:17clojurebotHuh?
19:17futile,(doc reify)
19:17clojurebot"([& 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:17futilefsmunoz: you probably forgot the protocol
19:17fsmunoz(mqtt is,btw, very simple to use, I was surprised, 10 lines of code and off goes the message)
19:18callenakhudek: that's more or less what I'm working towards.
19:18fsmunozfutile: http://paste.lisp.org/display/137662
19:19gdevthis 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:19futilefsmunoz: dunno bud
19:19fsmunozI'll reread reify docs though (although I only really "got it" by example.
19:19fsmunozfutile: ty though, appreciated.
19:19futilek
19:27technomancyfsmunoz: it looks like you're passing a function instead of calling it?
19:29fsmunozSwett baby jesus
19:29fsmunozI blame it on the Java code I'm using as reference :P
19:30fsmunoztechnomancy: ty, that fixes it of course.
19:33futilefsmunoz: >:|
19:34fsmunozfutile: tell me about it, sorry to waste all your time.
19:34futilethats not what
19:34futilebut never mind. i shouldnt have said anything.
19:35futilem supposed to just turn the other cheek.
19:36francis_wolkeHow do you go about getting the seq of symbols passed via closure? eg: ((fn ...) (fn [x] x)) => '(fn [x] x)
19:36gzmaskclojurescript, how do i do dom.style.display = 'none'? I tried (def (.-display (.-style (d/sel "#dom"))) "none") and it says presisten type error
19:38amalloyfrancis_wolke: there is no set of characters you could replace "..." with and get that result
19:38futileHow do you say "x contains [:a :a :b :b] but in any order"?
19:38futilein normal Clojure
19:39futileMy normal set-approach doesn't work here, since it can have duplicates.
19:39francis_wolkefutile: frequencies
19:39futileoh right, thanks.
19:39futile(inc francis_wolke)
19:39lazybot⇒ 1
19:41ztellmanamalloy: … => [_] '(fn [x] x)
19:42francis_wolkeztellman: what does [_] stand for?
19:42ztellmanfrancis_wolke: _ is a convention for "I don't care what the value is"
19:43ztellmanit was just a dumb joke, I'm saying that if you always return '(fn [x] x), you can get the desired output
19:43patchworkztellman: The trivial case is the best case!
19:43futile,_
19:43clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: _ in this context, compiling:(NO_SOURCE_PATH:0:0)>
19:44futile,(%)
19:44clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: % in this context, compiling:(NO_SOURCE_PATH:0:0)>
19:44futile,#(%)
19:44clojurebot#<sandbox$eval83$fn__84 sandbox$eval83$fn__84@fac455>
19:44futileuh oh
19:44futilethink im about to invent swearjure
19:44futile,(#(%) #())
19:44clojurebot()
19:44futilehuh!?
19:44futile,(#())
19:44clojurebot()
19:45futileoh
19:45futile,(#(%) (#(%) #()))
19:45ztellman#() => (fn [] ())
19:45clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList$EmptyList cannot be cast to clojure.lang.IFn>
19:45futileztellman: ahhhh
19:45futile,()
19:45clojurebot()
19:45futile,(type ())
19:45clojurebotclojure.lang.PersistentList$EmptyList
19:45futilelame.
19:45futile,clojure.lang.PersistentList/EmptyList
19:45clojurebot#<CompilerException java.lang.RuntimeException: Unable to find static field: EmptyList in class clojure.lang.PersistentList, compiling:(NO_SOURCE_PATH:0:0)>
19:46futilehmph
19:46futilelife is weird.
19:46akrikosindeed
19:46patchwork,clojure.lang.PersistentList$EmptyList
19:46clojurebotclojure.lang.PersistentList$EmptyList
19:47futile,(= () clojure.lang.PersistentList$EmptyList)
19:47clojurebotfalse
19:47futileuhh
19:47futile(inc akrikos)
19:47lazybot⇒ 1
19:47akhudekcallen: 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:47futilewho.. WHO ARE YOU!?
19:48akrikosfutile: a lurker?
19:48futilebut you know.. so .. much
19:49akrikosIt's always something I said
19:50francis_wolkehaving seen this `inc` business it appears that there is now some sort of ranking system built into lazybot?
19:50TimMcKarma module.
19:50TimMcIt's just silliness.
19:50francis_wolkeCool
19:53Raynesfrancis_wolke: If you get to 100, TimMc buys you a Tesla.
19:54francis_wolkeRaynes: Well I better get to learning some more computer science then.
19:55RaynesTimMc: This is how you get 'em to learn. Promise them things and then break them in two when they achieve their goals.
19:56amalloyhang on, a tesla? i'm not *that* far away. TimMc, i hereby consider Raynes's claim binding
19:56technomancyfrancis_wolke: that's not necessary; good jokes will do fine.
19:56papachan,(identical? '() clojure.lang.PersistentList$EmptyList)
19:56clojurebotfalse
19:56Bronsa(inc amalloy)
19:56lazybot⇒ 61
19:56Raynes(inc amalloy)
19:56lazybot⇒ 62
19:56Bronsaheh.
19:56RaynesBronsa: o/
19:57BronsaRaynes: \o
19:57hyPiRion(inc amalloy)
19:57lazybot⇒ 63
19:57hyPiRionLet's do this
19:58Bronsapapachan: ##(clojure.lang.PersistentList/EMPTY)
19:58lazybot⇒ ()
19:58papachanBronsa: ooh yes
20:03TimMcRaynes: I step away from the channel for 8 minutes, and this is what happens.
20:03TimMc*12
20:03RaynesI've made promises on your behalf. You can thank me later, Tim.
20:04TimMcRaynes: And now it's up to me to (deliver) them. Great.
20:04callen(realized? tesla) => nil
20:04TimMcamalloy: Don't get your hopes up, I'll just hack into lazybot if you get close.
20:05mthvedtthe tesla is actually a $10 tesla coil
20:05TimMcshhhh
20:05TimMcthat was the backup plan
20:05amalloyTimMc: "hack" is such an overstatement compared to how hard it would be
20:05TimMcI'll use VB and everything.
20:05mthvedttimmc: will there be a gui?
20:05nothingtoseehere(dec amalloy)
20:05lazybot⇒ 62
20:06TimMcmthvedt: There's always a GUI.
20:07RaynesWritten in VB6.
20:09hyPiRionHmm
20:09hyPiRionhyPiRion/botsnack#1
20:09lazybot,(println (+ 1 2)) ; -- https://github.com/hyPiRion/botsnack/issues/1 is open
20:09clojurebot3\n
20:09hyPiRionWoo!
20:09hyPiRionNow what can I use this for.
20:11amalloyhyPiRion: free webhosting, with ISPs github+lazybot
20:13RayneshyPiRion: https://github.com/hyPiRion/lein-shell/blob/master/src/leiningen/shell.clj wtf you traitor
20:13RayneshyPiRion: y u no conch
20:13RaynesHaving had a one fraction of a second glance at the code, I'm going to declare it would have made this significantly easier.
20:13RaynesAnd now being an expert on the subject, I demand a rewrite.
20:14technomancyRaynes: that file is just a copy-paste from lein
20:14hyPiRionwhat technomancy said
20:15Raynestechnomancy: wtf you traitor!
20:23fsmunozIs there something for emacs that shows documentation for Java methods, etc?
20:24technomancyfsmunoz: you can get a list of the methods and signatures, but for more detail than that you need a browser
20:25fsmunoztechnomancy: is it through the Display JavaDoc faciliy in nREPL I imagine?
20:25fsmunoz^it is
20:26technomancyfsmunoz: not sure. I use Javert; I rarely need full Javadoc
20:26technomancyhttps://github.com/technomancy/javert
20:26fsmunoznoted, ty.
20:29hyPiRionMan, it's so weird that Java has no way of sending a file descriptor from one jvm process to another
20:30callenRaynes: sorry, I'm the only person that uses conch.
20:30Raynescallen: Well, I use it too.
20:30callenRaynes: btw: (first (first (filter #(= :sports (first (second %))) (map-indexed vector (-> tree z/vector-zip z/down z/rights)))))
20:30callenRaynes: sort of the answer to what I was talking about earlier. Did you ever find anything relevant in laser.zip?
20:31Raynescallen: 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:31Raynescallen: I never looked. I assumed you were going to.
20:31callenwoooops.
20:31callenderp.
20:31justin_smithhyPiRion: 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:31hyPiRionjustin_smith: yeah, it was a bad attempt at irony
20:32justin_smithoh, ok
20:32callen;; END DAVIDNESS <--- lol
20:32hyPiRionIt would make Leiningen I/O so easier.
20:33justin_smithparents in pure c can pass fds to child processes
20:33hyPiRionjustin_smith: it is possible in c though, but it's not easy nor portable
20:33justin_smith(on unix that is)
20:33hyPiRionyeah
20:34n_bcallen: is there any reason not to use ffirst there?
20:35callenn_b: laziness.
20:35RayneshyPiRion: 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:35callenRaynes: Gaiman?
20:35hyPiRioncallen: of course
20:35Raynescallen: Yes.
20:36hyPiRionRaynes: Oh nice. How far in the California driver's manual are you now?
20:37n_bI 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:37RayneshyPiRion: About 3 quarters. Will finish tonight and tomorrow.
20:37RayneshyPiRion: At this point, I'm pretty sure I'm an expert at LA traffic laws.
20:37hyPiRionn_b: I thought he meant laziness as in "oh, forgot ffirst was in the lib"
20:38callenRaynes: good stuff.
20:38n_bhyPiRion: That was my first thought, but I always err on the side of "I'm an idiot"
20:39callenn_b: what hyPiRion said.
20:40mthvedtla has traffic laws?
20:41hyPiRionRaynes: Oh, there's a test about traffic laws and signs, but no driver's test?
20:41RayneshyPiRion: 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:43tomjackgetting a stackoverflow during occurs-check https://www.refheap.com/5431c7d187479e60e34ac15ad
20:43hyPiRionAh, that confirmed what I just tried to comprehend (It's vague).
20:43tomjackthat's the IPersistentCollection occurs-check-term
20:43tomjackbut when I log out the collection there, it's never deep
20:43tomjackso how could I be blowing the stack?
20:48tomjackhmm, logging v and x gives an awful lot of stuff like this https://www.refheap.com/4a75b624c28b98cee23f009f1
21:07tomjackI stuck a (binding [*ocs* (conj *ocs* [v x])] ...) in IPC's occurs-check-term and got this trace https://www.refheap.com/2cbd3c2763286f592be385218
21:07tomjackguessing that means I'm doing something horribly wrong..
21:10tomjackactually I guess these are deep, they just look shallow because of the lvars
22:00ZamarokCan I define a function that refers to a variable, then define the variable below that function?
22:00brehautyou can define a var with declare in that way, but not a lexical variable
22:01ZamarokA lexical variable being one defined with 'def'?
22:01brehautthere is also a special case for mutually recursive functions with letfn
22:01callentechnomancy: that JVM thread is a troll, right?
22:01brehautno, thats a var, lexicals are defined with arguments or lets
22:01brehauta Var sorry
22:01brehautcapital v
22:04Zamarok@brehaut https://gist.github.com/zfogg/5811139
22:05ZamarokThat's my problem... so I shouldn't define 'primes' with 'def' in that scenario?
22:05ZamarokSorry, the terminology is a bit confusing.. new to Clojure/Lisp
22:05brehautZamarok: you can predecalre primes with declare
22:05brehaut(declare primes)
22:05ZamarokAhh ok, that's what you meant
22:05brehautyes
22:06brehautalthough why primes cant just be declared above prime-factors escapes me
22:06brehautas it doesnt depend on it
22:06ZamarokWell, that was the obvious solution.. but I like to find out why things go wrong before just fixing it
22:06ZamarokThanks for your help, works great now
22:07brehautclojure is single pass by design
22:09brehautZamarok: i might be wrong, but i think you dont need lazy-cat there either
22:09brehautconcat would be fine
22:10brehaut(lazy-cat delays evaluating the expressions as well as producing a lazy seq, but concat does still produce a lazy seq)
22:10tjb1982cemerick: may I ask you a question about Friend?
22:11ZamarokAre you sure? Then wouldn't my definition of primes take forever to evaluate?
22:11cemericktjb1982: shoot
22:12ZamarokOh, it doesn't.. you're right, awesome
22:12tjb1982I 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:12tjb1982cemerick: ^
22:12cemerickyeah, that's not going to work :-)
22:13tjb1982what is the right way?
22:14cemericktjb1982: 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:14callentjb1982: is this just basic user auth?
22:14tjb1982yeah, just the interactive form
22:15callentjb1982: github.com/bitemyapp/neubite I have sessions + user auth in that example CMS
22:16tjb1982cemerick: callen: thank you both. That should get me squared away
22:17cemericktjb1982, callen: patch welcome to http://friend-demo.herokuapp.com demonstrating that sort of pattern
22:24arohner,(Math/log 3)
22:25clojurebot1.0986122886681098
22:25arohnerwhy does that work?
22:25arohnerMath/log is declared as log(Double) -> Double
22:25arohneris clojure implicitly casting?
22:25hyPiRionyes
22:27tjb1982cemerick: 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:28cemericktjb1982: looks good. I'll look forward to it :-)
22:33bbloom,(Math/log 3N)
22:33clojurebot1.0986122886681098
22:33bbloomarohner: hmm :-)
22:36tomjack&(Math/log (proxy [java.lang.Number] [] (doubleValue [] 10)))
22:36lazybotjava.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to clojure.lang.DynamicClassLoader
22:36tomjack..interesting
22:45amalloytomjack: the proxy macro does some side-effecty stuff at macroexpand time, and lazybot macroexpands by hand at runtime
22:46amalloylike, proxy looks at Compiler/LOADER to decide how to generate bytecode
22:47tomjackah, makes sense, gotta macroexpand by hand to be safe
22:57tomjackis the variarity even possible? https://www.refheap.com/60cdbcee3335f0a33028e98ac
22:57tomjackI guess it's gotta be
23:03tomjackcan't see how to do it without a macro
23:05Raynesamalloy: TIL lazybot has hands.
23:05RaynesMaybe it has...
23:05Rayneswait for it...
23:05Rayneshttp://www.youtube.com/watch?v=Pmv8aQKO6k0
23:16xpeHi, 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:17xpeMy guess is that two functions are needed
23:21bbloomxpe: yes. use two names
23:22xpebbloom: thanks. I figured unless Clojure could pick a function based on a desired (type hinted) return type, I would need two.
23:23bbloomxpe: technically, it's a feature the JVM supports to overload by return type
23:23bbloomxpe: but java can't, so it's kinda a bad idea to utilize it
23:24bbloomfor example, java.lang.reflect will barf on it, iirc
23:24gfredericksbbloom: what? We can use polymorphic constants?
23:24xpeah, interesting. So Clojure can do something like what I mentioned?
23:25bbloomhttp://www.drmaciver.com/2008/08/a-curious-fact-about-overloading-in-scala/
23:25bbloomread the comments too
23:26xpebbloom: I read that, thanks. Two functions are fine for me :)
23:35argent0using (: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:54murtaza52 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:55brehaut(apply file path)
23:55brehautmurtaza52: ^ using clojure.java.io/file ?
23:55brehauti hope you can slurp from a file
23:56murtaza52yup
23:59puredanger /help