#clojure log - Jun 17 2013

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

0:00 ddellacosta: cemerick: but self-hosting cljs would probably be better anyways, if you mean something loading in the browser env itself (?)

0:00 dnolen: hrm was going push out the first core.match beta but doesn't seem to want to build ...

0:00 cemerick: ddellacosta: yup

0:01 ddellacosta: cemerick: gotcha. Yeah, that would certainly be the best I think.

0:02 tomjack: hmm, you've discovered a new collection type? :)

0:02 ddellacosta: alright, 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.

0:02 dnolen: tomjack: doubtful :)

0:02 cemerick: ddellacosta: https://github.com/kanaka/clojurescript/

0:03 ddellacosta: ah, sweet.

0:03 cemerick: ddellacosta: np, and thanks :-) Maybe I'll squeeze off a 5m video sometime :-)

0:03 ddellacosta: sad the last commit is 4 years back. :-(

0:03 cemerick: that'd be great!

0:03 cemerick: what, no

0:03 ddellacosta: oh, maybe wrong branch then

0:04 yeah, that's weird, huh, since the README reference 2013

0:04 2012 I mean

0:04 cemerick: ddellacosta: something's wonky...cljs isn't even two years old

0:04 ddellacosta: yeah, good point..heh

0:04 tomjack: dnolen: looking at Complier that's really the only explanation I can think of, though..

0:04 ddellacosta: cemerick: yeah, clearly the commit log shows recent commits, so something is weird there. Anyways, will check it out.

0:05 dnolen: tomjack: eh, probably Hudson weirdness

0:05 tomjack: all the constructor calls for EmptyExpr are guarded with IPersistentCollection checks

0:06 but it's not a list, vector, map, or set? boggling

0:06 cemerick: dnolen: I'd try wiping the hudson workspace and triggering a new build

0:06 dnolen: cemerick: how do you do that?

0:06 cemerick: dnolen: click on workspace, then 'wipe'

0:07 then start a build

0:07 tomjack: hmm, PatternRow is a new collection type, irrelevant?

0:07 dnolen: cemerick: ok giving that a shot

0:08 cemerick: dnolen: that's the "clean" of the hudson world :-P

0:08 dnolen: tomjack: hrm, but why would that matter?

0:09 cemerick: didn't work

0:09 tomjack: and PatternRow has been a collection for a long time now

0:09 tomjack: but you just started AOT'ing, yes?

0:10 doesn't make sense that it would break on hudson and not locally though

0:10 cemerick: dnolen: your project.clj requires clojure 1.5, but the default contrib pom specifies 1.4?

0:10 tomjack: actually

0:10 I get the same error locally

0:10 dnolen: tomjack: yes I've been testing AOT locally

0:11 cemerick: oh hmm

0:11 tomjack: what are you doing to repro?

0:11 tomjack: mvn compile

0:12 from master

0:13 dnolen: tomjack: yeah just tried that worked

0:14 oops actually spoke too soon

0:16 tomjack: if PatternRow were the culprit I'd guess some macro would have to be returning one in the code it emits?

0:17 and an empty one

0:20 dnolen: tomjack: pretty sure it's as cemerick says 1.5.0 issue

0:23 tomjack: seems so

0:23 which is even more confusing to me

0:25 because EmptyExpr seems the same in the relevant respects

0:25 dnolen: huzzah

0:25 tomjack: if not all respects

0:25 dnolen: core.match-beta1 is out!

0:26 no more scary AOT warnings!

0:41 it's remarkably satisfying that this stuff "just works" in CLJS

0:53 tomjack: so, what, using as-> and cond-> caused that crazy compiler error? O_o

0:54 dnolen: tomjack: no, I think marker protocols was the problem

0:58 tomjack: interesting

1:00 https://groups.google.com/d/msg/clojure/7xa7Yg0-htc/fG1HuBozewwJ

1:00 so the fix was a workaround in emit-protocol

1:03 dnolen: beta2 going out

4:14 ddellacosta: so, "null" and nil are not the same thing in ClojureScript??

4:14 lazybot: ddellacosta: Uh, no. Why would you even ask?

4:14 ddellacosta: ??

4:14 lazybot: ddellacosta: What are you, crazy? Of course not!

4:14 mthvedt: ??

4:14 lazybot: mthvedt: Uh, no. Why would you even ask?

4:14 ddellacosta: didn't know lazybot did that. heh.

4:14 mthvedt: lazybot: are you well programmed??

4:14 lazybot: mthvedt: Uh, no. Why would you even ask?

4:15 r0bgleeson: ddellacosta: did what, aritificial intelligence?

4:15 ddellacosta: r0bgleeson: no, responded with something specifically when you had double-question marks (if my conclusion is correct.)

4:16 r0bgleeson: although, I guess maybe that's what you meant, so yes.

4:17 r0bgleeson: ddellacosta: i was making a lame joke :)

4:17 ddellacosta: r0bgleeson: ah, haha…sorry, I'm feeling a bit slow at the moment. ;-)

4:47 Guest15375: @borkdude Hello

4:47 borkdude: Guest15375 hi

4:48 Guest15375: @borkdude Nathan and Bram here, we have a question

4:48 borkdude: yes

4:49 I'll turn on Skype

4:50 Guest15375: @borkdude Is good, are you available on the HU?

4:50 borkdude: Guest15375 my skype name is michielborkent - no, from 14:00 I'm at the HU

4:51 Guest15375: @borkdude Inventation has been sent.

4:55 wei_: how do you serve a static html file in a compojure route?

4:59 clgv: wei_: route/files

4:59 wei_: with compojure.route :as route

4:59 wei_: clgv: could I give it a name that's not the original filename?

5:00 Raynes: Eh

5:00 wei_: oh i se

5:00 Raynes: wei_: Just do (let [static (slurp your-file-or-resource)] (defroutes …)) and serve it however you like it.

5:00 That's what I do.

5:00 More or less

5:01 wei_: thanks

5:01 clgv: Raynes: but that keeps the file in memory which is not suitable in all use cases (very many large files...)

5:02 Raynes: uh

5:02 clgv: 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.

5:03 Unless you've got 20 100MB HTML files, you're probably okay.

5:03 clgv: Raynes: oh, the question was to html files only - I did miss that ;)

5:04 wei_: there are huge html files, but mine is not one of them

5:08 bsmith: hi, i'm new and trying to understand code from ring

5:08 (defn- ^SimpleDateFormat formatter [format] ...)

5:08 does ^SimpleDateFormat have any effect here? or is it just to communicate the return type to the reader?

5:09 antares_: bsmith: and to the compiler, too

5:11 bsmith: what effect does this have during compile-time or run-time? will it throw if the function returns a different type?

5:11 is there a doc on clojure.org that explains this? sorry, i couldn't find one

5:12 borkdude: bsmith this is called type hinting

5:12 http://clojure.org/java_interop#Java Interop-Type Hints

5:12 antares_: 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.

5:13 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.

5:14 bsmith: great, thanks to both

5:14 antares_: bsmith: I highly recommend http://clojure-doc.org, by the way

5:15 callen: just wish clojuredocs would get updated.

5:15 antares_: how do you feel about a clojurewiki?

5:16 antares_: callen: not sure what that is

5:17 callen: antares_: thinking of making a wiki for Clojure, like EmacsWiki

5:18 antares_: callen: well, if the goal is to improve Clojure doc guides, just contribute to clojure-doc.org

5:18 (which has a bit too much stuff because of how enthusiastic we were in the beginning, admittedly)

5:19 emacswiki has *a lot* of stuff Emacs docs will never cover

5:19 callen: antares_: contributing to clojure-doc is really annoying.

5:19 antares_: for that, more resources make sense

5:19 callen: how?

5:19 callen: antares_: and AFAICT, it doesn't really cover the core docs use case like clojuredocs.

5:19 antares_: it's markdown in a pull request on github

5:19 callen: antares_: dude, that's unacceptable. I'm sorry.

5:19 antares_: how much more straightforward can it be?

5:19 callen: antares_: it's about friction, not obviousness.

5:20 antares_: callen: hm

5:20 callen: have you tried contributing to clojure at all?

5:20 THAT'S unacceptable and friction

5:20 callen: antares_: I really don't care about core dev in this context

5:20 antares_: their sins don't excuse yours.

5:20 antares_: callen: you can literally edit markdown on github.com

5:20 callen: why is it easier to accumulate knowledge collaboratively for a text editor than a programming language + ecosystem?

5:20 antares_: yeah, still don't care.

5:21 antares_: how much more convenient can it be?

5:21 callen: antares_: it's not, at all.

5:21 antares_: callen: sounds like you just "don't care for markdown". I don't care for wikis.

5:21 callen: it has nothing to do with markdown

5:21 antares_: wikis are too hard to keep structured

5:21 callen: in fact I planned on using md for the wiki.

5:21 antares_: callen: then how is it radically easier to edit a wiki page?

5:21 callen: if you don't understand the value of immediacy I can't really help you.

5:21 antares_: just say, "no, I don

5:22 't see the value of a wiki"

5:22 antares_: callen: I really don't think people contribute solid docs on the spot

5:22 callen: and leave it at that.

5:22 antares_: like, let me JUST WHIM OUT SOME DOCS, RIGHT NOW

5:22 no, that's not how it works

5:22 callen: you clearly haven't worked on a wiki.

5:22 antares_: callen: yes I have, for many years. It's fucking terrible.

5:23 wikis are undstructured mess unless you have an army of people and rules enforcing the structure, like Wikipedia does

5:23 you same some time for writers

5:23 and waste oceans of time for readers

5:23 in any case, I don't mind you starting a wiki

5:23 clojure-doc.org content is "free to steal", CC 3.0 licensed

5:23 I don't believe the language documentation needs another resource

5:24 and API reference (clojuredocs.rg) has nothing to do with clojure-doc.org, it was never a goal to provide an API ref

5:24 callen: antares_: I didn't say it was

5:24 antares_: the new clojuredocs.org, whenever it is ready, can be integrated into clojure-doc.org

5:24 callen: antares_: I wasn't talking about clojure-doc at all.

5:24 antares_: but it's still a separate resource, with an API

5:25 callen: there is a wiki at dev.clojure.org for the cool kids with paper CA (read: living in America)

5:25 it's not updated very often

5:25 callen: antares_: I hate JIRA

5:25 antares_: in theory, it provides the benefits of a wiki

5:25 callen: and I don't want a wiki that requires CA

5:25 antares_: that I can understand

5:25 callen: antares_: if you're going to offer suggestions, at least think first.

5:25 antares_: if I want a low friction way to accumulate knowledge about clojure and the wider ecosystem, why would dev.clojure suffice?

5:26 antares_: callen: you know what, I will probably go work on some OSS code instead of arguing you

5:26 callen: antares_: I just wanted to know if the notion of a wiki seemed useful to you or not.

5:27 a simple no would've sufficed.

5:27 antares_: 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.

5:27 callen: what new clojuredocs?

5:27 as far as I aware, it was derelict.

5:27 antares_: clojuredocs.org in Clojure, without being locked into a particular version http://github.com/clojuredocs

5:27 and with an API

5:28 the repo name is eisago

5:29 callen: antares_: it was last updated 7 months ago.

5:29 antares_: callen: I will write a blog post about it

5:29 callen: so?

5:30 callen: and it's still not live

5:30 antares_: callen: the original author no longer has time

5:30 callen: are you arguing to death about anything or just with me?

5:30 fuckin make it go live

5:30 callen: why invest effort with no guarantee it would go live?

5:30 antares_: hahahahaha

5:30 callen: that's not how OSS works

5:30 finish the code, deploy it, here, you have it live

5:31 callen: it's not even what I want

5:31 what I want is the core docs + wiki

5:31 I don't give a damn about an API either.

5:31 antares_: callen: it is what clojuredocs.org has today

5:31 + API

5:31 callen: well you don't but it's useful

5:31 a yet another wiki? no

5:31 tools developers care about API reference having an API

5:32 IDE plugin authors, nrepl integration hackers, etc

5:33 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.

5:33 callen: antares_: I've run into problems in the past where somebody else owned the domain/trademark and I couldn't deploy a copy

5:33 antares_: and if I wanted changes to go live, I had to harass them

5:33 antares_: please stop pompously educating me on how "OSS works"

5:34 antares_: 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

5:34 callen: I've already said it isn't what I want, contributing to it wouldn't make sense.

5:35 antares_: callen: I have no idea what you want then, but it's clearly something that YOU have to do

5:35 contributing to things that are useful to the community are not your thing, I gather

5:35 callen: no, it just makes sense.

5:35 antares_: good luck. No need to ask anybody for an opinion next time :)

5:35 callen: if I don't understand what I'd want out of it, I'm less capable of producing something nice and useful.

5:36 That's just basic usability.

5:36 all I wanted to know was if a wiki would be useful. Not to be put through the wringer.

5:37 antares_: ok, I'm sorry

5:39 callen: antares_: 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.

5:42 antares_: it is useful, I was talking about language documentation

5:46 callen: antares_: well if the new clojuredocs is a thing, then I can just focus on the wiki and hope that comes together.

5:47 antares_: callen: most of it is done, I hope to work on it after we ship our next clojurewerkz library

5:48 it also has a library that extracts docstrings and such from the code

5:48 at the very least you can reuse that

5:49 callen: antares_: oooh, what's the next clojurewerkz library?

5:49 antares_: http://clojurecassandra.info

5:49 callen: Very cool :)

5:49 antares_: needs the docs finished and a proper announcement, currently at RC4

5:50 built on the new DataStax Java driver, pretty similar to clojure.java.jdbc in scope and API style

6:26 noncom: why 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?

6:27 i mean why does not it turn the map into text by itself and yields nothing from it?

6:27 mpenet: because when you return a map it's supposed to follow the response spec

6:27 from ring

6:27 {:body "prout"}

6:27 if you want an output

6:28 a string return value will be fed to :body automagically

6:28 noncom: mpenet: oh i see! nice thing actually! didn't get to this point at docs, but thank you!

6:28 mpenet: noncom: https://github.com/ring-clojure/ring/blob/master/SPEC

7:05 m00nlight: Hi, 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

7:13 noidi: m00nlight, maybe your behind a NAT?

7:13 *you're

7:13 m00nlight: noidi: Yeah, I think so. My personal computer behinde an NAT,

7:15 noidi: So what maybe the problem?

7:18 noidi: m00nlight, you need to forward a port on the NATing device to your computer

7:18 m00nlight, http://en.wikipedia.org/wiki/Port_forwarding

7:20 m00nlight: noidi: if the server has an external IP, I still need forward a port?

7:20 noidi: The server has an external IP address

7:21 clgv: m00nlight: you are probably behind a router and need to forward the port at the router to your server

7:23 m00nlight: clgv: 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

7:24 clgv: m00nlight: you definitely need the system that is "in front of" your server to forward the port

7:26 m00nlight: clgv noidi: Thanks for your help

7:30 clgv: m00nlight: just to clarify, you rent a server in a computing center?

7:46 loz: hi

7:47 how should i install data.json library?

7:47 if i dont have a clojure project, its needed for rails/clojurescript?

8:01 cemerick: loz: Neither Clojure or ClojureScript libraries are "installed". They are obtained and tracked by a project file like those used by Leiningen.

8:04 loz: cemerick: i already found jar snapshots

8:05 but i still got

8:05 Exception in thread "main" java.io.FileNotFoundException: Could not locate clojure/data/json__init.class or clojure/data/json.clj on classpath:

8:05 cemerick: loz: are you using Leiningen?

8:05 loz: i dont have clojure project

8:06 cemerick: that's problem #1

8:06 loz: does this error mean data.json is not in classpath?

8:07 cemerick: yup

8:14 loz: cemerick: should i add to classpath every .jar which bootstrap downloads?

8:14 like google-closure-library-0.0-2029-2.jar

8:15 cemerick: loz: Unless you have a really good reason, you should be using leiningen.

8:15 loz: its rails dude

8:16 and there is plugins for rails wich downloads and setups clojurescript

8:16 plugin*

8:16 and looks like this plugin is a bit outdated

8:16 cemerick: loz: 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.

8:17 perhaps ask whoever put together this rails/clojurescript integration how things are supposed to work there?

8:18 loz: okey, ill continue my investigation)

8:19 tomjack: script/bootstrap should download data.json

8:20 loz: tomjack: yep, but plugin doesnt include it into classpath

8:20 gonna include every jar bootstrap downloads

8:20 and try

8:20 ls

8:20 lazybot: dev etc lost+found media root src

8:21 loz: haha lol

8:23 cemerick: loz: could you link to this rails/clojurescript thing?

8:23 loz: sure

8:23 https://github.com/maximvl/clementine

8:23 there is a blog post link on how to setup it

8:25 oh and i gave you my fork link)

8:25 cemerick: np

8:25 so this clojurescript source tree in /ext -- this is an example of the whole rails "vendoring" practice?

8:26 loz: idk im new to rails :D

8:28 cemerick: funny, reminds me of JSP precompilation

8:29 loz: is this code correct?

8:29 (ns app)

8:29 (defn ^:export init []

8:29 (js/alert "initializing!"))


8:29 want to call ns.init() from html

8:30 *app.init()

8:31 cause now i get

8:31 Exception in thread "main" java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol


8:39 xeqi: cemerick: looks like thats a ruby project, but its a similar concept

8:40 cemerick: xeqi: Yup. Quite upsidedowninsideoutbackwards to me, but whatever. :-)

8:41 xeqi: heh, its recommended for external code. here is a rubygems guide showing it for a C wrapper http://guides.rubygems.org/c-extensions/

8:42 cemerick: xeqi: don't mind me being curmudgeonly. I'm merely a ruby/rails observer, never used the stuff.

8:43 xeqi: cemerick: well now you've peaked my curiousity. Hows jni or the .net equivalent find the native code?

8:44 *piqued

8:45 cemerick: xeqi: 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.

8:47 xeqi: 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.

8:48 loz: xeqi: do you have any experience with cljs on rails?)

8:48 cemerick: Rails aside, it seems to be a common thing in ruby only because so many of its modules are apparently thin C wrappers

8:49 hyPiRion: xeqi: oh, JNI is painful. Anything very low-level is painful in general

8:50 xeqi: loz: nope

8:51 cemerick: hyPiRion: ever used JNA? It wasn't so bad, last time I used it (~2 years now)

8:54 hyPiRion: cemerick: I was more thinking about low-level jvm stuff, such as catching POSIX signals or throwing file decriptors from a process to another

8:54 I 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

8:55 /s/exceptions/signals/

9:23 futile: mthvedt: 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:01 stuartsierra: JNI isn't that bad. You can skim the docs and get something running in half an hour.

11:04 wink: that's like "you can skim the recipe and not die eating what you cooked"

11:05 llasram: That is the best analogy I've heard all week

11:05 bpr: that is pretty classic

11:07 janpaulbultmann: Any thoughts on how to do co recursion with let bindings? akin to this https://gist.github.com/ticking/5797558

11:09 llasram: janpaulbultmann: Lazy sequences which references themselves sometimes work, but as an implementation side-effect. They generally are not a good idea

11:11 janpaulbultmann: llasram: thanks, noted :)

11:24 mikerod: Has 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:25 Lajjla: mikerod,

11:25 the Ashtadhyayi is the single most brilliant thing ever made by man

11:28 mikerod: Lajjla: I'm not sure I follow you...

11:28 Lajjla: mikerod, do you know what it is?

11:28 mikerod: I had to look up this Ashtadhyayi, and the most relevant meaning I could find is its relation to language theory.

11:28 Lajjla: It's essentially a formal definition of the grammar of Sanskrit in some sort of backus-nauer esque form

11:28 made 400 BCE.

11:28 A formal definition of the grammar of a natural language.

11:28 At that time

11:28 It took up to the 20th century before western linguistics could catch up.

11:30 mikerod: Lajjla: That is quite interesting. hah

11:31 Lajjla: You found that this relates to clojure-maven-plugin? :)

11:31 Lajjla: mikerod, panini also innovated the destinction of the phone to the phoneme

11:31 mikerod, not at all.

11:31 It is far more important

11:31 because it is the single most brilliant thing ever

11:32 the Ashtadhyayi fully defines the grammar of sanskrit with zero redundancy

11:32 ohpauleez: it's unclear if this is spam or a troll

11:32 but either way, it's irrelevant

11:32 mikerod: Lajjla: Well, I am enlightened now.

11:32 ohpauleez: haha

11:32 ken_barber: lol

11:33 Lajjla: ohpauleez, please, this is something anyone should know.

11:33 The Ashtadhyayi was two millennia before its time

11:33 llasram: Oddest spammer ever

11:33 ohpauleez: yes

11:33 for real

11:34 Lajjla: it 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:34 ohpauleez: can we get an admin?

11:34 Lajjla: How can you consider appreciation for such a monumental effort spam?

11:34 What kind of willfully ignorant person are you to not recognise the significance of the ashtadhyayi, nor its brilliance.

11:35 mthvedt: i feel like the time cube guy has found a new hobby

11:35 llasram: Lajjla: No matter brilliance, it is far off topic for this channel, and thus contextually spam

11:36 Lajjla: Brilliance ought never to be off topic.

11:36 Besides

11:36 it stands at the very fundament of programming languages.

11:36 ohpauleez: We'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:37 nonetheless, it's a good way to get you kicked

11:37 Lajjla: Please, I've been doing this for 5 years in this channel.

11:37 Raynes loves me.

11:37 Do you not raynes?

12:03 futile: Thinking it's nearing done: https://github.com/evanescence/test2/blob/master/SPEC.md

12:03 It addresses the issues amalloy_ and mthvedt have recently brought up.

12:07 bbloom: futile: why are there still noun suffixes on everything?

12:07 (runner finder reporter) => (run find report)

12:07 they are functions, not abstractions, right?

12:09 and 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:14 futile: bbloom: I think of them as roles, not just functions.

12:15 bbloom: the fact that it's currently a function is incidental (although they'll likely always be functions)

12:15 bbloom: futile: you are specifying them to be functions....

12:15 futile: bbloom: i like the idea of renaming finder -> discoverer though

12:15 bbloom: yes. but i still think of them as roles.

12:15 bbloom: it's hard to refer to them in the documentation as verbs:

12:15 bbloom: futile: that's just leftover OOP brain damage :-)

12:16 futile: bbloom: it may be so. let me look through the spec for a second.

12:16 bbloom: (str "the " role " function")

12:16 futile: maybe its not as ugly as im thinking to say it

12:16 "The Runner does not need to return." -> "`run` does not need to return."

12:16 I can see that.

12:16 bbloom: yup

12:17 i'm sure somebody already pull this move on you:

12:17 ~nouns

12:17 clojurebot: excusez-moi

12:17 bbloom: ~kingdom

12:17 clojurebot: It's greek to me.

12:17 bbloom: blah.

12:17 ~noun

12:17 clojurebot: LINE-ing-en ['laɪnɪŋən]

12:17 futile: bbloom: yea i saw that

12:17 didnt read it yet, but yeah

12:17 i mean i skimmed it

12:17 yegge is verbose

12:17 mthvedt: bbloom: having a test file full of "run"s seems confusing

12:17 bbloom: yes, yegge is very verbose

12:18 mthvedt: no, you have a test file full of tests…. you only need one run function

12:18 mthvedt: sorry, misread

12:18 TimMc: If this is who I think it is: /ignore -replies *!g2g2go2@*

12:19 Oh, it's the other one.

12:19 futile: bbloom: 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:19 mthvedt: but the objection works for finder and reporter… i think the idea is that you might have other impls

12:20 futile: bbloom: 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:20 rlb: what's the name of the command line library that automatically handles sub commands?

12:20 i.e. "$ foo cmd ..."

12:21 bbloom: futile: this is a trivial matter of word smithing

12:21 futile: rename your sections to "Definitions", "Assertions", "Discovery", "Execution", and "Reporting"

12:21 rename the finder/runner/reporter functions to discover/run/report

12:21 or discover/execute/report

12:22 you don't need to reify the "roles"

12:22 devn: rlb: er, not sure?

12:22 futile: bbloom: fancy

12:22 rlb: devn: ok, thanks -- someone posted it either here or on the list a while back, but now I can't recall the name.

12:22 futile: bbloom: 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:23 mthvedt: i would remove the nouns definer and asserter, but keep the other ones

12:23 bpr: #p

12:23 bleh

12:24 rlb: devn: 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:24 devn: rlb: i did a cursory search for you

12:24 but no dice

12:25 rlb: is it an argument parsing library then?

12:25 rlb: yes

12:25 I thought it was posted by someone from one of the clojure companies I'd heard of, but don't recall...

12:25 (there was a github page, etc.)

12:25 devn: anyway, thanks -- I'm sure I'll find it eventually.

12:25 mthvedt: oo style nouns like 'asserter' are loaded with the idea that you're talking about closures with behavior

12:26 behavior that fits an interface to some other lib

12:26 rlb: devn: if I recall correctly, the lib made it easy to specify the sub-commands and their behavior.

12:26 mthvedt: but asserters are consumers of the test2 interface

12:26 bbloom: mthvedt: yeah, when i see an actor suffix like -er or -or, i assume there is state in that thing

12:27 devn: rlb: i found an old one: argparse4clj (https://github.com/tatsuhiro-t/argparse4clj)

12:27 futile: bbloom: that sounds like a faulty assumption on your part, not a bad definition

12:27 rlb: devn: yeah -- that's not the name I recall

12:27 devn: it was some *other* lib for parsing command lines with sub-commands.

12:28 bbloom: futile: more of a conservative heuristic than a faulty assumption

12:28 mthvedt: but i think e.g. 'reporter' is OO in the sense that a reporter is expected to fit an interface and have some behavior

12:28 OO-lite

12:31 maybe clojurians might prefer 'report-fn' over 'reporter', i dunno

12:32 bbloom: mthvedt: yes. if you want to differentiate between a report data structure and the report function

12:32 TimMc: ohpauleez: Unfortunately, I think chouser and rhickey are the only ones with ops.

12:33 ohpauleez: TimMc: Yeah, I saw the message on the mailing list - perhaps we'll get some more admins in here

12:35 bpr: mthvedt: very much so

12:35 futile: ohpauleez: for what?

12:36 bpr: mthvedt: but, report is ok for me as well

12:36 ohpauleez: futile: There's been a slight rise in spammers in the channel

12:36 futile: oh? hadn't noticed.

12:36 ohpauleez: and it's bothering some people enough that they raised the issue

12:36 futile: I see.

12:36 ohpauleez: I didn't either, until this morning

12:37 TimMc: It's very sporadic.

12:37 ohpauleez: yes

12:43 futile: Okay, notified mailing list. Expecting to get yelled at again for some reason.

13:09 loliveira: hi, does somebody know some good Facebook library?

13:33 futile: Oh no!

13:33 Sometimes the same function isn't = to itself!

13:35 ,(= = =)

13:35 clojurebot: true

13:35 futile: ,(= = (eval '=))

13:35 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

13:36 futile: Oh right.

13:36 ,(load-string "=")

13:36 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

13:36 futile: :(

13:36 ,(= = (var-get (resolve '=)))

13:37 clojurebot: true

13:37 futile: bultitude!!

13:37 At least I think that's what's making this not equal :(

13:37 ianeslick: If 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:38 futile: ianeslick: if you aren't married to the idea of extending Map, you could just return [[k v] [k v] ...] already sorted.

13:39 ianeslick: I'm creating a new data type that wraps the functionality of a remote database (scalable key-value stores).

13:39 futile: ianeslick: i.e. ##(sort-by :a [{:a 3 :b 3} {:a 1 :b 1} {:a 2 :b 2}])

13:39 lazybot: ⇒ ({:a 1, :b 1} {:a 2, :b 2} {:a 3, :b 3})

13:39 ianeslick: I'm building an in-memory testing version first

13:39 futile: Uhh, oops.

13:39 ianeslick: So this is a subproblem

13:39 futile: ianeslick: oh

13:40 ,(sort-by :a [{:a 3 :b 3} {:a 1 :b 1} {:a 2 :b 2}])

13:40 clojurebot: ({:a 1, :b 1} {:a 2, :b 2} {:a 3, :b 3})

13:40 ianeslick: Use a map to simulate a remote key-value store without re-implementing or wrapping Map

13:40 I have some new protocols for transforming Index Values to a smaller Index based on range, value-filter, or other constraints.

13:40 futile: ianeslick: fwiw we just have a function that takes mongo "objects" and converts it to a real-live Clojure map

13:40 ianeslick: but that's the last of my helpfulness on this topic

13:41 (if it even is such)

13:41 ianeslick: Yeah, 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:42 Want 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:42 I'm starting with DynamoDB, but may need to leave Amazon later this year for legal reasons.

13:42 So I need an in-memory testing version + a production DDB version of the type.

13:42 Still feel like I don't fully understand protocols!

13:43 Wild_Cat`: ianeslick: note that DynamoDB doesn't sort anything.

13:43 wait, no, it does. It sorts by range key

13:44 but hash keys are arbitrarily-ordered.

13:44 futile: Oh no! (require :reload) makes = no longer work on functions, because it gives them a new ptr! Dang.

13:44 ianeslick: Yes, so you have to have hints that tell the interface how to construct keys for range queries

13:44 futile: Okay okay, calm down.

13:44 Is there another way to compare two functions as being equal when in a test?

13:44 ianeslick: I'm only generalizing enough for my simple application

13:45 Tuplanolla: How can I automatically reload Clojure files in the repl when they change?

13:45 technoma`: futile: you have to compare vars

13:45 futile: technoma`: :( that's what I was afraid of.

13:45 hyPiRion: humm

13:45 futile: technoma`: because in test2 we agreed to move away from vars for the internal representation of tests, so now my tests have false negatives

13:46 i.e., (= {:func test-1} (find-test-1-somehow)) fails

13:46 blast! foiled again.

13:47 Tuplanolla: Setting up the toolchain is really difficult.

13:48 ianeslick: Is there a way to compare the source code of the function?

13:48 In some toolchains that is stored in the Var metadata

13:48 (or something like that)

13:48 futile: hyPiRion, technoma`: does this seem too horrible to live in a test? (= (.getName (type test-1)) (find-test-1-somehow))

13:49 ianeslick: So, no hints on best practice for creating a derived version of Map with new behaviors and some extra protocol implementations?

13:49 Tuplanolla: There's ring.middleware, but it's essentially undocumented, so I have no idea how to use it.

13:50 patchwork: Tuplanolla: It doesn't reload automatically when source changes, you have to (require :reload '[your.namespace :as x])

13:50 dnolen: ianeslick: it's a bit of work, look at how defrecord is implemented

13:50 Tuplanolla: I want to avoid doing that.

13:50 technoma`: Tuplanolla: there are ways to make it work, but it's way easier to just get your editor to trigger the reload.

13:50 since it knows when you save already

13:51 futile: if everyday testing requires stuff like that then yeah; pretty bad. depends on context though.

13:51 Tuplanolla: I'm not so sure about IDEA.

13:51 patchwork: laneslick: you can have all this functionality without deriving a new Map implementation

13:51 weavejester: Tuplanolla: What do you mean by ring.middleware? The middleware in the official Ring libraries?

13:51 mthvedt: futile: why not compare assertions to know you've found the right test

13:52 futile: mthvedt: thats disproportionally harder

13:52 Tuplanolla: This, weavejester: https://github.com/weavejester/ring-reload-modified

13:52 weavejester: ianeslick: Unless you want polymorphism, you don't need to use protocols to add new functionality

13:53 mthvedt: if you're just smoke testing discovery, you could even compare return values

13:53 weavejester: Tuplanolla: That should have a deprecated note on. The functionality has been rolled into ring-devel for a while now.

13:53 ianeslick: I 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:54 Tuplanolla: I don't see the note anywhere. I'm just trying to set things up.

13:54 weavejester: Tuplanolla: Nope, that's why I said "should" :). I'll add the note to the readme.

13:55 Tuplanolla: If you use lein-ring, it will setup reloading for you automatically.

13:55 Tuplanolla: Otherwise you can wrap your handler in ring.middeware.reload/wrap-reload

13:55 futile: (inc lein-ring)

13:55 lazybot: ⇒ 1

13:55 futile: Have been very pleased with it.

13:56 ianeslick: Basically 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:56 Tuplanolla: There seem to be a lot of web things related to it. I don't need any of that.

13:56 arcatan: Tuplanolla: if (require :reload ...) is too much, tools.namespace offers you simple call to (refresh)

13:56 dnolen: ianeslick: sure, but what kind of guidance are you looking for? just implement the interfaces you care about.

13:56 arcatan: you'll lose your state, though

13:57 ianeslick: dnolen: 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:58 dnolen: ianeslick: it's in fact impossible

13:58 ianeslick: dnolen: Ok, that's helpful!

13:58 dnolen: ianeslick: and you have no inheritance, you just need to implement everything yourself

13:58 Wild_Cat`: ianeslick: do you need real immutability, or could you make do with java.util.TreeMap?

13:59 weavejester: ianeslick: Are you implementing a new immutable data structure?

13:59 dnolen: ianeslick: you can compose and delegate of course if that's your cup of tea - again see defrecord

13:59 Tuplanolla: So what's the non-deprecated way of doing it, weavejester?

13:59 patchwork: laneslick: I feel like the whole issue is your requirement that it work with existing clojure map code. That seems misguided

13:59 weavejester: Tuplanolla: Are you creating a website or web service or something else?

14:00 patchwork: Just have it work as a library, and call your code explicitly

14:00 It is not a clojure map

14:00 so it shouldn't work with clojure map syntax

14:00 weavejester: Tuplanolla: reload-modified and it's successor in RIng, ring.middleware.reload, are just for Ring

14:00 Tuplanolla: My first project, weavejester.

14:00 ianeslick: No, the idea is to create a datatype that supports clojure interfaces so the new types fit into the system neatly.

14:00 Tuplanolla: The most basic setup.

14:00 ianeslick: Why create new interfaces and new accessors to reproduce what Clojure already supports?

14:01 weavejester: Yes, new immutable structure that is consistent across a cluster of machines.

14:01 weavejester: Tuplanolla: 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:01 Tuplanolla: I just don't want to spend half of the time writing (reload) or hitting up to find it in the command history.

14:01 arcatan: Tuplanolla: what editor do you use?

14:01 Tuplanolla: IDEA at the moment, arcatan.

14:02 technoma`: hrm; should get refresh hooked into nrepl auto-discovered commands

14:02 arcatan: okay. i'm not familiar with IDEA.

14:02 weavejester: ianeslick: I'm not sure I completely understand. By definition, an immutable structure is always consistent.

14:02 patchwork: ianeslick: 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:02 they come with their own interface

14:02 ianeslick: Wild_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:03 weavejester: 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:03 arcatan: 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:03 clojurebot: Ack. Ack.

14:03 Tuplanolla: I've tried emacs, but the keys are painful with a foreign keyboard.

14:03 technoma`: 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:03 clojurebot: I 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:03 ianeslick: That means the abstraction provides an immutable view of an external resource (think HBase used in a write-mostly fashion and keeps history)

14:04 patchwork: ianeslick: That is such a specific use case that I wouldn't want it masquerading as built in clojure types

14:04 ianeslick: Architecturally this is solving similar problems that Datomic solves, but in a write-scalable rather than read scalable fashion.

14:04 weavejester: ianeslick: Ah, okay, so you have some large immutable data structure somewher that's referred to by a UUID or cryptographic hash, presumably.

14:05 ianeslick: weavejester: basically. Tablename + Timestamp + Key is always consistent

14:06 weavejester: ianeslick: And presumably you want a way of doing things to the data structure, like conj etc. without loading it into memory first.

14:06 Tuplanolla: I'm just trying to find a simple setup. I'm a scientist, not a system administrator.

14:06 ianeslick: weavejester: 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:07 arcatan: Tuplanolla: 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:07 Tuplanolla: have you tried using those?

14:07 ianeslick: weavejester: 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:08 weavejester: ianeslick: 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:09 Tuplanolla: That 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:09 weavejester: ianeslick: e.g. (require [foobar.distributed :as d]) (d/conj remote-structure new-value)

14:09 ianeslick: weavejester: 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:10 A 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:10 weavejester: ianeslick: 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:10 ianeslick: Store is easy. Could be done with multi-methods, but Index/Log should probably be types.

14:11 weavejester: That's a good argument.

14:11 weavejester: Easier than implementing clojure's internal interfaces too

14:12 technoma`: 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:12 no one seems interested in implementing it for non-emacs editors so far though =\

14:12 Tuplanolla: Clojure is developing so quickly, half of the materials I find on the internet are already deprecated.

14:12 weavejester: clojure.core.reducers takes that approach - it has its own versions of map, reduce, etc. with subtly different semantics.

14:12 And I'm taking that approach with my FRP library

14:13 ianeslick: weavejester: 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:13 weavejester: Perhaps I was over-influenced by my work with Datomic.

14:13 Tuplanolla: I'll follow that progress, technoma.

14:13 ianeslick: weavejester: Where Entities behave alot like Maps, implementing a subset of clojure interfaces

14:14 My Index type a collection just like that.

14:15 weavejester: ianeslick: 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:15 ianeslick: weavejester: So eschew niceties like keyword lookups, collection as IFn, etc?

14:16 technoma`: Tuplanolla: if it does get picked up, it'll probably be implemented in eclipse before idea.

14:16 weavejester: ianeslick: I'd still use IFn… maybe keyword lookups too...

14:17 ianeslick: I guess things that I can port directly I would, but anything which doesn't quite fit would need a new function.

14:17 ianeslick: weavejester: 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:17 Tuplanolla: If only Eclipse wasn't so slow at everything...

14:17 ianeslick: Entities are tied to a particular point-in-time Database value.

14:18 weavejester: ianeslick: It sounds like Entities are in-memory and immutable, but have additional constraints over maps.

14:18 ianeslick: weavejester: 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:18 weavejester: Yes, took a bit to get used to writing code based on maps you couldn't augment directly.

14:18 weavejester: via assoc

14:18 technoma`: Tuplanolla: I've never used it; I've just noticed they seem to be more on top of things

14:18 weavejester: Interesting...

14:19 ianeslick: You 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:20 Tranactions can include functions that run on the transactor, so you can avoid most rollbacks based on local read-modify-write operations.

14:20 Tuplanolla: It starts for fifteen minutes and using content assist with the whole JDK 7 included freezes the context menu for five minutes.

14:20 ianeslick: Gives you cluster wide transactability, but all your data manipulation is based on in-memory cached covered indexes of the current state.

14:20 weavejester: ianeslick: 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:20 ianeslick: weavejester: You've sold me on that as an interim if not final strategy, thanks. Just the advice I was looking for.

14:21 futile: All this pain is making me rethink using vars again in the official data representations, /cc mthvedt amalloy et al

14:26 Tuplanolla: IDEA seems to be also missing documentation. I guess I'll have to use emacs.

14:27 bpr: learning emacs is an investment that pays off many times over

14:27 though, it is an investment

14:28 Tuplanolla: I learned the basic usage, but had to give up on the shortcut mess. There's ergoemacs I'll have to try though.

14:28 justin_smith: I prefer to think of it as technical speculation in the technical lottery that keeps printing winning tickets

14:29 technoma`: ergomacs is a bit nutty

14:31 weavejester: Has anyone use LightTable in a serious project? Maybe that's another possibility.

14:32 CaptainLex: weavejester: I'm about to begin in using LightTable in a serious project

14:33 technoma`: was there the gsoc project for clooj?

14:35 hiredman: I'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:38 I 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:39 ianeslick: weavejester: 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:39 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:53 dnolen: cemerick: good point about js/Date IEquiv, I've backed that out of master

14:53 cemerick: dnolen: gah! :-P

14:54 CaptainLex: So does the classes-and-interfaces vector in proxy actually not take multiple members?

14:54 cemerick: dnolen: what about number and string, then?

14:54 oh, the string extend is for keywords

14:54 dnolen: cemerick: those are safe - they don't modify prototypes

14:54 weavejester: ianeslick: Those all seem reasonable interfaces to implement

14:55 cemerick: dnolen: I guess there's a subtle difference between Date and e.g. Number?

14:55 dnolen: cemerick: which won't last for long when we optimize constants

14:55 cemerick: there's a big difference, CLJS doesn't modify real JS natives, proto implementation lookup is done via hashtables

14:56 cemerick: dnolen: but through prototypes for non-native classes, I guess.

14:57 Maybe whatever whitelist that exists for strings and numbers can be extended. Not being able to e.g. test for date equality is rough.

14:58 dnolen: cemerick: actually we can't back it out yet

14:58 cemerick: yes I put it back and noted we could add special handling, patch welcome

15:01 tomjack: is "add comment about possible future change" the comment about possible future change?

15:18 Bronsa: mh

15:18 http://sprunge.us/MOKh

15:18 this looks wrong to me

15:20 dnolen_: Bronsa: I'd be surprised if defrecord validated non-basis keys

15:20 bbloom: Bronsa: the problem seems to be the second output, not the third

15:21 Bronsa: bbloom: yeah.

15:21 dnolen_: Bronsa: bbloom: I think you'd be likely to hear that the issue is the third

15:22 Bronsa: dnolen_: but records can be used effectively as maps

15:22 bbloom: dnolen_: record reader forms accept extra keys

15:22 dnolen_: https://www.refheap.com/15852

15:22 dnolen_: Bronsa: bbloom: just a hunch given that defrecord are a performance optimization like structs

15:23 what's the point of putting arbitrary keys in there if you care about perf at all

15:23 bbloom: dnolen_: you care about perf of access to the core fields

15:23 dnolen_: records allow extra fields for annotations & non perf critical things like that

15:23 Bronsa: this potentially causes some records that are valid at runtime to be non readable back

15:23 https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L1237-L1242 the check is done explicitely though.

15:24 tomjack: core.async's ioc-macros is an in-the-wild use case that occurs to me

15:24 dnolen_: Bronsa: bbloom: in anycase my point is, it's not clear to me that records are designed to permit *semantically* non keyword keys

15:24 I maybe wrong about that

15:24 tomjack: well those are all keywords

15:24 dnolen_: but that's what the behavior sits on

15:25 and the explicit check in the Reader backs me up

15:27 bbloom: dnolen_: 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:27 tomjack: the explicit check just seems bizarre to me

15:27 Bronsa: maybe it is a leftover from early experimentations on record

15:27 I relly see no point in that check

15:27 bbloom: Bronsa: that would be my guess

15:28 semantically, records are pretty much just maps with a minimum set of keys and a type differentiator

15:28 practically, they are faster for read/write access to those minimum keys

15:28 tomjack: http://dev.clojure.org/jira/browse/CLJ-800

15:29 Bronsa: tomjack: yeah, I was just reading that

15:29 tomjack: don't see any explanation

15:29 bbloom: yup

15:35 dnolen_: 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:35 tomjack: maybe symbols are disallowed because allowing them brings up the question of whether they should be evaluated?

15:36 Bronsa: tomjack: I don't think so

15:36 #foo.bar{:foo bar} is valid

15:36 and bar is not evaluated

15:36 tomjack: ah

15:37 bbloom: I'm 99% sure this is a reader bug

15:37 tomjack: that seems odd to me

15:38 not that I really want them to be evaluated, but the inconsistency vs a regular map seems odd

15:39 bbloom: tomjack: it's consistent with respect to tagged literals, but that came later :-P

15:40 ,{:x 'y}

15:40 clojurebot: {:x y}

15:40 tomjack: in that it is just impossible to have your tagged literal type evaluate symbols inside?

15:40 bbloom: i guess you need to use edn/read-whatever when reading clojure maps

15:41 tomjack: it's not impossible, you just need to call eval :-/

15:41 or do symbol resolution

15:41 tomjack: well not at read-time clearly

15:41 bbloom: it does seem odd that records don't work precisely the same as maps in this respect

15:41 tomjack: but eval on some funky object is identity, so there's nothing you can do about how it evals

15:41 (right? I don't understand that stuff)

15:42 bbloom: tomjack: you don't eval the result of the reader, you eval while building the result of the reader

15:42 (def x 1) (eval 'x) => 1

15:43 tomjack: that doesn't make sense to me

15:44 say `#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:44 or am I totally confused? feels that way

15:45 bbloom: oh yeah, you're right, sorry

15:46 i guess the fundamental issue is that {:foo "bar"} means (hash-map :foo "bar") but #whatever{:foo "bar"} means #<someobjecthere>

15:47 bbloom: i guess the real thing is you need to know "am i quoted?" when reading the literal

15:48 lol i just bbloom:ed myself. whoops

15:48 dnolen_: this is related to the constants work w/ cljs. tagged literals are inherently constants: they can't do any evaluation

15:48 same for records

15:49 this is why :map, :vector, and :set need to be special forms

15:49 b/c they need to do something different depending on context

15:49 amalloy: bbloom: {:foo "bar"} doesn't mean (hash-map :foo "bar"). it doesnt' read to a list, it reads to a map

15:49 bbloom: amalloy: it means both depending on how it's used

15:49 amalloy: if quoted, it means a map. if unquoted, it means code which builds a map

15:50 amalloy: if unquoted and recursively constant, it can mean a map as an optimization

15:50 amalloy: that is a bizarre claim. in what case does the reader see input {} and return (hash-map)?

15:50 bbloom: amalloy: it doesn't

15:51 Bronsa: '`{}

15:51 ,'`{}

15:51 clojurebot: (clojure.core/apply clojure.core/hash-map (clojure.core/seq (clojure.core/concat)))

15:51 Bronsa: ,'`()

15:51 clojurebot: (clojure.core/list)

15:51 bbloom: Bronsa: ehhh. that's cheating. that's the behavior of syntax-quote

15:51 amalloy: sure, backquoting, although i'd argue that it's ` doing that, not {}

15:51 mefesto: \quit

15:51 bbloom: amalloy: consider {:foo (query-the-internet)}

15:52 that doesn't do anything until that line of code is run

15:52 it's logically equiv to (hash-map :foo (query-the-internet))

15:53 amalloy: welllllll, 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:53 ie, that (eval some-deftype-object) doesn't eval its fields, whereas (eval some-hashmap) evals its fields

15:59 tomjack: looks like CLJ-374/800 added cases in Compiler/analyze for IRecord/IType to ConstantExpr

15:59 Bronsa: yep

16:00 tomjack: where IPersistentMap gets a MapExpr which always emits a PAM/PHM

16:01 I guess letting people control eval would be nuts?

16:01 Bronsa: you'd need hooks in the compiler

16:02 hiredman: luckily lisp has a mechanism for tha

16:02 t

16:02 «»

16:02 feh

16:02 quotation

16:03 Bronsa: hiredman: I'm not sure how that matters

16:03 futile: welp

16:04 hiredman: "I guess letting people control eval would be nuts?"

16:04 Bronsa: hiredman: quoting only prevents evaluation

16:04 there's no way to "make it happen"

16:06 user=> `#user.foo{:a ~'a}

16:06 #user.foo{:a (clojure.core/unquote (quote a))}

16:06 this kinda sucks

16:06 tomjack: I've considered having data readers look for unquote :/

16:08 but thinking about it, they can't do anything useful even if they look for it, huh

16:08 bpr: Bronsa: maybe i'm missing context, but what sucks about that?

16:08 futile: tomjack: https://github.com/evanescence/test2/blob/master/SPEC.md

16:09 bpr: if you have a reader registered for #user.foo, doesn't it provide the apropriate data-type?

16:09 Bronsa: bpr: http://sprunge.us/FdRB

16:09 bpr: user.foo is a record not a tagged reader

16:10 bpr: oh

16:11 tomjack: I guess you should just be using `(map->foo {:a ~'a}), similarly for data readers

16:12 like you don't use #db/id in code, you use datomic.api/tempid

16:15 bpr: Bronsa: does using a tagged data literal to properly construct your record work as expected?

16:15 * futile goes away quietly

16:16 dnolen_: 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:16 bbloom: dnolen_: yeah, was really cool that it also served as a generator :-)

16:19 tomjack: which paper?

16:20 dnolen_: "A Functional-Logic Perspective of Parsing"

16:25 tomjack: intriguing

16:25 I had written <*> in my little LogicT experiment

16:25 and <|> is just mplus?

16:26 Hetu: thanks for the paper tip dnolen_

16:27 dnolen_: tomjack: I never actually read too much about LogicT

16:27 tomjack: confirmed <|> is mplus in LogicT source at least

16:31 I'd guess you'd get what the paper shows with LogicT ((->) Rep) something. but wtf is something?

16:36 hmm probably not

16:39 dnolen_: tomjack: are you referring to the original LogicT paper?

16:40 tomjack: yeah

16:40 I dunno what changed between the paper and http://hackage.haskell.org/package/logict though

16:41 (if there are important differences I refer to the package not the paper)

16:43 dnolen_: tomjack: hrm, sounds like the repo is an "adaptation" ?

16:43 tomjack: I don't read Haskell good

16:44 tomjack: yeah, I hadn't noticed till now that the author of the package is not one of the authors of the paper

16:44 I think they're the same in spirit

16:44 I did notice at least one implementation difference

16:45 akells`: 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:45 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:46 bpr: akells`: cast (get-file-size file) to an int

16:47 also, *out* doesn't need to be in the call to the constructor

16:47 akells`: thanks for your response, bpr. I'll double check that its an int

16:47 oh, okay. I guess maybe I've been doing that wrong then.

16:49 dnolen_: 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:50 tomjack: extensions?

16:50 dnolen_: tomjack: language extensions

16:52 tomjack: guess that's inherited from MonadReader etc

16:53 I was hoping to avoid that stuff..

16:53 the parsing paper appears not to use monads at all which is promising

17:02 hmm, parser_rep is only an applicative if the representation is a monoid

17:11 tupi: hello, 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:42 tomjack: working out any relation between LogicT and the parsing paper has proved difficult

17:44 antares_: New ClojureWerkz project, Cassaforte: a Clojure Cassandra client built around CQL 3.0: http://blog.clojurewerkz.org/blog/2013/06/17/introducing-cassaforte/

17:48 tupi: how can i tell clojure where to find extra classes ?

17:50 puredanger: tupi: 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:50 tupi: puredanger: here is what i try:

17:51 java -cp clojure-1.4.0.jar clojure.main /usr/lpdi/projects/fiji/plugins/test_2.clj


17:51 which does not wotk because it does not know ehere imagej clases are, and there are here:

17:51 /usr/local/src/Fiji.app/jars

17:52 puredanger: -cp defines the classpath - add jars to it like: -cp clojure-1.4.0.jar:/usr/local/src/Fiji.app/jars/XYZ.jar:...

17:52 tupi: ah, merci! trying

17:53 puredanger: java 6+ can also use the specific wildcard format of /the/dir/* to add all jars (in arbitrary order) to the classpath

17:53 note this is not general glob support - it only works with just "*".

17:54 in general, I highly recommend using a build tool (leiningen or if you hate life, perhaps Maven) to assemble your classpaths for you

17:54 technoma`: further proof that writing /usr/bin/java was a task that Sun delegated to the interns

17:54 puredanger: technoma`: ha, yeah

17:54 can't tell you how many times I've written *.jar only to get burned

17:57 tupi: java -cp clojure-1.4.0.jar:/usr/local/src/Fiji.app/jars clojure.main /usr/lpdi/projects/fiji/plugins/test_2.clj

17:57 Exception in thread "main" java.lang.ClassNotFoundException: ij.IJ


17:58 test_2.clj starts like this: (import '(ij IJ)

17:58 '(ij ImagePlus))

17:59 puredanger: what's the actual full Java class name with package?

18:01 tupi: puredanger: i don't know

18:02 my knowledge of java is close to null [and will remain so i am afraid]

18:02 puredanger: tupi: try doing something like jar -tf /usr/local/src/Fiji.app/jars/YOUR.jar | grep IJ

18:02 I 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:04 tupi: trying

18:08 puredanger: tupi: your import looks ok if you have an ij.IJ Java class

18:09 tupi: yes, that i know because the script runs if i run it 'from' imagej

18:10 puredanger: can you post your whole command line?

18:10 tupi: it does not find the jar, i don't understand

18:11 pure i did already, i think

18:11 java -cp clojure-1.4.0.jar:/usr/local/src/Fiji.app/jars clojure.main /usr/lpdi/projects/fiji/plugins/test_2.clj


18:12 atyz: Hi guys, i feel dumb for asking but does this namespcae no longer exist? clojure.contrib.string

18:12 puredanger: you need to put the actual name of the jar after /jars - the directory is not sufficient

18:12 atyz: no, you should use clojure.string

18:13 atyz: does that contain substring?

18:13 puredanger: no! :)

18:13 tupi: oh this won't be possible with real code, there are hunderds of jars in imagej

18:13 puredanger: but subs is actually part of core now

18:13 tupi: you can use .../jars/* if you want to get them all

18:13 tupi: ok

18:14 puredanger: atyz: (subs "foobar" 3) ==> bar

18:14 atyz: puredanger: i dont' want a substring, basically i want a check to see if a string is a substring

18:14 so i could use (.contains "abcd" "bc")

18:15 futile: Evening.

18:15 I mean, hi.

18:15 puredanger: atyz: ah, first see: http://clojure.org/cheatsheet

18:16 atyz: puredanger: thanks

18:16 puredanger: atyz: second, you can go the Java route with (.indexOf "foo" "oo")

18:16 which returns the position of the substring

18:17 but perhaps better to use the re-* functions to do regex matching depending what you're doing

18:18 atyz: puredanger: thats exactly what i'm doing

18:18 I appreciate it :)

18:18 I need to get more familiar with teh clj std library

18:20 tupi: it'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:20 here is the output of 'imagej':

18:20 david@capac:~/lpdi/projects/fiji/plugins 15 $ imagej test_2.clj

18:20 WARNING: clojure.lang.Repl is deprecated.

18:20 Instead, use clojure.main like this:

18:20 java -cp clojure.jar clojure.main -i init.clj -r args...

18:20 Clojure 1.3.0

18:20 nil

18:20 user=>

18:21 [the nil is (println *command-line-args*)]

18:21 but i wanted to run clojure1.4 and tell it where imagej classes where, it seems more complicated then i thought

18:22 CapnKernul: What ever happened to lazytest?

18:22 tupi: using clojure1.4,as copied earlier, it complains:

18:22 java -cp clojure-1.4.0.jar:/usr/local/src/Fiji.app/jars/* clojure.main /usr/lpdi/projects/fiji/plugins/test_2.clj

18:25 nil

18:25 Exception in thread "main" java.awt.HeadlessException

18:25 at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207)

18:25 at java.awt.MenuComponent.<init>(MenuComponent.java:159)

18:25 ... ...

18:25 so i guess imagej [which a binary file unfortunately] does more then just launching clojure ...

18:25 puredanger: you're causing AWT (the Java window toolkit) to get instantiated, which is not too surprising

18:25 given that it's an image lib

18:26 you can use -Djava.awt.headless=true I believe to avoid that

18:26 tupi: well image processing does work in the memory [and in this case does not open any window]

18:27 puredanger: tupi: try that flag in your command line

18:28 or put it at the top of your code (above the ij import) - (System/setProperty "java.awt.headless" "true")

18:29 tupi: here is the full script, it is really short so i'll copy it here

18:29 (import '(ij IJ)

18:29 '(ij ImagePlus))


18:29 (let [imp (IJ/openImage "/usr/lpdi/projects/fiji/tests/image_to_watershed.png")]

18:29 (IJ/run imp "8-bit" "")

18:29 (IJ/run imp "Watershed", "")

18:29 (IJ/save imp "/tmp/itw.png"))


18:29 and all i want is to get it work passing the directoru and image name as a command line arg

18:31 puredanger: -Djava.awt.headless=true is before clojure.main ?

18:31 puredanger: tupi: that should work

18:32 tupi: arhgg it did not [yet], here is the cmd and 1st line of error:

18:32 java -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:32 Exception in thread "main" java.awt.HeadlessException

18:32 at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207)

18:32 at java.awt.MenuComponent.<init>(MenuComponent.java:159)


18:33 jtoy: if im in the repl, how can i run a function that has sudo permissions?

18:34 is this possible? it sounds like more of a unix question?

18:35 tupi: puredanger: tx so much to get me up and running with this by the way

18:35 i really need to take the control of imagej through clojure and not the other way around ...

18:35 llasram: jtoy: Generally speaking, whole processes run as a particular user. Definitely a Unix (or whatever OS-context) question

18:36 futile: I really like the idea of LightTable suddenly.

18:36 tupi: what is the clojure command to exit the repl?

18:37 puredanger: ctrl-c ? :)

18:37 futile: If this thing has paredit-like keys, I'm quite possibly sold.

18:37 aaelony: ctrl-d

18:37 justin_smith: tupi (System/exit 0)

18:37 tupi: justin_smith: tx

18:37 puredanger: your command-line args will end up in a variable named *command-line-args*

18:38 so you can access them like (first *command-line-args*) and (second *command-line-args*)

18:38 gotta run, hope that helps a little - I don't think you're far

18:38 despite appearances

18:39 tupi: puredanger: tx, it is weird to be so close but ...

18:39 jtoy: thx

18:55 if i want to keep a secured persistent connection to another site through clojure, what protocol/technology would you recommend?

18:56 justin_smith: either shell out to ssh (or tunnel across an external ssh processes tunnel) or aleph/https web socket maybe?

18:58 jtoy: cool, ill try that

18:59 justin_smith: do you know if aleph can work from clojurescript?

18:59 justin_smith: clojurescript should be able to create a websocket via javascript interop

18:59 jtoy: sweet

19:00 justin_smith: I bet there is an example on the web for using aleph/clojurescript for two way web sockets

19:05 jtoy: would be cool to send raw lisp down the channel to eval on the other side

19:06 justin_smith: I usually have each end creating and reading json, and responding to it

19:07 tupi: it 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:13 muhoo: under what conditions would doall fail to do all?

19:14 i 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:14 oops, nevermind pr-str :-)

19:15 callen: muhoo: don't feel bad, I was doing some dumb stuff with iterate not too long ago.

19:15 muhoo: stuff that required killing Emacs and restarting the REPL :(

19:16 muhoo: it did not occur to me to feel bad :-P

19:17 but thanks anyway. it was my big derp of the day; i always have at least one.

19:19 callen: muhoo: so does anybody use defstruct anymore?

19:23 robink: How do I make EDN dispatch on a Joda Time #<DateTime .*> object that has been serialized?

19:31 I 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:36 rhickey: t

19:37 Is there a straightforward way to get lein to use the clojure.jar of my choice from my local disk (not installing in maven)?

19:39 TimMc: rhickey: For lein's own process, or for the codebase it is launching?

19:39 rhickey: the codebase

19:40 really, get it in lein classpath

19:40 TimMc: Honestly, if I have source I usually just mvn install with a unique version and use that in the pom/project...

19:41 If I'm just hacking around, :resource-paths is a close enough approximation.

19:41 technomancy will yell at you, though.

19:42 technoma`: hrm; no, :resource-paths makes sense for this.

19:42 typically you'd use checkout-deps, but that only works if you're trying to include a leiningen project

19:42 no one's hooked it up to maven yet

19:42 ianeslick: Weird, anyone get errors from nrepl require like "namespace 'dstore.api' not found after loading '/dstore/api'?"

19:43 rhickey: technoma`: you put the jar name in resource-paths?

19:43 ianeslick: (i.e. load nrepl into fresh lein project, define that namespace at src/dstore/api.clj and then try to require)

19:43 technoma`: rhickey: full path to the jar should do the trick

19:43 well, relative path from the project root should work too

19:43 oh yeah, and that's a string in a vector

19:44 :resource-paths ["/path/to/clojure.jar"]

19:44 rhickey: technoma`: will that disable any defaults for clojure del?

19:44 dep

19:44 technoma`: rhickey: no, you'd need a top-level exclusion as well to keep clojure from being transitively included

19:44 :exclusions [org.clojure/clojure]

19:45 rhickey: ok, thanks

19:45 technoma`: sure

19:45 robink: Would the latter approach be preferable?

19:45 I just want the date output to be parsable and sane

19:45 technoma`: 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:45 better to be explicit about it

19:46 tomjack: robink: it sounds like you're asking about print-method

19:46 robink: (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:47 tomjack: the problem is that you want DateTime to print as a tagged element?

19:47 jtoy: silly 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:47 futile: Oh no! Missed my one chance to deliver the message to rhickey about that one thing that could.. Save the World ... dun dun DUNNNN!!!

19:48 jtoy: all I am doing is appending data to a file: (writer "/etc/hosts" :append true)...

19:48 robink: tomjack: 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:49 tomjack: My question is what's a sane and appropriate means to save and read the data, provided I'm still using EDN?

19:49 tomjack: I guess I still don't understand

19:49 EDN is a sane way to save and read data

19:49 fgallina: Hi 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:49 tomjack: I'm guessing you want (defmethod print-method DateTime [out date-time] (binding [*out* out] (print "#foo ") ...)) or whatever

19:49 robink: tomjack: pr outputs, literally, "<DateTime 2013-05-11T23:04:12.000-07:00>", which the reader (clojure.edn/read) doesn't like.

19:50 tomjack: right, define a print-method for the types of interest

19:50 robink: tomjack: Ah, OK

19:50 tomjack: EDN has nothing about printing, it's up to the host. in clojure it's print-method

19:50 robink: Gotcha

19:53 tomjack: [out date-time] should apparently be [date-time out].

19:53 tomjack: but otherwise, perfect, thanks.

19:57 tomjack: 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:03 tomjack: oh, yeah, whoops

20:08 gdev_: Stanley Cup Playoffs as a value

20:16 tomjack: gdev_: yes.

20:42 gdev_: tomjack, really? hrm I wonder if its too late to submit a proposal for a talk

21:15 mefesto: using 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:15 https://gist.github.com/anonymous/5801886

21:19 dnolen_: mefesto: there's a thread on the mailing list about this hopefully something comes of it

21:19 mefesto: on the CLJS mailing list

21:19 mefesto: dnolen_: oh i didn't realize cljs stuff is no longer using the clojure mailing list. i'll have to join :)

21:19 supersym: you can do goog.require('foo')?

21:20 dnolen_: mefesto: you can ask your question in either place, but CLJS specific things seem to moving off the main ML

21:21 mefesto: dnolen_: do you know the title of the discussion so i can search for it?

21:22 dnolen_: mefesto: Compiling "Modules" via ClojureScript Compiler

21:22 mefesto: I see some of the discussion has moved to clojure-dev too

21:23 mefesto: dnolen_: thanks!

22:14 rationalrevolt: using 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:15 i'm not sure how i would use the :configurator parameter for this situation

22:23 callen: rationalrevolt: there's a number of ways to do this, the best all involve using a third party analytics solution.

22:23 rationalrevolt: not futzing around with Ring.

22:25 rationalrevolt: hmm, 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:25 minikomi: Hi there

22:30 brehaut: rationalrevolt: sessions seem like an awkward way to track that given http is stateless

22:31 and teh lifetime of a session doesnt necessarily correspond to the actual lifetime of a visit

22:32 callen: rationalrevolt: don't do that.

22:32 rationalrevolt: my app is a statefull game - and every user's gamestate is stored on the session

22:32 callen: rationalrevolt: you need JS to know who's actually on the site.

22:32 rationalrevolt: thats true

22:32 callen: rationalrevolt: you could do a JS -> heartbeat API -> Redis

22:32 rationalrevolt: but I mean, third party analytics solutions have already done the work and come with APIs.

22:32 so.

22:33 best solution would be to cache the results from the third party API

22:33 because 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:33 ways that could lead to Cthulhu siphoning off your sanity with one of his many eldritch tentacles.

22:33 brehaut: callen: distributed computation is hard, news at 11 :P

22:34 callen: brehaut: to be fair, we've had atomic increments and decrements for a long time.

22:34 brehaut: also, he eats with tentacles, his mere presence or dreams do the sanity siphoning ;)

22:35 callen: ^^ twoo

22:35 rationalrevolt: do you have any other dreams I can crush?

22:35 rationalrevolt: I've had coffee and am feeling frisky/.

22:36 brehaut: Fhtagn

22:37 callen: brehaut: I'm actually listening to lovecraftian black metal right now.

22:37 rationalrevolt: lol, i know session's wouldn't tell me how many are actually really playing my game

22:37 callen: brehaut: slash blackgaze. It's quite wonderful.

22:37 brehaut: callen: lol

22:37 callen: rationalrevolt: it wouldn't tell you anything at all.

22:37 brehaut: totally incidentally, I was listening to it before this conversation started.

22:38 brehaut: callen: its only appears incidental because your meagre human perspective is so small

22:38 callen: brehaut: I mean, the great old ones have been manipulating my will for many years now.

22:38 brehaut: callen: important question then: tree or star

22:40 callen: brehaut: tree because it flies past the muggles.

22:41 brehaut: https://www.youtube.com/watch?v=BWT07iRvI9M

22:42 callen: brehaut: yeah I've seen that. good video.

22:43 brehaut: it really bothers me when youtube has better content than 97% ofSNL

22:43 brehaut: i have no idea what SNL is

22:43 callen: brehaut: saturday night live?

22:44 brehaut: oh right. ive never seen it.

22:44 callen: brehaut: best way to be. Keep it that way.

22:58 rlazerowitz: Does anybody know of a library that will let me get the distance (radius) between 2 coordinates?

22:59 So I can check if one pair of coordinates is .5 miles near another coordinate

22:59 callen: rlazerowitz: isn't that just arithmetic?

22:59 rlazerowitz: callen: Is it?

23:00 callen: to actually get a radius?

23:00 callen: rlazerowitz: is this something involved data in a database, or in-memory?

23:00 rlazerowitz: callen: As part of a function

23:00 callen: Yea I guess you are right just simple arithmetic

23:01 callen: so I'm not totally crazy.

23:01 rlazerowitz: callen: Yea lol I feel like an idiot. Any good libs though that handle geolocation?

23:01 xeqi: well, coordinate systems that convert to miles usually do some warping

23:02 rlazerowitz: xeqi : go on?

23:08 brehaut: rlazerowitz: http://en.wikipedia.org/wiki/Map_projection

23:08 rlazerowitz: brehaut: Thanks but this function would not be for more than a few miles

23:09 xeqi: right, thats what I was thinking

23:09 though wgs84 and the haversine formula might work fine

23:10 assuming a spherical earth was close enough

23:10 brehaut: rlazerowitz: if you picked the wrong projection, a few miles is enough to distort depending the points are located

23:10 rlazerowitz: I see this just needs to give a rough estimate of how close you are to someone else in a city

23:10 a few blocks

23:10 gt`: hi

23:11 need to get some pointers on how to configure slime for clojure on emacs

23:13 brehaut: gt`: do you absolutely need slime?

23:13 gt`: because clojure emacs integration is moving to nrepl

23:13 gt`: http://technomancy.us/163

23:14 xeqi: rlazerowitz: as for libs, geotools was the standard java one several years back. Totally over kill for this usage.

23:14 I see there is http://code.google.com/p/simplelatlng/ from a SO question, but can't vouch for it

23:14 gt`: brehaut: that is wot ppl are using right ?

23:14 brehaut: its likely that something from openstreetmaps might suffice, but then you have an osm dependancy

23:15 gt`: nrepl is yes

23:15 gt`: okay how to i get nrepl

23:15 malyn: rlazerowitz: I use https://www.refheap.com/15862

23:15 brehaut: gt`: https://github.com/kingtim/nrepl.el the readme explains

23:16 gt`: depending on your choice of emacs package installation mechanism

23:16 callen: malyn: I do all of my geolocation stuff with an abacus and a compass.

23:16 gt`: brehaut: thanks will check it out

23:23 rlazerowitz: marlyn: thanks but that won't account for warping right?

23:23 malyn: callen: Sounds too complex. My preferred approach to geolocation is to start a random walk and just wait.

23:24 rlazerowitz: You mean because the earth is an ellipsoid and not a sphere?

23:24 rlazerowitz: malyn: yes

23:24 callen: malyn: you just but I've seen people use random-neighborhood walkers as a solution to a search problem before.

23:25 you jest*

23:25 malyn: rlazerowitz: I thought you only needed accuracy to within a few blocks?

23:25 rlazerowitz: malyn: yup

23:26 malyn: rlazerowitz: So wouldn't a spherical earth work in that situation then?

23:26 rlazerowitz: malyn: I suppose thanks!

23:27 malyn: rlazerowitz: You bet. Let me know if you need a 16-bit integer version written in Forth. ;)

23:27 (which is what I last used that for)

23:27 rlazerowitz: malyn: forth?

23:27 lol

23:28 malyn: Turns out it's somewhat complex to do geo calculations without floating point. You have to invent weird new units.

23:28 callen: rlazerowitz: He actually means the programming language Fors, but he has a Lisp.

23:28 rlazerowitz: callen: I got that thought it was funny

23:28 callen: someday I'll invent a joke so punningly awful it's lethal. Then the world is mine.

23:29 malyn: Of course on IRC you won't know if we're dead or it's a netsplit.

23:29 callen: malyn: especially on freenode.

23:30 malyn: callen: Exactly. Everyone else may be dead already.

23:30 * Raynes pokes callen with a sharp stick

23:31 * callen snarls at Raynes

23:31 Raynes: callen: I'm buying a car. :D

23:31 callen: Raynes: 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:31 Raynes: oooh, congrats on the car!

23:31 Raynes: Coworker is selling me his car because he is buying a new one. Ridiculously cheap. No way I could turn it down.

23:31 Bad part is that now I have to deal with the DMV to get my CA license.

23:31 v_v

23:32 callen: Raynes: CA DMV is the innermost circle of Hell.

23:32 Raynes: I have made vehicle purchasing decisions based purely on avoiding them in the past.

23:32 Raynes: Hahaha

23:32 callen: I'm srs :(

23:32 Raynes: Alex has been working with me to get me used to driving again before I do any examinations.

23:32 I'm going to drive us to work tomorrow, for example.

23:33 He has been very helpful. Selling me the car super cheap and assisting me with getting the license.

23:33 callen: Raynes: good idea. Try not to die.

23:33 Raynes: Well, 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:33 tim: \nick tbaldridge

23:33 Raynes: He had me drive to Century City and then to Santa Monica.

23:34 It'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:34 Protip: don't not drive for almost a year.

23:34 callen: Yerp

23:35 Raynes: callen: I also got tickets to OneRepublic in September at the Greek.

23:35 :D


23:43 robink: Is it possible to have a macro defined in a binding other than a global one?

23:44 For 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:45 i.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:45 echo-area: Probably by defining it as a private one?

23:45 robink: echo-area: Ah, how do you define a macro as private?

23:46 echo-area: robink: Adding {:private true} to its meta

23:46 robink: echo-area: Aha

23:48 amalloy: robink: see also clojure.tools.macro/macrolet

23:49 (macrolet [(m [body] (whatever))] (defn foo [x] (m x)))

23:49 robink: amalloy: Thanks

23:56 amalloy: Does macrolet support defining a macro that's used by defmulti?

23:57 amalloy: I've got a macro that's (defmethod name type [binding] (expanded form))

23:57 amalloy: huh? it just defines a macro that exists only within the defined lexical scope

23:57 robink: amalloy: Gotcha.

23:57 amalloy: and defmulti handles the dispatch appropriately, whether the macro is local to a scope or not?

23:58 amalloy: robink: try it and see

23:58 robink: amalloy: OK

Logging service provided by n01se.net