#clojure log - Feb 01 2014

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

0:00 akurilin: Unrelated question: is it possible to step through a list two elements at a time, in a rolling fashion? As in, there's an overlap of 1 element between each step? Sounds like partition is a bad fit, but maybe one could use for with two lists, the second with (rest) applied to it

0:00 Not sure I want nesting though.

0:01 Raynes: &(partition 2 1 [1 2 3 4 5 6])

0:01 lazybot: ⇒ ((1 2) (2 3) (3 4) (4 5) (5 6))

0:02 brainproxy: dnolen: could you push mori 0.2.5 to clojars sometime?

0:03 akurilin: Raynes: that would work too, let me try :D

0:10 TEttinger: man... I really have no idea what I'm doing for profiling my clojure.

0:10 JVisualVM reports a massive amount of time (50% total?) devoted to a TCP thread that I think is just checking for java updates.

0:11 I tried Timbre but wasn't really sure how to make it work

0:18 is there some kind of guide to profiling clojure... preferably not using commercial tools?

0:19 I found a few but couldn't really figure out why profile was sometimes enabled, sometimes not?

0:19 orionh: Is it kosher to ask questions about clojurescript here?

0:19 TEttinger: sure, orionh

0:20 orionh: I'm noticing my cljsbuild auto incremental builds jump from subsecond to 7 seconds if I have clj files in the src directory along with cljs files

0:20 this is... unanticipated

0:20 is there a workaround?

0:21 cark: orionh: you're probably refering to it like a cljs file ?

0:21 orionh: the clj file is in the :source-paths vector

0:21 if that's what you mean

0:21 cark: nope, in one of your cls files you have a refer close to it

0:22 cljs

0:22 instead of refer-macros

0:22 orionh: oh, you know, there's no refer, but they use the name namespace, so I'm sure that's it

0:22 cark: at least that's how i sometimes had problems

0:23 orionh: I just saw some libraries doing it, so I assumed it was what I should do

0:23 cark: i think you may do it, but you have to use ...erm let me find out

0:26 orionh: yeah, I just have two files client.cljs and server.clj, both are just empty ns declarations

0:26 and it's a 7 second incremental build

0:27 I can just split it out so instead of src/projectname/files.clj[s] it's client/projectname/file.cljs and server/projectname/file.clj

0:27 but it seems like that's unnecessary, based on what I'm seeing elsewhere

0:27 cark: ah better

0:28 well, that's usually to provide macros for clojurescript

0:28 orionh: fair, but, I mean, both files are blank

0:29 cark: that's for the case you do this : (:require [om.core :as om :include-macros true])

0:29 then it will look for the same file with clj extention

0:29 orionh: right

0:30 okey-dokey, I think I was just confused about how code is organized

0:30 cark: better to separate clinet and server anyways =)

0:30 orionh: is it?

0:30 cark: i don't know, i naturally do it this way

0:31 if you want to share code, you might want to have a look at cljx

0:31 orionh: I thought cljx was a crazy hack, I just assumed someone would figure out another client/server story for clojure

0:32 cark: i don't know, there are quite a few people using it

0:35 orionh: thanks for your help

0:48 seangrov`: I don't suppose with-redefs is going to work very well with go blocks

0:55 It almost does, but the original definitions never get put back

0:58 hiredman: seangrov`: if they don't, that is a bug

0:59 the original definitions are put back in a finally, an go blocks are supposed to run finallys

0:59 seangrov`: hiredman: Good, good. I'll track it down then

0:59 Definitely somewhere in my code

1:04 hiredman: This look like the right usage? https://www.refheap.com/5015fd931bc3d0f6e30cafec9

1:05 This is in cljs by the way, possibly it's something funky

1:05 "Replay block finished" is logged to the console, but the original defs are never run

1:08 hiredman: seangrov`: clojurescript, all bets are off

1:08 cark: there are no vars in clojurescript

1:08 * seangrov` sighs

1:09 cark: which is seriously annoying

1:09 tho binding works

1:10 but that might explain some bugs

1:10 hiredman: I imagine with-redefs and binding are synonymous in clojurescript

1:11 cark: yes but core.async is full of trickery afaik

1:11 might be trying to do something that's a noop or something

1:15 seangrov`: bbloom: Anything ever come of http://dev.clojure.org/display/design/Dynamic+Binding ?

1:33 akurilin: Raynes: anyways, yes, that was pretty cool and worked :)

2:00 elarson: would someone mind shedding some light on why I get always get nil with this multimethod? https://www.refheap.com/30874

2:04 cark: println returns nil ?

2:05 elarson: I'll try removing my debugging statements

2:06 no change. I updated the essential code on the paste here

2:06 https://www.refheap.com/30874

2:07 cark: there are still print statements in your methods

2:07 hiredman: cark: look at the dispatch fn arity

2:08 elarson: cark: sorry if I wasn't very clear. my issue is that dispatch function seems to always return nil

2:08 hiredman: elarson: add (def come-out nil)

2:09 cark: the first version has correct arity

2:09 elarson: hiredman: just a def ? I do have a defmethod come-out nil for debugging

2:09 cark: the problem is the print statements

2:09 you're returning nothing from your call

2:09 elarson: cark: even in the latest version of the paste?

2:10 hiredman: cark: but if he isn't getting exceptions with the second, it is likely his real dispatch function is never called

2:10 elarson: the come-out-result only wraps a cond

2:10 hiredman: elarson: I assume you are testing this in repl?

2:10 elarson: hiredman: that seems to be what I've been seeing b/c after adding print statements in my dispatch function I never saw the output

2:10 cark: hiredman: but look how he calls it, there are 2 parameters

2:10 elarson: hiredman: yes

2:11 hiredman: elarson: defmulti acts like defonce, so you need to clear it out to redefine it with a new dispatch function

2:11 cark: ah indeed

2:11 elarson: ah ok

2:11 ah ok

2:12 cark: first version is best though, but it will return nil no matter what

2:12 elarson: then I did get the arity issue which I assume is b/c my dispatch function only takes on parameter

2:12 hiredman: yep

2:12 elarson: awesome

2:13 thanks for the help!

2:13 do you guys have any suggestions as to how to avoid the repl going stale?

2:13 hiredman: I will often put a (def … nil) above a defmulti

2:14 elarson: hiredman: how did you find out that the defmulti needed the def nil?

2:14 * elarson will forever say the nick of "hiredman" when asked the very same question ;)

2:15 hiredman: because I am on the mailing list and saw the discusion that lead to it doing that

2:15 and subsequently have cursed the day about once a month

2:15 elarson: ok, cool. wanted to make sure I didn't miss something obvious in the docs or anything

2:16 hiredman: yeah, amazing the docs still don't mention it

2:16 elarson: it is not the most obvious IMO

2:16 hiredman: it was changed years ago

2:17 it was changed to be that way because people were complaining that if you had you defmethods spread across different files, if you reloaded the file with the defmulti, you would lose the methods unless you also reloaded those files

2:18 elarson: ah I could see that being an issue

2:18 hiredman: http://dev.clojure.org/jira/browse/CLJ-900

2:18 hah

2:18 elarson: but seeing as I'm new here I'll complain really loudly as though I know better :P

2:40 amalloy: a popular pastime, elarson

3:08 luxbock: hi, what's wrong with the follwing: https://gist.github.com/8749459 ?

3:09 hiredman: you don't know how to write/use macros

3:09 luxbock: this is true

3:09 hiredman: you want apply, not a macro anyway

3:09 luxbock: ah right, think I've made this mistake before

3:41 mkuitune: Good weekend! Is anyone using Clojure with OpenGL and perhaps some font support to boot?

3:41 I'm mainly interested in setting up a geometry/graphics workbench for myself (in Clojure of course, heh)

3:42 I have 0 experience in Java so if anyone has any working setup I'd be glad if you could share tips

3:43 Note: I have background in realtime graphics, not just used Java at all

3:43 Trying to figure out the leat head-achy way to get an OpenGL context running

3:44 Is LWJGL a good first step?

3:44 ... although this is a bit discouraging https://github.com/rogerallen/hello_lwjgl

3:44 john2x: other than restarting the repl, is there a way to refresh dependencies? e.g. I already have the repl running with a bunch of stuff def'd, but I forgot to add a dependency to project.clj..

3:45 or a typo in the dep's version

3:52 hiredman: https://github.com/pallet/alembic

3:55 fitzoh: mkuitune: I have no idea, but I feel like that big of a question/intro at least deserves a response :p

3:55 mkuitune: fitzoh: :D

3:57 cark: hum >>= is bind, what was the name of >> again ?

3:59 john2x: hiredman: cool, thanks

4:18 cark: ,(require 'clojure.core.async :as async)

4:18 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: async in this context, compiling:(NO_SOURCE_PATH:0:0)>

4:18 cark: ,(require 'clojure.core.async :as 'async)

4:18 clojurebot: #<FileNotFoundException java.io.FileNotFoundException: Could not locate clojure/core/async__init.class or clojure/core/async.clj on classpath: >

4:19 cark: https://gist.github.com/cark/8749982

4:20 why would this block instead of printing nil ?

4:20 isn't async/map supposed to close its channel when there is nothing left ?

4:20 since there are no channels, there is nothing left

4:29 TEttinger: geez... apparently, the ^"[[F" type hint for 2D float arrays does not help in the slightest with performance. reflection on the many 2D aget calls I made was taking up about half the time used by my program.

4:30 make that about 70%, just checked related methods

4:31 hiredman: there are no 2d arrays in java, [[F is an array of arrays

4:31 TEttinger: I removed it, converted everything to flat arrays, and used ^floats

4:31 hiredman: TEttinger: you where most likely typehinting the wrong places

4:31 TEttinger: yeah

4:32 I was typehinting before agets

4:32 err, the arrays in an aget

4:32 hiredman: type hinting pulling the float array out of the array of arrays, instead of type hinting the actual pulling out of floats

4:33 TEttinger: eh?

4:33 (aget ^"[[F" floatfloat-arr x y)

4:34 hiredman: ,(let [^"[[F" ff … f (aget ff 0)] (+ (aget f 0) 1.0))

4:34 TEttinger: (aget floatfloat-arr x y) would warn on reflection

4:34 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ? in this context, compiling:(NO_SOURCE_PATH:0:0)>

4:35 hiredman: oh

4:35 TEttinger: anyway, I didn't know that type hints in strings needed reflection but wouldn't warn on it

4:35 hiredman: well, there you go, using multiple indices like that is not going to be inlined properly

4:36 TEttinger: so you think it was just the multiple indices?

4:36 hiredman: yes

4:36 TEttinger: interesting

4:37 you're probably right, I wonder if this affects vectorz-clj at all

4:37 hiredman: anything more than one in a call like that will be reflective

4:38 if you have one index (and it is not used in a higher order way) aget is inlined as a static method call, then the static method call can be replaced by a bytecode intrinsic in the compiler

4:40 TEttinger: hiredman, so do you think that the arrays of arrays would be slower in java (not clojure I mean) than 1D arrays?

4:41 is it a JVM thing that makes 1D array access faster?

4:41 hiredman: no, just the way you accessed them in clojure was slow

4:42 well, actually, 1d might be faster regardless, but you would have to benchmark

4:43 TEttinger: thanks hiredman, that explains a lot

4:45 hiredman: if you look at the source for aget, it has a inline for 1 index, you can look for similar things on other functions

5:01 logic_prog: what is a good cljs library for rendering excel like spread sheets in cljs?

5:15 Sorella: logic_prog, not quite for rendering, but: https://github.com/tailrecursion/javelin

5:15 logic_prog: ah, reactive clojure

5:51 nez: Hi

6:19 sobel: is Julia lisp?

6:20 jack_rabbit: link?

6:20 sobel: http://julialang.org/

6:21 jack_rabbit: No, that's not lisp.

6:22 sobel: because it can call into C/Python?

6:22 jack_rabbit: not at all.

6:23 It's because it's not made of forms, or s-expressions.

6:23 Denoted by parenthesis.

6:24 sobel: oops, i meant to ask, is Julia a lisp

6:24 jack_rabbit: You did. And it's not.

6:24 sobel: i asked a slightly different question

6:24 jack_rabbit: The Julia language is not a lisp.

6:48 AeroNotix: The Python language is not a lisp.

6:49 coffeeyesplease: Hi all, quite newb here.

6:49 AeroNotix: Aren't we all

6:49 coffeeyesplease: just started learning clojure and got myself a copy of clojure cookbook (early release)

6:50 :)

6:50 AeroNotix: ok

6:50 coffeeyesplease: but I was wondering if anyone has tips (links) for some other resources for an introduction to clojure

6:51 scottj_: coffeeyesplease: clojurebook.com is the most frequently recommended resource.

6:51 AeroNotix: coffeeyesplease: 4clojure gives a set of good functional programming problems

6:51 you can also see how other people implemented the answers

6:51 coffeeyesplease: (for people not only unfamiliar with clojure, but with functional programming as a whole)

6:53 AeroNotix: coffeeyesplease: "Purely Functional Datastructures" is pretty mindblowing

6:53 but somewhat academic

6:53 Like i said, though, 4clojure is pretty good for functional programming problem

6:53 s

6:53 coffeeyesplease: there's also clojure-koans, interactive tutorial to walk through some basic clojuer features.

6:54 rue_: Hm. Is vim-clojure-static + vim-fireplace still the way to go for heathens?

6:54 AeroNotix: It also uses lein, which is never too early to start using

6:54 coffeeyesplease: @ AeroNotix I was hoping of getting a more hands experience before getting the "serious stuff" :)

6:54 checking out the 4clojure site, looks quite promising

6:55 xiaq: hi there, is there a successor to clojuredocs.org? it seems stuck at 1.3.0 forever...

6:57 scottj_: xiaq: I don't think so.

6:59 xiaq: scottj: :(

7:14 riz_: hi

7:14 jack_rabbit: hi

7:14 insamniac: sup

7:14 riz_: 4:11 am here!

7:15 can't sleep

7:15 insamniac: a/s/l?

7:15 riz_: let me guess, you're a '90s child

7:15 or possibly an 80s child

7:15 insamniac: Hah

7:15 riz_: a male

7:15 insamniac: '81

7:15 riz_: me too

7:16 did your humble internet beginnings originate on AOL?

7:16 insamniac: Of course.

7:16 insamniac@aol.com lulz

7:16 riz_: haha

7:17 i honestly don't remember my "screen name"

7:17 insamniac: You in California?

7:17 riz_: norther

7:17 BC

7:17 insamniac: o

7:18 riz_: i'm starting out with clojure

7:18 insamniac: Yeah me too. It's been rough.

7:18 riz_: it's very painful

7:19 what are you adept with?

7:19 *in?

7:19 insamniac: I dunno, I'm not great at anything. I do a lot of python and groovy for work.

7:19 riz_: ah ok

7:19 insamniac: some XSLT and javascript.

7:19 riz_: i do c# and .net

7:19 insamniac: lots of bash

7:19 Nothing close to a lisp though.

7:19 riz_: me neither

7:20 nothing close to functional, except javascript

7:20 insamniac: Yeah, same.

7:20 riz_: although c# does have lambda expressions

7:20 so maybe you have come across the answer to this question

7:21 insamniac: And there's no way anyone at my work would want to use clojure. I could barely get them to adopt groovy as a replacement for simple java stuff.

7:21 riz_: is clojure suitable for large scale projects?

7:21 will it produce maintainable code?

7:21 insamniac: well Rich Hickey says that's all he works on

7:22 riz_: I dunno much about him

7:22 insamniac: I think that's kinda the point of it

7:22 riz_: does he work on large scale?

7:22 insamniac: yeah, he said that in one of the videos i watched

7:22 riz_: well i know that clojure reduces line count

7:22 insamniac: The hard part is having people that can maintain it because no one knows clojure!

7:22 riz_: but it's not necessarily the same as being maintainable over 5-10 years

7:23 I think that will change if people can be convinced that it's sustainable

7:23 like doing javascript on serverside

7:23 insamniac: I have a lot of books and have watched a lot of talks, and reusable/maintainable is a big selling point.

7:23 riz_: hmmm

7:24 because from the examples and tutorials I've worked with, I find it difficult to see that it would be maintainable over long periods of time

7:24 insamniac: But there are lots of smart people in this channel that can discuss this sort of thing way more in depth than me.

7:24 riz_: but that's fine because I'm a beginner

7:24 insamniac: Yeah I still feel like I'm doing everything wrong.

7:25 riz_: also the other thing is taht I'm not that familiar with the toolset

7:25 insamniac: even just trying to write simple utilities to replace things I've already done in other languages

7:25 riz_: especially debugging

7:25 insamniac: have you seen light table?

7:25 riz_: yeah i use it for clojure

7:25 and i find insta repl handy

7:26 insamniac: I've just been using vim with xterm windows all over the place

7:26 riz_: i'm just not as productive with REPL when trying to debug something

7:27 I'm used to putting breakpoints and hovering over variables

7:27 but maybe it's because it's such a huge paradigm shift too

7:27 maybe in clojure world there's no breakpoints

7:28 insamniac: Yeah.. i mean since stuff isn't supposed to run sequentially

7:28 I don't even have the vocabulary to talk about this stuff without sounding retarded.

7:28 riz_: lol

7:29 have you ever used emacs?

7:29 insamniac: I remember using visual studio back when i started like 9 years ago... I loved it.

7:29 nah

7:29 riz_: yeah well if you use visual studio now, it's fucking mind blowing

7:29 sobel: debugging declarative/functional code is just different. i hit the same wall when i figured out i would never get the "debugger" type view or single step through how my query is executed

7:29 (in sql)

7:29 insamniac: cemerick is one of the smart guys

7:30 seize him

7:30 riz_: commencing seizure

7:31 insamniac: i just use vim now because of my job.. i get put in situations lots of times where all I have is putty/ssh

7:31 riz_: yeah i did vim back in school

7:31 I gravitated towards it

7:32 I tried emacs, it was too complicated for me at the time

7:32 so was lisp lol

7:32 I didn't see the point

7:32 insamniac: If you see someone who always uses an IDE, and then they don't have it... they're lost

7:32 I didn't want to be like that

7:32 riz_: true

7:32 insamniac: I should probably use light table at least though

7:33 Really I need to start coding, and stop talking about clojure!

7:33 riz_: I've had situations where I've had to just work with a simple editor and command line

7:33 insamniac: I've been doing too much video watching and book reading... hoping to have some Aha! moment

7:33 riz_: lol

7:34 have you gone through koans?

7:34 insamniac: Even though I know the only way it's gonna happen is if i start coding

7:34 I've done a lot of 4clojure problems.

7:34 I think koans are more involved?

7:34 riz_: i haven't done 4clojure

7:34 but koans get insane later on

7:34 you'll get through first few easily

7:34 but the good thing is that they have youtube videos on each one

7:35 because they stop becoming self-explanatory after a few

7:35 I think the last one I did was 15 or something

7:35 insamniac: I need a computer that has no internet access so i stop getting distracted

7:35 riz_: and then I joined school!

7:35 insamniac: you do clojurekoans.com?

7:36 riz_: yep

7:36 koans are awesome

7:36 they keep you going

7:36 insamniac: 4clojure is cool because you can see other users' answers after you finish... but it's crazy how many ways there are to do the same exact thing

7:37 that makes me think it would be really tough working with other peoples code..

7:37 riz_: i'll try it when i have some free time next

7:37 hmmm

7:37 insamniac: and makes me think i'm always doing things wrong

7:37 riz_: unless you're well versed in it

7:37 I think it's like starting out fresh to programming with c++

7:37 insamniac: yeah i think i just need to keep at it.. keep reading and writing lispy stuff

7:38 riz_: it's a mindfuck for first 6 months

7:38 yeah u kno what I think even if you don't end up using it, it'll make you a better imperative programmer

7:39 already I like to think functionally when doing oop stuff now

7:39 anyway, i hope you're already doing your first koan

7:39 insamniac: almost!

7:40 riz_: lein is pretty nice

7:41 insamniac: We shall contemplate truth by testing reality, via equality

7:41 I already like this

7:41 sobel: interesting... the Koans site is published by 8th Light

7:42 i work with a team that we more or less poached from 8th

7:42 but they are all rubyists

7:42 RickInAtlanta: is 8th light Bob Martin's company?

7:43 insamniac: RickInAtlanta: are you the Rick that's organizing the Parkour talk?

7:43 riz_: hi sobel

7:44 Parkour the sport?

7:44 insamniac: heh

7:44 RickInAtlanta: Parkour the map reduce library

7:44 insamniac: can't we do both?

7:44 riz_: oh ok hadn't heard of it

7:44 parkour while doing parkour

7:44 RickInAtlanta: that is llarsam, he is the co-organizer of the atlanta group.

7:45 insamniac: I wish there was a high speed train connecting augusta to atlanta.

7:45 RickInAtlanta: he is doing the presentation, and I believe he is also the author of parkour

7:46 Just as well you missed the meeting last month

7:46 insamniac: no good?

7:46 RickInAtlanta: The presenter missed it, he had an emergency come up

7:46 insamniac: oh, that would have sucked

7:46 RickInAtlanta: I thought of you... glad he didn't drive up from augusta

7:47 insamniac: Heh

7:47 RickInAtlanta: Are you going to Dev Nexus? Stuart Sierra is going to be doing a couple of sessions there

7:47 insamniac: Yeah I saw that.

7:47 And yeah, I got my boss to bless off on it.

7:48 RickInAtlanta: http://www.meetup.com/Atl-Clj/events/163247862/

7:48 insamniac: Definitely gonna hit all the clojure stuff. I'm interested in the pair programming thing too, since I've never encountered that in the wild.

7:50 Good stuff. That's one I will be able to attend.

7:50 I might even try to come up for Parkour, since I might be starting on a hadoop project here shortly.

7:51 jdt: anybody up?

7:51 insamniac: It's just hard to do things on weeknights 'cause I go to work at 4:30 AM

7:51 RickInAtlanta: llasrm aka Marshall, is a good person to talk to. He uses haddop every day. I know he has used cascading in the past.

7:51 insamniac: jdt: whatup

7:52 riz_: a hadoop project?

7:52 jdt: Anybody now how to bind *data-readers* in ~/.lein/profiles.clj so that spyscope will work?

7:52 riz_: you work for a large scale company?

7:52 insamniac: I work for a defense contractor

7:52 jdt: the current clojure/lein doesn't let me use spyscope in lein repls

7:52 insamniac: :(

7:52 jdt: it's not finding data-readers.clj in the ~/.m2/...spyscope.jar I guess

7:53 riz_: I've never had the opportunity to deal with something that scale

7:53 *of

7:54 insamniac: Me neither.. kind of sucks because i can't really try stuff out at home..

7:54 riz_: haha yeah true

7:54 insamniac: i mean i have a single node hadoop cluster VM..

7:54 plus we do things on closed networks for the Army.. it's really a pain

7:55 having no access to the outside world is just getting trickier and trickier because everything expects you to be able to pull down dependencies from all around the internets

7:56 RickInAtlanta: if you have no experience with hadoop and want a gentle introduction, the udacity course is pretty good (and free)

7:56 insamniac: a guy on my team is doing the cloudera training next week.. $3k for 4 days

7:57 I had no idea training cost so much... since absurd.

7:57 er

7:57 seems

7:59 riz_: ya i don't see the value of going to train at a seminar vs. buying a vid subscription

7:59 or doing something like udacity

8:00 except maybe you get to network with other professionals

8:00 insamniac: Yeah, networking

8:00 something I don't do at all..

8:01 well I guess this counts as networking

8:01 but i have extremely limited interaction with other programmers in person.

8:03 riz_: yeah there's not much need to

8:04 anymore...

8:04 insamniac: Well, I would have liked to work with someone much better than me at some point in the last 9 years.

8:05 But it's like everywhere I go, I know the most... even though I don't know that much.

8:05 That's why I come here, because this channel makes me feel really dumb.

8:06 Keeps me humble, because at work they think I know everything.

8:08 riz_: reading tech news keeps me humble

8:09 makes me feel everybody else has a startup and mad coding skillz

8:09 insamniac: or stackoverflow

8:10 on to koan 2!

8:11 RickInAtlanta: woot

8:11 daGrevis: What's the difference between println and prn?

8:12 yakcc: hi

8:13 insamniac: daGrevis: println appends a newline

8:13 daGrevis: I think there's a difference between prn and print though

8:14 RickInAtlanta: prn appends new line too

8:14 ,(doc prn)

8:14 clojurebot: "([& more]); Same as pr followed by (newline). Observes *flush-on-newline*"

8:14 insamniac: daGrevis: oh yeah pr doesn't

8:14 RickInAtlanta: ,(doc pr)

8:14 clojurebot: "([] [x] [x & more]); Prints the object(s) to the output stream that is the current value of *out*. Prints the object(s), separated by spaces if there is more than one. By default, pr and prn print in a way that objects can be read by the reader"

8:15 insamniac: ,(doc print)

8:15 clojurebot: "([& more]); Prints the object(s) to the output stream that is the current value of *out*. print and println produce output for human consumption."

8:15 RickInAtlanta: (prn "x")

8:15 ,(prn "x")

8:15 clojurebot: "x"\n

8:15 RickInAtlanta: ,(println "x")

8:15 clojurebot: x\n

8:19 sobel: i'm about to find out how well clojure+jdbc+postgresql array types play together

8:21 daGrevis: this is funny https://github.com/rplevy/swiss-arrows

8:26 riz_: ok i might sleep a few winks

8:26 see you later insamniac and good luck with koans

8:33 michaniskin: swiss-arrows are great

8:33 RickInAtlanta: what are they?

8:34 michaniskin: extension of the -> and ->> threading macros basically

8:34 RickInAtlanta: oh, cool

8:34 michaniskin: like -<> for instance

8:34 with -> you can only thread things through the first arg "hole"

8:34 RickInAtlanta: my first thought when I clicked on the link was that it was ascii art

8:34 michaniskin: but if you want like

8:35 RickInAtlanta: then the examples didn't seem to fit that

8:35 michaniskin: (-> [1 2] (conj 3) (map inc)) you're in trouble

8:35 because map takes the collection in the last arghole

8:35 with -<> you can do like

8:36 (-<> [1 2] (conj 3) (map inc <>))

8:36 RickInAtlanta: interesting

8:36 michaniskin: where <> is the placeholder for where you want it to thread

8:36 but there are all kinds of interesting threading ideas in there beyond that

8:37 rue_: Eek, here I hoped we were finally rid of inscrutable symbols

8:37 borkdude: isn't -<> very similar to as-> then?

8:37 michaniskin: i like inscrutible symbols

8:38 gfredericks: borkdude: yes

8:38 borkdude: michaniskin: I use <> as the name whenever I use as->

8:38 borkdude: ,(as-> [1 2] x (conj x 3) (map inc x))

8:38 clojurebot: (2 3 4)

8:38 borkdude: I would have turned around the name and expression in as-> if I would have chosen it though

8:39 michaniskin: borkdude: me too

8:39 borkdude: arghole... hehe

8:39 michaniskin: borkdude: i'd probably have done (as-> [x [1 2]] ...)

8:39 expez: Why doesn't this short Liberator test do what I expect? https://gist.github.com/expez/8752384

8:40 michaniskin: borkdude: one thing that i don't 100% like about clojure idioms is the "false tree"

8:40 like i kind of prefer scheme style let and cond, where binding pairs are enclosed in parens

8:40 and so on

8:41 especially when you have to make macros around them

8:41 it simplifies the parsing phase of the macro

8:42 borkdude: michaniskin let binding syntax? what would (as-> [a 1, b 2] (inc a) (inc b) (inc a)) mean then? ;)

8:42 michaniskin: also getting editors to pprint false-tree expressions nicely is complicated

8:42 borkdude: wow 707 users here

8:43 it's growing steadily

8:43 michaniskin: borkdude: lol that seems insane

8:43 daGrevis: hello! how could I make this work faster using all cores? http://vpaste.net/z2Ao1

8:44 thesaskwatch: hello

8:44 where can I find some guid on how to use paredit?

8:44 michaniskin: daGrevis: reducers?

8:44 borkdude: I heard in the mostly lazy podcast about some 'new' web framework like pedestal, luminus, starting with the letter k, but forgot it's name. What was it?

8:45 thesaskwatch google

8:45 RickInAtlanta: the paredit cheatsheet is good http://www.emacswiki.org/emacs/PareditCheatsheet

8:45 daGrevis: michaniskin, I tried to wrap it into future and then deref but it didn't help

8:45 borkdude: thesaskwatch the paredit cheat sheet is particularly helpful

8:45 michaniskin: borkdude: do you mean Caribou?

8:45 thesaskwatch: borkdude: haven't found anything good, I did google first

8:45 borkdude: michaniskin probably yeah

8:46 michaniskin you know it?

8:46 thesaskwatch: RickInAtlanta: thanks

8:46 michaniskin: daGrevis: with regular lazy seqs (which filter, map, etc use) you process items sequentially. with reducers you can process them in parallel

8:47 clojurebot: reducers

8:47 clojurebot: reducers are http://clojure.com/blog/2012/05/08/reducers-a-library-and-model-for-collection-processing.html

8:47 daGrevis: okay, thanks

8:48 michaniskin: borkdude: i've looked at it. i haven't used it though

8:49 borkdude: michaniskin yet another one I guess

8:49 michaniskin: borkdude: it appears to be a framework in the spirit of Ruby on Rails, more or less

8:50 RickInAtlanta: I keep planning to look at the hoplon web framework

8:51 borkdude: RickInAtlanta it's amazing if you like Excel (:P)

8:51 michaniskin: RickInAtlanta: join us in #hoplon if you have any hoplon issues :)

8:51 just released 5.0.0 yesterday, so you're at a good place to start!

8:51 borkdude: version 5 already?

8:52 michaniskin: i want to keep the versions semantic as faithfully as possible, so i incr when necessary

8:52 so if anything that worked in aprevious version could possibly not work in the new version i'll incr the major number

8:53 borkdude: yeah ok

8:53 michaniskin: the last change was to the build process, which is (imho) part of the program, so i did it

8:53 even tho the actual project source is backwards compatible

8:53 dsrx: i think semver allows breaking changes on minor versions until 1.0.0

8:54 borkdude: michaniskin so does (a :style some-cell) work now? ;)

8:54 michaniskin: borkdude: not yet :) it could go in for 5.1.0 though

8:55 borkdude: hihi

8:55 michaniskin: we'd keep the existing stuff too

8:55 should i do it?

8:55 borkdude: michaniskin up to you, I am not yet a seasoned hoplon user, so who am I to decide ;)

8:56 michaniskin: it's a little complicated because of the way properties on DOM elements work, especially style

8:56 borkdude: michaniskin don't worry about it then

8:56 michaniskin: like should it be a map? probably

8:57 (a :style (cell= {:background-color color-cell})) for example

8:58 borkdude: michaniskin would that only update one attribute of the style attribute and leave the rest of it intact?

8:58 michaniskin: it would be updating the style property instead of the attribute

8:58 elem.style.backgroundColor = "red"

8:58 borkdude: michaniskin I think that's cool. And maybe just (cell= some-cell) would update the whole attribute?

8:59 neh

8:59 I like yours

8:59 michaniskin: i suppose if the cell contained a string it could update the attr, too

8:59 borkdude: it's the same as now, except with the ommission of a :do-attr right

8:59 michaniskin: yes

8:59 yeah you're right

9:00 ok it's going in there :)

9:01 sritchie: ambrosebs: hey dude - what do you think it would take to get schema properly emitting core.typed annotations?

9:02 ambrosebs: we've gone pretty bonkers with schema, but I want to start using your stuff too

9:03 ambrosebs: sritchie: there's this wip https://github.com/circleci/schema-typer

9:04 sritchie: nice

9:06 cool, I'll look into it

9:07 michaniskin: borkdude: speaking of Excel, alan's bacwn datalog app demonstrates the advantages of spreadsheet consistency stuff

9:07 it would be hard or impossible to do that managing the order of evaluation explicitly

9:12 sobel: anyone handy with jdbc? i'm trying to figure out if there's an execute many or if i need to just use map

9:13 sritchie: man, I've been hitting the circular dependencies thing lately...

9:14 I thought I had a good webapp structure figure out, but it's pretty rough to avoid circular deps when two models in a webapp depend on one another

9:14 you almost need a namespace for each model, then a namespace for every edge

9:15 sobel: why do the models depend on eachother?

9:16 sritchie: so, say you have a User and an EventEntry - an event entry has a user ID,

9:16 so that's one way.

9:16 but then when you delete a user,

9:16 you need to remove that user from all event entries

9:16 (since an event entry may have many users)

9:16 so user needs to call the "remove-user!" function back in the evententry namespace

9:16 sobel: now, I could have the caller just handle the coordination

9:17 (do (delete-user) (delete-event-entry))

9:17 but to hide that, I need an edge namespace, really

9:17 john2x: anybody tried `lein eastwood`? I'm wondering if I can trigger it from within a repl? So it doesn't have to start up the jvm every time.

9:17 sritchie: that can make that transactional

9:17 sobel: 2 models for 2 tables?

9:18 sritchie: sobel: a model for each table, right

9:18 sobel: it sounds like you really have 1 domain and that's why your models depend on eachother

9:18 sritchie: well, doc type (this is CouchDB)

9:18 what do you mean by 1 domain

9:19 michaniskin: sritchie: seems like you need a "manager" to coordinate access to tightly coupled but separate resources

9:19 sobel: User and EventEntry are related

9:19 sritchie: yeah, so that's the "edge" namespace, I guess

9:19 so you guys are recommending just embracing that, and for coordination between resources,

9:19 sobel: what's the practical use case? do you want events destroyed as a necessary side-effect of deleting a user?

9:19 sritchie: moving any functions that coordinate resources into their own spot

9:20 sobel: yeah, that's right

9:20 sobel: write a trigger in your database

9:20 sritchie: well, not destroyed, actually -

9:20 sobel: don't make this a concern of the client/front-end app

9:20 archived?

9:20 sritchie: EventEntry has a list of athletes -

9:20 has-many

9:20 sobel: storage logic should be able to do the right thing there for you, or you need a better database

9:20 sritchie: so I want to remove the deleted user from EventEntry

9:20 :) that's probably try

9:20 true*

9:21 about the DB

9:21 michaniskin: in general you're going to need to have some kind of manager layer above the db tables anyway, because the real world can't be divided cleanly into tables :)

9:21 sritchie: yeah, I was trying to stick to models + API + view (no controller)

9:21 michaniskin: like what if you wanted to send emails or something

9:21 sritchie: but the "api" layer might be this coordination thing

9:21 michaniskin: sritchie: precsely

9:21 sobel: michaniskin: so true, but domains are a somewhat better object to model. tables are too granular for much practical use, by themselves.

9:22 michaniskin: also tables complect perf issues with api design issues

9:22 sritchie: yeah, this proj that I've been working on jammed a lot of the coordination into the "view" layer, with the enlive code

9:22 sobel: i didn't understand 'complect perf issues with api design issues'

9:23 oh performance

9:23 michaniskin: sobel: how you normalize your data affects both performance and how you make queries

9:23 sobel: sure

9:24 michaniskin: yeah so i always plan on having a coordination layer

9:24 sobel: is this aka a DAO?

9:24 michaniskin: yeah basically

9:24 sobel: distinct from something resembling an 'active record'

9:24 sritchie: michaniskin: easier Q - any naming conventions for your coordination layer?

9:25 michaniskin: or do you segment based on functionality,

9:25 michaniskin: sritchie: well i try to think of it as a state machine

9:25 sobel: cool, DAO is the pattern that has worked best for me.

9:25 it's state machines all the way down

9:25 so i endorse this view

9:26 michaniskin: yeah i think the state machine fits well with functional programming, and the object/class less so

9:26 i mean imho

9:27 sobel: well, when i say DAO the object is a collection of sexprs that interact with data in a particular domain

9:28 in OO it would be a class, but...not here

9:28 sritchie: michaniskin: okay, yeah, convinced… that of course makes sense.

9:28 but as far as project org,

9:29 state transitions that affect multiple models are state transitions on some subgraph of the system,

9:29 so I guess the art is just jamming all state transitions that concern certain groupings of tables, or models, into one spot

9:30 michaniskin: yeah i think that's the artistic part of the process :)

9:31 sritchie: and I'll know it's right when I can sell prints of the graph at the local coffee shop

9:31 michaniskin: i'll buy one

9:33 it would be awesome if you could buy large e-ink posters that could be configured via bluetooth or something

9:33 or e-ink wallpaper

9:34 scape_: i'm trying to wrap a macro call and am not sure what I am missing

9:34 (defmacro with-data [v body] `(fn with-data#[d#] (let [~v d#] ~@body)))

9:34 ((with-data mydata (prn "data:" mydata)) "the data")

9:34 never prints

9:35 michaniskin: (defmacro with-data [v & body] ...) ?

9:36 scape_: well shit

9:36 :D

9:36 thanks michaniskin

9:36 michaniskin: hah i do that all the time

9:39 thesaskwatch: borkdude: RickInAtlanta: thanks .. I'm starting to "get" paredit now :)

9:56 sobel: oh, here's a nice use of the spreadsheet cell model: http://hoplon.io/

10:03 rue_: Is this spreadsheet cell model something like reactive programming? *stabs in dark*

10:17 sobel: i don't know what is meant by reactive

10:19 i guess it's like an island of reactive programming

10:19 makes good sense for browsers/GUIs

10:19 RickInAtlanta: sobel: have you read http://www.reactivemanifesto.org/

10:19 rue_: Reactive programming focuses on data flow, basically.

10:19 sobel: no, i didn't read the manifesto

10:20 does a SQL trigger count?

10:45 luxbock: is there a better way than this to convert a ratio in string form to an actual ratio?

10:45 (defn str-to-ratio [sr] (apply #(/ (Integer. %1) (Integer. %2)) (str/split sr #"/")))

10:48 gfredericks: luxbock: read-string would work, if you trust the input

10:48 probably a bit slower

10:49 luxbock: hmm think I prefer this to that

10:49 rue_: Hm, no bundled number parsing?

10:50 gfredericks: ,(let [[_ s1 s2] (re-matches #"(-?\d+)/(\d+)" "17/18"] (/ (Integer. s1) (Integer. s2)))

10:50 clojurebot: #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: ]>

10:50 gfredericks: ,(let [[_ s1 s2] (re-matches #"(-?\d+)/(\d+)" "17/18")] (/ (Integer. s1) (Integer. s2)))

10:50 clojurebot: 17/18

10:50 gfredericks: rue_: well most stuff can be done via the jvm; I guess ratios are the main exception

10:51 ,(clojure.edn/read-string "17/18")

10:51 clojurebot: #<ClassNotFoundException java.lang.ClassNotFoundException: clojure.edn>

10:51 gfredericks: ,(require 'clojure.edn)

10:51 clojurebot: nil

10:51 gfredericks: ,(clojure.edn/read-string "17/18")

10:51 clojurebot: 17/18

10:51 gfredericks: luxbock: ^ that works w/o the trust part

10:51 luxbock: ah nice

10:51 * gfredericks forget about clojure.edn momentarily

11:29 wink: anyone at fosdem?

11:34 untyped: hi, I am wondering how probable it is to find a remote Clojure job. Is anyone you know looking for Clojure devs (or has been looking recently) ?

11:56 jballanc: untyped: have you looked at http://functionaljobs.com ?

11:56 last I checked there were some that were remote

11:57 untyped: I have

11:57 jballanc: also, it never hurts to just ask

11:58 untyped: sure, thx. I have done some research and it doesn't look good. On the other hand there may be companies that complain for lack of people.

11:59 bbloom: seangrov`: nope. still no reified vars or binding frames of any kind in cljs

12:01 seangrov`: i'm pretty sure that with the new constant table support, we could easily handle the #'syntax which i think would still be super useful for (comp #'var whatever) during development and for add-watch uses too. but bound-fn and friends is unlikely to happen any time soon

12:03 untyped: anyways, just in case someone is interested please drop me an email untyped@yahoo.com (+12 yrs mostly in Java, and 2 yrs in Clojure and Scala)

12:21 jcromartie: does anybody know of a library or technique for doing a number of complex operations with side effects that can be rolled back if any part fails?

12:22 tmciver: git. ;)

12:23 jkj: jcromartie: just put the world with the side effects in a box and you don't have side effects

12:23 or are they real side effects causing changes in physical reality outside your sw?

12:25 jcromartie: jkj: real side effects in like 6 different external systems

12:25 like, I might need to create a project here, create a wiki there, update a user there, and if any one of them fails, then roll back the others that did succeed, and do some of those in parallel

12:25 now, I already have something to do this, but I want to see if there's any model for it that's already out there :)

12:28 jkj: jcromartie: when your side effects have finalized, you have a system (think map) with some of the parts failed. then you verify it, and decide to roll back... which rolls back the parts that have not failed and you end up with empty system?

12:28 or something

12:29 Sosacek: jcromartie: normally your middleware would do that

12:29 jcromartie: middleware?

12:29 jkj: jcromartie: don't know specific lib or methodology, but modeling the outside world's tate there might help

12:29 jcromartie: yeah, I've looked at this from a couple of different angles

12:29 but we can't know the outside state ahead of time since it's changing all the time

12:29 mkuitune: jcromartie: I have no idea what your use case is but it sounds a bit like multi level transaction management?

12:29 jcromartie: mkuitune: that sounds like a useful term to describe it

12:30 my specific use case is imposing a higher level management interface on a bunch of disparate custom/COTS services

12:30 mkuitune: jcromartie: at leat for me googling for the term provides a bunch of references :)

12:30 jcromartie: so we have our own concept of a "project" and "roles" which translate to a whole slew of complex tasks in various other systems

12:31 JIRA, Confluence, Stash, Bamboo, Jama, LDAP

12:31 at least!

12:31 mkuitune: phew

12:31 Sosacek: usually, there's a middleware that can do something like that

12:31 jcromartie: Sosacek: you don't mean Ring middleware, right?

12:32 jkj: Sosacek: give an example

12:32 Sosacek: which kind of middleware?

12:32 jcromartie: we've already got the API calls worked out

12:32 and some non-API calls (like navigating the HTML forms for tools that don't have APIs)

12:32 it's kinda nuts

12:32 well I guess HTML is an API transport :)

12:33 jkj: luckily atlassian sw has apis

12:33 jcromartie: some of them

12:33 and for some tasks

12:33 :|

12:33 jkj: mm. true

12:33 jcromartie: we have a weird set of versions and have to do a couple of things outside the scope of the APIs

12:33 Sosacek: like, you're opening account on in a bank, and the branch system calls CRM to create a user profile, security system to validate credit score, saves the signed contract to document storage, etc

12:34 jcromartie: Sosacek: and you're saying there's magic software that does that?

12:34 Sosacek: I'm writing *that*

12:34 Sosacek: and instead of calling each system by it's own api, it happens over middleware

12:34 jcromartie: yeah, I'm the middleware

12:34 Sosacek: usually it's ridiculously expensive, in Java, byt Oracle and uses xml

12:34 the smarter ones can do distributed rollbacks and stuff. at my job ... we don't have the smarten one

12:35 jcromartie: hah hah

12:35 well I'm trying to arrange the smart one

12:35 :P

12:35 Sosacek: I'm not sure there's something like this for Clojure, and usually, it's the responsibility of the target system to implement it, which is probably not going to happen with you :)

12:37 well, good luck :)

12:38 mkuitune: jcromartie: I just remembered this paper. It's not in your domain per se but discusses undoable side effect to linked systems a bit

12:39 http://homes.cs.washington.edu/~lamarca/pubs/templogic-uist00.pdf

12:39 jcromartie: thanks mkuitune, you keep delivering :)

12:40 mkuitune: jcromartie: You're welcome, not sure if it helps but perhaps they give some perspective :)

12:40 jcromartie: yes, definitely

12:43 I'm thinking that I can simplify this down to fns that return their own inverse

12:44 well, not inverse, but undo

12:45 Sosacek: that's interesting

12:45 gfredericks: ,(def count (atom 0))

12:45 clojurebot: #<CompilerException java.lang.SecurityException: denied, compiling:(NO_SOURCE_PATH:0:0)>

12:46 gfredericks: ,(def c (atom 0))

12:46 clojurebot: #'sandbox/c

12:46 gfredericks: ,(defn inc-c [] (swap! c inc) #(swap! c dec))

12:46 clojurebot: #'sandbox/inc-c

12:46 gfredericks: ,(do (inc-c) @c)

12:46 clojurebot: 1

12:46 gfredericks: ,(do (inc-c) @c)

12:46 clojurebot: 2

12:46 gfredericks: ,(do ((inc-c)) @c)

12:46 clojurebot: 2

12:47 gfredericks: should the undo fn return a redo fn?

12:47 * gfredericks doesn't actually know what we're talking about

12:48 Sosacek: actually, it does sound like an awesome idea

12:49 that's the deal with promises/futures and infinite sequences, right? you can do infinite sequence as a pair (value fn-that-computes-next-value) and future/promise as pair (false fn-to-do-it) or (true value)

12:50 "action" could be fn that does something and then returns pair (result fn-to-redo)

12:53 coventry: Untyped: These guys were hiring seriously in December, and may still be. https://groups.google.com/forum/#!topic/clojure/WgEG5woJDvw

13:07 silasdavis: I have a protocol P which defines a method foo for String

13:08 I want to extend-protocol in another module, and within the body of my override for foo, call the original foo defined elsewhere

13:08 I tried other-module/foo within extend protocol but this causes a stack overflow

13:08 what is the best way to do this?

13:09 am I using extend-protocol correctly if I want to override the default implementation of foo for String within my module?

13:18 gre: hi

13:18 is clojure good for neural networks

13:18 is clojure good for neural networks

13:18 ?

13:20 coventry: /join shitfire!!!

13:20 Heh. From here: https://news.ycombinator.com/item?id=7161604

13:28 gfredericks: silasdavis: um

13:28 what do you mean by "the body of my override for foo"?

13:29 you're trying to extend the same protocol to String in two different namespaces?

13:31 rereading, I think my understanding is correct; and what you're trying to do is not possible

13:31 protocol implementations are global

13:32 if you want a function to behave differently in a different namespace what you really want is a different function; or a more general function

13:34 silasdavis: gfredericks, hm, thanks, are you familiar with liberator?

13:36 gfredericks: silasdavis: no

13:53 seangrov`: Really seeing some of the brilliance of the pedestal approach. We're definitely working on a substandard re-implementation of a lot of their ideas.

14:05 egghead: silasdavis: I love liberator! so nice

14:09 anyone in here know how you'd go about testing om apps?

14:18 llasram: insamniac: (going through channel scrollback) I'm totes up for chatting about Hadoop and Clojure (Parkour or Cascalog/Cascading) some time

14:18 insamniac: If you decided to go the Cascalog route, sritchie is here frequently too, an there is a #cascalog

14:20 silasdavis: egghead, well perhaps you might have some thoughts on: https://github.com/clojure-liberator/liberator/issues/99

14:25 egghead: hmm silasdavis i've yet to tackle auth on the project I'm using liberator with, I was hoping to integrate with friend but I haven't crossed that bridge yet

14:25 hopefully you'll figure it out for me :p

14:25 silasdavis: gfredericks, so should I really not extend-protocol someone else's protocol in one of modules to override it?

14:26 egghead, shouldn't be a problem, just used the :authorized? decision function, return [true, {:auth-token auth-token}] or the like

14:26 to indicate request is authorized, and to merge relevant information into the context

14:26 you can used :allowed? to check specific access permissions

14:27 my problem is about passing that auth-token to a middleware

14:27 egghead: right, but it's an interesting considerating that if friends annotates the ring request I wouldn't be able to easily get to it?

14:27 silasdavis: you can get at the request

14:27 you just can't write out to the ring response from within liberator

14:28 actually that's no true

14:28 you can do that fine from a handler with: (reify lib-rep/Representation (as-response [this ctx] <write your ring response>))

14:29 egghead: ooo, you need to modify liberators responses to add an extra header of yr auth token or something?

14:29 silasdavis: my problem is I would have to do that for every handler to get something generic (i.e. that does not relate to specific path through the decision graph) out to the ring response

14:29 egghead, yeah that kind of thing

14:30 if I could override the default as-response functions, but I'm lead to believe that's not kosher

14:31 egghead: ya interesting silasdavis https://github.com/clojure-liberator/liberator/issues/46 looks like that is an option too

14:32 silasdavis: ah okay that's easier than providing as-response for that case

14:32 still for me it's a problem of doing that for every handler

14:33 egghead: ya

14:33 you could use a higher order fn or something to abstract it if it's boilerplatey, maybe, I don't know

14:33 :)

14:40 silasdavis: I guess

14:41 it would mean I couldn't easily use defresource

14:41 also I'd have to manually maintain a list of all handle functions

14:41 that could conceivably change with liberator

14:41 it smells pretty bad

14:42 although I'm not seeing a good way round it

14:43 this: http://stackoverflow.com/questions/3589569/whats-the-rationale-behind-closed-records-in-clojure convinces me that I shouldn't be overriding the extending done by the extend-protocol in liberator.representation

14:43 I could pass some callback into my resource

14:44 and return a promise that gives the auth token

14:44 but that is a horrible work around

14:45 no I'm going to have to extract the authorization to before liberator

14:46 that's actually reasonably clean

14:46 thanks for the rubber ducking egghead :)

14:51 egghead: of course silasdavis

15:15 seangrov`: dnolen: This look like an ok usage of with-redefs in cljs? https://www.refheap.com/5015fd931bc3d0f6e30cafec9

15:16 dnolen: seangrov`: that looks a bit sketchy since go blocks are async

15:17 seangrov`: if this something simple probably ok, but that's likely to result in very weird bugs if you're doing that in several places

15:18 seangrov`: dnolen: Just doing it in one place for replays, but the functions are never returned to their original defs

15:19 It's not the end of the world since we'll just throw them away the page after running it more or less anyway, but it would be nice to have it be slightly more robust, to be able to play up to a point and then resume manual interaction

16:17 coventry`: LT question: I just built light table on OSX 10.9 using the OSX script in the README.md. It starts after a complaint that "Breakpad initializaiton failed" and a few complaints of "Internals of CFAllocator not known." (https://www.refheap.com/31194) But it is then completely unresponsive. Any suggestions for how to get it working? I gather the second warning is benign, the first can be caused by conflicting LT processes, which I don't

16:17 think I have. https://groups.google.com/d/msg/light-table-discussion/QohEDkf-TP8/kcBivkT1iToJ

18:05 davidchambers: What's the thinking behind `=` requiring at least one arg?

18:09 AeroNotix: davidchambers: wat

18:09 davidchambers: ,(= 1 1 1)

18:09 clojurebot: true

18:09 davidchambers: ,(= 1 1)

18:09 clojurebot: true

18:09 davidchambers: ,(= 1)

18:09 clojurebot: true

18:10 davidchambers: ,(=)

18:10 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core/=>

18:10 gratimax: Hmm

18:10 AeroNotix: davidchambers: and the problem you're trying to solve is?

18:10 gratimax: ,(= false)

18:10 clojurebot: true

18:10 amalloy: AeroNotix: (apply = coll)

18:11 * goodger blinks

18:11 davidchambers: AeroNotix: I'm wondering what the default value of equality is. The default value of addition, for example, is zero.

18:11 amalloy: a perfectly reasonable thing to want to do, but it breaks on empty collections

18:11 davidchambers: ,(+)

18:11 clojurebot: 0

18:11 amalloy: davidchambers: it should be true, but it's not :P

18:11 gratimax: davidchambers: If you think about the definition of =, it checks if all the arguments are equal. In the case of one argument, it is equal to itself. Problem solved

18:12 amalloy: gratimax: i feel like you've missed the point

18:12 AeroNotix: hmm

18:12 amalloy: he's asking why it doesn't work for 0 args, not why it does work for 1

18:12 gratimax: ah

18:12 RickInAtlanta: you cant have a default value for equality

18:12 if you apply the identity to addtion, 0 it doesn't change anything

18:12 goodger: if this were PHP, we would assume truth and be done, damn it

18:12 davidchambers: RickInAtlanta: Can you point me to a Wikipedia entry or something similar? I'm interested in reading about this.

18:13 amalloy: you can't have a default argument, RickInAtlanta, but you can have a default return value

18:13 RickInAtlanta: but what + and * return is the identity that applies to their operation

18:14 amalloy: sure, so = can't be a monoid, but it can still do something useful when called with no args

18:14 AeroNotix: amalloy: but is it true or fale

18:14 RickInAtlanta: whether it is useful or not depends on what you want to do with it.

18:14 AeroNotix: false

18:14 gratimax: good point. = has no 'identity element'

18:15 coventry: Should a set of no objects all be equal to each other? Should they not be equal to each other? Seems like a good thing to punt on. :-)

18:15 AeroNotix: coventry: exactly

18:15 gratimax: set theory would answer that for you

18:15 amalloy: coventry: easy, they're all equal

18:15 AeroNotix: ,(= #{} #{})

18:15 clojurebot: true

18:15 amalloy: if you can find a counterexample from that empty set, i'd be happy to hear it

18:15 gratimax: the empty set is a subset of itself, therefore it is equal

18:16 amalloy: for the same reason a collection of one element is/are all equal

18:16 coventry: They're also all not equal.

18:19 amalloy: coventry, that's true, but nobody asked that. (every? f []) is true, as is (not-any? f []), for any f; that's no contradiction that needs to be punted on, just the way empty lists are

18:25 coventry: OK, I guess it makes sense for (=) and (not=) to return true by the same logic.

18:26 I've certainly abused every? that way.

18:26 amalloy: it's not an abuse at all

19:11 danlei: in cider, I don't get completion for namespace-qualified symbols. any ideas? (I'm on emacs 23.3.50 cider 0.6.0snapshot, clojure 1.5.1, nrepl 0.2.3, without ac-nrepl)

19:24 technomancy: danlei: do you mean vars?

19:29 danlei: technomancy: yes -- my clojure terminology is a little rusty

19:43 deevus: Is SICP still a great reference for learning a lisp?

19:44 AimHere: I don't think it ever was. It's a great reference for learning computer science.

19:45 It's there as a survey of programming concepts, and it certainly doesn't hurt anyone to go through it

19:45 You won't learn everything there is to know about scheme from it; it's very light on macros, for instance

19:46 technomancy: deevus: I think the Little Schemer is much better for learning the essence of lisp

19:51 danlei: hm, no error message, nothing to find via google. I think I'll just give up on completion for now and call it a night.

19:52 devn: best way to do bulk inserts with korma?

19:52 i think im paying for autocommit right now

19:55 nevermind

19:55 danlei: seems to be some weird interaction with another package. anyway, good night

20:09 deevus: Thanks AimHere, technomancy

20:10 I'm beginning my 2nd year CS in March. Thought it might augment my studies.

20:15 AimHere: I reckon it will; it's also free online by the way, so if you're worried about blowing your textbook budget on a book you don't like, you can check first

20:15 Just don't expect it to be a Lisp programming manual

20:16 deevus: Yeah okay

20:16 Is there a free e-book version online, or just HTML?

20:17 AimHere: I think it's html, but I'd guess that it's likely been pdfed by now

20:17 I do vaguely remember a texinfo version

22:21 sdegutis: I found this cool article on recursion:

22:21 https://news.ycombinator.com/item?id=7164655

22:26 v

Logging service provided by n01se.net