2012-03-03
| 00:02 | ztellman | I shouldn't drink and read IRC logs: https://github.com/ztellman/potemkin/blob/master/README.textile |
| 00:02 | mk | how can I redefine a function via the repl? |
| 00:03 | mk | I'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:04 | TimMc | ztellman: Huh, cool. I hadn't actually looked at what potemkin *does*. |
| 00:04 | ztellman | mk: if you just do another (defn hello-world …) at the repl, that should work fine |
| 00:04 | ztellman | TimMc: once you look at the abyss... |
| 00:05 | TimMc | ztellman: Ah, well, I already have. |
| 00:05 | TimMc | ztellman: https://github.com/baznex/imports/blob/7754d3a565a4db47b68cdf1e86bb6edf6bb8cbbd/src/org/baznex/imports.clj#L169 |
| 00:06 | ztellman | TimMc: wat |
| 00:06 | TimMc | ^ yet another ugly reification of IFn (this one didn't work out and was reverted, by the way) |
| 00:07 | ztellman | reifications of common constructs in clojure require an awful lot of effort |
| 00:07 | TimMc | ztellman: That was in service to a macro that would create a private defn proxying a Java static method. |
| 00:08 | TimMc | So yes, the abyss. |
| 00:08 | mk | yeah, 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:09 | ztellman | TimMc: this seems positively innocuous compared to that: https://github.com/ztellman/penumbra/blob/master/src/penumbra/opengl/core.clj#L171 |
| 00:10 | ztellman | though to be fair, the initial version of that was written in my first week of writing clojure |
| 00:10 | mk | I'm using eclipse/ccw |
| 00:11 | ztellman | mk, you're not wrapping the function in wrap-ring-handler by any chance? |
| 00:13 | mk | nope. just the basic wiki code. is it a namespace issue? |
| 00:14 | TimMc | `(defmacro ...) is always a good time |
| 00:15 | ztellman | TimMc: my clojure/west talk will involve macros that write macros |
| 00:15 | ztellman | it won't condone them, but it will involve them |
| 00:15 | TimMc | haha |
| 00:16 | ztellman | mk, if you enter this at the repl: (let [ch (result-channel)] (hello-world ch nil) @ch), what do you see? |
| 00:16 | mk | java.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:18 | ztellman | ugh, why can't protocols notice they haven't actually changed... |
| 00:20 | TimMc | Would it be possible for the compiler to emit less-performant dynamic-coding-safe code for protocols depending on a command-line switch? |
| 00:20 | TimMc | because that would be killer |
| 00:21 | TimMc | (or do protocols *have* to be load-once) |
| 00:23 | ztellman | mk, https://gist.github.com/1964538 |
| 00:24 | ztellman | it loses the var when creating the handler, so it won't update if the var is redirected |
| 00:24 | ztellman | but if you do this, then updating hello-world will change the response |
| 00:26 | ztellman | I've got to run, hope that helps |
| 00:28 | mk | thanks, that does |
| 01:55 | chris-m-r | if someone has access to the clojurescript github page, would be good to mention that the jdk is required, rather than just the jre |
| 01:58 | mk | file an issue. closing it shouldn't be much more trouble than reading an email. |
| 01:59 | talios | or make a pull request with the content change :) |
| 02:04 | Bahman | Hi all! |
| 02:08 | mk | hello Bahman ! |
| 03:58 | tomoj | if 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 | _ulises | morning |
| 04:19 | Cozey | Hello. Is there some clojure library to handle [the apps] user registration, login, password change, reset password functionality etc? |
| 04:21 | muhoo | where did clojure.contrib.graph go? |
| 04:22 | muhoo | and no, the wiki page with "where did conttrib go?" doesn't list anything for graph |
| 04:25 | _ulises | Cozey: is this about web-dev? |
| 04:28 | Cozey | yes. sorry for no clariffication |
| 04:29 | Cozey | it's this common stuff with users which is highly reusable. also has to do with site security |
| 04:29 | Cozey | so - somehing like spring-security for ring ? |
| 04:30 | _ulises | Cozey: 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:31 | Cozey | is noir popular/developed? I was thinking about giving it a try |
| 04:31 | _ulises | I'd like to think it's becoming more and more popular. I for one use it a fair bit |
| 04:32 | _ulises | and ibdknox (the creator/main dev) is very active in all things Clojure so I reckon that yes, it's developed and maintained |
| 04:36 | dhkl | Cozey: noir is probably the easiest to get started with. The documentation is quite good. |
| 04:36 | Cozey | I've used compojure before for a while, so i'm not really a beginner now |
| 04:36 | Cozey | but i'll give it a shot |
| 04:37 | Cozey | just didn't want to write the security stuff myself. |
| 04:38 | Cozey | i have actually managed to use spring-security with clojure, but it's a mess and i wouldn't recomment it do anyone |
| 04:38 | _ulises | heh |
| 04:38 | Cozey | the're just too much spring-security is bringing in to the clj world |
| 04:45 | Cozey | What 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:47 | talios | we use gettext |
| 04:48 | talios | tho 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:09 | Cozey | do you host it on github |
| 05:09 | Cozey | ? |
| 05:12 | talios | nope, thats sadly stuck inside our work git repos. |
| 05:14 | talios | i wanted it to be open source, but the powers that be wernt keen at the time. |
| 05:15 | Cozey | mhm |
| 06:02 | tutysra | hi there |
| 06:02 | _ulises | hey tutysra |
| 06:03 | tutysra | I 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:04 | tutysra | others in room have experienced something similar, i had reinstalled emacs + clojure mode, still the behavior is the same |
| 06:05 | _ulises | perhaps it's the swank version? |
| 06:06 | tutysra | _ulises : using swank version 1.4.0 |
| 06:06 | _ulises | same as me :/ |
| 06:07 | raek | tutysra: did you close the first exception? (by pressing 0) |
| 06:08 | _ulises | yup |
| 06:08 | tutysra | raek : yes i killed that buffer in emacs |
| 06:08 | _ulises | oh, eek, heh |
| 06:09 | tutysra | raek : C+x k |
| 06:09 | _ulises | tutysra: I think raek meant whether you dismissed the exception by pression 0 |
| 06:10 | raek | tutysra: 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:10 | tutysra | _ulises : no i didn't pressed 0 |
| 06:11 | raek | so 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:12 | tutysra | raek : 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:12 | raek | tutysra: I have always dismissed it by pressing 0 |
| 06:13 | raek | then the buffer goes away |
| 06:13 | tutysra | raek : ok...thx |
| 06:13 | raek | in Common Lisp, you can often do more things than just return to the top level |
| 06:14 | raek | and Slime is really built for CL |
| 07:12 | Vinzent | Hi, is there public function which parses protocol implementation definition in a map? e.g. (foo [x] ...) => {:foo (fn [x] ...)} |
| 09:17 | drostie | This 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:18 | drostie | Now 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:18 | RickInGA | that's actually a cool question... |
| 09:18 | drostie | (or maybe I'm missing something.) |
| 09:19 | RickInGA | I haven't looked into it yet (still pretty early in the learning process) |
| 09:19 | RickInGA | But I have heard that the ClojureScript compiler was written in Clojure |
| 09:19 | RickInGA | As opposedd to the Clojure compiler, which has a lot of java in it |
| 09:20 | drostie | I know. :D |
| 09:20 | RickInGA | But from what you are saying, the CLJS in Clojure requires java... so it is not CLJS in CLJS |
| 09:21 | RickInGA | I can't answer your question, but you have given me more to think about, and some questions of my own |
| 09:21 | drostie | Well one thing is that CjS is Cj. So CjS-in-Cj starts you very far off towards Cj-in-Cj. |
| 09:22 | RickInGA | did you see that some people have done clojure in python, for the pypy compiler |
| 09:22 | drostie | (replace "is Cj" with "is a subset of Cj" I guess.) |
| 09:23 | drostie | yeah. might be nice. I'll miss lisp's bignums if I switch to CjS. |
| 09:23 | RickInGA | some of the numeric things probably will get added |
| 09:23 | drostie | Python also has bignums so that would actually not be so bad. :D |
| 09:24 | RickInGA | I know that vectors, which are 32-bit tries in clojure are just arrays in java |
| 09:24 | RickInGA | if you 'modify' a vector in javascript, you just get a copy |
| 09:25 | RickInGA | for large vectors, this will have performance issue |
| 09:25 | RickInGA | but for an early release, they didn't feel like being able to handle huge datastructures was a priority |
| 09:26 | drostie | They're entirely right. Copying an array is one of the fastest things you can do in JavaScript -- also one of the most succinct. |
| 10:02 | drostie | okay, 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:02 | drostie | But division and modulo would be more complicated. :x |
| 10:03 | RickInGA | wow |
| 10:03 | RickInGA | I bet you have a high score on project Euler :) |
| 11:37 | mk | what is the way to set up a cached/DP function return value? |
| 11:42 | drostie | Okay, 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:42 | drostie | (and string parsing and bignum * num and other such cases). |
| 11:43 | drostie | http://www.bpaste.net/show/24517/ |
| 11:46 | mk | nice work :) |
| 11:47 | drostie | mk: yes but it's not good enough and therefore I give up. ^_^ |
| 11:48 | mk | what's the problem? |
| 11:48 | drostie | Lispy bignums have so many more features. :P |
| 11:48 | drostie | like moduluses and such. |
| 11:48 | mk | how many? |
| 11:50 | drostie | that's a tough question. Hm. |
| 11:50 | mk | and why a new BigNum? (I'm not familiar with clojurescript.) Does it lack one now, or? |
| 11:55 | drostie | mk: https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure "Currently ClojureScript numbers are just JavaScript numbers" |
| 11:57 | mk | I see |
| 11:57 | drostie | mk: but I should check whether Google Closure already has bignums. ^_^;; |
| 12:00 | drostie | mk: :o it does, there is a goog.math.Integer class. |
| 12:01 | TimMc | I'd also take a look around for other EPL-licensed JS that implements bignum |
| 12:01 | drostie | Well it was just a random fun thing to do. ^_^ |
| 12:02 | TimMc | Maybe not even EPL licensed, if you can conditionally compile CLJS against a third party JS lib. |
| 12:02 | mk | implementing a bignum yourself is probably among the things that a programmer should try regardless :) |
| 12:03 | TimMc | true |
| 12:03 | TimMc | along with finite state machines, compilers, and MUAs |
| 12:05 | mk | I'd add simple text editors and http servers to the list, too |
| 12:05 | AimHere | Alternatively just reimplement emacs and cross them all off your list at once |
| 12:06 | drostie | Wow, also I didn't realize that EPL was GPL-incompatible. o_O. One more reason to not like the GPL I suppose. |
| 12:06 | TimMc | drostie: Not really. |
| 12:06 | TimMc | There's a lot of incidental incompatibility out there in license-land. |
| 12:07 | TimMc | A far better reason to not like the GPL is the aggressive virality of it. |
| 12:07 | TimMc | (Which I like, for some projects.) |
| 12:08 | AimHere | EPL has a choice of law clause which is a good way of fostering unnecessary licensing incompatibilities |
| 12:09 | drostie | Well 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:09 | AimHere | What way would that be/ |
| 12:10 | drostie | You 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:10 | AimHere | How is that different from giving out BSD-licensed code and not giving the source code to it? |
| 12:11 | AimHere | Other than the people with the BSD-licensed code can make copies of binary-only freeware, I suppose |
| 12:11 | mk | they can share it |
| 12:11 | AimHere | So a choice between binary-only unfree junk and not having the right to give the software out at all |
| 12:11 | drostie | And they could disassemble it and do weird stuff and share that weird stuff under the BSD license. :D |
| 12:12 | pipeline | drostie: well, no, they can't do that. the GPL compels the upstream licensee to make the source available on request |
| 12:12 | AimHere | Someone publishing software like that whether under BSD or GPL is being a dick |
| 12:12 | AimHere | pipeline> THe copyright owner can do what the fuck he wants. It's his code |
| 12:12 | mk | pipeline: 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:13 | drostie | pipeline: what they said. The GPL is intentionally a *license*, not a *contract*, and thus places absolutely no obligation on the licensor. |
| 12:13 | AimHere | It's a silly corner case anyways, I don't think it means anything |
| 12:14 | pipeline | oh, you mean on green-ground work |
| 12:14 | mrBliss | Noir 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:15 | TimMc | pipeline: "green ground"? |
| 12:15 | drostie | "green" as in fresh, new, untrodden. |
| 12:15 | TimMc | Does this have anything to do with "blue sky"? |
| 12:15 | TimMc | Ah, "from scratch". |
| 12:16 | drostie | But 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:17 | TimMc | Haha, that would be amazing. |
| 12:17 | drostie | Possibly you could get Stallman to reject a GPLed piece of software and then make fun of them both. |
| 12:17 | AimHere | Well Stallman would reject the nominal sourceless GPL as unfree to begin with, and quite rightly |
| 12:17 | AimHere | The aim of the game is 'free software', not the GPL |
| 12:18 | mk | it would also mean that a source code leak would not legally qualify as a leak |
| 12:18 | AimHere | Well it would |
| 12:18 | mk | it would be possible to use the code, and it would be difficult to claim trade secret on it (I suspect) |
| 12:19 | TimMc | The license would cover the source code. |
| 12:19 | mk | (though I don't know as much about trade secrets) |
| 12:19 | AimHere | But if you've not published the source code yet, it would still be a trade secret |
| 12:19 | TimMc | Right, any court would reject a trade secret argument on that. |
| 12:19 | AimHere | There 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:20 | AimHere | And the court ruled that he shouldn't have done so |
| 12:20 | TimMc | AimHere: Imagine if that org had released binaries and called them GPL, but withheld source. |
| 12:20 | AimHere | That was before anything at all was published, of course |
| 12:21 | mk | AimHere: publication is a solid legal indicator of intention. I'd think that declaring the code to be GPL is the same. |
| 12:22 | AimHere | Well 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:24 | dnolen | drostie: as far how far off from CLJS-in-CLJS not far I think - but no one's taken a crack at it. |
| 12:24 | mk | unsure. The GPL seems to give away certain rights, and I think the right to having the source code is among them. |
| 12:25 | dnolen | drostie: it's easy to connect to a Node REPL as well, no need to fire up Rhino. |
| 12:25 | mk | it'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:25 | mk | heck yes I am, there's fair use, and a variety of other provisions |
| 12:27 | drostie | dnolen: are there docs on that somewhere? starting up java for every request is getting tiresome. ^_^ |
| 12:28 | dnolen | drostie: not much in the way of docs, https://github.com/swannodette/clojurescript/tree/node-repl |
| 12:28 | dnolen | drostie: I have a branch I use for testing purposes, not robust yet - script/node-repl |
| 12:29 | drostie | dnolen: yay! thanks. |
| 12:30 | dnolen | drostie: no problem. Feedback appreciated, good CLJS support for Node.js is desirable, but we need someone to actually focus on that. |
| 12:31 | dnolen | drostie: 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:33 | spoonman | hi, does anyone have a nice updated tutorial on setting up emacs and clojure? I'm a an emacs and clojure begginer |
| 12:34 | mk | spoonman: (if you're just looking for an ide, I'm finding eclipse+ccw is easy enough) |
| 12:36 | spoonman | mk: thanks but i'm not a fan of eclipse neither netbeans |
| 12:38 | mk | if 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:40 | AimHere | memoization might help, if we're talking about caching stateless functions that get repeatedly called with the same arguments |
| 12:42 | mk | I was wondering in general, though at the moment I'd like to download a webpage and have it expire after a day |
| 12:49 | TimMc | dnolen: I suppose it helps that JS generation in CLJS is probably more approachable than JVM bytecode generation in CLJ. :-) |
| 12:54 | raek | spoonman: https://github.com/technomancy/swank-clojure |
| 12:54 | raek | this is the official up to date info |
| 12:55 | raek | it's pretty simple if you have a clean install |
| 12:55 | raek | if 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:01 | rlb | FWIW, 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:01 | rlb | form of a work.'. |
| 13:01 | rlb | |
| 13:02 | dnolen | TimMc: definitely. But JS also is a dynamic host - many things are simpler because of that. |
| 13:04 | spoonman | raek: thanks, i will try that one |
| 13:05 | raek | spoonman: if you have followed any other guide, make sure you undo any steps you performed there |
| 13:08 | spoonman | raek: ok, thanks |
| 13:13 | dgrnbrg | is there a function in clojure.core to reverse a map? |
| 13:13 | dgrnbrg | i.e. create the map from vals to keys |
| 13:14 | dgrnbrg | I know how to do, but it seems like something that would be built-in, but I don't see it on clojuredocs |
| 13:14 | Vinzent | I think no |
| 13:14 | dgrnbrg | thanks :) |
| 13:15 | Vinzent | (zipmap (vals m) (keys m)) is pretty short :) |
| 13:15 | Iceland_jack | dgrnbrg: a map doesn't have to be a bijection, why would you want to reverse a map? |
| 13:15 | dgrnbrg | vincent, 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:15 | Iceland_jack | keep in mind that Vinzent's solution ruins duplicates |
| 13:15 | Iceland_jack | &(let [m {:a "m" :b "m"}] (zipmap (vals m) (keys m))) |
| 13:15 | lazybot | ⇒ {"m" :b} |
| 13:15 | dgrnbrg | Iceland_jack: my map is a bijection :) |
| 13:15 | Iceland_jack | as it should |
| 13:16 | Iceland_jack | ah |
| 13:16 | TimMc | dgrnbrg: 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:16 | dgrnbrg | ok, good to know :) |
| 13:17 | dgrnbrg | I can probably get rid of some order invariant-ing code I wrote :) |
| 13:17 | dgrnbrg | I am writing a hardware description language in clojure |
| 13:17 | dgrnbrg | clojure on fpgas |
| 13:18 | Vinzent | wow, that's cool! Are you doing it just for fun or no? |
| 13:18 | dgrnbrg | just for fun :) |
| 13:18 | dgrnbrg | I think that all the HDLs that exist suck |
| 13:18 | dgrnbrg | so I'm making a better one |
| 13:18 | dgrnbrg | it has a strong type system w/ composite types and pattern matching |
| 13:19 | dgrnbrg | it will have a multithreaded simulator that can co-simulate with verilog |
| 13:19 | dgrnbrg | and it'll generate verilog (and maybe vhdl later) |
| 13:19 | dgrnbrg | it also will have automatic pipelining features |
| 13:20 | dgrnbrg | I currently have math on unsigned modular bit-constrained types, structs, enums, bools, and a simulator |
| 13:20 | Vinzent | is it embedded dsl or you're writing compiler in clojure? |
| 13:20 | dgrnbrg | it's an embedded dsl with a full-blown compiler |
| 13:20 | dgrnbrg | suppose you did something like (+ ((uintm 3) 2) + 4) |
| 13:21 | dgrnbrg | that'd give you ((uintm 3) 0) as a result |
| 13:21 | dgrnbrg | but you can declare modules which have state elements |
| 13:21 | dgrnbrg | and then it'd defer the computation for the cycle simulation |
| 13:21 | dgrnbrg | and you can write hooks in the simulator to get callbacks when things happen |
| 13:22 | dgrnbrg | so 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:22 | dgrnbrg | but it all supports clojure's destructuring |
| 13:25 | Vinzent | whoa, I'm not into all that stuff, but it sounds very promising and cool :) I can only wish you good luck! |
| 13:25 | dgrnbrg | eventually, I want to get it to the point where it'll be the best choice for building hardware |
| 13:25 | weavejester | Are there any mocking libraries apart from clojure.contrib.mock ? |
| 13:25 | dgrnbrg | so that you can just buy a $100-500 fpga board, and then write audio/video processors or new processors quickly |
| 13:29 | fliebel | dnolen: ping |
| 13:34 | raek | dgrnbrg: there is a function to reverse a map: clojure.set/map-invert |
| 13:34 | raek | dgrnbrg: your project sounds interesting... :-) |
| 13:34 | dgrnbrg | how do I depend on clojure.set? |
| 13:34 | dgrnbrg | is it in core? |
| 13:34 | raek | dgrnbrg: yes, just require or use it |
| 13:34 | raek | http://clojuredocs.org/clojure_core/clojure.set/map-invert |
| 13:35 | dgrnbrg | got it :) |
| 13:35 | dgrnbrg | if you'd like to see tho code now, it's on github |
| 13:35 | dgrnbrg | but it's not particularly usable at the moment |
| 13:35 | dgrnbrg | for actually generating verilog |
| 13:35 | raek | it's easy to see on that page which namespaces are included in clojure |
| 13:35 | dgrnbrg | it needs a couple more weeks |
| 13:36 | dgrnbrg | I never looked too closely at the sidebar |
| 13:42 | technomancy | weavejester: with-redefs? =) |
| 13:42 | netrealm | Is there any way to insert into a hash-map and preserve the order of insertion? |
| 13:42 | weavejester | technomancy: I was hoping for something with a little more features :) |
| 13:43 | scriptor | netrealm: what do you mean preserve the order? Hashmaps are unordered |
| 13:43 | Vinzent | weavejester, midje? |
| 13:43 | scriptor | relying on the order of a hashmap is very unreliale |
| 13:43 | gfredericks | netrealm: use a sorted-map instead? |
| 13:43 | Vinzent | technomancy, by the way, do you really changed the syntax of :dependicies?! |
| 13:43 | weavejester | Vinzent: As I understand it, that would require me having to rewrite my clojure.test-based tests. |
| 13:44 | netrealm | Oh..I feel stupid...sorted-map and hash-map are two different types of maps. |
| 13:44 | ivan | how do you make a sorted-map that stays sorted by insertion order? |
| 13:45 | netrealm | ^ that would be my next question. |
| 13:45 | Vinzent | weavejester, no, you don't have to (although you of course can't use midje's mocking possibilities with your deftests) |
| 13:45 | gfredericks | oh I missed that aspect of the question |
| 13:45 | Vinzent | there was ordered-map implementation somewhere on github |
| 13:46 | gfredericks | netrealm: so this would be a data structure that's indexed in two different ways |
| 13:46 | TimMc | netrealm: I've seen ordered-map in one of ztellman's projects. |
| 13:46 | TimMc | potemkin does some stuff with novel maps, but I think this was actually in gloss |
| 13:47 | netrealm | gfredericks: Yes, I suppose that's one way of looking at it. |
| 13:47 | netrealm | TimMc: Thanks, I'll go look at those. |
| 13:47 | Vinzent | also see https://github.com/flatland/ordered |
| 13:49 | scriptor | php has ordered maps, could switch to that ;) |
| 13:49 | TimMc | lulzphp |
| 13:54 | RickInGA | I 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:57 | netrealm | Vinzent: Thanks, flatland's ordered is what I needed. |
| 13:57 | Vinzent | np |
| 13:59 | scriptor | RickInGA: well, it's a lot easier to get it working on osx than on windowww |
| 13:59 | scriptor | *windows |
| 13:59 | RickInGA | It seems like a lot of people use macs, are they running mac os, or a vm with linux in it? |
| 13:59 | muhoo | gfredericks: is that problem still in current gloss? |
| 13:59 | RickInGA | I already feel the pain of dev on windows :) |
| 13:59 | scriptor | a lot use straight up osx |
| 13:59 | weavejester | RickInGA: I went from Ubuntu to OSX very recently |
| 13:59 | ibdknox | RickInGA: osx |
| 14:00 | weavejester | RickInGA: I've had no problems running Clojure |
| 14:00 | weavejester | It was also a little easier to install the latest Emacs 24 snapshot with brew |
| 14:01 | scriptor | even installing it from the binary wasn't too bad |
| 14:01 | ibdknox | and macvim is awesome ;) |
| 14:01 | RickInGA | I imagine that the air is powerful enough, so I won't feel bad about going for the lightweight instead of bigger processor |
| 14:01 | ibdknox | I use an air |
| 14:02 | weavejester | RickInGA: I haven't had any problems with the Air |
| 14:02 | RickInGA | thanks for the feedback guys |
| 14:02 | weavejester | ibdknox: Did you go for the 11" or 13" out of interest? |
| 14:02 | ibdknox | weavejester: 13, to me it's the perfect screen size |
| 14:03 | ibdknox | you? |
| 14:03 | clojurebot | YOU WILL LIKE OVERTONE & CLOJURE |
| 14:03 | ibdknox | lol |
| 14:03 | weavejester | ibdknox: I went for the 11". I liked the feel of it a little better. |
| 14:04 | ibdknox | weavejester: still happy with it? |
| 14:04 | RickInGA | when I am on my desktop I use dual screens, does air support that? |
| 14:04 | weavejester | ibdknox: Yeah, my previous netbook had the same size screen. |
| 14:04 | weavejester | RickInGA: In my experience, macs are not good with dual screens. |
| 14:05 | RickInGA | k thx |
| 14:05 | ibdknox | why not? |
| 14:05 | ibdknox | I never had issues really |
| 14:05 | weavejester | ibdknox: Dual screens as in two monitors? |
| 14:05 | weavejester | Not a screen + laptop screen |
| 14:05 | ibdknox | yeah |
| 14:05 | weavejester | I was never able to get it to work. |
| 14:06 | weavejester | When I googled it, there was a bunch of posts saying how hard it was |
| 14:06 | weavejester | But this was a few years ago |
| 14:06 | ibdknox | ah, from a laptop it is tricky |
| 14:06 | ibdknox | unfortunately the only "easy way" to do it is with apple's new monitors |
| 14:07 | ibdknox | since you can dasiy-chain them |
| 14:07 | weavejester | Ahh |
| 14:08 | weavejester | I was trying to get a Macbook Pro to dual screen a couple of years back, and didn't manage it. |
| 14:34 | jondot_ | any recommended image manipulation lib for working with clojure (like image magick) ? |
| 14:44 | technomancy | Vinzent: I backed out of the :dependencies-as-map idea; too many issues with extra settings like :exclusions and :classifier |
| 14:44 | technomancy | Vinzent: :repositories is an ordered-map now though |
| 14:44 | technomancy | (though the vector-of-vectors still works) |
| 14:44 | technomancy | RickInGA: anything that's not windows is going to be about the same from the perspective of Clojure |
| 14:45 | Vinzent | technomancy, glad to hear it! |
| 14:45 | technomancy | the main annoyance with OS X is the way it's hard to set the $PATH consistently |
| 14:45 | technomancy | plus you end up installing a lot more stuff by hand |
| 14:45 | technomancy | but that's kind of orthogonal to Clojure |
| 14:46 | RickInGA | hard to set the path? |
| 14:46 | technomancy | RickInGA: that's the #1 issue people report with Emacs on OS X |
| 14:46 | technomancy | RickInGA: if you launch a program from the GUI rather than the console, your environment variables are ignored |
| 14:46 | technomancy | I've gotten a lot of bug reports for that even though there's nothing I can do about it =( |
| 14:47 | RickInGA | ah ok, so I should stick with the console |
| 14:48 | beardmigration | /? |
| 14:49 | technomancy | RickInGA: I don't know. I try to avoid OS X as much as I can |
| 14:50 | technomancy | I mean, there are ways to make it work. it's just annoying and not obvious. |
| 14:51 | RickInGA | thecnomancy: you run *nix? |
| 14:52 | technomancy | RickInGA: I'm on Debian, yeah |
| 14:53 | technomancy | I also run this nix: http://nixos.org/nix if that's what you mean |
| 14:54 | RickInGA | no, Debian was what I meant (or some other distro, or unix) |
| 14:54 | technomancy | if you're going to be deploying you'll need to develop on Linux anyway |
| 14:54 | technomancy | *deploying on Linux |
| 14:55 | RickInGA | what if I wanted to upload to heroku, for example, can you do that from mac? |
| 14:56 | RickInGA | I 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:56 | technomancy | the closer your dev environment is to deployment, the better your ability to catch bugs before they become an issue in production |
| 14:56 | RickInGA | If I am going to run into that on osx, then I am not going there! |
| 14:56 | dabd | i 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:57 | technomancy | having a different development environment from everyone else is kind of a different problem from having development/production mismatches |
| 14:58 | technomancy | dabd: you can put it in a future |
| 14:59 | h0x5f3759df | Hi, how can i unpack my args from a list to call a func. (looking for the python's "foo(*lst)" equivalent) |
| 14:59 | technomancy | this is pretty trollish but still raises some good points: http://teddziuba.com/2011/03/osx-unsuitable-web-development.html |
| 14:59 | RickInGA | technomancy: 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:59 | scriptor | h0x5f3759df: you're looking for apply |
| 14:59 | xeqi | ,(apply + [1 2]) |
| 14:59 | scriptor | http://clojuredocs.org/clojure_core/clojure.core/apply |
| 14:59 | technomancy | RickInGA: yeah and it's easy enough to develop in virtualbox on OS X if you like |
| 14:59 | clojurebot | 3 |
| 15:00 | h0x5f3759df | thanks scriptor |
| 15:00 | scriptor | honestly, as much of a pain it's been to set up emacs and lein on my windows box |
| 15:00 | scriptor | it was just so cheap |
| 15:01 | RickInGA | scriptor: 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:02 | jondot_ | can i specify a maven dependency in lein? |
| 15:02 | RickInGA | jondot_: lein does search maven |
| 15:02 | jondot_ | great |
| 15:03 | dabd | technomancy: cool thanks. I just wrapped my (shell.out/sh ..) call in a a (future ...). Hope I am doing it right. |
| 15:05 | jondot_ | fwiw - i also only develop on what i deploy on |
| 15:06 | jondot_ | 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:07 | jondot_ | 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:13 | RickInGA | I need to run, thanks everybody for the input.... decisions decisions... |
| 15:46 | jondot_ | to make clojure as close to the metal as possible, should i add type hints everywhere? |
| 15:46 | dgrnbrg | jondot_: just set *warn-on-reflection* and put hints to eliminate those warnings |
| 15:46 | dgrnbrg | everywhere else, the clojure compiler inferred types |
| 15:47 | jondot_ | nice, is there any notion of how close this will be to actual java? |
| 15:47 | dgrnbrg | If 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:47 | Raynes | You have to write Java-like code to produce Java-like bytecode. |
| 15:47 | dgrnbrg | jondot_: there is, but you should understand what clojuer's doing |
| 15:48 | Raynes | You can write Clojure code to produce basically the same bytecode, but you tend to lose the benefits of Clojure the more you try. |
| 15:48 | dgrnbrg | generally it doesn't matter |
| 15:48 | dgrnbrg | and there are profilers to help you when it does matter |
| 15:48 | jondot_ | 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:49 | Raynes | Java interop is idiomatic in Clojure. |
| 15:49 | jondot_ | bad choice of words. i guess i meant functional forms |
| 15:49 | Raynes | I once used java.util.Date. True strory. |
| 15:49 | Raynes | story* |
| 15:50 | jondot_ | dgrnbrg, is there any documentation about 'what clojureis doing' that you mentioned, i'd love to read that? |
| 15:51 | dgrnbrg | jondot_: it's scattered |
| 15:51 | dgrnbrg | do you have intuition as to how laziness is implemented? |
| 15:51 | dgrnbrg | I can offer some links |
| 15:51 | dgrnbrg | do you care about vectors, maps, vars, refs, agents, atoms, numbers, or what? |
| 15:52 | jondot_ | one link is enough, i could get the context from there and continue searching :) |
| 15:52 | dgrnbrg | I don't have one link--i know of a blog post on how persistent data structures work |
| 15:52 | dgrnbrg | another of vars |
| 15:52 | dgrnbrg | another of atoms |
| 15:52 | dgrnbrg | etc. |
| 15:52 | jondot_ | any of those would do |
| 15:53 | dgrnbrg | the best resource is here, actually: |
| 15:53 | dgrnbrg | https://github.com/clojure/clojure/tree/master/src/jvm/clojure/lang |
| 15:53 | dgrnbrg | I keep that open |
| 15:53 | dgrnbrg | then, there's no guessing |
| 15:53 | dgrnbrg | just source code to understand exactly what everything does |
| 15:55 | worrelsik | Raynes, http://www.the-ocean.com/simpsons/homer/stories.wav |
| 15:55 | jondot_ | thanks |
| 15:56 | dgrnbrg | jondot_: I am assuming you are an expert java programmer and beginning clojure programer |
| 15:56 | dgrnbrg | if that's not your background, i have other resources that would be more appropriate |
| 15:57 | jondot_ | not expert on java but i'll manage :) |
| 16:41 | goodieboy | technomancy: 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:42 | goodieboy | technomancy: do'h! I got it, I didn't see that top-level bin directory. |
| 16:53 | qbg | Can you create anonymous relations in core.logic? |