#clojure logs

2012-12-02

01:40SgeoIs there already a library providing Lamina with a monadic interface?
01:40SgeoIf not, I'll go write one
01:56tomojSgeo: I haven't seen one. what would you get out of it, `for` for channels, and anything much more?
01:56SgeoWell, currently only going to do result-channels
01:56SgeoBut I think `for` for result-channels is a cool thing
01:57Sgeolift is pretty good too, but Lamina might have that already, I didn't check
02:39tomojSgeo: lamina sort of already has that I think?
02:39tomojoh, no, it got removed in the perf branch iirc
02:39Sgeoo.O what was it?
02:40tomojthe async macro
02:40tomoj(async (let [x a-result-ch y b-result-ch] [x y]))
02:42tomojcljque's `on`
02:42tomojexcept `async` did more, e.g. I think (async (f a-result-ch)) passed the result to f, not the result-ch
02:43tomojhttps://github.com/ztellman/lamina/wiki/Async-Programming
02:43tomojthe bottom example is kinda funny to me
02:43tomojwhy isn't it (async (doseq [msg ch] (handle-message ch))) ?
02:45tomojer, (handle-message msg) of course
03:16brainproxyjust saw asterline's netty-ring-adapter, any thoughts on when to favor something like that instead of jetty?
05:00TEttinger,(doseq [j (range 4)] (doseq [i (range 4)] (print "*")) (print))
05:00clojurebot****************
05:00TEttinger&(doseq [j (range 4)] (doseq [i (range 4)] (print "*")) (print))
05:00lazybot⇒ ****************nil
05:00TEttingerhuh, the bot I am running gets execution timeouts when it evals that code
05:01TEttinger&(doseq [j (range 4)] (doseq [i (range 10)] (print "*")) (print))
05:01lazybot⇒ ****************************************nil
05:04nightfly_I'm getting java.lang.NoClassDefFoundError when I try and import an abstract java class or any of it's decendants. The source file definitely exists and lein is compiling a .class for it. Is there some special symantics for dealing with abstract classes I'm missing or what?
05:08borkdudenightfly_ in this case it always helps to print a directorly listing on refheap, or better yet, the project on github
05:08borkdudenightfly_ and your project.clj -- not that I know the answer, but this usually helps people to find the error more quickly
05:08mpenetSgeo: see pipeline/run-pipeline it's probably what you are looking for
05:09SgeoExcept for needing to use merge-results and then unpack the result from that in the next stage?
05:09mpenetthere is a merge-result fn I think
05:10mpenetnm
05:10mpenetyes, you have to do that manually
05:10nightfly_borkdude: Well, most of the code is the decompiled code for minecraft so I can't really put it up anywhere... The only addition to my project.clj is :java-source-paths ["src/java"] and concrete classes are importing as expected.
05:13mpenetSgeo: another option is to use restart/complete and use a pipeline like a loop that updates the state at every step
05:13Sgeorestart/complete?
05:13mpenetlamina.core/restart lamina.core/complete
05:14SgeoAnother option: Make it compatible with an existing macro that does pretty cool things.
06:23wei_is anyone using friend with noir and if so, how did you define the logout function?
06:30muhoowei_: i did, i don't remember how i did that though
06:30muhoonice work on the jida thing btw
06:30wei_thanks
06:31muhooit looks like i just did ((friend/logout identity)
06:31muhoo(defpage "/logout" ... ((friend/logout identity)
06:32wei_oh, didn't realize that would work. I thought you needed to pass in a handler.
06:32muhoowith a (response/status 200....) after that
06:32RaynesChris Granger should pay me for this shit.
06:32muhooRaynes: which shit?
06:32RaynesUp at 5:30AM trying to get a noir release out, updating his crappy website with unqualified uses and shit.
06:32RaynesI'm going to ridicule him for these uses.
06:33RaynesHe also uses TWO libraries that both have single segment namespaces.
06:33wei_haha. thanks for maintaining it, raynes
06:33RaynesAnd I had to switch to a new library for markdown and guess what? It uses single segment nses too.
06:33wei_that and jayq
06:33muhoo:-(
06:33RaynesI want to kill myself for even using these libraries.
06:34muhooIIRC, somre of the uses in noir override core functions too
06:34muhoosome
06:34Apage43heh, I use conch + some command line markdown program for markdown in the things I've done that use markdown from clojure
06:35wei_noir is very opinionated.
06:35RaynesNoir is very annoying.
06:35wei_:P
06:36RaynesIf Chris wasn't a buddy, I'd never even try to maintain it.
06:37muhooit's very big of you to pick up that task.
06:37muhooi'd say he owes you.
06:37RaynesHe'll pay me back with liquor when I turn 21.
06:37wei_yes, thanks for wading through it. I've been very productive using it lately
06:38muhoogo to louisiana, drink there.
06:40muhoough, my information is out of date. louisiana is 21 now too. whole country is. http://en.wikipedia.org/wiki/U.S._history_of_alcohol_minimum_purchase_age_by_state sorry bro, things were different in my day.
06:41Sgeosingle segment namespaces?
06:41Apage43(ns blah) as opposed to (ns thing.blah)
06:41Sgeooh
06:42SgeoUh, I take it that that's disliked for some reason?
06:42Rayneshttps://groups.google.com/forum/?fromgroups#!topic/clojure/gOffhotk25Y
06:42Apage43causes issues, yeah
06:42RaynesFor lots of reasons.
06:42RaynesOne, it's broken, two, people should at least try to use unique namespaces.
06:43gfrederickslike ##(format "ns-%d" (rand-int 10000000))?
06:43lazybot⇒ "ns-4153793"
06:43muhoonamespaces didn't make my life as miserable as the copious use of macros did. or the non-functional storing of local state in atoms. or, whatever, i enjoyed noir until i didn't anymore.
06:46wei_muhoo: thanks, your suggestion above worked for me
06:47muhoogreat. i'm going to have to integrate friend with some kind of json or edn service soon, so i'll refamiliarize with it
06:47wei_ah, i have it working with fetch
06:48muhoocool, in that jida project?
06:48wei_nope, another project. this example helped: https://github.com/xeqi/friend-fetch-example
06:48SgeoIs Friend usable with non-web services?
06:49wei_although I'm going to update that example with a working log-out
06:50wei_Sgeo: I've only used it for web, although it claims to support "multiple workflows"
06:51wei_muhoo: did you use friend with a session store in your last project? that's not working for me yet
06:51muhoowei_: i used couchdb as a session store, iirc
06:52muhoohad to do some massive hacks/fixes to the couch session store lib though
06:53wei_i'm using mongo. other than the lib, did you do anything more than specify :session-store in noir.server/start?
06:55wei_(thanks)
06:56muhooah, i never integrated that in production. it's sitting in a dead branch. wasn't confident in it.
06:57muhoobut it was easy, just https://www.refheap.com/paste/7211
06:59muhooso the production app is using a memory store, apparently. but, yes, just :session-store and off you go.
07:00wei_that's what I have too, with monger. it's creating the session records but not authenticating the user when they come back.
07:00wei_will investigate further
07:01muhoodoing more reading, the reason i didn't integrate it is because i got the idea that having session store come back through a json round trip to a network data store was insane.
07:02muhoolooks like just keeping it in ram was going to be fine, and i was going to add in the aging middleware so as to not burn up ram
07:03muhooalso, i was using google auth, so if the server restarted, and the memory wiped out, google would reauth them transparently, and the users didn't see any glitch.
07:05muhooand i wasn't doing anything really stateful on the server side anyway.
07:05wei_i see. memory store works great for your use case
07:35sqiudzwhat would be the shortest way to change [0 0 0] 1 [2 2 2] into [0 0 0 1 2 2 2] ?
07:36borkdudesqiudz (fn [a b c] (concat a [b] c))
07:36hyPiRion&((fn [& r] (flatten (apply concat r))) [0 0 0] 1 [2 2 2])
07:36lazybotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long
07:36sqiudzborkdude: so just convert the single val to a single vector val and then use concat?
07:37borkdude,( (fn [a b c] (concat a [b] c)) [0 0 0] 1 [2 2 2])
07:37clojurebot(0 0 0 1 2 ...)
07:37hyPiRion&((fn [& r] (flatten (apply reduce into r))) [0 0 0] 1 [2 2 2])
07:37lazybotclojure.lang.ArityException: Wrong number of args (4) passed to: core$reduce
07:37borkdudesqiudz yes
07:37hyPiRionArrh, I'm too old for this.
07:37hyPiRion,(flatten (conj [0 0 0] 1 [2 2 2]))
07:37clojurebot(0 0 0 1 2 ...)
07:38hyPiRionIs the idea.
07:38sqiudzim getting the illegalArgumentException though
07:39hyPiRionsqiudz: For which? borkdude's should work fine.
07:39sqiudzhyPiRion: let me try your last one
07:39hyPiRion,((fn [& r] (flatten (reduce conj r))) [0 0 0] 1 [2 2 2])
07:39clojurebot(0 0 0 1 2 ...)
07:41sqiudzhyPiRion: okay the last one with flatten seems to work
07:42ChousukeI hope that's not a very common operation in your program :P
07:42sqiudzthe only thing is that it converts it to a list when I wanted to keep it a vector
07:42Chousukesqiudz: call vec on the result again
07:42sqiudzChousuke: and yes it will be pretty common
07:42Chousukethen use a different data structure
07:43sqiudzcalling vec only puts the list in [(n1 n2 n3)]
07:43sqiudzChousuke: please elaborate
07:43Chousukeadding things in the middle of a vector is a linear operation
07:43Chousukewhich means if you do it a lot, it will be slow
07:44sqiudzi', appending vectors with conj
07:44sqiudzisnt that different?
07:44Chousukein that case you can do:
07:45Chousuke,(into [1 2 3] [4 5 6])
07:45clojurebot[1 2 3 4 5 ...]
07:45Chousukethat's not so bad, performance-wise
07:45sqiudzI have a single value in between
07:45sqiudzlike [1 2 3] 4 [5 6 7]
07:46Chousukewell then you should do a conj first and then into
07:46sqiudzokay
07:46sqiudzthen performance should be pretty good still right?
07:46Chousukewell, it's still linear on the size of the vector you're appending + the one conj
07:46Chousukebut it's better than using reduce conj and flatten and then making a new vector
07:47sqiudzokay, thanks. Do you think it would be possible to get it to run constant?
07:47Chousukeno.
07:47hyPiRionConstant?
07:47clojurebotunlink: and constantly is just a function that takes any arguments and returns whatever argument is given
07:48borkdudewhat about this one? https://www.refheap.com/paste/7216
07:48hyPiRion,(conj [1 2 3] 4) ; is constant
07:48clojurebot[1 2 3 4]
07:48Chousukesqiudz: you can concat two lists lazily in constant time but not vectors.
07:49hyPiRion,(into [1 2 3] [4 5 6]) ; O(n), where n is the size of the last vector
07:49clojurebot[1 2 3 4 5 ...]
07:49sqiudzChousuke: ah okay. Is it true that Lists are kind of like LinkedLists in java where Arrays are like ArrayLists?
07:49Chousukemmm not really.
07:49Chousukearrays support random access, and conj to the tail
07:49sqiudzthen how can I compare the two
07:49Chousukelists are linear access only and conj to the front
07:50Chousukeneither support insertion in the middle
07:50sqiudzah okay thanks very helpful
07:50borkdudesqiudz did you see my fn in the refheap paste?
07:50Chousukealso, I said arrays but I meant vectors, obviously :P
07:50sqiudzborkdude: no let me take a look
07:50borkdudeit basically selects into or conj
07:50Chousukesqiudz: and clojure lists and vectors are also immutable, which is quite important :)
07:51sqiudzyes, I guess what I did was kind of make my own array insert
07:52Chousukeif you need a lot of inserts in the middle of a data structure you should maybe use a finger tree or something
07:52sqiudzthis is what I did in the end https://www.refheap.com/paste/7217
07:52Chousukebut if you're fine with just appending vectors to each other then into should be okay.
07:52sqiudzChousuke: So I would have to implement my own finger tree right, since I suppose clojure doesnt support them out of the box
07:53sqiudzthat just inserts a '1' into a vector at a given index
07:54Chousukesqiudz: there's a contrib library of finger trees
07:54Chousukesqiudz: but you can keep on using vectors for now
07:54Chousukechange it later if speed is an issue
07:54borkdudeChousuke right, if it's not the bottleneck, why bother
07:55SgeoWhy does frenchy64's analyze require 1.5?
07:55sqiudzChousuke: ive never used a finger tree, and while it shouldnt be a problem with speed, it might be interesting to acquaint myself with finger trees anyhow
07:56borkdudesqiudz or use a Java ArrayList :P
07:56Chousukefinger trees are weird
07:56Chousuke:P
07:56sqiudzI would rather go functional if I have the choice
07:56borkdudesqiudz good boy, this was only a test
07:56sqiudzhaha
07:57Chousukefinger trees can actually be used to implement all kinds of weird data structures
07:57sqiudzI'm really loving clojure. I normally program java, and started doing haskell on the side. Haskell was fun, but it was so hard to get things done. Maybe I just need more time. After trying clojure though, everything just seems to be 'right'
07:57sqiudzChousuke: do you use them often?
07:58borkdudesqiudz I sense that too. Clojure is made for people who want to get things done
07:58Chousukenah. I just know they're capable of crazy stuff :P
07:58Chousukeit's a bit easier to experiment with clojure
07:58Chousukehaskell can be extremely productive as well but you need to understand its abstractions an type system and it's a bit of a hurdle.
07:58Chousukeand*
07:59tgoossensi have a collection: ((0 1 4 7 8 9) (0 1 2 5 8 9) (0 1 2 5 6 9) (0 3 4 7 8 9) (0 1 2 4 7 9) (0 2 5 7 8 9)) . Some of the subcollections are the complement of another (concretely: (map #(- 9 %) coll) sometimes matches another one)
07:59tgoossensi want to filter this collection
07:59tgoossensto remove the complements
07:59tgoossensso that in the result, no subcoll is the complement of another
08:00tgoossenshmm
08:00tgoossensmaybe recursion will help me here
08:00borkdudeChousuke yes agree about Haskell, it's a bit of a learning curve but I have the gut feeling there must be something at the end being worth it all
08:00Chousukeborkdude: some of the abstractions are simply beautiful
08:01borkdudeChousuke I'm reading about parsing now, it looks nice - I think you could do the same in clojure though
08:01Chousukeeven supposedly "scary" things like monads are extremely simple. Once you understand what they actually do.
08:02Chousukeyou can actually implement monads in clojure with about 20 lines of code
08:02Chousukethey're not quite as convenient to use as in haskell. though.
08:03borkdudeChousuke I am only a Haskell n00b, but the do syntax thing, it can be applied to monadic things right?
08:03borkdudeChousuke I mean, do is made to make monadic composition easier?
08:03Chousukedo syntax is sugar for bind, yeah
08:03sqiudzwould using monads in clojure be more of an abstraction design decision, where using Monads could improve say an API
08:03Chousukeborkdude: a monad is actually an abstraction that provides two operations, bind and return.
08:04Chousukeborkdude: do is sugar for making bind easier to use.
08:04sqiudzand I guess the good stuff is how you define bind
08:04Chousukeso everything that implements the monad abstraction gets to use do
08:04Chousukebecause it's just bind under the covers
08:04borkdudeChousuke right
08:05sqiudzbeing able to implement your own bind means that you can provide a 'context' to every sequential bind that you do in a given monad
08:05sqiudzwhich is i guess why some describe monads as a context
08:10borkdudesqiudz I think "context" is a nice term for it
08:11borkdudethat makes me wonder, what does the word monad actually mean… http://www.etymonline.com/index.php?term=monad <- right...
08:26tomojSgeo: you seen the pod talk?
08:26Sgeotomoj, no
08:29SgeoHmm, delimc seems to use macroexpand-1 as its only macroexpansion tool
08:29SgeoWhich is, uh. Insufficient.
08:30SgeoAs far as I can tell, macroexpand-1 and macroexpand-all are not sufficient to fully macroexpand a macro and all subforms
08:30SgeoThere's no way to pass a lexical environment to them, so any macro that uses &env will break.
08:32tomojSgeo: maybe tools.macro's mexpand will work?
08:33SgeoJust realized that macros are functions, you can call the function, and I think the function takes &env and &form as arguments
08:33Sgeotomoj, or that might work
08:33tomojhmm, there's no &env in that ns though
08:35tomojjacking in.. aw. pom.xml.
08:37Sgeo...I think I'm about to get into a flamewar on Clojuredocs
08:41SgeoIs there any way to receive an email when someone comments on a Clojuredoc page
08:41Sgeo?
08:52KiPSOFThi all
09:00sqiudzhi kip
09:01KiPSOFThow to type class default property in clojure ?
09:01sqiudzhow do I*
09:02KiPSOFThttp://pastebin.com/7trq5ziM
09:02KiPSOFTexample this pastebin
09:39VotingIf I'm planning to work in clojurescript in the near future, is this channel where I should ask my questions?
09:40daimrodVoting: there is #clojurescript
09:40jonasenVoting: yes
09:41VotingOnly 3 or 4 in #clojurescript... better to be here?
09:43hyPiRionVoting: better to be here, yes.
09:43VotingI'm an old hand at Lisp programming (Lisp Machines even) ... Will I clojurescript?
09:43Votingwill I enjoy clojurescript?
09:45AimHereYou might like it more than javascript
09:50sqiudzhow do clojurescript and fay(haskell) compare?
09:51VotingConsidering http://haxe.org/ - Why would I consider ClojureScript rather than a haxe, a language the provides lots of checking and portability?
09:52Raptumbecause parens
09:53Voting(I was not joking - what is good about javascript...)
09:53AimHereVoting, there's a book all about that, actually
09:53AimHereAdmittedly, a slim one
09:53VotingAimHere: what book do you mean?
09:54AimHereJavascript: The Good Parts, by Douglas Crockford
09:54AimHereThe thesis is that under all that terrible DOM junk, and a bunch of ugly ad-hoc warts, there's a nice, powerful, flexible language yearning to break free
09:55VotingAimHere: Javascript: the good parts will help me know if I want to program in Haxe or ClojureScript?
09:56MauriceMoss42hey all... I've got an hypothetical question (in order to better understand how Clojure works): if I could modify Clojure so that I could prevent 'eval' from working at runtime (I'm not saying it's possible: let just pretend it is), would program not specifically using eval and not offering a REPL still work?
09:56Votingyes
09:56AimHereNot really. Clojurescript is for people who want to write something like Clojure because they don't want to write Javascript either
09:56MauriceMoss42Voting: was the 'yes' for my question about eval?
09:57VotingMauriceMoss42: PM me if you like
09:57VotingMauriceMoss42: yes, I would be surprised if ...
09:57VotingI am wrong about that...
09:57Votingfuncall sorts of thing may be used all over the place...
09:58Votingbut eval should not be used beside in the repl
09:58Votingand when someone calls eval
09:59AimHereEval is like reader macros or thermonuclear weapons. You can sneer at other languages or other countries, because you have such things and they don't, but for fucks sake, don't thing about actually USING them
10:00VotingBut I don't know the actual implementation of clojure... I'm just talking in general about how lisps are implemented
10:00AimHere*think
10:00VotingI think reader macros can be useful in certain applications, actually. Used to know johl white, the inventor of them...
10:01VotingWhere would you expect eval to be used where internally, MauriceMoss42 ?
10:01MauriceMoss42AimHere: my question was more like: "If I'm not specifically using eval, is Clojure under the hood still using eval at runtime even if there's no repl" : )
10:02Votingwhere would it?
10:02MauriceMoss42Voting: well... you tell me : ) I'm just discovering the macro / functions (compiled to bytecode in Clojure?!) etc. and I was wondering about that specific case.
10:02AimHereWell you could always grep the code you're intending to use for 'eval' (and then grep for the functions that use it etc)
10:03AimHereAs in, the underlying code for the libraries and so on
10:03MauriceMoss42Voting: I mean: knowing that eval should potentially not be used anywhere at runtime unless I'm either using a REPL or specifically calling eval helps me better understand how thing works (I guess)
10:03VotingMauriceMoss42: A compiler for lisp...
10:03MauriceMoss42AimHere: but I'd also then need to grep the built-in APIs / functions / macros...
10:04MauriceMoss42Voting: (another topic) so reader macros were a late addition to lisps dialect and weren't in the "first lisp"?
10:04VotingMauriceMoss42: A compiler for lisp can generate code that applies functions to arguments, right? Why would the compiler need to eval? It is arranging to do that later, right?
10:05VotingMauriceMoss42: reader macros were not in lisp 1.5, for sure.
10:08VotingMauriceMoss42: and they are an obscure feature for use when you want to be able to be able to type in a data structure. Say, for example, I want to be able to type in the name of a person and have it hook into the person, stored in some lookup table or something... I want the code to be able to write out data structuers that will be readable later... you could program your entire life in lisp and never choose to use this feature and this w
10:09Voting(I'm speaking as a person who use to program in CommonLisp and predecessor lisps and I could be out of date here.)
10:13MauriceMoss42Voting: thanks a lot for all these infos... Going back to devouring my book ("Clojure programming") : )
10:16hcumberdaleHow to order '("/prefix/filename2.ext" "/prefix/filename1.ext" "/prefix/filename3.ext") by '("filename1" "filename2")?
10:18gfrederickshcumberdale: you need a function that pulls out the simple filename, then you can use sort-by
10:19wingyshould i cache user profile pages?
10:19hcumberdalegfredericks: But I need the full file name as result
10:19wingyseems not cacheable right since GET /my-account requests should give you different pages based on what session id is
10:20hcumberdalewingy: why not use GET /account/username or id
10:21hcumberdaleOr cache the results behind the decision what to put into my-account
10:22wingyhcumberdale: seems weird since you still need to be logged in (have the correct session data) or else GET /accounts/:id would fail
10:22wingyanother reason might be that then someone can save the URL which gives the wrong impression that you can just click on it and be logged in
10:23wingyoh
10:24hcumberdalewingy: that shouldn't be a problem since you can check if the user is logged in and redirect
10:24hcumberdaledo you use friend?
10:24wingyno
10:25wingylet's say that this is a bank .. is it good to have the profile page cached?
10:25wingywill it rise security issues?
10:25hcumberdalewingy: caching is not about security
10:25hcumberdale(server-side caching)
10:26hcumberdaleYou can just check if a user is authorized regardless if you have a cache or not
10:27wingyok
10:27wingyi'll try with GET /account first and see if it fits
10:27hcumberdalejust having a page which is aware of a session-id and is not good for many reasons
10:27wingywithout caching that is
10:28wingyfriend can help me with this kind of stuff?
10:28hcumberdalewingy: HTTP-GET should get a uniqe single ressource
10:28hcumberdalewingy: yes!
10:28hcumberdaleThere are frameworks working like GET /everything with some parameters, session awareness and so on
10:29hcumberdaleBut you should avoid that
10:29hcumberdaleif there is a ressource you can build nice url's to directly point to it
10:29wingyhttps://github.com/cemerick/friend seems difficult to get
10:29hcumberdalelike /accounts/john_doe
10:30hcumberdalewingy: yes but only because it is lacking full & complete examples
10:30wingyit is worth the time then?
10:30hcumberdaleIt is not hard at all if you get it working
10:31hcumberdalewingy: there is sandbar and friend, both good
10:31hcumberdalefriend is more up to date, provides more features and does not come with dependencies like hiccup
10:32hcumberdaleI've written a lot with sandbar. But now I'm going on with friend
10:32wingycool didnt know about sandbar
10:32wingyi trust cemerick :)
10:32wingyup to date means everything
10:35hcumberd`;)
10:42cemerickhcumberd`: friend will be getting much better docs soon. I finally pushed my revamp of nrepl docs recently, so friend is the last project of mine waiting in that particular queue. Thanks for your patience. :-)
10:43borkdudewhat a friend we have in cemerick
10:45hcumberd`cemerick: thx! I've created some working examples for friend+compojure.
10:52wingyyeah would better doc i would get how to use friend
10:53wingyplease explain what/why/how
10:54hcumberd`wingy
10:54hcumberd`https://github.com/kremers/friendly
10:55wingythx
10:56wingyhcumberd`: i also found that https://twitter.com/settings/profile is not appending your id in the URL
10:56wingyso i should just do GET /account
10:56wingyand check whatever session id to respond with
10:56wingyand not cache it
10:58hcumberd`wingy: it's kind of the interpretation of HTTP-GET
10:58wingybtw .. if all my pages is showing the current username in the HTML page .. then to be able to caching it I have to provide GET /page?user=123 right?
10:58hcumberd`If you say a the page "account" is a single unique ressource it's okay
10:58wingysince if i just have GET /page then i can't have them showing different usernames
10:59hcumberd`From the view of the user it is a unique ressource
10:59hcumberd`From the view of the server it's not. So its really possible to discuss
11:00hcumberd`wingy: There is browser-side and server-side caching possible
11:00hcumberd`The browser just saves the page beyond "account"
11:00hcumberd`The cache will work for a single user
11:00hcumberd`Not if he's logging out and in with another user again
11:01hcumberd`it is very unlikely that cache coherence will occur
11:01hcumberd`Because the browser will invalidate the cache
11:01wingyi c
11:01wingyso i dont need to append anything in the GET path
11:01hcumberd`Yes you do not need to
11:01wingygoogle isn't https://www.google.com/ shows my name
11:01hcumberd`But you should to comply to HTTP spec
11:02wingyhcumberd`: when will the browser invalidate the cache? when the session is changed?
11:03hcumberd`http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.3
11:03hcumberd`wingy: depends on the browser
11:03hcumberd`IE6 will have a different mechanism
11:05hcumberd`wingy: you can provide cache headers in HTTP
11:05hcumberd`Cache-Control: max-age=1000
11:05wingyyeah
11:06p_lalso, ETags can help
11:06hcumberd`Or NoCache
11:06hcumberd`wingy: if your browser supports ETags, that's the creme
11:06hcumberd`creme-de-la-creme
11:06wingyyeah i have to read about that
11:06hcumberd`You can cache every ressource with it, but ETag generation is a big topic
11:07hcumberd`wingy: ETags are really easy. HTTP sends an additional Header ETAG:mytaghere
11:07hcumberd`The tag should be a uuid, generated by a checksum of the ressource
11:07hcumberd`resource ;)
11:08wingymy actual question was that if I do GET /profile and then my server will check for what user is currently logged in through session and respond with the current user profile .. if it's cached then the next GET /profile would give the same user .. so you are saying that if the user logs out the cache will be invalid .. and the next GET /profile will be re-fetched based on the new session data?
11:09hcumberd`wingy: It depends on how content is provided in your page
11:09hcumberd`Do you load specific things with javascript after page generation
11:10wingyno its just html
11:10wingyserver spits out html to client
11:10tataloois there any motherfucking manual for working with logical expressions and bitwise in clojure/
11:10tataloo?
11:11wingylol
11:11wingywanna RTFM i guess
11:12tataloowhat the fuck is RTFM?
11:12hcumberd`tataloo: I don't know if there is a manual that fulfils the requirement 'motherfucking'.
11:13tataloook :(
11:13wingytataloo: what you are trying to do :)
11:13hcumberd`http://clojure.org/data_structures
11:13hcumberd`There is a reference to all bitwise-* operators
11:13hcumberd`wingy: or what he better should do
11:13tataloofind the true bits in a binary using &
11:16hcumberd`tataloo: find the position, count,... ?
11:16cemerickhcumberd`: by all means, publish 'em
11:17tatalooseems fucking legit
11:18hcumberd`https://github.com/kremers/friendly
11:18hcumberd`That's one example ;)
11:19hcumberd`wingy: if you log out and log in again and the cache header does not say anything about invalidation it depends on your browser what happens
11:19wingyhcumberd`: ok
11:20hcumberd`Not all browsers comply fully to the HTTP SPEC about caching
11:20hcumberd`When it's likely to see errors in IE
11:20hcumberd`pages may work very well in FF
11:20hcumberd`http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13
11:20hcumberd`Best you'll stick to the specification
11:21hcumberd`It's the only thing assuring you doing the 'right' thing
11:21hcumberd`(.replace thing way)
11:28hcumberd`wingy: If you work with cache invalidation headers like Last-Modified and a resource that is aware to a kind of 'state' like the session-id, you'll have to generate headers depending on the context. That's why a writing a single page for multiple cached results for different users is so hard to do
11:29hcumberd`It's much more easy to redirect on the context to a specific resource
11:30hcumberd`Like /my-account will forward you to /my-account/john_doe
11:31wingyhcumberd`: yeah
11:32wingyprobably a better idea .. seems more correct
11:32wingyGET /accounts/123
11:33wingyand then it checks the session id before generating
11:33wingymore RESTful
11:34hcumberd`yes
11:35hcumberd`Then caching is no problem. And you really have the control when to send modified headers or etags because you know when the page changed for a specific user
11:36wingyyeah!
11:36hcumberd`But the page as it is, is mostly the smallest part
11:37hcumberd`Bigger party are images, css, js, ...
11:37hcumberd`all cachable with etags
11:37wingyyupp
11:37hcumberd`if your page is really, really calculation/performance intensive you might really want to cache the whole page with etag&modified-since header
11:38wingyI have an anchor that do GET /logout and here is the route (GET "/logout" [] {:status 302 :headers {"Location" "/"} :session nil}) .. the issue is that after clicking it my browser is pointing to /logout still when it should be pointing to /
11:38wingywhat is the issue?
11:40wingyi think the issue is jquery mobile … it's doing some magic in frontend
11:40hcumberd`wingy: you should use ring/redirect
11:41hcumberd`(GET "/admin/categories" [] (redirect "/admin/categories/"))
11:42hcumberd`like it's used to add a missing /
11:42wingybut then i can't nil the session
11:42wingywhere is the function so i can see what its returning?
11:42wingyhttps://github.com/ring-clojure/ring/tree/master/ring-core/src/ring/middleware
11:43wingyhttps://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/util/response.clj
11:43wingyits doing the same thing as I
11:44MauriceMoss42tataloo: you mean using instead of & or 'and'? (spent quite some time debugging a piece of code where I was using 'and' instead of 'bit-and'... That's when static typing may help a little bit ; )
11:44hcumberd`wingy: don't understand what exactly you mean
11:45wingyhcumberd`: just saying its returning the same response map as i do
11:45MauriceMoss42tataloo: you mean using BIT-AND instead of & or 'and'
11:45MauriceMoss42tataloo: (forgot the word 'bit-and', which may be what you're after)
11:45tataloosure
11:45hcumberd`wingy: yes but it's build in ring functionality. Should be used if available (more readable,...)
11:45MauriceMoss42tataloo: I did just use the Clojure cheatsheet as my 'manual' : )
11:46tatalooyeah :)
11:46hcumberd`wingy: if you use friend like in the example project, you can use friend/logout
11:46hcumberd`It's middleware that cleans out all session information
11:51dbsHelp please on working with multiple handlers (xmpp + noir-async). How do I make a noir/async-push whenever I receive an xmpp message? This code doesn't quite work: http://codepad.org/vGwRtwxD
12:08borkdudeis there a function to append a line to a file, without with-open etc (pref. in clojure 1.3.0)
12:10borkdudeprobably this is just it? (defn log-line [line path]
12:10borkdude (with-open [wrtr (writer path :append true)]
12:10borkdude (.write line)))
12:33hcumberd`wingy: what are you currently writing?
12:34wingyhcumberd`: how so?
12:34hcumberd`users/accounts/http caching...?
12:34hcumberd`Shopping Website?
12:34wingyhcumberd`: yeah :)
12:34wingythought to apply for YC next year
12:34hcumberd`What's YC?
12:34wingyhcumberd`: YCombinator
12:35wingyhcumberd`: and you?
12:36hcumberd`wingy: I've written a blog in clojure, tried a lot frameworks and ideas
12:36wingylink?
12:36clojurebotyour link is dead
12:37wingyclojurebot: yeah . but perhaps not his
12:37clojurebotexcusez-moi
12:37wingyclojurebot: shut up
12:37clojurebotPardon?
12:37hcumberd`https://github.com/kremers/cblog
12:37wingyyou look happy :)
12:38wingyfrom Germany?
12:38hcumberd`yes
12:38wingycool .. huge market
12:39hcumberd`happy? impressions->go ?
12:39wingythe pic
12:40hcumberd`ahh github
12:40hcumberd`yes, it was taken in hamburg on a ship
12:41hcumberd`the market is huge, depending where in Germany you live
13:07TimMcclojurebot: forget your link |is| dead
13:07clojurebotI forgot that your link is dead
13:08hcumberd`!link google.de
13:10Raptumas someone whom is coming from scheme/CL and hasn't used java in a few years, would it really be all that worth my time to run through a refresher course on java again before pursuing the clojure path?
13:10TimMcRaptum: If you've used Java at all in the past, probably not.
13:10Raptumcool.
13:11TimMcClojure uses some newer standard-library features such as the executors framework, but you likely won't need to know anything about that dependency.
13:11Raptumanything massive i'm going to miss from the other lisps?
13:11RaptumCL in particular
13:12TimMcFull numeric tower.
13:13TimMcClojure relies on JVM numerics, which has some weirdness re: hashing, and in version 1.3 abandoned autopromoting math as a default.
13:14TimMce.g. ##(take 4 (range Long/MAX_VALUE Double/POSITIVE_INFINITY)) used to work
13:14lazybotjava.lang.ArithmeticException: integer overflow
13:14Raptumah
13:15TimMc&(take 4 (iterate inc' Long/MAX_VALUE))
13:15lazybot⇒ (9223372036854775807 9223372036854775808N 9223372036854775809N 9223372036854775810N)
13:15TimMcinc', +', *', etc. are the new autopromoting numeric ops
13:15TimMcClojure likes to use longs by default anyway, so it mostly doesn't matter.
13:16TimMcI don't think I've actually needed BigInteger (BigInt?) once.
13:17sqiudzwhat's the best way to write tail-recursive functions in clojure?
13:18hcumberd`loop,recur
13:21sqiudzokay. is loop functional?
13:21dbsany pointers on working with multiple handlers?
13:22hcumberd`sqiudz: yes
13:30borkdudehcumberd` sqiudz there's only some issues about recur, I don't know what this problem is called, but you can't guarantee which recur belongs to which loop or fn
13:31borkdudesqiudz in case you use macro's… forgot what this problem is called though
13:33sqiudzborkdude: I dont use macros, so this shouldnt be a problem right?
13:38borkdudesqiudz in general it works
13:39borkdudesqiudz personally I never ran into problems
13:47DaReaper5Does anyone know how to or if i can return file (of ANY type) with ring on a clojure server
13:47borkdudewhen I connect to an nrepl server and have a nrepl repl in emacs, how do I eval code from some source file?
13:48borkdudeC-x C-e says: lisp-eval-last-sexp is void...
13:48DaReaper5Here is a list of mime types but none of them make sense for ANY type of file: https://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/util/mime_type.clj
13:49sqiudzborkdude: did you change the namespace in the repl for you file?
13:49borkdudesqiudz I switched to the buffer with the source file
13:49borkdudethen I want to eval, just like in slime/swank setup
13:50borkdudenrepl connecting works
13:50borkdudeevaluating from the repl in emacs also
13:50borkdudebut not from a source file
13:51sqiudztry C-c M-n first
13:51DaReaper5Does anyone know how to or if i can return file (of ANY type) with ring on a clojure server
13:51borkdudesqiudz undefined
13:52sqiudzare you running in nREPL mode?
13:52borkdudeI'm using nrepl 1.5 btw. I don't know if the .clj buffer knows about nrepl?
13:52sqiudzi mean nreple-interaction-mode
13:53borkdudesqiudz ah that's it… why do I have to turn it on manually?
13:53sqiudzrun nrepl-interaction-mode in your clojure buffer. that will enable you to evaluate code from source
13:53sqiudzborkdude: not sure, i just started using the emacs version today
13:53borkdudeok
13:53borkdude:-s
13:54sqiudzi just added a line to my init.el that starts it anytime i open a clojure file
13:54borkdudesqiudz maybe I should re-open it
13:54sqiudzyeah maybe
13:55borkdudesqiudz hmm, when I re-eval a function it complains: log-line already refers to: #'twitter-service.views.welcome/log-line in namespace: user -- yes, so?
13:56borkdudehmm, apparently nrepl-interaction-mode doesn't know in what namespace to eval the code!
13:56borkdudebitten by the newness of it
13:56sqiudzdid you do C-c M-n after starting nrepl-interaction-mode?
13:56borkdudemaybe it does work when I re-open the file
13:57borkdudesqiudz I did now, but what does it do?
13:57sqiudzthat should load your namespace into the repl
13:58sqiudzafter having your namespace loaded, just occasionally use C-c C-k to save/reload your buffer, and you should always be synced between repl and source
14:00sqiudzborkdude: any luck?
14:00borkdudesqiudz yes tnx. these are all additional steps from slime/swank though
14:02sqiudzso as far as i know the process is start nrepl server(once) -> load namespace(once) -> save file/eval
14:03borkdudesqiudz yes, probably I ran into some edge case -- I repeat, always when I try to use some new technology I run into problems no-one ever had :-s
14:03borkdudewhat should I use when I want to .writeln to a textfile in clojure?
14:04borkdudedynamically rebind *out*?
14:04sqiudznot sure what you mean
14:06borkdudesmth like this: https://www.refheap.com/paste/7221
14:08sqiudzdont know what binding does
14:12borkdudesqiudz it dynamically rebinds the var *out* to a different stream
14:12borkdudeso all subsequent calls to println will write to the different stream
14:13borkdudeon heroku, if I want to write to a file in my application's resource folder, what (absolute) path do I use? technomancy ?
14:16antares_borkdude: I don't think using absolute paths on heroku is a good idea
14:17antares_borkdude: I assume current directory is a good place to write to, or ./resources
14:17borkdudeantares_ maybe not… should I just use "resources/blah.txt"?
14:18borkdudea matter of trying I guess
14:18borkdudeit seems to work
14:20black_joeI have a question about calling methods from within lists.
14:20black_joehttp://pastebin.com/Z4eq2Csr
14:20black_joeThis function returns nil on execution, but every call seems valid from println debugging.
14:20black_joeSo, is there some special procedure when putting a Class/method function into a list?
14:22borkdudeblack_joe first of all, you will get better help when using refheap.com :P
14:23black_joeSweet, I never knew about that. It has always been such a pain on Pastebin to find the Clojure highlighting
14:26black_joeHmm... It's not just for Class/method. Println, when put in as ordinance's (first (first)) doesn't run either.
14:27borkdudeblack_joe some functions like println return nil, but only have a side effect
14:28borkdudeblack_joe I find your code bit hard to follow
14:28black_joeRight, but still. Double/parseDouble should reutrn a double.
14:28black_joeSorry. It is hastily thrown together to fix a problem that arose this morning.
14:29black_joeWhat I am looking to do is have a function that assigns types to a string based on a letter in parentheses, like "4.0(d)"
14:29borkdude,(Double/parseDouble "2.0")
14:29clojurebot2.0
14:29borkdude,(println (Double/parseDouble "2.0"))
14:29clojurebot2.0
14:30borkdude,(nil? (println (Double/parseDouble "2.0")))
14:30clojurebot2.0
14:30clojurebottrue
14:30black_joe,(println ((second (println Double/parseDouble)) "4.0))
14:30clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading string>
14:30black_joe,(println ((second (println Double/parseDouble)) "4.0"))
14:30clojurebot#<CompilerException java.lang.RuntimeException: Unable to find static field: parseDouble in class java.lang.Double, compiling:(NO_SOURCE_PATH:0)>
14:30black_joeHmm... That could be a problem.
14:31black_joeCrap. I forgot to make that a literal list.
14:32black_joeOkay, I can confirm that this does not work: ((second '(println Double/parseDouble)) "4.0")
14:32black_joeSo... would there be any way to call parseDouble in that fashion?
14:32borkdude,(second '(println Double/parseDouble))
14:32clojurebotDouble/parseDouble
14:33black_joe,((second '(println Double/parseDouble)) "4.0")
14:33clojurebotnil
14:33black_joeSee?
14:34borkdudeblack_joe you must read that as ('Double/parseDouble "4.0")
14:34black_joeSo it's being considered literal, then?
14:34black_joeWhat would be the correct way to call it in that fashion.
14:34borkdude,('foo {'foo 2 'bar 4})
14:34clojurebot2
14:35borkdudeblack_joe symbols look themselves up in maps (they behave as functions), that's why you get nil here
14:35borkdudeblack_joe how to convert a symbol to a method.. I would wrap the method into a function first and throw around the function
14:37black_joeWell, that's a bit overly complex. I will just throw an if structure together instead of having a list of functions.
14:37black_joeThanks. Also, thanks for the refHeap.
14:38borkdudeblack_joe that's probably a better idea, welcome
14:39black_joeI just usually avoid that since it limits the scalability to work on other types. But I guess with the limited number it would be best.
14:39apwalkblack_joe: your code works as written, when called as (apply-type "4.0(d)" [["(d)" #(Double/parseDouble %)]])
14:39apwalkor as (apply-type "4.0(d)" (list (list "(d)" #(Double/parseDouble %))))
14:40TimMc,(read-string "4.0") :-P
14:40clojurebot4.0
14:40black_joeHmm... Never seen "#". Guessing that's the reader macro for a function.
14:40TimMcblack_joe: Anonymous function literals.
14:40black_joeIs the "%" significant? That's new to me too.
14:41TimMc&'#(+ % 3)
14:41lazybot⇒ (fn* [p1__11288#] (+ p1__11288# 3))
14:41TimMc&'#(+ %2 3)
14:41lazybot⇒ (fn* [p1__11300# p2__11299#] (+ p2__11299# 3))
14:42black_joeWell, glad to learn about those two. But the more I think about it, I am doing it with a cond.
14:43black_joeUsing a list in this case could end up hurting someone calling it wrong, rather than helping them.
14:45TimMcblack_joe: %1 (or %) through %9 are symbols captured by the fn literal reader macro.
14:45TimMc%& as wlel
14:46black_joeI am planning to read up on reader macros soon. I skipped over them in the book I read to learn Clojure. Along with destructuring.
14:46borkdudeI usually find using (fn [] …) more pleasant to read though than #(% … %9), also #'s can't be nested
14:47black_joe^ I've always used fn as well.
14:47Mr_Bondsometimes it is handy with #(% .. etc), to put data at some place in the middle of a function
14:48Mr_Bondor several levels of recursive functions
14:50DaReaper5Does anyone know how to or if i can return file (of ANY type) with ring on a clojure server
14:51borkdudeDaReaper5 I'm sorry, don't know
14:51nightfly_Is there a way to get a list of all the classes in a Java package available to clojure?
14:53Mr_Bondnightfly_: yes, you can do it in the same way as in java, since all java classes are also available to clojure, and you can call the same methods via clojure
14:54Mr_Bondlike the refections library, can be used for it
14:54Mr_Bondhttp://code.google.com/p/reflections/
14:57nightfly_Mr_Bond: Thanks, checking it out now
14:58hcumberd`Is there a JVM free clojure?
14:58black_joeTechnically Clojurescript.
14:58hcumberd`I heard of clojurec but it's not 1.4 right?
14:59hcumberd`Clojurescript,... mhh.
14:59hcumberd`Is there anything like a compiler (like in LISP)
14:59black_joeNot that I know of, no.
15:01Mr_Bondhcumberd`: it runs on .net as well
15:01RaptumMr_Bond: clojure does?
15:02Mr_Bondyes
15:02Mr_Bond.net and jvm
15:02Raptumintredasting
15:02Mr_Bondand javascript as mentioned
15:02Raptumyes of course
15:02Mr_Bondprobably possible to get it working on llvm or such as well
15:02Mr_Bondwell, it is possible, but a fair amount of work
15:03Mr_Bondand have it compiled to machinecode
15:03hcumberd`what is llvm?
15:03wingyhcumberd`: lisp on clojure
15:05Mr_Bondhugod: it's sortof the basis of a compiler, which you can put compilers on top of
15:05Mr_Bondlike clang (compiler), or llvm-py (python compiler)
15:05magnarswhat's the significance of the @ in `@(d/transact conn schema-tx)` ?
15:05wingyhcumberd`: i meant lisp on erlang
15:05Mr_Bondhcumberd`: sorry, I ment to write to you
15:06wingyhcumberd`: http://joxa.org/
15:06wingyhttps://github.com/schani/clojurec
15:06wingythe latter is not up to date it seems
15:07Mr_Bondclojurec looks cool
15:08wingyi donno .. sometimes i wished clojure was on c
15:08wingynot java
15:08Mr_Bondthat would be ideal for things like raspberryPi
15:08hcumberd`thx 4 joxa link
15:09hcumberd`I like to use clojurec far more then the jvm sh**
15:09hcumberd`Clojure uses a bit of java syntax for string handling
15:09hcumberd`doesn't know how clojurec handles it
15:09hcumberd`It's a project I like to see evolve
15:11Mr_Bondthe backend to files in clojure is pretty much java's File object as well
15:11Mr_Bondthat will probably not work well either on clojurec
15:12hcumberd`Mhh Damn!
15:13hcumberd`Most things I write rely on the file handling functionality
15:14Mr_Bondyou could create a simular interface in clojurec, but if you had to spend a lot of time re-inventing java interfaces, it might not be worth using it for the benefits of C. JVM is pretty good on many things as well, even compared to C
15:15Raptum...can i write android apps in clojure?
15:15Mr_Bondgoogle seems to think so: I found this: http://www.deepbluelambda.org/programming/clojure/creating-android-applications-with-clojure
15:15hcumberd`But it's now from ORCALE
15:16hcumberd`there are so many bad libs
15:16hcumberd`bad quality everywhere ;(
15:16black_joeRaptum: Yes, but it would be more sane to write the functions of your program in Clojure and the Ui / resource stuff in Java.
15:16Raptumah
15:16wingyMr_Bond: but then we wouldn't need java interop thus interfaces right .. the whole OOP thing
15:16hcumberd`OpenJDK may help
15:17Mr_Bondwingy: is that a good thing or bad thing? :)
15:17wingyno OOP!
15:17wingyOOP is bad
15:17hcumberd`-> more kind of a bad thing when you ask me
15:17Raptumlol
15:17hcumberd`lol^2
15:17Mr_Bondhehe
15:17wingyRich said so
15:17Raptumhence why this isn't #java?
15:17borkdudeClojure is build using an OOP language, so it can't be that bad right? ;)
15:18Raptumborkdude: sure it can
15:18Raptumoh
15:18Raptumoops didn't see the sarcasm
15:18hcumberd`Maybe I'll need a guide. How to migrate from Clojure to Java
15:19Mr_BondIf clojure ran outside jvm, wouldn't it just be another lisp?
15:19hcumberd`Mr_Bond: Clojure is more than that
15:19hcumberd`STM,..
15:19wingylazyness
15:19wingydatomic and light table!
15:19Mr_Bondhm yeah maybe
15:19ivaraasendrugs!
15:20wingyRich!
15:20Mr_Bondivaraasen, that sounds very norwegian-like:)
15:20Raptum'baccer!
15:20ivaraasenMr_Bond: probably
15:20hcumberd`You can feel the jvm
15:20hcumberd`from startup times to memory consumption
15:21ivaraasenspeaking of drugs, I wonder what kind of drugs the guys that made this CSV file were using
15:21Mr_Bondivaraasen: kult at det er flere nordmenn her :)
15:21Mr_Bonddo you mean in a good or bad way?
15:21wingybut then sometimes i agree that using a platform is a good choice
15:22Mr_Bondmaybe he was high on baby jesus
15:22wingylike i am using jquery mobile instead of doing native apps
15:22ivaraasenwell, tons of filler stuff (........... everywhere), many lines are empty, not everything is aligned correctly, and some fields are split over two-three lines
15:23Mr_Bondivaraasen: ah, I think that drug is trending, because last week I got an email written entirely in the Subject field.
15:24ivaraasenMr_Bond: SSB har skylda for den fila, forøvrig :)
15:24Mr_BondStatan!
15:25ivaraasenMr_Bond: UiO or NTNU?
15:25Mr_Bondivaraasen: I'm at Copyleft Solutions
15:26ivaraasennice!
15:27Mr_BondBut working at a lisp-shop, I'm not actually a lisp-programmer. It's something I've learned for fun in my spare time, I work with system administration
15:31ivaraasenI mostly do Clojure for quick data hacking myself. I'm really a journalist/editor.
15:32RaynesEverything I say is off the record.
15:33RaynesI've always wanted to say that to a journalist.
15:33hcumberd`;)
15:35ivaraasenRaynes: as far as journalists are concerned, people are always on record ;)
15:35RaynesI know. :(
15:36ivaraasenI really don't get tech journalism though
15:36Mr_Bondivaraasen: cool :)
15:37Mr_Bondivaraasen: do you freelance or work for some publisher?
15:38ivaraasenMr_Bond: I'm planning on doing some freelance writing soon
15:39ivaraasenATM I'm way too busy reading for my exams though
15:41Raynesivaraasen: You can interview me whenever you like, friend. I'm all the rave everywhere.
15:42ivaraasenRaynes: sure thing. Refheap looks really good, btw
15:42Raynes<3
15:42ivaraasenhttps://www.refheap.com/paste/62330608de0bf0a395eb59d30
15:43ivaraasenhorrible code, but the CSV file was even worse
15:43RaynesCSV.
15:43ivaraasenthank god we have Google Refine these days
15:43RaynesI've got to do some stuff with csv at work.
15:44RaynesThinking about quitting and cleaning windshields instead.
15:46ivaraasennobody deserves CSV, with the possible exception of Sweden
15:51ivaraasenthe by-year function is quite handy. turns a nested map like {:a {:a1 1 :a2 2} ... :z {:a1 3 :a2 666 }} into {:a1 {:z 3 :a 1} :a2 {:z 666 :a 2}}.
15:51ivaraasenthere's probably a built-in for that, but I couldn't find it
15:53TimMc"Don't quote me on this."
15:54Mr_Bondivaraasen: hehe
15:59gfredericksdoes anybody know about the official supportedness of js/foo and js* in cljs?
16:07TimMcIs anything ever official in CLJS land?
16:07TimMcI haven't followed too closely, but I don't recall a 1.0 release.
16:08mpenetI think I have heard a few times not to use js*
16:08TimMcor an official doc site, which is more relevant
16:08mpenetjs/FOO is probably here to stay otherwise you dont get access to the js world
16:08mpenetwell the global scope
16:13gfredericksyeah I think that about summarizes what I've heard about the issue as well
16:25wei_is there a good way to test cemerick/friend with context, similar to noir's with-noir macro?
16:41Raptumhow could i perform something like this and flatten the resulting list? http://ideone.com/lqycdM
16:43RaynesRaptum: What is the end result supposed to look like?
16:43Raptumthe same thing, but flattened; never mind, someone got it for me: http://ideone.com/IwWLgX
16:44RaynesRaptum: That function is in clojure.core btw.
16:44Raptumi know.
16:44RaynesJust checking.
16:44Raptuminterlace or something
16:44Raptuminterleave*
16:46ivaraasenI guess you could use mapcat vector as well, to avoid explicit recursion
16:48gfredericksthe golden rule of clojurescript: "It's not just JavaScript!"
16:49TimMc
16:49nightfly_Java interop doesn't always seem to behave as expected. ConfigurationBuilder.setScanners(s ...) expects something that implements the Scanner interface, which ResourcesScanner does. But line 20 fails with a ClassCastException. https://www.refheap.com/paste/7225
16:49gfredericks:)
16:50bbloomnightfly_: do you want -> or do you want 'doto ?
16:51TimMcLine 20 shouldn't fail on the basis of that, though.
16:51bbloomTimMc: you're right, didn't realize that line 19 was commented out
16:52bbloomnightfly_: do you have javadocs or source for any of those types? would need to look at the methods to say what's going wrong
16:53nightfly_Yeah, http://reflections.googlecode.com/svn/trunk/reflections/javadoc/apidocs/index.html?org/reflections/Reflections.html
16:54holohi
16:54clojurebotHuh?
16:54gfredericksdoes having reified types in cljs for keywords and symbols have prohibitively poor performance?
16:54TimMcnightfly_: varargs
16:54TimMcnightfly_: I could have told you that if you'd provided the message of the exception.
16:54TimMc~varargs
16:54clojurebotvarargs is a fiction of the Java compiler -- from Clojure, you'll need to pass in an array of the appropriate type. See into-array and float-array, etc.
16:54dnolengfredericks: unknown, but I doubt it.
16:55bbloomTimMc: beat me to it :-)
16:55gfredericksdnolen: is that an eventual want then?
16:55TimMcThough actually, I could have guessed based on the method name being plural.
16:55dnolengfredericks: yes
16:55gfredericksdnolen: with interning as well?
16:56bbloomgfredericks: I took a crack at it quite a while ago and couldn't quite get performance up to snuff, but that's probably my fault, not the approach
16:56dnolengfredericks: that's the idea yes.
16:56nightfly_TimMc: bbloom Ah! Didn't know that, thank you.
16:57gfredericksbbloom: do you have a branch somewhere?
16:57bbloomgfredericks: https://github.com/brandonbloom/clojurescript/commits/keywords-and-symbols
16:58bbloomgfredericks: totally hacked up attempt
16:58gfredericksbbloom: cool, thanks
16:58bbloomgfredericks: you gonna take a shot at making it work? :-)
16:59bbloomgfredericks: I forget now, but I *think* the main performance issue was that identical? was no longer a sufficient test and = needed to be used to support runtime keywords, symbols, etc
16:59bbloombecause javascript doesn't have weak references
16:59bbloomso each runtime keyword or symbol would be a memory leak if interned, which was unacceptable
16:59gfredericksbbloom: oh so we don't want to intern the runtime ones as well?
16:59gfredericksI see
16:59gfredericksthat is tricky then.
16:59bbloomyeah, really tricky
17:00gfredericksshouldn't that be no worse than what happens currently?
17:00gfrederickspresumably (= kw1 kw2) checks identical? first and then walks through the strings?
17:00gfredericks(at least at the vm level)
17:01bbloomgfredericks: except there's a function call overhead (generally) as well as a protocol dispatch on not identical?
17:01gfredericksand interning would just give you an identical?-hit more often?
17:02gfredericksclj-jvm keywords use weak refs?
17:03murphy_good evening! I was doing a bit of work on 4clojure.org and for the solution to problem 19 (find the last element in a sequence without using "last"), one of the reference solutions was' reduce #(-> %2) ' can someone help me understand what that means?
17:03bbloomgfredericks: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Keyword.java#L37
17:03gfredericksbbloom: I might well play with it after tuesday; I'd like to contribute in some way or another; so far I've not exceeded too well.
17:04murphy_e.g. what does the sigil "->" mean ? I read somewhere that it's some sort of stream operator, but googling for it is proving somewhat unproductive
17:04bbloom(doc doc)
17:04clojurebot"([name]); Prints documentation for a var or special form given its name"
17:04bbloom(doc ->)
17:04clojurebot"([x] [x form] [x form & more]); Threads the expr through the forms. Inserts x as the second item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the second item in second form, etc."
17:04murphy_woah! Thank you!
17:04bbloomwhile you're at it, if you've never read through `man man` you really ought to :-)
17:04gfredericksbbloom: I saw that band once
17:05murphy_haha
17:05bbloomheh
17:05gfredericksonly by accident though
17:05RaynesThis is a pretty horrid use of -> for the purpose is keeping number of characters as low as possible.
17:05gfredericks#(-> %) is short for identity I imagine?
17:05murphy_yeah, of course, but I figure it'll come into play later and I want to understand it
17:05gfredericksthough why you'd want to (reduce identity ...) I can't imagine
17:06bbloomwell it was %2
17:06gfredericksoh right
17:06bbloomwhich seems odd too
17:06AimHereWell the idea is that he's just using reduce to get to the last element of a list
17:06gfredericks(reduce #(-> %2) ...) should be equivalent to last then?
17:07gfredericksbut last is a shorter way to say that
17:07AimHereRight, but your 4clojure problem is set in a world where the 'last' command has been outlawed by Rich Hickey, in a fit of spite
17:07gfrederickslol
17:07gfredericksof course
17:08murphy_hahaha
17:08seangroveImpressive amount of spite to do that, hah
17:08AimHereClojure's collections are SOOO good, they should never ever end
17:09TimMcCommit message: "'last is a sign you're using the wrong data structure; removed"
17:09bbloom#(drop (count (butlast %)) %)
17:09AimHereJust evaluate them lazily
17:09bbloom#(first (drop (count (butlast %)) %))
17:09bbloom,(#(first (drop (count (butlast %)) %)) [1 2 3 4 5])
17:09clojurebot5
17:09bbloomw00t.
17:09TimMc,(reduce #(do %2) [1 2 3 4 5])
17:09clojurebot5
17:10TimMcdo is just as good as -> here
17:10bbloom,(first (reverse [1 2 3 4 5]))
17:10clojurebot5
17:10bbloomi think that's shorter :-)
17:10bbloomand slower.
17:11TimMc(comp peek vec)
17:12bbloomanyway, gfredericks you'll also need to emit pre-interned symbols and keywords for all those known statically to be in use at compile time
17:13ivaraasenTimMc: or maybe even #(% (dec count %)) vec
17:17TimMc,(#(% (dec count %)) vec [1 2 3 4 5])
17:17clojurebot#<CompilerException clojure.lang.ArityException: Wrong number of args (2) passed to: core$dec, compiling:(NO_SOURCE_PATH:0)>
17:17TimMcNOPE.
17:18TimMcbut I like your style.
17:19ivaraasenerr, typo. sorry
17:19ivaraasen,(#(% (dec (count %))) [1 2 3 4 5])
17:19clojurebot5
17:20ivaraasen,(#((into [] %) (dec (count %))) [1 2 3 4 5])
17:20clojurebot5
17:20ivaraasenbulletproof version
17:20ivaraasenin case you get, say, a list
17:21mpenet,(#(first (take-last 1 %)) [1 2 3])
17:21clojurebot3
17:21mpenetit's almost cheating, ok
17:22gfredericksbbloom: right; and that part you didn't do?
17:24Sgeohttp://clojuredocs.org/clojure_core/clojure.walk/macroexpand-all
17:24SgeoIs there a significant chance that Cubic didn't see my quote mark?
17:26bbloomgfredericks: i hacked it up for perf testing: had a manual list of symbols to intern iirc
17:32gfredericksah ha
17:32holoi'm new to tests. i just noticed i can't test a hidden function. am i supposed to not need to test them, so this wouldn't be addressed as a problem at all?
17:33bbloomholo: you can access privates via their vars
17:34bbloom(defn- secret-f [x] (inc x))
17:34bbloom(#'secret-f 5)
17:35holobbloom, that's super cool. thanks!
17:47ziltiException in thread "main" java.io.FileNotFoundException: Could not locate clojure/tools/macro__init.class or clojure/tools/macro.clj on classpath
17:47ziltiWhat might cause this error?
17:48seangrovetechnomancy: Having troubles pushing a clojur app to Heroku, getting errors that "Failed to transfer file: http://s3pository.herokuapp.com/maven-central/commons-pool/commons-pool/1.6/commons-pool-1.6.pom. Return code is: 503, ReasonPhrase:Service Unavailable: Back-end server is at capacity."
17:48nightfly_Well, solved my real problem. It seems that an uncatched exception is raised when initializing a java class clojure reports it the first time and after that just doesn't acknowledge the class exists. The problem was in the java code the whole time :/
17:49nightfly_s/ an / when an /
17:55gfredericksthe himera synonyms page claims that nested mapping over lazy seqs only traverses something once??
17:55lazybotgfredericks: Definitely not.
17:55gfredericksAnd I think Sgeo was claiming that about clj-jvm yesterday (though I convinced him otherwise)
17:55gfrederickswhere does that idea come from? is there anything to it?
17:56Sgeo...I thought you just convinced me that it doesn't actually save work unless you only take a part of the result
17:57gfredericksright
17:57gfredericksbut it looks like fogus is saying the same thing you did
17:57SgeoThat's different from saying that the it's traversing multiple times
17:57gfrederickswell you can imagine that it walks them both at the same time, but it's not an interesting thing to point out performance-wise, as I understand it
17:58gfredericks(it's at the top of the Lazy Sequences section here http://himera.herokuapp.com/synonym.html)
17:58SgeoIt is an interesting thing to point out when it comes to "now I take the first three elements from the result"
17:59gfredericksdefinitely, but his example doesn't have that characteristic
17:59SgeoWell, if someone already knows about lazy lists, it's a good thing to point out
18:01gfredericksI wonder if it has positive effects on memory access due to locality
18:05gfredericksis there any decent way to use cljs-HEAD with lein-cljsbuild? checkouts doesn't seem to work since cljs isn't a lein project
18:06wingyis 5000 LoC much for a project
18:06ivanwingy: depends on if you've got multiple projects in your project
18:06gfrederickswingy: depends on what the project is for
18:06wingyivan: No
18:07wingygfredericks: its a SAAS
18:07gfredericksyes anything above 2744 is always too much
18:08seangroveAnyone else able to deploy Clojure apps to Heroku? Was going to announce Jida on the ml, but now it seems we can't push anymore, and it's down.
18:09wingygfredericks: ? :)
18:10gfrederickswingy: delete linebreaks until you're below that threshhold.
18:11ivana weird thing I've seen twice in Clojure projects now is a completely unnecessary macro that duplicates a function
18:11ivannot always obvious until you actually try to refactor and notice that it's 100% redundant
18:13gfredericks(undefmacro ...)
18:13ivanheh
18:43omarkjHey.
18:43omarkjI was wondering if anyone could explain this to me (I'm new at clojure so I might be unwrapping this to the wrong expression) https://gist.github.com/4f90605e5978fd7d9db4
18:50omarkjI would have expected those arrays to match that is.
18:56omarkjWrong operator - sorry.
19:40SgeoAs much as I hate to admit it, I'm starting to see advantages to clojure.algo.monads
19:41gfredericksover other monadic libs or over not monads?
19:41SgeoOver other monadic libs
19:42SgeoAlthough the only other one I know of is protocol-monads
19:42gfredericksI haven't looked at algo.monads since I decided I understand monads more than I don't
19:42hcumberd`Any better way to write: (filter #(some #{(tx_basename %)} order) (filter #(= (fs/extension %) ".opt") files))
19:43hcumberd`nesting filter looks wired
19:43kaoD_any good source on WTF are monads?
19:43gfrederickshcumberd`: you can unnest with ->> at least
19:43gfredericksbut since they're both filters
19:43gfredericksyou could also just combine the filter functions
19:43kaoD_I read it some time ago but apparently I couldn't grasp the concept, because I coudln't explain it if I tried
19:43gfrederickskaoD_: I read several things and they didn't really make sense until I tried to actually write some haskell code
19:43spaceshipsi wonder what they mean outside of haskell
19:43mdeboardHi, I'm preparing an example illusrating agents for a presentation, and I'm having trouble articulating why my example code works the way it does. The comments on lines 21-25 are what I could use a hand with.
19:43mdeboardhttps://gist.github.com/4191817
19:43bbloomkaoD_: http://www.intensivesystems.net/tutorials/monads_101.html
19:44gfredericksspecifically I read LYAH and did a lot of project euler
19:44gfrederickshcumberd`: you could combine them abstractly with every-pred, or just use and
19:45kaoD_gfredericks: yep, Haskell's in my huge-pile-of-thing-to-do
19:45kaoD_I guess this is the perfect excuse to look into it :)
19:45kaoD_bbloom: thanks
19:45gfredericks~monad
19:45clojurebotmonad is "yea, though I should walk in the valley of imperative code, I shall fear no evil, for your monad comforts me" - seen in #haskell
19:45gfredericks~monad
19:45clojurebotmonad is monads
19:46gfredericks~monad
19:46clojurebotmonad is monads
19:46bbloom~monads
19:46clojurebotmonads are http://www.bolour.com/papers/monads-through-pictures.html
19:46gfredericksWAT
19:46mdeboardBasically, WITH the `(apply await-for ...)' line, the return value is the return value of the `(touch)' fn; otherwise it's the return value of the last line of `(make-files)'. So I assume that the evaluation of `(touch)' is the last thing to be processed in this example, which is why, given time, its value is what's returned.
19:46mdeboard"degenerate monad producer" sounds like a job title your mother wouldn't be proud to tell peopl you have
19:48kaoD_I've read like 15 definitions of "monad"
19:48kaoD_and most of them are orthogonal
19:48spaceshipsa typeclass that implements bind and return :P
19:48mdeboardkaoD_: The guys in #haskell have a lot of jokes around people trying to define monads
19:49mdeboardit's a something soemthing functor something donald knuth
19:49mdeboardthat's all I know.
19:49kaoD_pffft hahahaha
19:49SgeoA monad is a monoid in the category of endofunctors, what's the problem?
19:49SgeoAlso, a monad is like a burrito
19:49mdeboardastronaut*
19:49bbloomextremely simply: it's an interface with three functions that happen to have interesting compositional behavior
19:49gfredericksa comonad is like a fajita
19:49bbloomthat's it.
19:49SgeoA monad is a burrito that has eaten an astronaut.
19:50mdeboardnailed it.
19:50gfredericksa fajito that has eaten a cosmonaut
19:50gfrederickss/fajito/fajita/
19:50SgeoSorry. It's just that a lot of people seem to write monad tutorials, many of which try to use analogies, and there's so many that there are jokes about them
19:51mdeboardAnyway, anyone have a clearer explanation of my example than I can muster?
19:51mdeboardhttps://gist.github.com/4191817
19:51mdeboardlines 21-25
19:51kaoD_okay I hate y'all
19:51gfredericksSgeo: in my experince every talk/article about monads starts by complaining about all the talks/articles about monads
19:51kaoD_well not you all, but most of you
19:51SgeokaoD_, sorry
19:52kaoD_Sgeo: don't worry, I like astronauts
19:54SgeoUm, I don't see clojure.tools.macro on Clojars
19:54SgeoHow am I supposed to obtain it?
19:54bbloom~contribs
19:54clojurebotNo entiendo
19:54bbloom~contrib
19:54clojurebotMonolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
19:54bbloomhow do i teach clojurebot things?
19:54bbloomclojurebot: contribs is contrib
19:54clojurebotAlles klar
19:54bbloom~contrib
19:54clojurebotMonolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
19:55bbloom~contribs
19:55clojurebotcontribs is contrib
19:55bbloom:-)
19:56SgeoShould I just use it from maven?
19:57SgeoGuess I can try it
20:02tomojhttp://search.maven.org/#search%7Cga%7C1%7Ctools.macro
20:03tomoje.g. for a conkeror webjump, "http://search.maven.org/#search\%7Cga\%7C1\%7C%s&quot;, maybe something similar for other browsers (?)
20:03Sgeoclojure.tools.macro/mexpand does NOT macroexpand inner forms
20:04tomojyeah, sorry, that was misinfo
20:04tomojwell, you need mexpand-all
20:04tomojbut I think your problem with &env will still be there
20:05SgeoYes, it is.
20:06SgeoBut there is a way to do a (not full) macroexpansion and pass it an &env
20:07Sgeouser=> (#'get-env '(get-env) {'a 1})
20:07Sgeo{(quote a) a}
20:08tomojhmm.. consider (defmacro foo [& body] `(let [~'foo 42] ~@body)). then (foo (env-using-macro))
20:12SgeoHow many forms change the &env of their bodies, and do any macros actually use the values of the &env rather than just the keys?
20:13tomojI don't know how you could use the values if you wanted
20:13tomojin clojurescript the &env is very useful
20:13tomojand some macros will do a lot with it :(
20:14tomojin clojure I think (hope?) just let* and loop* change &env
20:14Sgeofn and variants too
20:14tomojoh yeah
20:14tomojfn*, let*, loop*?
20:15SgeoWhat about bound-fn and variants? Do those just expand to ultimately fn*?
20:15bbloomSgeo: i use both &env and &form for my CPS transform in cljs
20:16bbloomi need to know if a macro is expanded into a return position, for example
20:16Sgeobbloom, but the question is, do you somehow change what the body sees without using let* fn* or loop* ?
20:16SgeoWait, you're already doing CPS transforms?
20:16SgeoI assume you must use a macroexpander?
20:17bbloomSgeo: not finished: https://github.com/brandonbloom/cljs-cps/
20:17bbloomi rely on the cljs analyzer's expanding
20:17Sgeo(My main interest here is CPS)
20:17SgeoAh
20:17gfredericksis there anything published about typed-clojure for cljs yet?
20:18bbloomSgeo: i don't need the CPS transform quite yet (eventually) so i put it on the back burner for now
20:18SgeoIt would be nice if Clojure just exposed its internal macroexpansion
20:18bbloomSgeo: I was also waiting for various patches to land in cljs proper that were blocking me
20:19bbloomnot strictly necessary, since you need the AST info to macro expand
20:20bbloomSgeo: you can just run the analyzer and you get back an AST
20:20bbloomthen simply (:form ast)
20:20bbloomand you've got a fully macroexpanded form
20:20Sgeobbloom, what analyzer?
20:20tomojso in cljs, using the analyzer on (foo (env-using-macro)) works fine
20:20bbloomthe clojurescript analyzer
20:20Sgeobbloom, was talking Clojure
20:21bbloomah
20:21bbloomwell any patches that make the clojurescript analyzer more useful for clojure code would surely be appreciated :-)
20:21tomojbut in clojure there is no working mexpand-all for that?
20:21bbloomim not as familiar with the internals of clojure itself
20:21bbloomdunno
20:36tomojSgeo: looks like you can do (with-bindings {clojure.lang.Compiler/LOCAL_ENV env} (macroexpand-1 form))
20:37tomojbut that doesn't completely solve the problem, does it
20:56Sgeotomoj, hmm, in what sense?
20:57jkdufairdoes anyone have apps deployed on heroku? mine died, unchanged, apparently due to s3pository being down
20:58tomojSgeo: you can define a (fn macroexpand-1 [form env]) which binds LOCAL_ENV to allow passing the env down, but if you macroexpand-1 something and wind up with a let*, you still have no easy way of recursively macroexpanding it
21:02SgeoDetermine what the env should be inside the let* and call macroexpand-1 with that on the inside?
21:04SgeoI need to stop thinking about this and work on Senior Project
21:24bbloomdid somebody mention that they were working on a toy version of datomic?
21:31black_joeSo earlier #clojure helped me fix some problems in my language. It's now fixed for anyone that liked the sounds of it earlier. http://dymatic.github.com/MicroMarkup/
21:31black_joeIt's a static language for Clojure data structures.
21:36tomojblack_joe: seems pretty difficult to understand what it is
21:38black_joeIt just seperates data from source files. Kind of like a database, but with lists and maps instead of tables.
21:38SgeoOh dear god "instance cool object named y that came from x" I'm scare
21:38Sgeoscared
21:39black_joelol, inline documentation. Yup.
21:40tomojwhat does it give you over just putting clojure data in those data files?
21:41black_joeEasy human readability and typing, mainly.
21:41black_joeAnd less syntax-to-content ration for large structures.
21:41black_joeratio*
21:41SgeoI wrote a bot in Tcl, and its configuration files are arrays
21:42SgeoIt makes those files very readable
21:42Sgeoserver irc.example.com
21:42Sgeochannel #example
21:42Sgeoetc
21:42SgeoIt does get kind of bad in another of the files, though
21:42bbloomTcl is an under appreciated language
21:42Sgeofeeds {abc def}
21:43Sgeoabc,url http://example.com
21:43Sgeobbloom, Tcl is awesome
21:43bbloomthe idea of a command-by-default language is brilliant
21:43bbloomjust like ERB is just like a ruby file that is in template mode by default
21:43bbloomTcl is a language that is in shorthand command usage mode by default
21:43bbloomit's clever
21:45SgeoI think I would rather have top-level commands be wrapped in []. Or an id command that isn't some obtuse usage of something else
21:46SgeoWhat I really like about Tcl is the lack of what Lispers would call special forms
21:46SgeoEverything is a command
21:46SgeoAnd you can pass code (albeit as a string, which kind of sucks) to commands, and you can generate parts of that code on the fly
21:49seangroveWhat's the best way to dynamically invoke a function name known only at runtime in cljs?
21:50seangroveSomething like ((str service "-menu") menu-data)
21:50bbloomseangrove: there isn't one
21:50bbloomseangrove: not if you want to use advanced compilation anyway
21:50seangroveI could put all of the fn's into a map and call them from there, but not sure if that's best practice
21:50seangroveHmm
21:50bbloomseangrove: yes, do that for the subset of functions you expect to call dynamically by name
21:50bbloomor seek an alternative approach
21:50seangroveok, that works
21:51seangroveThere will only be ~30 of them, not a big deal, just wondering
21:51bbloomuse aset and aget
21:51bbloomon a (js-obj)
21:52seangroveOr I could do: (defn stripe-menu ...) (defn another-menu ...) (def menu-fns {:stripe stripe-menu :another :another-menu})
21:52seangroveUltimately it'd be the same performance characteristics, right?
21:52bbloomroughly
21:52seangroveNo big gotchas?
21:53bbloomif you plan on having a never changing map, a single (def menu-fns (js-obj "stripe" stripe-menu …))
21:53bbloomthat would perform best, most likely
21:53seangroveYeah, never changing
21:53bbloomaget on that
21:53seangroveSounds good, thanks
22:02seangrove,(doseq [item (map identity [123 123 123 ])] (fn [x] (println x )))
22:02clojurebotnil
22:02seangroveWell, yes, that should be nil
22:03seangroveBut it seems like the side-effects aren't carried out - println isn't called in my repl
22:03seangroveAhk
22:03seangroveYes, nevermind, stupid mistake
22:06clj_newb_2345is it possible, through soem reflection Matic, to get from a defrecord to it's type? I.e .I have (defrecord Foo []), (defrecord a (Foo.)) ; now, given "a", I want to recover either Foo. or ->Foo
22:11unnaliclj_newb_2345 (though absent): (class (Foo.)) does yield Foo
22:11unnali(which you can then call (new …) on)
22:12SgeoI thought new only accepts symbols, you can't pass a dynamically found class?
22:12Sgeo,(new (class []))
22:12clojurebot#<CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: (class []), compiling:(NO_SOURCE_PATH:0)>
22:14unnaliYeah, so you're right.
22:14unnaliNot certain how one is meant to do that, but I'm sure there's a way.
22:15SgeoThis is why I like Tcl.
22:21echo-areaNrepl is much easier set up than ritz. I haven't tested if it requires as much memory as ritz though.
22:34gfredericksaugh
22:34gfredericksadvanced compilation is refusing to work :/
22:34gfredericks(with jquery)
22:34muhooexterns?
22:34gfredericksyep
22:34gfredericksgot the jquery externs file, have it listed in the project.clj...no evidence it's being used
22:35gfredericksit is in /resources/externs/jquery-1.8.js
22:35muhoodunno then, sorry.
22:35gfredericksand the build in project.clj has {:compiler {... :externs ["externs/jquery-1.8.js"]}}
22:37gfredericksah; I don't think the leaving off of /resources was a good idea
22:37gfredericksI think I might send a pull request for the jayq readme :)