#clojure logs

2013-02-08

01:08FrozenlockI had my first reflex use of `comp'. I feel like I just achieved a new level.
02:53tomojwhat if you had ::foo/bar read to (keyword ":foo" "bar") if there is no alias for 'foo?
02:53tomojwhen I read the edn spec I expected ::foo/bar to be valid
02:54tomojbut I guess the spec means that the part after the colon must be a valid symbol
03:06danebezgood morning, I'd be interested to know if anyone has had to motivate the adoption of Clojure for new e-commerce solutions to management in a country where Clojure still virtually unknown and Java and Rails are hugely prevalent
03:09danebezmanagement sees potential risks in a) new technology, b) finding resources, especially in emergencies that would affect a system launch, c) lack of success stories of similar projects by local companies
03:14darth10@danebez The main problem with Clojure is workforce. But you actually don't really need too many people working on a Clojure project, because of the nature of the language itself.
03:19headshotdanebez: it's also a jvm language with full access to the java world
03:20headshotso if you have a commitment to jvm/java already, it's not an introduction of yet another runtime
03:20danebezthanks for the comments. @darth10, can you be more specific as to why collaboration is more effective vs. Java or Rails?
03:20danebez@headshot we have no commitment yet
03:21headshotoh, "in a country where"
03:21danebezi come from a Java background though, but am convinced that a Clojure implementation would be faster, more concise, have fewer bugs and support scalability
03:22danebez(better)
03:24headshoti kinda lucked out in my workplace. most of the devs are old skool emacs junkies who aren't afraid of lisps
03:24headshotand we have a pretty solid commitment to the jvm as a runtime
03:25shaunxcodewhy am I about to argue with someone on hn about clojure "not being a lisp"? time to walk away from the keyboard
03:26danebezi'm the only technical person in our company, so you can imagine the blank looks and suspicion when i say that i'd like to implement a system in a new language (and one that a huge amount of capital investment will ride on)
03:27headshoti'm not a ruby fan, but it does seem there are a lot of ruby -> clojure "converts"
03:27headshotso that might help with staffing
03:28shaunxcodedanebez: if you are in it for the long haul - go for it - otherwise I can see their point. Maybe I am biased as I have had to say no to myself wrt using clojure on work projects when there are no other developers wanting to learn it :-(
03:28atyzdanebez: i missed the first part of that conversation (disconnected), but i've found rails to be an incredibly effective prototyping tool
03:28headshotbut if you have a bunch of commodity java developers to choose from, that can be quite a brain shock
03:29danebezpeople converting to clojure for web applications from rails when they get decent performance these days is super interesting
03:29headshotespecially if you might be the only clojure job they might ever get in some long term
03:29danebezi wonder what the major benefits are
03:29atyzdanebez: for protyping you won't beat rails
03:29atyzthe issue is that with rails you're stuck with so much convention
03:29atyzand decisions that have already been made for you
03:29atyzas a frame work it isn't *THAT* flexible
03:29atyzits big and fat - and it can be difficult to scale
03:30atyzclojure on the other hand is implemented on the jvm and you can easily choose your components
03:30atyzi like its minimalist approach
03:30danebezrails seem to have grown into something rather enormous, i'm hesitant to learn it (and Ruby) coming from a JVM background
03:30atyzbut this is a weird arguement to be having as its rails (a framework) vs a language
03:31atyzdanebez: ruby is the best multitool language i have ever used
03:31atyzits tooling is amazing and it can do almost anything you want - don't look to it for speed/performance though
03:31atyzthe community behind is is also really great
03:33danebezgiven a clean slate, why choose something that isn't as powerful or concise as Clojure on the functional side, is probably slower, isn't JVM-oriented (except JRuby) and will probably take longer to learn?
03:35shaunxcodesorry did you already mention the region you are working in?
03:37danebezno
03:37danebezi am in South Africa
03:39danebezat the moment, there are virtually no clojure skills being offered on the job market as there are too few companies using clojure still
03:39tomojactually, I'd be happy with this: https://www.refheap.com/paste/698cbbb111cb0d200dcce066e
03:39danebezthe companies that use it either had someone learn it, or hired someone for which it was a "hobby"
03:42ejacksondanebez: there is a web company it Cape Town using Clojure
03:42ejacksonso that's at least 1
03:42danebezyes i am aware of 2 companies ;-)
03:42ejacksonok
03:43ejacksonbut yeah, clojure is a double edged sword right now. You get a self selecting group of enthusiastic, and hence usually, skilled, programmers. There're not lots of them though.
03:43ejacksonFrankly I value that, high signal to noise ratio.
03:44danebezexactly, it seems to be favoured by experienced/skilled/smart developers, which kinda makes it exclusive. but the current java/rails/php ubiquity is by far the largest hindrance imo
03:44shaunxcodedanebez: I am nearly certain I was chatting with someone on datomic mailing list from south africa (unless it was you hah)
03:45danebezno was probably a buddy of mine that runs the local user group
03:46atyzejackson: where are you from?
03:46shaunxcodedanebez: https://www.cognician.com/ ?
03:46danebezyes
03:46ejacksonatyz: originally, Zimbabwe, then SA, now UK, soon US !
03:47atyzejackson: my parents grew up in bulowayo
03:47clgvejackson: you dont like to stay in one place very long, do you? ;)
03:47ejacksonatyz: yeah, my grandparents had a farm just outside there.
03:48ejacksonclgv: yeah, its sadly, true. Wish it wasn't though.
03:48clgvejackson: do you move to the US for a new job?
03:49atyzI'm looking at moving to US in a year or 2
03:49ejacksonactually, I'm just following the missus this time. She got a great job, and I'm going along. I'm an indie dev/consultant so I don't mind where my keyboard rests.
03:49ejacksonatyz: good move.
04:01amalloyoh, we'll have you among us now, ejackson? where in the US?
04:02ejacksonamalloy: not for months yet - December is the appointed time
04:02amalloyah
04:02ejacksonI'm heading to the South to try fill the Clojure gap left by Raynes's departure: Nashville, TN
04:02amalloyyou've missed it, then. dunno about england, but in the US that was two months ago
04:03ejacksonamalloy: its one of those timezone things.... :)
04:43borkdudewhere can I find the source of the port of clojure datastructures in clojurescript?
04:43borkdudein which file on the clojurescript repo I mean
04:59edlothiolborkdude: https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L2863
05:00abpHow can I find out on which ports nrepl servers are running?
05:02abpI've set the repl-options in my project.clj but can't M-x nrepl to the specified port after "lein ring server".
05:07borkdudeanother question: there was a discussion once about why elisp wasn't a good candidate for being a clojure host, because it doesn't have immutability- but javascript doesn't either right?
05:10Bodilborkdude: Uh, neither does the JVM, so that can't really be a serious argument... or am I missing something here?
05:13borkdudeBodil http://technomancy.us/159
05:13vijaykiranwasn't it because of lack-of reader macros and concurrency related stuff ?
05:16borkdudeBodil JVM strings are immutable, also Java has "final" which makes it not easy to change stuff
05:16borkdudebut apparantly in clojurescript this is not considered a problem
05:16Bodilborkdude: The argument seems to be more about using Cljs in place of Elisp rather than whether Elisp can be a Cljs target.
05:17Bodilborkdude: JS certainly has most of the same problems, referential transparence is by convention when it's required.
05:17Bodilborkdude: referential transparency*
05:19borkdudeI think I could live with ref. trans. by convention in elisp
05:20noidiare emacs lisp strings mutable?
05:20borkdudenoidi apparently
05:21noidithat's a pretty big interop hurdle, then
05:22borkdudenoidi who is mutating strings these days?
05:23OscarZ_doing some 4clojure problems.. I tried to creating a function with multiple arities for reduce.. whats the difference between (def func (fn ([] 0) ...)) compared to (fn func ([] 0) ...) ?
05:24noidiOscarZ_, in the latter no var is created for the function
05:25noidithe function name parameter to `fn` is only needed for non-tail recursion
05:26noidiso, the first one's an anonymous function bound to a var, the latter is a function with a name but not bound to a var
05:26OscarZ_ah ok.. i was wondering what can you do with that name after fn but of course you can make a recursive call...
05:27OscarZ_thanks makes sense
05:35OscarZ_from the docs: "def yields the var itself (not its value)." .. so I guess it binds the function to name "func" ... but what kind of beast is var itself? :)
05:43OscarZ_I tried (def foo (def bar (fn ([x y] (+ x y))))) in REPL.. ok i think i get it
06:05ejacksonBodil: nice shirt, glad somebody finally said it so clearly.
06:07Bodilejackson: I'm not going to take credit for that. http://wadler.blogspot.no/2012/12/tech-mesh-2012.html :)
06:09hyPiRiongfredericks: Be my guest :)
06:10ejacksonBodil: nothing is new.
08:54jweissI'm baffled that my clojure function that reduces a list to a list, and then reduces that list a single number, seems to peg all 4 cpus (with a large list). how is that possible? Here's the code: https://www.refheap.com/paste/11048
09:14ponzaojweiss, you are iterating through the list a few times so I guess it is only natural
09:35clgvjweiss: it's not your code but maybe the garbage collector if you list is large enough
09:39calisShould I learn clojure with Emacs (with Emacs Live) or Sublime as my editor? I'm unfamiliar with both
09:41arrdemcalis: I've never used Sublime so I don't know how good its repl (if it has one) is, but I'll say that I moved from vim to emacs because of nrep.el
09:42jweissclgv: yeah that must be it. a million items in the list
09:42clgvcalis: there are more alternative, e.g. Counterclockise in Eclipse
09:49Foxboroncalis: what OS?
09:49calisOS X
09:49Foxboronarrdem: it got capable REPL, as long as you fix the keybinds :P
09:50Foxboroncalis: then you can choose TBH. Emacs got a steaper learning curve, but you get really into all LISPY stuff
09:50Foxboroncalis: if you just want things to work and look good, go Sublime Text 2 and SublimeREPL
09:50FoxboronI have two packages to help with documentations for CLojure in Sublime text
09:50Foxboron(one for autocompletion and one for general docs)
09:51FoxboronI do recommend Emacs if you wanna get really down with Clojure
09:56calisCan u set up sublime with Emacs bindings? Maybe that's best, then I can switch to Emacs when I grow a beard and become a real developer
09:57Foxboroncalis: i really dont recommend emacs bindings in general <.<
09:57Foxborongo with the vim keybinds (which Sublime allready supports) and use those when you get into emacs
09:58Foxboroncalis: but too answer your question; yes you can setup with emacs keybinds
09:58aroemerscallenbot: if you go with ST, try the GotoOpenFile package (and hide the tab bar and side bar), it'll get you used to switching files (or buffers as they are called in emacs)
09:59Foxboroncalis: https://github.com/grundprinzip/sublemacspro
09:59aroemerscalis: ^
09:59Foxboronbut again. VIM keybinds > Emacs keybinds
09:59aroemerscallenbot: sorry, nevermind me
10:00FoxboronEditors in general: Emacs before vim.
10:00Foxboron(my opinions)
10:00Foxboron(don't kill me)
10:01arcatanI think that the times of the holy editor wars are over
10:01arcatanthey should be, anyway :P
10:01calisThanks all
10:01ttimvisherwe're trying to use cascalog interactively from a slime session and under circumstances that we haven't pinned down yet it keeps failing to find our test file on the classpath after working for a while.
10:01ttimvisheranyone experienced something like that before and know how to resolve it?
10:04ttimvisherwe're on hadoop 1.1.1 and cascalog 1.10.0 if that helps
10:05kryftFoxboron: I agree, and emacs in evil mode has been quite nice so far :)
10:05Foxboronkryft: i do have small problems with it, but just change too emacs mode again and it works :P
10:06llasramttimvisher: Are you runing jobs on a cluster from the REPL, or is this just Hadoop local mode?
10:06ttimvisherllasram: remote cluster
10:07llasramttimvisher: How are getting your job contents all available on the task classpath -- launching the REPL from an uberjar, or some other mechanism?
10:09ttimvisherllasram: i'm actually not totally sure how to answer that. we're basically trying to work through these examples: http://nathanmarz.com/blog/introducing-cascalog-a-clojure-based-query-language-for-hado.html
10:10ttimvisherdoes bootstrap do something to do that?
10:11llasramNo. Let's see. So when you submit a Hadoop job to a cluster, you hand the Hadoop mapreduce framework a JAR, which needs to contain all the job's dependencies you have arranged to be available on other nodes by some other mechanism (such as static cluster-wide deployment and addition to the HADOOP_CLASSPATH)
10:14llasramThere's a couple of ways to do that. The two most-used approaches are (a) to build an uberjar and (b) to distribute the jars via the distributed cache then add them to the task classpath (the hadoop commaandline "-libjars" option)
10:14ttimvisherllasram: ah. i see. we've got a little shell script that's `uberjar`ing and rsyncing up to the cluster. i think i don't know enought to even ask the right question at this point :)
10:15llasramOk. Are you explicitly specifying that uberjar as the job JAR somehow?
10:16llasramIf not, my hypothesis is that if you look at your the logs, in the failure cases Cascading has infered something else (probably the Cascading or Cascalog JAR) to be the job JAR
10:17llasramSecond hypothesis is Hadoop gremlins
10:17ttimvisherllasram: looks like we _may_ have simply been using a bad ns declaration :\
10:18llasramhaha
10:19ttimvishernot sure how it was working before
10:20llasramHadoop gremlins
10:41devnRaynes: You around?
10:42devnRaynes: On morphin the README has a note: "More will come soon" -- any ideas for what other sorts of ranges you'd add?
10:47TimMcgfredericks: This is how I imagine your Swearjure talk: https://www.youtube.com/watch?v=F5N35kQAPv0
10:48TimMcgfredericks: (Either the first part or the second part, I'm not sure which. :-P)
10:52babilentpope: Ping me if you need further details regarding vim-foreplay/issues/51
10:52hyPiRion~quicksort
10:52clojurebotquicksort is not something you need alphanumerics for: https://www.refheap.com/paste/284a0552a6b69c6037faa2db5
10:54TimMc(for some definitions of quick)
10:55hyPiRionO(n^3) worst case.
10:56hyPiRionIt's a bit boring that rest is O(n). Wonder if we can speed that up.
10:56TimMcSurely n^3 log n?
10:56TimMcOh, I guess you can ignore log factors at that point.
10:56TimMcrest might even be worse than n
10:56hyPiRionTimMc: Wha?
10:56TimMcWhat's this do? (= `[~@list] [])
10:57hyPiRionOh for. God riddance.
10:57hyPiRionO(n^4) or something then
10:59TimMc(That "what's this" was about your quicksort preview code. I think it can be simplified.)
10:59TimMcSo yeah, my swearjure-rest not only builds up a new copy of the input, it also does a comparison check with the original input, which is O(n).
10:59TimMcAnd there's maybe even another (into ...) step somewhere.
11:00TimMcTime to measure it, I guess!
11:00TimMc~rest
11:00clojurebotrest never returns a unicorn
11:00TimMc~rest
11:00clojurebotrest never returns a unicorn
11:00TimMc~rest
11:00clojurebotrest is easy to write without alphanumerics: https://www.refheap.com/paste/5980
11:01hyPiRionTimMc: oh right, I've not posted the whole thing
11:01hyPiRionI'll pop it up for you
11:02hyPiRionTimMc: https://www.refheap.com/paste/79c034805f87edf1e54c5c8b0
11:03TimMcIs that the same logic as my rest?
11:03ivaraasenhyPiRion: beautiful
11:03TimMcNo, it's got a gensym in it. Nasty.
11:04TimMcI mean, beautiful.
11:04TimMcVery clever.
11:05hyPiRionTimMc: If it's going to be incomprehensible, better make it as incomprehensible as possible.
11:06ivaraasenhyPiRion: do the wrong thing right?
11:07hyPiRionivaraasen: Two wrongs make one right
11:08TimMchyPiRion: I can't tell if that's better or worse than my trick.
11:09TimMcI think it has the same time complexity.
11:09hyPiRionTimMc: Yeah, it has the same time complexity
11:10hyPiRionHm.
11:11ln2This is probably the most silly question ever asked. But what does the # character do? (I tried google and failed miserably) =(
11:11hyPiRion,(map (fn [a] ({[] true} a false)) [() nil [] [1 2 3] (list 1 2 3)])
11:11clojurebot(true false true false false)
11:11TimMcln2: Look at http://clojure.org/reader
11:12TimMcln2: It's a dispatch symbol for the reader -- what's important is the character that comes after it.
11:12TimMc#{ starts a set, #( starts a function literal, etc.
11:13TimMcIf you find it at the end of a symbol, however, it's a gensym.
11:13TimMcDon't worry about those for now.
11:13hyPiRionTimMc: We can probably replace (= `[~@list] []) with ({[] true, nil true} list)
11:13ln2TimMc: Thank you! I have a lot of reading to do on this.
11:13FrozenlockWell, I found some of my older code using read-string without changing *read-eval*. :(
11:14TimMchyPiRion: Well, it's more that `[~@list] and list are in the same eequality partition.
11:14hyPiRionTimMc: Huh? I thought .equals first compared length, then elements
11:15TimMc&(= '(1 2 3) [1 2 3])
11:15lazybot⇒ true
11:15TimMc&(= `[~@'(1 2 3)] [1 2 3]) ;; unnecessary
11:15lazybot⇒ true
11:15hyPiRion&(= nil [])
11:15lazybot⇒ false
11:15ln2Is there a more general / easier definition for what a dispatch is exactly?
11:16hyPiRion&(= `[~@nil] [])
11:16lazybot⇒ true
11:16ln2(I did read the clojure.org document)
11:16TimMcln2: Hmm. Don't worry about that for now either. Just know that "#{" is a single token, "#" isn't doing something to "{".
11:17TimMc# isn't anything by itself.
11:17ln2TimMc: Alright thanks! I just get frustrated when I see code that contains something I don't understand and/or cant replicate. =(
11:18hyPiRion#{} is an empty set, #! is the same as ; (comment), #(...) is a function, #"abc" is a regular expression
11:18ln2I'm on #38 on 4clojure and some of the solutions included # (I had to cheat on two of them).
11:18hyPiRion#'foo is something you shouldn't worry about
11:18hyPiRionln2: if there's #(... % ...), then consider it as (fn [%] (... % ...))
11:19ln2I wonder why the decision was made to use one character in so many different wants? Is that unique to Clojure?
11:19TimMcIt goes back decades.
11:19hyPiRionIt's pretty common for lisps.
11:19ln2Interesting. So if I start a fn with # it automatically assumes inputs %1 %2 %3 ect.?
11:20TimMcDepending on what %n it finds inside, yes.
11:20ln2Very cool !
11:20TimMc,'#(+ % %2)
11:20clojurebot(fn* [p1__55# p2__56#] (+ p1__55# p2__56#))
11:20hyPiRionln2: I'll make some examples to give you an idea
11:21ln2The ' character means "treat as raw data" correct?
11:21TimMcYeah, it's quote.
11:21TimMc'foo is (quote foo)
11:21kryftln2: Or "don't evaluate"
11:21ln2 'win == "win" ?
11:21TimMcNope.
11:22TimMcIt still has to contain well-formed Clojure code, unlike a string.
11:22Frozenlock,(= (name 'win) "win")
11:22clojure-newbhey guys, I'd like to compare the values in two maps, how can I turn the values into sets and compare ?
11:22clojurebottrue
11:22hyPiRionln2: win is a symbol, 'win means "don't evaluate (lookup the value of) win)
11:22clojure-newbor is that not how I would do it ?
11:22TimMcclojure-newb: Call vals on the two maps.
11:22ln2hyPiRion: I think I'm starting to get it. Thanks. =)
11:22ln2kryft: Thank you. =D
11:23ln2Alright I'm going to continue on with my 4clojure now. xD
11:23TimMcErr... maybe call set on those? I think they might not be sets.
11:23TimMcRight, vals can contain duplicates.
11:23clojure-newbso (hash-set whatever) ?
11:23clojure-newband then (= hs1 hs2) ?
11:23TimMcJust set.
11:23clojure-newboh
11:23clojure-newbok
11:24clojure-newbthx
11:24TimMcclojure-newb: Would {:a 1 :b 1 :c 2} have the same vals as {:a 1 :b 2}?
11:24clojure-newberm no
11:25clojure-newbwould need {:a 1 :b 2} == {:a 1 :b 2}
11:25TimMchyPiRion: I get a stack overflow with my rest on a 1e4 element vector.
11:25TimMcclojure-newb: Oh, the keys need to match as well? Just use = on the maps.
11:25hyPiRionln2: https://www.refheap.com/paste/23405de5f52cdb3c531bd5c35 Should cover most of the #(...) examples
11:25hyPiRionuse-cases*
11:26clojure-newbTimMc: sorry no the keys do not need to match, but there are the same number of key/val pairs in each of my maps
11:26hyPiRionTimMc: :jvm-opts ["-Xss1000m"]
11:26ln2hyPiRion: Holy Sh** thanks!!! Bookmarked!
11:27clojure-newbthink I've got it with 'set' thx
11:27TimMcclojure-newb: Then would {:a 1 :b 1 :c 2} have the same vals as {:d 1 :e 2 :f 1}?
11:27TimMcerr, {:d 2 :e 1 :f 2}
11:27TimMcNote that one as 2 2s, and the other has 2 1s.
11:28clojure-newbTimMc: my case is something like {:a 1 :b 2} compared to {:a1 1 :b1 2}
11:28clojure-newbso set on the vals should be good
11:29hyPiRionln2: You're welcome :) I had problems finding documentation on the #() thing, so I can relate
11:29kryftHmm, algorithms and data structures are generally presented in imperative pseudo-code. How hard is it usually to come up with a decent functional implementation? I'm asking as someone who is quite new to both functional programming and algorithms and data structures (my CS background is, uh, checkered)
11:29TimMcclojure-newb: So duplicate vals of different "multiplicity" don't bother you?
11:29clojure-newbTimMc: no as I'll be grabbing keys I control beforehand
11:31hyPiRionkryft: I have found it to be hard to program algorithms with functional programming languages first time I tried, but with some training I've found it to be just as "hard" as imperative programming. A "problem" is the speed. Usually functional versions have a higher constant, though they have the same runtime.
11:31ln2hyPiRion: Even on clojure.org it doesn't give a very good high level explanation either. Most of this documentation assumes you have java and/or lisp experience. =(
11:32hyPiRionln2: I think it requires programming experience in general. And I know, it's a bit sad
11:32ln2hyPiRion: Yup. Got zero of that. xD
11:33ln2hyPiRion: Maybe there will be some books or websites that target true "beginner" programs for Clojure soon. We really need to teach the next generation of programmers to think and program in this way. Not just ourselves!
11:33ln2*programmers
11:34hyPiRionln2: I think the community would be very happy if you could note down where you are struggling. I'd love to help making it easier to learn the basics of programming through Clojure, but I'm afraid I will assume that people have an understanding of this and that.
11:34hyPiRionWhich they most likely won't when they've never programmed before.
11:35hyPiRionAlso, a dictionary of words would be nice. I still find "multiple dispatch" a bit... academic?
11:35ln2hyPiRion: That is actually a really really great idea. I will start making some notes now considering I'm still less than a week into it. Maybe the notes can help give perspective on the brain of a completely virgin programmer attempting to learn FP. xD
11:35kryfthyPiRion: Ok, thanks :)
11:36hyPiRionkryft: If you're going to learn algorithms and data structures, do so with an imperative programming language like Java or C++. Most books are designed for those languages, so attempting to learn both at same time may inflict more pain than you'd like :p
11:37ln2I think that an "absolute beginner" course for lamda calculus would solve a lot of problems with grasping Clojure.
11:38Natchln2: if you have 20+ hours of free time I heartily recommend Structure and Interpretation of Computer Programs video lectures and book if you want an intro to programming and how stuff works using lisp (scheme). free from http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/
11:38ln2Natch: Thank you!!! I love lectures! Haha
11:39FrozenlockThose are amazing lectures
11:39ln2*Watching right now* =)
11:39FrozenlockBlackboard... So many parentheses without the help of an editor.
11:40kryfthyPiRion: I was afraid you'd say that. :P I'm trying to decide on my first clojure project, and many of the ideas seem like they might involve non-trivial algorithms (i.e. something I might have to look up) or numerics
11:42kryfthyPiRion: (I'm mentioning numerics separately from algorithms mainly because I expect numerics has its own considerations compared to, say, graph algorithms)
11:43hyPiRionkryft: I think programming the solutions in FP is a great way to really understand the problem and its solutions, but it involves to think outside the textbook and lectures.
11:44kryfthyPiRion: Ah, I'm not taking a course in anything, just teaching myself
11:46kryfthyPiRion: But yeah, of course the point about needing to think outside the textbook pseudocode still stands. :P
11:46hyPiRionkryft: If you really want to understand both worlds, then I think it's a great approach. Just be prepared to spend some time with it :)
11:47kryfthyPiRion: Ok, thanks :)
11:47kryftI want to understand everything, which is why I often get very little done :P
11:48hyPiRionI did a blogpost on the "functional programming + algorithms" thing, not sure if it helps you to pick "the right thing", but I can at least point you to it: http://hypirion.com/musings/fbhc-2013-in-clojure
11:49hyPiRion(Facebook Hacker Cup is an "algorithm and data structures"-competition)
11:50hyPiRionWhat you'd like is the introduction and the "Improving Ancient Skills"-part.
11:51kryfthyPiRion: My limited exposure to functional programming has certainly changed the code I write in less functional language
11:52ToBeReplacedi've been thinking about DOM manipulation problems; has anyone tried modeling nodes as time-series?
11:52hyPiRion(inc kryft)
11:52lazybot⇒ 1
11:53hyPiRionkryft: It's all about picking the right tool, and sometimes you can partially have your tool in a language not designed for it :)
11:53desertmonadif I buy Clojure Programming from orally with a coupon, do the authors get less royalty from that purchase?
11:53desertmonader, oreilly
11:53desertmonadlol
11:54tpopebabilen: I'm around
11:55babilentpope: Ah, wonderful. Might be easier like this.
11:56babilentpope: I just commented that one way would be to check for (defproject ...) in project.clj, but that might still cause false positives. I can't really think of a fool-proof method to decide this though. Checking for "(defproject ..)" strikes me as better than checking for "src" though.
11:57babilenOr is anyone here aware of a good method to test if something is a leiningen project if project.clj is around?
11:57tpopeslurping the entire file in is lame
11:57tpopeis there really nothing in the directory we can rely on?
11:59babilenI agree, but AFAIK there is nothing like a .this-is-a-lein-project or something like that. The best I can come up with is "test for project.clj" or "test for project.clj and check that it contains (defproject ..)"
11:59hyPiRionbabilen: project.clj may have multiple statements. You'd have to check every single statement to do that.
11:59hyPiRion(the (defproject ...) check)
12:01babilenhyPiRion: Can you think of another way to test this?
12:01hyPiRionYou could possibly make a "lein-nothing" plugin which does nothing and requires a project. It will return an error message if it's not within a project map.
12:02hyPiRionBut that would evaluate project.clj, so be aware of that.
12:02tpopeI'm looking to do static analysis actually
12:02babilenhyPiRion: Sounds as if simply running "lein classpath" to get the classpath (or an error) would be a viable option then.
12:03babilenBut that also does not allow for a static check
12:03babilenAs I said: Checking for project.clj and testing its content is the best I can think of. That might not be beautiful, but I really can't think of anything else. (short of using lein)
12:03tpopeI was checking for both project.clj and src/. but apparently some people are too good to have a src/
12:04hyPiRiontpope: Yeah, people may have clojure/ and java/
12:04ToBeReplacedor src-clj src-cljs
12:04hyPiRionLeiningen checks by evaluating project.clj really, so.. *shrugs*
12:04babilenhyPiRion: Some people don't use src/ but configure :source-paths ["übersrc"] in project.clj or something along those lines.
12:05hyPiRionbabilen: exactly.
12:05tpopethese are horrible people
12:05nDuffEh.
12:05babilentpope: I agree - But I ran into it today, went "wtf" and figured out what can be done to solve this.
12:05nDuffI think "anyone who does that is awful" is an excuse for people to write a lot of very horrid code
12:05nDuffie. assuming in shell scripts that there will never be files or directories with spaces or newlines in their names
12:06nDuffthe bugs that fall out of those assumptions are frequently security-exploitable
12:06hyPiRionBut if there's a project.clj and it contains a defproject, it's considered a Leiningen project. Whether it's malformed or not is another issue.
12:06nDuff...building code to be robust even against things that only "horrible people" do is simply the Right Thing.
12:06tpopecounterexample: https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/project.clj
12:06tpopenDuff: yes, which is why I'm trying to find a solution
12:06babilen+1
12:08babilentpope: To get this straight: you don't actually call "lein classpath" to determine the classpath in every case? And you also see checking the content of project.clj (does it contain (defproject ...)?) as an ugly solution?
12:08gfrederickshyPiRion: cool, thanks
12:08tpopebabilen: well for starters, classpath.vim is technically optional. you can connect to nrepl without it
12:09tpopethere's two different checks for this. one in classpath.vim and one in foreplay.vim
12:09hyPiRiontpope: Leiningen considers that folder to be a project, and casts an exception because project.clj is malformed.
12:09kryfthyPiRion: I've also heard about things like Okasaki's Purely Functional Data Structures, but I thought that might be overkill at this point
12:09tpopehyPiRion: yes, but lein has the luxury of telling the user not to do that
12:09TimMcnDuff: And -- all the things!
12:10tpopeforeplay works irrespective of the cwd
12:10hyPiRionkryft: I got that book, and it doesn't go into "standard" algorithms
12:10hyPiRionAnd I think it requires some familiarity with data structures from before
12:11hyPiRiontpope: heh. Life's hard, eh.
12:11hyPiRionMake some bayesian network which returns a probability that the folder is a leiningen project or not.
12:11ln2I love the Eval => Apply wizard. Haha
12:12kryfthyPiRion: Right
12:13ln2Iceland_jack: No I'm watching the MIT Lisp lectures. xD
12:13tpopebabilen: if you want to help, step one is taking foreplay.vim's s:hunt and factoring it inline
12:13alexnixonhyPiRion: re your blog post - note that although C++ hasn't historically encouraged the use FP-related principles (e.g. purity, immutability), the language doesn't prevent you from doing so
12:13tpopethere's only one consumer left
12:14TimMctpope: What does foreplay.vim do?
12:14babilentpope: Ok, I'd love to help, but have to see how far I can get.
12:14nDuffalexnixon: Makes it very easy to slip out of them by mistake, however, and hard to analyze whether something is conformant.
12:15babilenTimMc: vim → nrepl plugin : https://github.com/tpope/vim-foreplay (think of it as nrepl.el for vim)
12:16tpopeyeah basically
12:16hyPiRionalexnixon: Indeed. The difference between Clojure vs. C++ is that Clojure has immutable datastructures in the core language/standard library, whereas C++ does not
12:16SurlyFrogDoes Clojure have a method of determining the location of the source file at runtime? I want to get at some data files relative to the source code files. I'm thinking something along Common Lisp's `(make-pathname :defaults *load-truename* …)` or Python's `__file__` feature.
12:16TimMcOK. It was hard to tell from the description.
12:17nDuffSurlyFrog: Hmm. There's compile-time metadata with those, but I'm not sure it still exists at runtime.
12:17hiredmanSurlyFrog: it does, but I recommend using clojure.java.io/resources instead
12:17TimMcSurlyFrog: Put things in the ./resources folder.
12:17tpopewell it's hard to describe. it's technically not nrepl specific
12:17gfredericksTimMc: hyPiRion: submitted
12:17hyPiRiongfredericks: :D
12:17hiredmanclojure.java.io/resource
12:17technomancytpope: FWIW lein just checks for project.clj, so if someone has a project.clj that's not in the project root they're going to have issues running lein anyway
12:18technomancytpope: including the leiningen-core project, heh
12:18technomancyit has bitten me a couple times but never enough for me to actually fix it
12:18SurlyFrogThanks all, I'll look at clojure.java.io/resource
12:18tpopetechnomancy: yeah, since I'm not using the cwd I need to be more careful about it than you do
12:19hiredmanSurlyFrog: it lets you load arbitrary files from the classpath
12:19hiredmanthe jvm way to do that sort of thing
12:19SurlyFroghiredman: thanks, my Java experience is limited, but I'll figure it out :-)
12:20gfredericksI bet there's significant demand for an "Intro to the JVM for clojure programmers" that cuts out all the java-specific noise
12:22SurlyFroggfredericks: I would definitely second that. I for one have over a decade of experience doing C, Python, and Common Lisp. I really like Clojure, but I find myself lost a lot when it comes to certain JVM items.
12:22ldhgfredericks: thirded
12:22gfredericksI have a coworker with a lot of C++/ruby in a similar position
12:26kryftgfredericks: I was actually just about to ask about that
12:26jackdangergfredericks: fourthed. I had to learn Java to get past intermediate Clojure steps.
12:26SurlyFrogSo, to do this the proper way, I make a folder named "resources" under my project root (where Leiningen's project.clj file is), then use `(.getFile (clojure.java.io/resource "filename"))` and the JVM will find it?
12:26Frozenlockgfredericks: Yes, the JVM is really the hardest part of clojure. Or rather, the implication that one should use it.
12:28SurlyFrogThere must be something else to it. Possibly a Leiningen option….
12:29nDuffSurlyFrog: Depends on your classpath.
12:29hiredmandon't use .getFile
12:29nDuff...oh; was reading too quickly / didn't see the .getFile
12:29hiredmanuse one of the other functions in clojure.java.io, most likely reader or input-stream depending on what you are doing
12:30nDuffSurlyFrog: ...so, consider the case where your project has been compiled into a .jar
12:30SurlyFrogWell, I'm relying on Leiningen to set up my class path for me. Is there an option to have it add a "resources" subdirectory to it
12:30nDuffSurlyFrog: in that case, your resource is no longer a separate file
12:30SurlyFrogokay
12:30hiredmanhttps://github.com/technomancy/leiningen/blob/master/sample.project.clj#L213
12:31technomancySurlyFrog: I think if you create the resources directory after starting your repl it won't be visible until the repl restarts
12:31technomancyjust an annoying jvm-ism
12:31SurlyFroghiredman: thanks
12:31SurlyFrogtechnomancy: yeah, I had that thought while I was doing it...
12:32hiredmanthe reason to avoid "files" is the normal way to distributed code is as some kind of jar file, so your "files" don't exist as files, they are just entries in the jar (a zip file)
12:32SurlyFrogSo, the actual key is using the `:resource-paths` in project.clj, correct? By doing that, will the case that nDuff talks about (compiling the project into a jar) be handled?
12:33hiredmanI think java7 has some nio2 stuff that will let you treat a jar like a filesystem
12:33technomancySurlyFrog: no, you don't need to set :resource-paths unless you're changing the default
12:33technomancycreating a "resources" directory in the project root is enough
12:33nDuffSurlyFrog: Content in your resource-paths should make it into jars that lein builds for you, yes. (But if it's just project-root/resources, that should already be the case)
12:34SurlyFrognDuff: thanks
12:36SurlyFrogIs there a way to denote that a particular resource is only used for testing? In the event I had some giant file that wouldn't need to be included in a JAR being released.
12:37technomancySurlyFrog: sure; put it in dev-resources insntead
12:37SurlyFrogtechnomancy: perfect, thanks so much!
12:39SurlyFrogThat's in :profiles, correct? So `:profiles {:dev {:resource-paths ["path/to/dir"]}}`
12:39technomancysimplest just to mkdir dev-resources
12:40SurlyFrogat the top-level of the project?
12:41SurlyFrogI see it, thanks
12:49SurlyFrogUm, Java inexperience showing again…. `(clojure.java.io/resource "foo")` gives me a URL to a file. I want to read it line by line. Am I correct to assume that using `clojure.java.io/reader` is considered the "right way" to do this?
12:52hyPiRionSurlyFrog: (with-open [r (io/reader (io/resource "foo"))] (read lines here))
12:52hyPiRionSo yes.
12:52hyPiRionEither that, or slurp.
12:52hiredman(doc line-seq)
12:52clojurebot"([rdr]); Returns the lines of text from rdr as a lazy sequence of strings. rdr must implement java.io.BufferedReader."
12:52SurlyFroghyPiRion: thanks so much for confirming! That's what I'm up to :-) Doesn't slurp pull the entire file into memory?
12:53hyPiRionSurlyFrog: yup. hiredman's solution also works, but be aware that the reader will be open until the last line is consumed.
12:53SurlyFroggot it. thanks so much
12:53hyPiRionActually, hiredman's solution seems to fit better with your goal, so use that one.
12:55SurlyFrogI'm doing a `(with-open [rdr (io/reader (io/resource "xxx"))] (doseq [line (line-seq rdr)] ….))
12:55hyPiRionThat should be safe
12:56hyPiRion(In the sense that it shouldn't crash)
12:56dnolenfeedback welcome http://swannodette.github.com/2013/02/08/the-simply-typed-lambda-calculus-in-20-lines-redux/
13:06TimMcdnolen: I'm curious why you decided to move to github. Doesn't that give you less control over your URLs?
13:07TimMcOh, never mind -- you were on posterous before.
13:07dnolenTimMc: heh yeah
13:07dnolenI just don't want to spend time managing a blog, jekyll + git is convenient.
13:07TimMcI'm one of those folks who thinks that everyone should have their own domain name.
13:08technomancyI think if you pay for a micro plan github will let you do a CNAME
13:08dnolentechnomancy: yeah I saw that
13:09DerGuteMoritzdoes anyone know if this is intentional behavior:
13:09DerGuteMoritzuser> (let [m (transient {1 2})] [(get m 1) (contains? m 1)])
13:09DerGuteMoritz[2 false]
13:09jonasendnolen: there is a t (instead of tau) in (1)
13:10jonasenin the explanation of (1) that is
13:10hyPiRionDerGuteMoritz: sounds very much like a bug.
13:10hyPiRion(doc transient)
13:10clojurebot"([coll]); Alpha - subject to change. Returns a new, transient version of the collection, in constant time."
13:10DerGuteMoritzah http://dev.clojure.org/jira/browse/CLJ-700
13:10dnolenjonasen: thanks!
13:11jonasendnolen: nice post btw. Already looking forward to the next one
13:11TimMcWow, that's an old bug.
13:11DerGuteMoritzhm something seems to be wrong with the patch :-)
13:11DerGuteMoritzanyway, cljs seems to have the same bug
13:11dnolenjonasen: thanks
13:12AtKaaZ,(sorted? (map? (sorted-map)))
13:12clojurebotfalse
13:12mrb_bkdnolen: ooh a new post
13:12dnolenjonasen: btw, I think you'll finally get your sequence matching feature in core.logic ;)
13:12AtKaaZwhy isn't sorted-map implementing Sorted? or what is?
13:12ln2I didn't realize that you could use github to hosts websites. That's pretty cool. =)
13:14AtKaaZ,(sorted? (sort []))
13:14clojurebotfalse
13:14mrb_bklol @ "Being an undisciplined not computer scientist"
13:14jonasendnolen: that would be very nice
13:14biff_tannenqq ... will including lein-ring include ring-core as a dependency ?
13:14AtKaaZmrb_bk: that sounds like me :D
13:14DerGuteMoritzah no, I am mistaken, only -contains-key? has this bug in cljs
13:15jonasendnolen: is it already implemented somewhere?
13:15dnolenjonasen: there just wasn't a good place for it, but now that we have featurec we can do it sensibly.
13:15mrb_bkdnolen: a link to the paper might be a good idea
13:15AtKaaZ~logs
13:15clojurebotlogs is http://clojure-log.n01se.net/
13:15dnolenjonasen: it will be supported in featurec
13:15dnolenmrb_bk: which paper?
13:15mrb_bkdnolen: Cheney & Urban
13:15mrb_bkoh!
13:15mrb_bkit's there
13:15technomancybiff_tannen: plugins and dependencies are separated by design
13:15mrb_bkdnolen: my bad
13:16weavejesterbiff_tannen: Indirectly, but it's best to add the dependency explicitly.
13:16technomancybiff_tannen: though it's possible for a plugin to affect the dependencies list if it thinks it needs to
13:16dnolenjonasen: so (featurec some-list [1 2 (rvar) 3 4]) or something like that
13:16weavejesterYou shouldn't rely on it pulling in ring-core, put it that way :)
13:16dnolenjonasen: where rvar will consume until 3 is encountered
13:16ivaraasendnolen: nice blog post
13:17dnolenivaraasen: thanks!
13:17AtKaaZoops I realized where I fail: (sorted? (map? (sorted-map))) instead of (let [x (sorted-map)] (and (sorted? x) (map? x)))
13:18dnolenjonasen: there's probably some edge cases where around multiple possible matches, not sure if or even how to support that yet.
13:19jonasendnolen: possible matches arise when you have several rvar's as in [(rvar) 1 (rvar)].
13:19AtKaaZmaybe (sorted? true) should yell if not being passed a coll, for lame ppl like me :)
13:19jonasenmultiple, not possible
13:19weavejestertechnomancy: Is there any way of having a "profile.clj" on a per-project basis in Lein?
13:20weavejesterAs project.clj is typically in source control
13:20weavejesterBut sometimes you might want to override options without commiting them to the repo.
13:20dnolenjonasen: yep, so I'm not sure about that - whether supporting it is worth it without handling that case
13:20technomancyweavejester: yeah; profiles.clj =)
13:20dnolenthose cases, really
13:21jonasendnolen: But that shouldn't be a problem since core.logic already returns multiple results.. or am I missing something?
13:21weavejestertechnomancy: You mean if you have a "profiles.clj" in your repo directory it will allow you to override options in the project.clj file?
13:21dnolenjonasen: no it's a problem - constraints live in a different "world" so to speak
13:21dnolenthey don't really participate in search - that is they never return multiple possibilities
13:21technomancyweavejester: yeah
13:21AtKaaZwhat identifies as coll(ection) ? is it clojure.lang.ISeq ?
13:22weavejestertechnomancy: Ah, excellent. That makes an awful lot of sense.
13:22AtKaaZoh it's coll? aka clojure.lang.IPersistentCollection
13:22jonasendnolen: ok.
13:23technomancyweavejester: I think hugod added it
13:23biff_tannenthx technomancy weavejester
13:24hugodtechnomancy: I don't remember adding it - though I certainly use profiles.clj.
13:25hugodI tend to put all the dev time stuff in it and commit it as well though
13:25technomancyhugod: hmm... well I don't remember adding it myself.
13:26technomancyhttp://forums.weebls-stuff.com/images/smilies/Itisamystery.gif
13:26mrb_bkdnolen: does this look reasonable? https://gist.github.com/mrb/4740935
13:27dnolenmrb_bk: looks ok to me, do you need a conde because you're going to add other clauses?
13:28mrb_bkdnolen: ah yeah good point i left that in when this did more. thanks!
13:29TimMchyPiRion: DId you follow what I meant about `[~@list]?
13:43FrozenlockIs there a way to temporarily cache result from a function? i.e If called within 10 sec, just return the same result.
13:44technomancyFrozenlock: easier to do for the scope of a binding than by a time window
13:44TimMcCheck if core.cache has a memoizer that does that.
13:47cemericklynaghk: have you looked at lein-dalap any? http://birdseyesoftware.github.com/lein-dalap.docs/
13:48FrozenlockTimMc: TTLCache sure looks promising :)
13:49abpcemerick: Have you? :)
13:50cemerickabp: reading now
13:52cemerickcouple of practical bits that'll make it tough to dig into
13:52cemerickesp. enumerating source and target file paths
13:54abpcemerick: Hm ok.
13:56lynaghkcemerick: nah, I've never seen it
13:58lynaghkcemerick: looks like it was inspired by cljx, though. I guess they wanted form-by-form transforms, instead of just toplevel vars
13:59hyPiRionTimMc: `[~@list] generates a new list in O(n) time, yes
13:59ln2Trying to install https://github.com/fmw/vix
13:59ln2I get the following error. http://tny.cz/ad7dd9fa
14:00ln2In the "Execute the (add-user) function in order to add a user with full access privileges:" step. Any suggestions?
14:01ln2The entirety of google doesn't seem to have this error related specifically to vix. =(
14:01lynaghkcemerick: it kind of bugs me that there are two or three different things out there for this problem. I'm not sure if there is a Clojure-specific trend there or if it's just an emerging language or programmer thing in general
14:02hyPiRionTimMc: was that what you thought of?
14:02technomancyit's because people don't tell the irc channel before starting!
14:02cemericklynaghk: trend, as in, multiple parallel solutions?
14:02lynaghkcemerick: e.g., every month someone releases a new hiccup library without really mentioning why something new is warrented
14:02lynaghkcemerick: yeah.
14:02nDuffThere'll eventually be one solution that's canonical.
14:03cemerickwell, it's early days
14:03nDuff...at least for the clj/cljs thing.
14:03technomancylynaghk: validation libs =\
14:03cemerickas cool as cljx and kibit is, writing core.logic rules for portability purposes hurts
14:03technomancyit's the Curse of Lisp; it's easier to roll your own than to coordinate.
14:03lynaghkcemerick: yeah, sure. I'm definitely part of the problem on a few libraries though.
14:03FrozenlockYeah, why don't people check clojure.org before starting a library! SHeesh
14:03technomancyFrozenlock: hehe
14:04cemerickall of these options will be blown up whenever feature expressions land
14:04cemericklynaghk: I don't actually think it's a problem.
14:04lynaghktechnomancy: that's true for lots of languages. When node.js first came out I was trying to use it for something and found like 20 JSON parsers.
14:04hiredmancemerick: is their any indication from rich that they will ever land?
14:04cemerickPeople want different stuff, bikeshed, and sometimes are just interested in the problem as an exercise.
14:04technomancylynaghk: CL never grew out of it
14:05hiredmanthere
14:05lynaghkcemerick: it's not a problem if you have a few hours to github around. There definitely are benefits to Python's "batteries included" approach
14:05hiredmandamn
14:05technomancyruby had a phase where every other week there was a new testing framework because people liked playing with metaprogramming
14:05p_ltechnomancy: I think CL suffered more from the lack of code sharing and lack of good and easily available implementation
14:06cemerickhiredman: Not that I'm aware of, but a lot of people are lobbying.
14:06ln2Does anyone have any experience with Vix? https://github.com/fmw/vix
14:06lynaghkcemerick: sure, yeah. I totally get where they're coming from---my rant is mostly self-directed angst about the lack of such ecosystem-level documentation on my own projects =P
14:06cemericklynaghk: eh; many of those batteries are traps
14:06p_lby the time it was easier to do so, it suffered from thousands of shitty tutorials written based on stuff from late 1970s ;)
14:07lynaghkcemerick: sure, but at least it forces people to consider the question---"this library X is a replacement for default library; unlike the default it does A, B, and C"
14:07cemerickThe Clojure portability issue is going to haunt us nearly forever though, feature expressions or not.
14:08nDufflynaghk: Look at Python's XML library situation.
14:08devnI have a feeling there's going to end up (whether people like it or not) being a couple of "default stacks" in clojure. Some will decide to go the "Sinatra" route, others will want a more "batteries included" approach.
14:08lynaghkcemerick: we tend to have a lot of announcements like "ANN: Awesome Library X 0.1.0. It does A"
14:08Frozenlockfwiw, shaunxcode made a summary of existing cljs libraries to help newcommers, and hopefully help avoid duplicates in libraries: https://github.com/shaunxcode/clojurescript-ecosystem/wiki/libraries
14:08nDufflynaghk: You've got a whole bloody lot of them all there as included batteries, because they can't be removed without a lengthy deprecation process once they're in.
14:09nDufflynaghk: ...and the only one's that actually _good_ (lxml) isn't even in there.
14:09cemericklynaghk: time heals all :-)
14:09cemericklynaghk: surely you can't be _so_ angsty already!? ;-)
14:09lynaghkFrozenlock: thanks for pointing that out
14:10devnlol
14:10sirvalianceHow is the progress for clojure on android?
14:10lynaghkcemerick: I think I might just need to bite the bullet and start a blog where I set things straight =P
14:11lynaghkcemerick: and/or stir up trouble. The problem is that I prefer just shipping quietly.
14:11hiredmanoy, you front end guys, endless drama
14:12devnsirvaliance: there's a clojure-android google group
14:12hyPiRionOh, talking about multiple libraries and so forth: Is there a number theory library for Clojure?
14:12lynaghkhiredman: we're all troubled because what we make these days are hacks on hacks on hacks on top of a few backwards langugages =P
14:12cemerickI'm still at the stage where I generally don't bother looking for cljs libs. I don't even properly know what I need, even if it were right in front me.
14:13devnhttps://github.com/pierrel/clojumbertheory
14:13devnheh, 4 years old at this point
14:13lynaghkcemerick: you know what you do need? A ClojureScript-powered iPhone app to tell you the weather: http://weathertableapp.com/
14:13cemericklynaghk: if only I had an iphone
14:13cemerickoh, I'll give it a roll on my wife's
14:14lynaghkcemerick: rad =)
14:14sirvaliancedevn: Thanks, somehow I missed it
14:14cemericklynaghk: your h1's are clipping horizontally
14:14cemerickFF 18
14:14devnsirvaliance: np
14:14hyPiRiondevn: hehe. Well, I suppose it's reasonable to create a new library if the old one's unmantained and not forked.
14:14lynaghkcemerick: thanks, I'll forward to the OCD designer.
14:15lynaghkhyPiRion: hence all of the hiccup libraries...
14:15TimMccemerick: Don't you know? Clipping is all the rage these days. http://alistapart.com/
14:15cemericklynaghk: you're supposed to make it free, and then monetize via premium features! :-P
14:16lynaghkcemerick: "Don't want it to rain? Buy the rain-guard for $1.00 right now!"
14:16cemerickTimMc: hum :-/
14:16devnhyPiRion: my thought is that there's probably a java library you could wrap
14:16TimMccemerick: I'm kidding, ALA got a lot of flak for that.
14:16FrozenlockTimMc: I don't know why, but the fact that I can't see the entire heading makes me mad.
14:16cemericklynaghk: or, think of the affiliate income from showing ads from local bodegas when the storm is coming!
14:16dnolenlynaghk: nice
14:16hyPiRiondevn: Think about the cljs-people.
14:16hyPiRionbut yeah, I know, I know.
14:16devnhyPiRion: fair enough
14:17lynaghkdnolen: stuff got pretty gnarly in there, code-wise. E.g., it initially used EDN but deserializing 2kB took 8 seconds on the phone
14:17devnyeesh
14:17dnolenlynaghk: oof
14:17TimMchyPiRion: It's more that (= list []) is a simpler way to write it.
14:17hyPiRionIt's just that I've done quite a bit of Project Euler and made a couple of utility functions, all related to nuber theory.
14:17lynaghkdnolen: so we switched to JSON. The DOM walking was pretty slow, so I had to rip out C2 and use .-innerHTML gnarlyness
14:18cemericklynaghk: do you not have JIT the way it's deployed?
14:18jonasendnolen: A new clojurescript release would be nice as people are seeing warnings due to #455
14:18clojurebotClojureScript is https://github.com/clojure/clojurescript
14:18lynaghkdnolen: interesting fact, though, JSON.parse takes an optional "reviver" function that is basically a postwalk function, so you can throw together an EDN-esque tagged literal system
14:18devnhyPiRion: yeah, i did euler problems so long ago in clojure that I never made a lib of them.
14:18dnolenlynaghk: I'm not surprised by switching to JSON, nor having to use .-innerHTML depending on what you're doing
14:19devnbut everyone writes the same stuff. a library would be cool
14:19lynaghkcemerick: My understanding is that iOS doesn't allow JIT inside of embedded web views, which is how this app is deployed
14:19dnolenjonasen: yes, but it would be nice to confirm 418 first
14:19hyPiRionTimMc: I suppose it's okay since I know that all "lists" will be vectors? For a general-purpose algorithm that wouldn't hold.
14:19cemerickbrutal
14:19hyPiRione.g. (filter foo nil).
14:19cemericklynaghk: but bookmarked/fullscreen sites would get the JIT?
14:19lynaghkdnolen: next cut of the app will probably be using Angular.js---I'm interested to see how well that performs and how much cleaner the code gets. Right now the architecture is a lil' state-machine with transitions that bang on the DOM.
14:19dnolenlynaghk: yeah JIT does make a big difference.
14:20lynaghkcemerick: yeah, if you are using Safari then stuff gets JIT'd (in my limited understanding)
14:20fogus|gonednolen: Is it a fair statement to say that conde unifies across parallel universes?
14:20cemerickThank goodness I'm not targeting mobile yet.
14:20lynaghkcemerick: yeah, this was our first stab at a consumer-facing AppStore App.
14:21lynaghkcemerick: is your browser zoomed? That may be the cause of the clipping.
14:21cemericklynaghk: nope
14:21cemerickdo you want a screenshot?
14:21lynaghkcemerick: yeah, that'd be great. thanks
14:22dnolen`fogus: hmm, I don't really think of conde that way :) in my mind it's like a nicer version of disjunction in Prolog - but that doesn't sound as cool
14:22devnlynaghk: i think the slide animations in the weather app when selecting days seem a little wonky to me
14:22`fogusdnolen: I'm aiming for cool (and for comic book references ;p)
14:23devnthe header (day of the week) seems to not be attached to the hourly view
14:23devnand changes at a slightly different rate
14:23dnolen`fogus: I do think of it as permitting the description of possible worlds.
14:24`fogusdnolen: I'll take it! Thanks
14:24cemericklynaghk: http://twitpic.com/c1y85h
14:28hiredman"dnolen endorses copenhagen interpretation, physicists puzzled as kitchen table coder speaks out"
14:29hiredmanmy guess as to what fogus is writing
14:30`fogushiredman: I like to think of it as the Infinite Crisis interpretation.
14:34SurlyFrogIs there a way to see the actual byte size of a data structure? I have a set in memory and I can get its `count`, but I'd actually like to know how much space it is really taking up.
14:35hyPiRionSurlyFrog: Oh, you're new to the JVM I see.
14:35SurlyFroghyPiRion: yeppers...
14:36mattmossWhat, Java doesn't have sizeof? j/k
14:37hyPiRionSurlyFrog: not sure if it's possible, to be honest. maybe with some profiler or debugger?
14:37nDuffYourKit can do it... kinda.
14:37nDuffTo know a real value, you need to figure out what objects that structure holds the only references to
14:37SurlyFrogokay….I'll do some experimenting
14:38ravsterhello all
14:39SurlyFrogI wish `time` gave you memory usage as well as execution time.
14:40nDuffWouldn't be a very useful number.
14:40nDuff...not for Java-based programs, anyhow.
14:40SurlyFrogwhy not?
14:40craigbroit COULD be useful if you had nothing else going on, and you GCed before and after
14:40nDuffSurlyFrog: Because if you give a Java program more memory, it'll use it to be able to GC less frequently.
14:41nDuffSurlyFrog: so the peak memory it uses and how much memory you need for things that actually have references to them at any given time are completely unrelated.
14:41SurlyFrogYep, I'm thinking along the lines of Common Lisp's `time` which gives you information about memory consed, garbage collection, etc.
14:42SurlyFrogI've just always found it helpful when I know I'm going to be processing and building up some big data structure
14:42nDuffAhh -- I was thinking of the shell time builtin.
14:43SurlyFrognDuff: yeah, that wouldn't be very helpful :-)
14:43nDuff...last time I used JRockit, though, it had some decent profiling tools that were free for use in non-production environments.
14:45SurlyFrogI think I'm fine. I've discovered that at default on my system, a set of a million vectors of two Longs each blows up but 750K of them seems fine. I don't expect to keep more than about 250K in memory at any one time, so I should be quite good to go.
14:46hiredmanSurlyFrog: is that without or without fiddling with the jvm max heap?
14:46hiredmanwith
14:47SurlyFroghiredman: without. That's just a plain `lein repl` and then sitting inside the emacs *nrepl* buffer.
14:47bruceadamsSurlyFrog: if you can use Java serialization, a serialized object can be viewed as bytes--you can get a count of bytes.
14:48hiredmanSurlyFrog: the default jvm max heap varies on different platforms, so you should explicitly set it for that kind of thing to make sure it is the same for your test env and your deployment
14:48bruceadamsthere is some overhead. the serialized object will often be larger than the real live object in memory.
14:48SurlyFroghiredman: oh, good point. Thanks for that.
14:48craigbrowell, it IS useful to have a cons measurement
14:48craigbroaka, how much consing did I doo
14:48craigbroregardless of wether it is reachable and GCed or not
14:49hiredmanhttp://stackoverflow.com/questions/4667483/how-is-the-default-java-heap-size-determined
14:49SurlyFrogbruceadams: thanks, I appreciate the idea re. serialization.
14:49craigbrothe value of eveything, the cost of nothing...
14:49SurlyFrog:-)
14:50craigbroi earned the nickname Sir Cons Alot in my CL hacking days
14:50SurlyFrogcraigbro: *that's* funny :-)
14:51hyPiRioncraigbro: I'm probably worse. "If it's immutable, just call the function again with the same parameters!"
14:51hyPiRion/s/immutable/pure/
14:51SurlyFrogI've done a *ton* of embedded systems programming where I'm always concerned about memory usage (in fact, I'm doing a PIC24 project for a customer right now) so I'm just conditioned to worry about it.
14:52OscarZ_whats the best resource for checking out how the core functions work etc ?
14:52hyPiRionSurlyFrog: The JVM itself has a large memory footprint.
14:53FrozenlockSurlyFrog: I wonder how long it will take before MCUs to be replaced with something with more punch (kinda like Raspberry Pi)
14:53hiredmanhyPiRion: that depends on what you mean by large
14:53FrozenlockOr rather, what we normally consider MCUs
14:53SurlyFrogFrozenlock: years if not decades. It's still a matter of price/power for many devices
14:54craigbroit's a range too
14:54craigbromore power lets tinkerers do more itneresting things
14:54Frozenlock^
14:54craigbrobut finished commodity products are gonna shoot lower power and price
14:54SurlyFrogWhen you've got to dump a bunch of sensors in a field and let them run for 5-years on a coin cell battery, you really need an MCU. However, everything above that level will get pretty interesting.
14:54FrozenlockBut more power also allow more easy code reuse IMO.
14:55hyPiRionhiredman: Microprocessor-large.
14:55craigbrocode reuse is not a big win in those fields IMO
14:55craigbroyour operations are trivial
14:55craigbrocollect sensor data, munge it, convert it to simple wire protocol, send it upstream etc...
14:57Frozenlockcraigbro: Depending on your field, you then have to encode the data into an industry protocol (Modbus, Lonwork, BACnet...), then send it over LAN/IP/Wireless. Possibly have local memory storage also... I would like to have more powerful devices :)
14:59hiredmanthere are "jvms" that run in around 32KiB but most of them are not "modern" (read post java 1.5) jvms
15:00Frozenlockhiredman: That seems... surreal
15:00craigbropicojava!
15:00TimMchyPiRion: No, it works even if `list` is a list.
15:00Frozenlockclojure on MCUs?
15:01craigbroFrozenlock: yah, kinda what I meant as a tradeoff. On a project I was advising to build open source, cheapish sensor array for urban farming, we went with more powerful devices, because it meant a simpler networ infrastructure and code that a larger set of people could understand (and this was all run with volunteer labor so that was important)
15:02TimMchyPiRion: ##(let [x (list 1 2 3)] [(= x [1 2 3]) (= `[~@x] [1 2 3])]) ;; What I'm saying is that it's a no-op.
15:02lazybot⇒ [true true]
15:02`fogusdnolen: Is it considered unindiomatico to use multiple bindings in the run* form?
15:02craigbro`fogus: can you even?
15:02dnolen`fogus: what do you mean? like (run* [a b c] ...) ?
15:02craigbro(run* [foo bar] does not work
15:02dnolencraigbro: it does
15:03craigbro???
15:03lazybotcraigbro: How could that be wrong?
15:03`fogusdnolen: ya
15:03craigbrois that newish?
15:03craigbrosorry, ignore me
15:03dnolencraigbro: relatively
15:03craigbrook, mind you I started on ancient core.logic 8^)
15:03dnolen`fogus: it's idiomatic yes, map support coming at some point as well
15:03craigbroBTW, we got our analysis engine running as an API server on our cluster this week.
15:04`foguscraigbro: https://gist.github.com/fogus/4741564
15:04`fogusdnolen: Wonderful. Thank you
15:04dnolencraigbro: `fogus: the fundamental form is now (-run option-map [bindings*] goals*)
15:04craigbronormanrichards wrote a little in memory DB for us, replacing defrel etc, that lets us have core.logic programs run against their own fact DB
15:04dnolener
15:04dnolenshould be
15:05ttimvisheranyone know how to output the result of a cascalog job back to hdfs?
15:05dnolen(-run option-map binding-form goals*), where binding-from can currently be a vector of names or a vector names + :as vector name
15:05ttimvisherwe're trying to use `hfs-textline` and that does write the result of the query back to hdfs but in a strange directory format
15:05craigbroand thus in their own threads
15:05dnolencraigbro: sweet!
15:05ttimvisherwe're basically trying to split apart a gigantic file into more manageable chunks to support iteration on our part.
15:06`fogusdnolen: With run* taking multiple forms is the use of fresh obviated?
15:06`fogus(binding forms)
15:06dnolen`fogus: no, you still need it in subgoals
15:06craigbrofresh is still useful
15:06`fogusdnolen: Duh. Of course
15:07hyPiRionTimMc: yeah, I know that. But not if it's nil. ##(= [] nil)
15:07lazybot⇒ false
15:07craigbrodnolen: yah, 8+ threads of core.logic malware behavior anlaysis fits easily inside a 4g heap and is fast enough our cluste can't keep it supplied with data (it has to un/rearchive all the mateirals etc...)
15:07craigbroerr, I meant 80+ threads
15:07craigbroI would guess 50 or so of them are actually doing the core.logic work
15:08dnolencraigbro: whoa
15:09dnolencraigbro: you gonna talk about that at Clojure/West?
15:09craigbrowe got 64core blades, a dozen or so of them, each of them doing this
15:09craigbrodnolen: I was going to focus more on how we do our data modeling in core.logic
15:10craigbrodnolen: aka, we have a relational model for representing malware observable (files touched, sockets opened, etc...)
15:10craigbrodnolen: and then the same model is used by core.logic to identify behavior/patterns/indicators of compromise
15:10craigbrodnolen: but is also pretty much directly translated into SQL DDL for our database
15:10dnolencraigbro: that is amazing
15:11craigbrodnolen: and then we use korma to query the DB for our analysts UI and all that.
15:11craigbrohence the title, core.logic and SQL killed my ORM
15:12craigbrokewl thing is, I wrote like three example core.logic programs for our malware analysts
15:12craigbroand they have written the rest
15:12dnolenwowzers
15:12craigbromind you, they are a little shakey, abuse conde etc...
15:13dnolenheh sure
15:13craigbronext step is to put a shim language in there for end users to write programs
15:13dnolenstill need to optimize conde at some point ...
15:13craigbroactually, in almost all cases, they should be using conda
15:13dnolencraigbro: well optimized conde could obviate conda
15:13craigbroso it's not a big deal. these programs are basically just pattern matching
15:13dnolenin the pattern matching case
15:14TimMchyPiRion: Ah! I see.
15:14craigbrohmm, maybe I misunderstand the difference between conda and conde then
15:14llasramcraigbro: Are you one of the threatgrid peeps?
15:14craigbroI thought conda stopped on first match
15:14craigbrollasram: yup
15:14dnolencraigbro: sorry, that's what I mean about optimized conde
15:14hiredmancraigbro: which is sort of optimized behaviour if you know other branches in code won't happen
15:14dnolenif the heads of the conde clauses have a common pattern we could use that information to know there's only one match
15:15craigbrowell, we use it for stuff like filling in variables that couldn't be bound
15:15craigbro(conda ((somegoalthatwouldbind LVAR)) (== LVAR "Unknown"))
15:15craigbrowell, that last form needs more parens, but you get it
15:15dnolencraigbro: i see
15:16craigbrothe more intensive work is actually not the pattern matching
15:16craigbrobut report generation, we make a very nice HTML report, all core.lgic driven. you prolly seen Tim hacking on it 8^)
15:16dnolencraigbro: hehe yes
15:16craigbrothat takes way more time, most of it putting strings together in hiccup
15:17craigbroalso, turns out that defrel indexing doesn't buy a whole lot, at least with our data
15:17dnolencraigbro: well defrel was lil ol hack, current implementation leaves *much* to be desired.
15:18craigbroI meant hat in the general sense tho, not just defrel
15:18dnolencraigbro: gotcha
15:18craigbropldb without indexing is just a smidgin slower, totally drowned out by other noise
15:20normanrichardscraigbro I guess our datasets would have to get MUCH bigger, and the logic much more complex to really gain from indexing
15:20craigbroyah, I was just going to try and get a measure of num of observations per sample
15:21dnolencraigbro: definitely looking forward to your talk at Clojure/West, this stuff sounds awesome.
15:21normanrichardscraigbro and the nature of the logic prunes the search tree pretty gast
15:21normanrichardsfast
15:23dnolennormanrichards: craigbro: oh ... wow I didn't realize you all did this https://github.com/threatgrid/pldb
15:23normanrichardsdnolen https://github.com/orb/pldb/tree/indexing
15:23normanrichardsthat's the branch with indexing
15:23normanrichardsnot really much there
15:23normanrichardsbut it works well
15:24craigbroyah, it's what lets use run in multiple threads
15:25craigbroagainst different DBs
15:30dnolennormanrichards: craigbro: I wouldn't be against replacing what core.logic has with what you all have :)
15:31jonasendnolen: I'd like to help out testing cljs-418. Should it be tested via cljsbuild or directly via script/bootstrap etc. as per the clojurescript wiki
15:31dnolenjonasen: thanks, doesn't matter really, either works.
15:32jonasenok
15:32normanrichardsdnolen it needs to be cleaned up a bit (the indexing in particular is hacky) but I'm pretty sure we'd be happy to contribute
15:33dnolennormanrichards: awesome! would remove an eyesore :)
15:34craigbrodnolen: yah, totally, I have a CA already, and norman can get one if he doesn't
16:01gfredericksAre there any libs that wrap compojure with the assumption that input/output are always JSON?
16:05jeremyheilergfredericks, couldn't you just add middleware that makes that assumption?
16:07ttimvishergfredericks: ymmv, but i've been interested in trying https://github.com/ngrunwald/ring-middleware-format for awhile
16:12gfredericksjeremyheiler: no
16:12gfredericksbecause compojure will interpret maps returned from routes as a ring response
16:13gfredericksunless there's a thinner alternative to defroutes that I didn't know about
16:14amalloygfredericks: just...wrap the routes?
16:14amalloythe output half is easy; input is trickier
16:16craigbronot sure whatis means for inputs to always be json
16:16craigbrothat are so many different ways for input to arrive
16:16craigbroas query params, as POST form data, and multipart post etc...
16:18octagonhi, i'm trying to find out how the ClojureScript compiler expands certain macros. without macroexpand in the REPL how would one go about doing this?
16:19amalloyoctagon: it's the same macroexpand rules that clojure uses, so test it in a clj repl, not a cljs repl
16:20octagonamalloy: for example, (walk/macroexpand-all (case x "foo" bar)) expands to (let* [G__234 x] (case* ...)) in clj
16:21octagonamalloy: cljs has no case* special form
16:21amalloyah. i guess i'd just look at the source for case, then, in cljs
16:21octagonamalloy: also cljs has its own macroexpand-1
16:21Raynes$latest ring-middleware-format
16:21amalloybut i think it probably expands to cond :P
16:21lazybot[ring-middleware-format "0.2.4"] -- https://clojars.org/ring-middleware-format
16:22octagonamalloy: it does, from reading the code. but where is cond defined? it's not in the list of special forms in the cljs compiler, but i can't find anywhere where it's defined
16:23gfredericksamalloy: output is easy? I don't think that's true
16:23octagonamalloy: also it's a more general question. seeing what a thing expands to is way more reliable than trying to run a macro expander in your head lol
16:23amalloyoctagon: the import-macros line in src/clj/cljs/core.clj
16:23amalloyis where cond comes from
16:23octagonamalloy: excellent, thanks!
16:24gfredericksamalloy: if I return {:foo [1 2 3]} from my route, then when it comes out of the defroutes handler it becomes
16:24gfredericks{:foo [1 2 3], :status 200, :headers {}, :body ""}
16:25amalloygfredericks: what? i don't believe that. not only have i never noticed that, the source for defroutes (https://github.com/weavejester/compojure/blob/master/src/compojure/core.clj) clearly has no code for doing that
16:26amalloyGET and POST *might* do something crazy like that, but defroutes certainly doesn't
16:26aaelonyclojure.xml/parse parses and loads a source, which can be a File, InputStream, or String naming a URI. In my case, I have a URI that needs an extra header where I can provide an access key as a header. Can specify a header that clojure.xml/parse can use or do I need something else?
16:26gfredericksamalloy: I just did it
16:27amalloygfredericks: paste?
16:27gfredericksamalloy: https://gist.github.com/fredericksgary/4742078
16:27gfredericksoh I see what you mean by GET and POST
16:28amalloygfredericks: GET is doing that
16:28gfredericksI didn't know they acted separately
16:28amalloyit's in compile-route, which calls render
16:28gfrederickshow do I use defroutes by itself?
16:28amalloygfredericks: (defroutes a b c) is just (fn [r] (or (a r) (b r) (c r)))
16:28gfredericksfascinating
16:28amalloyor rather, that's (routes a b c)
16:29gfredericksokay so would only have to provide an alternative to GET/POST/etc, and figure out what I mean by "JSON-only input"
16:29amalloyyes
16:29amalloyor re-extend the render protocol
16:30amalloywhich might or might not work; don't quote me
16:31amalloygo tell weavejester you thought defroutes was magic. he already regrets writing it, because it just looks so magic
16:32hiredmanor you could return {:body {:foo bar}} and have a middleware that json encodes body on the way out
16:32gfredericksI'm already doing (return-json {:foo bar}) which is about the same amount of work
16:32gfredericksthis is at least the third time I've set up a json rest API and it's feeling like there's similar ceremony around it each time
16:33tomojhttps://www.refheap.com/paste/43476cfab0a829957d6e1967f
16:33amalloygfredericks: you could try wakeful
16:33gfredericksoh that might make sense
16:33amalloyif what you want is a json api that magically exposes functions in a certain namespace, that's basically what wakeful is
16:33tomojI thought defroutes was magic
16:33amalloy(inc defroutes)
16:33lazybot⇒ 1
16:34amalloyall hail defroutes
16:34tomojGET is magic
16:34llasramI've used bishop for a few small JSON-exposed service APIs, and been quite happy with it
16:34gfredericksis defroutes just some-fn?
16:34trofhi guys is this room ok for clojure noobs or theres another room?
16:34gfrederickstrof: 100% okay
16:34trofthx
16:35amalloyyeah, GET is prettyheavy
16:35amalloygfredericks: probably
16:35gfredericksoh some-fn + def
16:38technomancyllasram: does bishop cover vaguely the same use case as liberator?
16:39gfredericksamalloy: I'm trying to get over the fact that wakeful uses thing-id instead of thing/id
16:39llasramtechnomancy: Looks like it. I missed liberator -- will need to check it out and compare
16:40technomancyllasram: just wondering because someone asked last night at the seajure meeting
16:40technomancyI've felt like raw compojure doesn't have much to help with varying content-accepts headers
16:40technomancyprobably by design
16:44FrozenlockI see that some libraries provide docstring for the namespace itself. Is that expected?
16:44technomancyFrozenlock: it's a good idea if the namespace isn't obvious at a glance
16:45Frozenlocktechnomancy: (ns robert.hooke "Hooke your functions! ... :D
16:46gfredericksis there yet a repl function for pretty-printing a whole namespace with the public vars and docstrings?
16:46FrozenlockBut how does that reflect for the user? In the repl you 'doc' a namespace?
16:47amalloygfredericks: (clojure.java.shell/sh "cat" filename)?
16:47gfredericksif I had such a function I could use it on clojure.repl to check if such a function existed there
16:47gfredericksamalloy: without the source code
16:48gfredericksanytime I want to explore what a namespace has in it the easiest thing I can think of is browsing to github
16:48amalloygfredericks: (doseq [... (ns-publics ...)] ...)?
16:48gfredericksbecause it's easier than typing all that out :)
16:48amalloysomeone wrote that and called it dir, apparently in homage to python
16:48gfredericksI should send a patch to clojure.repl
16:48amalloydunno where it is, but maybe the name will help you find it
16:49xeqidoes anyone know who maintains incanter?
16:49gfredericksoh apparently this is already in clojure.repl
16:49amalloygfredericks: ...
16:49technomancyxeqi: the london clojure group, I think?
16:49hiredmanxeqi: who says anyone does?
16:49Frozenlockgfredericks: do tell
16:49gfredericksamalloy: oh nevermind it just prints the var names
16:52Frozenlock,(doc (ffirst (ns-publics 'clojure.core)))
16:52clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol>
16:52FrozenlockDamn you macro!
16:53ToBeReplacedgfredericks: i think we've all asked for that at some point; so it going into clojure.repl makes sense to me
16:54callenbottechnomancy: I need a favor of you.
16:55callenbottechnomancy: I'm creating a tutorial for web dev in Clojure. I'd like to point the noobies in the direction of emacs-starter-kit. Paredit is a deal breaker. How do I bribe you into removing it?
16:55ivaraasenwow, the JVM is quite good at saving cycles wrt. primitives
16:56ToBeReplacedi don't know how anyone uses emacs without paredit...
16:56technomancycallenbot: I don't really actively recommend the use of the starter kit anymore as anything other than a resource to steal ideas from, but if they're in a hurry installing the starter-kit base package without starter-kit-lisp will do it I believe.
16:56ToBeReplacedtechnomancy: what do you think about prelude?
16:57callenbottechnomancy: I need something like Clojure in a Box. Is it safe to say I am making this myself?
16:57technomancyToBeReplaced: I think orthogonal functionality should be distributed as independent packages, and we should focus on documenting which packages do what.
16:57ToBeReplacedcallenbot: i think bbatsov's prelude gets you clojure in a box
16:58technomancycallenbot: if you do it, try to structure it in terms of composing orthogonal parts and be clear about what functionality comes from where.
16:58callenbotToBeReplaced: it needs to be fully automagic, this isn't for me, it's for the derpy new people.
16:58technomancythat's where the greatest confusion around the starter kit and similar packages comes from
16:58callenbottechnomancy: I'm a nihilist, I only care about them seeing a repl in a project.
16:58technomancycallenbot: designing for derpy new people is what gets you sweet-expressions =\
16:59ToBeReplacedcallenbot: i think prelude is... it's down to a curl-installer-script
16:59callenbottechnomancy: we need to make onboarding easier/smoother
16:59callenbottechnomancy: I want more normal people using Clojure so I can use it for a living.
16:59craigbrowhat do you do for a living?
17:00hiredmanoptimizing for newbies is a losing game
17:00callenbotcraigbro: I practice interpretive dance.
17:00technomancycallenbot: are they people who would balk at using eclipse?
17:00callenbotcraigbro: I use Clojure to do the audio and video programming for the dance presentations at the theatre.
17:00ToBeReplacedtechnomancy: while i generally agree re: orthogonal functionality, libraries over frameworks etc, i think that for many people, an editor isn't in the space of things worth doing that for
17:00Frozenlockgfredericks: If you haven't already what you wanted https://www.refheap.com/paste/11078
17:00callenbottechnomancy: I don't know that yet.
17:01craigbrocallenbot: oooohhhhhh
17:01technomancyToBeReplaced: if you think Emacs is just an editor, sure
17:01craigbrocallenbot: awesome!
17:01technomancysome people use it that way
17:01callenbotcraigbro: I was being a smart ass.
17:01hiredman"hey, I am investing all this time and effort in to making a thing people will abandon after two weeks of use"
17:01callenbotcraigbro: I write code for a living.
17:01craigbrocallenbot: oh, booooooooring.
17:01callenbotcraigbro: rule 1: never believe anything I say
17:01pjstadighiredman: ever the optimist
17:01ToBeReplacedtechnomancy: yes; i think it is for many people, and especially the newbie target audience
17:02callenbotI don't know how to get instant feedback in Eclipse, only in Emacs.
17:02callenbotI need that instant feedback loop for the newbcakes.
17:02ToBeReplacedtechnomancy: if you advice against the starter kit, do you think putting a note in it would be worthwhile?
17:02technomancyToBeReplaced: I don't pretend to understand the newbie audience, but telling them to learn Emacs and Clojure at the same time is asking an awful lot. Eclipse has much better affordances for new learners.
17:02callenbottechnomancy: I agree.
17:03octagoni set my boss up with clojure in eclipse in about 10 minutes and he was writing code on his own with a book in 20 min
17:03callenbottechnomancy: but I don't know eclipse and can't help them if they're using CCL
17:03hiredman^-
17:03callenbottechnomancy: and I'm not going to use CCL in a tutorial.
17:03technomancyToBeReplaced: maybe... I haven't decided strongly enough to commit to it
17:03callenbotoctagon: CCL?
17:03callenbotI'd better check out CCL and get familiar with it then.
17:03octagoncallenbot: counter-clockwise
17:03callenbotoctagon: I know what it means, I was asking if he used it.
17:03ivaraasentechnomancy: starter-kit was of great use to me as a newbie
17:03octagoncallenbot: yes, i wasn't sure what CCL meant, but yes, that's what i set him up with
17:04callenbotoctagon: I'll check it out. I now have the problem of potentially using a different editor in a video tutorial than the student.
17:04octagoncallenbot: he still uses it, but he has another repl in a terminal too
17:05technomancyivaraasen: I wish it could just disappear, but the problem is it's very difficult to fix bad defaults in the core of Emacs itself. political reasons and all.
17:05octagoncallenbot: he runs a second repl in a screen session or something
17:05ToBeReplacedtechnomancy: tough problem... i think if you do think about it more, placing a note about it, whichever way you fall, would be helpful
17:05callenbotI'm 500 commits away from catching up with isaacs. I have to beat him.
17:06Frozenlocktechnomancy: bad default? The white background?
17:06technomancycallenbot: I agree that one of the most difficult things about teaching newbies is putting yourself in their mindset.
17:06technomancymaybe using eclipse would put you in a state of disorientation where you could empathise with them better =)
17:06callenbottechnomancy: I'm a fucking idiot, I can handle bringing myself down to that.
17:06craigbrohehe
17:06technomancyFrozenlock: ido off by default, no uniquify, menu bar and tool bar; stuff like that.
17:06callenbottechnomancy: being an idiot is why I give excellent copy and UX feedback too. Everything confuses me.
17:07octagonhonestly if someone can't do some examples in eclipse with CCL then they aren't going to like clojure at all anyway
17:07hiredmanwrong, the miss difficult thing about teaching newbies is getting them to shutup and read the stacktraces
17:07technomancycallenbot: it's valuable! =D
17:07hiredmanmost
17:07callenbottechnomancy: I just need to explain to my employer why being a simpleton is valuable now.
17:07Frozenlockeh, I actually believed the menu bar was newbie friendly :/
17:07Frozenlockbut I agree that ido should be enabled by default
17:07callenbottechnomancy: also I was talking to my best friend who moved to California after I did. The both of us are probably moving to WA / SeaTac.
17:07hiredmanclosely followed by reading the docs
17:08callenbottechnomancy: we were doing a bunch of cost of living, legal research etc. We're pretty keen on WA now.
17:08craigbroI used to work ona programming language targetting 6th grades and up, to graduate students (the real dummies) NetLogo
17:08callenbotI'll visit the moment I get some actual free time.
17:08technomancyFrozenlock: seeing a menu bar makes people think they can use it to find everything they need, which is silly. it sets unsound expectations.
17:08technomancycallenbot: cool; hope it works out =)
17:08ToBeReplacedhiredman: i even had that in python... "TypeError: foo is not a string"... "ToBeReplaced, why isn't this working?..." ... "Well, have you considered that foo might not be a string?"... "OMG you're so good at debugging"
17:08callenbottechnomancy: yeah it's all early stage now but I'm pretty excited.
17:09hiredmanit is a fact
17:09hiredmanprogramming is 90% reading
17:09craigbrohehe
17:09octagonyou can't trick people into liking clojure via a text editor
17:09octagonpeople aren't that dumb
17:10callenbotoctagon: who suggested that was possible?
17:10octagoncallenbot: the fascination with tools
17:10octagonit's inappropriate for new guys i think
17:10technomancyoctagon: I think he's saying "if you use this; I can help you myself"
17:11octagontechnomancy: i'm just pointing out that sometimes this tooling fetish isn't appropriate for new guys, cause they just want to see what you have to offer, not some cool tools
17:12callenbotnavigating this code is like trying to make an hourglass out of sand somebody tossed into the wind.
17:12callenbotoctagon: I'm just trying to avoid confusion arising from disparity in environment.
17:12callenbotoctagon: I'm currently writing and thinking about doing video tutorials.
17:12callenbotoctagon: I'll use whatever's necessary to make the tutorials effective, but I have to balance my productivity against what's going to be facile.
17:13ToBeReplaceddommy, froelich, domicile, domina, crate, hiccups, piccups ... yikes
17:13callenbotToBeReplaced: what's wrong?
17:14technomancy"Use what you want, but be advised that I'll be able to offer more effective help if you use X." is how I read it.
17:15ToBeReplacedjust a lot of related functionality... i guess domina doesn't belong on there... the rest seem all very similar, with at least 4 of them supporting the same hiccup-styled templates
17:15ToBeReplacedmaybe i just don't understand them... particularly dommy vs. crate
17:15callenbotToBeReplaced: dommy is fast.
17:16callenbotToBeReplaced: crate is not.
17:16callenbotignore hiccups and piccups.
17:16callenbotI can't speak to domicile and froelich.
17:16zerokarmaleftpackage-list
17:16ToBeReplacedthen why have both? is there something crate is better suited for?
17:16zerokarmaleftoops
17:16dnolenToBeReplaced: crate appeared very early on, dommy was released like a week ago
17:16callenbotToBeReplaced: it existed before dommy
17:16FrozenlockCrate was quickly hacked together way before.
17:16callenbotToBeReplaced: dommy was created because crate was slow.
17:16craigbrothat reminds me
17:16craigbroso, is there something like hiccup that is faster
17:17craigbropreferably drop in replacement?
17:17craigbroor has there been a speedup in hiccup releases in the last couple months?
17:17Frozenlockcraigbro: You mean for the jvm?
17:17mrb_bkshout out to all the nerds in NYC who will be trapped indoors tonight
17:17craigbroyah
17:18ToBeReplacedso dommy is the way of the future? they both have commits in the last month, heh
17:18callenbotmrb_bk: hello, it's sunny, blue skies, and pleasant here in California. I think I might go for a motorcycle ride and taunt you.
17:19technomancyit's even sunny in seattle today
17:19ivaraasenPrismatic are releasing some great stuff
17:19tmciver2 feet of snow by tomorrow in Boston.
17:19callenbotivaraasen: I love the prizzies.
17:19ivaraasensupposedly they are releasing Flop soon.
17:19technomancyivaraasen: maybe it's to make up for all the libs they pulled?
17:19callenbotivaraasen: crazy little phids.
17:19callenbotivaraasen: that would be nice.
17:20ivaraasencallenbot: at least they told me so on Twitter, FWIW
17:20callenbottechnomancy: oh so I'm not crazy, they used to have more libraries on their github?
17:20callenbottechnomancy: or do you refer to something else?
17:20technomancycallenbot: yeah, they yoinked a bunch a while back when they went into super secret stealth mode or something
17:22ivaraasentechnomancy: yeah, they announced Flop like, 5 months ago? so I just wrote my own Flop clone instead
17:23danielglauserDoes anyone know a generic way to get the name of the current function?
17:23hiredmantechnomancy: no no, that was a "totally different" company with a name that started with a w
17:23Frozenlockivaraasen: my google-fu is failing me... flop?
17:23hiredmanfunctions do not inherently have names
17:23technomancyhiredman: how silly of me
17:23hiredmanso there is no way
17:24hiredmanfunctions like other values can be bound to names, but imagine asking the question of other values
17:24tanzoniteblackFrozenlock: http://highscalability.com/blog/2012/7/30/prismatic-architecture-using-machine-learning-on-social-netw.html has a quote about what flop is supposed to be
17:24hiredmanDoes anyone know a generic way to get the name of a vector?
17:25hiredmandanielglauser: what do you want a name for?
17:25danielglauserI believe it is in the metadata of the Var, but I don't know how to get the name of the Var without already knowing the name
17:25ivaraasenFrozenlock: basically macros that makes it nicer to work with primitive double arrays
17:25craigbrohehe
17:25Frozenlockivaraasen: yeah sure, said like that that's super simple... :P
17:26ivaraasenFrozenlock: instead of (areduce ^doubles ws idx ret (double . . . MY BRAIN IS MELTING, you just write (asum ws)
17:26ivaraasenor for the dot-product, (asum [w ws x xs] (* w x))
17:26hiredmandanielglauser: what do you want a name for?
17:27craigbrodanielglauser: there is not guanrateed to be a name BTW
17:27danielglauserhiredman: We've factored some of the repetitive test code into helper functions. When it goes boom in the helper function we don't know where the call came from
17:27craigbrodanielglauser: haha
17:27danielglausercraigbro: Ah! Thx
17:27hiredmandanielglauser: look at the stacktrace?
17:27craigbrodanielglauser: throw an error, catch it, grep thru the stacktrace 8)
17:27ivaraasenFrozenlock: also somewhat easy to do stuff like in-place map (afill!)
17:28danielglauserNo stack trace but I could throw an exception
17:28craigbronot guaranteed to get anything euseful there either
17:28hiredmandanielglauser: if look at some other tests that do that kind of thing we pass an error message to the helper
17:28danielglauserFailing in an is call so that will be somewhat cludgy
17:28hiredman(is assertion error-message)
17:29hiredmanwhen assertion fails is also prints out error-message
17:29danielglauserhiredman: Yup! Was trying to pass a context in, that's what prompted my original question
17:29danielglauserhiredman: Doing that now but still don't know who the caller was
17:30hiredmandanielglauser: you want to take this sonian channels?
17:32Bronsadanielglauser: (-> (Throwable.) .getStackTrace first str (clojure.string/split #"\.invoke") first (clojure.string/replace "$" "/"))
17:32Bronsathis should do it
17:32danielglauserBronsa: Awesome, thanks, I'll give that a try
17:33iceyAnyone here use datomic in their projects?
17:39nickmbaileyis there a way to tell lein to automatically use a certain profile with a certain task. for example use a specific profile with 'lein test'
17:42technomancynickmbailey: you should be able to alias the task to ["with-profile" "+myprofile" "task"] but there may be a bug preventing that
17:42nickmbaileyunix alias?
17:43technomancynickmbailey: :aliases {"test" [...]} in project.clj
17:43nickmbaileyaha!
17:43Frozenlocktechnomancy: Regarding hooks: "Then users can place files that call add-hook under a specific namespace prefix (my.program.hooks.*)" Does it mean that the user don't need to require their own file, as long as it's in the project directory?
17:43Frozenlocks/user/users
17:44technomancyFrozenlock: I think it's only auto-activated from within plugins?
17:46FrozenlockAh I see, so somehow the plugin must be loaded by the main 'project' before it can do anything.
17:47FrozenlockI'll go check leiningen for insight, thanks!
17:55nickmbaileytechnomancy: doesn't seem to be any bugs, except that the aliases are recursive
17:55nickmbaileyi'm not sure if thats a bug or expected
17:56technomancyyeah, that's the bug
17:56technomancythe alias is supposed to remove itself upon use
17:56nickmbaileygotcha
17:57ravsterhello all
18:03Frozenlockravster: hello you
18:10FrozenlockAny obvious setbacks to loading every .clj file in a 'plugin' directory?
18:23callenbotpeople, it's friday! TO THE LEFT: <( " <) <( " <) <( " <) PUTCHA HANDS UP: (^"^) (^"^) (^"^) AND GET DOOOOWN: (v' 'v) (v' 'v) (v' 'v)
18:25ravstercallenbot: :)
18:26ravstercemerick: I'm printing out a request that I'm running through peridot, and friend-auth stuff isn't in the :session key but is seperate. how does friend work through sessions?
18:30cemerickravster: the friend identity is always in the session map under :cemerick.friend/identity
18:35xeqiravster: what do you think of peridot?
18:41ravsterxeqi: its good. we're using it to automate integration tests through our api.
18:42ravsterI've probably not explored all of it, but its great for mimicking user interactions.
18:43FrozenlockOh compojure, why are you so magic?
18:43FrozenlockMagic as in "ahhh what is happening"
18:48weavejesterFrozenlock: What do you think is magic?
18:49hyPiRionThe source is out there.
18:49FrozenlockhyPiRion: Reading now
18:49Frozenlockweavejester: Might be a lack of webdev knowledge, I have to wrap my head around the route thing.
18:50weavejesterFrozenlock: Have you seen: http://www.booleanknot.com/blog/2012/09/18/routing-in-compojure.html ?
18:51FrozenlockNo I did not, but I'll read it immediately, thanks :)
18:51FrozenlockSure has a promising title "Understanding Routing in Compojure"
19:00thearthurI'm trying to help a coworker set up lein2 + nrepl
19:01thearthurwhen she runs nrepl-jack-in the nrepl buffer opens with out th nrepl prompt
19:01thearthurany idea what to google for on this
19:01thearthurnrepl 1.6
19:01thearthurerrr 0.1.6
19:01technomancythearthur: emacs 24?
19:01thearthuryes,
19:02thearthur24.2
19:02technomancythearthur: any fancy additions like auto-complete?
19:03thearthurwe removed all packages and then added clojure-mode and nrepl
19:03thearthuradded as packages from marmalade
19:03technomancyvery strange
19:06thearthurtechnomancy: not all the fancy stuff had been properly removed ...
19:09thearthurtechnomancy: the culprite was (add-hook 'nrepl-mode-hook 'paredit-mode)
19:10yves`test
19:12Frozenlocktest failed with 2 errors
19:12yves`Frozenlock: ^^
19:39cola_zerothearthur: Can emacs connect to runnning repl server?
19:41gfredericksso the latest lein-cljsbuild still has the namespace-out-of-order bug even though cljs had it fixed months og?
19:41gfrederickss/og/ago/
19:47dnolengfredericks: it wasn't that long ago, but I thought I fixed it. Perhaps it was more subtle than I thought.
19:48tanzoniteblackcola_zero: this is generally done with nrepl
19:48tanzoniteblackcola_zero: an emacs mode
19:51gfredericksdnolen: has cljsbuild been keeping up to date?
19:52ravsterxeqi: when doing multiple requests in peridot, can I set content-type only once, or do I have to do it for each request sent out?
19:53callenbotI found lein-cljsbuild to be a good manifestation of the Vietnam War.
19:53callenbotI cut and ran pretty quickly.
19:53warzis there a popular clojure irc client to build on? i see a few that just wrap java clients.
19:55cola_zerotanzoniteblack: yas, I know. I want to know whether 'M-x nrepl' is working or not.
19:56dnolengfredericks: I would assume so but you would need to ask emezeske. If if didn't you could use master or override to specific version.
19:56tanzoniteblackcola_zero: guess I don't understand your question then, sorry. That's how I connect to a running repl.
19:56dnolencallenbot: it has some rough edges, but it's also come a long way.
19:57callenbotdnolen: oh so you've visited Vietnam recently too? yeah it's really improved.
19:57dnolengfredericks: I mean even if it wasn't pulling a more recent CLJS I mean.
19:57dnolencallenbot: *eye roll*
19:57gfredericksdnolen: right
19:58callenbotdnolen: I tell a lot of people about CLJS. Frontenders, switchers, all kinds.
19:58callenbotdnolen: the conversation ends the moment they ask about source maps.
19:58callenbotdnolen: I can't keep bumping the project if SM aren't in place.
19:59cola_zerotanzoniteblack: I asked to thearthur because he has strange behavior of nrepl-jack-in.
20:00dnolencallenbot: yes SM will be a big step forward. though I hardly think that will convince everyone.
20:01callenbotdnolen: it'll convince the people I know.
20:01callenbotdnolen: but then again, I don't restrict my social circles to the coding avant-garde.
20:01dnolencallenbot: sure, it will happen one day.
20:01callenbotdnolen: FYI, one of those people I tried to sell ended up going to TypeScript.
20:01dnolenin the not too distant future.
20:01dnolencallenbot: more power to them
20:02xeqiravster: you should be able to do (-> (session ..) (content-type "application/json") (visit ...) (visit ...))
20:03tanzoniteblackcola_zero: I didn't even notice that was a directed question...I'll just go back to not paying attention. I think thearthur fixed the issue though, something about paredit-hook causing an issue
20:03ravsterxeqi: sweet, tnx
20:03xeqis/visit/request/g
20:04cola_zerotanzoniteblack: ah, sorry.
20:04xeqiravster: glad to hear its working well for you (just got back from dinner and saw message). let me know if yo urun into any problems
20:04callenbotdnolen: not really. Clojure needs a dons.
20:05callenbotdnolen: too many modest Clojure Hackers. we need more douchebags telling people how ridiculous awesome we are.
20:05callenbotI, for one, would like to be able to use Clojure in my day job.
20:05dnolencallenbot: I don't see why. Clojure has got along fine w/o too many of those so far.
20:05callenbotdnolen: not everybody gets to be uber-choosy in their technologies in the context of employment
20:06callenbotdnolen: the best way to help the 99% and make it more likely Clojure will be an allowed option, it has to spread.
20:06thearthurcola_zero: sorry for the late response, no the behaviour was the same in both cases. turned out to be because of a broken call to add-hook in her init.el
20:07callenbotdnolen: but it's great that you work in an environment where you can use whatever you fancy.
20:07callenbotdnolen: but most people don't have that. So lets put the perspective originating in privilege aside and consider the plight of people stuck in lesser programming communities and stacks.
20:08hiredmancallenbot: that is the stupidest most entitled thing I've ever read in #clojure, you must be trolling
20:09callenbothiredman: entitled is not caring whether or not the language spreads enough for other people to be able to convince their boss to use it.
20:09callenbothiredman: I actually have a choice, but I know many people who do not. Pardon me for thinking of circumstances other than my own.
20:13cola_zerothearthur: I'm glad to hear that.
20:15dnolencallenbot: I dunno this is not something I worry about much. Clojure adoption seem to grow at a nice steady pace. I find it hard to really follow along these days.
20:16craigbrodnolen: would pldb need to work in clojurescript?
20:16dnolencraigbro: not at this point - defrel doesn't even work in CLJS yet
20:16craigbrook
20:16dnolencraigbro: CLJS version of core.logic is no-frills miniKanren more or less
20:24callenbotdnolen: is it substantially different enough that you need to carefully consider what you might and might not be taking for granted in the Clojure core.logic?
20:26dnolencallenbot: it's pretty different - lots of stuff missing.
20:26callenbotthat's good to know in case I characterize it incorrectly in future.
20:27dnolencallenbot: yeah I don't really have the energy to keep them in sync until we have something like official along the lines feature expressions
20:27dnolencallenbot: I mostly did the CLJS port to see a non-trivial benchmark of CLJS compiler output
20:29Frozenlockweavejester: You did a really nice explanation of the routing in compojure, thanks again :)
20:32FrozenlockIs there compelling reason to use enlive in a one-man project?
20:37ToBeReplacedFrozenlock: if you're not sure, just get dirty with it... it'll be time well spent because it reframes the problem a bit
20:38FrozenlockSo many things to try!
20:57callenbotdnolen: I didn't even expect it to exist in CLJS. Pretty awesome idea for a test.
21:02Frozenlock#'fn-name is sugar coating for what exactly? Getting the function instead of the symbol?
21:03tmciverFrozenlock: same as (var fn-name)
21:03Frozenlock,doc var
21:03clojurebot#<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.repl/doc, compiling:(NO_SOURCE_PATH:0)>
21:03Frozenlock,(doc var)
21:03clojurebotexcusez-moi
21:04tmciver&(doc var)
21:04lazybot⇒ "Special: var; The symbol must resolve to a var, and the Var object\nitself (not its value) is returned. The reader macro #'x expands to (var x)."
21:04Frozenlockclojurebot, why y u hate me?
21:04clojurebotdeftype is see datatype
21:05tmciverFrozenlock: personally, I don't use it much but it's good for accessing a private function for testing.
21:05FrozenlockWhere is this useful, VS quoting?
21:15pppauli have a testing question
21:16pppauli have a very side effect heavy workflow that i'm about to implement…. 90% of the functions are doing stuff with the file system or local server
21:16pppaulhow would i test something like that?
21:18Iceland_jackpppaul: You can define properties that those actions should show (e.g. creating a non-existant file and removing it should not change the state of the system (for some definition of that))
21:20pppauli was thinking about doing something like that stuart Sierra talked about, having a function that outputs instructions for a side-effect function to fulfill. then testing the instruction function
21:24pppauli guess i am just overwhelmed by how much mocking i think i need… hope it turns out to be different
21:58dxehim assuming with clojure, since it compiles to jvm bytecode, you can use actual java libraries within your clojure application?
21:59gfredericksdxeh: that's most of the reason that clojure targets the jvm
21:59dxehwell i like that idea, much better than writing boring old java syntax all of the time
21:59gfredericksquite
22:02dxehdoes emacs have clojure support?
22:02gfredericksemacs has better support than any other editor/IDE
22:03dxehgfredericks, built in though or do i need an addon
22:03gfredericksI think you need clojure-mode
22:04austinhI struggled to write a tree substitution relation in core.logic. If anyone knows how to improve https://gist.github.com/austinhaas/4743651 I would love hear about it.
22:09austinhThat function took me about 15 hours to write.
22:10Frozenlockaustinh: the shorter it is, the longer it takes :)
22:11ln2I'm watching the MIT Lips lectures. Trying to replicate one of the example programs in Clojure and I'm having some difficulty.
22:11ln2(defn adding [x y] (if (= x 0) y (inc (+ dec x))))
22:11gfredericksln2: what do you want (inc (+ dec x)) to do?
22:12ln2This function should give me the sum of x and y.
22:12gfredericksah ha
22:12gfredericksso (inc (+ (dec y) x)) then?
22:12ln2I'm not sure. What I wrote above is an exact copy (I think) of the lecture program.
22:13ln2Which was written in Lips however.
22:13ln2*Lisp
22:13FrozenlockIsn't a call to `adding' missing?
22:13gfredericksFrozenlock: oh it's s/+/adding/
22:13ln2(adding 1 2) throws the error
22:14gfrederickstry (defn adding [x y] (if (= x 0) y (inc (adding (dec x) y))))
22:14gfredericksif that's not the code you're looking at I expect there was a mistake
22:15ln2That works!
22:15ln2Is there some difference between Clojure and Lisp that would break the profs program?
22:15gfredericksno I think it's a typo
22:15Iceland_jackln2: What you're referring to as “Lisp” is most certainly Scheme?
22:15ln2Nope it's lisp.
22:15ln2http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-001-structure-and-interpretation-of-computer-programs-spring-2005/video-lectures/1b-procedures-and-processes-substitution-model/
22:16Iceland_jackRight, using SICP?
22:16ln2I "translated" the program to Clojure. Which apparently was a massive failure.
22:16ln2Your code works gfred! Thank you!
22:16ln2SICP?
22:16clojurebotsicp is http://www.codepoetics.com/wiki/index.php?title=Topics:SICP_in_other_languages:Clojure:Chapter_1
22:16Iceland_jackln2: the thing you're studying
22:17Iceland_jackIf you use Lisp to refer to a language (and I personally would not) it generally refers to Common Lisp
22:17Iceland_jackSICP uses Scheme
22:17ln2What is SICP? I'm sorry. xD
22:17Iceland_jackln2: SICP is in the url that you yourself posted
22:18FrozenlockThe name of the course I think
22:18ln2Ahh I see.
22:18gfredericksln2: the name of the course is "Structure and Interpretation of Computer Programs"
22:18ln2That course is LISP for sure. 1A has Lisp in the name. Unless they changed from day 1 to day 2?
22:19gfredericksln2: lisp is a family of languages
22:19gfredericksscheme is "a lisp"<
22:19Iceland_jackln2: Lisp is a family of languages
22:19ln2"1A: Overview and Introduction to Lisp"
22:19gfredericksscheme is the "dialect" of lisp used in that course
22:19Iceland_jackLISP is a 50+ year old language
22:19FrozenlockCommon Lisp, Scheme, Emacs lisp...
22:19ln2Interesting that they wouldn't refer to the actual language used...
22:20Iceland_jackln2: They are using a Lisp, it's called Scheme
22:20gfredericksthe name "scheme" might not have been so recognizable at the time
22:20Frozenlockln2: iirc they mention _once_ that they are using scheme.
22:20ln2I'm really glad I asked a question then because I would have probably missed that not so little detail! Haha
22:21ln2Thanks. =)
22:21Frozenlockln2: If you use emacs, you could probably just fire IELM and have a lisp repl, without the weird java messages :P
22:23ln2I'm using LightTable at the moment. So far I've enjoyed translating to Clojure but it was a little surprising when that program didn't translate (since it's so simple).
22:25Frozenlockln2: see you are already a step ahead :P
22:25gfredericksln2: I skipped through the video and found a function similar to the one you were talking about; it had -1+ for dec and 1+ for inc?
22:25ln2Yeah right. xD
22:25ln2Right! Everything translated perfectly I just subbed -1+ and 1+ for the dec and inc functions.
22:26gfredericksln2: I'm looking at it right now and I think it's just like mine
22:26gfredericksstaring at the second expression at 20:14
22:28ln2Yup. Now I look like a total tool. I was reading off of the blackboard instead of from the monitor where everything is neatly typed. Haha
22:29gfredericksoh I just found the right one by coincidence
22:29gfredericksat least now it's not a mystery :)
22:29ln2I wish they had these lectures at better than 240p. =(
22:31FrozenlockFor the time it was made, I'm impressed those are available at all.
22:31FrozenlockWith a screen to show the functions!
22:33ln2My favorite is the eval apply wizard. Haha
22:36ln2And my favorite quote so far is "It is good to have the names of things. Like any good wizard will tell you, if you have the name of a spirit you have control over it". Haha
22:36ln2I wonder if all of these professors played DnD? O.o
22:37FrozenlockIs there a way in compojure to get the current URI, other than adding {uri :uri} in the arguments?
22:44gfredericksFrozenlock: why would you need another way?
22:48FrozenlockI was toying with a menu function that set the 'active' class on where it presently is.
22:56drewcFrozenlock: strangely enough, I am working on something where I have to set the "active" class on an <li> for a "navbar" ... and I am working in Lisp :) Not Clojure at all, and I cannot answer the question... but somehow caught my eye.
22:56FrozenlockBootstrap?
22:57drewcyup
22:57drewcI have used it for a while for a number of applications. It is quite great imo.
22:59amalloyFrozenlock: in the end, you have to look in the request object. but if you want, you can add a middleware that does some of the work for you
22:59Frozenlockdrewc: First time using it. I was too lazy to make my own new css :P
23:00amalloyfor example, Frozenlock, you can do something like https://github.com/4clojure/4clojure/blob/develop/src/foreclojure/ring_utils.clj
23:00Frozenlockamalloy: Ah! Probably next on my compojure learning; middleware
23:00amalloynot very functional, but convenient and not dangerously stateful
23:02FrozenlockLooks perfect! Thanks!
23:03drewcFrozenlock: I have made my own css over the years, but things have advanced quite a bit in the last little while, so now using bootstrap because it works for all the browsers I test in and was designed graphic-wise by designers, not /me/. Even re-doing a 10 year old application using it :)
23:07FrozenlockThe jquery is a bit of a turnoff however, as I might end up using cljs on this project.
23:15marcellusthecatthe javascript is optional but in practice I've found it extremely convenient to use (perhaps in addition to cljs) unless you want to spend time implementing a bunch of lowish level ui stuff yourself in cljs
23:23dxehi think im going to write a jvm bytecode manipulation lib in clojure :D
23:45Frozenlockdrewc: I'm amazed at how the layout changes when I resize the window. I must be getting old.
23:51yedican someone who knows korma help me out with this simple starter program: https://gist.github.com/yedi/4743886
23:51yediam i missing a step somewhere?
23:55toastyedi: try putting a (declare products) above defentity
23:55yedishouldn't the defentity take care of declaring it?
23:56yedii tried that and got the same error unfortunately
23:56toastyea - I was just looking at my code and that was the only diff I could see
23:57yediyours works correctly?
23:57yedihmm, maybe my postgres isn't set up right
23:58yediit did say the server started