#clojure logs

2012-03-03

00:02ztellmanI shouldn't drink and read IRC logs: https://github.com/ztellman/potemkin/blob/master/README.textile
00:02mkhow can I redefine a function via the repl?
00:03mkI'm using aleph with (start-http-server hello-world {:port 8080}), and I'd like to have the hello-world function send out a new body
00:04TimMcztellman: Huh, cool. I hadn't actually looked at what potemkin *does*.
00:04ztellmanmk: if you just do another (defn hello-world …) at the repl, that should work fine
00:04ztellmanTimMc: once you look at the abyss...
00:05TimMcztellman: Ah, well, I already have.
00:05TimMcztellman: https://github.com/baznex/imports/blob/7754d3a565a4db47b68cdf1e86bb6edf6bb8cbbd/src/org/baznex/imports.clj#L169
00:06ztellmanTimMc: wat
00:06TimMc^ yet another ugly reification of IFn (this one didn't work out and was reverted, by the way)
00:07ztellmanreifications of common constructs in clojure require an awful lot of effort
00:07TimMcztellman: That was in service to a macro that would create a private defn proxying a Java static method.
00:08TimMcSo yes, the abyss.
00:08mkyeah, it doesn't seem to change. I'm doing a defn hello-world .... :body "TEST"})), and it still gives me hello world. It's not a cache issue, since I'm going to a different url
00:09ztellmanTimMc: this seems positively innocuous compared to that: https://github.com/ztellman/penumbra/blob/master/src/penumbra/opengl/core.clj#L171
00:10ztellmanthough to be fair, the initial version of that was written in my first week of writing clojure
00:10mkI'm using eclipse/ccw
00:11ztellmanmk, you're not wrapping the function in wrap-ring-handler by any chance?
00:13mknope. just the basic wiki code. is it a namespace issue?
00:14TimMc`(defmacro ...) is always a good time
00:15ztellmanTimMc: my clojure/west talk will involve macros that write macros
00:15ztellmanit won't condone them, but it will involve them
00:15TimMchaha
00:16ztellmanmk, if you enter this at the repl: (let [ch (result-channel)] (hello-world ch nil) @ch), what do you see?
00:16mkjava.lang.IllegalArgumentException: No implementation of method: :consumer of protocol: #'lamina.core.channel/ChannelProtocol found for class: lamina.core.pipeline.ResultChannel (NO_SOURCE_FILE:0)>
00:18ztellmanugh, why can't protocols notice they haven't actually changed...
00:20TimMcWould it be possible for the compiler to emit less-performant dynamic-coding-safe code for protocols depending on a command-line switch?
00:20TimMcbecause that would be killer
00:21TimMc(or do protocols *have* to be load-once)
00:23ztellmanmk, https://gist.github.com/1964538
00:24ztellmanit loses the var when creating the handler, so it won't update if the var is redirected
00:24ztellmanbut if you do this, then updating hello-world will change the response
00:26ztellmanI've got to run, hope that helps
00:28mkthanks, that does
01:55chris-m-rif someone has access to the clojurescript github page, would be good to mention that the jdk is required, rather than just the jre
01:58mkfile an issue. closing it shouldn't be much more trouble than reading an email.
01:59taliosor make a pull request with the content change :)
02:04BahmanHi all!
02:08mkhello Bahman !
03:58tomojif I want to define a protocol, implement its interface in java, and use that implementation in clojure, do I have to put the protocol definition in a separate project?
04:15_ulisesmorning
04:19CozeyHello. Is there some clojure library to handle [the apps] user registration, login, password change, reset password functionality etc?
04:21muhoowhere did clojure.contrib.graph go?
04:22muhooand no, the wiki page with "where did conttrib go?" doesn't list anything for graph
04:25_ulisesCozey: is this about web-dev?
04:28Cozeyyes. sorry for no clariffication
04:29Cozeyit's this common stuff with users which is highly reusable. also has to do with site security
04:29Cozeyso - somehing like spring-security for ring ?
04:30_ulisesCozey: I know that there is a session middleware for ring, but I'm not sure there's much CRUD stuff for users around. I seem to recall one such module for Noir though.
04:31Cozeyis noir popular/developed? I was thinking about giving it a try
04:31_ulisesI'd like to think it's becoming more and more popular. I for one use it a fair bit
04:32_ulisesand ibdknox (the creator/main dev) is very active in all things Clojure so I reckon that yes, it's developed and maintained
04:36dhklCozey: noir is probably the easiest to get started with. The documentation is quite good.
04:36CozeyI've used compojure before for a while, so i'm not really a beginner now
04:36Cozeybut i'll give it a shot
04:37Cozeyjust didn't want to write the security stuff myself.
04:38Cozeyi have actually managed to use spring-security with clojure, but it's a mess and i wouldn't recomment it do anyone
04:38_ulisesheh
04:38Cozeythe're just too much spring-security is bringing in to the clj world
04:45CozeyWhat about i18n? I read here in google that java world uses .properties files for this, but is'nt gettext a better standard [with support for plural forms etc]
04:47talioswe use gettext
04:48taliostho we also wrote an antlr gettext grammer to support it, we couldn't find any decent java gettext libraries that worked the way we wanted
05:09Cozeydo you host it on github
05:09Cozey?
05:12taliosnope, thats sadly stuck inside our work git repos.
05:14taliosi wanted it to be open source, but the powers that be wernt keen at the time.
05:15Cozeymhm
06:02tutysrahi there
06:02_uliseshey tutysra
06:03tutysraI am using swank + slime, whenever a command throws an exception successive execution of other commands also gives the same exception back in slime repl
06:04tutysraothers in room have experienced something similar, i had reinstalled emacs + clojure mode, still the behavior is the same
06:05_ulisesperhaps it's the swank version?
06:06tutysra_ulises : using swank version 1.4.0
06:06_ulisessame as me :/
06:07raektutysra: did you close the first exception? (by pressing 0)
06:08_ulisesyup
06:08tutysraraek : yes i killed that buffer in emacs
06:08_ulisesoh, eek, heh
06:09tutysraraek : C+x k
06:09_ulisestutysra: I think raek meant whether you dismissed the exception by pression 0
06:10raektutysra: ah, if I just ignore the buffer then the repl continues to work, but if I kill the buffer the old exception popped up again
06:10tutysra_ulises : no i didn't pressed 0
06:11raekso I guess the second time you eval something, slime realized you have an exception you didn't deal with, and opens that buffer again
06:12tutysraraek : ok...i am new to emacs, so, what is the preferred workflow? you guys keep all the error message open in their buffer? or should I just press 0 to dismiss them instead of killing the buffer?
06:12raektutysra: I have always dismissed it by pressing 0
06:13raekthen the buffer goes away
06:13tutysraraek : ok...thx
06:13raekin Common Lisp, you can often do more things than just return to the top level
06:14raekand Slime is really built for CL
07:12VinzentHi, is there public function which parses protocol implementation definition in a map? e.g. (foo [x] ...) => {:foo (fn [x] ...)}
09:17drostieThis might be a very evilly question, but how far are you guys from ClojureScript in ClojureScript? I became interested mostly because I wanted to run ClojureScript directly in Node. >:D
09:18drostieNow I find out that if I want to run it I'll need Java, and Java's JS engine, to run a REPL that won't have access to Node libraries, etc.
09:18RickInGAthat's actually a cool question...
09:18drostie(or maybe I'm missing something.)
09:19RickInGAI haven't looked into it yet (still pretty early in the learning process)
09:19RickInGABut I have heard that the ClojureScript compiler was written in Clojure
09:19RickInGAAs opposedd to the Clojure compiler, which has a lot of java in it
09:20drostieI know. :D
09:20RickInGABut from what you are saying, the CLJS in Clojure requires java... so it is not CLJS in CLJS
09:21RickInGAI can't answer your question, but you have given me more to think about, and some questions of my own
09:21drostieWell one thing is that CjS is Cj. So CjS-in-Cj starts you very far off towards Cj-in-Cj.
09:22RickInGAdid you see that some people have done clojure in python, for the pypy compiler
09:22drostie(replace "is Cj" with "is a subset of Cj" I guess.)
09:23drostieyeah. might be nice. I'll miss lisp's bignums if I switch to CjS.
09:23RickInGAsome of the numeric things probably will get added
09:23drostiePython also has bignums so that would actually not be so bad. :D
09:24RickInGAI know that vectors, which are 32-bit tries in clojure are just arrays in java
09:24RickInGAif you 'modify' a vector in javascript, you just get a copy
09:25RickInGAfor large vectors, this will have performance issue
09:25RickInGAbut for an early release, they didn't feel like being able to handle huge datastructures was a priority
09:26drostieThey're entirely right. Copying an array is one of the fastest things you can do in JavaScript -- also one of the most succinct.
10:02drostieokay, it looks like I could at least do bignum parsing and bignum addition and multiplication in perhaps only 40-50 lines of fast JS code, by encoding as an array of N numbers divisible by 10^7 (so that the very large "digits" can be multiplied without losing precision).
10:02drostieBut division and modulo would be more complicated. :x
10:03RickInGAwow
10:03RickInGAI bet you have a high score on project Euler :)
11:37mkwhat is the way to set up a cached/DP function return value?
11:42drostieOkay, I slightly underestimated the work to provide a new BigNum primitive in JavaScript for ClojureScript. Rather than 40-50 lines of code it came out at 58 lines of code just to implement + and * .
11:42drostie(and string parsing and bignum * num and other such cases).
11:43drostiehttp://www.bpaste.net/show/24517/
11:46mknice work :)
11:47drostiemk: yes but it's not good enough and therefore I give up. ^_^
11:48mkwhat's the problem?
11:48drostieLispy bignums have so many more features. :P
11:48drostielike moduluses and such.
11:48mkhow many?
11:50drostiethat's a tough question. Hm.
11:50mkand why a new BigNum? (I'm not familiar with clojurescript.) Does it lack one now, or?
11:55drostiemk: https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure "Currently ClojureScript numbers are just JavaScript numbers"
11:57mkI see
11:57drostiemk: but I should check whether Google Closure already has bignums. ^_^;;
12:00drostiemk: :o it does, there is a goog.math.Integer class.
12:01TimMcI'd also take a look around for other EPL-licensed JS that implements bignum
12:01drostieWell it was just a random fun thing to do. ^_^
12:02TimMcMaybe not even EPL licensed, if you can conditionally compile CLJS against a third party JS lib.
12:02mkimplementing a bignum yourself is probably among the things that a programmer should try regardless :)
12:03TimMctrue
12:03TimMcalong with finite state machines, compilers, and MUAs
12:05mkI'd add simple text editors and http servers to the list, too
12:05AimHereAlternatively just reimplement emacs and cross them all off your list at once
12:06drostieWow, also I didn't realize that EPL was GPL-incompatible. o_O. One more reason to not like the GPL I suppose.
12:06TimMcdrostie: Not really.
12:06TimMcThere's a lot of incidental incompatibility out there in license-land.
12:07TimMcA far better reason to not like the GPL is the aggressive virality of it.
12:07TimMc(Which I like, for some projects.)
12:08AimHereEPL has a choice of law clause which is a good way of fostering unnecessary licensing incompatibilities
12:09drostieWell the "aggressive virality" has toned down a bit, but yes, there exists a way to use GPL as a proprietary license by exploiting that, in a way that one can't do with BSD.
12:09AimHereWhat way would that be/
12:10drostieYou give someone a license to use your work via GPL, and then don't give them your source code. They can't share it without sharing the source code and they can't make you give it to them, so... :P
12:10AimHereHow is that different from giving out BSD-licensed code and not giving the source code to it?
12:11AimHereOther than the people with the BSD-licensed code can make copies of binary-only freeware, I suppose
12:11mkthey can share it
12:11AimHereSo a choice between binary-only unfree junk and not having the right to give the software out at all
12:11drostieAnd they could disassemble it and do weird stuff and share that weird stuff under the BSD license. :D
12:12pipelinedrostie: well, no, they can't do that. the GPL compels the upstream licensee to make the source available on request
12:12AimHereSomeone publishing software like that whether under BSD or GPL is being a dick
12:12AimHerepipeline> THe copyright owner can do what the fuck he wants. It's his code
12:12mkpipeline: that's only the case for GPL-derived works. a license isn't a contract, and does not impose obligations on the original author
12:13drostiepipeline: what they said. The GPL is intentionally a *license*, not a *contract*, and thus places absolutely no obligation on the licensor.
12:13AimHereIt's a silly corner case anyways, I don't think it means anything
12:14pipelineoh, you mean on green-ground work
12:14mrBlissNoir question: using noir.status/set-page! I can provide a default string for 404 requests. How can I get it to route the 404 requests to a function instead?
12:15TimMcpipeline: "green ground"?
12:15drostie"green" as in fresh, new, untrodden.
12:15TimMcDoes this have anything to do with "blue sky"?
12:15TimMcAh, "from scratch".
12:16drostieBut I agree. It doesn't mean much of anything. It could, I suppose, if Apple decided to play a large practical joke on the FSF by GPLing their operating system just to pollute the namespace, but other than those fringe cases, it's not a very useful loophole. ^_^
12:17TimMcHaha, that would be amazing.
12:17drostiePossibly you could get Stallman to reject a GPLed piece of software and then make fun of them both.
12:17AimHereWell Stallman would reject the nominal sourceless GPL as unfree to begin with, and quite rightly
12:17AimHereThe aim of the game is 'free software', not the GPL
12:18mkit would also mean that a source code leak would not legally qualify as a leak
12:18AimHereWell it would
12:18mkit would be possible to use the code, and it would be difficult to claim trade secret on it (I suspect)
12:19TimMcThe license would cover the source code.
12:19mk(though I don't know as much about trade secrets)
12:19AimHereBut if you've not published the source code yet, it would still be a trade secret
12:19TimMcRight, any court would reject a trade secret argument on that.
12:19AimHereThere WAS a test case of this nature. Someone pilfered source code from an organization that was going to put it out as free software anyways, IIRC
12:20AimHereAnd the court ruled that he shouldn't have done so
12:20TimMcAimHere: Imagine if that org had released binaries and called them GPL, but withheld source.
12:20AimHereThat was before anything at all was published, of course
12:21mkAimHere: publication is a solid legal indicator of intention. I'd think that declaring the code to be GPL is the same.
12:22AimHereWell if you say 'These binaries are GPL. No you can't have source', isn't that a clearer indicator of intent than the GPL, which doesn't actually mention this case
12:24dnolendrostie: as far how far off from CLJS-in-CLJS not far I think - but no one's taken a crack at it.
12:24mkunsure. The GPL seems to give away certain rights, and I think the right to having the source code is among them.
12:25dnolendrostie: it's easy to connect to a Node REPL as well, no need to fire up Rhino.
12:25mkit's like people who publish some stupid photo, and then put a big disclaimer under it saying "you are not allowed to use this photo"
12:25mkheck yes I am, there's fair use, and a variety of other provisions
12:27drostiednolen: are there docs on that somewhere? starting up java for every request is getting tiresome. ^_^
12:28dnolendrostie: not much in the way of docs, https://github.com/swannodette/clojurescript/tree/node-repl
12:28dnolendrostie: I have a branch I use for testing purposes, not robust yet - script/node-repl
12:29drostiednolen: yay! thanks.
12:30dnolendrostie: no problem. Feedback appreciated, good CLJS support for Node.js is desirable, but we need someone to actually focus on that.
12:31dnolendrostie: also cljs.numeric-tower would be cool, core arithmetic probably can't support BigNum, but no reason that can't come via a library
12:33spoonmanhi, does anyone have a nice updated tutorial on setting up emacs and clojure? I'm a an emacs and clojure begginer
12:34mkspoonman: (if you're just looking for an ide, I'm finding eclipse+ccw is easy enough)
12:36spoonmanmk: thanks but i'm not a fan of eclipse neither netbeans
12:38mkif I have a function that takes a long time to compute, and I want to cache the result, what's the way to do this?
12:40AimHerememoization might help, if we're talking about caching stateless functions that get repeatedly called with the same arguments
12:42mkI was wondering in general, though at the moment I'd like to download a webpage and have it expire after a day
12:49TimMcdnolen: I suppose it helps that JS generation in CLJS is probably more approachable than JVM bytecode generation in CLJ. :-)
12:54raekspoonman: https://github.com/technomancy/swank-clojure
12:54raekthis is the official up to date info
12:55raekit's pretty simple if you have a clean install
12:55raekif you don't, make sure you don't have slime installed in emacs, and that you don't have any old swank-clojure as a plugin or as a dev-dependency
13:01rlbFWIW, the GPL says 'The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source
13:01rlbform of a work.'.
13:01rlb
13:02dnolenTimMc: definitely. But JS also is a dynamic host - many things are simpler because of that.
13:04spoonmanraek: thanks, i will try that one
13:05raekspoonman: if you have followed any other guide, make sure you undo any steps you performed there
13:08spoonmanraek: ok, thanks
13:13dgrnbrgis there a function in clojure.core to reverse a map?
13:13dgrnbrgi.e. create the map from vals to keys
13:14dgrnbrgI know how to do, but it seems like something that would be built-in, but I don't see it on clojuredocs
13:14VinzentI think no
13:14dgrnbrgthanks :)
13:15Vinzent(zipmap (vals m) (keys m)) is pretty short :)
13:15Iceland_jackdgrnbrg: a map doesn't have to be a bijection, why would you want to reverse a map?
13:15dgrnbrgvincent, is vals and keys guaranteed to be in the same order? It seems like vals could be a set an come in other orders
13:15Iceland_jackkeep in mind that Vinzent's solution ruins duplicates
13:15Iceland_jack&(let [m {:a "m" :b "m"}] (zipmap (vals m) (keys m)))
13:15lazybot⇒ {"m" :b}
13:15dgrnbrgIceland_jack: my map is a bijection :)
13:15Iceland_jackas it should
13:16Iceland_jackah
13:16TimMcdgrnbrg: Yes, vals and keys on a map are ordered collections, in the same order, and will return the same order every time (for the same exact map instance in the same JVM)
13:16dgrnbrgok, good to know :)
13:17dgrnbrgI can probably get rid of some order invariant-ing code I wrote :)
13:17dgrnbrgI am writing a hardware description language in clojure
13:17dgrnbrgclojure on fpgas
13:18Vinzentwow, that's cool! Are you doing it just for fun or no?
13:18dgrnbrgjust for fun :)
13:18dgrnbrgI think that all the HDLs that exist suck
13:18dgrnbrgso I'm making a better one
13:18dgrnbrgit has a strong type system w/ composite types and pattern matching
13:19dgrnbrgit will have a multithreaded simulator that can co-simulate with verilog
13:19dgrnbrgand it'll generate verilog (and maybe vhdl later)
13:19dgrnbrgit also will have automatic pipelining features
13:20dgrnbrgI currently have math on unsigned modular bit-constrained types, structs, enums, bools, and a simulator
13:20Vinzentis it embedded dsl or you're writing compiler in clojure?
13:20dgrnbrgit's an embedded dsl with a full-blown compiler
13:20dgrnbrgsuppose you did something like (+ ((uintm 3) 2) + 4)
13:21dgrnbrgthat'd give you ((uintm 3) 0) as a result
13:21dgrnbrgbut you can declare modules which have state elements
13:21dgrnbrgand then it'd defer the computation for the cycle simulation
13:21dgrnbrgand you can write hooks in the simulator to get callbacks when things happen
13:22dgrnbrgso that you can write tests based on expected behavior and sequences of events, but the synthesizable code maps more closely to the fpga's semantics
13:22dgrnbrgbut it all supports clojure's destructuring
13:25Vinzentwhoa, I'm not into all that stuff, but it sounds very promising and cool :) I can only wish you good luck!
13:25dgrnbrgeventually, I want to get it to the point where it'll be the best choice for building hardware
13:25weavejesterAre there any mocking libraries apart from clojure.contrib.mock ?
13:25dgrnbrgso that you can just buy a $100-500 fpga board, and then write audio/video processors or new processors quickly
13:29fliebeldnolen: ping
13:34raekdgrnbrg: there is a function to reverse a map: clojure.set/map-invert
13:34raekdgrnbrg: your project sounds interesting... :-)
13:34dgrnbrghow do I depend on clojure.set?
13:34dgrnbrgis it in core?
13:34raekdgrnbrg: yes, just require or use it
13:34raekhttp://clojuredocs.org/clojure_core/clojure.set/map-invert
13:35dgrnbrggot it :)
13:35dgrnbrgif you'd like to see tho code now, it's on github
13:35dgrnbrgbut it's not particularly usable at the moment
13:35dgrnbrgfor actually generating verilog
13:35raekit's easy to see on that page which namespaces are included in clojure
13:35dgrnbrgit needs a couple more weeks
13:36dgrnbrgI never looked too closely at the sidebar
13:42technomancyweavejester: with-redefs? =)
13:42netrealmIs there any way to insert into a hash-map and preserve the order of insertion?
13:42weavejestertechnomancy: I was hoping for something with a little more features :)
13:43scriptornetrealm: what do you mean preserve the order? Hashmaps are unordered
13:43Vinzentweavejester, midje?
13:43scriptorrelying on the order of a hashmap is very unreliale
13:43gfredericksnetrealm: use a sorted-map instead?
13:43Vinzenttechnomancy, by the way, do you really changed the syntax of :dependicies?!
13:43weavejesterVinzent: As I understand it, that would require me having to rewrite my clojure.test-based tests.
13:44netrealmOh..I feel stupid...sorted-map and hash-map are two different types of maps.
13:44ivanhow do you make a sorted-map that stays sorted by insertion order?
13:45netrealm^ that would be my next question.
13:45Vinzentweavejester, no, you don't have to (although you of course can't use midje's mocking possibilities with your deftests)
13:45gfredericksoh I missed that aspect of the question
13:45Vinzentthere was ordered-map implementation somewhere on github
13:46gfredericksnetrealm: so this would be a data structure that's indexed in two different ways
13:46TimMcnetrealm: I've seen ordered-map in one of ztellman's projects.
13:46TimMcpotemkin does some stuff with novel maps, but I think this was actually in gloss
13:47netrealmgfredericks: Yes, I suppose that's one way of looking at it.
13:47netrealmTimMc: Thanks, I'll go look at those.
13:47Vinzentalso see https://github.com/flatland/ordered
13:49scriptorphp has ordered maps, could switch to that ;)
13:49TimMclulzphp
13:54RickInGAI am thinking about getting a macbook, if my only goal is to do clojure/clojurescript dev, are there reasons that mac would be a bad idea
13:57netrealmVinzent: Thanks, flatland's ordered is what I needed.
13:57Vinzentnp
13:59scriptorRickInGA: well, it's a lot easier to get it working on osx than on windowww
13:59scriptor*windows
13:59RickInGAIt seems like a lot of people use macs, are they running mac os, or a vm with linux in it?
13:59muhoogfredericks: is that problem still in current gloss?
13:59RickInGAI already feel the pain of dev on windows :)
13:59scriptora lot use straight up osx
13:59weavejesterRickInGA: I went from Ubuntu to OSX very recently
13:59ibdknoxRickInGA: osx
14:00weavejesterRickInGA: I've had no problems running Clojure
14:00weavejesterIt was also a little easier to install the latest Emacs 24 snapshot with brew
14:01scriptoreven installing it from the binary wasn't too bad
14:01ibdknoxand macvim is awesome ;)
14:01RickInGAI imagine that the air is powerful enough, so I won't feel bad about going for the lightweight instead of bigger processor
14:01ibdknoxI use an air
14:02weavejesterRickInGA: I haven't had any problems with the Air
14:02RickInGAthanks for the feedback guys
14:02weavejesteribdknox: Did you go for the 11" or 13" out of interest?
14:02ibdknoxweavejester: 13, to me it's the perfect screen size
14:03ibdknoxyou?
14:03clojurebotYOU WILL LIKE OVERTONE & CLOJURE
14:03ibdknoxlol
14:03weavejesteribdknox: I went for the 11". I liked the feel of it a little better.
14:04ibdknoxweavejester: still happy with it?
14:04RickInGAwhen I am on my desktop I use dual screens, does air support that?
14:04weavejesteribdknox: Yeah, my previous netbook had the same size screen.
14:04weavejesterRickInGA: In my experience, macs are not good with dual screens.
14:05RickInGAk thx
14:05ibdknoxwhy not?
14:05ibdknoxI never had issues really
14:05weavejesteribdknox: Dual screens as in two monitors?
14:05weavejesterNot a screen + laptop screen
14:05ibdknoxyeah
14:05weavejesterI was never able to get it to work.
14:06weavejesterWhen I googled it, there was a bunch of posts saying how hard it was
14:06weavejesterBut this was a few years ago
14:06ibdknoxah, from a laptop it is tricky
14:06ibdknoxunfortunately the only "easy way" to do it is with apple's new monitors
14:07ibdknoxsince you can dasiy-chain them
14:07weavejesterAhh
14:08weavejesterI was trying to get a Macbook Pro to dual screen a couple of years back, and didn't manage it.
14:34jondot_any recommended image manipulation lib for working with clojure (like image magick) ?
14:44technomancyVinzent: I backed out of the :dependencies-as-map idea; too many issues with extra settings like :exclusions and :classifier
14:44technomancyVinzent: :repositories is an ordered-map now though
14:44technomancy(though the vector-of-vectors still works)
14:44technomancyRickInGA: anything that's not windows is going to be about the same from the perspective of Clojure
14:45Vinzenttechnomancy, glad to hear it!
14:45technomancythe main annoyance with OS X is the way it's hard to set the $PATH consistently
14:45technomancyplus you end up installing a lot more stuff by hand
14:45technomancybut that's kind of orthogonal to Clojure
14:46RickInGAhard to set the path?
14:46technomancyRickInGA: that's the #1 issue people report with Emacs on OS X
14:46technomancyRickInGA: if you launch a program from the GUI rather than the console, your environment variables are ignored
14:46technomancyI've gotten a lot of bug reports for that even though there's nothing I can do about it =(
14:47RickInGAah ok, so I should stick with the console
14:48beardmigration/?
14:49technomancyRickInGA: I don't know. I try to avoid OS X as much as I can
14:50technomancyI mean, there are ways to make it work. it's just annoying and not obvious.
14:51RickInGAthecnomancy: you run *nix?
14:52technomancyRickInGA: I'm on Debian, yeah
14:53technomancyI also run this nix: http://nixos.org/nix if that's what you mean
14:54RickInGAno, Debian was what I meant (or some other distro, or unix)
14:54technomancyif you're going to be deploying you'll need to develop on Linux anyway
14:54technomancy*deploying on Linux
14:55RickInGAwhat if I wanted to upload to heroku, for example, can you do that from mac?
14:56RickInGAI have felt like a second class citizen because I am on Windows, I can get stuff to work, but it takes a lot of patience
14:56technomancythe closer your dev environment is to deployment, the better your ability to catch bugs before they become an issue in production
14:56RickInGAIf I am going to run into that on osx, then I am not going there!
14:56dabdi am starting a java process using (shell-out/sh "java" ... ) and it starts the java process (xml-rpc server in this case) but it does not return and hangs the REPL. how can I prevent it from hanging the REPL?
14:57technomancyhaving a different development environment from everyone else is kind of a different problem from having development/production mismatches
14:58technomancydabd: you can put it in a future
14:59h0x5f3759dfHi, how can i unpack my args from a list to call a func. (looking for the python's "foo(*lst)" equivalent)
14:59technomancythis is pretty trollish but still raises some good points: http://teddziuba.com/2011/03/osx-unsuitable-web-development.html
14:59RickInGAtechnomancy: ok, so setting up a dev environment shouldn't be an issue, at least for learning purposes, but I may find myself wanting a different os when I want to have an environment similar to production
14:59scriptorh0x5f3759df: you're looking for apply
14:59xeqi,(apply + [1 2])
14:59scriptorhttp://clojuredocs.org/clojure_core/clojure.core/apply
14:59technomancyRickInGA: yeah and it's easy enough to develop in virtualbox on OS X if you like
14:59clojurebot3
15:00h0x5f3759dfthanks scriptor
15:00scriptorhonestly, as much of a pain it's been to set up emacs and lein on my windows box
15:00scriptorit was just so cheap
15:01RickInGAscriptor: the problems I had with emacs was that all the instrucions I could find seemed to assume that you already knew how to use emacs
15:02jondot_can i specify a maven dependency in lein?
15:02RickInGAjondot_: lein does search maven
15:02jondot_great
15:03dabdtechnomancy: cool thanks. I just wrapped my (shell.out/sh ..) call in a a (future ...). Hope I am doing it right.
15:05jondot_fwiw - i also only develop on what i deploy on
15:06jondot_all the cool kids have macs, but the proper cool kids know they have to run virtualbox/parallels in their macs to do actual work
15:07jondot_may be less important on JVM but i've seen plenty of teams using macs + MRI because its cool, going to production stings when you have segfaulting native extensions
15:13RickInGAI need to run, thanks everybody for the input.... decisions decisions...
15:46jondot_to make clojure as close to the metal as possible, should i add type hints everywhere?
15:46dgrnbrgjondot_: just set *warn-on-reflection* and put hints to eliminate those warnings
15:46dgrnbrgeverywhere else, the clojure compiler inferred types
15:47jondot_nice, is there any notion of how close this will be to actual java?
15:47dgrnbrgIf I have several lazy seqs, and I want to get a lazy seq whose elements are (the tuple of the first element of each seq), (the tuple of the second element of each seq), etc, is there a built-in function like juxt for seqs?
15:47RaynesYou have to write Java-like code to produce Java-like bytecode.
15:47dgrnbrgjondot_: there is, but you should understand what clojuer's doing
15:48RaynesYou can write Clojure code to produce basically the same bytecode, but you tend to lose the benefits of Clojure the more you try.
15:48dgrnbrggenerally it doesn't matter
15:48dgrnbrgand there are profilers to help you when it does matter
15:48jondot_Raynes, i see. in my case clojure will provide a glue for several java libraries so i'm afraid there wouldn't be much idiomatic code
15:49RaynesJava interop is idiomatic in Clojure.
15:49jondot_bad choice of words. i guess i meant functional forms
15:49RaynesI once used java.util.Date. True strory.
15:49Raynesstory*
15:50jondot_dgrnbrg, is there any documentation about 'what clojureis doing' that you mentioned, i'd love to read that?
15:51dgrnbrgjondot_: it's scattered
15:51dgrnbrgdo you have intuition as to how laziness is implemented?
15:51dgrnbrgI can offer some links
15:51dgrnbrgdo you care about vectors, maps, vars, refs, agents, atoms, numbers, or what?
15:52jondot_one link is enough, i could get the context from there and continue searching :)
15:52dgrnbrgI don't have one link--i know of a blog post on how persistent data structures work
15:52dgrnbrganother of vars
15:52dgrnbrganother of atoms
15:52dgrnbrgetc.
15:52jondot_any of those would do
15:53dgrnbrgthe best resource is here, actually:
15:53dgrnbrghttps://github.com/clojure/clojure/tree/master/src/jvm/clojure/lang
15:53dgrnbrgI keep that open
15:53dgrnbrgthen, there's no guessing
15:53dgrnbrgjust source code to understand exactly what everything does
15:55worrelsikRaynes, http://www.the-ocean.com/simpsons/homer/stories.wav
15:55jondot_thanks
15:56dgrnbrgjondot_: I am assuming you are an expert java programmer and beginning clojure programer
15:56dgrnbrgif that's not your background, i have other resources that would be more appropriate
15:57jondot_not expert on java but i'll manage :)
16:41goodieboytechnomancy: Hey there. Could you tell me how to get lein 2 setup and running? I have it cloned, tests pass... but how to install the lein 2 executable?
16:42goodieboytechnomancy: do'h! I got it, I didn't see that top-level bin directory.
16:53qbgCan you create anonymous relations in core.logic?