#clojure logs

2012-06-24

00:00gfredericks1) your call to print is causing things to be printed (a side effect)
00:00y3diim gettin the same error that this guy had: https://gist.github.com/1326747
00:00gfredericks2) print is returning nil, and those nils are being collected into a list which is the return value of the for expression; that list of nils is being printed at the repl because the repl prints the return value of the expression you give it
00:01gfredericksso two things are printed: "0123" and "(nil nil nil nil)"
00:01gfredericksand they're somewhat interleaved in the output
00:01SrPxactually
00:02SrPxif that was true then I would get the output "0123 (nil nil nil nil)". but I'm getting the output "(0123 nil nil nil nil)"
00:02SrPxhow is the 1234 getting inside the parenthesis
00:02gfrederickswelp
00:02gfredericksfor is lazy
00:02gfredericksit returns immediately with a lazy seq
00:02gfredericksthe repl say "oh I have a seq; that means I need to print an open paren and the print the contents"
00:03gfredericksso it prints the open paren and then proceeds to read the contents of the seq
00:03gfrederickswhich causes the side effects
00:03gfredericksyou might expect (0nil 1nil 2nil 3nil) or something like that
00:03gfredericks,(for [a '[0 1 2 3]] (print a))
00:03clojurebot(0123nil nil nil nil)
00:03gfredericks,(for [a '(0 1 2 3)] (print a))
00:03clojurebot(01nil 2nil 3nil nil)
00:03gfredericksah like that ^
00:04gfredericksthe reason you don't get something more interleaved like that, and instead get the whole "0123" up front is because some seqs are chunked for optimization
00:04gfredericksso when you request the first thing, the first 32 things are computed. or 4 in this case since there are only 4.
00:04SrPxwow
00:04gfredericksthis whole thing can be avoided if
00:04SrPx,(for [a '[0 1 2 3]] (print a))
00:04clojurebot(0123nil nil nil nil)
00:05gfredericksyou don't mix laziness with side effects
00:05SrPx,(for [a '[0 1 2 3]] (print a))
00:05clojurebot(0123nil nil nil nil)
00:05SrPx,(for [a '[0 1 2 3]] (print a))
00:05clojurebot(0123nil nil nil nil)
00:05SrPxwat
00:05gfredericksfor is lazy and print is a side effect
00:05gfredericksdoseq is good for side effects
00:05SrPxhow did you manage to get that different output
00:05gfredericks,(doseq [a (range 4)] (print a))
00:05clojurebot0123
00:05gfredericksSrPx: using a list instead of a vector
00:05SrPxoh I see
00:05gfredericksvectors are chunked, lists are not
00:05gfredericksapparently
00:06SrPx,(for [a '(0 1 2 3)] (print a))
00:06clojurebot(01nil 2nil 3nil nil)
00:06gfredericksyou got chunked output originally because range is also chunked
00:06SrPx,(for [a '(0 1 2 3)] (print a))
00:06clojurebot(01nil 2nil 3nil nil)
00:06gfredericks,(for [a (take 4 (iterate inc 0))] (print a))
00:06clojurebot(01nil 2nil 3nil nil)
00:06gfredericks^ that's another way to avoid chunking
00:06SrPxhm
00:07gfredericks99% of the time you don't have to think about these things
00:07SrPxanyway
00:07SrPxfor generates a list
00:07gfredericksyep
00:07SrPxwould be more to a list comprehension on python than python's for itself right
00:07gfrederickscorrect
00:07SrPx(=
00:08SrPxvery cool.
00:08gfredericksso the second question was about a succincter syntax for function composition?
00:09SrPxI dont know the word succincter but well, just asking if some syntax sugars are possible
00:10gfrederickswith macros most sugars are possible, within a couple constraints
00:10gfredericks1) you still have to use s-expressions -- i.e., only what the clojure reader accepts
00:11gfredericks2) macros have to be called as a list, i.e. (macro-name ...other-things...)
00:11SrPxso I definitely cant make something like (+ 3*2 2) >> 8
00:11SrPx(not that I want that, just wondering)
00:11gfredericksper constraint 2, you could arrange that IF that expression were wrapped in a macro that was managing it for you
00:11gfrederickswell
00:12gfredericksconstraint 1 will probably say that 3*2 is unreadable
00:12gfredericksbut (+ 3 * 2 2) should be possible
00:12gfredericks,(read-string "3*2")
00:12clojurebot#<NumberFormatException java.lang.NumberFormatException: Invalid number: 3*2>
00:12SrPxgfredericks: should it?
00:13gfredericksSrPx: if it was wrapped in a macro; e.g. (with-funny-syntax (+ 3 * 2 2))
00:13SrPxgfredericks: how? + is not a macro so... ?
00:13gfredericksor I suppose you could also define a macro called +
00:13gfredericksdifferent tradeoffs in each case
00:18bhenryhas anyone else run into this? http://i.imgur.com/kVdJB.png
00:18bhenryi can't figure out where my code is making that happen.
00:19gfredericksbhenry: that's interesting looking
00:20gfredericksbhenry: you have an re-matches in your code somewhere?
00:20bhenrynope!
00:20bhenryit must be used in ibdknox's remote stuff with his fetch library
00:21gfredericksit looks like something that could get compiled from (let [[x y z] (re-matches ...)] ...)
00:21gfredericksbut in clojure when re-matches returns nil then it should just bind x y and z to nil
00:21gfredericksrather than crash
00:21gfredericksI can't imagine cljs behaving differently
00:22gfrederickssurely someone would have noticed by now :)
00:22gfredericksbut can't say more than that without seeing the source for that line
00:22gfredericksand I'm going to bed anyhow
03:04michaelr5252.5 hours of full channel sleep
04:54michaelr5254.5 hours of full channel sleep
04:54Erika_Mustermannhush
05:52muhoozzzzz
05:52muhoothis has been a much less chatty channel in recent months than it used to be
05:52muhoonot sure tht's a bad thing tho
06:00michaelr525muhoo: if you want to sleep, sleep! don't talk!
06:24bartjhello, can someone please have a look at this tiny example of multimethods: http://pastie.org/4142109
06:24antares_clojurebot: anyone
06:24clojurebotJust 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 ..."
06:25bartjI am not sure why the multimethod is not getting executed. Instead it throws the error: java.lang.IllegalArgumentException: No method in multimethod 'test' for dispatch value: true (NO_SOURCE_FILE:0)
06:27antares_bartj: because you defined implementations for [true] and [false]
06:27antares_not true and false
06:27antares_2nd argument to defmethod is an exact value, not a vector: https://github.com/michaelklishin/welle/blob/master/src/clojure/clojurewerkz/welle/conversion.clj#L310
06:28bartjok, I think you mean the first argument?
06:29bartjbecause when I do this: (defmethod mtest true [_] (println "hello"))
06:29bartj(defmethod mtest false [_] (println "world"))
06:29bartjit works
06:29antares_yes, that's the 2nd argument
06:29Guest52069hi
06:30antares_bartj: so it is [name of multimethod] [dispatch value] [vector of args] [body]
06:31bartjantares_, thank you very much!
06:31antares_bartj: no problem
07:22gtuckerkelloggi just upgraded to 1.4, and now clojure-jack-in fails :(
07:23gtuckerkellogganyone else seen this: "error in process filter: slime-require: Assertion failed: (keywordp module)"
07:23bhenrygtuckerkellogg: did you also upgrade lein-swank?
07:24gtuckerkellogghmm
07:25gtuckerkelloggbhenry, you mean swank-clojure?
07:26bhenrygtuckerkellogg: yes that's exactly what i mean, sorry
07:31gtuckerkelloggi seem to be using lein-swank 1.4.4, but lein 1.7.1
07:31antares_gtuckerkellogg: I have lein-swank 1.4.3 here and it works great with 1.3 and 1.4 codebases
07:31antares_I use lein2, though
07:31antares_for everything
07:31gtuckerkelloggmaybe I should upgrade
07:32gtuckerkelloggto lein2
08:32espeedwhat's the recommended Thrift library?
08:39dfgdfgdfgam planning to do SICP in the next couple of months..would it be advisable to use clojure instead of scheme?
08:40michaelr525dfgdfgdfg: dfgdfgfhgdfgdg
08:40dfgdfgdfgmichaelr525: I cannot decipher
08:42antares_dfgdfgdfg: yes
08:42dfgdfgdfgantares_: alright, I am going to give it a shot
08:42antares_dfgdfgdfg: there is nothing wrong with scheme but clojure has many nice aspects about it and some traditional Lisp baggage that was dropped (for good)
08:43dfgdfgdfgantares_: cool, I might even be able to do something with it at work :)
08:45antares_dfgdfgdfg: right :)
09:15samratok, so i've downloaded this repo https://bitbucket.org/drcabana/euler but i've no idea about how to try out the programs
09:16samratalso, i already have lein installed
09:16samratcan anyone help me
09:18antares_project.clj has a comment that says there are unit tests
09:18antares_so, lein test
09:20michaelr525samrat: you can 'lein repl' and then '(load "file.clj")' and then you can run any of the functions from that file
09:21samratmichaelr525: thanks, i'll try it
10:02tensoHi, this gives me an error in slime / swank:
10:02tenso(do (println "LOG: Computing...")
10:02tenso (+ 1 1))
10:02tensosry
10:03tensoit makes slime-repl print "; Evaluation aborted."
10:04Vinzenttenso, that's all? No buffer with stacktrace?
10:09tensoHuh, the error disappeared after I restarted Emacs
10:10xeqiI've had that occasionally, when I restart swank it disappears
10:10Vinzentyou probably sent something BAD before :)
10:10tensoweird, it might be I still had a stacktrace open in the background
10:29jhowarthIs there a keybind in emacs paredit mode for swapping a s-expression's surrounding character? e.g. change ( to [?
10:33AimHereUnlikely, since paredit is really for all lisps, and users of not-Clojure lisps have no need of brackets that aren't your traditional rounded parentheses
10:33AimHereIt's the sort of thing you'd write your own binding for if you had a pressing need for it
10:37jhowarthAimHere:
10:37jhowarthThanks
10:43y3digetting swank-clojure on windows is feeling impossible, sigh
10:43ScorchinWhat are the best "introduction to clojure" lightning talks (10-15 min) out there? Bonus points if you can provide a link to view/download a video.
10:48nonrecursiveScorchin: this is a good talk but it's an hour and ten minutesL http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey
10:48Scorchinnonrecursive: cool, thanks!
10:49nonrecursivenp
10:49nonrecursiveJust put my first noir site on heroku :) :)
10:57jhowarthgrats!
10:57jhowarthHoping I can do the same this weekend :D
10:58Frozenlo`Why on Heroku VS your own machine?
10:59jhowarthI actually was more hoping to get my first noir site done this weekend. Hadn't thought about hosting.
10:59jhowarthheroku is easier initially to get setup
11:36bartj,(+ 18.99 1.90)
11:36clojurebot20.889999999999997
11:37bartjwhy is the above result not simply 20.89
11:37bartjhow can I get clojure to output: 20.89 ?
11:37AimHereBecause you're using floating point numbers, which are necessarily inaccurate
11:38AimHere,(+ 1899/100 19/10)
11:38clojurebot2089/100
11:38AimHereYou could try rounding the numbers somehow
11:38zomgwut, does 1/2 to mean 0.5 work?
11:38zomgNeat
11:39AimHereWell clojure does support rationals
11:39AimHerebartj, if you want it as a String, eventually, you could use format
11:39AimHere,(format "%.2f" (+ 18.99 1.90))
11:39clojurebot"20.89"
11:39zomgAimHere: well a lot of languages do but first time I see that syntax for it :)
11:42bartj, (+ (Double/parseDouble "18.99") (Double/parseDouble "1.90"))
11:42clojurebot20.889999999999997
11:42bartjI tried using double instead of float but, still the precision does not seem enough
11:42gfredericks,(let [third (double 1/3)] (+ third third third))
11:42clojurebot1.0
11:42gfredericks^ why does that happen?
11:43gfredericksbartj: if you don't like floating point spookiness, use rationals
11:43gfredericksit's not too hard to write an exact function that outputs a rational in decimal format to any precision you like
11:44AimHereTrouble is, you see, bartj, floating point numbers are always going to have artifacts of that nature. You could write a dinky little function to round the function to the nth significant figure, if there isn't one pinched from Java in Math/foo or whatever
11:48bartjAimHere, gfredericks thanks!
11:49gfredericks,(first (drop-while #(= 1.0 (apply + (repeat % (double (/ 1 %))))) (drop 2 (range))))
11:49clojurebot6
11:49gfredericks,(let [x 1/6] (+ x x x x x x))
11:49clojurebot1N
11:50gfredericks,(let [x (double 1/6)] (+ x x x x x x))
11:50clojurebot1.0000000000000002
11:50gfredericksI still don't understand why 1/3 and 1/5 escape
11:51kaoDgfredericks, what do you mean escape?
11:52gfrederickskaoD: why is (+ 1/3 1/3 1/3) equal to 1.0 in floating point addition?
11:52gfredericks(double 1/3) must be rounded either up or down
11:52gfredericksso it stands to reason that the sum should be either greater or less than 1.0
11:53gfredericksit's as if there's some sort of trivial exception logic built in to the floating point ALU
11:53mmarczyk,(+ 0.3333333333333333333333333333333333333333333333333 0.33333333333333333333333333333333333333333 0.33333333333333333333333333333333333333333333)
11:53clojurebot1.0
11:54gfredericksor else the software is silently rounding things that look really close to other things
11:54gfredericksbut that's disturbing as well
11:56gfredericksruby has the same threshold (6 breaks, 3 and 5 don't)
11:56gfredericksbut stranger, the result for 6 it still prints as "1.0" despite reporting that it doesn't equal 1.0
11:56mmarczykhuh?
11:57kaoDgfredericks, I guess rounding is right there
11:57mmarczykirb says 0.333... + 0.333... + 0.333... == 1.0
11:57gfredericksx=1.0/6;y=x+x+x+x+x+x;[y.to_s,y==1.0]
11:57mmarczykoh, for 6
11:57bartjgfredericks, you are very curious
11:57kaoD,(float 1/3)
11:57clojurebot0.33333334
11:57mmarczykwell, nothing suspect about this
11:57kaoD,(* 3 0.33333334)
11:57clojurebot1.0000000199999999
11:58mmarczykan extra digit of precision appears "to the left", so some precision might be lost "to the right"
11:58gfredericksmmarczyk: about what?
11:58kaoD,(float (* 3 0.33333334))
11:58clojurebot1.0
11:58kaoDsee?
11:58kaoDit's just lucky about the rounding error
11:58gfredericksmmarczyk: what extra digit of precision?
11:59mmarczykgfredericks: just before the decimal point in our representation of choice
11:59gfredericks101 vs 110 both have 3 digits
11:59gfrederickswhence the difference between 5 and 6?
11:59mmarczykwhat kaoD said
12:00kaoDfloating point representation is quite different from binary
12:00gfrederickswell they're inverted so 101 vs 110 doesn't apply I guess
12:00kaoDsee IEEE754
12:00gfrederickskaoD: I'm familiar with it
12:00gfrederickskaoD: (double 1/3) must be either slightly less or greater than the ideal 1/3, right?
12:00mmarczykyou could draw diagrams of ieee 754 doubles and do the calculations by hand to check :-)
12:01kaoDlet's see
12:01kaoD,(double 1/3)
12:01clojurebot0.3333333333333333
12:01kaoD,(* 3 (double 1/3))
12:01clojurebot1.0
12:01kaoDyou don't see the rounding error really
12:01kaoDyou can see it in float (using double)
12:01kaoDbut double is the max representation
12:01mmarczykthat doesn't mean that when you add three of them you won't get 1.0
12:01gfrederickswhy not?
12:02gfredericksoh hmmm maybe I can imagine
12:02mmarczyksince the "ideal" result of adding three copies of the double closest to 1/3 might turn out to be the double closest to 1.0
12:02mmarczykthat is, 1.0
12:02gfredericksso perhaps it is larger by a slight amount but that amount gets lopped off?
12:02kaoDgfredericks, that's it
12:02gfredericksokay, I can buy that
12:02kaoDI insist: it's easier to se in float because you can use double to see the actual rounding error
12:02kaoDbut it happens in double too
12:03mmarczykI mean, might turn out to be closest to the double closets to 1.0 :-P
12:03kaoDand not only that, most FPUs have extra bits of precision
12:03mmarczykclosest
12:03gfredericks,(first (drop-while #(= 1.0 (apply + (repeat % (float (/ 1 %))))) (drop 2 (range))))
12:03clojurebot3
12:03kaoDand once that bit's trimmed, there's an extra rounding error there too
12:03kaoD(which luckily turns 1.3*3 into 1.0)
12:04gfredericks,(take 10 (remove #(= 1.0 (apply + (repeat % (float (/ 1 %))))) (drop 2 (range))))
12:04clojurebot(3 5 6 7 9 ...)
12:04kaoDin fact, think about the internal representation
12:04kaoDthe implied 1 bit
12:04kaoDand a lot of zeroes
12:04kaoD(in the mantissa, of course)
12:04gfredericksof course
12:04kaoDif, after rounding, you lose all the ones, it will be rounded to 1.0
12:05gfredericksso for 1/6, too much error is accumulated
12:05kaoDno
12:05kaoDthe error is at the end
12:05kaoDonce the floating point value is truncated
12:05kaoDas I said, most FPUs have extra bits
12:06kaoDand it might be truncated only at the end
12:06y3dihm, i can't seem to find clojure-mode in the package list for emacs, does that mean i might already have it installed
12:06kaoDy3di, nope, that means you oughta add marmalade to your package list
12:07kaoDsee the slime-clojure (or swank-clojure, not sure) README.md at their GitHub repo
12:07kaoDgotta go, cya!
12:09rlb...and with x86 you those extra bits can be confusing if you forget they're there. gcc has some options to control their use.
12:10y3dii followed a tutorial, and this is in my init.el file: (add-to-list 'load-path "~/.emacs.d/")
12:10y3di(require 'clojure-mode)
12:10y3dii assume this may mean i already have clojure-mode?
12:11y3diand i installed swank-clojure through lein
12:11y3diso i think i should be good to go
12:13y3dihm but doing m-x swank/slime shows no match
12:13y3dim-x clojure-jack-in works however
12:17Vinzenty3di, well you also need slime, slime-repl and swank-clojure in your emacs
12:20y3dihm, I installed swank-clojure through lein
12:20y3diim having trouble figuring out how ti install slime/slime-repl/swank-clojure
12:20y3direading the swank readme, it says to get marmalade
13:08SrPxhow can I see a list of variables on local namespace?
13:19jhowarthy3di: I recently setup slime so I might be able to help. Did you end up upgrading to emacs 24?
13:24kaoDy3di, as I said, you've got to add the Marmalade package repositories
13:24kaoDsee the README.md of related projects at GitHub, it's there somewhere
13:25kaoDyou might need Emacs snapshot, if you're not using it already
13:25kaoDand make sure you just add clojure-mode and paredit
13:25kaoDdon't install anything else, clojure-mode takes care of SLIME for you
13:25kaoD(just invoke clojure-jack-in and it'll download and install everything)
13:26kaoDand don't even try clojure starter kit, it didn't work very well for me
14:01Rakin05hi guys. i'm a vimmer at heart and found my love for clojure. i downloaded VimClojure and installed it. now i have the question if there is any syntaxchecker for clojure that can work with syntastic?
14:36y3dikaoD, thanks, imma pm you
14:45kaoDy3di, answered your pm, not sure if you've read it
14:58Scorchinwhat's the easiest way to convert a ByteArrayInputStream into clojure string?
14:58Scorchin*into a clojure string
14:59S11001001,(doc slurp)
14:59clojurebot"([f & opts]); Opens a reader on f and reads all its contents, returning a string. See clojure.java.io/reader for a complete list of supported arguments."
14:59S11001001^^ Scorchin
15:01ScorchinS11001001: thanks
15:04shawnlewisIs there a way to specify contrib.datalog as a dependency in leiningen, given that contrib is gone and datalog didn't move?
15:04shawnlewis(with clojure 1.3)
15:04S11001001no; put it in your own source under a different namespace, or offer to maintain it
15:05shawnlewisS11001001: word, thanks
15:06S11001001you could complain to jstraszheim about it, but I'm not sure that will work
15:08shawnlewisS11001001: well… no complaint really. I was just wondering if I was right that its gone away.
15:12jickstaCan anyone explain why doing (take 5 (cycle (range 6)) in the REPL would hang?
15:13raekjicksta: the repl waits for one more closing parenthesis
15:14jickstaHaha, a much stupider problem that I expected. I was getting problems with the (cycle (range 6)) outputting an infinite sequence just before this so I thought it was the same problem. Thanks :)
15:22Rakin05is there anything like "~ compile" from sbt/scala in leiningen?
15:24S11001001Rakin05: no; compilation doesn't take long, and doesn't really help you code anyway
15:25Rakin05S11001001: what about live error checking? is there anything?
15:25S11001001Rakin05: also, in clj-land, we code by installing new source into a running program, not compiler loops
15:25S11001001Rakin05: I make edits and press C-c C-l to load my source changes into the running program
15:26Rakin05S11001001: You use Emacs?
15:26S11001001yes
15:26S11001001for scala too
15:27Rakin05S11001001: tried emacs...my pinky still hurts
15:27S11001001swap your caps lock and control keys
15:27S11001001or just replace caps lock, who needs that
15:27S11001001I guess there is also a vimclojure thing if you're into that, but I don't care about vim usage
15:28S11001001and some IDE things, but I don't care about those either
15:28Rakin05S11001001: does'nt that mean that i write Uppercase and Lowercase randomly?
15:28S11001001uh, what
15:28S11001001I am fairly sure they all provide live loading into a running program
15:28S11001001so, I replaced caps lock with control
15:28S11001001when I hold down caps lock, it just does what ctrl does
15:29S11001001even the vim people I know do this
15:29rlb(and it's much better)
15:29Rakin05Ohhh...okay...i understand. you mean via system settings
15:30bartjhello, was the "run/test" task added to leningen after version 1.1 ?
15:30bartji can't seem to find them in version 1.1
15:30S110010011.1?!?!
15:32bartjyes :)
15:32S11001001bartj: can you not upgrade for some reason?
15:34S11001001Rakin05: you may like to peruse my intro to clojure for scalawags at https://bazaar.launchpad.net/~scompall/+junk/clojure-stuff/view/head:/src/com/nocandysw/cloj_dummy/scala.clj ; instructions for cloning at https://code.launchpad.net/~scompall/+junk/clojure-stuff
15:34S11001001in progress :)
15:35SrPxHow do you guys organize your project? For example, in C++ it would be .cpp files for class implementation, .h files for header implementation, with the old OO design of classes and methods...
15:35SrPxHow are clojure projects organized?
15:35Rakin05S11001001: The idea with Caps Lock Ctrl switching is great. thanks for that hint
15:36uvtcSrPx, `lein new` gets you off to a good start.
15:36uvtcSrPx, The newest version will also create a "doc" dir for you and start you off with, I think, an "intro.md" file.
15:37S11001001I assume due to github bias?
15:37SrPxlein new,? let me see
15:38uvtcS11001001, may as well settle on a standard, IMO. .md files in a "doc" directory seems to work fine.
15:38uvtcWhich brings me to...
15:38S11001001hmm.
15:39uvtcI've been working some more on my project to centralize project docs. I added a way to create examples for a given project, similar to how there's examples at clojuredocs.
15:39uvtcThe project is called "The Alcove" and it's at http://www.unexpected-vortices.com/alcove/index.html
15:40uvtcI'll announce it on the ML, but thought I'd post here first, and maybe get some feedback and also suggestions on projects to add.
15:40uvtcIt works now for projects without a "doc" directory,
15:40uvtcand also even for projects without a README.md file.
15:40bartjSrPx, https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md
15:42jhowarthDoes Korma guard against sql injection?
15:44uvtcS11001001, regarding creating docs for a project, I don't think it's necessarily a github bias, though github does use markdown all over the place. But so do sites like reddit and various blog commenting systems. And marginalia uses it too. And it's the nicest of the bunch (of markup formats that I've used). And pretty much everyone already knows it or can learn the basics in a few minutes.
15:45S11001001alright, good
15:46uvtcWhat other projects should I add to the alcove? For what projects do you think others might be interested in adding examples?
15:49S11001001uvtc: slingshot, tools.macro, and algo.monads are good example fodder
15:51uvtcS11001001: Some of those are contrib. I think contrib docs/examples are at clojuredocs, correct?
15:51wingyhow is closjurescript doing in async programming?
15:51S11001001I don't know
15:52uvtcS11001001, Looks like they are. For example, monads: http://clojuredocs.org/clojure_contrib/clojure.contrib.monads
15:52S11001001that would be ancient history
15:53S11001001your chance to grab onto the new hotness while clojuredocs is stuck with the old and busted
15:54uvtcS11001001, added slingshot. Thanks.
15:55uvtcS11001001, I actually emailed clojuredocs to see about having the alcove hosted there. Have not heard back yet.
15:55uvtcS11001001, I mean, Zachary.
15:56SrPxseriously what is that
15:56SrPxo.o
15:56SrPxwhat do you use instead of classes, just this?
15:57S11001001SrPx: that what?
16:01SrPxlein
16:01S11001001lein is a build tool
16:01S11001001it knows how to create project trees and set up a REPL with your code and libraries you're using
16:02S11001001if you mean organization at the source level, clojure programs are organized mostly as functions in namespaces
16:12technomancyrlb: did you say you're working on getting emacs 24 into Debian?
16:28bartjis the error: "Exception in thread "main" java.lang.Exception: Unable to resolve symbol: defrecord in this context" because of an older clojure version ?
16:30S11001001Yes
16:31S11001001still wondering why you're stuck with lein 1.1
16:32bartjS11001001, I've upgraded
16:32bartjLeiningen 2.0.0-preview6 on Java 1.6.0_22 Java HotSpot(TM) Client VM
16:32S11001001ok, so your clojure version in project.clj...
16:38clj_newb_024587I have a clojure web app currently setup using ring, compojure, friend, clojurescript. Now, I want to add ssl support to it. What is the easiest way to do this?
16:39weavejesterclj_newb_024587: Usually it's easiest to proxy from nginx or something similar.
16:39clj_newb_024587I am using ubuntu 12.04. I have no exprience setting up ssl, though I am familiar with crypto. Which one do I have the smallest chance of fucking up?
16:39weavejesterclj_newb_024587: The Ring Jetty adapter does support SSL, but it's often useful to separate it out into a proxy.
16:40weavejesterclj_newb_024587: nginx SSL is fairly straightforward.
16:40clj_newb_024587weavejester: this is very low bandwidth, i.e. I have a dual 8GB machine, and there's be a max of 3 concurrent users at any time.
16:40clj_newb_024587So I can set this all up using just ring-jetty, without nginx?
16:41weavejesterclj_newb_024587: It's often useful to proxy a web server through a proxy nginx as a matter of course. That way you can bind nginx to port 80 as root, but have your web app run as an unpriviledged user.
16:41clj_newb_024587right now, I have an iptables rule forwarding port 80 to port 8080
16:42clj_newb_024587but it sounds like I should learn about ngninx
16:43weavejesterclj_newb_024587: I think nginx would be my choice, whether I was writing a web app in Clojure or Ruby or something else.
16:43clj_newb_024587weavejester: can you recommend something better than http://nginx.org/en/docs/http/configuring_https_servers.html ?
16:44weavejesterclj_newb_024587: Let me see if I can find something...
16:45clj_newb_024587weavejester: one more thing; how do I get a signed ssl certificate?
16:45clj_newb_024587do I just go and throw my wallet at godaddy ?
16:45arrdemclj_newb_024587: that'll work.... but I would look around some first
16:46arrdemgodaddy is not what you would call cheap.
16:46clj_newb_024587arrdem: what would you use?
16:46arrdemclj_newb_024587: honestly? no idea. I have never worked with SSL/HTTPS certs. I've just had sub-optiomal experiences with GDDY
16:49clj_newb_024587http://emspace.com.au/article/installing-ssl-ubuntu-nginx damn this is compliated
16:49weavejesterclj_newb_024587: Try looking at this for examples of proxying: https://help.ubuntu.com/community/Nginx/ReverseProxy
16:50weavejesterclj_newb_024587: It's actually not that complex… You just need to dump one file in a directory, and then run one command, if memory serves.
16:50clj_newb_024587it's like NP-complete; an expoenntial amount of work for a short solution
16:57weavejesterclj_newb_024587: This file should be all you need to proxy (HTTP at least): https://gist.github.com/2984900
16:57clj_newb_024587intersting you merged in proxy.conf
16:57clj_newb_024587(I was just working through the tutorial)
16:58weavejesterclj_newb_024587: You just dump that in /etc/nginx/available, and sym-link ot to /etc/nginx/enabled and then reload
16:58clj_newb_024587so I have this weird situation right now, where (1) ssh-ed into my server, "lynx localhost:80" works (it gets me localhost:8080's content); however, from my laptop, going to remote-addr:80 ... it hangs
16:58weavejesterFor SSL, add another server to listen on 443
16:59clj_newb_024587crap ; I think I just nuked my ssh conections
17:00clj_newb_024587okay; my current problems = firewall problem; not nginx problem
17:00clj_newb_024587weavejester: thanks for help
17:00weavejesterclj_newb_024587: np
17:01clj_newb_024587weavejester: one more dumb question; I acutally don't need to change anythign on the ring/compojre/clojure side right? i.e. I can just redirect 443 to port 8080, and not modify my clojure code, and everything will wor as is, since nginx handles everything?
17:02weavejesterclj_newb_024587: Right
17:03weavejesterclj_newb_024587: If you wanted to work with client SSL certificates, you'd have to have Jetty handle the SSL, but client SSL certs are rarely used
17:03weavejesterclj_newb_024587: Once nginx is setup, you can use any back end web server and not have to worry about SSL anymore
17:03clj_newb_024587I like this separation of concerns.
17:04weavejesterclj_newb_024587: Another benefit is that you can configure nginx to wait if the web app is down, so you can restart your app with new code, and users wouldn't see any downtime - their connections would just be delayed for a few seconds while the app restarts.
17:05clj_newb_024587weavejester: oh boy, I'm not sure if that is possible with jvm start up times
17:07weavejesterclj_newb_024587: The JVM only takes a few seconds to boot, right?
17:07weavejesterclj_newb_024587: Alternatively, you could have two servers, and restart each separately, so you always have one server up.
17:11bartjin clojure.test is there a diff b/w error and failure ?
17:13ckybartj: Yes. A failure means your code has a bug. An error means some unexpected error occurred, which means your code may or may not be buggy.
17:13xeqidid it throw an exception or fail an (is ..)
17:14bartji purposefully changed an expected test-case which it showed as "failure"
17:14clj_newb_09824weavejester: okay, after firewall fixing, port 443 forwarding works now
17:14clj_newb_09824so correct me if i"mwrong all I need now is to generate the fiels cert.pem and cert.key
17:14bartjxeqi, failure
17:15bartjis it possible to write a multimethod for this scenario:
17:15bartjinput is a string
17:16weavejesterclj_newb_09824: I can never remember the exact steps, but essentially a cert is a public key plus metadata about the site (domain name, owner, etc.). You need to generate the key-pair, generate the cert, then upload the cert to a cert authority to sign it.
17:16bartjif input contains the string "abc" return 1, if input contains the string "xyz" return 2, input is "pqr" return 3
17:16weavejesterclj_newb_09824: Then nginx needs to have a file with the signed cert, and the private key.
17:16bartji think it is not possible because the dispatch value has to be a *constant*
17:19Raynesmmarczyk: The problem we were seeing in refheap was that mongo-session had a transitive dependency on an ancient version of the java mongo driver. Updating it fixed that issue.
17:20Raynesbartj: That would require predicate dispatch which Clojure's multimethods do not support.
17:26Raynesmmarczyk: Also, this is ridiculously slow.
17:26Raynes:(
17:26Raynes20 seconds to highlight a 655 line java file.
17:27bartjRaynes, I meant something like this: http://pastie.org/4144823
17:28bartjdo you think that implementation is wrong, for the problem I posted above?
17:29Raynesbartj: That looks about right. (nth foo 1) is just (second foo) though.
17:29Raynes&(nth [1 2 3] 1)
17:29RaynesDamn bot.
17:29bartjbut, you said it wasn't possible ?
17:29bartjso I was wondering...
17:30RaynesI thought you were asking for something much more general.
17:30RaynesIt sounded like you wanted to execute a different function for each method implementation until one matched.
17:46clj_newb_09824hmm
17:46clj_newb_09824where can I get my *.csr file signed?
17:49rlbtechnomancy: yes, should be soonish (next few days I hope).
17:50ckyclj_newb_09824: Any certificate authority will do that for you for some $$$.
18:00technomancyrlb: godspeed =)
18:01rlbthx -- nearly finished; the dfsg split and debian "multiple flavor" infrastructure just takes some time.
18:11hcliffhey, anyone know how to bring up the chrome debugger from the clojurescript reply? (js* "debugger") isn't working
18:13brehauthcliff: are you wanting to just make it appear, or to break at a certain point?
18:28jlewisdo the runtime characteristics of assocEx differ from assoc in IPersistentHashMap?
18:33gfredericksI was wondering what assocEx was the other day
18:33gfredericksis that assoc where you know the key to be already present?
18:33jlewiswell, i think what it does is throw an exception immediately if the key already exists
18:33jlewisbut... if that's the case, what does assoc do when the key already exists?
18:36jlewisoh, i see
18:36jlewisassoc replaces the value
18:36jlewisassocEx blows up
19:11ibdknoxdnolen: have you run into this showing up with master: clojure.lang.PersistentHashMap.create.call(null, b)
19:11ibdknoxdnolen: it's appearing in cljs.core.js->clj and blowing up
19:34iwilligdoes anyone know if i can call a compojure application with a ring request ?
19:35weavejesteriwillig: Yes; Compojure is built on top of Ring.
19:35iwilligcool
19:35weavejesteriwillig: Compojure's effectively a routing library for Ring
19:36weavejesterAlmost every function in Compojure returns a Ring handler
19:36iwilligso if i have an compojure app... I should be able to call (app (request :get "/"))
19:36mmarczykibdknox: do you have an example of code where this happens?
19:36weavejesteriwillig: Right
19:36iwilligwhere request is from request ring-mock
19:36iwilligcool weavejester thanks
19:36ibdknoxmmarczyk: it's in cljs.core
19:37weavejesteriwillig: A compojure app = a ring handler
19:37mmarczykibdknox: I mean, a call to js->clj which is guaranteed to blow up
19:37mmarczykI've never seen this happen
19:37iwilliglovely thank weavejester
19:38ibdknoxmmarczyk: here's what is in my output: https://www.refheap.com/paste/3304
19:38ibdknoxmmarczyk: any call to js->clj will trigger that path
19:39mmarczykwhoa
19:39iwilligweavejester: when i try (app (request :get "/"))
19:39iwilligi keep on getting an key must be an integer error
19:39ibdknoxmmarczyk: yeah, I have no idea what's going on
19:39ibdknoxmmarczyk: makes no sense to me
19:40weavejesteriwillig: It sounds like there's a problem in your app
19:40iwilligokay
19:40ibdknoxmmarczyk: this started happening after I picked up the analyzer split changes
19:40ibdknoxmmarczyk: I was a little behind though, so it could be anything since then
19:40iwilligshoot silly error sorry to bug you
19:44gfredericksthere is no cljs.core/format?
19:44gfredericksI guess because it'd have to be implemented from scratch instead of deferring to jvm?
19:45ibdknoxgfredericks: correct
19:45gfredericksis that a wanted feature?
19:46dnolenibdknox: I just looked at my output, I don't see this. Did you try cleaning everything?
19:46ibdknoxdnolen: yeah
19:46ibdknoxdnolen: I'll recheckout
19:46ibdknoxgfredericks: I'd love it :D
19:46gfredericksis there a jira ticket for it?
19:46dnolengfredericks: no
19:46gfredericksdnolen: shall I?
19:46dnolengfredericks: please do.
19:46gfredericksor are there design questions?
19:46mmarczykibdknox: yeah, I don't have this in my compiled output either
19:46gfrederickson it
19:47ibdknoxdnolen: mmarczyk: I'm on 1.5, not sure if that might make a difference
19:47mmarczykibdknox: https://www.refheap.com/paste/3305
19:48dnolenibdknox: that looks like map destructuring is completely broken.
19:48dnolenibdknox: hmm ... that might, on 1.4 here. are you using 1.5 specific things?
19:48ibdknoxyeah
19:49mmarczykoh yeah
19:49mmarczykreplacing clojure.jar in lib with 1.5.0-alpha1 breaks things for me
19:49mmarczyk*but*
19:49mmarczyknot in the same way :-P
19:49ibdknoxlol
19:50ibdknoxI'm using clojure master
19:51dnolenibdknox: yeah destructuring macro changed.
19:51gfrederickscljs.core/format sounds like a good target for the macro-and-function pattern
19:51dnolenibdknox: inline clojure.lang.PersistentHashMap/create reference in Clojure HEAD
19:51dnolenibdknox: which of course does not exist in CLJS.
19:51ibdknoxdnolen: right
19:52mmarczykhah
19:52dnolenthis a pretty argument for continuing with static fields pattern even though not necessary for JS target ...
19:53ibdknoxdnolen: suggestion? If necessary I can likely recreate my changes on 1.4 instead. If there's a straightforward path to a fix, I can work on that instead though.
19:54mmarczykthis is also possibly an argument in favour of bbloom 's host-specific-macro-based approach to map creation, although here I guess it wouldn't help (since any macros imported from clojure.core would still have been compiled to use clojure.core's helpers)
19:54dnolenmmarczyk: ibdknox: http://dev.clojure.org/jira/browse/CLJS-325
19:54dnolenibdknox: seems like a simple patch.
19:54dnolenmmarczyk: how was the 1.5 breakage you were seeing different from ibdknox's?
19:55mmarczykdnolen: Reflection warning, cljs/analyzer.clj:234 - call to create can't be resolved.
19:55mmarczykdnolen: Reflection warning, cljs/compiler.clj:500 - call to create can't be resolved.
19:55mmarczykdnolen: and loads more with different line numbers
19:56mmarczykdnolen: compiled output looked ok at first (cursory) glance
19:56dnolenmmarczyk: oh right ...
19:56dnolenmmarczyk: that's a Java class reference.
19:56mmarczykyeah
19:56mmarczykfreaked me out though
19:56mmarczykuntil I looked at the output :-P
19:57dnolenmmarczyk: we probably need to move destructure into core.clj macros file.
19:58mmarczykdnolen: ...and possibly revisit :properties destructuring? :-)
19:58mmarczykdnolen: wouldn't that entail moving let, loop, fn, defn, defmacro (... ?) into cljs also?
19:59mmarczyknot that I necessarily see a problem with that
19:59dnolenmmarczyk: ah ... yeah since they will be calling the wrong destructure.
20:00mmarczykalso, with cljs-specific macros c.l.PHM/create wouldn't be needed
20:01dnolenmmarczyk: yeah
20:02mmarczykat some point those macros may simply need to be imported -- certainly if cljs were to become *the* Clojure compiler (w/ a JVM backend), possibly if non-JVM cross-host issues or something else of importance required cljs-specific changes
20:04dnolenmmarczyk: I don't think we need to move that many macros. only let and loop far as I can tell.
20:09mmarczykdnolen: oh, it does look that way
20:18mmarczykwas there a ticket for 93c795fe10ee5c92a36b6ec6373b3c80a31135c4 (in Clojure)?
20:18mmarczykI'd like to read the rationale
20:22technomancyrlb: yeah, I don't envy anyone who has to get in the middle of the dfsg and the gfdl.
20:22technomancyI'd imagine it's something like http://wondermark.com/657/
20:26dnolenmmarczyk: hmm I vaguely recall something
20:27mmarczykdnolen: ?
20:27gfredericksit looks like the example test sort of uses it as a way to provide default values?
20:27SrPxis there any way to save REPL state?
20:27dnolenmmarczyk: http://dev.clojure.org/jira/browse/CLJ-763
20:28mmarczykdnolen: thanks!
20:29mmarczyknow this really makes me see bbloom's emitter idea in a new light
20:30bbloommmarczyk: :-)
20:30mmarczykexpanding to (unchecked-create-map ...) w/ unchecked-create-map inlined on the JVM would save as some hassle
20:30mmarczykbbloom: :-)
20:30mmarczykbbloom: thanks for the extensive reply, by the way, I'll be answering soon
20:30bbloomwhat did i miss?
20:31mmarczykbbloom: I do think I came across in a more negative way than I aimed for -- I just think macro-based constant handling should happen no sooner than generic factories are in place
20:31mmarczykbbloom: cljs breaks with Clojure 1.5 because of a change to clojure.core/destructure
20:32mmarczykbbloom: which now calls clojure.lang.PersistentHashMap/create directly
20:32bbloommmarczyk: ah. yes, need a generic factory function for it to call directly?
20:32mmarczykbbloom: ah, also, set is comparable to vec, not vector... hash-set is the analogue of hash-map
20:32mmarczykbbloom: right
20:33bbloommmarczyk: yeah, in that patch, i used set*
20:33mmarczykset* ?
20:33bbloommmarczyk: yeah, didn't know what else to call it to differentiate the same was as vec vs vector
20:34mmarczykbbloom: ah, right
20:34bbloommmarczyk: because you need the vector-version of set to work well with a macro otherwise you need to break down the form to get the tems
20:34bbloomand the form might just be a symbol! which is no good
20:34bbloomtems -> items
20:35bbloomsimply (defn set* [& items] (set items))
20:35bbloomand then you can define a set* macro
20:35bbloomprobably needs a better name :-P
20:35bbloomi guess could use hash-set directly
20:37mmarczykcreate-$foo ?
20:38mmarczykand unchecked-create-foo for places where the standard ctor / factory objects to some kind of errors (like duplicate keys in sets/maps)
20:39mmarczykbbloom: incidentally, that PHSet/fromArray thing could be a separate patch -- should be a 100% clear gain right now, I think
20:39mmarczykimo, at any rate
20:39bbloommmarczyk: ok ill look at that in a sec
20:39mmarczykcool
20:54bbloommmarczyk: https://www.refheap.com/paste/3306 what do you think? that's just the fromArray bit
20:55bbloomseems like a win to me :-)
20:56mmarczykbbloom: hah! cool :-)
20:56bbloomignore that -equiv thing on string
20:56bbloomdidn't mean to have that in there :-P
21:00mmarczykdnolen: so I have a working version of cljs with destructure, let and loop in cljs.core; tests pass
21:00dnolenmmarczyk: great make a ticket and a patch and I'll take a look.
21:00mmarczykdnolen: k, just a sec
21:01dnolenmmarczyk: er I mean attach patch to existing ticket :)
21:01bbloommmarczyk: dnolen: http://dev.clojure.org/jira/browse/CLJS-326
21:01SrPxOkay after playing with windows command prompt I really need an editor for the REPL
21:01SrPxare you guys all using emacs?
21:02leo2007it is the only sensible option.
21:02bbloommmarczyk: you mean let and loop implemented as macros? or just namespaced? or what?
21:02mmarczykbbloom: I mean copy & paste + adjustments to make them work again (because some things they use are on the :refer-clojure :exclude list)
21:03mmarczykbbloom: http://dev.clojure.org/jira/browse/CLJS-325
21:03mmarczykbbloom: part of cljs's struggle for independence ;-)
21:03bbloommmarczyk: yup :-) hence why i keep adding missing bits and pieces from clj proper heh
21:03mmarczykright
21:03mmarczykSrPx: that's one good choice
21:03bbloommmarczyk: one small step at a time towards the canonical CinC ;-)
21:04mmarczykI don't know of another one
21:04mmarczykbbloom: totally! :-)
21:04SrPxmmarczyk: I can't install it u.u
21:05mmarczyk(actually I do like my Vim, used it to write thousands of lines of Scheme, but Paredit put me under a spell)
21:05mmarczykSrPx: what OS?
21:05SrPxxp
21:05bbloomi'm still wed to vim… haven't tried the vimparedit thing yet
21:06mmarczykbbloom: don't try the Emacs version if you want to stay faithful
21:06SrPxmmarczyk: is it bad?
21:07mmarczyk(actually I haven't tried Vim's paredit impls, but I'm told they don't implement the full range of functionality -- and I think I use most of what's available)
21:07SrPxoh nvm
21:07bbloommmarczyk: i figure i need to try emacs&slime at some point but the last time i tried i wanted to cry b/c my vim muscle memory is very very deep. also i do *a lot* of different languages in any given coding session, so i just need my vim bindings and no vim-emulation mode will ever cut it
21:07SrPxanyway
21:08mmarczykSrPx: hm, I'm not sure I can be much help except to say I have run Emacs on XP with no problems
21:08SrPxI've cloned slime, swank clojure, clojure mode... I have slime working... no idea what to do with that code, though
21:08mmarczykSrPx: slime on the other hand... would you be willing to try cygwin?
21:09SrPxwhy not?
21:09mmarczykbbloom: I know what you mean, Vim is absolutely the best editor
21:10SrPxI'm under an impression that vim doesn't matter that much for lisp
21:10bbloomminus vimscript… *cringe*
21:10mmarczykbbloom: supposedly evil (latest vim emulator for emacs) is very good -- I must give it a try, but I'll be really surprised if it solves the problem
21:10SrPxAll your code is small s-expressions, right?
21:10mmarczykah, vimscript doesn't come into it for me
21:10mmarczykI said "editor" :-)
21:10bbloomheh
21:10mmarczykso the Emacs text editing experience is somewhat inferior imo
21:10mmarczykin general
21:10bbloomi don't know of any hardcore vim guys who have tried evil and stuck
21:10bbloomand i know a few who tried hard
21:11bbloombut it was a while ago
21:11mmarczykcertain modes offer so much on top of the basics though
21:11bbloommaybe i'll try it sometime
21:11SrPxbut mmarczyk does it matter that much for clojure?
21:11mmarczykplus there are fantastic emacs "apps" -- org mode etc.
21:11mmarczykmagit
21:12SrPx)=
21:12mmarczykSrPx: as mentioned above, I've written thousands of lines of scheme in Vim and I loved that experience
21:12mmarczykI switched to Emacs for a number of reasons
21:13mmarczykbut for lisp editing paredit made the most difference
21:13mmarczykplus the fact that I simply came to prefer a workflow where I have hundreds of buffers in a single editor session :-P
21:13mmarczyka server running in the background, clients -- X and terminal -- coming and going...
21:13mmarczykah, the Emacs life
21:14mmarczykanyway. there are new addons for Vim which introduce stuff like text objects useful in lisp, some subset of paredit functionality etc.
21:15mmarczykit's well worth a try
21:15bbloomi use the shit out of text objects in vim
21:15gfredericksmmarczyk: I work with a bunch of vimmy folk and they're always closing vim and CDing somewhere and opening another file in a new vim session...........it pains me to watch it
21:15bbloomdap baby dap all the way
21:15mmarczykgfredericks: yeah :-)
21:16bbloomgfredericks: why is that painful? i don't do that when working on a project, but on a server editing configs? i do that non stop
21:16mmarczykgfredericks: I used to open loads of files in Vim too -- with tabs, NERDtree -- but it never felt as natural as it does in Emadcs
21:16mmarczykEmacs.
21:16gfredericksbbloom: because they do it when working on a project
21:16bbloomheh
21:16gfredericksmmarczyk: yeah I was using nerdtree during my last few months of vim
21:16bbloomluckily vim starts fast :-)
21:17mmarczykSrPx: but if you want slime, I think cygwin might help
21:17mmarczykgfredericks: well, I actually still use Vim a fair bit -- I'd really love it for Evil to be as good as it's made out to be
21:18bbloomi've even got one of those kenisis concave keyboards with the modifiers on the thumbs… people assume i'm an emacs guy :-P
21:18mmarczykI was planning to give it a spin come end of June, so I guess I'll find out soon :-P
21:19mmarczykbbloom: oh cool, always wanted to touch one of those things
21:19bbloommmarczyk: took about 1 week to get back up to speed a few years ago
21:19mmarczykI don't believe they're stocked by any brick & mortar 'round here :-(
21:19bbloommmarczyk: love this dopey thing
21:20mmarczyk:-)
21:20bbloomyeah, i ordered online
21:20mmarczykI think it'd be slightly dangerous in my current situation
21:20SrPxno idea how to use it sigh
21:22mmarczykmoving around with a laptop quite a lot, I mean
21:23mmarczykthe switch from a MS keyboard to the laptop keyboard was already painful, if the kinesis thing is anywhere near as good as it looks ... :-P
21:23mmarczykSrPx: cygwin?
21:24bbloom*cringe* @ cygwin
21:25Hodappcygwin helps keep my sanity on my Windows box at work
21:26SrPxõo
21:26S11001001truth
21:28gfredericksmmarczyk: I never even considered being proficient at both editors simultaneously
21:28gfredericksthat sounds like a recipe for confusion and frustration
21:28gfredericksditto for qwerty and dvorak
21:29y3dihave you guys tried out haskell? and if so, why do you like clojure better?
21:30bbloomgfredericks: probably pretty easily overcome. i used to think the same thing when i started doing a few different languages for a few different projects at the same time or in the same file. HOW DO I KEEP ALL THESE ESCAPE SEQUENCES RIGHT!?! but eventually you just get good at it
21:31mmarczyky3di: I have, I love it
21:31mmarczyky3di: as for the why question, there are two answers
21:33S11001001y3di: who said I like clojure better? :?
21:33mmarczykthe first is that I like the Lisp style of programming best, I find Clojure's design particularly elegant etc. -- could go on
21:33mmarczykthe second is Cabal
21:34mmarczykw/o the second answer I think this would be a pretty close call, I absolutely love doing stuff in Haskell when I'm not fighting the packaging facility
21:35mmarczykthere's hsenv now and the Yesod thing (cabal-meta?) which I haven't tried yet, so things are getting better
21:38SrPxWhat is cabal?
21:39mmarczykthe blog post on cabal-meta is dated April 5, 2012 and it includes the sentence (describing the pre-cabal-meta state of affairs) "Even with all these tools, one day I found myself completely incapable of installng Yesod from source."
21:40mmarczykI still think Haskell is a marvellous language and an overall glorious achievement, but *argh*
21:40mmarczykSrPx: Haskell package manager
21:40mmarczykSrPx: well, build tool
21:41S11001001sort of both
21:41mmarczykthat's actually an acronym
21:41S11001001fetches deps anyway
21:41mmarczykhttp://www.haskell.org/haskellwiki/Cabal
21:42mmarczykwith certain recently developed utilities it can be used sort of like lein
21:43mmarczykbut getting the correct versions of deps resolved seems to be more of a problem
21:52treehughow would i go about using goog.dom.query in a clojurescript app? i got this far: https://gist.github.com/2985921 but i'm confused why it is not finding the right provides even though they are in the deps i listed in project.clj for cljsbuild to use
21:53bbloomtreehug: hmm.. looks like you're getting errors in core, not your code
21:53bbloomi see you're using cljsbuild, have you managed to compile an empty project at all?
21:54treehugyes, if i leave out the deps i have listed there it compiles. even using goog.dom.* functions if i 'require them
21:54treehug(that is, i remove the reference to good.dom.query from mutest.cljs)
21:54technomancymmarczyk: it's funny that build nightmares are also my biggest complaint with ocaml
21:54technomancythe general advice is "just use apt"
21:55mmarczykouch
21:56jhowarthIs there an equivalent in emacs for M+( that will wrap an s-exp in brackets instead?
21:56bbloomtreehug: is that the right sep? do you want (:use [goog.dom :only [query]]))
21:57bbloomor (:require [goog.dom.query :as query])
21:57bbloomi think you're running into the export == module name issue
21:57mmarczykjhowarth: there's no default binding, but the function is called paredit-wrap-square
21:58bbloomtreehug: let me know if either of those work
21:58jhowarthmmarczyk: Thanks!
22:02cgagi'm messing with aleph and my code looks like this: https://www.refheap.com/paste/3307, but when i open up three tabs and send 3 requests, rather than all of them finishing around the same time, it looks like it's just chugging through them synchronously
22:02rlbtechnomancy: yeah, it's unfortunate, but I understand how we got here, and at the moment, it's the situation we have.
22:03rlbtechnomancy: though I was very happy when guile dropped the non-dfsg bits.
22:03rlb(Running candidate 24.4+1-1 build now...)
22:05cgaganyone know if my that code looks reasonable?
22:06treehugbbloom: i tried (:require [goog.dom.query :as query]) w/ (query/query …), also (:use [goog.dom.query :only [query]) w/ (query …) and (:use [goog.dom :only [query]) w/ (query …) -- basically the same error message with only the namespace text different
22:07bbloomtreehug: what version of cljs are you using?
22:07bbloomtreehug: or, i guess revision
22:08ibdknoxI have very exciting news for tomorrow :)
22:09mmarczykibdknox: http://dev.clojure.org/jira/browse/CLJS-325
22:09bbloomtreehug: are you sure you have the right namespace? i think it's good.dojo.dom.query
22:09ibdknoxmmarczyk: ah, thank you!
22:09bbloomtreehug: http://closure-library.googlecode.com/svn/docs/closure_third_party_closure_goog_dojo_dom_query.js.html
22:09treehugbbloom: interesting question… i take it that cljsbuild provided me lein-cljsbuild-compiler-0/cljs/core.cljs but i'm not sure where from
22:10bbloomhmm maybe there is goog.dom.query too
22:10treehugok i'll try that
22:10bbloomis there a git repo in there? what revision is it?
22:10mmarczykibdknox: now I'm going to wonder what kind of news :-P
22:10mmarczykis tomorrow many hours away in your TZ? :-)
22:11ibdknoxI'll be releasing the playground tomorrow :)
22:11treehugnothing in it, i'll try a clean & deps and see where it downloads from
22:11bbloomibdknox: ah, cool.
22:11ibdknoxI suspect there will be a sudden spike in interest for "learning clojure" materials
22:11mmarczykibdknox: oh great, now you've ruined my start-of-week productivity :-D
22:12ibdknoxhaha
22:12bbloomibdknox: presumably only to kickstarter backers? or more boradly?
22:12bbloombroadly*
22:12ibdknoxthe playground will go out to the world
22:12mmarczykseriously though, can't wait to have a look :-)
22:14gtuckerkelloggis anyone here using clojure in with org-babel?
22:16treehugbbloom: looks like org/clojure/clojurescript/0.0-1236/clojurescript-0.0-1236 is downloaded by cljsbuild
22:19treehugi think it must be my project.clj -- even if i just have (ns mytest) and that
22:20treehug's all i get the same kind of error
22:20bbloomtreehug: oh, heh, that's what i was asking about before…. like i said: you're getting errors loading stuff at the top of cljs core… you're not importing goog.string for example, but core is
22:21pterygotahello, anyone working with overtone in here?
22:21treehugbbloom: yeah sorry, i've been messing around with my project and at one point a simple empty file did compile properly…
22:22bbloomtreehug: try to break it down to a minimal repo & the problem will hopefully become more apparent :-)
22:24treehugbbloom: ok https://gist.github.com/2986062 does compile simple (ns mutest) file, but uncommenting any comination of those google-closure-library deps will break it
22:25bbloomi don't use cljsbuild myself, so i don't know: do you need a gclosure dep? or is that implicitly provided by leon?
22:25bbloomlein* stupid apple auto correct
22:28treehugit looks like leon cljsbuild is downloading a clojurescript and a closure-library to ~/.m2/repository and then compiling a cljs.js info ./.lein-cljsbuild-compiler-0/cljs/core.js maybe my explicitly including closure-library/closure-library-thirdparty on top of the gclosure bits compiled into cljs.js conflict
22:29bbloommaybe. again, i don't use cljsbuild… have you tried just using query without the deps in project.clj ?
22:31technomancyclojurebot: leon is a good sign it's time to turn off auto-"correct"
22:31clojurebotc'est bon!
22:31bbloomleon.
22:31xeqi~leon
22:31bbloomno? :-P
22:31clojurebotleon is a good sign it's time to turn off auto-"correct"
22:31technomancyI should write a library named after Ponce de Leon just to mess with people
22:31bbloomheh.
22:32bbloomi use Textual irc which doesn't disable auto correct in it's little message box, it's pretty much the only time i ever encounter a normal cocoa text box
22:33bbloomchrome, terminal, and vim is pretty much the only other times i type anything :-P
22:34SrPxhttps://github.com/technomancy/swank-clojure <- Add [lein-swank "1.4.4"] to the :plugins section of either project.clj or your user profile. <- what does this mean?
22:35abpibdknox: Holding my breath. ;D
22:35bbloomSrPx: what does which part mean?
22:36bbloomSrPx: do you have a project.clj file?
22:36SrPxNo, I don't even know what this is?
22:36bbloomleon, er i mean lein
22:36pterygotaSrPx: if you create a project with lein new projectname, you should get a directory with a project.clj in it called projectname
22:36bbloomSrPx: it's clojure's project system https://github.com/technomancy/leiningen
22:37treehugbbloom: no doesn't work either - i think because clojurescript doesn't use the thirdpaty closure stuff. anyway i just discovered domina uses good.dom.query and depends on a goog.jar for it and does some magic :libs ["goog/dom/query.js"] in the project.clj. i'll experiment a bit more with that
22:37pterygotaand in project.clj there will be a plugins section
22:37treehugbbloom thanks for your help and ideas
22:38SrPxbut how can I install it? I don't have any of those package manages
22:38SrPxmanagers
22:38pterygotajust install lein by downloading it as described on that page and running it
22:57dnolenmmarczyk: ping
22:57wolgohi
22:57mmarczykdnolen: pong
22:57dnolenmmarczyk: see my comment on 325?
22:58wolgoI want to start learning clojure. Outside of writing, programs what is recommended as a decent first read for someone that has some lisp exposure and can program in other languages?
22:58mmarczykdnolen: assert-args was already in cljs.core, I just moved it to the top of the file
22:59mmarczykdnolen: it's only used to validate macro args, not in the expansion
22:59scottjwolgo: fav book of the channel is clojurebook.com
22:59mmarczykexpansions
22:59dnolenmmarczyk: oh right, gotcha.
23:00wolgookay thanks
23:00wolgoI will be back when I have questions. You have been warned!
23:03dnolenmmarczyk: ibdknox: CLJS-325 resolved.
23:04mmarczykgreat!
23:04rlbtechnomancy: probably won't upload emacs24 until at least tomorrow fwiw -- everything looks good, but I need to test the install a bit more.
23:27technomancyrlb: no worries; I'm on testing anyway