#clojure log - Apr 26 2012

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

0:00 felideon: oh wait silly me

0:00 * devn slaps your around a bit with a large trout

0:00 devn: you* (fail)

0:00 LuminousMonkey: your around?

0:00 felideon: lol you using mIRC or something

0:01 devn: felideon: it was meant to be a throwback, but then i made a typo... :(

0:01 * hugod just updated the readme to mention melpa and try and clarify the slime install

0:01 felideon: hugod: what does t at the end of add-to-list do?

0:02 hugod: good question

0:02 devn: did you guys see this earlier? I was picking through old sexps on the #clojure channel and I found:

0:02 ,(letfn[(!-?>[&$ &!](if(>,&!,1)(!-?>@(->>,&$,(*,&!)ref)(->,&!,dec))&$))](!-?>,1,5))

0:02 clojurebot: 120

0:03 hugod: felideon: adds it to the end of the list

0:03 felideon: hugod: ah

0:04 hugod: oh, so do i need that specific version of slime? i had just installed slime-ritz through M-x package-list-packages

0:05 devn: im heading to bed

0:05 happy clojuring all, and to all a goodnight

0:05 felideon: devn: nite

0:05 devn: ho ho ho, merry [x xs]mas

0:05 hugod: felideon: yep, the version ritz uses isn't the same as the version swank-clojure uses

0:05 felideon: which isn't the same as CVS head

0:06 * felideon hears everyone facepalm

0:06 devn: CVS...the wave of the *future*

0:06 hugod: no, I've been meaning to update ritz to use head, but haven't got round to it

0:06 felideon: is it really impossible to have all this coexist with regular slime?

0:06 ah

0:07 hugod: it might work with cvs head, but I haven't tried recently

0:08 felideon: maybe i shoould just have two emacs init files altogether

0:08 and rename them depending if i am going to lisp or clojir

0:09 hugod: or just pass an arg to emacs, -l ~/.emacs-for-cljr.el

0:10 felideon: well there you go

0:10 hugod: what is the benefit of using ritz?

0:10 i think i only stumbled on it because google turned up this line "If you use slime with multiple lisps, you can isolate clojure specific setup by using ritz-connected-hook and ritz-repl-mode-hook."

0:10 hugod: integrated debugger - not sure how it compares to swank-clojure now it has cdt

0:11 many other minor tweaks

0:12 felideon: I see.

0:12 hugod: if i wanted to use the jack-in support

0:13 i have to disable all my slime configs?

0:13 "For "jack-in" to work, you can not have SLIME installed." define 'installed'

0:14 hugod: felideon: https://gist.github.com/1934037 is most of my slime config

0:15 ben_m: How do you wrap something in a var and what implications does that have?

0:15 felideon: hugod: oh interesting

0:15 hugod: felideon: for jack-in to work, you shouldn't have slime loaded, might be a more precise statement

0:16 so, just make sure you don't have a (require 'slime)

0:16 felideon: so you with your setup, you can have a CL slime-repl and a clojure one side-by-side?

0:17 hugod: yes, though I haven't run CL in a few months

0:20 * hugod heads to bed too

0:21 y3di: light table has a good chance of getting funded!

0:22 LuminousMonkey: Would be nice. :)

0:28 technomancy: how is melpa anyway?

0:28 I told that guy to write it but I haven't gotten a chance to try it

0:33 ben_m: Is there a command to find out where leiningen expects the .lein to be?

0:33 Because I have (use 'clojure.repl) in my user.clj, but still can't use (doc)

0:34 technomancy: ben_m: https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/user.clj#L5

0:34 I'm not sure user.clj was carried forward to lein2

0:34 ben_m: Not using lein2

0:35 felideon: technomancy: do i have to download slime from marmalade to be able to slime-connect to swank-clojure?

0:39 technomancy: felideon: you could prime your emacs instance by M-x clojure-jack-in first, but yeah otherwise you need a manual install

0:39 ben_m: it could be loading but not affecting the repl namespace; toss a println in there

0:41 ben_m: Where would that println show up, using clojure-jack-in?

0:42 Oh, nevermind. I'm just stupid.

0:42 (doc) works in the user ns (even though I get ^M for line endings), just stops working as soon as I switch ns :D

0:43 technomancy: yeah, that's the annoying thing about clojure.repl

0:44 felideon: technomancy: I guess I meant downloading from marmalade vs from cvs head

0:44 technomancy: felideon: oh yeah, stay the heck away from cvs

0:44 cvs in general, but especially slime's cvs

0:44 brehaut: huh... I never took the time to wet the filter beforehand

0:44 will have to start trying that

0:45 ben_m: technomancy, appreciate the help though :)

0:45 brehaut: technomancy: i generally rinse my chemex filters before use, but i dont think it changes the taste much

0:46 felideon: technomancy: well, meh. so if I want to run CL an Clojure slime repls side-by-side I need to stick with the clojure's canonized version of slime?

0:46 s/the clojure/clojure

0:46 technomancy: felideon: or you could run an older version of CL's swank server if you like

0:46 I mean, yeah

0:46 felideon: right

0:47 technomancy: http://p.hagelb.org/slime-cvs-rant.txt

0:47 felideon: "but in practice most Clojure users lose interest in CL and

0:47 don't mind"

0:47 that is yet to be seen!

0:48 technomancy: I didn't say everyone. =)

0:48 felideon: technomancy: i dont think slime is meant for production anyway

0:48 technomancy: slime isn't, but swank-clojure is

0:48 which is more or less the root of the problem

0:48 felideon: why is that?

0:49 to connect to the remote image?

0:49 technomancy: right, because sometimes you don't have the luxury of figuring out how to reproduce a problem locally; you just need to figure out what's going on and fix it, possibly on the fly

0:51 felideon: my compliance department would have an issue with that

0:51 i kid. i hate corporate america :(

0:52 technomancy: well, ideally it would never be necessary

0:52 felideon: indeed. unless the shuttle is in orbit.

0:55 kickstart nrepl.el or something

0:56 technomancy: believe me, I would be thrilled to be able to ditch swank-clojure for nrepl.el

0:56 just waiting for some enterprising hacker to finish the job: https://github.com/technomancy/nrepl.el

0:56 I can't do it myself because I hate writing functions that aren't referentially transparent

0:57 wkmanire: Are slime or swank abbreviations?

0:57 technomancy: (actually working on a blog post about that)

0:57 wkmanire: slime is the Superior Lisp Interaction Mode for Emacs

0:57 I'm not sure about swank

0:58 wkmanire: In my mind I keep thinking swanky slime.

0:58 felideon: technomancy: blog post would be nice since i'm not sure what you mean

0:58 wkmanire: I just don't get a very pretty mental image when I hear those words.

0:59 technomancy: felideon: http://p.hagelb.org/159.yml.html <- here's the draft

0:59 wkmanire: What is nrepl? Why is it better?

1:00 felideon: technomancy: hmm yaml? what do you use to convert this to an HTML page?

1:00 technomancy: felideon: it's just about why I'm disillusioned with elisp and why coding without immutability is such a mess

1:00 felideon: http://p.hagelb.org/Rakefile.html

1:00 my 92-line blog "engine"

1:00 felideon: technomancy: that's your ownt hing

1:00 ah nice

1:01 produces http://technomancy.us/ ?

1:01 technomancy: yeah

1:01 (happy to take feedback re: the draft)

1:02 felideon: what are the four runtimes? JVM, Javascript, Python, and... .NET ?

1:02 technomancy: yeah

1:03 I guess technically scheme too now? does that count?

1:03 felideon: how stable is the .NET thing? maybe i can go back to a .NET job and not go crazy :)

1:03 technomancy: no idea. I don't think anyone in here uses it.

1:03 wkmanire: nrepl is the "canonical" clojure repl tooling backend

1:04 it's better because it's actively maintained and designed with Clojure in mind

1:04 swank-clojure is some guy's first Clojure project; in most places a line-by-line port of the CL version, except it's so old that when it was written atoms weren't even implemented.

1:04 wkmanire: technomancy: yikes.

1:05 That's a hell of a first project.

1:05 Was he already a lisper?

1:05 technomancy: yeah, it was the same guy who wrote clojure-mode

1:05 wkmanire: it's amazing it still works. feels like a relic of Atlantis or something.

1:06 the original author disappeared a few months after I started Clojure; I don't think anyone actually understands its internals

1:06 wkmanire: But it is still the go to system for new developers I think right?

1:07 I guess it really should be replaced if there isn't anyone left who knows how to improve it.

1:07 technomancy: I don't recommend it to anyone who doesn't already know emacs

1:08 felideon: what do non-emacsen use?

1:08 wkmanire: Setting it up on linux was a piece of cake, but getting it working on windows proved to be too much trouble for my patience.

1:09 technomancy: felideon: vim has historically used nailgun, but they are switching over to nrepl

1:10 that's still in progress, but CCW is on nrepl and the lein2 CLI repl uses nrepl too

1:10 everything else is a rounding error

1:11 maybe intellij, but I don't think their stuff is actively maintained

1:11 wkmanire: Is there a whole lot of work left to finish nrepl.el?

1:16 felideon: \o/

1:17 ; SLIME 20100404

1:17 user>

1:18 wkmanire: felideon: Congrats. Now you can start!

1:18 * wkmanire fist pumps.

1:18 felideon: technomancy: please, for the sake of future Common Lispers, add bolding to "don't have any other versions of Slime installed;"

1:18 and maybe s/installed/loaded

1:19 intersting that clojure preserves read-case. I guess that makes it easy for java interop.

1:20 wkmanire: :P

1:30 wkmanire: devn: You're the author of this article on namespaces?

1:45 muhoo: omg, this whole nosql thing is hilarious. i just saw someone coming up with a great new idea-- normalizing data!

1:45 * muhoo watches wheels get reinvented

1:48 wkmanire: muhoo: nosql?

1:49 Just read the wiki.

1:53 muhoo: i think if all i wanted to do was keep my data in nice clean clojure maps and just dump them to disk in a way slightly more organized and atomic than pr-str and serializing to a flat file, i could get excited about these nosql things.

1:54 kind of treating it like a version-controlled (in the case of couchdb), replicated file system. maybe i could get behind that.

1:54 kovasb: muhoo: i could definitely get behind that

1:57 muhoo: it's the querying that then becomes the stickler for me

1:57 o'

1:57 wkmanire: muhoo: I haven't used this type of database yet, but personally I like the idea of a database that can't do much more than store and retrieve records.

1:57 amalloy: muhoo: that's a lot like how jiraph works. it was originally built as a graph database, but it has so many pluggable extension points that really it's just a generic clojure datastore now

1:58 eggsby: how might I copy all the keys and vals from one map to another?

2:00 amalloy: &(doc merge)

2:00 lazybot: ⇒ "([& maps]); Returns a map that consists of the rest of the maps conj-ed onto the first. If a key occurs in more than one map, the mapping from the latter (left-to-right) will be the mapping in the result."

2:00 amalloy: &(doc into)

2:00 lazybot: ⇒ "([to from]); Returns a new coll consisting of to-coll with all of the items of from-coll conjoined."

2:00 LuminousMonkey: Isn't the GAE datastore a type of NoSQL? If I was to write a GAE app, I would have to use that sort of thing?

2:00 eggsby: ah thank you amalloy

2:01 muhoo: gae is a nosql thing yes

2:01 i don't know if you HAVE to use it, but it's there if you host on ae

2:01 and... i really don't grok it. it uses this weird GQL language which tries to make a nosql seem like it has sql capabilities

2:02 LuminousMonkey: I was thinking about playing with Compojure on GAE, but I haven't got around to it, not using SQL still seems weird to me.

2:03 muhoo: i'm kind of obsessed with trying to figure out what the fuss is about.

2:03 simply because i get so frustrated with ORMs and ActiveRecord, maybe there's a better way

2:04 wkmanire: muhoo: I get frustrated when portions of the core behaviors of applications I am working on get implemented in T-SQL.

2:04 muhoo: ouch

2:04 MSFT shop eh

2:05 LuminousMonkey: Before Clojure, I was playing around with RoR, outside of the typical stuff, I found ActiveRecord a pain.

2:05 wkmanire: UDFs galore, it's never been easier now that you can write UDFs in your CLR targeting language of choice and attach them to the db server to directly be called from your queries.

2:05 LuminousMonkey: Plus, I was trying to move everything into triggers, etc, on the database, which is not the way RoR tends to do things.

2:06 muhoo: hehe, see, i remember that when sql came out, it was supposed to be a programming language really

2:06 you'd write your application in sql, all the business rules, etc., or at least that's how it was sold

2:07 wkmanire: muhoo: Write a unit test for Function ProcessFeeds(), when all ProcessFeeds does is establish a connection to a database and call a stored procedure, dbo.ProceeFeeds.

2:07 :D

2:07 LuminousMonkey: That's what I thought was the best thing to do, that way use whatever frontend you like, just have all validation, etc in the database, that's what they're for.

2:08 wkmanire: Process* bleh

2:08 LuminousMonkey: ActiveRecord wants to have all that stuff on the app end.

2:08 muhoo: wkmanire: eek

2:09 and now with things like views in couchdb, it's going back to stored procedures

2:09 wkmanire: I think we're just having a hard time, as always, drawing the line in between different bits of functionality.

2:10 madsy: Hm, the documentation on the -> macro is pretty vague, but I finally understand it. Is there an approach to suggest additions to the clojure documentation?

2:10 muhoo: except, if saas companies like cloudant add clojure support, then those procedures could be in clojure, which'd be fun.

2:10 wkmanire: Theres always that blurry part where if you do some of your logic here, or some of your data persistence there then it is "easier".

2:10 muhoo: yeah, it's a balancing act really

2:11 wkmanire: To be or not to be, chewbranca or russel. That is the question.

2:12 muhoo: madsy: it may depend on which documentation you mean

2:12 chewbranca: wkmanire: oh I've decided, my damn irc client on the other hand has not

2:12 LuminousMonkey: Well, it's DRY stuff isn't it? Mix of business logic in app and DB code?

2:13 wkmanire: LuminousMonkey: And testability.

2:13 LuminousMonkey: there really isn't a good reason to hard code your application's data model to a particular persistence method.

2:13 madsy: muhoo: The general documentation on clojure.org/ and the API documentaton on clojure.github.com/

2:13 muhoo: i'd try out datomic but it requires a back-end service i don't have and don't want to sign up for. it supposedly works on postgres too, which'd be great, but it says "not for production use", which makes me wonder why.

2:14 madsy: well the stuff on github can be forked, and you can do a pull request

2:14 LuminousMonkey: Well, the problem is data integrity, databases are more than just a persistent datastore.

2:14 madsy: muhoo: Ah, thanks.

2:14 muhoo: madsy: some of the stuff on clojure.org is a wiki

2:14 but you'd need to fill out an agreement to get permissions to edit it

2:16 LuminousMonkey: which, if i'm just storing clojure maps encoded as json in couchdb, i get no referential integrity

2:16 ben_m: Is there a reason why ring.middlewar.params returns a function that returns a response, instead of just returning a response?

2:16 madsy: muhoo: Yeah, I just figured that some of the more fundamental reader macros and special forms could need more examples.

2:16 So people like me with no Lisp background could learn it faster

2:16 wkmanire: LuminousMonkey: I guess from my point of view, I should be able to replace my database with a bunch of text files and my app will still run as designed.

2:17 Slower perhaps.

2:17 But I don't lose application functionality because I changed the way I store my data.

2:17 muhoo: madsy: that'd be cool. also, there are some books designed for non-lispers to pick up clojure, i like clojurebook.com myself

2:17 amalloy: muhoo: waaaaat. does clojure accept pull requests to clojure.github.com? i really doubt it

2:17 derrida: madsy: check out clojuredocs.org

2:17 LuminousMonkey: wkmanire: Yeah, if that's a concern, then I think that's fair enough. But I don't know how often people change databases for that to be a big priority?

2:17 muhoo: amalloy: i doubt it too, but would it hurt to make one?

2:17 amalloy: https://github.com/clojure/clojure.github.com indicates that it would be impossible anyway

2:18 muhoo: amalloy: what then, file an issue in JIRA?

2:18 LuminousMonkey: wkmanire: I loath MySQL, so I'm always targetting Postgres I guess, I have the luxury of being able to know what the database will be.

2:18 amalloy: muhoo: no, but i think it hurts to tell someone who's interested "hey, direct your efforts here" and point at a brick wall

2:18 wkmanire: LuminousMonkey: The longer a software package lives (is actively being developed and used) the more likely something like that may happen becomes.

2:18 muhoo: amalloy: oh, sorry

2:18 amalloy: yes, i imagine jira is the only attempt

2:18 er

2:18 muhoo: madsy: what amalloy said

2:18 amalloy: avenue

2:19 LuminousMonkey: muhoo: That's another thing I wonder about these NoSQL databases too, how can you do anything with integrity? Must be ways around it.

2:19 wkmanire: LuminousMonkey: Here's an example. I worked on an application in windows land where somebody convinced the management to make the switch from SQL 2000 to SQL 2008. :D

2:20 LuminousMonkey: Guess how different and incompatible those two database systems are? Guess how many application behaviors relied on the way SQL 2000 works? :D :D

2:20 muhoo: LuminousMonkey: if i were doing a financial or business app, there's NFW i'd do that in anything other than postgres or equivalent

2:20 * wkmanire hated that project.

2:21 muhoo: i want transactions, and foreign key integrity, and all that, for that kind of stuff

2:22 wkmanire: muhoo: I completely agree with you, If you can use a system that can give you those comforts then definitely use them/it. I'm just illustrating my distaste for getting "fancy" in your database.

2:23 LuminousMonkey: muhoo: I guess that's my point of view, internal sales app, so very important. Plus I'll never write an app that will be popular enough to need something like a NoSQL DB I would imagine.

2:23 muhoo: wkmanire: agreed. it can get very ugly

2:25 wkmanire: LuminousMonkey: Out of curiosity, why don't you like MySQL? Why do you prefer postgres?

2:25 muhoo: madsy: sorry, i was wrong about github. clojuredocs.org seems to have a lot more action.

2:26 madsy: muhoo: Yeah, derida mentioned clojuredocs too. Thanks to you both.

2:27 LuminousMonkey: wkmanire: You know, I can't think of specifics right now, but generally Postgres is written more compliant. Triggers, and the PL/SQL stuff, etc works in Postgres.

2:28 wkmanire: I've read as much. MySQL used to be faster too I think, but they're basically identical on performance now right?

2:28 LuminousMonkey: wkmanire: MySQL seems to be more of a dumb datastore.

2:29 I think MySQL is still faster, because it sacrifices features for raw speed? Where Postgres seems to be more focused on integrity.

2:29 Plus MySQL is everywhere, harder to get hosting plans with Postgres.

2:29 wkmanire: That's definitely true.

2:29 muhoo: postgres is ingres, isn't it?

2:30 LuminousMonkey: Looks like it, evolved from Ingres

2:30 muhoo: open sourced ingres, which means it dates back to the mid 1970s or something

2:30 wkmanire: I thought Postgres was a university project.

2:31 By berkley or some similar school.

2:31 LuminousMonkey: Consulting the mighty oracle wikipedia....

2:31 http://en.wikipedia.org/wiki/PostgreSQL

2:31 Berkeley

2:32 muhoo: heh "oracle wikipedia"

2:33 only if it runs on mysql

2:33 amalloy: support for the oracle wikipedia runs about $40,000/mo

2:33 LuminousMonkey: Heh

2:34 wkmanire: Man, I'm hankerin' for a chilli dog.

2:35 LuminousMonkey: I really did want to play with some NoSQL stuff, but unless you're going to deal with massive data, or have to use it, I don't think you need to?

2:35 muhoo: something tells me that couchdb came out of the 1990s: http://guide.couchdb.org/draft/recipes.html#pagination

2:35 LuminousMonkey: Even for a pretty large application, SQL seems to be just fine?

2:36 muhoo: i'm coming at it from a different angle

2:36 wkmanire: LuminousMonkey: With good indexes you can quickly query millions and millions of rows of data.

2:36 muhoo: i think there may be projects where sql is TOO much, and i could use something simpler

2:36 wkmanire: At least I've done that first hand in T-SQL.

2:37 On relatively low-end servers.

2:38 muhoo: the schema-less bit intrigues me more than the supposed scalability

2:38 wkmanire: But on the other hand, I've also had such indexes get "eated".

2:38 then it takes several days to query the data, or several days to rebuild the index.

2:39 felideon: I feel getting the clojure repl up on emacs should show the 'your kitten of death' awaits message instead.

2:39 LuminousMonkey: muhoo: So it's just like playing with maps?

2:39 wkmanire: Ouch.

2:39 muhoo: that's what it appears to be, but i'm still feeling my way through it

2:39 there's a catch somewhere, i know it.

2:39 and i think it has to do with querying.

2:40 LuminousMonkey: I've wanted to play with it, but I don't think I would use it.

2:40 wkmanire: muhoo: Your data for a particular "type" can be irregular right?

2:41 muhoo: querying seems really verbose in these things

2:41 wkmanire: As in, some "Customers" can have extra key/value pairs that others don't have?

2:41 muhoo: wkmanire: they seem like just k-v stores

2:42 amalloy: wkmanire: you sound like some customers are more equal than others

2:42 algernon: fwiw, nosql is great for structured logging: both the schema-lessness and scalability comes in handy there.

2:42 wkmanire: amalloy: :D

2:43 muhoo: they're all different though. couch is the one i've decided to dive into more deeply

2:43 wkmanire: amalloy: I'm bad at asking questions.

2:43 LuminousMonkey: muhoo: Any particular reason why?

2:45 muhoo: nice clojure bindings (clutch), easy to install and set up, cloudy provider (cloudant), and immutable data with versioning, +/- coin toss

2:46 oh, also, on local instance, you can write views in clojure :-)

2:46 sadly, cloudant doesn't support that though.

2:47 LuminousMonkey: Clojure does end up spoiling you...

2:48 Though, I really should play with OCaml, sticking with one language all the time isn't good practice.

2:57 wkmanire: Hooray! I've succesfully CRUD'd to a CSV with clojure ... AND unit tested that it works ... AND tested it from my REPL.

2:57 I can finally get to using seesaw to build my GUI.

2:57 :D

2:58 muhoo: wkmanire: congrats!

2:58 wkmanire: I'm blown away by how little code there is.

2:58 muhoo: hehe

2:58 still amazes me too :-)

2:59 tomoj: CRUD to CSV?

2:59 wkmanire: tomoj: It's not as dirty as it sounds.

2:59 tomoj: that's like, a restful service in clojure that exports to csv files ?

2:59 or what

2:59 wkmanire: No, nothing even half that complex.

3:00 Literally just creating, updating and deleting addresses from a list of addresses that I'm persisting in a text file.

3:00 tomoj: oh, of course

3:00 neat

3:00 wkmanire: I'm still learning Clojure.

3:00 More importantly, I'm learning functional programming for the first time.

3:02 I'm gonna have me one more beer and then hit the sack.

3:02 back in a flash.

3:02 rodnaph: one more b

3:02 *r i've just started work!

3:03 wkmanire: 5 minutes to 03:00 here.

3:05 LuminousMonkey: Exactly 12 hours from me.

3:05 tomoj: hmm

3:06 I wonder if seesaw's protocols and multimethods would extend nicely to android

3:06 wkmanire: tomoj: That'd be neat. I like the idea of doing some mobile dev in clojure.

3:06 Although I suppose that is already being made possible by Clojure JS.

3:06 tomoj: right, I was also thinking of JS...

3:06 but that's nuts

3:07 wkmanire: nuts?

3:08 tomoj: not clojurescript. trying to write a UI library that encompasses swing, android, and web seems nuts

3:08 LuminousMonkey: Too much of a leaky abstraction?

3:09 tomoj: that is my totally uninformed suspicion

3:10 LuminousMonkey: I would agree, feels like it wouldn't work.

3:11 wkmanire: I was just talking strictly HTML5 app.

3:12 tomoj: yeah

3:13 wkmanire: I think there are already externs for jQuery for Clojure JS.

3:13 I bet somebody is working on externs for jQuery mobile.

3:16 Wow, seesaw looks awesome so far.

3:20 tomoj: (boolean (and x (or y z)))

3:20 is that a long way to write something short?

3:25 LuminousMonkey: Not sure if you could have it shorter?

3:32 wkmanire: Whew, just made it through the seesaw tutorial.

3:32 I think finishing the UI for this little app will only require one more work session.

3:32 :) Time for sleep.

3:32 goodnight folks.

3:34 LuminousMonkey: wkelly: Night

3:42 wmealing: does clojure.java.shell able to handle interactive processes with multiple interactions ?

3:44 alexyakushev: Greetings! Have anyone tried to develop a plugin for lein 2.0.0?

3:45 emezeske: alexyakushev: I have

3:48 alexyakushev: I stuck at one point... When I try to compile/run/whatever my plugin the compiler says that there is no leiningen/core.clj on the classpath

3:49 wmealing: essentially i wanted 'expect' for clojure.

3:49 alexyakushev: Documentation says that one should not require depending on leiningen in project.clj, but I tried it anyway still without luck

3:49 emezeske: alexyakushev: Do you have :eval-in-leiningen true in your project.clj?

3:49 alexyakushev: Yes

3:50 emezeske: What does your (:require ...) look like for leiningen.core?

3:50 alexyakushev: (:use [leiningen [javac :only (javac)] [core :only (read-project)] [compile :only (compile)] [help :only (help-for)]])

3:51 The old lein (1.7.0) works fine on this plugin project

3:52 emezeske: alexyakushev: I don't think leiningen 2 has a leiningen.core namespace

3:52 alexyakushev: *Though I can't make it use clojure 1.3.0 (it always loads 1.2.1) and I'm feeling very stupid about it

3:52 emezeske: alexyakushev: There are leiningen.core.xyz, but no leiningen.core

3:53 lein 1 uses clojure 1.2 end of story

3:53 alexyakushev: Oh, I see now

3:54 Thank you for help! And sorry for not looking that up by myself

3:54 emezeske: No problem, when I first converted my plugin to lein 2 I needed more help than that :)

3:54 Good luck! I'm outta here.

4:26 Raynes: muhoo: Your indent-buffer would be gg=G if you used evil-mode.

4:26 :D

4:33 muhoo: i used evil-mode for about a week on my transition from vim to emacs

4:33 Raynes: muhoo: Any particular reason you stopped?

4:38 wmealing: he's not evil ?

4:39 clgv: superman showed up ;)

4:41 alexyakushev: Gosh I'm feeling like a complete idiot.

4:41 Why the function is overloaded for one and two arguments, but when I use/require the namespace with it I get only version for two arguments?

4:42 And I don't see any metadata or anything that could cause it, function is defined by mere defn

4:45 clgv: alexyakushev: give a paste showing the source (minimal if possible) and stating the exact problem

4:45 ~paste

4:45 clojurebot: paste is https://refheap.com/

4:48 alexyakushev: https://refheap.com/paste/2372

4:48 This is a function from leiningen

4:49 When I require it it comes to me with only one overloaded version for two arguments

4:49 clgv: the definition looks fine. how do you call it?

4:50 alexyakushev: Simply (help-for #'foo) for example. But it doesn't matter, (doc help-for) yields help for only one overloaded version.

4:51 But I guess the problem is that the Leiningen version that is running differs from the one I look the source code of. But I don't know how to check that.

4:51 clgv: alexyakushev: I guessed that as well right now ;)

4:52 alexyakushev: I explicitly stated a dependency for leiningen 2.0.0 in the project.clj but who knows...

4:53 clgv: you wanto use leiningen as dependency in a project? or do you want to write a plugin?

4:53 alexyakushev: The latter, exactly

4:54 clgv: afaik, in that case you would not add it as dependency but install the leiningen version you need

4:54 there is a guide on their github page

4:55 alexyakushev: Yes, I tried without the dependency too.

4:55 I've read the guide, but maybe I've missed something

4:56 clgv: I dont use lein2, yet. so I cannot test that setup

4:57 alexyakushev: Thanks for help anyway!

4:59 muhoo: hmm, fp is kind of nice for this kind of nested insert: https://refheap.com/paste/2373

5:02 Raynes: i'm pretty bilingual. when i use vi, i use vim. when i use emacs, i use emacs, not vi-in-emacs.

5:03 i switch back and forth between them often (emacs for development, vi for sysadmin work), so it helps to keep them straight from each other.

5:16 Raynes: muhoo: Not sure that actually makes sense.

5:16 muhoo: Wouldn't it be easier to be able to use common functionality in familiar ways?

5:16 Making them completely different seems counterintuitive to making it easy to switch between the two.

5:18 progo: well, there are many ways to learn. Contrasting might be an effective one

5:20 Raynes: I'm not arguing learning.

5:22 progo: after you've learned both ways, it should be easy to hop editors

5:34 clange: Hello Clojureists! I'm a (just now) desperate newbie. I have a function to cut lines at '=' characters: (defn cut [l] (split l #"=\s*")) that works well. But how do I apply this function to a vector of strings??

5:34 lazybot: clange: What are you, crazy? Of course not!

5:35 Raynes: clange: Can you show an example of this vector of strings?

5:35 clange: (def test ["one= eins" "two= zwei"])

5:36 Raynes: What is the output you're looking for?

5:36 [["one" "eins"] ..]?

5:37 clange: Either, or as one-dimensional vector w/ alternating single string.

5:37 Raynes: (map cut test) should result in what I just said.

5:37 (mapcat cut test) will result in what you just described.

5:37 Pick your poison.

5:37 clange: THX! I struggled w/ apply ...

5:38 Raynes: apply would apply your function to all of the strings at once which is definitely not what you want.

5:38 map applies the function to each element of the vector in turn and accumulates the results.

5:39 alexyakushev: Could please someone answer the following question: if I have two namespaces with the same names on the classpath, how do I specify which one I would like to require?

5:45 tomoj: you mean you have two clj files on the classpath which have the same path (relative to the classpath) and define the same namespace? is there a reason you can't avoid this?

5:45 muhoo: how limited is noir's defpage compared to ring's defroutes?

5:45 tomoj: defroutes is compojure, isn't it?

5:45 muhoo: compojure, yes, sorry

5:47 i can't tell if there are any limits placed on routing or if it passes through all of compojure's capabilities

5:49 tomoj: one strange thing to me is that defpage sets up the routes inside a global

5:49 muhoo: that appears to be so that you can define routes all over the place instead of having to have them in a centralized place

5:50 i.e. to group the functions in files a little more flexibly, afaict

5:53 tomoj: it seems like it is more flexible to not use a global, although not usually more convenient maybe

5:53 muhoo: it does look from the docs like he's just passing it through to compojure, which is great, but from the source i'm not sure if that's what's happening.

6:16 ody1231: are there any utils for navigating clojure files with emacs?

6:44 madsy: ody1231: Could you be a bit more specific?

6:46 ody1231: You have paredit for better control over nested parantheses. You have swank-clojure + slime + emacs for enhanced REPL navigation, but it's not trivial to set up

7:42 tomoj: has anyone seen weirdness with loaded-libs?

7:42 weirdness being missing libs

7:47 clgv: tomoj: erm what? guess you have to be more specific

7:47 tomoj: I C-c C-k a file in emacs, then switch into that namespace in the repl

7:47 ((loaded-libs) (.name *ns*)) is nil

7:48 just running (require 'my.namespace) fixes this

7:48 so I guess it's something to do with the way C-c C-k causes code to be loaded..

7:48 but.. hmm

7:49 loaded-libs also doesn't include an AOT compiled namespace

7:49 an entry point

7:50 clgv: I just did call (loaded-libs) in lein repl which returns all the namespaces. but in Counterclowise's REPL (loaded-libs) returns nil as well

7:50 +ck

7:53 laurus: I have a data structure like this: [[1] [2] [3]]. How do I turn it into [1 2 3] ?

7:54 Fossi: flatten

7:54 or depends

7:54 if you want it really flat or just the first level

7:54 then apply concat i think

7:54 laurus: flatten worked, thanks! :)

7:55 Fossi: laurus: flatten will work on all levels

7:55 tomoj: how'd you get [[1] [2] [3]]?

7:55 Fossi: good point also :)

7:58 tomoj: https://gist.github.com/68f6dcf147783fee5856

7:58 bad.clj prints "Not loaded!"

7:58 good.clj prints "Loaded!"

7:58 clgv: haha.

7:59 tomoj: good.clj prints "Not loaded!" with `lein run` somehow...

7:59 clgv: hmm maybe the send-to-repl code replaces the ns macro and only executes the content and skips the creation of a new namespace

8:01 tomoj: wait, I'm seeing "Not loaded!" with java -cp now too

8:02 clgv: tomoj: maybe the whole loaded-libs is intended differently or just messed up

8:03 tomoj: the self-require workaround doesn't seem to work at all

8:04 though this thing definitely did print "Loaded" a few attempts ago.. no clue how

8:06 oh

8:06 (.name *ns*) is 'user

8:06 fliebel: Neo4j for Clojure is weird. Like, 5 different and now dead forks have existed over time.

8:07 tomoj: right so bad.clj doesn't work with java -cp `lein classpath`

8:07 clgv: tomoj: I did try without (.name *ns*)

8:07 tomoj: but does work with lein run

8:11 kij: fliebel: which one would you recommend ?

8:12 gfredericks: fliebel: my group is using one right now

8:12 fliebel: kij: I have no idea. I'd pikc the most recent Borneo fork if I had to, or directly use the Java bidnings

8:12 I wonder why one would use the Java binding, if it's just a REST API though.

8:12 gfredericks: What are you using?

8:12 gfredericks: there is an embedded option too

8:13 fliebel: gfredericks: Is it common to embed it?

8:13 * gfredericks digs through a pom.xml

8:13 gfredericks: fliebel: no clue

8:13 I think we switched to that for perf

8:13 looks like clojurewerkz/neocons

8:14 I assume that's a neo4j library, I guess I'm not 100% positive

8:14 not involved in that part of the project

8:15 _KY_: I want to use the "for" form, but I want to pass the first arg to it from a function, how can I do that?

8:15 gfredericks: as in (for [x (foo-bar)] ...)?

8:17 fliebel: gfredericks: That looks interesting. The website url is brokne though.

8:18 _KY_: gfredericks: (for [sth-returned-from-function] ...)

8:18 fliebel: I wonder if...? https://github.com/michaelklishin/neocons/blob/master/script/set_up_basic_http_auth_env_variables.sh#L4

8:19 gfredericks: _KY_: you need a pair inside the binding form...I don't quite understand what you're trying to do.

8:19 _KY_: Let's say the function returns the pair

8:20 Suppose the function returns [x listx]

8:20 And I want to do (for [x listx] stuff....)

8:21 gfredericks: but you don't know what x is until runtime?

8:21 _KY_: Yes

8:21 Seems to require a macro...?

8:21 gfredericks: then how do you know what symbol to use in the body to refer to it?

8:21 fliebel: _KY_: So what is in the loop?

8:22 _KY_: I will pass something containing "x" in the loop as well

8:22 Basically, I want to find the permutations of lists of elements, and the "for" form can do it

8:23 gfredericks: for can do permutations?

8:23 _KY_: Yeah... for example:

8:23 clgv: _KY_: you should specify what shall be done and how the macro call should look like

8:23 _KY_: ,(for [a [1 2 3] but [7 8]] (println a "." but))

8:24 clojurebot: (1 . 7

8:24 1 . 8

8:24 _KY_: ,(for [a [1 2 3] but [7 8]] (println a "." b))

8:24 clojurebot: nil 2 . 7

8:24 2 . 8

8:24 nil nil 3 . 7

8:24 3 . 8

8:24 nil nil ...)

8:24 #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: b in this context, compiling:(NO_SOURCE_PATH:0)>

8:24 gfredericks: _KY_: I think that's a cartesian product, not permutations

8:24 mmarczyk: CLJS transient vector and transient hash set ready @ CLJS-170 & CLJS-207 respectively :-)

8:24 _KY_: It's just the same name

8:25 gfredericks: _KY_: I'm just making sure that you do want cartesian product, because if you actually want permutations you'd be disappointed

8:25 _KY_: How is permutation different?

8:25 gfredericks: permutations are, given a single list, all the different ways of ordering its elements

8:26 _KY_: I'm picking one element out of each list with replacement

8:26 Yes, and I have a list of lists

8:26 gfredericks: okay since you don't know the number of lists at compile time you'll either want to write a custom recursive function, or use the one in the combinatorics library

8:27 https://github.com/clojure/math.combinatorics/blob/master/src/main/clojure/clojure/math/combinatorics.clj#L87

8:27 _KY_: I see...

8:28 Are you sure that's not permutations?

8:28 gfredericks: yes, permutations only applies to a single collection

8:28 _KY_: It's the cartesian product

8:28 gfredericks: whereas cart-prod only makes sense for more than one collection

8:28 _KY_: Do you know the notation nPr in combinatorics?

8:29 gfredericks: it looks familiar but I can't remember what it means

8:30 Frozenlock: ---> Cannot cast clojure.lang.LazySeq to com.serotonin.bacnet4j.service.confirmed.ConfirmedRequestService

8:30 How can I make sure to have an evaluated seq?

8:30 gfredericks: _KY_: if you ask for (permutations [1 2 3]) you'll get [[1 2 3] [1 3 2] [2 1 3] [2 3 1] [3 1 2] [3 2 1]])

8:31 tomoj: iirc nPr counts the r-permutations of n?

8:31 permutations here is the case where r = n

8:31 _KY_: You're right... it's the cart-prod I want...

8:31 gfredericks: whereas (cartesian-product [1 2 3]) is just [[1] [2] [3]]

8:31 _KY_: So, "for" can do cart-prods

8:31 Frozenlock: (def foo (doall foo)) Is still lazy :(

8:32 gfredericks: _KY_: yes but only if you know the number of collections at compile-time

8:32 _KY_: But maybe I should call the combinatorics library

8:32 Right...

8:33 gfredericks: Frozenlock: (doall) forces a lazy seq, but doesn't change its type

8:33 Frozenlock: your error message looks like a type issue

8:37 _KY_: What should I declare to use clojure.math.combinatorics?

8:46 gfredericks: in your ns you can (:use [clojure.math.combinatorics :only [cartesian-product]])

8:47 _KY_: Do I need to download it?

8:47 I included that already

8:48 gfredericks: are you using leiningen?

8:48 _KY_: No... just REPL

8:49 gfredericks: ah; I dunno then. I guess you want to download the jar but not sure where from

8:49 _KY_: I have install leiningen somewhere... not sure

8:49 gfredericks: lein is much easier for this sort of thing

8:49 you just add the declaration to your project.clj

8:49 _KY_: Let me see...

8:52 madsy: Ah, finally swank/slime works

9:03 wmealing: is there a way to work interactively with a sub process in clojure ? ie, multiple stdin/stdout ?

9:09 tomoj: multiple? you mean one per subprocess?

9:09 wmealing: yes, i'd like to do multiple interactions to stdin/stdout though

9:10 tomoj: you mean, like, print more than one line or something?

9:10 https://github.com/Raynes/conch

9:10 mknoszlig: wmealing: you mean something like this: http://richhickey.github.com/clojure-contrib/shell-out-api.html ?

9:10 lazybot: Nooooo, that's so out of date! Please see instead http://clojure.github.com/clojure-contrib/shell-out-api.html and try to stop linking to rich's repo.

9:10 * wmealing looks at both

9:11 wmealing: i think the clojure contrib shell is a "once off"

9:11 mknoszlig: wmealing: i'm not sure if there's still a version in post 1.2-contrib...

9:11 * wmealing nods

9:11 clgv: clojure-contrib is deprecated as well. see clojure.java.shell in clojure 1.3

9:11 wmealing: tomoj, that conch might be what i need

9:11 tomoj: never used conch, but at the very least the source should be helpful

9:11 _KY_: Can I use lein to test-run a single file?

9:12 wmealing: yes.

9:12 thanks tomoj, i did google.. but apparently not well enough

9:12 how did you find it ?

9:12 mknoszlig: wmealing: oh sorry, it's been a while since i used it...

9:12 _KY_: Which command should I use? or start a repl?

9:12 bhenry: in korma is there something like a (with-db db (do …)) or do i have to put the db i want in each sql function?

9:12 wmealing: mknoszlig, no problem man. It is _almost_ what i needed.

9:14 mknoszlig: wmealing: internally it uses streams, i think that's what i grabbed and adapted to my needs - but i forgot about me changing it ;)

9:15 wmealing: ah ok

9:29 _KY_: I just set up lein, but "lein run" cannot run an empty project...

9:29 Says "cannot find core.clj on classpath"

9:29 What should I do?

9:30 tmciver: _KY_: you can create an empty project with 'lein new <project-name>'

9:30 _KY_: I created that

9:30 And I'm trying to "lein run" within it

9:31 tmciver: _KY_: you also need ':main <some-ns>' in your project.clj

9:32 _KY_: and a -main defn in that ns (I believe)

9:32 mmarczyk: dnolen: hi, thanks for the merge

9:33 _KY_: -main or just main?

9:33 mmarczyk: dnolen: with the transient stuff all in place, I've wired into to use transients -- CLJS-208

9:33 tmciver: _KY_: -main

9:34 _KY_: Thanks=)

9:34 Ok it runs now...

9:34 tmciver: np, cool

9:34 _KY_: But I want to load a specific file to debug it...

9:34 tmciver: _KY_: are you using emacs?

9:34 _KY_: No, an external editor

9:35 tmciver: _KY_: you can always just 'use' it from a repl and then call your functions.

9:36 _KY_: So I start "lein repl"?

9:36 tmciver: _KY_: yes

9:37 _KY_: Ok.. I'm trying to "load-file" but it can't find my file

9:37 tmciver: _KY_: how about just (use 'your.ns)?

9:38 _KY_: I see...

9:38 So I have to include the file somewhere in project.clj?

9:38 clgv: _KY_: I recommend reading an introductory book on clojure or at least a tutorial article

9:38 tmciver: _KY_: it should be on the classpath already.

9:39 _KY_: clgv: which book? or article?

9:39 tmciver: how do I include it in the classpath?

9:40 clgv: _KY_: there are several books: Programming Clojure, Practical Clojure, Clojure in Action, Clojure Programming, The Joy of Clojure.

9:40 _KY_: The file is already in the same directory as core.clj

9:41 tmciver: _KY_: is the ns in that file consistent with the file name and path?

9:42 _KY_: the ns in that new file should be 'projectname.filename (assuming no hyphens).

9:44 _KY_: Can I have hyphens in the filename?

9:45 Oh it seems to force me to use _

9:46 dnolen: _KY_: not in the actual name, no. replace hyphens w/ underscores.

9:46 tmciver: _KY_: yes

9:47 _KY_: clgv: the books don't talk about lein, do they?

9:48 clgv: _KY_: not all, I guess. "Clojure Programming" talks about it

9:49 _KY_: That's the new other'reilly book?

9:49 That's the new o'reilly book?

9:49 clgv: yep. more practical oriented they say

9:50 cemerick: _KY_: Yes, we talk about Leiningen and Maven in the book, along with project organization, other tools, etc. http://clojurebook.com if you'd like more info, see a sample chapter, etc.

9:51 fdaoud: I'm sure there are leiningen tutorials on the web.. I mean, if I learned how to use it.. :)

9:52 cemerick: Yup, there are few things that beat reading the documentation in full.

9:52 clgv: cemerick: where is my commission for naming your book? ;) :P

9:52 fdaoud: cemerick: been reading your book here and there, it's been excellent so far. great work!

9:52 clgv: *listing

9:52 :D

9:52 cemerick: clgv: Hah. Need to get your own amazon affiliate link poppin. ;-)

9:53 fdaoud: Thanks :-) It seems to be measuring up so far.

9:53 fdaoud: clgv: I think there is such a thing, where you set up a reading list on amazon and if people by books from your list, you get something

9:54 ody123: anyone know how to navigate clojure source files in emacs?

9:54 clgv: fdaoud: didnt know that.

9:55 mefesto: ody123: C-x d

9:55 cemerick: clgv, fdaoud: don't need to set up a reading list; just sign up as an affiliate.

9:55 https://affiliate-program.amazon.com/ FWIW

10:00 fdaoud: cemerick: as an unexpected bonus, from your book I discovered the ubuntu monospace font, very nice!

10:01 cemerick: fdaoud: what, from picking apart the PDF?

10:02 ody123: mefesto: thx

10:02 fdaoud: cemerick: no, the epub is just a zip file and the .ttf files are in there.

10:02 cemerick: ah

10:03 fdaoud: but really I could have just gone to http://font.ubuntu.com :)

10:10 _KY_: So what should I include in project.clj if I want to use combinatorics?

10:13 It still throws an exception saying cannot locate combinatorics.clj

10:15 clgv: _KY_: a dependency declaration to the library that contains the combinatorics namespace. for leiningen start with https://github.com/technomancy/leiningen/blob/master/README.md

10:19 _KY_: Is it like: [org.clojure/math.combinatorics]?

10:20 And I can't find the version number... on the combinatorics page

10:21 gfredericks: `lein search combinatorics` might give you that

10:21 after a half-hour of pondering

10:22 _KY_: I see... that took too long so I broke out from it...

10:22 But I'll try again... =)

10:22 gfredericks: normally you can search clojars for these things, but I think the core libs are deployed elsewhere and I don't know where that is

10:23 you can also check the pom.xml in the combinatorics project

10:23 doesn't guarantee that version is deployed somewhere but it's a good bet

10:29 clgv: Is there a Clojure function that returns the fullqualified symbol of a given variable?

10:30 gfredericks: &(resolve '+)

10:30 lazybot: java.lang.SecurityException: You tripped the alarm! resolve is bad!

10:30 gfredericks: wait no

10:30 &`+

10:30 lazybot: ⇒ clojure.core/+

10:30 gfredericks: I guess that's not a function though

10:31 clgv: resolve returns the variable. now I want the symbol of the variable ;)

10:31 gfredericks: by "variable" you mean var?

10:31 noidi: maybe you're looking for #' ?

10:31 gfredericks: no

10:32 clgv: #' is a shortcut for 'var - my problem is that I get a symbol and need to find its namespace

10:32 gfredericks: &(meta #'+)

10:32 lazybot: ⇒ {:ns #<Namespace clojure.core>, :name +, :file "clojure/core.clj", :line 919, :arglists ([] [x] [x y] [x y & more]), :added "1.2", :inline-arities #<core$_GT_1_QMARK_ clojure.core$_GT_1_QMARK_@139955c>, :inline #<core$nary_inline$fn__3566 clojure.core$nary_inline$fn... https://refheap.com/paste/2379

10:32 clgv: so using resolve returns the var and I could access the ns property via interop

10:33 sattvik: ,(map namespace ['foo 'foo/bar])

10:33 clojurebot: (nil "foo")

10:33 sattvik: clgv: Does namepsace do the trick?

10:34 gfredericks: ,(let [{ns :ns n :name} (meta #'+)] (symbol (str ns) (name n)))

10:34 clojurebot: clojure.core/+

10:35 clgv: sattvik: I have 'bar and want to get 'foo/bar

10:35 where 'foo is the namespace in which 'bar is defined

10:35 gfredericks: ,(->> '+ resolve meta ((juxt :ns :name)) (map str) (apply symbol))

10:35 clojurebot: clojure.core/+

10:35 sattvik: I see.

10:36 gfredericks: clgv: ^ that oughta work eh?

10:36 clgv: gfredericks: better without meta since meta is additional information.

10:37 gfredericks: meta is additional information?

10:38 clgv: gfredericks: if you have a look at defn you'll see that the meta information is added to the variable after it was created.

10:38 that was what I meant with "additional"

10:38 gfredericks: so it doesn't work with def I suppose?

10:39 looks like it does

10:39 so I don't think it is specific to defn

10:39 with def I get :ns, :name, :file, and :line

10:39 clgv: hmm.

10:40 kephale: ,((symbol (apply str (rest (rest (str (var +)))))) 2 2)

10:40 clojurebot: 2

10:41 neotyk: dnolen: regarding CLJS-{35,161}: I'm afraid repl fix will be tough, using file protocol, all tests in crosspagechannel_test from GClosure fail :/

10:43 jsabeaudry: Is (js/FormData. ($ "form.myform")) the correct translation of "new FormData($('form.myform'))" ?

10:44 xumingmingv: i have reader something about clojure 1.4's data readers, i know what it is

10:44 but dont know why it is important

10:45 can anyone explain it a bit, what beauty can it bring?

10:46 gfredericks: you can watch rich hickey talk about it on the video of his conj talk

10:49 rhc: gfredericks: conj talk?

10:49 dnolen: neotyk: is there a websockets channel? would that work?

10:50 gfredericks: rhc: xumingmingv: http://blip.tv/clojure/rich-hickey-keynote-5970064

10:50 clgv: defmulti is not redefined when I send the file to repl again? I changed the dispatch function and this change was not reflected before a repl restart

10:50 neotyk: dnolen: looking how server backend for browser repl is done, I would not dare to move it to WS

10:50 rhc: gfredericks: ah thanks

10:51 neotyk: dnolen: also, it would only work in Chrome ;-)

10:51 timvisher: anyone know of a clojure test coverage tool?

10:52 _KY_: Can I still use clojure-contrib?

10:52 I'm trying to use this but failed:

10:52 dnolen: neotyk: I wonder if we could provide a minimal static file server in clojure and write a script to trigger it?

10:52 _KY_: http://richhickey.github.com/clojure-contrib/combinatorics-api.html

10:52 lazybot: Nooooo, that's so out of date! Please see instead http://clojure.github.com/clojure-contrib/combinatorics-api.html and try to stop linking to rich's repo.

10:52 gfredericks: _KY_: clojure.core.combinatorics is the new library

10:52 dnolen: neotyk: script/open index.html

10:52 gfredericks: ~contrib

10:52 clojurebot: Monolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

10:53 dnolen: neotyk: I'm not against moving to latest Closure but we should provide a simple solution for CLJS consumers.

10:54 xumingmingv: gfredericks thanks

10:54 neotyk: dnolen: I'm on same page

10:54 dnolen: we have web server already, browser repl backend is minimal http server

10:55 dnolen: neotyk: k, if you're will to adapt that for servering index.html to support browser REPL I'm ok w/ that.

10:55 neotyk: whatever we do it should be easy for tools like lein-cljsbuild to hook into.

10:55 gotta run.

10:59 _KY_: gfredericks: I'm looking at this and can't figure out what to say in project.clj

10:59 Mordus: What do people use in Clojure to write SOAP clients?

10:59 _KY_: https://github.com/clojure/math.combinatorics/blob/master/pom.xml

11:00 gfredericks: _KY_: it's line 4

11:01 _KY_: gfredericks: but what's the string that goes before the version number?

11:02 gfredericks: org.clojure/math.combinatorics

11:02 format is group-name/artifact-name

11:02 the group you have to get from line 8

11:02 the artifact is line 3

11:03 if 0.0.3-SNAPSHOT doesn't work, try 0.0.2, since there's a tag for that

11:04 Mordus: What do people use to write soap clients in clojure? I have a project that requires this and I'm having trouble doing it in Perl. Hoping that Clojure offers something better.

11:08 clgv: Mordus: I didn't read about any clojure lib for SOAP but there should be plenty for Java. So you can use one of these with Clojure's good Java interop capabilities

11:08 _KY_: gfredericks: thanks, that works now =)

11:08 gfredericks: _KY_: great

11:09 clgv: Mordus: do you need SOAP explicitely?

11:10 there is a remoting lib called slacker if you only need remote procedure calls in general

11:10 Mordus: Yeah, the libraries I'm accessing only work via SOAP with x.509 certificates. I'm trying to avoid the hell that is Java, with its layers of XML configuration files in arcane formats

11:11 madsy: When I open new files from different leiningen projects, I have to restart swank for the REPL to see the compiled file. Does this have something to do with slime's CWD and the classpath set by leiningen's project.clj?

11:12 clgv: Mordus: http://www.mail-archive.com/clojure@googlegroups.com/msg18312.html

11:12 madsy: Uh, I didn't just restart swank, but I terminated swank *and* the slime connection

11:13 Mordus: clgv: Thanks, I'll take a look.

11:18 TimMc: I'd like to see a persistent (both meanings!) DB that provides manipulation of multiple store types under the same transaction: Queues, relational stores, caches... I think the best approach would be a shared version ID between the individual stores.

11:18 raek: madsy: what do you mean by "the compiled file"?

11:20 madsy: raek: C-c C-k in emacs to compile and load via slime/swank

11:21 raek: As clojure always compiles, I guess you can omit "compile" there. It supposed to load the code via swank

11:23 raek: madsy: if C-c C-k succeeds, then the definitions in that file should usable immediately

11:23 madsy: CWD is not used in clojure-land

11:24 *is not widely used

11:24 since you can't change the CWD after the JVM has started

11:25 madsy: can you describe the step that does not work?

11:28 madsy: raek: Yeah, hold on. I'll reproduce the exact error.

11:29 nDuff: What's the idiomatic way to get from [1 2 3 4 5 6] to [[1 2] [3 4] [5 6]] (both input and output being seqable, not necessarily vectors)?

11:30 ahh, partition

11:31 gfredericks: nDuff: also look at partition-all in case you need that behavior

11:32 nDuff: Good to know about, thanks -- though in this case, if it's not even pairs, that's a usage error.

11:33 madsy: raek: Hm, now it's gone. Must have been a one time thing.

11:38 bdog66: l

11:38 l

11:40 clgv: ,(throw (Exception. "bla") (Exception. "blubb"))

11:40 clojurebot: #<RuntimeException java.lang.RuntimeException: java.lang.Exception: bla>

11:40 clgv: I would expect a compiler error since only one exception belongs in there.

11:40 TimMc: ,(throw 5)

11:40 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Throwable>

11:41 TimMc: ,(throw (Exception. "foo") 5 6 7)

11:41 clojurebot: #<RuntimeException java.lang.RuntimeException: java.lang.Exception: foo>

11:41 raek: ,(throw)

11:41 clojurebot: #<NullPointerException java.lang.NullPointerException>

11:41 nDuff: ^{} notation in my macros (annotations for a gen-class declaration) isn't showing up during macroexpand. Should I worry?

11:42 raek: nDuff: have you enabled *print-meta*?

11:42 TimMc: clgv: I suppose that since it is a compiler special, it doesn't have the arity checking by default (and someone forgot to put it in.)

11:42 nDuff: raek: just did so; no change in macroexpand output.

11:45 clgv: TimMc: yeah thats probably the reason

11:45 raek: nDuff: unfortunately macros have to be written to propagate metadata correctly

11:46 gfredericks: using with-meta can normally get around those issues, right?

11:46 raek: yeah

11:46 but the macro author has to be aware of it

11:47 gfredericks: those silly macro authors

11:47 also fretting about the macro publishing industry

11:52 dnolen: ibdknox: so you got to have a long chat with Sussman, eh?

11:52 ibdknox: dnolen: him, Piotr Mitros, and Dave something

11:52 _KY_: Lein has been downloading the index for 1:30 hours =(

11:52 ibdknox: I didn't catch his last name

11:53 dnolen: ibdknox: about Light Table?

11:53 gfredericks: _KY_: yeah that's so weird.

11:53 ibdknox: dnolen: yeah :)

11:53 dnolen: ibdknox: sweet! I'm sure Sussman was excited about the Lisp part ;)

11:53 zanes: dnolen: Dave Herman?

11:53 _KY_: Usually it's faster?

11:54 gfredericks: _KY_: dunno :(

11:54 in my experience it is usually longer than you want to wait for it

11:54 raek: _KY_: it took about 30 minutes for me last time :(

11:54 _KY_: Thankfully I'm not depending on it now...

11:54 * gfredericks does not know why it does that

11:54 _KY_: So I'll just leave it running

11:54 TimMc: Maven Central is overloaded.

11:55 gfredericks: they should set up a KickContinuer

11:55 TimMc: It should use torrents. :-)

11:55 ibdknox: dnolen: haha they thought it was cool. Sussman had some neat ideas, some I had actually been talking to a friend about earlier in the day

11:55 gfredericks: or torrents

11:55 TimMc: we can't use torrents it'll confuse politicians

11:55 gotta keep everything black and white

11:56 ibdknox: dnolen: it was funny conversation all in all. Piotr and Sussman end up arguing about whethoer not MITx was going to solve all the world's problems :D

11:56 dnolen: ibdknox: haha

12:04 goodieboy: I'm working with a ring web app here... anyone know the best way to get the path to "resources" so that it works locally, and when deployed to a servlet container?

12:04 I'm messing around with clojure.java.io, i *think* that's the place to be looking?

12:06 gfredericks: goodieboy: I don't think that's normally an issue

12:06 I put a directory in "resources/public" and use the ring middleware

12:06 should be on the classpath in both cases

12:07 goodieboy: gfredericks: well i actually need a working path, when the app first inits

12:07 alexyakushev: Could someone please tell if lein 2.0.0 honors the :extra-classpath-dirs option? Grepping through the sources yields no occurences

12:09 goodieboy: gfredericks: so it's way before any kind of request comes in

12:13 fdaoud: ibdknox: Sussman as in SICP?

12:13 ibdknox: fdaoud: yeah

12:13 fdaoud: ibdknox: wow that's awesome.

12:14 ibdknox: :)

12:14 fdaoud: ibdknox: how many hours do you sleep/night?

12:14 or have you found a way to extend the number of hours in a day?

12:14 ibdknox: haha

12:15 I sleep a normal amount

12:15 fdaoud: or to pause the clock?

12:15 zanes: ibdknox: Have you been in contact with the PLT folks? I bet they'd have interesting things to say about Light Table.

12:16 ibdknox: zanes: nope haven't heard from them

12:16 jsabeaudry: Is this the idiomatic way to call Math.round : (js/Math.round 5.5) ?

12:19 ibdknox: jsabeaudry: seems reasonable

12:21 gfredericks: goodieboy: yeah I believe there's a resource-path function in io, which I assume you've found by now

12:26 metajack: Is there something like iterate that takes a no-arg function? Or is (iterate (fn [_] (f)) (f)) the best way?

12:26 ibdknox: ,(doc repeatedly)

12:26 clojurebot: "([f] [n f]); Takes a function of no args, presumably with side effects, and returns an infinite (or length n if supplied) lazy sequence of calls to it"

12:27 metajack: i will add taht to see also for clojuredocs :)

12:27 thanks!

12:51 ipostelnik: is there a way to update var binding so that it's visible in child threads?

12:51 mcrittenden: anyone here tried emacs + evil mode? I'm a vim user but lots of emacs is pretty tempting, would like to get the best of both

12:58 scottj_: mcrittenden: it sounds like evil is the best right now, if that fails you can try viper or vimpulse

12:59 mcrittenden: scottj_: have you tried it? wondering about potential pitfalls when using such a non-emacsy emacs

13:00 scottj_: mcrittenden: I've tried it, I don't have a list of pitfalls, there was a blog post on that recently though it was from a non-vim user perspective

13:00 mcrittenden: ah cool i'll look for that, thanks scottj_

13:00 scottj_: mcrittenden: http://dnquark.com/blog/2012/02/emacs-evil-ecumenicalism/

13:01 mcrittenden: scottj_: AWSESOME, looks packed full of info. thanks

13:08 _KY_: Can all my project files share the same namespace instead of each file its own namespace?

13:10 tmciver: _KY_: You should really stick to one ns per file.

13:10 bsteuber: ibdknox: did you already do some research about how to do the webview thing? I'm asking because I need something similar for another cool cljs project..

13:10 _KY_: Ok...

13:11 ibdknox: bsteuber: a little, mostly came to the conclusion that there wasn't a solid crossplatform solution for it

13:11 bsteuber: in my case it'll end up built custom I think

13:11 bsteuber: damn, I was afraid of that ^^

13:11 ibdknox: bsteuber: you can use SWT though

13:11 bsteuber: and just have different binaries for the different platforms

13:11 tmciver: _KY_: if you have code that you feel should be in separate files, then it should be in separate namespaces.

13:11 ibdknox: bsteuber: at the very least it'll be the same code

13:11 bsteuber: I wonder whether it's easier to use a webview or offer IE support *sigh*

13:12 yes also read about swt before - might be the way to go

13:13 ibdknox: but for you, SWT will be a no-go?

13:13 ibdknox: bsteuber: not sure yet

13:13 bsteuber: that's a late game problem in my case :)

13:15 bsteuber: true that, we're already in an alpha stage, so we can't defer that much longer :)

13:18 nsxt: anyone have experience using hiccup with non-dev designers?

13:20 bsteuber: nsxt: what we did was planning the rough html structure with the designer, then generate all html with hiccups, give him the app and let him just do the css

13:20 worked very nicely

13:21 ibdknox: thanks anywayx - I'll tell you in case we have any success ^^

13:21 ibdknox: bsteuber: please do, I'm very interested in what you find out :)

13:22 _KY_: In lein REPL, how can I re-load a file when I "use" it?

13:23 the-kenny: (use 'foo.bar :reload) should work

13:23 zamaterian: or :reload-all

13:23 goodieboy: gfredericks: oh, no i didn't see the resource-path function! I'll check that out

13:24 nsxt: bsteuber: pre-planning sounds like a great approach - i guess as long as the html is firmly "semantic" you don't really have much to worry about, at least in terms of designers complaining about not being able to work on the html without knowing hiccup

13:25 bsteuber: nsxt: exactly, when you generate div's only there's not so much html stuff to worry about

13:25 nsxt: bsteuber: that's weavejester's approach to it, anyway... i was just wondering how hiccup would work in a team with 5+ designers

13:26 bsteuber: of course you could try teaching them some clojure

13:26 nsxt: bsteuber: haha, it's not a terrible idea, especially seeing as hiccup's syntax is mind-numbingly easy

13:27 but i'm biased, obviously.

13:27 bsteuber: but even in this case, they need to know what kind of data flows in

13:27 good model-view separation is needed anyways

13:33 fdaoud: cemerick: Clojure Programming was The Staff Pick in this week's "New Books In Programming" from http://anynewbooks.com

13:35 StepanKuzmin: Hi all!

13:36 How can I call this function — layer = new OpenLayers.Layer.OSM( "Simple OSM Map"); — in ClojureScript? I've tried (def layer (.OSM (.Layer js/OpenLayers) "Simple OSM Map")) but it makes layer = OpenLayers.Layer().OSM("Simple OSM Map");

13:37 Frozenlock: I have a ISO_8859_1 encoded string (in its own class). When I use the toString method and export the results, I have some weird gibberish instead of the accented characters. Is there a way to transform it into UTF-8? Something like (export (utf8 my-string))

13:37 StepanKuzmin: Is there any way to remove second ()?

13:38 Bronsa: StepanKuzmin: have you tried (.OSM (.-Layer js/OpenLayers) "Simple OSM Map") ?

13:38 ibdknox: StepanKuzmin: (def layer (OpenLayers.Layer.OS. "simple OSM Map")

13:39 forgot my js/ in front

13:39 StepanKuzmin: I'll try it

13:39 ibdknox: but that's what you want to do

13:39 StepanKuzmin: Thanks!

13:40 Thanks! (.Layer.OSM js/OpenLayers "Simple OSM Map") works great!

13:48 jweiss: I'm trying to have a recursive function return a map, where one of the values is a call to the recursive function. but I can't use recur this way because it's not in the tail position. I don't see how I can use an accumulator either, because the next call won't know where to insert into the accumulator.

13:49 i can just have it eat up the stack, because i'm pretty sure i won't blow the stack, but if there's a simple solution using recur, i'd like to do that

13:49 mefesto: jweiss: code example?

13:50 jweiss: mefesto: one sec

13:50 mefesto: https://refheap.com/paste/2383

13:51 that's the stack consuming way, obviously ^

13:56 mefesto: jweiss: perhaps make this a multi-arity function which would have the location of where to insert in the accumulator?

13:56 just ate lunch so my brain isn't fully functional atm

13:56 jweiss: mefesto: yeah, i considered that, but that adds a lot of complication vs just consuming stack :)

14:00 mefesto: jweiss: having it nested is a requirement?

14:01 jweiss: mefesto: yeah, the tree is going to be walked breadth first, and order is important.

14:12 goodieboy: anyone know if it's possible to tell "lein ring uberwar" to ignore a directory in ./resources ?

14:18 dgrnbrg: I'm using lein1 behind a firewall, and I've copied lein-nailgun into the .lein/plugins/ directory, but it's not showing up as a task

14:18 I can't find anywhere else that I need to register the plugin

14:21 fdaoud: goodieboy: not sure if that's what you're looking for, but I have in project.clj, :ring { :war-exclusions [#"something-to-ignore"] }

14:24 goodieboy: fdaoud: oh, yeah that might do it. Thanks.

14:25 cemerick: fdaoud: that's cool, didn't know about then

14:25 them*

14:28 samaaron: wub wub

14:32 amalloy: jweiss: one trick you could use is to store a ##(doc delay) as the value, and force it when you need it

14:32 lazybot: ⇒ "Macro ([& body]); Takes a body of expressions and yields a Delay object that will invoke the body only the first time it is forced (with force or deref/@), and will cache the result and return it on all subsequent force calls. See also - realized?"

14:51 fdaoud: goodieboy, cemerick: happy to help when I can :)

14:53 achin: I'm having trouble with dynamic variables. This form works as expected: (binding [*v* 3] (map (partial + *v*) [1 2 3])) => (4 5 6). But this breaks with a "var unbound" error: (binding [*v* 3] (map (fn [n] (+ n *v*)) [1 2 3])). What am I misunderstanding?

14:53 sattvik: achin: It may be because map is lazy.

14:54 dnolen: wow bumping against 500 folks in #clojure today :)

14:54 achin: sattvik: Hmm. Sure, but wouldn't *v* be looked up any time it's needed?

14:54 amalloy: achin: that partial evaluates *v* once, before any mapping happens

14:54 the fn you write yourself looks up *v* every time it needs to add. but because map is lazy, the binding has gone out of dynamic scope before its value is used

14:55 sattvik: achin: If *v* has no root binding, I can see how the error would occur.

14:55 achin: amalloy: Aaaaah. That makes sense. I hadn't thought of the map result being evaluated out of the scope of the binding.

14:55 amalloy: compare to ##(binding [*v* 3] (doall (map (fn [n] (+ n *v*)) [1 2 3]))), where you make sure all elements are produced inside the dynamic scope of the binding

14:55 lazybot: java.lang.SecurityException: You tripped the alarm! pop-thread-bindings is bad!

14:55 amalloy: siiiiigh

14:55 rsenior: I have hit a snag with a defrecord that has a huge lazy seq, and I can't figure out how to get the defrecord to let go, so it can be garbage collected: https://gist.github.com/8a5125e7827abfbeb8d0

14:56 achin: amalloy: Thanks a lot.

14:57 rsenior: I can wrap the lazy-seq in a thunk, put the thunk in the record instead and then the defrecord isn't holding onto the head, but i was hoping to do something from within in the function that is being passed the defrecord

14:57 hiredman: rsenior: in that kind of design it cannot be gc'ed

14:58 rsenior: hiredman: that's my current thinking

14:58 hiredman: there is a reference in a field of the deftype, and as long as there is a reference to the deftype

14:59 rsenior: hiredman: right, I've tried dissocing it from the record, handling it separately, etc, no luck, was hoping there was another way

15:00 nDuff: Hmm.

15:00 hiredman: the way is to not have a reference to the head of the seq in the instance of the type

15:01 muhoo: on heroku, is it LEIN_BUILD_TASK or LEIN_BUILD_PHASE ?

15:01 rsenior: maybe I'll run with the wrapping it in a function then

15:02 technomancy: muhoo: LEIN_BUILD_TASK

15:02 muhoo: thanks

15:03 technomancy: muhoo: as long as you have user_env_compile enabled

15:03 rsenior: hiredman: thanks for the response

15:03 fdaoud: dnolen: 500 people and a very high signal-to-noise ratio too :)

15:04 muhoo: technomancy: i do, thanks

15:05 thanks for such great clojure support on heroku too. making this very pleasant.

15:05 nDuff: cemerick: I'm connected into a REPL in a JIRA plugin via slime; the local classloader environment is rather odd. (pomegranate/add-dependencies) appears to do the right thing, but I can't use modules so installed -- the default incanter usage in the README yields "Could not locate incanter/core__init.clrass or incanter/core.clj on classpath", for instance. Any hints or pointers on where I should start looking?

15:06 cemerick: nDuff: what does the result of (cemerick.pomegranate/classloader-hierarchy) look like?

15:08 Multi-tenant app servers and *especially* apps with their homegrown module/plugin systems are likely going to be a PITA like this until someone burns through adding support for them (either in pomegranate itself or as separate addons).

15:08 technomancy: muhoo: glad to hear it =)

15:09 nDuff: cemerick: a few clojure.lang.DynamicClassLoader instances, followed by a org.springframework.osgi.util.BundleDelegatingClassLoader

15:09 cemerick: nDuff: can you paste a pprint or something?

15:10 technomancy: slime in jira; nice

15:10 nDuff: cemerick: https://gist.github.com/617991f31df3d12f29cc

15:11 mrb_bk: oh hello there

15:11 cemerick: nDuff: can you run it again? I'd like to know if the object IDs change with different REPL invocations

15:11 nDuff: cemerick: yes, they're changing.

15:11 cemerick: all of them?

15:12 nDuff: the first two are the only ones showing IDs; I'd have to play some games to see if the BundleDelegatingClassLoader's identify shifts

15:14 cemerick: nDuff: should work: (map #(str % (System/identityHashCode %)) (cemerick.pomegranate/classloader-hierarchy))

15:14 muhoo: &&(letfn [(valid? [{:keys [firstname lastname]}] true)] (valid? {}))

15:14 lazybot: java.lang.RuntimeException: Unable to resolve symbol: & in this context

15:14 muhoo: &(letfn [(valid? [{:keys [firstname lastname]}] true)] (valid? {}))

15:14 lazybot: ⇒ true

15:14 muhoo: that does not seem right

15:14 nDuff: cemerick: only the BundleDelegatingClassLoader stays constant.

15:15 cemerick: Hrm, that sucks.

15:16 muhoo: ibdknox: actually, that's from the noir docs ##(letfn [(valid? [{:keys [firstname lastname]}] true)] (valid? {}))

15:16 lazybot: ⇒ true

15:16 muhoo: oh, duh, nevermind

15:16 ibdknox: it's a multimethod, doh

15:16 Raynes: ibdknox: Damn it, raise money.

15:17 ibdknox: Raynes: hm? :)

15:17 Raynes: Raise money faster.

15:17 ibdknox: lol

15:17 cemerick: nDuff: unless that's an odd artifact of SLIME, then pomegranate's add-classpath strategy needs to get smarter.

15:17 ibdknox: it got a good boost today

15:17 from the kickstarter newsletter I guess

15:17 Raynes: I think you could get this over with quickly if you offered nude pictures under the 1k+ rewards.

15:17 cemerick: and someone will need to write support for this BundleDelegatingCL

15:17 ibdknox: lol

15:17 I'm sure that'd work :p

15:18 muhoo: I didn't follow that

15:18 cemerick: nDuff: have you used pomegranate within SLIME locally?

15:18 muhoo: ibdknox: it was me being an idiot, nm

15:18 nDuff: cemerick: no, I haven't. Happy to give it a try if that'd be helpful.

15:18 muhoo: i scroll down and my question was answered already :-)

15:19 cemerick: nDuff: Please. I don't use emacs, but I've heard good things from others that do. Maybe there's something more general we can focus on.

15:21 gtuckerkellogg: i'm having what is surely a stupid problem with slime and clojure-test-mode

15:21 nDuff: (as an aside -- the classloader environment, at least in terms of how it ends up in the oSGI sandbox used by JIRA's version-2 plugin loader, is quite different between swank and nrepl; would have stuck with the latter if it weren't for nrepl lacking any frontend with functionality equivalent to slime)

15:22 gtuckerkellogg: the first time I switch from a source file to a test file using C-c t, I am not placed into clojure-test-mode. I have to M-x clojure-test-mode or else everything goes haywire

15:22 cemerick: nDuff: well, leiningen v2 and/or Counterclockwise…but, ok. :-P

15:25 nDuff: cemerick: the issue doesn't reproduce outside the JIRA's OSGi-sandboxed plugin environment.

15:25 cemerick: oooh, osgi

15:26 nDuff: something like this is required in that case: https://github.com/aav/clojure.osgi

15:28 nDuff: cemerick: *shrug* -- I was able to escape the OSGI classloader back in nREPL (by finding the classloader that loaded the OSGi classloader's implementation class itself and walking the tree back). Was hoping to do something similarly tricksy/evil here.

15:28 cemerick: That said, I know little about the issues involved. lpetit did the heavy lifting with clojure.osgi and Counterclockwise.

15:29 nDuff: ...but the swank environment is different enough that that doesn't work verbatim.

15:29 * nDuff ponders poking at CCW

15:29 cemerick: nDuff: you sound like you're just the person to untangle it all ;-P

15:30 nDuff: Depends on how long I can hold off the folks expecting me to get Real Work done. :)

15:30 lynaghk: dnolen: I'm doing some cleanup/profiling of my C2 library and I've run into some interesting cljs performance tidbits. E.g., copying a seq into a JavaScript array and running doseq on that takes half as much time as running doseq directly.

15:31 dnolen: (and using forEach on the js array is ten times faster than doseq)

15:32 this in Chrome on CLJS head with :simple optimizations.

15:32 gfredericks: lynaghk: presumably doseq has an advantage for large/lazy seqs?

15:32 dnolen: lynaghk: last point makes sense, though that should hopefully improve w/ chunking, though I don't think it'll beat forEach on array, it should be competitive.

15:34 lynaghk: gfredericks: how do you mean? If you need to touch everything in a finite collection, is there an advantage to using seq?

15:34 dnolen: lynaghk: not sure about the previous point, that seems weird.

15:34 lynaghk: dnolen: yeah, last point makes sense. I was surprised with the first

15:34 dnolen: https://github.com/lynaghk/profile-cljs/blob/master/src/cljs/seq_test/test.cljs

15:34 gfredericks: lynaghk: if it's a larger-than-memory lazy seq, you can process it efficiently without having to have it all in memory at one time, as shoving it in an array entails

15:35 dnolen: lynaghk: will look into it, thx!

15:35 gfredericks: (doseq [x (take 1000000000 (range))] ...)

15:35 lynaghk: gfredericks: ah, good point.

15:35 gfredericks: so presumable the benefit lessens and disappears beyond some threshold

15:35 presumably*

15:36 lynaghk: dnolen: rad, thanks! I was considering extending C2's unify! to accept js arrays for better performance on large datasets.

15:36 gfredericks: lynaghk: though it'd be interesting to know if the oddity you discovered means that even for large seqs you could speed it up by chunking them into arrays piece by piece

15:37 felideon: technomancy: yay

15:38 lynaghk: gfredericks: yeah, definitely. Feel free to send some pull requests to that repo if you come up with any tests/benchmarks. If there's interest, I might put together some infrastructure to do nicer benchmarks and look at results historically so that we can track ClojureScript performance changes.

15:39 gfredericks: especially now that we're going to have some new backends by the end of the summer = )

15:39 gfredericks: new backends?

15:40 lynaghk: gfredericks: one of the accepted Clojure Google Summer of Code students is modular-izing ClojureScript and writing a Lua emitter

15:40 gfredericks: ah that's what all that talk's been about

15:41 lynaghk: gfredericks: I'm really jazzed about it, since it basically means I'll be able to get more performant code for iOS.

15:41 * gfredericks has no idea what Lua has to do with iOS. or anything about Lua really.

15:42 gfredericks: woah what if we wrote a clojure emitter for clojurescript

15:43 that idea was about 5 times less interesting than I expected it would be

15:43 muhoo: &(first (System/getenv))

15:43 lazybot: java.security.AccessControlException: access denied (java.lang.RuntimePermission getenv.*)

15:43 lynaghk: gfredericks: I'm sure someone will do that, if he doesn't. Then I'd be able to kill my clj/cljs code rewriting abomination.

15:44 gfredericks: lynaghk: I was thinking you could just run on rhino but maybe there would be some kind of perverse advantage

15:44 muhoo: are java methods not composable via juxt? i.e. this is failing: ((juxt .getKey .getValue) (first (System/getenv)))

15:44 gfredericks: muhoo: use memfn

15:44 muhoo: not to mention I think key and val would do the same thing as that example?

15:44 muhoo: oh cool

15:45 no it works if not juxted

15:45 (.getValue (first (System/getenv))) works, (.getKey (first (System/getenv)))

15:46 gfredericks: yes but I mean (val (first (System/getenv))) might do the same thing

15:46 muhoo: oh, it does, thanks. makes sense

15:47 gfredericks: thus (juxt key val)

15:47 muhoo: ((juxt key val) (first (System/getenv))), easy

15:47 actually what i really wanted was (map (juxt key val) (System/getenv)) , and i got it now :-)

15:47 gfredericks: does seq not work on raw java maps?

15:48 muhoo: seq does, but it produces some weird #<UnmodifiableEntry

15:48 gfredericks: ,(seq (doto [m (new java.util.HashMap)] (set m 1 2) (set m 5 6)))

15:48 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: m in this context, compiling:(NO_SOURCE_PATH:0)>

15:48 gfredericks: okay I don't know how to use doto apparently

15:49 lynaghk: ,(seq (doto (java.util.HashMap.) (set 1 2) (set 5 6)))

15:49 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: core$set>

15:49 muhoo: it's ok, (pprint (map (juxt key val) (System/getenv))) ftw

15:50 lynaghk: ,(seq (doto (java.util.HashMap.) (.put 1 2) (.put 5 6)))

15:50 clojurebot: (#<Entry 1=2> #<Entry 5=6>)

15:50 gfredericks: ,(map vec (doto (java.util.HashMap.) (.put 1 2) (.put 5 6)))

15:50 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unable to convert: class java.util.HashMap$Entry to Object[]>

15:50 gfredericks: weird error

15:53 daniel_: can i easily convert upper or lower case chars to the other case? \p -> \P

15:53 i know i can do it with clojure.string/capitalize but this leaves me with a one letter string

15:53 gfredericks: you can combine that with first at least; don't know if there's anything easier for chars

15:54 daniel_: ok, will just do that for now

15:54 joegallo: ,(Character/toUpperCase \u)

15:54 clojurebot: \U

15:54 gfredericks: joegallo: I was just about to look through the javadocs for something like that :)

15:57 TimMc: ,(= \u0131 \i)

15:57 clojurebot: false

15:57 TimMc: ,(= (Character/toUpperCase \u0131) (Character/toUpperCase \i))

15:57 clojurebot: true

15:58 gfredericks: TimMc: uh oh computing is broke

15:58 ,(println \u0131)

15:58 clojurebot: ı

15:58 gfredericks: a headless i

16:02 muhoo: is there any way in noir to get a handle on the, um, handler? so i can run route functions from the repl?

16:03 hmm, wait i see atoms noir-routes, etc. good

16:03 sweet

16:03 antares_: muhoo: you also can imitate requests with noir test helpers

16:07 daniel_: im having trouble with my 64 bit longs: https://gist.github.com/2502570

16:07 only fails when the generated number is 64 bits long

16:08 \r is the black rook on a chess board, so far corner

16:08 dnolen: lynaghk: accepting arrays probably an optimization worth doing anyhow.

16:09 jodaro: here is one of my favorite comments of the day

16:09 / Complete code duplicate from above because java \

16:09 can't do pragmas

16:09 yeah, pal, and you couldn't think of any other way to do it, huh?

16:09 dnolen: lynaghk: yeah I think Raphael will be tuning for LuaJIT performance, but I'm sure many of those choices will translate for regular Lua as well.

16:09 lynaghk: dnolen: yeah; it shouldn't be too difficult to do anyway.

16:09 sattvik: daniel_: What are using to convert the string to a number?

16:10 gfredericks: jodaro: what are pragmas?

16:10 dnolen: gfredericks: no sure if you followed along my conversation with rhickey yesterday - definitely seems like proper numerics is something worth thinking about if someone wants to take it on.

16:10 gfredericks: dnolen: cool I didn't see that -- that was in #clojure?

16:10 lynaghk: dnolen: Hmm. I wonder how JITless Lua compares with JavaScript on iOS anyway.

16:10 jodaro: i guess he wanted compile time stuff

16:10 no idea

16:11 dnolen: gfredericks: http://clojure-log.n01se.net/date/2012-04-25.html#11:47

16:11 jodaro: original author is long gone, messing up someone elses code now

16:11 gfredericks: dnolen: cool thanks; I just got on the clojure dev list so I'll send out a note asking for confluence-page-create-rights

16:11 dnolen: lynaghk: JavaScriptCore is pretty fast.

16:11 gfredericks: dnolen: I'm in between jobs for the next 10 days or so so I might have a good amount of attention for it

16:11 daniel_: sattvik: java.long.Long/parseLong

16:12 ,(java.lang.Long/parseLong "10001")

16:12 clojurebot: 10001

16:13 daniel_: ,(java.lang.Long/parseLong "1000000000000000000000000000000000000000000000000000000000000000")

16:13 clojurebot: #<NumberFormatException java.lang.NumberFormatException: For input string: "1000000000000000000000000000000000000000000000000000000000000000">

16:13 daniel_: ,(java.lang.Long/parseLong "100000000000000000000000000000000000000000000000000000000000000")

16:13 clojurebot: #<NumberFormatException java.lang.NumberFormatException: For input string: "100000000000000000000000000000000000000000000000000000000000000">

16:13 daniel_: hmmm

16:13 ,(java.lang.Long/parseLong "100000000000000000000000000000000000000000000000000000000")

16:13 clojurebot: #<NumberFormatException java.lang.NumberFormatException: For input string: "100000000000000000000000000000000000000000000000000000000">

16:13 daniel_: seems to be when it starts with 1

16:13 ,(java.lang.Long/parseLong "0100000000000000000000000000000000000000000000000000000000")

16:13 clojurebot: #<NumberFormatException java.lang.NumberFormatException: For input string: "0100000000000000000000000000000000000000000000000000000000">

16:13 daniel_: nope, im clueless

16:14 dnolen: hey OpenJDK 7 out for OS X

16:14 metellus: that number is too big

16:15 long is <= 2^63-1, which ~= 10^19

16:15 gfredericks: metellus: I think he's trying to parse a binary number

16:15 thus the initial 0

16:15 antares_: dnolen: 7u4 final for OS X? is it official or just another preview update?

16:16 dnolen: antares_: http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u4-downloads-1591156.html

16:16 sattvik: daniel_: Yeah, I think the problem is that it's too big. Longs are signed. I think Java is thinking you are tryint pass +2^64, which is outside of the valid range.

16:16 daniel_: i see metellus

16:17 i need to represent a bitboard for a chess engine, perhaps long isnt the right choice

16:17 ,(java.lang.Long/parseLong "100000000000000000000000000000000000000000000000000000000000000" 2)

16:17 clojurebot: 4611686018427387904

16:17 daniel_: i actually have a radix of 2, so it works then

16:17 but still fails at the 64th digit

16:18 sattvik: daniel_: java.util.BitSet?

16:18 daniel_: ,(java.lang.Long/parseLong "1000000000000000000000000000000000000000000000000000000000000000" 2)

16:18 clojurebot: #<NumberFormatException java.lang.NumberFormatException: For input string: "1000000000000000000000000000000000000000000000000000000000000000">

16:18 TimMc: daniel_: The chess engine constrains you to this choice of data structure?

16:18 dgrnbrg: daniel_: you could use a primitive vector of longs

16:18 antares_: dnolen: oh, awesome

16:18 daniel_: TimMc: no, i dont have any constraints...just trying to find the best representation

16:18 Chousuke: keep it simple at first

16:19 write functions to update and access the positions on the board, so you can change the internal representation later

16:19 daniel_: but a bitboard representation makes generating moves a lot easier and faster on 64 bit machines, its fairly common

16:19 gfredericks: chess engines are traditionally done pretty low level I think

16:19 like C

16:19 daniel_: sattvik: i'll look into that

16:19 TimMc: daniel_: Worry about speed later.

16:20 daniel_: Build a solid API around the abstraction of a board, then screw with the internals later.

16:20 sattvik: daniel_: Well, you can use a long, but you won't be able to use parseLong (unless you take the two's complement of the number and append a -). You can manipulate a long directly using Clojure's bit-twiddling functions.

16:20 Chousuke: you should be able to write an interface that doesn't care if you use a bitset or a vector of vectors of objects as the representation.

16:21 daniel_: TimMc: i think the representation of the board is a pretty fundamental decision, cant think how id create a solid API without having this decided

16:21 bhenry: how can i get the value of an html multi select element as a list or vector that can be passed to a remote as a list or vector

16:21 gfredericks: daniel_: do you need to parse binary strings at runtime, or are you just putting them in your source for compile-time-handling?

16:21 bhenry: ping ibdknox

16:21 ibdknox: bhenry: pong

16:21 dgrnbrg: daniel_: you can make the board interacted with via a protocol

16:21 and then you can plug in different board implementations later

16:22 Chousuke: daniel_: I would start by thinking about what operations you need to provide to manipulate pieces on a board rather than bits in the board representation

16:22 bhenry: ibdknox: i've got a call to jayq/val on a multi select element but it gives me an array which seems to create a problem when passing it to the remote.

16:22 daniel_: Chousuke: that depends on the representation, for example in a bitboard representation you can represent a pawn move by shifting the bits along 8 bits (goes forward one rank)

16:23 Chousuke: daniel_: you can provide lower-level functions later when you're done with your prototype

16:23 rplevy: kibit people, someone copy this for Clojure: https://codeclimate.com/

16:23 ibdknox: bhenry: there's a js->clj function in core

16:23 rplevy: or has someone already?

16:23 Chousuke: daniel_: yeah but you don't need to expose that detail to the user

16:23 bhenry: aha! i thought so. i'll give it a shot.

16:23 Chousuke: daniel_: you can give them just a "move-forward" function

16:24 daniel_: Chousuke: right, i see what you saying

16:24 i'd probably have functions like pawn-moves knight-moves...

16:25 the idea with the bit board is i can generate all the pawn moves by shifting the bits by 8, then do a bitwise and on all the other boards to find out if i've captured and pieces or if it's blocked by my own pieces

16:25 Chousuke: if you really need performance, you can use macros to eg. compile a vector of moves into a series of bit shifts and optimise. But still, I don't think you need to *start* with that :P

16:26 daniel_: dgrnbrg: like this? https://github.com/zmyrgel/tursas/blob/master/src/tursas/move.clj

16:26 dgrnbrg: daniel_: yes, something like that

16:26 once you know your API, you can always just swap out implementations

16:27 daniel_: they have chosen a 0x88 representation instead of a bitboard

16:27 dgrnbrg: (for testing, though, I recommend you avoid protocols--they make development hard)

16:27 just keep them in mind and use them afterwards

16:27 daniel_: ok

16:27 Chousuke: just start with functions. you can add protocols later

16:27 dgrnbrg: the best situation is that you develop the system 10x faster due to clojure's interactivity

16:27 daniel_: thats good to know

16:27 dgrnbrg: and then it's really slow to run, and you optimize it very quickly

16:28 daniel_: the specific thing that sucks w/ protocols is that they don't play nicely w/ redefinition in an interactive setting, like a repl

16:30 Chousuke: in Clojure itself protocols seem to be used mostly as an implementation-level tool, and the actual user-facing API consists of normal functions that use the protocol methods.

16:30 OwenOu: hi i am trying to follow the tutorial here in Heroku on connecting a clojure app postgresql, https://devcenter.heroku.com/articles/clojure-web-application

16:30 but i am getting this error: user=> (require '[clojure.java.jdbc :as sql])

16:30 nil

16:30 (sql/with-connection (System/getenv "DATABASE_URL")

16:30 (sql/create-table :testing [:data :text]))

16:30 IllegalArgumentException protocol = socket host = null sun.net.spi.DefaultProxySelector.select (DefaultProxySelector.java:151)

16:30 Raynes: technomancy: ^

16:31 OwenOu: could anyone help me a bit? thanks

16:31 technomancy: OwenOu: do you have the DATABASE_URL environment variable set?

16:31 OwenOu: yes

16:31 user=> (System/getenv "DATABASE_URL")

16:31 "postgresql:///shouter"

16:31 mefesto: is lein-cljsbuild known to work with lein2?

16:31 OwenOu: is this the right url to connect to it?

16:32 technomancy: OwenOu: I think it's "postgres://" instead of "postgresql://"

16:32 (which is kind of dumb that jdbc cares)

16:32 mefesto: yeah

16:33 rplevy: kibit / Clojure version of codeclimate -> code deodorant?

16:34 or maybe patchouli , because no one wants their code to smell like a Phish show

16:34 OwenOu: technomancy : same problem though: (sql/with-connection (System/getenv "DATABASE_URL")

16:34 (sql/create-table :testing [:data :text]))

16:34 IllegalArgumentException protocol = socket host = null sun.net.spi.DefaultProxySelector.select (DefaultProxySelector.java:151)

16:34 user=> (System/getenv "DATABASE_URL")

16:34 "postgres:///shouter"

16:35 dabd: if i want to generate html in clojure should i go with enlive or hiccup?

16:35 bhenry: ibdknox: still stuck at this https://gist.github.com/8a0063cd28d55e0f1799

16:35 Raynes: Or mustache.

16:36 technomancy: OwenOu: hm... maybe you need to be more specific: "postgres://localhost:5432/shouter"

16:36 oskarth: I like hiccup, but I think both are fine

16:36 Raynes: dabd: Any of these things are acceptable. Use whatever you like more and is appropriate for your application. If you've got designers doing the designing, separating HTML and code might be appropriate and thus enlive or mustache would be a good choice.

16:36 technomancy: OwenOu: I've seen it fill in the defaults if they are absent in some cases, but I guess it doesn't always?

16:37 OwenOu: technomancy: you are right, it has to be explicit

16:37 technomancy: OwenOu: thanks for the heads-up; I'll be sure that's reflected in the article

16:37 bhenry: ibdknox: side note, that fields->map function works on another form that's all text fields.

16:37 ibdknox: bhenry: what is g if you log pr-str it to the console?

16:38 bhenry: i'll check. do you mean (.log js/console (pr-str g))?

16:38 OwenOu: technomancy: you're welcome, thanks for your help :)

16:39 dabd: Raynes: I want to generate simple html files (tables) from clojure data structures

16:39 Raynes: Then hiccup is likely your best option.

16:39 bhenry: ibdknox: same {:grpname "MEFAManager", :grpsubs ["[object Object]"]}

16:39 dabd: ok thx

16:40 ibdknox: bhenry: hm and what does it print without the js->clj?

16:41 bhenry: ibdknox: {:grpname "Test", :grpsubs #<Array ["[object Object]"]>}

16:41 ibdknox: that's interesting

16:42 bhenry: $("sdofij").val() is returning the string "[object Object]"

16:42 mefesto: doh

16:42 i guess it helps if i use the right file extension for cljs files :)

16:43 ibdknox: bhenry: are you sure the values are being set to what you expect?

16:43 bhenry: I believe that is doing the right thing

16:43 bhenry: i don't know. basically i want to get the option values of the multiselect as some collection of strings that can be passed to the remote.

16:44 ibdknox: another side note http://i.imgur.com/YjLhY.png this hangs my cljs repl

16:44 ibdknox: bhenry: yeah, the compiler doesn't handle redefs of core functions well

16:44 bhenry: name it something else

16:45 bhenry: which core function am i redefing?

16:45 subs is a function?

16:47 aaaahhaha. sheesh

16:52 dnolen: bhenry: ibdknox: that's fixed in master

16:52 not sure when stuartsierra will cut the next release.

16:52 ibdknox: dnolen: :)

16:52 dnolen: I've been working against master

16:53 dnolen: been good so far

16:53 dnolen: ibdknox: we're trying not to break things :)

17:00 muhoo: what could i be doing wrong, in noir, where (server/load-views "src/projectname/views") isn't loading src/project/name/views/user.clj ?

17:00 bhenry: ibdknox: thanks for the help. i introduced a breaking change. you were right about the values being set wrong.

17:01 ibdknox: muhoo: if there's a compile error

17:01 bhenry: np

17:01 muhoo: i don't see any

17:01 if i manually (require 'projectname.views.user :reload) it compiles just fine

17:02 and then i can do load-views and everything shows up fine

17:02 in (pprint @noir.core/noir-routes)

17:02 ibdknox: muhoo: reloading might be hiding compile errors, specifically ordering issues

17:02 muhoo: ah, ok

17:03 ibdknox: that's bitten me at the repl a few times with Clojure in general

17:04 yoklov: hm, how large can JS integers be before they stop acting like integers?

17:04 muhoo: slamhound to the rescue :-)

17:05 mefesto: what is all this var CLOSURE_NO_DEPS = true; for and is it only needed for :whitespace optimization level in cljsbuild ?

17:05 yoklov: aha, 32

17:05 i guess

17:06 emezeske: mefesto: I'm not sure I can explain it much better than https://github.com/emezeske/lein-cljsbuild/blob/master/example-projects/simple/src-clj/example/views.clj#L4

17:07 mefesto: emezeske: ahh thanks

17:07 i know you've heard it before but lein-cljsbuild is quite awesome :)

17:08 emezeske: mefesto: Thanks!

17:14 daniel_: sattvik: why does parseLong fail on the 64 char string?

17:15 fdaoud: now that's a funny nick

17:16 dnolen: yoklov: JS has 53bit integer.

17:17 sattvik: daniel_: Imagine longs are signed 8-bit values, the biggest long you could get is 0111111. If you try to parse 10000000, that's outside of its range.

17:19 daniel_: i see, but you said i could use longs, but not parseLong

17:19 yoklov: dnolen: but bitwise operations only work on 32 bit integers, right?

17:19 sattvik: I believe that would be most negative value you could get. To give it "1000 0000", that would be the equivalent of -256.

17:21 dnolen: yoklov: ah yeah, they'll get converted it looks like

17:22 daniel_: why cant java have unsigned longs? :'(

17:22 yoklov: daniel_: i'm pretty sure all its numbers are signed

17:22 sattvik: So, to get the value of "1000 0000", you actually would have to use "-111 1111".

17:24 Now, you can use a plain old long, but you'll need to use the low-level bit functionality, such as set-bit and test-bit.

17:25 daniel_: either way, it adds an annoying layer of complexity

17:25 sattvik: Honestly, though, I think you're getting caught up too much in trying to twiddle bits.

17:25 daniel_: how does the two's compliment effect bitwise operations i will want to do on it

17:26 i am but what choice is there when Java doesn't have unsigned longs

17:26 sattvik: As far as things like bit-set go, it doesn't know anything about the signed vs. unsigned. It's just bits.

17:28 daniel_: i wouldnt know how to use either bit-set or two's compliment atm, so i need to go away and try to understand them

17:28 yoklov: daniel_: why do you want to represent this as bits then?

17:28 usually the only reason to do that is when its either convenient or familiar

17:29 or prohibitively slow

17:29 daniel_: so i can do bitwise operations to easily calculate capturing moves or off-the-board

17:29 yoklov: i thought it would be convenient, i didnt see this problem

17:29 yoklov: are you sure that it's easier than the alternative?

17:30 daniel_: other representations would be less convenient in some other ways

17:30 samaaron: where middlewares essentially just modify incoming request maps in a chain

17:30 and also similarly for outgoing responses

17:30 i.e. all incoming requests flow through all middlewares

17:30 and all all outgoing responses similarly flow through the whole outgoing middleware chain

17:31 yoklov: daniel_: well, whenever i've ported c bit-twiddling code to java its mostly worked, but i've needed to use the >>> (unsigned right shift) operator (unfamiliar what this called in clojure/what the default behavior of bit-shift-right is)

17:32 samaaron: oops - ignore me please

17:32 yoklov: and if there's a spot in particular which doesn't work, i'd do (problem-spot >>> 0)

17:32 _KY_: How can I select which function to run in "lein test"?

17:33 technomancy: _KY_: `lein help tutorial` and look for "test selectors"

17:33 yoklov: daniel_: ah, looks like clojure has no equivalent of >>>. shame

17:33 http://dev.clojure.org/jira/browse/CLJ-827

17:36 mefesto: are there multiple ways to access a javascript objects properties in cljs?

17:36 i saw something about (.-prop obj)

17:36 mebaran151: hey, quick map destructuring question: I'd like to make a keyword arg fn where I'd like to bind one special key to a local var and pass the rest as a map to my function body

17:37 possible?

17:37 yoklov: mefesto: (.-prop obj), and (. obj -prop) both work

17:37 joegallo: yoklov: of course, you can put it together pretty easily in a tiny mixed java & clojure library

17:37 mefesto: yoklov: thanks

17:37 joegallo: but it would be really nice to have that applied to clojure one day... :(

17:37 yoklov: mefesto: (also, if it's locally bound, obj.prop happens to work)

17:37 but that's just a quirk i guess.

17:38 mefesto: is there a clojure equivalent for (bean obj) in cljs?

17:38 yoklov: mefesto: what would that do in cljs?

17:39 mefesto: yoklov: take the js obj and return a map of the props using keywords

17:39 daniel_: the problem is with parseLong i suppose, im trying to use a vector like [\r \n \b ... ] to generate the bitboard

17:39 mefesto: (bean jsobj) => (:prop jsobj)

17:39 yoklov: mefesto: js->clj is it, i think

17:40 daniel_: i wanted to avoid defining the initial bitboard (for all 12 pieces/colour) and generate it from one vector

17:40 mefesto: yoklov: cool thanks :)

17:40 yoklov: mefesto: you might want (js->clj obj :keywordize-keys true)

17:41 daniel_: i end up with a string "rnbqkbnrpppppppp...." and then i map 1 or 0 to the string depending on if the character matches for the piece

17:42 nevermind, i'll end this crappy evening of longs and resume tomorrow

17:43 Fullmoon: Can anyone recommend a non-trivial (echo, …) network server written in clojure to look at?

17:46 technomancy: Fullmoon: you could try mire. it's a little dated, but it's a simple MUD.

17:48 kurtharriger: does the new clojure 1.4 require syntax not support :rename ? I'm trying (:require [clojure-hbase.core :refer [with-table] :rename {get hb-get}) but this doesn't seem to work, thought the idea was that :use could be entirely obsolete

17:50 technomancy: :rename is kind of redundant with :require; just give it an alias

17:50 :as hb, then hb/get instead of hb-get

17:51 sattvik: technomancy: I'm trying to use the emacs-clojure-vagrant from the Seajure site, but it seems like it's not finding Jark. Is there a more up-to-date setup available?

17:52 technomancy: sattvik: not yet, but I'm thinking of porting it to vmfest

17:53 Fullmoon: technomancy: Mire?

17:53 technomancy: https://github.com/technomancy/mire <- the sample app from the peepcode screencast

17:54 Fullmoon: technomancy: Yeah, I saw the screencast :)

17:54 technomancy: oh, cool

17:54 kurtharriger: I decided I don't like using :as for for local project files as it makes moving functions between namespaces more difficult since I need to go change usages not just ns declaration... I'm okay with them for external dependencies but still prefer being explicit about which functions I'm importing

17:54 Fullmoon: technomancy: Very land of lispy

17:55 technomancy: Fullmoon: yeah, should have added a drunken wizard =)

17:55 Fullmoon: technomancy: Looks nice, I'll have a look, totally forgot about it

17:56 sattvik: technomancy: OK, thanks. I'll see what I can do with what I have. I'm new to vagrant, but I think I can work out most of the details out from here.

17:57 technomancy: sattvik: just comment out the jark lines and you should be fine

18:04 ritre: \part

18:04 mefesto: is this the idiomatic way in cljs? https://refheap.com/paste/2386

18:04 ^ line 11

18:04 (.-SUBMIT events/EventType)

18:19 yoklov: mefesto: to be honest, the idiomatic way would likely be to use a wrapper around the closure libs

18:19 wkmanire: Howdy folks.

18:20 yoklov: or to abstract it a bit further before actually doing things, i guess

18:20 i just use the dom. the closure libraries are weird

18:28 emezeske: yoklov: I just use jayq

18:28 yoklov: It's much less boilerplatey than goog stuff I think

18:28 yoklov: emezeske: i sometimes use jayq

18:30 emezeske: it's not complete though and i get little annoyed when I have to call a method on it or something

18:30 wkmanire: I'm really impressed by seesaw so far.

18:30 I don't think I've ever used a GUI library that was easier than this.

18:34 emezeske: yoklov: Yeah, the incompleteness bugs me for sure

18:35 yoklov: I keep meaning to fork it and bring it up to 100%

18:36 yoklov: emezeske: yeah, the thought's crossed my mind on a few occasions. or at least to fix things like (on) so it handles its arguments the same as jquery does

18:36 jquery has a somewhat large api though.

18:37 wkmanire: yoklov: Large, with some redundancies.

18:37 yoklov: wkmanire: certainly

18:37 wkmanire: Although I think in 1.7.1 they addressed some of that with .on for binding events.

18:40 emezeske: yoklov: I'd like to fix at least the really silly things, like having attr but no remove-attr :)

18:41 yoklov: emezeske: yeah, it's that sort of stuff that bugged me

18:42 but as soon as I considered doing that the sheer size of jquery would daunt me

18:43 ibdknox: yoklov: emezeske: jayq has on: https://github.com/ibdknox/jayq/blob/master/src/jayq/core.cljs#L186

18:43 yoklov: ibdknox: yeah, but it handles its arguments differently than jquery itself

18:44 thats what i mean, at least

18:44 meant*

18:44 ibdknox: oh I thought I actually made it so all the common cases fell through

18:44 I've not used on much

18:44 so I dunno

18:45 yoklov: yeah, if you only give it an event and a handler it fails iirc

18:46 ibdknox: taking a cursory look that *should* work

18:46 in any case, I would love pull requests for completeness :D

18:47 yoklov: if sel and data are missing, they're supposed to be treated as null

18:47 as it is, i think ->selector gets the handler, and data and handler become null

18:47 emezeske: ibdknox: You might just get such a pull request :)

18:48 ibdknox: yoklov: ->selector will just pass it through

18:49 yoklov: and unless jquery went out of it's way to fuck it up, those nulls should be interpreted as a lack of those args

18:49 so theoretically it'd work :D

18:49 yoklov: ibdknox: hm, i see what you're saying

18:49 ibdknox: yeah i think that it really doesn't work though

18:49 ibdknox: well that's annoying

18:49 so much for my being clever

18:49 :)

18:50 nDuff: cemerick: it's an ugly awful hack, but I'm able to escape the OSGi environment sufficient to allow pomegranate to do its thing.

18:50 (actually, it's not _that_ ugly, comparatively speaking; the nrepl form was worse)

18:54 yoklov: ibdknox: hm, you know, it really looks like it should work looking at the jquery source… I don't know, maybe my bug was elsewhere and I just attributed it to that? hm

18:54 cemerick: nDuff: what did you need to do?

18:56 ibdknox: yoklov: I claim ignorance

19:09 mebaran151: hey dakrone, does clj-http support the HTTP patch method?

19:09 yoklov: Hm, waht's the syntax for number literals with different bases?

19:10 dakrone: mebaran151: it doesn't, I had never heard of the PATCH method until now :P

19:11 mebaran151: huh, something I'll have to look at adding

19:11 mebaran151: here's the RFC: http://tools.ietf.org/html/rfc5789

19:11 TimMc: Why not allow arbitrary verbs? :-)

19:13 dakrone: mebaran151: out of curiosity, what API/website uses this?

19:13 mebaran151: dakrone: Salesforce API

19:13 dakrone: mebaran151: interesting

19:14 mebaran151: do you have a way to work around it until PATCH is added? (using POST or something?)

19:14 mebaran151: for some reason they don't use put :/

19:15 the assumption of the API is that you drive it through curl, which seems kind of crazy to me

19:15 septomin: some google apis use patch also

19:15 https://developers.google.com/drive/v1/reference/files/patch

19:16 dakrone: I'll work on adding it

19:17 mebaran151: oh this looks nasty: apparently Apache HttpClient doesn't even support it

19:18 dakrone: yea, you have to extend it yourself: http://www.mail-archive.com/httpclient-users@hc.apache.org/msg04246.html

19:19 brehaut: that code sums up java so well

19:19 TimMc: oh god what

19:20 brehaut: two ways to get a string, and magic implemented somewhere else

19:21 TimMc: The static final override just... wtf.

19:21 brehaut: TimMc: for bonus though, getMethod doesnt even reference it

19:22 mebaran151: Salesforce has an official workaround wherein you do some weird overrides

19:23 hiredman: curl is how big бизнес does rest

19:23 mebaran151: I was hoping to stay in clj-http land :)

19:24 hiredman: actually it might work with clj-http-lite

19:24 since for URLConnection you can set the method as a string name

19:25 dakrone: hiredman: "one of: GET POST HEAD OPTIONS PUT DELETE TRACE are legal"

19:25 hiredman: oh, well damne

19:27 mebaran151: why is the PATCH method such a bastard child?

19:27 heh

19:32 I'm definitely confused why Salesforce is so gungho about using the PATCH method as well

19:43 amalloy: github likes you to use PATCH for some of their APIs

19:43 but i believe they accept POSTs since a lot of clients won't do PATCH

19:43 yoklov: so, i wanted to ask about this: does anybody have any ideas about how I can manage state better in cljs? when I made my game for ludum dare, threading the entire game state through every function wasn't really doing it for me

19:44 or really, how to manage something like the state of a game in a functional language

19:44 mebaran151: Salesforce really pushes you to use SOAP, but compiling a WSDL seems so archaic with what is actually a really nice Rest API

19:44 brehaut: yoklov: depending on your needs, you probably want either an atom closed over by the stateful functions, or a state monad

19:44 mebaran151: all you ever want to do in Salesforce is push objects into the system or get other objects that you then do some computation on so it works well, if only for the patch method :/

19:45 brehaut: yoklov: although a state monad is probably going to introduce unacceptable function calling overheads in a game [caveat: i have no idea how goog closure would be able to optimise that]

19:46 yoklov: brehaut: google closure mostly tends to do obvious optimizations

19:47 brehaut: yoklov: from memory the clojure monad lib uses a dynamic vars to track the current monad functions

19:47 yoklov: hm

19:47 brehaut: and the state monad adds about 3 function calls for every one function in monad

19:48 one of which (m-bind) is indirecting through the dynamic var

19:49 yoklov: the most performance intensive part of games is typically just the rendering, and i can probably unpack everything I need before the rendering starts to happen

19:49 mebaran151: brehaut: I don't think algo.monads uses dynamic vars

19:50 a quick grep of the source didn't reveal any binding magic

19:51 but monads in clojure are funcall heavy

19:52 yoklov: hm

19:53 ben_m: You could use the new tagged datatype reader macro thing to make monads prettier, I suppose?

19:53 Or just write a (do ..) macro.

19:54 yoklov: ben_m: the syntax isn't really my concern

19:54 brehaut: mebaran151: the dynamic stuff is handled by with-symbol-macros from https://github.com/clojure/tools.macro/blob/master/src/main/clojure/clojure/tools/macro.clj#L232-235 which (from a quick look) does appear to use binding

19:54 mebaran151: ah I stand corrected

19:54 brehaut: https://github.com/clojure/algo.monads/blob/master/src/main/clojure/clojure/algo/monads.clj#L161-171

19:54 mebaran151: yeah I looked through: I often think of monads as the rich man dynamic vars

19:54 I didn't realize how right I was

19:55 brehaut: thats some complicated macro soup

19:55 mebaran151: brehaut: yeah it's unclear if the binding is compile time or runtime

19:55 brehaut: mebaran151: in haskell they arent; they use the type system to evaluate the implementation statically, but we dont (yet) have return type polymorphism and static analysis in clojure

19:56 amalloy: brehaut: symbol-macros only use bindings at compile-time

19:56 brehaut: ah well. thats clever then

19:57 mebaran151: the funcall overhead is a little nasty though

19:57 and you get stacktraces, that compared to Haskell, can be hard to follow

19:57 brehaut: haha hasnt haskell only recently got stack traces?

19:57 * mebaran151 was thinking of creating a monad to encapsulate some of logic for interacting with salesforce

19:57 mebaran151: I mean error messages :)

19:58 brehaut: oh right, yes

19:58 amalloy: yeah, i can't think of any reason monads would need a dynamic var at runtime, since the m-bind etc functions are only meaningful in lexical scope

20:04 mebaran151: dakrone: with regard to the patch method, it looks like from your src, all I would have to do is (def proxy-patch-with-body (make-proxy-method-with-body :patch)) and then wire it up in request method

20:05 is there any reason why you wouldn't just change the case expression to condp and pass unknown symbols directly to proxy-method-with-body directly

20:06 then you could get support for even stranger verbs like MOVE, COPY, PROPFIND to a limited degree

20:13 what's the best way to import an external git project that you'd like to keep up to date into a project?

20:13 *lein project

20:14 technomancy: mebaran151: try checkout dependencies

20:14 described in the readme

20:14 aniero: technomancy: no need for https://github.com/tobyhede/lein-git-deps ?

20:14 mebaran151: thanks

20:17 technomancy: aniero: yeah, I'd strongly recommend against that approach

20:17 aniero: ohh, you're talking about the /checkouts dir?

20:17 technomancy: yeah

20:17 aniero: cool

20:18 technomancy: checkouts augment existing dependency declarations rather than replacing them

20:24 mebaran151: cool

20:35 wkmanire: Is there anything for seesaw that will let me load my UI from a text file? Like XML for instance.

20:35 yoklov: wkmanire: it wraps swing, which doesn't do that (afaik), so it's doubtful

20:36 amalloy: s/xml/clojure => yes?

20:36 wkmanire: amalloy: Yeah, I guess there really isn't much of a difference is there.

20:37 In that regard.

20:39 mebaran151: wkmanire: you could also play with JavaFX 2.0

20:40 it has its own little XML style language for Java, though you'd have to do a little bit of Java wrapping

20:42 wkmanire: mebaran151: Interesting, but I'm building a tiny little thing as part of my Clojure studies.

20:43 mebaran151: oh then seesaw is by far the most straightforward: I use it to put together little gui's in the office

20:43 wkmanire: I'll just stick to "hard-coding" the UI. I say hard-coding, but as amalloy remind me, since clojure code is also data, storing the UI as an XML document doesn't really have an advantage over storing it as Clojure code.

20:43 reminded*

20:44 yoklov: especially now with the extensible reader

21:16 cjfrisz: Just in case you ever wondered....factorial of 500000 is a big enough number to make an emacs buffer really mad

21:16 septomin: cemerick: something wrong with http://www.clojureatlas.com/org.clojure:clojure:1.4.0?guest=t

21:17 cemerick: bah

21:17 wmealing_sleep: cjfrisz, heh.

21:18 cemerick: septomin: will be back momentarily

21:19 septomin: should be good now

21:19 thanks for the heads-up

21:20 septomin: wfm, thanks

21:20 dreish: Trying to find what used to be clojure.contrib.repl-utils/show and having a hard time googling it. Anyone know where it lives now?

21:46 TimMc: dreish: A combination of places, actually.

21:47 But none of them are really as good as the original.

21:47 dreish: Just the show function?

21:47 TimMc: ~contrib

21:47 clojurebot: Monolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

21:47 TimMc: "Migrated to clojure.repl and clojure.java.javadoc. show functionality similar to clojure.reflect/reflect."

21:48 dreish: Ah, I see. Thanks.

21:50 faitswulff_: I have a shaky background in Ruby - I'm quite new to programming - but if I wanted to learn clojure, where should I start?

21:54 wkmanire: faitswulff_: I'm currently learning it too.

21:54 This is a great place to be.

21:54 tomoj: the "programming clojure" book is pretty good I think

21:55 wkmanire: faitswulff_: It's actually advantagous, in my opinion, that you're new to programming and already exploring functional programming.

21:56 faitswulff_: tomoj: Thanks! I'll look into it. Can you recommend any free online resources?

21:56 wkmanire: faitswulff_: It's been a real fight for me to stop trying to solve problems imperatively.

21:56 Frozenlock: Is there a trick to handle lazy seqs? I always try everything in the repl, but lazy are evaluated before they get printed. As a result, I often export files, only to realize too late it's written "clojure.lang.LazySeq@d2208dd" in them. :(

21:56 tomoj: faitswulff_: I don't think of any, other than this channel..

21:56 faitswulff_: tomoj: Okay. I'll get the book, then.

21:56 amalloy: faitswulff_: you might like 4clojure

21:57 faitswulff_: wkmanire: I don't know what that means...but sounds good!

21:57 tomoj: that I don't think of any is very bad evidence that there aren't any

21:57 cemerick: faitswulff_: Perhaps consider http://clojurebook.com. </biased>

21:57 wkmanire: faitswulff_: Ruby is an imperative language. The way you use it to solve problems can be greatly different than the way you would use Clojure to solve those same problems.

21:57 faitswulff_: amalloy: Awesome, thanks!

21:57 wkmanire: faitswulff_: cemerick authored a book I'm currently reading from.

21:58 faitswulff_: cemerick: I'm guessing you wrote...yep haha

21:58 wkmanire: It's really good and a few others in the channel indicated it for me as well.

21:58 other than cemerick.

21:58 cjfrisz: If anyone saw the "Improving Constant-space Tail Call Support in Clojure" video via Youtube/Planet Clojure, I'm the presenter in the video

21:59 I just posted my code on Github if anyone is interested: https://github.com/cjfrisz/clojure-tco

21:59 faitswulff_: wkmanire: That's exactly why I'm interested in learning it - it's a different way of problemsolving

21:59 metellus: Frozenlock: maybe doseq or doall

21:59 ibdknox: faitswulff_: a fantastically awesome one ;)

22:00 faitswulff_: ibdknox: :)

22:00 yoklov: cjfrisz: you do CPS conversion?

22:00 cemerick: cjfrisz: I have that vid queued. Cheers for kicking up some dust. ;-)

22:00 faitswulff_: Well, I'm going to head out because this coffee shop is closing, but it was extremely informative! Thank you, guys!

22:00 cjfrisz: yoklov: I indeed do CPS conversion

22:01 yoklov: cjfrisz: how big is the performance hit

22:01 ?

22:01 wkmanire: Frozenlock: I'm just taking a guess, but you could probably realize some of your lazy-seqs in the REPL for testing.

22:01 yoklov: cjfrisz: not that i'm criticizing you, it's super awesome, i'm just curious

22:01 cjfrisz: yoklov: I'm seeing about 1.5x to 2x execution time from standard Clojure where it can finish the computation

22:02 Frozenlock: wkmanire: that's the problem... I don't see that they are lazy when I test in the repl.

22:02 yoklov: that's actually not as bad as i would have expected

22:02 cjfrisz: yoklov: I'm not particularly pleased with it yet, but the version I posted is very naive, and I have a lot of smart PL/compilers people who were at the talk and gave me advice

22:02 wkmanire: Frozenlock: The doc strings usually tell you if a function is lazy or not.

22:03 cjfrisz: Next step is to add some smarter thunkification

22:06 wkmanire: chewbranca: Which client are you using?

22:06 chewbranca: wkmanire: Smuxi

22:07 wkmanire: I see you're still having trouble with your nick.

22:07 chewbranca: because it works on ubuntu with znc, had issues with passwords on xchat

22:07 yeah rather annoying, it defaults to using your system user account as the backup name.......

22:10 aniero: is there good straightforward guide for getting cljs working? i'm getting missing requests for "deps.js", trying to use jayq, and it doesnt seem to be working

22:16 amalloy: cjfrisz: in the video you mention scala's automatic self-TCO and don't know why clojure doesn't do it. the reason is that if it's automatic and "magic", you could easily write code that you think is a tail-call but ends up consuming stack because you did something wrong. a misplaced recur refuses to compile

22:16 cjfrisz: amalloy: That makes sense

22:17 amalloy: if java got real TCO, i wouldn't be surprised to see clojure get implicit TCO as well, but until then it's explicit and that's tbh kinda nice

22:18 alexbaranosky: once you get used to recur, it is pretty simple to use, and like amalloy said, it has the benefit of not being "magic"

22:18 cjfrisz: amalloy: If it were Scheme, I would reason that there's a lot more chance for rebinding names to different things, so it would be harder to guarantee that a name goes where you think it does.

22:18 But Clojure is a little stricter on mutation than Scheme

22:19 amalloy alexbaranosky: I agree that the story for *self* tail-calls isn't egregious in Clojure with recur. It's just a matter that you don't get fully general tail-call optimization.

22:19 Which is something that Schemers and MLers get spoiled on and is worth trying to implement.

22:32 kovasb: emezeske: I'm trying to use cljsbuild 0.1.8 .. what does it mean when the browser gives a 404 on "deps.js" ?

22:33 LuminousMonkey: Whoops

22:34 wmealing_sleep: other than the obvious file not found ?

22:34 kovasb: lol

22:34 Im looking for a place in my code that would specify such a file..

22:35 not finding one

22:35 so I'm guess it is generated by the compiler somehow

22:36 wmealing: i've done zero in clojurescript, sorry about that.

22:37 kovasb: its pretty rough

22:37 i can't seem to find a build system that works

22:38 wmealing: lein deps ?

22:38 kovasb: no, u need to compile the clojurescript

22:38 hence cljsbuild

22:38 wmealing: ah

22:39 do you do something like this: http://jeditoolkit.com/2012/03/17/clojurescripting-intro.html

22:40 kovasb: I've done quite a bit of clojuresript

22:40 already..

22:40 its just weird quirks that are making my head explode

22:41 mefesto: my head is exploding right now

22:41 kovasb: like, old versions of libraries getting compiled, after I've upgraded the dependencies

22:41 mefesto: can't seem to use goog.dom.query :-\

22:41 yoklov: emezeske: yeah, what _is_ the deal with deps.js?

22:41 kovasb: nathan is like, I'm outta here

22:41 mefesto: yoklov: heh i asked the samething earlier today

22:42 yoklov: i've just ignored it

22:42 it happened around when i started using cljs head

22:43 kovasb: does anyone know if the files in .lein-XX get involved in the compiler?

22:43 mefesto: yoklov: i think this is the answer: https://github.com/emezeske/lein-cljsbuild/blob/master/example-projects/simple/src-clj/example/views.clj

22:43 ^ regarding deps.js

22:43 kovasb: nice

22:43 good find

22:43 goodbye whitespace..

22:44 yoklov: wait, so if we don't do that it happens?

22:44 that is… stupid.

22:45 doesn't cljs use a single file anyway?

22:45 or at least, does anybodys not?

22:45 mefesto: yoklov: yeah when you compile in simple or advanced mode

22:45 yoklov: err

22:45 kovasb: i'd rather have multiple files

22:45 makes debugging easier

22:45 yoklov: no opts, simple opts, or advanced

22:46 it's still all one file for me

22:46 mefesto: yoklov: yeah you're right. whitespace mode just requires that extra CLOSURE_NO_DEPS declaration

22:47 kovasb: anyone know what option makes it give multiple files?

22:47 yoklov: kovasb: i dont think there is one

22:47 emezeske: kovasb, yoklov, mefesto: So, if you set :optimizations and :output-to to nil, the default multiple-output-files mode is used

22:47 If you just omit those options, lein-cljsbuild provides defaults

22:47 mefesto: ah

22:48 kovasb: sweet, i will try that

22:48 emezeske: When you turn on :whitespace optimizations, the optimizer is careful to not change any behavior, even the deps.js behavior (which is kind of silly)

22:48 yoklov: emezeske: how do i include it in my html if i don't specify an optput location

22:48 emezeske: kovasb: You don't want to do that, probably

22:48 yoklov: oh

22:48 why not?

22:48 emezeske: yoklov: Just set CLOSURE_NO_DEPS to false, and you're done

22:48 yoklov: multiple files sounds nice

22:49 not having to debug a 20k+ behemoth

22:49 emezeske: Well, I guess if you really want that, that's the way to do it

22:49 kovasb: emezeske: i want multiple files since this stale library problem is driving me crazy

22:49 emezeske: Okay, yeah, try setting {:output-to nil :output-dir "my/dir}

22:49 yoklov: stale library problem?

22:50 kovasb: emezeske: somehow when I pull in new versions of my cljs library, the old ones are getting compiled.. (this is with cljs-noir, trying cljsbuild now to see if it goes away)

22:50 mefesto: anyone able to use goog.dom/query ?

22:50 yoklov: mefesto: try just importing goog.dom

22:50 kovasb: mefesto: i just use query..

22:50 emezeske: kovasb: Why do you need multiple output files though?

22:50 mefesto: yoklov: i have but i get an error on my js console

22:50 kovasb: *jquery

22:51 emezeske: so i can quickly see which one got compiled

22:51 mefesto: chrome's js console

22:51 yoklov: i think i've had to do that before to get subpackages

22:51 emezeske: kovasb: I see.

22:51 yoklov: hm

22:52 kovasb: emezeske: do any of the .lein directories get put on the compilation path?

22:52 emezeske: one of my suspicions is that versions of files hang out in there and then get picked up by the compiler

22:53 emezeske: kovasb: Not that I'm aware of

22:53 kovasb: ok

22:57 emezeske: build spec here: http://pastebin.com/qWDWSCiv

23:00 emezeske: kovasb: I'm not certain, but I think you might want to set :optimizations nil as well

23:01 mefesto: is there anything obviously wrong with this code? https://refheap.com/paste/2390

23:02 everything works except for the call to (dom/query "p") on line 18

23:02 kovasb: emezeske: I got it to work, but with a different set of options

23:02 http://pastebin.com/hkgra8nN

23:03 emezeske: mefesto: Where does dom/query come from? I think that's maybe a third party addition to the google closure library that you don't have installed

23:03 kovasb: emezeske: I think I have an example of the ghost lib problem in this last compile

23:03 mefesto: emezeske: http://closure-library.googlecode.com/svn/docs/namespace_goog_dom.html

23:04 all the other goog.dom functions work

23:04 emezeske: mefesto: I wonder when query was added to goog.dom? The latest tagged clojurescript compiler uses a very old version of the library

23:04 kovasb: I don't think I fully understand what you mean by ghost lib problem

23:05 mefesto: emezeske: ah maybe that's it

23:06 damn, i really want that :)

23:07 emezeske: do you know if they plan to update that soon?

23:07 emezeske: mefesto: I believe it's up-to-date in HEAD

23:07 mefesto: So whenever they do the next release

23:10 mefesto: emezeske: sorry for the silly question, im a total clojurescript newb, but does lein-cljsbuild use my install of CLOJURESCRIPT_HOME for it's work or does it bundle it's own clojurescript?

23:11 aniero: should i be creating a deps.js in my cljs app?

23:12 emezeske: mefesto: Don't worry about asking silly questions. It depends on the latest tagged clojurescript release, and uses that. (So, it is pretty much bundled)

23:12 aniero: Probably you want to do something like this: https://github.com/emezeske/lein-cljsbuild/blob/master/example-projects/simple/src-clj/example/views.clj#L11

23:13 aniero: See the CLOSURE_NO_DEPS thingie

23:13 muhoo: i *almost* understand what this means, but not quite; java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to clojure.lang.IDeref

23:13 mefesto: aniero: <script>var CLOSURE_NO_DEPS=true;</script>

23:13 muhoo: i was passing in a proper bound variable (i thought), created with def. what does it want, an atom?

23:14 aniero: ahhh, thanks!

23:14 muhoo: i also tried passing in #'something that way. it hated that too.

23:15 aniero: awesome, thanks. and i got jayq's document-ready to work too

23:20 yoklov: muhoo: did you def it like (def foo)?

23:20 or should it have a value and everything

23:21 muhoo: yes

23:21 (def foo {}) , then i called this thing with foo, got that error, called it with #'foo, got same error

23:21 yoklov: well, somehow an unbound var is getting involved

23:21 hm

23:21 muhoo: macro

23:21 yoklov: mybe there's a bug in the code you're calling?

23:21 muhoo: it's a macro, i'll have to look at it more closely

23:22 the code i'm calling is a macro, that is

23:22 TimMc: dreish: Here's some show-like stuff I'm playing with: https://github.com/timmc/handy/blob/master/src/org/timmc/handy/repl.clj

23:23 muhoo: TimMc: that's very neat! i'd gotten only as far as this: https://refheap.com/paste/2391

23:23 dreish: TimMc: That looks nice. Looks like reflect just needs a wrapper like that to format the output.

23:24 TimMc: https://refheap.com/paste/2392

23:27 yoklov: haha: "finds some string in the mire of the loaded classpath"

23:30 muhoo: yeah, i just wanted to see if something was loaded or not, and what version of it, before deciding whether i needed to add it to my deps

23:30 kovasb: whew got my thing to work finally

23:30 once u go cljsbuild u don't go back

23:31 emezeske: kovasb: That's great to hear!

23:31 kovasb: emezeske: i have no idea what the problem was before, but I'm willing to attribute it to having multiple things trying to build the project

23:32 aniero: emezeske: any tips for debugging the :notify-command ?

23:32 ["growlnotify" "-m"] just dumps a help message

23:32 and using ["echo"] prints a blank line

23:34 emezeske: aniero: I don't actually work on a Mac, so I can't be too much help with growlnotify

23:34 aniero: I'd check into the man page for it (if it has one)

23:34 TimMc: $findfn #'long 'long

23:34 lazybot: []

23:34 TimMc: $findfn #'long "long"

23:35 lazybot: []

23:36 aniero: emezeske: aha, figured it out -- the example.project.clj file is missing the "%" argument, e.g. :notify-command ["growlnotify" "-m" "%"]

23:36 emezeske: or ["echo" "%" :beep true]

23:37 mefesto: for cljsbuild, the example shows in the project.clj that you can specify libs like :libs ["closure/library/third_party/closure"] ... where are these files? are they bundled and available on the classpath?

23:37 emezeske: aniero: Oh, is that how it works? :)

23:37 aniero: mefesto: i *think* those are files (that support the goog.exports stuff) that you have locally in your project

23:38 emezeske: mefesto: They will be pulled from anywhere on the classpath I beleive

23:38 aniero: emezeske: the pull request had the "%" in the config entry

23:38 emezeske: aniero: Yeah, you're right. Shows how much I've used it!

23:38 aniero: cljsbuild auto plus this notification thing is great!

23:39 emezeske: :)

23:39 aniero: means i don't have to switch over to my terminal all the time

23:39 emezeske: Yeah, that is cool

23:40 aniero: I fixed the docs, thanks for catching that

23:41 aniero: cool, yw

23:49 mefesto: emezeske: looks like goog.dom.query is defined in a third party library like you (or someone else?) said. it's in closure/library/third_party/closure/goog/dojo/dom/query.js ... how can i be sure that im including this file in my lein-cljsbuild project?

23:49 does :libs ["closure/library/third_party/closure"] include all files under that directory?

Logging service provided by n01se.net