#clojure logs

2013-06-17

00:00ddellacostacemerick: but self-hosting cljs would probably be better anyways, if you mean something loading in the browser env itself (?)
00:00dnolenhrm was going push out the first core.match beta but doesn't seem to want to build ...
00:00cemerickddellacosta: yup
00:01ddellacostacemerick: gotcha. Yeah, that would certainly be the best I think.
00:02tomjackhmm, you've discovered a new collection type? :)
00:02ddellacostaalright, I'm going to grab some lunch. cemerick: thanks for the help and pointers, I'll keep trying new things and try to communicate any new strategies I learn for getting my workflow/tooling smoother.
00:02dnolentomjack: doubtful :)
00:02cemerickddellacosta: https://github.com/kanaka/clojurescript/
00:03ddellacostaah, sweet.
00:03cemerickddellacosta: np, and thanks :-) Maybe I'll squeeze off a 5m video sometime :-)
00:03ddellacostasad the last commit is 4 years back. :-(
00:03ddellacostacemerick: that'd be great!
00:03cemerickwhat, no
00:03ddellacostaoh, maybe wrong branch then
00:04ddellacostayeah, that's weird, huh, since the README reference 2013
00:04ddellacosta2012 I mean
00:04cemerickddellacosta: something's wonky...cljs isn't even two years old
00:04ddellacostayeah, good point..heh
00:04tomjackdnolen: looking at Complier that's really the only explanation I can think of, though..
00:04ddellacostacemerick: yeah, clearly the commit log shows recent commits, so something is weird there. Anyways, will check it out.
00:05dnolentomjack: eh, probably Hudson weirdness
00:05tomjackall the constructor calls for EmptyExpr are guarded with IPersistentCollection checks
00:06tomjackbut it's not a list, vector, map, or set? boggling
00:06cemerickdnolen: I'd try wiping the hudson workspace and triggering a new build
00:06dnolencemerick: how do you do that?
00:06cemerickdnolen: click on workspace, then 'wipe'
00:07cemerickthen start a build
00:07tomjackhmm, PatternRow is a new collection type, irrelevant?
00:07dnolencemerick: ok giving that a shot
00:08cemerickdnolen: that's the "clean" of the hudson world :-P
00:08dnolentomjack: hrm, but why would that matter?
00:09dnolencemerick: didn't work
00:09dnolentomjack: and PatternRow has been a collection for a long time now
00:09tomjackbut you just started AOT'ing, yes?
00:10tomjackdoesn't make sense that it would break on hudson and not locally though
00:10cemerickdnolen: your project.clj requires clojure 1.5, but the default contrib pom specifies 1.4?
00:10tomjackactually
00:10tomjackI get the same error locally
00:10dnolentomjack: yes I've been testing AOT locally
00:11dnolencemerick: oh hmm
00:11dnolentomjack: what are you doing to repro?
00:11tomjackmvn compile
00:12tomjackfrom master
00:13dnolentomjack: yeah just tried that worked
00:14dnolenoops actually spoke too soon
00:16tomjackif PatternRow were the culprit I'd guess some macro would have to be returning one in the code it emits?
00:17tomjackand an empty one
00:20dnolentomjack: pretty sure it's as cemerick says 1.5.0 issue
00:23tomjackseems so
00:23tomjackwhich is even more confusing to me
00:25tomjackbecause EmptyExpr seems the same in the relevant respects
00:25dnolenhuzzah
00:25tomjackif not all respects
00:25dnolencore.match-beta1 is out!
00:26dnolenno more scary AOT warnings!
00:41dnolenit's remarkably satisfying that this stuff "just works" in CLJS
00:53tomjackso, what, using as-> and cond-> caused that crazy compiler error? O_o
00:54dnolentomjack: no, I think marker protocols was the problem
00:58tomjackinteresting
01:00tomjackhttps://groups.google.com/d/msg/clojure/7xa7Yg0-htc/fG1HuBozewwJ
01:00tomjackso the fix was a workaround in emit-protocol
01:03dnolenbeta2 going out
04:14ddellacostaso, "null" and nil are not the same thing in ClojureScript??
04:14lazybotddellacosta: Uh, no. Why would you even ask?
04:14ddellacosta??
04:14lazybotddellacosta: What are you, crazy? Of course not!
04:14mthvedt??
04:14lazybotmthvedt: Uh, no. Why would you even ask?
04:14ddellacostadidn't know lazybot did that. heh.
04:14mthvedtlazybot: are you well programmed??
04:14lazybotmthvedt: Uh, no. Why would you even ask?
04:15r0bgleesonddellacosta: did what, aritificial intelligence?
04:15ddellacostar0bgleeson: no, responded with something specifically when you had double-question marks (if my conclusion is correct.)
04:16ddellacostar0bgleeson: although, I guess maybe that's what you meant, so yes.
04:17r0bgleesonddellacosta: i was making a lame joke :)
04:17ddellacostar0bgleeson: ah, haha…sorry, I'm feeling a bit slow at the moment. ;-)
04:47Guest15375@borkdude Hello
04:47borkdudeGuest15375 hi
04:48Guest15375@borkdude Nathan and Bram here, we have a question
04:48borkdudeyes
04:49borkdudeI'll turn on Skype
04:50Guest15375@borkdude Is good, are you available on the HU?
04:50borkdudeGuest15375 my skype name is michielborkent - no, from 14:00 I'm at the HU
04:51Guest15375@borkdude Inventation has been sent.
04:55wei_how do you serve a static html file in a compojure route?
04:59clgvwei_: route/files
04:59clgvwei_: with compojure.route :as route
04:59wei_clgv: could I give it a name that's not the original filename?
05:00RaynesEh
05:00wei_oh i se
05:00Rayneswei_: Just do (let [static (slurp your-file-or-resource)] (defroutes …)) and serve it however you like it.
05:00RaynesThat's what I do.
05:00RaynesMore or less
05:01wei_thanks
05:01clgvRaynes: but that keeps the file in memory which is not suitable in all use cases (very many large files...)
05:02Raynesuh
05:02Raynesclgv: If your HTML files are that large, you're going to have a hell of a time serving that data at any decent rate anyways.
05:03RaynesUnless you've got 20 100MB HTML files, you're probably okay.
05:03clgvRaynes: oh, the question was to html files only - I did miss that ;)
05:04wei_there are huge html files, but mine is not one of them
05:08bsmithhi, i'm new and trying to understand code from ring
05:08bsmith(defn- ^SimpleDateFormat formatter [format] ...)
05:08bsmithdoes ^SimpleDateFormat have any effect here? or is it just to communicate the return type to the reader?
05:09antares_bsmith: and to the compiler, too
05:11bsmithwhat effect does this have during compile-time or run-time? will it throw if the function returns a different type?
05:11bsmithis there a doc on clojure.org that explains this? sorry, i couldn't find one
05:12borkdudebsmith this is called type hinting
05:12borkdudehttp://clojure.org/java_interop#Java Interop-Type Hints
05:12antares_bsmith: Clojure functions are compiled to Java classes that have invocation methods. They can take arguments of specific types or just Object, the same goes for return value.
05:13antares_bsmith: Clojure compiler only considers type hints as advice and has limited type inference. it does not perform type checking. JVM also performs very little type checking but mis-hinting argument types won't come unnoticed most of the time, at runtime.
05:14bsmithgreat, thanks to both
05:14antares_bsmith: I highly recommend http://clojure-doc.org, by the way
05:15callenjust wish clojuredocs would get updated.
05:15callenantares_: how do you feel about a clojurewiki?
05:16antares_callen: not sure what that is
05:17callenantares_: thinking of making a wiki for Clojure, like EmacsWiki
05:18antares_callen: well, if the goal is to improve Clojure doc guides, just contribute to clojure-doc.org
05:18antares_(which has a bit too much stuff because of how enthusiastic we were in the beginning, admittedly)
05:19antares_emacswiki has *a lot* of stuff Emacs docs will never cover
05:19callenantares_: contributing to clojure-doc is really annoying.
05:19antares_for that, more resources make sense
05:19antares_callen: how?
05:19callenantares_: and AFAICT, it doesn't really cover the core docs use case like clojuredocs.
05:19antares_it's markdown in a pull request on github
05:19callenantares_: dude, that's unacceptable. I'm sorry.
05:19antares_how much more straightforward can it be?
05:19callenantares_: it's about friction, not obviousness.
05:20antares_callen: hm
05:20antares_callen: have you tried contributing to clojure at all?
05:20antares_THAT'S unacceptable and friction
05:20callenantares_: I really don't care about core dev in this context
05:20callenantares_: their sins don't excuse yours.
05:20antares_callen: you can literally edit markdown on github.com
05:20callenwhy is it easier to accumulate knowledge collaboratively for a text editor than a programming language + ecosystem?
05:20callenantares_: yeah, still don't care.
05:21antares_how much more convenient can it be?
05:21callenantares_: it's not, at all.
05:21antares_callen: sounds like you just "don't care for markdown". I don't care for wikis.
05:21callenit has nothing to do with markdown
05:21antares_wikis are too hard to keep structured
05:21callenin fact I planned on using md for the wiki.
05:21antares_callen: then how is it radically easier to edit a wiki page?
05:21callenif you don't understand the value of immediacy I can't really help you.
05:21callenantares_: just say, "no, I don
05:22callen't see the value of a wiki"
05:22antares_callen: I really don't think people contribute solid docs on the spot
05:22callenand leave it at that.
05:22antares_like, let me JUST WHIM OUT SOME DOCS, RIGHT NOW
05:22antares_no, that's not how it works
05:22callenyou clearly haven't worked on a wiki.
05:22antares_callen: yes I have, for many years. It's fucking terrible.
05:23antares_wikis are undstructured mess unless you have an army of people and rules enforcing the structure, like Wikipedia does
05:23antares_you same some time for writers
05:23antares_and waste oceans of time for readers
05:23antares_in any case, I don't mind you starting a wiki
05:23antares_clojure-doc.org content is "free to steal", CC 3.0 licensed
05:23antares_I don't believe the language documentation needs another resource
05:24antares_and API reference (clojuredocs.rg) has nothing to do with clojure-doc.org, it was never a goal to provide an API ref
05:24callenantares_: I didn't say it was
05:24antares_the new clojuredocs.org, whenever it is ready, can be integrated into clojure-doc.org
05:24callenantares_: I wasn't talking about clojure-doc at all.
05:24antares_but it's still a separate resource, with an API
05:25antares_callen: there is a wiki at dev.clojure.org for the cool kids with paper CA (read: living in America)
05:25antares_it's not updated very often
05:25callenantares_: I hate JIRA
05:25antares_in theory, it provides the benefits of a wiki
05:25callenand I don't want a wiki that requires CA
05:25antares_that I can understand
05:25callenantares_: if you're going to offer suggestions, at least think first.
05:25callenantares_: if I want a low friction way to accumulate knowledge about clojure and the wider ecosystem, why would dev.clojure suffice?
05:26antares_callen: you know what, I will probably go work on some OSS code instead of arguing you
05:26callenantares_: I just wanted to know if the notion of a wiki seemed useful to you or not.
05:27callena simple no would've sufficed.
05:27antares_callen: wikis suck. There is no need for another doc resource. Spend your time helping with the new clojuredocs.org. That's all I have to say.
05:27callenwhat new clojuredocs?
05:27callenas far as I aware, it was derelict.
05:27antares_clojuredocs.org in Clojure, without being locked into a particular version http://github.com/clojuredocs
05:27antares_and with an API
05:28antares_the repo name is eisago
05:29callenantares_: it was last updated 7 months ago.
05:29antares_callen: I will write a blog post about it
05:29antares_callen: so?
05:30callenand it's still not live
05:30antares_callen: the original author no longer has time
05:30antares_callen: are you arguing to death about anything or just with me?
05:30antares_fuckin make it go live
05:30callenwhy invest effort with no guarantee it would go live?
05:30antares_hahahahaha
05:30antares_callen: that's not how OSS works
05:30antares_finish the code, deploy it, here, you have it live
05:31callenit's not even what I want
05:31callenwhat I want is the core docs + wiki
05:31callenI don't give a damn about an API either.
05:31antares_callen: it is what clojuredocs.org has today
05:31antares_+ API
05:31antares_callen: well you don't but it's useful
05:31antares_a yet another wiki? no
05:31antares_tools developers care about API reference having an API
05:32antares_IDE plugin authors, nrepl integration hackers, etc
05:33antares_you think I asked someone's permission to start clojurewerkz.org or clojure-doc.org, making sure it is "guaranteed to go live"? No, we just did it, it is live. That's how things work in the OSS community.
05:33callenantares_: I've run into problems in the past where somebody else owned the domain/trademark and I couldn't deploy a copy
05:33callenantares_: and if I wanted changes to go live, I had to harass them
05:33callenantares_: please stop pompously educating me on how "OSS works"
05:34antares_callen: well, if you develop a clojuredocs.org replacement, I will point api.clojure-doc.org or reference.clojure-doc.org to it, I promise
05:34callenI've already said it isn't what I want, contributing to it wouldn't make sense.
05:35antares_callen: I have no idea what you want then, but it's clearly something that YOU have to do
05:35antares_contributing to things that are useful to the community are not your thing, I gather
05:35callenno, it just makes sense.
05:35antares_good luck. No need to ask anybody for an opinion next time :)
05:35callenif I don't understand what I'd want out of it, I'm less capable of producing something nice and useful.
05:36callenThat's just basic usability.
05:36callenall I wanted to know was if a wiki would be useful. Not to be put through the wringer.
05:37antares_ok, I'm sorry
05:39callenantares_: it's fine, I just find it puzzling how people seem to think spontaneous content creation that doesn't belong to Stack Exchange wouldn't be useful.
05:42antares_it is useful, I was talking about language documentation
05:46callenantares_: well if the new clojuredocs is a thing, then I can just focus on the wiki and hope that comes together.
05:47antares_callen: most of it is done, I hope to work on it after we ship our next clojurewerkz library
05:48antares_it also has a library that extracts docstrings and such from the code
05:48antares_at the very least you can reuse that
05:49callenantares_: oooh, what's the next clojurewerkz library?
05:49antares_http://clojurecassandra.info
05:49callenVery cool :)
05:49antares_needs the docs finished and a proper announcement, currently at RC4
05:50antares_built on the new DataStax Java driver, pretty similar to clojure.java.jdbc in scope and API style
06:26noncomwhy does in COMPOJURE something like (GET "/test" [] {:a "aaa" :b "bbb}) retuns an empty page with no html code at all, and (GET "/test" [] (str {:a "aaa" :b "bbb})) returns a page with the textified map?
06:27noncomi mean why does not it turn the map into text by itself and yields nothing from it?
06:27mpenetbecause when you return a map it's supposed to follow the response spec
06:27mpenetfrom ring
06:27mpenet{:body "prout"}
06:27mpenetif you want an output
06:28mpeneta string return value will be fed to :body automagically
06:28noncommpenet: oh i see! nice thing actually! didn't get to this point at docs, but thank you!
06:28mpenetnoncom: https://github.com/ring-clojure/ring/blob/master/SPEC
07:05m00nlightHi, if I build an web app using compojure, I can access the app through the localhost or even the machine in the same cluster, but can not access outside, what probabilily make this ? I can not access even I close the iptables
07:13noidim00nlight, maybe your behind a NAT?
07:13noidi*you're
07:13m00nlightnoidi: Yeah, I think so. My personal computer behinde an NAT,
07:15m00nlightnoidi: So what maybe the problem?
07:18noidim00nlight, you need to forward a port on the NATing device to your computer
07:18noidim00nlight, http://en.wikipedia.org/wiki/Port_forwarding
07:20m00nlightnoidi: if the server has an external IP, I still need forward a port?
07:20m00nlightnoidi: The server has an external IP address
07:21clgvm00nlight: you are probably behind a router and need to forward the port at the router to your server
07:23m00nlightclgv: If I can not make change to the router server, is there any way to solve it? I can do anything on the server my application was on
07:24clgvm00nlight: you definitely need the system that is "in front of" your server to forward the port
07:26m00nlightclgv noidi: Thanks for your help
07:30clgvm00nlight: just to clarify, you rent a server in a computing center?
07:46lozhi
07:47lozhow should i install data.json library?
07:47lozif i dont have a clojure project, its needed for rails/clojurescript?
08:01cemerickloz: Neither Clojure or ClojureScript libraries are "installed". They are obtained and tracked by a project file like those used by Leiningen.
08:04lozcemerick: i already found jar snapshots
08:05lozbut i still got
08:05lozException in thread "main" java.io.FileNotFoundException: Could not locate clojure/data/json__init.class or clojure/data/json.clj on classpath:
08:05cemerickloz: are you using Leiningen?
08:05lozi dont have clojure project
08:06cemerickthat's problem #1
08:06lozdoes this error mean data.json is not in classpath?
08:07cemerickyup
08:14lozcemerick: should i add to classpath every .jar which bootstrap downloads?
08:14lozlike google-closure-library-0.0-2029-2.jar
08:15cemerickloz: Unless you have a really good reason, you should be using leiningen.
08:15lozits rails dude
08:16lozand there is plugins for rails wich downloads and setups clojurescript
08:16lozplugin*
08:16lozand looks like this plugin is a bit outdated
08:16cemerickloz: don't konw what to tell you then. I suspect you'll find everyone else here (whenever they wake up, ;-) will repeat the same line about leiningen.
08:17cemerickperhaps ask whoever put together this rails/clojurescript integration how things are supposed to work there?
08:18lozokey, ill continue my investigation)
08:19tomjackscript/bootstrap should download data.json
08:20loztomjack: yep, but plugin doesnt include it into classpath
08:20lozgonna include every jar bootstrap downloads
08:20lozand try
08:20lozls
08:20lazybotdev etc lost+found media root src
08:21lozhaha lol
08:23cemerickloz: could you link to this rails/clojurescript thing?
08:23lozsure
08:23lozhttps://github.com/maximvl/clementine
08:23lozthere is a blog post link on how to setup it
08:25lozoh and i gave you my fork link)
08:25cemericknp
08:25cemerickso this clojurescript source tree in /ext -- this is an example of the whole rails "vendoring" practice?
08:26lozidk im new to rails :D
08:28cemerickfunny, reminds me of JSP precompilation
08:29lozis this code correct?
08:29loz(ns app)
08:29loz(defn ^:export init []
08:29loz (js/alert "initializing!"))
08:29loz
08:29lozwant to call ns.init() from html
08:30loz*app.init()
08:31lozcause now i get
08:31lozException in thread "main" java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol
08:31loz
08:39xeqicemerick: looks like thats a ruby project, but its a similar concept
08:40cemerickxeqi: Yup. Quite upsidedowninsideoutbackwards to me, but whatever. :-)
08:41xeqiheh, its recommended for external code. here is a rubygems guide showing it for a C wrapper http://guides.rubygems.org/c-extensions/
08:42cemerickxeqi: don't mind me being curmudgeonly. I'm merely a ruby/rails observer, never used the stuff.
08:43xeqicemerick: well now you've peaked my curiousity. Hows jni or the .net equivalent find the native code?
08:44xeqi*piqued
08:45cemerickxeqi: You can put C or C++ right into a .NET project, the tooling there saves you all of the legwork needed for mixed architecture stuff elsewhere. There's some details around whether the resulting assembly is managed or not, but I've long forgotten them.
08:47cemerickxeqi: JNI is a PITA. JNA is much more sane...and even so, it's *really* rare to have a mixed e.g. C + #{Java, Clojure, Scala} codebase. Generally, you're just linking to a library pulled from apt or whatever.
08:48lozxeqi: do you have any experience with cljs on rails?)
08:48cemerickRails aside, it seems to be a common thing in ruby only because so many of its modules are apparently thin C wrappers
08:49hyPiRionxeqi: oh, JNI is painful. Anything very low-level is painful in general
08:50xeqiloz: nope
08:51cemerickhyPiRion: ever used JNA? It wasn't so bad, last time I used it (~2 years now)
08:54hyPiRioncemerick: I was more thinking about low-level jvm stuff, such as catching POSIX signals or throwing file decriptors from a process to another
08:54hyPiRionI managed to find a way to catch POSIX signals, although if the method which handles the exceptions throws an exception you end up with a segfault
08:55hyPiRion/s/exceptions/signals/
09:23futilemthvedt: it's gonna be kinda weird that each "group" is self-contained, because each one's :parent key will contain another group, rather than reference it.
11:01stuartsierraJNI isn't that bad. You can skim the docs and get something running in half an hour.
11:04winkthat's like "you can skim the recipe and not die eating what you cooked"
11:05llasramThat is the best analogy I've heard all week
11:05bprthat is pretty classic
11:07janpaulbultmannAny thoughts on how to do co recursion with let bindings? akin to this https://gist.github.com/ticking/5797558
11:09llasramjanpaulbultmann: Lazy sequences which references themselves sometimes work, but as an implementation side-effect. They generally are not a good idea
11:11janpaulbultmannllasram: thanks, noted :)
11:24mikerodHas anyone used clojure-maven-plugin and experienced it hanging for a pretty long time when compiling the last Clojure file. The file doesn't seem to matter, it just freezes up a while after the last "Compiling file.clj" line.
11:25Lajjlamikerod,
11:25Lajjlathe Ashtadhyayi is the single most brilliant thing ever made by man
11:28mikerodLajjla: I'm not sure I follow you...
11:28Lajjlamikerod, do you know what it is?
11:28mikerodI had to look up this Ashtadhyayi, and the most relevant meaning I could find is its relation to language theory.
11:28LajjlaIt's essentially a formal definition of the grammar of Sanskrit in some sort of backus-nauer esque form
11:28Lajjlamade 400 BCE.
11:28LajjlaA formal definition of the grammar of a natural language.
11:28LajjlaAt that time
11:28LajjlaIt took up to the 20th century before western linguistics could catch up.
11:30mikerodLajjla: That is quite interesting. hah
11:31mikerodLajjla: You found that this relates to clojure-maven-plugin? :)
11:31Lajjlamikerod, panini also innovated the destinction of the phone to the phoneme
11:31Lajjlamikerod, not at all.
11:31LajjlaIt is far more important
11:31Lajjlabecause it is the single most brilliant thing ever
11:32Lajjlathe Ashtadhyayi fully defines the grammar of sanskrit with zero redundancy
11:32ohpauleezit's unclear if this is spam or a troll
11:32ohpauleezbut either way, it's irrelevant
11:32mikerodLajjla: Well, I am enlightened now.
11:32ohpauleezhaha
11:32ken_barberlol
11:33Lajjlaohpauleez, please, this is something anyone should know.
11:33LajjlaThe Ashtadhyayi was two millennia before its time
11:33llasramOddest spammer ever
11:33ohpauleezyes
11:33ohpauleezfor real
11:34Lajjlait innovated the formal system, it gave a rudimentary definition of a finit etate machine, it innovated the destinction between the phone and the phoneme
11:34ohpauleezcan we get an admin?
11:34LajjlaHow can you consider appreciation for such a monumental effort spam?
11:34LajjlaWhat kind of willfully ignorant person are you to not recognise the significance of the ashtadhyayi, nor its brilliance.
11:35mthvedti feel like the time cube guy has found a new hobby
11:35llasramLajjla: No matter brilliance, it is far off topic for this channel, and thus contextually spam
11:36LajjlaBrilliance ought never to be off topic.
11:36LajjlaBesides
11:36Lajjlait stands at the very fundament of programming languages.
11:36ohpauleezWe've recently had a bit of an issue with spammers in the channel (most likely because of our charming personalities and stunning good looks)
11:37ohpauleeznonetheless, it's a good way to get you kicked
11:37LajjlaPlease, I've been doing this for 5 years in this channel.
11:37LajjlaRaynes loves me.
11:37LajjlaDo you not raynes?
12:03futileThinking it's nearing done: https://github.com/evanescence/test2/blob/master/SPEC.md
12:03futileIt addresses the issues amalloy_ and mthvedt have recently brought up.
12:07bbloomfutile: why are there still noun suffixes on everything?
12:07bbloom(runner finder reporter) => (run find report)
12:07bbloomthey are functions, not abstractions, right?
12:09bbloomand another nit pick: to me, "find" implies searching for one or a few specific things. "discover" implies searching for anything that you might uncover.
12:14futilebbloom: I think of them as roles, not just functions.
12:15futilebbloom: the fact that it's currently a function is incidental (although they'll likely always be functions)
12:15bbloomfutile: you are specifying them to be functions....
12:15futilebbloom: i like the idea of renaming finder -> discoverer though
12:15futilebbloom: yes. but i still think of them as roles.
12:15futilebbloom: it's hard to refer to them in the documentation as verbs:
12:15bbloomfutile: that's just leftover OOP brain damage :-)
12:16futilebbloom: it may be so. let me look through the spec for a second.
12:16bbloom(str "the " role " function")
12:16futilemaybe its not as ugly as im thinking to say it
12:16futile"The Runner does not need to return." -> "`run` does not need to return."
12:16futileI can see that.
12:16bbloomyup
12:17bbloomi'm sure somebody already pull this move on you:
12:17bbloom~nouns
12:17clojurebotexcusez-moi
12:17bbloom~kingdom
12:17clojurebotIt's greek to me.
12:17bbloomblah.
12:17bbloom~noun
12:17clojurebotLINE-ing-en ['laɪnɪŋən]
12:17futilebbloom: yea i saw that
12:17futiledidnt read it yet, but yeah
12:17futilei mean i skimmed it
12:17futileyegge is verbose
12:17mthvedtbbloom: having a test file full of "run"s seems confusing
12:17bbloomyes, yegge is very verbose
12:18bbloommthvedt: no, you have a test file full of tests…. you only need one run function
12:18mthvedtsorry, misread
12:18TimMcIf this is who I think it is: /ignore -replies *!g2g2go2@*
12:19TimMcOh, it's the other one.
12:19futilebbloom: for example, a "Definer" is an extension that happens to provide one or more ways to define tests. it may not even use functions, it may use macros
12:19mthvedtbut the objection works for finder and reporter… i think the idea is that you might have other impls
12:20futilebbloom: but the Definer is really the extension, which serves a purpose, does a role, but its still the extension itself, which is a noun.
12:20rlbwhat's the name of the command line library that automatically handles sub commands?
12:20rlbi.e. "$ foo cmd ..."
12:21bbloomfutile: this is a trivial matter of word smithing
12:21bbloomfutile: rename your sections to "Definitions", "Assertions", "Discovery", "Execution", and "Reporting"
12:21bbloomrename the finder/runner/reporter functions to discover/run/report
12:21bbloomor discover/execute/report
12:22bbloomyou don't need to reify the "roles"
12:22devnrlb: er, not sure?
12:22futilebbloom: fancy
12:22rlbdevn: ok, thanks -- someone posted it either here or on the list a while back, but now I can't recall the name.
12:22futilebbloom: I like that idea. But I think it's a last priority, and I'd like to get the rest of the spec itself mostly finished before I go s/this/that/ anything.
12:23mthvedti would remove the nouns definer and asserter, but keep the other ones
12:23bpr#p
12:23bprbleh
12:24rlbdevn: I assumed I'd be able to find it via web search when I wanted to go back and look at it, but so far, no luck.
12:24devnrlb: i did a cursory search for you
12:24devnbut no dice
12:25devnrlb: is it an argument parsing library then?
12:25rlbyes
12:25rlbI thought it was posted by someone from one of the clojure companies I'd heard of, but don't recall...
12:25rlb(there was a github page, etc.)
12:25rlbdevn: anyway, thanks -- I'm sure I'll find it eventually.
12:25mthvedtoo style nouns like 'asserter' are loaded with the idea that you're talking about closures with behavior
12:26mthvedtbehavior that fits an interface to some other lib
12:26rlbdevn: if I recall correctly, the lib made it easy to specify the sub-commands and their behavior.
12:26mthvedtbut asserters are consumers of the test2 interface
12:26bbloommthvedt: yeah, when i see an actor suffix like -er or -or, i assume there is state in that thing
12:27devnrlb: i found an old one: argparse4clj (https://github.com/tatsuhiro-t/argparse4clj)
12:27futilebbloom: that sounds like a faulty assumption on your part, not a bad definition
12:27rlbdevn: yeah -- that's not the name I recall
12:27rlbdevn: it was some *other* lib for parsing command lines with sub-commands.
12:28bbloomfutile: more of a conservative heuristic than a faulty assumption
12:28mthvedtbut i think e.g. 'reporter' is OO in the sense that a reporter is expected to fit an interface and have some behavior
12:28mthvedtOO-lite
12:31mthvedtmaybe clojurians might prefer 'report-fn' over 'reporter', i dunno
12:32bbloommthvedt: yes. if you want to differentiate between a report data structure and the report function
12:32TimMcohpauleez: Unfortunately, I think chouser and rhickey are the only ones with ops.
12:33ohpauleezTimMc: Yeah, I saw the message on the mailing list - perhaps we'll get some more admins in here
12:35bprmthvedt: very much so
12:35futileohpauleez: for what?
12:36bprmthvedt: but, report is ok for me as well
12:36ohpauleezfutile: There's been a slight rise in spammers in the channel
12:36futileoh? hadn't noticed.
12:36ohpauleezand it's bothering some people enough that they raised the issue
12:36futileI see.
12:36ohpauleezI didn't either, until this morning
12:37TimMcIt's very sporadic.
12:37ohpauleezyes
12:43futileOkay, notified mailing list. Expecting to get yelled at again for some reason.
13:09loliveirahi, does somebody know some good Facebook library?
13:33futileOh no!
13:33futileSometimes the same function isn't = to itself!
13:35futile,(= = =)
13:35clojurebottrue
13:35futile,(= = (eval '=))
13:35clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
13:36futileOh right.
13:36futile,(load-string "=")
13:36clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
13:36futile:(
13:36futile,(= = (var-get (resolve '=)))
13:37clojurebottrue
13:37futilebultitude!!
13:37futileAt least I think that's what's making this not equal :(
13:37ianeslickIf I want to extend a map, such as adding sorting capability (we'll call the extended type an Index), what is the proper strategy? I want to change it so that (seq) returns sorted pairs, vals and keys are sorted, etc
13:38futileianeslick: if you aren't married to the idea of extending Map, you could just return [[k v] [k v] ...] already sorted.
13:39ianeslickI'm creating a new data type that wraps the functionality of a remote database (scalable key-value stores).
13:39futileianeslick: i.e. ##(sort-by :a [{:a 3 :b 3} {:a 1 :b 1} {:a 2 :b 2}])
13:39lazybot⇒ ({:a 1, :b 1} {:a 2, :b 2} {:a 3, :b 3})
13:39ianeslickI'm building an in-memory testing version first
13:39futileUhh, oops.
13:39ianeslickSo this is a subproblem
13:39futileianeslick: oh
13:40futile,(sort-by :a [{:a 3 :b 3} {:a 1 :b 1} {:a 2 :b 2}])
13:40clojurebot({:a 1, :b 1} {:a 2, :b 2} {:a 3, :b 3})
13:40ianeslickUse a map to simulate a remote key-value store without re-implementing or wrapping Map
13:40ianeslickI have some new protocols for transforming Index Values to a smaller Index based on range, value-filter, or other constraints.
13:40futileianeslick: fwiw we just have a function that takes mongo "objects" and converts it to a real-live Clojure map
13:40futileianeslick: but that's the last of my helpfulness on this topic
13:41futile(if it even is such)
13:41ianeslickYeah, Mongo had a production bug about a year ago that screwed me hard - never used it after that. Silently dropped writes after you updated a particular structure too often.
13:42ianeslickWant to have semantics that are separable from the underlying store so it's: a) easier to reuse existing clojure coding methods but still have clean semantics and b) be independent of a particular backend.
13:42ianeslickI'm starting with DynamoDB, but may need to leave Amazon later this year for legal reasons.
13:42ianeslickSo I need an in-memory testing version + a production DDB version of the type.
13:42ianeslickStill feel like I don't fully understand protocols!
13:43Wild_Cat`ianeslick: note that DynamoDB doesn't sort anything.
13:43Wild_Cat`wait, no, it does. It sorts by range key
13:44Wild_Cat`but hash keys are arbitrarily-ordered.
13:44futileOh no! (require :reload) makes = no longer work on functions, because it gives them a new ptr! Dang.
13:44ianeslickYes, so you have to have hints that tell the interface how to construct keys for range queries
13:44futileOkay okay, calm down.
13:44futileIs there another way to compare two functions as being equal when in a test?
13:44ianeslickI'm only generalizing enough for my simple application
13:45TuplanollaHow can I automatically reload Clojure files in the repl when they change?
13:45technoma`futile: you have to compare vars
13:45futiletechnoma`: :( that's what I was afraid of.
13:45hyPiRionhumm
13:45futiletechnoma`: because in test2 we agreed to move away from vars for the internal representation of tests, so now my tests have false negatives
13:46futilei.e., (= {:func test-1} (find-test-1-somehow)) fails
13:46futileblast! foiled again.
13:47TuplanollaSetting up the toolchain is really difficult.
13:48ianeslickIs there a way to compare the source code of the function?
13:48ianeslickIn some toolchains that is stored in the Var metadata
13:48ianeslick(or something like that)
13:48futilehyPiRion, technoma`: does this seem too horrible to live in a test? (= (.getName (type test-1)) (find-test-1-somehow))
13:49ianeslickSo, no hints on best practice for creating a derived version of Map with new behaviors and some extra protocol implementations?
13:49TuplanollaThere's ring.middleware, but it's essentially undocumented, so I have no idea how to use it.
13:50patchworkTuplanolla: It doesn't reload automatically when source changes, you have to (require :reload '[your.namespace :as x])
13:50dnolenianeslick: it's a bit of work, look at how defrecord is implemented
13:50TuplanollaI want to avoid doing that.
13:50technoma`Tuplanolla: there are ways to make it work, but it's way easier to just get your editor to trigger the reload.
13:50technoma`since it knows when you save already
13:51technoma`futile: if everyday testing requires stuff like that then yeah; pretty bad. depends on context though.
13:51TuplanollaI'm not so sure about IDEA.
13:51patchworklaneslick: you can have all this functionality without deriving a new Map implementation
13:51weavejesterTuplanolla: What do you mean by ring.middleware? The middleware in the official Ring libraries?
13:51mthvedtfutile: why not compare assertions to know you've found the right test
13:52futilemthvedt: thats disproportionally harder
13:52TuplanollaThis, weavejester: https://github.com/weavejester/ring-reload-modified
13:52weavejesterianeslick: Unless you want polymorphism, you don't need to use protocols to add new functionality
13:53mthvedtif you're just smoke testing discovery, you could even compare return values
13:53weavejesterTuplanolla: That should have a deprecated note on. The functionality has been rolled into ring-devel for a while now.
13:53ianeslickI want to have many of the existing clojure methods work with the new types, and there will be multiple implementations of the protocols (different stores and two different data types)
13:54TuplanollaI don't see the note anywhere. I'm just trying to set things up.
13:54weavejesterTuplanolla: Nope, that's why I said "should" :). I'll add the note to the readme.
13:55weavejesterTuplanolla: If you use lein-ring, it will setup reloading for you automatically.
13:55weavejesterTuplanolla: Otherwise you can wrap your handler in ring.middeware.reload/wrap-reload
13:55futile(inc lein-ring)
13:55lazybot⇒ 1
13:55futileHave been very pleased with it.
13:56ianeslickBasically I'm adding two new immutable datatypes that support the sequence and map interface, but have different implementations underneath. I also have two 'store' classes that return these new values and process inserts and updates in coordinated ways (insert!, update! an indexed kv-store and append! a searchable log)
13:56TuplanollaThere seem to be a lot of web things related to it. I don't need any of that.
13:56arcatanTuplanolla: if (require :reload ...) is too much, tools.namespace offers you simple call to (refresh)
13:56dnolenianeslick: sure, but what kind of guidance are you looking for? just implement the interfaces you care about.
13:56arcatanyou'll lose your state, though
13:57ianeslickdnolen: I probably need to re-implement most of the map interfaces as the underlying semantics are different and I don't think there's an easy way to change the implementation of an existing type.
13:58dnolenianeslick: it's in fact impossible
13:58ianeslickdnolen: Ok, that's helpful!
13:58dnolenianeslick: and you have no inheritance, you just need to implement everything yourself
13:58Wild_Cat`ianeslick: do you need real immutability, or could you make do with java.util.TreeMap?
13:59weavejesterianeslick: Are you implementing a new immutable data structure?
13:59dnolenianeslick: you can compose and delegate of course if that's your cup of tea - again see defrecord
13:59TuplanollaSo what's the non-deprecated way of doing it, weavejester?
13:59patchworklaneslick: I feel like the whole issue is your requirement that it work with existing clojure map code. That seems misguided
13:59weavejesterTuplanolla: Are you creating a website or web service or something else?
14:00patchworkJust have it work as a library, and call your code explicitly
14:00patchworkIt is not a clojure map
14:00patchworkso it shouldn't work with clojure map syntax
14:00weavejesterTuplanolla: reload-modified and it's successor in RIng, ring.middleware.reload, are just for Ring
14:00TuplanollaMy first project, weavejester.
14:00ianeslickNo, the idea is to create a datatype that supports clojure interfaces so the new types fit into the system neatly.
14:00TuplanollaThe most basic setup.
14:00ianeslickWhy create new interfaces and new accessors to reproduce what Clojure already supports?
14:01ianeslickweavejester: Yes, new immutable structure that is consistent across a cluster of machines.
14:01weavejesterTuplanolla: But what is it? The purpose of your application depends on how you reload it. For instance, if you're creating a web application, you can check for new files on every request.
14:01TuplanollaI just don't want to spend half of the time writing (reload) or hitting up to find it in the command history.
14:01arcatanTuplanolla: what editor do you use?
14:01TuplanollaIDEA at the moment, arcatan.
14:02technoma`hrm; should get refresh hooked into nrepl auto-discovered commands
14:02arcatanokay. i'm not familiar with IDEA.
14:02weavejesterianeslick: I'm not sure I completely understand. By definition, an immutable structure is always consistent.
14:02patchworkianeslick: Because they are not built in clojure maps. We create new datatypes all the time, they just don't need to act like the native types
14:02patchworkthey come with their own interface
14:02ianeslickWild_Cat`: Immutability allows consistent reads, even if references are passed across the cluster. Side effects are managed by a proxy class that talks to the underlying datastore.
14:03ianeslickweavejester: Yes, but the concept of a value is different than the implementation of it. I need to pass 'values' between nodes without passing a terabyte of data.
14:03arcatanTuplanolla: in Emacs you'd connect to nrepl and press C-c C-k to load the file you're working on to the repl. i'm sure something similar is possible with IDEA.
14:03clojurebotAck. Ack.
14:03TuplanollaI've tried emacs, but the keys are painful with a foreign keyboard.
14:03technoma`clojurebot: forget Tuplanolla: in Emacs you'd connect to nrepl and press C-c C-k to load the file you're working on to the repl. i'm sure something similar |is| possible with IDEA.
14:03clojurebotI forgot that Tuplanolla: in Emacs you'd connect to nrepl and press C-c C-k to load the file you're working on to the repl. i'm sure something similar is possible with IDEA.
14:03ianeslickThat means the abstraction provides an immutable view of an external resource (think HBase used in a write-mostly fashion and keeps history)
14:04patchworkianeslick: That is such a specific use case that I wouldn't want it masquerading as built in clojure types
14:04ianeslickArchitecturally this is solving similar problems that Datomic solves, but in a write-scalable rather than read scalable fashion.
14:04weavejesterianeslick: Ah, okay, so you have some large immutable data structure somewher that's referred to by a UUID or cryptographic hash, presumably.
14:05ianeslickweavejester: basically. Tablename + Timestamp + Key is always consistent
14:06weavejesterianeslick: And presumably you want a way of doing things to the data structure, like conj etc. without loading it into memory first.
14:06TuplanollaI'm just trying to find a simple setup. I'm a scientist, not a system administrator.
14:06ianeslickweavejester: Should say that Tablename + Timestamp in HBase allows me to construct a cluster-wide consistent view of a datastructure. That table is reified as a new type Index which supports performant scan and filter operations server-side.
14:07arcatanTuplanolla: this tutorial suggests that IDEA/La Clojure has "Load file to REPL", "Execute last S-Expression in REPL" etc. http://blog.tomeklipski.com/2013/04/running-and-debugging-clojure-code-with.html
14:07arcatanTuplanolla: have you tried using those?
14:07ianeslickweavejester: My use case is more restricted than the low-level API requires, but common enough to justify some up-front work. (I also have a Log structure which operates similarly).
14:08weavejesterianeslick: My thought is that the mechanisms for working with a distributed database over one in memory are different enough to warrant a new namespace, even if the function names are the same.
14:09TuplanollaThat seems to work, kind of. It doesn't trigger on save or change the namespace though. I'll have to see if there's a button to send snippets to the repl.
14:09weavejesterianeslick: e.g. (require [foobar.distributed :as d]) (d/conj remote-structure new-value)
14:09ianeslickweavejester: One decision I made similar to Datomic was to separate side effects from read-only interactions. I don't create derived Immutable values by a local conj because I need to catch side effects made by remote systems - so the new type supports keyword access, get, seq, etc but not conj, assoc, etc.
14:10ianeslickA Store type handles new operations insert/update/append and returns new Index and Log types which interoperate with clojure's built-in read operations.
14:10weavejesterianeslick: That seems like all the more reason to treat it differently from in-memory data structures. Don't use clojure.core/get - use your-lib.distributed/get.
14:10ianeslickStore is easy. Could be done with multi-methods, but Index/Log should probably be types.
14:11ianeslickweavejester: That's a good argument.
14:11ianeslickweavejester: Easier than implementing clojure's internal interfaces too
14:12technoma`Tuplanolla: I'm working on a tool to help expose server-side functionality like refresh easily across any editor, but it's still in early stages: https://github.com/technomancy/nrepl-discover
14:12technoma`no one seems interested in implementing it for non-emacs editors so far though =\
14:12TuplanollaClojure is developing so quickly, half of the materials I find on the internet are already deprecated.
14:12weavejesterclojure.core.reducers takes that approach - it has its own versions of map, reduce, etc. with subtly different semantics.
14:12weavejesterAnd I'm taking that approach with my FRP library
14:13ianeslickweavejester: Reuse the clojure idioms and clearly produce 'local values' for processing by clojure at some point, but allow interactions with new types to be done in a new namespace.
14:13ianeslickweavejester: Perhaps I was over-influenced by my work with Datomic.
14:13TuplanollaI'll follow that progress, technoma.
14:13ianeslickweavejester: Where Entities behave alot like Maps, implementing a subset of clojure interfaces
14:14ianeslickMy Index type a collection just like that.
14:15weavejesterianeslick: I didn't realize datomic did that. I'd assume that there aren't any side-effects to treating an Entity as a map, though?
14:15ianeslickweavejester: So eschew niceties like keyword lookups, collection as IFn, etc?
14:16technoma`Tuplanolla: if it does get picked up, it'll probably be implemented in eclipse before idea.
14:16weavejesterianeslick: I'd still use IFn… maybe keyword lookups too...
14:17weavejesterianeslick: I guess things that I can port directly I would, but anything which doesn't quite fit would need a new function.
14:17ianeslickweavejester: They do something interesting. A Connection accepts transactions to update the database, produces immutable Database types which support queries that return Entities which are immutable. You cannot derive new Entities except by submitting transactions to Connections and getting a new Database + Entities.
14:17TuplanollaIf only Eclipse wasn't so slow at everything...
14:17ianeslickEntities are tied to a particular point-in-time Database value.
14:18weavejesterianeslick: It sounds like Entities are in-memory and immutable, but have additional constraints over maps.
14:18ianeslickweavejester: Easier to implement a custom index/get than the java Map interface to use the built-in get. I can always backport from a custom namespace later.
14:18ianeslickweavejester: Yes, took a bit to get used to writing code based on maps you couldn't augment directly.
14:18ianeslickweavejester: via assoc
14:18technoma`Tuplanolla: I've never used it; I've just noticed they seem to be more on top of things
14:18weavejesterInteresting...
14:19ianeslickYou basically end up with a separate read path and a write path in your code. Makes everything much more transactional - write a big pure function which takes an immutable value, generates a set of 'diffs', and then transactionally commits those diffs, or rolls back and retries with the latest Database value.
14:20ianeslickTranactions can include functions that run on the transactor, so you can avoid most rollbacks based on local read-modify-write operations.
14:20TuplanollaIt starts for fifteen minutes and using content assist with the whole JDK 7 included freezes the context menu for five minutes.
14:20ianeslickGives you cluster wide transactability, but all your data manipulation is based on in-memory cached covered indexes of the current state.
14:20weavejesterianeslick: In my libs, I've tended to extend generic and simple interfaces like IDeref and IFn, but I find that the more complex the interface the less likely it is that it will fit in exactly. And if it doesn't fit, I don't force it; I just create a new function in a new namespace.
14:20ianeslickweavejester: You've sold me on that as an interim if not final strategy, thanks. Just the advice I was looking for.
14:21futileAll this pain is making me rethink using vars again in the official data representations, /cc mthvedt amalloy et al
14:26TuplanollaIDEA seems to be also missing documentation. I guess I'll have to use emacs.
14:27bprlearning emacs is an investment that pays off many times over
14:27bprthough, it is an investment
14:28TuplanollaI learned the basic usage, but had to give up on the shortcut mess. There's ergoemacs I'll have to try though.
14:28justin_smithI prefer to think of it as technical speculation in the technical lottery that keeps printing winning tickets
14:29technoma`ergomacs is a bit nutty
14:31weavejesterHas anyone use LightTable in a serious project? Maybe that's another possibility.
14:32CaptainLexweavejester: I'm about to begin in using LightTable in a serious project
14:33technoma`was there the gsoc project for clooj?
14:35hiredmanI'd like an in browser clojure editor for my chromebook, adobe brackets looks interesting, but they don't have it working in browsers yet (it uses a custom browser app thing similar to lighttable)
14:38hiredmanI tried to get brackets running as a chrome extension, but errors seem to be swallowed for some reason, and something is clobbering the console object so logging doesn't work, and all the jquery defered stuff proved too much for me
14:39ianeslickweavejester: The easy/most useful interfaces for a type seem to be Seqable, IFn, IDeref, Ilookup, IKeywordLookup and maybe IHashEq, IObj. Seqable basically lets me turn an index into a sequence and then the usual clojure stuff will work. So (filter <pred> (index/scan index <start> <end>)), index/scan returns a new index, filter calls .seq to get a linear sequence and filters the scanned result. I also have an index/filter which will do server side
14:39ianeslick filtering - the general performance model is to push filters into the index to get a reduced sized index to reduce network traffic then do clojure ops on the returned standard clojure collections and values.
14:53dnolencemerick: good point about js/Date IEquiv, I've backed that out of master
14:53cemerickdnolen: gah! :-P
14:54CaptainLexSo does the classes-and-interfaces vector in proxy actually not take multiple members?
14:54cemerickdnolen: what about number and string, then?
14:54cemerickoh, the string extend is for keywords
14:54dnolencemerick: those are safe - they don't modify prototypes
14:54weavejesterianeslick: Those all seem reasonable interfaces to implement
14:55cemerickdnolen: I guess there's a subtle difference between Date and e.g. Number?
14:55dnolencemerick: which won't last for long when we optimize constants
14:55dnolencemerick: there's a big difference, CLJS doesn't modify real JS natives, proto implementation lookup is done via hashtables
14:56cemerickdnolen: but through prototypes for non-native classes, I guess.
14:57cemerickMaybe whatever whitelist that exists for strings and numbers can be extended. Not being able to e.g. test for date equality is rough.
14:58dnolencemerick: actually we can't back it out yet
14:58dnolencemerick: yes I put it back and noted we could add special handling, patch welcome
15:01tomjackis "add comment about possible future change" the comment about possible future change?
15:18Bronsamh
15:18Bronsahttp://sprunge.us/MOKh
15:18Bronsathis looks wrong to me
15:20dnolen_Bronsa: I'd be surprised if defrecord validated non-basis keys
15:20bbloomBronsa: the problem seems to be the second output, not the third
15:21Bronsabbloom: yeah.
15:21dnolen_Bronsa: bbloom: I think you'd be likely to hear that the issue is the third
15:22Bronsadnolen_: but records can be used effectively as maps
15:22bbloomdnolen_: record reader forms accept extra keys
15:22bbloomdnolen_: https://www.refheap.com/15852
15:22dnolen_Bronsa: bbloom: just a hunch given that defrecord are a performance optimization like structs
15:23dnolen_what's the point of putting arbitrary keys in there if you care about perf at all
15:23bbloomdnolen_: you care about perf of access to the core fields
15:23bbloomdnolen_: records allow extra fields for annotations & non perf critical things like that
15:23Bronsathis potentially causes some records that are valid at runtime to be non readable back
15:23Bronsahttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L1237-L1242 the check is done explicitely though.
15:24tomjackcore.async's ioc-macros is an in-the-wild use case that occurs to me
15:24dnolen_Bronsa: bbloom: in anycase my point is, it's not clear to me that records are designed to permit *semantically* non keyword keys
15:24dnolen_I maybe wrong about that
15:24tomjackwell those are all keywords
15:24dnolen_but that's what the behavior sits on
15:25dnolen_and the explicit check in the Reader backs me up
15:27bbloomdnolen_: i see no reason why they shouldn't allow keys of other types. that works just fine at runtime. the issue is the reader is unnecessarily restrictive.
15:27tomjackthe explicit check just seems bizarre to me
15:27Bronsamaybe it is a leftover from early experimentations on record
15:27BronsaI relly see no point in that check
15:27bbloomBronsa: that would be my guess
15:28bbloomsemantically, records are pretty much just maps with a minimum set of keys and a type differentiator
15:28bbloompractically, they are faster for read/write access to those minimum keys
15:28tomjackhttp://dev.clojure.org/jira/browse/CLJ-800
15:29Bronsatomjack: yeah, I was just reading that
15:29tomjackdon't see any explanation
15:29bbloomyup
15:35dnolen_bbloom: Bronsa: hmm I was thinking perhaps struct-maps were limited in this way - but it turns out not. So perhaps you all are right.
15:35tomjackmaybe symbols are disallowed because allowing them brings up the question of whether they should be evaluated?
15:36Bronsatomjack: I don't think so
15:36Bronsa#foo.bar{:foo bar} is valid
15:36Bronsaand bar is not evaluated
15:36tomjackah
15:37bbloomI'm 99% sure this is a reader bug
15:37tomjackthat seems odd to me
15:38tomjacknot that I really want them to be evaluated, but the inconsistency vs a regular map seems odd
15:39bbloomtomjack: it's consistent with respect to tagged literals, but that came later :-P
15:40bbloom,{:x 'y}
15:40clojurebot{:x y}
15:40tomjackin that it is just impossible to have your tagged literal type evaluate symbols inside?
15:40bbloomi guess you need to use edn/read-whatever when reading clojure maps
15:41bbloomtomjack: it's not impossible, you just need to call eval :-/
15:41bbloomor do symbol resolution
15:41tomjackwell not at read-time clearly
15:41bbloomit does seem odd that records don't work precisely the same as maps in this respect
15:41tomjackbut eval on some funky object is identity, so there's nothing you can do about how it evals
15:41tomjack(right? I don't understand that stuff)
15:42bbloomtomjack: you don't eval the result of the reader, you eval while building the result of the reader
15:42bbloom(def x 1) (eval 'x) => 1
15:43tomjackthat doesn't make sense to me
15:44tomjacksay `#funky {:foo a}` returns, uh, some funky map-like thing. a deftype? you don't want to eval 'a at read-time. if you wanted map-like semantics you'd want to eval 'a when the deftype is eval'd, but you have no control
15:44tomjackor am I totally confused? feels that way
15:45bbloomoh yeah, you're right, sorry
15:46bbloomi guess the fundamental issue is that {:foo "bar"} means (hash-map :foo "bar") but #whatever{:foo "bar"} means #<someobjecthere>
15:47bbloombbloom: i guess the real thing is you need to know "am i quoted?" when reading the literal
15:48bbloomlol i just bbloom:ed myself. whoops
15:48bbloomdnolen_: this is related to the constants work w/ cljs. tagged literals are inherently constants: they can't do any evaluation
15:48bbloomsame for records
15:49bbloomthis is why :map, :vector, and :set need to be special forms
15:49bbloomb/c they need to do something different depending on context
15:49amalloybbloom: {:foo "bar"} doesn't mean (hash-map :foo "bar"). it doesnt' read to a list, it reads to a map
15:49bbloomamalloy: it means both depending on how it's used
15:49bbloomamalloy: if quoted, it means a map. if unquoted, it means code which builds a map
15:50bbloomamalloy: if unquoted and recursively constant, it can mean a map as an optimization
15:50amalloythat is a bizarre claim. in what case does the reader see input {} and return (hash-map)?
15:50bbloomamalloy: it doesn't
15:51Bronsa'`{}
15:51Bronsa,'`{}
15:51clojurebot(clojure.core/apply clojure.core/hash-map (clojure.core/seq (clojure.core/concat)))
15:51Bronsa,'`()
15:51clojurebot(clojure.core/list)
15:51bbloomBronsa: ehhh. that's cheating. that's the behavior of syntax-quote
15:51amalloysure, backquoting, although i'd argue that it's ` doing that, not {}
15:51mefesto\quit
15:51bbloomamalloy: consider {:foo (query-the-internet)}
15:52bbloomthat doesn't do anything until that line of code is run
15:52bbloomit's logically equiv to (hash-map :foo (query-the-internet))
15:53amalloywelllllll, i wouldn't say it's logically equivalent, since that doesn't really mean anything useful. but i see the distinction you're making re: deftype objects
15:53amalloyie, that (eval some-deftype-object) doesn't eval its fields, whereas (eval some-hashmap) evals its fields
15:59tomjacklooks like CLJ-374/800 added cases in Compiler/analyze for IRecord/IType to ConstantExpr
15:59Bronsayep
16:00tomjackwhere IPersistentMap gets a MapExpr which always emits a PAM/PHM
16:01tomjackI guess letting people control eval would be nuts?
16:01Bronsayou'd need hooks in the compiler
16:02hiredmanluckily lisp has a mechanism for tha
16:02hiredmant
16:02hiredman«»
16:02hiredmanfeh
16:02hiredmanquotation
16:03Bronsahiredman: I'm not sure how that matters
16:03futilewelp
16:04hiredman"I guess letting people control eval would be nuts?"
16:04Bronsahiredman: quoting only prevents evaluation
16:04Bronsathere's no way to "make it happen"
16:06Bronsauser=> `#user.foo{:a ~'a}
16:06Bronsa#user.foo{:a (clojure.core/unquote (quote a))}
16:06Bronsathis kinda sucks
16:06tomjackI've considered having data readers look for unquote :/
16:08tomjackbut thinking about it, they can't do anything useful even if they look for it, huh
16:08bprBronsa: maybe i'm missing context, but what sucks about that?
16:08futiletomjack: https://github.com/evanescence/test2/blob/master/SPEC.md
16:09bprif you have a reader registered for #user.foo, doesn't it provide the apropriate data-type?
16:09Bronsabpr: http://sprunge.us/FdRB
16:09Bronsabpr: user.foo is a record not a tagged reader
16:10bproh
16:11tomjackI guess you should just be using `(map->foo {:a ~'a}), similarly for data readers
16:12tomjacklike you don't use #db/id in code, you use datomic.api/tempid
16:15bprBronsa: does using a tagged data literal to properly construct your record work as expected?
16:16dnolen_bbloom: unrelated, I had a copy of that functional parsing paper you sent along. I'd come across it when looking into how people built parsers in Prolog
16:16bbloomdnolen_: yeah, was really cool that it also served as a generator :-)
16:19tomjackwhich paper?
16:20dnolen_"A Functional-Logic Perspective of Parsing"
16:25tomjackintriguing
16:25tomjackI had written <*> in my little LogicT experiment
16:25tomjackand <|> is just mplus?
16:26Hetuthanks for the paper tip dnolen_
16:27dnolen_tomjack: I never actually read too much about LogicT
16:27tomjackconfirmed <|> is mplus in LogicT source at least
16:31tomjackI'd guess you'd get what the paper shows with LogicT ((->) Rep) something. but wtf is something?
16:36tomjackhmm probably not
16:39dnolen_tomjack: are you referring to the original LogicT paper?
16:40tomjackyeah
16:40tomjackI dunno what changed between the paper and http://hackage.haskell.org/package/logict though
16:41tomjack(if there are important differences I refer to the package not the paper)
16:43dnolen_tomjack: hrm, sounds like the repo is an "adaptation" ?
16:43dnolen_tomjack: I don't read Haskell good
16:44tomjackyeah, I hadn't noticed till now that the author of the package is not one of the authors of the paper
16:44tomjackI think they're the same in spirit
16:44tomjackI did notice at least one implementation difference
16:45akells`let's say I have a method get-file-size that returns a particular file's size. How would I properly construct a java ByteArrayOutputStream with that size? I'm making a binding for *out* to that ByteArrayOutputStream, so I'm trying (binding [*out* (ByteArrayOutputStream. (get-file-size file) *out*)]
16:45akells`but I'm getting No matching ctor found for class java.io.ByteArrayOutputStream -- I know I'm just missing something simple, but I can't seem to make it work
16:46bprakells`: cast (get-file-size file) to an int
16:47bpralso, *out* doesn't need to be in the call to the constructor
16:47akells`thanks for your response, bpr. I'll double check that its an int
16:47akells`oh, okay. I guess maybe I've been doing that wrong then.
16:49dnolen_tomjack: hmm I don't know enough Haskell to say but the original looks pretty straightforward and library you linked to busts out some fancy extensions
16:50tomjackextensions?
16:50dnolen_tomjack: language extensions
16:52tomjackguess that's inherited from MonadReader etc
16:53tomjackI was hoping to avoid that stuff..
16:53tomjackthe parsing paper appears not to use monads at all which is promising
17:02tomjackhmm, parser_rep is only an applicative if the representation is a monoid
17:11tupihello, i have a quiz about clojure/imagej interaction. i wrote a simple clojure script which execute a watershed command over an image, the clojure script is just a couple of lines really. right now i run the script as 'imagej test_2.clj', but i actually would prefer [to enhance these script with 'real' clojure code...] to call this script through clojure itself, telling where the imagej jars are .. is this possible ?
17:42tomjackworking out any relation between LogicT and the parsing paper has proved difficult
17:44antares_New ClojureWerkz project, Cassaforte: a Clojure Cassandra client built around CQL 3.0: http://blog.clojurewerkz.org/blog/2013/06/17/introducing-cassaforte/
17:48tupihow can i tell clojure where to find extra classes ?
17:50puredangertupi: Clojure runs on the JVM and the JVM finds classes via classloaders, most commonly by the system classloader that reads classes from the "classpath", a list of "class containers", which may be directories or JAR files (basically just zips)
17:50tupipuredanger: here is what i try:
17:51tupijava -cp clojure-1.4.0.jar clojure.main /usr/lpdi/projects/fiji/plugins/test_2.clj
17:51tupi
17:51tupiwhich does not wotk because it does not know ehere imagej clases are, and there are here:
17:51tupi/usr/local/src/Fiji.app/jars
17:52puredanger-cp defines the classpath - add jars to it like: -cp clojure-1.4.0.jar:/usr/local/src/Fiji.app/jars/XYZ.jar:...
17:52tupiah, merci! trying
17:53puredangerjava 6+ can also use the specific wildcard format of /the/dir/* to add all jars (in arbitrary order) to the classpath
17:53puredangernote this is not general glob support - it only works with just "*".
17:54puredangerin general, I highly recommend using a build tool (leiningen or if you hate life, perhaps Maven) to assemble your classpaths for you
17:54technoma`further proof that writing /usr/bin/java was a task that Sun delegated to the interns
17:54puredangertechnoma`: ha, yeah
17:54puredangercan't tell you how many times I've written *.jar only to get burned
17:57tupijava -cp clojure-1.4.0.jar:/usr/local/src/Fiji.app/jars clojure.main /usr/lpdi/projects/fiji/plugins/test_2.clj
17:57tupiException in thread "main" java.lang.ClassNotFoundException: ij.IJ
17:57tupi
17:58tupitest_2.clj starts like this: (import '(ij IJ)
17:58tupi '(ij ImagePlus))
17:59puredangerwhat's the actual full Java class name with package?
18:01tupipuredanger: i don't know
18:02tupimy knowledge of java is close to null [and will remain so i am afraid]
18:02puredangertupi: try doing something like jar -tf /usr/local/src/Fiji.app/jars/YOUR.jar | grep IJ
18:02puredangerI don't know what YOUR.jar should be but jar -tf will list all classes in the jar and grep should find the IJ class ?
18:04tupitrying
18:08puredangertupi: your import looks ok if you have an ij.IJ Java class
18:09tupiyes, that i know because the script runs if i run it 'from' imagej
18:10puredangercan you post your whole command line?
18:10tupiit does not find the jar, i don't understand
18:11tupipure i did already, i think
18:11tupijava -cp clojure-1.4.0.jar:/usr/local/src/Fiji.app/jars clojure.main /usr/lpdi/projects/fiji/plugins/test_2.clj
18:11tupi
18:12atyzHi guys, i feel dumb for asking but does this namespcae no longer exist? clojure.contrib.string
18:12puredangeryou need to put the actual name of the jar after /jars - the directory is not sufficient
18:12puredangeratyz: no, you should use clojure.string
18:13atyzdoes that contain substring?
18:13puredangerno! :)
18:13tupioh this won't be possible with real code, there are hunderds of jars in imagej
18:13puredangerbut subs is actually part of core now
18:13puredangertupi: you can use .../jars/* if you want to get them all
18:13tupiok
18:14puredangeratyz: (subs "foobar" 3) ==> bar
18:14atyzpuredanger: i dont' want a substring, basically i want a check to see if a string is a substring
18:14atyzso i could use (.contains "abcd" "bc")
18:15futileEvening.
18:15futileI mean, hi.
18:15puredangeratyz: ah, first see: http://clojure.org/cheatsheet
18:16atyzpuredanger: thanks
18:16puredangeratyz: second, you can go the Java route with (.indexOf "foo" "oo")
18:16puredangerwhich returns the position of the substring
18:17puredangerbut perhaps better to use the re-* functions to do regex matching depending what you're doing
18:18atyzpuredanger: thats exactly what i'm doing
18:18atyzI appreciate it :)
18:18atyzI need to get more familiar with teh clj std library
18:20tupiit's getting a little further but complains about graphicsenvironment. puredanger for you to understand, that directory contains clojure.jar which is clojure 1.3 and i wanted to use the latest debian stable and also getting a better control over comand line args.
18:20tupihere is the output of 'imagej':
18:20tupidavid@capac:~/lpdi/projects/fiji/plugins 15 $ imagej test_2.clj
18:20tupiWARNING: clojure.lang.Repl is deprecated.
18:20tupiInstead, use clojure.main like this:
18:20tupijava -cp clojure.jar clojure.main -i init.clj -r args...
18:20tupiClojure 1.3.0
18:20tupinil
18:20tupiuser=>
18:21tupi[the nil is (println *command-line-args*)]
18:21tupibut i wanted to run clojure1.4 and tell it where imagej classes where, it seems more complicated then i thought
18:22CapnKernulWhat ever happened to lazytest?
18:22tupiusing clojure1.4,as copied earlier, it complains:
18:22tupijava -cp clojure-1.4.0.jar:/usr/local/src/Fiji.app/jars/* clojure.main /usr/lpdi/projects/fiji/plugins/test_2.clj
18:25tupinil
18:25tupiException in thread "main" java.awt.HeadlessException
18:25tupi at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207)
18:25tupi at java.awt.MenuComponent.<init>(MenuComponent.java:159)
18:25tupi... ...
18:25tupiso i guess imagej [which a binary file unfortunately] does more then just launching clojure ...
18:25puredangeryou're causing AWT (the Java window toolkit) to get instantiated, which is not too surprising
18:25puredangergiven that it's an image lib
18:26puredangeryou can use -Djava.awt.headless=true I believe to avoid that
18:26tupiwell image processing does work in the memory [and in this case does not open any window]
18:27puredangertupi: try that flag in your command line
18:28puredangeror put it at the top of your code (above the ij import) - (System/setProperty "java.awt.headless" "true")
18:29tupihere is the full script, it is really short so i'll copy it here
18:29tupi(import '(ij IJ)
18:29tupi '(ij ImagePlus))
18:29tupi
18:29tupi(let [imp (IJ/openImage "/usr/lpdi/projects/fiji/tests/image_to_watershed.png")]
18:29tupi (IJ/run imp "8-bit" "")
18:29tupi (IJ/run imp "Watershed", "")
18:29tupi (IJ/save imp "/tmp/itw.png"))
18:29tupi
18:29tupiand all i want is to get it work passing the directoru and image name as a command line arg
18:31tupipuredanger: -Djava.awt.headless=true is before clojure.main ?
18:31puredangertupi: that should work
18:32tupiarhgg it did not [yet], here is the cmd and 1st line of error:
18:32tupijava -cp clojure-1.4.0.jar:/usr/local/src/Fiji.app/jars/* -Djava.awt.headless=true clojure.main /usr/lpdi/projects/fiji/plugins/test_2.clj
18:32tupiException in thread "main" java.awt.HeadlessException
18:32tupi at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207)
18:32tupi at java.awt.MenuComponent.<init>(MenuComponent.java:159)
18:32tupi
18:33jtoyif im in the repl, how can i run a function that has sudo permissions?
18:34jtoyis this possible? it sounds like more of a unix question?
18:35tupipuredanger: tx so much to get me up and running with this by the way
18:35tupii really need to take the control of imagej through clojure and not the other way around ...
18:35llasramjtoy: Generally speaking, whole processes run as a particular user. Definitely a Unix (or whatever OS-context) question
18:36futileI really like the idea of LightTable suddenly.
18:36tupiwhat is the clojure command to exit the repl?
18:37puredangerctrl-c ? :)
18:37futileIf this thing has paredit-like keys, I'm quite possibly sold.
18:37aaelonyctrl-d
18:37justin_smithtupi (System/exit 0)
18:37tupijustin_smith: tx
18:37puredangeryour command-line args will end up in a variable named *command-line-args*
18:38puredangerso you can access them like (first *command-line-args*) and (second *command-line-args*)
18:38puredangergotta run, hope that helps a little - I don't think you're far
18:38puredangerdespite appearances
18:39tupipuredanger: tx, it is weird to be so close but ...
18:39jtoythx
18:55jtoyif i want to keep a secured persistent connection to another site through clojure, what protocol/technology would you recommend?
18:56justin_smitheither shell out to ssh (or tunnel across an external ssh processes tunnel) or aleph/https web socket maybe?
18:58jtoycool, ill try that
18:59jtoyjustin_smith: do you know if aleph can work from clojurescript?
18:59justin_smithclojurescript should be able to create a websocket via javascript interop
18:59jtoysweet
19:00justin_smithI bet there is an example on the web for using aleph/clojurescript for two way web sockets
19:05jtoywould be cool to send raw lisp down the channel to eval on the other side
19:06justin_smithI usually have each end creating and reading json, and responding to it
19:07tupiit is amazing, like really totally crazy, how difficult it is to launch a memory computation based on imagej from clojure. the headless environment takes pages and pages on the web, to tell you how to write a complete program in java not to get the windowing system invlolved in your terrifically basic pure mem computation
19:13muhoounder what conditions would doall fail to do all?
19:14muhooi have a lazyseq, i'm trying to spit it out to a file, i tried wrapping it in doall, and all i get in the file is clojure.lang.LazySeq@eff30ce0
19:14muhoooops, nevermind pr-str :-)
19:15callenmuhoo: don't feel bad, I was doing some dumb stuff with iterate not too long ago.
19:15callenmuhoo: stuff that required killing Emacs and restarting the REPL :(
19:16muhooit did not occur to me to feel bad :-P
19:17muhoobut thanks anyway. it was my big derp of the day; i always have at least one.
19:19callenmuhoo: so does anybody use defstruct anymore?
19:23robinkHow do I make EDN dispatch on a Joda Time #<DateTime .*> object that has been serialized?
19:31robinkI can also change the DateTime object in the collection being output by pr, but I'm not sure how to make it a tagged element (i.e. #chrdc/jdt "2013-05-11T23:04:12.000-07:00").
19:36rhickeyt
19:37@rhickeyIs there a straightforward way to get lein to use the clojure.jar of my choice from my local disk (not installing in maven)?
19:39TimMcrhickey: For lein's own process, or for the codebase it is launching?
19:39@rhickeythe codebase
19:40@rhickeyreally, get it in lein classpath
19:40TimMcHonestly, if I have source I usually just mvn install with a unique version and use that in the pom/project...
19:41TimMcIf I'm just hacking around, :resource-paths is a close enough approximation.
19:41TimMctechnomancy will yell at you, though.
19:42technoma`hrm; no, :resource-paths makes sense for this.
19:42technoma`typically you'd use checkout-deps, but that only works if you're trying to include a leiningen project
19:42technoma`no one's hooked it up to maven yet
19:42ianeslickWeird, anyone get errors from nrepl require like "namespace 'dstore.api' not found after loading '/dstore/api'?"
19:43@rhickeytechnoma`: you put the jar name in resource-paths?
19:43ianeslick(i.e. load nrepl into fresh lein project, define that namespace at src/dstore/api.clj and then try to require)
19:43technoma`rhickey: full path to the jar should do the trick
19:43technoma`well, relative path from the project root should work too
19:43technoma`oh yeah, and that's a string in a vector
19:44technoma`:resource-paths ["/path/to/clojure.jar"]
19:44@rhickeytechnoma`: will that disable any defaults for clojure del?
19:44@rhickeydep
19:44technoma`rhickey: no, you'd need a top-level exclusion as well to keep clojure from being transitively included
19:44technoma`:exclusions [org.clojure/clojure]
19:45@rhickeyok, thanks
19:45technoma`sure
19:45robinkWould the latter approach be preferable?
19:45robinkI just want the date output to be parsable and sane
19:45technoma`typically the resources one would shadow the transitive one, but if there's a file in one but not the other shadowing gets weird
19:45technoma`better to be explicit about it
19:46tomjackrobink: it sounds like you're asking about print-method
19:46robink(org.joda.time.DateTime. "2013-05-11T23:04:12.000-07:00") returns a <DateTime 2013-05-11T23:04:12.000-07:00>, which is what I'm after.
19:47tomjackthe problem is that you want DateTime to print as a tagged element?
19:47jtoysilly question, why would I get this error when the file exists and I have permission (I am testing as root): IOException error=2, No such file or directory java.lang.UNIXProcess.forkAndExec (UNIXProcess.java:-2)
19:47futileOh no! Missed my one chance to deliver the message to rhickey about that one thing that could.. Save the World ... dun dun DUNNNN!!!
19:48jtoyall I am doing is appending data to a file: (writer "/etc/hosts" :append true)...
19:48robinktomjack: The problem is I want to serialize a collection that contains a Joda Time <DateTime blah> object in several places. I want to do it sanely, and I want to do it relatively securely. I control both the output (generated right now by pr) and the reader (using clojure.edn), and can change how I store/serialize/read the data I'm trying to save as EDN.
19:49robinktomjack: My question is what's a sane and appropriate means to save and read the data, provided I'm still using EDN?
19:49tomjackI guess I still don't understand
19:49tomjackEDN is a sane way to save and read data
19:49fgallinaHi all, I'm having a weird error, any help is appreciated: I defined a protocol in my src/core.clj, when I require it from another file and use defrecord implementing this protocol's methods, calling any of them with a record instance fails with "Unable to resolve symbol: <method> in this context".
19:49tomjackI'm guessing you want (defmethod print-method DateTime [out date-time] (binding [*out* out] (print "#foo ") ...)) or whatever
19:49robinktomjack: pr outputs, literally, "<DateTime 2013-05-11T23:04:12.000-07:00>", which the reader (clojure.edn/read) doesn't like.
19:50tomjackright, define a print-method for the types of interest
19:50robinktomjack: Ah, OK
19:50tomjackEDN has nothing about printing, it's up to the host. in clojure it's print-method
19:50robinkGotcha
19:53robinktomjack: [out date-time] should apparently be [date-time out].
19:53robinktomjack: but otherwise, perfect, thanks.
19:57robinktomjack: Better to have it tagged anyway, I suppose if any instance type or method could be instantiated or acted upon it would be no more secure than clojure.core/read.
20:03tomjackoh, yeah, whoops
20:08gdev_Stanley Cup Playoffs as a value
20:16tomjackgdev_: yes.
20:42gdev_tomjack, really? hrm I wonder if its too late to submit a proposal for a talk
21:15mefestousing clojurescript in a new project and wondering how i should initialize event handlers and such for different pages. currently, lein-cljsbuild is outputting a single file (app.js) which all pages load. BUT, each page will call it's own `init()` function. is this a terrible approach? should i be outputting multiple js files instead of one?
21:15mefestohttps://gist.github.com/anonymous/5801886
21:19dnolen_mefesto: there's a thread on the mailing list about this hopefully something comes of it
21:19dnolen_mefesto: on the CLJS mailing list
21:19mefestodnolen_: oh i didn't realize cljs stuff is no longer using the clojure mailing list. i'll have to join :)
21:19supersymyou can do goog.require('foo')?
21:20dnolen_mefesto: you can ask your question in either place, but CLJS specific things seem to moving off the main ML
21:21mefestodnolen_: do you know the title of the discussion so i can search for it?
21:22dnolen_mefesto: Compiling "Modules" via ClojureScript Compiler
21:22dnolen_mefesto: I see some of the discussion has moved to clojure-dev too
21:23mefestodnolen_: thanks!
22:14rationalrevoltusing ring and ring-jetty adapter, can i configure something like a session-listener? I would like to have a count of active sessions in my web-app
22:15rationalrevolti'm not sure how i would use the :configurator parameter for this situation
22:23callenrationalrevolt: there's a number of ways to do this, the best all involve using a third party analytics solution.
22:23callenrationalrevolt: not futzing around with Ring.
22:25rationalrevolthmm, i want to show the number of user who are online on the page, when a user visits my app - i was hoping to keep the active session count as an atom/ref and mutating it through something like a sessionlistener
22:25minikomiHi there
22:30brehautrationalrevolt: sessions seem like an awkward way to track that given http is stateless
22:31brehautand teh lifetime of a session doesnt necessarily correspond to the actual lifetime of a visit
22:32callenrationalrevolt: don't do that.
22:32rationalrevoltmy app is a statefull game - and every user's gamestate is stored on the session
22:32callenrationalrevolt: you need JS to know who's actually on the site.
22:32rationalrevoltthats true
22:32callenrationalrevolt: you could do a JS -> heartbeat API -> Redis
22:32callenrationalrevolt: but I mean, third party analytics solutions have already done the work and come with APIs.
22:32callenso.
22:33callenbest solution would be to cache the results from the third party API
22:33callenbecause if you try to write a client-side heartbeat module, I guarantee you it is going to break in subtle and impossible to track down ways.
22:33callenways that could lead to Cthulhu siphoning off your sanity with one of his many eldritch tentacles.
22:33brehautcallen: distributed computation is hard, news at 11 :P
22:34callenbrehaut: to be fair, we've had atomic increments and decrements for a long time.
22:34brehautalso, he eats with tentacles, his mere presence or dreams do the sanity siphoning ;)
22:35callen^^ twoo
22:35callenrationalrevolt: do you have any other dreams I can crush?
22:35callenrationalrevolt: I've had coffee and am feeling frisky/.
22:36brehautFhtagn
22:37callenbrehaut: I'm actually listening to lovecraftian black metal right now.
22:37rationalrevoltlol, i know session's wouldn't tell me how many are actually really playing my game
22:37callenbrehaut: slash blackgaze. It's quite wonderful.
22:37brehautcallen: lol
22:37callenrationalrevolt: it wouldn't tell you anything at all.
22:37callenbrehaut: totally incidentally, I was listening to it before this conversation started.
22:38brehautcallen: its only appears incidental because your meagre human perspective is so small
22:38callenbrehaut: I mean, the great old ones have been manipulating my will for many years now.
22:38brehautcallen: important question then: tree or star
22:40callenbrehaut: tree because it flies past the muggles.
22:41brehauthttps://www.youtube.com/watch?v=BWT07iRvI9M
22:42callenbrehaut: yeah I've seen that. good video.
22:43callenbrehaut: it really bothers me when youtube has better content than 97% ofSNL
22:43brehauti have no idea what SNL is
22:43callenbrehaut: saturday night live?
22:44brehautoh right. ive never seen it.
22:44callenbrehaut: best way to be. Keep it that way.
22:58rlazerowitzDoes anybody know of a library that will let me get the distance (radius) between 2 coordinates?
22:59rlazerowitzSo I can check if one pair of coordinates is .5 miles near another coordinate
22:59callenrlazerowitz: isn't that just arithmetic?
22:59rlazerowitzcallen: Is it?
23:00rlazerowitzcallen: to actually get a radius?
23:00callenrlazerowitz: is this something involved data in a database, or in-memory?
23:00rlazerowitzcallen: As part of a function
23:00rlazerowitzcallen: Yea I guess you are right just simple arithmetic
23:01callenso I'm not totally crazy.
23:01rlazerowitzcallen: Yea lol I feel like an idiot. Any good libs though that handle geolocation?
23:01xeqiwell, coordinate systems that convert to miles usually do some warping
23:02rlazerowitzxeqi : go on?
23:08brehautrlazerowitz: http://en.wikipedia.org/wiki/Map_projection
23:08rlazerowitzbrehaut: Thanks but this function would not be for more than a few miles
23:09xeqiright, thats what I was thinking
23:09xeqithough wgs84 and the haversine formula might work fine
23:10xeqiassuming a spherical earth was close enough
23:10brehautrlazerowitz: if you picked the wrong projection, a few miles is enough to distort depending the points are located
23:10rlazerowitzI see this just needs to give a rough estimate of how close you are to someone else in a city
23:10rlazerowitza few blocks
23:10gt`hi
23:11gt`need to get some pointers on how to configure slime for clojure on emacs
23:13brehautgt`: do you absolutely need slime?
23:13brehautgt`: because clojure emacs integration is moving to nrepl
23:13brehautgt`: http://technomancy.us/163
23:14xeqirlazerowitz: as for libs, geotools was the standard java one several years back. Totally over kill for this usage.
23:14xeqiI see there is http://code.google.com/p/simplelatlng/ from a SO question, but can't vouch for it
23:14gt`brehaut: that is wot ppl are using right ?
23:14brehautits likely that something from openstreetmaps might suffice, but then you have an osm dependancy
23:15brehautgt`: nrepl is yes
23:15gt`okay how to i get nrepl
23:15malynrlazerowitz: I use https://www.refheap.com/15862
23:15brehautgt`: https://github.com/kingtim/nrepl.el the readme explains
23:16brehautgt`: depending on your choice of emacs package installation mechanism
23:16callenmalyn: I do all of my geolocation stuff with an abacus and a compass.
23:16gt`brehaut: thanks will check it out
23:23rlazerowitzmarlyn: thanks but that won't account for warping right?
23:23malyncallen: Sounds too complex. My preferred approach to geolocation is to start a random walk and just wait.
23:24malynrlazerowitz: You mean because the earth is an ellipsoid and not a sphere?
23:24rlazerowitzmalyn: yes
23:24callenmalyn: you just but I've seen people use random-neighborhood walkers as a solution to a search problem before.
23:25callenyou jest*
23:25malynrlazerowitz: I thought you only needed accuracy to within a few blocks?
23:25rlazerowitzmalyn: yup
23:26malynrlazerowitz: So wouldn't a spherical earth work in that situation then?
23:26rlazerowitzmalyn: I suppose thanks!
23:27malynrlazerowitz: You bet. Let me know if you need a 16-bit integer version written in Forth. ;)
23:27malyn(which is what I last used that for)
23:27rlazerowitzmalyn: forth?
23:27rlazerowitzlol
23:28malynTurns out it's somewhat complex to do geo calculations without floating point. You have to invent weird new units.
23:28callenrlazerowitz: He actually means the programming language Fors, but he has a Lisp.
23:28rlazerowitzcallen: I got that thought it was funny
23:28callensomeday I'll invent a joke so punningly awful it's lethal. Then the world is mine.
23:29malynOf course on IRC you won't know if we're dead or it's a netsplit.
23:29callenmalyn: especially on freenode.
23:30malyncallen: Exactly. Everyone else may be dead already.
23:31Raynescallen: I'm buying a car. :D
23:31callenRaynes: I'm considering flouting the official requirements of this programming problem that was sent to me and doing it in zippers. Good idea? Y/N
23:31callenRaynes: oooh, congrats on the car!
23:31RaynesCoworker is selling me his car because he is buying a new one. Ridiculously cheap. No way I could turn it down.
23:31RaynesBad part is that now I have to deal with the DMV to get my CA license.
23:31Raynesv_v
23:32callenRaynes: CA DMV is the innermost circle of Hell.
23:32callenRaynes: I have made vehicle purchasing decisions based purely on avoiding them in the past.
23:32RaynesHahaha
23:32callenI'm srs :(
23:32RaynesAlex has been working with me to get me used to driving again before I do any examinations.
23:32RaynesI'm going to drive us to work tomorrow, for example.
23:33RaynesHe has been very helpful. Selling me the car super cheap and assisting me with getting the license.
23:33callenRaynes: good idea. Try not to die.
23:33RaynesWell, I drove for the first time in LA, for the first time at all in 7 months, for the first time in his particular car last Saturday.
23:33tim\nick tbaldridge
23:33RaynesHe had me drive to Century City and then to Santa Monica.
23:34RaynesIt's ridiculous that I have to practice for this crap when I've already been licensed before, but since my AL license expired the day I came here, it's possible they make me take a behind the wheel test.
23:34RaynesProtip: don't not drive for almost a year.
23:34callenYerp
23:35Raynescallen: I also got tickets to OneRepublic in September at the Greek.
23:35Raynes:D
23:36RaynesPLEASE LOS ANGELES, TAKE ALL MY MONEY.
23:43robinkIs it possible to have a macro defined in a binding other than a global one?
23:44robinkFor instance, I have a source file ${projectdir}/src/core.clj that has an individual (defmacro blah ...) line, and the macro is used by a function defined after it. However, the macro ends up getting called from another namespace (user). Is there a way to prevent this?
23:45robinki.e. I only want the macro to apply for a single function in the source file. I'm OK with it being used in an entire namespace, but I would like it not to apply to other namespaces.
23:45echo-areaProbably by defining it as a private one?
23:45robinkecho-area: Ah, how do you define a macro as private?
23:46echo-arearobink: Adding {:private true} to its meta
23:46robinkecho-area: Aha
23:48amalloyrobink: see also clojure.tools.macro/macrolet
23:49amalloy(macrolet [(m [body] (whatever))] (defn foo [x] (m x)))
23:49robinkamalloy: Thanks
23:56robinkamalloy: Does macrolet support defining a macro that's used by defmulti?
23:57robinkamalloy: I've got a macro that's (defmethod name type [binding] (expanded form))
23:57amalloyhuh? it just defines a macro that exists only within the defined lexical scope
23:57robinkamalloy: Gotcha.
23:57robinkamalloy: and defmulti handles the dispatch appropriately, whether the macro is local to a scope or not?
23:58amalloyrobink: try it and see
23:58robinkamalloy: OK