#clojure log - Feb 08 2013

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

1:08 Frozenlock: I had my first reflex use of `comp'. I feel like I just achieved a new level.

2:53 tomoj: what if you had ::foo/bar read to (keyword ":foo" "bar") if there is no alias for 'foo?

2:53 when I read the edn spec I expected ::foo/bar to be valid

2:54 but I guess the spec means that the part after the colon must be a valid symbol

2:56 * darth10 waves

3:01 * darth10 waves

3:06 danebez: good 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

3:09 management 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

3:14 darth10: @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.

3:19 headshot: danebez: it's also a jvm language with full access to the java world

3:20 so if you have a commitment to jvm/java already, it's not an introduction of yet another runtime

3:20 danebez: thanks for the comments. @darth10, can you be more specific as to why collaboration is more effective vs. Java or Rails?

3:20 @headshot we have no commitment yet

3:21 headshot: oh, "in a country where"

3:21 danebez: i come from a Java background though, but am convinced that a Clojure implementation would be faster, more concise, have fewer bugs and support scalability

3:22 (better)

3:24 headshot: i kinda lucked out in my workplace. most of the devs are old skool emacs junkies who aren't afraid of lisps

3:24 and we have a pretty solid commitment to the jvm as a runtime

3:25 shaunxcode: why am I about to argue with someone on hn about clojure "not being a lisp"? time to walk away from the keyboard

3:26 danebez: i'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)

3:27 headshot: i'm not a ruby fan, but it does seem there are a lot of ruby -> clojure "converts"

3:27 so that might help with staffing

3:28 shaunxcode: danebez: 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 :-(

3:28 atyz: danebez: i missed the first part of that conversation (disconnected), but i've found rails to be an incredibly effective prototyping tool

3:28 headshot: but if you have a bunch of commodity java developers to choose from, that can be quite a brain shock

3:29 danebez: people converting to clojure for web applications from rails when they get decent performance these days is super interesting

3:29 headshot: especially if you might be the only clojure job they might ever get in some long term

3:29 danebez: i wonder what the major benefits are

3:29 atyz: danebez: for protyping you won't beat rails

3:29 the issue is that with rails you're stuck with so much convention

3:29 and decisions that have already been made for you

3:29 as a frame work it isn't *THAT* flexible

3:29 its big and fat - and it can be difficult to scale

3:30 clojure on the other hand is implemented on the jvm and you can easily choose your components

3:30 i like its minimalist approach

3:30 danebez: rails seem to have grown into something rather enormous, i'm hesitant to learn it (and Ruby) coming from a JVM background

3:30 atyz: but this is a weird arguement to be having as its rails (a framework) vs a language

3:31 danebez: ruby is the best multitool language i have ever used

3:31 its tooling is amazing and it can do almost anything you want - don't look to it for speed/performance though

3:31 the community behind is is also really great

3:33 danebez: given 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?

3:35 shaunxcode: sorry did you already mention the region you are working in?

3:37 danebez: no

3:37 i am in South Africa

3:39 at the moment, there are virtually no clojure skills being offered on the job market as there are too few companies using clojure still

3:39 tomoj: actually, I'd be happy with this: https://www.refheap.com/paste/698cbbb111cb0d200dcce066e

3:39 danebez: the companies that use it either had someone learn it, or hired someone for which it was a "hobby"

3:42 ejackson: danebez: there is a web company it Cape Town using Clojure

3:42 so that's at least 1

3:42 danebez: yes i am aware of 2 companies ;-)

3:42 ejackson: ok

3:43 but 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.

3:43 Frankly I value that, high signal to noise ratio.

3:44 danebez: exactly, 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

3:44 shaunxcode: danebez: I am nearly certain I was chatting with someone on datomic mailing list from south africa (unless it was you hah)

3:45 danebez: no was probably a buddy of mine that runs the local user group

3:46 atyz: ejackson: where are you from?

3:46 shaunxcode: danebez: https://www.cognician.com/ ?

3:46 danebez: yes

3:46 ejackson: atyz: originally, Zimbabwe, then SA, now UK, soon US !

3:47 atyz: ejackson: my parents grew up in bulowayo

3:47 clgv: ejackson: you dont like to stay in one place very long, do you? ;)

3:47 ejackson: atyz: yeah, my grandparents had a farm just outside there.

3:48 clgv: yeah, its sadly, true. Wish it wasn't though.

3:48 clgv: ejackson: do you move to the US for a new job?

3:49 atyz: I'm looking at moving to US in a year or 2

3:49 ejackson: actually, 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.

3:49 atyz: good move.

4:01 amalloy: oh, we'll have you among us now, ejackson? where in the US?

4:02 ejackson: amalloy: not for months yet - December is the appointed time

4:02 amalloy: ah

4:02 ejackson: I'm heading to the South to try fill the Clojure gap left by Raynes's departure: Nashville, TN

4:02 amalloy: you've missed it, then. dunno about england, but in the US that was two months ago

4:03 ejackson: amalloy: its one of those timezone things.... :)

4:43 borkdude: where can I find the source of the port of clojure datastructures in clojurescript?

4:43 in which file on the clojurescript repo I mean

4:59 edlothiol: borkdude: https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L2863

5:00 abp: How can I find out on which ports nrepl servers are running?

5:02 I've set the repl-options in my project.clj but can't M-x nrepl to the specified port after "lein ring server".

5:07 borkdude: another 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?

5:10 Bodil: borkdude: Uh, neither does the JVM, so that can't really be a serious argument... or am I missing something here?

5:13 borkdude: Bodil http://technomancy.us/159

5:13 vijaykiran: wasn't it because of lack-of reader macros and concurrency related stuff ?

5:16 borkdude: Bodil JVM strings are immutable, also Java has "final" which makes it not easy to change stuff

5:16 but apparantly in clojurescript this is not considered a problem

5:16 Bodil: borkdude: The argument seems to be more about using Cljs in place of Elisp rather than whether Elisp can be a Cljs target.

5:17 borkdude: JS certainly has most of the same problems, referential transparence is by convention when it's required.

5:17 borkdude: referential transparency*

5:19 borkdude: I think I could live with ref. trans. by convention in elisp

5:20 noidi: are emacs lisp strings mutable?

5:20 borkdude: noidi apparently

5:21 noidi: that's a pretty big interop hurdle, then

5:22 borkdude: noidi who is mutating strings these days?

5:23 OscarZ_: 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) ...) ?

5:24 noidi: OscarZ_, in the latter no var is created for the function

5:25 the function name parameter to `fn` is only needed for non-tail recursion

5:26 so, 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

5:26 OscarZ_: ah ok.. i was wondering what can you do with that name after fn but of course you can make a recursive call...

5:27 thanks makes sense

5:35 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? :)

5:43 I tried (def foo (def bar (fn ([x y] (+ x y))))) in REPL.. ok i think i get it

6:05 ejackson: Bodil: nice shirt, glad somebody finally said it so clearly.

6:07 Bodil: ejackson: I'm not going to take credit for that. http://wadler.blogspot.no/2012/12/tech-mesh-2012.html :)

6:09 hyPiRion: gfredericks: Be my guest :)

6:10 ejackson: Bodil: nothing is new.

8:54 jweiss: I'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

9:14 ponzao: jweiss, you are iterating through the list a few times so I guess it is only natural

9:35 clgv: jweiss: it's not your code but maybe the garbage collector if you list is large enough

9:39 calis: Should I learn clojure with Emacs (with Emacs Live) or Sublime as my editor? I'm unfamiliar with both

9:41 arrdem: calis: 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

9:42 jweiss: clgv: yeah that must be it. a million items in the list

9:42 clgv: calis: there are more alternative, e.g. Counterclockise in Eclipse

9:49 Foxboron: calis: what OS?

9:49 calis: OS X

9:49 Foxboron: arrdem: it got capable REPL, as long as you fix the keybinds :P

9:50 calis: then you can choose TBH. Emacs got a steaper learning curve, but you get really into all LISPY stuff

9:50 calis: if you just want things to work and look good, go Sublime Text 2 and SublimeREPL

9:50 I have two packages to help with documentations for CLojure in Sublime text

9:50 (one for autocompletion and one for general docs)

9:51 I do recommend Emacs if you wanna get really down with Clojure

9:56 calis: Can 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

9:57 Foxboron: calis: i really dont recommend emacs bindings in general <.<

9:57 go with the vim keybinds (which Sublime allready supports) and use those when you get into emacs

9:58 calis: but too answer your question; yes you can setup with emacs keybinds

9:58 aroemers: callenbot: 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)

9:59 Foxboron: calis: https://github.com/grundprinzip/sublemacspro

9:59 aroemers: calis: ^

9:59 Foxboron: but again. VIM keybinds > Emacs keybinds

9:59 aroemers: callenbot: sorry, nevermind me

10:00 Foxboron: Editors in general: Emacs before vim.

10:00 (my opinions)

10:00 (don't kill me)

10:01 arcatan: I think that the times of the holy editor wars are over

10:01 they should be, anyway :P

10:01 calis: Thanks all

10:01 ttimvisher: we'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:01 anyone experienced something like that before and know how to resolve it?

10:04 we're on hadoop 1.1.1 and cascalog 1.10.0 if that helps

10:05 kryft: Foxboron: I agree, and emacs in evil mode has been quite nice so far :)

10:05 Foxboron: kryft: i do have small problems with it, but just change too emacs mode again and it works :P

10:06 llasram: ttimvisher: Are you runing jobs on a cluster from the REPL, or is this just Hadoop local mode?

10:06 ttimvisher: llasram: remote cluster

10:07 llasram: ttimvisher: How are getting your job contents all available on the task classpath -- launching the REPL from an uberjar, or some other mechanism?

10:09 ttimvisher: llasram: 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:10 does bootstrap do something to do that?

10:11 llasram: No. 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:14 There'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:14 ttimvisher: llasram: 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:15 llasram: Ok. Are you explicitly specifying that uberjar as the job JAR somehow?

10:16 If 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:17 Second hypothesis is Hadoop gremlins

10:17 ttimvisher: llasram: looks like we _may_ have simply been using a bad ns declaration :\

10:18 llasram: haha

10:19 ttimvisher: not sure how it was working before

10:20 llasram: Hadoop gremlins

10:41 devn: Raynes: You around?

10:42 Raynes: On morphin the README has a note: "More will come soon" -- any ideas for what other sorts of ranges you'd add?

10:47 TimMc: gfredericks: This is how I imagine your Swearjure talk: https://www.youtube.com/watch?v=F5N35kQAPv0

10:48 gfredericks: (Either the first part or the second part, I'm not sure which. :-P)

10:52 babilen: tpope: Ping me if you need further details regarding vim-foreplay/issues/51

10:52 hyPiRion: ~quicksort

10:52 clojurebot: quicksort is not something you need alphanumerics for: https://www.refheap.com/paste/284a0552a6b69c6037faa2db5

10:54 TimMc: (for some definitions of quick)

10:55 hyPiRion: O(n^3) worst case.

10:56 It's a bit boring that rest is O(n). Wonder if we can speed that up.

10:56 TimMc: Surely n^3 log n?

10:56 Oh, I guess you can ignore log factors at that point.

10:56 rest might even be worse than n

10:56 hyPiRion: TimMc: Wha?

10:56 TimMc: What's this do? (= `[~@list] [])

10:57 hyPiRion: Oh for. God riddance.

10:57 O(n^4) or something then

10:59 TimMc: (That "what's this" was about your quicksort preview code. I think it can be simplified.)

10:59 So 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:59 And there's maybe even another (into ...) step somewhere.

11:00 Time to measure it, I guess!

11:00 ~rest

11:00 clojurebot: rest never returns a unicorn

11:00 TimMc: ~rest

11:00 clojurebot: rest never returns a unicorn

11:00 TimMc: ~rest

11:00 clojurebot: rest is easy to write without alphanumerics: https://www.refheap.com/paste/5980

11:01 hyPiRion: TimMc: oh right, I've not posted the whole thing

11:01 I'll pop it up for you

11:02 TimMc: https://www.refheap.com/paste/79c034805f87edf1e54c5c8b0

11:03 TimMc: Is that the same logic as my rest?

11:03 ivaraasen: hyPiRion: beautiful

11:03 TimMc: No, it's got a gensym in it. Nasty.

11:04 I mean, beautiful.

11:04 Very clever.

11:04 * TimMc casts about for something to throw

11:05 hyPiRion: TimMc: If it's going to be incomprehensible, better make it as incomprehensible as possible.

11:06 ivaraasen: hyPiRion: do the wrong thing right?

11:07 hyPiRion: ivaraasen: Two wrongs make one right

11:08 TimMc: hyPiRion: I can't tell if that's better or worse than my trick.

11:09 I think it has the same time complexity.

11:09 hyPiRion: TimMc: Yeah, it has the same time complexity

11:10 Hm.

11:11 ln2: This is probably the most silly question ever asked. But what does the # character do? (I tried google and failed miserably) =(

11:11 hyPiRion: ,(map (fn [a] ({[] true} a false)) [() nil [] [1 2 3] (list 1 2 3)])

11:11 clojurebot: (true false true false false)

11:11 TimMc: ln2: Look at http://clojure.org/reader

11:12 ln2: It's a dispatch symbol for the reader -- what's important is the character that comes after it.

11:12 #{ starts a set, #( starts a function literal, etc.

11:13 If you find it at the end of a symbol, however, it's a gensym.

11:13 Don't worry about those for now.

11:13 hyPiRion: TimMc: We can probably replace (= `[~@list] []) with ({[] true, nil true} list)

11:13 ln2: TimMc: Thank you! I have a lot of reading to do on this.

11:13 Frozenlock: Well, I found some of my older code using read-string without changing *read-eval*. :(

11:14 TimMc: hyPiRion: Well, it's more that `[~@list] and list are in the same eequality partition.

11:14 hyPiRion: TimMc: Huh? I thought .equals first compared length, then elements

11:15 TimMc: &(= '(1 2 3) [1 2 3])

11:15 lazybot: ⇒ true

11:15 TimMc: &(= `[~@'(1 2 3)] [1 2 3]) ;; unnecessary

11:15 lazybot: ⇒ true

11:15 hyPiRion: &(= nil [])

11:15 lazybot: ⇒ false

11:15 ln2: Is there a more general / easier definition for what a dispatch is exactly?

11:16 hyPiRion: &(= `[~@nil] [])

11:16 lazybot: ⇒ true

11:16 ln2: (I did read the clojure.org document)

11:16 TimMc: ln2: Hmm. Don't worry about that for now either. Just know that "#{" is a single token, "#" isn't doing something to "{".

11:17 # isn't anything by itself.

11:17 ln2: TimMc: Alright thanks! I just get frustrated when I see code that contains something I don't understand and/or cant replicate. =(

11:18 hyPiRion: #{} is an empty set, #! is the same as ; (comment), #(...) is a function, #"abc" is a regular expression

11:18 ln2: I'm on #38 on 4clojure and some of the solutions included # (I had to cheat on two of them).

11:18 hyPiRion: #'foo is something you shouldn't worry about

11:18 ln2: if there's #(... % ...), then consider it as (fn [%] (... % ...))

11:19 ln2: I wonder why the decision was made to use one character in so many different wants? Is that unique to Clojure?

11:19 TimMc: It goes back decades.

11:19 hyPiRion: It's pretty common for lisps.

11:19 ln2: Interesting. So if I start a fn with # it automatically assumes inputs %1 %2 %3 ect.?

11:20 TimMc: Depending on what %n it finds inside, yes.

11:20 ln2: Very cool !

11:20 TimMc: ,'#(+ % %2)

11:20 clojurebot: (fn* [p1__55# p2__56#] (+ p1__55# p2__56#))

11:20 hyPiRion: ln2: I'll make some examples to give you an idea

11:21 ln2: The ' character means "treat as raw data" correct?

11:21 TimMc: Yeah, it's quote.

11:21 'foo is (quote foo)

11:21 kryft: ln2: Or "don't evaluate"

11:21 ln2: 'win == "win" ?

11:21 TimMc: Nope.

11:22 It still has to contain well-formed Clojure code, unlike a string.

11:22 Frozenlock: ,(= (name 'win) "win")

11:22 clojure-newb: hey guys, I'd like to compare the values in two maps, how can I turn the values into sets and compare ?

11:22 clojurebot: true

11:22 hyPiRion: ln2: win is a symbol, 'win means "don't evaluate (lookup the value of) win)

11:22 clojure-newb: or is that not how I would do it ?

11:22 TimMc: clojure-newb: Call vals on the two maps.

11:22 ln2: hyPiRion: I think I'm starting to get it. Thanks. =)

11:22 kryft: Thank you. =D

11:23 Alright I'm going to continue on with my 4clojure now. xD

11:23 TimMc: Err... maybe call set on those? I think they might not be sets.

11:23 Right, vals can contain duplicates.

11:23 clojure-newb: so (hash-set whatever) ?

11:23 and then (= hs1 hs2) ?

11:23 TimMc: Just set.

11:23 clojure-newb: oh

11:23 ok

11:24 thx

11:24 TimMc: clojure-newb: Would {:a 1 :b 1 :c 2} have the same vals as {:a 1 :b 2}?

11:24 clojure-newb: erm no

11:25 would need {:a 1 :b 2} == {:a 1 :b 2}

11:25 TimMc: hyPiRion: I get a stack overflow with my rest on a 1e4 element vector.

11:25 clojure-newb: Oh, the keys need to match as well? Just use = on the maps.

11:25 hyPiRion: ln2: https://www.refheap.com/paste/23405de5f52cdb3c531bd5c35 Should cover most of the #(...) examples

11:25 use-cases*

11:26 clojure-newb: TimMc: 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:26 hyPiRion: TimMc: :jvm-opts ["-Xss1000m"]

11:26 ln2: hyPiRion: Holy Sh** thanks!!! Bookmarked!

11:27 clojure-newb: think I've got it with 'set' thx

11:27 TimMc: clojure-newb: Then would {:a 1 :b 1 :c 2} have the same vals as {:d 1 :e 2 :f 1}?

11:27 err, {:d 2 :e 1 :f 2}

11:27 Note that one as 2 2s, and the other has 2 1s.

11:28 clojure-newb: TimMc: my case is something like {:a 1 :b 2} compared to {:a1 1 :b1 2}

11:28 so set on the vals should be good

11:29 hyPiRion: ln2: You're welcome :) I had problems finding documentation on the #() thing, so I can relate

11:29 kryft: Hmm, 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:29 TimMc: clojure-newb: So duplicate vals of different "multiplicity" don't bother you?

11:29 clojure-newb: TimMc: no as I'll be grabbing keys I control beforehand

11:31 hyPiRion: kryft: 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:31 ln2: hyPiRion: 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:32 hyPiRion: ln2: I think it requires programming experience in general. And I know, it's a bit sad

11:32 ln2: hyPiRion: Yup. Got zero of that. xD

11:33 hyPiRion: 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:33 *programmers

11:34 hyPiRion: ln2: 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:34 Which they most likely won't when they've never programmed before.

11:35 Also, a dictionary of words would be nice. I still find "multiple dispatch" a bit... academic?

11:35 ln2: hyPiRion: 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:35 kryft: hyPiRion: Ok, thanks :)

11:36 hyPiRion: kryft: 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:37 ln2: I think that an "absolute beginner" course for lamda calculus would solve a lot of problems with grasping Clojure.

11:38 Natch: ln2: 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:38 ln2: Natch: Thank you!!! I love lectures! Haha

11:39 Frozenlock: Those are amazing lectures

11:39 ln2: *Watching right now* =)

11:39 Frozenlock: Blackboard... So many parentheses without the help of an editor.

11:40 kryft: hyPiRion: 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:42 hyPiRion: (I'm mentioning numerics separately from algorithms mainly because I expect numerics has its own considerations compared to, say, graph algorithms)

11:43 hyPiRion: kryft: 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:44 kryft: hyPiRion: Ah, I'm not taking a course in anything, just teaching myself

11:46 hyPiRion: But yeah, of course the point about needing to think outside the textbook pseudocode still stands. :P

11:46 hyPiRion: kryft: 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:47 kryft: hyPiRion: Ok, thanks :)

11:47 I want to understand everything, which is why I often get very little done :P

11:48 hyPiRion: I 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:49 (Facebook Hacker Cup is an "algorithm and data structures"-competition)

11:50 What you'd like is the introduction and the "Improving Ancient Skills"-part.

11:51 kryft: hyPiRion: My limited exposure to functional programming has certainly changed the code I write in less functional language

11:52 ToBeReplaced: i've been thinking about DOM manipulation problems; has anyone tried modeling nodes as time-series?

11:52 hyPiRion: (inc kryft)

11:52 lazybot: ⇒ 1

11:53 hyPiRion: kryft: It's all about picking the right tool, and sometimes you can partially have your tool in a language not designed for it :)

11:53 desertmonad: if I buy Clojure Programming from orally with a coupon, do the authors get less royalty from that purchase?

11:53 er, oreilly

11:53 lol

11:54 tpope: babilen: I'm around

11:55 babilen: tpope: Ah, wonderful. Might be easier like this.

11:56 tpope: 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:57 Or is anyone here aware of a good method to test if something is a leiningen project if project.clj is around?

11:57 tpope: slurping the entire file in is lame

11:57 is there really nothing in the directory we can rely on?

11:59 babilen: I 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:59 hyPiRion: babilen: project.clj may have multiple statements. You'd have to check every single statement to do that.

11:59 (the (defproject ...) check)

12:01 babilen: hyPiRion: Can you think of another way to test this?

12:01 hyPiRion: You 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:02 But that would evaluate project.clj, so be aware of that.

12:02 tpope: I'm looking to do static analysis actually

12:02 babilen: hyPiRion: Sounds as if simply running "lein classpath" to get the classpath (or an error) would be a viable option then.

12:03 But that also does not allow for a static check

12:03 As 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:03 tpope: I was checking for both project.clj and src/. but apparently some people are too good to have a src/

12:04 hyPiRion: tpope: Yeah, people may have clojure/ and java/

12:04 ToBeReplaced: or src-clj src-cljs

12:04 hyPiRion: Leiningen checks by evaluating project.clj really, so.. *shrugs*

12:04 babilen: hyPiRion: Some people don't use src/ but configure :source-paths ["übersrc"] in project.clj or something along those lines.

12:05 hyPiRion: babilen: exactly.

12:05 tpope: these are horrible people

12:05 nDuff: Eh.

12:05 babilen: tpope: I agree - But I ran into it today, went "wtf" and figured out what can be done to solve this.

12:05 nDuff: I think "anyone who does that is awful" is an excuse for people to write a lot of very horrid code

12:05 ie. assuming in shell scripts that there will never be files or directories with spaces or newlines in their names

12:06 the bugs that fall out of those assumptions are frequently security-exploitable

12:06 hyPiRion: But 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:06 nDuff: ...building code to be robust even against things that only "horrible people" do is simply the Right Thing.

12:06 tpope: counterexample: https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/project.clj

12:06 nDuff: yes, which is why I'm trying to find a solution

12:06 babilen: +1

12:08 tpope: 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:08 gfredericks: hyPiRion: cool, thanks

12:08 tpope: babilen: well for starters, classpath.vim is technically optional. you can connect to nrepl without it

12:09 there's two different checks for this. one in classpath.vim and one in foreplay.vim

12:09 hyPiRion: tpope: Leiningen considers that folder to be a project, and casts an exception because project.clj is malformed.

12:09 kryft: hyPiRion: I've also heard about things like Okasaki's Purely Functional Data Structures, but I thought that might be overkill at this point

12:09 tpope: hyPiRion: yes, but lein has the luxury of telling the user not to do that

12:09 TimMc: nDuff: And -- all the things!

12:10 tpope: foreplay works irrespective of the cwd

12:10 hyPiRion: kryft: I got that book, and it doesn't go into "standard" algorithms

12:10 And I think it requires some familiarity with data structures from before

12:11 tpope: heh. Life's hard, eh.

12:11 Make some bayesian network which returns a probability that the folder is a leiningen project or not.

12:11 ln2: I love the Eval => Apply wizard. Haha

12:12 * Iceland_jack thought ln2 was writing some odd type constraint for a second

12:12 kryft: hyPiRion: Right

12:13 ln2: Iceland_jack: No I'm watching the MIT Lisp lectures. xD

12:13 tpope: babilen: if you want to help, step one is taking foreplay.vim's s:hunt and factoring it inline

12:13 alexnixon: hyPiRion: 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:13 tpope: there's only one consumer left

12:14 TimMc: tpope: What does foreplay.vim do?

12:14 babilen: tpope: Ok, I'd love to help, but have to see how far I can get.

12:14 nDuff: alexnixon: Makes it very easy to slip out of them by mistake, however, and hard to analyze whether something is conformant.

12:15 babilen: TimMc: vim → nrepl plugin : https://github.com/tpope/vim-foreplay (think of it as nrepl.el for vim)

12:16 tpope: yeah basically

12:16 hyPiRion: alexnixon: Indeed. The difference between Clojure vs. C++ is that Clojure has immutable datastructures in the core language/standard library, whereas C++ does not

12:16 SurlyFrog: Does 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:16 TimMc: OK. It was hard to tell from the description.

12:17 nDuff: SurlyFrog: Hmm. There's compile-time metadata with those, but I'm not sure it still exists at runtime.

12:17 hiredman: SurlyFrog: it does, but I recommend using clojure.java.io/resources instead

12:17 TimMc: SurlyFrog: Put things in the ./resources folder.

12:17 tpope: well it's hard to describe. it's technically not nrepl specific

12:17 gfredericks: TimMc: hyPiRion: submitted

12:17 hyPiRion: gfredericks: :D

12:17 hiredman: clojure.java.io/resource

12:17 technomancy: tpope: 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:18 tpope: including the leiningen-core project, heh

12:18 it has bitten me a couple times but never enough for me to actually fix it

12:18 SurlyFrog: Thanks all, I'll look at clojure.java.io/resource

12:18 tpope: technomancy: yeah, since I'm not using the cwd I need to be more careful about it than you do

12:19 hiredman: SurlyFrog: it lets you load arbitrary files from the classpath

12:19 the jvm way to do that sort of thing

12:19 SurlyFrog: hiredman: thanks, my Java experience is limited, but I'll figure it out :-)

12:20 gfredericks: I bet there's significant demand for an "Intro to the JVM for clojure programmers" that cuts out all the java-specific noise

12:22 SurlyFrog: gfredericks: 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:22 ldh: gfredericks: thirded

12:22 gfredericks: I have a coworker with a lot of C++/ruby in a similar position

12:26 kryft: gfredericks: I was actually just about to ask about that

12:26 jackdanger: gfredericks: fourthed. I had to learn Java to get past intermediate Clojure steps.

12:26 SurlyFrog: So, 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:26 Frozenlock: gfredericks: Yes, the JVM is really the hardest part of clojure. Or rather, the implication that one should use it.

12:28 SurlyFrog: There must be something else to it. Possibly a Leiningen option….

12:29 nDuff: SurlyFrog: Depends on your classpath.

12:29 hiredman: don't use .getFile

12:29 nDuff: ...oh; was reading too quickly / didn't see the .getFile

12:29 hiredman: use one of the other functions in clojure.java.io, most likely reader or input-stream depending on what you are doing

12:30 nDuff: SurlyFrog: ...so, consider the case where your project has been compiled into a .jar

12:30 SurlyFrog: Well, 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:30 nDuff: SurlyFrog: in that case, your resource is no longer a separate file

12:30 SurlyFrog: okay

12:30 hiredman: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L213

12:31 technomancy: SurlyFrog: I think if you create the resources directory after starting your repl it won't be visible until the repl restarts

12:31 just an annoying jvm-ism

12:31 SurlyFrog: hiredman: thanks

12:31 technomancy: yeah, I had that thought while I was doing it...

12:32 hiredman: the 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:32 SurlyFrog: So, 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:33 hiredman: I think java7 has some nio2 stuff that will let you treat a jar like a filesystem

12:33 technomancy: SurlyFrog: no, you don't need to set :resource-paths unless you're changing the default

12:33 creating a "resources" directory in the project root is enough

12:33 nDuff: SurlyFrog: 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:34 SurlyFrog: nDuff: thanks

12:36 Is 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:37 technomancy: SurlyFrog: sure; put it in dev-resources insntead

12:37 SurlyFrog: technomancy: perfect, thanks so much!

12:39 That's in :profiles, correct? So `:profiles {:dev {:resource-paths ["path/to/dir"]}}`

12:39 technomancy: simplest just to mkdir dev-resources

12:40 SurlyFrog: at the top-level of the project?

12:41 I see it, thanks

12:49 Um, 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:52 hyPiRion: SurlyFrog: (with-open [r (io/reader (io/resource "foo"))] (read lines here))

12:52 So yes.

12:52 Either that, or slurp.

12:52 hiredman: (doc line-seq)

12:52 clojurebot: "([rdr]); Returns the lines of text from rdr as a lazy sequence of strings. rdr must implement java.io.BufferedReader."

12:52 SurlyFrog: hyPiRion: thanks so much for confirming! That's what I'm up to :-) Doesn't slurp pull the entire file into memory?

12:53 hyPiRion: SurlyFrog: yup. hiredman's solution also works, but be aware that the reader will be open until the last line is consumed.

12:53 SurlyFrog: got it. thanks so much

12:53 hyPiRion: Actually, hiredman's solution seems to fit better with your goal, so use that one.

12:55 SurlyFrog: I'm doing a `(with-open [rdr (io/reader (io/resource "xxx"))] (doseq [line (line-seq rdr)] ….))

12:55 hyPiRion: That should be safe

12:56 (In the sense that it shouldn't crash)

12:56 dnolen: feedback welcome http://swannodette.github.com/2013/02/08/the-simply-typed-lambda-calculus-in-20-lines-redux/

13:06 TimMc: dnolen: I'm curious why you decided to move to github. Doesn't that give you less control over your URLs?

13:07 Oh, never mind -- you were on posterous before.

13:07 dnolen: TimMc: heh yeah

13:07 I just don't want to spend time managing a blog, jekyll + git is convenient.

13:07 TimMc: I'm one of those folks who thinks that everyone should have their own domain name.

13:08 technomancy: I think if you pay for a micro plan github will let you do a CNAME

13:08 dnolen: technomancy: yeah I saw that

13:09 DerGuteMoritz: does anyone know if this is intentional behavior:

13:09 user> (let [m (transient {1 2})] [(get m 1) (contains? m 1)])

13:09 [2 false]

13:09 jonasen: dnolen: there is a t (instead of tau) in (1)

13:10 in the explanation of (1) that is

13:10 hyPiRion: DerGuteMoritz: sounds very much like a bug.

13:10 (doc transient)

13:10 clojurebot: "([coll]); Alpha - subject to change. Returns a new, transient version of the collection, in constant time."

13:10 DerGuteMoritz: ah http://dev.clojure.org/jira/browse/CLJ-700

13:10 dnolen: jonasen: thanks!

13:11 jonasen: dnolen: nice post btw. Already looking forward to the next one

13:11 TimMc: Wow, that's an old bug.

13:11 DerGuteMoritz: hm something seems to be wrong with the patch :-)

13:11 anyway, cljs seems to have the same bug

13:11 dnolen: jonasen: thanks

13:12 AtKaaZ: ,(sorted? (map? (sorted-map)))

13:12 clojurebot: false

13:12 mrb_bk: dnolen: ooh a new post

13:12 dnolen: jonasen: btw, I think you'll finally get your sequence matching feature in core.logic ;)

13:12 AtKaaZ: why isn't sorted-map implementing Sorted? or what is?

13:12 ln2: I didn't realize that you could use github to hosts websites. That's pretty cool. =)

13:14 AtKaaZ: ,(sorted? (sort []))

13:14 clojurebot: false

13:14 mrb_bk: lol @ "Being an undisciplined not computer scientist"

13:14 jonasen: dnolen: that would be very nice

13:14 biff_tannen: qq ... will including lein-ring include ring-core as a dependency ?

13:14 AtKaaZ: mrb_bk: that sounds like me :D

13:14 DerGuteMoritz: ah no, I am mistaken, only -contains-key? has this bug in cljs

13:15 jonasen: dnolen: is it already implemented somewhere?

13:15 dnolen: jonasen: there just wasn't a good place for it, but now that we have featurec we can do it sensibly.

13:15 mrb_bk: dnolen: a link to the paper might be a good idea

13:15 AtKaaZ: ~logs

13:15 clojurebot: logs is http://clojure-log.n01se.net/

13:15 dnolen: jonasen: it will be supported in featurec

13:15 mrb_bk: which paper?

13:15 mrb_bk: dnolen: Cheney & Urban

13:15 oh!

13:15 it's there

13:15 technomancy: biff_tannen: plugins and dependencies are separated by design

13:15 mrb_bk: dnolen: my bad

13:16 weavejester: biff_tannen: Indirectly, but it's best to add the dependency explicitly.

13:16 technomancy: biff_tannen: though it's possible for a plugin to affect the dependencies list if it thinks it needs to

13:16 dnolen: jonasen: so (featurec some-list [1 2 (rvar) 3 4]) or something like that

13:16 weavejester: You shouldn't rely on it pulling in ring-core, put it that way :)

13:16 dnolen: jonasen: where rvar will consume until 3 is encountered

13:16 ivaraasen: dnolen: nice blog post

13:17 dnolen: ivaraasen: thanks!

13:17 AtKaaZ: oops I realized where I fail: (sorted? (map? (sorted-map))) instead of (let [x (sorted-map)] (and (sorted? x) (map? x)))

13:18 dnolen: jonasen: there's probably some edge cases where around multiple possible matches, not sure if or even how to support that yet.

13:19 jonasen: dnolen: possible matches arise when you have several rvar's as in [(rvar) 1 (rvar)].

13:19 AtKaaZ: maybe (sorted? true) should yell if not being passed a coll, for lame ppl like me :)

13:19 jonasen: multiple, not possible

13:19 weavejester: technomancy: Is there any way of having a "profile.clj" on a per-project basis in Lein?

13:20 As project.clj is typically in source control

13:20 But sometimes you might want to override options without commiting them to the repo.

13:20 dnolen: jonasen: yep, so I'm not sure about that - whether supporting it is worth it without handling that case

13:20 technomancy: weavejester: yeah; profiles.clj =)

13:20 dnolen: those cases, really

13:21 jonasen: dnolen: But that shouldn't be a problem since core.logic already returns multiple results.. or am I missing something?

13:21 weavejester: technomancy: 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:21 dnolen: jonasen: no it's a problem - constraints live in a different "world" so to speak

13:21 they don't really participate in search - that is they never return multiple possibilities

13:21 technomancy: weavejester: yeah

13:21 AtKaaZ: what identifies as coll(ection) ? is it clojure.lang.ISeq ?

13:22 weavejester: technomancy: Ah, excellent. That makes an awful lot of sense.

13:22 AtKaaZ: oh it's coll? aka clojure.lang.IPersistentCollection

13:22 jonasen: dnolen: ok.

13:23 technomancy: weavejester: I think hugod added it

13:23 biff_tannen: thx technomancy weavejester

13:24 hugod: technomancy: I don't remember adding it - though I certainly use profiles.clj.

13:25 I tend to put all the dev time stuff in it and commit it as well though

13:25 technomancy: hugod: hmm... well I don't remember adding it myself.

13:25 * technomancy glances around

13:26 * TimMc whistles innocently

13:26 technomancy: http://forums.weebls-stuff.com/images/smilies/Itisamystery.gif

13:26 mrb_bk: dnolen: does this look reasonable? https://gist.github.com/mrb/4740935

13:27 dnolen: mrb_bk: looks ok to me, do you need a conde because you're going to add other clauses?

13:28 mrb_bk: dnolen: ah yeah good point i left that in when this did more. thanks!

13:29 TimMc: hyPiRion: DId you follow what I meant about `[~@list]?

13:43 Frozenlock: Is there a way to temporarily cache result from a function? i.e If called within 10 sec, just return the same result.

13:44 technomancy: Frozenlock: easier to do for the scope of a binding than by a time window

13:44 TimMc: Check if core.cache has a memoizer that does that.

13:47 cemerick: lynaghk: have you looked at lein-dalap any? http://birdseyesoftware.github.com/lein-dalap.docs/

13:48 Frozenlock: TimMc: TTLCache sure looks promising :)

13:49 abp: cemerick: Have you? :)

13:50 cemerick: abp: reading now

13:52 couple of practical bits that'll make it tough to dig into

13:52 esp. enumerating source and target file paths

13:54 abp: cemerick: Hm ok.

13:56 lynaghk: cemerick: nah, I've never seen it

13:58 cemerick: looks like it was inspired by cljx, though. I guess they wanted form-by-form transforms, instead of just toplevel vars

13:59 hyPiRion: TimMc: `[~@list] generates a new list in O(n) time, yes

13:59 ln2: Trying to install https://github.com/fmw/vix

13:59 I get the following error. http://tny.cz/ad7dd9fa

14:00 In the "Execute the (add-user) function in order to add a user with full access privileges:" step. Any suggestions?

14:01 The entirety of google doesn't seem to have this error related specifically to vix. =(

14:01 lynaghk: cemerick: 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:02 hyPiRion: TimMc: was that what you thought of?

14:02 technomancy: it's because people don't tell the irc channel before starting!

14:02 cemerick: lynaghk: trend, as in, multiple parallel solutions?

14:02 lynaghk: cemerick: e.g., every month someone releases a new hiccup library without really mentioning why something new is warrented

14:02 cemerick: yeah.

14:02 nDuff: There'll eventually be one solution that's canonical.

14:03 cemerick: well, it's early days

14:03 nDuff: ...at least for the clj/cljs thing.

14:03 technomancy: lynaghk: validation libs =\

14:03 cemerick: as cool as cljx and kibit is, writing core.logic rules for portability purposes hurts

14:03 technomancy: it's the Curse of Lisp; it's easier to roll your own than to coordinate.

14:03 lynaghk: cemerick: yeah, sure. I'm definitely part of the problem on a few libraries though.

14:03 Frozenlock: Yeah, why don't people check clojure.org before starting a library! SHeesh

14:03 technomancy: Frozenlock: hehe

14:04 cemerick: all of these options will be blown up whenever feature expressions land

14:04 lynaghk: I don't actually think it's a problem.

14:04 lynaghk: technomancy: 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:04 hiredman: cemerick: is their any indication from rich that they will ever land?

14:04 cemerick: People want different stuff, bikeshed, and sometimes are just interested in the problem as an exercise.

14:04 technomancy: lynaghk: CL never grew out of it

14:05 hiredman: there

14:05 lynaghk: cemerick: 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:05 hiredman: damn

14:05 technomancy: ruby had a phase where every other week there was a new testing framework because people liked playing with metaprogramming

14:05 p_l: technomancy: I think CL suffered more from the lack of code sharing and lack of good and easily available implementation

14:06 cemerick: hiredman: Not that I'm aware of, but a lot of people are lobbying.

14:06 ln2: Does anyone have any experience with Vix? https://github.com/fmw/vix

14:06 lynaghk: cemerick: 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:06 cemerick: lynaghk: eh; many of those batteries are traps

14:06 p_l: by the time it was easier to do so, it suffered from thousands of shitty tutorials written based on stuff from late 1970s ;)

14:07 lynaghk: cemerick: 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:07 cemerick: The Clojure portability issue is going to haunt us nearly forever though, feature expressions or not.

14:08 nDuff: lynaghk: Look at Python's XML library situation.

14:08 devn: I 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:08 lynaghk: cemerick: we tend to have a lot of announcements like "ANN: Awesome Library X 0.1.0. It does A"

14:08 Frozenlock: fwiw, 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:08 nDuff: lynaghk: 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:09 lynaghk: ...and the only one's that actually _good_ (lxml) isn't even in there.

14:09 cemerick: lynaghk: time heals all :-)

14:09 lynaghk: surely you can't be _so_ angsty already!? ;-)

14:09 lynaghk: Frozenlock: thanks for pointing that out

14:10 devn: lol

14:10 sirvaliance: How is the progress for clojure on android?

14:10 lynaghk: cemerick: I think I might just need to bite the bullet and start a blog where I set things straight =P

14:11 cemerick: and/or stir up trouble. The problem is that I prefer just shipping quietly.

14:11 hiredman: oy, you front end guys, endless drama

14:12 devn: sirvaliance: there's a clojure-android google group

14:12 hyPiRion: Oh, talking about multiple libraries and so forth: Is there a number theory library for Clojure?

14:12 lynaghk: hiredman: 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:12 cemerick: I'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:13 devn: https://github.com/pierrel/clojumbertheory

14:13 heh, 4 years old at this point

14:13 lynaghk: cemerick: you know what you do need? A ClojureScript-powered iPhone app to tell you the weather: http://weathertableapp.com/

14:13 cemerick: lynaghk: if only I had an iphone

14:13 oh, I'll give it a roll on my wife's

14:14 * devn buys it

14:14 lynaghk: cemerick: rad =)

14:14 sirvaliance: devn: Thanks, somehow I missed it

14:14 cemerick: lynaghk: your h1's are clipping horizontally

14:14 FF 18

14:14 devn: sirvaliance: np

14:14 hyPiRion: devn: hehe. Well, I suppose it's reasonable to create a new library if the old one's unmantained and not forked.

14:14 lynaghk: cemerick: thanks, I'll forward to the OCD designer.

14:15 hyPiRion: hence all of the hiccup libraries...

14:15 TimMc: cemerick: Don't you know? Clipping is all the rage these days. http://alistapart.com/

14:15 cemerick: lynaghk: you're supposed to make it free, and then monetize via premium features! :-P

14:16 lynaghk: cemerick: "Don't want it to rain? Buy the rain-guard for $1.00 right now!"

14:16 cemerick: TimMc: hum :-/

14:16 devn: hyPiRion: my thought is that there's probably a java library you could wrap

14:16 TimMc: cemerick: I'm kidding, ALA got a lot of flak for that.

14:16 Frozenlock: TimMc: I don't know why, but the fact that I can't see the entire heading makes me mad.

14:16 cemerick: lynaghk: or, think of the affiliate income from showing ads from local bodegas when the storm is coming!

14:16 dnolen: lynaghk: nice

14:16 hyPiRion: devn: Think about the cljs-people.

14:16 but yeah, I know, I know.

14:16 devn: hyPiRion: fair enough

14:17 lynaghk: dnolen: stuff got pretty gnarly in there, code-wise. E.g., it initially used EDN but deserializing 2kB took 8 seconds on the phone

14:17 devn: yeesh

14:17 dnolen: lynaghk: oof

14:17 TimMc: hyPiRion: It's more that (= list []) is a simpler way to write it.

14:17 hyPiRion: It'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:17 lynaghk: dnolen: so we switched to JSON. The DOM walking was pretty slow, so I had to rip out C2 and use .-innerHTML gnarlyness

14:18 cemerick: lynaghk: do you not have JIT the way it's deployed?

14:18 jonasen: dnolen: A new clojurescript release would be nice as people are seeing warnings due to #455

14:18 clojurebot: ClojureScript is https://github.com/clojure/clojurescript

14:18 lynaghk: dnolen: 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:18 devn: hyPiRion: yeah, i did euler problems so long ago in clojure that I never made a lib of them.

14:18 dnolen: lynaghk: I'm not surprised by switching to JSON, nor having to use .-innerHTML depending on what you're doing

14:19 devn: but everyone writes the same stuff. a library would be cool

14:19 lynaghk: cemerick: My understanding is that iOS doesn't allow JIT inside of embedded web views, which is how this app is deployed

14:19 dnolen: jonasen: yes, but it would be nice to confirm 418 first

14:19 hyPiRion: TimMc: I suppose it's okay since I know that all "lists" will be vectors? For a general-purpose algorithm that wouldn't hold.

14:19 cemerick: brutal

14:19 hyPiRion: e.g. (filter foo nil).

14:19 cemerick: lynaghk: but bookmarked/fullscreen sites would get the JIT?

14:19 lynaghk: dnolen: 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:19 dnolen: lynaghk: yeah JIT does make a big difference.

14:20 lynaghk: cemerick: yeah, if you are using Safari then stuff gets JIT'd (in my limited understanding)

14:20 fogus|gone: dnolen: Is it a fair statement to say that conde unifies across parallel universes?

14:20 cemerick: Thank goodness I'm not targeting mobile yet.

14:20 lynaghk: cemerick: yeah, this was our first stab at a consumer-facing AppStore App.

14:21 cemerick: is your browser zoomed? That may be the cause of the clipping.

14:21 cemerick: lynaghk: nope

14:21 do you want a screenshot?

14:21 lynaghk: cemerick: yeah, that'd be great. thanks

14:22 dnolen: `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:22 devn: lynaghk: i think the slide animations in the weather app when selecting days seem a little wonky to me

14:22 `fogus: dnolen: I'm aiming for cool (and for comic book references ;p)

14:23 devn: the header (day of the week) seems to not be attached to the hourly view

14:23 and changes at a slightly different rate

14:23 dnolen: `fogus: I do think of it as permitting the description of possible worlds.

14:24 `fogus: dnolen: I'll take it! Thanks

14:24 cemerick: lynaghk: http://twitpic.com/c1y85h

14:28 hiredman: "dnolen endorses copenhagen interpretation, physicists puzzled as kitchen table coder speaks out"

14:29 my guess as to what fogus is writing

14:30 `fogus: hiredman: I like to think of it as the Infinite Crisis interpretation.

14:34 SurlyFrog: Is 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:35 hyPiRion: SurlyFrog: Oh, you're new to the JVM I see.

14:35 SurlyFrog: hyPiRion: yeppers...

14:36 mattmoss: What, Java doesn't have sizeof? j/k

14:37 hyPiRion: SurlyFrog: not sure if it's possible, to be honest. maybe with some profiler or debugger?

14:37 nDuff: YourKit can do it... kinda.

14:37 To know a real value, you need to figure out what objects that structure holds the only references to

14:37 SurlyFrog: okay….I'll do some experimenting

14:38 ravster: hello all

14:39 SurlyFrog: I wish `time` gave you memory usage as well as execution time.

14:40 nDuff: Wouldn't be a very useful number.

14:40 ...not for Java-based programs, anyhow.

14:40 SurlyFrog: why not?

14:40 craigbro: it COULD be useful if you had nothing else going on, and you GCed before and after

14:40 nDuff: SurlyFrog: Because if you give a Java program more memory, it'll use it to be able to GC less frequently.

14:41 SurlyFrog: 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:41 SurlyFrog: Yep, I'm thinking along the lines of Common Lisp's `time` which gives you information about memory consed, garbage collection, etc.

14:42 I've just always found it helpful when I know I'm going to be processing and building up some big data structure

14:42 nDuff: Ahh -- I was thinking of the shell time builtin.

14:43 * nDuff has an employer who pays for YourKit, and so is set on that count (re: memory profiling).

14:43 SurlyFrog: nDuff: yeah, that wouldn't be very helpful :-)

14:43 nDuff: ...last time I used JRockit, though, it had some decent profiling tools that were free for use in non-production environments.

14:45 SurlyFrog: I 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:46 hiredman: SurlyFrog: is that without or without fiddling with the jvm max heap?

14:46 with

14:47 SurlyFrog: hiredman: without. That's just a plain `lein repl` and then sitting inside the emacs *nrepl* buffer.

14:47 bruceadams: SurlyFrog: if you can use Java serialization, a serialized object can be viewed as bytes--you can get a count of bytes.

14:48 hiredman: SurlyFrog: 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:48 bruceadams: there is some overhead. the serialized object will often be larger than the real live object in memory.

14:48 SurlyFrog: hiredman: oh, good point. Thanks for that.

14:48 craigbro: well, it IS useful to have a cons measurement

14:48 aka, how much consing did I doo

14:48 regardless of wether it is reachable and GCed or not

14:49 hiredman: http://stackoverflow.com/questions/4667483/how-is-the-default-java-heap-size-determined

14:49 SurlyFrog: bruceadams: thanks, I appreciate the idea re. serialization.

14:49 craigbro: the value of eveything, the cost of nothing...

14:49 SurlyFrog: :-)

14:50 craigbro: i earned the nickname Sir Cons Alot in my CL hacking days

14:50 SurlyFrog: craigbro: *that's* funny :-)

14:51 hyPiRion: craigbro: I'm probably worse. "If it's immutable, just call the function again with the same parameters!"

14:51 /s/immutable/pure/

14:51 SurlyFrog: I'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:52 OscarZ_: whats the best resource for checking out how the core functions work etc ?

14:52 hyPiRion: SurlyFrog: The JVM itself has a large memory footprint.

14:53 Frozenlock: SurlyFrog: I wonder how long it will take before MCUs to be replaced with something with more punch (kinda like Raspberry Pi)

14:53 hiredman: hyPiRion: that depends on what you mean by large

14:53 Frozenlock: Or rather, what we normally consider MCUs

14:53 SurlyFrog: Frozenlock: years if not decades. It's still a matter of price/power for many devices

14:54 craigbro: it's a range too

14:54 more power lets tinkerers do more itneresting things

14:54 Frozenlock: ^

14:54 craigbro: but finished commodity products are gonna shoot lower power and price

14:54 SurlyFrog: When 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:54 Frozenlock: But more power also allow more easy code reuse IMO.

14:55 hyPiRion: hiredman: Microprocessor-large.

14:55 craigbro: code reuse is not a big win in those fields IMO

14:55 your operations are trivial

14:55 collect sensor data, munge it, convert it to simple wire protocol, send it upstream etc...

14:57 Frozenlock: craigbro: 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:59 hiredman: there are "jvms" that run in around 32KiB but most of them are not "modern" (read post java 1.5) jvms

15:00 Frozenlock: hiredman: That seems... surreal

15:00 craigbro: picojava!

15:00 TimMc: hyPiRion: No, it works even if `list` is a list.

15:00 Frozenlock: clojure on MCUs?

15:01 craigbro: Frozenlock: 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:02 TimMc: hyPiRion: ##(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:02 lazybot: ⇒ [true true]

15:02 `fogus: dnolen: Is it considered unindiomatico to use multiple bindings in the run* form?

15:02 craigbro: `fogus: can you even?

15:02 dnolen: `fogus: what do you mean? like (run* [a b c] ...) ?

15:02 craigbro: (run* [foo bar] does not work

15:02 dnolen: craigbro: it does

15:03 craigbro: ???

15:03 lazybot: craigbro: How could that be wrong?

15:03 `fogus: dnolen: ya

15:03 craigbro: is that newish?

15:03 sorry, ignore me

15:03 dnolen: craigbro: relatively

15:03 craigbro: ok, mind you I started on ancient core.logic 8^)

15:03 dnolen: `fogus: it's idiomatic yes, map support coming at some point as well

15:03 craigbro: BTW, we got our analysis engine running as an API server on our cluster this week.

15:04 `fogus: craigbro: https://gist.github.com/fogus/4741564

15:04 dnolen: Wonderful. Thank you

15:04 dnolen: craigbro: `fogus: the fundamental form is now (-run option-map [bindings*] goals*)

15:04 craigbro: normanrichards 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:04 dnolen: er

15:04 should be

15:05 ttimvisher: anyone know how to output the result of a cascalog job back to hdfs?

15:05 dnolen: (-run option-map binding-form goals*), where binding-from can currently be a vector of names or a vector names + :as vector name

15:05 ttimvisher: we'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:05 craigbro: and thus in their own threads

15:05 dnolen: craigbro: sweet!

15:05 ttimvisher: we're basically trying to split apart a gigantic file into more manageable chunks to support iteration on our part.

15:06 `fogus: dnolen: With run* taking multiple forms is the use of fresh obviated?

15:06 (binding forms)

15:06 dnolen: `fogus: no, you still need it in subgoals

15:06 craigbro: fresh is still useful

15:06 `fogus: dnolen: Duh. Of course

15:07 hyPiRion: TimMc: yeah, I know that. But not if it's nil. ##(= [] nil)

15:07 lazybot: ⇒ false

15:07 craigbro: dnolen: 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:07 err, I meant 80+ threads

15:07 I would guess 50 or so of them are actually doing the core.logic work

15:08 dnolen: craigbro: whoa

15:09 craigbro: you gonna talk about that at Clojure/West?

15:09 craigbro: we got 64core blades, a dozen or so of them, each of them doing this

15:09 dnolen: I was going to focus more on how we do our data modeling in core.logic

15:10 dnolen: aka, we have a relational model for representing malware observable (files touched, sockets opened, etc...)

15:10 dnolen: and then the same model is used by core.logic to identify behavior/patterns/indicators of compromise

15:10 dnolen: but is also pretty much directly translated into SQL DDL for our database

15:10 dnolen: craigbro: that is amazing

15:11 craigbro: dnolen: and then we use korma to query the DB for our analysts UI and all that.

15:11 hence the title, core.logic and SQL killed my ORM

15:12 kewl thing is, I wrote like three example core.logic programs for our malware analysts

15:12 and they have written the rest

15:12 dnolen: wowzers

15:12 craigbro: mind you, they are a little shakey, abuse conde etc...

15:13 dnolen: heh sure

15:13 craigbro: next step is to put a shim language in there for end users to write programs

15:13 dnolen: still need to optimize conde at some point ...

15:13 craigbro: actually, in almost all cases, they should be using conda

15:13 dnolen: craigbro: well optimized conde could obviate conda

15:13 craigbro: so it's not a big deal. these programs are basically just pattern matching

15:13 dnolen: in the pattern matching case

15:14 TimMc: hyPiRion: Ah! I see.

15:14 craigbro: hmm, maybe I misunderstand the difference between conda and conde then

15:14 llasram: craigbro: Are you one of the threatgrid peeps?

15:14 craigbro: I thought conda stopped on first match

15:14 llasram: yup

15:14 dnolen: craigbro: sorry, that's what I mean about optimized conde

15:14 hiredman: craigbro: which is sort of optimized behaviour if you know other branches in code won't happen

15:14 dnolen: if the heads of the conde clauses have a common pattern we could use that information to know there's only one match

15:15 craigbro: well, we use it for stuff like filling in variables that couldn't be bound

15:15 (conda ((somegoalthatwouldbind LVAR)) (== LVAR "Unknown"))

15:15 well, that last form needs more parens, but you get it

15:15 dnolen: craigbro: i see

15:16 craigbro: the more intensive work is actually not the pattern matching

15:16 but report generation, we make a very nice HTML report, all core.lgic driven. you prolly seen Tim hacking on it 8^)

15:16 dnolen: craigbro: hehe yes

15:16 craigbro: that takes way more time, most of it putting strings together in hiccup

15:17 also, turns out that defrel indexing doesn't buy a whole lot, at least with our data

15:17 dnolen: craigbro: well defrel was lil ol hack, current implementation leaves *much* to be desired.

15:18 craigbro: I meant hat in the general sense tho, not just defrel

15:18 dnolen: craigbro: gotcha

15:18 craigbro: pldb without indexing is just a smidgin slower, totally drowned out by other noise

15:20 normanrichards: craigbro I guess our datasets would have to get MUCH bigger, and the logic much more complex to really gain from indexing

15:20 craigbro: yah, I was just going to try and get a measure of num of observations per sample

15:21 dnolen: craigbro: definitely looking forward to your talk at Clojure/West, this stuff sounds awesome.

15:21 normanrichards: craigbro and the nature of the logic prunes the search tree pretty gast

15:21 fast

15:23 dnolen: normanrichards: craigbro: oh ... wow I didn't realize you all did this https://github.com/threatgrid/pldb

15:23 normanrichards: dnolen https://github.com/orb/pldb/tree/indexing

15:23 that's the branch with indexing

15:23 not really much there

15:23 but it works well

15:24 craigbro: yah, it's what lets use run in multiple threads

15:25 against different DBs

15:30 dnolen: normanrichards: craigbro: I wouldn't be against replacing what core.logic has with what you all have :)

15:31 jonasen: dnolen: 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:31 dnolen: jonasen: thanks, doesn't matter really, either works.

15:32 jonasen: ok

15:32 normanrichards: dnolen 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:33 dnolen: normanrichards: awesome! would remove an eyesore :)

15:34 craigbro: dnolen: yah, totally, I have a CA already, and norman can get one if he doesn't

16:01 gfredericks: Are there any libs that wrap compojure with the assumption that input/output are always JSON?

16:05 jeremyheiler: gfredericks, couldn't you just add middleware that makes that assumption?

16:07 ttimvisher: gfredericks: ymmv, but i've been interested in trying https://github.com/ngrunwald/ring-middleware-format for awhile

16:12 gfredericks: jeremyheiler: no

16:12 because compojure will interpret maps returned from routes as a ring response

16:13 unless there's a thinner alternative to defroutes that I didn't know about

16:14 amalloy: gfredericks: just...wrap the routes?

16:14 the output half is easy; input is trickier

16:16 craigbro: not sure whatis means for inputs to always be json

16:16 that are so many different ways for input to arrive

16:16 as query params, as POST form data, and multipart post etc...

16:18 octagon: hi, 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:19 amalloy: octagon: it's the same macroexpand rules that clojure uses, so test it in a clj repl, not a cljs repl

16:20 octagon: amalloy: for example, (walk/macroexpand-all (case x "foo" bar)) expands to (let* [G__234 x] (case* ...)) in clj

16:21 amalloy: cljs has no case* special form

16:21 amalloy: ah. i guess i'd just look at the source for case, then, in cljs

16:21 octagon: amalloy: also cljs has its own macroexpand-1

16:21 Raynes: $latest ring-middleware-format

16:21 amalloy: but i think it probably expands to cond :P

16:21 lazybot: [ring-middleware-format "0.2.4"] -- https://clojars.org/ring-middleware-format

16:22 octagon: amalloy: 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:23 gfredericks: amalloy: output is easy? I don't think that's true

16:23 octagon: amalloy: 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:23 amalloy: octagon: the import-macros line in src/clj/cljs/core.clj

16:23 is where cond comes from

16:23 octagon: amalloy: excellent, thanks!

16:24 gfredericks: amalloy: if I return {:foo [1 2 3]} from my route, then when it comes out of the defroutes handler it becomes

16:24 {:foo [1 2 3], :status 200, :headers {}, :body ""}

16:25 amalloy: gfredericks: 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:26 GET and POST *might* do something crazy like that, but defroutes certainly doesn't

16:26 aaelony: clojure.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:26 gfredericks: amalloy: I just did it

16:27 amalloy: gfredericks: paste?

16:27 gfredericks: amalloy: https://gist.github.com/fredericksgary/4742078

16:27 oh I see what you mean by GET and POST

16:28 amalloy: gfredericks: GET is doing that

16:28 gfredericks: I didn't know they acted separately

16:28 amalloy: it's in compile-route, which calls render

16:28 gfredericks: how do I use defroutes by itself?

16:28 amalloy: gfredericks: (defroutes a b c) is just (fn [r] (or (a r) (b r) (c r)))

16:28 gfredericks: fascinating

16:28 amalloy: or rather, that's (routes a b c)

16:29 gfredericks: okay so would only have to provide an alternative to GET/POST/etc, and figure out what I mean by "JSON-only input"

16:29 amalloy: yes

16:29 or re-extend the render protocol

16:30 which might or might not work; don't quote me

16:30 * gfredericks runs to tell all his friends what amalloy said

16:31 amalloy: go tell weavejester you thought defroutes was magic. he already regrets writing it, because it just looks so magic

16:32 hiredman: or you could return {:body {:foo bar}} and have a middleware that json encodes body on the way out

16:32 gfredericks: I'm already doing (return-json {:foo bar}) which is about the same amount of work

16:32 this 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:33 tomoj: https://www.refheap.com/paste/43476cfab0a829957d6e1967f

16:33 amalloy: gfredericks: you could try wakeful

16:33 gfredericks: oh that might make sense

16:33 amalloy: if what you want is a json api that magically exposes functions in a certain namespace, that's basically what wakeful is

16:33 tomoj: I thought defroutes was magic

16:33 amalloy: (inc defroutes)

16:33 lazybot: ⇒ 1

16:34 amalloy: all hail defroutes

16:34 tomoj: GET is magic

16:34 llasram: I've used bishop for a few small JSON-exposed service APIs, and been quite happy with it

16:34 gfredericks: is defroutes just some-fn?

16:34 trof: hi guys is this room ok for clojure noobs or theres another room?

16:34 gfredericks: trof: 100% okay

16:34 trof: thx

16:35 amalloy: yeah, GET is prettyheavy

16:35 gfredericks: probably

16:35 gfredericks: oh some-fn + def

16:38 technomancy: llasram: does bishop cover vaguely the same use case as liberator?

16:39 gfredericks: amalloy: I'm trying to get over the fact that wakeful uses thing-id instead of thing/id

16:39 llasram: technomancy: Looks like it. I missed liberator -- will need to check it out and compare

16:40 technomancy: llasram: just wondering because someone asked last night at the seajure meeting

16:40 I've felt like raw compojure doesn't have much to help with varying content-accepts headers

16:40 probably by design

16:44 Frozenlock: I see that some libraries provide docstring for the namespace itself. Is that expected?

16:44 technomancy: Frozenlock: it's a good idea if the namespace isn't obvious at a glance

16:45 Frozenlock: technomancy: (ns robert.hooke "Hooke your functions! ... :D

16:46 gfredericks: is there yet a repl function for pretty-printing a whole namespace with the public vars and docstrings?

16:46 Frozenlock: But how does that reflect for the user? In the repl you 'doc' a namespace?

16:47 amalloy: gfredericks: (clojure.java.shell/sh "cat" filename)?

16:47 gfredericks: if I had such a function I could use it on clojure.repl to check if such a function existed there

16:47 amalloy: without the source code

16:48 anytime I want to explore what a namespace has in it the easiest thing I can think of is browsing to github

16:48 amalloy: gfredericks: (doseq [... (ns-publics ...)] ...)?

16:48 gfredericks: because it's easier than typing all that out :)

16:48 amalloy: someone wrote that and called it dir, apparently in homage to python

16:48 gfredericks: I should send a patch to clojure.repl

16:48 amalloy: dunno where it is, but maybe the name will help you find it

16:49 xeqi: does anyone know who maintains incanter?

16:49 gfredericks: oh apparently this is already in clojure.repl

16:49 amalloy: gfredericks: ...

16:49 technomancy: xeqi: the london clojure group, I think?

16:49 hiredman: xeqi: who says anyone does?

16:49 Frozenlock: gfredericks: do tell

16:49 gfredericks: amalloy: oh nevermind it just prints the var names

16:52 Frozenlock: ,(doc (ffirst (ns-publics 'clojure.core)))

16:52 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol>

16:52 Frozenlock: Damn you macro!

16:53 ToBeReplaced: gfredericks: i think we've all asked for that at some point; so it going into clojure.repl makes sense to me

16:54 callenbot: technomancy: I need a favor of you.

16:55 technomancy: 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:55 ivaraasen: wow, the JVM is quite good at saving cycles wrt. primitives

16:56 ToBeReplaced: i don't know how anyone uses emacs without paredit...

16:56 technomancy: callenbot: 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:56 ToBeReplaced: technomancy: what do you think about prelude?

16:57 callenbot: technomancy: I need something like Clojure in a Box. Is it safe to say I am making this myself?

16:57 technomancy: ToBeReplaced: I think orthogonal functionality should be distributed as independent packages, and we should focus on documenting which packages do what.

16:57 ToBeReplaced: callenbot: i think bbatsov's prelude gets you clojure in a box

16:58 technomancy: callenbot: if you do it, try to structure it in terms of composing orthogonal parts and be clear about what functionality comes from where.

16:58 callenbot: ToBeReplaced: it needs to be fully automagic, this isn't for me, it's for the derpy new people.

16:58 technomancy: that's where the greatest confusion around the starter kit and similar packages comes from

16:58 callenbot: technomancy: I'm a nihilist, I only care about them seeing a repl in a project.

16:58 technomancy: callenbot: designing for derpy new people is what gets you sweet-expressions =\

16:59 ToBeReplaced: callenbot: i think prelude is... it's down to a curl-installer-script

16:59 callenbot: technomancy: we need to make onboarding easier/smoother

16:59 technomancy: I want more normal people using Clojure so I can use it for a living.

16:59 craigbro: what do you do for a living?

17:00 hiredman: optimizing for newbies is a losing game

17:00 callenbot: craigbro: I practice interpretive dance.

17:00 technomancy: callenbot: are they people who would balk at using eclipse?

17:00 callenbot: craigbro: I use Clojure to do the audio and video programming for the dance presentations at the theatre.

17:00 ToBeReplaced: technomancy: 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:00 Frozenlock: gfredericks: If you haven't already what you wanted https://www.refheap.com/paste/11078

17:00 callenbot: technomancy: I don't know that yet.

17:01 craigbro: callenbot: oooohhhhhh

17:01 technomancy: ToBeReplaced: if you think Emacs is just an editor, sure

17:01 craigbro: callenbot: awesome!

17:01 technomancy: some people use it that way

17:01 callenbot: craigbro: I was being a smart ass.

17:01 hiredman: "hey, I am investing all this time and effort in to making a thing people will abandon after two weeks of use"

17:01 callenbot: craigbro: I write code for a living.

17:01 craigbro: callenbot: oh, booooooooring.

17:01 callenbot: craigbro: rule 1: never believe anything I say

17:01 pjstadig: hiredman: ever the optimist

17:01 ToBeReplaced: technomancy: yes; i think it is for many people, and especially the newbie target audience

17:02 callenbot: I don't know how to get instant feedback in Eclipse, only in Emacs.

17:02 I need that instant feedback loop for the newbcakes.

17:02 ToBeReplaced: technomancy: if you advice against the starter kit, do you think putting a note in it would be worthwhile?

17:02 technomancy: ToBeReplaced: 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:02 callenbot: technomancy: I agree.

17:03 octagon: i 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:03 callenbot: technomancy: but I don't know eclipse and can't help them if they're using CCL

17:03 hiredman: ^-

17:03 callenbot: technomancy: and I'm not going to use CCL in a tutorial.

17:03 technomancy: ToBeReplaced: maybe... I haven't decided strongly enough to commit to it

17:03 callenbot: octagon: CCL?

17:03 I'd better check out CCL and get familiar with it then.

17:03 octagon: callenbot: counter-clockwise

17:03 callenbot: octagon: I know what it means, I was asking if he used it.

17:03 ivaraasen: technomancy: starter-kit was of great use to me as a newbie

17:03 octagon: callenbot: yes, i wasn't sure what CCL meant, but yes, that's what i set him up with

17:04 callenbot: octagon: I'll check it out. I now have the problem of potentially using a different editor in a video tutorial than the student.

17:04 octagon: callenbot: he still uses it, but he has another repl in a terminal too

17:05 technomancy: ivaraasen: 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:05 octagon: callenbot: he runs a second repl in a screen session or something

17:05 ToBeReplaced: technomancy: tough problem... i think if you do think about it more, placing a note about it, whichever way you fall, would be helpful

17:05 callenbot: I'm 500 commits away from catching up with isaacs. I have to beat him.

17:06 Frozenlock: technomancy: bad default? The white background?

17:06 technomancy: callenbot: I agree that one of the most difficult things about teaching newbies is putting yourself in their mindset.

17:06 maybe using eclipse would put you in a state of disorientation where you could empathise with them better =)

17:06 callenbot: technomancy: I'm a fucking idiot, I can handle bringing myself down to that.

17:06 craigbro: hehe

17:06 technomancy: Frozenlock: ido off by default, no uniquify, menu bar and tool bar; stuff like that.

17:06 callenbot: technomancy: being an idiot is why I give excellent copy and UX feedback too. Everything confuses me.

17:07 octagon: honestly if someone can't do some examples in eclipse with CCL then they aren't going to like clojure at all anyway

17:07 hiredman: wrong, the miss difficult thing about teaching newbies is getting them to shutup and read the stacktraces

17:07 technomancy: callenbot: it's valuable! =D

17:07 hiredman: most

17:07 callenbot: technomancy: I just need to explain to my employer why being a simpleton is valuable now.

17:07 Frozenlock: eh, I actually believed the menu bar was newbie friendly :/

17:07 but I agree that ido should be enabled by default

17:07 callenbot: technomancy: 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:07 hiredman: closely followed by reading the docs

17:08 callenbot: technomancy: we were doing a bunch of cost of living, legal research etc. We're pretty keen on WA now.

17:08 craigbro: I used to work ona programming language targetting 6th grades and up, to graduate students (the real dummies) NetLogo

17:08 callenbot: I'll visit the moment I get some actual free time.

17:08 technomancy: Frozenlock: seeing a menu bar makes people think they can use it to find everything they need, which is silly. it sets unsound expectations.

17:08 callenbot: cool; hope it works out =)

17:08 ToBeReplaced: hiredman: 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:08 callenbot: technomancy: yeah it's all early stage now but I'm pretty excited.

17:09 hiredman: it is a fact

17:09 programming is 90% reading

17:09 craigbro: hehe

17:09 octagon: you can't trick people into liking clojure via a text editor

17:09 people aren't that dumb

17:10 callenbot: octagon: who suggested that was possible?

17:10 octagon: callenbot: the fascination with tools

17:10 it's inappropriate for new guys i think

17:10 technomancy: octagon: I think he's saying "if you use this; I can help you myself"

17:11 octagon: technomancy: 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:12 callenbot: navigating this code is like trying to make an hourglass out of sand somebody tossed into the wind.

17:12 octagon: I'm just trying to avoid confusion arising from disparity in environment.

17:12 octagon: I'm currently writing and thinking about doing video tutorials.

17:12 octagon: 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:13 ToBeReplaced: dommy, froelich, domicile, domina, crate, hiccups, piccups ... yikes

17:13 callenbot: ToBeReplaced: what's wrong?

17:14 technomancy: "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:15 ToBeReplaced: just 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:15 maybe i just don't understand them... particularly dommy vs. crate

17:15 callenbot: ToBeReplaced: dommy is fast.

17:16 ToBeReplaced: crate is not.

17:16 ignore hiccups and piccups.

17:16 I can't speak to domicile and froelich.

17:16 zerokarmaleft: package-list

17:16 ToBeReplaced: then why have both? is there something crate is better suited for?

17:16 zerokarmaleft: oops

17:16 dnolen: ToBeReplaced: crate appeared very early on, dommy was released like a week ago

17:16 callenbot: ToBeReplaced: it existed before dommy

17:16 Frozenlock: Crate was quickly hacked together way before.

17:16 callenbot: ToBeReplaced: dommy was created because crate was slow.

17:16 craigbro: that reminds me

17:16 so, is there something like hiccup that is faster

17:17 preferably drop in replacement?

17:17 or has there been a speedup in hiccup releases in the last couple months?

17:17 Frozenlock: craigbro: You mean for the jvm?

17:17 mrb_bk: shout out to all the nerds in NYC who will be trapped indoors tonight

17:17 craigbro: yah

17:18 ToBeReplaced: so dommy is the way of the future? they both have commits in the last month, heh

17:18 callenbot: mrb_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:19 technomancy: it's even sunny in seattle today

17:19 ivaraasen: Prismatic are releasing some great stuff

17:19 tmciver: 2 feet of snow by tomorrow in Boston.

17:19 callenbot: ivaraasen: I love the prizzies.

17:19 ivaraasen: supposedly they are releasing Flop soon.

17:19 technomancy: ivaraasen: maybe it's to make up for all the libs they pulled?

17:19 callenbot: ivaraasen: crazy little phids.

17:19 ivaraasen: that would be nice.

17:20 ivaraasen: callenbot: at least they told me so on Twitter, FWIW

17:20 callenbot: technomancy: oh so I'm not crazy, they used to have more libraries on their github?

17:20 technomancy: or do you refer to something else?

17:20 technomancy: callenbot: yeah, they yoinked a bunch a while back when they went into super secret stealth mode or something

17:20 * callenbot rolls eyes

17:22 ivaraasen: technomancy: yeah, they announced Flop like, 5 months ago? so I just wrote my own Flop clone instead

17:23 danielglauser: Does anyone know a generic way to get the name of the current function?

17:23 hiredman: technomancy: no no, that was a "totally different" company with a name that started with a w

17:23 Frozenlock: ivaraasen: my google-fu is failing me... flop?

17:23 hiredman: functions do not inherently have names

17:23 technomancy: hiredman: how silly of me

17:23 hiredman: so there is no way

17:24 functions like other values can be bound to names, but imagine asking the question of other values

17:24 tanzoniteblack: Frozenlock: 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:24 hiredman: Does anyone know a generic way to get the name of a vector?

17:25 danielglauser: what do you want a name for?

17:25 danielglauser: I 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:25 ivaraasen: Frozenlock: basically macros that makes it nicer to work with primitive double arrays

17:25 craigbro: hehe

17:25 Frozenlock: ivaraasen: yeah sure, said like that that's super simple... :P

17:26 ivaraasen: Frozenlock: instead of (areduce ^doubles ws idx ret (double . . . MY BRAIN IS MELTING, you just write (asum ws)

17:26 or for the dot-product, (asum [w ws x xs] (* w x))

17:26 hiredman: danielglauser: what do you want a name for?

17:27 craigbro: danielglauser: there is not guanrateed to be a name BTW

17:27 danielglauser: hiredman: 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:27 craigbro: danielglauser: haha

17:27 danielglauser: craigbro: Ah! Thx

17:27 hiredman: danielglauser: look at the stacktrace?

17:27 craigbro: danielglauser: throw an error, catch it, grep thru the stacktrace 8)

17:27 ivaraasen: Frozenlock: also somewhat easy to do stuff like in-place map (afill!)

17:28 danielglauser: No stack trace but I could throw an exception

17:28 craigbro: not guaranteed to get anything euseful there either

17:28 hiredman: danielglauser: if look at some other tests that do that kind of thing we pass an error message to the helper

17:28 danielglauser: Failing in an is call so that will be somewhat cludgy

17:28 hiredman: (is assertion error-message)

17:29 when assertion fails is also prints out error-message

17:29 danielglauser: hiredman: Yup! Was trying to pass a context in, that's what prompted my original question

17:29 hiredman: Doing that now but still don't know who the caller was

17:30 hiredman: danielglauser: you want to take this sonian channels?

17:32 Bronsa: danielglauser: (-> (Throwable.) .getStackTrace first str (clojure.string/split #"\.invoke") first (clojure.string/replace "$" "/"))

17:32 this should do it

17:32 danielglauser: Bronsa: Awesome, thanks, I'll give that a try

17:33 icey: Anyone here use datomic in their projects?

17:39 nickmbailey: is 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:42 technomancy: nickmbailey: you should be able to alias the task to ["with-profile" "+myprofile" "task"] but there may be a bug preventing that

17:42 nickmbailey: unix alias?

17:43 technomancy: nickmbailey: :aliases {"test" [...]} in project.clj

17:43 nickmbailey: aha!

17:43 Frozenlock: technomancy: 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:43 s/user/users

17:44 technomancy: Frozenlock: I think it's only auto-activated from within plugins?

17:46 Frozenlock: Ah I see, so somehow the plugin must be loaded by the main 'project' before it can do anything.

17:47 I'll go check leiningen for insight, thanks!

17:55 nickmbailey: technomancy: doesn't seem to be any bugs, except that the aliases are recursive

17:55 i'm not sure if thats a bug or expected

17:56 technomancy: yeah, that's the bug

17:56 the alias is supposed to remove itself upon use

17:56 nickmbailey: gotcha

17:57 ravster: hello all

18:03 Frozenlock: ravster: hello you

18:10 Any obvious setbacks to loading every .clj file in a 'plugin' directory?

18:23 callenbot: people, it's friday! TO THE LEFT: <( " <) <( " <) <( " <) PUTCHA HANDS UP: (^"^) (^"^) (^"^) AND GET DOOOOWN: (v' 'v) (v' 'v) (v' 'v)

18:25 ravster: callenbot: :)

18:26 cemerick: 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:30 cemerick: ravster: the friend identity is always in the session map under :cemerick.friend/identity

18:35 xeqi: ravster: what do you think of peridot?

18:41 ravster: xeqi: its good. we're using it to automate integration tests through our api.

18:42 I've probably not explored all of it, but its great for mimicking user interactions.

18:43 Frozenlock: Oh compojure, why are you so magic?

18:43 Magic as in "ahhh what is happening"

18:48 weavejester: Frozenlock: What do you think is magic?

18:49 hyPiRion: The source is out there.

18:49 Frozenlock: hyPiRion: Reading now

18:49 weavejester: Might be a lack of webdev knowledge, I have to wrap my head around the route thing.

18:50 weavejester: Frozenlock: Have you seen: http://www.booleanknot.com/blog/2012/09/18/routing-in-compojure.html ?

18:51 Frozenlock: No I did not, but I'll read it immediately, thanks :)

18:51 Sure has a promising title "Understanding Routing in Compojure"

19:00 thearthur: I'm trying to help a coworker set up lein2 + nrepl

19:01 when she runs nrepl-jack-in the nrepl buffer opens with out th nrepl prompt

19:01 any idea what to google for on this

19:01 nrepl 1.6

19:01 errr 0.1.6

19:01 technomancy: thearthur: emacs 24?

19:01 thearthur: yes,

19:02 24.2

19:02 technomancy: thearthur: any fancy additions like auto-complete?

19:03 thearthur: we removed all packages and then added clojure-mode and nrepl

19:03 added as packages from marmalade

19:03 technomancy: very strange

19:06 thearthur: technomancy: not all the fancy stuff had been properly removed ...

19:09 technomancy: the culprite was (add-hook 'nrepl-mode-hook 'paredit-mode)

19:10 yves`: test

19:12 Frozenlock: test failed with 2 errors

19:12 yves`: Frozenlock: ^^

19:39 cola_zero: thearthur: Can emacs connect to runnning repl server?

19:41 gfredericks: so the latest lein-cljsbuild still has the namespace-out-of-order bug even though cljs had it fixed months og?

19:41 s/og/ago/

19:47 dnolen: gfredericks: it wasn't that long ago, but I thought I fixed it. Perhaps it was more subtle than I thought.

19:48 tanzoniteblack: cola_zero: this is generally done with nrepl

19:48 cola_zero: an emacs mode

19:51 gfredericks: dnolen: has cljsbuild been keeping up to date?

19:52 ravster: xeqi: 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:53 callenbot: I found lein-cljsbuild to be a good manifestation of the Vietnam War.

19:53 I cut and ran pretty quickly.

19:53 warz: is there a popular clojure irc client to build on? i see a few that just wrap java clients.

19:55 cola_zero: tanzoniteblack: yas, I know. I want to know whether 'M-x nrepl' is working or not.

19:56 dnolen: gfredericks: 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:56 tanzoniteblack: cola_zero: guess I don't understand your question then, sorry. That's how I connect to a running repl.

19:56 dnolen: callenbot: it has some rough edges, but it's also come a long way.

19:57 callenbot: dnolen: oh so you've visited Vietnam recently too? yeah it's really improved.

19:57 dnolen: gfredericks: I mean even if it wasn't pulling a more recent CLJS I mean.

19:57 callenbot: *eye roll*

19:57 gfredericks: dnolen: right

19:58 callenbot: dnolen: I tell a lot of people about CLJS. Frontenders, switchers, all kinds.

19:58 dnolen: the conversation ends the moment they ask about source maps.

19:58 dnolen: I can't keep bumping the project if SM aren't in place.

19:59 cola_zero: tanzoniteblack: I asked to thearthur because he has strange behavior of nrepl-jack-in.

20:00 dnolen: callenbot: yes SM will be a big step forward. though I hardly think that will convince everyone.

20:01 callenbot: dnolen: it'll convince the people I know.

20:01 dnolen: but then again, I don't restrict my social circles to the coding avant-garde.

20:01 dnolen: callenbot: sure, it will happen one day.

20:01 callenbot: dnolen: FYI, one of those people I tried to sell ended up going to TypeScript.

20:01 dnolen: in the not too distant future.

20:01 callenbot: more power to them

20:02 xeqi: ravster: you should be able to do (-> (session ..) (content-type "application/json") (visit ...) (visit ...))

20:03 tanzoniteblack: cola_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:03 ravster: xeqi: sweet, tnx

20:03 xeqi: s/visit/request/g

20:04 cola_zero: tanzoniteblack: ah, sorry.

20:04 xeqi: ravster: 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:04 callenbot: dnolen: not really. Clojure needs a dons.

20:05 dnolen: too many modest Clojure Hackers. we need more douchebags telling people how ridiculous awesome we are.

20:05 I, for one, would like to be able to use Clojure in my day job.

20:05 dnolen: callenbot: I don't see why. Clojure has got along fine w/o too many of those so far.

20:05 callenbot: dnolen: not everybody gets to be uber-choosy in their technologies in the context of employment

20:06 dnolen: the best way to help the 99% and make it more likely Clojure will be an allowed option, it has to spread.

20:06 thearthur: cola_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:07 callenbot: dnolen: but it's great that you work in an environment where you can use whatever you fancy.

20:07 dnolen: 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:08 hiredman: callenbot: that is the stupidest most entitled thing I've ever read in #clojure, you must be trolling

20:09 callenbot: hiredman: 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:09 hiredman: I actually have a choice, but I know many people who do not. Pardon me for thinking of circumstances other than my own.

20:13 cola_zero: thearthur: I'm glad to hear that.

20:14 * Frozenlock just spend 20 minutes whipping cream so he could make a coffee with whipped cream on it.

20:15 dnolen: callenbot: 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:16 craigbro: dnolen: would pldb need to work in clojurescript?

20:16 dnolen: craigbro: not at this point - defrel doesn't even work in CLJS yet

20:16 craigbro: ok

20:16 dnolen: craigbro: CLJS version of core.logic is no-frills miniKanren more or less

20:24 callenbot: dnolen: 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:26 dnolen: callenbot: it's pretty different - lots of stuff missing.

20:26 callenbot: that's good to know in case I characterize it incorrectly in future.

20:27 dnolen: callenbot: 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:27 callenbot: I mostly did the CLJS port to see a non-trivial benchmark of CLJS compiler output

20:29 Frozenlock: weavejester: You did a really nice explanation of the routing in compojure, thanks again :)

20:32 Is there compelling reason to use enlive in a one-man project?

20:37 ToBeReplaced: Frozenlock: if you're not sure, just get dirty with it... it'll be time well spent because it reframes the problem a bit

20:38 Frozenlock: So many things to try!

20:57 callenbot: dnolen: I didn't even expect it to exist in CLJS. Pretty awesome idea for a test.

21:02 Frozenlock: #'fn-name is sugar coating for what exactly? Getting the function instead of the symbol?

21:03 tmciver: Frozenlock: same as (var fn-name)

21:03 Frozenlock: ,doc var

21:03 clojurebot: #<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.repl/doc, compiling:(NO_SOURCE_PATH:0)>

21:03 Frozenlock: ,(doc var)

21:03 clojurebot: excusez-moi

21:04 tmciver: &(doc var)

21:04 lazybot: ⇒ "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:04 Frozenlock: clojurebot, why y u hate me?

21:04 clojurebot: deftype is see datatype

21:05 tmciver: Frozenlock: personally, I don't use it much but it's good for accessing a private function for testing.

21:05 Frozenlock: Where is this useful, VS quoting?

21:15 pppaul: i have a testing question

21:16 i 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:16 how would i test something like that?

21:18 Iceland_jack: pppaul: 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:20 pppaul: i 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:24 i guess i am just overwhelmed by how much mocking i think i need… hope it turns out to be different

21:58 dxeh: im assuming with clojure, since it compiles to jvm bytecode, you can use actual java libraries within your clojure application?

21:59 gfredericks: dxeh: that's most of the reason that clojure targets the jvm

21:59 dxeh: well i like that idea, much better than writing boring old java syntax all of the time

21:59 gfredericks: quite

22:02 dxeh: does emacs have clojure support?

22:02 gfredericks: emacs has better support than any other editor/IDE

22:03 dxeh: gfredericks, built in though or do i need an addon

22:03 gfredericks: I think you need clojure-mode

22:04 austinh: I 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:09 That function took me about 15 hours to write.

22:10 Frozenlock: austinh: the shorter it is, the longer it takes :)

22:11 ln2: I'm watching the MIT Lips lectures. Trying to replicate one of the example programs in Clojure and I'm having some difficulty.

22:11 (defn adding [x y] (if (= x 0) y (inc (+ dec x))))

22:11 gfredericks: ln2: what do you want (inc (+ dec x)) to do?

22:12 ln2: This function should give me the sum of x and y.

22:12 gfredericks: ah ha

22:12 so (inc (+ (dec y) x)) then?

22:12 ln2: I'm not sure. What I wrote above is an exact copy (I think) of the lecture program.

22:13 Which was written in Lips however.

22:13 *Lisp

22:13 Frozenlock: Isn't a call to `adding' missing?

22:13 gfredericks: Frozenlock: oh it's s/+/adding/

22:13 ln2: (adding 1 2) throws the error

22:14 gfredericks: try (defn adding [x y] (if (= x 0) y (inc (adding (dec x) y))))

22:14 if that's not the code you're looking at I expect there was a mistake

22:15 ln2: That works!

22:15 Is there some difference between Clojure and Lisp that would break the profs program?

22:15 gfredericks: no I think it's a typo

22:15 Iceland_jack: ln2: What you're referring to as “Lisp” is most certainly Scheme?

22:15 ln2: Nope it's lisp.

22:15 http://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:16 Iceland_jack: Right, using SICP?

22:16 ln2: I "translated" the program to Clojure. Which apparently was a massive failure.

22:16 Your code works gfred! Thank you!

22:16 SICP?

22:16 clojurebot: sicp is http://www.codepoetics.com/wiki/index.php?title=Topics:SICP_in_other_languages:Clojure:Chapter_1

22:16 Iceland_jack: ln2: the thing you're studying

22:17 If you use Lisp to refer to a language (and I personally would not) it generally refers to Common Lisp

22:17 SICP uses Scheme

22:17 ln2: What is SICP? I'm sorry. xD

22:17 Iceland_jack: ln2: SICP is in the url that you yourself posted

22:18 Frozenlock: The name of the course I think

22:18 ln2: Ahh I see.

22:18 gfredericks: ln2: the name of the course is "Structure and Interpretation of Computer Programs"

22:18 ln2: That course is LISP for sure. 1A has Lisp in the name. Unless they changed from day 1 to day 2?

22:19 gfredericks: ln2: lisp is a family of languages

22:19 scheme is "a lisp"<

22:19 Iceland_jack: ln2: Lisp is a family of languages

22:19 ln2: "1A: Overview and Introduction to Lisp"

22:19 gfredericks: scheme is the "dialect" of lisp used in that course

22:19 Iceland_jack: LISP is a 50+ year old language

22:19 Frozenlock: Common Lisp, Scheme, Emacs lisp...

22:19 ln2: Interesting that they wouldn't refer to the actual language used...

22:20 Iceland_jack: ln2: They are using a Lisp, it's called Scheme

22:20 gfredericks: the name "scheme" might not have been so recognizable at the time

22:20 Frozenlock: ln2: iirc they mention _once_ that they are using scheme.

22:20 ln2: I'm really glad I asked a question then because I would have probably missed that not so little detail! Haha

22:21 Thanks. =)

22:21 Frozenlock: ln2: If you use emacs, you could probably just fire IELM and have a lisp repl, without the weird java messages :P

22:23 ln2: I'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:24 * Frozenlock used to mess up 'defn' with 'defun'.

22:25 Frozenlock: ln2: see you are already a step ahead :P

22:25 gfredericks: ln2: 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:25 ln2: Yeah right. xD

22:25 Right! Everything translated perfectly I just subbed -1+ and 1+ for the dec and inc functions.

22:26 gfredericks: ln2: I'm looking at it right now and I think it's just like mine

22:26 staring at the second expression at 20:14

22:28 ln2: Yup. 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:29 gfredericks: oh I just found the right one by coincidence

22:29 at least now it's not a mystery :)

22:29 ln2: I wish they had these lectures at better than 240p. =(

22:31 Frozenlock: For the time it was made, I'm impressed those are available at all.

22:31 With a screen to show the functions!

22:33 ln2: My favorite is the eval apply wizard. Haha

22:36 And 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:36 I wonder if all of these professors played DnD? O.o

22:37 Frozenlock: Is there a way in compojure to get the current URI, other than adding {uri :uri} in the arguments?

22:44 gfredericks: Frozenlock: why would you need another way?

22:48 Frozenlock: I was toying with a menu function that set the 'active' class on where it presently is.

22:56 drewc: Frozenlock: 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:56 Frozenlock: Bootstrap?

22:57 drewc: yup

22:57 I have used it for a while for a number of applications. It is quite great imo.

22:59 amalloy: Frozenlock: 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:59 Frozenlock: drewc: First time using it. I was too lazy to make my own new css :P

23:00 amalloy: for example, Frozenlock, you can do something like https://github.com/4clojure/4clojure/blob/develop/src/foreclojure/ring_utils.clj

23:00 Frozenlock: amalloy: Ah! Probably next on my compojure learning; middleware

23:00 amalloy: not very functional, but convenient and not dangerously stateful

23:02 Frozenlock: Looks perfect! Thanks!

23:03 drewc: Frozenlock: 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:07 Frozenlock: The jquery is a bit of a turnoff however, as I might end up using cljs on this project.

23:15 marcellusthecat: the 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:23 dxeh: i think im going to write a jvm bytecode manipulation lib in clojure :D

23:45 Frozenlock: drewc: I'm amazed at how the layout changes when I resize the window. I must be getting old.

23:51 yedi: can someone who knows korma help me out with this simple starter program: https://gist.github.com/yedi/4743886

23:51 am i missing a step somewhere?

23:55 toast: yedi: try putting a (declare products) above defentity

23:55 yedi: shouldn't the defentity take care of declaring it?

23:56 i tried that and got the same error unfortunately

23:56 toast: yea - I was just looking at my code and that was the only diff I could see

23:57 yedi: yours works correctly?

23:57 hmm, maybe my postgres isn't set up right

23:58 it did say the server started

Logging service provided by n01se.net