#clojure logs

2013-01-17

00:11frozenlockI might be way off on this, but couldn't an externs.js file be generated by looking in the cljs files? Say my library is named Foo, then all I need to do is take every "js/Foo.[^ ]*" and dump them in the externs.js.
00:14tomoj(def jq js/jQuery)
00:14tomoj(.whatever jq)
00:15tomojin other words, you can't tell what properties you access indirectly
00:17frozenlockoh.. the properties too are munged?
00:17frozenlockThis means that my carefully hand written externs.js file is useless...
00:19muhoodoesn't including stuff in the externs keep it from getting munged?
00:20muhoowhat i've seen of externs files reminds me of c header files: function declarations
00:23arrdemwho mentioned using irc bouncers a few weeks back?
00:25frozenlockmuhoo: apparently one can just give the entire library as an externs file... but my compiler has been running for >5 min on it, so there must be something wrong. :(
00:30muhooi'd try just pulling out the function declarations
00:33muhoonot a fun task on a large library, but the few things i've tried advanced mode with, someone had already done that work and published an externs for it
00:37frozenlockTurns out that setting :warnings false in the config reduce the compile time to ~30s :)
00:38muhoo!
00:38muhoogood to know, thanks
00:38frozenlockor :pretty-print... I'm too lazy to check which one.
00:39muhooi can't see using pretty-print with advanced mode anyway
00:40tomoj&#.foo
00:40lazybotjava.lang.ClassNotFoundException: /foo
00:40tomojhmm?
00:51tomojhm, the tag for a data literal can be a data literal
00:51tomojnot that I can think of any sane reason to do that
00:52arrdemwait... so I could create a tagged literal taking its type from... a var?
00:52arrdemnothing could go wrong here.
00:53tomoj"Reader tag must be a symbol"
00:54tomoj`##foo bar baz`, `#foo bar` is a data literal, it must read to a symbol which is the tag used to read `baz`
00:58muhoothey need to be namespaced too, no?
01:08frozenlockWell I was totally wrong.. changing :warnings and :pretty-print had no effect, I simply forgot I switched back to externs.js instead of the library.js -_-
01:09frozenlockI have some uses of `this-as' in my code: (this-as this (set! (.-vis this) vis)). How am I supposed to input the .-vis field in the externs.js?
01:13Raynesalgernon: o/ for using conch
01:13RaynesOf gource you use it. https://github.com/algernon/balabit.logstore/blob/master/lgstool/src/clj/balabit/logstore/visualisation/gource.clj#L95
01:30frozenlock"Compiling "resources/public/js/cljs.js" failed. java.lang.NullPointerException:" Cmon, it's too late for this crap...
01:30frozenlock
02:09tomojlooks like in the 'lens' haskell library, funky flipped function invocation + argument operators are defined to get arguments in the order of (fn assoc-in [m ks v & more])
02:16brainproxyso.. I really enjoy using the auto-reload function with ring, but is there a way for it to spit out a stack trace when a namespace reload fails?
02:16brainproxye.g. when there's a syntax error?
02:17brainproxyI can achieve that effect by bounding the process, since an error like that will show up right away as the various namespaces are loaded
02:17brainproxy*bouncing
02:45devnyogthos|away: is /go daito
02:45devnblech
03:09ebaxtAnyone using https://github.com/cemerick/piggieback?
03:19Raynes~anyone
03:19clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
03:22ejacksonyou got told Raynes !
03:26ebaxtRaynes: Thanks, I pinged cemerick on twitter
03:26RaynesGood fellow, that cemerick.
03:27ejacksonoh, there's more than one of him
03:29ebaxtSure is
04:32AWizzArdAmazing. The bestest error message I’ve ever seen. Program terminates and outputs to the shell: “Error: no error”.
04:32ro_stheh
04:34hyPiRionI love such errors.
04:38muhoovery zen. the error is no error. the key is no key. dada is dead. check your overcoat.
04:39muhookeep the lasagna flying.
04:42ejacksonAWizzArd: that's up there with "Warning No keyboard. Press enter to continue" from back DOS days.
04:42wuttfWhen I do (command line windows) java "E:\Program Files (x86)\leiningen-2.0.0-preview10-standalone.jar", it says java.lang.ClassNotFoundException: E:\Program Files (x86)\leiningen-2.0.0-preview10-standalone.jar
04:43wuttf(I am new to the Java ecosystem)
04:44clgvAWizzArd: how about that one? "ava.lang.NullPointerException: null at clojure.lang.Reflector.invokeNoArgInstanceMember (Reflector.java:296) clojure.stacktrace$print_trace_element.invoke (stacktrace.clj:30)"
04:44p_lwuttf: java -jar <path-to-jar>
04:44clgvfrom a print-cause-trace in a catch statement. something throwable or exception that cannot be printed via print-cause-trace it seems
04:45wuttfp_l: Failed to load Main-Class manifest attribute from E:\Program Files (x86)\leiningen-2.0.0-preview10-standalone.jar
04:45hyPiRionwuttf: have you followed the instructions on leiningen.org? It'd make stuff easier.
04:46wuttfhyPiRion: Well I talked with some dudes here yesterday, If I remeber well they said I can set some envars (I did) and run leiningen directly
04:48clgvwuttf: did you?
04:48acron^hyPiRion: you didn;t used to play Anarchy Online, did you?
04:49wuttfclgv: Which part? Did I talk or did I set the envars?
04:49wuttfclgv: Both anyway.
04:50clgvwuttf: so you added the directory where lein.bat is to the path and downloaded a wget.exe and finally ran "lein" from command line?
04:51wuttfclgv: No, Ember and an other guys said there is an other way (wget crashed on me)
04:51wuttf-s
04:51clgvcurl.exe should work as well
04:51wuttfclgv: I try that then.
04:52clgvbut it needs to be on the path as well. so maybe just put it beside the lein.bat
04:57wuttf"leiningen-2.0.0-preview10-standalone.jar can't be used now" wtf?
04:58hyPiRionacron^: No, I've actually never used this nickname in gaming.
04:58hyPiRionThough apparently people use it frequently there.
04:59acron^Is it from somewhere?
05:01hyPiRionIt's a combination of my middle name, my skills in math and the god Hyperion.
05:02hyPiRionPiR => Pi R
05:02hyPiRionPiR => can be spoken as Pierre
05:07acron^Ahh
05:07acron^You're right, I didn't notice the spelling
05:19Guest20858Any recommendation for validation on http requests and routes. For example to check that 'id' exists in route-params and is a valid guid, or that that 'body' is given as post data and is less than some number of characters.
05:20silasdavisrecommendations for a validation library that is
05:24rodnaphsilasdavis: are you planning to do that validation via middleware? could be neat.
05:27ejacksonsilasdavis, clj-schema might help ?
05:32silasdavisejackson: useful thanks
05:35silasdavisrodnaph: I'm using liberator (http://clojure-liberator.github.com/) to return appropriate http responses and I think I need to do validation within it's decision tree, which is a graph of decision functions. It passes a context map between those functions but that map is not quite the same as a ring response map
06:45ChongLihi
06:46ChongLianyone around?
06:52ro_styep
07:10augustlI'm going to use MySQL from Clojure (and JVM in general) for the first time. Anyone got some suggestions to stuff I should read?
07:10augustlwould be nice to make it so that I could use an in-memory database for testing, for example
07:16ro_stpresumably you know about sqlkorma.com already?
07:16ro_sti don't know if you get in-memory sql databases. sqlite3 is disk based. perhaps h2?
07:26p_lro_st: SQLite3 has in-memory store as well
07:27ro_stthere ya go, then :-)
07:27p_lyou just open, iirc, :memory: as filename
07:37xificurCif I wanted to start a custom repl for a simple game that will accept a couple of commands only, is there a way to print text in the repl without getting a nil after each print?
07:53augustlp_l, ro_st: thanks!
07:53augustlseems that if I just use the jdbc stuffs I'm golden.
08:01cemerickxificurC: if it's a custom REPL, then you have complete control over what is printed or not
08:03xificurCcemerick: you are right, if I knew what exactly was I doing I would :D Anyway I changed some parts of the code and now it's fine
08:04xificurCby custom repl i meant a quite simple (loop [] (do (print (eval (read))) (recur)))
08:05xificurCoh one more question: I get these ^M symbols at the end of each printed line for some reason, what does that mean? I am using Emacs-nrepl
08:17hyPiRion$google ^M emacs
08:17lazybot[Hiding ^M in emacs - Stack Overflow] http://stackoverflow.com/questions/730751/hiding-m-in-emacs
08:21xificurChyPiRion: thanks, I tend to forget googling when I'm sitting in a chat room :(
08:22hyPiRionno problem, didn't know ^M would be read literally either
08:44calisI'm an objective-c programmer. I'd like to learn some server-side stuff, so I can do the whole caboodle (native apps which use custom made web services etc) for clients. Clojure (+ ring etc) seem like a good fit for the web side. What would be a good route for me to learn? I've started on the 4clojure site already.
08:44Bronsa,(symbol nil)
08:44clojurebot#<NullPointerException java.lang.NullPointerException>
08:45Bronsa,(keyword nil)
08:45clojurebotnil
08:45Bronsaew
08:50aroemerscalis: read the excellent Clojure Programming book: http://www.clojurebook.com
08:51aroemersIt will get you up to speed quickly and contains a lot of practical stuff as well.
08:57calisaroemers: thanks, I will have a look. My only concern is that it compares clojure with Java, Ruby, and Python, none of which I'm familiar with
08:59cljI'm new to clojure. I installed leiningen 2 on my OSX 10.8. I want to install https://github.com/hugoduncan/criterium, what's the best way to do it? Do I need to clone the repo and do something? I think I could do it using lein plugin install <> in lein 1, but not sure about lein 2.
09:00xificurCcalis: I myself started learning clojure only a couple of weeks ago and since I have only a little bit of experience with programming (and none with Lisp or functional languages) it was quite hard to get used to it
09:02xificurCgoogling for manuals, tutorials, books etc lands you enough resources but to get accustomed to the language I think you really need to just code, code and code
09:02xificurCI also did the 4clojure problems (not all) and about 60 of Project Euler problems until I felt comfortable with the basics
09:06calis_+: How does Euler help? Is it clojure is a math-heavy language? Objective-c doesn't feel too mathy
09:09xificurCcalis_: it only helped me because I was never able to use map, reduce, apply, filter and the like the right way. Forcing myself to store numbers in lists or vectors and apply changes to them helped me train these functions
09:11xificurCbut yes, since Clojure is a general-purpose language you wont learn all you need from solving math problems :)
09:13calis_Thanks +, I'll definitely make Euler part of my learning experience
09:16calis_http://grokcode.com/367/learning-clojure-with-project-euler/
09:19xificurCcalis_: also, if you want to check other clojure solutions to the problems you solved - http://clojure-euler.wikispaces.com/
09:21biff_tannenwhats the standard web-framework/toolchain for developing web applications with clojure?
09:23S11001001biff_tannen: clojure isn't the standard language for developing web applications. Why stop exploring now?
09:24biff_tannenno i mean
09:25cemerickbiff_tannen: compojure is the most common baseline
09:25biff_tannenis there a library/framework that enables web facing development with closure
09:25biff_tannenok
09:30basefriendwhois biff_tannen
09:35jweisswhere's the best place to post job openings for clojure programmers? (i mean clojure-specific place) I have seen a couple on the mailing list but thought there might be something else.
09:35pjstadigusually the mailing list
09:36pjstadigthat's where we've posted several
09:36bordatouecould anyone please tell me if there is any built in support for Unsigned primitive types in clojure
09:36jweissok i'll have to see if our HR will do that or if I should just do it myself
09:37jweisspjstadig: did you get some bites when you posted?
09:37yogthosbiff_tannen: I'm maintaining this http://www.luminusweb.net/
09:37pjstadigjweiss: yeah we've hired some great candidates from there
09:37jweissgreat, that's good to hear
09:37pjstadigthere's not a ton of bites right a way, you have to be a little patient sometimes
09:38yogthosbiff_tannen: it creates a template project using Ring/Compojure and sets it up following some of the best practices currently agreed upon right now
09:38pjstadigbordatoue: no, there are no unsigned numbers on the JVM
09:38S11001001bordatoue: not sure about CLR version though.
09:38pjstadigand so no support for them in clojure
09:39bordatouepjstadig: S11001001, thanks - do you know about any java lib with these support
09:39S11001001bordatoue: you can't add it with a library
09:39S11001001unless you're talking about vector ops or whatnot, in which case, you'd have to look for that specifically
09:39bordatoueS11001001: why can't i make fn calls to the lib from clojure
09:40S11001001bordatoue: Perhaps you should narrow what you're looking for. In Java, you can't stick unsigned values on the stack, and can't put them in the managed heap, and that's what "unsigned primitive types" means.
09:41S11001001And by "can't" I mean you could not possibly find a library that does it, because it's not supported by the VM.
09:42S11001001So if that's *not* what you mean, what do you mean?
09:46bordatoueS11001001: isn't there any library that would automatically promote a type to a large type , only when it comes to long it need to make some reference type
09:48S11001001You mean with plus, minus, etc functions that simulate the clock math you're looking for?
09:49S11001001You can write clock math on signed primitive types, but they would still be signed types, and you can't add new primitive types in JVM.
09:50bordatoueS11001001: I agree with you, I can see the bytecode ins uses fixed java types .
09:53jweissi want to write pmap, but for trees. pass each node of the tree through f, returning a tree of the same structure but different nodes. i'm at a loss how to write this functionally. zippers don't seem to work because they only have a notion of one "current" node, so it's not parallelizable. any suggestion?
09:53bordatoueis there anyway to use bytebuffer to deal with unsigned types
09:58S11001001and immutability will help you avoid deadlocks when doing so
09:58S11001001s,help,make,
10:01maleghastAnyone in here got any experience using Clojure / JDBC or SQLKorma with a clustered MySQL environment..? Just looking for some pointers with regard to setting up the connection(s)...
11:04Bronsauser=> (deftype foo [bar])
11:04Bronsauser.foo
11:04Bronsauser=> (baz/.bar (foo. 1))
11:04Bronsa1
11:04Bronsauser=> (find-ns 'baz)
11:04Bronsanil
11:06TimMcheh
11:07TimMc,(fnurbl/.length "hi!")
11:07clojurebot3
11:07TimMcYeah, there are parts of Clojure that only use the name portion of symbols.
11:07TimMcGood stuff for obfuscation, by the way.
11:07Bronsanamely, the macroexpander
11:08TimMc,(. "hi!" fnurbl/.length)
11:08clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching field found: .length for class java.lang.String>
11:08TimMcAh!
11:08hyPiRionwrap it
11:08TimMc,(. "hi!" fnurbl/length)
11:08clojurebot3
11:08TimMcI don't think the macroexpander has anything to say about that.
11:08TimMcIt's the Compiler.
11:09Bronsathe compiler too, then
11:09jkkramer,(macroexpand '(baz/.foo blah))
11:09clojurebot(. blah foo)
11:09Bronsa^
11:09hyPiRion,(macroexpand '(. blah baz/.foo))
11:09clojurebot(. blah baz/.foo)
11:09TimMcSo it really is both.
11:09Bronsayep
11:21solussdis there an easy way to add a jar to your classpath using leiningen 2? I dont want to create a local maven repo- I just want to "try" something real quick. :)
11:21augustlI've always used HTTP for APIs. Now I'm using a message queue for the first time. What do you typically do for things like status codes, and what format should one use for the message contents?
11:23llasramaugustl: What do you mean by 'status codes' in the MQ context?
11:23augustlllasram: I'm using the MQ for RPC
11:24llasramaugustl: As far as message contents, whatever is easiest in your system, although I'd definitely suggest using a general extensible encoding scheme. We're using JSON, although honestly you don't get as much benefit from a human-parsable format as you do in other arenas
11:24augustlso my typical use is (let [res @(do-rpc .....)]). Need to figure out what "res" should be and what the "..." part should be :)
11:24augustlI'd default to JSON everywhere, and just {"status":"ok","message":...}, etc
11:24llasramHmm. I'm of the opinion that RPC over message queues is an anti-pattern, so don't have any good suggestions on how to do it :-)
11:25augustlllasram: hmm, how so?
11:25kmeister123How do you get out of the current line if the repl's expecting more, a command like C-c? Ex: I entered (instance? java.util.List {1 2
11:26augustlllasram: it seems to solve a lot of problems for me at least
11:26llasramaugustl: There's a mismatch in semantics which leads to fighting against your queuing system to some extent and failing to fully exploit what it can do well
11:28llasramaugustl: If I may ask, what's your larger problem?
11:29augustlllasram: the biggest benefit the way I see it is that I can just add more servers
11:30augustland do things like deploying the newest version and taking down the older version, in that order, without any of the API users noticing
11:31llasramaugustl: Sure, but those are properties of using a message queue, not using it for RPC. If the RPC requirement is baked in stone, well -- I guess you do what you can :-)
11:37augustlllasram: not sure if I follow. They are the properties of a message queue, and that's what I want
11:43llasramRight. I think RPC via message queues is problematic, but my proposed solution would be to use message queues with message-oriented vs RPC semantics, not use RPC via some other mechanism
11:46augustlllasram: my API will occasionally be proxied through HTTP though, so I need request/response-ish so that the HTTP request can respond accordingly etc
12:07e_svedangHello, is there a special channel for Clojure CLR?
12:15Anderkent|awayWhy do people put log4j.properties in their libraries? Expecially ones that config the root logger? Gah!
12:17TimMcAnderkent|away: Because Log4j is incomprehensible magic, so people are satisfied to get it working at all.
12:23AnderkentTimMc: pretty sure rootLogger is clear enough to know that you shouldn't use it... Similarly why is a library selecting appendersls
12:23Anderkentwoops didnt mean to do 'ls<return>' there :P
12:27maleghastAnyone in here deploying on Immutant..?
12:28technomancyAnderkent: but people just copy/paste log4j configs around without reading them because they generally consist of complete gibberish
12:28ucbonce I have a project I'm hacking in parallel in checkouts/, I assumed I have to include it in my list of :dependencies, right?
12:28technomancyucb: right
12:28ucbthanks
12:28technomancyucb: most people don't understand that for some reason
12:29jcrossley3maleghast: if immutant-specific, ask it in #immutant
12:29ucbtechnomancy: I didn't initially; I thought it'd be some magical pony thing but then I read that the checkouts actually take "precedence" over clojars which made the difference for me. I was just confirming my conclusion
12:29maleghastjcrossley3: Good point…
12:30ucbtechnomancy: quick question, if checkouts/ takes precedence over clojars, what does it look for? a prebuilt jar? I'm thinking about the dependencies of my checkouts/
12:34jchaunceycan you only use tools.cli when executing a jar file? seems that it won't work with lein run
12:34jchaunceyoh wait i may have figured it out
12:35technomancyucb: have you seen the lein-pprint plugin?
12:35technomancy`lein pprint :checkout-deps-shares` will show you what entries from the checkouts/ projects are added to your project's classpath
12:44radshello all. I've been testing out clojurescript and one of the hardest things to do is to avoid using the same patterns I do in javascript
12:44radsfor example, Backbone.js is OO-based, and I was wondering if there is anything in the clojurescript world for the same use case, but in a functional manner
12:44S11001001rads: don't use loop for stuff
12:44radsor at least some examples
12:44S11001001rads: also, don't use reduce for stuff
12:44S11001001rads: should get you started
12:45nDuffWhat _is_ backbone.js?
12:45radsS11001001: thanks :) I'm pretty experienced with clojure so the functional programming part isn't too much of a switch
12:45S11001001ah ok
12:45S11001001n/m then
12:45radsit's more questions of "how do you represent a View" in clojurescript?
12:46radsin backbone it's common to create a class to wrap around a DOM element and associate events to it, but the API for doing so is not very functional
13:03asteveI want a function that returns 2 numbers, 1 and 2
13:03frozenlock(defn my-fn [] [1 2])? :P
13:03astevewhy won't (fn [1] [2]) do that?
13:03asteveah, I'm forgetting the input
13:04asteve(let [[x y] (fn [] [1 2])] y)
13:05astevewhat am I doing wrong there?
13:05frozenlockHmm... someone has a clever way of doing this? (apply .trigger `(component ~@args))
13:05S11001001asteve: (fn [] [1 2]) is a function.
13:05frozenlock#(let [y (fn [] [1 2])] y)
13:06asteveI'm trying to let x = 1 and y = 2;
13:06S11001001frozenlock: can only do with reflection
13:06S11001001asteve: functions are not the values they return, they are functions.
13:06nDuffasteve: ...so you want to actually _call_ the function?
13:06asteveyes
13:07skelternetwould it be (let [ [x y] (myfn ...
13:07nDuff,(let [[x y] ((fn [] [1 2]))] y)
13:07clojurebot2
13:07frozenlockS11001001: And in layman terms?
13:07nDuffasteve: ^^ the extra parens are needed to make it a call; otherwise, you're returning the function itself, not calling it.
13:07frozenlock(cljs, not clj btw)
13:07astevenDuff: thanks!
13:08astevethis clojure stuff is cool
13:08asteve:)
13:10frozenlockInteresting, (`(.trigger component ~@args)) doesn't seem to choke the compiler.
13:10S11001001frozenlock: it wouldn't
13:11S11001001the result of that doesn't try to "apply" to `.trigger'; it has .trigger in the (here<<<- ...) position at compile-time
13:12technomancy,`(do ~@(map / [1] [0]))
13:12clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.ArithmeticException: Divide by zero>
13:12technomancy,(do `(do ~@(map / [1] [0])) nil)
13:12clojurebotnil
13:13technomancy^ fun fact
13:13S11001001,`(do '~@(map / [1] [0]))
13:13clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.ArithmeticException: Divide by zero>
13:13S11001001&(doc memfn)
13:13lazybot⇒ "Macro ([name & args]); Expands into code that creates a fn that expects to be passed an object and any args and calls the named instance method on the object passing the args. Use when you want to treat a Java method as a first-class fn."
13:14S11001001frozenlock: as with .method forms, memfn also enforces knowledge of the argument count at compile time, for the same reasons
13:15S11001001there are some convenient static methods in the clojure java code you can use for making variadic, necessarily reflective calls, more conveniently than the java stdlib allows
13:18frozenlockI'm not sure I get everything :(
13:18frozenlockbut as a rule of thumb, dot calls should always be in the left position?
13:18frozenlock(here<<<<<< )
13:20hyPiRionfrozenlock: not neccesarily
13:20hyPiRion,(macroexpand '(.length "1234"))
13:20clojurebot(. "1234" length)
13:20TimMc,(macroexpand '(.foo "1234"))
13:20clojurebot(. "1234" foo)
13:21TimMc,(macroexpand '(.foo "1234" 42))
13:21clojurebot(. "1234" foo 42)
13:21TimMcHuh...
13:21frozenlocklol
13:21TimMc,(macroexpand '(. "1234" (foo 42)))
13:21clojurebot(. "1234" (foo 42))
13:22TimMcI'm still unclear on exactly when the compiler (as a whole) makes the decision on when an interop call is a field or method.
13:27augustlthis returns the value of the first function in a list that returns something truthy: (some #(%) [(fn []) (fn []) #(- 5 1) #(+ 1 2)])
13:27augustlany better ways to do it? #(%) looks weird..
13:28metellusidentity
13:28TimMcnot quite...
13:29augustlnope, that just gives me the first function :)
13:31TimMcfun-call
13:31TimMcDoesn't exist in CLojure, but you could write it. :-)
13:33S11001001#(% %&) should :)
13:33TimMc&(letfn [(fn-call [f & args] (apply f args))] (some fn-call [(fn []) (fn []) #(- 5 1) #(+ 1 2)]))
13:33lazybot⇒ 4
13:34TimMcS11001001: Needs an apply, yeah?
13:34frozenlockWell... I think I just overwritten my js library by giving a clojure namespace the same name as the library.
13:35S11001001'#(do %&)
13:35S11001001,'#(do %&)
13:35clojurebot(fn* [& rest__27#] (do rest__27#))
13:35frozenlockIn retrospect it's obvious.
13:35S11001001ah, heah, TimMc
13:35S11001001yeah
13:35S11001001got it mixed up with cut/cute's variadic syntax
13:35TimMc&(let [fn-call #(apply % %&)] (some fn-call [(fn []) (fn []) #(- 5 1) #(+ 1 2)]))
13:35lazybot⇒ 4
13:45ucbaugustl: you could try #(apply % '())
13:45ucbblip
13:45augustl:D
13:46augustlwhy the list instead of a vector?
13:46TimMcor nil
13:47ucbnothing in particular
13:47ucbcould've been #{} or even {} if you want
13:48S11001001(java.util.Map.)
13:48ucb(or nil as TimMc point's out)
13:48S11001001HashMap whatever
13:51sorenmacbethahoy!
13:51sorenmacbethcan one destructure namespace-qualified keywords from a map?
13:51sorenmacbethusing the {:keys [a b c]} m syntax
13:52sorenmacbethor do I have to do it long form?
13:56S11001001sorenmacbeth: I can't imagine a good short-form encoding.
13:57rippy(count [1 2 3]) ; prints 3
13:57rippyi want to do ...
13:57rippy(quote (count [1 2 3]))
13:58augustlhow do you add new columns with clojure.java.jdbc? Since I couldn't find that on google.. Is nobody actually using clojure.java.jdbc?
13:58rippysomething like that, but have it come out as 3
13:58S11001001rippy: and get...?
13:58technomancyaugustl: here's what I do: https://github.com/technomancy/syme/blob/master/src/syme/db.clj#L50
13:58augustltechnomancy: tnx
13:58technomancyc.j.jdbc isn't great, but it mostly gets the job done
13:58rippyso the (count [1 2 3]) gets evaulated in side before the quote
13:59technomancyaugustl: beware libraries that claim to be able to support DB-agnostic migrations
13:59rippynot sure if it can be done, i'm pretty new to clojure
13:59AimHereYou mean you want something evaluated inside a quote at compile-time?
13:59S11001001,`'~(count [1,2,3])
13:59clojurebot(quote 3)
13:59rippyawesome, thanks
13:59augustltechnomancy: indeed :)
13:59augustltechnomancy: do you have an example of an actual migration in there?
14:00svjsonI can't for the life of me seem to get compojure/ring to use a custom session store. (wrap-session {:store (whatev-store)}) seems to have no effect whatsoever. Anyone with experience there?
14:00technomancyaugustl: this might be a better example: https://github.com/heroku/buildkits/blob/master/src/buildkits/db/migrate.clj
14:00luxbockif I have a sequence [A B A A C B A C], how do I find out how many times an item takes place in the sequence?
14:01technomancyluxbock: try frequencies
14:01weavejestersvjson: Perhaps the session middleware has already been added with the default store.
14:02weavejestersvjson: Are you using compojure.handler/site at all?
14:02luxbockI'm doing a 4Clojure problem and frequencies is banned
14:02weavejesterluxbock: Just the one item?
14:02svjsonweavejester: Yeah, I'm starting off from template code generated from the leiningen plugin
14:02luxbockyeah just one item is fine
14:03svjsonweavejester: So, basically I've got this: (def app (handler/site app-routes))
14:03svjson(def war-handler
14:03svjson (-> app
14:03svjson (wrap-resource "public")
14:03svjson (wrap-base-url)
14:03svjson (wrap-session {:store (monger-store)})
14:03svjson (wrap-file-info)))
14:03nDuffIs cljs/lua still live? Its github repo doesn't look like it's seen action in a while.
14:03svjsonAh, that didn't format itself very good, sorry for spamming
14:03weavejestersvjson: handler/site adds in a session already
14:04weavejestersvjson: Try: (handler/site app-routes {:session {:store (whatever-store)}})
14:04svjsonweavejester: Aha!
14:04weavejestersvjson: Or alternatively, add the middleware yourself.
14:05brainproxyweavejester: is there a way to have ring print an exception to stdout/err when the ring reload throws, e.g. when it encounters a syntax error when reloading a namespace?
14:05weavejestersvjson: BTW, in Compojure, I tend to prefer (route/resources "/") over the middleware (wrap-resource "public")
14:05svjsonweavejester: Can't say I'm well versed enough to understand the difference there :/
14:06weavejesterbrainproxy: I suspect that might be lein ring server putting wrap-reload before wrap-stacktrace
14:06weavejestersvjson: Well, either will do.
14:07svjsonweavejester: Doing what you suggested with the session-store worked like a charm, though! Thanks - The banging of this head against hard surfaces may now cease.
14:08weavejestersvjson: Effectively the wrap-session added by handler/site overrode the wrap-session added by you
14:08brainproxyweavejester: i see, so maybe I should manually setup wrap-reload, and make sure wrap-stacktrace comes before it?
14:08brainproxyi.e. instead of depending on the :auto-reload? option in project.clj
14:09weavejesterbrainproxy: Which version of lein-ring are you using?
14:09brainproxy0.8.0
14:10weavejesterbrainproxy: Hm, in that the stacktrace printing should come last
14:10weavejesterOh wait
14:10weavejesterNo, I fixed it, but didn't release a new version
14:11weavejesterSo the repo is up to date, but I'll need to release a 0.8.1
14:11brainproxyokay
14:11weavejesterI'll do that tomorrow
14:11brainproxyquick question, would it be possible in the project.clj to specify wrap-stracktrace-log behavior vs. wrap-stracktrace?
14:11weavejesterbrainproxy: Not unless you wrap it yourself
14:12weavejesterbrainproxy: But I want to make wrap-stacktrace smarter for Ring 1.2
14:12brainproxyokay, that's what I meant, and that's fine
14:12minimalhttp://www.python.org/dev/peps/pep-0427/
14:12brainproxylein-ring is great btw, thanks for your hard work on it
14:12minimalah wrong window
14:13svjsonweavejester: turns out I also have (route/resources "/") among my routes (also generated by the lein-plugin). So what that does is basically to serve the resources directory under /, I gather. You said you prefer this of (wrap-resource "public") - are these two ways of achieving the same thing?
14:13weavejestersvjson: Yes. (route/resources "/") == (route/resources "/" {:root "public"})
14:14weavejestersvjson: Which will achieve the same effect as (-> handler (wrap-resource "public") (wrap-file-info))
14:14svjsonweavejester: In other words, I can toss (wrap-file-info) as well, then?
14:15weavejestersvjson: Yes, unless you're returning java.io.File objects from your own routes
14:15weavejesterbrainproxy: You're welcome :). Lein-Ring is a little tricky to write, because there's inevitably some corner case it doesn't apply to.
14:16svjsonweavejester: Got it, thanks.
14:17svjsonweavejester: Oh, and thanks for Compojure as a whole. I'm having great fun with it!
14:17weavejestersvjson: You're welcome :)
14:19technomancyweavejester: the evolution of compojure from "clojure web framework" to "library for setting up routes" is interesting to me; have you written/spoken anywhere about the process of paring it down and finding just the right way to decompose things?
14:21technomancymight be especially relevant with all this "full-stack" talk that was running on the mailing list
14:21weavejestertechnomancy: No, I don't believe so. It was mostly driven by the appearance of Ring. When I took out all the servlet stuff the only parts left were the routes and the HTML generation, and then it seemed natural to split them apart too.
14:22weavejestertechnomancy: I thought the consensus was just to create useful templates
14:22weavejesterGood templates for starting projects seem a good idea.
14:23technomancywell yes, but it's a limited consensus =)
14:24technomancyI agree that's the most effective way to communicate patterns to newcomers myself.
14:24nz-example apps that go beyond simple hello world, are also nice
14:27technomancythe motivation and process behind that might make a good blog post or conference talk
14:28ucbtechnomancy: got a sec to look at my checkouts/ setup? it doesn't seem to be working unfortunately :(
14:28technomancyucb: sure
14:29asteve(let [[x y] ((fn [] [1 2]))] [y x]) is the same as (defn one-two [] [1 2]) (let [[x y] (one-two) [y x])?
14:29ucbtechnomancy: this is the tree https://gist.github.com/4558722
14:29asteveone-two)]*
14:29ucbtechnomancy: and the relevant project.clj https://gist.github.com/4558728
14:30amalloyasteve: well, except one of them leaves a function defined in the global scope
14:30asteveamalloy: that is what I want
14:30technomancyucb: and riemann.orig has a proper checkout of riemann with a project.clj in it? what does `lein classpath` say?
14:31asteveI guess I need to verify that I only need a single parenthesis around the function call one-two
14:31asteveand when a function has no input, do I leave it blank?
14:32ucbtechnomancy: indeed; lein classpath where? in centinela or riemann.orig?
14:32asteveshould it be (one-two) or (one-two [])?
14:32technomancyucb: in the project that has a checkouts/ dir
14:33ucbtechnomancy: I get https://gist.github.com/4558782
14:33amalloyasteve: (one-two []) calls the function with a single argument, the empty vector
14:33ucbtechnomancy: so that's basically my problem, lein deps or lein repl report the same thing
14:34ucbtechnomancy: that's why I was wondering whether I need to build the projects in checkouts/ or? If I lein install rieman.orig everything works fine (as expected)
14:34ferdanybody using monger + ragtime + lein ? any example to start form?
14:34asteveamalloy: I want one-two to take in no argument; so (one-two) is more appropriate?
14:34technomancyucb: :dependencies and checkouts/ are orthogonal; the only overlap they have is that they both affect the classpath
14:35amalloyi've already answered that question twice. what you wrote the first time is correct
14:38ucbtechnomancy: I see. So, checkouts/ should be added to the path even if I don't list riemann as a dependency?
14:38technomancyucb: right
14:41ucbtechnomancy: right, if I remove riemann from the dependencies it all works and it appears fine in the classpath
14:41ucbworks means I get a repl; trying to use/require an ns from riemann fails though
14:41ucbthat might be a different problem though
14:41technomancyucb: right, because the dependencies don't get pulled in
14:41technomancybecause it's not in :dependencies
14:42augustlI'm getting a NullPointerException when I use "jdbc:h2:mem:" as the arg to with-connection.. Any ideas why?
14:42ucbtechnomancy: oh, so adding checkouts to ... grumble ... how can I get riemann's dependencies pulled in then?
14:42ucblisting riemann as a dependency I suppose, but that didn't quite work for me earlier
14:42technomancyucb: if you have a dependency you have to put it in :dependencies
14:43technomancyyou can also put it in checkouts, but you can't omit it from :dependencies
14:43augustlanyone ever used h2 in-memory from clojure.jdbc?
14:44ucbtechnomancy: fair enough, say I depend on the entirety of riemann. I've added [riemann "X.Y.Z"] to my dependencies however it failed at fetch time from clojars (it hasn't been published)
14:44augustlcan't seem to figure out what the correct URL is, the one from the h2 docs doesn't seem to work - "jdbc:h2:mem:"
14:44technomancyucb: sure; that has nothing to do with checkouts
14:44ucbtechnomancy: I've obviously misunderstood checkouts then :)
14:45technomancyyou are not alone
14:45technomancyI simply can't figure out how to explain it differently though.
14:45ucbI suppose I'll have to go the lein install route for now
14:45ucbtechnomancy: so, checkouts only affects the classpath, correct?
14:46technomancyI think people assume it does more than it actually does or something.
14:46technomancyright
14:46ucbright, if that's the case I understand now. As you say, I assumed it did more than it does.
14:46augustlwow, clojure.java.jdbc seems to do a lot of parsing of the URLs on its own
14:47ucbI suppose that I was expecting checkouts to put a working version of riemann on my classpath
14:47ucbbut it only puts the riemann code on the classpath and not its dependencies
14:47ucbI see now. Thanks technomancy
14:47technomancyright; it's supplementary and non-transitive
14:48technomancyif you can think of how to explain it so people wouldn't be confused by it I would be happy to update the docs, but at this point I'm beginning to think it's impossible =)
14:53ucbtechnomancy: how does this read "Checkouts will only affect your project's classpath, i.e. only the clojure source code of the projects you're hacking in paralell will be placed in your classpath but not their dependencies."?
14:54ucbtechnomancy: to replace "Libraries located under the..." in https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md
14:56technomancymaybe "not transitive" isn't clear enough
14:57ucbI understand transitive now that we've been through the dance.
15:00technomancymaybe this is better? https://github.com/technomancy/leiningen/commit/6e42ceea191ac80b86b7b270240dc1a6576bd651
15:02ucbtechnomancy: that reads better; but there's still an edge case, i.e mine. I've a version of riemann in checkouts/ that hasn't been pushed. Even after puttin riemann in checkouts/ I can't put it in :dependencies because lein won't find it in clojars
15:03technomancyucb: that's completely unrelated to checkouts though
15:03tomoj&(with-meta (constantly 42) {})
15:03lazybot⇒ #< clojure.lang.AFunction$1@6e6189>
15:03technomancyyou can't put things in :dependencies that aren't in a repo ever
15:04ucbtechnomancy: sure, but I thought checkouts/ (somewhat) was my solution to my problem: I want to work on riemann as well as on my project.
15:04amalloytomoj: http://dev.clojure.org/jira/browse/CLJ-908 is related
15:04tomojthanks
15:05ucbtechnomancy: my point is, no matter how thick I may be, the description of checkouts/ seemed like a good fit for my problem.
15:06technomancyis it not?
15:07ucbwell, no. I mean, it's half a solution. I don't want to list all of riemann's dependencies as dependencies of my top-level project
15:07hiredmanbut you shouldn't need to
15:07technomancyof course; it's supplementary
15:08technomancythat's the whole point
15:08hiredmanif you have riemann as a dep you should get all its deps
15:08amalloyi get the impression his locally-modified version of riemann has different deps
15:08ucbhiredman: problem is that I'm using a version of riemann that hasn't been pushed to clojars
15:08ucboh wait
15:09ucbI haven't changed the dependencies. Maybe I should see if there's a diff and instead depend on a published version of riemann
15:09technomancythe problem checkout dependencies solves is "I don't want to have to re-run `lein install` and restart my repl whenever the source changes"
15:09hiredmanucb: exactly
15:09ucbtechnomancy: indeed
15:09hiredmantechnomancy: codeveloment dependencies
15:09ucbhiredman: problem with that is that if I push my project anywhere, all of the sudden I'm depending on the wrong version of riemann
15:10technomancydoing the "install/restart" cycle when dependencies change is still necessary, and not nearly as annoying as having to do it all the time
15:13augustldo I have to use a singleton connection with korma? Or can I pass in a connection thingie to queries?
15:14nDuffaugustl: I haven't used it in a while, but I thought korma used dynamic vars, no?
15:15nDuffaugustl: ...so, you may not be passing them in with queries, but that's plenty of fine-grained control over which ones are used when.
15:17augustlnDuff: yeah if I can bind it that's more than good enough
15:17augustlnDuff: I like to mount my actual apps when testing them, singletons makes that tedious..
15:21augustlah, there's a with-db
15:23andersfaugustl: leaving datomic? :)
15:25nybbleshey does anyone know how to paste a string into a repl so that quotes are escaped? i.e. i have a bunch of json that i want to paste into the repl
15:25nybblessomething like the '''blah''' syntax in python
15:27upgradingdavehey all, I'm trying to wrap my brain around bound-fn and bound-fn*, trying to understand why bound-fn* doesn't seem to eval the function shown here: https://gist.github.com/4559296, any ideas?
15:28nybbleswhoa.. holy crap, i just found out how
15:29mpenettechnomancy: I am not sure it's still true, but I noticed something with checkouts: when doing lein jar/uberjar it won't take the code from the checkouts, but get it from the local repo. Is this by design (repeatability and all) ?
15:29mpenetgets*
15:29technomancympenet: yes, checkouts shouldn't influence downstream consumers
15:30mpenetright
15:30augustlandersf: nah, different project
15:30ebaxtI'm looking for a client-side router for ClojureScript. Found https://github.com/gf3/secretary, any other suggestions?
15:30technomancyso by design
15:30augustlandersf: two clojure projects at work now, w00t :)
15:30llasramupgradingdave: bound-fn/* return *functions*
15:30mpenetebaxt: snout
15:31mpenetI didn't use it but I know some people who do and seem happy with it.
15:32ebaxtmpenet: thx!
15:32ebaxtaugustl: Client project or internal? :)
15:34no7hingthanks, i was about to ask about the cljs router lib too
15:35upgradingdavellasram: ahhh, ok, I glanced at def for bound-fn* and saw the line (apply with-bindings* bindings f args). But now I see it returns a fn, thx
15:35frozenlockarrr! Interop will be the death of me... (`(.trigger component ~@args)) doesn't work, even if the compiler is ok with it... How can I have a method with variable number of args?
15:35augustlebaxt: one internal-ish, one client
15:36nDufffrozenlock: Out of context of the enclosing defmacro, that doesn't look so insane to me.
15:36biff_tannenhey ... newbie user here trying to get acquainted with the language ... i just cloned this repo (https://github.com/briancarper/cow-blog) and am trying to follow the instructions ... theres a step that mentions a .clj file that i need to 'run' in order to create the db tables ... how exactly do i run a specific .clj file with lein (if lein is the right tool to use) ?
15:36amalloyfrozenlock: the compiler is okay with it because it's valid code for constructing a list object and then calling it
15:36frozenlock(defn trigger
15:36frozenlock [component & args]
15:36frozenlock (`(.trigger component ~@args)))
15:36frozenlock
15:36ebaxtaugustl: cool, *envy*
15:36amalloynDuff: no, it's insane
15:36nDufffrozenlock: ...it's a defn, not a defmacro? Then that's seriously wrong.
15:36llasramfrozenlock: `(. component trigger ~@args)
15:37augustlebaxt: it's a bit painful atm though.. Doing SQL stuffs was a bit more work than I expected
15:37amalloyyou guys are all crazy. you just can't do that to a special form like . at runtime; suggesting code to him that obviously won't work doesn't help a lot
15:38llasramSorry -- I thought this was in the context of a macro
15:38nDuffamalloy: Was I suggesting other code? I'm pretty sure the only thing I asserted was that that was broken.
15:38amalloyfrozenlock: the best you can do is (fn ([component] (.trigger component)) ([component x] (.trigger component x)) ...)
15:38nDuff(unless being done within a macro, in which case it's at compile time, in which case it's valid/legal)
15:38frozenlockamalloy: can I splice 'x'?
15:39ebaxtaugustl: greenfield?
15:39amalloynDuff: yes, i did a bad job of rebuking both of you at once
15:39augustlebaxt: both are, yeah
15:39augustlaren't that many large clojure projects around in Norway :)
15:39frozenlockOh, a different case for each number of arguments?
15:40amalloy(`(.trigger component ~@args)) is provably wrong whether in a macro or not, though, which was why i said you were crazy for saying it looked fine
15:40ebaxtaugustl: Yes, no kidding. We need to fix that
15:40andersfaugustl: what's the other one?
15:40gf3ebaxt: I used secretary for a project, it could use some love but it works
15:40gf3ebaxt: I mean, I wrote it to use in a project
15:42ebaxtgf3: Cool, I'll have a look. Any gotchas I should know about?
15:42frozenlockamalloy: It works (I'm sure you knew that :P), thank you very much.
15:42gf3ebaxt: The param substitution supports many options but could be more robust, I think it has tests
15:43augustlandersf: husleie.no
15:43gf3ebaxt: Secretary works well with Closure's hashchange stuff, that's how I used it
15:43technomancybiff_tannen: you should be able to use `lein run -m whatever.namespace` if it's set up properly
15:45biff_tannentechnomancy ok, i'll try that ... i was also trying to run it via REPL, but i can't figure out how to include the local file structure
15:45gf3ebaxt: Here's a code fragment lifted from the project (note: There are things in there you don't need) → https://gist.github.com/fd8c8a4ec16d0ff35ffb
15:46ebaxtgf3: thx!
15:48gf3ebaxt: NP, updated gist
15:56upgradingdavehmmm, I'm still not fully understanding bound-fn...not sure why this dosn't use the "different" binding. Thanks again in advance your help, driving crazy all day ... my brain hurts...https://gist.github.com/4559296
15:57llasramupgradingdave: lazy seqs again
15:58upgradingdavedoh, so I guess bound-fn has to be wrapped around the for?
15:58upgradingdaveand then map apply to the resulting lazy-seq of fn's?
16:01llasramupgradingdave: So functions created with bound-fn will restore dynamic var bindings visible when the function is defined, but only within the scope of the function's execution
16:01llasramupgradingdave: A lazy seq which is realized in a different dynamic scope sees the values at the point where realization occurs
16:02amalloythe point is more that it will restore only dynamic var bindings that were in place when the function was defined
16:02amalloyhere, no dynamic bindings were in place when bound-fn was called
16:02amalloythe seq of bound-fns is not realized until after the binding exits
16:02llasramOh, that too :-)
16:04upgradingdaveI think it'll take me a while to digest that, but very helpful, thx
16:05pbostromhey y'all, I've been working on a little side project, a shared, web-based REPL, I was wondering if anyone is interested in checking it out, I'm mostly just curious if it will actually work: http://cwo.io
16:05skelternetjust tried (doc doc)
16:06saolsenneat
16:06frozenlockpbostrom: really nice!
16:06skelternetI guess I was in the home repl
16:07saolsenbackspace isn't working in the repl
16:07kovasnice
16:07kovaspbostrom: I'm working on a similar project, https://github.com/kovasb/session, if you are interested in collaborating
16:08saolsenso can you not type in other peoples repls?
16:08pbostromkovas: yeah, I saw that a few days ago, it gave me some motivation to polish mine up a little bit
16:09kovascool. well now I'm motivated as well :)
16:09pbostromkovas: I will check it out, still working on getting mine put up on github
16:09saolsenvery neat
16:09kovaswhat did u do the front end in?
16:11pbostromkovas: it's cljs with jquery and bootstrap
16:11pbostromsaolsen: you can only type in someone else's repl if they transfer to you
16:12saolsenpbostrom: oh cool, I see that now
16:13pbostromsaolsen: I did include core.logic, but that's one of the few non-core libs
16:13pbostromoops, maybe not
16:14pbostromanyway, thanks for humoring me, I'll try not to take up too much more of the chat with this
16:14frozenlockpbostrom: really really nice.
16:14kovasis the repo clojailed?
16:14kovasrepl
16:14pbostromyes, clojail
16:15frozenlockIs it possible to simultaneously connect to a repl with emacs/vim?
16:15frozenlockI might be pushing it here... :P
16:16saolsenif it uses nrepl that doesn't sound too crazy
16:16ebaxtkovas: do you have a demo site of session?
16:16pbostromno, the editing experience was the thing I spent the least amount of time on
16:17kovasebaxt: i haven't set up a clojailed version, so not yet
16:17pbostromI'm going to look into trying to swap in nrepl at some point
16:17kovasit should be pretty simple to just clone the repo and run the 2 commands
16:44devnyogthos: Is it possible to run the luminus template on top of an existing project?
16:45devnSort of like rails generators where it would prompt you if there are conflicts?
16:54S11001001devn: you've been storing your project in a version control system?
16:55Sgeo_Monticello totally counts as a good version control system, right?
16:57amalloymonticello sounds more like a font
16:57S11001001I follow this lovely process, which works even if the template system is "here's the base template set, edit these files to do stuff"
16:57S110010011. go back to when you checked in the pure template
16:57Sgeo_It's a version control system for Smalltalk
16:58S110010012. make a rev on top of that with the new template/paster/whatever
16:58S110010013. merge that into your project
16:58devnMonaco is a better name for a version control system
16:58S11001001your VC is better at managing conflict resolution anyway
16:58devngambling!
16:58Sgeo_Convenient enough to use that I'm actually likely to use it for stuff!
16:58devnmaybe you get that commit history... maybe you don't... lay your cards on the table
16:59devnS11001001: yeah i can do it by hand. it's more of a feature request
16:59S11001001I'm suggesting it's an antifeature
16:59devni dont think we're talking about the same thing
16:59S11001001because, whereas the VC records the history of the relationship between the template and your changes
16:59S11001001a paster's resolution doesn't
16:59S11001001maybe not
17:01devnS11001001: i would like to have a command line "lein add-luminus" which initializes the files for a base luminus project, and if i dont have any conflicts, it just gives me those files and adds deps to my project.clj
17:02devnif there are conflicts, it says: "do you want to overwrite, quit, get a diff, edit, or continue without action"
17:03devni routinely have a clojure thingy ive been playing with that ive built from the bottom up. that's how most of my clojure projects go. I start with some data manipulation stuff and do some interesting stuff, and then i want to give it a simple web interface
17:03devnit would be nice to just say "sudo give me a working web stack"
17:04hyPiRiongem install hairball
17:04devnthe only conflicts i would have had in my current project are: project.clj and src/myproject/util.clj
17:04devnhyPiRion: that's hyperbolic
17:05devnyou go to your project.clj and add a dep and run lein deps, did you just "lein get hairball"?
17:06devnhyPiRion: there's nothing wrong with making something easy at the expense of flexibility if you don't give a damn
17:06devni reserve the right to piss all over my personal projects
17:11hyPiRiondevn: what? I was referring to http://www.youtube.com/watch?v=rI8tNMsozo0#t=947s
17:13devnhyPiRion: i think we probably agree with the "simple ain't easy" stuff, but i think what you sort of are doing by parroting that quote in this context is suggesting that i didn't think about ease vs simplicity. i have, and i want something easy in this case. i don't think that's a crime.
17:15devncorrect me if im wrong, but i think people need to relax a bit and say: "hm, yeah, i see what you did there. you composed some very common libraries into a template and wrote some boilerplate. thank you. now, i'd like to drop it all into my project."
17:24devnit's the same thing clojure the language does: it's pragmatic about side effects. it steers you away from them, but it doesn't say "absolutely not". stuart halloway once called clojure a "consenting adults language". as a community i think we should try to steer people away from making a mess, but no one should be given the snide "gem install hairball" if they're conscious of the tradeoffs and decide that whatever tradeoffs may exist are orthogonal to the ...
17:25devn... problem they're fundamentally trying to solve.
17:25devnhyPiRion: do you think that's wrong?
17:28devnin this case: I have a bunch of code that has nothing to do with building a website. i just want a quick way to get some boilerplate and common dependencies so I can type a command and go home. there's nothing "hairball" about that.
17:28frozenlockI'm once again confused by cljs interop... (this-as this (set! (.-field this) value)) works, but this doesn't: (this-as this (set! (. this field-name) value))
17:29nDuff...right -- because (. this field-name) is an invocation, not a property reference. IIRC.
17:30amalloyfrozenlock: (. this -field-name) would be equivalent
17:31frozenlockHmm... is there another way to access the field? I have the field name as a string. (symbol (str "-" field-name)) makes me feel dirty inside.
17:34piranhafrozenlock: (aset this field-name value)
17:35AimHereEvery time I have to change symbols and/or keywords by converting to str and then modding and converting back, I have to take a cold shower
17:35piranhaif I understood correctly
17:36frozenlockpiranha: Well at least the repl didn't choke on it. Let me see if it works.
17:37piranhafrozenlock: ah well, read your messages properly - yes, this is exactly what you need for cljs (didn't notice 'cljs' mentioned)
17:41frozenlockpiranha: Seems like it, thank you very much :)
17:46seangroveIf I have a function that uses keywords, can I pass a map to it and have it destructured?
17:47seangrove(defn open-popup [& {:keys [oauth-url base-url]}] ...) and calling it with (open-popup {:oauth-url "x"})
17:48bbloom,(apply (fn [& {:keys [x y]}] [x y]) (apply concat {:x 1 :y 2}))
17:48frozenlockYes, but if you use &, you'll need to put your {:keys ...} in a vector IIRC.
17:48clojurebot[1 2]
17:48bbloomthat's the best i've got :-)
17:48amalloy~mapply
17:48clojurebotYou could (defn mapply [f & args] (apply f (apply concat (butlast args) (last args))))
17:48seangrovewow, looks gnarly
17:48amalloyyes, it's ugly because it's bad
17:48bbloomi generally don't like keyword functions
17:48amalloy& {:keys ...} just leads to pain eventually
17:48lazybotjava.lang.RuntimeException: Unable to resolve symbol: ... in this context
17:49seangroveWhy's that?
17:49amalloybecause it makes the function near-impossible to apply
17:49frozenlockReally? I find it really convenient to pass arguments around.
17:49seangroveAh, I see
17:49bbloomit's optimizing for usage over composition
17:49hiredmanand, I mean, what else are you going to do with a function besides apply it?
17:50hiredmanattach metadata to it? hah!
17:50gfredericksclojure/west ends rather early on wednesday...I guess not many people will be staying through the evening?
17:51eggheadmy flight out is wed. night
17:51bbloomi'm out early thursday morning
17:54gfredericksalright I'll do wednesday night
17:56frozenlockIf you don't use keywords argument, do you limit your functions to 2-3 arguments?
17:57amalloyfrozenlock: instead of (fn [& {:keys [a b c d e]}]), (fn [{:keys [a b c d e]}]) is just as "legible", and much more flexible
17:58frozenlockOh I see, '&' is the problem.
17:58bbloomkeyword arguments are only really useful for functions that are command-like
17:59bbloomwhich is pretty rare
17:59bbloomstuff you intend to use form the repl
17:59bbloomin that sense, they are like --flags
18:03frozenlockquote isn't defined in cljs?
18:04bbloom,`quote
18:04clojurebotquote
18:04bbloomit's a special form, not a function or macro
18:04bbloom,`not-quote
18:04clojurebotsandbox/not-quote
18:10frozenlockOh my mistake, I just remembered there's some special incantation for macros in cljs. -_-
18:48AtKaaZhi, how can I specify class type in a let form like ^ClassName or ^{:tag ClassName} when I want to (def ClassName java.io.File), is that even possible?
18:49mattmoss,(let [cls java.io.File] cls)
18:49clojurebotjava.io.File
18:49AtKaaZI mean like this let [^String full-path "test"]
18:49mattmossAh...
18:49mattmossDon't know that you can.
18:49amalloyno
18:49AtKaaZaw :(
18:50mattmossTHIS IS NOT JAVA. lol
18:50AtKaaZmaybe I can use the c++ preprocessor
18:50mattmossegads
18:52TimMcIt would probably be possible to do this with a macro.
18:53amalloyTimMc: no
18:53TimMcNote that (not= could should).
18:53amalloywell, you could do it with a sufficiently aggressive macro, but such a thing would break a lot of other things
18:53TimMc:-)
18:53AtKaaZso if I make the macro return ^java.io.File it would work?
18:54TimMcThat's not a thing, so a macro can't return it.
18:54AtKaaZoh right
18:55cbp`import-static wasn't migrated right? do i need to write it or is there a new import-static?
18:55AtKaaZwhat macro preprocessors would you guys suggest?
18:55Sgeo_Is there some weird metadata problem going on?
18:56AtKaaZSgeo_: i just want to be able to specify the class type in only one place in the (def cls java.io.File) for example
18:56bbloomwhat's icky about it? i've found it to be absurdly useful
18:57hyPiRionAtKaaZ: I'd recommend search-and-replace.
18:58brehautbbloom: i think theres a noob trap where metadata applied with ^ (ie to forms) is primarily for the compiler/macros, and with-meta is what you want for runtime meta
18:58AtKaaZhyPiRion, that's what I'm trying to avoid :)
18:59bbloombrehaut: that is definitely true
18:59bbloomAtKaaZ: what you want is the ability to create type aliases for use in hints, right?
19:00AtKaaZbbloom: i think so
19:00bbloomthat's a legitimate feature request. dunno if it's one that would ever be accepted, but it seems sensible
19:00bbloomi've wanted something similar for Clojure / ClojureScript hybrid projects
19:00bbloomthe thing is that ^Foo and ^{:tag Foo} performs static class name resolution
19:01bbloomthe issue is that metadata with ^ is evaluated at read time
19:01AtKaaZI'm thinking of using m4 but does anyone know how I could integrate that with leiningen? something like preprocess the source before being fed to lein
19:01bbloomwhich is what brehaut was alluding to
19:01AtKaaZit's static which I needed in my case
19:03bbloomi mean that it's looking up classes by name with a class loader
19:03bbloomit won't look at symbols local to your code
19:03bbloomand this occurs when the file is read, not when it's being compiled
19:03hiredman,(meta (quote ^Foo foo))
19:03clojurebot{:tag Foo}
19:04hiredman,(type (:tag (meta (quote ^Foo foo))))
19:04clojurebotclojure.lang.Symbol
19:04bbloomAtKaaZ: Why do you need a type alias anyway? maybe we can suggest an alternative?
19:04AtKaaZbbloom: it's just for code structure really, ie. it's like stating that all those places where this symbol is used are meant to use the same class (where symbol would be the classname)
19:05hyPiRionhiredman: ##(let [^String foo "foo"] (meta foo))
19:05lazybot⇒ nil
19:05bbloomAtKaaZ: i think you're overthinking it :-P my suggestion: just don't do that
19:05bbloomproblem solved!
19:05AtKaaZwell, you're right
19:06hiredmanhyPiRion: you are looking at the metadata of the string "foo" there
19:06bbloomif you really want that, #haskell is over that way --->
19:06hiredmanthere is no way to look at the meta of foo in that example out side of a macro
19:06AtKaaZbbloom, I'll check, thanks
19:07frozenlockOmg noes!!!
19:07bbloomfrozenlock: whoa whoa, that's 4 hyphens, you went way too far
19:07arrdemyeah that's #lisp
19:07brehautfrozenlock: i think you just saw #coq
19:08technomancydevn: I am interested in allowing `lein new` templates to run in existing projects
19:08TimMccbp`: Does this work for you? https://github.com/baznex/imports
19:13cbp`thanks
19:16TimMcLet me know if there are any features you want. It was fun to work on, and I learned a hell of a lot about the compiler.
19:39cbp`will do
19:47AtKaaZok, haskell&co is not what I want...
19:49Sgeo_AtKaaZ, what's wrong with Haskell?
19:50ChongLihaskell is a fantastic language
19:50ChongLiI just wish its standard library was as good as clojure's
19:51ChongLiparticularly the sequences library and all the niceness of maps and sets
19:52AtKaaZSgeo_: nothing, I can even do that typing that I said above
20:30bbloomhmmm looks like fogus is up to something.... https://github.com/fogus/ariadne
20:30technomancyfogus is always up to something
20:31Sgeo_o.O Smalltalky stuff!
20:31Sgeo_"The oldest example is also the source for the name - the Smalltalk development environment. "
20:31Sgeo_:D
20:31bbloompeeking through his reading list, it looks like he's putting together a rules engine on datomic
20:32bbloomwhich would be pretty cool :-)
20:32AtKaaZwhat's that simulant thing?
20:33bbloomAtKaaZ: i think it's an integration testing framework that some relevance guys are working
20:33bbloomon
20:33AtKaaZprivate github repo? since I can't find it
20:34bbloomi think they are planning on revealing it at clojure/west
20:35technomancysecret open source
20:35technomancyso weird
20:36brehauteveryone wants secret sauce
20:42tomojhttp://clojurewest.org/sessions#halloway
20:49frozenlocktomoj: I really hope this will be recorded...
21:11RazWelles_Is there a way to explore a library from clojure like is done with python's "dir"? I'm trying to view what's available in a dll I just loaded in clojureclr
21:12bbloom,(ns-publics *ns*)
21:12clojurebot{}
21:12skelternetwhat all can clojurebot do?
21:13RazWelles_I got empty brackets with that
21:13bbloomyeah that's your local namespaces' publics
21:13RazWelles_ahh so I guess that means my load was a failure o.x
21:13bbloomno
21:13bbloomthat's your local namespace, not what's imported
21:14RazWelles_How would I investigate what's imported?
21:14bbloomtry (find-doc "clojure.core/")
21:14ivan,(ns-publics 'clojure.core)
21:14clojurebot{sorted-map #'clojure.core/sorted-map, read-line #'clojure.core/read-line, re-pattern #'clojure.core/re-pattern, keyword? #'clojure.core/keyword?, unchecked-inc-int #'clojure.core/unchecked-inc-int, ...}
21:15bbloomRazWelles_: yeah, what ivan said :-)
21:15RazWelles_ok trying that :)
21:15bbloomand then you can do:
21:15bbloom(doc sorted-map)
21:15clojurebot"([& keyvals]); keyval => key val Returns a new sorted map with supplied mappings."
21:15bbloomfor example
21:16ivanit took me a while to figure out that I should just pass a symbol into that function
21:16ivansuper-obvious to everyone else, I'm sure
21:16bbloomivan: not at all, i was just mucking with it lol
21:16bbloomreally should be documented better :-P
21:17AtKaaZis there a one liner that I can put at the beginning of a file to prevent anything below from getting executed/compiled/loaded ?
21:18bbloom(comment .............. )
21:18bbloomso a two liner
21:18amalloy(throw (Exception.))
21:18bbloomyou need to give it the ending )
21:18bbloomamalloy: lol
21:18brehaut(inc amalloy)
21:18lazybot⇒ 41
21:18amalloy(/ 1 0)
21:18clojurebot#<ArithmeticException java.lang.ArithmeticException: Divide by zero>
21:18AtKaaZI need it to be ignored, for some reason midje loads all
21:19AtKaaZI think I'm stuck with the two liner then? thanks
21:25gfredericks(alter-var-root #'read (-> nil constantly constantly))
21:27AtKaaZinfinite loop?
21:27gfrederickshaha that's a funny one to try at the repl
21:27frozenlockcljs: "WARNING - dangerous use of this in static method envision_cljs.timeseries var this$ = this;" Is this warning always present when one uses `this-as', or am I doing something wrong?
21:27gfredericksAtKaaZ: I have no idea about the implications :P
21:28AtKaaZgfredericks: what is it supposed to do in non-repl?
21:29gfredericksAtKaaZ: bork everything
21:29gfredericksAtKaaZ: it was supposed to be a crazy-hilarious knee-slapper. do not try this at home more than several times.
21:30skelternetwould be cruel to slip that in someone else's code
21:30AtKaaZrestarting eclipse... :D
21:31skelternetI had a colleague who redefined the value of 0 in an early version of FORTRAN
21:32gfredericks woah this gives me crazy ideas
21:33frozenlockgfredericks: Like trying it on clojurebot?
21:34gfredericks,(alter-var-root #'read (partial comp #(if (integer? %) (inc %) %)))
21:34clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
21:35gfrederickshuh
21:35gfredericks(+ 1 2) returns 3 while 0 returns 2
21:35clojurebot*suffusion of yellow*
21:35ivanbug report: nREPL does not recover from (alter-var-root #'read pr)
21:36frozenlockI never tried to run a repl on top of the repl in clj. (I did once in CL for the heck of it)
21:36frozenlockLiterally: read eval print loop
21:39AtKaaZdid anyone do something with 3D and clojure's AST?
22:17AtKaaZdid anyone try to write clojure code in java? via like RT class, where can I find docs about this?
22:18brehautlol docs
22:19AtKaaZtutorial? :)
22:19nonubynewbie, i have a json file (which I have no control over), I load it in via load-blob fn so now i have a hash map, i need to make several changes to do so i have another fn called transform-json, i have a series of assoc-in that I chain together via -> to get the return transformation, presumably this isnt very pragmatic?
22:19AtKaaZwell I mean, I could read the clojure code,
22:19brehautAtKaaZ: you basically want to look at the interface for RT.var and Var.invoke i belive
22:20brehautyup, thats it
22:20AtKaaZk thx
22:20brehauthttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L331-L333
22:20brehauthttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Var.java#L410-L529
22:21brehautAtKaaZ: ^
22:21frozenlockpbostrom: Is your repl project OSS?
22:21AtKaaZbrehaut: what are the invokes supposed to do
22:22brehautAtKaaZ: invoke the function int he var for different arities
22:22AtKaaZbrehaut, I should look up what a var is
22:22brehautAtKaaZ: a var is a thing in a namespace
22:23AtKaaZbrehaut: like the most elemental thing is a var? ie. a symbol is a var?
22:23brehautso clojure.core has a big old bag of vars, such as symbol, let, conj, defn, list, map, filter, vector, vec etc etc
22:23brehautno, a symbol refers to something that may be a var
22:23AtKaaZoh
22:24brehautsymbols tpyically refer to either lexical values (locals, arguments etc) or to namespace Vars
22:24pbostromfrozenlock: I have it in a private repository at the moment, but I can put it out on github if you want to take a look at it
22:24brehautVars are defined with def and friends
22:24AtKaaZright, cool
22:25frozenlockpbostrom: I would really like to :)
22:25brehautAtKaaZ: http://clojure.org/vars
22:25xumingmingvbrehaut: is there a way to get the var for a object(function, macro) dynamicly?
22:25brehautxumingmingv: RT.var
22:26brehautxumingmingv: unless you want to get the var by the thing it points to, in which case probably not
22:26xumingmingvI know (var xxx), but it seems checks whether xxx exists statically
22:26pbostromfrozenlock: ok, give me a sec, just a warning, it might not follow a lot of the best practices that some of the experienced clojure devs might recommend
22:26brehautxumingmingv: (var (symbol "foo")) ?
22:26AtKaaZbrehaut, thanks, that's what I want to read
22:26brehaut,(var (symbol "inc"))
22:27clojurebot#<CompilerException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol, compiling:(NO_SOURCE_PATH:0)>
22:27brehauthah no
22:27brehautlooks like var is a macro
22:27xumingmingvvar is a special form
22:27brehautoh. special form
22:28xumingmingvresolve might be the trick
22:28brehaut,(clojure.lang.RT/var "clojure.core" "inc")
22:28clojurebot#'clojure.core/inc
22:28brehautyeah resolve works
22:28xumingmingvbut then the question is how to get the symbol for a object (function or macro)
22:29brehautdue to the potential *:1 relationship between vars and an object, that seems difficult
22:29aperiodici'd imagine that you can't do it at all for macros, since you can't use them as values
22:29brehautxumingmingv: anyway, why do you need the var if you have the thing it refers to
22:29xumingmingvAcutally I want to check its metadata
22:29AtKaaZa macro is a var though right?
22:30xumingmingvmacro IS a var
22:30brehaut,macro
22:30clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: macro in this context, compiling:(NO_SOURCE_PATH:0)>
22:30brehautno its not :P
22:30xumingmingvto check its metadata, i need its var
22:30AtKaaZI meant, a defined macro
22:30aperiodic,->
22:30clojurebot#<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/->, compiling:(NO_SOURCE_PATH:0)>
22:31aperiodic,(var '->)
22:31clojurebot#<CompilerException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.Symbol, compiling:(NO_SOURCE_PATH:0)>
22:31AtKaaZI remember it has meta
22:31brehautAtKaaZ: yes, a macro is referenced by a var, but you cant get the value for it
22:31AtKaaZbrehaut: what do you mean by value?
22:31skelternet,(class '->)
22:31clojurebotclojure.lang.Symbol
22:31brehaut,when
22:31clojurebot#<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/when, compiling:(NO_SOURCE_PATH:0)>
22:31AtKaaZoh that?
22:31skelternet,(class ->)
22:31clojurebot#<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/->, compiling:(NO_SOURCE_PATH:0)>
22:31brehautAtKaaZ: something you can get hold of
22:31aperiodicsomething you can pass to functions
22:32AtKaaZcan pass the var I guess
22:32brehaut,#'when
22:32clojurebot#'clojure.core/when
22:32brehautbut im not sure what use that is
22:33AtKaaZlike to check if the symbol is a macro maybe
22:33brehautmacros are (effectively) installed into the compiler
22:33AtKaaZare macros in the AST?
22:33brehautsure
22:33AtKaaZawesome
22:33brehauter, sure checking meta data
22:33AtKaaZah
22:33brehautno idea about AST
22:34AtKaaZstill trying to understand things...
22:34brehautim not sure what clojure does with ASTs (if any)
22:34xumingmingvbrehaut: yeah, I want to check function/macro's metadata, so I need its corresponding var.
22:35brehautxumingmingv: i suspect you may need to exhaustively search all the namespaces?
22:35xumingmingvuntil find the var?
22:35brehautindeed
22:36brehautfunctions dont hold back references to their vars
22:36brehautand many functions dont have vars
22:36frozenlockpbostrom: you weren't here to see me ask dumb question this afternoon... :P
22:36AtKaaZI've something related to that: https://github.com/DeMLinkS/demlinks/blob/master/src/runtime/util.clj#L15
22:36brehautAtKaaZ: a lisp style crime has been commited by that code
22:36brehaut~style
22:37clojurebotstyle is http://mumble.net/~campbell/scheme/style.txt
22:37AtKaaZok, checking
22:37brehauthanging parens are nasty
22:37xumingmingvbrehaut: thanks!
22:37brehautxumingmingv: i do wonder if you arent going about things in an arse about face way
22:37AtKaaZI'll make a mental note to either fix my style or prevent my code from being seen
22:37brehautfix your style
22:38frozenlockThe parens! What happened to them?!
22:40brehautfrozenlock: i think they may have been drugged. they look all spun out
22:40AtKaaZlol brokets
22:40frozenlocklein do?
22:40AtKaaZin lein2 only
22:40gfrederickslein do!
22:41brehautlein do‽
22:41gfredericks~brehaut
22:41clojurebotbrehaut: I think struct embedding is monkey patching / mixins, and interface embedding is duck typing / typeclasses
22:41AtKaaZlein do clean, install vs lein1 clean, install
22:41brehautseriously what the hell clojurebot
22:41gfredericksclojurebot: brehaut is ‽
22:41clojurebotIk begrijp
22:42brehaut~clojurebot
22:42clojurebotclojurebot is amazing
22:42gfredericks~brehaut
22:42brehaut~lazybot
22:42clojurebotbrehaut is ‽
22:42clojurebotIt's greek to me.
22:42xumingmingv~clojurebot
22:42clojurebotclojurebot will become skynet
22:42gfredericksclojurebot: forget brehaut is ‽
22:42clojurebotIn Ordnung
22:42xumingmingv~lazybot?
22:42clojurebotHuh?
22:42gfredericksclojurebot: brehaut is <reply> ‽
22:42clojurebotYou don't have to tell me twice.
22:42gfredericks~brehaut
22:42AtKaaZgfredericks your ? is odd
22:42clojurebot
22:43frozenlockgfredericks: Thanks for that, I would have continued to do 'lein clean' 'lein whatever' for a long time...
22:43brehautAtKaaZ: Interrobang!
22:43AtKaaZbrehaut: oh i get it :)
22:43gfredericksfrozenlock: ANYTIME
22:43mattmoss~c++
22:43clojurebot,(let [testar (fn [x y] (if (= (reduce + (filter odd? (range 0 x))) y) (str y " is an")) )] (testar 10 25))
22:44mattmoss!?
22:44clojurebotCLABANGO!
22:45mattmoss~?
22:45clojurebotPardon?
22:45amalloygfredericks: your "forget" surely just made things worse
22:45amalloynow he's learned what "forget brehaut" means
22:46pbostromfrozenlock: I only give the warning so you might avoid picking up any of my bad habits. Here it is, use at your own risk https://github.com/pbostrom/cwo-public
22:47gfredericksamalloy: I'm not sure I'd say that's "worse"
22:47gfredericksperhaps "richer"
22:47gfredericksclojurebot: forget brehaut?
22:47clojurebotforget brehaut is ‽
22:47gfredericks(inc clojurebot)
22:47lazybot⇒ 14
22:47amalloyclojurebot: gfredericks is polluting your memory and must be destroyed
22:47clojurebotIk begrijp
22:48gfrederickswhy would alter-var-root hang?
22:49frozenlockpbostrom: thank you very much! Do you intend to use this repo, or was it only for me?
22:50gfredericksoh that's why
22:51AtKaaZbrehaut: I'm currently hoping for a third variant, code clojure in java directly
22:51pbostromfrozenlock: I might push out bug fixes, and any new features if I get some time to work on it
22:51AtKaaZthis way maybe I also have refactoring
22:51brehautAtKaaZ: that sounds like a recipe for sadness
22:52brehautAtKaaZ: im pretty sure Object defeats IDE refactorings
22:52djwonk⇒ 14
22:55brehautAtKaaZ: at least, thats the only interpretation of 'have refactoring' that you sensibly could mean.
22:55brehautAtKaaZ: because of course you can refactor clojure code
22:55mattmoss&(*)/(+)
22:55lazybot⇒ 1
22:55AtKaaZbrehaut: I'm using eclipse+ccw
22:56mattmossuhhh
22:56mattmoss&1/0
22:56lazybotjava.lang.ArithmeticException: Divide by zero
22:56mattmoss&(+)
22:56lazybot⇒ 0
22:56AtKaaZlol
22:56mattmoss&(*)
22:56lazybot⇒ 1
22:56brehautmattmoss: literal ratios only apply to numbers
22:57mattmossbrehaut: Sure, but I didn't get a ratio for 1/0, I got an exception.
22:57brehaut,'[(*)/(+)]
22:57clojurebot[(*) / (+)]
22:57brehaut,[(*)/(+)]
22:57clojurebot[1 #<core$_SLASH_ clojure.core$_SLASH_@43495829> 0]
22:57mattmoss& (*) / (+)
22:57lazybot⇒ 1
22:57mattmossSo why do I get 1?
22:57brehautmattmoss: because lazy bot is returning the result of the first expression
22:58AtKaaZnice1
22:58mattmosslazybot is lazy
22:58mattmoss&((*) / (+))
22:58lazybotjava.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn
22:58mattmossdoh, i'm stupid
22:58brehautmattmoss: well, what you told it to evaluate wasnt really an expression
22:59tmciver&(/ (*) (+))
22:59lazybotjava.lang.ArithmeticException: Divide by zero
22:59mattmossThanks, brain failure.
22:59gfredericks&'[(*)/(+)]
22:59lazybot⇒ [(*) / (+)]
22:59skelternetis the ampersand a clojure thing or a clojurebot thing?
22:59mattmossThis is what happens when I write C++ and Clojure on alternate days.
23:00brehautskelternet: lazybot evaluation
23:00tmciverskelternet: neither: it's a lazybot thing. :)
23:00tmciverha
23:00skelternet(goes to google lazybot and clojurebot)
23:02amalloythey're right here, man. ask them yourself
23:02skelternetdidn't want to spam the group, but ok
23:02skelternetlazybot help
23:02amalloythis channel is nothing but comical noise of people toying with the bots
23:02amalloybut i won't leave you stranded:
23:02amalloy$whatis source
23:02amalloy~source
23:02lazybotsource is http://github.com/flatland/lazybot
23:02clojurebotsource is http://github.com/hiredman/clojurebot/tree/master
23:03skelternetI have it on audio with Adium
23:03skelternetsometimes the snarkiness is actually pretty good comedy
23:04brehautamalloy: what about they imprecise answers to questions!
23:06skelternet$help
23:06lazybotYou're going to need to tell me what you want help with.
23:07skelternet$find-fn mysql-server
23:07skelternet$find defpallet
23:09xeqi$find-fn 1 1 2
23:09brehautskelternet: i think you are thinking of apropos or find-doc
23:09brehaut,(apropos 'part)
23:09clojurebot(partition-by partition-all partial partition)
23:10skelternetfind-fn may not be installed: https://github.com/flatland/lazybot/compare/544566f7ee740731ca69...da4fcae5f3afe6cc9e6c, for finding the clojure function you're looking for, by https://github.com/jColeChanged
23:11skelternet$help find-fn
23:11lazybotTopic: "find-fn" doesn't exist!
23:13xeqi$findfn 1 1 2
23:13xeqino - in it
23:13lazybot[clojure.core/+ clojure.core/unchecked-add clojure.core/+' clojure.core/unchecked-add-int clojure.core/bit-shift-left]
23:13skelternet$findfn defpallet
23:13lazybotjava.lang.RuntimeException: Unable to resolve symbol: defpallet in this context, compiling:(NO_SOURCE_PATH:0)
23:14skelternet$findfn 'defpallet
23:14lazybot[]
23:14skelternetNot really expecting it, but thought it would be worth a try
23:16skelternetclojurebot: source comp
23:17skelternetthat could be pretty useful
23:22skelternet$fcst 78620
23:23skelternet$rwhatis
23:23lazybotmatrix is everywhere. It is all around us. Even now, in this very room. You can see it when you look out your window or when you turn on your television. You can feel it when you go to work... when you go to church... when you pay your taxes. It is the world that has been pulled over your eyes to blind you from the truth. That you are a slave, Neo. Like everyone else you were born into bondage. Born into a prison that you cannot smel
23:25skelternet$help fcst
23:25lazybotTopic: "fcst" doesn't exist!
23:32xumingmingv~clojurebot
23:32clojurebotclojurebot is amazing
23:32xeqi~lazybot
23:32clojurebotCool story bro.
23:32metellus~clojurebot
23:32clojurebotclojurebot is not very good at indicating the difference between a return value and an exception
23:46luxbockI'm doing the 4Clojure problem #56: http://www.4clojure.com/problem/56#prob-title
23:47luxbockmy solution is #(keys (group-by identity %)), but it fails the last test
23:47luxbockyet REPL tells me:
23:47luxbockuser> (= (keys (group-by identity (range 15))) (range 15))
23:47luxbocktrue
23:47luxbockwhy is that?
23:48luxbock(doc distinct)
23:48clojurebot"([coll]); Returns a lazy sequence of the elements of coll with duplicates removed"
23:48luxbockerr ops
23:53handojinquestion...
23:53cbp`luxbock: hashmaps don't have an specified order for keys
23:54luxbockahhh right
23:54handojinanyone know offhand how to start server from a luminus project from eclipse/counterclockwise