#clojure logs

2012-01-04

00:05amalloysomeone did something like that. but it's very dangerous territory: you're abstracting over stuff that you really need to know/care about
00:41technomancy_man, there's a lot of potential in clojuresphere
00:43wingieare there some cool products created with clojure?
00:43wingieand how do you think clojure compares to scala?
00:44technomancy_clojurebot: scala?
00:44clojurebot{((x: Any, y: Any) => (f: Function2[Any, Any, Any]) => f(x, y))(1, 2)((x: Any, y: Any) => x)}
00:44wingiewhats that?
00:46technomancy_scala
00:47wingiedont get the example .. it's demonstrating the verbosity of it?
00:47amalloyi think the dramatic illegibility. like, i get haskell type signatures, but i can't even begin to guess what this means
00:47technomancy_yeah, I have no idea
00:48technomancy_my take-away is that scala is easier for Java people to learn because it lets them mix imperative OO and FP.
00:48technomancy_and for some reason, some people think that's a good thing.
00:48wingieare there times you need oop in clojure?
00:48wingieits like js embracing oop and fp
00:49wingiecould be a good thing?
00:49wingiewho said fp fits for every situation
00:49wingiealso if all langs were fp we would have missed oop :)
00:49wingieso good to be able to use whatever we want whenever we want perhaps
00:49technomancy_well... if you can't see why that's bad maybe you should spend some time doing scala.
00:50technomancy_or JS for that matter
00:50wingieim spending quite of an amount on js
00:50wingiebut im still very new to programming in general
00:50wingieits due to the mutable states in objects?
00:51wingie*reading programming clojure*
00:51technomancy_OO is a bunch of concepts bundled up together
00:51wingieperhaps it will give me some more hints
00:51technomancy_some of them are good, but there's no reason to take them as a whole
00:52wingiecouldnt you say that they make more sense for our mind?
00:52fryguywingie: no
00:52wingiewhen you have robot .. he has a name .. he can do things etc
00:52amalloyyou can say anything you want. the english language is very expressive
00:52wingiekinda like theatre
00:52technomancy_OO is definitely more intuitive to people who have been trained in OO.
00:53amalloysame thing applies to mutable state. SICP goes forever without introducing any mutability and then is like "okay look, you can change things if you want. see how many of our existing concepts/rules this breaks?"
00:55amalloybut if you grew up thinking of programming as "do this, do that, now do this" then it feels "natural" to use mutation, and "restrictive" not to; as opposed to "natural" to program functionally and "world-breaking" not to
00:55skelternetwasn't OO's birth in SmallTalk supposed to be more around so-called message-passing and not so much function calls? That seemed like a big deal
00:56amalloyone of the things OO originally emphasized was immutability
00:57wingieamalloy: the former is imperative programming and the latter is functional programming?
00:57amalloyyes
00:57technomancy_amalloy: eh? you mean kay?
00:57amalloytechnomancy_: yeah
00:58wingieare there more styles than ip and fp?
00:58amalloyam i wrong? i've had trouble re-discovering his quote about that
00:59technomancy_that's new to me
01:01technomancy_oh dang
01:01technomancy_I never realized what fnil was for
01:01technomancy_but it's for implementing safe-inc
01:02technomancy_whenever I do map-reduces to do counts I always have to (defn safe-inc [x] (inc (or x 0))), which is what fnil is for
01:02technomancy_this concludes me being an idiot; back to your regularly-scheduled #clojure.
01:02alexbaranoskywingie, I've done a decent amount of Scala at work - I like Clojure better for various reasons, but you could do a lot worse than being "stuck" with Scala
01:02amalloyyeah, i love (fnil inc 0)
01:04wingiealexbaranosky: could you just name some of the reasons?
01:06technomancy_I've only seen one person go the other way, (clojure -> scala) but that could also be explained by the relative size of the communities, so whatever.
01:06alexbaranoskywingie, I day try them both.
01:06amalloytechnomancy_: http://programmers.stackexchange.com/questions/81197/what-did-alan-kay-mean-by-assignment-in-the-early-history-of-smalltalk is a pretty good thing on that topic
01:06alexbaranoskytechnomancy_, also the company you keep affects that perception I'm sure
01:07technomancy_yeah, definitely
01:07amalloyright, probably anyone going from clojure->scala will have their relationship with technomancy_ degrade first, so that he never notices them leave
01:07technomancy_amalloy: nah gnuvince still has the gall to hang out in #emacs; can you believe it
01:07alexbaranoskywingie, Scala is not dynamically typed, so depending on which side of the stat/dynamic argument you live you may like Scala or Clojure more, for example
01:07technomancy_thanks for the link
01:07amalloy(cause how could you leave while you're still buddies with phil)
01:08alexbaranoskywingie, Scala is very object oriented - you could say 60% oo, 40% functional
01:08amalloyyeah, i feel the same. hindley-milner makes static types totally un-irritating
01:08technomancy_alexbaranosky: wouldn't you say that is more a function of the codebase than the language?
01:09alexbaranoskywingie, Clojure is much less OO centric, maybe like 10% or something
01:09wingiealexbaranosky: oh thought it was not oo at all
01:09technomancy_alexbaranosky: from what I gather there are lots of people trying to write Java in Scala and some people trying to write Haskell in Scala
01:09alexbaranoskytechnomancy_, to a degree, but in Scala even functions are objects
01:09alexbaranoskyso I counted that :)
01:09hiredmanhttps://twitter.com/#!/timbray/status/153996532952203264
01:09technomancy_heh
01:10alexbaranoskythere's nothing in Scala keeping you from using simple collections: seqs, sets, maps etc
01:10alexbaranoskywingie, Scala even has a Haskell -like extension library called Scalaz that is pretty interesting to read through
01:11technomancy_alexbaranosky: right; it seems like whether you do FP or OO in scala depends largely on what circles you find yourself in
01:11amalloyhttps://twitter.com/#!/dibblego/status/124946563494719488 is one of the ones i feel guilty for liking
01:11wingiei wished i had more time to delve into all these langs
01:11alexbaranoskywingie, I personally prefer Clojure because it is more concise, more lazy (in the man Im a lazy sunofabitch today way), easier to write more concise code with less duplication -- and I hate duplication
01:12alexbaranoskytechnomancy_, definately, at my work the code is OO in Scala
01:12wingiealexbaranosky: yeah im already in love with lisp
01:12wingiei have no reason at all using clojure over node.js atm but i can't stop reading and learning about it
01:13amalloyhiredman: wow, that list surely is a sign of disease
01:13alexbaranoskynode js is js, so that's a reason :)
01:13wingieJS really sucks compared to Clojure
01:13wingiethats also a reason for using it =)
01:14wingiebut then you would use CoffeeScript and a lot of uglyness is solved
01:14wingieand you quite enjoy writing it
01:14technomancy_wingie: if you haven't read http://clojure.org/state you should at some point
01:14wingiei actually have
01:14technomancy_oh, cool
01:14alexbaranoskyoh yeah - Scala is more complicated than Clojure
01:14technomancy_and then somewhere down the line you'll definitely want to read Out of the Tarpit as well
01:14alexbaranosky:)
01:15wingieis it worth learning Scala just to confirm Clojure is more pretty/concise?
01:15hiredmans/more complicated/less maintainable/
01:15technomancy_wingie: if you're interested in static types, it makes way more sense to pick up ocaml or haskell
01:15technomancy_static types on the JVM are just not much fun.
01:15wingietechnomancy_: in a way im fond of the jvm
01:16technomancy_well, I mean if you're more interested in learning a good type system than Getting Stuff Done
01:16wingieim more to the latter
01:16technomancy_to a lisper, the JVM just means giving up tight posix integration and fast boot time, but to a static typing fan it means giving up full type inference, which is huuuuuge.
01:16wingiei have some requirements a lang must "pass" to be worth learning it
01:16amalloyi've dabbled in haskell, and read several chapters of a scala book (serious credentials there). haskell just seems to have way fewer special cases and a more consistent worldview
01:17wingieone of them is it must be deployable .. preferable in Heroku
01:17alexbaranoskyScala's type system is really nice, but its type inference isn't as good as Haskell/Ocaml
01:17wingieand Heroku has support for Clojure, Scala, Ruby, Java, Node.js, Groovy and Python
01:17wingieno Haskell
01:17technomancy_gonna need to lick my wounds a bit more before I revisit that one. =\
01:17amalloytechnomancy_: that's an ocaml thing?
01:18technomancy_amalloy: yeah
01:18alexbaranoskyamalloy, yeah, because Haskell isn't doing any OO so the language can be simpler
01:18wingienot even Cloud9ide has support for Haskell highlughting .. it seems that it's not that widely used they bothered to support it quickly .. perhaps later on
01:18wingieor not that hyped i should say?
01:18amalloyalexbaranosky: it actually has a ton of OO, it just can afford to think about it differently than java does; scala has to embrace java *and* pile on its own ideas
01:18technomancy_wingie: these days you can deploy pretty much anything on heroku provided the compiler doesn't need to be installed on a systemwide level
01:19technomancy_wingie: I've got an emacs lisp webapp at http://commodore-night-vision.herokuapp.com
01:19technomancy_ocsigen's build is just batshit insane; it's definitely an outlier
01:19alexbaranoskyamalloy: hasells got records, and typeclases, so it has polymorphism, butnot the kind of OO you see in Scala
01:19alexbaranoskynot saying Im voting for Scala's OO :)
01:20alexbaranoskyor maybe I'm forgetting something....
01:20amalloyno, that's basically what i meant
01:20wingietechnomancy_: hm how do you do that?
01:20amalloyi'm just saying that it's a mistake to say "OO" and mean "how java implements OO"
01:21technomancy_wingie: here's the trick for elisp: https://github.com/technomancy/heroku-buildpack-emacs
01:21technomancy_oh, apparently you can run ocaml: https://github.com/markpundsack/heroku-buildpack-opa just not ocsigen
01:21amalloyi guess inheritance is a fairly key part of OO, which haskell is kinda missing. but it does have interface inheritance in typeclasses
01:23TweyHaskell can do subtyping too, with HList
01:23wingietechnomancy_: it's kinda a hack?
01:23wingiedoes original lisp implement oo?
01:24wingiei recall someone from lisp said he chose haskell since he wanna use oo sometimes
01:24TweyEnhh
01:25TweyYou can do OO (for any of the many and poorly-defined values of ‘OO’) in Haskell, but generally you wouldn't, because it's just not something that makes a lot of sense in the programming model Haskell primarily enables
01:25TweyNot that it's not possible, it's just not very useful
01:25TweyCommon Lisp, OTOH, has a great OO system
01:25amalloywingie: http://www.winestockwebdesign.com/Essays/Lisp_Curse.html has an interesting point about object-orientedness in lisp, in the first few paragraphs
01:25amalloythe rest of the article is worth reading too, but isn't really relevant to your current questions
01:26wingieamalloy: seems like an intresteing read
01:27wingieill read it before bed time
01:27wingiewhich is very soon
01:28wingieone thing that seems weird is the way it destructures a map
01:29wingieso I have this map: {:last-name "Vinge" :first-name "Vernor"}
01:29wingieand it is passed to this function: (defn greet-author-2 [{fname :first-name}]
01:29wingiewouldn't it be better doing: (defn greet-author-2 [{:first-name fname}]
01:29wingiecoffeescript is doing like that
01:30Tweyamalloy: That's a neat article
01:30wingiebut i guess i could agree to the way clj is doing it
01:31wingieor no
01:31wingieit feels more natural with the coffeescript approach
01:59wingiewhat's the diff between (ns foo) and (in-ns 'foo)
02:00raekwingie: ns is a convenience macro for callin use, require, and import, but it also calls in-ns and refer-clojure for you
02:01raekbut basically you use 'ns' to create a new namespace and 'in-ns' to enter an existing one
02:02wingieraek: ah thnaks
02:02wingiethanks
02:03raeknot that if you have (ns foo (:refer-clojure :exclude [replace])) in foo.clj, require it and then use (ns foo) to enter the namespace in the repl, you will mess up replace in foo
02:04wingieseems to much info for me right now .. have to absorb it slowly by reading the book
02:04raeksince (ns foo) does something like (ns foo (:refer-clojure :exclude []))
02:04wingiebut i know if there are same names they will be replaced
02:05raekwingie: this is a good guide: http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html
02:06raekI rarely use 'ns' in the repl at all, but I use it in every source file
02:07raekin emacs I can press C-c C-k followed by C-c M-p to load a namespace and cause the repl to be in it
02:08raekthe equivalent clojure repl invokation would be (require 'foo :reload) (in-ns 'foo)
02:15amalloyor: (doto 'foo (require :reload) (in-ns))
02:16wingieraek: thanks ill have a look in it
03:34tsdhIs it a bug (with no practical implications) that (= (gensym) 'G__1737) returns true for a wisely chosen symbol?
03:44CmdrDatshey guys, I need to connect to a server running swank with emacs from the outside - any pointers on how I should handle some kind of authentication/security so that it's not just an open port?
03:47tsdhCmdrDats: Why not ssh to the server and only connect locally? Then you can forbid connections from outside to the swank port.
04:07CmdrDatsfound this : http://a1k0n.net/2005/11/04/lisp-using-slime-over-ssh.html :D
04:07CmdrDatslooks like i can make that work with clojure just fine
04:12notsonerdysunnyCmdrDats: would you be able to post what you come up with on using slime over ssh?
04:13CmdrDatssure
04:13notsonerdysunnythanks CmdrDats
04:15amalloytsdh: IMO yes. i wish gensyms worked like they do in CL
04:16amalloynotsonerdysunny: easy. call the two hosts Server and Client. on Server, lein swank. on Client: ssh -NfL 4006:localhost:4005 Server; (slime-connect localhost 4006)
04:17amalloythe tricky part is getting filename translation right when you do stuff like C-c C-k. i haven't really worked out how to do that, but there are definitely articles about it that appear to make some sense
04:18tsdhamalloy: Thanks, I agree. It might even get a real issue if one clojure process generates code that is loaded by another process later on...
04:19amalloywell you're never going to make that work
04:20amalloythere's a reason the CL reader barfs when it tries to read a form containing a gensym - it refuses because it might create a collision
04:21tsdhReally? I can read gensym-like looking symbols just find with SBCL.
04:22notsonerdysunnythx amalloy
04:23amalloytsdh: hmmmmm. the behavior seems to be more complicated than i thought
04:24amalloyfor example, (let ((#:G9518 1)) #:G9518) gives me an error on clisp
04:24amalloybut it's not a reader error, because i can evaluate '#:G9518
04:25tsdhamalloy: Indeed, that doen't evaluate in SBCL, too.
04:26tsdhamalloy: (eq '#:G111 '#:G111) => NIL, which somehow explains it.
04:27amalloyah. so when it reads them in it refuses to let them be eq to anything else
04:27tsdhOk, so my code generation argument doesn't make sense with CL, anyway.
04:29amalloyright. if you want to serialize code as a string, you have to settle on names for the gensyms, and those can conflict
04:30Fossieither that or they would have to be more unique ;)
04:30amalloybut if you want to preserve the gensyms you can just write your own. instead of serializing '(fn [foo_1029] (inc foo_1029)), you can serialize it as '(let [foo (gensym)] `(fn [~foo] (inc ~foo)))
04:30Fossiafaik erlang creates unique identifiers even across machines
04:31amalloyyou have to eval in any case, so all you have to do is be more explicit about the gensyms in the output code
04:34tsdhamalloy: Right. But in that case, the reading process will generate unique gensyms again, so that it's again only an issue if a user decides to use vars like G__1713. (I've heard rumors that programming physicists like to have hundreds of variables that are simply numbered. :-))
04:47fbru02hey guys ! what's the best way to eliminate for a vec the previous to last element ?
04:55AWizzArdfbru02: maybe subvec is what you want
04:57fbru02AWizzArd: thanks let me tcheck that
05:27blackbitAre there any plans to add core.match to clojure?
05:31jaleyhey guys. sorry... i've been reading the migration guide and i can't find the answer anywhere... where are the libraries formerly in contrib that didn't migrate to a modular library now? i'm looking for what was repl-utils
05:34ejacksonjaley: a lot of that went into clojure.repl
05:34ejacksoni think
05:38fbru02what's the best way to cons something into a vector and get a vector back ?
05:41jaleyejackson: oh.. there's a clojure.repl... thanks!
05:41ejacksonfbru02: conj
05:42fbru02ejackson: and then reverse it ?
05:42ejacksonfbru02: to do that you need to go via a seq
05:43fbru02ejackson: yeah the thing is I want a vector and i want to add sth at the front
05:43ejacksonfbru02: concat then
05:44ejackson,(into [] (concat [1] [2 3 4]))
05:44clojurebot[1 2 3 4]
05:44fbru02ejackson: awesome, thanks
05:44ejacksonfbru02: careful about letting that get too long though, concat is dangerous
05:45fbru02ejackson: no it will be small always
05:45ejacksonyou're good then
05:48tscheibl,(concat [1] [2 3 4])
05:48clojurebot(1 2 3 4)
05:48ejacksontscheibl: he wanted a vector back
05:48tscheiblyep I'm just testing
05:48ejackson:)
05:49tscheiblalthough I could do it in my own repl ;)
05:49tscheibl,(apply conj [1] [2 3 4 5])
05:50clojurebot[1 2 3 4 5]
05:51tsdhtscheibl: BTW, I've seen that clojure 1.4 added some eager, vector-returning variants of map, filter, reduce (mapv, filterv, reducev)...
05:51tscheibltsdh: hey, cool
05:51ejacksonthat's interesting
05:51tscheiblejackson: btw, the apply conj version is almost double speed of the into variant
05:52ejacksonseriously ?
05:52tsdhtscheibl: Really? What clojure version?
05:52tscheiblyep.. just tried it out using (time)
05:52tscheibl1.3
05:52tscheibl,(time (dotimes [c 10000] (into [] (concat [1] [2 3 4 5]))))
05:52clojurebot"Elapsed time: 133.842 msecs"
05:53tscheibl,(time (dotimes [c 10000] (apply conj [1] [2 3 4 5])))
05:53clojurebot"Elapsed time: 144.392 msecs"
05:53tscheiblhmm
05:53tscheiblat least in my repl on 1.3
05:53tsdhtscheibl: Hm, in that version, into will use transients if possible. But the conversion from persistent to transient and back again doesn't make sense if the vector is that small...
05:53tscheibl,(time (dotimes [c 100000] (into [] (concat [1] [2 3 4 5]))))
05:53clojurebot"Elapsed time: 485.379 msecs"
05:53tscheibl,(time (dotimes [c 100000] (apply conj [1] [2 3 4 5])))
05:53clojurebot"Elapsed time: 263.549 msecs"
05:54tscheiblha
05:55tsdhtscheibl: Try into with some larger structures, and then it should be much faster than conjoining every item separately.
05:55tscheiblthe difference in speed gets bigger the more repetitions I use
05:55tscheibltsdh: ok
05:59tscheibltsdh: hmm.. I've tried it with vectors of maps instead of scalars now... the apply version is still significantly faster
06:01tsdhtscheibl: Try this
06:01tsdh,(let [v1 (vec (take 10000 (iterate inc 0))), v2 v1] (time (dotimes [_ 1000] (into v1 v2))))
06:01clojurebot"Elapsed time: 1061.225 msecs"
06:01tsdh,(let [v1 (vec (take 10000 (iterate inc 0))), v2 v1] (time (dotimes [_ 1000] (apply conj v1 v2))))
06:02clojurebot"Elapsed time: 5778.755 msecs"
06:02tsdhSix times slower.
06:04tscheibltsdh: ok.. so it depends on the size of the vector that becomes applied
06:05tscheiblanyway, the "into" version looks cleaner :)
06:06tsdhtscheibl: Yep. into creates a mutable (transient) vector for its first argument, into which additions can be performed more efficient.
06:06tscheibland more concise
06:06ziltiI have a problem with clj-time... I want to "(parse (formatters :date) (now))" but that doesn't work... :(
06:11tscheiblzilti: why would you want to do that?
06:11ziltitscheibl: I want to format the current date
06:11tsdhWhen chunking a seq in order to process chunks in parallel, is there some rule of thumb how many chunks to generate depending of the number of processors?
06:12ziltitsdh: One per virtual core I'd say would be the most efficient
06:13tscheiblzilti: wouldn't it be 'unparse' then? (unparse (formatters :date) (now))
06:14ziltiOh. Indeed
06:14tsdhzilti: Hm, but then, if one chunk is processed earlier, its thread cannot pick up another chunk.
06:15tsdhzilti: So I'd say, it might be something like (* 2 N) or so... Well, I'll run some benchmarks...
06:15ziltitsdh: Yes, but a solution to that isn't that trivial... Maybe you'd have to look which other chunk is the longest and "cut" it... But it definitely will slow it down if you run the processing of two chunks on one core
06:16ziltibecause of the swapping
06:18tsdhzilti: I don't intend to activate more workers than I have cores. I just want to have enough chunks so that workers finishing early may pick up another one.
06:19ziltitsdh: Oh I see.
07:01dbushenkohow is android support in clojure 1.3?
07:41Fossidbushenko: i guess the same as before
07:41dbushenko:-)
07:42Fossithe bigger problem back then was clojure support for android
07:42Fossiie functional languages that create loads of objects
07:42Fossibut i only tried the last time before the bigger garbage collection and jit improvements
07:43Fossimaybe also creating a 3d game in clojure wasn't such a great idea ;)
07:44Fossias even java struggles a lot with garbage collection in that area
07:44Fossibasically the evengalist said: NEVER give the gc a chance to run, except inbetween levels :>
07:59rabblerI totally forgot the name of the unix tool to use instead of JLine… Can anyone remind me? Man, leave for vacation for a couple weeks and you forget a lot of stuff.
07:59ejacksonemacs ?
07:59ejackson:P
08:00rabblerno. command line stuff. I'm not an emacs person, I've given up on that one for quite a while.
08:00clgvrabbler: try rlwrap
08:00rabblerthat's it!
08:00rabblerthanks!
08:00clgvrabbler: see the clojure wikibook for an advanced setup
08:01rabblerAnd yeah, that's the site I was at before. It's all comin' back.
08:01rabbler2 Clojure-Conj, 2 years and I still haven't done any dev with Clojure. Kick me.
08:20tsdhrabbler: Was that ok?
08:20ejacksontsdh: I was gonna too, but it seemed rude to add injury to insult
08:21tsdh:-)
08:24rabblerHeh, yeah.
08:24rabblerBeen trying. I'm in my java, objective-c world.
08:24rabblerI want to dump the Java as much as possible. Can't really dump the Obj-C though.
08:25AWizzArdEmacs 24 with Slime under Windows: I have problems with german umlauts. For example (println (char 252)) ==> Debugger entered--Lisp error: (end-of-file) byte-code("\302\30\"\210\303\304\"\210\300\30\"\207" [error process debug slime-net-close t "net-read error: %S"] 3) see http://paste.lisp.org/display/126859 for the full output.
08:25AWizzArdIdeas?
08:26AWizzArdI can not continue to work. I first have to M-x slime-disconnect and then M-x slime-connect RET RET again.
08:42solussdwhere did clojure.contrib.io go?
08:42AWizzArdsolussd: try clojure.java.io
08:42solussdthanks
08:57TimMc~where did contrib go?
08:57clojurebotwell... it's a long story: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
08:57TimMcsolussd: ^
08:57TimMcThat's as complete a list as you'll find.
08:57solussdthanks- I've been looking for that.
09:11ejacksonwhat do I need to be able to refer to a protocol from another namespace ?
09:16TimMcejackson: You should be able to just require/use it, yeah?
09:16TimMcUnless there's also something to import. Does a protocol create a Java interface?
09:17ejacksoni know you have to import records, and thats working
09:17ejacksonunsure about protocols
09:20mcrittendenwould someone mind giving me a hint on http://www.4clojure.com/problem/23 ? I got here https://gist.github.com/1560238 but it throws an error and I just realized conj doesn't always add to the beginning anyway
09:20ejacksonits weird, I can extend my type, it finds the protocol in the other namespace, but then when I try to use it, it says there's no implementation
09:21rabblermcrittenden: conj will add to the tail on vectors and the head on lists.
09:21mcrittendenrabbler right, so I feel like conj must not be the right solution here
09:22rabblerif you want it at the head, all the time, you can use cons.
09:22rabblerbut, that is not efficient on vectors… but, again, if you want it, you have it.
09:23ejacksonaaah, I see, when you call the method from the other namespace, you need to fully qualify it (using :require not :use for that namespace)
09:25mcrittendenhmm ok so now it's just an issue of debugging the error. thanks
09:25mcrittendenrabbler: I'm not very concerned with efficiency on a puzzle like this
09:26rabblermcrittenden, I understand. Just throwing it out there.
09:26mcrittendenrabbler: oh sure thing, I appreciate the tip for sure
09:26rabblerI've only done 70 problems on 4clojure so far.
09:27rabblermcrittenden Really makes me feel like a moron when I am doing those problems!
09:27mcrittendenrabbler: haha that makes me feel better. i'm just getting started with clojure but I figured I'd at least make it past the "easy" questions without getting stumped
09:29rabblermcrittenden, hint: You are trying to call a function when you do this: (coll)
09:30mcrittendenrabbler: that plus i had the params reversed for (cons ...). this worked: https://gist.github.com/1560282
09:31mcrittendenthanks again for the help!
09:32rabblermcrittenden: cool.
09:51clgvmcrittenden: you can have that shorter with one reduce only ;)
09:52mcrittendenclgv how do you mean?
09:52clgvyou might have a look at my solution overthere ;)
09:53mcrittendenclgv whoa, interesting
09:54mcrittendenamalloy's solution is just: into()
09:54mcrittendeninto ()
09:54mcrittendenweird stuff
09:54clgvmcrittenden: in fact I could skip the anonymous function for a better golf score
09:54clgvmcrittenden: lol yeah, I didnt know the into was implemented like that at this time ;)
10:07minikomihi there
10:10minikomiI'm working through 4clojure .. I keep using loop/recur eg. https://gist.github.com/1560424
10:12clgvminikomi: you could do that very concise the lazy way as well.
10:12minikomioh? do you mind editing the gist to give me nudge in the right direction?
10:12koeieni used a solution that iterates the function fn [[x y]] [y (+ x y)]
10:13minikomihaven't wrapped my head around laziness yet
10:13clgvminikomi: did you solve it already?
10:13minikomiwell, that gist was my solution and it gave me all green
10:14clgvminikomi: the you can just "follow" me (click at the users list) to see my solutions.
10:14minikomiok, no problem
10:14minikomisame user name ?
10:14clgvyes
10:16minikomihmm. will have a play with it in the REPL. Thanks!
10:18clgvminikomi: if the problem has something sequency then there is a chance the lazy way (map&co, lazy-seq) is the best choice
10:18koeienlazy-seq automatically interleaves the computation?
10:18koeieneven if i use a tail-recursive function?
10:19minikomithanks.
10:20clgvkoeien: with lazy-seq you can return the "current" seq element and do the a <- b, b <- a+b switch in the function call that is used for the next seq element
10:20minikomimap / reduce I have some bearing of coming from ruby, but i often fall back on loops when I get stuck
10:20koeienclgv: i'll play around with it, i come from haskell so it's a bit confusing to see what's strict and what's lazy
10:21clgvkoeien: only seqs are lazy ;)
10:27zilti_Is there a page which lists the contents of *request* from Ring?
10:29bsteuberany cljs experts here? I got similar problems to http://groups.google.com/group/clojure/msg/13048df8108e3f64
10:30bsteuberonly :optimizations nil works for me
10:46flashingpumpkinhey guys. I'm curious if someone went to the lengths to port penumbra to clojure 1.3. I can't really find something on the list and github doesn't look like it too.
10:48flashingpumpkinit's making use of a lot of contrib packages - I guess refactoring that is the biggest hurdle, non?
11:26KvaksNewb-question here: I want to use a str-utils function, and have added 'org.clojure/clojure-contrib "1.2.0"' to dependencies and run 'lein deps'. The contrib jar gets downloaded to lib/ and I can see some contrib-stuff in the repl, but no str-utils. Any idea what I'm doing wrong? (I'm using emacs/slime/swank/leiningen.)
11:27zilti_ ~where did contrib go?
11:27zilti_~where did contrib go?
11:27clojurebotwell... it's a long story: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
11:28KvaksThanks, I'll look at that.
11:33RaynesKvaks: What function from str-utils do you want?
11:34RaynesThe old Clojure Contrib was deprecated in favor of splitting the libraries into individual libraries, so you don't want to use clojure contrib like that anymore. However, str-utils was deprecated long before that. There is a new namespace built into Clojure with most of the things from the old string utility libraries. clojure.string. Chances are what you want is there.
11:37KvaksRaynes: I'm realizing that the book/tutorial I'm reading is slightly outdated, yes. :-)
11:42wingieKvaks: what bootk ar you reading?
11:43wingieim reading "Programming Clojure" from 2009 and I can't include the re-split
11:43Kvakswingie: Same book here.
11:44wingieKvaks: what page are you at?
11:44wingiewe can do "pair learning"
11:44wingie:)
11:44KvaksHehe. :)
11:44KvaksPage 50-60.
11:46wingieim at 65 =)
11:47solussdare there clojure conj videos from this year?
11:48Bronsanot yet AFAIK
11:48wingiehttp://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html
11:48wingiewhy doesn't (require 'clojure.string) works?
11:48wingieas in the example
11:50wingieoh it works now .. i messed up my repl and had to restart it
11:53wingieare there times you are using java libs from clojure?
11:53wingieand what kind of libs/classes are you using then?
11:55jodarowingie: are you asking in general?
11:55wingieyeah
11:56wingiewanna know what kind of java code i would wanna use
11:56cgraythere's lots and lots of java code out there... it's kind of a hard question to answer
11:56jodaroyeah, depends on what you are trying to do
11:57jodarobut if you happen to have a problem that is already solved by some java library or framework
11:57jodarooften you can either use it directly or write a thin clojure wrapper over it
11:57jodarothats one of the main strengths of the language
11:57jodaroyou don
11:57jodaro't have to start from scratch
11:58jodaro(though sometimes its more fun to)
11:59wingiejodaro: could you give me some examples of java code that are good to use
11:59cgrayreally stateful java can be tough to use, and I've seen some java that calls System.exit() on error, which is obviously pretty bad
11:59wingieif someone asked me why coffeescript is js compatible i would for example say now you can use ExtJS, Sproutcore, Underscore, Mocha, Vowsjs and some other js libs
12:00zilticlojurescript!
12:00wingiecgray: seems not that beautiful to use java from clojure
12:01ziltiwingie: It's as beautiful as possible
12:01ziltiimo
12:01wingieperhaps another strength is that it could be run in jvm
12:01jodaroi think you get used to it
12:01jolyI've seen Clojure code using Swing, logging frameworks, etc. Most Java libraries should be usable from Clojure.
12:01wingieso performance boosts in jvm to speed up other langs would benefit clojure as well
12:01jodaroand like i said, you can always wrap your java usage up and put it in a dark corner of the codebase
12:01jodaroso no one has to see/smell it
12:02wingieyeah
12:02wingiewrap it up!
12:05koeieni would like to parse a file format in clojure. what is the recommended way / library of doing this?
12:06TimMckoeien: Binary format?
12:06koeienno, text-based
12:06koeienuse ANTLR and java bindings? or is there a reasonably efficient port of Parsec?
12:07TimMcOK, there are several parsing libs out there. fnparse and parsley come to mind, although you'll have to check on their maturity/maintenance activity.
12:07ziltiThere is a jparsec
12:10koeienthank you for your pointers.
12:13wingiea var is a global variable with a value. a var is bound to a symbol to access it's value?
12:14wingieplease confirm that
12:14wingiea local is a local variable. just like the above one but just for a local scope?
12:19viveknHi, is there any good VoIP library for clojure? I want to implement audio conferencing between multiple clients.
12:20pbuckleywingie: I think you have that right, but I'm far from an expert
12:21rabblerwingie: Just to clarify locals aren't 'variables'. They cannot change.
12:21rabblerbut you can change a def.
12:23zilti_vivekn: You'll have to use a java library
12:23viveknoh,do you have any suggestions?
12:24pbuckleyrabbler: but you can re-use and change the value of a local within a let binding, correct?
12:25pbuckley,(let [f (+ 3 4)
12:25clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
12:25rabblerThat doesn't change the value. The value cannot change in that scope.
12:25pbuckley,(let [f (+ 3 4) f (+ f 5)] (println f))
12:25rabblerSo, you set the value. But you cannot alter it.
12:25clojurebot12
12:25pbuckleyI can set it multiple times, referring to the old one
12:25RaynesIt looks like change, but in reality you're just creating a new thing.
12:25pbuckleyright, but I'm always referring to the newest thing
12:26pbuckleythe old thing can't be referred to once the new thing is there
12:26RaynesSo?
12:26zilti_vivekn: No, I'm sorry.
12:26pbuckleyso it looks like it changed
12:26RaynesThat's because you can't refer to two things by the same name in the same scope.
12:26wingierabbler: right
12:27pbuckleyit just seems like meaningless semantics in the context of setting a symbol to a new value in the same let binding
12:27pbuckleyfor all intents and purposes, the value the symbol points to, "has changed"
12:28wingieisn't it true for a var too? you are just setting a new value and it's unchanged?
12:28pbuckleyeven though under the covers where you can't access anything, it hasn't actually "changed"
12:28pbuckleywingie: I think so
12:28jcrossley3what's the recommended clojure library for rabbitmq? google's telling me to use the java one.
12:28wingiebut why is it called variable then?
12:28wingieif it cannot change
12:28wingiesince someone said local can't be changed, i assumed that a variable is changeable then
12:28antares_jcrossley3: I am obviously biased but https://github.com/michaelklishin/langohr is probably by the fast best right now
12:29rabblerwingie: its not called a variable. It's called a local. It's a val, not a var.
12:29pbuckleyrabbler: he's asking about vars now, set with def
12:29antares_jcrossley3: "the best" as in, feature-complete, well maintained, developed by someone who has been using rabbitmq for 3 years
12:29Raynesrabbler: He isn't talking about locals.
12:29pbuckleylike, why are they called vars, if they can't change
12:29rabblersorry.
12:29rabblerheh.
12:30wingienp
12:30wingieanyone knows the answer for that one?
12:30Rayneshttp://clojure.org/vars
12:31RaynesA var is mutable. You change it *in place*. You don't create a new one.
12:31jcrossley3antares_: thanks. do you think that's the one most people use?
12:32antares_jcrossley3: there is no single Clojure client that most people use
12:32zilti_,(.split "Hello World" " ")
12:32clojurebot#<String[] [Ljava.lang.String;@171c6d6>
12:32zilti_huh
12:32pbuckleyRaynes: so if the locals aren't mutable, when I set "f" twice in a let binding, I'm taking up two slots in memory, is that the impact?
12:32antares_jcrossley3: and as congomongo demonstrates, what most people use can actually be quite crappy :)
12:32zilti_,(println (.split "Hello World" " "))
12:32clojurebot#<String[] [Ljava.lang.String;@1add89d>
12:33Rayneszilti_: That's a Java array. You can work with it like a normal seqable object. If you want to look at it in a pretty way in the REPL, you can do ##(seq (.split "Hello, World!" " "))
12:33lazybot⇒ ("Hello," "World!")
12:33antares_zilti_: maybe use (vec …)
12:33zilti_What am I doing wrong? All I know is that I did it right five minutes ago
12:33cgray,(clojure.string/split "Hello world" #" ")
12:33jcrossley3antares_: ha! is it fair to say most people use the java client directly from clojure? (just based on what google tells me)
12:33clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.string>
12:33cgray,(require 'clojure.string)
12:33clojurebotnil
12:33cgray,(clojure.string/split "Hello world" #" ")
12:33clojurebot["Hello" "world"]
12:34Raynespbuckley: I imagine the old value would be garbage collected, since it isn't used anymore after you've created the new binding.
12:34pbuckleyRaynes: thanks
12:34RaynesBut I'm not the one to talk to about memory semantics.
12:34antares_jcrossley3: many people do and langohr is actually a really small library that makes that easier. It very much follows Java client API conventions and AMQP model in general (http://rubyamqp.info/articles/amqp_9_1_model_explained/)
12:35antares_jcrossley3: but the fact of the matter is, there is a dozen of incomplete rabbitmq clients that seemingly were developed by people who did not understand AMQP 0.9.1 very well, so they invented all kinds of weird APIs and terminology that confuses everyone on the mailing list
12:36jcrossley3antares_: understood. thanks for the perspective!
12:36VinzentHi. Why this line of code (-> url (client/get {:as :byte-array}) :body ByteArrayInputStream. xml/parse) doesn't work? client is clj-http.client and xml is clojure.xml. With standard parser it just hangs forever
12:37Raynespbuckley: I mean, there is a meaningful difference here. You have a value bound to x. You create a new value and bind it to x. This value is completely independent of the old value of x, but there can't be two of them so the newer one shadows the first one, simulating change. You can't (set! x "newval") or anything like that. You can't loop over it and change it in place (unless it is bound to something mutable like a ref, atom, etc)
12:37Raynesfor example.
12:37ziltiOh I love broken routers
12:40pbuckleyRaynes: I think I get it - there is meaningful difference beyond the semantics, but in my limited time using clojure, I haven't needed to go beyond simulating change, and so the semantic difference is my "childish" understanding at this point
12:40antares_jcrossley3: if you decide to use langohr, I am in #rabbitmq to answer your questions
12:45wingiewhat are the use cases for threading?
12:47wingiei wanna know when i benefit from using clojure (support for multi threading) instead of node.js (single threaded) as backend server for my web app
12:49licenserwingie: node.js is no fun (my 2 cent) closures biggest benefit is that you write lisp instead of JS
12:50ziltiOk so what's the recommended way of splitting a string, since (.split "Hello World" " ") doesn't work correctly (even if it should)?
12:50wingiethe weakest point of js is also the strongest
12:50Rayneszilti: That works fine.
12:50Rayneszilti: Why do you think it isn't working?
12:50licenserwingie: horrible variable scoping?
12:50zilti,(println (.split "Hello World" " "))
12:50wingieusing node.js i am using js full stack
12:50clojurebot#<String[] [Ljava.lang.String;@4fe2b3>
12:50cgray,(clojure.string/split "Hello world" #" ")
12:50clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.string>
12:50cgray,(require 'clojure.string)
12:50clojurebotnil
12:50cgray,(clojure.string/split "Hello world" #" ")
12:50clojurebot["Hello" "world"]
12:50Rayneszilti: It is a Java method. It returns a Java array. There is nothing wrong with that.
12:50licenserwingie: with noir and noir-cljs you can too with clojure :)
12:50wingiebut that was not the question .. how do i benefit from multithreading?
12:50licenserwhich is pretty amazing
12:51wingiein a web server
12:51ziltiUsed inside Java, String.split doesn't return an _array_
12:51technomancyclojurebot: same language on client and server?
12:51clojurebotNo entiendo
12:51licenserwingie: if you run only one instance of node.js and it really only runs 1 thread you benefit hugely
12:51licenserbut I am not a expert on node.js's inner workings
12:51licensermore threads mean more core can in parallel answer more requests
12:51technomancyclojurebot: using the same language on the client and server is not a big deal: http://blog.ianbicking.org/2011/03/30/js-on-server-and-client-is-not-a-big-deal/
12:51clojurebotIn Ordnung
12:51licenserit is a no tradeoff scaling
12:51Rayneszilti: http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html#split(java.lang.String)
12:52TimMczilti: It absolutely does.
12:52Rayneszilti: You're splitting a string. You need a collection of the split pieces. That's what you've got. The problem is that you're trying to print a Java object, but it doesn't look the way you expect it to because it is a Java object. If you want to look at it in the Clojure seqy way, call seq on the result. In practice, unless you plan on printing it for some reason, you don't need to.
12:52Raynes&(first (.split "Hello, World" " "))
12:53lazybot⇒ "Hello,"
12:53licenserbut wingie I would imagine that node.js will spawn multiple acceptors for your cores right?
12:53Raynes&(seq (.split "Hello, World" " "))
12:53lazybot⇒ ("Hello," "World")
12:53RaynesIt is doing exactly what you want.
12:53cgrayRaynes: what's wrong with clojure.string/split ?
12:54TimMc&(apply str (interpose " " (.split "Hello, world!" " ")))
12:54lazybot⇒ "Hello, world!"
12:54Raynescgray: It is utterly unnecessary.
12:54ziltiThat's what happens if you haven't programmed for two months
12:54licenserRaynes: i disagree
12:54licenserI find calling object functions the last resort
12:55RaynesThere is nothing wrong with it if you already have clojure.string imported or have some other reason for using it, but there is no good reason to use it over .split in this case.
12:55RaynesEspecially in this case, since he didn't understand what was going on. clojure.string dances around the problem.
12:56wingietechnomancy: that author just knows nothing about it
12:56wingie"I’ve used it a little"
12:56wingieit seems like that
12:56RaynesDidn't you recently point out that you are new to programming?
12:57wingiebut i have used node.js pretty long
12:57wingieand am building a serious web app with it .. i just hate posts when people write since they are biased
12:57licenserwingie: will node js spawn multiple 'workers' for all of your cores?
12:57TimMczilti: Haha, sorry to jump on you.
12:57technomancyhe has a really good point that the difficulty is not in learning a new language, it's in learning a new runtime.
12:57wingielicenser: chill im not tryng to start a war
12:57wingiebut we can all be more objective
12:57licenserwingie: no I am seriously curios
12:57technomancyI know Clojure backwards and forwards, but I can't do crap in ClojureScript because I don't know anything about the browser or node.
12:58mcrittendenwingie what's a situation where it's useful to use the same language client-side and server-side? curiousity question
12:58licenserI don't know the answer hence me asking :)
12:58wingielicenser: no it wont
12:58wingieor
12:58TimMcmcrittenden: It's fantastic for enforcing input constraints.
12:58technomancywhereas even though I didn't know Mirah at all, it was super-easy for me to code up a couple apps in it since I knew the JVM already.
12:58wingiejs is single threaded .. so i guess its not the same as using clojure
12:58licenserI see but the benefit you get from clojure is that you get this kind of scaling for free instead of needing to do it by hand
12:58TimMcmcrittenden: Ever run into a site that had different notions of how a credit card field should be formatted in its server and client code?
12:59wingiebut what i reacted on that post was that he just said "it won't help you" .. it _really_ helps you to share code
12:59licenserwingie: for 95% of all web apps the app itself is single threaded more threads only mean more req/s but spawning more servers does the same more or less (plus some memory overhead)
12:59mcrittendenTimMc usually in that case you use a jquery form validation lib with a custom vali rule client-side, and that doesn't help you much server-side, no?
12:59wingieand obviosuly he doesnt know how/why to share code
12:59technomancyTimMc: the article makes a really good point about how server-side validation is all about security and enforcing a formal model, while client-side validation is purely a UX concern
13:00technomancythe overlap is superficial
13:00TimMcmcrittenden: The problem is keeping the two consistent so you don't piss off your users.
13:00TimMcmaking it easy to be correct, not just possible.
13:01wingiemcrittenden: same general libs that don't care about server or client side envs eg underscore and sugarjs .. those don't have to be changed at all since they are pure functions
13:01technomancyif you want to talk about validation, we already have the same language running client-side and server side: regular expressions.
13:02wingiethen there are libs that have same code base but behave differently .. eg. testing suites like mocha
13:02mcrittendenwingie: you've been in a situation where it was useful to use those libs both client-side and server-side?
13:02TimMctechnomancy: "Sorry, your field did not match the regex. Please try again."
13:02wingiein node.js you run the tests in cli .. in browser it uses the dom .. but the testing code is the same .. means reusablility
13:02TimMcand they're still dual-homed.
13:02technomancyTimMc: did you read the article? the purpose of server-side validation is totally different from client-side
13:03wingiemcrittenden: yeah .. im using underscore on client and server
13:03TimMctechnomancy: Yes, I've read the article, and I think that point is misleading.
13:03mcrittendenwingie: interesting. not open source by any chance is it?
13:03TimMctechnomancy: Server requirements trickle down to the client and need to be communicated.
13:03RaynesI <3 validation. I remember trying to get a redbox kiosk to accept my raynes.me email address. Apparently it doesn't understand those kinds of emails.
13:04wingieone unconvenient way was to serve a js file to browser and then npm install it for node.js
13:04wingiebut a trend is now to use browserify
13:04wingieyou npm install it..and it will be used on both browser and server .. no more file split
13:04technomancy"this field needs to match this pattern" is data, you don't need to share a turing-complete language to share it.
13:05wingieyou update it with npm and the browser will get the new version too
13:05TimMctechnomancy: Your grandparents are gonna have a fun time using your websites.
13:05wingietechnomancy: yeah i agree on reg exps
13:05wingiekeep it simple is good
13:05wingiebut there are more
13:05wingiebenefits from sharing the same lang
13:05licenserTimMc: I don't think his grandparents will know the internet as we know it
13:05wingieanother is that you can move forward fast
13:06TimMc"Your username did not match /[a-z0-9_-]{3,20}/i, please try again."
13:06ziltinpm? browserify? *confused*
13:06wingieeg. just remembering one lang syntax, eco system .. which gives you focus and speed .. (i know you wanna learn more langs but we are talking about dev speed for you app now)
13:06mcrittendennpm = node package manager, sort of like leiningen for node
13:07wingieand if you are hiring people you can just hire good js people
13:07technomancyone language, two runtimes
13:07wingienot having to have an add "we need js devs .. would be good if you knew clojure"
13:07technomancyguess which is more difficult to learn?
13:07TimMccomplecting some topics here
13:08ziltitechnomancy: JS?
13:08wingietechnomancy: just saying that post was not very fair at all .. a typical post i wouldn't even post in irc .. gives no value
13:08technomancyzilti: JS or Clojure/Clojurescript; the fact remains. it's much easier to learn a new language on the same runtime than a new runtime for the same language.
13:08wingieyou could attack it more objectively
13:08licenserprobably your add 'need closure devs' will spawn less but more skilled results then 'we need js devs' (not saying bad things about them but there are way more want-to-be people in the JS world I think)
13:09wingieeg. if clojure could be used on both ends .. would people that loved clojure say it was a bad thing?
13:09wingieno
13:09TimMctechnomancy: What does "a new language on the same runtime" have to do with the price of tea in China?
13:09licenserwingie: it can ^^ look at clojurescript
13:09wingieif you don't like js then its better to just say js sucks and i dont want to work with it .. but don't attack the benefits of using the same lang on both ends
13:09wingieits powerful and saves time
13:10ziltitechnomancy: I'd say it's harder to switch from one programming paradigm to another
13:10TimMcI don't know what you;re trying to compare.
13:11wingielicenser: yeah yyou are right .. that is a good thing about clojure .. but there are kick ass devs using node.js too
13:12wingielicenser: im doing a serious web app with extjs and sproutcore .. need to use js for it
13:12licenserwingie: don't say they aren't but there is a bigger pool of people meaning also a wider spread, clojure is pretty esoteric compared to JS, and that in my experience attracts the upper scale of devs (or the crazy ones :P)
13:13wingieyeah i agree
13:13wingiewhy im here =)
13:13licenser^^ crazy? :P
13:13licenserjust kidding mate
13:13wingiejust saying node.js/browser is a good fit .. but that's that
13:14licenserI personally aint' a big fan of javascript, I find it ends up in a mess most of a time but hey that just as well can be my lack of experience
13:14licenserfortunately I found my way out of the mess ^^
13:15wingieits solid to say clojure > js
13:15licenserI won't go so far I'd say for me clojure > js
13:15wingienah it is
13:16wingiejs was created in 10 days
13:16wingiejust to give more flashy experience
13:16TimMcCreated under a marketing deadline. Bad news.
13:16mcrittendenad hominem!
13:16licenserI've seen people do amazing things with js, so one situation where my dislike for js was solidified was when a friend of me showed me some of his code and was all like 'look how beautiful and pure this code is' and I was close to vomiting, I still don't understand all of it since it is so spagetified
13:16TimMcNot terrible for what it is, though.
13:17wingieyeah .. people need to learn proper programming before writing big apps
13:17wingie(me)
13:18wingietalking about langs are okay but saying same lang on both ends is bad just because you dont like js is chilidsh
13:18mcrittendenanyone feel like giving me a hint on http://www.4clojure.com/problem/52 ? specifically, I don't understand what that let is doing, with the (range) in there
13:18technomancywingie: I'm not saying it's unique to JS
13:18licensertoday I tried to help a colleague with a bit of JS for a web fronted he used jQuery and was generating a table that was like 50 rows with combo boxes in each row and some stuff and it took between 1 and 0.5s to build that
13:18licenserit really shocked me
13:18technomancyI'm saying the same thing applies to clojure/clojurescript
13:18cgrayfor me, the worst thing about the linked article is how general it is. since he's talking about js, everyone assumes client means browser and server means web server, but imagine if client meant ssh client and server meant ssh server. why on earth would you not want to write both of them in the same language?
13:19wingietechnomancy: yeah its not ideal .. yet
13:19wingiesome problems before in node.js/browser land is now slowly going away
13:19TimMcI mostly agree with technomancy's broader point: A language is designed for a runtiome, and the same code may not be sane for both runtimes at the same time.
13:19technomancythat doesn't mean clojurescript is useless; it's not just some magic code-sharing dust you can sprinkle on your app to not have to think differently in different contexts
13:19licenserclojurescripts biggest downside is the complexity to get it to work properly
13:19wingieits still very new
13:19licenserbut that was the same with clojure before technomancy laied his hands on it and created lein ;P
13:19TimMcbut there's no reason a validation lib cannot be transpiled for great benefit.
13:19licensertechnomancy: I want leinjs
13:20clj_newbI have a dream. I have a dream that one day, my Clojure code will be judged by what it's meant to do, not on whether the platform it runs on is Java or JavaScript.
13:21TimMcclj_newb: JVM, you mean. Clojure doesn't run on Java.
13:21hroarkemcrittenden: the range constructs an infinite (lazy) sequence of integers. destructuring in the let takes that sequence apart into elements.
13:22technomancyit's funny that the directory in the clojure repository that contains the .java source files is called src/jvm.
13:22technomancyand then we complain about people not understanding the distinction. =)
13:22TimMcindeed
13:22TimMctechnomancy: Maybe that was from back when the .NET project was a bigger goal?
13:23technomancymust have been
13:23clj_newbI have a dream. I have a dream that one day, when Clojure programmers are writing Clojure code, they ask "what is this code menat to do" rather than "does this code run on the JVM or V8." <-- there we go, does this work?
13:23TimMcmuch better :-)
13:24mcrittendenhroarke: so a is 0 and b is 1, etc?
13:24TimMcalthough there may be some quibbling with your dream itself.
13:24hroarkemcrittenden: Yep
13:25wingiei have a dream
13:25TimMc&(let [[[a b] c] [[1 2] 3]] [a b c])
13:25lazybot⇒ [1 2 3]
13:25wingiethat one day we don't need to have js only in browser
13:25wingiedoesn't java plugin come along with all browsers?
13:26wingieor do you have to install it manually?
13:26clj_newbdidn't sun write abrowser back in the day? why did it fail?
13:26TimMcwingie: Wake up, we're there.
13:26licenserwingie: TimMc is right there are clojurescript (named firced cause it matches the channel name partially :P), coffee script and probably others
13:27wingielicenser: but its compiled all down to js
13:27licenserso that isn't a big issue for me
13:27wingieis java plugin installed on all browser by default?
13:27licensernope
13:27wingiewouldn't that be nice?
13:27ziltiwingie: It's still supplied with most PCs when you buy one
13:28wingieif jvm was installed on all browsers you could run clojure!
13:28RickInGAGoogle is working on building a sandbox for native code in a browser (C++ I assume), but Mozilla has said they won't support it.
13:28RaynesApplets are so 2002.
13:28ziltiNext-gen-Applets are so 2012
13:28pandeiroDon't forget about Dart
13:28wingieno no no
13:28wingiei have a dream...
13:28TimMcwingie: I misunderstood you, I thought you were annoyed that JS was limited to the browser, not that the browser be limited to JS.
13:28TimMcgrammar fail, too much lag
13:28ziltiRickInGA: Yes, because it's stupid. Then you need to supply a version for ARM and one for x86 or what?
13:29licenserwingie: I don't think it would, java is a huge beast compared to js I think
13:29gf3hey guys, so I have a function that should optionally take some sort of configuration, is it better to explicitly pass in a config map, or have some sort of global dynamic map?
13:29wingie...i wished that the web we see it today (web browsers) disappeared and apps (as client) took over
13:30wingiehaving watched a Steve Jobs interview I feel that is the future we don't see it quite yet
13:30wingiebut its evolving .. and computers like Asus Transformer Prime is one big step towards that
13:30TimMcgf3: It kind of depends on how many levels that option map would have to be passed through, and whether binding is appropriate.
13:31ziltiwingie: Since the next Windows will have an app store we might get one step closer to that one (simplifying application installation)
13:31wingieiPhone/Android phones -> iPad/Android tablets -> computers like Transformer
13:31ziltiUnfortunately technologies like Web Start have pretty much failed for consumers
13:32licenserzilti: for the reason that it is hugely complicated
13:32wingieSteve Jobs believed in the future laptops and desktops will be really rare and the mainstream will be computers like Transformer with "app" OSes
13:32licenseralso the advantage of web apps is that they pretty much run everywhere
13:32ziltiIs it? I don't think so. It's dead-easy
13:32gf3TimMc: 2 or 3 levels, I'll be using the data for translating request URIs to file paths
13:32pandeiroRaynes: is there any way I can inspect the noir errors map while my app is running? Relatedly can the app be run from and interacted with from the REPL?
13:32zilticlick link -> get app
13:32ziltinot even the need to launch an "app store" or whatever
13:33ziltiAnd automatic updates on each launch
13:33licenserzilti: you have worked often with them? I have to deal with some of the buggers at work and it is always a pain
13:33ziltiWeb Start? What's the pain with it? All you basically need is an XML file
13:33licenserthen they don't like the old IE we have to use, or don't run at all on the linux we have on other hosts
13:33licenseror the XML isn't correctly linked to the java thingy
13:33pbuckleywingie: have you read that article about why apps can't replace the web, because they don't have a standard for linking? (i.e. HTML?) - seemed convincing to me that the browser and web pages are still superior to a bunch of disconnected and mostly impossible/improbable to connect apps
13:33Raynesgf3: As in the validation *errors* map?
13:34pandeiroRaynes: yessir
13:34licenserzilti: might be that I had a particularly nasty combination of enviromentatl conditions but I only have bad experiences
13:34ziltiI never had problems, especially not since they provide that js library for launching webstart and applets
13:34Raynesgf3: That var is only ever bound inside of requests. As such, the code looking at it has to be underneath a defpage (you know, a route).
13:34wingiepbuckley: they could link in another way like with JSON sent to another app
13:34RaynesOutside of requests, it isn't bound at all.
13:35TimMcRaynes: You mean pandeiro
13:35wingieand it will give you what you wanted to check out
13:35RaynesYeah, I do.
13:35RaynesTimMc: I'm sitting like 6 feet away from my monitor. :p
13:35pandeiroRaynes: I see, and what about the general case of somehow interacting with the app through the REPL? Not possible, right?
13:35pandeiro(Sorry to make you squint)
13:35Raynes:p
13:35pbuckleywingie: they could, but that would take effort and standardization, and we already have the web which does a good enough job and which is improving with HTML5 etc
13:35pandeiroI CAN USE ALL CAPS IF YOU LIKE :-P
13:35gf3Raynes: no, I actually don't touch the req/resp
13:36gf3Raynes: I just use the URI to do some other work
13:36Raynespandeiro: You can run the whole thing in the repl and interact with it if you want.
13:36wingieso i guess that would be a platform standard .. eg. iOS would say .. you can open another app by doing X Y Z
13:36Raynespandeiro: Just run the server inside of a repl session.
13:36wingieand imo way better than web standards .. takes an eternity to imeplement
13:37pandeiroRaynes: just by calling the app.server/main fn, yes?
13:37wingielook at from "iPhone to Tablets" evolution
13:37Raynesgf3: I was actually responding to pandeiro. I got a bit confused for a moment there.
13:37Raynespandeiro: Yep.
13:37gf3Raynes: haha, no worries
13:37TimMcgf3: Go for dynamic, I guess. Just beware of lazy seqs yo ucreate in that scope!
13:37wingiejust a couple of years it has gained popularity from 0 .. the speed is enourmous
13:37pbuckleyright, but the web standards are already here - not that it couldn't be done, it just would take a bunch of work to make happen
13:37pbuckleysure, tablets are cheap toys, of course they sell well
13:37gf3TimMc: thank you
13:38pbuckleybut if anything, they're becoming less standardized as they increase in popularity
13:38TimMcpbuckley: Cheap toys? In my day, all we had was a squireel and a stick, and we had to *buy* the stick ourselves!
13:38pbuckleyTimMc: LOL :-)
13:38pandeiroI think I am confusing things by moving the valid? functions for my data to the models... I see Chris has them in the views... I am still trying to grasp the separation of concerns
13:38ziltilol
13:38licenserTimMc: but they were quality squirrels!
13:38wingiepbuckley: yeah of course its here .. (almost) but Steve Jobs noticed on mobile phones people are actually using apps more than browser .. it just fits better and gives a smoother experience
13:39TimMcdamn straight
13:39pandeirolike where would data processing/mapping happen, in the view or the model?
13:39licenserthat were better times *sigh*
13:39wingiewe use facebook.. twitter etc .. very specific about what we wanna use
13:39ziltiwingie: But mostly, those "apps" are just embedded browsers
13:39licenserthey were no cheep china squirrels like you get today ...
13:39TimMcThese modern squirrels fall apart if you so much as look at them.
13:39wingiethat will come into the mainstream computers one day .. then JS wouldn't have that much of monopoly
13:39solussdare type hints supported for return values now? I don't see it documented on clojure.org (that site needs some serious updating)
13:39wingieor importance compared to today .. which will make me happy =)
13:40wingiezilti: yeah they are hacks right now
13:40wingiephonegap etc
13:40solussde.g. (defn ^Type blah [arg] thingOfType)
13:40cgraysolussd: yes, type hints are supported for return values
13:40licenserwingie: but the apps were pre fared because they were more tailored to the over all user experience of the device
13:40licenserif you just plug the same apps on a windows phone 7 device they probably wouldn't be enjoyed that much
13:41wingielicenser: yeah .. the user experience will get better .. but i think it has already opened users mind about how you do things
13:41licenserwingie: I agree that apps are the better way if they are 1) portable and 2) provide a native user experience on all platforms
13:42licenserit starts that AquaMacs on OS X behaves horribly different from Emacs on windows or console-emacs on linux
13:42licenserthe same app but I feel like they are three entirely different ones
13:43technomancyaquamacs is a fork
13:43wingielike Steve Jobs believed .. i believe too .. the user experience in computers we know today (dekstop/laptops) will be dinousaurs maybe in 10 years .. just like the floppy disks .. just a possibility nice to have in mind if you are a developer (so it can guide you through your choices)
13:43technomancyit shouldn't be surprising that it behaves differently; it's just like how firefox behaves differently from the Mozilla suite.
13:44wingieperhaps it will not longer be about web sites .. but apps!
13:44TimMcOh man, is that still around?
13:44technomancyprobably not; I had a hard time picking an analogy. =\
13:44licenserwingie: or it might be all about web apps but no apps any more :P
13:45wingielicenser: impossible
13:45licensernot at all
13:45wingiewe are actually heading the other direction
13:45wingiearent we?
13:46wingiepeople mimich apps using web
13:46licenserI think we are currently more heading into the web apps direction
13:46wingieyes
13:46wingiebecause its just a mimick
13:46wingieeg. Sproutcore has already begun a cool project
13:46licenserdoesn't mean that if someone comes up with a good solution for apps
13:46licenserit won't change
13:46pandeirodid fogus ever release any results of his survey on Clojure users?
13:46wingieyou write once and its deployed in all platforms .. web is just one of them .. just another platform
13:47wingienot "the one"
13:47wingieiOS, Android, Web .. its 3 different platforms
13:47wingiethat is how they think of it
13:48ziltiAnd they think: "Let's make it for the web, so it runs on every device and we save a lot of money"
13:49wingieyeah the web platform is huge .. app platforms is evolving
13:49wingiei personally hope app platforms will win
13:49wingieweb wasn't meant to do these things
13:50ziltiI hope that, too
13:50wingieit's a good transportation layer though
13:50ziltiBesides I don't like the cloud that much. It's useful sometimes, but I want to control my data
13:50wingieso now i have another reason to learn other langs like clojure
13:51wingiezilti: just because your are using an app doesn't mean thats its not in the cloud
13:51wingieyour data that is
13:51wingiebrowser is just a client for consuming things
13:51wingielike an app
13:51wingieso it would still be data in cloud (i believe that is a good model)
13:51ziltiYes, but usually if you have a "desktop app" you have a possibility to store the data on your device
13:51wingieright
13:52wingieoffline data
13:52wingiethats a good solution
13:52ziltiI rarely see this on web apps
13:52ziltilogically
13:52wingieyeah its emerging
13:52wingiecloud9ide supports it
13:52wingiebut i feels apps are the way to go .. ahh .. we are lucky to live in this time
13:52wingieso much happening
13:53RickInGAwingie /agree
13:53rabblerAnyone know if the "Clojure in Clojure" initiative is still under development? Just curious.
13:53wingie(and in percentage not many knows about this)
13:53wingielike looking into the future .. and create it today
13:53wingie$$$
13:54RickInGAI just installed clooj... when I type (+ 1 2) in the input, I get (+ 1 2) in the REPL output, was expecting 3
13:54jodaroRaynes figured out a way to time travel with Clojure
13:54jodaroso we could probably do that right now
13:55Raynes&(clojure.string/reverse "2012")
13:55lazybot⇒ "2102"
13:55RaynesWelcome to the future.
13:55ziltilol :)
13:55RickInGAnice
13:55jodarogood thing irc is still around in 2102
13:55wingiehaha
13:55technomancy:dependencies [[org.clojars.docbrown/flux-capacitor "0.0.1-SNAPSHOT"]]
13:56ziltiToo bad we can't look what's happening outside IRC in 2102 :(
13:56jodaroheh
13:56jodarocrap, forgot plutonium at safeway
13:57RickInGAanyone using clooj 0.2.7 on windows?
13:58ziltiOh, Windows's still around, too?
13:58RickInGAheh, yeah some of us are still on legacy platforms
13:58jodarohuh
13:58jodarothe future kind of sucks
13:58jodarobring us back, Raynes
13:59RickInGAI seem to have a RPL as opposed to a REPL. wondering if there is something I need to set to get my E :)
13:59Raynes&(clojure.string/reverse "2102")
13:59lazybot⇒ "2012"
13:59dabdhow do you call append-spit from duck-streams? when i call it with (ds/append-spit "~/tmp/out.txt" "hello") I get Can't dynamically bind non-dynamic var: clojure.contrib.duck-streams/*append-to-writer*
13:59RaynesYou're trying to use an ancient library with a not-so-ancient version of Clojure.
14:00RaynesYou don't need duck-streams for this. http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/spit the normal spit works with an :append option.
14:00Raynes(spit "somefile" "sometext"
14:01dabdty
14:01RaynesDamn enter key.
14:01RaynesToo close.
14:01Raynes(spit "somefile" "sometext" :append true)
14:02Raynes$examples clojure.core/spit
14:02lazybothttps://gist.github.com/1561483
14:02RaynesThat's right. He can do that.
14:07cemerickIf one were to publish an example (and therefore not well-behaved) web crawler, what URL should be used as the crawl root?
14:07cemerickI'd like to get a decent spread (i.e. dredging google isn't compelling), but I'm having a hard time coming up with a site that I don't mind quasi-DDOSing.
14:08ibdknoxcemerick: what are you ddosing?
14:09cemerickibdknox: you missed my first msg… :-)
14:09cemerickIf one were to publish an example (and therefore not well-behaved) web crawler, what URL should be used as the crawl root?
14:09ibdknoxlol
14:10cemerickI am perhaps overestimating the example's reach. ;-)
14:10ibdknox:)
14:10cemerickBut I figure it's better to be polite in any case.
14:10cemerickOr, be impolite to someone that won't care.
14:11ibdknoxamazon!
14:11cemerickhrm, maybe
14:11cemericknot the best spread though…
14:11cemerickThe best thing I've come up with is BBC's news section.
14:12ibdknoxthat's not bad
14:12cemerickwikipedia is even better, but that feels wrong somehow
14:14jodaroif you donate $20 first, you might feel better about it
14:15ibdknoxhaha
14:15ziltilol
14:16zilticemerick: What are you parsing the pages with?
14:16ibdknoxenlive, I assume
14:16ziltiDidn't know that's possible
14:16cemerickyeah, enlive
14:16semperosit's quite adept at it
14:16ibdknoxit's one of its primary use cases :)
14:16cemerickwhich uses tagsoup
14:17ibdknoxzilti: dnolen has a good tutorial on it on his github
14:17ibdknoxcemerick: book example?
14:17cemerickyup
14:17ibdknoxzilti: and cemerick has in his book :)
14:17ibdknoxlol
14:17cemerick91 lines for a pretty decent little webcrawler, with some stupid word frequency tabulation as well
14:18ziltiThe last time I had to parse HTML I tried a few libs
14:18ziltihtmlcleaner was the only one able to parse EVERYTHIN
14:18cemericknever heard of it
14:18ziltihttp://htmlcleaner.sourceforge.net/
14:18cemericktagsoup and stone soup have never failed me *shrug*
14:18ziltiIt's java, though. But it's small and simple IMO
14:19cemericknot that I do this sort of stuff much
14:19cemerickGah, Java? I try to say away from stuff written in Java.
14:19ziltilol, and then again you're using Clojure
14:20cemerickzilti: I'm very dry. ;-)
14:20ibdknoxall the cool kids are.
14:20ibdknoxcemerick: I'd say it and mean it ;)
14:20cemerickThat should mean that I need to get outta here.
14:21cemerickibdknox: you are in the *wrong* place then! :-D
14:21ibdknoxstumbled in here by accident
14:21ibdknoxI was trying to go to #closure ;)
14:21jordandanfordI'm new to Clojure and I'm having some trouble with macros and namespaces - can someone help? http://pastebin.com/B75pHUni
14:21cemerickibdknox: oh, burn
14:22ziltijordandanford: If you're new to Clojure macros should be pretty much the last thing to learn
14:23ibdknoxjordandanford: it's usually not a good idea to create magic vars like that.
14:23jordandanfordibdknox: What would you recommend I do instead?
14:23cemerickjordandanford: You're trying to establish anaphoric bindings, and what ibdknox said. Very rarely a good reason for either.
14:23cgrayjordandanford: and you probably mean ~@body rather than ~body
14:24jordandanfordcgray: oh yeah, good point
14:24pandeiroibdknox: i'm trying to test my app at the REPL (swank) and getting no such var arguments, yet running `lein run` works fine... do I need to manually require all the namespaces in the REPL before requiring app.server?
14:24cemerickjordandanford: (println (:name current-state))
14:24ibdknoxpandeiro: what do you mean by test your app?
14:25ibdknoxpandeiro: Noir doesn't mess with Clojure's dependency resolution so requiring server should require all the things it needs
14:26pandeiroibdknox: yeah i mean i just want to run the app from the REPL...
14:26jordandanfordcemerick: I'm going to end up with a lot of functions that modify the state map, so I was just hoping I could use a macro to reduce the boilerplate – is that just a bad idea from the start?
14:26lynaghkcemerick, you know about the JIRA, yeah? I just submitted my first patch to CLJS and I accidently set the status to "in progress", though it should probably be "open" until a core member has time to look at it, right?
14:27cemericklynaghk: yup
14:27ibdknoxpandeiro: as in just start the server from the repl? That should work
14:27lynaghkI can't figure out how to flip it back.
14:27ibdknoxpandeiro: what's the exact error you're getting?
14:27lynaghk(p.s. I am not so good at "computers")
14:27ibdknoxlynaghk: me neither
14:27ibdknox:D
14:27cemerickjordandanford: I don't think (:name state) is boilerplate :-)
14:27pandeiroNo such var: user/prepare-user-doc
14:28lynaghkNice job on Mostly Lazy, b.t.w., I listened to the episode with chris granger this morning.
14:28cemerickkeys into maps are pretty essential; hiding them behind magical macros isn't really doing anyone any good.
14:28pandeiroibdknox: yet like i said, i don't get that error with `lein run`, only when i try to require myapp.server
14:28ibdknoxpandeiro: ah, I wonder if swank doesn't execute in the directory of your project
14:28ibdknoxpandeiro: try changing it load-views-ns instead of load-views
14:28cemericklynaghk: thanks :-) Going roll in a new format soon. Hoping people like it, too.
14:29pandeiroibdknox: ah ok
14:29cemericklynaghk: link to this JIRA issue?
14:29lynaghkhttp://dev.clojure.org/jira/browse/CLJS-114
14:29ibdknoxpandeiro: I don't use swank, so I've not run into this
14:29ibdknoxpandeiro: but assuming the classpath is setup correctly, load-views-ns should wor
14:29ibdknoxk
14:29pandeiroibdknox: that did it, thank you
14:30ibdknoxnp :)
14:30pandeiroibdknox: what do you use?
14:30ibdknoxpandeiro: VIM :D
14:30jordandanfordcemerick: I'm not referring to that in particular, I just mean that I'm going to need to get a lot of those values in every function and I don't really want to write out extra let bindings every time
14:30ibdknoxhaha
14:30jordandanfordcemerick: but I guess I'm just being lazy
14:30emezeskeibdknox: I thought maybe I was insane for using VIM, it makes me happy that I'm not alone :)
14:30ibdknoxemezeske: not at all
14:31ibdknoxwe are the few and the proud ;)
14:31cemerickjordandanford: That may be the case, but at the very least, I would write them out a couple of times before
14:31pandeiroibdknox: i made the switch when i decided to focus on learning clojure... after 2 years learning vim... embarrassed to say i can't even remember some of the most basic bindings
14:31lynaghk:wq
14:31cemerickgetting into a macro, so you understand what you need
14:31ibdknoxemezeske: also I mostly just like being able to say that I don't use emacs so I don't have to fix those problems for people ;)
14:31jordandanfordcemerick: okay
14:31ibdknoxlynaghk: lol
14:31cemerickjordandanford: That, and anaphora are tricky :-)
14:31pandeiroibdknox: haha
14:32jordandanfordcemerick: seems like it
14:32emezeskeibdknox: excellent plan!
14:34cemerickemezeske: #2 editor in these parts; you're far from alone
14:35pandeiroibdknox: i noticed in the webnoir examples, you put valid? functions together with a view, and in noir-blog, you stick them with the models... any logic behind that?
14:35pandeiro(is this stuff that would traditionally go in the 'controller' portion of a rails/etc app?)
14:35ibdknoxpandeiro: I usually put them in models
14:36pandeirowhat about data-mapping and processing? also models usually?
14:36ibdknoxpandeiro: yessir
14:41ibdknoxClojure has been eating HN these past few days :)
14:45lynaghkcemerick, is there anything I can do about this mangled JIRA issue, or should I just let it be for a week or two?
14:47TimMclynaghk: You can't just edit it?
14:47pandeiroibdknox: with load-views-ns I don't get the error output, but I also don't get any of my views ... should I take it to #emacs? ;)
14:47ibdknoxhaha
14:48lynaghkTimHc, the status field doesn't show up anywhere on the edit screen
14:48ibdknoxpandeiro: easiest solution is to just require your views explicitly at the top like you would normal files
14:48ibdknoxpandeiro: what does your load-views-ns look like?
14:48pandeirorequire all the views in the server.clj ?
14:48TimMclynaghk: It's probably handled differently.
14:49ibdknoxpandeiro: yeah, that essentially what those are doing
14:49pandeiro(load-views-ns "src/woodshed/views")
14:49ibdknoxah
14:49ibdknoxit should be (load-views-ns 'woodshed.views)
14:49pandeirowha... ok
14:49cemericklynaghk: Let it be; as long as it's tagged appropriately, it should move through
14:50ibdknoxpandeiro: you're telling it what namespace you want to load, as opposed to a directory
14:50lynaghkcemerick, okay. Thanks Chas.
14:50cemerickbug people on clojure-dev ~Friday if it hasn't been touched
14:51lynaghkWe git-submodule our dependencies from private repos, so it's not a huge need since we wrote the patch. I just want to be a good citizen = )
14:51pandeiroibdknox: still no views... guess i will have to add them manually to server.clj if i want to use the swank repl?
14:51TimMclynaghk: Status changes are performed using specific transitions on a state machine graph. :-)
14:51ibdknoxpandeiro: I guess so :( Sorry I'm not more help there :/
14:52TimMcUnfortunately, this JIRA installation does not have a transition from In Progress back to whatever.
14:53pandeiroibdknox: np, you've helped plenty... i will adjust my workflow for now
14:53pandeiroi already wasn't using swank to launch the app, just thought it would be cool
14:53lynaghkTimMc, That's certainly a positive outlook: always making progress.
14:54TimMchaha
14:54gregATioanyone there?
14:54ibdknoxpandeiro: I don't think there will be a huge benefit over just using Noir's reload behavior, but I dunno
14:55TimMcgregATio: Where?
14:55ibdknoxTimMc: I dunno, but I'm there
14:55gregATiojust using irc in emacs for the first time
14:55gregATiolol , ok ok , i guess its working
14:57TimMclynaghk: It's a mildly interesting topic: https://confluence.atlassian.com/display/JIRA/Configuring+Workflow
14:57pandeiroibdknox: yeah really what i wanted to be able to do is examine things inside the running app... validation/*errors* for example
14:57lynaghkTimMc, I thought you were joking about the state machine.
14:58pandeiroibdknox: i am debugging load-views-ns and your implementation is getting all the nested namespaces just fine...
14:58TimMcIt makes sense though, doesn't it?
14:58ibdknoxpandeiro: ah, so those are bound per request, so you really wouldn't be able to see them anyways. You'd have to print them out or something
14:58pandeiroibdknox: ah ok, Raynes told me that an hour ago and I pretended I understood but now I get it
14:58ibdknoxhaha
14:59RaynesNice to know that I'm excellent at explaining things.
14:59pandeiroso there really isn't anyway to example requests while they happen?
14:59RaynesGood thing I'm not writing a book.
14:59RaynesOh wait...
14:59jodarohaha
14:59ibdknoxRaynes: :D
14:59pandeiroRaynes: no it's a pebkac issue for sure (on my side)
14:59ibdknoxpandeiro: not without being able to break at a specific line
15:00ibdknoxwhich I believe you can do using the debuggers out there
15:00ibdknoxbut that's getting deep into emacs land
15:00pandeiroyeah i don't think i will make it there in 2012
15:01pandeirobasically then there isn't much advantage to launching the server in the REPL (other than not having to leave the REPL, which is comforting :)
15:01ibdknoxyeah, pretty much
15:03TimMcThe REPL means you can redef stuff, though.
15:04ibdknoxTimMc: it reloads the NS, so you essentially get the same behavior
15:05pandeiroibdknox: so i just had to do the (load-views-ns 'woodshed.views) inside the REPL
15:05TimMcoof, right
15:05ibdknoxpandeiro: oh cool :D
15:12_ViIs there way to automatically convert "(:use some.namespace)" to "(:use [some.namespace :only [this that those]])"? It should scan the source, resolve things and "register" them in ":only" lists.
15:13amalloyslamhound alleges to do this
15:17zilti"Caused by: java.lang.RuntimeException: Unable to resolve symbol: pass in this context" What could cause this error? That symbol doesn't exist anywhere in my source code
15:22VinzentWhat can I use to extract the text content of a page?
15:25ziltiVinzent: Web page? enlive (Clojure) or - my recommendation b/c I already did it - htmlcleaner (java)
15:27Vinzentzilti, yes, but I need only text, without any tags. https://github.com/tol/webmine seems outdated
15:29yazirianIf I run clojure-jack-in, where do stdout/stderr go? They aren't appearing in the REPL, nor are they appearing in *swank* or something, and slime-redirect-inferior-output says "No inferior lisp process"
15:32wingiei can't require math: (require 'clojure.contrib.math)
15:32wingieit says couldn't not include it
15:32wingieim using "lein repl"
15:32TimMcwingie: Don't use contrib...
15:32TimMcunless you really have to.
15:33amalloyand then if you really have to, still don't
15:33wingiewhy?
15:33clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack>
15:33wingiebut the issue still remains .. why can't i require it?
15:33amalloyhaha good call clojurebot
15:36wingieTimMc: could you explain why i shouldn't use it?
15:36ziltiwingie: Because contrib is discontinued
15:36ziltisince like forever
15:36TimMcwingie: It's hard, I have a terribvle connection right now.
15:37TimMcBasically, it's a monolithic lib containing unmaintained parts. Hard to version, too!
15:37ferdAny enlive expert around? I need a way to delete a node (and it's children) but the condition is on one of the children. Example: Delete nodes whose child element contains text "test": <x><y><z>test</z></y></x> -> <x></x>
15:38TimMcwingie: Anyway, do you have it in project.clj? And have run lein deps?
15:38wingiei see
15:38wingieno i haven't
15:38wingiei guess i shouldn't have
15:38wingieokay .. no contrib!
15:38TimMcEverything, including clojure.core, needs to be listed (or a dep of something that is.)
15:38wingiehate unmaintained stuff
15:39wingiecode is like muscles
15:39fbru02_is there a way to distinguish if you are creating a var or just calling make a fucntion call ?
15:39wingiehave to be maintained
15:39TimMcfbru02_: defn is def + fn, if that's what you're asking.
15:40wingiein a post the author said rather use "require" than "use"
15:40wingieis this better practice?
15:40TimMcwingie: use is fine with :only, and require is gest with :as
15:40TimMc*best
15:41wingieokay
15:41wingierequire reminds me about node.js
15:41wingiejust require it into a var
15:41fbru02_TimMc: no , i was thinking about introspection sth of the sort (defn foo (if (creating-var? (first [1 2 3]) (fnext [1 2 3])) ; (foo) => 2 , (def bar (foo)); (bar) => 1
15:43TimMcI don't understand the question, sorry.
15:43simonadameitis there a function to check if a sequence contains some elements?
15:43Vinzentsimonadameit, some
15:44Vinzentfbru02_, why do you need this?
15:45fbru02_Vinzent: i have a case where i need to distinguish when i'm doing a closure or when i'm calling the defn directly
15:45ziltisimonadameit: or some?
15:45TimMcsimonadameit: You mean, is not empty?
15:45simonadameitzilti: actually I want the seq to contain all members of a a set
15:45simonadameitor some collection
15:45simonadameitnot just some
15:45ziltiThere's a function for that, too, if I remember correctly
15:47simonadameitzilti: i thought so too.. but I dont seem to find the name right now
15:47ziltiMaybe "every?" works
15:47ziltihttp://clojuredocs.org/clojure_core/clojure.core/every_q
15:48ziltilooks like it's what you're looking for
15:48Vinzentfbru02_, as being said, defn is just (def name (fn ...)), I don't think you can do that without wrapping all your code in some macro... If I understand you correctly, which I probably don't :)
15:49fbru02_Vinzent: heheh thanks!! I thnk i will go the macro way
15:49simonadameithm… not exactly, since I want to check if a seq/collection contains all elements, not if a predicate is true for all elements of the seq
15:49ziltifbru02_: defn is just a macro expanding to (def name (fn ...))
15:49simonadameitit can contain others too
15:49Vinzentfbru02_, anyway, why do you need such thing?
15:50Vinzentsimonadameit, clojure.set/subset or somethin like that?
15:50emezeskesimonadameit: every? #{elements that I want} coll
15:50ziltisimonadameit: It works even if the set contains others, too
15:50fbru02_Vinzent: so, let think about it for a while and then I tell you :) maybe my thinking is wrong
15:50emezeskesimonadameit: would using the set as the pred work?
15:50zilti,(every? #{1 2 3 4 5 6 7} [1 2 3])
15:50clojurebottrue
15:50Vinzentfbru02_, ok
15:51simonadameit,(every? #{1 2 3} [1 2 3 4])
15:51clojurebotfalse
15:51simonadameitthat I want to be true
15:51TimMcfbru02_: You're probably trying to do somethign terrible.
15:51ziltisimonadameit: You could just flip the order
15:51zilti,(every? [1 2 3 4] #{1 2 3})
15:51clojurebottrue
15:52Vinzent,(clojure.set/subset? #{1 2 3} (set [1 2 3 4])) ; more readable, imo
15:52clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.set>
15:52Vinzent,(require 'clojure.set)
15:52clojurebotnil
15:52Vinzent,(clojure.set/subset? #{1 2 3} (set [1 2 3 4])) ; more readable, imo
15:52clojurebottrue
15:52emezeskeVinzent: that definitely seems like the right solution
15:52simonadameitzilti: that only works incidently since vector looks up keys :))
15:53simonadameitI guess I will have to do with set… though that is less efficient than it could be in this case
15:53simonadameitno need to create a set from the seq
15:57wingiewould you use clojure to write a banking system?
15:57wingieor a game backend?
15:58TimMcDidn't you already ask this?
15:58wingieno?
15:58clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack>
15:58wingienot this specific
15:58TimMcclojurebot: botsmack
15:58clojurebotOwww!
15:58Vinzentwingie, someone already wrote MMO server in clojure
15:58wingieMMO?
15:59TimMcwingie: OK, someone was asking here (like yesterday) about game dev. Oh, right -- it was about OOP or something.
16:00ziltiI wouldn't write huge games in clojure - I don't think the transactional memory system can handle that
16:00Vinzentwingie, yeah, online game. I can't give you a link, but I read about it in some blog...
16:01ziltiVinzent: You mean this one? http://code.google.com/p/poonscape/
16:02emezeskezilti: what is it about the STM system that you think can not handle a huge game?
16:02ziltiARGHHH WHY does Clojure keep spitting errors at me because of keywords that aren't there??
16:02lazybotzilti: Definitely not.
16:02Vinzentzilti, no, i don't think so
16:02simonadameitis there a preferred paste site/bot for this channel?
16:03cemerickmost people use gist
16:03TimMc~paste
16:03clojurebotpaste is gist
16:03ziltiemezeske: Not that much the STM itself but more that if you copy the whole game stuff each frame (which has to happen if you code idiomatic) you'll fill the whole ram
16:03cemerickThe lisp paste bot used to be here, years ago.
16:03TimMcclojurebot: forget paste |is| gist
16:03clojurebotI forgot that paste is gist
16:03TimMc~paste
16:03ziltiand copying even in STM is slow compared to mutable data structures
16:03clojurebotpaste is gist
16:03TimMcclojurebot: You're terrible.
16:03clojurebotHuh?
16:03technomancyclojurebot: pastesnack
16:03clojurebotCool story bro.
16:04cemerickzilti: persistent data structures do not use copy-on-write.
16:04TimMczilti: JVM GC is pretty fast for small recent objects.
16:04emezeskezilti: so you're saying that any clojure app with lots of state will eventually run out of memory? that doesn't sound right...
16:04ziltiNo
16:04simonadameitzilti: this is what I had in mind: https://gist.github.com/1562138
16:04ziltiJust that 60 times a sec plus garbage collection will really slow things down I think
16:05simonadameiti wonder if clojure already has this :)
16:05TimMczilti: *really* fast
16:05ziltisimonadameit: Now it does ;)
16:06amalloyi bet clojurebot sees the . and gives up? if so that's terrible
16:06hiredmanthe what?
16:07cemerickzilti: I wouldn't knock it 'til you try it. The STM is no slouch.
16:07ziltiNever said it is
16:07ziltiIt's an amazing piece of code
16:07hiredmanor have tried it even without the stm
16:09ferdNo enlive guru around ?
16:10TimMcferd: You'll never know until you ask an enlive question. :-P
16:10Raynes~anyone
16:10clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
16:10ferdTimMc: I did a few mins ago ;-)
16:11RaynesSo your question was rhetorical? ;P
16:11ferdHere I ago again: I'm new to enlive... I cannot find a way to delete a node (and it's children) but the condition is on one of the children. Example: Delete nodes whose child element contains text "test": <x><y><z>test</z></y></x> -> <x></x>
16:12TimMcferd: Oh, I saw that. Bad timing.
16:12TimMcSomeone had just asked about why they shouldn't use contrib.
16:12ferdRaynes: exactly ;-)
16:14devinusi'm still struggling to understand when to use 'symbol vs symbol
16:14devinusfor example
16:15pandeirocan a nested map have meta data? no right?
16:15devinuswhy does use use (use 'clojure.repl) when doc uses (doc refer-clojure)
16:15devinuswhy isn't it (doc 'refer-clojure) ?
16:15amalloypandeiro: certainly
16:15cemerickferd: doable, but I'm tied up; maybe msg the ML. Someone (maybe me) will get to it in short order.
16:15Raynesdoc is a macro and use is not.
16:15ziltidevinus: the ' means "don't evaluate the following thing"
16:16pandeiroamalloy: I mean when using a map literal? without making it a var?
16:16devinuszilti: right, i get that much
16:16ziltiyes, and doc is a macro
16:16devinusbut how is (doc refer-clojure) evaluating refer-clojure?
16:16RaynesSince use is not a macro, it can't defer evaluation of refer-clojure, so if you don't quote it, it evaluates it immediately.
16:16devinusRaynes: i get that macro's don't quote the symbol, but why is doc a macro and use is not?
16:16devinusif use is not a macro, is it a fun?
16:17RaynesBecause...
16:17TimMcdevinus: doc uses the var -- (doc +) would give doc the fn, not the var.
16:17TimMcdevinus: You could write a doc function that takes #'+, but that's inconvenient.
16:17TimMcand doc is a REPL namespace fn, intended for the common case.
16:17pandeiroi'm wondering about i18n, using a single map to store strings vs. storing each as its own var... the advantage i see in the latter is being able to store metadata...
16:18devinusok, so is use a fn?
16:18RaynesThere is already a macro that makes use prettier, ns. It's always a good idea to base your API on functions and, if you want, add macros to make them easier to use later.
16:18Raynes&(ifn? use)
16:18lazybot⇒ true
16:18amalloybecause when you want to look up something's doc, you always have its name available in raw code: a macro can do that and might as well add some syntax sugar for it
16:18duck1123pandeiro: if it's all one var, that's only one thing to re-bind
16:18amalloybut when you want to import a namespace, you often only have the namespace passed to you as an argument
16:18devinusok…so use is a function, that brings up another question i have….
16:18Vinzentpandeiro, you can use metadata with maps, see 'with-meta'
16:19devinusif use can import names into the current namespace, isn't the namespace mutable?
16:19devinusand i see a lot of procedural-esque code like e.g. (update-foo!)
16:19ferdcemerick: Thanks... I'm making some progress... using the "has" selector... I think I'm close
16:19Vinzentby the way, why 'use' is a function? Imo, there should be the 'use' macro and the 'use*' function. Quoting in use leads to misunderstanding and confusing
16:20devinusVinzent: +1
16:20devinusthat's why i think i've been getting confused
16:21ziltidevinus: Yes, the namespace is mutable. Otherwise e.g. a REPL wouldn't be possible
16:21pandeiroduck1123: that is a good point, but with with ns-publics I could probably easily loop through and bind everything...
16:22Vinzentdevinus, this question has been raised already... Maybe it will be done in clojure 2.0, since it a breaking change.
16:23devinusVinzent: use vs use* you mena?
16:23devinusmean*
16:23duck1123I think 'use' is considered low level enough, that the sugar isn't needed
16:24technomancyhawt: (let [graph (fetch-github-projects (build-project-graph))] (->> graph :clj-stacktrace :dependents (map graph) (map :github-url)))
16:25duck1123if you're doing anything fancy with using that can't be done as part of the ns form, you already have to have them as symbols
16:25TimMctechnomancy: *nice*
16:25Vinzentdevinus, yeah. and also something like this https://github.com/stuartsierra/need would be cool
16:25amalloy(map (comp :github-url graph))?
16:25RaynesYeah, I was thinking that too.
16:25RaynesSeems kind of wasteful to map twice.
16:25technomancyfine, fine
16:26technomancyanyway, I found our next seajure project. =)
16:26Vinzentduck1123, use is widly used in the repl and in various tutorials, code examples, etc
16:26Raynestechnomancy: Will it use tentacles? :D
16:26technomancyRaynes: it uses clojuresphere
16:26TimMcRaynes: No, tentacles is so 2011...
16:26technomancywhich still uses clj-github
16:26devinusVinzent: that's actually pretty cool
16:26Raynestechnomancy: The new Github API doesn't have a search mechanism, so that makes sense.
16:27technomancyRaynes: not even list by language?
16:27RaynesNope.
16:27technomancyouch
16:28technomancyI wonder how much stuff is in github that's not in clojars though
16:28technomancyfor this particular purpose anyway
16:29Vinzentdevinus, yeah, I have no idea why it's still not in the core
16:30devinus*sigh* hopefully my copy of JoC is going to clear some things up
16:30mrb_bkI'm assuming that it will create more questions than it answers
16:30mrb_bkIn a good way
16:30RaynesIIRC, there is some consolidation going on for namespace imports.
16:31technomancyyeah!
16:31technomancythere's this open issue
16:32technomancyhttp://dev.clojure.org/jira/browse/CLJ-879
16:32technomancyyou should all go vote for it
16:32technomancysince it's getting ignored
16:32RaynesNot surprising.
16:32simonadameitis there something like quickcheck for clojure?
16:33devinussimonadameit: i'm interested in the same thing
16:33wingiethis was a good one: http://cemerick.com/2010/06/07/results-from-the-state-of-clojure-summer-2010-survey/
16:33djwhittthere's also https://github.com/clojure/test.generative
16:34hiredmanhttps://github.com/clojure/test.generative
16:34cemerickwingie: that's old
16:34cemerick~survey
16:34clojurebotsurvey is http://cemerick.com/2011/07/11/results-of-the-2011-state-of-clojure-survey/
16:34devinuswhen clojure.contrib was broken up, where was repl-utils landed?
16:34wingiedevinus: oh they have a clojure survery each year =)
16:35hiredmantest.generative hasn't seen a lot of use outside of stuart h. though
16:35cemerickthey? o.0 :-P
16:35cemerickThe omnipresent "they" perhaps.
16:35technomancycemerick: the royal we
16:35Vinzenttechnomancy, what's the problem with breaking backward compatibility? 1.3 and deprecating of contrib caused much more problems than changing ns decl can cause
16:35mcrittenden
16:35mcrittendenoops
16:36technomancyVinzent: well the whole point of contrib was it was full of ideas that weren't necessarily very good to begin with. so there was no guarantee of stability.
16:36simonadameithiredman: thanks ill look into it
16:37technomancyVinzent: practically speaking people ended up using it like the standard library because early on there was no alternative, but it was very clear that was not the intention
16:37Vinzenttechnomancy, but, anyway, is was de-facto standard clojure library
16:37technomancyVinzent: right; in the end the only difference is that core gets to say "i told you so" when everything breaks.
16:39Vinzenthah, right...
16:39devinusanybody know what happened to clojure.contrib.repl-utils? :(
16:41Raynesdevinus: clojure.repl
16:41devinusRaynes: what happened to show ?
16:43devinusit listed out all the methods of a java object pretty nicely
16:43TimMc~what happened to contrib?
16:43clojurebotWell... it's a long story: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
16:44TimMcdevinus: ^
16:44devinushrm...
16:44TimMcdevinus: clojure.reflect/reflect, sort of
16:45xcvHey guys, does anyone have a feel for how a typical noir-esque clojure web stack performs compared to rails?
16:47devinusxcv: probably generally faster, unless there's some serious architectural problems with noir
16:47xcvI realize that this question might not have a perfect answer, but do share if you have any biased anecdotes or gut-feeling approximations
16:47xcv:P
16:47ibdknoxxcv: well
16:47xcvdevinus: I'd think so, a priori. How much faster in general? 50%? 20%?
16:48TimMcA friend of a friend once told me that noir doesn't have to reticulate quite so many splines as rails does.
16:48devinusxcv: i don't know myself, but we are talking about rails. it's not known for it's speed. plus clojure has the JVM working in it's favor
16:48ibdknoxTimMc: it's true
16:48xcvhaha
16:48devinusand i'm pretty sure noir can use jetty right? which means it can utilize multiple threads
16:48ibdknoxyes
16:48devinus(i think?)
16:48ibdknoxdevinus: Noir can use anything
16:49xcvand then there's aleph
16:49devinusright
16:49ibdknoxNetty/Tomcat/Jetty
16:49devinuswhich uses netty
16:49devinusnice
16:49ibdknoxxcv: I have a gist that has Noir on top of aleph
16:50xcvibdknow: Ok cool, I'll check that out
16:50duck1123transitioning from jetty to aleph was pretty easy
16:50devinusNoir would probably do best on netty when used in a highly concurrent simultaneous situation like a chatroom or something, prob best on jetty when serving sites
16:50devinusthat's just an educated guess though
16:50ibdknoxdevinus: correct
16:51xcvI think my use case calls for jetty then
16:52xcvthe reason I ask is that I was checking out some mailing lists for yesod, the haskell web framework, and though one would think haskell outperformed rails (being statically typed and compiled), that was not the case, since the rendering engine yesod used was slower
16:53xcvthey seemed to be working on fixing it, but it got me thinking whether the "newness" of some of the clj web libs was hurting performance or not
16:53xcvnot rendering in particular, but the general case
16:53xcvthat's why I asked
16:54xcv[outperformed ruby, I mean]
16:54technomancythat's quite surprising
16:54technomancyI bet yesod lets you swap in a more efficient rendering engine though
16:55xcvah, sorry, seems it was the database driver in that case
16:56xcvhere's part of that conversation (http://www.haskell.org/pipermail/web-devel/2011/001064.html)
16:56TimMcYep, the whole stack matters.
16:56xcvbut of course, this is an area where the java interop is really helping clojure
16:58xcvso my gut tells me a lot of those problems are not there for clojure, thanks to all the battle-tested libs that are being wrapped below the surface
16:59technomancyyeah IIRC the yesod author had to write his own mysql adapter
16:59xcvyeah, I think I heard about that too
17:01xcvthey're working on a couple of different postgres adapters, but it seemed like neither of them was both performant and production-ready
17:07devinushrm
17:08devinusdoes anybody know how to start a newline in the current parens with paredit without slime taking the line?
17:08amalloyi use C-j
17:08amalloywell. actually i don't use paredit in the repl. but C-j works anyway
17:09devinusit does work
17:09devinussort of annoying though
17:09devinusmaybe i should bind Shift-Enter to be the new enter
17:09amalloytechnomancy: i am completely baffled by some behavior i'm getting from lein. i have this test, which depends on protocol P being extended to type T. when i run lein test, i get failures saying P isn't implemented for T. lein swank followed by (test #'the-test) returns :ok and prints nothing. lein repl followed by (test #'the-test) prints out the "no implementation" error messages and then returns :ok anyway, but i assume that's something to d
17:10TimMcamalloy: "that's something to d"
17:10amalloythat's something to do with me calling the clojure.test code incorrectly in some way. does any of this make sense to you, and is there more information i could provide that would help clarify?
17:10amalloy(thanks TimMc)
17:13technomancyI'm not sure what to expect calling test directly. what about run-tests?
17:13technomancyin general I'm useless re: protocol questions though
17:14amalloy&(doc run-tests)
17:14lazybotjava.lang.RuntimeException: Unable to resolve var: run-tests in this context
17:15hiredmanamalloy: the thing to watchout for with protcols and clojure-test-mode is runing tests can causes code to be reloaded
17:16amalloyhiredman: i don't use clojure-test-mode
17:16amalloybut yes, i agree it looks kinda like a classloader issue
17:16technomancybloody protocols
17:16hiredmanyou might want to turn on verbose loading and see what happens
17:17amalloyhiredman: how do i do that?
17:17amalloytechnomancy: run-tests clarifies things a little: the tests fail in both repl and swank, and only repl prints any output. weird, but whatever
17:17hiredman(alter-var-root *loading-verbosely* (constantly true))
17:18hiredmanyou can also do (require 'foo.bar :verbose)
17:18amalloywhat namespace is that in? it doesn't seem to be available in my 1.3 repl
17:18hiredmanit's in core
17:18hiredmanoh
17:18hiredman(alter-var-root #'*loading-verbosely* (constantly true))
17:18hiredmanof course
17:19amalloyoh, it's private. right
17:20Vinzentbtw, why there is no set-var-root?
17:21technomancyVinzent: that's not what vars are for.
17:21technomancyalter-var-root is awkward on purpose
17:26Vinzenttechnomancy, that's a strange approach. One can still misuse vars, awkwardness of alter-var-root won't stop him!
17:26technomancyugly things should look ugly
17:27amalloyhiredman: that's a neat little tool to know about. it doesn't seem to be useful for me, since each file is being loaded only once (in a probably-reasonable order), and calling run-tests doesn't cause anything to reload
17:27hiredmanhuh
17:29VinzentI remember I have (alter-var-root #'something (constantly (constantly :foo)) - that's too ugly for this
17:32amalloybut there's definitely some weird classloader voodoo going on. maybe it's relevant that the class i'm extending to is a java class; it is presumably not showing up in the clojure namespace-loading verbose info
17:33hiredmansure
17:39technomancyibdknox: noir uses clj-stacktrace, right?
17:39ibdknoxtechnomancy: yeah
17:40technomancyI'm adding functionality to let you specify frames to omit
17:40ibdknox!
17:40ibdknoxthat would be killer
17:40technomancyexcellent
17:41technomancyif you want to take a look at the omit-frames branch, basically right now it's just set up so the pst function takes an options map
17:41technomancyhm; but you probably don't use that as your entry point
17:41ibdknoxI don't
17:41technomancyyou use parse-exception?
17:41ibdknoxlet me look real quick at what I do
17:42devinus(defn my+ [& args] (apply '+ args))
17:42devinuswhat am i missing there?
17:42ibdknoxtechnomancy: yep
17:42devinushow do i refer to args correctly?
17:42ibdknoxdevinus: don't quote +
17:42devinusok, so apply is a macro
17:42devinussweet it works
17:42ibdknox,(doc apply)
17:42Bronsano, apply is a function
17:42clojurebot"([f args] [f x args] [f x y args] [f x y z args] [f a b c d ...]); Applies fn f to the argument list formed by prepending intervening arguments to args."
17:42ibdknoxnot a macro
17:43technomancyibdknox: so I've exposed the omit function as well: https://github.com/mmcgrana/clj-stacktrace/blob/omit-frames/src/clj_stacktrace/repl.clj#L56
17:43devinusgrr
17:43Bronsa,+
17:43clojurebot#<core$_PLUS_ clojure.core$_PLUS_@143fc61>
17:43technomancywould that get you what you need?
17:43devinusi still don't get how symbol resolution works
17:43ibdknoxtechnomancy: I think so
17:43devinuswell
17:43devinuswhat i mean is i don't understand why apply would take the unquoted version
17:44technomancyibdknox: do you already have a mechanism set up for how users would customize things like to-omit?
17:45amalloydevinus: apply doesn't want a symbol, it wants a function
17:45rjackI need to parse a query string and I'm trying to use ring.middleware.params as suggested here: http://stackoverflow.com/a/6596296/54967 but I can't use parse-params in my code. Is this because it's defined with defn-? How can I use it anyway?
17:45ibdknoxtechnomancy: no, I'll have to think about that. My thought was just to omit things I know you don't want to see... which isn't necessarily a long list, but enough that it would be valuable
17:45amalloy'+ evaluates to a symbol, +. + evalutes to a function, the implementation of addition
17:46devinusthere's too much mixing between functions that want symbols versus functions
17:46ibdknoxrjack: you might find it much easier to get started with Noir
17:46technomancyibdknox: there are curmudgeons who think that no such things exist
17:46ibdknoxtechnomancy: they don't use Noir ;)
17:46amalloyhah
17:46ibdknoxtechnomancy: like amalloy :p
17:47rjackibdknox: I'm using enlive because I need to scrape some web pages. Some infos I want to scrape are query string parameters in href urls.
17:47ibdknoxah
17:48hiredmantechnomancy: I am not saying that a mechanism shouldn't exist, I am saying that the default should not be to trim stuff out
17:48devinusamalloy: thanks
17:48devinusit's starting to slowly sink in
17:49technomancyhiredman: ok, but I need actual examples
17:49nickmbaileyhow do i import a type defined with deftype from another namespace into my current namespace
17:49nickmbailey(:use ns) doesn't seem to work
17:49technomancylike concrete things you would use that otherwise-lost information for
17:50rjackibdknox: I'm new to clojure so I don't know if I need to specify some parameter in (:use ring.middleware.params)) in order to use parse-params.
17:51ibdknoxrjack: defn- makes it private, unfortunately
17:51devinusclojure uses UTF16 strings right?
17:52rjackibdknox: as I thought :( thank you
17:53hiredmantechnomancy: depends, what you filtering out?
17:55Vinzentnickmbailey, use :import
17:55technomancyhiredman: clojure.lang.AFn and clojure.lang.RestFn seem like no-brainers
17:56technomancyprobably clojure.lang.Compiler and clojure.lang.Var as well
17:57Vinzentrjack, you still can use private fns like this: #'full.ns/private-var, but only if you really know what are you doing
17:57hiredmanI could see AFn and RestFn
17:57ibdknoxtechnomancy: I started writing something for a new project of mine that allowed me to also modify what was said for each frame of an exception
17:57nickmbaileyVinzent: thanks
17:57ibdknoxtechnomancy: to make them a bit more friendly
17:57technomancyibdknox: how so?
17:58hiredmandoes clj-stacktrace do transforming of java frames into clojure (fn classes into vars)
17:58ibdknoxtechnomancy: in this particular case the system you're working with is a blackbox, and should stay that way. So it would replace parts of the stack with what it was doing
17:59ibdknoxtechnomancy: kind of neat, but has limited applicability. It was also replacing the messages of exceptions based on the type and whatever other information I could extract.
18:00technomancyhiredman: I think so, if I get what you're asking
18:01hiredman,(class +)
18:01clojurebotclojure.core$_PLUS_
18:01hiredman-> clojure.core/+
18:01technomancyoh, yeah it does that
18:02technomancyhas to reimplement it though; it's a shame that's not exposed by Clojure itself
18:02TimMctechnomancy: I did see a demunge somewhere.
18:02TimMcclojure.main, maybe
18:03technomancyTimMc: oh cool; in clojure.repl. must be new-ish.
18:04technomancyyeah, :added "1.3"
18:04technomancyglad it exists, even though I can't rely on it in this case.
18:04TimMc,(require 'clojure.repl)
18:04clojurebotnil
18:05TimMc,(-> + class str demunge)
18:05clojurebot"class clojure.core/+"
18:06TimMcI guess clojure.repl was already use'd, that require wouldn't have done anything for me.
18:09rjackVinzent: it works, thank you!
18:09replacatechnomancy: do you want me to take a whack at the slamhound pretty-print thing?
18:10Vinzentrjack, but I don't thibk you really should use it in your case. It was done private for some reason
18:11technomancyreplaca: oh dang; sorry. way behind on my email.
18:11technomancyreplaca: yeah, I think the main issue was it was inserting newlines like so: (:use\n [whatever.blah])
18:13rjackVinzent: as strange as it may sound, I think that in this file https://github.com/rjack/ring/blob/master/ring-core/src/ring/middleware/params.clj parse-params should be public and assoc-params should be private.
18:14rjackVinzent: I don't know, but assoc-params looks like an helper function for parse-params, yet it's public.
18:14Vinzentrjack, indeed
18:14hiredmantechnomancy: one possiblity is release with omit defaulting to false, see what people come up with, and get a reasonable default from there
18:15technomancyhiredman: yeah, that may be wise
18:16rjackVinzent: let's see, I'm opening a pull request
18:55wingieare everything an object in clojure?
18:55wingieor is there no such thing
19:01gf3I notice sometimes people show the expansion of the function short-form by preceding it with a quote, does this work simply because the macro is expanded as usual, and the quote prevents invocation?
19:01gf3or is there some other magic at work there?
19:12jodaro`ahah
19:13jodarogloss.repeated is automagically prefixing my stuff with a count
19:13jodarowhich i don't wnat
19:13jodaroor want
19:13ztellmanuse :prefix :none
19:13jodaroperfect
19:13jodarothanks!
19:14ztellmankeep in mind that the frame needs to be bounded some other way
19:14ztellmanotherwise it will never actually return anything
19:14jodarohmm
19:14ztellmanyou could use finite-frame as a wrapper, for instance
19:14jodarobasically this protocol has a spot for 0 or more null terminated strings
19:14ztellmanor define a delimiter
19:15jodaroand a size field that tells the server the size of those strings (as a whole)
19:15jodaroso sometimes i need it empty
19:15jodarosometimes i need "foo"
19:15ztellmanis the size field always there?
19:15jodaroand sometimes i need "foo\0bar"
19:15jodaroyeah
19:15jodarosize field is required
19:15jodaro(and sometimes "foo\0bar
19:15jodarosorry
19:16jodarofoo\0bar\0baz
19:16ztellmanso isn't the size field the prefix you were saying you don't want?
19:16jodarowell i'm specifiying it manually
19:16amalloytechnomancy, hiredman: figured out my issue and it was pretty weird. try this: (defprotocol Foo (bar [this])) (def b bar) (extend-type String Foo (bar [this] 10)) ;; now, (bar "") returns 10 but (b "") throws an exception
19:17ztellmancan you put your frame in a gist and show it to me?
19:17jodaroi suppose i could let repeated specify it autmagically
19:17jodaroyeah, hold
19:18amalloygf3: #(foo %) is a reader macro, not a regular macro. it gets "expanded" as part of the process of reading, whereas regular macros get expanded during evaluation (which is suppressed when quoting)
19:18hiredmanamalloy: must be the magic protocol metadata+var name
19:19gf3amalloy: so the quote just prevents invocation of the already expanded macro?
19:19technomancyamalloy: you aren't making me trust protocols more
19:19jodaroztellman: https://gist.github.com/1563014
19:19jodarothats what i started with and i've just been splitting/joining by hand
19:19jodarobut having gloss handle it would be way cleaner
19:19TimMcgf3: No macros involved.
19:20jodarowait sorry, i left something out
19:20TimMcHey, it's ztellman!
19:20jodaro:type is just an :int32
19:20amalloyright, hiredman. b doesn't have :protocol in its var's meta, though i don't really know what the consequences of that are
19:20gf3TimMc: I am confused, amalloy just mentioned it is a reader macro
19:20jodaroin an enum
19:21ztellmanTimMc: hi
19:21TimMcgf3: reader "macro" :-/
19:21hiredmanthe call site isn't being compiled as a protocol callsite
19:21ztellmanjodaro, the data-size is defined earlier in the rame?
19:21ztellmanframe*
19:21TimMcztellman: We had a burning question for you the other day: Why specify codecs using maps, which aren't sequential?
19:21jodarooh, yeah
19:21jodaro(defcodec data-size :int32)
19:21jodaro
19:21jodarodoesn't really need to be like that i guess
19:22jodaroi was just trying to split things up
19:22ztellmanTimMc, you can use other data structures
19:22ztellmanbut sometimes it's nice to have the key-value pairing
19:22jodaroTimMc: i switched to ordered-map
19:22amalloyin fact the way i was doing it was a little bit different: more like (letfn [(make-fn [f] (...use f...))] (def bar-fn (make-fn bar)), so there was no var at all to have metadata on
19:22jodaroand it works great
19:22ztellmanfor instance [:int32 :int32] is a perfectly valid frame
19:23ztellmanjodaro: there are only interposed null delimiters, correct?
19:23jodaroztellman: i was doing something like {:m :int32 :f (string :utf-8)}
19:23ztellmanso "a\0b\0c", not "a\0b\0c\0"
19:23jodarowithout ordered maps but forgetting that they wouldn't be ordered
19:23jodaroyes, thats correct
19:24ztellmanok, so the best thing to do is just have the splitting be a post-step
19:24jodarook
19:24ztellmanputting together a forked gist, just a sec
19:24jodarothe request and response are the same format
19:24jodaroi'm already splitting the response
19:24jodaroand that works fine
19:27TimMcztellman: If you use a map, that restricts you to use of the exact same architecture and Clojure version -- the ordering is arbitrary.
19:28ztellmanTimMc, that's why ordered-map exists
19:28ztellmanjodaro: https://gist.github.com/1563018
19:28ztellmanI haven't tested this, but hopefully the intent is clear
19:29TimMcztellman: Wiki might need clarification, then -- plain maps are used everywhere.
19:29ztellmanTimMc, maps cleanly encode and decode within gloss
19:29jodaroztellman: nice, thanks!
19:30ztellmankeys are ordered alphabetically
19:30TimMcAh! I see.
19:30hiredmanb
19:30ztellmanif you're trying to conform to another protocol, ordered-map is required
19:30TimMcGot it.
19:30ztellmanI think I mention this in the wiki, but I'll double-check
19:30TimMcztellman: What "alphabetically" do you use?
19:30jodaroTimMc, ztellman: thats what threw me
19:30jodarothe alphabetical ordering
19:30ztellmanI sort by (name keyword)
19:31jodaromainly because i figured the key would be descriptive of the field
19:31TimMcztellman: I'm thinking about non-ASCII.
19:31jodaronot necessary an ordered key
19:31jodaronecessarily
19:31ztellmanok, if that was confusing I'll clarify in the documentation
19:31ztellmanthanks for the feedback
19:32jodaroyeah
19:32jodaromaybe just add in a plug for ordered-map in the first example
19:33mdeboardThis is a bit off-topic but do any of you have any recommended reading/study materials wrt machine learning?
19:35ztellmanTimMc: I think naive unicode sorting should be consistent even if it's not always "correct"
19:35ztellmanand consistency is all we need
19:36TimMcCodepoints worked.
19:36TimMc*works
19:36wingiewhy doesn't ^serializable-stu work
19:36wingiefor showing meta
19:37jodaromdeboard: https://cwiki.apache.org/confluence/display/MAHOUT/Reference+Reading
19:37jodarolooks like there is some stuff there
19:37mdeboardYeah I'm there atm
19:37mdeboardjodaro: thanks
19:37jodarohttp://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-867-machine-learning-fall-2006/
19:37technomancywingie: that's deprecated; use the meta function
19:37jodaroi haven't read any of it
19:37jodarobut
19:38wingietechnomancy: ah good .. i love using the names instead
19:38wingiemakes it more consistent
19:38wingiewhy i love clojure in the first place
19:38technomancy^ is now used to attach metadata instead of reading it
19:38wingieokay .. ill just use the function instead
19:38wingiethey should ditch all those syntax!
19:39wingiemake it clean and consistent with no exceptions!
19:39wingiewouldn't that be cooler?
19:39mdeboardjodaro: Yeah I guess I was looking for some first-hand recommendations from the Clojure crowd; thanks for your efforts
19:39wingiethe no syntax lang
19:46TimMcztellman: "When a frame is defined using a map, Gloss encodes the vals in an arbitrary but consistent order. To work with existing binary protocols, use Gloss' ordered-map (or a vector.)"
19:46TimMcSound about right?
19:54ztellmanTimMc: yeah
19:55ztellmanfeel free to make the edit to the wiki, if you're feeling driven
19:55TimMcOK, added after the encode/decode[BJust did. :-)
19:55TimMc(ugh, bad connection)
19:55ztellmanha, ok
19:55ztellmanthanks
20:02clj_newbanyone know of a decent effort to implement a J/K/APL DSL within Clojure?
20:07wingieIs it possible to use OOP JS frameworks (ExtJS, Sproutcore, YUI etc) with ClojureScript?
20:07TimMcwingie: You have the full power of JS in CLJS.
20:08ibdknoxwhen I get a minute again I'll release the cool stuff I did with jQuery in cljs
20:09alexbaranoskyhey TimMc, give any more love to TryClojureScript ?
20:10etoschAnyone know if there's a straightforward way of setting max_allowed_packets using with-connection on a mysql database?
20:14TimMcalexbaranosky: Nah, I'm still annoyed at it.
20:15ibdknoxTimMc: what's wrong?
20:16TimMcibdknox: Can't figure out how to get the namespace right.
20:16TimMcLet me start up the server...
20:19ibdknoxare you using Clojail to sandbox cljs compilers for each person?
20:20TimMcibdknox: http://k.timmc.org:7013/ Try (+ 1 2), then (str 6), then (clojure.core/str 6)
20:20TimMcOh, I'm not sandboxing the compiler at all. Should I?
20:21ibdknoxI thought it kept track of declared symbols so it can resolve them over time, but that might only be part of the repl functionality. I can't remember
20:21wingieTimMc: cool .. will check back later on it when it's mature
20:22TimMcibdknox: Anything it doesn't recognize gets a cljs.user. in front of it.
20:22amroI have a vector, [a1 a2 b1 b2 ...] and I need to process each pair at once. is there an idiomatic way for handling that?
20:23ibdknox,(doc partition)
20:23TimMcamro: partition is a good start
20:23alexbaranoskyamro, 'partition
20:23clojurebot"([n coll] [n step coll] [n step pad coll]); Returns a lazy sequence of lists of n items each, at offsets step apart. If step is not supplied, defaults to n, i.e. the partitions do not overlap. If a pad collection is supplied, use its elements as necessary to complete last partition upto n items. In case there are not enough padding elements, return a partition with less than n items."
20:23amrothanks
20:24hiredman~partition
20:24clojurebotpartition is probably not what you want; see partition-all.
20:24ibdknoxTimMc: hm, are you declaring a namespace somewhere for the user?
20:25TimMcI have only once ever needed partition-all.
20:25ibdknoxI almost always want it
20:25jodarorad. ztellman had exactly the solution i needed
20:25TimMcThe one time I needed it, it was for displaying data for human consumption.
20:26ibdknoxTimMc: lol have you tried this? (defn b [] (js/alert "hey"))
20:26ibdknoxTimMc: it might be worth looking into how I did brepl
20:26ibdknoxit's a similar problem
20:27TimMcibdknox: Here's latest: https://github.com/baznex/trycljs/blob/master/src/trycljs/models/compile.clj
20:27TimMcI'm basically flailing around.
20:27ibdknoxI think if you refer clojure.core into there it'll work :)
20:28TimMcIs that it?
20:29TimMcibdknox: As in, (refer 'clojure.core) as the first part of the code to compile?
20:30ibdknoxmhm
20:31TimMcibdknox: Evaluation error: TypeError: cljs.core.refer is undefined
20:31ibdknoxlol
20:32ibdknoxanother potential solution is to wrap all of it in an NS call
20:32ibdknoxbut that won't work long term if people are allowed to define functions
20:33TimMcibdknox: ns call won't work -- GClosure throws a shitfit
20:33ibdknoxlet me see what I did then
20:34TimMc(goog.provide() throws an error the second time you give it the same ns to "teach new developers not to do that")
20:35ibdknoxI cheated and used compiler internals
20:36TimMcI saw a browser repl thingy in the CLJS codebase, is that brepl?
20:36ibdknoxnope, that's the official browser repl
20:37ibdknoxI wrote mine a couple days after CLJS came out
20:37wingiewhat does # mean: (meta #'str)
20:37mdeboardhipster
20:37ibdknoxI think they used mine as inspiration
20:37ibdknoxmdeboard: srsly.
20:37TimMcfound it
20:38alexbaranoskywingie, means its a var
20:38ibdknoxI think the problem is you need to add clojure.core to the build environment, without sending it to the client again
20:38TimMcwingie: # is a reader dispatch character. It is meaningless without the next char.
20:38alexbaranoskywingie, specifically #' indicates that 'str' is a var
20:39TimMcwingie: #'foo is (var foo)
20:39wingiealexbaranosky TimMc I see
20:39wingiethe latter seems more understandable
20:39TimMcwingie: read http://clojure.org/reader
20:39alexbaranoskytry: (#'str "a" "b")
20:39wingie,(#'str "a" "b")
20:39clojurebot"ab"
20:39TimMcibdknox: Did you solve the require vs. goog.provide problem?
20:39ibdknoxbut the compiler has to know about that ns otherwise it won't be able to resolve it. Last I knew it basically just kept a map of vars and their corresponding namesapces
20:39ibdknoxyeah
20:39alexbaranoskywingie, understanding is in the eye of the beholder
20:40wingiealexbaranosky: yepp .. good that both methods exist
20:40wingiei like choice
20:40alexbaranoskyI think #' goes back to Common Lisp
20:40alexbaranoskyso we're building on the backs of the greats here :)
20:41hiredman#' means something different in common lisp
20:41TimMcibdknox: Maybe I can surgically remove the ns declaration after compilation. >_<
20:41hiredman"look up the value of this symbol in the function namespace" or something
20:42ibdknoxTimMc: what you really want is to just call analyze and emit on the things, that will solve your problem
20:42jcrossley3is there a way to determine whether a java class is available at runtime?
20:42ibdknoxTimMc: you'll have to sandbox though, otherwise people's functions will stomp on eachother
20:42alexbaranoskyhiredman, ahh, I wasn't aware it had a different meaning in CL. thx
20:42hiredmanhttp://c2.com/cgi/wiki?SharpQuote
20:42mdeboardIf anyone's was paying attention earlier when I asked for first-hand recommendations for ML reading, I got a recommendation for http://www.amazon.com/gp/product/B0028N4WM4, $6 on the kindle
20:43hiredman"it's a crazy lisp 2 thing"
20:43TimMcibdknox: Are you sure that the analyzer needs to know what functions have been declared?
20:44TimMcI was hoping that since symbols are expanded by default to cljs.user/foo that I wouldn't have to bother.
20:44alexbaranoskyhiredman, totally makes sense, since symbols are in another namespace from functions in lisp 2's
20:44ibdknoxah
20:44ibdknoxsure
20:44ibdknoxTimMc: it at least needs to know clojure.core and anything else you want to expose
20:45technomancyalexbaranosky: assuming keeping functions in a separate namespace made sense in the first place =)
20:45ibdknoxTimMc: also, don't forget, you can always overwrite goog.provide to not be retarded
20:46alexbaranoskytechnomancy, well, if you're going to be crazy, might as well make sense while you're at it
20:46etoschjcrossley3: you mean like http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/ClassLoader.html?
20:46TimMcibdknox: Hmm... perhaps delegate and catch?
20:46hiredmanjcrossley3: as far as I know the only way is to try and load the class
20:47jcrossley3etosch: hiredman: nothing similar to ruby's 'defined?' method?
20:47jcrossley3something like symbol? or var? but for java classes?
20:47hiredman,(doc resolve)
20:47clojurebot"([sym] [env sym]); same as (ns-resolve *ns* symbol) or (ns-resolve *ns* &env symbol)"
20:47hiredman,(doc ns-resolve)
20:47clojurebot"([ns sym] [ns env sym]); Returns the var or Class to which a symbol will be resolved in the namespace (unless found in the environement), else nil. Note that if the symbol is fully qualified, the var/Class to which it resolves need not be present in the namespace."
20:48hiredman^- but ns-resolve actual throws an exception instead of returning nil for classes
20:48etoschjcrossley3: okay, this is from a while ago, but I seem to remember that the only way to check on the jvm speciically was to get a runtime and then test for a specific class using a class loader, but i am not certain
20:48hiredman,(ns-resolve 'Foo)
20:48clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$ns-resolve>
20:48hiredman,(ns-resolve *ns* 'Foo)
20:48clojurebotnil
20:48hiredmanUh
20:48hiredmanOh
20:49hiredmanwell, then there you go
20:49ibdknoxTimMc: that works too :)
20:49hiredman,(ns-resolve *ns* 'String)
20:49clojurebotjava.lang.String
20:49hiredman,(class (ns-resolve *ns* 'String))
20:49clojurebotjava.lang.Class
20:49jcrossley3hiredman: nice, thanks. :)
20:49ibdknoxTimMc: gotta run, but let me know how it goes :)
20:49etoschhiredman: cool, nice to see this is less painful in clojure :)
20:49TimMcibdknox: thanks
20:56TimMcHere's a nice trick for reading multiple forms from a string:
20:57TimMc&(let [s "1 2 ;comment \n 3 ; more comment"] (rest (read-string (str "(do " s " \n)"))))
20:57lazybot⇒ (1 2 3)
21:05TimMcalexbaranosky: ugh, you tricked me into working on trycljs more
21:16alexbaranoskyTimMc, old Jedi trick ;)
21:23unlinkPerhaps my expectations are incorrect, but why does a call to (meta foo) after (defn ^String foo [] "foo") yield nil?
21:23TimMcunlink: the meta you seek is on the var
21:24TimMcunlink: Try (meta #'foo)
21:28unlinkTimMc: Why thank you.
21:28unlinkI was looking on the fn, wasn't I.
21:29TimMcyep!
21:48gf3is there a predicate in core somewhere which is something like: checking if the count of an intersection is greater than zero?
21:49gf3I guess (subset?) is what I want
21:49wingieare all of the clojure's functions available in clojurescript?
21:52xcvAre you guys using any authentification library for your clojure web apps? I'm used to devise with rails and was wondering if there was a slimmed down version of it that still handled most of the boring standard auth logic, password encryption etc.
21:53xcvauthentication, that is
21:53xcv:P
21:54wingiexcv: i fixed it with oneall.com =)
21:54wingiebetter than janrain and gigya
21:55wingieand no need for custom auth (which sucks nowadays if your app is for the crowd=
21:59xcvwingie: Thanks, this might be a good fit for one part of my app, I'll look into it. I also need a more classical username/password system for the other part
22:01xcvwingie: wrt clojurescript, there's an overview on the wiki https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure
22:01gf3is there a more idiomatic way of writing the following:
22:01gf3(some (set (list clip)) [:border-box :padding-box :content-box])
22:01gf3where clip is a keyword
22:02wingieI hope it will be out of alpha and similar to coffeescript with solid documentation and user base
22:03xcvwingie: the major differences, as I recall, are the lack of refs, stm and agents, and that macros have to be defined in clojure files and imported to clojurescript files, since they operate on the clojure side of things
22:03amalloy(set (list x)) is just #{x}
22:03xcvthere's a better overview in Rich's presentation on blip.tv
22:03wingiexcv: do you know if the functions work like: rest, first, second etc?
22:04amalloybut really you want (#{:border-box :padding-box :content-box} clip)
22:04wingiexcv: okay *watching it*
22:05xcvwingie: first and rest are, at least
22:05xcvthere's a lot of stuff in src/cljs/cljs/core.cljs in the github repo
22:06xcvI guess most of the "canonical" utility functions and common algorithmic stuff is there or coming soon, in the talk he mentioned that those things were low-hanging fruit
22:07xcvdon't know the specific status though
22:09gf3amalloy: thank you
22:09gf3amalloy: that should have the same effect, right?
22:09amalloynaw, i like suggesting totally-different replacement code
22:12xcvAny more recommendations for auth plugins? Or should I just roll my own?
22:14wingiexcv: he says that clojure targets the .NET platform
22:15wingiewhat's that about
22:15amalloysandbar has auth-related stuff but i don't know much about it
22:16xcvwingie: Not sure, maybe this? https://github.com/clojure/clojure-clr
22:18gf3amalloy: no I meant set→key vs key→set
22:18gf3amalloy: I didn't mean your actual suggestion, sorry
22:18gf3I remember reading that
22:19wingiexcv: looks cool
22:19wingiebut it seems to be a big project for one guy to handle :)
22:25fbru02_,(map (partial apply hash-map) [["x" 4] ["x" 5] ["y" 6]])
22:25clojurebot({"x" 4} {"x" 5} {"y" 6})
22:31kenthHi, is there a way to extend a given protocol to a record after it has already been partially defined in defrecord?
22:38riddochcHey. Anyone had problems building clojure under openjdk? When I do a 'mvn install' at the tip of clojure's master branch, I get a few errors like: "The method divide(BigDecimal, int) in the type BigDecimal is not applicable for the arguments (BigDecimal, MathContext)"
22:46riddochcRunning 'lein jar' in enlive says it can't get org.clojure:clojure:jar:1.4.0-alpha3. I'm a bit surprised by this.
22:52replacatechnomancy: (sorry, got pulled from the computer) yeah, that's what I guessed. I'll make a patch and see what you think
22:52replacatechnomancy: do you have a preference patch or pull?
22:53amalloyreplaca: it's easy to create a patch from a pull request, not so easy the other way
22:56replacaamalloy: yeah, doesn't matter to me much - just what people like.
23:00amalloyreplaca: https://github.com/flatland/useful/pull/5.patch for example. i'm just saying if technomancy doesn't like pull requests it's super-easy for him to pretend you sent him a patch instead
23:15jodaroztellman: that worked great
23:15ztellmanjodaro: awesome, glad to hear it
23:22jodaroi shuffled things around a little and put it in its own codec
23:22jodaroand then include it in the request and response codec
23:23jodarobut otherwise, yeah, exactly what i was looking for. i guess i should have explored compile-frame closer
23:24ztellmanI think the documentation could stand a little restructuring
23:25jodaroi like the conversational style
23:25jodarothe lamina channels docs are good like that too
23:25jodaromaybe just more examples along those same lines
23:26technomancy_replaca: a pull request would be great
23:26technomancy_is it something that can be done entirely in slamhound?
23:27technomancy_riddochc: I use openjdk for everything
23:35alexbaranoskyman can't wait to deploy next version of Midje, the colorized clj-stacktraces look great
23:36technomancy_alexbaranosky: I think I wrapped up the omit-frames branch
23:36technomancy_just waiting for review from Mark to merge it
23:37alexbaranoskytechnomancy_, nice. then comes the color-specifying code? Or is it already incorporated in the branch?
23:38technomancy_I think it should be implemented in terms of the opts arg to pst once omit-frames is on master
23:39alexbaranoskyyeah, I see the opts arg now, I'm checking out the branch
23:39alexbaranoskynow would you need to make the color into semantically meaningful names, like I did (:java-colo, repl-color, etc)?
23:41riddochctechnomancy_: I've only recently been using openjdk - suse's been shipping it, and apparently oracle's licenses don't allow the linux distros to package the sun jdk/jre.
23:45technomancy_alexbaranosky: yeah, so probably two layers of maps
23:45technomancy_one for color names to ansi codes, and one for frame types to color names
23:46alexbaranoskytechnomancy_, yeah that sounds necessary