#clojure log - Jul 20 2012

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

0:00 ToxicFrog: Aha

0:00 And running it in the interpreter I get the actual error

0:01 I was :requiring a library by its old name rather than its new name

0:01 For some reason, this is an NPE when I try to compile it, but a "cannot find file" error when I run it in the interpreter.

0:11 "java.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.Symbol". What boolean?!

0:12 The error is reported in core.clj:1, which is the top-level (ns) for the project, which from experience means "it could be anywhere at all"

0:14 Which is to say, anywhere in kessler.sfs or kessler.sfs.reader or kessler.sfs.writer or kessler.sfs.lexer!

0:14 It's a mystery!

0:14 Why did I ever abandon :use, it's brought me nothing but pain

0:15 I think it may be bedtime

0:35 muhoo: in general, i find if i've got > 3 lines in a row in an irc channel, it's past bedtime for me

0:51 amalloy_: hahaha, good rule muhoo

1:22 lynaghk: I'm giving a talk at OSCON tomorrow on Clojure and putting together a handout for the audience. Any suggestions for resources to give at the end? Right now I have C2 (my library---the talk is on data vis) and Himera (ClojureScript compiler in browser repl)

1:28 AustinYun: lynaghk: a link to the clojure conj talks? most of them are REALLY good, the one on Ring in particular stuck out imo

1:31 lynaghk: also, if you're talking about data vis, the "logs as data" one might be a fun addendum http://blip.tv/clojure/mark-mcgranaghan-logs-as-data-5953857

1:38 lynaghk: AustinYun: that's a great idea! thanks

1:39 technomancy: lynaghk: if it's for people with no exposure, the ociweb article is probably the best freely-available resource on the web on the language itself: http://java.ociweb.com/mark/clojure/article.html

1:39 heaven help a newbie who tries to learn just from clojure.org

1:40 lynaghk: technomancy: I have that one already, thanks.

1:40 here's the handout now: http://keminglabs.com/handout.pdf

1:41 technomancy: o O ( "transpile"? )

1:42 lynaghk: technomancy: that's a word, right?

1:43 technomancy: I don't know about that

1:43 why not just say compile?

1:43 lynaghk: technomancy: it's like, a CoffeeScript hipster word. You probably wouldn't know it

1:43 technomancy: haha

1:43 lynaghk: technomancy: I'm afraid to say things like "compile" because it's loaded to a lot of neckbeards.

1:43 technomancy: "compile" doesn't necessarily imply that the target isn't source

1:44 I guess you're targeting a primarily JS crowd? maybe transpile is part of their lingo

1:44 lynaghk: Nah, it's a pretty broad crowd at OSCON.

1:44 I have no idea what to expect, really.

1:45 technomancy: my only other note would be that double semicolons are for comments at the beginning of a line; for "inline" comments single semicolons are usually used

1:46 lynaghk: ;=>

1:46 ?

1:46 cool. I always learn so much when I'm trying to teach others. Thanks

1:46 technomancy: yeah, that's more traditional

1:47 in the sidebar explaining atoms you might see if you can fit in a note that the swap! call results in a call to (+ 1 5) behind the scenes

1:48 saying '(1 2 3) is a list is ... I dunno; it rubs me the wrong way but I understand you don't have room to explain quoting there =)

1:49 lynaghk: yeah, I was even thinking of leaving lists out

2:09 technomancy: who needs em

2:12 fivebats: lynaghk: Maybe remove the commas from the one map (in your first simulated REPL output) so all your maps don't have them. Otherwise someone will ask what the difference is...

2:15 AustinYun: lynaghk: dunno if you're still up but fivebats makes a good point -- consistency and minimizing stealth introductions of stuff is a good idea

2:27 amalloy: $mail lynaghk (message forwarded from fivebats) -- Maybe remove the commas from the one map (in your first simulated REPL output) so all your maps don't have them. Otherwise someone will ask what the difference is...

2:27 lazybot: Message saved.

2:29 espeed: I have to projects I'm developing in parallel -- one is a DB client and one is the app -- is there a way to set one project as a dependency of the other?

2:29 two*

2:32 NVM -- it's in the FAQ...Q: I want to hack two projects in parallel, but it's annoying to switch between them.

2:32 AustinYun: you mean in lein?

2:33 espeed: yes

2:33 AustinYun: yup, looks like you found it though

3:17 greenmang0: hello all, I want to create a debian package for our web application which is written in clojure… can anybody tell me what is the right way to do it?

3:18 i came across lein-debian plugin - https://github.com/erickg/lein-debian … also some suggest to use maven

4:08 xumingmingv: when i use (println "你好") to print to the stdout, i got "????"

4:08 is there any encoding related setting?

4:50 broquaint: xumingmingv: WFM

4:51 At the REPL at least.

4:51 xumingmingv: WFM stands for?

4:51 broquaint: Works For Me

4:55 kral: namaste

4:57 stain: xumingmingv: what od you get from

4:57 (import [java.nio.charset.Charset]) (java.nio.charset.Charset/defaultCharset)

4:57 it should match the setting of your terminal

4:58 in *nix, run "locale" on the command line

5:00 xumingmingv: I use clojure.xml to read a xml document from http://xxxx.xx.com/xxx.xml

5:00 the content of the xml is chinese

5:00 then i use println to print the content to the stdout

5:01 the xml document itself is encoded in utf-8

5:09 xumingmingv:tmp$ locale

5:09 LANG=

5:09 LC_COLLATE="C"

5:09 LC_CTYPE="UTF-8"

5:09 LC_MESSAGES="C"

5:09 LC_MONETARY="C"

5:09 LC_NUMERIC="C"

5:09 LC_TIME="C"

5:09 LC_ALL=

5:10 aperiodic: i wish i knew more about unicode. that ni hao works for me in zsh & zsh + tmux, but inside of vim, the ni shows up as '[34m| '; while the hao and other chinese characters like 天 are fine

5:11 xumingmingv: more information: in emacs using clojure-jack-in, it works ok, but not in command line using "clojure xxx.clj" or "lein run xxx"

5:16 ro_st: i plan to persist var names of functions to a database. aside from you concerns about whether that's a good idea or not :-), if i transmit a vector eg [#'full-namespace/function-name 1 2] over the wire, will the reader correctly resolve this reference when i read it on the other side?

5:17 clgv: ro_st: just send it as symbol and call resolve yourself

5:17 ro_st: i plan to pass it into a fn that calls deref on it, or @thing

5:18 clgv: ro_st: you should take care that the receiver requires the namespace anyway - the reader wont do that

5:18 ro_st: yup, that's already taken care of

5:18 clgv: well then you can just add resolving in that implementation

5:19 sending plain symbols works out of the box ##(type (read-string "bla.blubb/f"))

5:19 lazybot: ⇒ clojure.lang.Symbol

5:19 ro_st: so how would i symbolise that fn's var?

5:20 clgv: &(doc symbol)

5:20 lazybot: ⇒ "([name] [ns name]); Returns a Symbol with the given namespace and name."

5:21 clgv: ro_st: you can query the functions metadata for namespace and name

5:21 ro_st: so, (symbol my-fn-name) ; UNable to resolve symbol in this context

5:22 (symbol #'my-fn-name) ; clojure.lang.Var cannot be cast to java.lang.String

5:22 is there some other way to refer to the fn that symbol likes?

5:22 clgv: that's why I said that you have to get ns and name from emta data ^^

5:23 *meta

5:23 ro_st: right

5:23 :ns and :name?

5:23 clgv: ro_st: yeah. it's in the snippet I posted you yesterday when you wanted to retrieve all metadata of a given function within a high order function

5:24 aperiodic: xumingmingv: FWIW, if i (slurp "http://uncyclopedia.tw/wiki/%E4%BD%A0%E5%A5%BD") and spit the results to a file, the chinese is preserved (shows up when i cat), but when i println, i get the quotation marks

5:25 clgv: ro-st: ##(->> inc meta ((juxt (comp name ns-name :ns) (comp name :name))) (apply symbol))

5:25 lazybot: java.lang.NullPointerException

5:25 clgv: ro-st: ##(->> map meta ((juxt (comp name ns-name :ns) (comp name :name))) (apply symbol))

5:25 lazybot: java.lang.NullPointerException

5:27 aperiodic: xumingmingv: my locale and some other basic info are in this paste: https://www.refheap.com/paste/3711

5:27 xumingmingv: aperiodic: yeah, your case is similar to mine

5:27 clgv: oh maybe that only worked in 1.2

5:27 aperiodic: ugh, question marks, it is late :P

5:28 ro_st: clgv: i'm using the fn's var when i pass in the action at the top

5:28 so it's easy to get the rest from there

5:28 clgv: yeah

5:28 aperiodic: xumingmingv: unfortunately i have no ideas of what could be causing this :)

5:28 ro_st: (let [m (meta #'my-fn)] (str (:name m) "/" (:name m)))

5:28 xumingmingv: aperiodic: thanks anyway!

5:29 aperiodic: encoding issue is the issue which we need to tackle for every language..

5:30 ro_st: ok so now i have a string rep of the full ns + name. how do i get back the var that respresents?

5:31 right now read-string returns a symbol

5:31 aperiodic: xumingmingv: unfortunately it's easy to be lazy about this when one's native language just works ;)

5:33 ro_st: woo that works

5:33 (resolve (read-string name))

6:39 cark: let's say I want to override the toString method of a clojure data structure, how would i go about it ?

6:41 clgv: cark: you cant do that. but you should be able to redefine the multimethod implementation of `print-method` for that data structure

6:42 cark: ah thanks, i'll investigate that

6:42 clgv: cark: then println & co print what you specified

6:43 cark: mhh but i think this will only impact the "clojure world"

6:43 my problem is this, i'm adding clojure data structures to a swing combobox

6:43 aperiodic: ooh boy, interop land.

6:44 cark: and i woudl like to have a preferably simple way to display a field of these maps as the label

6:44 aperiodic: so, if it is really the case that you can't override the toString, what you might be able to do is gen-class something that extends the java class implementing said data structure, and override toString there

6:44 clgv: cark: I feared something like that ;)

6:45 cark: aperiodic: the requirement was : simple !

6:45 or easy =P

6:45 clgv: cark: build a renderer for clojure data structures that uses the return value of (with-out-str (println obj))

6:46 aperiodic: oh wait, if you're using the combobox from clojure, you can probably use proxy/reify

6:46 cark: ah yes i guess i'm off to the renderer path, then i can directly access my field =/

6:46 clgv: cark: do you use seesaw?

6:46 cark: clgv: nope

6:47 aperiodic: but then i need to create an interface to access the data itself

6:47 clgv: clgv: maybe you should check what it offers. it has bindings with trnasformations which might also solve your problem

6:47 *transformation

6:48 aperiodic: cark: i don't understand what you mean

6:48 clgv: cark: I used it in a small project last week :)

6:48 cark: aperiodic: i need to wrap my map in a proxy, is what you're saying isn't it ?

6:49 clgv: cark: I think he meant to wrap the combobox in a proxy

6:49 cark: clgv: i had a look to it, it seems pretty good, just didn't dive into it

6:49 aperiodic: clgv: no, i meant the map

6:50 clgv: oh ok.

6:50 cark: lookup binding and transform there

6:51 aperiodic: i might be totally misunderstanding the reason why you need to override the toString/the environment in which you're trying to use the map

6:52 cark: ok let me explain : I have a serie of maps describing some data in my program

6:52 looks like this {:id 1 :label "fish"}

6:52 i'm adding these to a jcombobox

6:52 clgv: cark: overwriting toString for GUI display can only be considered a temporary hack... as soon as you need at least two different string representations it will fail

6:53 cark: clgv: right, i would do it right, but that's only for displaying stuff in a test window =/

6:53 so now my combo shows the full map for each item, which is a bit hard on the eye

6:54 no big deal as it's only a test window, but then i started to wonder how to do it easily anyways

6:54 clgv: cark: is the data in an atom anyway?

6:55 cark: nope, but i could do it

6:55 swing is terrible, this need to subclass everything is such a pain

6:56 clgv: cark: http://darevay.com/talks/clojurewest2012/#/step-36

6:58 cark: haha i really didn't want to, but i'll go and investigate seesaw

6:58 you win !

6:58 clgv: carK: just read the slides and maybe the repl tutorial. it was enough to convince me ;)

6:59 aperiodic: if you look at PersistentHashMap.java, then you can see that the toString implementation uses RT.printString, which itself uses RT.print, which calls the private clojure.core/pr-on multimethod

6:59 clgv: aperiodic: uh, that means changing the print-method could work

7:00 aperiodic: yup!

7:00 cark: aperiodic: so i guess i can use the multimethod thing then

7:00 haha thanks ! going to try it now

7:00 aperiodic: i have never regretted looking at the clojure source

7:00 i really need to get in the habit of doing it more often

7:06 clgv: aperiodic: it often helps. I was suprised when I looked up atom source because of the ML discussion

7:06 I had a different interpretation of atoms before

7:12 ordnungswidrig1: moin

7:13 ro_st: with lein midje —lazytest, is there some keypress i can use to tell it to reload and re-run all facts?

7:13 right now i'm quitting and restarting

7:14 clgv: ro_st: shouldnt it do that when you save files in that project

7:14 ro_st: it does that for the saved files and their dependents, which is awesome

7:15 but when i come up for air i like to check that all my facts are still good. also nice to see the total fact count

7:17 clgv: ro_st: you can run an additional lein midje

7:17 ro_st: yeah i guess. be nice if you could poke the active process to have it reload the full scope

7:19 kinda like the coffeescript guard ruby gem, pressing any key forces a recompile across the board

7:22 how do i (resolve) in clojurescript? can i?

7:23 of course, i'll need to export those symbols so the gclosure compiler doesn't munge them

7:27 hmm. looks like resolve isn't a thing in cljs

7:27 i'll need another way to find the fns by name in cljs

7:41 cark: why do you need to find functions by name ?

7:42 ro_st: my document persistence is storing a list of the fns triggered by user gestures and whatever data is passed to them

7:42 so that when i load the document back up, i just need to execute them in order to arrive at the same state

7:43 cark: could you maybe have a "registry" which maps names to actual functions ?

7:43 a map

7:43 ro_st: so i need some way to represent those fns as a string (which i've got) and a way to find those fns from that string

7:44 i suppose i could do that. i thought perhaps there's a way to resolve in cljs the way there is in clj

7:44 cark: you could define those functions you need registered with a macro that would add these automatically to your map

7:44 or just do it manually

7:44 which is fine

7:44 ro_st: would it have to be a macro?

7:44 could it not simply be a normal fn that does it?

7:45 cark: i guess

7:46 i was thing search and replace defn by defn-register

7:47 thinking*

7:59 ro_st: that works

8:08 it makes testing harder, though!

8:08 well, clean testing anway

8:09 greenmang0: hello friends, can anybody here help me creating a debian package of my clojure web app?

8:09 what is the right way to follow?

8:09 ro_st: presumably once you have a jar (using lein jar or lein uberjar) you can follow the instructions for making a debian package from there

8:10 citing leiningen as the package's sole dependency, or something

8:11 cark: ro_st: do you mean harder testing because of the introduction of global state ?

8:11 ro_st: yes

8:12 cark: function names is already global state isn't it ?

8:12 ro_st: not so simple to scrub everything after each fact, now

8:12 greenmang0: ro_st, ok

8:12 ro_st: yes, but now i'm introducing test data into that global state to verify that my code that deals with that state works

8:12 which could mess with other tests for other code that sits atop this functionality

8:13 will see how it goes. busy with this now

8:13 cark: clgv: seesaw has a :renderer option for listboxes and presumably for comboboxes too, i'm sold, thanks for introducing me to it

8:13 ro_st: good luck

8:14 clgv: cark: :) I was really impressed of that lib as well. I only miss support for swingx jtreetable.

8:18 ro_st: implement the registry as a threadlocal atom

8:19 this way you can rebind it for each test case

8:19 ro_st: it already is an atom

8:20 so if i make it ^:dynamic i can use binding to pre-set its contents for the purposes of testing?

8:22 clgv: exactly

8:25 ro_st: i'm just going to ignore the whiney voice in my head that's saying ^:dynamic shouldn't be in there just to support testing -grin-

8:34 when i do that binding, am i providing a fresh (atom …) ?

8:35 nevermind. midje's around had to use facts and not contents

8:36 success1

8:36 !

8:54 cshell: What's the clojure idiomatic way of working with environmental vars?

8:55 ro_st: (System/getenv) ; returns all env vars. (System/getenv "name) ; returns value of env var named "name"

8:55 cshell: thanks ro_st

8:56 ro_st: i use a namespace called <app>.config which draws in values into a dynamic var: (def ^:dynamic name (System/getenv "NAME"))

8:56 cshell: Why dynamic?

8:56 ro_st: then i can use (binding [config/name "some value"] tests-here) to reconfigure it for tests

8:56 cemerick: I've enjoyed using https://github.com/weavejester/environ, FWIW.

8:56 ro_st: eg test database, test paths for io

8:57 cshell: that makes sense to me, thanks ro_st

8:57 cemerick: I'll check that out as well, thanks!

8:57 ro_st: i dislike putting config in project.clj because i try to keep all config out of the code repo

8:57 http://www.12factor.net/config and all

8:58 cshell: I agree - I did see that heroku allows you to define config-vars: https://devcenter.heroku.com/articles/config-vars

8:58 cemerick: ro_st: Necessary for local testing, etc. Just put them in a lein profile.

8:59 cshell: does 1.7.1 support profiles?

8:59 ro_st: yup. i've just got it in my .zshrc instead of .lein/profiles.clj

8:59 nope

9:00 another great reason for lein2 to arrive already :-)

9:00 * cemerick has been using it for months :-P

9:00 cshell: has it been released? I've been waiting for the non snapshot version to come out for this production app

9:00 ro_st: by arrive, i mean the ecosystem to move over

9:00 still plenty of stuff uses 1.x

9:01 cemerick: It's a rare "1.x" project that doesn't just work in 2, at least in my experience.

9:01 ro_st: cljsbuild -glances at emezeske-

9:02 we'll get there. be nice when it does :-)

9:04 cshell: guess I'll give it a try :)

9:07 jweiss_: all my projects are lein1 projects, but now some of my users are pulling down lein2 because that's the default now on the main page. Seems to hose everything up, lein2 cannot build my lein1 projects. is there an easy way to fix this? seems like no project.clj can work with both?

9:08 ro_st: my project.cljs have both :profiles and :dev-dependencies keys with the data duplicated

9:11 clojurescript was announced a year ago today?

9:14 jsabeaudry: happy announcement day cljs!

9:18 ro_st: indeed. it's come incredibly far since then

9:26 cshell: yeah, heroku only wants 1.7.1

9:28 :(

9:28 they're probably watiing for 2.0 to be officially release

9:28 mtkoan: wow.. can't believe cljs is only a year old

9:29 ro_st: cshell: luckily the person who built it works at heroku, so you can be sure they're interested in seeing that happen

9:34 xeqi: cshell: there is a branch of the clojure buildpack that technomancy tells me should work

9:34 https://github.com/heroku/heroku-buildpack-clojure/tree/lein-2

9:38 ro_st: anyone used both enlive and enfocus?

9:38 curious to know how close the apis are

9:41 cshell: xeqi: I'll check it out, thanks

9:41 xeqi: wow that is cool

9:42 ro_st: I've just used enlive - what's the diff?

9:42 one is cljs?

9:43 ro_st: one is cljs ya

9:44 it looks like i can thrash out the logic of my template transforms with enlive in a jvm repl and push that code to cljs for enfocus to use

9:44 just need to figure out how to :require the right thing for each env

10:24 cshell: an anyone help me with teh repl version of use? this isn't working :(

10:24 (use '[environ.core :only [env]])

10:24 or this: (use '[environ.core :only (env)])

10:24 duck1123: in clojure or clojurescript?

10:24 cshell: which I took from cemerick's book, so I must be doing something wrong :(

10:25 clojure

10:26 duck1123: what is the error that you're getting? is environ.core on your classpath? (I assume you're doing this with lein repl?)

10:26 cshell: CompilerException java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to clojure.lang.IPersistentCollection, compiling:(core.clj:22)

10:26 it's on my classpath, I"m using laclojure but I can get to that class with require

10:27 i'm just trying to use use to be more succinct

10:27 duck1123: what's going on at line 22 in core.clj? Sounds like you have an error there you need to fix first

10:28 cshell: hmm

10:28 that's in the envoron .core

10:28 I'll have to check that otu

10:28 didn't notice that

10:28 thanks duck!

10:28 duck1123: np

10:28 cshell: I knew cemerick's book wouldn't have been wrong!

10:29 cemerick: :-P

10:30 cshell: if you're on 1.4, (:require [environ.core :refer (env)]) is preferable

10:31 That should have been a footnote or something, but I had yet to solidify my thinking around it until after the book was out the door.

10:35 duck1123: so is require/refer meant to replace use/only going forward?

10:35 edw`: Do folks have any recommendations for a persistent hash-like, core.cache-friendly facility? Something that uses Redis, perhaps, but I'm no completely picky.

10:36 s/I'm no /I'm not/

10:37 cemerick: duck1123: The only circumstance where a bare use is worthwhile now is when you really, really just want a blanket refer on an entire namespace — which should be a very, very rare thing.

10:38 duck1123: yeah, I've been making an effort to hunt down and kill any instances of bare use in my code

10:39 jkkramer: you can do (:require [foo.bar :refer :all]) too

10:39 (for special occasions)

10:41 duck1123: The one thing that use/only has going for it is that it keeps the two sections separated

10:41 so it's easy to see at a glance what vars are refered

10:42 jkkramer: I like having fewer :use/:require/:import, etc. now usually just :require, sometimes :import

10:43 ToxicFrog: I'm still trying to get the compiler to stop crashing after switching from :use to :require :/

10:43 I've probably screwed it up somehow but it would be nice to get an actual error message.

10:51 gfredericks: ToxicFrog: what _is_ the error message?

10:51 ToxicFrog: Null pointer exception.

10:51 gfredericks: ToxicFrog: can you wittle the namespace down to a minimal example?

10:52 ToxicFrog: I'll try.

10:52 gfredericks: ToxicFrog: the contents of the stacktrace of an NPE can also be enlightening

10:53 ToxicFrog: Well, here's the complete stack: https://gist.github.com/e75caa96361eff7c955f

10:53 gfredericks: but not in this case :)

10:54 ToxicFrog: Also, I'm using 'lein run' here and not invoking the compiler directly; is that a potentially confounding factor?

10:54 gfredericks: so you say replacing :use with :require does it -- so if you remove all the code and leave just the (ns ) decl, does it still crash?

10:54 ToxicFrog: it shouldn't be

10:54 ToxicFrog: Well, that's the thing - in the process of replacing :use with :require I also did a bunch of code rearrangement

10:55 Previously, I've had NPEs but fixing problems with my use of (ns) fixed them

10:55 Now, I have code that runs fine in the interpreter, but crashes the compiler.

10:55 gfredericks: does it run fine if you restart the entire interpreter?

10:55 ToxicFrog: Yes.

10:56 As in, I can run it as 'java -cp ... clojure.jar -m ca.ancilla.kessler ...' and it works perfectly.

10:56 gfredericks: oh that

10:57 I would go back to changing one thing at a time :)

10:57 ToxicFrog: Yeah, I wasn't really expecting to run into compiler bugs while doing this :/

10:57 I was just thinking "while I'm changing my use of ns in every file anyways, I might as well make it a bit more organized"

10:57 And then blammo

10:58 And as a result it's really hard to nail down which changes actually caused the problem.

10:58 nDuff: ToxicFrog: ...have a reproducer available?

10:58 ToxicFrog: nDuff: that's what I'm working on, yes.

10:59 I mean, I have code that reliably reproduces it, but it's a 200-line library and I'd like to have something more minimal

10:59 gfredericks: I like `git branch wtf` and then start bisecting by deleting half the project at a time

11:00 duck1123: Sometimes it's so hare to spell "closure" correctly. By instinct, I want to type that 'j'

11:00 gfredericks: speling is always hare

11:19 stuartsierra: ToxicFrog: Clojure does not have an interpreter. There is only the compiler.

11:19 tensorpudding: it has a repl though

11:20 ToxicFrog: stuartsierra: what's the distinction between loading and running a .clj directly and compiling it with (compile) for later direct loading by Java, then?

11:20 tensorpudding: as anything that calls itself a lisp dialect should

11:20 ToxicFrog: Also, if there is no distinction, why does one work and the other not?

11:21 stuartsierra: ToxicFrog: Running the .clj file generates the bytecode in memory and loads it directly into the JVM. `compile` does the same thing and also writes the bytecode to disk in .class files.

11:22 But `compile` sometimes breaks, especially when the compiled code has side effects at the top level of a namespace.

11:22 ToxicFrog: stuartsierra: there is clearly -some- difference, though, because compile NPEs and running it directly works.

11:23 stuartsierra: Most of the differences are around how the JVM loads .class files that have already been compiled.

11:24 It could be issue with a `ns` declaration somewhere in your code that has a syntactic error.

11:25 ToxicFrog: In that case, wouldn't running it directly fail?

11:27 This has been the case with previous issues I've had with compile - there are errors in my code, but it crashes (or reports an error but not what file it's in) rather than reporting the error properly.

11:27 This code, however, runs fine when loaded directly but crashes the compiler.

11:28 Ok, I have a minimal test case

11:28 Two files, 10 lines.

11:31 xumingmingv: aperiodic: I solved the encoding issue

11:31 by setting the file.encoding property: java -Dfile.encoding=utf-8 xxx

11:40 ToxicFrog: gfredericks, stuartsierram, nDuff: reproducer here: https://dl.dropbox.com/u/7531542/wtf.tar.bz2

11:41 Unpack it and run 'run.sh' and it should output a warning message and then "sfs content goes here" and exit cleanly.

11:41 Unpack it and "lein run" and you'll get a NullPointerException in clojure.lang.Compiler$ObjExpr.emitVar.

11:47 Using (compile) directly produces the same results:

11:47 user=> (compile 'ca.ancilla.kessler.core)

11:47 WARNING: load already refers to: #'clojure.core/load in namespace: ca.ancilla.kessler.sfs, being replaced by: #'ca.ancilla.kessler.sfs/load

11:47 CompilerException java.lang.NullPointerException, compiling:(core.clj:1)

11:47 Except without the 60-line stack trace.

11:47 XPherior: Is there a good Clojure code coverage tool out? I tried a couple different ones, but no one them worked. =/

11:48 stuartsierra: sorry, don't have time to look at this now

11:48 ToxicFrog: stain: well, gfredericks and nDuff also expressed interest, and I'll leave it online anyways

11:49 ...oh seriously?

11:49 I found the problem!

11:50 gfredericks: forgot a semicolon?

11:51 ToxicFrog: gfredericks: no, apparently defining functions named 'write' and 'load', even in their own namespace, breaks the compiler

11:51 llasram: Mmm? I've definitely defined new functions named `load` w/o any problem

11:52 ToxicFrog: llasram: well, if I rename sfs/load to sfs/sfs-load, it compiles fine

11:52 If it's named sfs/load instead, the compiler crashes

11:53 It works fine if load is private, too

11:54 So this works: (ns ca.ancilla.kessler.sfs) (defn- load [name] {}) (defn sfs-load [name] (load name))

11:54 And this: (ns ca.ancilla.kessler.sfs) (defn sfs-load [name] {})

11:54 But this crashes the compiler: (ns ca.ancilla.kessler.sfs) (defn load [name] {})

11:56 In fact, here is a really minimal test case, single file:

11:56 llasram: So when I download your 'wtf.tar.bz2' sample, I get the warning about replacing load because of a missing :refer-clojure in your `ns` form, but then it prints "sfs content goes here" w/ no crash

11:56 Should I be looking at something else?

11:56 ToxicFrog: (ns ca.ancilla.kessler.core (:gen-class)) (defn load [x] 0) (defn -main [& args] 0)

11:57 This runs fine in the repl but crashes both 'lein run' and (compile) in 1.4.0

11:57 llasram: how are you running it?

11:57 llasram: Oh, I skipped a step. Just a sec

11:59 Oh, interesting. That's very weird. But adding the :refer-clojure to the `ns` form lets it work fine under `lein run`

11:59 ToxicFrog: Wacky

11:59 I didn't try that

12:00 llasram: The confounding factor appears to be AOT, and looks like a bug to me

12:01 If you modify project.clj to set ^:skip-aot and the `:main` namespace symbol, then `lein run` works fine w/o the `:refer-clojure`

12:02 kral: i'm reading Clojure Programming and i've notice that it uses to name function like camel->keyword

12:02 is it a convention?

12:03 or it's just the author way?

12:03 Iceland_jack: kral: it's similar to the `XtoY' tradition in C, command-line utilities etc.

12:03 like atoi

12:03 Wild_Cat: kral: standarc clojure naming convention is more like lowercase-with-dashes

12:04 (or maybe I'm completely misunderstanding your question)

12:04 llasram: Yeah, it's not uncommon, but I don't think it qualifies as universal convention either

12:04 kral: Iceland_jack: ok, thank you. I just want to know what the common convention is

12:04 Iceland_jack: Conventions don't have to be universal, I'd say from->to is pretty common and everyone will certainly know what you mean by it

12:05 kral: llasram, Iceland_jack: ty too

12:05 I was just curious

12:06 it reminded me of my dark past as perl monk...

12:06 Iceland_jack: ,(doc clojure.instant/caldate->rfc3339)

12:06 clojurebot: No entiendo

12:06 ToxicFrog: I love having so much leeway in what I name things.

12:07 llasram: so what's procedure here? Should I file a bug report?

12:22 nDuff: ToxicFrog: Yup, a bug report sounds like the right thing. See http://dev.clojure.org/jira/

12:23 pepijndevos: If I say ##(= {:foo 1, :bar 2} {:foo 1, :bar 2}) does Clojure check every single key and value for equality, or does it do something smarter?

12:23 lazybot: ⇒ true

12:25 ToxicFrog: nDuff: thanks

12:26 dnolen: ibdknox: ping

12:26 ibdknox: dnolen: hey

12:26 dnolen: totally didn't realize KTC was you btw :)

12:27 dnolen: ibdknox: yeah

12:27 ibdknox: haha :)

12:27 ibdknox: so I tried noir for the very first time - very sweet.

12:27 ibdknox: getting a noir app on heroku is mind blowing simple.

12:28 ibdknox: :)

12:28 dnolen: that was the hope

12:29 dnolen: ibdknox: so I'll probably start off the workshop in Light Table, which will be fun. This seems pretty straightforward. One thing I ran into was that perhaps lein-light is not yet fully-baked?

12:30 ibdknox: dnolen: what'd you run into?

12:30 rather, what issue

12:36 dnolen: ibdknox: sorry I got disconnected. did you reply?

12:36 ibdknox: dnolen: just asking what issue you ran into - I haven't hit anything myself, but that doesn't mean much :)

12:37 there were some problems the first day with it

12:37 but all that got fixed in 0.0.4

12:38 dnolen: ibdknox: actually no issue, I was just confused it's a simple REPL :) K I'll probably have more feedback later.

12:39 ibdknox: how'd OSCON talk go?

12:39 ibdknox: dnolen: I think it went well, though to be honest I end up on auto-pilot when I do talks, so I have no real sense of how I did until I see the video myself :)

12:40 dnolen: people were full of praise though, so presumably decently

12:40 dnolen: ibdknox: nice! so well attended.

12:40 ibdknox: they put me in one of the 400 people rooms - I'd say about half? and then it was live streamed as well and I heard that was around 200ish

12:41 for about 400 it sounds like

12:41 err so about*

12:49 dnolen: I gotta go catch a flight back to the valley, but I'd love to catch up sometime soon

12:50 dnolen: ibdknox: definitely! talk soon.

13:05 technomancy: jweiss: what problems are you having upgrading to lein2?

13:05 the precate plugin should cover the majority of cases

13:19 https://github.com/technomancy/nrepl.el/tree/ido-read-var <- can anyone try this out? have reports of it not working that I can't repro

13:20 you should be able to hit C-u M-. and browse the entire tree of vars and namespaces using ido

13:23 mtkoan: how can I remove the boilerplate from this let block? https://www.refheap.com/paste/3715

13:23 kilon: is there a library for Clojure to make it more common lispy like there is for elisp ?

13:24 jweiss: technomancy: the problem is there are many machines that use my project, some have lein1, some have lein2. can the ones that already have lein2 still run precate, or is it lein1 only?

13:25 technomancy: jweiss: precate is a one-time operation you can do on a lein1 project to see what needs to be added for lein2 compatibility

13:26 jweiss: technomancy: so if i have many machines with lein on it, i need to upgrade them all at once?

13:27 duck11231: once you fix the project, it'll be good for all

13:27 jweiss: will v1 and v2 live side by side just fine?

13:27 technomancy: most projects can work with both

13:27 and lein1 and lein2 can easily co-exist

13:28 jweiss: only problem i noted was the :java-source-path -> :java-source:paths

13:28 lein2 wouldn't compile the java until i made the change.

13:28 duck11231: I found it's best to have a lein1.7 and a lein2 and symlink whatever you want to be default to lein

13:28 technomancy: jweiss: for the time being you can just include both until you can drop lein1 support

13:29 it's not like the old entry will break anything

13:29 just put a comment that it's there for backwards compatibility

13:29 jweiss: ok, that's probably the best solution, was wondering if that was the only issue i woul dhit

13:29 nDuff: Hrm.

13:29 technomancy: definitely trying to make it easy for people to upgrade, so if there are any blockers I want to hear about it

13:30 jweiss: ok, i'll try to use the same project files on both, and submit issues if i can't do it

13:30 dnolen: mtkoan: [k1 k2 k3] (map read-string [k1 k2 k3]), but if you only have three keys, I'm not sure it's much of a win.

13:38 ToxicFrog: <llasram> Oh, interesting. That's very weird. But adding the :refer-clojure to the `ns` form lets it work fine under `lein run` -- I'm not seeing this

13:41 llasram: bug filed: http://dev.clojure.org/jira/browse/CLJ-1028

13:42 llasram: ToxicFrog: You're still getting the exception even with (ns ... (:refer-clojure :exclude [load])) ?

13:42 ToxicFrog: Oh. I didn't think to :exclude load

13:42 that works, I'll add a comment to that effect

13:42 llasram: Oh, that's what I'd meant :-)

14:25 aaelony: Has anyone tried to access the Google Analytics API from Clojure?

14:31 * nDuff wonders how much effort is involved in implementing https://lirias.kuleuven.be/bitstream/123456789/120456/1/KBI_0718.pdf. in Incanter

15:35 dnolen_: cemerick: bigger response than last year?

15:35 cemerick: dnolen_: We'll see next Thursday… :-)

15:36 emezeske: cemerick: Thanks for doing that, by the way, I'm very curious about the results.

15:37 cemerick: emezeske: Sure :-)

15:37 It's fun…although hopefully Google doesn't screw me on the charts this time around.

15:37 emezeske: What happened?

15:38 cemerick: Nope, they will be, nothing's changed.

15:38 emezeske: Only the first ~10 chars of each option are shown next to the corresponding bar, which is *super* unhelpful.

15:38 emezeske: cemerick: Bah!

15:38 cemerick: Last year, I ended up fiddling with each chart and putting the text in myself with acorn or something.

15:39 emezeske: Sounds less than pleasant

15:39 cemerick: I might see what excel can knock out this time around.

15:39 emezeske: :)

15:39 cemerick: If I were more of a hacker, I'd write a custom Clojure survey app/script or something. :-P

15:40 amalloy: cemerick: if you start now, you can probably have a heroku+incanter app ready for next year

15:40 cemerick: amalloy: I know you kid, but a lot of people keep asking me to provide drilldowns and stuff.

15:41 amalloy: "here's the data, mate, knock yourself out"

15:41 cemerick: i.e. "What is the IDE/editor distribution like for the people that do stats work?"

15:41 amalloy: which i understand is your policy already

15:41 cemerick: Quite.

15:41 I have a stack of cards for people that start sentences with "You know what you should do…"

15:45 S11001001: the best code is the code you don't write. Or as brucio put it better, "And what program is shorter than the one you can't write in Arc at all?"

15:47 TimMc: cemerick: Oh, is there another survey?

15:47 pbostrom: I was reading the notes posted from NYC meetup, curious about this: "Don't do this, ever: (def report-count (atom {}))"; what is the preferred way to deal with an atom you want to use throughout a namespace?

15:47 amalloy: i think the recommendation is to not use an atom throughout a namespace

15:48 (good advice: it makes the entire namespace hard to reason about, as well as being single-use)

15:48 cemerick: TimMc: Just this one, AFAIK: http://cemerick.com/2012/07/19/2012-state-of-clojure-survey/

15:48 axle_512: Is there a way for lein to search repositories for dependencies from the command line?

15:48 cark: so what, dynamic vars and a binding form ?

15:49 TimMc: cemerick: Great, thanks.

15:49 amalloy: *shrug* depends why you thought you wanted an atom to begin with

15:49 cark: i use atoms for those few places i need configuration which is read from a file

15:49 axle_512: Also, is there a way to get lein to update your project.clj with a new dependency (instead of editing the project.clj directly?)

15:50 raek: axle_512: lein help search

15:50 axle_512: raek: thanks! Will read it.

15:50 amalloy: cark: why an atom? if you read it from a file, just read it from a file

15:51 cark: read it on every request ?

15:51 amalloy: no

15:51 just once. i don't see what you think an atom is buying you there

15:52 cark: i have a centralized config reading thing, then i populate the fewx namespaces that require such config

15:52 duck1123: amalloy: so would you pass it around to every function, or would you assign it to a var?

15:52 cark: an atom does it, i guess i could redef

15:52 amalloy: (let [the-config (delay (read file...))] (defn get-config [] @the-config))

15:53 cark: that's still a reference type

15:54 duck1123: but then none of your functions are at the top level. not a big deal, but that tends to bug me

15:54 amalloy: well (a) no, it's just a memoized thunk; reference types are assignable. (b) so what? i didn't say you shouldn't have a delay, and neither did the author we were talking about

15:54 cark: amalloy: if i do that, my namespaces will need to refer to this centralized config, which is not their concern

15:55 let's imagine i have a namespace which is responsible for building web pages, and it requires a directory to pull templates from

15:55 duck1123: do you have a link to those notes?

15:56 pbostrom: notes: https://gist.github.com/3152034

15:56 amalloy: i don't understand your point at all, cark. you haven't proposed a single concrete benefit that you get from having an atom. perhaps link to a gist of some code where an atom is helpful

15:56 cark: well, by setting the atom, from outside the namespace, i don't need to have this namespace aware of the config retreiving method

15:56 nDuff: You can provide a promise from outside too.

15:57 cark: i'm separating config file managment concern from html generation

15:57 emezeske: cark: Does that mean that your config namespace is aware of all namespaces that use it?

15:57 amalloy: bleeeeurgh, you want your config namespace to be aware of what namespaces are aware of users?

15:57 er, that sentence didn't quite make sense. just pretend i said what emezeske did

15:57 cark: i have a config reading namespace which is not aware, then a controling one that dispatches to all , yes

15:58 at some point you need to make stuff happen

15:58 you have your .ini file, it's a centralized store for your config data

15:58 that data needs to be dispatched

15:59 but if at some point i need to use a database as iconfig store, well i can do it from a single place

16:00 that's why an atom is a good fit to store configuration data, you can set it from the outside, without a redef

16:00 emezeske: But... why not just have ns A that depends on config bit X just ask for config bit X?

16:01 cark: because your page generation namespace has no business thinking about configuration

16:01 at least mine doesn't !

16:01 emezeske: But... but..

16:01 * emezeske does this: http://assets.sbnation.com/assets/681381/homer.gif

16:01 duck1123: where are you storing config bit x?

16:02 cark: duck1123: i get your point, but already answered it : i might need to change access method for configuration, that's an application level thing

16:03 duck1123: actually, that was a question for the others. I'm trying to understand how they're storing the loaded config data and refering to it

16:03 cark: duck1123: haha ok so i really didn't get your point =)

16:04 axle_512: hmm, lein search seems to give me an exception: clojure.lang.ExceptionInfo: clj-http: status 404 {:object {:trace-redirects ["http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.zip"]

16:04 duck1123: I'm in a similar situation where I have a config library that loads data and stores it in a reference var and then the rest of my app call fns to read that data

16:05 I get the point of limiting global mutable data and I need to think about some of my choices a bit more, I'm just trying to make sure I understand this

16:05 amalloy: duck1123: that makes perfect sense; just store it in a delay rather than a writable reference type like an atom

16:06 emezeske: duck1123: That is a very sensible approach.

16:06 amalloy: (let [the-config (delay (read file...))] (defn get-config [path] (get-in @the-config path))

16:06 duck1123: what if I want to be able to update that data at runtime?

16:07 cark: duck1123: tho i'm not in amalloy's boat, i think that at this point that's not configuration anymore

16:07 duck1123: I have an api for changing that config and re-serializing it

16:07 amalloy: then it's not really configuration, is it?

16:07 or at any rate, if it's writable then it's not just an in-memory view of your app's config file

16:07 duck1123: granted, it's more of a crappy database, but I use it for configuration data...

16:09 Is the advice to never assign an atom to a top-level var, or does the name report-count have significance?

16:09 amalloy: duck1123: i think my point is that then it shouldn't be a def in your namespace, it should be an object or map of some kind that you can create multiple of

16:10 (defn read-config [file]) (defn write-config [file config])

16:10 pbostrom: I think in the example from the notes, report-count is just some global counter

16:11 amalloy: and if someone wants a handy pointer to the results of read-config, they should keep it themselves, rather than mutating the one everyone else is looking at

16:11 cark: amalloy: i agree on that

16:12 i just feel that application-wide stuff is to call in the pieces which is it gluing together, not the other way around

16:12 it is*

16:13 duck1123: I think I'll be changing that part soon anyway. I want to merge it in more with my start/stop application flow

16:13 I want the eventual ability to have multiple applications running in the same vm

16:13 cark: duck1123: with differing configurations ?

16:14 duck1123: yeah

16:14 or they can all read the same config file

16:15 cark: so you mean several instances of the same application with differing configurations, or different appluications ?

16:15 duck1123: either one

16:15 the services that are run are part of the config file. Of course, they would share fn definitions

16:16 cark: in the first case, i feel like dynamic defs and binding form are prefered

16:17 axle_512: Seems that "http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.zip" doesn't exist anymore? But there is a corresponding .gz file. Can lein search pickup the .gz instead?

16:17 cark: or make your services in some OO style, configure them, pass them around to your consumers

16:17 duck1123: yeah, if I were to do that, the threads would have to have some way of knowing what application they were part of. I have too many binding forms for my taste already

16:17 technomancy: axle_512: weird, can you open an issue in leiningen's tracker?

16:18 axle_512: technomancy: sure, will do!

16:18 amalloy: right, saying "use a dynamic binding" is just delaying the problem - somehow you have to know what to bind the thing to

16:18 pbostrom: so, in the "counter" example, rather than inc and deref some counter ref through out your namespace, you would treat it more like an object, and pass it in to read/write type functions (defn read-count [counter]) (defn inc-count [counter]) ?

16:19 duck1123: I miss the days when there was less stigma surrounding dynamic vars

16:19 axle_512: technomancy: found this issue that was opened by someone else a few days ago: https://github.com/technomancy/leiningen/issues/683#pull_comment_form I added a comment to the bottom.

16:19 cark: dynamic vars are good, no stigma here

16:20 technomancy: axle_512: oh, how did I miss that? thanks.

16:20 cark: they're only a hidden parameter to your functions

16:20 cemerick: cark: and thus put a wrinkle into what would otherwise be referentially transparent fns

16:20 duck1123: which makes them hard to reason about, and binding + lazy seqs leaves me scratching my head

16:20 axle_512: technomancy: no problem! Thanks for the awesome tool.

16:21 cemerick: But, yes, they have their uses. Just more rope than most people/uses need most of the time.

16:21 cark: cemerick: if you suddenly would see this parameter, they would still be referencially transparent

16:21 muhoo: they remind me of global variables

16:21 cark: so in effect they still are

16:22 amalloy: yes, if you pretend you're implicitly passing the entire state of RAM to every function, then every function is "in effect" referentially transparent. that's not a very useful definitino

16:22 cemerick: No, functions that touch dynamic vars are not referentially transparent.

16:22 cark: of course

16:23 technomancy: cark: isn't that just saying "if dynamic scope weren't dynamic..."?

16:23 cark: well, it kinda isn't, if you see it as passing the environment to all functions, but you all get my point

16:24 duck1123: I use dynamic vars to determine the request channel and response format for the request when generating the view. It was a neat idea at the time, but it has it's warts. I originally had them also passable as parameters, but that made it difficult to have them all accept varags

16:24 cark: bhy do you need referencially transparent stuff : testability and multithreading

16:24 why*

16:24 cemerick: cark: FWIW http://cemerick.com/2009/12/30/all-my-methods-take-316-arguments-and-i-like-it-that-way/

16:25 cark: cemerick: sure, that's why we segregate functionalities in little pockets called namespaces

16:26 but hey, i'm playing devil's advocate, i'm very much sold on functional pronciples

16:26 principles*

16:26 still, dynamic vars are a very usefull tool

16:27 technomancy: yep, as long as you think of them as "invisible arguments"

16:28 cemerick: Their real undisputed use case is to provide auxiliary returns.

16:29 Oh, and with-redefs and hooks.

16:29 This is going to turn into, "What have vars ever done for us?!"

16:29 cark: how about keeping the current database connection, real world non-functional stuff

16:29 hiredman: vars are an indirect linking construct

16:30 amalloy: cemerick: auxiliary returns? let me step in and dispute that

16:30 hiredman: http://en.wikipedia.org/wiki/Position-independent_code

16:30 * nDuff nods -- being able to set! a thread-local binding is darned useful at times.

16:30 hiredman: they provide an indirect link between the code in one function, and the code in another, and because the link is indirect it is easy to re-link

16:31 cark: hum yes there's that too, actually thir first goal in a lisp

16:31 hiredman: (if you are asking what vars have ever done for us)

16:31 cark: so i'm guessing the binding stuff is "complected" to it

16:32 hiredman: yes, but binding is somewhat disentangled now that you need to mark vars as dynamic

16:32 cark: right

16:33 hiredman: anyway, vars are very useful, and giving them up (clojurescript I am looking at you) is very sad

16:34 nDuff: Which parts of their functionality doesn't clojurescript implement adequately on top of normal javascript semantics, other than metadata?

16:34 hiredman: but given that clojurescript is mangled by the closure compiler, re-linking is non-trivial anyway

16:35 antoineB: hello, i have got this error: "org.mortbay.log.Logger [Thrown class java.lang.ClassNotFoundException]"

16:35 llasram: cemerick: Yeah, I watched your Clojure/west talk the other day and didn't get the "dynamic vars for auxiliary return" bit either

16:35 antoineB: does that mean i need to add org.mortbay.log as dependencie?

16:36 hiredman: (binding [r2 nil] ((fn [] (set! r2 2) 1)))

16:36 cemerick: llasram: what hiredman said; there's an extended example in the book.

16:37 hiredman: dynamic vars are like an ancillary call stack, which is why you use them to 1. pass args 2. pass results

16:38 (not that I am saying you should, I am just saying they are like X so the use cases people come up for are the same uses cases for X)

16:39 llasram: Oh, I think I see -- when you create a new binding, calls to `set!` set the value just for that position in the stack?

16:39 nDuff: llasram: Yes.

16:39 hiredman: right, they set! the inner most binding

16:41 llasram: That's interesting... I'm not sure how I feel about it, but it's interesting :-)

16:41 technomancy: I don't think I've ever seen that

16:43 hiredman: technomancy: yeah, well, how often is an ancillary return useful?

16:43 technomancy: how often is the value greater than the maintenance cost? never outside throwaway code, probably.

16:44 duck1123: If I ever need to return more than one thing, I just return them as a collection of some sort

16:44 hiredman: yeah, if clojure.core setup a few dynamic vars for that purpose they might get used more

16:44 *r1* … *r5*

16:44 :O

16:45 *r0* … *r4*

16:45 technomancy: duck1123: or metadata if you can get away with it

16:45 hiredman: :(

16:45 nDuff: ...so, here's one case.

16:45 hiredman: using metadata for that is icky

16:45 technomancy: there is one place in Leiningen where I use a promise in metadata as an ancillary return.

16:45 hiredman: :(

16:45 nDuff: I have a try/catch block where the error-handler can build a better error if a value which is only let inside the block is available

16:46 technomancy: better than set! though

16:46 nDuff: ...but its scope doesn't extend out into the catch without using a binding and set!

16:46 hiredman: no

16:46 technomancy: actually it might not be metadata with the promise anymore

16:46 hiredman: set! is better

16:46 amalloy: hiredman: i've thought about *r0* sorts of vars, but it's hard to make them work right

16:46 hiredman: amalloy: sure

16:47 cemerick: All the arguments about not needing to thread arguments to functions deep in the stack apply to auxiliary returns provided by functions deep in the stack.

16:47 technomancy: hiredman: set! might be better than an atom, but I'd say a promise is better because you can only deliver once

16:47 amalloy: like, you can't tell which function has set! it; it might have been set by function f in case its parent wanted it; but its parent didn't want it, so someone way up the callchain gets it instead

16:47 technomancy: it's not unconstrained mutability

16:47 hiredman: technomancy: passing it a long as metadata is yetch

16:48 amalloy: sure

16:49 technomancy: but it's kind of like arguing about COBOL vs BASIC; they're both so horrible

16:49 cemerick: the same arguments apply, it's just much less common to be interested in a return value because most icky non-functional code concerns itself with side-effects

16:49 hiredman: a lot of people started of programming with BASIC, maybe more than stopped programming with COBOL

16:50 technomancy: hiredman: it was an example; I didn't mean we should actually argue about it =)

16:50 hiredman: :)

16:51 cemerick: technomancy: Yeah, my biggest use case for them has been database libs, networking, etc.

16:54 technomancy: huh; the conj submission is requiring two abstracts again

16:54 I just don't get that

16:56 hiredman: cemerick: also, whats the deal with the friend examples from the readme being broken?

16:57 I screwed around with it, figured out the default uri wasn't being passed around in friend correctly, so I explicitly added the login-uri, it still didn't work, so I said "screw it, who knows what else is broken in this thing"

16:58 xeqi: hiredman, cemerick: I think thats friend/#13 https://github.com/cemerick/friend/pull/13

16:59 hiredman: xeqi: sure, I saw the pull request

16:59 cemerick: hiredman: Yeah, what xeqi said. Definitely just an oversight.

16:59 Though, point taken.

17:39 Aderius`: Hi, I wrote a (small) function that can get the corrected index of a

17:39 list when given a index that exceeds the limits of that list (eg list

17:39 of size 2 and given index of 3, gives back index 1) It also accepts

17:39 coordinates of a 2d list that are off limit, but there is one case I

17:39 get a strange exception and I can't figure out why. Somebody a clue?

17:39 More info in pastebin http://pastebin.com/rFSkncME (ps: Im experimeting with erc in emacs, if this question is posted twice in a row, Im sorry. I was not sure if it was sent)

17:40 hmm, strange formatting now, sorry!!!

17:40 hiredman: (nth map x)

17:41 ,(nth [] -1)

17:41 clojurebot: #<IndexOutOfBoundsException java.lang.IndexOutOfBoundsException>

17:43 espeed: how do you get the root path of the project? I need a consistent reference point for reading files

17:43 hiredman: use clojure.io/resource

17:43 (and read the docs for it before you use it)

17:44 technomancy: espeed: if you are never going to run your code from outside Leiningen you can use (System/getProperty "user.dir")

17:44 Aderius`: hiredman: Ow, No I see my error. The x is not yet 'adjusted'. Stupid that I didnt saw it. Thanks. You can see that Im a rookie in both clojure and programming. (its a hobby)

17:44 TimMc: clojure.java.io/resource, actually

17:44 technomancy: but assuming your code is always going to run in the context of a project may not be wise; depends on the project

17:46 espeed: techomancy: I was using (System/getProperty "user.dir") and then I included the project in another project's checkouts directory and it broke things

17:47 technomancy: espeed: ok, it sounds like you don't actually want the project root then; you want a resource

17:48 espeed: yeah, I'll just have to reshuffle the files

17:50 TimMc: reshuffle...?

17:50 espeed: (move the files around)

17:50 TimMc: espeed: Put things in th ./resources folder or the ./src folder if you want them available.

18:06 espeed: TimMC: the problem is that all the io/resource returns the resource path for the current project when it's called from an external project in the checkouts folder. I guess what I really want is a way to get the namespace root

18:07 hiredman: espeed: that is unlikely

18:08 espeed: what is unlikely?

18:08 hiredman: espeed: io/resource looks up stuff via the classpath, if you are putting data in ./resources it gets bundled in the jar by lein

18:09 ./resources is put on the classpath, meaning you just refer to things in ./resources like (io/resource "foo") for ./resources/foo

18:09 espeed: it is unlikely that you are doing it correctly

18:10 espeed: right, but I'm working on two projects in parallel -- the primary project and another which is in the primary project's checkout folder

18:11 hiredman: sure, but the jar for the checkout is still on the classpath, and will have the resource in it, unless you added the resource since the last time you made a jar

18:11 espeed: calls to io/resource from the secondary project are breaking because they are returning the primary project's resource folder, not the secondary's

18:12 hiredman: espeed: you need to ask for the resource by specific name

18:12 asking for folders via io/resource is bound to break

18:12 espeed: I'm in SLIME

18:13 hiredman: because most classloaders will not return a folder

18:13 espeed: so?

18:13 espeed: I'm asking for the specific file

18:13 hiredman: so you have the same resource in both projects?

18:14 (why?)

18:14 if you don't use io/resource but ask the classloader directly it can give you a list of resources with the same name

18:18 Aderius`: Hi, I'm working on a toy game (for clojure learning purposes). A will gave a huge 2d array of tiles as a game world (list of lists of integers (height-map) Curentely this data structure is a lazy seq. I was wondering if this is the best data structure for such a thing. Or should I go for a persistent list type. the values in this list will be changed often (probably multiple times in a game tick). I use a lazy seq because it isn't

18:18 loaded in memory in its total at any time (and that can matter if you have a big world) Or am I thinking wrong about lazy seq?

18:19 S11001001: Aderius`: lazy seq probably lacks the behavior you are looking for

18:19 aperiodic: a vector is probably what you want, since i imagine you will want to update particular tiles quickly and such

18:19 S11001001: Aderius`: accessing an element is O(n) over size, and you are only lazy to the right

18:21 Aderius`: S11001001: I have noticed that when I tried to access negative indices of the list. thats why I made my own functions to correct negative indices.

18:22 aperiodic: i don't see how lazy sequences would help you at all in this situation. where is your game state living if not in memory?

18:22 Aderius`: aperiodic: thus what you are saying is that manipulation of a vector (persistent list type?) is much faster? (aka looking up and changing valus at certain positions)

18:22 S11001001: Aderius`: what I mean is that lazy seqs aren't arbitrarily lazy; the only way you can get the 5th element is to first have loaded the first 4

18:22 just like in the movie

18:23 Aderius`: aperiodic: last answer was of previous comment of yours

18:23 drostie: Aderius`: have you seen the "Caves of Clojure" blog posts?

18:24 Aderius`: might save you some time reduplicating that blogger's work if you're interested in a 2d tiled game.

18:24 aperiodic: Aderius`: yeah, vectors don't require you to walk through them up to the cell you want to access/"change", unlike lists

18:24 +1 for checking out the Caves of Clojure posts

18:25 drostie: Aderius`: http://stevelosh.com/blog/

18:25 Aderius`: aperiodic: currently its still in memory constantly. I guess that i have to write it to a file regulary in a future.

18:26 jballanc: related question (was just looking at this): what is the preferred way to write Clojure data structures to disk?

18:26 Aderius`: drostie: I noticed the caves blogposts but didnt checked it in detail.

18:27 S11001001: ,(doc pr) ; jballanc

18:27 clojurebot: "([] [x] [x & more]); Prints the object(s) to the output stream that is the current value of *out*. Prints the object(s), separated by spaces if there is more than one. By default, pr and prn print in a way that objects can be read by the reader"

18:27 jballanc: hmm...ok

18:27 so there's not a compact binary form that people use?

18:28 S11001001: people who actually need to worry about compact binary forms worry about compact binary forms

18:28 jballanc: gotcha

18:28 thanks!

18:28 drostie: jballanc: general philosophy is that clojure data structs should become sorta like the JSON interchange format or so, direct serialization.

18:29 er, rather, *in*direct serialization.

18:29 Aderius`: My current placeholder heightmap generation is like this:(defn world-gen [world-x world-y] (repeat world-x (repeat world-y (rand-int 10))))

18:29 this is lazy right

18:29 jballanc: drostie: sure, I was just wondering if there was something like Ruby's Marshall.dump

18:29 Aderius`: just wrap it in (list x) to make it a vector?

18:30 S11001001: Aderius`: no, but also, you can't have an infinitely long vector or list

18:30 jballanc: drostie: though, considering the inter-version compatibility issues that Marshall.dump has, Clojure's approach might be better in the long run

18:30 S11001001: oh, I misread, n/m

18:30 ,(list 42)

18:30 clojurebot: (42)

18:30 S11001001: ,(vector 42)

18:30 clojurebot: [42]

18:30 S11001001: ,(vector '(1 1 2 3))

18:30 clojurebot: [(1 1 2 3)]

18:31 S11001001: ,(vec '(1 1 2 3))

18:31 clojurebot: [1 1 2 3]

18:31 aperiodic: jballanc: https://github.com/revelytix/carbonite might be worth a gander

18:31 S11001001: pick your poison

18:33 Aderius`: thanks a lot guys for pointing me to the right direction. Ill try to read a bit about it in the docs to understand it fully Im still a bit puzzeled about the different data types and there purpose.

18:34 y3di: does anyone use clojure with node?

18:34 i wonder how devving on that would be like

18:35 haspaker: The (comparator …) function puzzles me

18:35 aperiodic: Aderius`: i found http://www.brainonfire.net/files/seqs-and-colls/main.html to be extremely helpful in that regard

18:35 haspaker: And the docs aren't much help

18:35 Aderius`: the functions I already wrote should work the same with different seq like data types, right?

18:35 aperiodic: thanks

18:36 haspaker: (comparator #(> % %2))

18:36 The anonymous function should only return true or false

18:36 How does "comparator" turn it into three values: -1, 0 and 1?

18:38 jballanc: hmm...wonder if this works...

18:38 ,(source comparator)

18:38 clojurebot: Source not found

18:38 jballanc: ah, guess not :(

18:39 haspaker: if you try that in a clojure repl, you'll have your answer

18:40 aperiodic: i'm pretty sure it doesn't make a difference which one of -1 or 1 the 0 is conflated with; you can get an ordering with just an "are these in order?" predicate (since things that are equal are trivially in order)

18:41 haspaker: Yeah, the source made it all clear

18:41 Thanks!

18:50 AWizzArd: From Edsger Dijkstra: “Program testing can be used to show the presence of bugs, but never to show their absence!”.

19:18 dsrguru: quick poll: earmuffs only on dynamic vars or also on atoms?

19:18 arohner: AWizzArd: yes, but Dijkstra didn't ship products, either

19:18 :-)

19:19 dsrguru: only dynamic vars, and not even 100% of the time

19:19 emezeske: dsrguru: never on atoms.

19:19 aperiodic: dsrguru: only dynamics; atoms prefaced with !

19:20 dsrguru: thanks all

19:21 aperiodic: what do you mean by prefacing an atom with a bang?

19:21 hiredman: aperiodic: that is not a convention I've seen in wide use

19:21 (ever, really)

19:21 dsrguru: aperiodic: surely you don't mean (def !my-atom (atom foo)) ?

19:22 hiredman: putting aside whether or not you've seen it used, were you familiar with said convention?

19:23 hiredman: dsrguru: no, so I wouldn't call it a convention

19:23 aperiodic: dsrguru: that is what i mean. i like it, you can take it or leave it. i didn't mean to imply it was a convention; i was just answering a poll

19:25 hiredman: aperiodic: do you have other characters you use for other reference types?

19:26 dsrguru: aperiodic: ah kk, I definitely like the idea of differentiating vars, refs, atoms, and agents visibly, but googling suggests that Clojure folk don't routinely do that

19:27 hiredman: they don't routinely use any of the reference types

19:27 dsrguru: or I should say the absense of results on Google confirms the sentiment on #clojure

19:28 hiredman: what do you mean?

19:28 hiredman: I mean, the reference types are still mutable state, and purely functional code is to be prefered

19:29 aperiodic: hiredman: i don't often find myself using them very often, so no. i'll usually just prefix everything else that's global and not an atom with a $, and put the reference type in the var name

19:29 hiredman: :(

19:29 prefixing with $

19:29 aperiodic: i find it useful as a signal that that var doesn't come from the local context

19:29 dsrguru: hiredman: well obviously when possible, but mutable state is needed when sharing data across different people's browsing sessions or really any multithreaded application, no?

19:30 aperiodic: hiredman: why do you dislike it?

19:30 dsrguru: aperiodic: http://en.wikipedia.org/wiki/Hungarian_notation#Disadvantages

19:30 hiredman: dsrguru: it depends, but most large scale clojure apps are not websites

19:31 large backend data processing

19:31 dsrguru: hiredman: why do you think it is that more clojure programmers don't use it for web development?

19:32 hiredman: dsrguru: well, I think webdev sucks, so I wouldn't want to do it any language

19:33 which is why I don't do it

19:33 35343 lines of clojure (including tests) 1 or 2 atoms, one agent, one ref

19:34 well, actually, I shouldn't say that

19:34 dsrguru: well hopefully frameworks start popping up that you find less sucky because the web and mobile platforms seem to be eclipsing the desktop at least for consumer software

19:34 hiredman: I just remembered we use atoms in tests

19:35 dsrguru: *shrug* doesn't matter, backend data processing, I don't care what the ui is

19:35 hyPiRion: Personally, I just add a doc to it. Whenever I wonder what kind of type the var is, I just (doc foo) it.

19:36 dsrguru: hyPiRion: yeah I'm currently planning to just jump to its tag or doc/source it if I'm at the repl

19:57 dbacar: Hi

19:57 is this a nice way to reverse a list(without using the reduce and reverse)

19:57 )

19:57 )

19:57 )

19:58 (defn myReverse [x]

19:58 (loop [lst x agg '()]

19:58 (if (empty? lst)

19:58 agg

19:58 (recur (rest lst) (conj agg (first lst)))

19:58 )

19:58 )

19:58 )

19:58 nicholasf: technomancy: you awake?

19:58 hiredman: dbacar: please use a pastebin in the future

19:58 dbacar: need not to say i am a newbie

19:58 sorry for that

19:59 * nicholasf is thinking about writing a homebrew formula for leiningen2

20:03 dbacar: thanks anyway

20:04 emezeske: dbacar: For functions that already exist in clojure.core, I suggest looking at their source if you want to see a good implementation

20:04 amalloy: dbacar: that's a reasonable implementation of my-reverse

20:04 emezeske: dbacar: https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L884

20:05 lucian: are things like if and . called core forms?

20:05 emezeske: dbacar: ^what he said. A working implementation is the most important part. :)

20:06 lucian: i'm calling them "interpreter macros", but i think that may be wrong

20:06 hiredman: lucian: forms that start with certain reserved symbols are "special forms"

20:06 lucian: it is

20:06 lucian: clojure is compiled

20:06 dbacar: thanks a lot, trying to get the emacs (source ...) thing work

20:07 hiredman: so . is just the symbol ., but (. <whatever>) is a special form

20:07 lucian: hiredman: ok, special forms. i'm writing a lisp interpreter

20:07 amalloy: dbacar: if you have slime up, you can just use C-c C-d d

20:07 or M-. for source

20:07 hiredman: http://www.nhplace.com/kent/Papers/Special-Forms.html

20:07 lucian: hiredman: i'm trying to differentiate user-level macros from things that the language comes with

20:08 hiredman: lucian: *shrug*

20:08 lucian: just in the naming mind you, they're all in the same namespace anyway

20:08 hiredman: lucian: fn is refered to as a "special form" but is in fact a defmacro build on fn*

20:09 lucian: right

20:09 dbacar: amalloy: thank you

20:09 hiredman: clojure's special forms are not namespaced as a matter of fact, which is sort of a wart of the current impl

20:10 lucian: ah, interesting

20:10 i'm basically learning about interpreters

20:10 wrote my own lisp in python

20:10 amalloy: hiredman: i read someone suggesting that "special form" be defined as "any form with special [ie, not the same as a function call] evaluation rules", encompassing both language primitives and user-level macros. do you know if that's a popular interpretation, and/or one you like?

20:10 hiredman: http://dev.clojure.org/display/design/Wart+Removal

20:11 amalloy: that is interesting, I dunno

20:11 what do we call the things the compiler knows how to compile then?

20:12 compiler macros?

20:13 (= macros (union compiler-macros user-macros)

20:13 )

20:13 I just did away with special forms altogether

20:13 amalloy: no good; compiler macros already mean something useful

20:13 hiredman: ~tada

20:13 clojurebot: ? "Returns the metadata of obj, returns nil if there is no metadata."

20:13 hiredman: clojurebot: jerk

20:13 clojurebot: you cut me deep, man.

20:13 SegFaultAX|work2: Map is a strange beast in clojure. With multiple collections it effectively acts like zip-with right?

20:13 hiredman: amalloy: we'll just replace the bits the compiler knows about with compiler macros

20:14 amalloy: hiredman: actually it looks like the nhplace article you linked to suggests the terminology i mentioned

20:14 SegFaultAX|work2: Eg zipWith from Haskell, that is.

20:14 amalloy: Non-atomic, evaluable Lisp expressions may be divided into two fundamental classes: functional applications and special forms. Functional applications involve `normal' evaluation--arguments are evaluated from left to right in most dialects [2], followed by an application of a functional object to the result of the evaluations. Special forms involve any syntactic or semantic deviation from this description.

20:14 ~zip

20:14 clojurebot: zip is not necessary in clojure, because map can walk over multiple sequences, acting as a zipWith. For example, (map list '(1 2 3) '(a b c)) yields ((1 a) (2 b) (3 c))

20:15 SegFaultAX|work2: Wow, literally my exact words :D

20:15 I was trying to pick apart why (apply map vector [[:a :b] [:c :d]]) worked the way it did. I realized I didn't understand how map worked with multiple collections.

20:16 I don't like how map has been overloaded like that, personally.

20:16 amalloy: he seems to say that later on, the two "kinds" of special form got separated into either "macro" and "special form", or "special form" and "primitive special form"

20:16 emezeske: SegFaultAX|work2: You don't like that? It's ridiculously useful.

20:17 hiredman: yeah, well the original definition there, before macros were a thing in lisp, would have cleanly divided user functions from things the compiler/interpreter handles

20:17 amalloy: ah, is it that old? i didn't read it carefully; that makes sense

20:17 hiredman: I dunno

20:17 I didn't read it carefully either

20:17 amalloy: i think it is, though

20:20 SegFaultAX|work2: emezeske: Maybe so. However, I'm used to the slightly less general form `map :: (a -> b) -> [a] -> [b]` (excuse the Haskell type syntax)

20:20 amalloy: SegFaultAX|work2: it's only that way because haskell can't have variadic functions

20:20 SegFaultAX|work2: emezeske: And while it is useful, it's kind of a drastic shift from other functional languages that don't conflate mapping and zipping.

20:20 amalloy: zipWith4, indeed

20:21 SegFaultAX|work2: amalloy: I was only using that syntax as an example.

20:24 hiredman: "Most Lisps [in 1980] are dynamically scoped--i.e., the scoping of variables is determined by the dynamic, or runtime, environment rather than by the lexically apparent environment in which they were defined."

20:24 Hah!

20:25 amalloy: well, that was true, right? dynamic scoping was a big feature of lisp

20:25 hiredman: yeah

20:25 it is just amusing to read

20:37 the whole riff on conditional flow control in that paper doesn't make a lot of sense

20:38 oh, I get it

20:38 "well duh, you write it as a macro, what is all this? oh, I see showing me why you have to"

23:05 * ToxicFrog eyes the shit out of his bug report

23:08 ToxicFrog: Seriously?

23:08 "The compiler crashing is not a bug, because what you're doing isn't officially supported, even though it's meant to be legal"?

23:10 Even if I'm doing something outright forbidden, the compiler should report that as an error, not crash.

23:11 wkelly: ToxicFrog: hwhat

23:12 ToxicFrog: wkelly: yesterday I generated a NullPointerException in (compile) for a script that runs fine when not compiled

23:12 amalloy: he's referring to http://dev.clojure.org/jira/browse/CLJ-1028

23:12 ToxicFrog: Today I produced a minimal test case and filed a bug

23:13 amalloy: i think you grossly misquoted stuart's reply

23:13 ToxicFrog: amalloy: he said "This is left legal for compatibility, but programs that do it are in error."

23:13 First of all, it seems inherently contradictory that something should be legal and an error.

23:14 Secondly, if it's an error, the compiler should produce an error message, not crash mysteriously

23:14 wkelly: Now I see!

23:14 amalloy: agreed, poorly worded. choose to read that as "this is an error, but the compiler makes an effort to Do What You Mean"

23:14 ToxicFrog: Even if creating functions that shadow function in clojure.core is 100% verboten under all circumstances, this should not cause the compiler to crash.

23:16 cemerick: The warning seems like it would be the text of the error message you'd like to see…

23:16 ToxicFrog: I mean, I disagree with the premise here, but even if I didn't this is still a valid bug report!

23:16 cemerick: yes.

23:16 cemerick: So it should print ERROR instead of WARNING?

23:16 ToxicFrog: And then exit cleanly, yes.

23:16 cemerick: exit cleanly?

23:17 What should it do instead of throwing an exception?

23:17 ToxicFrog: If you actually read the bug, the problem is that the compiler emits that warning and then crashes with a NullPointerException.

23:17 cemerick: I'm looking at your stack trace right now. :-)

23:17 ToxicFrog: If it's a warning, this implies that it is discouraged or dangerous behaviour, but not something that prevents it from compiling the program.

23:17 If it does prevent it from compiling the program, the compiler should report it as such, rather than crashing.

23:18 amalloy: cemerick: the objection is that apparently if you overwrite any function but load, you get a warning and it successfully compiles; if you overwrite load, the compiler crashes

23:18 cemerick: Yeah, I get it.

23:18 wkelly: I agree with you, ToxicFrog! Seems a strange thing to be up in arms about, though

23:18 cemerick: Presumably, the compiler should be more careful to use clojure.core/load instead of whatever resolves locally.

23:18 ToxicFrog: amalloy: actually, it's not just load

23:19 That was just the first one I found.

23:19 cemerick: probably require, ns, defn, and so on as well.

23:19 ToxicFrog: AFAICT, pretty much anything in clojure.core will cause this warning followed by an NPE.

23:20 amalloy: ToxicFrog: that is definitely not the case

23:20 it's probably just the stuff that (ns) uses

23:20 ToxicFrog: Ok, find-doc doesn't

23:20 amalloy: aah, that would make sense

23:20 Oh wait, find-doc isn't even in core.

23:21 amalloy: ok, I have yet to find a counterexample.

23:22 wkelly: yeah, in the grand scheme of things it's a pretty minor error that's easy to work around

23:22 But (a) problems with the compiler like this make debugging my own code a pain in the ass, because I can never be sure if I have valid code triggering a compiler bug, or invalid code triggering a compiler bug that makes it impossible to figure out where the underlying problem with my code is - especially in cases like this where it runs fine without AOT compilation

23:23 wkelly: sure, that's fair

23:23 but you can't say it didn't warn you :P

23:23 ToxicFrog: And (b) it pisses me off personally when someone closes a bug report with, essentially, "this shouldn't cause it to crash, but you shouldn't be doing the thing that causes it to crash, so it's not a bug"

23:24 There is no other compiler on earth where "warning" is "warning: the compiler is about to crash as a result of this" rather than "warning: this is valid, but discouraged and/or unsafe code"

23:24 Normally, we call the former either "bugs in the compiler" and fix them, or "errors in the code" and exit cleanly rather than crashing.

23:24 cemerick: Well, that's probably not true; but, in any case, probably shouldn't take things personally. :-)

23:25 ToxicFrog: Ok, yeah, that was a bit hyperbolic.

23:26 But I can say that in every other compiler - for that matter, every other program! - I've worked on, contributed to, or filed a bug report against, "this causes it to crash" is considered a bug even if "this" is something you should not, under normal circumstances, ever be doing.

23:26 (and in any case I feel (a) is enough to make this report worth filing)

23:28 amalloy: tbh i can't see what would actually cause load to do this. the ns macro is careful to ns-qualify the code it generates (eg, ##(macroexpand-1 '(ns foo (:require bar)))), and i don't see any references in non-macro code that would make this happen

23:28 lazybot: ⇒ (do (clojure.core/in-ns (quote foo)) (clojure.core/with-loading-context (clojure.core/refer (quote clojure.core)) (clojure.core/require (quote bar))))

23:35 wkelly: I think it is fair to call it a bug

23:35 and also fair to say "won't fix" :P

23:36 but I agree that the bug should probably have been left open

23:37 seancorfield: quick emacs q: if you've loaded a new theme to try it out and don't like it, is there an easy way to revert to the default "theme" state?

23:38 ToxicFrog: wkelly: yeah, like, I'd accept "this is a bug but fixing it isn't a priority, to work around it just don't do that thing you shouldn't be doing anyways and submit a patch if it bothers you that much"

23:39 But saying that it's not a bug really rubs me the wrong way.

23:40 amalloy: ToxicFrog: my point re: your gross misquoting is he didn't say that

23:40 he said "if you do this, you are in error, and we won't fix it"

23:41 dubz: seancorfield: if you're using emacs 24 you can generally M-x load-theme

23:41 ToxicFrog: amalloy: he also said that it is "legal", and I did not previously think it controversial to think that a compiler should not crash on any legal input

23:41 ...or illegal input, for that matter

23:42 But yeah, he didn't say explicitly in the comment that it's not a bug, he did so by marking it CLOSED/DECLINED.

23:43 duck1123: In clojurescript, if I have the response from $.fetchJSON, how do I read the responseText? Better question, what function SHOULD I be using?

23:48 gfredericks: duck1123: doesn't fetchJSON parse the responsetext for you?

23:49 duck1123: It's giving me back a jquery object, and my text is in the responseText, all my attempts to access that field have failed

23:50 the generated js seems right

23:51 gfredericks: duck1123: you're giving it a callback right?

23:51 duck1123: even trying it in the console doesn't work

23:51 * gfredericks dunnos how familiar duck is with js/jquery

23:52 duck1123: gfredericks: I'm calling the one that should return it

23:52 gfredericks: you're not going to be able to call an ajax function that returns the response, if that's what you're expecting

23:52 duck1123: now that I think about it, I know why that's a bad idea

23:53 I was mainly looking for something I could use at the console

23:54 gfredericks: you still gotta do callbacks; no way around it

23:54 duck1123: that's fine.

23:55 gfredericks: I'll stop assuming I know what's going on and go to bed

23:55 * gfredericks stops assuming he knows what's going on and goes to bed

23:56 seancorfield: dubz: i know how to load a theme - my question was how do you return emacs to its default "theme" state?

23:56 AtKaaZ: hi, does anyone know how to get this to work ? fsteeg.com/2012/02/26/visualize-clojure-code-in-eclipse-with-dot-and-zest/ or anything similar to this

23:56 duck1123: seancorfield: close and re-open emacs :)

23:56 seancorfield: duck1123: yes, that works but i was hoping to avoid that :(

23:57 duck1123: I've never been able to change themes and get everything back to looking right

23:57 seancorfield: i find it frustrating that loading theme A, then theme B, then theme A again often does not get you back to the original theme A state :(

23:57 duck1123: I don't think hober (the theme I use) has defined everything

23:58 seancorfield: hmm, and what exactly does disable-theme do? it doesn't seem to do anything that i can see :(

Logging service provided by n01se.net