#clojure logs

2013-03-25

00:17wei_to answer the above question lein-ring takes an :init function that's great for db connections
00:24akhudekhm, anyone here use perforate?
00:49tyleris there a way to see what lib lein is trying to download a dependency for?
00:52akhudeklein dep :tree
00:52akhudekshows all the deps and their dependencies
00:53akhudekalso, if you aren't using it, use lein-pedantic
00:56tylerakhudek: thanks
00:56tylerakhudek: the problem i was running into was it threw an exception before lein deps completed becuase there was o dep in clojars
00:56tylerso the output of :tree would have never been shown
00:57akhudekah
00:58tylertrying to use aleph but yammer metrics jar is fuqored i think
00:59akhudektyler: why not http://http-kit.org/
01:00tylerakhudek: because i never heard of it before? thanks for the link
01:01tyler(inc akhudek)
01:06zakwilsonIs there something like subs that can take a negative start? I know it's trivial to write.
01:07akhudekzakwilson: don't think so
01:08zakwilsonAnd so util.clj grows.
01:36xeqityler: it wasn't printing out what was missing? can you paste a project.clj that does it?
01:36tylerxeqi: it was user error my bad
01:36tylertypo in project.clj
01:55tylerhow do you get a new object in cljs? like a Date with an arg passed into constructor
01:57bbloomsame was as in clojure: use the (Date. 123)
01:58bbloomwhich is just shorthand for (new Date 123)
01:58bbloomalthough in this case, i guess it's js/Date
01:58tylerah thnx
01:58bbloom,(macroexpand '(Date. 123))
01:58clojurebot(new Date 123)
01:59bbloombut you really want (js/Date. 123)
02:24yunfani checked an repo and when running lein repl , the dependancies is so crazy, it require soooooooo many
02:58tomoj.
03:05Lajjlatomoj: do you till love me the most
04:16robewaldpass
04:37borkdudesay I've got this project.clj like here: https://github.com/borkdude/tictactoe/blob/master/project.clj
04:38borkdudeI see lib-noir uses a different clojure version, ring version etc, so how do these "conflicts" resolve?
04:38borkdudeI mostly copied these settings from a luminus project btw
04:58kralnamaste
05:01sirupI keep getting an error about "Can't dynamically bind var: clojure.core/slurp" when I attempt to stub slurp with clojure.contrib.mock. Code + error here: https://gist.github.com/Sirupsen/71924dee7ce92dbcf98a
05:10siruphmm.. seems to work when I directly depend on org.clojars.echo/test.mock "0.1.2" instead of clojure.contrib and include echo.test.mock
07:29bosiehow would i test if a function is lazy
07:30bosieif the operation itself (to retrieve an element) is highly expensive
07:47ucbbosie: I'm curious as to why you need to check this?
07:47bosieucb: so i know its lazy
07:47bosie;)
07:47marvin2Hi, I've clobbered up a namespace and have made a symbol point to a non-standard value; is there any way to get the original binding back?
07:47ucband what would you do with that knowledge afterwards? I guess I'm saying I'm interested in what you would do with this knowledge
07:48bosieucb: i would use it accordingly. if i didn't know if map was lazy or not, i would use map very differently
07:49ucbhmm
07:49bosieucb: since there are plenty of use cases with my function that dont require to realize the entire list
07:49ucbI'm wondering in what cases knowing whether an fn is lazy or not matters much
07:49bosieucb: it returns a list though
07:50bosieso i would use it like (map #() (my-expensive-function [1 2 3]))
07:50magnars_ucb: I guess if map was not lazy, you would be more careful about using `take` first.
07:51clgv&(apropos "lazy")
07:51lazybotjava.lang.RuntimeException: Unable to resolve symbol: apropos in this context
07:51ucbmagnars_: indeed; I'm trouble figuring out why you shouldn't have all things being lazy to begin with
07:51ucband then ... well, not bother about it
07:51bosieucb: right but i dont know if my implementation is lazy or not
07:52ucbbosie: so, I'd say that it is if it's a combination of lazy fns
07:52clgvbosie: you can test the return value of a function if it is a clojure.lang.LazySeq via instance?
07:53bosiehm
07:53bosiek
07:54clgv&(instance? clojure.lang.LazySeq (map inc (range)))
07:54lazybot⇒ true
07:55bosiethank you, will try
08:18squidzim trying to use dommy which is like hiccup for clojurescript, but am confused how I am supposed render the created html. This may be javascript specific, but if anybody could guide me, id be thankful
08:32SonderbladeWorkwhy doesnt this work? (map #({:x %}) [1 2 3])
08:35Anderken1SonderbladeWork: because #({:x %}) means (fn [v] ({:x v})) - you're calling the map
08:44clgvSonderbladeWork: use #(hash-map :x %) instead
08:44clgv&(map #(hash-map :x %) [1 2 3])
08:44lazybot⇒ ({:x 1} {:x 2} {:x 3})
08:45SonderbladeWorkclgv: thanks
08:57MikeSethfor defrecord, is the recommended naming convention CamelCase or something else?
08:59augustlMikeSeth: CamelCase, yeah
09:00MikeSeththanks
09:39jtoyhi all
09:51squidzwhats are the best libs to use If I want to create a single-page-application in clojure?
10:00g4mm4can anyone recommend a mysql library for clojure?
10:00g4mm4clojureQL wasnt updated in a while and throws also some errors when requiring
10:01squidzg4mm4: korma
10:01g4mm4squidz: nice
10:17clgvsquidz: ring+compojure
10:22MikeSethhm, sublime repl keeps hanging
10:33squidzMikeSeth: use emacs
10:34clgvMikeSeth: I think the most supported environments are emacs, vim clojure and eclipse/counterclockwise
10:34MikeSethyeah, I know
10:34MikeSethemestee@terminata:~$ wc -l .emacs
10:34MikeSeth145 .emacs
10:34MikeSeth:P
10:35clgvhumm got only 122, might be because I only use it for sbcl atm ;)
10:36llambdastuartsierra: is this totally evil and bad? --> https://www.refheap.com/paste/12919
10:36llambdaarrdem: ^
10:37clgvllambda: depends what guarantees you want...
10:37yogsotothHi all. I'd like to take a look at clojure by building a minimal application I'll host on heroku. Is there a standard/recommended way of doing this ?
10:40llambdaclgv: okay, so kind of evil? :)
10:40clgvllambda: there are also macros that do a similar aliasing of vars from different namespaces
10:41clgvllambda: midje used something like that (at least until 1.4)
10:42llambdaclgv: originally i was going to use a macro, but it didn't seem necessary
10:42clgvllambda: you only need a macro for that task if you want to specify the variable names you want to alias.
10:43clgvllambda: e.g. (alias my.ns var1 var2 ...)
10:44stuartsierrallambda: yes
10:44stuartsierraIt breaks identity of Vars.
10:45clgvstuartsierra: is there something preventing true "reference variables" to be used for API namespaces?
10:46stuartsierraclgv: I don't understand the question.
10:48clgvstuartsierra: I mean code like the one from llambda usually occurs when someone wants to build an API namespace that exposes all functions an external use wants to use. so in this namespace you often just want to build an alias to a function in a nested implementation namespace
10:48clgv*external user
10:48stuartsierraWhy not just have one namespace?
10:50clgvstuartsierra: most likely to separate different concerns
10:50stuartsierraNamespaces are just that, a space for names. If you want the whole API available as one set of names, then it's one namespace.
10:50clgvI mean the implementation of those if you have a small API but larger implementations behind it
10:51clgvstuartsierra: I noticed that for example midje did aliasing that way to build "midje.sweet"
10:51llambdaclgv: that's exactly why i'm doing it
10:52stuartsierraI can't comment on Midje, haven't used it much.
10:52llambdait seems like i'm "doing it wrong" tho :)
10:52llambdai'm coming from python, so that's probably why my brain is tainted
10:52clgvIn my projects I did need something like such an alias only once yet. so I cannot argue that much for it.
10:53llambdai'm trying to avoid writing the same set of functions twice
10:53stuartsierraNamespaces are not equivalent to modules in the Python sense.
10:53llambdayeah i'm realizing that more and more, stuartsierra
10:53stuartsierraClojure really doesn't have modules in that sense.
10:53llambdai miss my modules
10:54stuartsierraNamespaces are only there prevent symbols from clashing. Nothing more. How you structure your code is up to you.
10:54llambdastuartsierra: what if i wanted to "import" these http functions from the library i'm wrapping?
10:54stuartsierraDon't.
10:54llambdait's basically just HTTP verbs wrapped around a central "request" function (which i'm redefining)
10:55llambdaso the best practice is to write the same set of functions twice, in this case?
10:55stuartsierraIf you're changing the definitions to be specific to your library, then yes.
10:55llambdatwice in my library, i mean
10:56llambdawell i don't mean twice in the sense, once in their library, once in mine: it will happen twice in my library between the oauth1 and oauth2 namespaces
10:56stuartsierraIf they're the same, then define them in one place and make that namespace part of your public API.
10:56llambdaokay
10:56llambdae.g. if it were a "client" namespace?
10:56llambdathe HTTP functions could live there
10:57llambdaand then the library could be used by requiring the proper oauth namespace and the client namespace
10:57stuartsierrasure
10:57llambdaall right
10:57llambdai can do that
10:57gfrederi1ksI'm having trouble with streaming JSON as a ring response
10:57llambdai just assumed oauth2/get oauth1/post, etc would make for a more user-friendly api
10:58llambdathanks for indulding my incompetence :)
11:00stuartsierraYour users will thank you in the long run if you keep your code as simple as possible and don't play tricks with Vars. :)
11:05llambdastuartsierra: that sounds like sane advice to me :)
11:10gfrederi1ksif I want to stream data into a ring response from another thread I have the issue of handling errors -- having already returned a 200 to the ring adapter, when something goes wrong on the streaming thread I don't know how to turn the response into a 500
11:11pl6306Hello, I am new clojure user. Is this the right place to ask questions on how to use it?
11:12gfrederickspl6306: yes
11:12pl6306I am looking at this function (defn log->list ...) what does "->" mean?
11:13gfredericksit's just a naming convention
11:13gfredericksusually A->B suggests the function converts an A to a B
11:13gfredericks-> is a legal part of the naming syntax
11:13pl6306got it so it just part of a name
11:13gfredericksyep
11:13pl6306Thanks!
11:13gfredericksnp
11:21MikeSethwill require and friends compile the lib on the fly?
11:22gfredericksif they haven't been AOT'd, yes
11:24MikeSethahhh
11:25MikeSethsorry, rtfm'ing
11:30papachanhello
11:30papachani am trying to do an import of my file into REPL
11:30papachanbut i have a ClassNotFoundException com.clojurebook.CustomException java.net.URLClassLoader$1.run (URLClassLoader.java:366)
11:30papachanmy start project is like this
11:30papachanhttp://paste.ubuntu.com/5646655/
11:31Anderken1papachan: you did not add . to the classpath
11:31gfrederickspapachan: your classpath doesn't include the root dir
11:32AnderkentI strongly recommend picking up lein so that you don't have to worry about the classpath
11:32Anderkentthat or mvn, but lein is much easier to get started with
11:34papachanoh yes i use lein and it work
11:35papachanbut i want to import simply my class into REPL
11:35papachanwill try to not include .
11:36papachanok
11:38papachantried: java -cp ./clojure-1.4.0.jar clojure.main -r .
11:38gfredericksyou want -cp .:./clojure-1.4.0.jar
11:41papachanok i uderstance
11:43clgv-cp .:clojure-1.4.0.jar even ;)
11:46AnderkentIs there an idiom for dynamically selecting which namespace to use depending on some state? I'd rather avoid having to use protocols or multimethods, what I have is two namespaces with the same signatures, and one wrapping ns that delegates to one of these : (if (is-live?) (real-ns/do-stuff) (fake-ns/do-stuff))
11:49noidiAnderkent, what you probably want is protocols and polymorphism
11:49TimMcNo, it sounds like situational polymorphism, not data polymorphism.
11:49noidithen you can configure which protocol implementation to use based on the state
11:50Anderkenteh, I was hoping I could use a ns like an object, but guess not.
11:50TimMc(I'm just making up jargon here.)
11:50noidiprotocols are the closest you can get to a first-class namespace in clojure
11:51clgvTimMc: you do that often lately ;)
11:51Anderkentnoidi: yes, but they're too annoying to work with, esp for such uncomplicated problem
11:51MikeSethfor (defrecord Foo) Foo is an internet symbol that is not a var, correct?
11:51MikeSethinterned*
11:52TimMcclgv: It's on account of my getting old and decrepit.
11:52AnderkentI want dependency injection :P
11:52clgvTimMc: had to look up that last word - decrepit ;)
11:53clgvMikeSeth: it'll be a class that defrecord statement generates
11:53papachanthanks it work fine with my classes folder
11:53clgvAnderkent: first-class functions ;)
11:53MikeSethclgv: ah
11:54noidiMikeSeth, interning means creating a var for a symbol
11:54MikeSethclgv: so I need to use import if I want to use it in another namespace?
11:54TimMcnoidi: No it doesn't.
11:54clgvMikeSeth: right. better use the automatically generated constructor function "->Foo"
11:54MikeSethoh, that is new then
11:54noidiTimMc, ok, looking up or creating :) http://clojuredocs.org/clojure_core/1.2.0/clojure.core/intern
11:55clgvclojure 1.4 (or maybe 1.3 already...)
11:55TimMcnoidi: Oh, by "interning" you mean "using clojure.core/intern"? Sure.
11:55MikeSeththanks!
11:55TimMcInterning in general has nothing to do with Clojure.
11:58MikeSethOh, I finally get it
12:02jtoyif I include a namespace that has a method and then do (resolve (read-string "my_fn_from_other_ns")) it returns nil
12:02jtoywhy cant i resolve it?
12:03gfrederickshow did you "include" it?
12:04jtoygfredericks: (use 'interests.enrichments)
12:04TimMc25 cents on Gilardi Scenario
12:05gfredericksI'll take that bet
12:05gfrederickshowever I don't know why it's not working
12:06gfrederickspresumably it's some detail you're not mentioning because it didn't occur to you it might be a problem
12:06TimMcjtoy: Is this in the REPL?
12:06jtoyTimMc: yes
12:07jtoyTimMc: in code I do (:use [interests.enrichments])
12:07jtoyI think I see
12:12TimMcjtoy: The :use is in your ns statement?
12:26gfrederickswould it be reasonable for a lein plugin to hook the 'jar' task and do some git introspection and write a `git-commit.sha` file to /resources?
12:27TimMcSounds good.
12:28TimMcgfredericks: But bonus points if you can create that file in the commit the jar is based on by achieving a hash collision.
12:29gfrederickshuh; leiningen.pom/read-git-head seems to exist
12:29technomancy_gfredericks: you can add :filespecs to project.clj that can have arbitrary bytes or paths
12:29technomancy_see `lein help sample`
12:30gfrederickstechnomancy: I saw that recently; it's not clear to me exactly what that means or how I would use it
12:30technomancyyeah it's not a very good interface
12:30technomancywill be rewritten from scratch for 3.0
12:33Sonderbladehow do you get the first/any item in a map in clojure?
12:33technomancySonderblade: you can't
12:34technomancymaps aren't ordered
12:34technomancyerr--you can't get first; you will get an arbitrary k/v pair using clojure.core/first
12:35hyPiRion,(first (sorted-map 3 :third 1 :second 0 [:first]))
12:35clgvSonderblade: since maps are seqable you can do the following, but there is no guarantee on the order ##(first {:a 1 :b 2})
12:35lazybot⇒ [:a 1]
12:35clojurebot[0 [:first]]
12:35hyPiRionBut I suspect you don't want the sorted-ability. Though it's nice to know about.
12:36Sonderbladei know maps are not ordered i just want any
12:40dnolenSonderblade: first does what you want
12:41kalasjohnny2000&join #devops
12:41lazybotjava.lang.RuntimeException: Unable to resolve symbol: join in this context
12:41kalasjohnny2000sry
12:41hyPiRionheheh
12:43kalasjohnny2000talking about it, what's the most decent way to make a git push and the branch gets into a stage environment?
12:43kalasjohnny2000like heroku does, but on my own server...
12:43kalasjohnny2000I did try with git hooks, but it feels a bit shakey.
12:45kalasjohnny2000is jenkins the way to go?
12:45nDuffkalasjohnny2000: *shrug*. Are you already using any ops-automation tooling?
12:45nDuffkalasjohnny2000: ...if you're already a Pallet, Chef or Puppet shop, then it makes sense to leverage that.
12:45kalasjohnny2000@nDuff pallet would be the most reasonable, yes.
12:46nDuff...then you can push out config changes with the same infrastructure you use for code changes.
12:46kalasjohnny2000that's what I want, yes. What is the best... crate... for this?
12:47pl6306What does "->" mean in (-> "http://nytimes.com" java.net.URL. .openConnection)? I would google it but "->" doesn't produce any good search results.
12:47kalasjohnny2000@pl6306 -> means "take the object coming afterwards and apply all the functions after it"
12:47yacin_,(-> [[1 2] 3 4] first first)
12:48clojurebot1
12:48yacin_,(-> [[1 2] 3 4] first second)
12:48clojurebot2
12:48kalasjohnny2000@pl6306 http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/-%3E
12:48pl6306Thanks!
12:49nDuffkalasjohnny2000: Actually -- not in a great position to tell you, there. My personal experience is mostly with Chef; Pallet looks like 0.8 will finally be fitting the bill re: most of my use cases, but it wasn't quite baked for what I needed in the past.
12:49dnolenpl6306: it's important to note that -> is a macro, it just transforms the syntax
12:50tbatchelli_mkalasjohnny2000: you can always drop by #pallet and ask
12:51kalasjohnny2000thank you both of you, @nDuff and @tbatchelli_m :)
13:05borkdudeIs there a name for apps built with ring, compojure, lib-noir and hiccup? I suggest: Hiricono apps. Say yes to Hiricono! Or Ricono if you don't use hiccup.
13:09borkdudelol, I just made this up while biking home, sorry
13:09jeremyheilerlol nice
13:10ejacksonbokdude: or orinoco
13:11borkdudeejackson nice
13:13borkdudemaybe Luminus should be renamed to Orinoco, I wouldn't mind ;)
13:13borkdudeunless there is some nice reasoning behind "Luminus"
13:51gfrederickstechnomancy: using the private leiningen.pom/read-git-head for getting the commit is a bad idea?
13:51technomancygfredericks: the jar contains the pom with the tag; can you just get it from there?
13:53gfredericksfrom META-INF/maven/group/artifact/pom.xml?
13:54technomancysure
13:54technomancyalso pom.properties if you don't feel like busting out a parser
13:54gfredericksyou correctly guessed whether or not I felt like busting out a parser!
13:55technomancyI suspect you'd much rather bust out some sick rhymes about XML.
13:56gfredericksthough to be fair, I probably would have just used a regex. I wonder how many problems I would hava had at that point.
13:56TimMc7
13:58SegFaultAXtechnomancy: That's awesome.
13:58gfrederickstechnomancy: so it'd be hard to write a general lib for reading this due to having to know the group/artifact to get the path, eh?
14:00technomancy(be sure to visit http://nedroid.com for more lulz)
14:00TimMcNedroid has quite a few of the lulz.
14:00technomancygfredericks: well every lein-produced jar will have a pom.properties on the classpath, yeah
14:03jcromartie*phew* I just solved my JSON dilemma
14:04jcromartiecreate my.project.json namespace with encode and decode functions that wrap whatever lib I decide to use tomorrow :)
14:05dakrone_jcromartie: yes, that is always a good idea
14:05jcromartieI think clojure.data.json has the best API, honestly… the :key-fn and :value-fn are just about the simplest solution possible
14:05jcromartieno multimethods, or installing handlers, or maps of types to functions
14:05jcromartiefunctions!
14:05jcromartiewhat a concept ;)
14:26patbrownDoes anyone know the significance of #_(function)? For instance in the pedestal.io user.clj file found here https://github.com/pedestal/pedestal/blob/master/service-template/src/leiningen/new/pedestal_service/user.clj
14:26patbrownMore specifically, what's the underscore for?
14:26arkxIt's a comment
14:26tbaldridgeThe reader drops whatever is next
14:26SegFaultAXpatbrown: It comments out the next form.
14:26Anderkentpatbrown: #_ is a reader macro that ignores the next form
14:27TimMc,[1 #_ 2 3]
14:27clojurebot[1 3]
14:27TimMcpatbrown: ^
14:27tbaldridgecompare to:
14:28SegFaultAXpatbrown: http://clojure.org/reader
14:28tbaldridge,[1 (comment 2) 3]
14:28clojurebot[1 nil 3]
14:28patbrownSo, the only reason to use it in this instance is for terseness?
14:28TimMcpatbrown: No, the point is that those are different.
14:28TimMc[1 nil 3] is not [1 3]
14:29patbrownOh, so you use it, so you don't return a nil?
14:29tbaldridgepatbrown: in your example from pedestal, the function now returns the result of the call to in-ns, instead of just returning null
14:29tbaldridge*nil
14:29SegFaultAXpatbrown: No. You use it when you want to comment out a form.
14:29SegFaultAX,(+ 1 #_ 2 3)
14:29clojurebot4
14:30TimMcIt's pretty rare to see anyone use the comment macro.
14:30SegFaultAX,(+ 1 (comment 2) 3)
14:30clojurebot#<NullPointerException java.lang.NullPointerException>
14:30tbaldridgeexcept for Rich :-P
14:30TimMcWhat you'll sometimes see is this:
14:30SegFaultAXpatbrown: Note that when the first of those forms is evaluated, it's like the 2 isn't even there.
14:30TimMc,[1 #_(comment 2 3 4 5) 6]
14:30clojurebot[1 6]
14:31TimMc(since #_ only takes out one form)
14:31TimMc.[1 #_2 #_3 #_4 #_5 6] is more annoying to type
14:31TimMc,[1 #_2 #_3 #_4 #_5 6] that is
14:31clojurebot[1 6]
14:31SegFaultAXTimMc: Although that gives me some fun ideas for code obfuscation :)
14:32SegFaultAXMake it as hard as possible to determine which forms are actually evaluated.
14:32TimMcSegFaultAX: #_ can also stack, if you want obfuscation.
14:32TimMc,[1 #_#_#_#_ 2 3 4 5 6]
14:32clojurebot[1 6]
14:33SegFaultAXWow, I didn't know that.
14:33Glenjaminhi guys, is there a common idiom to take an input stream and read it into a byte array?
14:33TimMcand it does weird things to anon fn args
14:33patbrownI just read the definition in the linked reader page. I'm still a little lost as to the practical usage of it. I stumbled across this because I'm working on conditioning my repl for cljs development. Is there any reason why in pedestal they load up a dev namespace instead of using a function to load code into the user namespace?
14:34SegFaultAXpatbrown: In the case of the code you linked, they probably did it that way because you don't need to actually refer to anything inside the dev namespace.
14:35SegFaultAXIt's purely for testing or development or whatever.
14:35SegFaultAXpatbrown: That form is commented out because they don't want to call dev/start when that dev function is run.
14:36patbrownWhy put it in there at all then?
14:36tbaldridgemaybe because it's alpha code?
14:37patbrownJust like with the clojurescript one project, the boys at relevance do things way differently than I see anyone else do them.
14:37SegFaultAXThat code is still highly active.
14:37patbrownMy questions have been answered, thanks. Reader macros are an interesting part of clojure I've yet to explore.
14:38technomancyI put in comments to do things like launching a dev jetty into production code
14:39TimMcpatbrown: If you use #_ instead of ;; you can provide (well-formed) code samples in a way that your editor will syntax-highlight them. :-)
14:39patbrownThat's the rub I gather.
14:39SegFaultAXI find ;; to be mostly useless.
14:40TimMcIt's also a way to comment out a multiple-line expression.
14:40hyPiRion,(let [a 10] (inc a) #_=> 11) ;)
14:40clojurebot11
14:40patbrownIt just looks better and it doesn't return nil, still giving you proper repl feedback
14:41TimMchyPiRion: Awful/
14:41TimMc,(let [a 10] (inc a) #_=> 'eleventy) :-(
14:41clojureboteleventy
14:41SegFaultAXI prefer "threeve"
14:42jro_when I run lein repl, I get an error: No such var: user/help, compiling:(NO_SOURCE_PATH:1:12391)
14:42TimMcjro_: Does that happen in just one project?
14:43jro_TimMc, yes, if I don't have project.clj, the error disappears
14:44TimMcjro_: But does it happen in multiple projects?
14:44SegFaultAXIs anyone here using Immutant?
14:45TimMcProbably.
14:45SegFaultAXTimMc: Are you?
14:45patbrownIn addition, I'm using piggieback for a cljs browser repl, however when I compile, my "out/goog" directory always goes in the root of my project, instead of "resources/public/js/out/goog" Does anyone know how to set the output folder? Note: my "out/cljs" and "out/clojure" are outputted under the "public/js" path.
14:46jro_I've currently just one checked out. Well, if it is just (user/help), then there is no problem.
14:46TimMcSegFaultAX: No, then I would have said "I am". :-)
14:46SegFaultAXTimMc: Maybe you were just being coy. ;)
14:46TimMcI don't know what Immutant is. Some kind of webby thing?
14:47SegFaultAXYea, it's a Clojure wrapper for JBoss AS 7
14:47squidzSegFaultAX: why is it useful?
14:47SegFaultAXBasically, torquebox for clojure (if you know what that is)
14:47TimMcI don't know what JBoss or torquebox is either. :-P
14:48SegFaultAXsquidz: JBoss AS 7 or Immutant?
14:48TimMcAh, from Wikipedia I gather that it is a beany webby thing.
14:48SegFaultAXTimMc: Yea, one of themz.
14:49SegFaultAXIt brings together a bunch of really useful stuff all in one coherent package: hornetq, infinispan, automatic clustering, distributed transactions, etc.
14:50SegFaultAXFrom an architectural perspective it seems very attractive to have all of that already available in your stack as opposed to hacking together a bunch of disparate components (zeromq, redis, etc.)
14:50squidzis it worth it to integrate all that stuff into a clojure app? or wouldnt using individual packages like clojurewerkz provides?
14:51squidzbe just as good
14:52jcrossley3SegFaultAX: i'm one of the immutant developers. wassup?
14:52SegFaultAXsquidz: I guess it depends on the project. I haven't used Immutant yet, but if I had to venture a guess I'd say because someone else has already taken the time to make sure everything is functional and well integrated.
14:52SegFaultAXjcrossley3: I know, I've seen all your talks! Great work by the way. :)
14:52borkdudegfredericks about the version from pom.properties: https://github.com/trptcolin/versioneer/blob/master/src/trptcolin/versioneer/core.clj
14:52jcrossley3SegFaultAX: thanks :)
14:53squidzSegFaultAX: ah right, so Immutant already did all the work to wrap everything in clojure
14:53SegFaultAXjcrossley3: What is unclear to me is the actual deployment aspect of Immutant. Eg, I have 5 fresh EC2 nodes, how do I bootstrap immutant on them and deploy new versions across them?
14:53SegFaultAXjcrossley3: And how do I do things like rolling deploys, etc.
14:53jcrossley3squidz: some folks like to grow their stack organically. some don't. plenty of ways to shave a yak. :)
14:53SegFaultAXjcrossley3: It seems like most of your talks and the documentation are geared toward the development phase and not so much on actually running in production.
14:54SegFaultAXsquidz: Plus JBoss AS7 which is awesome all by itself.
14:54SegFaultAXsquidz: If you're interested, checkout out jcrossley3 on InfoQ
14:54SegFaultAXsquidz: Search for "immutant" or Jim Crossley
14:54squidzill take a look thanks
14:55jcrossley3SegFaultAX: that is true regarding dev vs prod. the former has been our emphasis up to this point. hoping to focus more on prod during beta cycle.
14:56jcromartiewell that was easy
14:56jcromartie(-> (ScriptEngineManager.) (.getEngineByName "JavaScript") (.eval "print(\"Hello\");"))
14:56SegFaultAXjcrossley3: Unfortunately I need that piece before I feel like it's worth spending the time cozying up to Immutant. Do you have any idea when more information will be available? Or do you have tips for getting started now?
14:56jcromartieapparently Java 6 comes with Rhino now?
14:56jcrossley3SegFaultAX: ec2 is rough due to lack of multicast. we're in the process of getting autoscaling to work on openshift, which is backed by ec2. once we figure that out, we'll publish that config to other native ec2 users who'd prefer not to use openshift.
14:57SegFaultAXjcrossley3: I'm not tied to EC2 per se. What do you recommend?
14:57SegFaultAXjcrossley3: (And is there documentation for production usage on it?)
14:58jcromartie(as of 2006 ...)
15:00jcrossley3SegFaultAX: folks running it production now are using homegrown solutions, e.g. scp/rsync of immutant archives. so the story is muddy at the moment.
15:00jcrossley3it's on our list :)
15:01SegFaultAXjcrossley3: <3 I'll keep watching closely, then. Is Immutant one of your teams top projects atm?
15:02jcrossley3SegFaultAX: it's the primary focus of two of our team members. :)
15:07tcrawleySegFaultAX: you're welcome to join us in #immutant as well - it has a higher percentage of Immutant users compared to here
15:24Raynesgfredericks: You work at groupon?
15:25borkdudewhat is the typical way of deploying a ring webapp? uberjar, run with lein server, war?
15:30borkdudemaybe I should try immutant?
15:30amalloyborkdude: all of those are things that people do, yes
15:30amalloyin fact i myself have done all of them
15:30RaynesI prefer using lein ring, but uberjars and wars are fine.
15:30RaynesBut the way amalloy and I run our open source stuff tends to be pretty ghetto, so might not want to listen to us.
15:31borkdudeamalloy I actually have two simple ring apps I want to host, I don't want to configure a web server, so invoking an embedded jetty is very convenient
15:31amalloyso don't do it
15:32Raynesamalloy: But then he'll have to actually configure jetty. He needs a web server behind jetty to reverse proxy it otherwise.
15:32RaynesNo matter what he has to configure a web server.
15:32amalloyor just...run it on the right port from lein run
15:32weavejesterEmbedded Jetty behind an nginx stack would be my personal preference
15:32RaynesThat's what we do.
15:33Raynesnginx is easy to configure for a simple proxy to a jetty server.
15:33borkdudeRaynes I have nginx running, it forwards to 8080 for one app, I can let it forward to 8081 for the second app etc
15:33Apage43I was doing a separate jetty and scp'ing wars around for a while
15:34Apage43but that required making sure I did all my setup and teardown cleanly
15:34weavejesterI tend to use "lein ring uberjar" rather than "lein run". It's easier to deploy.
15:34Apage43just killing the thing was less to worry about
15:34borkdudeweavejester what's the difference between lein ring uberjar and lein uberjar?
15:34Apage43actually I'm using lein ring uberjar. I'm a bit confused =P
15:35Apage43But yeah, I didn't actually want to install lein on the prod webserver box
15:35Apage43just java
15:35Apage43so I can java -jar the thing
15:35weavejesterborkdude: The former automatically adds a main method that calls the handler, integrates :init and :destroy, and adds a manifest to make the jar executable.
15:35Apage43borkdude: ring uberjar gives you a java -jar'able jar that runs the thing
15:35borkdudeweavejester this is just what I need tnx
15:48lsoaI'm trying to read and parse a json file using clojure.data.json
15:49lsoaI'm getting an error, presumably because there's some invalid json in there
15:49lsoaException JSON error (unexpected character): clojure.data.json/-read (json.clj:222
15:49lsoais there a way to get the like that triggered that error?
15:50lsoaline*
15:53MikeSethidiomatic way to replace elements m to n in a vector with another value?
15:56arohnerMikeSeth: (vector (concat (take m v) new-vals (drop n v))
15:56arohnermaybe off-by-ones in there
15:56MikeSeththanks, pondering
15:56bbloomarohner: you want vec, not vector
15:57bbloom,(vector (range 5))
15:57clojurebot[(0 1 2 3 4)]
15:57bbloom,(vec (range 5))
15:57clojurebot[0 1 2 3 4]
15:57arohnerbbloom: thanks, I always get those mixed up
15:57pjstadigif you know it's a vector you might just use assoc over the range of m to n with reduce or something
15:57pjstadiginstead of going to a seq and back to a vector again
15:58bbloomarohner: here's a mnemonic: vector is longer than vec, and [(foo)] is longer than [foo]
15:58bbloompjstadig: that assumes the resulting length doesn't change
15:58arohnerbbloom: meh. it's only a problem when doing IRC-based development
15:59bbloomarohner: what? you bothered to install lein? i do all my coding in lazybot
15:59arohner:-)
16:00rkneufeldpatbrown: Hey, was your question about the dev namespace fully answered? I can provide further detail if you'd like
16:08borkdudeMikeSeth https://www.refheap.com/paste/12926 <- my attempt
16:12patbrownRyan, my man! Yeah, the use of the reader macro was well explained. Pedestal is a lot like cljs one. There is so much to it, it's hard to know where to start asking questions.
16:14rkneufeldHey! I thought it might be you. Anyways, we load things through the dev function on account of some nastyness with user code. If there are any problems in your user code, it stops a REPL from opening whatsoever. We didn't have enough time to fully iron out the details in our dev code and opted to go the same route and keep the (dev) security blanket.
16:20patbrownrkneufeld: I've been playing around with the app and app-tools portion of pedestal. I really like the approach to handling state without atoms. What's your role been in the project?
16:21rkneufeldpatbrown: I've spent most of my time in app as well. Taking on the role of community manager for the time being as well.
16:22borkdudehow to change the portnr for the jetty instance, just PORT=xxxx java -jar bla?
16:24nDuffrkneufeld: ...ahh -- you're with Relevance? If you don't mind the asking -- do y'all have any intent to maintain Avout?
16:25rkneufeldnDuff: I believe that one is totally in the hands of David Liebke. He is no longer with Relevance.
16:25nDuffAhh.
16:25nDuffSaw y'all on the copyright statement and assumed it was still a Relevance-sponsored project.
16:26rkneufeldNo worries, doesn't hurt to ask.
16:28borkdudeI'm editing a remote file with emacs… it works...
16:41stuartsierraAs far as I know, no one is currently maintaining Avout.
16:42bbloomBummer, since it's far more pleasant of an API than ZooKeeper... *cringe*
16:44stuartsierraZooKeeper's not that bad.
16:45bbloomI found Netflix's ZooKeeper to be much more useful (and reminiscent of Google's internal Chubby API)
16:46bblooms/useful/usable/
16:46bbloomzookeepers API is just kinda... raw
16:46bbloomer i mean Netflix's Curaitor
16:46bbloomthats the word i wanted
17:18thm_proverI'm writing a graphical REPL.
17:18thm_proverWhat is the right way to connect to the REPL / handle long computations?
17:19llasram`thm_prover: https://github.com/clojure/tools.nrepl
17:20thm_proverllasram`: the word interrupt appears twice on that page, claiming nREPL has interrupt support. do you know ho the interrupt suppor towrks?
17:21thm_proverhttps://github.com/clojure/tools.nrepl/blob/master/doc/ops.md loks like what I want
17:24llasramthm_prover: I actually right now don't know much about nrepl outside of the basic architecture
17:25thm_proverllasram: thanks for the pointer; building on nREPL looks like a better solution than throwing together my own adhoc solution
17:27technomancyyou get a lot of useful stuff for free if you build on the nrepl stack
17:54ppppaulanyone here using clojure and beanstalk, also how do you feel about it if you are?
17:56nDuffppppaul: You mean Amazon's, or a different beanstalk?
17:59ppppaulaws
18:02ppppauli'm wondering about people's experiences using it with clojure. i have no prior experience with beanstalk
18:03jeremyheilerppppaul: We use it to deploy headless Clojure webapps and it seems to work well. (I wasn't the one who set it up.)
18:06ppppauljeremyheiler, can you give me more information as to how you use it? do you deploy via git or war or via lein-beanstalk? does it help you with staging and development environments too?
18:08kursionHi there, i'm new in Clojure's world :)
18:09auserhey hey kursion
18:11kursionHey auser :)
18:11ppppauli'm also a user
18:14jeremyheilerppppaul: We deploy WAR files. For environemnts, we built a little webapp that manages the environments and allows us to click a button to deploy.
18:15ppppaulinteresting
18:15ppppaulthanks
18:16jeremyheilerppppaul: np
18:17auserjeremyheiler: is that open-source?
18:17auserthat's sexy
18:17squidzi'm getting a lot - Use of undeclared Var - errors while trying to import domina in my namespace. Does anybody else use Domina know what im talking about?
18:17jeremyheilerauser: Unfortunately no.
18:18auserI bet it'd be rad if it was
18:18jeremyheilerauser: I would be, but it's not a high priority at the moment.
18:18jeremyheilerIt*
18:18ausergotcha
18:24jimkcardoes `lein repl` execute the defined -main function?
18:24gfredericksno
18:25jimkcarI have code with a database connection that throws errors when I lein repl without the database being there. I can't figure out how it is running.
18:25jimkcarwhat about macros?
18:26nDuffjimkcar: Could this code be getting executed as part of evaluating the namespace?
18:26nDuffjimkcar: if you do a (def connection (connect-to-the-database)) at top level somewhere, that would do it.
18:26jimkcaryeah I assume so, but I can't find where its happening
18:26nDuffjimkcar: (in which case, you might consider (def connection (delay connect-to-the-database))
18:27jimkcarwhat about a defmacro .... ~(connect-to-database)
18:27nDuffjimkcar: Can you post your code? (refheap is a local favorite, if you don't have a preferred ad-free pastebin already)
18:27nDuffjimkcar: macros just rewrite your code; they don't change when the rewritten code is run.
18:27jimkcarok.
18:27jimkcarlet me scan again, and pastebin
18:29nDuff...if you can include a stack trace from a failure alongside said code, that would be helpful too.
18:30gfrederickshow does one restart the nrepl session, other than restarting emacs and nrepl-jack-in again?
18:31nDuff...but I'm sure there's an easier way.
18:32kursionIs sublimetext a good editor for clojure guys ?
18:33technomancyit's not OSS
18:33technomancyso the tooling around it is not very good from what I gather
18:33technomancygfredericks: there's an nrepl-restart command
18:33amalloygfredericks: i think there's nrepl-restart or something
18:34amalloywell, that's my helpful advice for the day
18:35gfrederickstechnomancy: amalloy: thank you both equally
18:35kursionOk technomancy
18:35kursionTy
18:36technomancynormally I say "go with what you already know" but if you don't know any OSS editors then that's different
18:37kursionI find it very light and handy + lots of plugins, better than npp
18:37amalloycan we call the process of open-sourcing a previously closed-source app "ossifying"?
18:37technomancyinc by me
18:37kursion:D
18:38kursion(Going to sleep a bit, cya tomorrow)
18:38nDuffkursion: There are a few things pretty much critical -- paredit and nrepl support
18:39nDuffkursion: I wouldn't seriously consider anything without solid implementations of both.
18:39kursionNrepl = terminal +bash
18:39nDuffNot at all.
18:39kursionWhat are your editors .?
18:40amalloythose things are important eventually, but if you're just playing around with the language any text editor is fine
18:40nDuffHaving editor nrepl support means your editor knows what's in your namespaces
18:40kursionHum you mean like the eclipse plugin... ?
18:40nDuff...so it can autocomplete functions no matter what library they're from, it can retrieve documentation straight from the live Clojure instance, it can directly run your code...
18:41nDuffkursion: the best implementation of all these things is emacs. That said, the Eclipse plugin is working on it, and may eventually become passable.
18:41kursionYeah the only IDE that support clojure is eclipse and the plugins
18:41nDuffkursion: Keep in mind that emacs has been editing LISPs for decades. Its tools in the area are very, very good.
18:42nDuffkursion: What definition of "IDE" do you use wherein Emacs doesn't qualify?
18:42kursionEmacs is alive ? Interresting .... :)
18:42technomancynDuff: everyone knows IDE is short for "editor that's good at Java"
18:42nDuff:)
18:43kursionAutocomplete + intelli at least, then snippets
18:43technomancysnippets are for languages that don't have macros
18:44kursionTrue point
18:44nDuffemacs very much has autocomplete, and that autocomplete is nrepl-assisted
18:44nDuffand, as technomancy says, snippets are moot in Clojure.
18:44nDuff...If you need them, you're Doing It Wrong.
18:44technomancyyeah, vim has autocomplete too
18:44nDuff(though yes, of course, they do exist for emacs, if you need them)
18:45technomancydnolen: yes, but only because you don't have access to macros that early in the file
18:45hyPiRionsnippets are usually for `lein new` to handle
18:45nDuffkursion: Take a look at the intro video for Emacs Live
18:45__zerowhat's paraedit and nrepl?
18:45technomancythe ns macro is not very egalitarian
18:46kursionGonna redownload emacs to see this , has i said i started clojure today
18:46dnolentechnomancy: I actually have a couple other snippets that come in handy, but it's true I do rely on them less than when I code in say JS.
18:47nDuffkursion: http://vimeo.com/22798433
18:47kursionTy for your advices nDuff. I appreciated this little talk :)
18:47hiredmanclojurescript is just a very complicated set of javascript snippets dnolen has
18:47technomancyhaha
18:47kursionOk bookmarked for tomorrow :)
18:47dnolenhehe
18:48nDuff__zero: paredit is a mode specialized for editing LISPs; basically, it makes the editor structurally aware.
18:48ivan~paredit
18:48clojurebotparedit is not for everyone, but what you need to understand ís how to become the kind of person that paredit ís for.
18:49technomancy~botsnack
18:49clojurebotthanks; that was delicious. (nom nom nom)
18:50nDuff__zero: ...and nrepl is a protocol and set of tooling for, well, networked REPLs -- with support for adding things like session support, debugging operations, and other extensions via middleware.
18:52technomancy,(update-in {} [] assoc :hello "world")
18:52clojurebot{nil {:hello "world"}}
18:53technomancy^ is that surprising to anyone else?
18:53amalloynot anymore
18:53pjstadigit has a logic to it
18:53pjstadigseems like maybe a bug though
18:54technomancyamalloy: because you're paying attention to Leiningen bug reports?
18:54amalloytechnomancy: because i've known about it for years?
18:54technomancyor that
18:54hyPiRionhow does that make sense, really?
18:55amalloyi doubt it will ever change; i just use my own update-in* when i care about the behavior for an empty keyseq
18:55pjstadigamalloy: :(
18:55hyPiRion,(= (update-in {} [] assoc :a :b) (update-in {} [nil] assoc :a :b))
18:55clojurebottrue
18:55amalloyhyPiRion: the contract (perhaps implicit) of update-in is that you give it a non-empty keyseq; if you give it an empty keyseq, any behavior makes sense
18:56pjstadig,(doc update-in)
18:56clojurebot"([m [k & ks] f & args]); 'Updates' a value in a nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. If any levels do not exist, hash-maps will be created."
18:56amalloywhether that's a good contract i don't want to argue about, but that's the way in which it makes sense
18:56pjstadignot sure that's implicit
18:56pjstadig[k & ks]
18:56technomancyhyPiRion: when you put it that way it's gotta be a bug
18:56technomancypossibly a documentation bug
18:56technomancybut a bug
18:57technomancyoh; hrm. didn't consider :arglists as part of the doc.
18:57technomancyso anyway, it's silly but not worth the trek to jira.
18:57hyPiRiontechnomancy: well, the signature is [k & ks], where ks is a seq only. k has to be something
18:58technomancyyeah, I'll buy that
18:58technomancydon't have to like it though
18:59hyPiRionWell, I think it should throw some Arity Exception if it follows that contract.
18:59hyPiRionIt would be better to have it accept [] though.
18:59technomancyclojure isn't really well-known for validating inputs to functions
18:59technomancy*ahem* contains?
18:59Apage43it accepts it, it just doesn't do something particularly helpful
18:59hyPiRionwell, that doesn't mean we can better on doing that
19:00technomancyhyPiRion: depends how you define "we" =)
19:00hyPiRionwell, that was one interesting sentence I made.
19:00hyPiRiontechnomancy: Clojure contributors :)
19:02amalloytechnomancy: doesn't contains? throw an exception as of 1.5?
19:02technomancywhoa seriously?
19:02hyPiRionhuh, I only thought its docstring changed.
19:02technomancyholy smokes
19:03hyPiRion,(contains? [1 2 3] :hrrng)
19:03clojurebotfalse
19:03technomancyI thought that was a line drawn in the sand
19:03amalloy,*clojure-version*
19:03clojurebot{:major 1, :minor 5, :incremental 0, :qualifier "RC6"}
19:03amalloy,(contains? :a :b)
19:03clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: contains? not supported on type: clojure.lang.Keyword>
19:04amalloy&(contains? :a :b)
19:04lazybot⇒ false
19:04hyPiRionTo be fair, I was more surprised by the fact that it didn't throw there.
19:13arrdemanyone here used the Lexington lexer before?
19:27rationalrevoltwould someone mind looking at a sudoku code at: https://gist.github.com/rationalrevolt/4564280 , and help me understand why (gen-random-board) never completes but (solve test-hard-board) completes? I tried putting prints on the solved? function, and it seems to keep looping even after the board is solved when i run (gen-random-board)
19:28jimkcarnDuff: I figured it out.
19:29jimkcarnDuff: it was a dependency doing it to me.
19:29jimkcarwhen I require this project, it spews log messages. https://github.com/liebke/zookeeper-clj
19:40Apage43rationalrevolt: at first glance it looks like it's not going to short-circuit once it finds -a- solution, but could potentially generate a lot of solutions before it finally unwinds and discards most of them
19:40Apage43possibly finding many of them multiple times
19:42Apage43mm ,maybe
19:42Apage43depends on the lazy-seq behavior
19:43Apage43rationalrevolt: you could try grabbing a stack trace at that point (throw and catch an exception) to see how far down it is when solved? is returning true
19:43Apage43could be insightful
19:43amalloyyou're just trying to run the same naive search in a much larger probability space when you start from a blank board. you're generating gazillions of unsolvable boards
19:44amalloy(probably. i haven't looked too deeply, but that's one plausible explanation)
19:45rationalrevolthmm, in the solved? function, i tried adding a print of the return value - and it prints true multiple times - that should mean it should break out of the solve function
19:46rationalrevolti know shuffle is not lazy, but cant imagine why that will cause an infinite loop - if i remove the shuffle and start with a blank board - it completes very quickly
19:46Apage43you may be being bitten by chunked seqs
19:47nDuff...if that's the case, the number of times it continues will be bounded at the chunk size, so it's easy to look for.
19:48rationalrevoltI'm positive the shuffle is causing this behavior, because solving an empty board completes immediately
19:48rationalrevoltwithout the shuffle i mean
19:49Apage43what's probably happening is that the un-shuffled prospective boards all short-circuit to unsolveable very quickly
19:49Apage43where is with the shuffle it is actually going down a lot of solveable paths (due to chunked seqs)
19:49Apage43*wheras
19:49Apage43*whereas
19:51Apage43rationalrevolt: try wrapping your (for …) in one of the seq1's defined in the answer here: http://stackoverflow.com/questions/10556421/is-for-not-actually-lazy-in-clojure
19:51Apage43if that fixes it, then it is due to chunked seqs
19:53jimkcarnDuff: did you see what my problem was? I'd be interested to know if others see it too
19:55jimkcarif you create a new lein project, add [zookeeper "0.91.0"] as a dependency, lein repl, then (require '[zookeeper :as zk]) log4j messages will spew
19:55jimkcar0.9.1 rather
19:56rationalrevoltApage43: I have a feeling you may be right, will check
20:02rationalrevoltApage43: You were right. If i made the result of shuffle a lazy seq, it completes as expected.
20:02nDuffjimkcar: Sounds like a topic for a zookeeper-clj ticket. I wonder, by the way, if 0.9.1 is before https://github.com/liebke/zookeeper-clj/commit/70ad3eaf010d74d821ade7f09a878850b88e4af5
20:02Apage43interesting
20:02nDuffjimkcar: ...could also be a side effect of interacting with java-logging
20:03Apage43i guess that stops for from chunking
20:03rationalrevoltlooks like it
20:05jimkcarnDuff: I've been looking through the code and don't see anywhere that would do this. If it was a side-effect of java logging, there still has to be some zk code being run to print out all the logging.
20:05jimkcarI'll submit a bug to them.
20:05nDuffjimkcar: Well, what's the namespace on the log messages?
20:05jimkcarzookeeper.ZooKeeper
20:07nDuffIt's also possible for Zookeeper itself to be responsible.
20:09nDuff...static class initialization can happen pretty early.
20:09jimkcaryeah, they have a default console log at INFO level. I wonder if they have some log call in a static block somewhere.
20:09jimkcarugh
20:10jimkcarI can't seem to find the log4j.properties that it uses. Probably have one hidden on my classpath somewhere...
20:14jimkcaryep. right in the static block: https://github.com/apache/zookeeper/blob/trunk/src/java/main/org/apache/zookeeper/ZooKeeper.java
20:28dnolenSimply Typed Lambda Calculus in core.logic part II http://swannodette.github.com/2013/03/25/stlc-redux---part-ii/
20:28dnolentrying to move a bit slower than Nada's talk at Clojure/West
20:31bbloomdnolen: i see you moved your blog.... my blog has been somewhat stalled by my incomplete migration to a static site generator as well....
20:33dnolenbbloom: yeah
20:33tieTYTprotocols dispatch on type, right? Does that mean they're only useful when you get java classes as input?
20:33technomancytieTYT: unless you use records, but yeah... don't use protocols unless you have to.
20:34tieTYTok I haven't learned records yet, I should look that up
20:34technomancynah
20:34bbloomtechnomancy: well, i mean, records are just java types, right?
20:34tieTYTnah?
20:35technomancytieTYT: don't bother unless you're writing performance-critical polymorphic code
20:35technomancywhich is pretty rare
20:35bbloomtieTYT: what technomancy means is this: many new clojure programmers come from OOP & therefore use a lot of types and records
20:35tieTYTdon't bother with records or with prototypes?
20:35Bronsaprotocols*
20:35technomancybbloom: *hand wavy dismissal to avoid confusion around advanced topics*
20:35tieTYTBronsa: right
20:35bbloomtieTYT: types and records are often useful, but they are most often misused. so if you are new to clojure, avoid protocols, defrecord, deftype, etc
20:36tieTYTi'm writing a program that dispatches based off of the domain of a url. I used multimethods for this because it didn't seem like I could use a protocol when the inputs are all strings/urls
20:36nDufftieTYT: multimethods are indeed the right tool for that job
20:36tieTYTi need to dispatch on the value, not the type
20:36tieTYTnDuff: good to hear, thanks
20:36technomancywhether that's suitable for multimethods is debatable, but it's definitely not for protocols
20:36technomancyit's likely you don't need polymorphism at all
20:38tieTYTwell i suppose I could use a map of <string, function>
20:38tieTYTbut multimethods seemed cleaner in my newbie mind
20:38tieTYTalso seems to point out, "I'm dispatching on this"
20:39nDufftieTYT: if a map has functions on the RHS, it's typically pretty clear that it's involved in dispatch. :)
20:40tieTYTi suppose that's true
20:50Frozenlo`Well well well... I finally made a breakthrough. It seems Googlebot is having a hard time with wrap-force-ssl. Can anyone concur?
20:55jcromartieis there any reason not to create a uuid for an item before inserting it in a persistent store?
20:56ivanFrozenlo`: you may be able to get some insight by forcing Googlebot to hit your site with webmaster tools and capturing traffic with wireshark
20:57ivanFrozenlo`: unpopular HTTPS servers sometimes have bugs, or use wrong options, or your certificate has some weird options Google doesn't like
20:58ivanyou can also see if Googlebot likes an nginx/apache server you set up with the same cert
20:58ivanand compare that traffic to jetty (?)
21:04Frozenlo`ivan: I fired wireshark once last week and saw the initial handshake, but nothing beyond that. :/
21:04dybaI have a question about this gist --> https://gist.github.com/weavejester/598020
21:05dybaon line 19, can anyone explain what is going on with the argument to handler?
21:05Frozenlo`Raynes: pinnnnng. Ever had any problem with refheap's https and googlebot?
21:05dybahandlers take requests as arguments
21:06dybaso I was thinking that by writing the first argument as a map, we are using destructuring to capture the data we need
21:06dybais that correct?
21:09dybaI noticed that {{name "name"} :params} isn't the same thing as {:params {name "name"}}
21:13gfredericksdyba: yeah the function takes one argument
21:13gfrederickswhich is assumed to be a map
21:14gfredericksand it destructures it by pulling out the :params key in particular
21:14gfredericksthe value under that key is further destructured
21:14gfrederickspulling out the "name" key and binding that to the local `name`
21:16dybagfredericks: thanks for the explanation! It makes sense now. :)
21:16gfredericksthe weirdest thing about map destructuring is that the keys/values are usually the opposite of what you'd expect
21:24noprompti'm a bit confused here. how do i change the behavior of ILookup when using defrecord?
21:24gfredericksI don't think you do. You use deftype if you want something more custom.
21:25nopromptgfredericks: ah, ok. that's kinda what i thought.
21:34bbloomnoprompt: i should warn you that if you're trying to make a custom Map type, it's quite a difficult road to travel
21:34bbloomILookup is one thing, but map with custom lookup is quite another
21:36MikeSethis it possible to create a collection that is a generator?
21:36MikeSethahh, nvm
21:36bbloomMikeSeth: depends on what you mean by "generator". but mostly: yes. see ##(doc lazy-seq)
21:36lazybot⇒ "Macro ([& body]); Takes a body of expressions that returns an ISeq or nil, and yields a Seqable object that will invoke the body only the first time seq is called, and will cache the result and return it on all subsequent seq calls. See also - realized?"
21:37MikeSethbbloom: yeah, I sinned by not rtfm'ing, thanks
21:53RaynosApparently there's a functional clojure GUI framework
21:53Raynosone that renders "scenes" or something by taking the current thing and the previous thing and rendering an efficient diff
21:53Raynosim trying to find it
21:54ivanwebfui?
21:54bbloomAre you talking about the recently announced http://pedestal.io/ ?
21:54nopromptbbloom: yeah, i'm starting to see that.
21:55bbloomnoprompt: see my dispatch-map for an example https://github.com/brandonbloom/dispatch-map
21:55bbloomnoprompt: it's pretty tricky to get right, since there are so many interfaces/protocols/whatnot to implement
21:55bbloomnoprompt: i'm not even sure i got it 100%, what with hash codes, equality, printing, etc
21:55nopromptbasically i want a custom type that models a CSS rule.
21:55nopromptbut acts like a map.
21:56bbloomnoprompt: why does it need to be a custom type? why not just a CSS AST in a tree of maps?
21:56nopromptwell i dunno.
21:56noprompti've take the approach of modeling the CSS like so ["selector" {:prop-1 "val" :prop-2 "val}]
21:57nopromptbut i thought it would be convenient to have Rule type that lets me lookup properties easily.
21:58bbloomwhy not just have a function of a rule map?
21:58nopromptcan you explain what you mean?
21:59nopromptlike (defrule [selector prop-map]) ?
21:59bbloomdescribe the intended behavior of your desired ILookup implementation
22:00Raynosim just looking for examples of big efficient functional GUIs
22:00nopromptCSS rules are defined as a selector and any number of declarations.
22:00RaynosI cant figure out how to create large modular UI systems
22:00nopromptie, div { prop: val; prop: val }
22:00bbloomRaynos: heh, that's a bit of an open research problem....
22:01noprompti'd like the type to have a field for the selector and a field for the declaration map.
22:01Raynosi think webfui works
22:01RaynosI know how to create large procedural modular UI systems
22:01bbloomnoprompt: that's SORTA sufficient, it's worth pointing out that CSS selector rules are actually ordered maps & can have duplicate keys and what not, but 99% of the time that doesn't matter
22:01nopromptbbloom: right.
22:02bbloomnoprompt: anyway, what operation are you trying to accomplish?
22:02nopromptso to work around that
22:02bbloomnoprompt: you can't talk about how to model something until you talk about the operations you want to achieve on your model
22:02noprompt["h1" {:prop "val"} {:prop "val}]
22:02nopromptyou can have multiple maps so you can preserve order, overwrite, etc.
22:03nopromptbbloom: basically i wanted to make the manipulation of rules easy.
22:04nopromptwriting css in data structures is fine. but with CSS it's not as clean as hiccup.
22:04bbloomnoprompt: do you know what types of manipulations you're making most often?
22:04bbloomhiccup is somewhat hard to manipulate, you need to do stuff like check if the second entry in a vector is a map and then flatten seqs and what not
22:04bbloomhiccup is optimized for expression, not for manipulation
22:05bbloomor rather optimized for synthesis
22:05nopromptbbloom: right. and i think i have the synthesis part figured out pretty good. there's a few other tricks i haven't mentioned.
22:05nopromptbbloom: but i've always wanted to have a flexible CSS that allowed you to pull apart selectors like you would a map.
22:06bbloom[:div.foo [:div.bar "baz"]] is easy to write & to compose construction, but if you want to manipulate them later, you're better off with {:tag "div" :attrs {:class "foo} :children { ...}}
22:06nopromptyeah and that's what i'm talking about. i could have it like that.
22:06bblooma hiccup parser would read the vector notation and turn it in to clojure.data.xml style :tag, :attrs, :children representation
22:06nopromptand then write a few fn's and macros to make it easier.
22:06bbloomand by parser, i don't mean reader/parser like from strings
22:07nopromptso i guess then, in my case, {:rule {:selector "div" :declarations {}}}
22:07bbloommy suggestion is you try writing a function from hiccup -> xml maps (like clojure.data.xml) -> manipulation functions -> back to hiccup
22:08bbloomthis way both the synthesis and manipulation models are well known and defined for you
22:08bbloomand you can get a feel for the design tradeoffs
22:08bbloomthen go back to designing your models for CSS
22:08nopromptwait, you do understand i'm trying to compose CSS not HTML right?
22:08bbloomconsider things like add-class
22:08bbloomor toggle-attribute
22:08bbloometc
22:09bbloomyes
22:09bbloomi'm suggesting you experiment with this in the HTML design space, since hiccup and clojure.data.xml have already have well designed models for you to play with
22:09bbloomyou'll get some insights you can apply to CSS
22:10nopromptbbloom: ah, right. yeah i started reading the hiccup source starting from the first commit, and slowly seeing how the library was put together.
22:10Raynosanyone use webfui ?
22:11noprompti've pulled a lot of techniques from it.
22:11bbloomnoprompt: if you try to write (fn toggle-class [hiccup-form] ...) vs (fn toggle-class [xml-tree] ...) you'll quickly see what i'm talking about :-)
22:11nopromptmaybe the best thing to do is wrap up what i've got now, push up an alpha and get some input on the actual source.
22:11bbloomer i guess that toggle-class needs a class arg: [hiccup-form cls] etc
22:12Raynosnoprompt: how do you avoid https://github.com/drcode/webfui/blob/master/webfui-examples/src-cljs/calculator/core.cljs#L44 ?
22:12Raynosit feels like the pattern of having `render-all ENTIRE UI` would murder performance
22:12nopromptRaynos: i have no clue about that stuff, sorry man.
22:12noprompterr woman(?)
22:12Raynos:( sorry
22:13bbloomRaynos: the same way persistent data structures avoid copying everything: you share previous structure
22:13Raynosbbloom: that's fine, but that function returns an entire new thing
22:13Raynosit doesn't mutate a thing
22:13Raynosi dont understand whom you can share from
22:14nopromptbbloom: i'll have a look at that stuff. and like i said i'll push up the code soon and see if i can't get some better insights.
22:14nopromptbbloom: actually i did have one other question for you regarding types.
22:14bbloomRaynos: like i said, functional UIs are an open reserach problem. this is tricky stuff. go look at http://pedestal.io/
22:15nopromptCSS has various units. px, in, cm, em, etc.
22:15nopromptimagine i wanted to add px and in together and get cms
22:15noprompt(cm+ (px 40) (in 20))
22:15akhudekbbloom: how is your term rewriting project coming along?
22:15Raynosbbloom: thanks
22:16danneuyall know that joke about generating a random string by getting a freshman CS student to quit Vim?
22:16danneuwell i'm a Vim user using Evil-mode that just got stuck in Emacs-mode for 10 min
22:16bbloomnoprompt: that might be a reasonable place for a type, but it might also be a reasonable place for [40 :px]
22:17bbloomakhudek: i published an early work in progress to https://github.com/brandonbloom/retree -- it's really just a toy at this point. i'm doing a bunch of exploring in the space & that was one experiment
22:17nopromptbbloom: that could work, but i'm going to have to do a lot of extra checking
22:17bbloomnoprompt: i think cssgen does custom units, no idea of the implementation is any good
22:18nopromptbbloom: i'll look at it
22:18bbloomakhudek: kovasb had asked me about UpValues in mathematica: https://github.com/brandonbloom/retree/blob/master/src/retree/core.clj#L419-L437
22:19nopromptdanneu: i tried emacs with evil-mode yesterday.
22:20nopromptwas impressed at how much better the support for vim key bindings have gotten
22:21nopromptbbloom: thanks again
22:21nopromptcya
22:22akhudekbbloom: I like the configurable strategy, looks like a fun little project!
22:23bbloomakhudek: the piece i'm most interested in is how to combine this with computing information about the tree & then minimizing compulation when changing the tree, such that it's cheap to evolve the tree & ask questions about it over time
22:24akhudekbbloom: that's a really hard problem, though in my experience anytime you can save redoing rewrites is a huge win
22:26akhudekexploring rewrites based on term size is also a massive win (e.g. knuth-bendix ordering)
22:27bbloomakhudek: did we meet at clojure/west? i'm trying to match names to faces to IRC handles & there was much beer drank last week
22:28akhudekbbloom: no, I wasn't at clojure/west, though it's possible we met at the conj. I can't remember.
22:28bbloomakhudek: i wasn't at the conj :-P
22:28akhudekbbloom: ah, that answers that :-)
22:28bbloomrandom question for the room: is there a variant of (pop []) that returns nil instead of throwing an exception?
22:29bbloombut otherwise preserves a vector
22:33RaynesFrozenlock: I don't think so. I wouldn't know what a problem with that looks like.
22:33st3fandoes anyone know how to deal with multiple request params of the same name in compojure?
22:34st3fana request like foo?stops=a&stops=b returns "b" for (:stops params)
22:34RaynesRaynos: Dude. Your name is way too similar to mine.
22:35st3fanRaynes: nothing soundex can't fix
22:41RaynosRaynes: dud no u
22:41xeqist3fan: compojure/handler adds ring.util.params/wrap-params, which uses https://github.com/ring-clojure/ring-codec/blob/master/src/ring/util/codec.clj#L118 underneath. you might have to manually get then out of the request's :query-string if you want multiple ones with the same name
22:41RaynesRaynos: This can only be solved with fisticuffs in the courtyard. Duel at midnight!
22:41RaynosRaynes: https://twitter.com/Raynes ?
22:41RaynesYes.
22:41RaynesNo.
22:42RaynesIORayne
22:42Raynoshttps://twitter.com/Raynos <-
22:42RaynosOnce you get your real name on twitter
22:42Raynosthen we can duel
22:42RaynesI would if I could. :(
22:42Raynosits easy
22:42Raynosgo to SF
22:42Raynoscode at the twitter hq
22:42Raynoswait for a good time
22:42st3fanxeqi: hmm i think i'll just pass them in comma separated then
22:42RaynesActually, I wonder if I know anyone at twitter...
22:42Raynosi had to be in SF for like 6 months before I found a good time
22:42Raynosto get my account changed to Raynos
22:43Raynosnow I need to find someone at google to give me raynos@gmail.com
22:43xeqiRaynes: if you do let me know, I want to stake a claim as well
22:43RaynesRaynos: Was there any tweets on the raynos account?
22:43Raynostwo
22:43Raynosfrom 2009
22:43Raynesxeqi: Yeah, the problem with the Raynes account is that there are tweets on it.
22:43RaynesI'd have to have a really good friend to get them to give me the name.
22:49arrdemwoah woah. Raynes AND Raynos? man gensym is fucking up tonight
22:49Raynoso_o;
22:54RaynesI feel like I've seen Raynos in other channels before.
22:55danneuwow
22:55bbloomRaynes: He's like your core.logic relational counterpart. Raynes is a function and Rayneso is the relation, but we can abbreviate Raynos
22:56danneumy irc client gives every name its own unique color. yet of course it gives Raynes and Raynos the same color
22:56arrdemololol
22:56RaynesI think to think that I am Raynos's evil twin.
22:56RaynosRaynes: I have seen you
22:57danneuhttp://dl.dropbox.com/u/51836583/Screenshots/fv.png
22:57RaynosRaynes: do you use coffeescript?
22:57arrdem(inc danneu)
22:57lazybot⇒ 1
22:57arrdemyer all green anyway on my monitor... monochrome xterm aw yeah
22:58bbloomdanneu: haha. that sucks. i get confused when two people have the same color and are talking to each other & their names are wildly different
22:59Raynosdanneu: :D
22:59Raynosuse a better hashing function
23:00arrdemgah fnparse make sense.
23:00arrdemRaynos: it's probably the Java one TBH
23:00RaynesRaynos: I do not use Coffeescript at all.
23:00arrdem,(.hash "Raynes")
23:00clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching field found: hash for class java.lang.String>
23:00RaynesI may have wandered into the channel for one reason or another at some point.
23:00RaynosRaynes: then you are not my evil twin. My evil twin would use coffeescript
23:00arrdem,(.hash Object "Raynes")
23:00clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: hash for class java.lang.Class>
23:00RaynesFair enough.
23:00bbloomarrdem: hash or .hashCode
23:01Raynes&(hash "Raynes")(
23:01lazybot⇒ -1854081710
23:01Raynes&(.hashCode "Raynes")
23:01lazybot⇒ -1854081710
23:01bbloom,(map (juxt hash #(.hashCode %)) ["Raynes" "Raynos"])
23:01clojurebot([-1854081710 -1854081710] [-1854081400 -1854081400])
23:01RaynosI like how clojure outputs java exceptions :3
23:02arrdemclojure stacktraces...
23:08tieTYT2my question: http://stackoverflow.com/questions/15628682/in-clojure-how-do-you-download-an-image-from-a-webpage-and-save-it-on-your-file
23:09arrdemclj-http?
23:09clojurebotdakrone maintains clj-http
23:09tieTYT2i'm using that but i didn't see an example of how to do that
23:09tieTYT2i want the image, not the html
23:10arrdemtieTYT2: http://stackoverflow.com/questions/11321264/saving-an-image-form-clj-http-request-to-file
23:10tieTYT2nice thanks
23:11tieTYT2i'm going to flag my own question as a duplicate
23:11tieTYT2instead of deleting it. Might help people who search
23:11tieTYT2i have another question though, I don't understand that method signature
23:12tieTYT2(with-open [r (java.io.FileReader. "myfile.txt")] ...
23:12tieTYT2is that assigning r to the right hand side?
23:12tieTYT2how is that possible? I've never seen clojure work like that before
23:12tieTYT2i mean except in a let
23:12arrdemso that's just a normal binding form...
23:13arrdemwe do that in let, for, doseq...
23:13arrdemeverywhere.
23:13tieTYT2can you do that anywhere?
23:13arrdemno.
23:13tieTYT2or are these special cases?
23:13tieTYT2can i make my own function that uses this form?
23:13tieTYT2this binding form
23:13arrdemyou can build something else out of that form.
23:14arrdembut it's the (with-open) which is creating the binding of symbol r
23:14arrdemone could use a (let), but with-open will only execute it's body forms if the bindings were successful (no file open errors etc.)
23:17tieTYT2ok..
23:17tieTYT2but i can't expose that let as part of my api like with-open does
23:17tieTYT2right?
23:17clojurebottechnomancy: you're right I should explain the reason. The reason is I would like to be able to call aether with an extra parameter for introducing my own :transfer-listener.
23:18SegFaultAXtieTYT2: What are you trying to do?
23:18tieTYT2SegFaultAX: nothing, just trying to understand the clojure language better
23:18SegFaultAXtieTYT2: What's unclear?
23:19tieTYT2i've seen the binding form with functions and let
23:19tieTYT2but the difference with with-open is that it's exposed on the outside
23:19SegFaultAXtieTYT2: What do you mean exposed on the outside?
23:19tieTYT2and i was wondering if i can do that on functions i make
23:19tieTYT2http://clojuredocs.org/clojure_core/clojure.core/with-open
23:19tieTYT2the caller writes the binding form as a client
23:20tieTYT2instead of the person who wrote with-open doing it on the inside
23:20SegFaultAXtieTYT2: You do that with lets to, though.
23:20tieTYT2yeah but lets are on the inside of functions
23:20SegFaultAXtieTYT2: And yes you can use that functionality yourself if you choose to.
23:20tieTYT2i can't expose them as part of the function api
23:21tieTYT2wait can i do what this example does on any function I want?
23:21tieTYT2i thought this was special to with-open
23:21SegFaultAXtieTYT2: Nothing special about it at all.
23:22SegFaultAXtieTYT2: Do you have a repl open?
23:22tieTYT2yes
23:22xeqitieTYT2: you have to use a macro and transform the code, possible but rarely done
23:22SegFaultAXtieTYT2: True (source with-open)
23:22SegFaultAXTry*
23:22tieTYT2done
23:22SegFaultAXxeqi: Not that rare, really.
23:22SegFaultAXtieTYT2: You should see how they did it in with-open. You can use that as a template if you like.
23:23tieTYT2ok i want to make sure i understand this first
23:23danneutieTYT2: been to the readme? lots of examples
23:23tieTYT2is r bound to bindings?
23:23danneuoh i realized i was scrolled up in chat
23:23SegFaultAXtieTYT2: I don't think you know what "bindings" are.
23:23xeqiSegFaultAX: hmm, I can't recall a similar one in clojars or lein
23:24SegFaultAXxeqi: A simliar what?
23:24tieTYT2it's destructuring right?
23:24SegFaultAXtieTYT2: Look at the source, it simply expands to a normal let form.
23:25thm_proverhttp://hpaste.org/84656 <-- this code works fine for evaluating syntacticallyv alid clojure code, i.e. "(+ 2 3)" gets me "[5]". However, when I give it syntacticaly invalid code, like "(+ 2 3", I get "nil" back ... rather than an error message. How do I get error messages back from nrepl?
23:25xeqia defmacro that does a binding transformation into a let
23:25tieTYT2this source is a little advanced for me since it has a macro in it
23:26tieTYT2maybe it's not a macro, but it's using ~@ and ~ and stuff
23:26tieTYT2is there a simpler example I can look at?
23:27SegFaultAXtieTYT2: It's a macro, you can tell because it uses `defmacro`
23:27tieTYT2i'm just looking at this first example and wondering if two arguments are passed in or one: http://clojuredocs.org/clojure_core/clojure.core/with-open
23:27SegFaultAXtieTYT2: Probably safe to stay away while you're learning. Come back to it in a bit.
23:29tieTYT2whatever, obviously r is being BOUND to the rhs
23:29tieTYT2i didn't know you could do that when you call
23:29tieTYT2i thought you could only do that inside the def of a function
23:30bbloomodd:
23:30bbloom(let [v [1 2 3]] (into {} [[v 1] [(seq v) 2]]))
23:30bbloomvs
23:30bbloomer:
23:30bbloom,(let [v [1 2 3]] (into {} [[v 1] [(seq v) 2]]))
23:30clojurebot{[1 2 3] 2}
23:30bbloomvs:
23:30SegFaultAXtieTYT2: Lets do it to (which is what with-open is using)
23:30bbloom,(let [v [1 2 3]] (into {} [[(seq v) 1] [v 2]]))
23:30clojurebot{(1 2 3) 2}
23:30bbloomequiv is hard.
23:30bbloom:-/
23:31tieTYT2a let is inside the def of a function
23:31tieTYT2but this example is calling a function and using bindings
23:32SegFaultAXtieTYT2: No, it isn't.
23:32tieTYT2that's the thing i've never seen before
23:32tieTYT2it isn't?
23:32SegFaultAX,(let [a 1] a)
23:32clojurebot1
23:33tieTYT2ok you can use it outside
23:33tieTYT2is that what's going on?
23:33SegFaultAX,(let [a 1] ((fn [] (inc a)))
23:33clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
23:33danneuyou're still inside the let body
23:33SegFaultAX,(let [a 1] ((fn [] (inc a))))
23:33clojurebot2
23:33tieTYT2<tieTYT2> but this example is calling a function and using bindings as parameters
23:34tieTYT2this is the the thing that's confusing me
23:34tieTYT2can you show me an example doing that?
23:34SegFaultAXwith-open isn't a function
23:35tieTYT2oh right
23:35SegFaultAXtieTYT2: It's a macro.
23:35tieTYT2well is that the only reason youc an do this?
23:35SegFaultAXtieTYT2: In this case, yes. Macros are evaluated at compile time. They're similar to functions, except their inputs are always unevaluated lisp forms and their outputs are usually also unevaluated lisp forms.
23:36SegFaultAXtieTYT2: They allow you to transform lisp forms from one shape to another at compile time.
23:36tieTYT2ok the world makes sense again
23:36SegFaultAXtieTYT2: In with-open's case, it's transforming the (with-open [...] ...) into a do or let form, based on the number of forms in the vector.
23:37xeqi&(macroexpand-1 '(with-open [r (java.io.FileReader. "myfile.txt")] r))
23:37lazybot⇒ (clojure.core/let [r (java.io.FileReader. "myfile.txt")] (try (clojure.core/with-open [] r) (finally (. r clojure.core/close))))
23:37tieTYT2at a high level i get that it's taking that vector and saying "let myvector" when it replaces the code
23:37SegFaultAXtieTYT2: So if the vector is empty, it literally just becomes a normal (do ...) form.
23:37SegFaultAXtieTYT2: If the vector is non-empty, then it becomes (let [...] ...)
23:38tieTYT2ok
23:38tieTYT2thanks for the help
23:39SegFaultAXtieTYT2: Again, I suggest deferring macros for a little while until you have a much firmer grasp on normal clojure.
23:39tieTYT2well i'm not trying to write them, but i come across code that uses them and it makes me question my understanding of everything else
23:43danneuitd be nice if slurp decompressed
23:44danneuive used a few open source projects that lean on slurp and they choke on any gzipped website
23:45RaynesIt'd be nice if people didn't use slurp as an http client. :p
23:46bbloomIt'd be nice if stdlibs didn't try to be helpful and automatically interpret arbitrary URIs in their fopen routines!
23:46bbloomsheesh, i had no idea that slurp would do that
23:48tieTYT2well it takes a URL, i thought it was meant for that
23:49danneui wouldnt be surprised if you could pass it a :deflate option or something. "See clojure.java.io/reader for a complete list of supported arguments."
23:49danneubut i see no complete list there
23:51tieTYT2i'm getting this error in my repl: CompilerException java.lang.RuntimeException: Unable to resolve symbol: require in this context, compiling:(NO_SOURCE_PATH:1)
23:52tieTYT2this is what I'm running: (require 'my-proj.image-site)
23:52xeqitieTYT2: what namespace are you in?
23:53tieTYT2my-proj.image-site
23:53tieTYT2wait
23:53tieTYT2it worked this time
23:53tieTYT2all i did is restart the repl twicew
23:59tieTYT2how do I debug this exception? http://pastebin.com/cr9rcPa6
23:59tieTYT2seems like there should be a longer stack trace