#clojure log - May 21 2012

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

0:00 emezeske: technomancy: Offhand it doesn't seem like a whole lot of the code

0:00 technomancy: Most of it looks like it's related to serializing/execing/etc

0:00 technomancy: The actual HTTP server loop is pretty compact

0:00 technomancy: Oh, are we talking about for clojurescript? I am

0:01 technomancy: yeah

0:01 wondering what needs to happen to make it work in gjs

0:01 * technomancy refuses to write more than hello world without a repl

0:01 emezeske: what's gjs?

0:06 amalloy: emezeske: technomancy's been doing gnome extensions, i assume that's gjs

0:06 dherman: dnolen: ping

0:06 emezeske: amalloy: ah, cool, thanks

0:09 technomancy: yeah, it's gnome's spidermonkey

0:10 I guess it would probably look a lot like the node one

0:10 dnolen: dherman: pong

0:11 emezeske: technomancy: I was just about to suggest looking at the node one

0:11 dherman: dnolen: hey, I was poking around clojurescript design pages.. mostly they just say "no concurrency" -- are there plans to support some of clojure's concurrency constructs at some point?

0:11 technomancy: emezeske: does that live in a separate project or branch or something?

0:12 emezeske: or maybe I was looking in lein-cljsbuild which is the wrong place?

0:12 emezeske: technomancy: I think a branch; you might ask dnolen, I think he was working on that

0:12 technomancy: ah, yeah, that's in some upstream clojurescript branch

0:12 dnolen: dherman: I think that can/will only happen as much browsers provide supporting constructs.

0:12 emezeske: technomancy: I plan to eventually integrate it into cljsbuild, or at least I have a plan to plan to do that

0:12 dnolen: as much as

0:12 technomancy: emezeske: is it fair to say lein-cljsbuild currently only targets browsers then?

0:12 dherman: dnolen: well, it could happen with deeper compilation, but I imagine that would be slow

0:13 dnolen: dherman: yes not really interesting in providing our own concurrency layer.

0:13 dherman: sure

0:13 dnolen: interested

0:13 emezeske: technomancy: Sort of. I think some people use it to compile for node, but with no node repl it's not that swanky

0:14 dherman: dnolen: thx. preparing some slides for a preso about compiling to JS

0:14 technomancy: emezeske: so it's not an intentional decision?

0:14 dherman: don't wanna misrepresent anyone

0:14 emezeske: technomancy: No, definitely not. Just limited time/interest on my part

0:14 technomancy: sure

0:14 dnolen: dherman: cool! where you presenting?

0:14 dherman: "web rebels"

0:14 http://webrebels.org/

0:15 emezeske: technomancy: I'd love to pull in node/etc support, if someone with a higher interest and knowledge in that area put it together

0:15 technomancy: As it stands, I just do browser stuff personally, so I'd be slow to add that

0:16 technomancy: I don't know the first thing about gjs, but I hate all desktops that don't have a repl

0:16 dnolen: dherman: very interested in seeing some sort of task parallel JS thing happening - but not sure how much vendor interest there is in that.

0:16 technomancy: s/desktops/programs/ I guess

0:16 so hopefully my hate can be channeled into something productive

0:16 emezeske: hahaha

0:17 dherman: dnolen: we're very motivated, and tc39 has shown interest so far

0:17 emezeske: that's a kind of hate that I can get behind

0:17 technomancy: programs without repls: completely loathsome.

0:17 dherman: dnolen: though we haven't yet gotten any other vendors to sign up for a more active role yet

0:18 dnolen: er, sorry

0:18 task parallel

0:18 I was thinking data parallel

0:18 dnolen: we've got an intern starting this week who'll be working on task parallelism for JS

0:18 but we don't know yet how it'll pan out

0:19 dnolen: dherman: would be more excited about Workers but clone overhead makes it worthless for building on top of for us.

0:19 dherman: I see

0:19 yeah, workers are expensive

0:19 dnolen: dherman: wish there was some way to avoid that, we have persistent data structures.

0:20 dherman: dnolen: there's an API for transfering ownership but I don't think that helps you

0:20 transferring?

0:20 * dherman shrugs

0:20 dnolen: dherman: nope, because we want free reads.

0:20 technomancy: maybe I'm just tainted by the fact that the main repl-less program I'm stuck using is skype

0:20 but it's just so wretched

0:20 what really bums me out is that people put up with this crap even though they should know better

0:22 dherman: dnolen: I have a stupid question. how do you do the memory management of shared persistent data structures? concurrent GC?

0:22 dnolen: dherman: we leave it up to the host JS engine.

0:22 dherman: I guess I meant in Clojure, but the answer's obvious: JVM

0:22 dnolen: dherman: but we also provide lower level constructs too.

0:23 dherman: you don't actually have *parallel* data structures in cljs

0:23 oh, you can with copying

0:23 dnolen: dherman: yeah JVM manages them pretty well, not too many complaints in the past 5 years.

0:23 technomancy: I guess you pick your battles. =\

0:24 dnolen: dherman: we don't need parallel data structures

0:24 dherman: that's the whole point of rhickey's reducer work.

0:24 dherman: I thought that's what you were talking about

0:24 dnolen: you have to forgive my great distance from the clojure world

0:24 dnolen: dherman: we go data parallel the moment we have task parellelism.

0:24 dherman: I only have very cursory understanding of the data strucutres and concurrency models

0:25 dnolen: dherman: the latest work is based on Guy Steele's talk on foldl foldr considered harmful.

0:25 dherman: oh that's such an awesome talk

0:25 dnolen: dherman: we're ready for data parallelism on any host w/ task parellelism.

0:25 dherman: no new data structures required

0:25 dherman: can you explain?

0:26 dnolen: dherman: we already have persistent data structures - trees.

0:26 dherman: reducer framework is purely aglorithmic. We don't need new data structures.

0:27 just a way to divide up the work, reduce + combine in parallel. host stuff.

0:27 dherman: ok, so the reducer framework is all implemented in pure clojure

0:27 dnolen: dherman: yes

0:28 dherman: but I thought you were saying at first, you don't have a way of implementing persistent data structures that could be shared between workers in JS without copying

0:28 s/at first/at first was/

0:28 dnolen: dherman: perhaps I'm mistaken, but the copying is imposed by Workers right?

0:28 dherman: yes

0:28 except for transfer of ownership, but that doesn't give you sharing

0:29 dnolen: dherman: yeah that's horrible. We are giving workers something that doesn't need to be copied :)

0:29 dherman: right

0:29 so I was just thinking to myself,

0:29 is there some minimal API we could add, that doesn't require new deep semantic concepts in JS

0:29 but the sticking point is that it would require concurrent GC

0:29 basically I was thinking:

0:30 1) allocate something in OS shared memory that's owned by one worker

0:30 2) allow it to mutate it at will

0:30 3) when it's done initializing it, deep freeze it

0:30 4) then allow sharing it between workers

0:30 that's hand-wavy, b/c JS objects don't like being deeply frozen

0:30 they're all intertwingled via prototype goo

0:31 so I'm not even sure that's coherent

0:31 but it seems the biggest issue is that it would require concurrent GC

0:31 * dherman isn't sure any of that made sense

0:33 dnolen: dherman: I know hardly anything about GC - I guess JDK fork/join requires concurrent GC?

0:34 dherman: I'd think just JDK threads require concurrent GC

0:34 guess it depends what level concurrency we're talking

0:36 hm. y'know what, I believe we are working on a concurrent GC. maybe this is becoming more standard

0:37 dnolen: I'll speak with colleagues about this. persistent, shared data structures would be so awesome

0:37 dnolen: dherman: I'm not sure if it makes any difference but the reducer framework is about being alloation free.

0:37 dherman: YES

0:37 allocation

0:39 dherman: too bad rhickey isn't around, he'd probably have much more insightful points about all this :P

0:39 dherman: no worries, it's late

0:39 now I know there's a freenode channel

0:39 I'll try not to be a stranger

0:39 dnolen: dherman: thanks!

0:40 dherman: judging from his accent, I assume rich lives in NY or NJ, yes?

0:40 dnolen: dherman: yeah NY

0:41 dherman: hopefully we can talk about this sooner rather than later - but we'll also all be at StrangeLoop I see.

0:42 dherman: yeah, I'll definitely see you then, but drop me a line on IRC any time. I'm on irc.mozilla.org every day, but I'll hang out here too

0:42 dnolen: dherman: will do

0:42 dherman: a specific channel?

0:43 dherman: irc.mozilla.org: #jslang, #jsapi, #research, #lljs, #rust

0:43 but doesn't matter

1:17 muhoo: grr, i foundd the limit of the compojure-route approach. they don't get assoc'ed into a map, they just get conj'ed onto the end of a list.

1:18 so it's kind of a pain to reload them.

1:19 wkmanire: join #refheap

1:20 I swear erc eat's my characters if I don't wait for it to load.

1:21 muhoo: vector actually.

1:22 wkmanire: eats* bleh

1:23 banseljaj: hey wkmanire

1:24 wkmanire: banseljaj: Good morning ~Doctor

1:24 banseljaj: I actually went a head and made an experimental linux distro off of Open Suse. :D

1:24 * wkmanire runs and hides.

1:24 * banseljaj chases wkmanire?

1:25 wkmanire: banseljaj: Why'd you have to use Suse?

1:25 I don't know Suse very well.

1:25 banseljaj: No particular reason apar tform the fact that it gave a convenient tool to build distros in the cloud.

1:25 wkmanire: it's just like RHEL

1:26 wkmanire: I also don't know RHEL.

1:26 I use Debian and Debian variants.

1:26 Currently using Linux Mint.

1:26 * banseljaj too

1:26 banseljaj: I (heart) debian

1:26 But it was an experiment. just to see what would be needed.

1:26 wkmanire: I see.

1:27 Does it work?

1:27 banseljaj: Currently it only has packages.

1:27 I just finished building it.

1:27 I'll know by the end of today

1:27 wkmanire: I hope it does work.

1:27 I really do think this is a great idea.

1:28 banseljaj: Yeah.

1:28 It would require a truckload of work though

1:28 Suse doesn' have leiningen, for example

1:28 :(

1:28 So i'll have to build an rpm.

1:28 wkmanire: Well that doesn't mean you can't install it.

1:28 banseljaj: Not from a repo, no.

1:29 wkmanire: bah. Why? You're in control of the distro, just pre install it.

1:29 banseljaj: wkmanire: I'll probably make an rpm of lein. :D

1:29 wkmanire: But to install it you just run a shell script

1:29 and it does the rest.

1:29 banseljaj: If it doesn't work, i'll just use Arch.

1:29 wkmanire: Yup.

1:39 ambrosebs: gfredericks: might be interested in a sample of the types I devised for rest/next/first/conj https://gist.github.com/2760648

1:53 muhoo: debian is pretty awesome. though technomancy found this fascinating distro-overlay that is kind of like immutable packages

1:53 it's like if you took clojure structural sharing, couchdb revs, and git, and made a package manager out of them

1:54 raek: nix?

1:54 clojurebot: nix is a purely functional package manager exhibiting many similar characteristics to Clojure's persistent data structures or git commit trees: http://nixos.org/nix/

1:56 muhoo: that's the one

2:07 y3di: https://twitpic.com/show/large/9nild1 -- guess God really does use lisp

2:07 lnostdal: hi guys, is it possible to determine whether a binding was conveyed automatically (1.3+) to a thread (agent/future) or bound explicitly within that thread?

2:07 ivan: y3di: haha

2:08 muhoo: exceptions in the ns macro are fun fun fun

2:08 it's like 20 pages

2:09 ivan: someone should make an Clojure traceback decoder with every mistake you could make

2:09 forgetting the argument vector sure leads to an interesting one

2:10 muhoo: yep, some typo or another

2:10 michaelr`: y3di: the first thing that came to mind: "what is this? the horns of devil?"

2:11 ambrosebs: ivan: relevant: http://dev.clojure.org/jira/browse/CLJ-157

2:22 michaelr`: ambrosebs: why (if(if instead of (if (not ?

2:24 ambrosebs: not isn't bound at this point

2:24 michaelr`: oh

2:24 :)

2:24 ambrosebs: :P

2:26 michaelr`: It's probably because we don't have "and" here either

2:33 lnostdal: am i the only one who thinks automatic binding conveyance is a bad idea? .. or, i really do not understand how others cope with it (db connections long ago closed hang around across agents etc. etc.)

2:49 michaelr`: lnostdal: binding conveyance? can you point at a sample code?

2:54 lnostdal: yes, michaelr` https://www.refheap.com/paste/2813

2:54 something like that

3:07 it's driving me nuts ..

3:12 amalloy: lnostdal: to be fair, lack of binding conveyance also drives people nuts somewhat regularly

3:12 lnostdal: yes, but whitelist ...

3:12 or just, something

3:14 michaelr`: lnostdal: i don't see what's the problem in that code? :)

3:14 lnostdal: michaelr`, k

3:15 michaelr`: if i understand correctly the threads do not share state here, which is great..

3:15 lnostdal: michaelr`, that's not the issue

3:16 (in a sense the problem is exactly the opposite of what you say; threads _do_ share too much state, by default)

3:17 michaelr`: ok, in your example it's not a real db connection..

3:17 lnostdal: right

3:18 if it was, the operations in the agent would sometimes work and sometimes "mysteriously" fail

3:18 racy

3:18 ..sometimes people mess up you know

3:19 michaelr`: how can this work otherwise?

3:19 lnostdal: it shouldn't

3:19 it should fail predictably; every time

3:19 that's the problem

3:19 same with open files etc. too

3:20 e.g. (with-open ...)

3:20 michaelr`: what happens here is that you close the connection while another thread is still using it, right?

3:21 lnostdal: yes

3:21 try-finally type stuff

3:22 michaelr`: the correct code should wait for the thread to finish before closing the connection.. so how do you propose to solve this automatically?

3:22 amalloy: how does with-open have anything to do with bindings conveyance?

3:22 lnostdal: pretty common thing to do .. most DB layers i've seen in lisp use a *conn* dynamic var for context, with a try-finally (or unwind-protect and similar) design

3:23 amalloy, nothing; just to make michaelr` understand that the connection closes in this particular example

3:23 amalloy, well, nothing except with-open uses bindings .. but whatever

3:24 amalloy: no it doesn't. it uses a let

3:24 which, okay, you can call lexical bindings, but those aren't relevant to "bindings" in this context

3:24 lnostdal: it does? .. hm, yes it does .. then never mind .. i saw "binding" in the definition

3:25 ok, but the DB lib uses `binding' .. not `let' .. perhaps that's the problem

3:25 not sure what others do .. using java.jdbc here .. do they explicitly pass around the context or the connection?

3:34 nope, that wouldn't make sense either i think .... *shrug*

3:46 muhoo: that's kinda weird, i never knew you could do map destructuring in reverse

3:46 like (defn barg [{baz :params}] baz)

3:47 instead of (defn barg [{:params baz}] baz)

3:52 tomoj: only the former works

3:52 so I would call that "forward", not "reverse"

3:54 it makes sense to bind the value associated to one keyword in a map to two different variables, it does not make sense to bind a single variable to the values associated with two different keywords in the map

3:54 so the variables are the keys in the destructuring map form

4:04 muhoo: actually, they both seem to work

4:04 which is what i found surprising

4:05 oh wait, nm, i see

4:07 it's kind of symmetrical, ##(let [{bar :baz} {:baz "bar"}] bar)

4:07 lazybot: ⇒ "bar"

4:10 tomoj: I guess if you call building data structures "structuring", then it makes sense

4:11 {:baz "bar"} structures and {bar :baz} destructures

5:00 ro_st: cemerick: i'm a little confused about how i'd use friend to secure a json rest api

5:00 cemerick: ro_st: HTTP Basic over SSL is the most common / easiest option.

5:01 ro_st: http basic? could i use that with a mysql user database?

5:01 which has salted-hashed-passwords?

5:02 cemerick: sorry; what does mysql have to do with it?

5:02 ro_st: i want to authenticate users with my json service

5:02 mittchel: Hey

5:03 ro_st: and then have that auth information be a part of the request info used in subsequent json calls

5:03 cemerick: ro_st: well, what you use to verify credentials is entirely up to you; friend doesn't care whether that's in mysql, couchdb, in memory, or a flat file.

5:05 ro_st: OK, it sounds like you're calling this API from javascript, in a browser then?

5:05 ro_st: yes

5:05 cemerick: In that case, presumably the user is already logged in with a session?

5:05 ro_st: yes, which will also be a json call

5:06 cemerick: so, you just want the provided interactive-form workflow

5:06 json is a format, not a calling convention or something.

5:08 ro_st: ok, i'll start digging there. your samples are compojure based. i'm using the webmachine based Bishop library from cmiles. i guess friend would wrap my method that calls bishop/routes?

5:10 cemerick: ro_st: yup, authenticate is just more ring middleware, so it should compose with bishop just fine.

5:13 Mittch: Are you guys recieving this message? Tried to build an IRC client in clojure :o

5:13 ro_st: yup, we can see you

5:14 Mittch: Weird stuff I have to type: PRIVMSG #clojure : mymessage and it's not even a private message

5:15 ivan: that's how IRC works

5:15 Mittch: ro_sti: Can I try to message you?:P

5:16 ro_st: sure

5:16 mittchel: Did it work? lol

5:17 Running 2 clients now hehe

5:20 Mittch: /me lol

5:20 mittchel: fails haha

5:21 * mittchel test

5:21 * Mittch test

5:21 mittchel: there we go

5:22 ro_st: gah why does wildcard ssl cost so damn much? $200 a year is stupid

5:48 zawzey: hmmm, trying to read a byte[] array from a java lib, but i keep getting truncated data at the 64K (ie: 65536) limit , how do i get arround it

5:52 samaaron: zawzey: what are you reading into?

5:53 zawzey: samaaron: trying a variety of methods, BufferArrayInput, clojure.java.io/reader

5:53 samaaron: also where are you reading from?

5:53 a file?

5:54 zawzey: from nutch: http://nutch.apache.org/apidocs-1.2/org/apache/nutch/protocol/Content.html, the getContent() method

5:55 i'm to output the read content into a file on the clojure side, but it's getting truncated, so i'm trying to isolate where the issue is

5:55 samaaron: ok, well this is somethign I've never done - so I'm just shooting blind here

5:55 i did a quick google and this popped up: http://www.coderanch.com/t/277584/Streams/java/Max-Size-Byte-Array

5:55 perhaps it's do do with flushing?

5:58 zawzey: samaaron: hmm, don't think that's the case, but let me dig a bit into the ByteArrayInputStream.

6:08 Okay, fwiw, it's nutch's problem, it has a 64K limit setting by default. The documentation for nutch is quite poor to be honest

6:33 ljos: Is it just me or is it really irritating that `str` and `print` does not always force calculation of lazy sequences? I don't really understand when this behaviour would be wanted.

7:04 neotyk: hello everyone!

7:07 samaaron: neotyk: howdy!

7:08 neotyk: samaaron: hello clojurepunk

7:09 samaaron: haha

7:09 neotyk: I'm looking for some early feedback on WebSocket support in http.async.client

7:09 if you have time please tell me what you think of https://gist.github.com/2761440

7:24 fliebel: neotyk: Do you have something built-in to put it in a queue/pipe thing rather than a callback?

7:25 neotyk: fliebel: not yet, would you like to have a lazy-seq for reading received stuff?

7:25 fliebel: neotyk: I don't know... I'll have to read the arguments for not using lazy seqs for pipes/queues

7:26 neotyk: fliebel: lamina/channel ?

7:27 fliebel: neotyk: just anything "statefull", java.util.concurrent.BlckingQueue could also do the job.

7:47 timvisher: ,(= (long 1) 1)

7:47 clojurebot: true

7:47 hyPiRion: Any form of integer is equal to another.

7:47 timvisher: ,(= 1 (read-strng (pr-str (long 1))))

7:47 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: read-strng in this context, compiling:(NO_SOURCE_PATH:0)>

7:47 timvisher: ,(= 1 (read-string (pr-str (long 1))))

7:47 clojurebot: true

7:48 timvisher: hmm

7:48 hyPiRion: that's my expectation too yet i'm seeing a different behavior in my program at the moment

7:48 hyPiRion: ,(= (long 1) (int 1) (byte 1) (short 1) 1 1N (numerator 1/2))

7:48 clojurebot: true

7:48 timvisher: i'm seeing if i can get it to reproduce

7:48 ,*clojure-version*

7:48 clojurebot: {:interim true, :major 1, :minor 4, :incremental 0, :qualifier "master"}

7:48 timvisher: maybe it's because i'm on 1.2?

7:48 hyPiRion: What version of clojure do you have?

7:49 timvisher: i'm serializing an object to a file and then reading it back in

7:49 hyPiRion: Probably. I had issues that BigInteger doesn't equal normal integers

7:49 timvisher: the object has a long `1` in it, but when i compare it to another `1` in a test, it fails

7:49 hyPiRion: For instance, try this in your repl ##(#{2} (denominator 1/2))

7:49 lazybot: ⇒ 2

7:50 hyPiRion: It will return nil in clojure 1.2

7:50 timvisher: what does that expression even do?

7:50 i'm not used to seeing sets as a function

7:51 hyPiRion: Sets are just hash maps where the key is also the value

7:51 timvisher: and you're correct, of course.

7:51 ah, forgot that implementation detail

7:51 hmm, might be time to bite the bullet and upgrade then

7:51 see if that clears this up

7:51 hyPiRion: Do you use = or do you use == for comparing the numbers?

7:51 timvisher: =

7:52 don't believe i've ever had an occasion for using == yet

7:52 hyPiRion: Ah. Well, 1.2 is kind of weird with reading numbers and differences between e.g. BigIntegers and Integers.

7:52 timvisher: so many of the gotchas in clojure that i see are related to numbers

7:53 i wish the jvm had done a better job of it. hard problem, though, i suppose

7:54 hyPiRion: It's better in 1.3 though, and I don't think they made any number-changes to 1.4

7:57 fliebel: oh, same problem again. It seems since 1.3, = is not the richt tool to compare all numbers.

7:57 == works

8:01 hyPiRion: fliebel: That's just weird.

8:02 fliebel: hyPiRion: I know... I only know that some number types don't compare to others with =, while they do with ==. Don; know why. Probably optimization.

8:05 hyPiRion: fliebel: Yeah, and it's doomed to make people confused.

8:07 fliebel: I agree... I'm trying to figure out what's going on

8:10 hyPiRion: so, = calls number/equal, while == calls number/equiv

8:11 https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Numbers.java#L205

8:11 https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Util.java#L23

8:14 this means that for 2 numbers to compare using =, they need to be of the same type.

8:14 &(= 2 2.0)

8:14 lazybot: ⇒ false

8:14 fliebel: &(== 2 2.0)

8:14 lazybot: ⇒ true

8:15 fliebel: so, it is rather simple, == does a lot more work.

8:16 hyPiRion: fliebel: Well, it's not same type either

8:16 &(= (Long. 2) (BigInteger. "2"))

8:16 lazybot: ⇒ true

8:17 fliebel: wut...

8:17 hyPiRion: yeah.

8:18 fliebel: I'm pretty sure it's handled in clojure.lang, number, though: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Util.java#L28

8:19 hyPiRion: Yeah, most likely.

8:19 dbushenko: hi all!

8:19 fliebel: here: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Numbers.java#L213

8:19 dbushenko: does anyone have troubles while embedding the clojurescript repl in a web-page?

8:19 I'm trying the example from the clojurescript bundle, proceeding step-by-step

8:19 and the repl simply doesn't connect to the index.html

8:20 while accessing http://localhost:9000 does the job, and the repl connects

8:20 what could that be?

8:21 hyPiRion: fliebel: So if they're the same category (integer, ratio, float) they're checked for equality, but if they aren't, they are different types.

8:21 fliebel: yea...

8:22 hyPiRion: dbushenko: I wish I could help you, but unfortunately your guess is probably better than mine.

8:22 Tutorials and manuals usually helps, though.

8:22 dbushenko: yes, that's what I'm doing: I'm trying the samples and tutorials

8:22 fliebel: &(clojure.lang.Numbers/category 3)

8:22 lazybot: java.lang.IllegalArgumentException: No matching method: category

8:23 dbushenko: but no idea why I can't connect to a web-page..

8:23 fliebel: ... why doesn;t that work.

8:25 hyPiRion: fliebel: here's the source, though https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Numbers.java#L978

8:25 fliebel: hyPiRion: I now, but I should be able to call it, right?

8:27 hyPiRion: fliebel: well... yes

8:27 xeqi: its package level

8:28 hyPiRion: oh, durr.

8:28 fliebel: xeqi: meaning?

8:28 hyPiRion: it's not public, it's blank

8:28 fliebel: :(

8:28 hyPiRion: So you can only call it from the package it's defined in.

8:28 fliebel: oh, that package level

8:29 xeqi: or you have to wall hack it

8:31 timvisher: hyPiRion: 1.4.0 fixes it, thanks

9:17 kzar: ,(partition 100 [1 2 3])

9:17 clojurebot: ()

9:17 kzar: Can anyone explain that? ^^ (I want it to return '((1 2 3)) )

9:18 hyPiRion: kzar: try partition-all

9:18 ,(partition-all 100 [1 2 3])

9:18 clojurebot: ((1 2 3))

9:18 hyPiRion: ,(partition-all 2 [1 2 3])

9:18 clojurebot: ((1 2) (3))

9:18 kzar: hyPiRion: Nice, thanks

9:18 hyPiRion: You're welcome

9:47 bhenry: anyone else have problems with clojurescript keyword lookup in ie8?

9:49 http://imgur.com/vnmDJ results of (js/alert (apply str (keys user))

9:53 point9: When I run repl from lein, the var "realized?" couldn't be found. Why is that?

9:53 neotyk: bhenry: try (js/alert (apply name (keys user)))

9:54 point9: it must be old clojure, before 1.4

9:54 point9: oh...

9:56 bhenry: neotyk, that's not my point. (:username user) fails in ie8, because of the slash

9:56 uraimo: to upgrade from prev3 to prev4 do i need to do something else other than downloading the new lein script?

9:57 ops, wrong channel :)

9:57 neotyk: bhenry: what slash?

9:59 bhenry: neotyk, did you look at the way the keywords are alerted in the ie alert box? :/keyword as opposed to :keyword in chrome

10:00 neotyk: bhenry: keywords and symbols are strings in cljs, they just start with magic

10:01 bhenry: well then can you tell me why (:username user) doesn't work in ie8, but does work in all other browsers.

10:02 neotyk: bhenry: no idea about IE8, sorry

10:03 bhenry: if you would use (get user key) would it work?

10:03 bhenry: i'll try. gotta go for now

10:08 bderooms_: is anything optimized in the clojure sequences?

10:08 such as getting the last..

10:08 or is that O^n

10:13 si14: guys, where I can find any example of web-gui on ClojureScript?

10:13 bobry: bderooms_: depends on the sequence I guess, it's clearly O(n) for lists

10:18 hyPiRion: bderooms_: constant time for vectors. Reverse is also constant time.

10:18 (for vectors, that is)

10:20 chouser: rseq, not reverse

10:21 madsy: Is there a dynamic var I can change so swank doesn't flood me with text when I run a function that returns a huge sequence?

10:25 tmciver: madsy: looks like *print-length* might do what you want.

10:26 madsy: tmciver: I just found it on clojuredocs too. Thanks :)

10:29 tmciver: madsy: fyi: apropos is good for finding that kind of info. I ran (apropos 'print) in the repl.

10:38 bobry: did anyone get a stack overflow, while compiling cljs?

10:40 balint: wanted to try the new reducers library, cloned the repo, built the jar with mvn install and then got this when requiring the reducers:

10:40 CompilerException java.lang.ClassNotFoundException: jsr166y.ForkJoinPool, compiling:(clojure/core/reducers.clj:56)

10:41 do I need a certain version of the JVM for that to work?

10:41 I have 1.6.0_31

10:42 hyPiRion: I've seen some commits in which they say something about 1.7, though I'm unsure whether that leaves 1.6 incompatible.

10:43 Let me see.

10:43 pipeline: balint: look at the class name: jsr166y. it needs something that is a jsr proposal and not actually bundled with java. looks like this - http://g.oswego.edu/dl/concurrency-interest/

10:43 fliebel: Hm, I read it's a weird dependency problem.

10:44 the jsr thing is declared as an optional dep, iirc

10:46 balint: pipeline: thank you, that fixed it

10:47 in fact, I used the clojure-1.5.0-master-SNAPSHOT-slim.jar and so that's why the extra dependency needed to be declared explicitly

10:57 TimMc: clojure 1.5? o.o

10:57 ,*clojure-version*

10:57 clojurebot: {:interim true, :major 1, :minor 4, :incremental 0, :qualifier "master"}

10:58 TimMc: Oh, huh. Didn't realize 1.4 had been released.

11:00 S11001001: TimMc: don't worry, not too much changed

11:01 fliebel: &(:qualifier *clojure-version*)

11:01 lazybot: ⇒ nil

11:01 fliebel: &*clojure-version*

11:01 lazybot: ⇒ {:major 1, :minor 4, :incremental 0, :qualifier nil}

11:04 S11001001: 'course you would have known this following the presentation about 1.3/1.4 changes at the boston clojure a few months ago in Newton :)

11:11 TimMc: Yeah. sounded like mostly bugfixes.

11:12 S11001001: Did you make it to the one at Basho? I really liked the talk on Kiln.

11:12 S11001001: yeah

11:12 I sat next to the projector

11:13 hyPiRion: You lucky americans.

11:15 TimMc: hyPiRion: Well, I only get out to Clojure stuff in my own city. NYC would be easy to get to, Durham, NC would be annoyingly far (for the Conj), but I've only been to the west coast twice in my life.

11:16 hyPiRion: TimMc: Oh. I'd probably go to any (sufficiently large) Clojure thing within Europe if we had something large here.

11:17 But that's probably because there's no supply for these things over here, at least not in Norway.

11:18 S11001001: I do hope that Basho does indeed offer the space for more meetings

11:27 TimMc: hyPiRion: There's EuroClojure, right?

11:28 Also, I saw a really awesome job posting in Helsinki for controlling industrial robots in Clojure.

11:28 Now that's Finland, but it's still in your neck of the woods.

11:35 metajack: that's zenrobotics i think. i walked past their building whenever i was in Helsinki

11:40 TimMc: SO. COOL.

11:41 gfredericks: why does clj-http require a :length parameter for input-stream bodies?

11:41 TimMc: What's the catch, besides being in Finland?

11:42 OMG: "Some people see a problem and think "I know, I'll use Java!" Now they have a ProblemFactory."

11:42 * gfredericks lulz

11:42 muhoo: gfredericks: ram allocation?

11:42 bytaarray allocation, specifically, i'd guess

11:42 dakrone: gfredericks: because InputStreamEntitys for Apache require the length of the stream passed in

11:43 metajack: TimMc: no idea. I was working for another Finnish company, but remotely.

11:43 Helsinki is nice, but winter is awful

11:43 gfredericks: dakrone: so there's no way to stream data without knowing the length up front?

11:43 dakrone: gfredericks: https://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/entity/InputStreamEntity.html

11:43 metajack: the constant darkness was super depressing

11:43 TimMc: Yes, that would be my concern.

11:43 metajack: i visited in december and basically no one ever did anything. everyone just stayed indoors and was sad.

11:43 dakrone: gfredericks: I can look into it, but right now there's not

11:44 hyPiRion: TimMc: Oh, there is? I'll check it out.

11:44 gfredericks: dakrone: I think I can work it out, no worries

11:44 dakrone: gfredericks: if you find a way, patches welcome ;D

11:46 hyPiRion: and metajack: It's horribly dark in Fennoscandia.

11:47 gfredericks: dakrone: do you know for sure that HTTP allows it?

11:47 hyPiRion: I suppose it's colder in Finland though.

11:47 dakrone: gfredericks: I don't for sure, it may actually require length when sending data, another thing to add to the TODO

11:48 gfredericks: dakrone: I mean the HTTP protocol

11:48 dakrone: gfredericks: yea, that's what I meant also

11:48 gfredericks: er...the HTT protocol?

11:48 TimMc: HTTP allows for streaming

11:48 gfredericks: TimMc: without length, right?

11:48 TimMc: Has to.

11:49 gfredericks: okay thought so

11:49 TimMc: in a request, right?

11:50 muhoo: gfredericks: dakrone: transfer-coding = "chunked", perhaps? http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html

11:52 wkmanire: Gooooood morning.

12:04 gfredericks: wkmanire: morning?? but in time zone X it is actually a bad morning!

12:04 wkmanire: nah

12:04 Today is an awesome day.

12:04 I woke up and everything.

12:04 TimMc: wkmanire: I think it is already tomorrow some places.

12:05 gfredericks: man it would be weird if moods were globally synchronized

12:05 wkmanire: I can't imagine all 3 billion women on the rag at the same time.

12:05 :(

12:06 pipeline: wkmanire: shame on you

12:06 * gfredericks repents for suggesting the topic

12:06 wkmanire: pipeline: :D

12:06 TimMc: pipeline: For poor imagination?

12:06 wkmanire: I'm shameless

12:07 pipeline: if no one speaks up, sexist bullshit on irc self-perpetuates

12:07 so, uh, shame. picture the finger rubbing motion.

12:07 wkmanire: nothing sexist about that.

12:07 it's a well known fact.

12:07 lucian: plenty sexist about that

12:07 wkmanire: I just got in trouble with my lady because we ran out of rice.

12:07 gfredericks: (inc pipeline)

12:07 lazybot: ⇒ 1

12:07 pipeline: wkmanire: well, this is also why we have an /ignore function. get bent

12:07 wkmanire: pipeline: Feel free :)

12:08 kzar: Wow, this is the first time I've seen anything like this in #clojure

12:08 TimMc: Women in the same apartment seem to synchronize, but extended social networks don't. I imagine birth control pills are the reason (not allowing drift.)

12:08 * wkmanire seeths with rage blasting smiley faces in every direction.

12:08 * wkmanire is bent out of all proportions.

12:09 TimMc: pipeline: Were you reacting to "on the rag" or the notion that menstrual cycles (statistically!) affect mood?

12:09 foxdonut: please stop this topic now. thank you.

12:09 TimMc: k

12:09 wkmanire: Must be monday morning.

12:10 day/evening

12:10 geoffeg: let's talk about something like: beer!

12:10 TimMc: wkmanire: nooooo, that's how this got started

12:10 gfredericks: Wait, this is about HTTP *request* length?

12:10 si14: why there are so many warnings when one builds Domina?

12:10 WARNING: Use of undeclared Var domina/.DomContent at line 459 /home/si14/repos/domina/src/cljs/domina.cljs

12:10 wkmanire: TimMc: I'm trying to get back on topic and do something recursive.

12:10 gfredericks: TimMc: yep

12:11 TimMc: forwarding a request

12:11 TimMc: For some reason I was thinking about responses. ANyway, you should be able to copy the headers, yeah?

12:12 gfredericks: TimMc: content-length seems to be nil :/

12:13 muhoo: wkmanire: well, to do somthing recursive, do something recursive :-)

12:14 wkmanire: muhoo: It's not as easy as you might thing you might think.

12:17 tmciver: gfredericks: spec says (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13) Content-Length *should* be set, not that it *must* be set so perhaps this means clj-http is being overly restrictive?

12:17 dakrone: hmm, I wonder if I could get away with putting null for the length of the input stream

12:17 gfredericks: it's a primitive long isn't it?

12:17 wkmanire: tmciver: I've had chrome reject responses for having an incorrect content length.

12:18 tmciver: It was for JSON response.

12:18 a JSON response*

12:19 dakrone: yes

12:31 gfredericks: is there a standard way for lein-ring to reload files on changes?

12:31 weavejester: gfredericks: It does that by default

12:32 * gfredericks gurmbles

12:32 weavejester: You can turn it off by setting the :middleware option

12:33 gfredericks: weavejester: well I've wasted a million years of my life by not asking about that earlier

12:33 weavejester: Though I'm going to change that a little in the next release so there are :auto-reload and :auto-refresh options

12:33 gfredericks: Ohhhh :)

12:34 I did mention it in the readme, but it's only a sentence

12:34 gfredericks: weavejester: and/or reading the readme

12:35 AeroNotix: `

12:35 gfredericks: _

12:37 pjstadig: |

12:38 goodieboy: anyone know of an emacs plugin that will allow me to see all of the callers of a given function?

12:38 gfredericks: swank-clojure has a grep-based version of that

12:38 it is mentioned in the swank-clojure readme

12:38 goodieboy: gfredericks: cool ok, i'll check it out. thanks!

12:40 technomancy: it's not very good

12:40 I guess the readme should also mention that fact

12:42 S11001001: ah well, finding callers of a function is halting problem :)

12:42 gfredericks: technomancy: either that or annotate all the other features with "it's very good"

12:42 technomancy: gfredericks: that would work

12:43 gfredericks: S11001001: is it? the question isn't "will the function ever get called if I run the program"

12:43 nDuff: How can one get the JDK's tools.jar into the classpath when using leiningen?

12:44 S11001001: gfredericks: (defn do-something [f g h] (if (f) (g) (h))) (do-something some-f some-g some-h); who calls some-g or some-h?

12:45 gfredericks: S11001001: I guess for these purposes "mentioning" is as good as calling

12:45 ibdknox: you can only find usages reliably

12:45 S11001001: aye

12:46 technomancy: ibdknox: by piggybacking on the var's cache of usages it uses to make recompilation trickle down?

12:47 ibdknox: technomancy: you can do it without loading the code if you want to

12:48 technomancy: I haven't looked into it, but when I heard about how the non-dynamic-by-default changes to vars were going to be implemented, I figured the same mechanism if it were exposed would be wonderful for tooling

12:48 I don't think the static analysis approach would be very reliable

12:48 too easy to confuse it with macros

12:48 hiredman: vars are stored in fields on fns

12:49 ibdknox: hiredman: hm?

12:49 as in all the vars a fn uses?

12:49 hiredman: fns have a "constant pool" of fields

12:49 yes

12:49 ibdknox: oh neat, I didn't know that

12:49 technomancy: ibdknox: that's the only way you can recompile a defn and have the changes work for code that's already compiled.

12:49 ibdknox: right

12:50 hiredman: the constant pool holds various things, vars, different kinds of literals

12:50 technomancy: that is not true

12:51 I recall rich's description of having a sort of checkpoint mechanism, but as far as I know that isn't there

12:51 fns still deref the vars everytime

12:52 technomancy: I thought that changed in 1.3 since it wreaked havoc on hotspot's inlining

12:52 hiredman: nope

12:52 the only change was the removal of the sort of "is bound?" check in the general case

12:53 technomancy: huh; so the deref itself could still be inlined; that's cool.

12:53 hiredman: the emitted code doesn't actually call deref

12:54 it calls .getRoot or .getRawRoot depending if the var is dynamic or not

12:54 huh

12:54 no there is no .getRoot anymore

12:54 technomancy: getRoot will never respect binding though

12:54 pjstadig: yeah a non dynamic var is compiled directly to a call to .getRawRoot

12:55 it doesn't even bother with the thread locals

12:55 which allows hotspot to inline it

12:55 technomancy: but it's the moral equivalent of a deref anyway

12:55 pjstadig: well deref would check the thread locals though?

12:57 technomancy: sure, I mean it's just an optimization on deref since it knows it will never have to check thread locals

12:59 pjstadig: technomancy: i guess i don't follow you

13:00 technomancy: I guess it's just a matter of how much artistic license the term "moral equivalent" grants you =)

13:00 clojurebot: Licenser is the man who puts licenses on everything

13:13 wkmanire: Well hell. I guess pipeline went ahead and /ignored me. :/ I tried apologizing privately. So here's a public apology because I'm feeling guilty. I apologize for offending anyone with my comment from earlier. While I don't agree that it was sexist I do agree that perhaps #clojure is not the best venue for that sort of conversation. So, yeah. Foot in mouth.

13:14 ibdknox: technomancy: is there a way for me to force a lein project to use a different version of clojure? I'm setting the dependency correctly but always getting 1.3.0

13:15 banseljaj: wkmanire: Did I miss something?

13:15 technomancy: ibdknox: one of your dependencies is being a jerk and claiming to not work with newer versions; `lein deps :tree` should track it down

13:16 wkmanire: banseljaj: I made a comment in poor taste and offended at least one person.

13:16 technomancy: ibdknox: once you find it, submit a bug report with that lib; in the mean time use :exclusions to shut it up

13:16 wkmanire: banseljaj: No, you didn't miss anything.

13:16 ibdknox: technomancy: great, thanks

13:17 wkmanire: banseljaj: Did you get your Suse distro working?

13:17 banseljaj: wkmanire: Yeah. It's working at a basic level.

13:17 wkmanire: banseljaj: So you boot it up and you have a full functionaly (pardon the pun) clojure dev environment ready to rock and roll?

13:17 functional*

13:18 foxdonut: wow, SuSE is still going?

13:18 banseljaj: I'm trying to see what other softwares are needed and setup the basic dev envrironment

13:19 wkmanire: Not so fast. :P By "working", I mean it boots up, and you can do regular linux stuff on it. You can try it out. I haven't yet tried putting leiningen on it.

13:19 foxdonut: apparently so. :D

13:19 Any experienced clojure dev that wants to test or contributes shell scripts is welcome. :)

13:19 technomancy: banseljaj: do you have any experience with rpm packaging?

13:20 foxdonut: banseljaj: heh. last time I used SuSE, it came on CDs and I was on 56k modem :)

13:20 banseljaj: technomancy: I'd say beginner level experience. Plus, I learn fast. And I was actually looking into making a leiningen rpm. :)

13:21 foxdonut: that was true for me too until yesterday. :D

13:21 technomancy: banseljaj: would you submit it upstream or just use it for your own purposes?

13:21 foxdonut: banseljaj: what were you using before yesterday?

13:21 banseljaj: technomancy: I'd probably set up my own repo.

13:22 foxdonut: I was and still use debian based systems.

13:22 technomancy: banseljaj: suse doesn't use yum, does it?

13:22 banseljaj: I am just developing a clojure dev solution using OpenSUSE

13:22 technomancy: Packman

13:22 it *can* use yum.

13:22 technomancy: o_O

13:22 banseljaj: Is there a problem?

13:22 technomancy: I thought that was arch?

13:23 Bronsa: that's pacman

13:23 foxdonut: so did I

13:23 banseljaj: technomancy: that's pacman. Without the 'k'

13:23 :D

13:23 technomancy: geez

13:23 foxdonut: pff!

13:24 TOSFYPMN

13:24 technomancy: it would be nice to offer a repo, but rpm distros are pretty fragmented from what I understand.

13:24 foxdonut: think of something else for your package manager name!

13:24 technomancy: everyone invents their own repo format

13:24 banseljaj: I am currently looking into a full small footprint hand-crafted linux.

13:24 I'd probably use debs

13:24 debs are cool. :D

13:24 </11th doctor>

13:24 technomancy: yeah, this is the first time I've heard the word SuSE in years

13:25 well anyway, some people might find a raw rpm file useful even if it's not in a repo

13:26 banseljaj: so if you end up with something, could you add it to the packaging page of the wiki?

13:26 banseljaj: technomancy: that would have been my first move. :)

13:26 technomancy: cool

13:26 wkmanire: technomancy: Really? I see it mentioned all the time in the couple of linux magazines that circulate in Vegas.

13:26 technomancy: obviously I don't travel in the right circles

13:27 banseljaj: technomancy: are you a CEO?

13:27 wkmanire: But I know what you mean. The last time I tried SUSE, Lindows was still popular.

13:27 hiredman: do linux magazines still circulate anywhere else in the country?

13:27 technomancy: haha; no

13:27 banseljaj: If not, then yes, you don't. :)

13:27 SUSE is only corporate now.

13:27 technomancy: all my knowledge of distros comes from http://lein-survey.herokuapp.com/results

13:27 * wkmanire 25 clicks

13:28 banseljaj: I only saw it running as a special instance on AWS

13:28 technomancy: according to that survey there are 23 users of leiningen on rpm-based systems, but I didn't ask if they were using yum or some other system

13:28 * technomancy feels fine ignoring suse

13:31 banseljaj: technomancy: That's distroist.

13:31 technomancy: it's OK; I also ignore Arch

13:31 because apparently Arch users get grumpy if things are too easy.

13:32 tmciver: banseljaj: some of his best friends are distros.

13:32 banseljaj: lol

13:32 I probably would roll ut a complete new distro, but it's too much work for a single man.

13:32 s/ut/out/

13:35 pipeline: technomancy: for RPMs you can pretty much just offer RHEL and ignore the others

13:36 technomancy: Fedora is desktop users. They'll work it out in their home directories. SuSE is a much smaller userbase. Everything else is inconsequentially small.

13:38 wkmanire: banseljaj: LFS?

13:38 banseljaj: wkmanire: Yeah.

13:38 wkmanire: banseljaj: I liked the idea of LFS but I want to be able to use a package manager like aptitude.

13:39 banseljaj: If you can use aptitude on your system then you're basically running debian. At least from my point of you.

13:39 muhoo: if i use lein2 check, all that aot stuff isn't going to hang around, interefering with other things, is it?

13:39 banseljaj: I'm pretty sure that can be arranged. that's what I have in mind.

13:39 for now, I think someone other than me should check the SUSE install.

13:40 technomancy: pipeline: cool; thanks for the confirmation

13:41 pipeline: how much overlap is there between rhel and fedora though? considering there's no native bits I wouldn't be surprised if the same package could be used verbatim on both

13:41 muhoo: pipeline: debian is "inconsequentially small"? i dunno, seems pretty widespread to me.

13:41 pipeline: muhoo: talking about rpm distributions

13:41 technomancy: for practical purposes, none. RHEL trails fedora by 2+ years, but fedora releases are only supported for a year or two at a go.

13:42 technomancy: it DOES help to take rpm specfiles from old fedora releases and adapt them for new code on RHEL

13:42 technomancy: the problem is actually worse for "non-native" bits. packaging standards for python, java etc evolve too quickly inside fedora

13:42 technomancy: pipeline: when your dependencies consist of a JVM and rlwrap trailing by two years seems like no big deal though

13:43 Java's rate of evolution makes RHEL look fast =)

13:43 pipeline: you misunderstand me

13:43 the packaging standards

13:43 change rapidly

13:43 technomancy: oh, sure

13:43 pipeline: fedora is in many ways a test bed for new ideas in RHEL

13:43 banseljaj: technomancy: That webapp. The lein survey. that's pretty tiny compared to other frameworks I have worked wiht.

13:43 pipeline: so fedora picks up and abandons two or three packaging standards for non-C items in the time between RHEL releases ;)

13:43 technomancy: heh

13:43 banseljaj: oh, did you check out the source?

13:44 banseljaj: it's pretty simplistic; only 3 endpoints really

13:44 banseljaj: technomancy: Yeah. I'm looking at it right now.

13:44 and "HOLY SHIT IT'S TINY!"

13:45 technomancy: write a row in postgres and serve up some charts; not a lot going on =)

13:46 muhoo: banseljaj: webdev in clojure is wonderfully compact

13:46 banseljaj: technomancy: I work with rails. trust me, it takes a lot of work to get it working there. :(

13:47 muhoo: per rhickey: "gem install hairball"

13:47 banseljaj: technomancy: Would you mind explaining a tiny thing on your code.?

13:48 technomancy: sure; what's up?

13:49 banseljaj: technomancy: line 8 in render.clj, you do [[question _ answers]]. I wanted to know what it is that you're skipping by using the \UNDERSCORE

13:49 technomancy: banseljaj: in that case it's the type of the question

13:49 pipeline: technomancy: another thing to keep in mind is that you're free to disregard their standards and just depend on the easy stuff: integrate with the 'alternatives' system, depend on a system jdk. I do this all the time for ruby things, packaging stuff the official fedora way is just too much work.

13:49 clojure-newcomer: Hi guys, working through the clojure-programming book… trying to iterate over the result of the following function : http://pastebin.com/sTv0RFz8, can anyone help ?

13:50 technomancy: banseljaj: which is used to dispatch to the correct multimethod, but once you're in the method body you don't care

13:50 banseljaj: technomancy: Oh. Nice.

13:50 clojure-newcomer: basically just want to print some or all details of every element in collection/sequence

13:50 technomancy: pipeline: it's up to whomever cares enough to package it =)

13:50 pipeline: I was lucky to have a lot of help with Debian, but it's great to have it included in the official repos

13:51 muhoo: clojure-newcomer: doseq?

13:51 banseljaj: technomancy: well, the debs still don't have 2.0 :(

13:51 technomancy: banseljaj: yeah, unfortunately the number of dependencies shot way up in 2.0

13:51 but 2.0 isn't even finished anyway

13:51 clojure-newcomer: muhoo: I tried a doseq, but failed

13:52 banseljaj: technomancy: it works fine for me.

13:52 technomancy: we have a long way to go before 2.0 is done

13:52 banseljaj: technomancy: Actually, it's a wonderful tool. Thank you for that. :)

13:52 clojure-newcomer: I tried something like (doseq [author get-authors] (println author))

13:52 technomancy: sure =)

13:52 banseljaj: I like the cclojure community. :D

13:56 The results.clj makes about 30% sense to me. But then again, mY love affair with clojure is barely 72 hours

13:57 technomancy: there's a lot of crazy data-wrangling stuff in there; getting numbers in the right format for incanter

14:02 banseljaj: technomancy: How much java knowledge is required to properly use clojure?

14:02 technomancy: banseljaj: depends what you want to do

14:03 clojure-newcomer: can anyone help me with the doseq or equipvalent necessary for me to inspect : http://pastebin.com/sTv0RFz8 ?

14:03 banseljaj: technomancy: My Primary hobby is making web-apps. Secondarily, CLI apps, thirdly, GUI apps.

14:03 technomancy: you basically never need to know how to write Java. sometimes you need to know how to read Java; more often learning to read javadocs is enough.

14:03 banseljaj: technomancy: note: "hobby". Means I don't deal with deadlines and can work as long as I want to. :)

14:03 muhoo: and java stacktraces :-)

14:04 technomancy: banseljaj: you'll be ignoring Java until you need to pull in a Java library.

14:04 banseljaj: technomancy: I can read stacktraces. and javadocs.

14:04 technomancy: How often does that happen. I mean how mature is clojure's own library/plugin/whatchamacallit system

14:05 * technomancy still doesn't know how to write java

14:05 technomancy: banseljaj: not sure how to answer that. it's more mature than you would expect for a 4-year-old language, mostly since writing libraries to wrap existing java implementations is way easier than writing from scratch.

14:06 banseljaj: clojure's just 4 years old? :D

14:06 s/:D/D:

14:07 technomancy: maybe 5?

14:07 banseljaj: Java as a pretty strong library base.

14:08 technomancy:

14:09 banseljaj: it'll be the youngest language I'm learning then.

14:11 AeroNotix: can anyone make a comparison between clojure 6 months ago and clojure today?

14:11 I tried it and I just found it to have a very 'standard' set of built-in functions, with pretty much everything else hitting out to java libs

14:11 which kind of made it annoying to use

14:12 I would love to get back to it, because it really changed the way I wrote other code. And I would like to learn more ideas from Clojure and Lisps in general

14:13 technomancy: it's more likely you just weren't able to find the libraries for what you wanted. for the most part they are out there, but I wouldn't say they've become much easier to find in the last 6 months.

14:14 AeroNotix: technomancy: What I found extremely annoying was the very weird way of interacting with files

14:14 technomancy: I can't remember off the top of my head but it seemed strange there were regex `primitives` but not filereading `primitives`

14:15 built-in funcs, sorry

14:15 technomancy: you mean the fact that the file functions aren't in clojure.core?

14:15 they're definitely built-in

14:15 AeroNotix: technomancy: been a while but was it 'slurp'?

14:16 technomancy: slurp is the only one in clojure.core namespace; the rest are in clojure.java.io

14:16 but using clojure.java.io is not "using Java", it's just using io functions that are implemented on the JVM

14:17 AeroNotix: iirc slurp puts the whole file into memory, which I found a little odd for a functional language, I thought it would lazily read the file.

14:17 Anyway, it's no bother. File-reading is a small part

14:18 technomancy: yeah, slurp isn't meant for nontrivial purposes

14:18 AeroNotix: technomancy: and that's what got me

14:18 technomancy: well that hasn't changed in 6 months =)

14:18 AeroNotix: ok then

14:18 technomancy: but you might have a better time learning now that the oreilly book is out

14:18 AeroNotix: also, I picked up the completely *wrong* book to learn about clojure

14:18 technomancy: been looking at that

14:19 I picked up Practical Clojure, what a money grab

14:19 gtrak: is there a 'let' that'll dump its bindings and values into a map?

14:19 foxdonut: AeroNotix: not a fan either.

14:20 AeroNotix: foxdonut: It just seemed like an api doc to me

14:20 foxdonut: very little theory

14:20 foxdonut: AeroNotix: I blame Apress.

14:20 AeroNotix: foxdonut: well, I've had good books by Apress, "The Definitive Guide To Django" is amazing

14:21 foxdonut: I really should have waited for the O'Reilly book, never gone wrong with them

14:21 gfredericks: is there a built in java class-or-whatever for cloning an inputstream?

14:21 foxdonut: AeroNotix: to be clear: not all Apress books are bad. many books that are bad/rushed to market are from Apress.

14:21 AeroNotix: foxdonut: I'll keep that in mind :)

14:22 technomancy: Apress's CL book is great

14:22 AeroNotix: technomancy: the common lisp one?

14:22 gtrak: I want like the opposite of destructuring, being to reference other bindings as i'm building the map like a normal let

14:23 being able*

14:23 foxdonut: technomancy: my theory is that if the author is good, Apress won't get in the way :)

14:23 technomancy: AeroNotix: yeah

14:23 banseljaj: technomancy: How hard would it be to keep a local repo of all the clojure libraries? How much space?

14:24 technomancy: banseljaj: probably not impossible. check out http://clojuresphere.herokuapp.com

14:24 AeroNotix: I just found out today that my work has mirrors for like the top 20 linux distros, PyPI and CPAN and a host of other FOSS

14:24 xeqi: gfredericks: cloning an inputstream?

14:24 AeroNotix: I ftp from it at like 10mb/s

14:25 * banseljaj shoudl probably document his plan

14:25 gfredericks: xeqi: so it can be read twice; preferably without needing to keep more in memory than the difference between the two read points

14:25 technomancy: banseljaj: no way you'd want to put that on an iso for everyone though

14:25 gtrak: hmm.. like, (let {a 1 b (inc a)})

14:25 would return {:a 1 :b 2}

14:26 banseljaj: technomancy: No. But you can put a script which anyone can use to get them.

14:26 hyPiRion: A let which returns a map?

14:26 gfredericks: gtrak: wouldn't be too hard to make a macro that does that

14:26 gtrak: yea, I'm thinking about it

14:26 surprised it's not a already a thing, though?

14:27 Chousuke: what would you use that for? :/

14:27 technomancy: gtrak: you have to use a macro

14:27 see the implicit &env arg

14:27 gtrak: just to avoid (let [a 1 b (inc a)] {:a a :b b}), it's a common thing to write

14:29 &env arg, interesting

14:29 lazybot: java.lang.RuntimeException: Unable to resolve symbol: env in this context

14:29 gfredericks: (defmacro let-map [& pairs] (let [names (map first (partition 2 pairs))] `(let [~@pairs] (zipmap [~@(map (comp keyword name) names)] [~@names]))))

14:29 gtrak: ha, awesome :-)

14:32 fliebel: gfredericks: How would you use it?

14:32 gfredericks: (let-map a 1 b (inc a))

14:33 intuneontime: hello, quick question: how come if i execute "(doall (for [i (range 1 3)] (do (println i) i)))" in the repl i get the result i expect (1 and 2 printed, then the sequence itself), but if i do "(def x (for [i (range 1 3)] (do (println i) i)))" and then "(doall x)" it doesn't print the 1 and 2, but just the sequence? if that makes sense.

14:35 tmciver: intuneontime: I get the same result for both . . .

14:36 gfredericks: intuneontime: it would only print the 1 and 2 the first time -- are you doing it repeated times?

14:37 intuneontime: oh i see, it only happens the first time it's evaluated

14:37 thank you

14:37 gtrak: gfredericks: that's brilliant, though I think I like it more without the &, since it looks more like a let

14:38 fliebel: Does anyone know what Greenspun's tenth rule is?

14:38 gfredericks: gtrak: yeah, whatever you like

14:38 S11001001: If it does not do exactly what you expect with exactly zero hours' consideration or experience, it is a bug in Lisp that should be fixed.

14:39 technomancy: brucio's law =)

14:39 S11001001: even more important than whatever that Greenspan guy said

14:39 fliebel: Any sufficiently complicated Clojure program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.

14:40 hiredman: who wants all of common lisp?

14:41 fliebel: still on page 3...

14:41 gtrak: let-map along with destructuring is a multiple-return-value accelerator

14:50 gfredericks: gtrak: wrapping the pairs in a vector like you like would let you do more general things, like bind the resulting map to a local name and have a body for let-map that can use the map

14:50 not sure if that'd be useful though

14:50 gtrak: it also looks like destructuring would still work :-)

14:50 within the let-map

14:50 gfredericks: ehhhh

14:51 doubt it

14:51 the keys it has to turn into keywords

14:51 gtrak: ah, damn

14:51 you're right

14:51 gfredericks: it's conceivable though

14:52 gtrak: maybe the &env is a clue

14:53 use a normal let to do the destructuring, then at the end, assemble the elements with &env

14:56 gfredericks: yeah; if you care about shadowing you'll have to check the vals of the &env with identical?

14:59 gtrak: it might require a second macro, if I use macrolet that would mess it up :-)

15:07 eggsby: so I understand I can use atoms and references to eliminate race conditions... but how can I do concurrent operations in a clojure programs? Just spin up new threads?

15:07 nDuff: eggsby: that's one way; there's also agents

15:07 eggsby: ...what's the actual use case?

15:08 ...and futures...

15:09 eggsby: Oh I'm doing some 'learn clojure' course and the task is to have concurrent operations on some world map

15:10 nDuff: eggsby: heh -- there's a somewhat famous little demo you might find relevant... I think Conway's Game of Life, with each pixel handled by a different thread

15:10 eggsby: threaded game of life, eh

15:11 rhc: eggsby: i wrote something similar to that here: http://matthavener.com/matthavener/banksim

15:11 its sorta like the "ants" program hickey wrote

15:11 eggsby: basically what I'm thinking is either 'tick' the world map and process each possible 'move' for all the actors or spin up a bunch of threads and have them use a shared atomic resource

15:11 thank you rhc I will look at it

15:11 I like the fact that this course wants me to do interesting things, I don't like that there was absolutely no teaching involved :|

15:12 rhc: eggsby: banksim doesn't 'tick' but all the actors (trucks moving money) do sleep for a fixed amount of time

15:12 but you could easily make that per-truck, or random-per-move

15:13 eggsby: i wrote that recently, but i'm still new to clojure, so don't look to it for necessarily "idiomatic" clojure code, but imo its pretty ok

15:13 nDuff: ...ahh -- Ants is _exactly_ what I was thinking about

15:14 eggsby: is this ants video worth watching nDuff

15:14 rhc: the ants presentation is still on blip.tv

15:14 the whole presentation is an excellent intro to clojure

15:14 eggsby: it says 'be sure to grab the code and slides!' yet doesnt link to the code nor the slides :(

15:15 duck1123: The ants video is really old, so take some of it with a grain of salt

15:15 rhc: eggsby: err, that link si wrong: http://github.com/matthavener/banksim

15:15 babilen: rhc: Shouldn't that have been https://github.com/matthavener/banksim btw?

15:15 eggsby: I also have some old video from phil hagelberg w/ peepcode

15:15 babilen: ah

15:15 eggsby: but I think it's clojure 1.1

15:15 rhc: babilen: yeah, thanks

15:16 eggsby: okay, so I need to learn about agents then, i'll look at this code, thanks rhc

15:17 rhc: eggsby: no prob, let me know if you have any questions, i'll probably learn something too by trying to answer them :)

15:19 eggsby: and so avout offers this style of concurrency in a distributed way?

15:22 amalloy: gtrak: fwiw, useful.map has a macro "keyed", such that (let [a 1 b (inc a)] (keyed [a b])) would return {:a 1 :b 2}

15:23 gtrak: ah, interesting

15:23 amalloy: also accepts :strs and :syms options to mirror destructuring

15:23 gtrak: the non-destructuring macro is good enough for what I'm trying to do, though I think it'd be fun to figure this out :-)

15:25 solussd: noir question, if I have a pre route of "/*", can I get the actual value of "*" in my pre-route?

15:32 duck1123: solussd: I don't know noir, but do you have a key named :* in :params ?

15:36 eggsby: technomancy: do you think the peepcode clojure course is still relevant for people new to clj?

15:40 solussd: duck1123: doenst seem to work.. :/

15:45 duck1123: solussd: That's where clout puts it. I don't know what you have to do for noir

15:49 gtrak: gfredericks: https://gist.github.com/2764230 how do I keep c from showing up?

15:53 hmm, I can remove the keys that are there before unless they show up again

15:55 amalloy: i don't think you can ever get to-map to work with no arguments

15:57 Borkdude: What is the idea behind a non-dynamic var being mutable?

15:59 technomancy: eggsby: most of the features that have been added since the peepcode release are not relevant to beginners.

15:59 eggsby: the biggest thing is that the peepcode doesn't use Leiningen, but IMO that's easy to learn elsewhere

16:00 just stick your fingers in your ear for the minute or two that build.sh is mentioned =)

16:00 eggsby: see also http://technomancy.us/136

16:00 eggsby: technomancy: I've been using clojure for maybe 2 months, since I already understand the basics of the language, do you think it's a worthwhile purchase?

16:01 technomancy: I don't know; depends on your learning style and the kinds of things you've done so far.

16:02 you could read over the sample project source code; if it's all obvious to you then probably not

16:02 clojurebot: google mire clojure github

16:02 eggsby: good idea... and is it you actually doing the coding or did you just write it?

16:02 clojurebot: First, out of 296 results is:

16:02 technomancy/mire · GitHub

16:02 https://github.com/technomancy/mire

16:02 technomancy: I wrote the script and the code, but I didn't do the voiceover, thank goodness =)

16:03 eggsby: ah cool, well I think I'll purchase it just for that then

16:03 technomancy: great =)

16:04 amalloy: just to hear anyone's voice but technomancy's?

16:04 Borkdude: can someone answer my question, before I put myself to shame elsewhere?

16:04 ;)

16:04 amalloy: Borkdude: it's not really an answerable question yet, i think

16:04 not very clear about what you're asking

16:04 technomancy: amalloy: topfunky's voice is silky-smooth; good for soothing infants as well.

16:05 he really should advertise that angle more

16:05 raek: Borkdude: the fact that you can mutate the root binding?

16:05 Borkdude: raek: yes

16:05 technomancy: Borkdude: it's only possible because interactive development would suck otherwise

16:05 in ML-derived languages, changes to top-level definitions are not retroactive

16:06 which is also true in Clojure when working with non-var functions.

16:06 Borkdude: technomancy: yes, I noticed that in F#, do you mean this? http://stackoverflow.com/questions/2570628/difference-in-f-and-clojure-when-calling-redefined-functions

16:07 technomancy: non-var functions?

16:07 technomancy: more or less

16:08 Borkdude: technomancy: give me an example of a non-var function

16:08 technomancy: Borkdude: (defn f [] inc) (let [local-f (f)] (defn g [x] (local-f x)) (defn f [] dec) (g 10) ; -> 11

16:09 you see this most commonly with (run-jetty app {:port 8080})

16:09 if you want to be able to recompile app, you do this instead: (run-jetty #'app {:port 8080})

16:09 muhoo: :join? false

16:09 Borkdude: technomancy: ah, that's why you give it the var.. ok

16:10 Clojure fosters immutability, but invites you to redefines its + function into - ;)

16:11 technomancy: well...

16:11 + is defined with definline IIRC, so that doesn't work

16:11 Borkdude: technomancy: I just tried it in a repl

16:11 gtrak: Borkdude: try defining your function before redefining +

16:11 Borkdude: technomancy: (in-ns 'clojure.core), (def + -)

16:12 technomancy: (+ 1 2 3) => -4

16:12 gtrak: will try

16:12 technomancy: yeah, you can redefine it, but not retroactively

16:12 just like ML

16:13 Borkdude: ah, got it

16:14 I guess you can break anything if you want to

16:15 technomancy: yes, but it's not like Ruby which makes huge performance sacrifices to make redefining 2+2 work reliably =)

16:15 Borkdude: even with-redefs doesn't support retroactive defining on + or -

16:16 I guess this goes for all "inlined" fns?

16:16 technomancy: yes, though you can still change the behaviour of + when used as a HOF

16:16 since you can't inline HOFs

16:16 Borkdude: technomancy: + as a HOF, or in a HOF?

16:17 technomancy: + as a HOF

16:17 Borkdude: technomancy: example?

16:17 technomancy: ,(with-redefs [+ -] (map (partial + 2) [1 2 3]))

16:17 clojurebot: (1 0 -1)

16:17 Borkdude: ah

16:17 dnolen: Borkdude: I believe applies to primitive fns as well as protocol fns on Clojure JVM as well.

16:18 Borkdude: (partial + 2) isn't + as a HOF though, it is the HOF partial given + returning a new function which isn't + ;)

16:18 technomancy: IMO they're both HOFs

16:18 since they're arguments

16:19 Borkdude: my definition of a higher order function is a function that take functions as arguments and possibly return new function, but don't necessarily need to (like map)

16:19 + doesn't take a function as an argument

16:20 iwo: hey, is there a shorter way to do this:

16:20 (filter #(string/substring? "gnu" (key %1)) (System/getProperties))

16:20 Borkdude: but my definition might be incorrect, correct me

16:20 amalloy: that's the technically correct definition, but "+ as HOF" colloquially would mean "+ used as a value, not called immediately"

16:20 iwo: i.e. filter map for only some keys that match pred

16:20 * technomancy claims colloquiality

16:21 Borkdude: I have to think about that for a while, brb ;)

16:21 technomancy: iwo: that's pretty short already once you take out the pred and the map =)

16:24 iwo: technomancy: i guess so: (filter gnu-entry? props)

16:24 technomancy: iwo: you might need to (into {} (filter [...]))

16:25 iwo: technomancy: sorry, i don't understand. why?

16:26 technomancy: iwo: depending on whether you want a map back or a lazy seq of k/v pairs

16:26 iwo: oh i see

16:26 technomancy: yes, much more useful

16:29 wink: hehe, last 2 lines. nice coincidence? :P

16:33 bobry: is it possible to test clojurescript applications with 'clojure.test'?

16:35 dnolen: bobry: no - tho that would be a welcome addition if you want to take the time to put something like that together.

16:35 bobry: that's unfortunate :(

16:43 rlb: What would be the idomatic way to find the index of the first item in a collection that satisfies a predicate (other than equals)? I'm assuming there's something better than a manual recursion.

16:43 dnolen: bobry: easily remedied via community contribution, early days yet. CLJS hits 1 year from the first commit in 8 days.

16:44 gfredericks: ,(doc keep-indexed)

16:44 clojurebot: "([f coll]); Returns a lazy sequence of the non-nil results of (f index item). Note, this means false return values will be included. f must be free of side-effects."

16:44 adeelkh: what's the situation with exception handling in clojurescript? do we have try and catch?

16:45 dnolen: adeelkh: yes

16:46 rlb: gfredericks: oh, right, that'll do -- thanks.

16:51 kmicu: WARNING: The form (. "S" toLowerCase) is no longer a property access. Maybe you meant (. "S" -toLowerCase) instead? What is a proper way? I can't find it in host interop docs :)

16:51 TimMc: (.toLowerCase "S") probably

16:52 kmicu: from this I have warning

16:52 adeelkh: dnolen: I get `WARNING: Use of undeclared Var stopwatch.logger/catch`

16:52 dnolen: adeelkh: paste

16:52 amalloy: you probably have a bad macro

16:53 eg, one that expands to a catch without a try, and then you wrap that in a try elsewhere?

16:53 bobry: is there something special about having atoms in :pre constraints? the second one in 'machine' doesn' work https://gist.github.com/3e97073b9fc6cec40fc1

16:54 adeelkh: dnolen: https://gist.github.com/2764601

16:54 amalloy: i haven't written any macros

16:55 amalloy: too many )s

16:55 adeelkh: argh

16:55 amalloy: or misbalanced, anyway - the catch is indented as if it were in the try, but it isn't

16:56 dnolen: adeelkh: nice you're playing around with CLJS + node

16:56 adeelkh: dnolen: yeah, it's pretty cool. i just haven't figured out how to get a repl running though

16:57 dnolen: adeelkh: still waiting for someone contribute one of those too :)

16:57 adeelkh: dnolen: i might try to do it myself then, because i really miss the repl

17:01 Borkdude: technomancy: btw, I told my class to deploy their clojure apps to heroku ;)

17:02 technomancy: Borkdude: high five: o/

17:02 adeelkh: amalloy: well, i fixed the parentheses but it doesn't actually seem to be catching the error

17:03 https://gist.github.com/8a508324634e779de53f

17:03 (the warning about catch being undeclared is gone though now)

17:04 amalloy: that's the usual issue with laziness

17:04 (map f coll) instantly returns a lazy sequence; when you later realize its elements you are no longer inside a try/catch

17:04 dnolen: adeelkh: you need to specify the Error constructor you want to match

17:05 adeelkh: (catch js/Error e ...)

17:05 adeelkh: dnolen: aha, that worked. thanks

17:06 amalloy: really? dnolen, why does that work? like, for sure js/Error is a necessary fix, but shouldn't it break for the reason i said?

17:06 adeelkh: amalloy: in this case the error was in the evaluation of coll itself (not in the lazy sequence returned by map)

17:06 amalloy: ah, okay

17:07 Raynes: amalloy: pwned

17:08 Borkdude: is smth like this already in clojure.core? https://gist.github.com/2764700

17:08 goodieboy: we're using https://github.com/amitrathore/medusa and it's giving us problems now that we're bumping up clojure to 1.3 -- anyone know of an alternative?

17:12 Raynes: Borkdude: Not really. You can use (read-string ..) but keep in mind that it will read more than just numbers and make sure to disable read-eval if you use it.

17:12 If data can come from an outside source, that is.

17:13 S11001001: goodieboy: from general experience, it would probably be much easier for you to fix medusa than change your codebase to use an alternative API

17:13 Borkdude: Raynes: ah, what kinds of objects can it read?

17:13 Raynes: Anything the Clojure reader can read.

17:14 &(doc read-string)

17:14 lazybot: ⇒ "([s]); Reads one object from the string s"

17:14 Raynes: &(doc read)

17:14 lazybot: ⇒ "([] [stream] [stream eof-error? eof-value] [stream eof-error? eof-value recursive?]); Reads the next object from stream, which must be an instance of java.io.PushbackReader or some derivee. stream defaults to the current value of *in* ."

17:14 gfredericks: ,(read-string "(read-string \"(read-string)\")")

17:14 clojurebot: (read-string "(read-string)")

17:14 Borkdude: Raynes: great, good to know, but here I read in something which comes from an html form, so I'll use my own fn for now

17:14 goodieboy: S11001001: true, but our code is really only using the fixed thread pool, not using any of the stats stuff -- but i can look into it, i agree with you

17:15 gfredericks: ,(read-string "<html><body><div id=\"tommy\"></div></body></html>")

17:15 clojurebot: <html><body><div

17:16 Raynes: Borkdude: You could do (binding [*read-eval* false] (read-string foo)), but then you'd also need to check if the result was really a number.

17:16 In the end, you'd probably end up with more code than that function you've got now.

17:17 Borkdude: Raynes: yeh, now I can just write: (if-let [num (parse-int answer)] … …)

17:20 I like expression oriented programming

17:21 Raynes: I like Borkdude oriented programming.

17:21 Borkdude: :)

17:22 technomancy: statements are great as a heuristic to determine whether a language designer has been exposed to other languages or is just making it up as he goes

17:23 ForSpareParts: Does anyone know a good programmatic way to analyze a function and retrieve information about the functions it calls?

17:24 I was hoping that it'd be easy/easier to do in Clojure because of the whole lisp "code-is-data" thing, but I may have been foolishly optimistic.

17:24 gfredericks: by "a function" you mean "the source for that function"?

17:24 iwo: hey, does anyone know where i can get a "light table" theme for emacs?

17:24 Borkdude: ForSpareParts: you can do static analysis using https://github.com/frenchy64/analyze

17:25 ForSpareParts: gfredericks, Yeah. If it were possible to do that with only access to compiled code, that'd be pretty wild. But I do have source.

17:27 Borkdude, I have looked at that project briefly before, and it seems promising. I'm a little worried it'll be over my head as a new clojure user, though. Are there any guides/tutorials/articles on it anywhere?

17:27 TimMc: gfredericks: What's in lib-5141? For some reason, I couldn't tell by the name. :-P

17:28 Borkdude: ForSpareParts: you can start following @ambrosebs on twitter and bug him ;)

17:28 ForSpareParts: Borkdude, Fair enough. : )

17:29 And actually, as a more general question: was I right to think that this would be a task particularly well suited to Clojure? I'm thinking about using this for a work project, but it'd be bad form for me to reinvent the wheel

17:29 (and basically everything we do is in Java)

17:29 gtrak: ForSpareParts: are you analyzing java?

17:30 technomancy: ForSpareParts: this project is one guy's grad thesis; you would probably need a pretty big team to pull this off for Java

17:30 gtrak: or just steal it from eclipse?

17:30 technomancy: well, it's not even his thesis, it's just some library he needed to exist before he could start work on his thesis

17:30 for a bit of perspective =)

17:30 ForSpareParts: Well, I could be. The functions I want to analyze haven't been written yet, and that's why I'm thinking about this -- if doing some of my work in clojure would make analyzing the code easier, I'd be inclined to try making my project in Clojure.

17:31 Borkdude: a class of mine is doing this kind of thing: https://github.com/husacct/husacct

17:31 ForSpareParts: thanks, technomancy.

17:31 Borkdude: they use anltr for it

17:31 antlr

17:32 ForSpareParts: Basically, these are speculative questions at this point -- I'll be writing a bunch of testing stuff, and I was thinking that having that kind of metadata on my tests would be useful for optimizing regression testing and that sort of thing.

17:32 And, to be perfectly honest, I think Clojure is neat and I've been looking for a good excuse to build something with it : D

17:33 Borkdude: ForSpareParts: you can look around for some clojure+antlr examples on the web

17:33 ForSpareParts: if you want to do Java analysis

17:33 solussd: how do you call window.location.reload() from clojurescript? afaict, I can do (js/some_func arg), right?

17:34 Borkdude: bye folks

17:34 amalloy: (.reload (.-location js/window))?

17:35 solussd: what is the .-thing syntax mean exactly?

17:35 property access?

17:35 amalloy: yes

17:35 solussd: ah

17:35 thanks

17:39 adeelkh: how do i turn a clojure map into a javascript object, in clojurescript?

17:40 dnolen: adeelkh: you have to write your own converter.

17:41 pandeiro: would it make sense to have a canonical js interop ns like clojure.tools.javascript or something?

17:41 adeelkh: dnolen: hm, how should I do that? i have a map of config options i have to pass to a node library

17:41 dnolen: so it's just {"style" {"compact" true}} in this case

17:41 eggsby: why might I get an error like: Could not locate clojure/contrib/server_socket__init.class or clojure/contrib/server_socket.clj on classpath from the lein repl?

17:41 pandeiro: adeelkh: https://gist.github.com/1658431

17:42 dnolen: adeelkh: (js-obj "style" (js-obj "compact" true))

17:42 adeelkh: ah, thanks

17:42 technomancy: eggsby: it's using deprecated contrib

17:42 dnolen: adeelkh: js-obj + array handles the common interop cases.

17:44 technomancy: eggsby: gimme a minute

17:44 eggsby: technomancy: I just have 1.2 listed in the project.clj, shouldn't that have socket-streams ?

17:45 err, server socket*

17:45 technomancy: eggsby: yeah, but you shouldn't put old contrib in project.clj; it's gross.

17:48 eggsby: technomancy: https://github.com/technomancy/mire/blob/01-echo-server/src/mire.clj#L12 is this referring to clojure.contrib.io/read-lines ?

17:50 technomancy: eggsby: yeah

17:50 I guess if you're going step by step you're going to run into the old contrib stuff

17:50 eggsby: is it a typo that it says read-line or am I missing something

17:50 I might just use https://github.com/weavejester/tcp-server instead of socket-server

17:50 technomancy: oh, my bad

17:50 it's clojure.core/read-line

17:51 eggsby: aah, ok

17:52 could I get away with using weavejester's tcp server technomancy ?

17:53 technomancy: eggsby: no need; just pull the latest

17:53 just pushed an update

17:54 espeed: What's the general consensus on specifying a protocol implementation as a map so that its methods can be overridden?

17:54 eggsby: ah thanks technomancy

17:56 antares_: espeed: if you *really* need overriden implementations, it will work fine.

17:57 espeed: so it's not recommended as a standard practice?

17:59 antares_: espeed: reusing/overriding implementations The OO Way is often just not necessary.

18:02 espeed: thanks

18:08 ibdknox: dnolen: why is it when I have the cljs compiler repo as a dep does it always print everything out the first time I compile?

18:09 dnolen: ibdknox: first I've heard of that.

18:09 ibdknox: weird

18:09 it only happens if I use the git repo

18:09 dnolen: ibdknox: you building with lein-cljsbuild?

18:10 ibdknox: dnolen: calling build directly

18:10 I'm doing the equivalent of what lein-cljsbuild does

18:11 dnolen: ibdknox: but you don't encounter that with lein-cljsbuild right?

18:11 ibdknox: let me try

18:12 dnolen: correct

18:16 dnolen: ibdknox: then I'm not sure what's up.

18:17 ibdknox: might want to compare what you do differently.

18:17 ibdknox: I'll assume it's my fault somewhere then :)

18:45 * nDuff bangs his head a bit more on trying to get nREPL to work in an OSGi environment

18:49 dherman: dnolen: so without concurrency, what would you say are the killer one or two motivators for clojurescript? macros? expressive data abstraction?

18:50 Raynes: Not having to use javascript seems to excite people quite a bit.

18:52 dherman: Raynes: I'm preparing a slide about different languages that compile to JS, so they all have that feature. the question is differentiating clojurescript from others

18:52 TimMc: dherman: Fewer pitfalls to keep in mind, I suppose. I like to be able to iterate over a collection without having to be cautious.

18:53 Raynes: The data structures are a nice win. Clojure has excellent data structures.

18:53 dnolen: dherman: persistent data structures

18:53 dherman: the point isn't to contrast it with JS, since all languages that compile to JS eliminate the pitfalls

18:53 TimMc: Hmm, I see.

18:53 dnolen: dherman: comprehensive abstractions - like iteration for all types including natives

18:53 dherman: k

18:54 dnolen: dherman: sensible solution to expression problem

18:54 dherman: if I wrote "comprehensive data abstraction" would that be accurate?

18:54 dnolen: dherman: including natives

18:54 dherman: yes, but it's important that types that you don't control can be easily subsumed

18:54 dherman: oh that's good, more intuitive -- uniform data abstraction (including host objects!)

18:54 dnolen: dherman: yes

18:55 dherman: nice, thx

18:55 dnolen: dherman: lots of minor stuff, like let scoping, no fear of aliasing, no mutable locals, no need for cloning

18:55 dherman: thx

18:55 yeah, this is just a one-line of high points

18:55 so that's enough

18:56 dnolen: dherman: cool

19:03 dherman: which other compile-to-JS projects are you covering? CoffeeScript & Roy?

19:04 dherman: on that slide, I'm just mentioning a few for example. CoffeeScript, ClojureScript, Roy, FBJS, TameJS

19:04 technomancy: parenscript?

19:04 TimMc: haha

19:04 GWT?

19:04 dherman: technomancy, TimMc: there are maaaaaany languages that compile to JS. not looking for completeness.

19:04 but later in the talk I'm talking about different topics that haven't been talked about quite as much yet

19:05 TimMc: I've actually not heard of Roy, FBJS, and TameJS.

19:05 dnolen: dherman: what's the gist of the talk?

19:05 dherman: dnolen: "The JavaScript Virtual Machine"

19:05 dnolen: dherman: ooh nice :)

19:05 dherman: why I think JS is a compelling VM, and where I'd like to see it go

19:06 technomancy: "JS is a compelling VM" or "JS has some compelling VMs"?

19:06 dherman: TimMc: Roy: an MLish language (static types, pattern matching); FBJS = Facebook JS (security language); TameJS: CPS-based language with coroutines for sync-style event handling

19:06 technomancy: JS as the VM for targeting other languages to

19:06 technomancy: it's not a VM though

19:07 or you mean it as a metaphor?

19:07 dherman: depends on how optimistic you are about precisely defining "VM"

19:07 Raynes: metophypothetically

19:07 dherman: I'm happy treating it either way

19:07 McMartin: Let's go with "target platform"

19:08 Raynes: I'm not sure how you could define 'VM' that would let it include js.

19:08 It makes perfect sense metaphorically though.

19:08 technomancy: doesn't the term "JavaScript™" technically only apply to Mozilla's implementation?

19:08 or is that not true anymore

19:08 dherman: technomancy: not really

19:09 or, it's unclear at best

19:09 Sun owned the copyright to the name "Java"

19:09 now Oracle presumably does

19:09 technomancy: I mean, it used to be that ECMAScript was the name of the language, and JavaScript and JScript were the two implementations that existed.

19:09 dherman: but nobody really knows the status of it

19:09 technomancy: it was only called ECMAScript b/c JavaScript was copyrighted by Sun

19:09 technomancy: dherman: you can't copyright names

19:09 dherman: but they were meant to be the same thing

19:09 technomancy: are you talking about trademarks?

19:10 dherman: sorry, yes, trademark

19:10 wrong term

19:10 technomancy: I don't think the Java trademark applies to JavaScript

19:10 McMartin: Does JS have a standard bytecoded format?

19:10 dherman: they trademarked both

19:10 McMartin: no

19:10 * McMartin wonders how readily it could be turned into something like Parrot.

19:11 dherman: McMartin: you should listen to my talk this week ;-)

19:11 McMartin: Maybe I should! Where is it?

19:11 dherman: Oslo

19:11 McMartin: Sadly, I'm going to be in San Diego this week.

19:11 dherman: but it'll be recorded

19:11 McMartin: Will there be slides/a paper associated with it?

19:11 dherman: no paper, but definitely slides

19:11 in Full HTML5 Technicolor

19:11 dnolen: dherman: looking forward to it

19:11 dherman: thx

19:11 * McMartin was a languages/compilers geek in grad school, doesn't get a chance to do that much anymore

19:12 dnolen: dherman: targetting JS has been pretty awesome, I fully support the "JavaScript Virtual Machine"

19:12 dherman: :)

19:12 dnolen: dherman: down with Dart!

19:12 dherman: haha

19:12 Dart. feh

19:12 McMartin: dnolen: "Hey, nice dart you got there, now, about that JS V8 and what reasonable type inference nets you..."

19:13 Why yes, I do consider compiler technologies to be 1930s movie gangsters, don't judge

19:14 dherman: McMartin: SpiderMonkey has better type inference than V8 :)

19:15 brehaut: dherman: don't go using facts when talking about V8! The Holy Node will strick you down

19:15 McMartin: dherman: V8 is the only one I had numbers handy for, though.

19:16 dherman: well, V8 still beats us on many benchmarks, but our TI algorithm is more sophisticated

19:16 McMartin: (Specifically, from http://julialang.org/ and its table that accidentally says "why you should probably use JSV8 instead of Julia")

19:16 dherman: http://rfrn.org/~shu/drafts/ti.pdf

19:16 McMartin: Now I have to see if you cited any of my colleagues >_>

19:17 dnolen: dherman: it's been interesting finding the optimal line between what type of code optimizes on V8, SM, and JSC

19:17 dherman: dnolen: you know way more than I do, I'm sure

19:18 dnolen: dherman: SM and JSC tend to optimize real JS patterns. V8 often seems happier with lower level stuff.

19:18 McMartin: I can readily believe that

19:19 dherman: interesting. how do you determine that patterns are real?

19:19 McMartin: (Also: well, I recognize a few of those names)

19:19 dnolen: dherman: example - iterating over JS object keys with for in is slower than holding the keys in a array yourself and iterating over that.

19:20 on V8

19:20 not true for SM or JSC, but iterating over array is not slow - so it's a solution that works well for all.

19:20 dherman: huh. like, for (var a = Object.keys(o), i = 0, n = a.length; i < n; i++) { ... } ?

19:21 dnolen: dherman: no for(var k in obj) { ... }

19:21 dherman: right, but what's the faster alternative?

19:21 dnolen: dherman: store the keys in an array ourselves.

19:21 dherman: that's what I did...?

19:22 dnolen: no calls to Object.keys

19:22 dherman: so you start with a for-in loop and cache the keys, and then do multiple for loops over the array?

19:23 IOW, this only gives you savings if you loop multiple times over the same set of keys

19:23 it can't possibly be faster for one single loop

19:23 dnolen: dherman: some explanation - JS objects do double duty as real maps and types w/ fields.

19:23 dherman: CLJS provides proper map abstraction

19:24 dherman: complex keys etc

19:24 dherman: but we optimize string key only maps - since we have our own map abstraction, we track keys as their added.

19:24 they're

19:24 dherman: aha

19:24 that's what I missed

19:24 ok

19:33 brainproxy: re-implementing node-clojurescript in clojurescript, using node-clojurescript .. fun :D

19:56 archaic: Incanter 1.3 and quil 1.4.1 both use processing.org and when combined in the same project clash (quil fails to find static methods in proccessing.core.PConstants), I didn't think this was possible - for seperate libraries to interfere with each other like that (lein2, clojure 1.4.0)

20:04 technomancy: archaic: without special tricks, you can only load one version of a given library at once

20:04 kwertii: Is there some magic trick needed in Korma to do WHERE clauses with timestamps?

20:04 technomancy: so naturally it's easy for one dependency to win and the other one to complain

20:06 nDuff: How can I populate a namespace other than the one I'm in?

20:06 technomancy: change namespaces

20:07 nDuff: technomancy: ...so, for interactive use, that completely makes sense. In the case where I'm writing a function which to populate the user ns before kicking off a nREPL service which will (unconfigurably) default to it, I'm not quite as sure how that'll work.

20:08 technomancy: there are lots of ways to change namespaces

20:08 one way is to eval code when inside (binding [*ns* ...])

20:08 gfredericks: ,(macroexpand-1 (ns foo.bar))

20:08 clojurebot: nil

20:08 gfredericks: ,(macroexpand-1 '(ns foo.bar))

20:08 clojurebot: (do (clojure.core/in-ns (quote foo.bar)) (clojure.core/with-loading-context (clojure.core/refer (quote clojure.core))))

20:09 nDuff: Ahh.

20:11 eggsby: technomancy: After watching this video, I'm glad I don't need to run my clojure apps and tests with shell scripts... thanks for that

20:12 technomancy: eggsby: haha; yes, it's a nice peek into the dark ages

20:34 mebaran151: I'm trying to figure out how event binding works in jayq and clojurescript: how do I get the element that was clicked in a click handler?

20:39 brehaut: mebaran151: at a guess, the first argument to the event handling function is a dom event object?

20:40 mebaran151: or at least, the jquery wrapped event

20:40 mebaran151: in which case e.target is the target node

20:40 mebaran151: I've been trying something like that, but I just realized calling a function from the repl is different from clicking it

20:41 brehaut: target is a property, not a function

20:41 and yes

20:41 $(object).click() will simulate the click

20:41 translate that to cljs obviously

20:41 mebaran151: thanks brehaut; I'm still getting the hang of cljs

20:42 brehaut: no problem. i dont know anything about clojurescript though ;)

20:42 mebaran151: I have some familiarity with jQuery, but I thought in the long run, it might be worthwhile to code some of the logic in cljs, especially as I add more remoting to the mix

20:44 brehaut: seems reasonable. and you'll get to avoid some of the quirkiest parts of jquery

20:44 (eg, each, map etc)

20:46 mebaran151: just figured out console log; very much my friend

20:48 brehaut: mebaran151: console.dir(console) and have a look at the prototype. theres lots of handy stuff there

20:51 mebaran151: probably just 'console' is fine, but i cant never seem to predict when the console will return some other form for the data

20:52 mebaran151: whoopee, got it working

20:52 I'll check out console.dir

20:59 emezeske: dnolen: Have you noticed the clojurescript compiler output sneaking upwards in size again recently?

21:02 muhoo: is there a quick one-liner to transform map keys? i.e. to make {:foo "bar" :baz "quux"} into {:blah "bar" :yah "quuz"} ?

21:03 basically :foo -> :blah, and :baz -> :yah

21:03 dakrone: ,(doc clojure.set/rename-keys)

21:03 clojurebot: Gabh mo leithscéal?

21:03 dakrone: muhoo: well, clojure.set/rename-keys http://clojuredocs.org/clojure_core/clojure.set/rename-keys

21:07 muhoo: perfect, thanks!

21:07 clojure.core is like a chinese restaurant menu. so many dishes, all so tasty.

21:08 McMartin: And kind of poorly indexed when you're looking for something specific >_>

21:08 * McMartin is finally starting to get the hang of it

21:08 muhoo: and it could take years if you actually want to try them all

21:10 McMartin: http://clojure.org/cheatsheet is the best i've found yet

21:11 McMartin: Yeah, but even that cheatsheet I have to Ctrl-F to find what I need

21:12 muhoo: heh, methinks it is time for protocols and deftypes: https://www.refheap.com/paste/2821

21:12 protocols and defrecords, sorry

21:14 i'd like to add a function to emacs clojure.el to hotkey a function and let it show the docs, not in a browser, but in the repl, without having to type (doc foo) all the time

21:14 emezeske: muhoo: That seems totally reasonable as just a map to me

21:14 * emezeske shrugs

21:15 mebaran151: muhoo: you need the polymorphism?

21:15 muhoo: it'd be nice to have default implementations, yes

21:15 emezeske: Multimethods are pretty nice for that sort of thing

21:15 mebaran151: wouldn't the default just be a function that expects a map with certain keys?

21:16 muhoo: the default would fill in the keys

21:16 so i don't get NPE's :-)

21:16 mebaran151: muhoo: you could put together a template map and just merge your custom maps on top of it

21:16 muhoo: ((:save-button fsettings) "foo") is unpleasant if :save-button hasn't been defined, but i'm fine with using hiccup.form/save-button as a default

21:17 mebaran151: perfect, thanks!

21:35 amalloy: muhoo: C-c C-d C-d

21:35 emezeske: ibdknox: ping

21:37 ibdknox: unping :) I thought something was up with jayq, but I was using some crazy accidental local version

21:52 mebaran151: hey emezeske I'm using bootstrap.js from a CDN; how do I get it to compile on Advanced?

21:56 emezeske: mebaran151: You need to write an externs file

21:56 mebaran151: Except that you're lucky, and I happen to also be using bootstrap

21:56 mebaran151: Paste incoming :)

21:56 mebaran151: emezeske: oh many many thanks :)

21:57 emezeske: mebaran151: So, stick this in something like boostrap-externs.js: https://www.refheap.com/paste/2822

21:57 And then set :compiler {:externs ["path/to/bootstrap-externs.js"]}

21:58 mebaran151: do I throw this in a public directory or no?

21:58 emezeske: Nah, it's just used at compile time

21:58 mebaran151: let's try it...

21:58 emezeske: *Note: I have no idea what I'm doing with externs files, I just sort of threw that together until it worked for me

21:58 mebaran151: I may need to add more, but I see the idea

21:59 maybe it would be wise to pull down a local version of bootstrap just for compiling

21:59 that had all the functions which the Closure would then note

21:59 emezeske: You can use the original bootstrap.js as an externs file

21:59 But it will produce a ton of warnings

22:00 mebaran151: I still get a lot of warnings that .text doesn't mean .-text, etc

22:00 anyway to suppress those?

22:00 emezeske: Write an externs file ^_^

22:00 mebaran151: haha

22:00 they seem to be coming from jayq

22:00 emezeske: Hmm I don't get any of those any more

22:00 Maybe upgrade your compiler version?

22:01 That warning was removed from the compiler a while back

22:02 mebaran151: I'm just lein-cljsbuild 0.1.8

22:02 *using

22:02 emezeske: Hmm, that's pretty new. You might try 0.1.10, though

22:03 mebaran151: just pulled

22:03 same warnings

22:04 emezeske: Uh, that's very weird, I wonder if somehow you're inadvertently using an older version

22:05 mebaran151: emezeske: it looks like it's pulling the right jar (saw maven pull it)

22:05 could it be my jayq version

22:05 emezeske: What's the exact text of the warning?

22:06 mebaran151: WARNING: The form of (. this String) is no longer a property access....

22:06 emezeske: So, the string "property access" does not appear in the current version of the compiler (using grep)

22:06 mebaran151: hmmmm

22:06 curious

22:06 emezeske: Very!

22:08 mebaran151: ah, upgrade noir-cljs fixed it

22:08 *upgrading

22:09 emezeske: Sweet.

22:09 mebaran151: one of them must have overridden my running cljs

Logging service provided by n01se.net