#clojure logs

2012-07-20

00:00ToxicFrogAha
00:00ToxicFrogAnd running it in the interpreter I get the actual error
00:01ToxicFrogI was :requiring a library by its old name rather than its new name
00:01ToxicFrogFor 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.
00:11ToxicFrog"java.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.Symbol". What boolean?!
00:12ToxicFrogThe 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"
00:14ToxicFrogWhich is to say, anywhere in kessler.sfs or kessler.sfs.reader or kessler.sfs.writer or kessler.sfs.lexer!
00:14ToxicFrogIt's a mystery!
00:14ToxicFrogWhy did I ever abandon :use, it's brought me nothing but pain
00:15ToxicFrogI think it may be bedtime
00:35muhooin general, i find if i've got > 3 lines in a row in an irc channel, it's past bedtime for me
00:51amalloy_hahaha, good rule muhoo
01:22lynaghkI'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)
01:28AustinYunlynaghk: a link to the clojure conj talks? most of them are REALLY good, the one on Ring in particular stuck out imo
01:31AustinYunlynaghk: 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
01:38lynaghkAustinYun: that's a great idea! thanks
01:39technomancylynaghk: 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
01:39technomancyheaven help a newbie who tries to learn just from clojure.org
01:40lynaghktechnomancy: I have that one already, thanks.
01:40lynaghkhere's the handout now: http://keminglabs.com/handout.pdf
01:41technomancyo O ( "transpile"? )
01:42lynaghktechnomancy: that's a word, right?
01:43technomancyI don't know about that
01:43technomancywhy not just say compile?
01:43lynaghktechnomancy: it's like, a CoffeeScript hipster word. You probably wouldn't know it
01:43technomancyhaha
01:43lynaghktechnomancy: I'm afraid to say things like "compile" because it's loaded to a lot of neckbeards.
01:43technomancy"compile" doesn't necessarily imply that the target isn't source
01:44technomancyI guess you're targeting a primarily JS crowd? maybe transpile is part of their lingo
01:44lynaghkNah, it's a pretty broad crowd at OSCON.
01:44lynaghkI have no idea what to expect, really.
01:45technomancymy 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
01:46lynaghk;=>
01:46lynaghk?
01:46lynaghkcool. I always learn so much when I'm trying to teach others. Thanks
01:46technomancyyeah, that's more traditional
01:47technomancyin 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
01:48technomancysaying '(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 =)
01:49lynaghkyeah, I was even thinking of leaving lists out
02:09technomancywho needs em
02:12fivebatslynaghk: 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...
02:15AustinYunlynaghk: dunno if you're still up but fivebats makes a good point -- consistency and minimizing stealth introductions of stuff is a good idea
02:27amalloy$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...
02:27lazybotMessage saved.
02:29espeedI 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?
02:29espeedtwo*
02:32espeedNVM -- it's in the FAQ...Q: I want to hack two projects in parallel, but it's annoying to switch between them.
02:32AustinYunyou mean in lein?
02:33espeedyes
02:33AustinYunyup, looks like you found it though
03:17greenmang0hello 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?
03:18greenmang0i came across lein-debian plugin - https://github.com/erickg/lein-debian … also some suggest to use maven
04:08xumingmingvwhen i use (println "你好") to print to the stdout, i got "????"
04:08xumingmingvis there any encoding related setting?
04:50broquaintxumingmingv: WFM
04:51broquaintAt the REPL at least.
04:51xumingmingvWFM stands for?
04:51broquaintWorks For Me
04:55kralnamaste
04:57stainxumingmingv: what od you get from
04:57stain(import [java.nio.charset.Charset]) (java.nio.charset.Charset/defaultCharset)
04:57stainit should match the setting of your terminal
04:58stainin *nix, run "locale" on the command line
05:00xumingmingvI use clojure.xml to read a xml document from http://xxxx.xx.com/xxx.xml
05:00xumingmingvthe content of the xml is chinese
05:00xumingmingvthen i use println to print the content to the stdout
05:01xumingmingvthe xml document itself is encoded in utf-8
05:09xumingmingvxumingmingv:tmp$ locale
05:09xumingmingvLANG=
05:09xumingmingvLC_COLLATE="C"
05:09xumingmingvLC_CTYPE="UTF-8"
05:09xumingmingvLC_MESSAGES="C"
05:09xumingmingvLC_MONETARY="C"
05:09xumingmingvLC_NUMERIC="C"
05:09xumingmingvLC_TIME="C"
05:09xumingmingvLC_ALL=
05:10aperiodici 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
05:11xumingmingvmore information: in emacs using clojure-jack-in, it works ok, but not in command line using "clojure xxx.clj" or "lein run xxx"
05:16ro_sti 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?
05:17clgvro_st: just send it as symbol and call resolve yourself
05:17ro_sti plan to pass it into a fn that calls deref on it, or @thing
05:18clgvro_st: you should take care that the receiver requires the namespace anyway - the reader wont do that
05:18ro_styup, that's already taken care of
05:18clgvwell then you can just add resolving in that implementation
05:19clgvsending plain symbols works out of the box ##(type (read-string "bla.blubb/f"))
05:19lazybot⇒ clojure.lang.Symbol
05:19ro_stso how would i symbolise that fn's var?
05:20clgv&(doc symbol)
05:20lazybot⇒ "([name] [ns name]); Returns a Symbol with the given namespace and name."
05:21clgvro_st: you can query the functions metadata for namespace and name
05:21ro_stso, (symbol my-fn-name) ; UNable to resolve symbol in this context
05:22ro_st(symbol #'my-fn-name) ; clojure.lang.Var cannot be cast to java.lang.String
05:22ro_stis there some other way to refer to the fn that symbol likes?
05:22clgvthat's why I said that you have to get ns and name from emta data ^^
05:23clgv*meta
05:23ro_stright
05:23ro_st:ns and :name?
05:23clgvro_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
05:24aperiodicxumingmingv: 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
05:25clgvro-st: ##(->> inc meta ((juxt (comp name ns-name :ns) (comp name :name))) (apply symbol))
05:25lazybotjava.lang.NullPointerException
05:25clgvro-st: ##(->> map meta ((juxt (comp name ns-name :ns) (comp name :name))) (apply symbol))
05:25lazybotjava.lang.NullPointerException
05:27aperiodicxumingmingv: my locale and some other basic info are in this paste: https://www.refheap.com/paste/3711
05:27xumingmingvaperiodic: yeah, your case is similar to mine
05:27clgvoh maybe that only worked in 1.2
05:27aperiodicugh, question marks, it is late :P
05:28ro_stclgv: i'm using the fn's var when i pass in the action at the top
05:28ro_stso it's easy to get the rest from there
05:28clgvyeah
05:28aperiodicxumingmingv: unfortunately i have no ideas of what could be causing this :)
05:28ro_st(let [m (meta #'my-fn)] (str (:name m) "/" (:name m)))
05:28xumingmingvaperiodic: thanks anyway!
05:29xumingmingvaperiodic: encoding issue is the issue which we need to tackle for every language..
05:30ro_stok so now i have a string rep of the full ns + name. how do i get back the var that respresents?
05:31ro_stright now read-string returns a symbol
05:31aperiodicxumingmingv: unfortunately it's easy to be lazy about this when one's native language just works ;)
05:33ro_stwoo that works
05:33ro_st(resolve (read-string name))
06:39carklet's say I want to override the toString method of a clojure data structure, how would i go about it ?
06:41clgvcark: you cant do that. but you should be able to redefine the multimethod implementation of `print-method` for that data structure
06:42carkah thanks, i'll investigate that
06:42clgvcark: then println & co print what you specified
06:43carkmhh but i think this will only impact the "clojure world"
06:43carkmy problem is this, i'm adding clojure data structures to a swing combobox
06:43aperiodicooh boy, interop land.
06:44carkand i woudl like to have a preferably simple way to display a field of these maps as the label
06:44aperiodicso, 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
06:44clgvcark: I feared something like that ;)
06:45carkaperiodic: the requirement was : simple !
06:45carkor easy =P
06:45clgvcark: build a renderer for clojure data structures that uses the return value of (with-out-str (println obj))
06:46aperiodicoh wait, if you're using the combobox from clojure, you can probably use proxy/reify
06:46carkah yes i guess i'm off to the renderer path, then i can directly access my field =/
06:46clgvcark: do you use seesaw?
06:46carkclgv: nope
06:47carkaperiodic: but then i need to create an interface to access the data itself
06:47clgvclgv: maybe you should check what it offers. it has bindings with trnasformations which might also solve your problem
06:47clgv*transformation
06:48aperiodiccark: i don't understand what you mean
06:48clgvcark: I used it in a small project last week :)
06:48carkaperiodic: i need to wrap my map in a proxy, is what you're saying isn't it ?
06:49clgvcark: I think he meant to wrap the combobox in a proxy
06:49carkclgv: i had a look to it, it seems pretty good, just didn't dive into it
06:49aperiodicclgv: no, i meant the map
06:50clgvoh ok.
06:50clgvcark: lookup binding and transform there
06:51aperiodici might be totally misunderstanding the reason why you need to override the toString/the environment in which you're trying to use the map
06:52carkok let me explain : I have a serie of maps describing some data in my program
06:52carklooks like this {:id 1 :label "fish"}
06:52carki'm adding these to a jcombobox
06:52clgvcark: 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
06:53carkclgv: right, i would do it right, but that's only for displaying stuff in a test window =/
06:53carkso now my combo shows the full map for each item, which is a bit hard on the eye
06:54carkno big deal as it's only a test window, but then i started to wonder how to do it easily anyways
06:54clgvcark: is the data in an atom anyway?
06:55carknope, but i could do it
06:55carkswing is terrible, this need to subclass everything is such a pain
06:56clgvcark: http://darevay.com/talks/clojurewest2012/#/step-36
06:58carkhaha i really didn't want to, but i'll go and investigate seesaw
06:58carkyou win !
06:58clgvcarK: just read the slides and maybe the repl tutorial. it was enough to convince me ;)
06:59aperiodicif 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
06:59clgvaperiodic: uh, that means changing the print-method could work
07:00aperiodicyup!
07:00carkaperiodic: so i guess i can use the multimethod thing then
07:00carkhaha thanks ! going to try it now
07:00aperiodici have never regretted looking at the clojure source
07:00aperiodici really need to get in the habit of doing it more often
07:06clgvaperiodic: it often helps. I was suprised when I looked up atom source because of the ML discussion
07:06clgvI had a different interpretation of atoms before
07:12ordnungswidrig1moin
07:13ro_stwith lein midje —lazytest, is there some keypress i can use to tell it to reload and re-run all facts?
07:13ro_stright now i'm quitting and restarting
07:14clgvro_st: shouldnt it do that when you save files in that project
07:14ro_stit does that for the saved files and their dependents, which is awesome
07:15ro_stbut 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
07:17clgvro_st: you can run an additional lein midje
07:17ro_styeah i guess. be nice if you could poke the active process to have it reload the full scope
07:19ro_stkinda like the coffeescript guard ruby gem, pressing any key forces a recompile across the board
07:22ro_sthow do i (resolve) in clojurescript? can i?
07:23ro_stof course, i'll need to export those symbols so the gclosure compiler doesn't munge them
07:27ro_sthmm. looks like resolve isn't a thing in cljs
07:27ro_sti'll need another way to find the fns by name in cljs
07:41carkwhy do you need to find functions by name ?
07:42ro_stmy document persistence is storing a list of the fns triggered by user gestures and whatever data is passed to them
07:42ro_stso that when i load the document back up, i just need to execute them in order to arrive at the same state
07:43carkcould you maybe have a "registry" which maps names to actual functions ?
07:43carka map
07:43ro_stso 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
07:44ro_sti suppose i could do that. i thought perhaps there's a way to resolve in cljs the way there is in clj
07:44carkyou could define those functions you need registered with a macro that would add these automatically to your map
07:44carkor just do it manually
07:44carkwhich is fine
07:44ro_stwould it have to be a macro?
07:44ro_stcould it not simply be a normal fn that does it?
07:45carki guess
07:46carki was thing search and replace defn by defn-register
07:47carkthinking*
07:59ro_stthat works
08:08ro_stit makes testing harder, though!
08:08ro_stwell, clean testing anway
08:09greenmang0hello friends, can anybody here help me creating a debian package of my clojure web app?
08:09greenmang0what is the right way to follow?
08:09ro_stpresumably once you have a jar (using lein jar or lein uberjar) you can follow the instructions for making a debian package from there
08:10ro_stciting leiningen as the package's sole dependency, or something
08:11carkro_st: do you mean harder testing because of the introduction of global state ?
08:11ro_styes
08:12carkfunction names is already global state isn't it ?
08:12ro_stnot so simple to scrub everything after each fact, now
08:12greenmang0ro_st, ok
08:12ro_styes, but now i'm introducing test data into that global state to verify that my code that deals with that state works
08:12ro_stwhich could mess with other tests for other code that sits atop this functionality
08:13ro_stwill see how it goes. busy with this now
08:13carkclgv: seesaw has a :renderer option for listboxes and presumably for comboboxes too, i'm sold, thanks for introducing me to it
08:13carkro_st: good luck
08:14clgvcark: :) I was really impressed of that lib as well. I only miss support for swingx jtreetable.
08:18clgvro_st: implement the registry as a threadlocal atom
08:19clgvthis way you can rebind it for each test case
08:19ro_stit already is an atom
08:20ro_stso if i make it ^:dynamic i can use binding to pre-set its contents for the purposes of testing?
08:22clgvexactly
08:25ro_sti'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-
08:34ro_stwhen i do that binding, am i providing a fresh (atom …) ?
08:35ro_stnevermind. midje's around had to use facts and not contents
08:36ro_stsuccess1
08:36ro_st!
08:54cshellWhat's the clojure idiomatic way of working with environmental vars?
08:55ro_st(System/getenv) ; returns all env vars. (System/getenv "name) ; returns value of env var named "name"
08:55cshellthanks ro_st
08:56ro_sti use a namespace called <app>.config which draws in values into a dynamic var: (def ^:dynamic name (System/getenv "NAME"))
08:56cshellWhy dynamic?
08:56ro_stthen i can use (binding [config/name "some value"] tests-here) to reconfigure it for tests
08:56cemerickI've enjoyed using https://github.com/weavejester/environ, FWIW.
08:56ro_steg test database, test paths for io
08:57cshellthat makes sense to me, thanks ro_st
08:57cshellcemerick: I'll check that out as well, thanks!
08:57ro_sti dislike putting config in project.clj because i try to keep all config out of the code repo
08:57ro_sthttp://www.12factor.net/config and all
08:58cshellI agree - I did see that heroku allows you to define config-vars: https://devcenter.heroku.com/articles/config-vars
08:58cemerickro_st: Necessary for local testing, etc. Just put them in a lein profile.
08:59cshelldoes 1.7.1 support profiles?
08:59ro_styup. i've just got it in my .zshrc instead of .lein/profiles.clj
08:59ro_stnope
09:00ro_stanother great reason for lein2 to arrive already :-)
09:00cshellhas it been released? I've been waiting for the non snapshot version to come out for this production app
09:00ro_stby arrive, i mean the ecosystem to move over
09:00ro_ststill plenty of stuff uses 1.x
09:01cemerickIt's a rare "1.x" project that doesn't just work in 2, at least in my experience.
09:01ro_stcljsbuild -glances at emezeske-
09:02ro_stwe'll get there. be nice when it does :-)
09:04cshellguess I'll give it a try :)
09:07jweiss_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?
09:08ro_stmy project.cljs have both :profiles and :dev-dependencies keys with the data duplicated
09:11ro_stclojurescript was announced a year ago today?
09:14jsabeaudryhappy announcement day cljs!
09:18ro_stindeed. it's come incredibly far since then
09:26cshellyeah, heroku only wants 1.7.1
09:28cshell:(
09:28cshellthey're probably watiing for 2.0 to be officially release
09:28mtkoanwow.. can't believe cljs is only a year old
09:29ro_stcshell: luckily the person who built it works at heroku, so you can be sure they're interested in seeing that happen
09:34xeqicshell: there is a branch of the clojure buildpack that technomancy tells me should work
09:34xeqihttps://github.com/heroku/heroku-buildpack-clojure/tree/lein-2
09:38ro_stanyone used both enlive and enfocus?
09:38ro_stcurious to know how close the apis are
09:41cshellxeqi: I'll check it out, thanks
09:41cshellxeqi: wow that is cool
09:42cshellro_st: I've just used enlive - what's the diff?
09:42cshellone is cljs?
09:43ro_stone is cljs ya
09:44ro_stit 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
09:44ro_stjust need to figure out how to :require the right thing for each env
10:24cshellan anyone help me with teh repl version of use? this isn't working :(
10:24cshell(use '[environ.core :only [env]])
10:24cshellor this: (use '[environ.core :only (env)])
10:24duck1123in clojure or clojurescript?
10:24cshellwhich I took from cemerick's book, so I must be doing something wrong :(
10:25cshellclojure
10:26duck1123what is the error that you're getting? is environ.core on your classpath? (I assume you're doing this with lein repl?)
10:26cshellCompilerException java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to clojure.lang.IPersistentCollection, compiling:(core.clj:22)
10:26cshellit's on my classpath, I"m using laclojure but I can get to that class with require
10:27cshelli'm just trying to use use to be more succinct
10:27duck1123what's going on at line 22 in core.clj? Sounds like you have an error there you need to fix first
10:28cshellhmm
10:28cshellthat's in the envoron .core
10:28cshellI'll have to check that otu
10:28cshelldidn't notice that
10:28cshellthanks duck!
10:28duck1123np
10:28cshellI knew cemerick's book wouldn't have been wrong!
10:29cemerick:-P
10:30cemerickcshell: if you're on 1.4, (:require [environ.core :refer (env)]) is preferable
10:31cemerickThat 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:35duck1123so is require/refer meant to replace use/only going forward?
10:35edw`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:36edw`s/I'm no /I'm not/
10:37cemerickduck1123: 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:38duck1123yeah, I've been making an effort to hunt down and kill any instances of bare use in my code
10:39jkkrameryou can do (:require [foo.bar :refer :all]) too
10:39jkkramer(for special occasions)
10:41duck1123The one thing that use/only has going for it is that it keeps the two sections separated
10:41duck1123so it's easy to see at a glance what vars are refered
10:42jkkramerI like having fewer :use/:require/:import, etc. now usually just :require, sometimes :import
10:43ToxicFrogI'm still trying to get the compiler to stop crashing after switching from :use to :require :/
10:43ToxicFrogI've probably screwed it up somehow but it would be nice to get an actual error message.
10:51gfredericksToxicFrog: what _is_ the error message?
10:51ToxicFrogNull pointer exception.
10:51gfredericksToxicFrog: can you wittle the namespace down to a minimal example?
10:52ToxicFrogI'll try.
10:52gfredericksToxicFrog: the contents of the stacktrace of an NPE can also be enlightening
10:53ToxicFrogWell, here's the complete stack: https://gist.github.com/e75caa96361eff7c955f
10:53gfredericksbut not in this case :)
10:54ToxicFrogAlso, I'm using 'lein run' here and not invoking the compiler directly; is that a potentially confounding factor?
10:54gfredericksso 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:54gfredericksToxicFrog: it shouldn't be
10:54ToxicFrogWell, that's the thing - in the process of replacing :use with :require I also did a bunch of code rearrangement
10:55ToxicFrogPreviously, I've had NPEs but fixing problems with my use of (ns) fixed them
10:55ToxicFrogNow, I have code that runs fine in the interpreter, but crashes the compiler.
10:55gfredericksdoes it run fine if you restart the entire interpreter?
10:55ToxicFrogYes.
10:56ToxicFrogAs in, I can run it as 'java -cp ... clojure.jar -m ca.ancilla.kessler ...' and it works perfectly.
10:56gfredericksoh that
10:57gfredericksI would go back to changing one thing at a time :)
10:57ToxicFrogYeah, I wasn't really expecting to run into compiler bugs while doing this :/
10:57ToxicFrogI 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:57ToxicFrogAnd then blammo
10:58ToxicFrogAnd as a result it's really hard to nail down which changes actually caused the problem.
10:58nDuffToxicFrog: ...have a reproducer available?
10:58ToxicFrognDuff: that's what I'm working on, yes.
10:59ToxicFrogI 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:59gfredericksI like `git branch wtf` and then start bisecting by deleting half the project at a time
11:00duck1123Sometimes it's so hare to spell "closure" correctly. By instinct, I want to type that 'j'
11:00gfredericksspeling is always hare
11:19stuartsierraToxicFrog: Clojure does not have an interpreter. There is only the compiler.
11:19tensorpuddingit has a repl though
11:20ToxicFrogstuartsierra: what's the distinction between loading and running a .clj directly and compiling it with (compile) for later direct loading by Java, then?
11:20tensorpuddingas anything that calls itself a lisp dialect should
11:20ToxicFrogAlso, if there is no distinction, why does one work and the other not?
11:21stuartsierraToxicFrog: 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:22stuartsierraBut `compile` sometimes breaks, especially when the compiled code has side effects at the top level of a namespace.
11:22ToxicFrogstuartsierra: there is clearly -some- difference, though, because compile NPEs and running it directly works.
11:23stuartsierraMost of the differences are around how the JVM loads .class files that have already been compiled.
11:24stuartsierraIt could be issue with a `ns` declaration somewhere in your code that has a syntactic error.
11:25ToxicFrogIn that case, wouldn't running it directly fail?
11:27ToxicFrogThis 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:27ToxicFrogThis code, however, runs fine when loaded directly but crashes the compiler.
11:28ToxicFrogOk, I have a minimal test case
11:28ToxicFrogTwo files, 10 lines.
11:31xumingmingvaperiodic: I solved the encoding issue
11:31xumingmingvby setting the file.encoding property: java -Dfile.encoding=utf-8 xxx
11:40ToxicFroggfredericks, stuartsierram, nDuff: reproducer here: https://dl.dropbox.com/u/7531542/wtf.tar.bz2
11:41ToxicFrogUnpack it and run 'run.sh' and it should output a warning message and then "sfs content goes here" and exit cleanly.
11:41ToxicFrogUnpack it and "lein run" and you'll get a NullPointerException in clojure.lang.Compiler$ObjExpr.emitVar.
11:47ToxicFrogUsing (compile) directly produces the same results:
11:47ToxicFroguser=> (compile 'ca.ancilla.kessler.core)
11:47ToxicFrogWARNING: load already refers to: #'clojure.core/load in namespace: ca.ancilla.kessler.sfs, being replaced by: #'ca.ancilla.kessler.sfs/load
11:47ToxicFrogCompilerException java.lang.NullPointerException, compiling:(core.clj:1)
11:47ToxicFrogExcept without the 60-line stack trace.
11:47XPheriorIs there a good Clojure code coverage tool out? I tried a couple different ones, but no one them worked. =/
11:48stuartsierrasorry, don't have time to look at this now
11:48ToxicFrogstain: well, gfredericks and nDuff also expressed interest, and I'll leave it online anyways
11:49ToxicFrog...oh seriously?
11:49ToxicFrogI found the problem!
11:50gfredericksforgot a semicolon?
11:51ToxicFroggfredericks: no, apparently defining functions named 'write' and 'load', even in their own namespace, breaks the compiler
11:51llasramMmm? I've definitely defined new functions named `load` w/o any problem
11:52ToxicFrogllasram: well, if I rename sfs/load to sfs/sfs-load, it compiles fine
11:52ToxicFrogIf it's named sfs/load instead, the compiler crashes
11:53ToxicFrogIt works fine if load is private, too
11:54ToxicFrogSo this works: (ns ca.ancilla.kessler.sfs) (defn- load [name] {}) (defn sfs-load [name] (load name))
11:54ToxicFrogAnd this: (ns ca.ancilla.kessler.sfs) (defn sfs-load [name] {})
11:54ToxicFrogBut this crashes the compiler: (ns ca.ancilla.kessler.sfs) (defn load [name] {})
11:56ToxicFrogIn fact, here is a really minimal test case, single file:
11:56llasramSo 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:56llasramShould I be looking at something else?
11:56ToxicFrog(ns ca.ancilla.kessler.core (:gen-class)) (defn load [x] 0) (defn -main [& args] 0)
11:57ToxicFrogThis runs fine in the repl but crashes both 'lein run' and (compile) in 1.4.0
11:57ToxicFrogllasram: how are you running it?
11:57llasramOh, I skipped a step. Just a sec
11:59llasramOh, interesting. That's very weird. But adding the :refer-clojure to the `ns` form lets it work fine under `lein run`
11:59ToxicFrogWacky
11:59ToxicFrogI didn't try that
12:00llasramThe confounding factor appears to be AOT, and looks like a bug to me
12:01llasramIf you modify project.clj to set ^:skip-aot and the `:main` namespace symbol, then `lein run` works fine w/o the `:refer-clojure`
12:02krali'm reading Clojure Programming and i've notice that it uses to name function like camel->keyword
12:02kralis it a convention?
12:03kralor it's just the author way?
12:03Iceland_jackkral: it's similar to the `XtoY' tradition in C, command-line utilities etc.
12:03Iceland_jacklike atoi
12:03Wild_Catkral: standarc clojure naming convention is more like lowercase-with-dashes
12:04Wild_Cat(or maybe I'm completely misunderstanding your question)
12:04llasramYeah, it's not uncommon, but I don't think it qualifies as universal convention either
12:04kralIceland_jack: ok, thank you. I just want to know what the common convention is
12:04Iceland_jackConventions 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:05kralllasram, Iceland_jack: ty too
12:05kralI was just curious
12:06kralit reminded me of my dark past as perl monk...
12:06Iceland_jack,(doc clojure.instant/caldate->rfc3339)
12:06clojurebotNo entiendo
12:06ToxicFrogI love having so much leeway in what I name things.
12:07ToxicFrogllasram: so what's procedure here? Should I file a bug report?
12:22nDuff ToxicFrog: Yup, a bug report sounds like the right thing. See http://dev.clojure.org/jira/
12:23pepijndevosIf 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:23lazybot⇒ true
12:25ToxicFrognDuff: thanks
12:26dnolenibdknox: ping
12:26ibdknoxdnolen: hey
12:26ibdknoxdnolen: totally didn't realize KTC was you btw :)
12:27dnolenibdknox: yeah
12:27dnolenibdknox: haha :)
12:27dnolenibdknox: so I tried noir for the very first time - very sweet.
12:27dnolenibdknox: getting a noir app on heroku is mind blowing simple.
12:28ibdknox:)
12:28ibdknoxdnolen: that was the hope
12:29dnolenibdknox: 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:30ibdknoxdnolen: what'd you run into?
12:30ibdknoxrather, what issue
12:36dnolenibdknox: sorry I got disconnected. did you reply?
12:36ibdknoxdnolen: just asking what issue you ran into - I haven't hit anything myself, but that doesn't mean much :)
12:37ibdknoxthere were some problems the first day with it
12:37ibdknoxbut all that got fixed in 0.0.4
12:38dnolenibdknox: actually no issue, I was just confused it's a simple REPL :) K I'll probably have more feedback later.
12:39dnolenibdknox: how'd OSCON talk go?
12:39ibdknoxdnolen: 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:40ibdknoxdnolen: people were full of praise though, so presumably decently
12:40dnolenibdknox: nice! so well attended.
12:40ibdknoxthey 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:41ibdknoxfor about 400 it sounds like
12:41ibdknoxerr so about*
12:49ibdknoxdnolen: I gotta go catch a flight back to the valley, but I'd love to catch up sometime soon
12:50dnolenibdknox: definitely! talk soon.
13:05technomancyjweiss: what problems are you having upgrading to lein2?
13:05technomancythe precate plugin should cover the majority of cases
13:19technomancyhttps://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:20technomancyyou should be able to hit C-u M-. and browse the entire tree of vars and namespaces using ido
13:23mtkoanhow can I remove the boilerplate from this let block? https://www.refheap.com/paste/3715
13:23kilonis there a library for Clojure to make it more common lispy like there is for elisp ?
13:24jweisstechnomancy: 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:25technomancyjweiss: precate is a one-time operation you can do on a lein1 project to see what needs to be added for lein2 compatibility
13:26jweisstechnomancy: so if i have many machines with lein on it, i need to upgrade them all at once?
13:27duck11231once you fix the project, it'll be good for all
13:27jweisswill v1 and v2 live side by side just fine?
13:27technomancymost projects can work with both
13:27technomancyand lein1 and lein2 can easily co-exist
13:28jweissonly problem i noted was the :java-source-path -> :java-source:paths
13:28jweisslein2 wouldn't compile the java until i made the change.
13:28duck11231I found it's best to have a lein1.7 and a lein2 and symlink whatever you want to be default to lein
13:28technomancyjweiss: for the time being you can just include both until you can drop lein1 support
13:29technomancyit's not like the old entry will break anything
13:29technomancyjust put a comment that it's there for backwards compatibility
13:29jweissok, that's probably the best solution, was wondering if that was the only issue i woul dhit
13:29nDuffHrm.
13:29technomancydefinitely trying to make it easy for people to upgrade, so if there are any blockers I want to hear about it
13:30jweissok, i'll try to use the same project files on both, and submit issues if i can't do it
13:30dnolenmtkoan: [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:38ToxicFrog<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:41ToxicFrogllasram: bug filed: http://dev.clojure.org/jira/browse/CLJ-1028
13:42llasramToxicFrog: You're still getting the exception even with (ns ... (:refer-clojure :exclude [load])) ?
13:42ToxicFrogOh. I didn't think to :exclude load
13:42ToxicFrogthat works, I'll add a comment to that effect
13:42llasramOh, that's what I'd meant :-)
14:25aaelonyHas anyone tried to access the Google Analytics API from Clojure?
15:35dnolen_cemerick: bigger response than last year?
15:35cemerickdnolen_: We'll see next Thursday… :-)
15:36emezeskecemerick: Thanks for doing that, by the way, I'm very curious about the results.
15:37cemerickemezeske: Sure :-)
15:37cemerickIt's fun…although hopefully Google doesn't screw me on the charts this time around.
15:37emezeskeWhat happened?
15:38cemerickNope, they will be, nothing's changed.
15:38cemerickemezeske: Only the first ~10 chars of each option are shown next to the corresponding bar, which is *super* unhelpful.
15:38emezeskecemerick: Bah!
15:38cemerickLast year, I ended up fiddling with each chart and putting the text in myself with acorn or something.
15:39emezeskeSounds less than pleasant
15:39cemerickI might see what excel can knock out this time around.
15:39emezeske:)
15:39cemerickIf I were more of a hacker, I'd write a custom Clojure survey app/script or something. :-P
15:40amalloycemerick: if you start now, you can probably have a heroku+incanter app ready for next year
15:40cemerickamalloy: I know you kid, but a lot of people keep asking me to provide drilldowns and stuff.
15:41amalloy"here's the data, mate, knock yourself out"
15:41cemericki.e. "What is the IDE/editor distribution like for the people that do stats work?"
15:41amalloywhich i understand is your policy already
15:41cemerickQuite.
15:41cemerickI have a stack of cards for people that start sentences with "You know what you should do…"
15:45S11001001the 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:47TimMccemerick: Oh, is there another survey?
15:47pbostromI 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:47amalloyi think the recommendation is to not use an atom throughout a namespace
15:48amalloy(good advice: it makes the entire namespace hard to reason about, as well as being single-use)
15:48cemerickTimMc: Just this one, AFAIK: http://cemerick.com/2012/07/19/2012-state-of-clojure-survey/
15:48axle_512Is there a way for lein to search repositories for dependencies from the command line?
15:48carkso what, dynamic vars and a binding form ?
15:49TimMccemerick: Great, thanks.
15:49amalloy*shrug* depends why you thought you wanted an atom to begin with
15:49carki use atoms for those few places i need configuration which is read from a file
15:49axle_512Also, is there a way to get lein to update your project.clj with a new dependency (instead of editing the project.clj directly?)
15:50raekaxle_512: lein help search
15:50axle_512raek: thanks! Will read it.
15:50amalloycark: why an atom? if you read it from a file, just read it from a file
15:51carkread it on every request ?
15:51amalloyno
15:51amalloyjust once. i don't see what you think an atom is buying you there
15:52cark i have a centralized config reading thing, then i populate the fewx namespaces that require such config
15:52duck1123amalloy: so would you pass it around to every function, or would you assign it to a var?
15:52carkan atom does it, i guess i could redef
15:52amalloy(let [the-config (delay (read file...))] (defn get-config [] @the-config))
15:53carkthat's still a reference type
15:54duck1123but then none of your functions are at the top level. not a big deal, but that tends to bug me
15:54amalloywell (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:54carkamalloy: if i do that, my namespaces will need to refer to this centralized config, which is not their concern
15:55carklet's imagine i have a namespace which is responsible for building web pages, and it requires a directory to pull templates from
15:55duck1123do you have a link to those notes?
15:56pbostromnotes: https://gist.github.com/3152034
15:56amalloyi 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:56carkwell, by setting the atom, from outside the namespace, i don't need to have this namespace aware of the config retreiving method
15:56nDuffYou can provide a promise from outside too.
15:57carki'm separating config file managment concern from html generation
15:57emezeskecark: Does that mean that your config namespace is aware of all namespaces that use it?
15:57amalloybleeeeurgh, you want your config namespace to be aware of what namespaces are aware of users?
15:57amalloyer, that sentence didn't quite make sense. just pretend i said what emezeske did
15:57carki have a config reading namespace which is not aware, then a controling one that dispatches to all , yes
15:58carkat some point you need to make stuff happen
15:58carkyou have your .ini file, it's a centralized store for your config data
15:58carkthat data needs to be dispatched
15:59carkbut if at some point i need to use a database as iconfig store, well i can do it from a single place
16:00carkthat's why an atom is a good fit to store configuration data, you can set it from the outside, without a redef
16:00emezeskeBut... why not just have ns A that depends on config bit X just ask for config bit X?
16:01carkbecause your page generation namespace has no business thinking about configuration
16:01carkat least mine doesn't !
16:01emezeskeBut... but..
16:01duck1123where are you storing config bit x?
16:02carkduck1123: i get your point, but already answered it : i might need to change access method for configuration, that's an application level thing
16:03duck1123actually, 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:03carkduck1123: haha ok so i really didn't get your point =)
16:04axle_512hmm, 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&quot;]
16:04duck1123I'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:05duck1123I 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:05amalloyduck1123: that makes perfect sense; just store it in a delay rather than a writable reference type like an atom
16:06emezeskeduck1123: That is a very sensible approach.
16:06amalloy(let [the-config (delay (read file...))] (defn get-config [path] (get-in @the-config path))
16:06duck1123what if I want to be able to update that data at runtime?
16:07carkduck1123: tho i'm not in amalloy's boat, i think that at this point that's not configuration anymore
16:07duck1123I have an api for changing that config and re-serializing it
16:07amalloythen it's not really configuration, is it?
16:07amalloyor at any rate, if it's writable then it's not just an in-memory view of your app's config file
16:07duck1123granted, it's more of a crappy database, but I use it for configuration data...
16:09duck1123Is the advice to never assign an atom to a top-level var, or does the name report-count have significance?
16:09amalloyduck1123: 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:10amalloy(defn read-config [file]) (defn write-config [file config])
16:10pbostromI think in the example from the notes, report-count is just some global counter
16:11amalloyand 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:11carkamalloy: i agree on that
16:12carki just feel that application-wide stuff is to call in the pieces which is it gluing together, not the other way around
16:12carkit is*
16:13duck1123I think I'll be changing that part soon anyway. I want to merge it in more with my start/stop application flow
16:13duck1123I want the eventual ability to have multiple applications running in the same vm
16:13carkduck1123: with differing configurations ?
16:14duck1123yeah
16:14duck1123or they can all read the same config file
16:15carkso you mean several instances of the same application with differing configurations, or different appluications ?
16:15duck1123either one
16:15duck1123the services that are run are part of the config file. Of course, they would share fn definitions
16:16carkin the first case, i feel like dynamic defs and binding form are prefered
16:17axle_512Seems that "http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.zip&quot; doesn't exist anymore? But there is a corresponding .gz file. Can lein search pickup the .gz instead?
16:17carkor make your services in some OO style, configure them, pass them around to your consumers
16:17duck1123yeah, 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:17technomancyaxle_512: weird, can you open an issue in leiningen's tracker?
16:18axle_512technomancy: sure, will do!
16:18amalloyright, saying "use a dynamic binding" is just delaying the problem - somehow you have to know what to bind the thing to
16:18pbostromso, 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:19duck1123I miss the days when there was less stigma surrounding dynamic vars
16:19axle_512technomancy: 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:19carkdynamic vars are good, no stigma here
16:20technomancyaxle_512: oh, how did I miss that? thanks.
16:20carkthey're only a hidden parameter to your functions
16:20cemerickcark: and thus put a wrinkle into what would otherwise be referentially transparent fns
16:20duck1123which makes them hard to reason about, and binding + lazy seqs leaves me scratching my head
16:20axle_512technomancy: no problem! Thanks for the awesome tool.
16:21cemerickBut, yes, they have their uses. Just more rope than most people/uses need most of the time.
16:21carkcemerick: if you suddenly would see this parameter, they would still be referencially transparent
16:21muhoothey remind me of global variables
16:21carkso in effect they still are
16:22amalloyyes, 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:22cemerickNo, functions that touch dynamic vars are not referentially transparent.
16:22carkof course
16:23technomancycark: isn't that just saying "if dynamic scope weren't dynamic..."?
16:23carkwell, it kinda isn't, if you see it as passing the environment to all functions, but you all get my point
16:24duck1123I 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:24carkbhy do you need referencially transparent stuff : testability and multithreading
16:24carkwhy*
16:24cemerickcark: FWIW http://cemerick.com/2009/12/30/all-my-methods-take-316-arguments-and-i-like-it-that-way/
16:25carkcemerick: sure, that's why we segregate functionalities in little pockets called namespaces
16:26carkbut hey, i'm playing devil's advocate, i'm very much sold on functional pronciples
16:26carkprinciples*
16:26carkstill, dynamic vars are a very usefull tool
16:27technomancyyep, as long as you think of them as "invisible arguments"
16:28cemerickTheir real undisputed use case is to provide auxiliary returns.
16:29cemerickOh, and with-redefs and hooks.
16:29cemerickThis is going to turn into, "What have vars ever done for us?!"
16:29carkhow about keeping the current database connection, real world non-functional stuff
16:29hiredmanvars are an indirect linking construct
16:30amalloycemerick: auxiliary returns? let me step in and dispute that
16:30hiredmanhttp://en.wikipedia.org/wiki/Position-independent_code
16:30hiredmanthey 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:31carkhum yes there's that too, actually thir first goal in a lisp
16:31hiredman(if you are asking what vars have ever done for us)
16:31carkso i'm guessing the binding stuff is "complected" to it
16:32hiredmanyes, but binding is somewhat disentangled now that you need to mark vars as dynamic
16:32carkright
16:33hiredmananyway, vars are very useful, and giving them up (clojurescript I am looking at you) is very sad
16:34nDuffWhich parts of their functionality doesn't clojurescript implement adequately on top of normal javascript semantics, other than metadata?
16:34hiredmanbut given that clojurescript is mangled by the closure compiler, re-linking is non-trivial anyway
16:35antoineBhello, i have got this error: "org.mortbay.log.Logger [Thrown class java.lang.ClassNotFoundException]"
16:35llasramcemerick: Yeah, I watched your Clojure/west talk the other day and didn't get the "dynamic vars for auxiliary return" bit either
16:35antoineBdoes that mean i need to add org.mortbay.log as dependencie?
16:36hiredman(binding [r2 nil] ((fn [] (set! r2 2) 1)))
16:36cemerickllasram: what hiredman said; there's an extended example in the book.
16:37hiredmandynamic vars are like an ancillary call stack, which is why you use them to 1. pass args 2. pass results
16:38hiredman(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:39llasramOh, I think I see -- when you create a new binding, calls to `set!` set the value just for that position in the stack?
16:39nDuffllasram: Yes.
16:39hiredmanright, they set! the inner most binding
16:41llasramThat's interesting... I'm not sure how I feel about it, but it's interesting :-)
16:41technomancyI don't think I've ever seen that
16:43hiredmantechnomancy: yeah, well, how often is an ancillary return useful?
16:43technomancyhow often is the value greater than the maintenance cost? never outside throwaway code, probably.
16:44duck1123If I ever need to return more than one thing, I just return them as a collection of some sort
16:44hiredmanyeah, if clojure.core setup a few dynamic vars for that purpose they might get used more
16:44hiredman*r1* … *r5*
16:44hiredman:O
16:45hiredman*r0* … *r4*
16:45technomancyduck1123: or metadata if you can get away with it
16:45hiredman:(
16:45nDuff...so, here's one case.
16:45hiredmanusing metadata for that is icky
16:45technomancythere is one place in Leiningen where I use a promise in metadata as an ancillary return.
16:45hiredman:(
16:45nDuffI 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:46technomancybetter than set! though
16:46nDuff...but its scope doesn't extend out into the catch without using a binding and set!
16:46hiredmanno
16:46technomancyactually it might not be metadata with the promise anymore
16:46hiredmanset! is better
16:46amalloyhiredman: i've thought about *r0* sorts of vars, but it's hard to make them work right
16:46hiredmanamalloy: sure
16:47cemerickAll 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:47technomancyhiredman: set! might be better than an atom, but I'd say a promise is better because you can only deliver once
16:47amalloylike, 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:47technomancyit's not unconstrained mutability
16:47hiredmantechnomancy: passing it a long as metadata is yetch
16:48hiredmanamalloy: sure
16:49technomancybut it's kind of like arguing about COBOL vs BASIC; they're both so horrible
16:49technomancycemerick: 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:49hiredmana lot of people started of programming with BASIC, maybe more than stopped programming with COBOL
16:50technomancyhiredman: it was an example; I didn't mean we should actually argue about it =)
16:50hiredman:)
16:51cemericktechnomancy: Yeah, my biggest use case for them has been database libs, networking, etc.
16:54technomancyhuh; the conj submission is requiring two abstracts again
16:54technomancyI just don't get that
16:56hiredmancemerick: also, whats the deal with the friend examples from the readme being broken?
16:57hiredmanI 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:58xeqihiredman, cemerick: I think thats friend/#13 https://github.com/cemerick/friend/pull/13
16:59hiredmanxeqi: sure, I saw the pull request
16:59cemerickhiredman: Yeah, what xeqi said. Definitely just an oversight.
16:59cemerickThough, point taken.
17:39Aderius`Hi, I wrote a (small) function that can get the corrected index of a
17:39Aderius` list when given a index that exceeds the limits of that list (eg list
17:39Aderius` of size 2 and given index of 3, gives back index 1) It also accepts
17:39Aderius` coordinates of a 2d list that are off limit, but there is one case I
17:39Aderius` get a strange exception and I can't figure out why. Somebody a clue?
17:39Aderius` 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:40Aderius`hmm, strange formatting now, sorry!!!
17:40hiredman(nth map x)
17:41hiredman,(nth [] -1)
17:41clojurebot#<IndexOutOfBoundsException java.lang.IndexOutOfBoundsException>
17:43espeedhow do you get the root path of the project? I need a consistent reference point for reading files
17:43hiredmanuse clojure.io/resource
17:43hiredman(and read the docs for it before you use it)
17:44technomancyespeed: if you are never going to run your code from outside Leiningen you can use (System/getProperty "user.dir")
17:44Aderius`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:44TimMcclojure.java.io/resource, actually
17:44technomancybut assuming your code is always going to run in the context of a project may not be wise; depends on the project
17:46espeedtechomancy: I was using (System/getProperty "user.dir") and then I included the project in another project's checkouts directory and it broke things
17:47technomancyespeed: ok, it sounds like you don't actually want the project root then; you want a resource
17:48espeedyeah, I'll just have to reshuffle the files
17:50TimMcreshuffle...?
17:50espeed(move the files around)
17:50TimMcespeed: Put things in th ./resources folder or the ./src folder if you want them available.
18:06espeedTimMC: 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:07hiredmanespeed: that is unlikely
18:08espeedwhat is unlikely?
18:08hiredmanespeed: io/resource looks up stuff via the classpath, if you are putting data in ./resources it gets bundled in the jar by lein
18:09hiredman./resources is put on the classpath, meaning you just refer to things in ./resources like (io/resource "foo") for ./resources/foo
18:09hiredmanespeed: it is unlikely that you are doing it correctly
18:10espeedright, but I'm working on two projects in parallel -- the primary project and another which is in the primary project's checkout folder
18:11hiredmansure, 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:11espeedcalls to io/resource from the secondary project are breaking because they are returning the primary project's resource folder, not the secondary's
18:12hiredmanespeed: you need to ask for the resource by specific name
18:12hiredmanasking for folders via io/resource is bound to break
18:12espeedI'm in SLIME
18:13hiredmanbecause most classloaders will not return a folder
18:13hiredmanespeed: so?
18:13espeedI'm asking for the specific file
18:13hiredmanso you have the same resource in both projects?
18:14hiredman(why?)
18:14hiredmanif you don't use io/resource but ask the classloader directly it can give you a list of resources with the same name
18:18Aderius`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:18Aderius`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:19S11001001Aderius`: lazy seq probably lacks the behavior you are looking for
18:19aperiodica vector is probably what you want, since i imagine you will want to update particular tiles quickly and such
18:19S11001001Aderius`: accessing an element is O(n) over size, and you are only lazy to the right
18:21Aderius`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:22aperiodici 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:22Aderius`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:22S11001001Aderius`: 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:22S11001001just like in the movie
18:23Aderius`aperiodic: last answer was of previous comment of yours
18:23drostieAderius`: have you seen the "Caves of Clojure" blog posts?
18:24drostieAderius`: might save you some time reduplicating that blogger's work if you're interested in a 2d tiled game.
18:24aperiodicAderius`: yeah, vectors don't require you to walk through them up to the cell you want to access/"change", unlike lists
18:24aperiodic+1 for checking out the Caves of Clojure posts
18:25drostieAderius`: http://stevelosh.com/blog/
18:25Aderius`aperiodic: currently its still in memory constantly. I guess that i have to write it to a file regulary in a future.
18:26jballancrelated question (was just looking at this): what is the preferred way to write Clojure data structures to disk?
18:26Aderius`drostie: I noticed the caves blogposts but didnt checked it in detail.
18:27S11001001,(doc pr) ; jballanc
18:27clojurebot"([] [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:27jballanchmm...ok
18:27jballancso there's not a compact binary form that people use?
18:28S11001001people who actually need to worry about compact binary forms worry about compact binary forms
18:28jballancgotcha
18:28jballancthanks!
18:28drostiejballanc: general philosophy is that clojure data structs should become sorta like the JSON interchange format or so, direct serialization.
18:29drostieer, rather, *in*direct serialization.
18:29Aderius`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:29Aderius`this is lazy right
18:29jballancdrostie: sure, I was just wondering if there was something like Ruby's Marshall.dump
18:29Aderius`just wrap it in (list x) to make it a vector?
18:30S11001001Aderius`: no, but also, you can't have an infinitely long vector or list
18:30jballancdrostie: though, considering the inter-version compatibility issues that Marshall.dump has, Clojure's approach might be better in the long run
18:30S11001001oh, I misread, n/m
18:30S11001001,(list 42)
18:30clojurebot(42)
18:30S11001001,(vector 42)
18:30clojurebot[42]
18:30S11001001,(vector '(1 1 2 3))
18:30clojurebot[(1 1 2 3)]
18:31S11001001,(vec '(1 1 2 3))
18:31clojurebot[1 1 2 3]
18:31aperiodicjballanc: https://github.com/revelytix/carbonite might be worth a gander
18:31S11001001pick your poison
18:33Aderius`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:34y3didoes anyone use clojure with node?
18:34y3dii wonder how devving on that would be like
18:35haspakerThe (comparator …) function puzzles me
18:35aperiodicAderius`: i found http://www.brainonfire.net/files/seqs-and-colls/main.html to be extremely helpful in that regard
18:35haspakerAnd the docs aren't much help
18:35Aderius`the functions I already wrote should work the same with different seq like data types, right?
18:35Aderius`aperiodic: thanks
18:36haspaker(comparator #(> % %2))
18:36haspakerThe anonymous function should only return true or false
18:36haspakerHow does "comparator" turn it into three values: -1, 0 and 1?
18:38jballanchmm...wonder if this works...
18:38jballanc,(source comparator)
18:38clojurebotSource not found
18:38jballancah, guess not :(
18:39jballanchaspaker: if you try that in a clojure repl, you'll have your answer
18:40aperiodici'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:41haspakerYeah, the source made it all clear
18:41haspakerThanks!
18:50AWizzArdFrom Edsger Dijkstra: “Program testing can be used to show the presence of bugs, but never to show their absence!”.
19:18dsrguruquick poll: earmuffs only on dynamic vars or also on atoms?
19:18arohnerAWizzArd: yes, but Dijkstra didn't ship products, either
19:18arohner:-)
19:19arohnerdsrguru: only dynamic vars, and not even 100% of the time
19:19emezeskedsrguru: never on atoms.
19:19aperiodicdsrguru: only dynamics; atoms prefaced with !
19:20dsrguruthanks all
19:21dsrguruaperiodic: what do you mean by prefacing an atom with a bang?
19:21hiredmanaperiodic: that is not a convention I've seen in wide use
19:21hiredman(ever, really)
19:21dsrguruaperiodic: surely you don't mean (def !my-atom (atom foo)) ?
19:22dsrguruhiredman: putting aside whether or not you've seen it used, were you familiar with said convention?
19:23hiredmandsrguru: no, so I wouldn't call it a convention
19:23aperiodicdsrguru: 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:25hiredmanaperiodic: do you have other characters you use for other reference types?
19:26dsrguruaperiodic: 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:27hiredmanthey don't routinely use any of the reference types
19:27dsrguruor I should say the absense of results on Google confirms the sentiment on #clojure
19:28dsrguruhiredman: what do you mean?
19:28hiredmanI mean, the reference types are still mutable state, and purely functional code is to be prefered
19:29aperiodichiredman: 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:29hiredman:(
19:29hiredmanprefixing with $
19:29aperiodici find it useful as a signal that that var doesn't come from the local context
19:29dsrguruhiredman: 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:30aperiodichiredman: why do you dislike it?
19:30dsrguruaperiodic: http://en.wikipedia.org/wiki/Hungarian_notation#Disadvantages
19:30hiredmandsrguru: it depends, but most large scale clojure apps are not websites
19:31hiredmanlarge backend data processing
19:31dsrguruhiredman: why do you think it is that more clojure programmers don't use it for web development?
19:32hiredmandsrguru: well, I think webdev sucks, so I wouldn't want to do it any language
19:33hiredmanwhich is why I don't do it
19:33hiredman35343 lines of clojure (including tests) 1 or 2 atoms, one agent, one ref
19:34hiredmanwell, actually, I shouldn't say that
19:34dsrguruwell 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:34hiredmanI just remembered we use atoms in tests
19:35hiredmandsrguru: *shrug* doesn't matter, backend data processing, I don't care what the ui is
19:35hyPiRionPersonally, I just add a doc to it. Whenever I wonder what kind of type the var is, I just (doc foo) it.
19:36dsrguruhyPiRion: yeah I'm currently planning to just jump to its tag or doc/source it if I'm at the repl
19:57dbacarHi
19:57dbacaris this a nice way to reverse a list(without using the reduce and reverse)
19:57dbacar )
19:57dbacar )
19:57dbacar )
19:58dbacar(defn myReverse [x]
19:58dbacar (loop [lst x agg '()]
19:58dbacar (if (empty? lst)
19:58dbacar agg
19:58dbacar (recur (rest lst) (conj agg (first lst)))
19:58dbacar )
19:58dbacar )
19:58dbacar )
19:58nicholasftechnomancy: you awake?
19:58hiredmandbacar: please use a pastebin in the future
19:58dbacarneed not to say i am a newbie
19:58dbacarsorry for that
20:03dbacarthanks anyway
20:04emezeskedbacar: For functions that already exist in clojure.core, I suggest looking at their source if you want to see a good implementation
20:04amalloydbacar: that's a reasonable implementation of my-reverse
20:04emezeskedbacar: https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L884
20:05lucianare things like if and . called core forms?
20:05emezeskedbacar: ^what he said. A working implementation is the most important part. :)
20:06luciani'm calling them "interpreter macros", but i think that may be wrong
20:06hiredmanlucian: forms that start with certain reserved symbols are "special forms"
20:06hiredmanlucian: it is
20:06hiredmanlucian: clojure is compiled
20:06dbacarthanks a lot, trying to get the emacs (source ...) thing work
20:07hiredmanso . is just the symbol ., but (. <whatever>) is a special form
20:07lucianhiredman: ok, special forms. i'm writing a lisp interpreter
20:07amalloydbacar: if you have slime up, you can just use C-c C-d d
20:07amalloyor M-. for source
20:07hiredmanhttp://www.nhplace.com/kent/Papers/Special-Forms.html
20:07lucianhiredman: i'm trying to differentiate user-level macros from things that the language comes with
20:08hiredmanlucian: *shrug*
20:08lucianjust in the naming mind you, they're all in the same namespace anyway
20:08hiredmanlucian: fn is refered to as a "special form" but is in fact a defmacro build on fn*
20:09lucianright
20:09dbacaramalloy: thank you
20:09hiredmanclojure's special forms are not namespaced as a matter of fact, which is sort of a wart of the current impl
20:10lucianah, interesting
20:10luciani'm basically learning about interpreters
20:10lucianwrote my own lisp in python
20:10amalloyhiredman: 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:10hiredmanhttp://dev.clojure.org/display/design/Wart+Removal
20:11hiredmanamalloy: that is interesting, I dunno
20:11hiredmanwhat do we call the things the compiler knows how to compile then?
20:12hiredmancompiler macros?
20:13hiredman(= macros (union compiler-macros user-macros)
20:13hiredman)
20:13hiredmanI just did away with special forms altogether
20:13amalloyno good; compiler macros already mean something useful
20:13hiredman~tada
20:13clojurebot? "Returns the metadata of obj, returns nil if there is no metadata."
20:13hiredmanclojurebot: jerk
20:13clojurebotyou cut me deep, man.
20:13SegFaultAX|work2Map is a strange beast in clojure. With multiple collections it effectively acts like zip-with right?
20:13hiredmanamalloy: we'll just replace the bits the compiler knows about with compiler macros
20:14amalloyhiredman: actually it looks like the nhplace article you linked to suggests the terminology i mentioned
20:14SegFaultAX|work2Eg zipWith from Haskell, that is.
20:14amalloyNon-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:14amalloy~zip
20:14clojurebotzip 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:15SegFaultAX|work2Wow, literally my exact words :D
20:15SegFaultAX|work2I 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:16SegFaultAX|work2I don't like how map has been overloaded like that, personally.
20:16amalloyhe 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:16emezeskeSegFaultAX|work2: You don't like that? It's ridiculously useful.
20:17hiredmanyeah, 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:17amalloyah, is it that old? i didn't read it carefully; that makes sense
20:17hiredmanI dunno
20:17hiredmanI didn't read it carefully either
20:17amalloyi think it is, though
20:20SegFaultAX|work2emezeske: Maybe so. However, I'm used to the slightly less general form `map :: (a -> b) -> [a] -> [b]` (excuse the Haskell type syntax)
20:20amalloySegFaultAX|work2: it's only that way because haskell can't have variadic functions
20:20SegFaultAX|work2emezeske: And while it is useful, it's kind of a drastic shift from other functional languages that don't conflate mapping and zipping.
20:20amalloyzipWith4, indeed
20:21SegFaultAX|work2amalloy: I was only using that syntax as an example.
20:24hiredman"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:24hiredmanHah!
20:25amalloywell, that was true, right? dynamic scoping was a big feature of lisp
20:25hiredmanyeah
20:25hiredmanit is just amusing to read
20:37hiredmanthe whole riff on conditional flow control in that paper doesn't make a lot of sense
20:38hiredmanoh, I get it
20:38hiredman"well duh, you write it as a macro, what is all this? oh, I see showing me why you have to"
23:08ToxicFrogSeriously?
23:08ToxicFrog"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:10ToxicFrogEven if I'm doing something outright forbidden, the compiler should report that as an error, not crash.
23:11wkellyToxicFrog: hwhat
23:12ToxicFrogwkelly: yesterday I generated a NullPointerException in (compile) for a script that runs fine when not compiled
23:12amalloyhe's referring to http://dev.clojure.org/jira/browse/CLJ-1028
23:12ToxicFrogToday I produced a minimal test case and filed a bug
23:13amalloyi think you grossly misquoted stuart's reply
23:13ToxicFrogamalloy: he said "This is left legal for compatibility, but programs that do it are in error."
23:13ToxicFrogFirst of all, it seems inherently contradictory that something should be legal and an error.
23:14ToxicFrogSecondly, if it's an error, the compiler should produce an error message, not crash mysteriously
23:14wkellyNow I see!
23:14amalloyagreed, poorly worded. choose to read that as "this is an error, but the compiler makes an effort to Do What You Mean"
23:14ToxicFrogEven if creating functions that shadow function in clojure.core is 100% verboten under all circumstances, this should not cause the compiler to crash.
23:16cemerickThe warning seems like it would be the text of the error message you'd like to see…
23:16ToxicFrogI mean, I disagree with the premise here, but even if I didn't this is still a valid bug report!
23:16ToxicFrogcemerick: yes.
23:16cemerickSo it should print ERROR instead of WARNING?
23:16ToxicFrogAnd then exit cleanly, yes.
23:16cemerickexit cleanly?
23:17cemerickWhat should it do instead of throwing an exception?
23:17ToxicFrogIf you actually read the bug, the problem is that the compiler emits that warning and then crashes with a NullPointerException.
23:17cemerickI'm looking at your stack trace right now. :-)
23:17ToxicFrogIf it's a warning, this implies that it is discouraged or dangerous behaviour, but not something that prevents it from compiling the program.
23:17ToxicFrogIf it does prevent it from compiling the program, the compiler should report it as such, rather than crashing.
23:18amalloycemerick: 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:18cemerickYeah, I get it.
23:18wkellyI agree with you, ToxicFrog! Seems a strange thing to be up in arms about, though
23:18cemerickPresumably, the compiler should be more careful to use clojure.core/load instead of whatever resolves locally.
23:18ToxicFrogamalloy: actually, it's not just load
23:19ToxicFrogThat was just the first one I found.
23:19cemerickprobably require, ns, defn, and so on as well.
23:19ToxicFrogAFAICT, pretty much anything in clojure.core will cause this warning followed by an NPE.
23:20amalloyToxicFrog: that is definitely not the case
23:20amalloyit's probably just the stuff that (ns) uses
23:20ToxicFrogOk, find-doc doesn't
23:20ToxicFrogamalloy: aah, that would make sense
23:20ToxicFrogOh wait, find-doc isn't even in core.
23:21ToxicFrogamalloy: ok, I have yet to find a counterexample.
23:22ToxicFrogwkelly: yeah, in the grand scheme of things it's a pretty minor error that's easy to work around
23:22ToxicFrogBut (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:23wkellysure, that's fair
23:23wkellybut you can't say it didn't warn you :P
23:23ToxicFrogAnd (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:24ToxicFrogThere 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:24ToxicFrogNormally, we call the former either "bugs in the compiler" and fix them, or "errors in the code" and exit cleanly rather than crashing.
23:24cemerickWell, that's probably not true; but, in any case, probably shouldn't take things personally. :-)
23:25ToxicFrogOk, yeah, that was a bit hyperbolic.
23:26ToxicFrogBut 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:26ToxicFrog(and in any case I feel (a) is enough to make this report worth filing)
23:28amalloytbh 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:28lazybot⇒ (do (clojure.core/in-ns (quote foo)) (clojure.core/with-loading-context (clojure.core/refer (quote clojure.core)) (clojure.core/require (quote bar))))
23:35wkellyI think it is fair to call it a bug
23:35wkellyand also fair to say "won't fix" :P
23:36wkellybut I agree that the bug should probably have been left open
23:37seancorfieldquick 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:38ToxicFrogwkelly: 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:39ToxicFrogBut saying that it's not a bug really rubs me the wrong way.
23:40amalloyToxicFrog: my point re: your gross misquoting is he didn't say that
23:40amalloyhe said "if you do this, you are in error, and we won't fix it"
23:41dubzseancorfield: if you're using emacs 24 you can generally M-x load-theme
23:41ToxicFrogamalloy: 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:41ToxicFrog...or illegal input, for that matter
23:42ToxicFrogBut yeah, he didn't say explicitly in the comment that it's not a bug, he did so by marking it CLOSED/DECLINED.
23:43duck1123In clojurescript, if I have the response from $.fetchJSON, how do I read the responseText? Better question, what function SHOULD I be using?
23:48gfredericksduck1123: doesn't fetchJSON parse the responsetext for you?
23:49duck1123It's giving me back a jquery object, and my text is in the responseText, all my attempts to access that field have failed
23:50duck1123the generated js seems right
23:51gfredericksduck1123: you're giving it a callback right?
23:51duck1123even trying it in the console doesn't work
23:52duck1123gfredericks: I'm calling the one that should return it
23:52gfredericksyou're not going to be able to call an ajax function that returns the response, if that's what you're expecting
23:52duck1123now that I think about it, I know why that's a bad idea
23:53duck1123I was mainly looking for something I could use at the console
23:54gfredericksyou still gotta do callbacks; no way around it
23:54duck1123that's fine.
23:55gfredericksI'll stop assuming I know what's going on and go to bed
23:56seancorfielddubz: i know how to load a theme - my question was how do you return emacs to its default "theme" state?
23:56AtKaaZhi, 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:56duck1123seancorfield: close and re-open emacs :)
23:56seancorfieldduck1123: yes, that works but i was hoping to avoid that :(
23:57duck1123I've never been able to change themes and get everything back to looking right
23:57seancorfieldi 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:57duck1123I don't think hober (the theme I use) has defined everything
23:58seancorfieldhmm, and what exactly does disable-theme do? it doesn't seem to do anything that i can see :(