#clojure log - Dec 24 2012

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

0:16 alex_baranosky: my internet connection's out of whack, so sorry if I appear to be ignoring any responses

0:16 This appears to be doing what I want, but investigating further: (filter (complement coll?)

0:16 (rest (tree-seq coll? seq x)))

0:20 Raynes: alex_baranosky: Do you want to get a sequence of anything that isn't a collection? If so, the first one is great.

0:21 alex_baranosky: Raynes: I want to break the body of a namespace into all of its 'atoms' aka strings/symbols/keywords/numbers/etc

0:22 Raynes: Why on earth would you do a thing like that?

0:22 alex_baranosky: the version I posted works for that, or so it seems

0:22 making slam hound work

0:22 Raynes: Rename it to something useful while you're at it.

0:22 alex_baranosky: I'll call it 'useful' then :)

0:23 Raynes: amalloy already has that

0:35 tomoj: alex_baranosky: you need to upgrade swank-clojure

0:36 I have {:user {:plugins [[lein-swank "1.4.4"]]} {:dependencies [[swank-clojure "1.4.3"]]}}

0:36 alex_baranosky: tomoj: you saw my mailing list post? Thanks :)

0:36 tomoj: seems like there should be a new lein-swank release

2:28 bbloom: dnolen: you totally need to do a core.logic version of http://luckytoilet.wordpress.com/2012/12/23/2125/

2:32 needs optimization, however

2:40 tomoj: I vaguely remember there once being a big prize for a good minesweeper ai

2:41 oh

2:41 that's just the P=NP prize

2:41 :)

2:42 media: "you can win $1 million for solving minesweeper!"

2:56 bawr: Lein, why do you hate me so? Or at least my CPU. :<

3:31 Raynes: bawr: What is it doing?

3:33 bawr: Raynes: I think it's trying to fry an egg. Except there is no egg.

3:33 Raynes: Okay.

3:35 bawr: I guess that's what I get for being lazy and doing OpenJDK instead of Sun's JDK.

3:54 wingy: i have a map with keys/values and want to sort them based on their values into a vector (since maps are unordered).. how can i do that?

3:55 tomoj: &(sort-by val (zipmap (range) (take 10 (repeatedly #(rand-int 100)))))

3:55 lazybot: ⇒ ([2 0] [0 13] [1 28] [4 29] [8 46] [6 47] [7 52] [9 70] [3 92] [5 92])

3:56 Raynes: (sort-by val ..)

3:56 Without all the zipmap stuff that might confuse you.

3:58 tomoj: I suppose {:foo 3 :bar 2 :baz 1} would have been less confusing :)

3:59 wingy: yeah .. im reading up on sort-by

4:00 bawr: tomoj: oh, but isn't it fun when 90% of your answer is just boilerplate for data generation? ;)

4:01 tomoj: maybe lazybot could have a-map etc bound by default to generally useful values

4:01 mehwork: is there a way to make it so defn foo [& args] will reset args each time it's called? right now when i print args it shows all the values that were ever passed to that function from everything that called it

4:01 tomoj: eh, that's probably more confusing than helpful

4:04 mehwork: I think you must be confused about what's happening - if you refheap'd an example of the problem you might be able to get an answer

4:07 callen: does anyone use a frontend asset compiler with their Clojure project?

4:07 I found one that works for ClojureScript, but I need to roll in other dependencies.

4:08 mehwork: tomoj where can i read about what & args does?

4:15 tomoj: I dunno

4:15 &(let [f (fn [& args] (println args))] (f 1 2 3) (f 4 5 6))

4:15 lazybot: ⇒ (1 2 3) (4 5 6) nil

4:18 tomoj: anyway, it just does what you probably want, not what you think it does :)

4:23 wingy: clojure is the best lang ever!

4:23 Raynes: oh em gee

4:25 mehwork: you must not have seen php

4:26 they have lambduz and interfaces. Anything goes, even goto

4:26 php 6 is probably going to have inline asm

4:27 wingy: really

4:27 mehwork: no, but it wouldn't surprise me :p

4:27 wingy: might have to check that out .. php sounds hot

4:28 mehwork: they have bitwise operations even though none of their users will ever know what that means

4:28 wingy: i like goto .. it's like having a back door to any place

4:30 Raynes: Yeah, but all the places are hell.

4:31 All of the places end with you being fired and me hating you.

4:32 Ember-: haha, PHP. Now there's a language :)

4:33 it's so hilarious it has it's place in the programming world solely for that

4:33 but of course it's less hilarious if you're forced to do anything serious with it

4:33 I've been lucky and I've done only two semi serious things with it

4:33 enough to see it's insanity

4:34 wingy: the creator should be executed on the spot

4:34 without a trial

4:35 Ember-: I just love the attitude of the PHP creators

4:36 this is a wonderful article about why PHP sucks so badly :) http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/

4:36 longish but worth the read

4:37 callen: bwahahahaha

4:37 anon_1337: isn't clojure the PHP of functional programming?

4:37 callen: technomancy: I just broke your employer's system.

4:38 wingy: ill save that for a before sleep reading

4:38 clojurebot: Titim gan éirí ort.

4:38 callen: technomancy: I necromancy'd an ancient account and logging in threw a 500

4:38 borkdude: trying to commit suicide?

4:39 borkdude: callen hehe

4:42 callen: god dammit

4:42 I tried logging in via another newer account and it 500'd

4:42 is Heroku's admin panel down for anybody else?

4:43 wingy: callen: nope

4:43 callen: I must be cursed then.

4:44 I've got two different accounts 500'ing.

4:44 and it's Christmas

4:44 so this is unlikely to get fixed for like...a week or two.

4:44 wingy: you shouldn't be coding on christmas!

4:45 callen: wingy: I'm single, male, no family, an inveterate nihilist, and I have an itch to scratch. Heroku being down is slowing down my itch-scratching and that makes me mad.

4:45 wingy: callen: if you live in SF give me a call and we'll go n party :)

4:45 callen: wingy: actually, this is doable, I'm in Mountain View.

4:46 borkdude: callen no family? they all died or ?

4:47 callen: borkdude: nobody's died recently, AFAIK

4:50 Ember-: hmm, in my opinion Christmas is the best possible time to code your own little projects :)

4:51 borkdude: yeah, xmas is a good time for hobby coding

4:52 Ember-: just had a blast while sitting for 7 hours in a train

4:52 did some programming for my own little project

4:53 callen: Ember-: agreed.

4:53 in my case I have an actual itch to scratch that's been irritating me for a long time.

4:54 Ember-: yeah, I know what you mean

4:54 callen: Ember-: the project is a searchable personal database, mostly for notes and links.

4:55 Ember-: it may sound like something I could use an existing webapp for, but you'd be surprised. I haven't found anything that was particularly good and focused on links. Delicious is fairly awful for how I collect links.

4:55 Ember-: hehe

4:55 my project is the old play by email game called Stars! as a HTML 5 version

4:56 I love that game but it *is* a bit too outdated for my taste

4:56 so I decided to create my own version with modern technologies

4:56 callen: Ember-: that actually reminds me of something. "Play by email" is one of those slow-web things, I think there's a lot of room for "slow-web" asynchronous type stuff to get updated and brought into the modern world.

4:56 Ember-: which don't force you to install a separate client or anything, everything is in the browser and in the clojure backend

4:57 callen: Ember-: cool project :)

4:57 Ember-: yeah, I agree :)

4:57 turn based and it will stay that way but will take advantage of real time possibilities provided by the architecture

4:57 for example, in the original game diplomacy was done through tedious messaging system

4:58 you wrote a message and the recipient received your message when next turn was generated

4:58 now with modern browsers it's easy to create a realtime chat for that

4:59 and I have a lot of other ideas too, but will start with a nearly identical copy of the original game since I'm not a game developer and I might very easily break the balance

5:00 callen: Ember-: are you familiar with the game, "OGame"?

5:00 Ember-: no

5:00 callen: Ember-: it had a funky mix of time-delay-based asynchronous gameplay

5:01 Ember-: it wasn't "turn based", as in, you could repeatedly take actions before your opponent could

5:01 Ember-: this one? http://www.ogame.org/

5:01 tomoj: wow, 0 and O look identical in the font I use in emacs. wtf and how have I not noticed this before?!

5:01 callen: Ember-: but the time-scale was very different, it'd take 2, 10, 20 hours to send a fleet to attack a planet dpeending on how far away it was

5:01 Ember-: yes that.

5:01 tomoj: that's pretty egregious.

5:02 tomoj: OTOH, when your programming language doesn't consider a boolean false and 0 to be identical, you don't see as many of them...

5:02 Ember-: anyway, just thought I'd mention a game that has some similar design priorities.

5:02 Ember-: yeah, nice to know about that

5:02 thanks

5:03 I'm happy to have inspiration from all kinds of games for my little project

5:03 "little"

5:03 :D

5:03 callen: Ember-: I'm kinda obsessed with game mechanics as a general subject and hobby.

5:03 Ember-: let's see if this finishes

5:03 callen: Ember-: like for example, I've spent a fair bit of time just thinking about how different games and systems model "time".

5:03 Ember-: :)

5:03 callen: there's more variety than one might suspect, but not as much as it merits.

5:04 and I don't mean some kitschy gimmick like being to reverse time.

5:04 Ember-: I kinda like the idea of linear time progress instead of turns

5:04 but it makes a lot of things harder

5:04 callen: Ember-: aye. So the way you could linear time progression ala OGame is to allow user actions to create scheduled triggers (events)

5:04 Ember-: yeah, I understand

5:04 it's in many ways similar to the way Stars! works

5:05 callen: Ember-: the reason for a linear time progression model is that it allows for many people to act in concert

5:05 Ember-: you tell your ships etc that "when you encounter x do y"

5:05 callen: Ember-: the reason is to allow an MMO scale of galaxy.

5:05 many people cooperating, etc.

5:05 Ember-: yeah, well that is achieved also in turn based game via diplomacy

5:05 but that *is* an interesting idea

5:05 callen: well the issue with a turn-based game, especially as the number of players increases, is that everybody blocks on whoever hasn't taken their turn.

5:06 acron^: how can I turn a string (":a") into a map key (:a

5:06 (:a)*

5:06 Ember-: it might be a good idea to build my game in such a way that you could start the game later as linear time based

5:06 callen: acron^: don't use :a

5:06 Ember-: first the turn based version, later the linear time

5:06 if I find it feasible

5:06 callen: another reason OGame was built that way, was to allow for a flexible amount of "investment" into their actions.

5:06 whereas turn-based games by definition have a limited amount of action you can take per turn

5:06 acron^: callen: i kinda need to

5:06 callen: acron^: it's straight forward to convert "a" -> :a

5:07 Ember-: callen: yeah, that is indeed a problem with turn based games

5:07 the time it takes for ppl to wait for that one micro manager to finish his turn

5:07 callen: OGame allows some people to invest more in expanding their economy by spending more time tweaking and scaling up

5:07 it also eliminates the blocking problem as you just mentioned

5:07 Ember-: needs careful design though to work

5:07 callen: There were a lot of issues with OGame's game mechanics though

5:07 acron^: callen: that's the question i'm asking..

5:07 callen: one is that people with absolutely no lives had HUGE economic advantages

5:08 acron^: callen: if it's easy, how is it done?

5:08 Ember-: for example if you spend most of your time just waiting for your ships to move to their destination it's not fun

5:08 callen: ,(keyword "a")

5:08 clojurebot: :a

5:08 callen: acron^: ^^

5:08 acron^: thank you

5:08 Ember-: and in the start of the game your technology is so lame that everything will take time

5:08 callen: Ember-: another issue is that one of the nice things about a turn-based game is that they tend to be a lot more fair

5:09 Ember-: the economic advantage of spending more time playing OGame gave it the grindy feel of an MMO. Unpleasant and unsustainable long term.

5:09 Ember-: yeah, I can see why

5:09 callen: the build-up to better technology did take quite some time, but once you leveled off at the top-tier, *everything* became about economics

5:09 Ember-: I'm considering of adding a game mode where there is a time limit for the game turn

5:09 callen: because once you're at the top tier, it's purely about who has the bigger fleet

5:09 Ember-: one which could be increased on fly via galactic election :)

5:10 callen: Ember-: you could call it galactic hot potato.

5:11 acron^: callen: that's erroneous

5:11 callen I asked for ":a", not "a"

5:11 Ember-: ,(str ":" "a")

5:11 clojurebot: ":a"

5:11 Ember-: :P

5:11 acron^: but then (keyword ":a") doesn't work

5:12 i need to remove the ":" before keywording it

5:12 borkdude: "For two millenia, the idea of mimicking the real world has actually imprisoned geometry." (isn't this also true for OO programming? ;-))

5:12 callen: acron^: that's what I was saying.

5:12 borkdude: meh. I blame Simula.

5:12 acron^: (second (string/split ":a£" ":")) <- ?

5:12 callen: borkdude: funny part is, CES ends up being better than OO/inheritance for doing actual simulations.

5:13 borkdude: callen CES?

5:13 callen: acron^: probably good enough.

5:13 acron^: callen there isn't a nicer way?

5:13 callen: acron^: I'm cringing a bit at the possibility of more than one colon.

5:13 acron^: you could stop generating keywords from strings, for a start.

5:13 borkdude: component entity systems

5:13 borkdude: composition, separation of state and logic, etc

5:14 acron^: callen: don't really have a choice, it's from url params

5:14 callen: borkdude: not quite "functional", but has similar design priorities. it's popular for game development and simulation systems these days.

5:14 borkdude: callen ah

5:14 callen: acron^: you always have a choice. Are you using maps?

5:14 ,(get {"a" "b"} "a")

5:14 clojurebot: "b"

5:15 callen: acron^: ^^

5:15 acron^: stop generating keywords.

5:15 acron^: refheap your problem.

5:15 acron^: ok

5:15 2 secs

5:17 Ember-: well, time to spend Christmas away from computer :)

5:18 tomoj: OO fails to mimic the real world

5:19 callen: tomoj: you're being verbose, let me help you. "OO fails"

5:19 tomoj: I suppose they have an idea that they're mimicking the real world

5:19 :)

5:19 Siphonblast: Couldn't you technically develop a game in clojure if you used the java OpenGL bindings?

5:19 bawr: Stars! on a Clojure channel. Ecellent. :)

5:20 acron^: callen: https://www.refheap.com/paste/7836

5:20 borkdude: bawr stars? wadda you mean?

5:20 callen: borkdude: Stars!

5:21 zilti: I wouldn't say OO fails per se. e.g. when working with GUI stuff you always end up using objects.

5:21 callen: acron^: okay. well I answered the original question, what's the current problem?

5:21 acron^: callen: when you asked for refheap I assumed you wre going to pass comme ton my structure

5:22 comment*

5:22 is there a better way I should be doing this?

5:23 borkdude: callen bawr I'm clearly missing smth =)

5:23 callen: acron^: I assumed you were a lost cause when I saw you were using MangoDB

5:24 acron^: why? :\

5:24 callen: acron^: more seriously, in the context of that refheap what you're doing has an internal...sense to it, but that doesn't mean I don't suspect it could be done better. You've created the need for some mildly 'meta' programming, you may just have to do it like this.

5:25 acron^: could describe at a high level what you're doing?

5:25 acron^: are you enabling users to query something?

5:25 acron^: MangoDB is the data store of choice of scoundrels, nihilists, and people that don't care about their data.

5:26 since I am all of those things, I too use MangoDB.

5:26 acron^: callen: yes ^ as a proof of concept for a web app I'm attempting to map url params to queries in mongo directly

5:26 however i want to support both OR and AND operations

5:26 callen: acron^: pretty dangerous. God help you.

5:27 acron^: well, it is and it isn't

5:27 i put my faith into the monger library :p

5:27 callen: probably don't want to be injecting user-entered strings into your db queries. Just uh, gonna put that out there.

5:28 acron^: but it's not strings, it's all broken down to clojure types before then getting converted back again

5:28 anyway

5:28 this isn't about the shoulds or shouldn'ts

5:30 borkdude: MangoDB is smth new? or is it MongoDB? things are moving so fast these days ;)

5:31 acron^: He means MongoDB :p

5:31 callen: borkdude: MangoDB is web scale rockstar ninja tech

5:31 acron^: (second (clojure.string/split ":a" #":")) just feels so ugly

5:31 callen: acron^: it is. for one thing, use a friggin' regex

5:31 that code breaks on ":a:something_important"

5:32 acron^: i know

5:32 callen: acron^: you make me feel like I'm begging a crazy person not to stab themselves.

5:32 zilti: acron^: What if you'd just drop-while?

5:33 acron^: zilti: if it's not obvious i'm a clojure noob. what's drop-while ?

5:33 borkdude: ,(name :a)

5:33 acron^: callen: there comes a time in every coder's life when he has to bleed a little

5:33 clojurebot: "a"

5:33 zilti: acron^: It drops stuff from a collection as long as the helper function returns true

5:34 acron^: zilti: sounds good

5:34 zilti: &(drop-while #(= % \:) ":a:b")

5:34 lazybot: ⇒ (\a \: \b)

5:34 bawr: borkdude: there was a discussion about a Stars! (an oldie but goodie game) clone as a holiday project.

5:34 zilti: Oops

5:34 Well you'd have to turn it into a string again afterwards

5:35 acron^: zilti: that's fine, i can do this begfore it's a string anyway - thank you

5:35 borkdude: bawr ah

5:35 callen: ,(drop-while (fn [blah] (= blah \:)) ":a:something_important")

5:35 clojurebot: (\a \: \s \o \m ...)

5:35 zilti: acron^: #(= % \:) is short for (fn [char] (= char \:)

5:36 acron^: callen: how does the second colon make it through?!

5:36 tomoj: and long for #{\:}, sort of :)

5:36 callen: ,(apply str (drop-while (fn [blah] (= blah \:)) ":a:something_important"))

5:36 clojurebot: "a:something_important"

5:36 callen: acron^: that's...the point.

5:36 tomoj: I'm trying to write code, not obfuscated Russian emoticons.

5:37 zilti: acron^: That's why it's called "drop-while". http://clojuredocs.org/clojure_core/clojure.core/drop-while

5:37 acron^: zilti: sorry, the semantic fail is mine

5:37 zilti: acron^: No reason to say sorry for that :)

5:37 acron^: it still serves me better than my existing solution

5:38 tomoj: to me, #{\:} is idiomatic, not obfuscated

5:38 callen: tomoj: I was kidding.

5:38 tomoj: I suppose sometimes "idiomatic" is just a euphemism for "obfuscated" :(

5:38 zilti: Hmm I wonder why that happens:

5:38 &(= (apply str (concat (drop-while #(= % \:) "::abc:de"))) (str (concat (drop-while #(= % \:) "::abc:de"))))

5:38

5:38 lazybot: ⇒ false

5:39 callen: tomoj: no, it's fine. Your code was good.

5:39 tomoj: you really shouldn't take me seriously.

5:39 zilti: What's the point of #{\:} ?

5:40 callen: ,(#{\:} \:)

5:40 clojurebot: \:

5:40 tomoj: but really, many things called "idiom" are not very clear. (if (seq x)) being more idiomatic than (if (not (empty? x))) for example

5:40 callen: ,(#{\:} \b)

5:40 clojurebot: nil

5:40 callen: zilti: ^^

5:41 tomoj: even though the latter is more clear to those who don't speak the idiom..

5:41 acron^: i need to learn the basics before i think about idioms. coming from C++ this is a real challenge for me.

5:41 callen: are you serious?

5:41 zilti: callen: Thanks. I guess. ^^

5:41 bawr: I wouldn't say (if (seq)) is terribly idiomatic, one of the first things you learn is that seq gives nil on empyty sequences, and that nil is false.

5:42 callen: C++ (for me) is like having my limbs ripped off and the wounds salted.

5:42 acron^: nice image

5:42 zilti: Does anyone btw know what happened to clojuredocs.org?

5:42 callen: zilti: ...it's still there?

5:42 acron^: C++ can be pretty eloquent if it's done well, you know

5:42 zilti: callen: Yes, but it's still at 1.3

5:43 acron^: Especially now we have C++11

5:43 callen: acron^: I am a fan of C++11, but yeah, not really a general purpose lang for me.

5:43 zilti: What I always hated about C++ is that you need not one, but two files (damn header files!) for one class.

5:43 acron^: zilti: technically you don't need a .cpp ;p

5:44 still not sure where clojure will fit in my toolbox but i am enjoying the purity of it so far

5:45 zilti: And that let's-manage-our-memory-by-hand stuff. It was fun for the little one-threaded simple game I wrote, but I imagine it can be the hell for larger stuff.

5:45 acron^: zilti: well, yes. for larger stuff you write a memory manager

5:45 callen: tomoj: but on a more serious note, while what you did was idiomatic, abusing set membership for what was fundamentally a filter was a little cutesy.

5:45 tomoj: apparently it scares the younglings too.

5:45 acron^: ^ it does

5:45 callen: should show them some APL, let them know some real horror.

5:46 acron^: :E

5:46 * callen whips out his unicode cheat-sheet for APL

5:46 tomoj: I almost always write #{x} for #(= % x). that's abuse?

5:47 zilti: APL... has that been invented by a greek?

5:48 tomoj: hmm, wasn't there something about how literal set notation is not really meant to be used with non-literal values?

5:48 callen: tomoj: it's not abuse, it's just cutesy.

5:48 bawr: APL is all fun and games until someone pokes their eye out.

5:48 callen: tomoj: it's an obvious byproduct of familiarity and brevity overtaking obviousness of expression

5:49 tomoj: oh I guess the problem case was #{x y} when (= x y)

5:49 callen: tomoj: I don't think it's a bad idiom. I'm just saying that a newbcake is going to *_* when they see it.

5:49 tomoj: pardon me for caring about the computing third world.

5:50 zilti: I've seen that for the first time today, but when you know that "kewords" are functions taking collections as arguments and the other way around, #{x} is pretty obvious.

5:51 tomoj: &(let [x nil] (remove #{x} [nil nil nil]))

5:51 lazybot: ⇒ (nil nil nil)

5:53 zilti: The difficult thing at functional programming is that you just have that huge pile of functions laying in front of you without a real organisation behind it compared to OO. That made it a bit difficult for me to start with it.

5:54 tomoj: &(read-string "#{x x}")

5:54 lazybot: java.lang.IllegalArgumentException: Duplicate key: x

5:54 tomoj: of course..

5:55 zilti: Argh why doesn't korma support many-to-many?

5:57 callen: zilti: it doesn't officially but it certainly works.

5:57 acron^: my god, lein is frustrating

5:57 callen: acron^: try sbt or cabal sometime, then report back.

5:57 zilti: acron^: Then you better never try Scala's "Simple Build Tool". THATs hell.

5:58 callen: zilti: https://github.com/korma/korma.incubator

5:58 Raynes: zilti: That isn't true at all.

5:58 zilti: callen: There's an implementation in korma.incubator

5:58 callen: lol @ zilti quoting the same awfulness as me.

5:58 Raynes: zilti: That's what namespaces are for.

5:58 zilti: kik

5:58 callen: and then mentioning the same lib as me

5:58 zilti: *lol

5:58 callen: Raynes: hey. you. Laser.

5:59 acron^: are you infact a single consiousness in two bodies?

5:59 callen: Raynes: so it looks promising but the Enlive people want their CSS selectors and other niceties. Whatcha gonna do to keep it from getting complectified?

5:59 acron^: I am large and contain multitudes.

5:59 Raynes: callen: I've got plans to write a real implementation of CSS selectors separate from everything else and provide it as a function call and such.

5:59 zilti: Well lol, the korma.incubator implementation seems to be broken, or can someone here confirm it's working?

6:00 callen: Raynes: I guess what I'm wondering is, what parts of enlive are you going to refuse to implement to keep it simpler?

6:00 because there has to be something.

6:00 Raynes: callen: I haven't found anything yet.

6:00 zilti: Raynes: Did you write the wrong person with "That isn't true at all"?

6:00 Raynes: zilti: No.

6:00 zilti: Argh. I'm always trying to use autocomplete in IRC

6:01 Raynes: "The difficult thing at functional programming is that you just have that huge pile of functions laying in front of you without a real organisation behind it compared to OO."

6:01 I was responding to that.

6:01 callen: zilti: Raynes is a hyper-dimensional being that transcends space and time. Your mortal conceptions of "ancient history" are but a blink of the eye for him.

6:01 zilti: also, /lastlog

6:02 zilti: Raynes: Oh I see. Well, look at clojure.core and tell me it's well-ordered compared to OO core-libs, I'd say it's not. After some time you just know what that stuff is for and that it makes sense not to order it more.

6:02 callen: I'm sorry, what's wrong with it?

6:02 Raynes: callen: I'm sure there are things missing from laser that are in Enlive, I just haven't seen anything important yet, and I figure people will let me know if there are useful things missing..

6:03 zilti: clojure.core is a collection of functions that are meant to be available all the time. Is is a totally different thing.

6:03 callen: Raynes: I guess what I'm wondering is whether scope-creep will simply inflate it to where Enlive is now.

6:03 Raynes: You want to look at libraries. Not bootstrapped Clojure libraries.

6:03 callen: No.

6:03 zilti: Raynes: Yes, of course, but that doesn't make it less overwhelming for newbies. I don't want to have this changed, don't misunderstand me.

6:03 Raynes: callen: If I thought that was a possibility, I wouldn't have bothered.

6:03 bawr: zilti: Compare it to Python's builtins or something, it's really not much different.

6:04 zilti: Well, Clojure is supposed to be simple, not easy. ;)

6:04 Raynes: zilti: I'm not disagreeing that it can be annoyingly cobbled together.

6:04 borkdude: would it be awkward if +,- etc would be moved to a namespace called clojure.math instead of clojure.core?

6:04 callen: Raynes: fair enough, I just don't know how to differentiate the purpose of the two beyond the fact that laser is newer and possibly less inclined to require the user to understand astrology.

6:04 borkdude: yes.

6:04 zilti: borkdude: yes

6:05 callen: ,(prn "borkdude: yes")

6:05 clojurebot: "borkdude: yes"

6:05 borkdude: if yes, then you've got your answer.

6:06 zilti: About that korma.incubator many-to-many implementation - has anyone used that and it worked?

6:06 callen: ibdknox: many-to-many in korma.incubator. Is good?

6:07 acron^: does Ring produce error logs? somewhere? anywhere?

6:07 Raynes: callen: To answer someone's question of "Why laser instead of enlive?", my answer would be something like "Laser is smaller and takes a combinator based approach over a faux-css selector approach. It has (or will have) better, clearer documentation, the code will be cleaner and make more sense, and it should always be well maintained."

6:07 callen: acron^: Ring never has errors and therefore has no error logs.

6:08 combinator based approach. ogod.

6:08 acron^: Oh right. That's fine then.

6:08 callen: Raynes: have you been smoking the Haskell again?

6:08 Raynes: callen: Get out of my internet.

6:08 acron^: callen: So...what happens...when it crashes?

6:09 Raynes: It doesn't.

6:09 Obviously.

6:09 acron^: Well, something is

6:09 zilti: It's your code

6:09 callen: acron^: http://mmcgrana.github.com/2010/07/develop-deploy-clojure-web-applications.html

6:10 acron^: https://www.refheap.com/paste/7838

6:10 callen: I cringe at linking the apostate's website, but it's a good place to start.

6:10 acron^: just...go work through the tutorial I linked.

6:10 acron^: :(

6:10 callen: acron^: if you still can't figure it out by the time you get to the bottom of the page, check back.

6:10 acron^: dont be angry with me callen..

6:10 callen: acron^: I'm not trying to be an asshole, it's just...logging is something you do

6:10 acron^: look at my refheap

6:10 callen: acron^: I'm not angry, I'm just trying to be maximally helpful.

6:11 Raynes: callen: Anyways, like I said, there will be real css selectors eventually. I'm clearing out the last bugs before I bother with it.

6:11 callen: acron^: whoa, cool error.

6:11 acron^: I know, right?

6:11 Raynes: callen: Hah, Mark is an apostate? :p

6:11 callen: Raynes: yes?

6:11 acron^: add logging

6:11 acron^: read the tutorial I linked

6:11 Raynes: callen: Because he started using Go?

6:11 callen: I'm super srs.

6:12 Raynes: yes.

6:12 acron^: reading

6:12 callen: Raynes: gophery apostate.

6:12 zilti: Why does he do (-> #'handler instead of (-> handler ?

6:12 Raynes: Hah

6:12 zilti: Because if you refer to #'handler, if the thing the var refers to changes (in place, ew, mutable, ew) the changes will be seen.

6:13 borkdude: mutable… aaaaaaaah, it burns…

6:13 callen: I can't decide if this is for code-reloading or bizarre satanic rituals.

6:14 zilti: Well ok, so I probably won't ever need it.

6:14 Raynes: The forme.r

6:14 borkdude: callen both

6:14 Raynes: former*

6:14 callen: then I'm keeping it.

6:14 Raynes: callen: It's particularly useful for REPL development.

6:14 * callen clings to his cargo cult

6:15 zilti: So it's a "recalculate the surrounding expression if this variable changes" thing?

6:15 callen: zilti: I think it's more along the lines of "don't use the persistent result of this reference, just keep dereferencing the var"

6:16 if the underlying var changes, the result changes

6:16 Raynes: zilti: #'handler = the handler var. You're referring to the var and not the thing inside of it, so if the thing inside of it changes...

6:16 Bang, you has new thing.

6:16 zilti: Raynes: Like pointers.

6:17 Raynes: Uh, well, like anything mutable ever.

6:17 'fraid I can't comment on pointers, never used C.

6:17 callen: Raynes: pointers in C point to fully mutable memory locations

6:17 zilti: Everybody kept telling how difficult they are to understand, but I found it to be damn easy. It's just by-reference instead of by-value.

6:18 callen: Raynes: the ground falls out from underneath you quickly

6:18 btw, I produced a demonstration of what I was talking about

6:18 zilti: https://www.refheap.com/paste/7839

6:18 pedagogy via repl. woohoo.

6:18 zilti: I found clojure atoms to be kinda like pointers in some way

6:18 callen: vars and java references are all pointers.

6:19 the semantics of Java are reference-semantics weakly imitated by by-value passing of pointers to objects.

6:19 Python is the same way, references don't live longer than their by-value pointers.

6:20 dereferencing a re-instantiated object will go somewhere other than the last time you dereferenced the object, it will not overwrite the original.

6:20 Raynes: does my paste explain the matter well, do you think?

6:20 zilti: Callen: You made a mistake. You called woot before you defined it, I guess it's supposed to be (blah "blah") on line 3?

6:21 callen: zilti: that's not a mistake, ignore that line.

6:21 zilti: I was building up to the experiment, invoked woot to test an assumption.

6:22 zilti: Well by now I really, really prefer by-value.

6:22 callen: zilti: the persistent and immutable nature of Clojure data structures by default give you what amount to by-value semantics.

6:23 zilti: it's just that deep down, references underlie how it works in the JVM

6:23 and incidentally, vars are really just mutable references anyway.

6:23 for convenience's sake more than anything else.

6:23 bawr: zilti: pointers are one of those things you either get immediately, or never fully get

6:23 callen: bawr: I always saw them as index cards with a number on it. If you looked at that number's location in a series of cardboard boxes, you might find your data.

6:24 that or SEGMENTATION FAULT^D

6:24 bawr: I never needed a visualisation, they just made sense.

6:25 callen: bawr: I didn't need one, but the analogy is more to explain my internal mental model than anything else

6:25 borkdude: pointers, aren't they like cofunctorial invariants under the mutability monad? I'm just guessing

6:25 bawr: Yeah, that's a number at an address in memory that points to another address in memory.

6:25 callen: borkdude: somebody's been smoking the Haskell.

6:25 borkdude: callen not really, just bullshit ;)

6:25 acron^: How is this my code that's the problem?? https://www.refheap.com/paste/7840

6:25 bawr: callen: heh, fair enough. I don't see how a different mental model can be made. ;)

6:26 callen: acron^: becaus --- Subprocess failed

6:26 acron^: the server didnt even start!

6:26 callen: acron^: your code is bad and you should feel bad.

6:26 acron^: argh

6:26 callen: acron^: it's Christmas, don't be frustrated.

6:27 acron^: this is the universe telling you to go drink some eggnog and wrestle with a cousin.

6:27 acron^: :\

6:27 I'd rather not

6:27 callen: acron^: okay okay, fine. So you're a misanthrope like me.

6:27 acron^: Absolutely

6:28 I'll be here tomorrow, flagellating myself some more

6:28 borkdude: why are you a human hater if you don't drink egg nog?

6:28 callen: acron^: sexy. See you then Friar Tuck.

6:30 acron^: I wonder if it's a memory issue...

6:31 callen: acron^: how much do you got?

6:31 acron^: Well

6:31 i'm running this on an ec2 micro

6:32 callen: acron^: ಥ_ಥ

6:32 acron^: ~100mb

6:32 clojurebot: Huh?

6:32 acron^: (lol)

6:32 callen: ,(lol)

6:32 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: lol in this context, compiling:(NO_SOURCE_PATH:0)>

6:32 callen: that is a travesty.

6:32 we need a lol function.

6:33 acron^: (lol [1 4 7]) => "LOL"

6:33 callen: yes.

6:34 acron^: fuck

6:34 it's memory

6:34 Ember-: callen: (defn lol [& _] "LOL")

6:34 you're welcome

6:34 acron^: 7800k free

6:34 callen: acron^: derp.

6:34 bawr: hurr

6:34 callen: Ember-: thanks, but I want it in clojure.core

6:34 Ember-: I don't :)

6:34 this ain't PHP

6:34 :P

6:35 callen: Ember-: fair.

6:35 bawr: callen: the whole point of clojure is being able to fill in the missing functionality, now stop belly-aching. ;P

6:35 borkdude: callen lucky for you namespaces are not sealed, so you can put it in whenever you want, in your own program

6:35 zilti: https://www.refheap.com/paste/7841 <- Could anyone take a quick look at my error message? I'm not even trying to drop anything named like that in a schema like that

6:36 Ember-: :D

6:36 * callen pfffft

6:36 callen: Schema "KORMA" nicht gefunden I take this means, "does not exist"?

6:36 or not found?

6:36 zilti: callen: Yes, it's "not found"

6:36 bawr: Not found.

6:36 zilti: callen: But that's pretty much the same for h2

6:37 *is the same.

6:37 callen: zilti: can you get the generated SQL?

6:38 zilti: callen: I'll try.

6:38 callen: Just I have no Idea where that SQL string comes from. It's a drop table which korma doesn't support, so it's a hand-crafted SQL string

6:39 bawr: Why do you get errors in German, anyway?

6:39 borkdude: hmm &_ is a valid symbol name in clojure for a var, how nice

6:39 zilti: bawr: I live in Switzerland and the computer locale is swiss-german and h2 supports german, so I suppose that's why.

6:40 callen: borkdude: &_ is a clear indication to the user that, "this function cares not for your silly data!"

6:40 bawr: zilti: I live in Poland and make it a point to tweak my locale to use English. Precisely because of that error-translation bullshit.

6:40 borkdude: callen I forgot a space between & and _, then it actually expects always 1 arg ;)

6:40 bawr: English arrors are so much more googlable.

6:40 callen: zilti: Schweizerdeustch. ugh.

6:41 zilti: bawr: Luckily h2 gives the message in both languages

6:41 bawr: Ooh.

6:41 Well, that's saner.

6:41 ivaraasen: callen: it's the best German, man

6:41 callen: ivaraasen: no.

6:42 zilti: Argh. I looked at that code a dozen times and didn't see it. Now it makes sense: (str "DROP TABLE IF EXISTS " clojure.core.table) is bullshit

6:43 (I only wrote table, not korma.core.table, but I didn't define a "table" anywhere)

6:43 ivaraasen: I once had to debug a codebase with Norwegian variable and fn names. ugh...

6:43 zilti: nice

6:44 ivaraasen: it was Matlab code as well, so not exactly clean

6:44 zilti: I always write my code and documentation in english. And be it just because of the special characters.

6:48 repsac: Anyone know the best way to crawl a clojure jar and grab metadata (docs, src etc) for each namespace in the jar?

6:52 for all publics in all namespaces in the jar i mean

7:24 Raynes: replaca: Well, codox does stuff like that.

7:24 Er, not replaca.

7:24 repsac, but he has disappeared.

9:05 jcromartie: is noir abandoned?

9:05 ah I see

9:07 Anderkent: ,(macroexpand '(no.such.Class/doThing 1 2 3))

9:07 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: no.such.Class>

9:08 Anderkent: any way around this? :(

9:09 zilti: Around what?

9:09 Anderkent: macroexpand crashing when there's a non-existing class reference

9:10 i.e. macroexpand tries to run (part of the) code

9:10 zilti: No, it isn't. The problem is that you're trying to macroexpand a static method of a java class, which of course doesn't work

9:10 Or you could try macroexpand-1

9:11 Anderkent: no, the problem is that the class does not exist at time of macroexpansion.

9:11 zilti: You can't and are not supposed to macroexpand classes.

9:12 Anderkent: ,(macroexpand '(java.lang.System/currentTimeMillis))

9:12 clojurebot: (. java.lang.System currentTimeMillis)

9:13 Anderkent: is that sufficient as an example?

9:13 zilti: That's not expanding the method

9:13 It's just saying that it didn't expand anything at all

9:13 (macroexpand '(1 2 3))

9:13 Anderkent: It transformed the Object/method syntax

9:13 zilti: ,(macroexpand '(1 2 3))

9:13 clojurebot: (1 2 3)

9:13 Anderkent: into the dot syntax

9:13 which is what I want to do

9:14 but it does not work when the class is not available on the classpath

9:14 which is disappointing

9:14 zilti: Then do it with other methods than macroexpand, because macroexpand is meant to expand macros

9:16 Anderkent: 'They all expand into calls to the dot operator (described below) at macroexpansion time.', says clojure.org/java_interop

9:17 zilti: But they are special forms and not macros.

9:17 Why would you want to transform this anyway?

9:17 Anderkent: I'm also pretty sure you should be able to call macroexpand on any list at all, even if the first node is not a macro

9:18 I'm writing a code coverage tool and for that I need to fully macro expand a given source file

9:30 deg: Does Clojure offer a way to safely evaluate tainted user-input strings? Ideally, I'd like to eval the string in an environment that includes a small set of dynamic variables and functions that I've allowed, but no access to anything else (random functions, reader macros, etc.).

9:31 lucian: deg: there are some sandboxes around (4clojure and the bots in this channel use them)

9:31 jcromartie: deg: at the minimum, you can define your own set of allowed symbols

9:32 deg: jcromartie: Once I define my own set of allowed symbols, can I create an isolated namespace and pass it to the reader?

9:32 jcromartie: deg: I don't think so

9:32 deg: I'm not an expert, and sandboxes are hard

9:33 deg: but I'd definitely say a whitelist is better than a blacklist

9:33 lucian: deg: there's https://github.com/Licenser/clj-sandbox for example

9:34 jcromartie: what's that one form (reader macro) that's immediately evaluated at read time?

9:34 deg: I need binding of specified dynamic vars, arithmetic, and maybe some of the standard special forms (if, and, or; maybe a few more). So, a whitelist is definitely the path I want. But, I don't want to write an entire sandboxed evaluator myself.

9:34 jcromartie: ha

9:34 deg: Lucian: thanks, looking at that now.

9:34 jcromartie: http://clojuredocs.org/clojure_core/clojure.core/*read-eval*

9:35 deg: jcromartie: Yup, I'd definitely need to turn off #=. But, that feels like a blacklist approach, which I don't really trust as much as whitelist.

9:44 lucian, jcromartie: Thanks. Looks like licenser sandbox will do what I need. (It'd definitely overkill -- it would have been cleaner if the standard reader took a set of available defs, bindings, and reader macros -- but I'm not pedantic enough to refuse a working tool. :-) )

9:55 yedi: does anyone have suggestions for good articles/talks to consume? stuff like prismatics article introducing graph, hickeys talk/article on reeducers, articles describing strucjure and clojure's matching library, etc

9:57 xeqi: deg: the other well used one is https://github.com/flatland/clojail but its a blacklist approach

9:58 also, some use of something like classlojure to make an isolated enviornment incase they escape the sandbox, and a good java.policy file to restrict messing up the box is recommended

9:59 its extremely hard to make a public eval, even clojail has a couple of esoteric ways to escape

9:59 * a secure public eval

11:07 Bronsa: ibdknox: you should merge the last blind, i just fixed a bug that prevented numbers in the form 1e2 to be read

11:51 zilti: I wrote a macro that writes several declare statements. Now unfortunately it packs them in a list, and this happens:

11:51 &((declare something))

11:51 lazybot: java.lang.SecurityException: You tripped the alarm! def is bad!

11:51 zilti: ,((declare something))

11:51 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

11:52 zilti: IllegalStateException Attempting to call unbound fn: #'lopia-server.database/something clojure.lang.Var$Unbound.throwArity (Var.java:43)

11:54 dnolen: zilti: wrap them in a do. but also you know that declare can take multiple symbols right?

11:55 zilti: No, I didn't know that. Thanks for the hint!

12:00 Hm, my macro doesn't work the way I want it to... Isn't a macro supposed to write the stuff that's backquoted into the namespace?

12:03 jkkramer: zilti: backquote namespace-qualifies symbols, but not necessarily with the current namespace

12:03 &`(map foo bar)

12:03 lazybot: ⇒ (clojure.core/map clojure.core/foo clojure.core/bar)

12:03 jkkramer: ,`(map foo bar)

12:03 clojurebot: (clojure.core/map sandbox/foo sandbox/bar)

12:03 seangrove: Out of curiosity (thinking about putting this together in my cljs app), has anyone tried completely modelling an app's UI as via FSMs?

12:04 zilti: What's FSMs?

12:04 seangrove: finite state machines

12:05 matthavener: seangrove: lots of UI elements are modeled using FSMs

12:05 seangrove: Trying to get my UI's as declarative as possible

12:05 matthavener: seangrove: but you're saying an entire UI as a single FSM?

12:05 seangrove: Yeah

12:05 dnolen: seangrove: you should talk to ibdknox, that's what waltz is all about http://github.com/ibdknox/waltz

12:05 matthavener: interesting idea

12:06 seangrove: Maybe that's too high-level

12:06 dnolen: Ah, thanks :)

12:08 Sadly waltz and domina are both pretty quiet

12:31 yedi: does anyone have suggestions for good articles/talks to consume? stuff like prismatics article introducing graph, hickeys talk/article on reeducers, articles describing strucjure and clojure's matching library, etc

12:32 seangrove: yedi: Worth watching "the refined clojurian"

12:32 s/clojurian/clojurist

12:32 http://skillsmatter.com/podcast/scala/the-refined-clojurist

12:33 No idea why it's under a scala url though

12:33 yedi: oh cool

12:34 seangrove: Lnaugage of the system, and some others here too http://skillsmatter.com/event/scala/clojure-exchange-2012

12:39 dnolen: yedi: seangrove: http://www.youtube.com/user/ClojureTV, and Planet Clojure RSS feed

13:07 zilti: Is it possible to do what (intern ns name val) does, but for macros?

13:07 gfredericks: interning a var whose value is a macro?

13:08 zilti: gfredericks: More like "redirecting" the macros output to that namespace, or better: "executing it in the other namespace"

13:10 gfredericks: what's the use case?

13:11 zilti: I have a macro that writes korma defentity statements based on data stored in a map. And they're supposed to end up in the macro's namespace.

13:12 bawr: >Clojurist

13:12 urrgh, sounds almost as bad as "Pythonista"

13:13 AimHere: Clojurissimo

13:13 Clodjer

13:13 borkdude: zilti http://clojuredocs.org/clojure_contrib/clojure.contrib.with-ns/with-ns

13:13 gfredericks: zilti: so you're calling this defentity-writing macro from outside your foo.entities namespace. Where do you intend to use the defined vars? Also from other namespaces?

13:14 I think a macro that defs something in another namespace is pretty unusual; you can definitely use intern to do what you're talking about though.

13:15 zilti: gfredericks: I'll call them from outside, but not only from one namespace, so they should end up in "their" namespace.

13:15 gfredericks: looks like with-ns would work too

13:15 for intern you have to add the {:macro true} metadata to the symbol

13:15 as in (intern 'foos.entities (quote #^{:macro true} the-var-name) a-macro-function)

13:17 wow that's weird that with-ns uses map

13:18 that sounds like an obvious laziness bug

13:19 oh nevermind

13:19 it gets spliced in

13:19 borkdude: last time I used something like this I just did (binding [*ns* x] …) and passed *ns* as the argument for x from the other namespace

13:20 but since I didn't know how to "get" a namespace object from a symbol, I found with-ns on clojuredocs =)

13:20 ah, the-ns is something in clojure.core

13:21 weird name though

13:22 it felt wrong though - someone was trying to make a standard list of requires and uses and defined a functino for this in a util namespace

13:23 so you'd only have to call the util function and it would require everything in your namespace

13:23 zilti: Great, the macro still works

13:24 It took me hours to figure out that error was caused by this.

13:27 borkdude: gfredericks the map also surprises me, why not just ~@body

13:27 gfredericks: borkdude: it has to use eval

13:28 zilti: I sometimes think my browser is leaking bookmarks

13:28 gfredericks: compare (binding [*ns* (find-ns 'clojure.walk)] postwalk) to (binding [*ns* (find-ns 'clojure.walk)] (eval 'postwalk))

13:31 borkdude: binding changes the namespace at runtime, not compile-time

13:33 borkdude: gfredericks right

13:33 gfredericks: eval: for when you need compile-time at runtime

13:34 borkdude: gfredericks I'm trying to figure out why the thing worked when I did it without eval

13:34 gfredericks probably because it was a function, not a macro

13:35 gfredericks: I can imagine some subleties wherein it depends on what you're doing and whether or not it's top-level

13:35 borkdude: gfredericks we required and used some stuff in a namespace that was passed along as an argument

13:36 gfredericks: and just did (binding [*ns* symbol-arg] (require 'thing) ...)?

13:36 borkdude: gfredericks yes

13:36 * gfredericks tries it

13:36 borkdude: gfredericks no

13:36 gfredericks the symbol-arg was an actualy namespace object

13:36 gfredericks: well symbol-arg would be a namespace object

13:36 yeah it'd have to be

13:37 yep works for me too

13:37 now to try it inside a function

13:38 yeah inside a function it works the other way

13:38 oh wait

13:38 scratch that

13:38 * gfredericks tries again

13:39 gfredericks: okay works the way you'd want in a function too

13:39 oh I know why

13:39 require/use just care about the value of *ns* at runtime

13:39 it's compiling within your namespace, but defining things in the other

13:40 you could tease apart the difference if e.g. you didn't refer-clojure in the other namespace

13:40 require and use would still compile because they're compiling in the namespace the code appears in

13:40 but if you want the symbols resolved in the other namespace, you need eval

13:41 borkdude: gfredericks this is getting complex

13:43 gfredericks: the meaning of the symbols is determined at compile-time, and so depends on the compile-time value of *ns*. The effect of require/use happens at runtime, and so depends on the runtime value of *ns*.

13:44 if you're trying to effect stuff in other namespaces dynamically I think you're already doing complex stuff :P

13:44 borkdude: gfredericks yes, I tried to discourage it first ;)

13:46 zilti: You did not really ;) It's working great now, though. I need it because I need/want to be able to modify the database at runtime and want to dynamically regenerate the defentity statements with the new table relations.

13:51 gfredericks: are you modifying the code that uses the entities as well?

13:51 zilti: gfredericks: no, just the entities

13:52 gfredericks: weeerds

13:53 borkdude: zilti I tried to discourage someone else, but doesn't matter

13:54 this is actually a nice threading operator, maybe they can sneak it in clojure 1.5 just in time? ;) https://github.com/krisajenkins/hashthread

13:55 gfredericks: is that like let->?

13:55 &(doc let->)

13:55 lazybot: ⇒ nil

13:55 gfredericks: ,(doc let->)

13:55 clojurebot: Cool story bro.

13:55 gfredericks: argle bargle

13:56 borkdude: gfredericks I don't know what let-> does, but the nice thing about this one is that you can control where the threaded thing should go in the next expression

13:56 gfredericks: yeah I believe so. Only difference is you get to pick the local name instead of defaulting to %

13:57 so the example in the README becomes (let-> 5 x (range x 10) (map inc %))

13:57 er (map inc x)

13:57 borkdude: gfredericks ah ok, even more useful then

13:57 gfredericks: nestable!

13:57 borkdude: gfredericks yeah

13:58 gfredericks: always nest your let->'s so your coworkers will think you're smart

13:59 tpope: it's as-> not let->

14:00 ,(doc as->)

14:00 clojurebot: Titim gan éirí ort.

14:00 tpope: &(doc as->)

14:00 lazybot: ⇒ nil

14:00 tpope: well it is!

14:00 borkdude: clojure.core/as->

14:00 ([expr name & forms])

14:00 Macro

14:00 Binds name to expr, evaluates the first form in the lexical context

14:00 of that binding, then binds name to that result, repeating for each

14:00 successive form, returning the result of the last form.

14:00 gfredericks: it's let-> in my 1.5.0-beta1 repl

14:00 borkdude: gfredericks I'm on RC1 her

14:00 tpope: it's as-> in my 1.5.0-rc1 repl

14:00 gfredericks: I think I remember rich renaming it

14:00 tpope: but neat, guess there was a last minute name change

14:01 gfredericks: time to upgrade my repls

14:01 borkdude: gfredericks there was a discussion on the ML about renaming it

14:01 gfredericks but I never got the intention from the documentation. examples speak louder than words for me

14:01 gfredericks: I think let-> got rejected because it makes you want a vector of bindings

15:59 saolsen: anybody know a good parser library? There seem to be a bunch but I can't tell which is the most mature/stable/widely used

16:01 technomancy: saolsen: none of them are still maintained IIRC

16:02 arrdem: am I right in remembering that nREPL is supposed to succeed SLIME?

16:02 technomancy: I found a good new one a few days back lemme dig for a minute

16:02 technomancy: arrdem: that's right; nrepl.el is the way forward

16:02 arrdem: saolsen: this is something I found a few days back, it was surprisingly easy to work with https://github.com/richard-lyman/amotoen

16:04 saolsen: it may not be exactly what you want... I admit I was very frustrated by the lack of a "require one or more" token, you have to compose a "require one" and a "require 0 or more"

16:05 saolsen: arrdem: yeah I'll have to look into it. Looks like it could work.

16:06 arrdem: I was hoping there would be a port of parsec to clojure, though I guess that could be aukward / tricky to port

16:06 technomancy: I think there are a couple half-finished ports

16:06 arrdem: yeah...

16:06 I don't remember any full ports

16:06 bawr: I know those are very different beasts, but someone pressed me for an answer - is there a sensible Clojure / OCaml or F# comparison somewhere out there?

16:06 saolsen: i found fnparse

16:07 but it looks unmaintained

16:07 arrdem: saolsen: oooh yea

16:07 technomancy: fnparse is old as the hills

16:07 bawr: And yeah, I do realise how odd and wrong the question is. >_>

16:07 arrdem: fnparse is a very nice system and I enjoyed working with it but it has been abandoned for years

16:08 there exists an update for 1.3.0 at least tho so no need to use the old contrib "official" one.

16:09 technomancy: bawr: I've done a little bit of ocaml. the main disadvantage of ocaml is that the libraries and tooling are really weak compared to what's on the JVM. it also felt a bit dated in a few other ways like the regex engine. but if you need to write close-to-the-metal code it's much better than Clojure at being lightweight.

16:09 arrdem: technomancy: is there a compelling reason for me to migrate from vim/vimclojure to emacs/slime?

16:09 darp darp nrepl

16:10 technomancy: arrdem: if you are going to use emacs just for editing clojure, it might not be worth it. but if you're going to use Emacs like it's supposed to be used (IRC, email, note-taking, shells, version control, etc) then definitely.

16:10 bawr: technomancy: how's does OCaml fare with immutable / persistent data structures, though? Can it sensibly do immutable by default / etc?

16:11 technomancy: bawr: yeah, OCaml does a good job of encouraging immutability but being pragmatic about falling back to imperative code when you absolutely need to get the last bit of perf.

16:11 bawr: I see.

16:12 ivaraasen: technomancy: OCaml seems pretty nice, really. I'm trying out ocaml-batteries-included later this evening

16:12 technomancy: arrdem: your enjoyment of Emacs is going to be proportional to how much you hate using programs that aren't written in lisp.

16:12 personally it drives me absolutely batty when I try to use a program and it won't let me rewrite core functionality on the fly.

16:13 arrdem: technomancy: hahaha we shall see. I have a vim/tmux/lein/irssi work environmen that has served me well... debating uninstalling vim and making myself switch while its the holidays and I can

16:13 bawr: Performance aside, is there anything that Clojure does very well that OCaml doesn't? Mostly regarding concurrency / multiprocessing, but other insights are welcome, too.

16:13 technomancy: arrdem: just don't think of it as a replacement for vim; that's just the tip of the iceberg

16:13 azkesz: hey guys, what would you recommend me do if I wanted to search for a pattern of bytes with holes in a file? something like 0x77 0x12 (anycharhere) 0x88 . Could you tell me how you'd do it?

16:14 arrdem: azkesz: so a regex on bytes?

16:14 herm...

16:14 technomancy: bawr: oh yeah, OCaml's GC is kind of lame; doesn't allow for true concurrency. but the most noticeable difference is definitely the access to Java libraries and tools.

16:14 arrdem: azkesz: I think that the standard regex library could work...

16:15 depending. lemme try something and brb.

16:15 technomancy: ivaraasen: I used OCaml to write a replacement for dmenu, but then the latest version of dmenu has added the features I wanted, so I don't have anything to use it for.

16:15 azkesz: arrdem, interesting... I haven't thought of that...

16:15 saolsen: fnparse has lots of docs, and a bunch of talk about verion 2 and version 3

16:15 and then just no updates after 2012 :(

16:15 technomancy: saolsen: fnparse requires Clojure 1.2

16:15 you don't want that =\

16:15 arrdem: saolsen: version 2 is what's live. v3 was never written

16:15 saolsen: er, after 2010

16:15 dnolen: bawr: meta programming in a Lisp is pretty nice - a large subset of Clojure compiles to optimizable JS

16:15 arrdem: technomancy: hey there man, there are about three update forks.

16:16 wingy: so if you wanna do iOS, Android and Windows apps you are forced to OOP?

16:16 technomancy: arrdem: heh; fair enough

16:16 egghead: arrdem: I switched from vim to emacs, it's been enjoyable

16:16 technomancy: arrdem: I just remember clojurebot was stuck on 1.2 for a long time because of fnparse

16:16 wingy: but the backend can still be in clj right?

16:16 azkesz: arrdem, how would you read the file? and the apply some regex on it

16:16 technomancy: bawr: yeah, homoiconicity is a nice-to-have too but IMO not nearly as important as access to a large set of libraries

16:18 arrdem: azkesz: you would just slurp it as a string and apply a regex appropriate to the bytes

16:18 there may be a better way to do that tho

16:18 azkesz: cool

16:18 I kinda just needed the basic idea, thanks arrdem

16:19 arrdem: azkesz: no problem. Java has (and therefore Clojure has) a way to encode a byte literal in a string, you probably want to use that.

16:19 technomancy: bawr: F# probably doesn't have the concurrency problems OCaml does

16:19 and it probably has better library support, though still not nearly as good as Clojure

16:20 borkdude: technomancy what do you mean with library support?

16:20 arrdem: ,(= (str 0x77) "\0x77")

16:20 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Invalid digit: x>

16:20 technomancy: borkdude: being able to pull in lucene and stuff

16:20 borkdude: for my simple OCaml library I tried to pull in xlib in order to change the WM properties of my program and it was an absolute nightmare

16:21 azkesz: arrdem, btw is there a lib that maybe already does all this? like for applying binary patches

16:21 borkdude: if you're into .NET F# is a great choice - that makes me wonder, how is clojureclr these days?

16:21 technomancy: half the libraries used makefiles; the rest were split among 2 or 3 competing ocaml build tools

16:21 arrdem: azkesz: I have no idea... I would hope so tho.

16:21 borkdude: azkesz do you need to find this pattern once or multiple times?

16:21 technomancy: and they actually expect you to install some 3rd-party libraries using apt-get which is foolish

16:22 arrdem: technomancy: because we all roll Debian...

16:22 azkesz: borkdude: probably multiple times, as in to make sure it only occurs once

16:22 technomancy: arrdem: I <3 Debian, but apt-get is not appropriate for distributing development libraries.

16:22 it's designed for end-user applications, and that's the only thing it's good at

16:23 azkesz: borkdude: but sometimes it occurs more than once and it's ok too (since the context for it is the same for two different locations that need a change to happen)

16:23 egghead: isn't scala closer to the OCaml heritage? It's highly influenced by ML

16:23 wink: that would at least explain why I found it so weird :P

16:23 technomancy: egghead: F# is much closer from what I gather

16:24 borkdude: egghead technomancy I also think F# is closer

16:24 technomancy: scala cribs more from Haskell

16:24 zilti: That Prismatics Graph, is this a freely available library and I just haven't found it yet, or do I have to use something else, similar?

16:24 technomancy: but even then, interop with Java forces it to give up on HM inference, which is a huge drag

16:24 saolsen: zilti: they never released it but there are 2 alternatives

16:24 technomancy: zilti: Prismatic deleted all their OSS repos from GitHub =(

16:25 ibdknox: F# basically is OCaml

16:25 technomancy: you can still find some of them around but I would not trust them

16:25 zilti: saolsen technomancy Oh... That's a disappointment. Then I'll take a look at these alternatives (someone posted the links yesterday)

16:25 azkesz: borkdude, were you thinking that I should use some caching? maybe clojure.core.cache?(no idea)

16:25 wink: ibdknox: oh, thanks for the warning :P

16:25 arrdem: azkesz: I did some digging and it looks like the regex library doesn't behave nicely for arbitrary bytes because of string encoding nonsense

16:26 azkesz: arrdem, oh i see... thanks for this

16:26 egghead: technomancy: I didn't know that :(

16:26 ibdknox: I wonder if that means they're trying to sell

16:27 azkesz: arrdem, when you slurp the file is it converted into something like UTF-8? if that makes any sense

16:27 technomancy: ibdknox: I can't imagine any other reason

16:27 ibdknox: technomancy: me neither

16:27 azkesz: arrdem, for example can I read the UTF-8 bom at the beginning of a file ?

16:27 technomancy: then again, I can't imagine any competent buyers who would actually consider deleting GitHub repos (with a promise of "they'll be back some day, honest") a good thing

16:28 ibdknox: it's a baggage thing

16:28 I could easily see that being written into someone's terms

16:28 especially if they EOL'ing the product

16:28 they're*

16:28 arrdem: azkesz: not sure.

16:28 azkesz: hey guys can anyone suggest me a lib or something to handle raw bytes from ie. an exe file?

16:28 gfredericks: just because leaving them up but not maintained looks somehow worse than taking them down?

16:29 (trying to understand what the baggage consists of)

16:29 ibdknox: gfredericks: them being there requires some amount of attention. Acquisitions for parts are very slash and burn in style

16:30 you don't want any loose ends even if they may not be something that will actually cause trouble

16:30 gfredericks: ah

16:31 ibdknox: you never know what might be hiding there

16:31 lol

16:31 M&A is a weird business

16:31 azkesz: I'll take a look at gloss, but I don't want to define any structures though

16:31 ibdknox: it's kind of like a chop-shop :(

16:32 gfredericks: I interviewed at a mountain-view company once after having only worked for a state govt and a university. it was very foreign.

16:33 arrdem: azkesz: gotcha http://code.google.com/p/byteseek/

16:33 technomancy: azkesz: java.io.DataInputStream maybe

16:33 ibdknox: gfredericks: haha, yeah those are very different worlds

16:34 azkesz: arrdem, thank you, this seems to be the thing, looking into it; technomancy I'll take a look at that if this fails

16:35 arrdem: azkesz: do us all a favor and if you use this throw a Clojure wrapper up on GH. If you don't then I will XP

16:35 azkesz: arrdem, ok; what's XP?

16:35 borkdude: Xterminate you Personally

16:35 azkesz: arrdem, btw, I don't think I'm good enough to do that, but I'll try :D

16:36 arrdem: azkesz: it's a smiley face intended to indicate a tougue in cheek comment

16:36 azkesz: lol

16:36 bawr: technomancy: dnolen: Thanks, that gives me a starting point.

16:36 egghead: my copy of the reasoned schemer finally arrived :)

16:36 azkesz: borkdude, way to hype up the drama :D

16:41 arrdem, I think you should do it (wrapper) cause if I try I will mess it up

16:41 (still reading for now)

16:41 arrdem: azkesz: feh ok. it'll be an exuse for me to do my first serious clj library.

16:41 azkesz: awesome

16:42 arrdem: technomancy: emacs just took the back seat, there is work to be done X-P

16:45 joevandyk: i can use a Groovy library in clojure, right?

16:45 bawr: Yup.

16:45 joevandyk: say i want to use http://freeside.co/betamax/ ?

16:45 devn: happy holidays folks

16:45 joevandyk: i use the standard ways of calling java code from clojure?

16:46 technomancy: joevandyk: if it exposes a java class, then sure.

16:46 might be trickier if it's designed to be used from groovy only

16:46 devn: it's times like these, when i'm sitting with family, head buried in my laptop reading the codeq schema

16:46 when i think of you, fair clojurians

16:46 azkesz: got no chrismas tree in my cave :)

16:46 arrdem: hehe I built a cave when I came home for christmas

16:46 bawr: devn: I can relate ^^

16:46 zilti: What the heck is christmas anyway?

16:47 ^^

16:47 bawr: devn: I borrowed a laptop from my sister to just play some games... and I've installed LightTable already. xD

16:47 gfredericks: any short answer to that will upset somebody

16:47 arrdem: (inc gfredericks)

16:47 lazybot: ⇒ 13

16:48 gfredericks: ooh lucky

16:48 ibdknox: "a holiday" seems safe ;)

16:48 borkdude: ibdknox holy day? ;)

16:48 arrdem: azkesz: yeah so I'm digging into this and it's one srs buisness library

16:48 ibdknox: lol

16:48 bawr: Let's not get PC-crazy. xD

16:48 gfredericks: ibdknox is always in here pushing his religion on us

16:49 bawr: I mean, if I wanted to push my religion, I'd... Hm.

16:49 arrdem: INTERNET FIGHT

16:49 bawr: I don't even know what the Discordian equivalent of Christmas is. xD

16:49 azkesz: arrdem, yeah it looks great and it's like exactly what I want

16:49 arrdem: azkesz: haha yeah I'm just looking at this and realizing that a wrapper is gonna be huge

16:51 bawr: ibdknox: is lighttable looking for some leisurely devs, or should I just look at making CodeMirror better? ;)

16:55 ibdknox: bawr: for right now, CodeMirror is the best avenue. In the not too distant future, though, there will be a plugin system that would love some attention ;)

16:55 bawr: That works.

16:56 One small feature I'd love is getting some feedback from Leiningen shown when creating a project, for a while I thought it hanged on me.

16:56 ibdknox: hm

16:56 what version of LT are you using?

16:57 we don't have project creation in there anymore (for now)

16:57 bawr: Uh, I downloaded the newest from the site.

16:57 ibdknox: bawr: the one from here? http://www.lighttable.com/

16:57 bawr: Yeah, Linux32.

16:58 ibdknox: ah, you mean when it's connecting? :)

16:58 bawr: Aye, well it prompted me to create a project. ;)

16:58 ibdknox: unfortunately most of that time is spent spinning up a JVM

16:59 bawr: Hmm. Any way of letting me use drip or some of the persistend JVM wrappers if I so desired?

16:59 ibdknox: if it's fetching deps, it's at least nice enough to tell you that

16:59 bawr you can use lein-light

16:59 bawr: Yeah, though it'd be nice to see what it's fetching, took surprisingly long here, given that I have a good connection.

16:59 Maybe it's just a leiningen thing.

17:00 ibdknox: the thing it does is essentially run a leiningen plugin manually

17:00 lein-light is that plugin. With that you can just use lein to connect

17:00 bawr: Oh, I see.

17:00 ibdknox: in not too long I'll be moving over to nrepl too, so we'll have those options as well

17:01 bawr: heh, I guess development is going well behind the scenes ;)

17:03 ibdknox: well it's still just me building it right now, but I'm hoping to announce at least one if not maybe two hires pretty soon :)

17:05 bawr: heh, I missed the kickstarter, but I'm glad it worked ;)

17:06 Any plans of open-sourcing the core while it's being developed, or will that be considered later?

17:07 ibdknox: it *will* be open sourced, exactly when is still an open question

17:07 seangrove: Hrm, what's a convenient way to interpose a function return value into the sequence, so that the function is called for each interposed value

17:07 gfredericks: three days before closed-sourcing it for M&A

17:08 bawr: M&A?

17:08 ibdknox: at the very latest it'll be by v1 (summer 2013), though there's a good chance it'll be when the beta goes public

17:08 gfredericks: bawr: that's what I thought 30 minutes ago

17:08 seangrove: ,(interpose #(rand-int 100) [1 1 1 1 1])

17:08 clojurebot: (1 #<sandbox$eval27$fn__28 sandbox$eval27$fn__28@35a99473> 1 #<sandbox$eval27$fn__28 sandbox$eval27$fn__28@35a99473> 1 ...)

17:08 ibdknox: Mergers and Acquisitions

17:08 bawr: ah

17:08 ibdknox: gfredericks: fortunately in our case, that'll be impossible

17:08 seangrove: hrm, why's that?

17:09 Bronsa: , (interleave (repeatedly #(rand-int 100)) [1 1 1 1])

17:09 clojurebot: (40 1 4 1 29 ...)

17:09 Bronsa: seangrove: ^

17:10 seangrove: Ah, nice, thanks Bronsa, was just getting to interleave

17:10 arrdem: ,(doc interleave)

17:10 clojurebot: "([c1 c2] [c1 c2 & colls]); Returns a lazy seq of the first item in each coll, then the second etc."

17:10 bbloom: i'm blanking on the name of the lib that is like hiccup, but is xml-style maps of tag, attrs, and content rather than vectors... what was it again?

17:10 gfredericks: enlive?

17:10 clojurebot: enlive is for generating HTML from pure-markup templates: http://wiki.github.com/cgrand/enlive/getting-started

17:11 bbloom: gfredericks: i don't need transformation at all, just html printing

17:11 gfredericks: bbloom: it was my only guess

17:11 weavejester: Does anyone happen to know how to resolve the symbols in a quoted form?

17:12 bawr: ibdknox: well, can't wait until we're at least able to write plugins. it's about damn time someone started rethinking the IDE.

17:12 seangrove: gfredericks: was it inspired by a haskell lib?

17:12 weavejester: i.e. turn '(+ 1 1) into '(clojure.core/+ 1 1)

17:12 bbloom: weavejester: ##(doc resolve) ?

17:12 lazybot: java.lang.SecurityException: You tripped the alarm! resolve is bad!

17:12 bbloom: heh.

17:12 (doc resolve)

17:12 clojurebot: "([sym] [env sym]); same as (ns-resolve *ns* symbol) or (ns-resolve *ns* &env symbol)"

17:12 xeqi: bbloom: data.xml?

17:12 weavejester: bbloom: resolve just works for symbols though

17:12 I was hoping to avoid walking the tree and resolving all the symbols

17:12 I'm not completely sure it would work, either

17:12 Especially for macros

17:13 bbloom: what do you mean by quoted?

17:13 ,''foo

17:13 clojurebot: (quote foo)

17:13 seangrove: macroexpand...?

17:13 clojurebot: http://groups.google.com/group/clojure/browse_thread/thread/bba604cee3b232d9/28837d55525306d8?lnk=gst&q=recursive+macroexpand#28837d55525306d8

17:13 bbloom: like that?

17:13 seangrove: ,(macroexpand '(+ 1 1))

17:13 clojurebot: (+ 1 1)

17:13 bbloom: xeqi: i think that's what i wanted, thanks

17:13 seangrove: Ah, no

17:13 hah

17:14 bawr: ,(macroexpand '(or 1 2))

17:14 clojurebot: (let* [or__2243__auto__ 1] (if or__2243__auto__ or__2243__auto__ (clojure.core/or 2)))

17:14 weavejester: I mean given a form with symbols that are not resolved, how to resolve them in a way that accounts for macros and other forms

17:14 ibdknox: ,(macroexpand '(when true :true))

17:14 clojurebot: (if true (do :true))

17:14 bawr: Seems legit.

17:14 weavejester: e.g. '(+ 1 (* 2 2)) => '(cloure.core/+ 1 (clojure.core* 2 2))

17:14 bbloom: ibdknox: not a great example, since all the special forms are un-namespaced

17:14 weavejester: I guess I could macroexpand and then walk the tree and resolve

17:14 joevandyk: is http://www.clojure-toolbox.com/ up to date?

17:15 weavejester: But it seems like there should be something to do that

17:15 ibdknox: weavejester: yeah that's what you have to do

17:15 bawr: Hmm.

17:15 weavejester: joevandyk: No...

17:15 bawr: ,(macroexpand '(or 1 2 3))

17:15 clojurebot: (let* [or__2243__auto__ 1] (if or__2243__auto__ or__2243__auto__ (clojure.core/or 2 3)))

17:15 joevandyk: weavejester: there a better source for recommend libraries?

17:15 weavejester: I've been meaning on updating clojure toolbox with some sort of auto scraper

17:15 bbloom: bawr: that's a better example

17:15 technomancy: joevandyk: http://clojuresphere.herokuapp.com is better

17:15 borkdude: ,(second `'(+ 1 1))

17:15 clojurebot: (clojure.core/+ 1 1)

17:15 technomancy: though still a bit behind the times

17:15 jkkramer: the url is http://www.clojuresphere.com/ now - should probably make a redirect

17:16 bawr: bbloom: Yeah, at first I expected macroexpand to be recursive.

17:16 joevandyk: is there a rule of thumb for picking a clojure library vs one in a different language?

17:16 weavejester: ,(let [x '(+ 1 1)] `~x)

17:16 clojurebot: (+ 1 1)

17:16 technomancy: joevandyk: nothing beats asking on IRC =)

17:16 bbloom: bawr: there is macroexpand-all in walk

17:16 technomancy: jkkramer: cool

17:16 bbloom: ,(clojure.walk/macroexpand-all '(or 1 2 3))

17:16 bawr: bbloom: ooh.

17:16 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.walk>

17:16 bbloom: ,(walk/macroexpand-all '(or 1 2 3))

17:16 clojurebot: #<CompilerException java.lang.RuntimeException: No such namespace: walk, compiling:(NO_SOURCE_PATH:0)>

17:16 bbloom: *shrug*

17:16 &(walk/macroexpand-all '(or 1 2 3))

17:16 lazybot: java.lang.RuntimeException: No such namespace: walk

17:16 Bronsa: ,(require 'clojure.walk)

17:16 clojurebot: nil

17:16 bbloom: &(clojure.walk/macroexpand-all '(or 1 2 3))

17:16 lazybot: ⇒ (let* [or__3824__auto__ 1] (if or__3824__auto__ or__3824__auto__ (let* [or__3824__auto__ 2] (if or__3824__auto__ or__3824__auto__ 3))))

17:16 bbloom: there

17:17 pick a bot and a namespace

17:17 Bronsa: ,(walk/macroexpand-all '(or 1 2 3))

17:17 clojurebot: #<CompilerException java.lang.RuntimeException: No such namespace: walk, compiling:(NO_SOURCE_PATH:0)>

17:17 Bronsa: derp.

17:17 bbloom: of course there are 4 permutations, and i try all 4 of them before getting it right

17:17 Bronsa: ,(clojure.walk/macroexpand-all '(or 1 2 3))

17:17 clojurebot: (let* [or__2243__auto__ 1] (if or__2243__auto__ or__2243__auto__ (let* [or__2243__auto__ 2] (if or__2243__auto__ or__2243__auto__ 3))))

17:17 bawr: Why do we have such an ungodly number od bots, anyway.

17:17 Bronsa: 2 is ungodly?

17:17 weavejester: ,(read-string (pr-str '(+1 1)))

17:17 clojurebot: (1 1)

17:17 technomancy: Bronsa: well it's not three

17:18 arrdem: bawr: 2 isn't really that bad..

17:18 Bronsa: should we make it be three then?

17:18 weavejester: ,(read-string (pr-str '(+ 1 1)))

17:18 clojurebot: (+ 1 1)

17:18 arrdem: lets do it!

17:18 Bronsa: you start

17:18 bawr: I thought there *was* 3. My triple bad. ;)

17:18 arrdem: that was sarcasm

17:18 Bronsa: mine too

17:18 bawr: *were

17:18 * technomancy notes that bawr is obviously not trinitarian

17:19 bawr: Clearly, all spare blood went to my stomach.

17:19 arrdem: (inc technomancy)

17:19 lazybot: ⇒ 44

17:19 borkdude: technomancy binitarianism is more common among geeks

17:19 arrdem: ,(bool 'bawr)

17:19 bawr: technomancy: There's only one Eris, even if she also goes by Discordia.

17:19 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: bool in this context, compiling:(NO_SOURCE_PATH:0)>

17:20 weavejester: ,(eval (read-string (str "`" (pr-str '(+ 1 1)))))

17:20 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

17:20 bawr: technomancy: But I refuse to do reference counting. ;)

17:21 weavejester: (fn [form] (eval (read-string (str \` (pr-str form)))))

17:22 That works, but it… bleh

17:22 joevandyk: best way to do interactive web app tests? (like https://github.com/jnicklas/capybara)

17:23 maybe interactive's the wrong word. i mean being able to simulate clicks, filling in forms, checking boxes, etc

17:23 technomancy: joevandyk: peridot and kerodon both look great

17:23 kerodon probably for that

17:23 xeqi: joevandyk: I've got something similar in nature (though incomplete) at https://github.com/xeqi/kerodon ; or you can go full stack with https://github.com/semperos/clj-webdriver

17:23 phaer: joevandyk: You could use selenium trough java

17:24 joevandyk: there's a headless selenium thing, right?

17:24 that can do basic javascript?

17:25 xeqi: supposedly you can use htmlunit for that

17:25 haven't done it myself

17:25 bbloom: joevandyk: if you like capybara, just use it

17:25 no need to limit yourself just to clojure

17:25 phaer: joevandyk: Depends what you define as "headless".

17:25 bbloom: integration tests can be completely isolated anyway

17:26 joevandyk: phaer: being able to run in an environment without a graphical x server

17:26 xeqi: I usually just run my selenium test in an xvfb session

17:26 phaer: joevandyk: You can use firefox + xvfb for a complete browser or htmlunit.

17:26 joevandyk: hm

17:26 i should look into that

17:29 arrdem: w00t live in nrepl! I have no idea how to emacs..

17:30 * technomancy is conflicted about cond again

17:30 arrdem: technomancy: do tell

17:30 technomancy: every time there's a multiline value I always feel like I should separate the pred/value pairs with newlines

17:31 but I hate that cond is the only place where non-toplevel newlines

17:31 arrdem: ah. this pain I have felt.

17:32 Bronsa: gomai

17:32 ops.

17:33 arrdem: I have a zsh nested in emacs. what is going on here.

17:36 * technomancy hums level-up sound effect

17:39 bbloom: technomancy: i hate that. finally decided just to indent values 2 spaces

17:39 technomancy: clojure-1.4-compatible slamhound 1.3.0-SNAPSHOT release is on clojars

17:39 bbloom: it looks weird, but it offends me least

17:40 technomancy: my solution is normally to just quit using cond

17:40 I wonder if core.match has that problem too

17:40 bbloom: that also works

17:40 one other choice: short predicate and transformation names

17:40 technomancy: heh; yeah

17:41 bbloom: either def or let some nicely named functions and make a nice neat table out of those w/ cond

17:43 Baughn: I'm attempting to write plugins for a system that uses a significant number of custom annotations. Is this something I can use clojure to do?

17:43 bbloom: Baughn: java annotations?

17:43 Baughn: Yes

17:48 bbloom: There's nothing in the documentation, so I guess not?

17:50 weavejester: I think I might have written the worst function I ever have in Clojure...

17:51 (defn resolve-form [form]

17:51 (eval (read-string (str \` (pr-str form)))))

17:51 It works, though...

17:51 Baughn: If you can call invoking the compiler at runtime "works"..

17:51 I do hope you aren't expecting performance from that. :P :P

17:51 weavejester: Oh, it's being called by a macro

17:51 Baughn: Ah

17:52 ..I expect ` also exists as a symbol that you could wrap the form in

17:52 Well, special form

17:52 weavejester: Yeah, there should be a better way

17:52 Although...

17:53 callen: weavejester: dare I ask what project necessitated that?

17:53 weavejester: I'm trying to send a form to be remotely evaluated

17:54 It kinda seemed a good idea to resolve the form first

17:54 bbloom: weavejester: my backquote library allows pluggable resolvers, you could port the relevant bits from compiler.java, it's only 15 or 20 lines or so

17:54 i'd accept that pull request :-)

17:54 weavejester: bbloom: What's your library called?

17:54 bbloom: weavejester: github.com/brandonbloom/backtick

17:55 weavejester: Ah, I see

17:55 Baughn: <weavejester> I'm going to call eval on data I got from a remote source

17:55 Please excuse me while I panic

17:55 weavejester: Baughn: It's for a distributed calculation

17:56 So I have N worker processes consuming a queue

17:56 Baughn: weavejester: Throwing around live code is still.. worrying

17:56 bbloom: weavejester: my library is basically a port of https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L756 & there are some resolution bits in there that could be ported too

17:56 Baughn: weavejester: A network like that could be hilariously easy to break into. Make sure you at least use SSL.

17:57 bbloom: in particular https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L777-817

17:57 weavejester: Baughn: Well, that's the part that's bugging me, too. Not the security so much, but the fact that it's a leaky abstraction.

18:01 Baughn: So apparently, clojure /does/ support annotations, it's just not documented?

18:01 Er.. well, why not.

18:03 weavejester: Maybe I'm looking at this problem in the wrong way...

18:03 bbloom: Baughn: https://github.com/richhickey/clojure/commit/fa899d22dceb531d9f5af833ac6af0d956e6bdc7

18:03 Baughn: bbloom: Yeah, I found that.

18:03 callen: does anybody here know Yogthos?

18:03 he made that Luminus web dev template.

18:04 bbloom: Baughn: maybe open a bug on jira to improve that documentation?}

18:04 Baughn: I'm not sure that counts as documentation, but to be fair, it /does/ include.. ..okay, no comments.

18:04 bbloom: clojure's web site is starting to be in need of a big overhaul

18:04 Baughn: bbloom: Hehe, I'd rather open a bug to expand all of the documentation

18:05 callen: bbloom: ooh ooh, pick me pick me

18:05 bbloom: Baughn: more targeted feedback is likely to be more actionable

18:05 Baughn: Granted.

18:05 bbloom: I'm going to start by learning to use clojure. We'll see later.

18:05 I literally ran hello, world half an hour ago.

18:06 bbloom: Baughn: take some notes of what you struggle with and what's poorly documented, so you can help us help others later :-)

18:06 Baughn: Sounds like a plan

18:06 callen: Baughn: btw, http://clojure-doc.org/

18:06 bbloom: Baughn: that said, i may avoid java interop while you're learning clojure

18:06 callen: Baughn: hang with the Clojurewerkz guys, they'll take care of you.

18:06 Baughn: bbloom: The only thing I want it for is java interop, though. :P

18:06 I'll manage.

18:06 bbloom: start with the pure, functional subset of clojure and slowly expand your skill set to include the more complex bits

18:07 if you're doing 100% java interop, you might just be better off writing java :-P

18:07 callen: If Java is the only thing you're interested in, then use Java. You're here because there's something else you're interested in.

18:07 * callen hoists the Common Lisp pirate flag and claims Clojure in the name of all that is Lisp

18:07 Baughn: I'm writing a minecraft mod. There's going to be a bit of interop first, and then I can wander off into pure clojure-land.

18:07 pipeline: other jvm languages exist for 100% java interop

18:07 scala and groovy are both much more practical for that

18:07 callen: Baughn: that's a sweet idea for a project.

18:07 Baughn: callen: I didn't even tell you what the project /is/. ^^;

18:08 callen: Baughn: I don't care, I want a Clojure wrapper/framework for making Minecraft mods.

18:08 Baughn: callen: ..I can work with that.

18:08 callen: it could end up being so quick and easy to produce Minecraft mods if there's a nice Clojure library...

18:08 Baughn: Getting clojure to work with MCP might be fun, yurk

18:08 arrdem: minecraft?

18:08 callen: arrdem: Minecraft.

18:09 arrdem: yay I'm not alone here!

18:09 callen: Baughn: MCP is kinda pissy about their tools. They may get upset if you wrap it in Clojure.

18:09 Baughn: callen: ..my eyes doth bleed tears of sorrow for their loss

18:10 callen: Baughn: I'm just saying, they outline pretty strictly what you can and cannot do with their stuff

18:10 Baughn: you need written permission to respin their tools IIRC

18:10 Baughn: callen: Hopefully there's no need to do that

18:10 callen: Baughn: Iuno. I'm just a derpy web dev.

18:11 pipeline: i wouldn't worry too much about mcp

18:11 i'm sure they mostly want to prevent forking

18:12 Baughn: callen: I already got kickbanned from #redpower from asking if it was okay to try interoperating with blutricity, so yeah.

18:12 Most of their claims are utterly unenforcable anyway

18:13 Raynes: ho ho ho

18:13 arrdem: haha I spend time in #computercraft threatening to replace LUA with clojure

18:13 callen: Baughn: so much of the Minecraft community are utter children

18:14 bbloom: how'd you sucker him into joining the dark side?

18:14 bbloom: callen: who what?

18:14 callen: bbloom: oh it just seemed like he was a convert you'd brought in or something.

18:14 bbloom: i don't convert, i educate

18:14 Baughn: Nah, I've always liked lisp.

18:15 callen: fine fine, kill the joke.

18:15 arrdem: callen: it was dead on arrival mate.

18:15 Baughn: Haven't /used/ it much, but the choices for decent JRE languages are pretty sparse

18:15 * Baughn would have preferred haskell. ;)

18:15 bbloom: what arrdem said

18:16 callen: arrdem: thanks

18:16 Raynes: callen: Doesn't that apply to gaming in general?

18:16 Any given Halo game is full of lolnoobheadshotomg

18:17 callen: Raynes: nah, I participate in some cool game communities.

18:17 Raynes: it's commonly true though.

18:17 Raynes: Like?

18:17 bbloom: Raynes: there are plenty of adults playing halo, but they've just got the tv on mute b/c their kids are sleeping and don't have a microphone b/c they've sat on three of them already and keep snapping the cheap plastic

18:17 Raynes: I mean, I haven't come across a game that had an idiot free community.

18:18 the-kenny: Fifa 2013 </irony>

18:18 callen: bbloom: I hear someone speaking from experience.

18:18 Raynes: bbloom: Halo is great online as long as you avoid audio.

18:18 callen: yogthos: hey, it's Mob_of_One here.

18:18 bbloom: callen: no kids, but my gf works/sleeps odd hours :-P

18:18 callen: bbloom: that'll do it.

18:18 bbloom: suffering has a way of providing perspective :)

18:19 Raynes: bbloom: I played Dead Island and didn't have a way to turn off the other player's mic audio, so I had to listen to this 11 year old yell "KICK ME. KICK ME DUDE. KICK ME" for God knows why for half an hour until he got tired.

18:19 Funfact: you can't kick the other player

18:20 callen: Raynes: I got tired of that game quickly.

18:20 yogthos: hey

18:20 callen: Raynes: single or multiplayer

18:20 yogthos: hi, so Luminus.

18:20 yogthos: yeah :)

18:20 so far so good lol

18:20 callen: yogthos: so a few thoughts. Yes, good so far. The advantage of a template as opposed to a framework is that interested parties can rip out the irrelevant parts quickly.

18:20 bbloom: heh. oh the pain of being an 18 year old programming prodigy with a quick wit surrounded by reverse-prodigies

18:20 callen: yogthos: it's worth keeping in mind that you're making a specificity/friction trade-off.

18:21 Raynes: callen: I found it way too repetitive. The worst part was that the character's movement made me want to toss my lunch and I got dizzy if I played it for very long. They went *way* overboard.

18:21 bbloom: anyway, this is absurdly off topic

18:21 callen: Raynes: I didn't get dizzy, but I found very much like performing chores.

18:21 bbloom: how about that clojure stuff guys?

18:21 arrdem: bbloom: buzkill

18:21 Raynes: I've been playing Far Cry 2 which makes a similar attempt at emulating human movements, but it does it much better.

18:21 callen: yogthos: so if you provide a sqlite thingy in the models, somebody gunna have to rip it out

18:21 yogthos: yup

18:21 callen: yogthos: also, providing a prebaked database config presumes you know the best way to manage prod/dev configs

18:21 Raynes: bbloom: I don't think anyone cares at this exact moment in time.

18:21 yogthos: so one option is just to have some modules

18:22 callen: yogthos: so there's an interdependency that will cause a cascading series of rip-outs if you're not careful.

18:22 arrdem: it's christmas for christsake

18:22 yogthos: it's sort of how it's assembled already

18:22 Raynes: bbloom: callen and I can come over to your house and talk about this though, if it'd make you happier.

18:22 bbloom: i was kidding :-P

18:22 callen: yogthos: modularization is a great idea, I don't know how to do combinatoric lein plugins though.

18:22 Raynes: Right. In. Your. Ear.

18:22 callen: Raynes: I like video games anyway. I dun mind.

18:22 bbloom: Raynes: doors open. bring some beer

18:22 callen: yogthos: maybe do defaults with the ability to pass overrides on an as needed basis?

18:22 arrdem: bbloom: is that an open invite I hear? beer's cheap...

18:22 Raynes: bbloom: All I have is hard lemonade.

18:23 callen: yogthos: that seems plausible, but the config stack is probably going to have be fixed/invariant.

18:23 yogthos: you might even want to base the template on a dynamic templating system with overrides or something.

18:23 yogthos: but lets rollback a bit to reality

18:24 Baughn: callen: Ideally, I can get a Clojure loader into MCP as a 'mod'. The only real problem is that mods have to be, well, obfuscated - which doesn't play very nice with dynamic languages.

18:24 callen: But I'll give it a go.

18:25 Raynes: cemerick: Happy Christmas eve.

18:26 cemerick: Raynes: Merry Winter Solstice (ish)

18:26 callen: Baughn: wait, why are mods obfuscated?

18:26 HAPPY YULE

18:26 arrdem: okay. this emacs thing is proving a bit of a pain and I'm done with working. blergh

18:26 Baughn: callen: Because minecraft is

18:26 Raynes: callen: gtfo wiccan

18:26 arrdem: ^ yeah. that.

18:26 er... not what I meant at all..

18:27 Baughn: Oh, right. Happy newtonmas!

18:27 callen: Raynes: I'm not wiccan, I merely honor my ancestors by getting drunk and fat over the holidays. :)

18:27 Baughn: newtonmas, nice!

18:27 Raynes: But do you dance in a circle?

18:28 callen: Raynes: when I get drunk enough, yes.

18:28 Raynes: Only Wiccans dance in a circle.

18:28 callen: I'm preparing Mongolian BBQ for dinner tonight >:D

18:28 Raynes: this reminds me of the witch test in Monty Python

18:28 Baughn: 'twas a silly test. Everyone knows wood doesn't float.

18:28 <- Aquarist

18:28 callen: I'm a cancer.

18:29 if you ask the right people, they'll abbreviate to, "he's cancer"

18:29 Raynes: Stop spreading.

18:29 cemerick: Christians have done more for pagan rituals than the pagans could have ever hoped.

18:29 Baughn: callen: Like that cancer-based suppervillain?

18:30 * cemerick arrived, so it's OT-time! :-P

18:30 Raynes: cemerick: We were talking about video games before you joined, bro.

18:30 You don't even know what OT is.

18:30 cemerick: fair

18:30 I miss gaming.

18:30 Raynes: So, what do you mean?

18:30 cemerick: sometimes, anyway

18:30 callen: cemerick: btw, loving the book.

18:30 Raynes: re: pagan rituals

18:31 callen: cemerick: it's been a great read a few pages, hack for awhile, go back and read more companion.

18:31 cemerick: the section on delay/futures/promises/deliver was choice.

18:31 cemerick: callen: \m/ Feel free to leave a review eventually if you think it's warranted.

18:31 sweet

18:31 Raynes: I found that cemerick's book made excellent tinder for the fire this year.

18:31 callen: cemerick: I'm actually going to use that section to teach my frontend guy how promises/futures work.

18:31 even though he doesn't know Clojure (lol)

18:32 Raynes: Futures and promises make more sense in Clojure than they do in most.

18:32 twem2: 7

18:32 Raynes: 6

18:32 callen: Raynes: the for comprehension deref equivalence thing in Scala was loony.

18:32 Raynes: there's like zero symmetry in Scala.

18:32 cemerick: Raynes: Worshipping nature idols (Christmas tree), celebrating natural rebirth by lionizing the Easter Bunny, eggs, etc.

18:33 yogthos: scala is like a cauldron lol :P

18:33 Raynes: cemerick: Interesting observation.

18:33 bbloom: callen: Scala's for syntax is basically haskell's do syntax

18:33 yogthos: it's the C++ approach of just adding every feature known to man into one language

18:33 callen: bbloom: I don't like Haskell either. COINCIDENCE?!

18:33 bbloom: map and flatMap are scala's list monad names, but they generalize to the monadic laws

18:34 callen: yogthos: yeah, that's why I always snort whenever people tell me Scala is "simpler than Java"

18:34 bbloom: callen: http://blog.tmorris.net/controlling-effects-with-flatmap/

18:34 Raynes: cemerick: Wicca in particular is interesting because it gets called out as an 'invented' religion simply because it was invented in recent memory.

18:34 bbloom: scala is like java++

18:35 yogthos: lol

18:35 cemerick: Raynes: Indeed.

18:35 bbloom: if you prefer C++ over C, you'd prefer Scala over Java

18:35 it's that simple

18:35 Raynes: So simple a callen could do it.

18:35 bbloom: indeed.

18:36 callen: cemerick: you just got a 5-star review on Amazon. Merry Christmas :)

18:36 Raynes: do ho ho.

18:37 "so simple a callen could do it", this should be the litmus test for library usability.

18:37 cemerick: callen: dude, you're a mensch :-)

18:37 bbloom: cemerick: how was the book authoring experience?

18:37 cemerick: bbloom: do you have four hours to talk? ;-)

18:38 I'm going to publish a retrospective on the whole thing sometime Q1

18:38 bbloom: cemerick: heh, actually yeah. i've been considering forcing myself to write a blog post a week and eventually compile it into a book

18:38 callen: bbloom: leanpub is popular for that sort of thing

18:38 cemerick: Definitely a smart approach.

18:38 callen: bbloom: if you do your blog posts in Markdown, you can directly port it.

18:38 cemerick: f'n Markdown.

18:38 yogthos: hehe

18:38 callen: I'm not a fan myself (prefer org mode), but it's popular.

18:38 yogthos: no two flavors are alike :P

18:38 no love for latex?

18:38 callen: yogthos: mostly because the fool that created it declared himself BDFL and then sat on it.

18:39 the-kenny: org-mode -> LaTeX ftw.

18:39 callen: yogthos: what the-kenny said.

18:39 LaTeX is a compile targer

18:39 target

18:39 not an end-user lang.

18:39 yogthos: it's not that bad :)

18:39 bbloom: callen: i do my posts in blogger's stupid editor thinggie, which royally sucks for code, but i just haven't gotten around to configuring a static page generator in a non-useless fashion

18:39 the-kenny: (Like Java </duck>)

18:39 cemerick: bbloom: if you'll be at clojurewest, we can chat about publishing/authorship at length

18:39 callen: I did all of our due-diligence documentation via org-mode -> LaTeX -> PDF generated documents.

18:39 bbloom: plenty of SSGs in Clojure yo.

18:40 cemerick: I take it you're not one of those people who think it's a total waste of time?

18:41 bbloom: cemerick: *might* make it there, otherwise i'll be in NY, so (just github stalked you) i may find an excuse to road trip up to boston/ma/whatever

18:41 callen: patio11 has been rather loud about his dismissal of writing books. He's gotten rather obsessed with economic extraction.

18:41 bbloom: i'm much more interested in the clout for hiring for my next company

18:42 callen: bbloom: next? you going to do a startup?

18:42 cemerick: callen: No, writing is never a *total* waste of time

18:43 bbloom: callen: did one, going to do another

18:43 callen: wtf amazon. I searched for "laptop stand" and got "Fifty Shades of Grey"

18:43 cemerick: bbloom: are you in NYC now?

18:43 bbloom: cemerick: moving jan 29

18:43 callen: cemerick: I agree with you and see the value on several fronts, but some people are hellbent on reducing everything to direct and immediate compensatory value.

18:43 cemerick: callen: that's called "anticipating future purchasing intent"

18:44 callen: from laptop stand? sigh.

18:44 cemerick: I think it did this because I bought Christmas gifts for women.

18:44 cemerick: bbloom: ping me and we'll catch lunch or something. I'll be making my way to NYC semi-regularly next year.

18:44 bbloom: cemerick: definitely going to take you up on that

18:45 cemerick: I'll bug you about business/startup stuff in exchange. :-P

18:45 bbloom: cemerick: my pleasure. 2 years and a small exit yields lots of good stories :-)

18:45 cemerick: callen: yeah, the consulting biz optimization stuff that landed on his podcast recently was *weird*

18:46 callen: cemerick: tbqh, ever since he stopped caring about bingo card and appointment reminder, he seems like he's gone off the deep end

18:46 cemerick: oh, I think he'll end up scaling AR quite a way

18:47 callen: cemerick: he's not really about optimizing revenue in the context of doing your own thing anymore, it seems mostly like "quickest maximum economic extraction, damn all other things" now.

18:47 I mean, I keep hearing that, but AR is so neglected that I've considered running a competitor to it just to spur him on.

18:47 AFAIK, he's been doing consulting full-time for years now.

18:48 cemerick: *shrug*

18:48 he's clearly got quite a profitable shtick.

18:49 callen: no doubt, but the original reason I was interested in him is that he inspired me to try bootstrapping again

18:49 he's since departed from that quite a bit, so I'm a bit alienated from his current priorities, even if I value his knowledge.

18:51 yogthos: well, at least you're finally here now. You're the most active person on r/clojure, I was really surprised you weren't on here.

18:52 ivan: patio11: you were cool before you started raking in the big bucks

18:54 callen: ivan: it's not about wearing the hair shirt, it's about freedom.

18:55 yogthos: so uh hi all :P

18:57 callen: yogthos has been shepherding the Reddit Clojure community, he made a template/pico-framework for Ring designed to enable people to get started more quickly as well.

18:57 I'm fiddling with it as we speak, although I'm about to go buying ingredients for dinner.

18:57 weavejester: Ho yogthos

18:57 Or Hi even

18:57 yogthos: howdy

18:58 callen: yogthos: what part of the world are you in? I'm in the bay area.

18:58 Raynes: Life would be better if people would just use weavejester libraries.

18:58 callen: Raynes: it does.

18:58 Raynes: it uses Compojure

18:58 or I thought it did, wait a tick

18:58 yes it does.

18:58 yogthos: yeah, I'm taking the approach of a nice default template with a lib and helpers

18:58 callen: yogthos: the lib-luminus includes compojure doesn't it?

18:59 yogthos: yup

18:59 callen: that was confusing.

18:59 haha

18:59 Raynes: I entirely disagree with the reason luminus needs to exist.

18:59 IT'S SO NOT HARD

18:59 yogthos: for us

18:59 I'm introducing clojure at work

18:59 people have trouble with the stupidest things

19:00 Raynes: :p

19:00 yogthos: it's kind of hard to look back once you learn something and remember what it's like on the other side :)

19:00 callen: Raynes: we're the revolutionary vanguard, we know what the noobies need. Do not spite the educators!

19:00 Raynes: yogthos: Why do you have lib-luminus?

19:00 callen: I'm musing on that too.

19:00 yogthos: helper utils mainly

19:00 Raynes: Yeah, lib-noir. :p

19:00 yogthos: I could merge with that

19:00 would make sense

19:00 Raynes: You've added another library to the mix when you could have just added this stuff to lib noir. You're not helping!

19:00 :p

19:00 yogthos: lol

19:00 callen: Raynes: don't be mean! It's Christmas.

19:01 or it will be, tomorrow.

19:01 yogthos: I'm totally cool to add the stuff to lib-noir makes it easier :)

19:01 I wouldn't mind taking it over either if you get bored with it :P

19:01 callen: just let him go further down the rabbit-hole with Laser

19:01 Raynes: You just want to add that weird redirect macro.

19:01 yogthos: but for now I just wanted to get something out of the door

19:02 well right now context is borked on app servers :)

19:02 callen: yogthos: you should fix the FIXME in the description for lib-luminus.

19:02 aha, that's where compojure and hiccup are coming from.

19:03 Raynes: yogthos: Yeah, pretty much all of this stuff would be fine in lib-noir if you sent me a pull request. Leave out the markdown-clj stuff. I'd rather use pegdown for that. You can add it, just do it like refheap does it.

19:03 yogthos: yeah sure thing, I can move it to the template

19:03 Raynes: yogthos: Also, I'm really just kidding with the mean stuff. I think the template is a good idea. I would definitely rather move this utility stuff into lib-noir though.

19:04 yogthos: haha no prob dude :)

19:04 ibdknox: Raynes is mean

19:04 He berates me constantly

19:04 and I cry.

19:04 yogthos: lol

19:04 Raynes: And I'll play with the redirect stuff too, because I now feel bad about not paying much attention to your pull request.

19:04 yogthos: hi Chris :)

19:04 callen: I agree, merging the utility/middleware code into lib-noir and then anything objectionable into the template makes a lot of sense to me.

19:04 ibdknox: I end up taking it out on cemerick

19:04 the-kenny: Everyone here is totally mean!

19:04 (especially Raynes)

19:04 yogthos: wahh

19:04 callen: the-kenny: I'm mean too, just ask me about generating HTML.

19:04 ibdknox: IT'S A TRAP

19:04 the-kenny: callen: How would you generate html?

19:04 yogthos: that's one of those shed painting questions :P

19:05 the-kenny: I'd use some XML stuff for it

19:05 Raynes: yogthos: If you get around to sending me a pull request to merge lib-luminus, I'll get it done quickly. I promise this time. :)

19:05 ibdknox: yogthos: hi :)

19:05 yogthos: ok I'll get on that

19:06 callen: yogthos: I'll re-critique/re-build the app under lib-noir + template when you give me the heads up that the merge is done.

19:07 Raynes: ibdknox: http://www.reddit.com/r/Clojure/comments/15cspw/luminus_my_attempt_at_a_clojure_web_framework/c7lhuf8

19:07 ibdknox: huh

19:07 I think people are looking at the Noir thing wrong

19:08 disregarding that, I've been very upfront with korma

19:08 bbloom: i'm starting to have a thing that looks like AngularJS, Clojure, and WPF had a weird 3 headed baby.... i kinda like it... hopefully i can get it to a production quality before i need to go back to doing real work again :-)

19:08 ibdknox: it's not my fault that no one seems to care enough to keep it moving forward

19:08 callen: ibdknox: what *is* the status with Korma anyway?

19:08 are people just using the Clojure JDBC wrappers?

19:08 yogthos: yeah with 700 stars I was surprised nobody picked it up

19:08 ibdknox: tons of people are using Korma

19:09 Raynes: ibdknox: People are thinking we just abandoned it. I think I was fairly clear in stating that I just didn't see the point in keeping it going when Compojure and lib-noir became such a good solution.

19:09 callen: ibdknox: so you're waiting for a maintainer?

19:09 ibdknox: callen: yep, called for one several times now, have had about 4 people step up, but no one actually did

19:09 Raynes: yeah - that's the thing. I don't think Noir is the best solution anymore

19:09 callen: that is unfortunate.

19:10 yogthos: yeah I think compojure+lib-noir is pretty smooth sailing, all that's really missing is a nice template, hence luminus

19:10 ibdknox: Korma needs work, but it would ridiculous to expect me to do it at this point - not even because of LT, but because I'm not doing *any* SQL work at all

19:10 yogthos: make some sane defaults that run out of the box, and then people can rip out change what they need

19:10 callen: I've had too much yak-shaving occur because of the absence of a quick-start template, hence Luminus.

19:10 ibdknox: I can only stretch my charity so far :/

19:11 callen: funny part is, I was talking in this channel about making a template right before Yogthos announced Luminus.

19:11 Raynes: ibdknox: My highly edited response: http://www.reddit.com/r/Clojure/comments/15cspw/luminus_my_attempt_at_a_clojure_web_framework/c7lou6q

19:11 callen: ibdknox: I take it LightTable is eating you alive?

19:11 yogthos: btw nice work on that ;)

19:11 I'm really enjoying seeing how the releases are progressing

19:12 ibdknox: callen: one guy building an IDE is a bit of a challenge ;)

19:12 weavejester: Hm, Stuart Sierra's data.dependency library doesn't seem to be on Maven or Clojars

19:12 Raynes: ibdknox: People always get that entitlement feeling when they start using things in production. I really don't believe in using anything free that I wouldn't be willing to replace or maintain myself if I had to.

19:12 ibdknox: VS has 2000 people in total lol

19:12 callen: ibdknox: aye, I don't doubt it @ IDE

19:12 ibdknox: yogthos: some really neat stuff coming soon I think :)

19:12 callen: Visual Studio has a distinct lack of focus.

19:12 ibdknox: yes it does

19:13 bbloom: ibdknox: i'm sure it's fun to say "i'm doing the work of 2000 people" but you damn well know that 1500 of those people are doing negative work :-)

19:13 callen: ibdknox: just wondering, how much thought will you be giving to web dev workflows in LightTable? So far it's great for testing groups of functions (for me).

19:13 weavejester: Oh, looks like it's part of tools.namespace - it was never released separately

19:13 ibdknox: bbloom: haha, it's more a matter of creating a sense of scale

19:14 bbloom: one of my favorite questions was always to ask how big in LoC VS is

19:14 bbloom: ibdknox: did you ever plot a histogram of responses to that? :-)

19:14 ibdknox: callen: I think that's one of the places it can shine

19:14 bbloom: hah, I should've. The answers were hilarious

19:15 bbloom: ibdknox: probably would have needed to be a logorithmic scale

19:15 ibdknox: bbloom: maybe 100kloc? no, probably like 500k

19:15 bbloom: lol.

19:15 ibdknox: it's funny how little we know about our own industry

19:15 100kloc is quite a bit for a website

19:15 * bbloom runs `cloc emacs`

19:15 ibdknox: but that doesn't even given you the VS editor

19:16 bbloom: do be fair, like 92% of those lines are QueryInterface :-P

19:16 zilti: bbloom: Let me know the result

19:16 ibdknox: bbloom: COM is evil

19:16 the editor was entirely managed though

19:16 bbloom: zilti: 1,410,764 ignoring blanks and comments

19:16 ibdknox: and it was still something on the order of half a million

19:17 it's an interesting exercising forcing LT to remain small such that I can still continue to work on it

19:17 zilti: bbloom: For Emacs? Wow. Is that the "raw" version, or the one including things like org-mode?

19:17 ibdknox: exercise*

19:17 bbloom: zilti: git://git.savannah.gnu.org/emacs.git

19:18 ibdknox: what size is LT now?

19:18 ibdknox: < 5k

19:18 bbloom: ibdknox: nice.

19:18 ibdknox: with the refactor I'm doing right now, it'll get smaller actually

19:18 bbloom: `cloc textmate` yields: 142,405

19:19 probably would be most fair to compare single-language support tho

19:19 zilti: That's a damn lot for a "simple text editor"with extension interfaec

19:19 bbloom: simple != smal

19:19 l

19:19 ibdknox: there is no such thing as a simple text edtiro

19:19 editor*

19:19 bbloom: zilti: sometimes, simple is bigger, since you're not packing complex multi-purpose semantics into single lines

19:20 zilti: ibdknox: Notepad

19:20 yogthos: speaking of text editing, is there any plans for paredit style stuff? :)

19:20 bbloom: i consider redis to be simple, but cloc says 90,214

19:20 zilti: notepad is a lot more complex than you'd think

19:20 callen: Notepad isn't as simple as you think

19:20 bbloom: notepad cheats a bit by leveraging window's textbox control

19:20 ibdknox: notepad is actually pretty impressive

19:20 bbloom: you ever try to create a text box control? heh.

19:21 ibdknox: the amount of work that went into virtualizing large files was crazy

19:21 bbloom: ibdknox: in notepad or lighttable?

19:21 zilti: I never did Windows programming. But I've some experience with plain Swing programming.

19:21 ibdknox: notepad

19:21 bbloom: ibdknox: when did it get that feature? vista? lol

19:21 ibdknox: I think so

19:22 I'm punting on the stupidly large files thing for now

19:22 bbloom: how's LT's large file support? ;-)

19:22 heh

19:22 ibdknox: lol

19:22 bbloom: poorly. got it!

19:22 ibdknox: not worth it

19:22 want to open a 1gb file?

19:22 do it somewhere else :p

19:22 bbloom: vim is this way --->

19:22 reasonable decision

19:22 ibdknox: the only thing that are actually that large are logs anyways

19:23 bbloom: ibdknox: generated sources too

19:23 ibdknox: and there are likely better solutions there

19:23 they get up to > 10mb?

19:23 yogthos: well if you have large files with clojure it's already gone off the rails :P

19:23 bbloom: (spit "myapp.edn" output-of-cljs-analyzer)

19:23 ibdknox: ah

19:23 bbloom: ibdknox: just be careful that you don't offer any plugin apis that let people write stupidly slow whole-file processing

19:24 "pit of success" and all that: the APIs should encourage line-scan relative processing

19:24 i know you're already service-izing and async-ifying everything

19:24 ++ for that

19:24 ibdknox: and asynchrony

19:24 yeah

19:24 bbloom: it's one of the major disadvantages of clj forms vs something like a line oriented protocol

19:24 Rich_Morin: I don't see a way to step to the next problem in 4clojure; am I missing something?

19:25 ibdknox: I haven't gotten to the point where I'm ready to craft those APIs yet

19:25 bbloom: a line oriented protocol is kinda inherently scan friendly

19:25 aim for something reducer-esque :-)

19:25 Rich_Morin: nm

19:26 bbloom: Rich_Morin: we all assumed you'd find it :-P

19:26 dnolen: core.logic constraint stuff just got considerably more reliable

19:26 gfredericks: your issue should be fixed now along with many, many others

19:26 callen: dnolen: as opposed to what?

19:27 ibdknox: callen: dnolen just recreated the universe as a logic problem, no big deal

19:27 dnolen: callen: not really being reliable - particularly when mixing together the various contrainst available to you.

19:27 constraints

19:27 bbloom: ibdknox: i mean, doesn't E=MC^2 imply that that it's a finite domain? dnolen should have *zero* trouble with that

19:28 ibdknox: haha

19:28 dnolen: hehe

19:28 ibdknox: dnolen: you rock.

19:28 * bbloom taps foot impatiently

19:36 dnolen: and it seems faster too - tho I didn't really work that much on that.

19:55 Siphonblast: This is relatively off-topic, and I realize the ubiquity of such a question, but the dearth of Clojure docs puts it in a specific position: (of the few) what are some great Clojure books and/or comprehensive resources for learning Clojure? I am not the kind of person to glean deep understanding from documentation. ATM I am doing SICP, and while Scheme is much different, at least it introduces me to similar philosophies. Clojur

19:55 e on the other hand is a bit more ambiguous with how to get to the level of solving very difficult 4clojure problems.

19:56 dnolen: Siphonblast: O'Reilly book is good

19:57 bbloom: i think rich's talks are also great insight into the clojure mindset

19:57 ~infoq

19:57 clojurebot: infoq is http://www.infoq.com/author/Rich-Hickey

20:01 Baughn: Um, how do I inject some arbitrary .jar in the leiningen classpath?

20:02 zilti: Baughn: Leiningen does not want you to do that at all, unfortunately.

20:02 Baughn: I need to do so anyway. :/

20:02 zilti: Baughn: You might want to use this plugin: https://github.com/kumarshantanu/lein-localrepo

20:06 Baughn: zilti: Gives me mostly nullpointerexceptions.

20:08 zilti: Baughn: It works fine here. The only downside is that lein searches all online repos for the jar you put in your localrepo before using it, which takes a few seconds.

20:10 Baughn: zilti: What version are you using?

20:11 zilti: Baughn: [lein-localrepo "0.4.1"]

20:11 Baughn: Right. Maybe 0.3.0 is too old..

20:11 It's the one there was installation instructions for, though. :X

20:11 bbloom: dnolen: is that a good example of using core.logic to linearize a dependency graph?

20:11 s/that/there

20:12 dnolen: bbloom: not that I'm aware of

20:13 bbloom: dnolen: should just be a simple matter of unifying a vector where (relative-order left right) ?

20:13 Baughn: zilti: I mean, https://github.com/kumarshantanu/lein-localrepo just says to add a line to profiles.clj

20:13 zilti: But that doesn't seem to /do/ anything

20:13 Do I need to manually install it, as well? How?

20:13 zilti: Baughn: Did you add it to the correct profiles.clj?

20:13 bbloom: i'll git it a crack

20:13 give* man i can't type today

20:13 zilti: No need for a manual install

20:14 Baughn: zilti: ~/.lein/profiles.clj, sure

20:14 zilti: Baughn: So it looks like that at you:

20:14 {:user {:plugins [[lein-localrepo "0.4.1"]]}}

20:15 Baughn: Yes. I copied and pasted from the readme.

20:15 zilti: Then do a "lein deps"

20:15 And then you should be able to use "lein localrepo"

20:15 Baughn: Nope

20:15 $ lein localrepo

20:15 That's not a task. Use "lein help" to list all tasks.

20:16 zilti: And you are using leiningen 2, right?

20:17 Baughn: Looks like 1.7.1

20:17 ..yeah, that'd do it.

20:17 zilti: Baughn: Then you'd have to "lein plugin install lein-localrepo "0.3""

20:18 Baughn: That's what I tried first, actually. That's the one that gives me nullpointerexceptions.

20:18 zilti: Strange.

20:18 But you should consider upgrading to leiningen 2

20:19 Baughn: Doing that now. Too bad the package manager's version is so old.

20:20 bbloom: dnolen: it occurs to me that i can do this trivially for a particular graph, but i have no idea how to generate a core.logic program from an input graph

20:22 Baughn: zilti: Did that, localrepo install now works, :dependencies on the .jar does /not/

20:23 zilti: Baughn: No, you are doing it wrong. You have to do a

20:23 lein localrepo install <filename> <[groupId/]artifactId> <version>

20:23 Baughn: Yup, did that.

20:23 zilti: And then add [groupId/artifactId "version"] to your project.clj

20:23 Baughn: Did that, too

20:23 dnolen: bbloom: it's tricky business I'll say that much :)

20:23 zilti: And then lein deps

20:24 Baughn: Did that. No good

20:24 bbloom: dnolen: the obvious answer is a macro, but that just feels dirty :-P

20:24 zilti: Baughn: What does it say now?

20:24 dnolen: bbloom: I keep telling people I usually cheat. I read a Prolog answer and port it.

20:24 Baughn: zilti: ould not find artifact net.minecraft:minecraft:pom:1.4.6 in central (http://repo1.maven.org/maven2)

20:24 +C

20:24 And another one for clojars

20:25 bbloom: dnolen: heh. ok well i basically just want to take a graph and generate a bunch of beforeo forms

20:25 zilti: Baughn: It says that because it can't find them online, but it has it locally, so that should work fine now. You get those "could not find" messages for every dependency you add.

20:26 bbloom: dnolen: kinda wish there was some and/or tree i could return and pass to the solver :-)

20:26 Baughn: zilti: Oh, right.. this .jar is the obfuscated one. >_>

20:28 dnolen: bbloom: pro-tip, Ask a Prolog question on StackOverflow and hope that noone thinks it's a homework question.

20:28 bbloom: dnolen: lol

20:28 dnolen: Prolog answers on SO are always really good.

20:28 zilti: I try using deftest in a midje test file, but it keeps telling me that deftest doesn't exist. Is that in another namespace than midje.sweet, or is the documentation outdated?

20:29 dnolen: bbloom: seriously, if you find a Prolog solution - porting it usually is trivial.

20:29 at least in my experience.

20:32 bbloom: dnolen: i think my real question is: how do i treat logic predicates as data? ie how can i generate predicates and then how do i run the generated program?

20:33 dnolen: bbloom: I gotta run, I need to more concrete description of what you'd like to do

20:33 xeqi: Bahman_: localrepo adds the jar, but not a pom; those messages are lein checking for the pom on a server;

20:33 bah

20:33 Baughn: ^

20:34 you can add a fake .pom based on http://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Minimal_POM to your ~/.m2 to get rid of them

20:39 clj-newb-234: is there a builtin for (fn [v k v] (set! v (assoc v k v))) ?

20:39 is there a builtin for (fn [v k va] (set! v (assoc v k va))) ?

20:39 where v = a var, k = a key, va = a value

20:40 zilti: http://clojuredocs.org/clojure_core/clojure.core/assoc

20:41 clj-newb-234: ??

20:41 lazybot: clj-newb-234: What are you, crazy? Of course not!

20:41 clj-newb-234: how does the doc to assoc solve the above?

20:41 I want to update a var ...

20:44 zilti: clj-newb-234: You wrote if there's a built-in for collection/key/value.

20:45 clj-newb-234: assoc is not equiv to the fn defined above

20:46 zilti: Think over it twice if you really need a var.

20:48 clj-newb-234: well, i've gone ahead and thought it over 3 times

20:48 it's technically not a var, but a dynamic binding, i.e. (binding [*blah* ...])

20:48 I should have been clearer

20:49 zilti: Definitely, and your fn up there doesn't compile.

20:51 clj-newb-234: intresting

20:51 so basically, this would have to be amcro

20:51 oh boy, i'm using binding, set!, and macros

20:51 perhapss I should rethink this through

20:52 xeqi: clj-newb-234: you don't need a macro for that

20:52 clj-newb-234: I need a way to also involve transients and jni

20:52 xeqi: enlighten me:

20:52 (defn update-binding! [b k v] (set! b (assoc b k v))

20:52 is not allowed as a func, ... thus my next idea is a macro

20:52 how can I do that without using a macro?

20:53 bawr: Is it just me, or is readline broken for lein repl under cygwin?

20:54 clj-newb-234: this christmas, I'm thankful I no longer have been cygwin free for half a decade

20:55 xeqi: blah, I was thinking atom, not var, sorry

21:02 azkesz: hey guys, is there a way to write asm win32 code from clojure ?

21:04 maybe I didn't phrase that right, I'm wondring if there's some kind of asm compiler that uses clojure code inside the asm for macros for example

21:04 yogthos: I don't think such an animal exists ;)

21:05 azkesz: I'm currently checking this http://blog.danieljanus.pl/blog/2012/05/14/lithium/

21:05 yogthos: nifty

21:06 github hasn't been updated for a while

21:07 azkesz: 7-8 months

21:07 yeah but that's seems to be what I was looking for, seeing the example

21:07 yogthos: ah

21:08 heh would probably be a lot easier to implement for arm :)

21:08 azkesz: you know like something like that: https://github.com/nathell/lithium/blob/master/examples/stripes.li.clj

21:08 yogthos: the intel instruction set is massive

21:08 azkesz: to write asm in clojure like way

21:09 yogthos: looks pretty similar to the regular way :)

21:09 azkesz: yeah lol but I kinda need the power to use macros

21:10 yogthos: yeah I can see fun assembly hacking with macros ;)

21:14 azkesz: now I'm thinking maybe I just needed some way to write assembler in clojure such that when ran it will generate a "real" (masm) .asm file, so it would just act like a neat macro machine.

21:15 wonder if that's what you'd ccall a preprocessor

21:30 yogthos: heh maybe you can grab a list of opcodes and generate the preprocessor that way

21:32 azkesz: naah without that, I meant simply convert what i write into masm .asm format, and let masm do the asm to bytecode; but you're right lithium does asm to bytecode directly; but I'm having second thoughts about doing any asm anymore, I initially wanted a small .exe file to apply a patch

21:32 bawr: technomancy: I have a small patch to lein.sh that makes repl work under Cygwin. How do I go about sending it somewhere? :)

21:32 azkesz: pull request on github

21:33 https://github.com/technomancy/leiningen

21:41 bawr: Welp, I was hoping for a simple patch. But erh, was going to dig up my github, anyway.

21:52 clj-newb-234_: what are good examples of code bases < 10K LOC worth reading (in clojure)

21:52 I actually don't care what it does, as long as it's idiomatic clojure code and does something cool

21:52 bonus points if it relates to Databases and distributed ystems

22:17 bbloom: clj-newb-234: not sure how idiomatic they are, but nathanmarz has some cool distributed systems and database projects

22:18 clj-newb-234: https://github.com/nathanmarz/storm & https://github.com/nathanmarz/elephantdb for example

22:18 peeking at the code, it seems relatively sane

22:18 although he's pretty aggressive about supporting java clients too, which can add complexity

22:19 also, a bit messy, but extremely enlightening: https://github.com/clojure/clojurescript

22:21 xeqi: I like the https://github.com/weavejester/compojure source, decent intro to the ideas at http://www.booleanknot.com/blog/2012/09/18/routing-in-compojure.html

22:27 arrdem: technomancy: yeah I'm now lost in emacs... live via erc

22:55 muhoo: trying to download slides for this, and it's hanging on chrome CM9 http://www.infoq.com/presentations/Clojure-Reducers . i am logged in.

22:55 is it just me?

22:56 * ioexception dials infoq.911

22:57 muhoo: well, i don't expect anyone here to FIX it, but it'd be nice if someone could confirm "it works for me"

22:58 because, if it doesn't work for others besides me, then i will contact infoq. but in the meantime, my setup is odd enough that it could be pilot error on my part.

23:01 gfredericks: is it normal for `lein repl` to involve 20 or 30 OS processes?

23:17 theatticlight: `lein repl` should only involve 2 OS processes.

23:26 Raynes: technomancy: Me no can contact Heroku? And refheap is down?

23:27 Looks like the ssl endpoint is broken.

23:27 Just FYI to everyone, refheap is down, do not panic.

23:27 * Raynes hyperventilates

23:30 alex_baranosky: I'm trying to think of a nice way to do this: I want to drop the ns form from a file, and keep the rest of the file contents (unmolested/unreformatted) and then put a new ns-form in place of the old … The way I was trying was to use `read` with a PushbackReader, read the first form, and then read the rest of the file. The problem with this approach is that the namespace ends up getting reformatted, which I'd like to avoi

23:30 I mean to say the body of the namespace gets reformatted.

23:32 Raynes: I've been using ref heap a lot for sharing code snippets between machines/devs at work

23:32 Raynes: alex_baranosky: Yey! Sorry for downtime. :(

23:32 alex_baranosky: Raynes: it is a lot nicer than having Skype mangle it

23:32 Raynes: Luckily the only time refheap has ever went down is when Heroku goes down.

23:32 And the only time Heroku has issues is usually when AWS is having issues.

23:33 So all bad things in the universe can be directly linked back to Amazon.

23:33 muhoo: QED

23:35 all the ops are probably drinking egg nogg or whatever.

23:35 alex_baranosky: muhoo, what a great idea

23:36 muhoo: tho i'd bet technomancy is probably putting presents under tree for his kids, right about now, etc.

23:38 maybe amazon downage is why i can't get infoq to hand me pdfs of rich's slides

23:48 alex_baranosky: no one has any ideas on a good way to replace just the ns form of a namespace?

23:53 Sgeo: Can Heroku be used to run web stuff from arbitrary languages?

23:54 arrdem: Sgeo: in theory...

23:55 if you wanted to do some non-standard server I suppose you could include it in your repo and change their run command to launch it so long as it conforms to their $PORT var

Logging service provided by n01se.net