#clojure logs

2012-12-29

00:00bbloomtpope: i have a very deep map in an editor and it's kinda funny to hold j and watch the cursor slow down as the tree depth increases
00:00bbloompresumably that stops getting slower at 100 levels or something
00:01tpopebbloom: just like scrolling through a buffer?
00:01bbloomyeah
00:02tpopeI've seen the syntax highlighting get pretty slow just browsing clojure.core
00:02bbloomi assume it has to do with brace matching
00:02bbloomyup
00:04tpopeyeah that's my guess too
00:04tpopeI don't know what state the static runtime files are in
00:05tpopeI think guns annoyed meikel even more than I did
00:06bbloomheh. creation is messy
00:31technomancybbloom: https://github.com/trptcolin/reply/issues/94 <- looks like it's fixed
00:32bbloomtechnomancy: awesome! thanks to you and trptcolin
00:32Raynestechnomancy: You should rewrite clojars with laser.
00:33RaynesIt's super important to everybody on Mars.
00:33technomancyRaynes: including Ziggy Stardust?
00:33RaynesEspecially him.
00:33technomancyI'll get right on it.
00:33technomancyI actually started yak-shaving an elisp interface to github issues
00:34technomancybut I got foiled by the fact that the elisp equivalent to tentacles uses a port of CLOS and doesn't support pagination
00:34technomancyby "a port of CLOS" I mean "a very annoying port of CLOS"
00:34callentechnomancy: you could make a little clojure daemon that talked to a dumb text-mode interface in elisp.
00:35technomancycallen: yeah, or there's already a ruby gem for it I could shell out to
00:35callentechnomancy: if you want to be unfun. I can see heroku is infecting your brain.
00:35technomancycallen: if it were I'd be using the ruby lib =P
00:35callentechnomancy: it's been your plot all along to replace clojuredocs with another Ruby app, hasn't it?
00:36callen~guards
00:36technomancyanyway the github API lib is by the guy who maintains Magit, so you know it's going to be decent
00:36callen$guards
00:36lazybotSEIZE HIM!
00:36callenI designed a little helper for magit.
00:36callentechnomancy: http://blog.bitemyapp.com/2012/03/05/magit-cheat-sheet.html
00:36hyPiRion$gourds
00:36hyPiRionoh no.
00:37technomancynice
00:37technomancya friend of mine did the screencast, but that was in like 08 or so
00:37callentechnomancy: I made it so I could quick-check the cheat sheet and refer to it when teaching people.
00:37technomancycallen: I was looking for a specific command and was all "where is this?" and then I realized, oh yeah, this is qwerty.
00:37callentechnomancy: I've been trying to be the Johnny Appleseed of converting people to Emacs+Magit+Clojure
00:38technomancydelicious
00:38Raynes~gourds
00:39Raynesy u no clojurebot
00:39hyPiRionRaynes: exactly the problem
00:39callentechnomancy: I've actually been considering expanding that cheat-sheet to include more commands as my appreciation of magit has improved.
00:39technomancycallen: dvorak edition plz
00:39Raynescallen: That cheat sheet is awesome. You're a good person for this one particular thing.
00:40RaynesAlso, ew, dvorak.
00:40Raynesqwerty plx
00:40callenDvorak is for aspies >:<
00:40RaynesAspies don't exist anymore.
00:40callenRaynes: you'll change your mind soon enough.
00:40Raynes$google aspergers is no longer a diagnosis
00:40lazybot[It's official: 'Asperger's syndrome' is no longer a thing] http://io9.com/5965524/its-official-aspergers-syndrome-is-no-longer-a-thing
00:41technomancypoof--everyone who had asperger's has vanished
00:41callenhoo, he's a muggle.
00:41wingydatomic users i need u .. how do i query schema attribute definitions?
00:41technomancyso I don't actually use clojure-test-mode's jump-between-test-and-src
00:41technomancycan someone tell me if I should merge this? https://github.com/technomancy/clojure-mode/pull/105
00:42Raynestechnomancy: Indeed.
00:42callentechnomancy: go for maximum open source troll and kick it back to him saying you want unit tests proving the PR works.
00:42technomancyintegration tests!
00:43callenunit, functional, integration, sexual, whatever.
00:43technomancyI'm sending 'em after you if anyone comes complaining
00:43bbloomtechnomancy: you might actually be capable of answer this question for me: http://stackoverflow.com/questions/14079002/topological-order-for-a-dependency-subgraph
00:43callentechnomancy: send them after Raynes.
00:43callenI'm the one that said to ask for tests.
00:44RaynesI write tests.
00:44RaynesSometimes.
00:44technomancybbloom: I'm just riding the wave of aether; I didn't get to write any of the fun algorithmic dependency graph code in lein =\
00:44hyPiRionI don't like to call them tests
00:44hyPiRionguardrails is a more suitable name
00:44callenRaynes: I write tests when I'm about to frame somebody for breaking something.
00:44bbloomtechnomancy: blast.
00:45callenhyPiRion: you call them guardrails because TDD is like driving a car by banging into the guard rails the whole way home.
00:45bbloomtechnomancy: would you have any guidance where in aether to look?
00:45Raynescallen: Oh man, I love that description of tdd.
00:45Raynescallen: If I did TDD, I would never get any actual code written. I can't think that far ahead.
00:45technomancybbloom: actually I'm even wimpier than that; I use the clojure wrapper around aether.
00:46technomancycemerick or xeqi might know
00:46bbloomtechnomancy: damn you and your pragmatism
00:46technomancybbloom: no code is better than no code
00:46bbloomi'm on sabbatical, i don't have any need to be pragmatic!
00:46hyPiRioncallen: Well, I don't do TDD though. I just write guardrails to ensure I've not put up some off-by-one error or something similar in my code
00:47callenhyPiRion: I do the same thing, but that's not TDD.
00:47bbloomi've been manually toposorting, but now i have about 15 passes and it's getting to the point that i've got comments that document the ordering just for my own sanity, lol
00:47callenhyPiRion: I was simply launching off your comment so I could instigate a 5 minutes of hate.
00:47hyPiRionIt's not for testing the semantics, it's for testing that I haven't made a small fuckup
00:47hyPiRionheh
00:47callenRaynes: there's am infamous anecdote where a relatively famous TDD/agile 'consultant' attempted to use TDD to implement a sudoku solver in Ruby. After a couple months and like 10 blog posts he utterly failed to implement a working solver.
00:48Raynescallen: You or someone told me of this.
00:48tpopeI want names
00:48callenRaynes: it's *particularly* funny because Norvig had a little "dynamic programming" tutorial for writing a sudoku solver in Python up on his site for the last decade.
00:48RaynesWasn't it something to do with the Lisp guy turned Python guy?
00:48RaynesYes, Norvig.
00:48callenRaynes: aka director of research at Google
00:48callenRaynes: his background was in AI, he was why I learned CL.
00:49hyPiRioncallen, Raynes: http://xprogramming.com/xpmag/sudoku5
00:49bbloomtl;dr version: http://ravimohan.blogspot.com/2007/04/learning-from-sudoku-solvers.html
00:49RaynesHow much work do I have to do in your class, professor Allen?
00:49callenRaynes: what?
00:50Rayneswhoosh
00:50tpoperon jeffries
00:50callenRaynes: obviously whoosh but please explain?
00:50bbloomyeah, his series of sudoku articles is like watching the ravings of a mad man
00:50Raynescallen: You just gave me a brief history lesson.
00:51bbloomcompare to dnolen's solver: https://gist.github.com/3217582
00:51bbloomRaynes: you should read norvig's book
00:51bbloomnorvig is awesome
00:51RaynesNo I should not.
00:51callenchrist @ dnolen's solver
00:51bbloomRaynes: http://aima.cs.berkeley.edu/
00:51RaynesI've got a very long list of books I should read.
00:52bbloomthat AI book should be on everyone's list :-)
00:52RaynesI haven't read a book since I read The Joy of Clojure.
00:52bbloomcallen: yeah, it's pretty awesome
00:53callenRaynes: re: history lesson - I'm like that IRL too.
00:53RaynesYou can't be nearly as obnoxious in real life as you are on IRC. Surely someone would have punched you in the face and broken your hands thus preventing you from typing.
00:53callenyogthos: (var ...) wrappers for handlers/apps in luminus, how does that compare with #'? Any conscious decision there?
00:53Raynes<3
00:54callenRaynes: I run tech at a startup, I'm every bit as obnoxious as you imagine.
00:54yogthoscallen: hey uhm I didn't really consider one over the other, is there pros cons?
00:54bbloomcallen: as a fellow obnoxious fellow, may i suggest being slightly less proud of it
00:54callenyogthos: that's what I was asking you!
00:55callenbbloom: only half serious, I'm a very warm and pleasant person IRL, but I do tend to come off as a bit of a know-it-all because I really like sharing things like that exposition about Norvig.
00:55Raynescallen: I think that (var ..) might make more immediate sense to someone new to Clojure, which is what luminus is designed for.
00:55callenbbloom: I'm from the midwest, I'm not capable of being an asshole to anyone's face.
00:55Raynesyogthos: ^
00:55yogthosRaynes: oh that'll do it?
00:55callenRaynes: that's mostly what I was pondering. I was doing it the 'clever' way.
00:56Raynesyogthos: ?
00:56Raynesdoes not compute
00:56bbloomcallen: I'm from NY, so I'm quite capable of being an asshole to anyone's face.... let me assure you, from a place of experience, being a proud asshole has significant career implications
00:56yogthosRaynes: thought you meant ^ in relation to var vs #' :)
00:56dnolenbbloom: callen: and it even looks like some sudoku problems are competitive w/ CiaoProlog which has a big head start on all-distinct constraints :)
00:56Raynesbbloom: It has come to my attention that you are incapable of ever being wrong.
00:57callensince when is clojure.org Wikispaces?
00:57dnolenbbloom: callen: haven't even really taken the CLP optimization stuff seriously yet.
00:57Raynescallen: Since forever.
00:57callendnolen: yeah well, bravo man. I'm going to abusing that gist as Pro-Clojure propaganda.
00:57bbloomRaynes: i'm wrong plenty, but just for *very short periods of time*. one thing i've needed to learn to do is to let people gloat for longer when i admit that they are right
00:58callendnolen: ala: http://www.youtube.com/watch?v=WyvbFMGmImg
00:58Raynesbbloom: I've tried to have arguments with you. Mostly just get tired and give up.
00:58Raynes:p
00:58callenoh he must be my clone then.
00:58bbloomRaynes: oh, that has nothing to do with me being right or wrong... that's stamina baby.
00:59callenYeah I'm indefatigable too. Learned it from my parents.
00:59yogthoscallen: ah so looks like #' is just a shortcut for var
00:59callenyogthos: yeah, stick with var
01:00bbloomi literally have practiced this series of phrases: "oh, i had not considered X. you are correct about Y. i was incorrect about Z. thank you for making point X. you have changed my opinion from Z to Y"
01:00callenyogthos: the django scaffolding is heavily commented inline for the sake of pedagogy. I think something similar (maybe slightly less verbose) would be really nice for Luminus.
01:00callenbbloom: LW?
01:00yogthoscallen: yeah that's not a bad idea
01:00bbloomcallen: i have no idea what that acronym means
01:00jkkramer#' is more common in the wild than var for what it's worth
01:00yogthoscallen: useful AND eduactional :)
01:01dnolencallen: it's a neat example, but hopefully we come up w/ some more real world useful constraint problems.
01:01callenjkkramer: I don't think #' as long as it comes with an explanation.
01:01yogthosjkkramer: so might as well switch it to look idiomatic and put that it just makes a var in a comment then :)
01:01Raynescallen: We are apparently fine together as long as we don't talk about templating.
01:01callenyogthos: I just said the same thing, haha.
01:01callenRaynes: I ended up settling on a compromise for that anyway.
01:01Raynescallen: Also, you told somebody that laser focuses more on tree traversal and such than enlive. What did you mean?
01:02RaynesI plan to support real css selectors in a future version.
01:02callenRaynes: you're not, AFAICT, focusing on diving into the thick of it with CSS selectors.
01:02RaynesAs a function.
01:02callenRaynes: well that's fine but you had me read your code not your mind.
01:02callenyou asked me to read the laser code. All I know is what I saw.
01:02callenso then I became the resident laser expert whenever you were gone, which is unfortunate because I'll never use it.
01:03callenI can pass the baton to somebody else if they want to be Raynes' parrot.
01:03Raynescallen: I... didn't mean anything by that.
01:03RaynesIt's fine that you said that.
01:03RaynesI was just saying.
01:03RaynesYou can be the resident laser expert while I'm away. I was just curious on what you meant.
01:03RaynesThanks for saying it is simpler than enlive though.
01:03callenRaynes: I didn't take any offense, I was just clearing up the reasons for what I said.
01:04RaynesI'm going to write a great big fun tutorial for it like I did for tentacles soon. Something Enlive does not have.
01:04Raynesdnolen: Speaking of which, you wrote an enlive tutorial once. You should look at laser some time and see what you think.
01:04yogthosRaynes: cool stuff :)
01:04callentechnically dnolen has a tutorial from awhile back.
01:04callenit's comprehensive.
01:04RaynesI never liked his tutorial very much.
01:04callenit's the one I did to understand Enlive.
01:05dnolenRaynes: my brain is so saturated w/ Clojure projects I'm not sure I can look at anything more :) instead I just chat on #clojure.
01:05RaynesI unfortunately came away from that tutorial more confused than when I started.
01:05RaynesI don't think it was necessarily because of his writing or anything.
01:05RaynesIt was just that Enlive was such a weird concept and strangely implemented.
01:05dnolenRaynes: I will try to check it out more closely. The repo description looked interesting.
01:06Raynesdnolen: Excellent. Also, yes, my head hurts frequently with the pain of a zillion parentheses beating at its edges.
01:06yogthosRaynes: yeah enlive is... different ;) I can definitely grok laser a lot easier :)
01:08Raynesyogthos: Great to hear, that's what I'm going for.
01:08callenyogthos: what are you using bultitude for anyway?
01:09callenThe problem with Enlive is that some really smart people who don't remember what feeling confused feels like wrote it.
01:09callenyogthos: I get that it has something to do with namespaces, beyond that, don't know the speicifics.
01:09yogthoscallen: to resolve if wrap-reload is present
01:09RaynesI was originally just going to rewrite parts of Enlive, but gave up after about 5 minutes of browsing the source code.
01:09yogthoscallen: so if you run in dev profile stuff reloads magically :)
01:10callenRaynes: i kno rite.
01:10dnolenRaynes: my favorite part about your repo is it says Enlive is too big at 800 LOC.
01:10Raynesdnolen: It's actually over 900 loc. I need to point that out.
01:10ibdknoxlol
01:11callendnolen: Clojurians have high standards for low amounts of code.
01:11ibdknoxyou can do a lot in 1000 lines of Clojure
01:11callenlow quantities.
01:11yogthosindeed
01:11yogthosI was talking about that with a friend at work the other day, back when we did java 100 lines meant you were just getting warmed up :)
01:11yogthosnow 100 lines is a heck of a lot of code :P
01:12callenyogthos: to be fair, Java code is kinda sparse.
01:12callen} is a line.
01:12yogthoscallen: true, but it's also very inexpressive :)
01:12yogthoscallen: which compounds the problem
01:12callenno doubt, just trying to be intellectually honest :)
01:12dnolencase in point, I was telling people it would take 500-600 lines of Clojure to do source map merging. 174.
01:12dnolenI did waste a week on it though.
01:12callendnolen: wait does that mean source maps is working in CLJS now?
01:12RaynesWhoa?
01:12dnolencallen: no, just talking about the logic for merging source maps.
01:13RaynesAw.
01:13callendammit.
01:13RaynesI might actually use cljs if it had source maps.
01:13RaynesRight now I'd much rather burn the servers it is hosted on.
01:13dnolencallen: emitter needs to be fixed, probably a couple of weeks of work.
01:13dnolencallen: waiting on 1.5.0 to merge source-map branch, and waiting on blind to become a contrib.
01:13bbloomdnolen: we'll definite need to get together and pair on it or something in february
01:14callenbbloom: are you in NYC?
01:14bbloomwill be in feb
01:14dnolenbbloom: yeah!
01:15callenwhy are the cool people always on the opposite coast of me?
01:15callenwhen I was in NYC, I didn't know any nice people :|
01:16bbloomcallen: i'm in seattle now, so you can take solace in the fact that your coast is 1 brandon unit cooler for at least a little while
01:16yogthosoh btw just remembered this exists :) https://github.com/liquidz/misaki
01:16Raynesbbloom: Yeah, but I'm moving to the west coast in a month. I'll replace you ten-fold.
01:16yogthoskinda hiccupy
01:17callenbbloom: I'm in the bay area with a few other clojurians. Only corfield is really active with the community though.
01:17bbloomRaynes: it's true. you're like at least 2^10 brandon units
01:17RaynesNice of you to recognize my level of awesome.
01:18callenyogthos: is :gen-class for bultitude or something else?
01:18yogthoscallen: it's for it to be runnable, when you make a jar or a war there needs to be java byte code to run
01:18RaynesWhat does gen-class have to do with bultitude?
01:18yogthosnothing at all :)
01:18callenI don't know, I'm asking know-nothing questions so I can identify what needs documented.
01:19RaynesDidn't think so.
01:19callenthere's a lot of room for cargo cult in the luminus template still and I'm trying to figure out what I need to add comments for.
01:19tpopenyc :)
01:19callenyogthos: you don't need it outside of the server namespace, right?
01:19yogthoscallen: nope, it propagates
01:19yogthoscallen: which also means that you never ever want to use it in a library :)
01:20yogthosor it'll statically link everything and going to be dependent on that version of java/clojure
01:20RaynesI guess I should actually look at luminus one day.
01:21yogthosRaynes: :)
01:21Raynesyogthos would hate me if I did a code review.
01:21RaynesHe submitted like 30 lines of code to lib-noir and got like 10 comments.
01:21yogthosRaynes: lol you should, it's nice to have a second pair of eyes on it ;)
01:21RaynesI've suddenly become amalloy.
01:21yogthosRaynes: I know you'll hate all the trailing spaces though :P
01:22callenyogthos: is there some reason you need gen-class that lein uberjar doesn't take care of?
01:22Raynesyogthos: What editor do you use? You screwed up indentation all over the place but I didn't care enough to ask you to fix it.
01:22yogthosRaynes: eclipse (shame) :P
01:22callenoh that's why your whitespace makes no fucking sense
01:22callenit's those middle-of-nowhere misclicks
01:22yogthos:)
01:22RaynesHahaha
01:23yogthosI use the paredit mode in ccw, but yeah it spits some interesting stuff out sometimes ;)
01:23Raynesyogthos: I wanted you to put the request middleware in noir.request.
01:23callenyogthos: uberjar vs. gen-class? Anything I'm missing there?
01:23RaynesNot just the *request* var, :p
01:23yogthosRaynes: ah lol next refactor :)
01:23yogthosRaynes: although I kinda like having all middleware in one spot too
01:23Raynesyogthos: Yeah, but you don't.
01:23Raynesyogthos: stateful sessions, cookies, etc.
01:23RaynesAll of those are separate.
01:24yogthoscallen: I think you need gen-class for uberjar to work
01:24RaynesValidation too.
01:24callenyogthos: these questions are so that the docs can be more cogent.
01:24yogthosRaynes: yeah that's a good point actually
01:24yogthosRaynes: come to think of it that's how the rest of it is structured too :)
01:25yogthosRaynes: I'll clean it up
01:26Raynesyogthos: Regarding indentation, https://github.com/noir-clojure/lib-noir/blob/master/src/noir/util/middleware.clj#L70 is what I was talking about. Each argument should be lined up together. Of course, cemerick disagrees and thinks everything should be indented precisely like this (because he uses Eclipse, obviously). It isn't a huge deal though, so don't worry about fixing it if this is how Eclipse inden
01:26Raynests it. No sense in having to manually indent it just to please my sensibilities.
01:27RaynesI could fix it in Emacs if I really cared with a few keystrokes.
01:27RaynesBut if I didn't berate you about something, I'd have nothing to live for.
01:27yogthosRaynes: yeah I hate that about ccw, it indents those wrong
01:27yogthosRaynes: haha
01:27yogthosRaynes: now I'm holding out for LT :)
01:27ibdknoxdamn right!
01:27ibdknoxand shit I missed dnolen
01:27yogthoshehe
01:28Raynesibdknox, yogthos: Codemirror is amazingly correct with Clojure indentation.
01:28ibdknoxI've been fixing it
01:28RaynesIt can even reindent regions of text for you!
01:28Raynesibdknox: I've fixed it a bit myself, IIRC.
01:28yogthosibdknox: good to hear, what about paredit mode though? :)
01:28yogthosibdknox: it's like a drug once you start using it :)
01:29ibdknoxif someone looked at subpar and made it faster...
01:29RaynesI'm surprised nobody has done it yet.
01:29Bergle_1noob question.. what is subpar ?
01:29Raynes$google subpar codemirror
01:29lazybot[Subpar for CodeMirror to get paredit / strict mode (Feature request ...] https://github.com/Kodowa/Light-Table-Playground/issues/223
01:29ibdknoxme too actually
01:29Bergle_1ahh nice
01:30RaynesLight table's code editor is a separate entirely independant project from light table. Codemirror is open source and well designed with a smart, nice maintainer.
01:30RaynesIt's also the editor on refheap.
01:30callenoh that's why the editor on refheap is so nice.
01:30yogthosyeah codemirror is fantastic stuff
01:30RaynesIt's easy to extend. It's probably the most like Emacs of all the javascript editors in that it is super easy to extend, in fact.
01:31ibdknoxit's getting better
01:31RaynesAnd the lexers are written in a real language instead of bloody XML.
01:31yogthoslol it's such a tragedy they dropped scheme syntax in js back in the day
01:31ibdknoxI contracted him to do some really really good stuff for it
01:31yogthoswhat could've been :)
01:31RaynesI hate sublime text 2 more every day.
01:31ibdknoxlike separating the text model
01:31Raynesibdknox: You've paid him to work on it? Do you know how awesome that makes you?
01:32ibdknox:)
01:32RaynesWhat stuff is he going to do, or is it top secret?
01:33RaynesIt has those.
01:33RaynesTo some extent.
01:33yogthoscallen: mmm docs! :)
01:33Raynescallen: Yey, you like refheap's editor? :D
01:33n_bthe problem with 'to some extent' is that it messes with muscle memory
01:33bbloomno one can ever get vim bindings right
01:33Raynesn_b: I use evil-mode in Emacs. I wish there was something like it for every editor.
01:33Raynesbbloom: I think evil-mode does.
01:33callenyogthos: I'm not a machine like some people, but I do have a measure of passion for documentation.
01:34Raynesevil-mode is an amazing work of Emacs art.
01:34bbloomRaynes: i am extremely skeptical.... but maybe someday ill try it
01:34RaynesDo it.
01:34bbloomvim-foreplay means i dont have to bother :-P
01:34callenRaynes: yeah Refheap's editor is the only pastebin that hasn't utterly pissed me off when fiddling with Clojure code
01:34yogthoscallen: that works out, I'm kinda bad about documenting :P
01:34callenRaynes: it's no Emacs, but I don't expect it to be.
01:34callenRaynes: I like the default styling and theme too.
01:34bbloomi have NO IDEA what caliber any paste bin's text editor is
01:34bbloomi have never ever done anything other than paste into one
01:35bbloomyou guys actually edit stuff in your browser, ever?
01:35n_binc bbloom
01:35Raynescallen: Yeah, it has lots of little goodies as keyboard shortcuts and stuff. Like shift+tab reindents selected text.
01:35callenbbloom: I tinker inside of them when demo'ing sometimes.
01:35Raynesbbloom: I've done it once and thanked God I had added codemirror to refheap.
01:35n_bonly thing I edit in browser is tiny markdown edits
01:35Raynescallen: The theme is tomorrow-night. I wrote a theme based on it for both codemirror and pygments, so they differ only slightly most of the time.
01:35n_banything else is unbearable and ends up with jjd2wi and such all over
01:36bbloomanyway, ibdknox knows that i'm going to report about 398563853 vim binding bugs whenever i get around to trying light table for something significant :-)
01:36ibdknoxbbloom: pfft, I built an IDE in a browser ;)
01:36RaynesUnfortunately can't make the code in the editor look exactly the same as the pasted code, but it's close enough.
01:36ibdknoxoh good :p
01:36RaynesMy codemirror tomorrow-night theme is now included with light table cause ibdknox loves me.
01:36bbloomibdknox: and then you promptly boxed it up in an osx frame
01:36ibdknoxyeah
01:36ibdknoxfucking keybindings
01:36ibdknoxthat was the main problem actually
01:36callenyogthos: common.clj seems okay, but I'm going to admit upfront that while I've seen it a lot, I hate that nomenclature.
01:37Raynesibdknox: Congrats on building a web-app-pretending-to-be-native that doesn't suck. Like that new inky thing.
01:37callenyogthos: I prefer to have a common function inside of a file named views.clj
01:37callenRaynes: any thoughts here?
01:37ibdknoxRaynes: inky sucks?
01:37yogthoscallen: haha yeah I'm pretty much inheriting that from noir :)
01:37callenI find common.clj to be a bit generic for something that's explicitly about views/templating
01:37callenI don't see anything wrong with views/common though.
01:37ibdknoxviews/common was my fault ;)
01:37Raynescallen: I put common stuff in common.clj in refheap.
01:38yogthoshaha
01:38RaynesNot sure what you're saying is bad.
01:38callenokay so one point of order
01:38ibdknoxyou often have multiple layouts, so a single common function didn't work for me
01:38callenhrm, yeah, one moment.
01:38Raynescallen: I have views/common.clj. You mean just a random common.clj sitting at the top-level of the directory hierarchy?
01:38callenRaynes: yes I'm checking the final template right now.
01:39yogthosif we're going to refactor that the time is now :P
01:39callenyogthos: okay yes it's at the top level
01:39callenyogthos: so I'm going to ask for a refactor, I'll propose a few ideas
01:39Raynesibdknox: Inky is slow and screams web app in my face. It also totally doesn't work on OS X for me. I'm going to keep an eye on it though because the guy who made it made some of my favorite childhood video games (Crash Bandicoot 1 and 2).
01:39callenyogthos: views directory, common.clj file, views.clj file at the top level...
01:39ibdknoxRaynes: oh cool. Crash was awesome
01:39callenyogthos: any opinions?
01:40callenRaynes: dude. I loved Crash Bandicoot.
01:40n_band the guy who did ITA
01:40callenRaynes: the death animations were hilarious.
01:40Raynescallen: Yeah man, it rocked.
01:40n_bwhich is cooler, depending on your viewpoint/love of platformers
01:40yogthoscallen: hmm it feels a bit different with compojure, because it's all around routes now as opposed to views
01:40Raynesibdknox: Note that it does work well on Windows for me. Still slow and too web appy, but it actually works and works pretty well for a pre-alpha sort of thing.
01:41ibdknoxwhat does pre-alpha mean?
01:41callenyogthos: you can put it that way if you want, but there's always going to HTML or something generating HTML somewhere
01:41ibdknoxlol
01:41callenyogthos: you're not going to have "logic-less" anything with Hiccup, which is fine, but the nomenclature here would be views as opposed to templates.
01:41Raynesibdknox: Means he didn't mean for it to get out in the open yet.
01:41yogthoscallen: but I guess conceptually it's sort of the same thing, so maybe views/ is not bad
01:41n_bcompojure is the new hotness right?
01:41ibdknoxRaynes: ah
01:41Raynesibdknox: So it's pretty much supposed to be completely broken. :p
01:41callenyogthos: if it's code generating the HTML frontend and there's no templates they're the views.
01:41n_bBuilding my first Clojure web-app tomorrow, wasn't sure whether noir or compojure was the way to go
01:41Raynesn_b: It isn't new, but it's what we recommend now.
01:41n_bI saw Noir was deprecated but batteries aspect is appealing
01:42callenyogthos: I like views/common.clj, is that what you're thinking of?
01:42yogthoscallen: ok sure
01:42Raynesn_b: Noir is deprecated. Go Compojure and lib-noir (if lib-noir contains things you want, which it likely does).
01:42callenn_b: use luminus!
01:42Raynesn_b: Check out luminus.
01:42callenyogthos: want a PR, or do you want to do it?
01:42Raynesyogthos is here and can answer questions about it if necessary.
01:42yogthoscallen: then maybe can refactor the handler to get rid of the home view from it and move it to views/home.cj
01:42yogthoscallen: home.clj that is
01:42callenyogthos: that would be supremely ideal.
01:42callenyogthos: that's how I structured my independent template I made a week or two ago.
01:43yogthoscallen: ok this is taking shape, handler will have all the base routes for serving static content and not-found and then all the actual page routes will live in namespaces underviews
01:43callenyogthos: seems to make sense to me.
01:43yogthosn_b: http://luminusweb.net
01:44n_bChecking it out
01:44yogthoscallen: awesome, want to do a pull? :P
01:44callena PR?
01:44callenyeah I can, h/o
01:44yogthossweet
01:44RaynesOkay guys. /me is vanishing for a while
01:44RaynesNice discussions. I <3 you all.
01:44yogthosg'night ;)
01:45n_boh, and if I wanted to run tasks on a schedule, uberjar up a clojure app and run that via cron?
01:45DeeceDoes anyone else use VimClojure? I have my nailgun server running, but it seems to have stopped working in vim - if I run :sr I get "pattern not found: client"
01:45RaynesI'm not going to bed. Playing Far Cry 2. It is Friday after all.
01:45n_bDeece: Did you try restarting ng-server?
01:45ibdknoxRaynes: that's prime working time!
01:45yogthosn_b: yeah that's probably the easiest, or you can put a while loop in your main with a Thread/sleep
01:45callenRaynes: Have fun
01:45ibdknoxRaynes: you must be some kid or something... playing games hah ;)
01:45callenibdknox: yeah it is for me too. My prime time is from about 8 or 9 pm until 4 am.
01:46callenibdknox: hey I play vidya too :(
01:46n_byogthos: Sounds like a solid architectural decision
01:46yogthoslol speaking of games anybody play sc2 around here? :)
01:46n_bWhat could go wrong?
01:46ibdknoxI was just giving him a hard time
01:46yogthosn_b: :P
01:46callenyogthos: ...yes...I'm so awful at it though.
01:46callenibdknox: I knows it.
01:46ibdknoxyogthos: used to
01:46callenyogthos: I was gold league when I played.
01:46ibdknoxgot bored with it
01:46yogthosI go on and off with it :)
01:46yogthoscallen: gold is not bad, I'm down to that now playing randoms :)
01:46Raynesibdknox: Dude. I've written a wrapper for a markdown parser, a replacement for enlive, helped yogthos merge lib-luminus with lib-noir, and merged pull requests on tentacles this week.
01:46ibdknoxI don't seem to enjoy competitive games much anymore
01:47RaynesOff my back.
01:47callenyogthos: okay, what's the future of the models directory?
01:47yogthosRaynes: you're a machine dude :P
01:47ibdknoxRaynes: FINE.
01:47callenyogthos: that's partly why I never ranked up, I avoided fighting randos and mostly practiced with friends.
01:47yogthoscallen: could axe it from the base template, since db templates will add it anyways
01:47Deecen_b: yep, it's running and i can telnet to the nailgun server.
01:47callenyogthos: k, killing it in this PR.
01:47yogthoscallen: I tend to play teams 3v3s is my thing :)
01:47abaranoskyRaynes: are you bragging ? ;)
01:48n_bDeece: It gets stuck sometimes - what happens if you kill your vim session, restart ng, then reopen vim?
01:48ibdknoxI think 0.3 might be an experience focused released
01:48Raynesabaranosky: Don't have to brag when you're obviously this awesome.
01:48RaynesOkay, leaving for real this time.
01:48Rayneslatrs
01:48ibdknoxabaranosky: I'm about to shoot an email to the list
01:48abaranoskyRaynes: nice :D
01:48abaranoskyibdknox: great
01:49yogthosciao
01:49ibdknoxEveryone currently in here, abaranosky is going to take over Korma and make it awesome :D
01:49yogthosoh awesome news :)
01:49abaranoskyI may be dating myself, but Age of Empires 2 is the only video game I ever play
01:49callenabaranosky: oh ho ho, ibdknox made it official. Does this mean I can bug the ever-loving shit out of you now?
01:49yogthosI've been doing rts since dune 2 :)
01:49callenI HAVE FEATURE REKWESTS.
01:49ibdknoxabaranosky: dude
01:50ibdknoxabaranosky: I played so much AoE
01:50callenAoE2 was one of the best RTSs.
01:50abaranoskycallen: yes
01:50yogthosaoe2 was pretty fun
01:50abaranoskywe play at work almost everyday
01:50callenabaranosky: #1: can you get the many-to-many from incubator mature and into core?
01:50abaranoskyI used to play years ago, then they got me back into it
01:51callenI find AoE2 is better for casual playing with coworkers and friends than SC or SC2
01:51callenStarCraft is too blood-thirsty.
01:51abaranoskycallen: my plan is to approach the easy things first, and cull the giant pile of issues and pull requests
01:51callenabaranosky: as thou wilt, just making my hearts desires known.
01:51abaranoskycallen: alongt he way think about what the best way to handle some of the more interesting changes
01:51Deecen_b: My vim seems to be connecting to the ng server now, but i still get odd errors. if i run :sr, I see "pattern not found: usr"
01:51yogthoscallen: btw you also have to update the handler.clj to reference the views now ;)
01:52n_blet me boot up ng, sec
01:52callenyogthos: yeah yeah, I'm using the retarded github editor, sorry, h/o
01:52callentoo lazy to use my fork.
01:52n_bohh
01:52yogthoslol
01:52abaranoskycallen: plus I'm still gettin gmore familiar with things
01:52n_byou're not hitting leader
01:52callenI'll use my fork after I finish the handler fix.
01:52n_bDeece: What's your <LocalLeader> set to?
01:53abaranoskycallen: if you're interested in something please do make it known on the relevant issue on the project GitHub (if you haven't already)
01:53tpopevimclojure D:
01:53Deecen_b: I think it might not be set.
01:54callenabaranosky: given how I've been spamming yogthos tonight, that may not be a great idea.
01:54tpopeI don't wanna be "that guy," but foreplay.vim will totally save you a ton of headache
01:54n_btpope: tbh I still haven't switched. Not in lov e with the way the REPL works in foreplay
01:54callenI don't wanna be "that yak", but you should be using Emacs anyway.
01:54n_b(popcorn)
01:55Deececallen: maybe so, but my muscle memory is what it is ;)
01:55yogthoscallen: lol
01:55n_bDeece: let mapleader = "," then try ,sr in normal mode
01:56yogthoscallen: ok I might as well add home.clj
01:56tpopeI'm of course open to ideas, as long as that idea isn't copy what vimclojure does
01:57DeeceI'm gonna give foreplay a go - vimclojure was working before after meticulous setup and now it's just broken -_-
01:57callenI suddenly have the perverse impulse to be exhibitionist and show a non-Emacs user my dotfiles repo.
01:57n_bI agree the vc way is terribly flawed and ultimately unfixable, but the manner in which I work meshes with it more than using the command-line
01:58n_bsince I end up using it as a scratchpad buffer with (comment) and do a bunch of terrible stuff
01:58tpopescratchpad buffer with vimclojure?
01:58tpopeor with foreplay?
01:58n_bwith vc
01:59tpopeyou can totally edit scratch.clj in foreplay
01:59tpopethat's bbloom's preferred method
01:59n_ber, I mean I use the repl as my scratchpad and a REPL
01:59callenyogthos: k, I have the remotes set for my fork. Are you doing the home.clj refactor?
01:59n_bit's a dumb way of working, but it's how I got started with 4clojure and the habit has yet to be broken
01:59ibdknoxI dunno that you want to mimic bbloom, I'm fairly certain he's legit crazy. ;)
01:59callenyogthos: I have some alternative thoughts there, possibly.
02:00yogthoscallen: yeah it's in progress :)
02:00yogthoscallen: what you thinkng?
02:00callenyogthos: it might be sacrilege, but I have controllers.clj that call out to the views. Any route-specific logic is handled in the controller.
02:01tpopen_b: I mean you can use scratch.clj as a makeshift repl. press cpp on the forms you want to eval
02:01yogthoscallen: that's sort of what handler does already though no?
02:01callenyogthos: I think so.
02:01Deecewell foreplay just worked out of the box after half a hour of trying to fix vimclojure so
02:01Deecetpope: i am indebted
02:01n_btpope: I understand that, know I should switch, and just have yet to make the jump
02:01callenyogthos: part of this is me reconciling in my head my template with yours.
02:01yogthoscallen: it's pretty small as is, I'm not sure it's worth adding another namespace with only a few functions
02:01callenyogthos: no no, I agree. If that's your intent for handler that makes sense.
02:02tpopewell that's your prerogative
02:02callenyogthos: handlers as far as nomenclature goes will come with less mental baggage than controllers.
02:02yogthoscallen: I'm thinking handler takes care of the core application, and then each view has its routes and those get included in all-routes
02:02callenokay that's the part I'm confused by
02:02callenwhy would the views know anything about the routes?
02:02tpopeDeece: number one reason I wrote foreplay was that vimclojure was way too fickle
02:02callenAFAIK views would just be functions called by handlers, pointed to by server.clj
02:03yogthoscallen: I'm thinking that you'd want to keep related stuff together, for example say you have auth view
02:03yogthoscallen: so you'd have registration, login, logout, etc
02:03yogthoscallen: all of those are related, so I'd make auth-routes for them and keep them in that namespace
02:03callenyogthos: my point is keeping views isolated from server.clj/routes
02:03callenyogthos: those only point to controllers/handlers
02:03callenviews are only utilized by controllers/handlers.
02:04callenso sure, you might have views/auth.clj
02:04callenwhich has a login page, a profile page, whatever
02:04callenbut the routes/server.clj know nothing of it, only the handlers/controllers concern themselves with it.
02:04yogthoscallen: but then you'll end up jumping between that and the handler a lot as you add remove them when you're developing
02:05callenI don't see it, myself, as I've worked like this for many years.
02:05yogthosso you'd keep all the routes in the handler?
02:05callenlets clarify what is meant by routes.
02:05callenwhen I think route, I think (GET "/" [] index)
02:06yogthosright
02:06callenindex is pointed to by that route.
02:06yogthosour entry points the client calls
02:06callenyou wouldn't necessarily keep everything in the handler forever and ever
02:06callenyou could scale that up to be a controllers or handlers folder, but a single file should fine for an example template.
02:06callenhopefully the views directory example is enough to teach the newbie how to do that themselves later.
02:07callenbut initially the logic (manipulate session, get data, whatever) would live in the handlers and they would interchangably manipulate and utilize the views.
02:07callenif they aren't doing anything, so to speak, then I have a hard time imagining why the handlers exist at all.
02:07callenat that point you want to conflate views/handlers to eliminate the redundancy.
02:07yogthoscallen: well that's why I'm kind of thinking just a single handler
02:07callendepends on what you ahve in mind. I like to keep them separate.
02:07callenso that views can be more easily reused.
02:07yogthoscallen: which takes care of the middleware
02:08yogthoscallen: and then you keep views+controllers and their routes together
02:08callenyogthos: that's just it, I'm talking more like controllers that invoke views and inject data and call the models. Those could live in the handlers just fine.
02:09callenyogthos: now some simpler/flat things could end up passing through directly to a view if it's logic-less or close to it
02:09callenyogthos: but any custom logic I would envision living in handlers.clj or a controllers.clj
02:09yogthoscallen: I'd keep those as close to the view as possible
02:09callenhandler.clj that is.
02:10callenyogthos: I guess what I'm saying is I imagined views/ containing things like common/layout, not (defn home )
02:10yogthoscallen: I find the controllers tend to be pretty lightweight and it's often helpful to see both the rendered view and the controller together right
02:10callenyogthos: I could definitely see that.
02:10ibdknoxyogthos: callen: my argument against controllers in Noir: https://groups.google.com/forum/#!msg/clj-noir/FxipsTEhVtM/nDH3JH48LFAJ
02:11callenibdknox: you're almost addressing a different matter that's aimed at fat models.
02:11callenibdknox: I'm in favor of fat models.
02:11callenyogthos: let me introduce a word that will help clarify.
02:12callenyogthos: when you say views, you're thinking of what I would call a controller or handler. You're using views like the Django people.
02:12callenyogthos: when I was saying views, I was thinking of the layout functions that use hiccup.
02:13yogthoscallen: right yeah
02:13callenyogthos: which is fine, and I like what ibdknox and you are saying about not having island-functionality that lives on its own but is mixed in with the routes for no reason.
02:14yogthosbasically you want to close the loop I think
02:14yogthoseverything thing that pertains to a particular workflow needs to be in one place
02:14callenI think that's what I want yes, let me propose this
02:14callenhandlers loads the stuff in viewws.
02:15callentop level of views/ is files of functions that are being invoked by the handlers
02:15callenstuff like GET, POST, etc in home.clj
02:15callenyogthos: what would you think of separating layouts though?
02:15callenyogthos: I'm envisioning something like a layouts.clj with a (defn common ...)
02:16yogthoscallen: heh basically flip the current naming scheme? :)
02:16callencommon would build on base, and you could respin new layouts on top of base accordingly, but the "logic" would be in either the model or the view.
02:16callenyogthos: that's part of it, yes.
02:16yogthoscallen: but common often has other stuff in it too
02:16Raynesyogthos: People actually use controllers in Clojure?
02:16callenyogthos: well let me take a look.
02:16yogthosRaynes: I haven't seen it ;)
02:17RaynesI still don't understand what a controller is. Every time I think I've got it right, someone tells me "No, it's supposed to be..." leading me to believe that nobody really knows what they're for./
02:17yogthoscallen: for example you might put headers, footers, stuff that's used across all pages basically
02:17callenyogthos: yes that's what I'm proposing live in layouts.
02:17yogthosRaynes: essentially a service :)
02:17callenyogthos: everything presentation.
02:18yogthoscallen: well common presentation right
02:18RaynesDamn it, I'll never get anywhere in this game if I compulsively alt+return out of it.
02:18yogthosRaynes: lol
02:18callenyogthos: I guess but I still am squicked-out by common.clj
02:18yogthoscallen: well when it's views/common.clj it's more descriptive ;)
02:19callenyogthos: not really, views is logic + pages, not layout
02:19callenyogthos: it'd be more descriptive, IMHO, as layout.clj or something.
02:19callenyogthos: a noobie is not going to have a damned clue what common.clj is.
02:19yogthoscallen: well it's that whole definition of views ;)
02:19callenno you've got two things you're conflating here
02:19callenthat's my point
02:19callenone thing is view functions like home
02:19callenone is layouts like (defn layout ...) and header, footer
02:20callenthat need to be clearly delineated for new people to understand what's going on
02:20callenit's highly irregular the way the Clojure community has been doing that stuff up to this point.
02:20callenIt only worked in Clojure because Noir aggressively used defpartial
02:21yogthoscallen: I don't know that defpartial has been the main reason
02:21yogthoscallen: I only used it from the layout myself, and then made everything into functions
02:21callenmaybe so but I felt like defpage/defpartial were enabling people to skim over it and it made it more obvious what was going on.
02:21yogthoscallen: you only need to generate html in one spot
02:21ibdknoxthat was the intent of defpage and defpartial
02:22ibdknoxusing just functions it's harder to parse
02:22callenyogthos: I'm not really talking about breaking stuff apart, I'm talking about using clearer nomenclature than common.clj
02:22yogthoscallen: basically a page has up to 3 components to it, the thing the browser renders, the service which browser calls and the routes
02:22callenib thank you, yes.
02:22callenibdknox: ^^
02:22callenyogthos: my point is that you've already got a layout function the home view is calling
02:23yogthoscallen: yeah so I mean I'm not stronlgy opposed to layouts.clj instead
02:23callenyogthos: do you want me to just do it up real quick so you can see what I'm talking about?
02:23yogthoscallen: yeah might be a good idea :)
02:23callenyogthos: it'll be a partial port of what I'd been doing in my template-thingy.
02:23callenkk, h/o
02:23yogthoscallen: structure it the way you envision it and we'll look it over, lol probably faster than talking about it :)
02:24callenthink so. we'll see.
02:24callenI just don't like sending PRs that people might interpret as aggressive.
02:26callenyogthos: another matter, models/ was plural, views/ is plural. handler is not. Are we reserving plurals for directories?
02:27callenor is it specific to the nature of the thing contained?
02:27yogthoscallen: yeah that seems reasonable, directories plural namespaces singular
02:27callensounds good.
02:27callenyogthos: I'm just going to go ahead and tromp all over home.clj to make my point clear, sorry.
02:28yogthoscallen: sure thing :)
02:28yogthoscallen: this is also exposing a bit of a problem with the current templating, since it's done at file level, any time you have the same file in multiple profiles, all have to be kept in sync
02:29yogthoscallen: breaking stuff up a bit more might address that
02:29callenwe'll find out.
02:29callenyogthos: I'm a devotee of the "make a mess, clean it up" methodology.
02:29callenrather than tiptoe'ing.
02:29callenI find it's a good way to learn too.
02:29yogthoscallen: yeah same
02:29yogthoscallen: a lot of the time you have to implement the thing to understand it
02:29callenyogthos: http://folklore.org/StoryView.py?story=Make_a_Mess,_Clean_it_Up!.txt
02:29yogthoscallen: and refactoring is easy :)
02:30yogthosah folklore, so many good stories there :)
02:31callenyogthos: I had a friend who is a programmer and startup kid too, he once told me the thing he most valued about me was that I was a walking trove of hacker lore.
02:31callenyogthos: you cannot begin to imagine how much this disappointed me.
02:32yogthoscallen: ha
02:32callenI did not come to the bay area after years of dreaming about it and reading about the hackers of yore just so I could be a storyteller.
02:33yogthoscallen: that's the exciting part about clojure, there's so much new stuff to make :)
02:34callenyogthos: the bootstrap stuff needs fixed up a bit.
02:34callenyogthos: I'm trying to decide if I wanna be the guy. I don't actually like bootstrap.
02:35yogthoscallen: it seems popular nowadays :)
02:35callenI know I know
02:35yogthoscallen: which js framework is the one you like?
02:35callenI'll put in a stub for you to consider using if you want, copy-pasta'd from my template.
02:35callenyogthos: JS is a separate matter, I can explain sometime if you want. let me see if I can wrap this commit up.
02:36yogthoscallen: yeah I mean the whole plan is pluggable stuff, so bootstrap's just one option :)
02:36callenyogthos: I know, I'm not in opposition to that, I'm just saying that the current bootstrap template is a little wonky and won't work out of the box AFAIK
02:37callenI'm fixing it, I think. testing a hypothesis.
02:37yogthoscallen: ah gotcha :)
02:37callenyogthos: I was griping about disliking bootstrap because it forces the use of un-semantic markup and I resent having to fix something I don't like
02:37callenyogthos: tl;dr kvetching
02:38yogthoscallen: ah hehe understandable
02:38callenyogthos: your use of into is problematic.
02:38callen,(into [:body] [:div [:div "blah"]])
02:38yogthoscallen: is there a better way?
02:38callen,(into [:body] '([:div [:div "blah"]]))
02:38callengod dammit bot.
02:38yogthoslol
02:38callen&(into [:body] [:div [:div "blah"]])
02:38lazybot⇒ [:body :div [:div "blah"]]
02:39callen&(into [:body] '([:div [:div "blah"]]))
02:39lazybot⇒ [:body [:div [:div "blah"]]]
02:39yogthosright
02:39yogthosbut it takes & body right
02:39yogthosso its should always get a top level list
02:39yogthoslayout I mean
02:39callenyogthos: is that in fact the expectation? i'd been doing direct inlining.
02:40callenI hadn't been listifying sub-content
02:40callenand instead passing the same vector stuff around.
02:40yogthoscallen: well my idea was that layout is the top level wrapper for the page
02:40callenthat'll change quickly in a growing webapp, but it'll make a good default base.
02:40yogthoscallen: all the content gets passed into it and it adds headers, footers, and all that jazz
02:40callenyogthos: some yes, some no. there will be siblings after enough time.
02:41callenand a sufficiently complicated app.
02:41yogthoscallen: yup
02:41yogthoscallen: for example in the sqlite template there's a base-layout and layout
02:41callenyogthos: point being, they see hiccup syntax.
02:41yogthosbase-layout is more barebones
02:41callenyogthos: they're going to think they're supposed to pass [:div ...] not '([:div ...])
02:41callenthe (into ...) breaks that naive assumption.
02:42calleninto can be used, but you need to be aware of how it violates user expectations.
02:42yogthoswell the layout function works as you expect
02:42callenand document accordingly.
02:42yogthosyeah I'd just put a note around it
02:42yogthosin the end you want it to be convenient to use too
02:42callenuh, sure but I'm saying that the common in the non-bootstrap and the bootstrap based templates are going to have different behaviors.
02:43yogthosah yeah
02:43callenyogthos: I'll do it my way, you can see and decide for yourself.
02:43yogthosok sure thing :)
02:44callenthis might be a little messy, apologies ahead of time.
02:44yogthosno prob
02:47callenyogthos: why is the sqlite plugin common different from the default one?
02:47yogthoscallen: ah I rolled in authentication example into that one
02:47callenyogthos: I actually think you should delete the sqlite plugin until the duplication and the other stuff gets resolved a bit better, also models are hammered out.
02:47yogthoscallen: so there's a login/logout, etc
02:47callenit's getting a bit busy.
02:47callenI get what you mean though.
02:48callenI'll see if my changes are going to break the sqlite template. I think it was early for this though.
02:48yogthoslikely :)
02:48callenah, no, it won't.
02:48yogthosbut that's alright
02:48callenbecause it has its own handler.
02:48callenif I'm understanding correctly.
02:48yogthosyeah it does
02:48callenit's largely self-contained and should be fine.
02:49callenIuno. I'll just do the commit.
02:49yogthoswe'll refactor it after
02:50callenyeah I'm bothered by the duplication in sqlite/, we'll see how this PR strikes you.
02:50yogthoscallen: a lot of the stuff in sqlite is kinda new and specific to it though, there might not be a clean way around that
02:51yogthoscallen: for most plugins there shouldn't be much duplication, since they presumably provide distinct functionality
02:51callenyogthos: maybe, maybe not. We'll see. The problem is cross-cutting dependencies.
02:51yogthoscallen: yeah, have to see how it goes, one option is to read the templates in and actually work with them as structured data
02:52yogthoscallen: but that seems like a lot of work, and I'd rather avoid it if possible ;)
02:52callenyogthos: likewise.
02:53callenyogthos: it's posted.
02:53yogthosok cool
02:53callenyogthos: I'm going to back to hacking on my own app and porting stuff to it from Luminus. Let me know if you accept the PR and post a new jar.
02:54yogthosok sounds good
02:54yogthosI'll have to do a bit of testing first though make sure we didn't break too much, so I'll probably post it tomorrow morning ;)
02:54yogthoslet me look over it now though
02:55callenyogthos: sounds sensible to me.
02:55yogthoscallen: does hiccup autoexpand stuff?
02:56yogthoscallen: if you give [:body '([:div "foo])] to it
02:56callenyogthos: k, what you're describing is why I got rid of into
02:56yogthoscallen: yeah if hiccup already does that then into is kinda superfluous :)
02:57callenyogthos: I meant something else, h/o
02:59callenyogthos: garbwell.server=> (html [:body '([:div "foo"])])
02:59callen"<body><div>foo</div></body>"
02:59yogthoscallen: yeah so no need for into
02:59yogthoscallen: only thing I'd change would be to create separate home routes in the home namespace
03:00callenyeah I saw the comment, I'm pnondering it.
03:00callenI h
03:00yogthos(defroutes home-routes (GET "/" [] (home-page))) then (def all-routes [home/home-routes app-routes])
03:00yogthoscallen: goes back to the idea that all the relevant stuff is in one place
03:01callenoh I see what you're doing there.
03:01yogthosbasically I think a namespace should represent a workflow or a user story if you like ;)
03:01callenyogthos: that makes sense, but it's not really views/ anymore, no?
03:01yogthosyou identify a particular set of tasks, make a namespace for them and go nuts, and that keeps stuff organized
03:01yogthoscallen: sort of :)
03:01yogthoscallen: I'm not sure if there's cleaner terminology
03:02yogthospages?
03:02callenyou're describing app namespaces
03:02callenin some sense
03:02callenlike django apps
03:02yogthosyeah
03:02callenproject/app/models project/app/views
03:02callenyogthos: I find my project template to be unambiguous and simple, but I can see what you're getting at with that.
03:02yogthossimilar idea
03:03yogthosonce it grows you don't want to be poking around
03:03callenyogthos: I'll tell you right now though, what django tried with ensapsulated and reusable apps didn't really work out. You're opening up a front on a new war if you really want to do this.
03:03yogthosit's especially important when you come back to some code later
03:03callenI like the notion of locality though.
03:03callenso that you don't have to grasp about for where something lives.
03:03yogthosyeah exactly what I'm going for with that
03:04callennow that I understand, I could respin my pages in those terms.
03:04yogthosI think we might want to sleep on this a bit :)
03:04callenyogthos: I'm going to be up for awhile.
03:04callenI have a lot of work to do yet, tonight.
03:04yogthossounds like we're mostly agreeing, just need to clean up a little bit and we're golden
03:05yogthosI gotta hit the sack here :)
03:05callenI think so. There are some specifics to the nomenclature and routes handling that makes me a little queasy. I'll give it some thought.
03:05callenyogthos: cheers.
03:05yogthoscallen: you too, thanks for brainstorming :)
03:05callenlikewise.
03:05yogthoscallen: we'll nail this tomorrow for sure :)
03:06callensounds exciting. If you catch me after I hit the gym tomorrow I might be a little less hyperactive :P
03:06yogthoscallen: haha alrighty :)
03:06yogthoscallen: cya tomorrow
03:06callengooood night
03:06yogthosg'night
03:55bbloomibdknox: i'm legit crazy? for using a scratch file? or just in general?
04:00callenbbloom: wat
04:00bbloom[22:50:54] <ibdknox> I dunno that you want to mimic bbloom, I'm fairly certain he's legit crazy. ;)
04:01callenoh. that's fairly random.
04:01callenbbloom: anybody that uses vim is crazy anyway.
04:02bbloomthank you.
04:05callenbbloom: do you use vim?
04:05bbloomyes
04:05callenbbloom: I'm so sorry.
04:06callen$5 says the vim clojure community loses more people to LT than Emacs does.
04:06callenibdknox: what say you?
04:06callenbbloom: yes but I want a new toy to beat vim users over the head with.
04:06callen >:)
04:07callenBergle_1: true, but they aren't in here.
04:17ibdknoxbbloom: I was talking total nonsense
04:17ibdknoxbbloom: scratch buffers are the way to go
04:18bbloomi do 90% of my work in a scratch buffer
04:18ibdknoxLT is based on that concept
04:18ibdknoxI have some neat ideas for adding transient areas to a file
04:18bbloomif i move something to a non scratch buffer, there's a 75% chance i'm about to git commit in a second :-)
04:30bbloomibdknox: what does "transient area" mean
04:37Raynesbbloom: Probably fancy speak for mini scratch buffer.
04:37bbloomRaynes: i assumed, but i was curious to hear his ideas
04:39Raynesibdknox: You're a pretty cool cat. Using the old style mac keyboards in the lighttable.com background.
04:46tomojare core.logic's conda/condu of equivalent power to prolog's cut?
05:08borkdudegoat moaning
05:09ziltisheep morning
05:12tomojhuh..
05:13tomojthe huge (comment) block in clojure.math.combinatorics above the ns decl seems to cause trouble in slime
05:13tomojsince I guess clojure.core is not referred
05:40amalloytomoj: i think slime assumes the ns form is the first one
05:40tomojI wonder if it warrants a patch
05:41tomojI just copied #'combinations instead..
05:42tomojI suppose it is never acceptable for an IReduce impl to call f1 inside swap!
05:43tomojwell, maybe for some crazy reducer, I dunno
05:47ziltiThis gives me an "Unreadable form" exception, but I don't see why: https://www.refheap.com/paste/7917
05:48bbloomzilti: do a binary search
05:48tomojthe Delays
05:49ziltiAh, oh yes. Damn. Something goes wrong when serializing that stuff...
05:56thorwilthere's a tlog.dispatch.route/static-slugs and i thought i could just access it in tlog.render.html with its qualified name. but i get a no such var
05:57thorwiltrying to require tlog.dispatch.route in tlog.render.html leads to a Cyclic load dependency exception
05:57thorwili'm confused
06:16callenBwahaha, broke it. CompilerException java.lang.OutOfMemoryError: Java heap space
06:20SgeoI'm reading what iirc is miniKanren Scheme code
06:20SgeoIt doesn't use the define shortcut for defining named functions
06:20SgeoRather it does the full (define blah (lambda ...
06:41callenSgeo: Schemers are digital monks.
07:35callen,(+ 1 2)
07:35callen&(+ 1 2)
07:35lazybot⇒ 3
07:36Ember-amazing skills!
07:36Ember-;P
07:36callenEmber-: no, I was trying to check which bot works.
07:36Ember-hehe
07:36Ember-&true
07:36lazybot⇒ true
07:36kmicu,1
07:36Ember-he said it is true, I believe you
07:37kmicu, 1
07:37kmicuwhy, bot, why
07:37callen&(->> [1 2] first (+ 2) (* 3))
07:37lazybot⇒ 9
07:37callen&1
07:37lazybot⇒ 1
07:42Ember-&(nth ((fn [] (map first (iterate (fn [[a b]] [b (+ a b)]) [0N 1N])))) 250)
07:42lazybot⇒ 7896325826131730509282738943634332893686268675876375N
07:46callen&(nth ((fn [] (map first (iterate (fn [[a b]] [b (* a b)]) [1N 2N])))) 250)
07:46lazybotExecution Timed Out!
07:47Ember-heh
07:47Ember-grows kinda large numbers doesn't it? :)
07:50callenEmber-: I had to know.
07:50callenEmber-: if you really want fast growing, just use the ackermann function.
08:23ziltiIs there a special function to get a subset of a map? As in, hand it a map and a list of keys, and get a new map with those keys extracted.
08:24zilti(get-subset {:a 1 :b 2 :c 3 :d 4} [:a :b]) => {:a 1 :b 2}
08:24lantigaselect-keys
08:24ziltiThanks!
08:25callenzilti: you know find-fn works right?
08:25ziltifind-fn?
08:26callen$findfn
08:26callen$findfn 1 2
08:26callenI forget the syntax, h/o
08:26lazybot[clojure.core/cond clojure.core/dosync clojure.core/import clojure.core/prn clojure.core/refer-clojure clojure.core/print clojure.core/newline clojure.core/comment clojure.core/or clojure.core/load clojure.core/await clojure.core/declare clojure.core/println clo... https://www.refheap.com/paste/7918
08:26lazybot[clojure.core/unchecked-inc-int clojure.core/unchecked-inc clojure.core/inc clojure.core/inc']
08:26tomoj:)
08:26callenoh son of a bitch.
08:26callen$findfn [1 2 3 4 5] 2
08:27lazybot[clojure.core/second clojure.core/fnext]
08:27tomojwtf is clojure.core/await
08:27callenzilti: ^^
08:27tomojoh
08:27tomojinteresting@
08:27zilticallen: :)
08:27callenzilti: don't smile at me, smile at the bot author
08:28callenwhy is everyone on IRC impressed with the fact that I can google and read?
08:28tomoj&(= (println 1) 2)
08:28lazybot⇒ 1 false
08:28ziltior at the bot
08:28tomojI don't get it
08:28zilti& :)
08:28lazybotjava.lang.RuntimeException: Invalid token: :
08:28zilti:(
08:28callen...
08:28callen&({:a 1} :a)
08:28lazybot⇒ 1
08:29tomojactually very few of those make sense to me
08:29tomoj&(= (cond 1) 2)
08:29lazybotjava.lang.IllegalArgumentException: cond requires an even number of forms
08:29tomojguess I don't fully understand the syntax of find-fn
08:30ziltiI wonder how findfn works. Must be quite some code and brain behind it.
08:30callenso, I'm watching Parks and Recreation. The actors keep making eye contact with the camera. It's really bothering me.
08:30ziltiOr brute-force.
08:30callenzilti: it's brute force.
08:30borkdudezilti https://github.com/Raynes/findfn
08:30callenzilti: first rule of programming, your first and last tries are always brute force.
08:30callenlast rule of programming, your middle try is also brute force
08:31ziltilol
08:31borkdude$findfn (range) 0
08:31lazybotjava.lang.OutOfMemoryError: Java heap space
08:31borkdude=)
08:31ziltiNow you did it. Our second bot is dead.
08:31calleneverybody gotta be a smart ass.
08:32callen$findfn [1 2 3 4 5] 3
08:32zilti&(println "I'm still alive")
08:32lazybot⇒ I'm still alive nil
08:32ziltiphew
08:32lazybot[]
08:32callenreally? no third? PSH BACK TO COMMON LISP
08:32callenLAAAAAME
08:32tomojcan't seem to get findarg to work
08:33callenit's not a real lisp unless I can caddddadadr.
08:33tomojoh it's backwards
08:33tomoj$help findarg
08:33lazybottomoj: (findarg map % [1 2 3] [2 3 4]) ;=> inc
08:34tomojoh!
08:34tomojit's calling all the macros as functions I bet
08:34tomojno, that doesn't make any sense
08:36borkdude$findfn "help" "pleh"
08:36lazybot[clojure.string/reverse]
08:36borkdudeyay
08:37callen$findarg reduce % [1 2 3] 2
08:38lazybot[]
08:38callen$findarg reduce % [1 2 3] 6
08:38borkdude$findarg reduce % [1 2 3] -4
08:38lazybot[]
08:39lazybot[]
08:39callenfeel like I'm missing something here.
08:39callen$findarg map % [1 2 3] [2 3 4]
08:39lazybot[]
08:39borkdudehmzmzmz
08:39callenokay yes, definitely not doing it right.
08:40callen$(findarg map % [1 2 3] [2 3 4])
08:40borkdude$findarg reduce [1 2 3] [2 3 4]
08:40callen...
08:41lazybot[]
08:41borkdude$(print "dude")
08:41borkdude&(findarg map % [1 2 3] [2 3 4])
08:41lazybotjava.lang.RuntimeException: Unable to resolve symbol: findarg in this context
08:41callen(╯°□°)╯︵ ┻━┻)
08:42borkdudethere definitely should be a bot faq
08:42borkdudewhat bot does what
08:42callenborkdude: ¯\(°_o)/¯
08:43Ember-callen: too much booze?
08:43zilticallen: Two knifes?
08:43borkdudecallen my compliments for your ascii art
08:43ziltiThe throwing-table one is awesome
08:43ziltiThe second one looks like a dude with two knifes who just loses an eye
08:44callenhe's shrugging.
08:51ziltiawesome. select-keys made my day.
08:54callenzilti: communist lies, findfn made your day.
08:56tomojwhy did it take me years to set *print-level*
08:56tomojwhy
08:56Bergle_1ask callen he has answers ;)
08:56tomojnot like I didn't know it was there
08:57tomojI guess I just enjoyed killing my jvm when I accidentally eval'd something huge
08:58Bronsabbloom: ping
09:00callenBergle_1: what did I do?
09:00Bergle_1"[23:21] <callen> why is everyone on IRC impressed with the fact that I can google and read" i like to fish :)
09:03callenBergle_1: I was teasing zilti :(
09:04Bergle_1i know :)
09:04tomojhuh, you can't use :rename with :as
09:04tomojI mean, you can use them together but they don't work together
09:05tomoj.. in the way that I hoped
09:05tomojguess that's obvious, you need a refer
09:15tomojRaynes: thanks for laser. I love it already. just had to get past the current selector verbosity and take a quick spin
09:16callentomoj: what do you like about it over enlive?
09:16tomojI haven't ever gotten very familiar with enlive
09:16tomojlaser seems comparatively transparent
09:17callenjust wondering
09:18tomojof course I will want to define an enlive-like selector thing
09:18tomojwhich could be a major source of opacity to enlive..
09:18callennah.
09:18tomojI like hickory, but that's somewhat minor
09:22tomojmostly I just got what I wanted done with laser and hadn't yet with enlive, but I hadn't really started with enlive, so it's unclear whether I like it over enlive
09:26callenokay
09:27borkdudetomoj I have two questions. How do I transform this enlive template to laser? https://www.refheap.com/paste/7919 And how would I do it in Enlive, without the Hiccup impureness?
09:32callenborkdude: Hiccup...impure?
09:33borkdudecallen you could do everything with an enlive template, without using hiccup to generate the a tags
09:33borkdudecallen "impure" as in, not purely enlive
09:34callenborkdude: jsyk, <a></a> -> the a means 'anchor'.
09:35borkdudecallen I know
09:35bosiehas someone a good resource of explanation of why the AST in clojure is such an important detail/better than in other non-lisp languages?
09:35bosiei re-read the explanation in Clojure Programming but fear i require more
09:35borkdudebosie macro's
09:35callenborkdude: no apostrophe
09:36bosieborkdude: sure, but i am wondering about the how thats done
09:36borkdudecallen tnx, I do that all the time...
09:36bosieborkdude: the clojure programming book has an ast in a java program and the same in clojure. except it is literally the same it seems
09:36callenborkdude: apostrophe means two things: contracted is or possession.
09:36borkdudecallen I also know that
09:36callenbosie: you're reading too much into something you don't really understand, just keep reading.
09:36tomojwell, you'd put <a> into your template
09:37tomojborkdude: ^
09:37tomojin enlive
09:37callenbosie: yes, the syntax / AST in Clojure is important, no you don't need to know why yet.
09:37bosieok
09:37tomojI don't have time right now to work out how to translate to laser
09:37bosiecallen: and 'when' would be that time? ;)
09:38callenbosie: when you learn macros, you'll get why it's so nice.
09:38bosieok
09:38borkdudecallen it's just that in Dutch we use 's sometimes
09:38borkdudecallen for plural, like hobby's
09:38borkdudecallen and pyjama's
09:38callenborkdude: that's not a thing in English.
09:38bosiethanks again callen
09:39borkdudecallen I KNOW! BUT THAT'S WHY I MAKE THE MISTAKE ALL THE TIME - VODKA?
09:39borkdude=)
09:39callenborkdude: hey the vodka is my job.
09:39callenspeaking of, I'm nearly out (◕︵◕)
09:39bosieborkdude: no. get us some of that primo dutch weed
09:40chouserI don't think you guys are talking about the AST
09:40chouserSorry if I'm being too pedantic, but s-exprs are not the AST. Macros are about s-exprs.
09:41callenjust when I thought I'd put the conversation to bed.
09:41callenchouser: you get to burp the baby this time.
09:42borkdudechouser you wrote the joy, so you can explain what bosie is reading the best ;)
09:42chouserHe's not reading Joy, so all I can do is make snarky comments.
09:42bosiechouser: but i bought the Joy ;)
09:43chouserAh, well that's good. I'd be happy to explain any references to AST you find in there.
09:43borkdudechouser bosie huh, why did I read that then, it must be the holidays
09:43callenbosie: what chapter/section were you talking about?
09:43bosieborkdude: because i am reading Programming Clojure atm. I just bought the meap of joy way back and never got to read it ;)
09:44callenbosie: okay, two different books
09:44bosiecallen: in PC its chapter 1, page 10
09:44bosiecallen: yes
09:44borkdudebosie ah, I think the joy has excellent macro explanation, so read both ;)
09:44callenbosie: are you talking about Programming Clojure or Clojure Programming?
09:44bosiecallen: ah sorry
09:44callenJoy *after* PC
09:44bosiecallen: Clojure Programming
09:44callenbosie: don't apologize, tell me which
09:44callenokay
09:44borkdudebosie "the clojure programming book" isn't "Programming Clojure"
09:44bosiei know
09:44callenborkdude: yes we've gotten that far
09:44callenbosie: page/section/chapter?
09:45bosiecallen: 10/homoiconicity/1
09:45callenkk, h/o
09:46bosiechouser: thanks for the offer
09:47callensigh, god dammit, I was right.
09:47callenchouser: the section he was talking about was in fact about s-exprs
09:48callenchouser: pedantry generally isn't useful when we're talking about somebody reading the first chapter of a beginner's programming book, which I guessed him to be in the middle of and that's why I told him not to worry about it.
09:48chouserI guess I can apologize a second time for the pedantry.
09:48callenchouser: I'm just providing data for your calibrator.
09:48chouserok
10:41bawrcallen: I disagree. It makes sense to make people learn stuff properly from the get-go.
11:08luxbockhas anyone here used clojure in org-babel with nrepl (Emacs)?
11:15atyzhey guys, if anyone is familiar with korma? I'm busy trying to build models, problem is those models have relationships with others. i've run into a problem where it won't let me redeclare an entity in the different models. so i suppose this leaves me with the choice of creating a new file to contain all the relationships between them. however this doesn't feel quite right. is there a "standard" for this type of situation?
11:16gfredericksredeclare an entity in the different models?
11:17atyzahh but i have those models called from a routes file. so i'm getting an error that that one of the entities is already declared
11:17atyzoh sorry
11:18atyzumm one of my models (A) has (defentity a) and (defentity a (belongs-to b), now i'm trying to do (defentity a) in model b
11:18gfredericksfor each model you should only have a single defentity
11:19gfredericksand you ought to be able to work out whatever you need within that constraint
11:19gfredericksI can't stick around, hopefully somebody else can help you sort it out
11:20atyzah, that would mean including the other model inside it
11:20atyzwhich isn't something i really wanted to do
11:20atyzit seems.. big
11:21atyzah no worries, thanks anyway
11:21ziltiatyz: I'm working on a library for greater flexibility for such things, you might want to take a look at it? https://www.github.com/zilti/tetrisql
11:25atyzzilti: this looks more like a db migration tool
11:26ziltiatyz: It's meant to be a library to handle korma's entities more dynamically.
11:26ziltiI'm not even aware of what a db migration tool is meant to di
11:26zilti*do
11:28atyz*looks again*
11:28ziltiIt's my first serious library so maybe I've missed my goal
11:29atyznono, it probably does exactly what you think, i may have just missed the point
11:29atyzi'm new to clojure
11:36jajuHi guys - need some help in debugging a situation. Am trying to use compojure with ring-java-servlet in an existing web application, but see some errors I can't seem to debug.
11:37jaju#clojure-web is quiet - so, thought I could ask here.
11:47bprhow feasible is modifying clojure-test-mode.el to work with nrepl (via nrepl.el of course)?
11:47bprwould i be better off just re-writing?
12:04mmitchelli was in here a few days ago and got a nice answer from someone about compojure routes, I forgot to write down the solution! My question was: how can I dispatch a route on a single query parameter?
12:06tmcivermmitchell: like (GET "user/:user" [] get-user-fn)?
12:06luxbockI'm looking at the source for interleave. can anyone explain why this line is needed (when (every? identity ss) on line 13
12:06luxbockhttp://clojuredocs.org/clojure_core/clojure.core/interleave#source
12:06mmitchelltmciver: actually, I meant to say query string parameter
12:06borkdudemmitchell if you must, you can always read the logs http://clojure-log.n01se.net/
12:07mmitchelltmciver: like: /xyz?param1=a&param2=b -- so in that case, I'd want to dispatch if param2 = b etc..
12:07mmitchellborkdude: cool thanks!
12:08chouserluxbock: that terminates the return sequence as soon as any of the inputs are exhausted.
12:08luxbockah right
12:09mmitchelltmciver: here we go: http://clojure-log.n01se.net/date/2012-12-20.html#09:47
12:09mmitchellbut, the problem is that I don't have a "default route", I just want to pass through to the next route that might match
12:09chouserluxbock: without that test, the return sequence would never end at all. nils forever.
12:11mmitchelltmciver: maybe i could inspect the param in middleware, then change the request path so that it works with standard path route matching?
12:11luxbockyeah got it, thanks
12:11chousernp
12:12TimMctmciver: A Christmas-themed render from my raytracer: http://i.imgur.com/ZYPHD.png
12:13TimMc(I finally added the ability to use colored lights.)
12:13tmciverTimMc: Nice, looks high-res.
12:14tmcivermmitchell: I'm not sure I understand why you can't use normal routes. Can't you just do (GET "/xyz" [] your-fn) and then do the destructuring in your-fn?
12:15tmciverTimMc: on vaca this past week?
12:16mmitchelltmciver: oh yeah, i'm thinking about this incorrectly!
12:17tmcivermmitchell: yeah, the wrap-params middleware makes that easy.
12:17mmitchelltmciver: cool yep, and we're using that
12:18TimMctmciver: Yep.
12:18TimMcI'm in the middle of nowhere, Ohio.
12:18tmciverOhio, that's a state, right?
12:18tmciver:)
12:19tmciverWhat's in Ohio?
12:20TimMcWife's family (father's side.)
12:29thorwilhow can i work around that a var defined in namespace A is not available to a namespace B, where B is required by A?
12:30TimMcthorwil: Because the var is private?
12:30TimMcOh, nvm -- circular dependency?
12:31Raltthorwil: pass an argument to the B function you call within A
12:31thorwilTimMc: not private. it would be a circular dependency, if i tried to require A in B
12:32Ralthu wait
12:32Raltjust use binding
12:32thorwilRalt: i would, if that wouldn't mean passing that argument through another ns in between
12:35Raltthorwil: http://java.ociweb.com/mark/clojure/article.html#Vars
12:35moogatronictrying to get 'lein midge' working, running lein-midje 2.0.3, and latest leiningen2 from git, seeing: Could not locate bultitude/core__init.class or bultitude/core.clj on classpath. Any suggestions?
12:39TimMcthorwil: Combine the namespaces or split out a third ns.
12:40pmaesmoogatronic: What is your namespace of your test and where is the file located? Make sure those two correspond. I had the same problem and forgot to replicate the directory structure exactly.
12:41thorwilRalt, TimMc: i guess i can declare a var in B and then define it in A. kinda thinking backwards
12:45technomancymoogatronic: sounds like the bootstrap of the lein checkout went wrong; try removing .lein-classpath and checking the "Building" section of the readme
12:45moogatronicpmaes: hmm.. It looks like they correspond, if clojure.test works, should midje also work?
12:46technomancyoh, disregard that if it's just midje that's broken
12:46moogatronictechnomancy: Actually I just updated lein, and rebuilt the .lein-classpath and it still seems to report the bultitude thing
12:47technomancywell that's the great thing about clojure.test; it pretty much always works =)
12:47moogatronicI'll try clojure.test real quick. I typically use clojure.test anyway, but wanted to play with midje for fun.
12:48pmaesmoogatronic: I'm sorry, I'm not sure, I'm new to clojure. I know my issue was that I forgot a 'test' subdirectory, seemingly causing the core.clj test to be confused with the actual core.clj I wanted to test.
12:49moogatronicpmaes: no worries. I do have the proper namespace / file naming / etc.
12:49moogatronicclojure.test works.. .. hmm..
12:55moogatronicadding bultitude 0.2.0 as a dependency fixes it of course -- is this something that is supposed to be added?
12:55moogatronic(to the project.clj)
12:58TimMcthorwil: I don't think you can do that. If you declare it in B, it will be B/foo, not A/foo.
13:00bprtechnomancy: i'm thinking of modifying clojure-test-mode.el to work with nrepl.el ... Is that feasible or is slime/swank different enough from nrepl that it would basically require a re-write?
13:00n_btpope: This might be better for #vim, but is there a way to keep the command line window for foreplay open after evaluating a form?
13:03ziltiWhen I'm connected to an application-embedded nREPL, can I "get into" that application's name spaces and modify them, and if so, how? Is it enough to change *ns*?
13:09ppppaulhey guys
13:09ppppaulcould i get some datomic help #datomic
13:10ppppaulreally simple problem and i can't find examples on google so easily
13:11loliveirais there any good parser like flex/bison in clojure?
13:13ppppaulhulp
13:15ziltiin-ns seems not to be enough
13:16moogatronic(in-ns 'this.is.my.namespace)
13:16moogatronicworks for me
13:19borkdudezilti in-ns doesn't load the namespace
13:19technomancybpr: someone actually already did that
13:20technomancybpr: I haven't tested it thoroughly yet though
13:20ziltiborkdude: (load) seems to do what I need.
13:21ziltinah. It doesn't.
13:21technomancy(doto 'my.ns require in-ns)
13:22ziltiOk, it was a typo, with load and in-ns I get what I want.
13:22bprtechnomancy: ah ok. is the code available anywhere?
13:23technomancybpr: it's merged into master
13:24bpro
13:26tpopen_b: negative. it probably wouldn't be *that* hard to rig up. but then it would probably feel weird that you could only see the output from the most recent command
13:27n_btpope: OK, that's what I thought after poking around in the help for command-line and saw how output is handled - thanks for the prompt response!
13:28tpopen_b: it would probably be more natural to do for the cqp prompt instead
13:29tpopeI might try that
13:32mccraig_technomancy: nrepl.el appears to be hanging my emacs whilst executing long running forms… is that expected ?
13:33mccraig_(assuming you are a good person to ask based on your name in nrepl.el)
13:37technomancymccraig_: it's supposed to be async
13:37technomancybut I havent' been following its development closely
13:45tpopen_b: you can try cqP on the cqP branch. I'm not sure it's worth merging in
13:50llasrammccraig_: I haven't looked at the code, but my experience is that although evaluation operations are/should be async, (a) multiple operations form a queue rather than execute in parallel, and (b) ac-nrepl blocks
13:50llasrammccraig_: So if you kick off something long running, then do something which causes autocomplete to kick in, emacs blocks
13:54mccraig_llasram: yeah, that matches the symptoms… i don't recall slime having the problem so presumably slime executes ops in parallel, or ac-slime was non-blocking
14:04dnolencore.logic 0.8.0-beta4 going out
14:04technomancyoh, yeah the auto-complete stuff for nrepl is finicky
14:05technomancynever used it but a lot of people report problems that go away when they take it out
14:05dnolenand maybe some deep (hopefully fun) documentation/tutorial for core.logic is in the works ...
14:22borkdudewhen you want to host a 4clojure instance on a server (for whatever reason), what is the recommended policy https://github.com/flatland/clojail/blob/master/example.policy ?
14:26catgenuhmmm, is there any vim support for clojure?
14:28borkdudecatgen since no-one else is answering: yes, there is, I think it's called VimClojure http://www.vim.org/scripts/script.php?script_id=2501
14:29borkdudecatgen but I'm not a vim user, so I'm not going to google any other info you can find yourself =)
14:29catgenhaha, thanks :)
14:29tpopealso foreplay.vim
14:29seangrovevim?
14:29clojurebotGesundheit!
14:29seangroveforeplay?
14:29seangroveCan anyone teach clojurebot things?
14:30seangroveOr only a restricted few?
14:31borkdudeis there something like pop/push for changing directories in bash?
14:32borkdudelike I'm in dir a, I'm cd-ing to dir b, but then want to get back to a again
14:32seangrove'..'?
14:32tpopecd -
14:32ivanborkdude: pushd, popd
14:32tpopeit's not a stack though, just a toggle
14:32tpopeif you want a stack, read up on pushd/popd
14:32borkdudeivan tpope tnx!
14:33n_btpope: Was in transit, will check that out and see how it goes
14:34tpopen_b: k, lmk
14:34borkdudetpope cd - is also very handy, didn't know that
14:47TimMcUndocumented, I believe.
14:52TimMcgfredericks: Engineering a Safer World
14:54seangroveHrm, my mind is blanking
14:54seangroveIf I want to have a map with multiple keys pointing to the same data, what structure is that?
14:55borkdudehm, trying to run 4clojure locally, but when loading the data (load-data.sh) I get this weird error https://www.refheap.com/paste/7921
14:55gfrederickswell if it's all values, that's just a map
14:55seangrovegfredericks: Yeah, just values
14:55gfredericksborkdude: that's a weird class for it to want
14:55seangroveBut I don't want to store multiple copies of the values in the map
14:56TimMcseangrove: Since they're references, no worries.
14:56gfredericksseangrove: (assoc m :foo x :bar x :baz x :blammo x) -- what's wrong with that approach
14:56gfrederickslike TimMc said
14:56TimMcUnless you want the val at :x to magically change with the val at :y.
14:56seangroveHrm, what if x is a map?
14:56TimMcSo what?
14:56seangroveTimMc: Yes, I'd like that ;)
14:57seangroveWell, I'll back up
14:57gfredericksso you want (assoc m :baz z) to change the :foo :bar and :blammo keys as well?
14:57seangroveI have a few fairly big maps (big for js runtimes) that need to be returned for multiple keys (think a person's email, or their phone number, or address, etc.)
14:57seangroveGiven any of those keys, I'd like to return that fairly big map
14:58seangroveI'd also like to only update the map once, and have all the other keys point to the new data
14:59TimMcseangrove: That assoc that gfredericks provided does that.
14:59borkdude,(let [x {:foo 1}] {:a x :b x}) ;; I guess clojure only has one instance of x right?
14:59clojurebot{:a {:foo 1}, :b {:foo 1}}
14:59gfredericksTimMc: not the last bit
14:59gfredericksborkdude: yes
15:00seangroveIt's not a huge deal and I can get away without it right this moment, but I thought if there's some standard data structure for this, I might as well do it now
15:00gfredericksit sounds like a fun one to build
15:00gfredericksbut a weird one to want
15:00borkdudeclose over an atom with a map in it?
15:01TimMcseangrove: Sometimes multiple keys will point to the same val, and sometimes not?
15:01gfredericksyou don't have to do it statefully
15:01gfredericksit sounds like he wants equivalence classes of keys
15:01borkdudegfredericks ah right, you can still do it functionally
15:01seangroveYeah, something like {[:foo :bar :baz] {...} [:baboom] {...}}
15:02gfredericks(deftype StickyMap [m key-classes] ...)
15:02seangroveWhere passing in either :foo, :bar, or :baz would return the first map there
15:02gfredericksseangrove: do the key-classes ever change?
15:03devnhttp://imgur.com/G8fMu <-new logo for datomic
15:03seangrovegfredericks: What do you mean?
15:03gfredericksdevn: wth is rhickey's arm doing there
15:03TimMcgfredericks: That's another way of looking at my question, right?
15:03seangrovedevn: Very freaky
15:04devngfredericks: he's levitating
15:04devn...or something
15:04gfredericksseangrove: do the keysets change at runtime? I.e., would you ever say "okay now I'm moving the :foo key over to the group with :baboom in it"?
15:04gfredericksTimMc: probably...
15:05seangroveThey would change at runtime, yes
15:05seangroveAt startup, they're empty
15:05gfrederickshrm
15:06seangroveI suppose I could play with making it
15:06gfredericksI'm wondering what would be the API for changing them
15:06reflections79anyone out there worked with clojurescript + push state in the past?
15:06seangrovegfredericks: No worries
15:07seangroveI'll come back ot it later, sounds like it's not super common anyway
15:07reflections79i'm attempting to access pushState with little success
15:07reflections79https://gist.github.com/c9c2fe05606de72f5a59
15:07gfredericksExtra Credit: Build a StickyVector
15:08seangrovereflections79: One second, I'll take a look
15:08reflections79thank you!
15:10tomojsticky?
15:10gfrederickswhy does the clojure repl not print stacktraces? do people hate them?
15:12n_bError messages in Clojure are poor because Rich Hickey doesn't make mistakes and hence has never seen them
15:15seangrovereflections79: How do this work: (.pushState (aget js/window "history") nil nil "https://localhost:8000/me&quot;)
15:16gfrederickswhat's the workflow for improving error messages? 1 jira issue per message?
15:17reflections79seangrove: i'll give it a try
15:17reflections79thanks!
15:17seangroveNo problem
15:17seangroveSimilar, maybe easier to read: (-> (.-history js/window) (.pushState nil nil "https://localhost:8000/me&quot;))
15:18borkdudegfredericks what would be an improvement to that error message?
15:18gfredericksappending "Perhaps you didn't mean to call a vector as a function?"
15:18reflections79seangrove: that works great
15:18reflections79thank you much
15:19seangroveNo problem reflections79
15:20borkdudegfredericks don't you think a global reference of exception message and possible explanations would be more useful?
15:21seangroveborkdude: I think that's the same thing
15:21seangroveJust pulled into the exception message directly
15:21borkdudeseangrove a reference could be more elaborate than an exception message
15:22borkdudeseangrove giving examples of how to reproduce the exception etc
15:22seangroveIdeally, both, I would think
15:23seangroveOr, just ruminating, both in a "training-wheels" mode for clojure
15:23seangroveWhere the tooling and runtime will try to help you out as much as possible, give you links, suggestions, etc. And when you turn it off, it assumes you know what you're doing
15:24borkdudeseangrove a special version of clojure: educlojure? ;)
15:24seangroveCould be pretty cool
15:24gfredericksX can't be cast to IFn could also use a helpful hint
15:25gfredericksgiven that I expect in only 0.007% of cases was somebody conciously interested in casting something to an IFn
15:25borkdudegfredericks yes, a very common one
15:25gfredericks"...alright, and then on this line I'm going to cast it to an IFn! What could go wrong?"
15:27gfrederickswat. this agda paper says that functions are not allowed to crash _and_ they have to terminate
15:27gfredericksis agda not turing-complete?
15:27borkdudegfredericks I think not, because it doesn't allow infinite recursion
15:28borkdudegfredericks total functional programming languages aren't turing complete in general
15:29gfrederickstotal == always-halting?
15:30borkdudegfredericks http://en.wikipedia.org/wiki/Total_functional_programming
15:30gfrederickswhy do people put up with languages that have reified "fixity"
15:30gfredericksI think at that point you need to give up and start using lisp.
15:31gfredericksdoes scala have fixity?
15:31borkdudegfredericks maybe "not Turing-complete" doesn't have to be a bad thing - maybe you can do very stupid things with a Turing machine you don't even want ;)
15:32gfredericksthat's why I thought it was an interesting question
15:32gfrederickssurely turing-incomplete means that it can't do some set of things, but it's not obvious that that set has to have useful things in it
15:33gfredericksholy crickey
15:34gfredericks"any algorithm for which an asymptotic upper bound can be calculated can be trivially transformed into a provably-terminating function by using the upper bound as an extra argument decremented on each iteration or recursion."
15:37pjstadigyeah, where have non-crashing, guaranteed terminating programs been all my life?
15:37dbushenko:-D
15:37borkdudegfredericks it feels like a trick to me, like the IO Monad… just satisfy the termination constraint by using a decrementing counter :P
15:38pjstadiggfredericks: what paper are you reading? I was just reading up on region-based memory management
15:38mthvedti think windows 9x had guaranteed terminating programs
15:38mthvedtbut they used the always-crashing technique, not non-crashing
15:41borkdudegfredericks I bet Haskell won't be good enough anymore after reading about this? ;)
15:41pjstadigi guess being turing incomplete means that agda can never be implemented in itself?
15:41pjstadigor maybe it can be implemented in itself, but you couldn't implement, like, Java or something
15:42pjstadigor simulate Java, or whatever
15:42pjstadigassume i know what i'm talking about
15:43borkdudepjstadig it just means that every program written in Agda has to be provably executed in a finite amount of steps
15:44pjstadigborkdude: but it also means that there are some computable functions that it cannot compute
15:46borkdudepjstadig are some computable functions taking forever?
15:47pjstadigturing complete means that you can simulate a turning machine, and a turing machine has been proven to be able to compute any computable function
15:48pjstadigbeing turing incomplete means that there are some computable functions that you cannot compute
15:48borkdudepjstadig my question was, can some computable functions take forever?
15:48pjstadigbut like gfredericks said "who needs those functions anyway"
15:48mthvedtborkdude: i think computable implies finite termination
15:49pjstadigborkdude: i don't know, but it doesn't seem relevant
15:49mthvedtare there any examples of useful functions that cannot be proven to terminate?
15:49gfrederickssorry guys I dropped out for a minute
15:49pjstadigi guess if non-terminating functions were not computable, then designing a language that guarantees termination would not make that language turing incomplete
15:49gfrederickspjstadig: http://www.cse.chalmers.se/~ulfn/papers/afp08/tutorial.pdf
15:50borkdudepjstadig it seems relevant, because I would like an example of a computable function that isn't computable in a total functional programming language
15:50mthvedtpjstadig: for any language that guarantees termination, there exists computable functions that cannot be expressed in such a language
15:50pjstadigborkdude: what does it mean to say that a total functional programming language is turing incomplete
15:50pjstadig?
15:50mthvedtthen you can make language n+1 to handle that computable function, but there will always be another
15:50borkdudepjstadig it is turing incomplete because it doesn;t allow some forms of recursion
15:51pjstadigok
15:51pjstadigi'm not sure if/when i said that a total functional language was turing incomplete because it disallows non-terminating functions
15:51gfredericksmthvedt: does this parallel the incompleteness theorem?
15:52borkdudeturing complete isn't a guarantee for a nice language, turing incomplete isn't a guarantee for a sucky language, hence, it says basically nothing
15:52devngfredericks: is this an improvement? http://imgur.com/oPxw0
15:52eggheadi'd say that one of the computeable things is to compute forever
15:52gfredericksborkdude: yesterday I would've bet $50 that turing incomplete guaranteed a sucky language
15:52pjstadigit says that there are some computable functions which your turing incomplete language cannot compute
15:52pjstadigi never said it made the language sucky
15:53mthvedtgfredericks: i don't know, but it wouldn't surprise me
15:53borkdudepjstadig if there are some, give me one
15:53borkdudepjstadig I'm just really curious =)
15:53pjstadigborkdude: i'm stating something which is definitionally true
15:53gfredericksmthvedt: same kind of structure; given a system, there's an X you can't prove. You can make a new system with X as an axiom, but then there's an X'
15:53pjstadigi don't have a particular example
15:53mthvedtyup
15:53gfredericksI guess that parallels the uncountability proof as well
15:54gfredericksthe set of things you might want to compute happens to be uncountable
15:54gfredericksso everything's related :)
15:54pjstadigborkdude: i would be interested in an example, too :)
15:54eggheadthis chat is reminding me of GEB
15:54mthvedti never studied formal logic, but i know a lot of those variety of non-constructibility take off of the incompleteness theorems
15:54gfredericksdevn: you are an odd man.
15:54mthvedtnon-constructibility proofs
15:54mthvedtincluding non-computability
15:54gfredericksegghead: not nearly enough punning
15:56gfredericksI'm gonna start a company where the only interview question involves summarizing the incompleteness theorem and the halting problem theorem. We'll never get anything done.
15:56gfredericksis the name "Busy Beavers" taken?
15:56borkdudegfredericks if you can keep the people from the bank eternally busy, your company will survive
15:57gfredericksbusybeavers.com is taken. I'm not going to go look at what's there.
15:57borkdudegfredericks lol
15:57seangrove,(zipmap [:a :b :c :d :e] ((constantly {}))) ;; how should I be doing this?
15:57clojurebot{}
15:58gfredericksTimMc: is this book really worth 460 pages of my time? Was it life-changing?
15:58gfredericksI'm not a guy with a pile of time.
15:58gfredericksseangrove: with less parens
15:58borkdudegfredericks btw, I started reading "The Annotated Turing", but I bet you've already read it
15:58gfredericksif your clojure code doesn't work, delete parens until it does
15:58gfredericksborkdude: I haven't
15:58dnolenborkdude: how would you write an Agda program that animates Conway's game of life indefintiely?
15:58pjstadiggfredericks: "Institute of Cybernetics" I want to work there
15:59gfredericksdnolen: remove the word "indefinitely" and allow the user to specify 10**1000 steps :)
15:59dnolengfredericks: yes but that's the point - it can't be done. You have to specify some time T which may be hihgly undesirable.
15:59gfredericksdnolen: is it undesirable in this case?
16:00seangrove,(zipmap [:a :b :c :d :e] (repeat {})) ;; how should I be doing this?
16:00clojurebot{:e {}, :d {}, :c {}, :b {}, :a {}}
16:00seangroveThere we go
16:00dnolengfredericks: uh, that's one example of pretty much every program anyone actually uses on their desktop.
16:00pjstadigyou just specify an upper bound that outlasts the universe
16:00pjstadignothing is non-terminating
16:00gfredericksdnolen: ^ exactly
16:02dnolenpjstadig: I suspect there may trouble specifying that in Agda, but I don't know Agda and I'd like to see that.
16:02borkdudednolen I don't know enough about Agda really, but I've seen you can define infinite datastructures. Maybe GoL can be expressed like an infinite data structure.
16:02dnolenI find the lack of results for game of life Agda on Google - unpromising
16:02pjstadigdnolen: neither do i, gfredericks is our expert :)
16:02gfredericks:P
16:03gfredericksdysinger keeps tweeting about it
16:03pjstadighow long is 2^64 seconds?
16:03dnolenAgda just recently was got a algorithm for typing records. I'm staying away.
16:03pjstadigseems like you could run a program for a really long time
16:04eggheadhey dnolen does core.logic have condi and conda too?
16:04gfredericksfrom the TFP wiki article: "Some classes of algorithms without a theoretical upper bound, but which have a practical upper bound (for example, some heuristic-based algorithms) can be programmed to "give up" after so many recursions, also ensuring termination."
16:04gfredericksegghead: condi is conde
16:04dnolenegghead: there is only condi. conde *is* condi. conda exists.
16:04egghead:O
16:04clojurebotGabh mo leithscéal?
16:04gfredericksit has conda and condu as well
16:05dnolengfredericks: yeah sounds like literring your program w/ Y2K bugs.
16:05eggheadgot a copy of reasoned schemer last week, been working through it w/ core.logic
16:05eggheadthe pattern matching stuff is original to core.logic ?
16:05gfredericksmore like ##(format "Y%dK" (rand-int 1000000000)) bugs
16:05lazybot⇒ "Y802326776K"
16:05gfredericksegghead: yep
16:05borkdudednolen Is a game loop considered computable in the world of computability? I guess it is?
16:06gfredericksthere's a lot of core.logic not in TRS
16:06dnolenmy bottom line for PLs, if you can't write video games in it - it's probably crap.
16:06pjstadigdnolen: hehe
16:06gfredericksborkdude: is this book mostly interesting for history?
16:07pjstadigdnolen: is that like some corrolary to Turing completeness...video game completness?
16:07dnolenpjstadig: haha
16:07borkdudegfredericks I don't know, I recently started reading it. It takes of with some mathematical foundations, like several orders of infinity (alephs)
16:07pjstadiglet's formalize it and call it "Doom completeness"
16:08pjstadigif you cannot write Doom in your programming language, then it is Doom incomplete
16:08dnolenhaha
16:08gfredericksI think that will hinge on the meaning of "cannot"
16:08borkdudegfredericks I like the style so far, I think it mixes history with theory, I like that
16:08borkdudelol
16:08gfredericksborkdude: I've read a _lot_ of infinity porn :/
16:09gfrederickspjstadig: dnolen: maybe a better approach is "if nobody has written Doom in your programming language..."
16:09borkdude"This language has been proven to be Pacman complete. TODO: prove Doom completeness".
16:10bbloomBronsa: i'm here now
16:10seangroveDamnit, I can't believe javascript has nothing in the language to tell you about memory usage
16:11dnolenegghead: in general core.logic offers a lot more than what is presented in The Reasoned Schemer.
16:12dnolenegghead: it also rolls the various miniKanren implementation into one. If we get alphaKanren in, it'll be all of them.
16:16gfredericksam I using clojure-mode wrong such that it doesn't create new semicolons when I newline inside a comment block?
16:18dnolenwell lookey here, re: Agda
16:18dnolenyou can write non-terminating programs in Agda it seems http://www.cs.swan.ac.uk/~csetzer/slides/goeteborg2009AgdaIntensiveMeeting.pdf
16:19gfredericksyou can write impure functions in haskell too :)
16:19gfredericksbut maybe this isn't done via cheating
16:20gfredericksSet must be the set of all finite types?
16:21gfrederickser...the type of finite types...
16:21dnolenanyways looks like they're likely to figure this stuff around 2030
16:22gfrederickswhy do they write code in non-monospace fonts :(
16:23tufflaxIs there a function that checks if a seq is a prefix och another seq? Like (prefix "clo" "clojure") => true
16:23bbloomgfredericks: for the same evil reasons they use fancy symbols instead of ascii: they hate us.
16:23borkdudegfredericks the trick might be called codata, but really I have never used Agda and don't know much about it either ;)
16:24tufflaxof*
16:24gfredericks,((fn prefix [a b] (every? (partial apply =) (map list a b))) "clo" "clojure")
16:24clojurebottrue
16:24bbloomtufflax: for strings, you can use java itnerop to .startsWith, or use a regex
16:24gfredericks,((fn prefix [a b] (every? (partial apply =) (map list a b))) "clo" "brojure")
16:24clojurebotfalse
16:25bbloomtufflax: or do what gfredericks does for more generality
16:25tufflaxyeah ok, thanks
16:25gfrederickswell
16:25gfredericksI guess mine isn't correct
16:25gfredericksgiven that
16:25gfredericks,((fn prefix [a b] (every? (partial apply =) (map list a b))) "clojure" "clo")
16:25clojurebottrue
16:25gfredericksthat should be false I imagine
16:25tufflax;)
16:25bbloomdnolen: i don't know much about Agda, is it destine to be the next Haskell?
16:26gfredericksbbloom: _I'm_ the agda expert here
16:26bbloomgfredericks: ok, then make with the explaining :-)
16:26gfredericksI don't know.
16:27gfredericksI've only been reading about this for an hour or so why should I have an opinion.
16:27bbloomhaha ok then
16:27bbloomyou did call yourself an expert
16:27gfredericksrelatively
16:28gfredericksbbloom: the idea that a total functional programming language can potentially do useful things was a surprise to me
16:35borkdudegood night all
16:36seangroveNested atoms - a bad idea, amirite?
16:37bbloomseangrove: you mean an atom in an atom? or an atom with a keypath that points to a location within the first atom?
16:37bbloombecause i was literally just thinking about the latter....
16:37seangroveAn atom within an atom
16:38bbloomseangrove: ah. ok well i dunno, that's not *necessarily* a bad idea
16:38bbloombut it means that the thing inside your atom loses some properties of a value, such as being serializable
16:39seangroveAh, yes
16:39bbloomit might be better to replace the nested atom with a name or an id pointing to a value in a map somewhere else
16:39seangroveI'm mainly using it for the watchers in cljs right now
16:39seangroveAnd just about to do what you suggested, more or less
16:39gfredericksseangrove: I think I had an atom in an atom in cljs at least once
16:39gfredericksbut I didn't feel good about it
16:40bbloomi think the question is this: can you reasonably assign a name to a value? (a symbol, a keyword, a number, a string, whatever)
16:40bbloomif yes, then avoid using atoms
16:41bbloomat the top level, when you have a whole db in a single atom, then you've got a name for it myapp.core/db
16:41bbloombut you wouldn't make myapp.core/user-123 :-)
16:43seangrovebbloom: slightly confused about your example
16:44seangrove"If yes, then avoid using atoms", but then you do give a name to /db
16:44seangroveAnd wrap it in an atom
16:44bbloomseangrove: the point i am making is that an atom is two things: it's an "identity" in hickey's model of state and time and it's a mutable reference cell
16:44seangrovegot it
16:45bbloomif you can supply your own identity, ie "user-123", then you don't has (as much) need for a mutable reference cell
16:45bbloomso avoid using one :-)
16:45seangroveI'm slightly worried about the overhead of swapping atoms frequently - say, a few times a second - with small-to-medium amounts of data (potentially with a few watchers, each of which will get the old and new data), in cljs
16:46seangroveI think that's more or less how datomic is done for vastly larger data sets though, so maybe I'm worrying about nothing
16:46seangroveI suppose the biggest cause for concern is that v8 and friends aren't going to get anywhere near the jvm
16:46bbloomseangrove: if there is no contention, and of course there is none in single threaded javascript, swapping is extremely fast
16:47bbloomand i think that v8 actually can get quite near the jvm in some cases
16:49seangrovebbloom: I'll implement it and see how it goes then. We're working within gmail, which is already slow and assumes it doesn't have to be considerate to anyone else
16:49seangroveEventually I'll probably have to find a way to cut up every single step of our app to operate in < 16ms chunks
16:50bbloomheh, yeah i do not envy anyone writing a plugin to somebody else's web app
16:50bbloomand i especially don't envy anyone doing it to a web app without a plugin system!
16:51seangrovebbloom: We've been kicking around the idea of a cljs email frontend (probably using gmail as the only backend) business webapp, with plugins in mind
16:52bbloomseangrove: you have absolutely no idea what you'd be getting yourself into....
16:52seangrovebbloom: Heh, well, we have a vague, vague idea. We've talked to some of the others who've done it
16:53bbloomthinkfuse's web app was practically an email client, despite not explicitly being one. the amount of work that went into dealing with seemingly simple things like rendering html email without blowing up the layout was astronomical
16:54seangroveWell, it's not anything we'll do in the short term
16:54seangroveI'll want to prove out a lot of other things before we take on a huge task like that
17:02gfredericksTimMc: I went with http://www.amazon.com/Elliptic-Tales-Curves-Counting-Number/dp/0691151199/
17:20timvisherhey all
17:21Bronsabbloom: yeah, sorry, i'm here too
17:21timvisheris there any way to discover what the value was that offended a pre-condition?
17:21Bronsaanyway, I've thought about it and I don't think it really makes sense to get namespace aliasing for tagged literals
17:22Bronsasince the namespaces used in tagged literals may not exist
17:28gfrederickstimvisher: I don't think there's a built-in way. easy to write a function wrapper that catches assertion errors and re-throws an ex-info with the args
17:30timvishergfredericks: wow. :(
17:30timvisheri guess there'd be no easy way to do that. You wouldn't want to throw a message that contained an infinite seq or something like that
17:30timvisherbut i was hoping for something more clever than that :\
17:32timvisherhmm. that really seems to throw a damper on my enthusiasm for pre and post-conditions, because the prospect of failure at a distance is pretty high. If I wrote a wrapper function, for instance, at the top level of my apis then i wouldn't have access to the arguments at the cause, would I?
17:38tufflaxI have a file with (ns my-ns), but when I check *ns* in the file it returns "user" when I run it via lein. Why?
17:39technomancytimvisher: there are ways to safely print possibly-infinite seqs
17:39ziltitimvisher: Maybe this could help? https://github.com/clojure/tools.trace
17:39technomancytufflax: because *ns* is bound in the entry point of clojure
17:40tufflaxtechnomancy, ok
17:41bbloomBronsa: hm that makes sense.... i guess that's why keyword alias resolution only happens for ::
17:41bbloomyou'd need like ## or something
17:41Bronsayeah
17:47timvishertechnomancy: simple function call? any link?
17:48timvisherzilti: looks interesting!
17:48ziltitimvisher: It's like a "call stack trace with argument- and return-values"
17:49ziltitimvisher: But if you're unlucky it can "break" the function call.
17:50timvisherzilti: nice :)
17:58technomancytimvisher: (binding [*print-length* 100] (pr-str (range)))
17:58technomancy
18:02timvishertechnomancy: sweet!
18:02timvisherthanks!
18:14weavejesterHi folks
18:14gfrederickshello mister jester
18:14weavejesterA slight off-topic question...
18:14devntechnomancy: that only works in the REPL though right?
18:14gfredericksweavejester: romney
18:14weavejesterHas anyone heard of a multi-user REPL
18:14gfrederickswould emacs give you that?
18:14weavejesterI'm thinking for teaching purposes
18:14dnolenk core.logic is about to go fully lazy
18:15gfredericksdnolen: like just switching the defaults? or is it a lot deeper than that?
18:15weavejesterI guess I'd like to avoid emacs. It's a great editor, but I'm not sure I want to teach someone emacs *and* programming at the same time :)
18:16aperiodicwhen i've been teaching tmux + lein repl has been pretty serviceable
18:16dnolengfredericks: the issue was that we were communicating occurs-check via binding*
18:16dnolener `binding`, it's now a field, so we can just go back to being fully lazy
18:16gfredericksah ha
18:16Raynesweavejester: I don't think there is anything interesting other than for Emacs at the moment.
18:16AimHereYou could just teach someone the basic notepad move-cursor-about-save-load stuff
18:16gfredericksdnolen: there was a lazy version of run already, wasn't there?
18:16bbloomi noticed that the implementation of split-with literally calls take and drop, so it traverses the sequence twice.... but it's actually a surprisingly difficult problem to preserve laziness for both the take and the drop and reuse the traversal between the two
18:17Raynesweavejester: ibdknox claims to have interesting ideas for that sort of thing in light table eventually.
18:17dnolengfredericks: it shouldn't make any difference to anyone except for people like myself running benchmarks
18:17weavejesterRaynes: That would be interesting
18:17dnolengfredericks: there was, but that was a hack and you couldn't set occurs-check
18:17gfredericksbbloom: I brought that up like a year ago and virtually everybody else thought it would be an overoptimization to do anything different
18:17weavejesteraperiodic: tmux might be an idea
18:18bbloomgfredericks: it's actually really complex to do something better....
18:18gfredericksI'm trying to see why
18:18bbloomgfredericks: i'm not proposing changing it, just thought it was interesting
18:18bbloomwell, right now, it's lazy in both terms. if you do split-at and then only look at the second part of the vector, it will only traverse once
18:18gfredericksdnolen: I dunno, I think newcomers expect laziness and it's weird when you have to switch from run* to run for an infinite resultset
18:19bbloomso if you wanted to be truly lazy, you need to not traverse EITHER half until somebody tries to traverse it... and then you want to preserve that traversal
18:19bbloomyou'd need a lazy seq object of some sort that can share state with the other one
18:19bbloompretty interesting how such a small thing can be so complex...
18:19dnolengfredericks: I'm not sure what you mean
18:19gfredericksbbloom: the point being to make sure that the function isn't called twice for any given element?
18:20dnolengfredericks: run* just means try to find all solutions
18:20gfredericksdnolen: if run* were lazy, then you could effectively ignore run and just use take with run*
18:20dnolengfredericks: well you can do that now if you like, but I think it's nice to have bound as part of the api
18:21dnolengfredericks: so you like (take n (run* ...)) go for it :)
18:21bbloomgfredericks: preserving laziness would mean that the second half needs to be deferred until the first half is evaluated. regardless of which half you use to evaluate it! and then only doing it once... it's tricky :-)
18:21bbloomgfredericks: but it doesn't matter... probably should use finger trees or something instead if you need fast indexed access
18:21gfredericksdnolen: you can do that now? I thought it diverges
18:21dnolengfredericks: btw, how did that core.logic meetup actually go? it's cool that you put that all together
18:21dnolengfredericks: yes that's what I'm fixing right now.
18:22gfredericksdnolen: it was great fun; I enjoyed it much more than doing a straight talk
18:22gfredericks60-90 minutes of 15-20 guys just hacking at exercise problems
18:22gfredericksI talked for 20 or 25 at first to present it
18:22gfrederickss/present/introduce/
18:22gfredericksit was awesome that 4clojure was so easily adapted
18:23gfredericksthose guys made some great code
18:24gfredericksbbloom: yeah, now that I get my head back into it I suppose it did turn into a shared state thing; I bet you could do it pretty easily by just closing over a shared sequence
18:25dnolengfredericks: that's great to hear, so people had fun w/ it?
18:25dnolengfredericks: I'm sad that core.logic FD code was so buggy around the time you were putting it all together.
18:25gfredericks(let [shared (map (juxt identity f) coll)] [(map first (take-while second shared)) (map first (drop-while second shared))])
18:25gfredericksbbloom: ^ zat work?
18:25dnolendone, http://github.com/clojure/core.logic/commit/3be00503588772c5ababd35f037a967fb00036e2
18:26gfredericksdnolen: I found that bug when I had a fun geometric idea I wanted to show; but yeah people had a lot of fun with it; the organizer said it was one of their best meetups
18:27gfredericksI could have made the 4clojure experience a bit smoother; there are a couple things that made it a bit ornery; but I was there to explain it so it wasn't too terrible
18:27gfredericksI feel sorry for whoever's been working on them in isolation since
18:28gfredericksI wonder how many people gave up without being able to figure out _.0 => _0
18:29dnolengfredericks: that's great!
18:29dnolenheh
18:30bbloomgfredericks: *shrug* i stopped thinking about it and went back to the more pressing issues :-)
18:31gfredericksbbloom: :P
18:31bbloombasically, i needed remove-nth and realized that was a dumb idea, so spent a few seconds thinking about javascript's splice function, realized that was a dumb idea too, and swapped out my vector with a sorted-map of id -> value and then life was good and went back to work :-)
18:31gfredericksbbloom: how does a sorted-map let you remove-nth efficiently?
18:31technomancyweavejester: someone said they were going to write a multi-user repl in this channel literally yesterday
18:32bbloomgfredericks: it doesn't. it replaces remove-nth with remove-by-id
18:32bbloomdissoc
18:32gfredericksbbloom: ah
18:33technomancyweavejester: it wasn't this, but this is also interesting: https://github.com/jamii/concerto
18:33technomancytmux is definitely as good as the current state of the art gets
18:33weavejestertechnomancy: I took a look at that one
18:34weavejesterI'm not completely convinced I'd start by teaching someone Clojure as a first language
18:34weavejesterIt needs a bit too much knowledge about the JVM
18:35technomancyyeah, it looks like nothing beats racket when it comes to existing teaching materials
18:35gfrederickslet's build hostless-clojure!
18:35technomancyluckily you can do a lot in racket without learning horrible procedural antipatterns
18:38bprtechnomancy: I'm using the clojure-test-mode on master, and it seems to work well, fyi (with clojure-mode from master and nrepl v.0.1.5)
18:40amalloytechnomancy, weavejester: you mean https://github.com/munrepl/server
18:40technomancyamalloy: that's the one; thanks
18:40technomancyliterally a day old
18:41weavejesterThat's interesting
18:41clojurebotNo entiendo
18:42technomancyweavejester: what's your take on concerto?
18:42weavejestertechnomancy: I haven't yet played around with it, but the source code looked a little rough.
18:46weavejesterI like the use of aleph and lamina to handle multi user commands
18:47weavejesterI have this idea for a REPL where each person gets a different colour prompt, but operates on the same environment
18:49technomancynrepl already supports multiple users
18:49technomancyit's just a matter of displaying feedback from other users
18:49technomancyshould be a nice fit for middleware
18:50AimHereEither that or interactive corewars. Winner is the guy who breaks the other two guy's repls
18:50technomancyAimHere: too easy =)
18:50technomancyrepls are fragile
18:50technomancyyou could build up defenses though
18:50technomancya self-healing repl
18:50technomancyhmmm
18:51Sgeoweavejester, how about a CodeNomic?
18:51technomancyAimHere: actually if you had some restrictions (rate limiting, thread limits, etc) that could be a lot of fun
18:51SgeoWhere each person can run code independently in a little sandbox-y thing, and people can propose code to vote for to effect the whole system
18:51weavejesterSgeo: A what?
18:51SgeoYou vote on system-wide changes
18:51SgeoAnd the code that manages that voting is, itself, code
18:51SgeoThat can be changed
18:51Sgeoetc
18:52AimHereweavejester> Nomic is some game where all players vote on the rules of the game, including the voting system
18:52weavejesterSgeo: Interesting idea
18:52AimHereweavejester, I don't think there's been an actual finished game of Nomic in history
18:52weavejesterAimHere: Oh, I've heard of that
18:52amalloy(inc AimHere)
18:52lazybot⇒ 1
18:53SgeoAimHere, why would anyone want to "finish" a game of nomic?
18:53AimHereWell the idea would be to win it, before everyone gives up and gets bored
18:53SgeoThere have been nomics that have been won
18:53SgeoAlthough the one I'm thinking of has rules such that winning doesn't end it
18:53AimHereReally?
18:53SgeoIt's been running since 1993
18:54Sgeohttp://agoranomic.org/
18:54SgeoI'm sure you could do a finite duration nomic though. Not sure if Suber's initial ruleset is geared to finite duration or not
18:55SgeoThere's also BlogNomic, which does a sort of theming thing. Everytime someone wins, the themed rules are repealed, winner decides new theme and is sort of an imperial ruler
18:55SgeoSo the rules never get too complex
18:55Sgeohttp://blognomic.com/
18:55jlewisi think there should be a law about the inevitability of a group of bored programmers to start talking about nomic
18:55jlewisit's just so tempting
18:56SgeoRishoNomic is long dead
18:56SgeoDoes that count as being finished?
18:57Sgeohttp://waxbanks.typepad.com/blog/2010/03/all-in-game-nomic-and-self-interest.html
18:57AimHereSgeo, well most nomics seem to just peter out through lack of interest, as far as I can tell
18:58SgeoAimHere, Agora has periods of disinterest and interest
19:51devni wonder what a game of nomic in datomic would look like
20:17n_bSo I have some Java source I'd like to call out to from my Clojure code - do I just drop the whole com.one.thousand.long.package.name structure into the src/ dir of my lein project?
20:18gfredericksprobably not
20:18gfredericksyou might have to compile it independently
20:19gfredericksmaybe there's lein support somehow or a plugin, but I would be surprised if any tactic like that just worked
20:19n_bAh
20:19n_bThis should be fun...
20:20gfredericksit's worth a try though :) I've never considered the situation
20:20gfredericksheck I might try it miself
20:20amalloyit really is (almost) as easy as that
20:20amalloyjust steal from https://github.com/flatland/clojure-protobuf/blob/develop
20:20amalloyset the :java-source-paths in project.clj, and dump your java in there
20:22gfredericksamalloy: I hadn't seen this project before; I'm curious why you can't do everything at runtime
20:22gfredericksalso does that import line in the example need a quote?
20:23amalloygfredericks: you mean all in clojure?
20:23gfredericksamalloy: that too
20:23n_bamalloy: That worked! You are the savior of my Hackathon project
20:23amalloywell, when ninjudd started the project deftype didn't exist yet
20:23gfredericksamalloy: that is a good reason.
20:23n_bjust spent hours trying to fix issues with JRuby and decided to give it a try with Clojure
20:24gfredericksruby was not made for the jvm :(
20:24amalloyand we want to wrap the java classes that protoc generates, so at least some of it has to happen not-at-runtime
20:24n_bI can't wait til they have to deal with refinements
20:24n_band by can't wait, mean "feel sorry for them"
20:24amalloyn_b: because what ruby really needs is more action-at-a-distance
20:25gfredericksamalloy: it's what developers want! it's tasty! it "just works"!
20:25gfredericksprinciple of least surprise or something
20:26amalloyspeaking of least surprise, i read about the difference between proc and lambda the other day. talk about a surprise
20:27gfredericksall that complexity just so things can be dottable
20:27amalloydottable?
20:27gfredericksyeah; foo.bar
20:27gfredericksmethods
20:28gfredericksmethods are the difference between procs and lambdas
20:28amalloynot the only difference
20:28amalloyi was actually referring to how "return" behaves inside a proc
20:28SgeoOh god Ruby
20:28gfredericksthat's what I mean
20:28Sgeo?
20:28gfredericksmethods:blocks::lambdas:procs
20:28gfredericksyes of course we have four different non-functions to make up for our lack of functions
20:29SgeoYou know what would be nice? If Smalltalk overtook Ruby
20:29bbloomamalloy: yeah proc and lambda are entertaining... but it actually makes sense in the world of ruby... it's a reasonably elegant solution to a problem you shouldn't have in the first place :-)
20:29SgeoRuby is a Smalltalk-like system poisoned by ugly syntax
20:29SgeoAnd changes
20:30SgeoAlthough Smalltalk also has a similar culture of monkey-patching I think
20:30SgeoIf method names were namespaced I would be happy
20:30bbloomyou could so something similar with dynamic variables and continuations in a scheme world. i forget which is which (proc vs lambda) but one of them would bind 'return to a continuation and the other wouldn't
20:31SgeoOh, I still want to port Racket's for/fold to Clojure
20:31bbloomsimilar to return, yield, continue, break, etc all that could be continuations as well
20:31gfredericksSgeo: what it is?
20:31bbloombut ruby hard codes them
20:31Sgeogfredericks, syntax sugar around reduce, basically
20:32bbloomSgeo: maybe you should refheap up some examples of what it would look like in clojure
20:32bbloomSgeo: don't even need to implement it yet, just curious to see what the usage would look like
20:33amalloyfor/fold looks like it would be very easy to write
20:34Sgeo....I just forgot what comment syntax is in... ok, got it
20:35amalloywell, maybe not
20:35gfredericksit's ; or #_ or the new clojure heredoc comment syntax ;-*;__
20:36amalloygfredericks: omg that really works!!1
20:36gfredericksmy emacs still doesn't make it easy for me to do multiline semicolon comments :(
20:37gfredericksI'm all manually "RET SEMICOLON SEMICOLON SPACE" continue typing
20:37amalloygfredericks: whaaaat. set the region and then M-;, right?
20:37gfredericksamalloy: heck I don't know anything about emacs
20:37amalloyM-; is a funny command "comment-do-what-i-mean"
20:38gfredericksI think gnome-terminal might be catching the M-
20:38gfrederickswell it does something
20:39gfrederickscurrently M-; seems to do what M-m does
20:39gfredericksoh wait there it did something different
20:39gfredericksamalloy: this might be useful
20:40gfredericksnot what I wanted but better than the current approach
20:40Sgeohttps://www.refheap.com/paste/7925
20:40SgeoI don't know if I got that right
20:41bbloomdnolen: ping
20:41dnolenbbloom: pong
20:42bbloomdnolen: i still really want some small bits and pieces of reified vars in cljs... what do i need to do to get you to seriously consider such patches? :-)
20:42SgeoDoes my example make sense?
20:42SgeoThe first vector defines accumulator(s), second vector is like the vector in a for form?
20:43dnolenbbloom: just not interested in considering it at all, maybe post bootstrapping
20:43amalloygfredericks: you could also try: ; type type type type type, no RET at all, type type type...done, M-q
20:43Sgeo(Although actually that's closer to Racket's for*/fold. for/fold doesn't do nested loops with multiple things in the thing
20:44bbloomdnolen: all i want is the 'var special form to create a Var object which is deref-able. it's actually quite easy to accomplish and doesn't even modify the binding macro in anyway
20:44bbloomdnolen: all it would do is when it sees #'foo it would turn that into (Var. 'user/foo (fn [] user/foo))
20:44devnAnyone know how to make datomic pick up the fact that I've required clojure.string :as s. I'm trying to call split within a datomic :where clause and it complains that it doesn't know about the namespace s.
20:45bbloomdnolen: given (deftype [sym deref])
20:45bbloomdnolen: maybe add in a 'meta too :-)
20:45bbloomthat'd be it!
20:45bbloomactually, probably not even meta
20:45gfredericksamalloy: oh I bet that would work; it just feels so wrong to not RET
20:45gfredericksI'm afraid if I don't RET all of a sudden notepad will pop up and I'll have to use that
20:45amalloygfredericks: i think if you set auto-fill-mode it would RET for you
20:46bbloomdnolen: it literally would have ZERO impact on any code that doesn't use (var x) or #'x
20:46gfredericksooh there's something to google
20:46bbloomdnolen: thoughts on that?
20:46amalloyyeh, it does
20:46dnolenbbloom: implementing reified var semantics piece meal seems half-baked.
20:46bbloomdnolen: well, you won't let me get fully baked :-)
20:46dnolenbbloom: also you're the only one that ever asks for this - so I'm not convinced there's any reason to do it as of yet.
20:47bbloomdnolen: i ask for them b/c i'm using them in my fork
20:47bbloomdnolen: and they work fine :-P
20:47dnolenbbloom: I could be wrong about that, of course and you could start a dev ML thread - but I think you have a specific use case in mind that others don't share.
20:47justincampbellim new to clojure, and id like to just play around with some code, but more than a repl
20:47justincampbellideally with vim and the makeprg
20:48justincampbelli tried setting up cake but when i cake run it just exits silently
20:48justincampbelldoes it make sense to use lein for exploration code?
20:48bosiejustincampbell: yes!
20:48justincampbell(coming from ruby if that helps)
20:48bosiejustincampbell: i come fromr ruby, i read a clj book. i use leiningen
20:48bbloomdnolen: i'm getting close to something that i can release, but it's useless if everyone needs to use my cljs fork :-(
20:48bosiejustincampbell: the advantage for leiningen (+ its repl) is also the dependency management. definitely go for leiningen
20:49devnnevermind, guess it just needed to be the fully qualified name: clojure.string/split instead of s/split
20:49justincampbellbosie: thanks!
20:49bosiejustincampbell: setting up vimclojure is a cake too
20:49justincampbellbosie: im upgrading to 2.x right now
20:49justincampbellyeah i did that last night
20:49gfredericksamalloy: well now I know more things. Thanks.
20:49dnolenbbloom: so demonstrate why you think it's a great idea :) And talk about it, I still have no concrete idea what you're going to use this for.
20:49bosiejustincampbell: though i switched to intellij :(
20:49dnolenbbloom: and by talk I mean on a blog w/ code examples, non-trivial usage etc.
20:51SgeoI guess I should be thinking about how I'd implement for*/fold?
20:52bbloomdnolen: *sigh* it's gonna be easier to just finish my thing with my forked cljs & then demonstrate that and my use case will become obvious.... i guess i better get back to work then
20:52Sgeo...come to think of it, it heavily reminds me of loop/recur
20:54dnolenbbloom: a simple nice use case is all that's required. I can't imagine your fork has significant changes for this to work, right?
20:54bbloomno, it's a pretty small set of changes
20:55dnolenbbloom: my concern is that your descriptions have been a bit abstract - it'd be easier to understand if there was a concrete - here's this pain point in CLJS programs that this could alleviate.
20:56Sgeoamalloy, if I have a macro that expands to (let [it <stuff>] ...body provided to macro...)
20:57SgeoWithin the body, is "anaphor" a good term to describe "it"?
20:57amalloysounds fine to me
20:58SgeoOk, thanks. Going to rant on my Tumblr now. Rant/feature suggestion
20:58bbloomdnolen: i'll get concrete as in code soon, but the main reason i've been abstract is b/c i've been iterating *a lot*. however, every single iteration of my scene graph project has a common element: you can assign dynamically scoped names to sub-views or sub-models.
20:58bosiebbloom: pardon, scene graph project?
20:59bbloombosie: it started as a GUI toolkit, but now the GUI parts are a plugin to a more general scene graph :-)
20:59dcbdevn: I think you are correct; functions within queries have to be fully qualified. see https://groups.google.com/forum/?fromgroups=#!searchin/datomic/fully$20qualified/datomic/IdtjQCp7vfs/NjtIl1-MAycJ
21:00bbloomand the HTML/CLJS parts are a plugin to the GUI toolkit! heh
21:00bosiebbloom: oh. i didn't know 'scene graph' is the name of a data structure
21:00Sgeo(tl;dr: I think allowing (let [somenamespace/something blah] ...) is useful)
21:01bbloombosie: it's not a particular data structure, it's just the general name for the data structure behind a simulation
21:01bosiek
21:01bbloombosie: in my case, it's a tree of maps
21:02bosiebbloom: hmm. reading a bit on wiki, would the same be used for something like google earth?
21:03bbloombosie: practically any modern graphical system uses some kind of scene graph
21:03bosiebbloom: fair enough
21:04justincampbellif i make a new lein project, how do i run the file in core?
21:04bbloombosie: there are two general rendering strategies: "immediate" and "retained". in the former, it's procedural, you draw things by mutating some drawing target. in a retained system, you general built on top of some immediate system, you have a scene graph and some immediate mode renderer
21:04justincampbelllein run says no :main defined, and if i do :main myprojectname it says it cannot find it
21:07gfredericks:main should be the namespace name
21:07gfredericksmaybe myprojectname.core ?
21:08marcelusI'm trying to inject some html into a goog.ui.Dialog object with cljs and I keep getting back what looks to be a vector [object Object] when ever I click the link that activates the dialog. here is a gist of the two files: https://gist.github.com/c2e1380e10faa59e6bdb
21:08SgeoAnd like an idiot I try out my Clojure code in the C++ section of IdeOne
21:08marcelusAny clues as to what the problem is?
21:08gfredericksSgeo: it didn't compile?
21:09gfredericksmarcelus: I think that's JS's normal toString for an arbitrary object
21:09gfredericksi.e., not a vector
21:09marcelushmm
21:10SgeoOk Chrome is really pisisng me off with its tendency to crash whenever I close a popup
21:10bbloomSgeo: sounds like a bad plugin.
21:10marcelusI was thinking that it was just returning a string representation of a clojure data structure
21:10bblooms/plugin/extension/
21:11dnolenmarcel: what is the type of :body
21:11dnolenwhen calling `create-dialog`
21:11dnolenmarcelus: ^
21:12marceluswell the server is returning html so the idea is to pull in a string (or the html if possible) in order to load it into the dialog
21:13marcelusnow I'm not so familliar with clojure so I might have fouled that all up but that is the intention here
21:13dnolenmarcelus: but Ajax requests are async - so it looks like you're returning a request object, not the value from the server.
21:14dnolenf is just the request object it looks like
21:16justincampbellCompiling fpoo.core Exception in thread "main" java.lang.ClassNotFoundException: fpoo.core
21:16justincampbellgfredericks: lein new fpoo, in project.clj i add :main fpoo.core, lein run, it says
21:16justincampbellgfredericks: sorry those are backwards
21:18marcelushmm
21:19marcelusdnolen: do you know of a way to print the type of a binding to the browser console?
21:19gfredericksjustincampbell: you'll need a function in that namespace called -main as well
21:20gfredericksyou can also use lein run with the -m option to specify arbitrary functions to call; that would let you avoid the :main option as well
21:20dnolenmarcelus: (.log js/console foo)
21:20Sgeo,`do
21:20dnolenmarcelus: https://gist.github.com/65ee1280c5c725ae9214
21:20clojurebotdo
21:20Sgeo,`let
21:20clojurebotclojure.core/let
21:20Sgeohm
21:20SgeoIf the reader can tell the difference..
21:20dnolenmarcelus: you want something like this ^, I've included some formatting tips :) code untested
21:20SgeoWait, I guess it can't
21:21Sgeo`(blah do let for recur loop)
21:21Sgeo,`(blah do let for recur loop)
21:21clojurebot(sandbox/blah do clojure.core/let clojure.core/for recur ...)
21:22gfredericks,`let*
21:22clojurebotlet*
21:22gfredericks,`[let let* fn fn* loop loop*]
21:22clojurebot[clojure.core/let let* clojure.core/fn fn* clojure.core/loop ...]
21:23marceluslet me give it a shot
21:27SgeoMy entire post may be worthless :(
21:28SgeoAre there any cases where anaphoric macros are very useful, and they can't just be turned into a non-anaphoric macro that accepts a symbol as a name for the thing?
21:29SgeoEven reset could be written as something that asks for a name to give shift
21:29SgeoI think
21:32amalloySgeo: i don't think that's a very useful point of view. any macro can be turned into just a function, if you require the user to...write more stuff. that doesn't mean macros aren't useful. what about loop, for example? if it were a macro instead of a special form, it would anaphorically introduce a function named "recur"
21:33amalloybut rewriting it to require a name for recur makes it pretty useless
21:33gfredericksmarcelus: google himera
21:34tpopeI felt so betrayed when I discovered fn and let and the like weren't actually special forms
21:34tpopeyou lied to me, Clojure Programming!
21:37gfredericksit was for your own good.
21:37gfredericks(that was also a lie, but it was for your own good)
21:38devnhttp://www.flickr.com/photos/conj/8223169413/in/photostream <--do you know this man? He was at the conj this year (obviously) but I can't remember his name.
21:39gfredericksdevn: oh that's rich hickey, the discoverer of Clojure
21:39marcelus^_^
21:40gfredericksthat photo makes me imagine that there was a long line of people for taking photos with rich
21:40devnthere wasn't
21:40marcelusI can so picture devn making an "I should have know that!" face.
21:40bbloomheh "discoverer"
21:41devnmarcelus: do we know one another?
21:41Sgeoamalloy, anyone else interested: v
21:41Sgeooops
21:41Sgeohttp://sgeo.tumblr.com/post/39178562890/namespaced-anaphors-in-clojure
21:41marcelusno we do not most likely.
21:41tpopedevn: first you forget rich, now marcelus? :(
21:42marcelustpope: stop trying to mess with devn's mind. :D
21:43gfredericksdevn: I met one of you bendyfolks at strangeloop
21:44marcelushmm it seems like clojurescript doesnt generate an implicit argument for functions that are to be used as callbacks
21:44marceluswell at least that is what the warnings I am getting suggest
21:44devngfredericks: probably chris wilson
21:44gfredericksdevn: yep
21:44dnolenmarcelus: that doesn't make sense.
21:47marcelushe ran away
21:48xeqimaybe he closed emacs.. but who would do that
21:49n_bI have a Java object to which I want to do something like (defn [obj & args] (-> (apply (.invoke obj) args) (.getResult)) but I'm not having much luck and think I'm approaching it in the wrong way
21:51gfredericksn_b: so you don't know what method you're going to call until runtime?
21:51n_bargs have variable arity
21:51gfredericksgiven you don't know the length of args until runtime
21:54n_bOh
21:54n_bNo, I do
21:54n_bThis works just as well as the fancy version: (defn call [cl srv mthd arr] (. cl getResult (.invoke cl srv mthd arr)))
21:54seangroveHow can I apply dissoc with a seq of keys with swap!ing an atom?
21:54n_bI overthought it
21:54seangrove,(let [ex (atom {:a 10 :b 5 :c 0}) to-remove (map first (take 2 (sort @ex)))] (swap! ex dissoc to-remove) (count (keys @ex)))
21:54clojurebot3
21:55seangroveI can just write a little function, but seeing if there's nice syntax for it
21:55amalloy(apply swap! ...)
21:56seangroveAhem
21:56bbloomseangrove: confusion with set! ?
21:56seangroveThanks amalloy :)
21:58seangrovebbloom: Could be it I suppose. I'll look at the source of some of this stuff
22:05marcelusthe himera page should be linked on the clojurescript github page
22:06marcelusI had run into it before today but forgot it existed.
22:07gfrederickswhy? anybody starting out in clojurescript should be expected to think "Oh, I should google for 'Himera' just in case there are any interesting and relevant results."
22:08hiredmanmarcelus: have you seen the various nrepl clojurescript options? himera is dated
22:08marcelushave not
22:09marcelusi happen to be using dotcloud so I would be thrilled if I could rig a browser connected repl over that
22:09hiredmanmarcelus: https://github.com/cemerick/piggieback
22:10marcelusI know its possible to run clojure on that service as they allow jvm but i've had issues running php in interactive mode with it
22:11hiredmanbrowser connected repl?
22:11hiredmanmost people mean "a repl that evaluates code in the context of a browsers js runtime" by that, is that what you mean?
22:12marcelusyea
22:12hiredmanso how does dotcloud figure in to that?
22:12marcelusbasically you can evaluate cljs and stuff happens in the browser window
22:12marceluswell ive only ever seen this done on the same machine
22:13hiredmanright
22:13marcelusI hate dealing with configuring servers so for the project im working on i use dotcloud instead
22:13marcelusjust rsync code over to it and run
22:13marceluslike heroku without the git dependency
22:14hiredmansure, but none of that explains how dotcloud figures in to your browser connected repl
22:14hiredmanyou don't want to install the cljs compiler locally?
22:15marcelusno I dont want to bother with installing the webserver, and mysql locally
22:15marcelusthough I probably will tomorrow
22:16marcelusi'm just wondering if anyone has ever configured something like brepl to work over a service like it
22:37marcelushiredman: https://gist.github.com/c2e1380e10faa59e6bdb might you know why I keep getting this Uncaught TypeError: Object [object Object] has no method 'call' in the generated js?
22:38[1]tufflaxAre there functions like slurp and spit but for binary files? Or what is the easiest way to do something like that?
22:39gfredericksyou want byte arrays?
22:39marcelusThe xhrio object definitely has the data I want coming back. however when the js goes to execute my callback it gives that error method.
22:39[1]tufflaxI want to download and mp3 from the web and save to disk
22:39tufflaxan*
22:42tufflaxgfredericks, so yeah, maybe byte arrays would to it
22:43gfredericksif flatland doesn't have a good lib for that I'll be disappointed
22:46technomancytufflax: you can call copy on an input-stream from a URL
22:46technomancyjava.io.copy
22:51ynnivis there a def that only sets a value if it wasn't already defined?
22:54bbloomdefonce
22:56ynnivbbloom: most excellent
22:59tufflaxtechnomancy, ah nice! thanks
23:12bbloomwhat can cause exceptions to say [trace missing] ?
23:18marcellus1f
23:18bbloomUnable to resolve symbol: f in this context
23:19marcellus1haha wrong window, woops!
23:19Raynesdsantiago: You around?
23:30technomancySgeo: someone has done it
23:30Sgeotechnomancy, o.O
23:31technomancybut nobody uses it because the person who ported it can't stop going on about how great they are and how horrible non-hygenic macros ore
23:31technomancyare
23:31technomancyit's really tiresome
23:31Sgeo:/
23:31SgeoHygienic macros are better when you don't need non-hygiene, I guess, but...
23:31marcelus:(
23:32SgeoAlso non-hygiene is easier to understand IMO
23:32technomancyI dunno; auto-gensym solves every problem I've ever encountered or heard about with non-hygenic macros.
23:32bbloomtechnomancy: auto-gensym + namespace resolution
23:32bbloomthat last part is very important :-)
23:32SgeoI think Racket-like hygienic macros might be useful for very simple templatey cases
23:32SgeoMore convenient
23:33technomancybbloom: right; auto-qualification
23:33SgeoAlso for porting Racket macros >.>
23:33SgeoSuch as for*/fold
23:34SgeoEvery Lisp and its mother uses #' to mean something else
23:35technomancySgeo: elisp uses it to mean "hey everyone, I'm a CL programmer who either doesn't understand that this doesn't do anything in elisp or wants to vaguely protest that fact."
23:36technomancyis anyone using the new clojure-test-mode with nrepl.el? wondering if that is pretty stable at this point
23:43ynnivhmm, does anyone know how to specify multiple acceptable classes in enlive?
23:43ynnivseems like it might require code
23:46ynnivah, nice, you can specify alternatives using sets