2012-06-03
| 00:03 | mthvedt | parsley looks neat |
| 00:15 | antares_ | KirinDave: FYI, I am migrating gantry to clojure 1.4 |
| 00:15 | mthvedt | i'd rather use a clojure-ish parser than have to do something in antlr |
| 00:16 | gf3 | I wonder if you could use TreeTop from JRuby |
| 00:17 | KirinDave | antares_: Oh cool. Is there really much to do for that? |
| 00:17 | antares_ | KirinDave: it's a small codebase but they use stuff from like 1.1 days and libraries that are no longer maintained |
| 00:17 | antares_ | we will see |
| 00:17 | antares_ | I want a tool like that and don't use Clojure 1.2 for anything |
| 00:25 | KirinDave | antares_: Already forked it? |
| 00:26 | antares_ | KirinDave: not yet, working in a local branch |
| 00:26 | antares_ | KirinDave: I can stash and push if you want me to |
| 00:26 | KirinDave | antares_: That'd be cool. Pardon me, just got paged to deal with site issues. |
| 00:27 | antares_ | looks like it may take a few hours to finish, there's a lot of weird stuff from clojure.contrib.condition being used |
| 00:27 | antares_ | KirinDave: no problem |
| 00:31 | KirinDave | Man I have got to destroy this janky ruby system. :\ |
| 00:31 | KirinDave | hah, wrong window. |
| 00:31 | KirinDave | but there we are. True story. |
| 00:34 | fil512 | is there a way to turn (1 2 3) into 1 2 3? |
| 00:34 | fil512 | or [1 2 3] into 1 2 3 |
| 00:34 | Raynes | In what context? |
| 00:35 | Raynes | That doesn't make sense except for in one context: passing them as individual arguments to some function. |
| 00:35 | fil512 | yes |
| 00:35 | Raynes | &(apply println [1 2 3 4]) |
| 00:35 | fil512 | exactly |
| 00:35 | lazybot | ⇒ 1 2 3 4 nil |
| 00:35 | Raynes | apply! :D |
| 00:35 | fil512 | hmmm |
| 00:36 | KirinDave | i was just trying to use palette. |
| 00:36 | fil512 | I'm on 4clojure |
| 00:36 | KirinDave | Can't ein plugin install pallet/lein-template 0.2.1 |
| 00:36 | KirinDave | Can anyone else. |
| 00:36 | fil512 | trying to write the equivalent of flatten... |
| 00:40 | antares_ | KirinDave: it works with lein2 for me |
| 00:41 | KirinDave | Should I be using lein2? |
| 00:41 | antares_ | KirinDave: by the way, I pushed my fork of gantry. It will take a day or so of work to port it but if you are interested, here it is: https://github.com/michaelklishin/gantry |
| 00:41 | antares_ | so far I have tests finally passing on OS X |
| 00:42 | antares_ | digging in getting rid of clojure.contrib dependencies |
| 00:42 | Raynes | antares_: No it doesn't. |
| 00:42 | Raynes | antares_: You can't 'plugin install' something in lein2. :p |
| 00:42 | antares_ | Raynes: I did not plugin install it |
| 00:42 | antares_ | I added it to my :user profile |
| 00:42 | antares_ | and ran lein2 version, lein downloaded it just fine |
| 00:42 | Raynes | antares_: I know, but you implied you 'plugin install'ed it which might have confused KirinDave. |
| 00:42 | Raynes | You should really be ashamed of yourself. |
| 00:43 | antares_ | Raynes: fair enough |
| 00:43 | Raynes | KirinDave: If you're using the latest version of lein-newnew, you should just be able to do `lein new pallet ..` |
| 00:43 | Raynes | It automagically downloads and installifies the template for you. |
| 00:43 | KirinDave | Raynes: Could not find template pallet on the classpath. |
| 00:44 | Raynes | What version of lein-nenwew? |
| 00:44 | Raynes | newnew, even |
| 00:44 | KirinDave | 0.2.6 was listed on pallet |
| 00:45 | antares_ | I think the most recent release is 0.2.8 or so |
| 00:45 | antares_ | and I remember there were small features and bug fixes in 0.2.7 alone |
| 00:46 | KirinDave | Well this is bad. |
| 00:46 | KirinDave | Lein's plugins seem to be broken now. |
| 00:57 | rplevy | is interactive mode replaced by something else in lein 2? |
| 01:00 | Miko2 | I have a trie represented as a map { \a { \b { \c { ... } } } }. What would be the easiest way to add "d" from "abcd" to the nested \c's map? |
| 01:01 | mthvedt | update-in? |
| 01:02 | antares_ | Miko2: update-in, get-in? |
| 01:03 | tomoj | of course, but still surprising ##(assoc-in {} "foo" 3) |
| 01:03 | lazybot | ⇒ {\f {\o {\o 3}}} |
| 01:03 | Miko2 | Woah, too easy to be true. Thanks. :) |
| 01:06 | rplevy | curious if lein interactive is not yet implemented, or if it has been removed in lein 2 |
| 01:09 | xeqi | rplevy: I havne't heard of any plans to convert it |
| 01:10 | rplevy | is there some way to get a similar experience, or to run lein commands from the repl perhaps? |
| 01:13 | xeqi | I think the plan originally was to replace it with jark, but I haven't heard anything about it recently |
| 01:14 | rplevy | that sounds like a good idea |
| 01:38 | _KY_ | what is the function [1 2 3 4] -> [[1] [1 2] [1 2 3] [1 2 3 4]]? |
| 01:39 | ivan | $fn [1 2 3 4] [[1] [1 2] [1 2 3] [1 2 3 4]] |
| 01:39 | _KY_ | Nevermind... I can get around it... |
| 01:39 | ivan | $findfn [1 2 3 4] [[1] [1 2] [1 2 3] [1 2 3 4]] |
| 01:39 | lazybot | [] |
| 01:40 | _KY_ | It's just a simple (take n [...]) |
| 01:41 | rplevy | I've never used jark before, but I just tried running the jark lein plugin and it output a null pointer exception. This is in a lein 2 project. |
| 02:11 | splunk | anybody know if there's an idiomatic parameter name for passing in a seq into a fn? |
| 02:12 | splunk | e.g. |
| 02:12 | splunk | (fn [seq] (first seq)) |
| 02:12 | splunk | except not calling it seq? |
| 02:20 | duncanm | splunk: well, for that case, you can just pass 'first' directly |
| 02:20 | duncanm | splunk: you can call it a-seq, or something like that |
| 02:21 | splunk | right, the first was just an example. |
| 02:22 | splunk | duncanm: cool, will use a-seq. Thanks! |
| 02:31 | craftybones | Hello |
| 02:32 | splunk | ahoy! |
| 02:32 | craftybones | I'm having a bit of trouble getting leiningen setup |
| 02:33 | craftybones | https://gist.github.com/4a5169984336d1701bb3 |
| 02:38 | splunk | are you installing on osx ? |
| 02:38 | splunk | have you seen this post? |
| 02:38 | splunk | http://comments.gmane.org/gmane.comp.java.clojure.leiningen/162 |
| 02:39 | craftybones | Thanks splunk |
| 02:40 | borkdude | you could also try the fresh preview6 of leiningen 2 that got released two hours ago :) |
| 02:41 | craftybones | Lol. Will do. I am starting fresh on clojure |
| 02:41 | craftybones | Man, Limechat absolutely rocks |
| 02:42 | craftybones | Interesting. For some vague reason the lein script didn't download the jars properly. I moved my .ssh to a diff dir and tried again, and this worked. |
| 02:42 | borkdude | craftybones is it better than textual? I like that one also |
| 02:47 | eraad | hi |
| 02:47 | splunk | ahoy |
| 02:52 | craftybones | borkdude: Yeah, it has some cool stuff like, if you paste into the window, it puts it into a gist for you and pastes the link |
| 02:53 | borkdude | craftybones that sounds very convenient |
| 02:53 | craftybones | borkdude: Thanks for your help |
| 02:53 | craftybones | splunk: you too |
| 02:53 | splunk | np |
| 02:57 | borkdude_ | ok, I'm now in Limechat |
| 02:58 | borkdude_ | ,(+ 1 2 3) |
| 02:59 | clojurebot | 6 |
| 02:59 | borkdude_ | craftybones: when does it paste smth btw? |
| 03:02 | craftybones | borkdude: If you ctrl-v or cmd-v that is |
| 03:03 | borkdude_ | {:user {:plugins []}} |
| 03:03 | borkdude_ | craftybones: beyond a certain length? |
| 03:03 | craftybones | borkdude: Yeah, or perhaps if there are \n in the paste |
| 03:04 | borkdude_ | https://gist.github.com/da2c822bcf20a81cb103 |
| 03:04 | borkdude_ | ah great |
| 03:05 | borkdude_ | craftybones: what is the use of that bottom window |
| 03:05 | craftybones | borkdude: Messages from other channels you've joined in |
| 03:08 | borkdude | craftybones If you're a fan of japanese software… I can recommend the Yorufukurou twitter client as well |
| 03:09 | craftybones | borkdude: thanks, I'll try that out. I am not a specific fan of Japanese software or anything, though I admit, I do love Ruby :) |
| 03:09 | borkdude | craftybones me neither, but I happen to like that twitter client ;) |
| 03:11 | borkdude | craftybones I don't like that bottom window though, can I get rid of it? ;) |
| 03:13 | craftybones | Yes you can |
| 03:16 | craftybones | borkdude: just resize it out and you'll be fine |
| 03:18 | borkdude | just testing what happens... |
| 03:18 | borkdude | (def defaults {:source-paths ["src"] |
| 03:18 | borkdude | :resource-paths ["resources"] |
| 03:18 | borkdude | :test-paths ["test"] |
| 03:18 | borkdude | :native-path "target/native" |
| 03:18 | borkdude | ok… maybe I can find a textual plugin that does the same as limechat |
| 03:47 | amalloy | splunk: i don't really like a-seq. popular names include coll and xs |
| 04:18 | borkdude | craftybones haha I see your msg on twitter… the rest of the day barely interesting… these people don't read twitter? |
| 04:19 | craftybones | borkdude: Oh, they're very good friends. They obviously read. |
| 04:20 | borkdude | craftybones you didn't mean the wedding itself then? I guess it's a bit ambiguous ;) |
| 04:20 | craftybones | borkdude: Yes. The wedding itself wasn't. They had a large history leading up to the wedding, so it was finally amazing that it did happen |
| 04:26 | craftybones | So I run a lein plugin install swank-clojure-1.3.4 and it doesn't really seem to have done anything |
| 04:29 | craftybones | Ah never mind. |
| 04:29 | craftybones | Space for the version |
| 04:29 | borkdude | craftybones 1.4.2 seems to be the newest |
| 04:31 | craftybones | borkdude: Yeah I got 1.4.2, but now a clojure jack in isn't working from emacs |
| 04:31 | craftybones | borkdude: tells me project.clj is missing |
| 04:32 | borkdude | craftybones you must visit a file within tyour project in emacs |
| 04:32 | borkdude | craftybones only then it knows which project to start the swank server for |
| 04:33 | craftybones | borkdude: Ah, so I can't essentially use it without using a lein-ed project |
| 04:33 | borkdude | craftybones right |
| 04:35 | sdevijver | what's the difference between :dependencies and :dev-dependencies in lein? |
| 04:35 | borkdude | craftybones what I do if I just want a repl to play with, I make a project for that situation |
| 04:36 | borkdude | craftybones so just somewhere: lein new foo, and then visit a file in that project |
| 04:36 | craftybones | borkdude: Ok. Thanks. So inferior-lisp is slightly easier to do this then? |
| 04:36 | borkdude | craftybones I think so |
| 04:37 | aperiodic | sdevijver: :dev-dependencies are non-transitive (projects that use yours won't use its dev-dependencies) |
| 04:37 | aperiodic | sdevijver: they're also on the classpath for plugins |
| 04:39 | aperiodic | sdevijver: typically, dev-dependencies are development tools, hence the name |
| 04:40 | borkdude | aperiodic I guess they aren't included when uberjarring as well? |
| 04:41 | aperiodic | borkdude: correct |
| 04:42 | aperiodic | sdevijver: they're going away in lein2, though |
| 04:42 | aperiodic | sdevijver: instead, use profiles to accomplish the same thing |
| 04:43 | aperiodic | sdevijver: also profiles have other benefits besides, but i haven't really used lein2 much |
| 04:44 | sdevijver | aperiodic, I'm trying to get lazytest working with midje on lein 2, I already had a suspicion :dev-dependencies were ignored :) |
| 04:45 | craftybones | Dummy question. So a clojure-jack-in complains about a missing lein. Where is this complaint coming from and where do I tell it that it needs to look for lein somewhere specific? |
| 04:46 | borkdude | craftybones missing lein? |
| 04:46 | craftybones | lein not found |
| 04:46 | borkdude | craftybones did you put it on PATH? |
| 04:46 | craftybones | borkdude: Yeah |
| 04:46 | craftybones | I think I know why |
| 04:47 | craftybones | I think I might have to add lein to my project.clj |
| 04:48 | aperiodic | that sounds fishy to me; PATH issues seem like the more likely culprit |
| 04:50 | borkdude | I never had to set the path for leiningen in emacs |
| 04:50 | craftybones | Got it working. It was in path, but I hadn't sourced it in that window :D |
| 04:50 | aperiodic | i don't know anything about emacs, though, it's just that specifying lein in the project.clj seems... redundant |
| 04:50 | aperiodic | heh |
| 04:51 | craftybones | Sweet. Yeah it works without that |
| 04:52 | borkdude | 404 users… |
| 04:52 | borkdude | not found... |
| 04:53 | borkdude | co-incidental combination ;) |
| 04:55 | borkdude | craftybones I think you're better of switching to lein2 anyway |
| 04:55 | craftybones | borkdude: Alright :) |
| 04:55 | aperiodic | check out lein-precate |
| 04:57 | borkdude | or just make a file called profiles.clj in ~/.lein with {:user {:plugins [[lein-swank "1.4.4"]]}} |
| 04:57 | borkdude | lein swank / clojure-jack-in will work |
| 04:57 | borkdude | without installing anything |
| 04:57 | borkdude | (manually that is) |
| 06:12 | almostobsolete | Hello, I'm very new to Clojure and having some issues with lein |
| 06:13 | almostobsolete | When running "lein deps" on a project based on the compojure quickstart I get the following: |
| 06:13 | almostobsolete | |
| 06:13 | almostobsolete | [INFO] Unable to find resource 'org.clojure:clojure:jar:1.2.0-RC1' in repository clojars (http://clojars.org/repo/) |
| 06:14 | almostobsolete | Full error trace: https://gist.github.com/2862895 |
| 06:14 | almostobsolete | Any ideas what I might be doing wrong? |
| 06:18 | ejackson | almostobsolete: using a WAY to old clojure :) |
| 06:18 | ejackson | stable is currently 1.4 |
| 06:18 | ejackson | use this one: [org.clojure/clojure "1.4.0"] |
| 06:19 | ejackson | in your project.clj |
| 06:19 | almostobsolete | Thanks! Trying it now... |
| 06:19 | ejackson | Raynes: past midnight and you turn into a cat ? |
| 06:20 | almostobsolete | I'm still getting a similar error: |
| 06:20 | almostobsolete | [INFO] Unable to find resource 'org.clojure:clojure-contrib:pom:1.4.0' in repository central (http://repo1.maven.org/maven2) |
| 06:20 | ejackson | almostobsolete: OK, its not going to find it in maven central |
| 06:21 | hiredman | almostobsolete: there is no contrib 1.4.0 |
| 06:21 | hiredman | almostobsolete: contrib after 1.2 doesn't exist as a single package |
| 06:21 | ejackson | oh yeah, that too :) |
| 06:21 | almostobsolete | Oh, ok, so I don't need to have that dep at all? |
| 06:22 | ejackson | it gets annoying, if the template called for it, then compojure might be wanting it, but the whole thing is woefully out of date |
| 06:22 | almostobsolete | Seems to have worked! |
| 06:22 | ejackson | will the repl will start, but will compojure route ? |
| 06:22 | ejackson | or compoje, or whatever |
| 06:24 | almostobsolete | Success! Is displaying in browser :) |
| 06:24 | ejackson | well, we have a winner :) |
| 06:25 | almostobsolete | Hmmm, and looking at the quick start it doesn't match the project.clj, I must have got that from another example. Cut and paste coding strikes again! ;) |
| 06:27 | almostobsolete | Where's a good place to search for clojure libraries? |
| 06:32 | ejackson | try: http://clojuresphere.herokuapp.com/ |
| 06:32 | ejackson | or: http://clojure-libraries.appspot.com/ |
| 06:32 | ejackson | which I just nicked from: http://dev.clojure.org/display/doc/Getting+Started |
| 06:33 | almostobsolete | Thansk! |
| 06:35 | ejackson | I also like http://www.clojure-toolbox.com/ |
| 06:38 | antares_ | almostobsolete: http://clojurewerkz.org |
| 06:39 | antares_ | speaking of libraries, I have announced Neocons RC1 earlier today on the mailing list but not here :) http://clojureneo4j.info/ |
| 06:40 | zomg | I guess clojure oriented libs would be more suited into the style of the language vs. libs developed with standard Java in mind? |
| 06:40 | ejackson | neocons ! lol |
| 06:40 | antares_ | zomg: what a "libs developed with standard Java in mind"? |
| 06:40 | antares_ | *are |
| 06:40 | zomg | well I mean any Java libs I guess :) |
| 06:40 | antares_ | Clojure was created to be hosted and interoperate and reuse existing infrastructure |
| 06:41 | zomg | I know but the style of code is quite different in Clojure than in Java |
| 06:41 | antares_ | there is nothing wrong with having DSLish layers on top of Java libs and using Java libs |
| 06:41 | antares_ | certainly, I don't think anyone has tried to develop clojure libraries that look like Java libraries |
| 06:42 | antares_ | sometimes you need to implement a few interfaces to extend a Java library, people do it in clojure, too |
| 06:42 | zomg | Yeah was just wondering about the point for clojure-oriented libs, since afterall java libs work in clojure |
| 06:42 | antares_ | zomg: ease of use, better geared towards functional programming techniques |
| 06:42 | zomg | Yeah pretty much as I thought then :) |
| 06:42 | antares_ | zomg: take a look at clojurewerkz.org projects, many of them have Java libraries underneath but expose much more concise API |
| 06:43 | antares_ | also, you use Clojure data structures instead of instantiating lots of lib-specific objects |
| 06:43 | antares_ | but I guess that falls into the "ease of use" category |
| 06:44 | opened | I am reading "clojure programming" and on the definition of show-info on page 395, a static method is used on the when-let macro which expectedly results to the method not being found. |
| 06:44 | opened | Is that an errata or am I doing something wrong? |
| 06:45 | antares_ | opened: do you have a print book? |
| 06:45 | antares_ | in my PDF on page 394 it looks fine |
| 06:46 | opened | antares_: nope |
| 06:46 | antares_ | show-info is a no-op (or some code is missing?) and it is invoked from a Java listener callback |
| 06:47 | opened | antares_: In page 395 rather |
| 06:47 | antares_ | ah |
| 06:48 | opened | here: http://pastebin.com/TGpQ3fEF |
| 06:48 | antares_ | (when-let [selected-fn (.getSelectedValue fn-names)] |
| 06:48 | antares_ | this is what I have in when-let |
| 06:49 | opened | try macroexpand on the when-let, it truncates the "JOptionPane" and just leaves "showMessageDialog" |
| 06:50 | antares_ | opened: I see |
| 06:50 | antares_ | opened: http://shop.oreilly.com/product/0636920013754.do |
| 06:51 | antares_ | opened: one of the pages suggest going to this URL for errata |
| 06:51 | opened | Wait... So it is an errata then? |
| 06:51 | antares_ | opened: feel free to post on the clojure ML, all authors are there and will be happy to answer your questions |
| 06:51 | antares_ | I am not sure, looking |
| 06:51 | antares_ | http://oreilly.com/catalog/errata.csp?isbn=0636920013754 |
| 06:54 | twhume | I'm using map to apply a function to a sequence; in this function I'd like to know what position I'm at in the sequence (so that I can allocate a unique incrementing ID to members of the resulting sequence). What's the most idiomatic way to do this? |
| 06:55 | ejackson | twhume: you could reduce over the seq, passing the counter along |
| 06:57 | twhume | ejackson: thanks (I'm a clojure noob btw, if you hadn't noticed). Is that the standard way to do this kinda thing in Clojure, or one of many possible paths? |
| 06:57 | twhume | I'm trying to learn idiom as well as getting the thing working... |
| 06:57 | raek | twhume: do you need the results from the function calls? |
| 06:57 | twhume | raek: yes. |
| 06:57 | raek | twhume: then you can't use map nor reduce |
| 06:57 | twhume | The function calls are producing maps I will later need. I would like each map to be numbered sequentially. |
| 06:58 | raek | one way is to roll your own loop |
| 06:58 | PeregrinePDX | map-indexed? |
| 06:58 | woollyams | Another noob question: is there a Clojure equivalent of Haskell's "tails"? http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-List.html#v:tails |
| 06:58 | ejackson | or just bind the numbers in before you start |
| 06:58 | raek | (since your usage does not fit the pattern map and reduce factors out) |
| 06:59 | raek | another way is to use state, which is slightly more unideomatic |
| 06:59 | twhume | raek: yep, coming from a Java background my instinct was to set an atom, but I need that to be beaten out of me. map-indexed looks interesting tho. |
| 06:59 | PeregrinePDX | What's wrong with using map indexed.. It seems to be exactly what he is asking for. KNowing what position he is in the sequence while he's using map. |
| 06:59 | PeregrinePDX | err map-indexed even |
| 07:00 | opened | raek: using state is a bit of an overkill |
| 07:00 | opened | how about mapping the function to the sequence first, then zipmap the resulting sequence with (iter inc 0) |
| 07:02 | twhume | I have map-indexed working for me now - thank you :) |
| 07:03 | ejackson | PeregrinePDX: I didn't know about mapindexed, thanks |
| 07:04 | PeregrinePDX | The first thing I do when I have a library function that almost works for me but doesn't quite is in the repl I do (apropos 'function that almost works) |
| 07:04 | PeregrinePDX | So (apropos 'map) and voila all the functions that have map in them. |
| 07:06 | ejackson | i'd have ended up doing: https://www.refheap.com/paste/2979 |
| 07:10 | opened | woollyams: I don't think there is one, but here something similar: (take-while (comp not nil?) (iterate next [1 2 3 4])) |
| 07:12 | woollyams | opened: Close enough. Thanks! |
| 07:12 | opened | woollyams:okay |
| 07:13 | twhume | thanks everyone :) |
| 07:13 | opened | ... and about the book "clojure programming". I am going to submit an errata now, unless someone disagrees. |
| 07:13 | jsnikeris | Hi all. How do you get information about a Java class from Slime? Public members, Javadocs, etc |
| 07:19 | michaelr525 | jsnikeris: you open an eclipse in parallel :) |
| 07:19 | michaelr525 | though i usually search google |
| 07:20 | antares_ | jsnikeris: REPLy has a function that opens Java docs (for JDK classes) in the browser, you just pass it an instance and it does the rest |
| 07:21 | antares_ | jsnikeris: as for public members, REPL should have tab-completion over them (definitely for class and package names, static methods and other stuff that has important info to the left of the point) |
| 07:21 | antares_ | I mean, any REPL, not just REPLy lein2 comes with |
| 07:22 | michaelr525 | antares_: only starting from lein2? |
| 07:22 | antares_ | michaelr525: REPLy can be used as a standalone tool but then you will have to figure out SLIME integration on your own |
| 07:22 | antares_ | clojure-jack-in uses the same stuff lein repl does |
| 07:24 | jsnikeris | antares_: I see see what you mean about tab-completion, but what about seeing what the parameters of a method are? For example, I'm trying to instantiate a class (Blah. _) and my cursor is at '_' is there a way to easily see what the available constructors that class has? |
| 07:25 | antares_ | jsnikeris: SLIME does it for clojure functions but not class constructors |
| 07:25 | antares_ | probably because SLIME wasn't designed for languages that interoperate with Java :) |
| 07:25 | jsnikeris | antares_: ah OK |
| 07:25 | jsnikeris | :) |
| 07:26 | jsnikeris | is there better support for this kind of stuff in other editors? |
| 07:26 | antares_ | IDEA should have what you expect from IDEA |
| 07:27 | antares_ | the plugin is called La Clojure |
| 07:27 | antares_ | I am not familiar with Counterclockwise (the Eclipse plugin) but I guess it is comparable |
| 07:28 | jsnikeris | antares_: I already use IDEA for Java development, so I'll give La Clojure a try. Thanks |
| 07:29 | antares_ | jsnikeris: it is from JetBrains folks themselves |
| 07:50 | opened | oh GOD... I am such a retard D: The code in the book is just fine. I only forgot to include the title for the message dialog. |
| 07:51 | opened | I even sent a errata for it! Someone shoot me. |
| 07:52 | opened | Oh well. I probably need some break from reading. |
| 07:53 | gfredericks | ,(println "/me shoots opened") |
| 07:53 | clojurebot | /me shoots opened |
| 07:53 | gfredericks | aw man |
| 07:54 | opened | *dies* |
| 07:55 | ejackson | opened: don't sweat it bro, |
| 07:55 | ejackson | nobody will mind :) |
| 07:56 | opened | yeah, who would mind a garbage ;) |
| 07:59 | opened | I've been reading a lot these days, and I noticed my attention to detail has worsened, unlike before. Anyone else experienced this? |
| 07:59 | ejackson | oh, you have finite bandwidth ? |
| 08:01 | ejackson | its the implacable foe: how can you learn all topics you need in sufficient depth to use them properly ? Near to impossible. |
| 08:04 | opened | I guess I am overfed with information. I'll take a break tomorrow. |
| 10:10 | tomoj | at this point if I'm writing a cljs library intended to be used from javascript (in particular node) with mori, is there something better I can do besides copying mori's source into my cljs project? |
| 10:14 | dnolen | tomoj: planning on continuing to support mori, but would like to deal with some CLJS stuff perf stuff first. |
| 10:14 | dnolen | tomoj: you can create a jar and put it on clojars and include it as dep until I get around to doing that myself. |
| 10:15 | tomoj | oh, of course |
| 10:57 | duck1123 | Is there a better function than instance? for testing the type of a record? (instance? Foo (Foo.)) is true, but (instance? Foo (map->Foo {})) is false |
| 10:59 | ejackson | how about isa? ? |
| 11:01 | duck1123 | still false |
| 11:02 | dnolen | duck1123: you're env is stale, instance? should work |
| 11:02 | dnolen | your |
| 11:03 | dnolen | duck1123: deftype and defrecord don't play well with redefinition on the JVM |
| 11:03 | dnolen | duck1123: you usually need to recompile the whole file when working with deftype / defrecord |
| 11:06 | duck1123 | actually, I think you might be right. I just defined a new record type, and that one works |
| 11:06 | dnolen | duck1123: yep |
| 11:07 | duck1123 | I'll take "you need to clean" over "what you'd logically expect doesn't work" anyday, thanks |
| 11:09 | skoodge | Is it possible to turn the content of a variable (a function) into a symbol? Let's say I have the variable foo, which contains the clojure function +, how do I get '+ out of foo? |
| 11:10 | duck1123 | skoodge: you should probably be assigning #'+ to foo, that way you have the full var, and you can do a bit more with it |
| 11:13 | duck1123 | dnolen: so is the issue that I changed my record and didn't clean, or is it that I re-evaled that ns in the session? |
| 11:14 | dnolen | duck1123: if you change your record you need to recompile all code that refers to it. |
| 11:15 | duck1123 | ok, I can deal with that. I probably won't be changing those record defs anymore |
| 11:16 | dnolen | duck1123: well host-y code like instance? |
| 11:16 | duck1123 | just wanted to make sure I'm safe to C-c C-k my model s |
| 11:17 | skoodge | duck1123: well, I would like to directly pass functions instead of quoted functions into some function. So I need some way to turn the passed function into a (unqualified) symbol. Is there any way do to that? |
| 11:18 | duck1123 | a function doesn't know it's symbol, so if you want to get back symbols, you need to pass around vars |
| 11:18 | dnolen | skoodge: you can't do what you want. but #'+ is not a quoted function. it's the var. |
| 11:18 | duck1123 | I have to do a similar thin in my code |
| 11:20 | duck1123 | ok, after a clean compile, that test passes. on to the next |
| 11:23 | skoodge | duck1123, dnolen: ok, thanks. I guess I'll keep passing quoted functions then and use resolve on that |
| 11:27 | duck1123 | passing around symbols will be dependant on the ns declarations of when you resolve them. passing around vars will have the ns info included |
| 11:28 | duck1123 | ,(map class [+ '+ #'+]) |
| 11:28 | clojurebot | (clojure.core$_PLUS_ clojure.lang.Symbol clojure.lang.Var) |
| 11:30 | gfredericks | dnolen: I've been working on the numerics the last day or two and am filling in my thoughts on confluence |
| 11:32 | gfredericks | okay updated confluence |
| 11:48 | dnolen | gfredericks: might be better to outline how we could get Clojure numerics w/o much regard for how things are now - and then start thinking about how we could make it fast again per rhickey's suggestion. |
| 11:49 | gfredericks | dnolen: you mean mimicking jvm clojure semantics? like using longs? |
| 11:57 | dnolen | gfredericks: longs & double, generic operators. Look at Numbers.java |
| 11:58 | dnolen | gfredericks: has many, many tricks |
| 12:02 | jsnikeris | How would one pass an import-list stored in a var to the 'import' macro? |
| 12:03 | jsnikeris | e.g. (def an-import-list '(blah.blah.blah blee blow blum)) |
| 12:03 | gfredericks | ,(doc import) |
| 12:03 | clojurebot | "([& import-symbols-or-lists]); import-list => (package-symbol class-name-symbols*) For each name in class-name-symbols, adds a mapping from name to the class named by package.name to the current namespace. Use :import in the ns macro in preference to calling this directly." |
| 12:03 | jsnikeris | (import an-import-list) |
| 12:03 | gfredericks | it's not a macro |
| 12:03 | gfredericks | (apply import an-import-list) |
| 12:04 | dreish | (source import) shows a defmacro for me. |
| 12:04 | dreish | ,import |
| 12:04 | clojurebot | #<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/import, compiling:(NO_SOURCE_PATH:0)> |
| 12:04 | dreish | Yep. That's a macro. |
| 12:04 | dreish | I would think you could use eval. |
| 12:05 | gfredericks | ,import |
| 12:05 | clojurebot | #<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/import, compiling:(NO_SOURCE_PATH:0)> |
| 12:05 | dreish | Or, going the other way, (import #=(eval an-import-list)) |
| 12:05 | gfredericks | boo; doc is supposed to say it's a mocr |
| 12:05 | jsnikeris | what's that #= syntac? |
| 12:05 | jsnikeris | syntax |
| 12:06 | dreish | Read-time "eval" -- though it's not really the full eval unless you call eval. |
| 12:06 | dreish | More like just apply. |
| 12:08 | gfredericks | dnolen: do you expect closure longs perform significantly better than clojure bigints? |
| 12:09 | dnolen | gfredericks: no idea w/o benchmarking |
| 12:10 | gfredericks | okay; just curious if that's why we would use them instead of just bigints directly |
| 12:10 | dnolen | gfredericks: from glancing at the source, seems like it would perform well. |
| 12:10 | dnolen | gfredericks: closure long is not about bigints |
| 12:12 | gfredericks | if you mean that closure long is 64bit integer and closure integer is bigint, then yes I understand that |
| 12:12 | gfredericks | I assume we'd want to support closure-integers for bigints; i.e., that's what 42N would compile to |
| 12:13 | gfredericks | so if we already have bigints it's not obvious to me that it wouldn't be simpler to just compile 42 to a bigint as well, rather than a long |
| 12:13 | gfredericks | unless it's expected to perform better or there is a high value on mirroring jvm-clojure |
| 12:15 | dnolen | gfredericks: I'd expect it to perform better. |
| 12:15 | dnolen | gfredericks: making things generic isn't the challenge here. |
| 12:16 | dnolen | the challenge is getting modern JS engine perf that means somehow moving sensisbly from JS numbers to Closure (or Closure-like) long to BigInts. |
| 12:17 | dnolen | gfredericks: so outline the changes for Clojure JVM numeric semantics - and figure out the hard work of not slowing everything down. |
| 12:17 | frozenlock | Hello gentlemen. Any advice on how I could read byte from a buffered-input-stream? I've tried (read buff...) but apparently it doesn't work if my steam isn't of type java.io.PushbackReader. |
| 12:21 | gfredericks | frozenlock: isn't there an instance method for that? (.read buff)? |
| 12:21 | gfredericks | the read function is for reading s-expressions |
| 12:22 | frozenlock | There is, but I was getting an error. So I dismissed it.. |
| 12:22 | dnolen | gfredericks: actually might be as simple as *unchecked-math* which means we emit JS numbers and overflow on integer values that can't be represented with 53 bits. |
| 12:23 | gfredericks | dnolen: I was thinking another option would be a js/+ |
| 12:23 | gfredericks | would give you the current behavior |
| 12:23 | dnolen | gfredericks: nope |
| 12:24 | dnolen | gfredericks: anything that make core.cljs hard to repurpose it a non-starter, I've working to eliminate such things as much as possible. |
| 12:24 | gfredericks | so *unchecked-math* is a compile-time change? |
| 12:24 | dnolen | gfredericks: same as Clojure |
| 12:26 | gfredericks | that would only apply to longs though I would think |
| 12:26 | dnolen | gfredericks: same as Clojure |
| 12:27 | gfredericks | maybe I've been assuming too little about the perf needed. I thought it was all about retaining the ability to do fast double arithmetic |
| 12:28 | dnolen | gfredericks: JS has 64 bits floats, what's there to do? |
| 12:29 | gfredericks | dnolen: ensure that (+ 3.0 4.0) is just as fast as it currently is |
| 12:29 | gfredericks | since presumably + couldn't just be an inlined "+" anymore |
| 12:29 | dnolen | gfredericks: sure, but that's easy, we statically can determine those are double and emit JS numbers. |
| 12:30 | dnolen | gfredericks: why not? |
| 12:30 | dnolen | gfredericks: simple if we have type information, otherwise generic ops as usual. |
| 12:30 | gfredericks | but currently it's fast even if we don't have type information, because it still inlines the native + |
| 12:31 | gfredericks | that's where I assumed the hit would be |
| 12:32 | gfredericks | we'd have to emit "if(typeof x == 'number' && typeof y == 'number'){x+y}else{add(x,y)}", no? |
| 12:35 | Miko2 | Can I put utility functions inside defrecord, or do I need to put them outside? |
| 12:36 | Miko2 | ...as "regular" functions. |
| 12:40 | eckroth | Miko2: it is my understanding that you have to either make them regular funcs or create a protocol |
| 12:40 | eckroth | Miko2: but that funcs do not go "inside" defrecord like you would in java |
| 12:41 | ejackson | does clojurescript do anything to strings passed in as arguments. In a console $("div:contains('foo')") returns the elements, but called from compiled clojurescript (js/jQuery "div:contains('foo')") does not :( |
| 12:41 | Miko2 | Yeah. So I just put the "methods" that implement the protocol inside defrecord and do everything else with regular functions? :) |
| 12:41 | ejackson | Miko2: yup. |
| 12:56 | devn | brain fart: is there a not-empty? |
| 12:57 | devn | like... |
| 12:57 | devn | ,((complement empty?) "") |
| 12:57 | clojurebot | false |
| 12:57 | Chousuke | use "seq"? |
| 12:58 | Chousuke | iirc empty? is defined as (not (seq ...)) :p |
| 12:58 | devn | Chousuke: thanks |
| 12:58 | ejackson | there is not-empty |
| 13:00 | devn | ejackson: that isn't a predicate though |
| 13:00 | TimMc | It can be. |
| 13:00 | drguildo | i have a scala program with a listbuffer that stores swing progress bars that get drawn to a table. what's the "best" way to achieve the same kind of thing the clojure/functional way? |
| 13:01 | ejackson | right |
| 13:01 | TimMc | &(map not-empty [[] [1 2 3]]) |
| 13:01 | lazybot | ⇒ (nil [1 2 3]) |
| 13:01 | drguildo | i should have mentioned the listbuffer gets added to and removed from |
| 13:02 | TimMc | It preserves type, so it is used in things like (when-let [v (not-empty ...)] ...) |
| 13:02 | Chousuke | drguildo: a vector/list inside an atom or something |
| 13:04 | ejackson | in answer to my earlier clojurescipt question: no, clojurescript behaves like you'd expect. I got nailed by async, per usual. |
| 13:06 | tomoj | suppose I can provide blocking ISeq semantics in clojure, but not in clojurescript. I can provide nonblocking ISeq semantics in both, where each element is an eventual value, say through ISeqable. but providing both semantics in clojure would mean (seq? x) but (not= x (seq x)) and (not= (first x) (first (seq x))) |
| 13:06 | tomoj | is that reasonable? |
| 13:08 | TimMc | tomoj: first calls seq |
| 13:09 | tomoj | not if it's already a seq |
| 13:09 | TimMc | hmmm |
| 13:09 | TimMc | That sounds rather naughty. |
| 13:09 | tomoj | actually |
| 13:10 | tomoj | if I just don't use ISeqable, and instead provide a function that returns a seq of eventual values, it looks a lot less weird |
| 13:10 | drguildo | Chousuke: thanks |
| 13:12 | mheld | is there a devise-like authentication framework for clojure? |
| 13:13 | lynaghk | mheld: https://github.com/cemerick/friend |
| 13:15 | mheld | gracias |
| 13:21 | freiksenet | hi! I am having trouble connecting to lein swank server, it says 'can't find suitable coding-system'. Is there any standard solution to that? It used to be working ~6 months ago with same config |
| 13:21 | freiksenet | slime is latest quicklisp version, works with SBCL fine |
| 13:27 | Miko2 | Umm, the records defined with defrecord are not available through lein repl when I (use 'xyz) them. The other functions from xyz are in the scope. :/ |
| 13:28 | Miko2 | Getting CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: Foobar, compiling:(NO_SOURCE_PATH:16) |
| 13:32 | Miko2 | Oh, I need to import it? |
| 13:44 | meiji11 | I've written a macro that swaps the values of two locals created in a let if those bindings satisfy some predicate. the macro is incredibly slow.. it takes about 9 seconds whereas the original code executes in about 100 ms. why might that be? |
| 13:50 | meiji11 | ah, never mind. I see now. |
| 15:02 | technomancy | freiksenet: if you're still having trouble with slime, the problem is the version you're using is too new: http://p.hagelb.org/slime-cvs-rant.txt |
| 15:03 | freiksenet | technomancy: I tried clojure-jack-in and now it complains about unbalanced parens. clojure-jack-in should be using it's own slime, shouldn't it? |
| 15:08 | technomancy | it should, but there's no way to unload an existing slime if you've already got one loaded in a given instance |
| 15:08 | technomancy | the results of loading two different versions sequentially are undefined |
| 15:10 | freiksenet | okay, I removedthe file that loaded slime. result is the same |
| 15:10 | freiksenet | so it still complains about unbalanced parenthesis |
| 15:17 | freiksenet | technomancy: so what's the last supported slime version? I will try to downgrade and use my previous setup |
| 15:28 | scottj | freiksenet: I have good luck with 2009-10-15 |
| 15:29 | bbloom | dnolen: Help me help you & Raph with the pluggable backend stuff :-) |
| 15:30 | bbloom | I've got some extra time to work on CLJS now |
| 15:30 | bbloom | Decoupling parse&analyze from js&emit seems like the right first step |
| 15:31 | freiksenet | scottj: that's quite old ) |
| 15:31 | scottj | freiksenet: ritz supports a more recent version, but it's from 2010 I think :) |
| 15:32 | scottj | The only major new feature I've heard mentioned since then is presentations, would be curious to hear of others |
| 15:41 | dnolen | bbloom: heya, cool! |
| 15:41 | bbloom | dnolen: hey |
| 15:42 | dnolen | bbloom: finally getting around to doing something about your emit patches, source map work is under way. |
| 15:42 | bbloom | :-) who's doing more stuff on source maps? |
| 15:42 | dnolen | bbloom: I am! :) |
| 15:42 | dnolen | bbloom: http://github.com/clojure/clojurescript/tree/source-map |
| 15:43 | bbloom | dnolen: nice. |
| 15:43 | dnolen | bbloom: more than happy to get some help of course :) |
| 15:43 | bbloom | dnolen: heh, i have some vlq encoding code here too |
| 15:43 | dnolen | bbloom: http://github.com/clojure/clojurescript/compare/master...source-map |
| 15:43 | dnolen | bbloom: vlq stuff is done, works |
| 15:44 | bbloom | dnolen: great. gotta instrument emission |
| 15:44 | dnolen | bbloom: yes emission I think will be straightforward. |
| 15:45 | bbloom | dnolen: i haven't given it much thought yet, so i dunno |
| 15:45 | dnolen | but we need to parse the Closure source map, merge with original line/col info and generate a real source map. |
| 15:46 | bbloom | dnolen: so i have several irons in the fire: 1) source maps 1B) column metadata 2) decouple parse/emit 3) vars 4) ast children |
| 15:46 | bbloom | maybe something else too.... |
| 15:46 | bbloom | where should i start? :-P |
| 15:48 | bbloom | i think there's a bunch of stuff in the parse/analyze phase that can move to the emit phase and there's a bunch of stuff in the emit phase that can move into macros… for example :vector, :set, :map, etc can become macros. they simply generate function calls |
| 15:48 | bbloom | I'd love to trim down the compiler.clj file into analyzer.clj and compiler/js.clj + whatever core compiler stuff |
| 15:48 | dnolen | bbloom: source maps are big, if you want to get up to speed w/ what I've done that would be helpful. |
| 15:49 | dnolen | bbloom: raph_amiard is already working on that. |
| 15:49 | dnolen | bbloom: col metadata is really just waiting on Clojure/core approval - that may take a while. |
| 15:50 | bbloom | dnolen: OK. I have no idea if that patch will stay up to date with other changes. i'm still pretty new to contributing to other people's open source communities! |
| 15:50 | bbloom | dnolen: I read the master..sourcemaps diff — anything else to look at? |
| 15:52 | dnolen | bbloom: not yet, just trying to figure the best format to emit CLJS -> JS mapping info. |
| 15:52 | bbloom | dnolen: OK, i can help think about that… what have you got so far? |
| 15:52 | dnolen | bbloom: I'm thinking a map for the segment, vector of segments for the line, vector of lines |
| 15:53 | dnolen | bbloom: that's for the CLJS -> JS side, we need that info. |
| 15:53 | dnolen | bbloom: then we need to read the Closure map source-map and probably convert to the same format |
| 15:53 | dnolen | bbloom: merge |
| 15:53 | bbloom | hold on, finding the source map spec |
| 15:53 | dnolen | open to other reps, just whatever is the simplest for merging. |
| 15:54 | bbloom | you mean merging multiple compilation units? or merging multi-level source mappings? |
| 15:55 | bbloom | also worth noting: last i tried, webkit provided practically zero in-app logging of sourcemap loading. if you run chrome from a terminal w/ the debug flag on the command line, you get slightly more info |
| 15:56 | dnolen | bbloom: anything less than multi-level source mapping is useless for CLJS. |
| 15:57 | bbloom | dnolen: but does that mean we need to do the merging? my assumption was that we just needed to produce a single source map and provide it as input to gclosure |
| 15:57 | dnolen | bbloom: news to me, do you have a link? |
| 15:57 | bbloom | dnolen: isn't that what GWT does? java->js as input to closure compiler which produces java->minjs |
| 15:58 | bbloom | dnolen: looking |
| 15:58 | dnolen | bbloom: far as I know noone has multi-level source mapping. |
| 16:01 | bbloom | dnolen: hold on, slow connection & need to checkout the closure compiler source |
| 16:05 | dnolen | bbloom: Closure does provide a SourceMapConsumer but it doesn't produce Clojure types so it will be a pain to work w/. |
| 16:07 | bbloom | dnolen: still checking out — but i thought you could just produce a source map as json & then pass that file path to the closure compiler |
| 16:09 | dnolen | bbloom: and what would that do? |
| 16:10 | bbloom | dnolen: well, you're saying we need multi-level because of clj->js->minified, right? |
| 16:11 | bbloom | dnolen: step one is clj->js and disable advanced optimizations — i *thought* closure could handle merging for us, but even if it can't you still need a source map to merge! :-) |
| 16:11 | dnolen | bbloom: there's not to disable adv opts, emission has nothing to do with that. |
| 16:11 | dnolen | no need to disable. |
| 16:12 | bbloom | dnolen: no, what im saying is that the two source maps you want to merge are cljs->js and js->optimized, right? |
| 16:12 | dnolen | bbloom: source-map branch is already generating the Closure source-map for any :optimization level from the original emitted JS |
| 16:12 | Anniepoo | lein.bat's not working for me on winders 7. It installs with self-install but doesn't find the clojure jars after |
| 16:12 | Anniepoo | =8c/ |
| 16:12 | dnolen | bbloom: no |
| 16:13 | bbloom | dnolen: then which are they? |
| 16:13 | dnolen | bbloom: Closure optimization compilation produces a source map, before that CLJS-JS emissions produces in-memory mappings |
| 16:13 | bbloom | dnolen: yeah, that's js->minjs, right? |
| 16:14 | dnolen | bbloom: we load closure source map converting it into another set of in-memory mappings that's mergeable with the one we created during emission |
| 16:14 | dnolen | bbloom: a bit convoluted but I've seen nothing in Closure that would make this simpler (could be missing something) |
| 16:15 | bbloom | dnolen: have you pushed the latest work you have to github? :-P b/c all i see is the vlq code |
| 16:15 | bbloom | dnolen: no changes to compiler.clj |
| 16:16 | dnolen | bbloom: not yet, I'm toying with some stuff but the approach is in mostly in my head at the moment. |
| 16:16 | bbloom | dnolen: heh, ok. what i'm saying is that there are three source maps that exist. one is cljs->js, the next is js->minjs, and the last is cljs->minjs |
| 16:17 | dnolen | bbloom: there are only two source-map that will actually get produce, not three |
| 16:17 | bbloom | dnolen: closure produces js->minjs and *might* provide map composition we need (might also not) |
| 16:17 | dnolen | 1) closure js->minjs, 2) cljs->minjs |
| 16:18 | dnolen | we never actually produce cljs->js |
| 16:18 | bbloom | dnolen: why not? |
| 16:18 | bbloom | it seems like that's the only one *we* need to make, if closure provides a way to compose maps for us |
| 16:19 | dnolen | bbloom: *if* closure does, I've seen nothing of the sort. source v3 doc specifically mentions the challenges around merging source map. and |
| 16:20 | bbloom | dnolen: actually, that seems like the only one we *can* make on our own :-P we don't know what transformations closure's compiler makes for us |
| 16:20 | bbloom | but anyway, my thought was to just ignore advanced compilation for a moment. implement cljs->js, and then worry about merging next |
| 16:21 | dnolen | bbloom: it's just too low of a goal at this point. |
| 16:21 | Anniepoo | is leiningen dead? |
| 16:22 | dnolen | bbloom: we do a lot of optimizations ourself under advanced compilation. |
| 16:22 | Vinzent | Anniepoo, what do you mean? |
| 16:23 | Anniepoo | I'm trying to install leiningen/clojure/etc on a windows 7 machine, |
| 16:23 | Anniepoo | lein self-install installs, but then can't find clojure. d/l and install binaries and adding to my classpath doesn't help |
| 16:23 | Anniepoo | 8c/ |
| 16:23 | bbloom | dnolen: we might be talking past each other. "advanced compilation" == google closure's advanced compilation. i'm saying we should get source maps working inside the cljs compiler on a single compilation unit without touching google closure at all — we need to get source maps working on a single expression before we can worry about project-wide |
| 16:24 | Vinzent | Anniepoo, what do you mean by "can't find clojure"? |
| 16:26 | dnolen | bbloom: to be clear, it doesn't matter what level of :optimization you use |
| 16:27 | Anniepoo | ah- ok, my beliefs about how this all works are out of date |
| 16:27 | dnolen | bbloom: and yes, what you're saying does need to be solved regardless. |
| 16:29 | Vinzent | Anniepoo, btw, you can run "lein repl" to get basic code evaluation tool. It can be done outside of project too |
| 16:29 | bbloom | dnolen: right. i'm saying that compiler.clj needs to be able to produce a mapping — long before closure.clj touches it |
| 16:29 | Anniepoo | they moved the clojure jares, I tried adding them to project.clk |
| 16:30 | dnolen | bbloom: currently the compiler always defaults to :simple - but :whitespace, :pretty-print all of these things change the original emitted source. |
| 16:31 | dnolen | bbloom: writing the code that produces the simplest source map will need to be done. but I don't think anyone will ever use it once we get to merging - which I don't think will be much work. |
| 16:34 | bbloom | dnolen: except that we probably *shouldn't* do merging ourselves b/c it's something that the browsers should be able to handle. you actually want *both* source maps in the browser so you can debug at varying levels |
| 16:34 | bbloom | dnolen: also, it's something that *every* compiler needs |
| 16:34 | bbloom | dnolen: consider again GWT: java->js->minjs |
| 16:35 | bbloom | the merging doesn't belong in GWT, it belongs in the js->minjs phase |
| 16:35 | bbloom | or, better yet, it belongs in the web inspector |
| 16:35 | dnolen | bbloom: I've heard of no such browser plans - source maps in fact launched mentioning that this might be supported one day but who knows when? |
| 16:35 | dnolen | bbloom: unless you have evidence to the contrary. |
| 16:37 | bbloom | dnolen: i *thought* had evidence to the contrary. still looking. either way, merging should happen elsewhere. we should contribute to chromium or gecko, if they don't support merging. that's the right level for this merging to happen. |
| 16:37 | dnolen | bbloom: btw I've never seen any demos of GWT java->js->minjs |
| 16:37 | dnolen | bbloom: only java->js |
| 16:37 | dnolen | only js->minjs |
| 16:38 | dnolen | bbloom: CoffeeScript has the same problem thus things are still moving slowly on this, plus they emit semi-debuggable JS. |
| 16:38 | bbloom | dnolen: GWT probably isn't the best example. I'm pretty sure I saw a coffeescript -> minjs demo |
| 16:38 | dnolen | bbloom: does not exist |
| 16:39 | dnolen | bbloom: if it did I most definitely with have heard about it from Jeremy Ashkenas himself. |
| 16:39 | bbloom | dnolen: heh, ok |
| 16:40 | bbloom | dnolen: either way, the cljs->js mapping needs to exist before merging can do anything useful |
| 16:41 | dnolen | bbloom: yes |
| 16:43 | iwo | hey, does anyone know how i set jvm arguments that should be used when running swank in emacs? |
| 16:43 | iwo | i use :jvm-opts in my project.clj for lein, but this isn't used by swank when run via clojure-jack-in |
| 16:56 | bbloom | dnolen: reviewed the source map specs & gave some thought to the in memory representation. i think you're right. to clarify: |
| 16:57 | bbloom | top-level map with :file and :lines keys. each lines key is just a vector of segments. each segment is just a map with :original and :generated keys with [line column] values and :name, :source-file keys |
| 16:59 | bbloom | so: {:file "abc.js" :mappings [[{:source [1 2] :generated [3 4] :name 'abc :file "abc.cljs"}]]} |
| 16:59 | dnolen | bbloom: branch updated, with some thinking http://github.com/clojure/clojurescript/compare/master...source-map |
| 17:00 | dnolen | bbloom: now all we need is code to produce a v3 source map from *cljs-mappings* |
| 17:02 | bbloom | side question: why are all of these vars prefixed with cljs- ? |
| 17:03 | bbloom | dnolen: i thought namespaces meant we didn't need prefixes :-) |
| 17:04 | dnolen | bbloom: well eventually these will get moved into the js emission namespace, good way to mark things that will move for now :) but yeah, should be more consistent |
| 17:05 | bbloom | dnolen: looks like a good start. clever use of metadata on the symbols |
| 17:06 | bbloom | is :var the only place we need to emit mappings? |
| 17:07 | bbloom | dnolen: also, use :col (when m (:col m 0)) |
| 17:07 | bbloom | dnolen: that way it will gracefully upgrade to support columns when available :-) |
| 17:08 | bbloom | dnolen: and actually, are columns and lines one or zero based? maybe you want 1, not 0 |
| 17:08 | dnolen | bbloom: I'm not totally sure - sidenote, I'm not totally sure why source map v3 segments are 1,4,5 |
| 17:08 | dnolen | bbloom: columns are 0 based |
| 17:08 | dnolen | bbloom: lines are 1, but that's implicit in the mapping vector anyhow. |
| 17:08 | dnolen | bbloom: 4 I guess for things minifiers might do? 1 is a mystery. |
| 17:08 | dnolen | bbloom: good catch re: col |
| 17:10 | bbloom | dnolen: yeah, the 1,4,5 is a bit of a mystery for me… the docs are complecting logical representation and encoding based on prior values |
| 17:11 | bbloom | dnolen: http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/ is a little clearer than the spec |
| 17:11 | dnolen | bbloom: k then 1 is probably to account for whitespace |
| 17:12 | dnolen | bbloom: yeah I looked over that a few times. |
| 17:14 | bbloom | dnolen: is *cljs-gen-col*necessary? seems like one more thing to keep track of. couldn't you do: (let [last-segment (-> *cljs-mappings* last)] (+ (:gcol last-segment) (count (:name last-segment))) |
| 17:14 | bbloom | dnolen: (it is very hard to code in irc :-P you get the idea) |
| 17:15 | dnolen | bbloom: *cljs-mappings* doesn't contains segments, it contains lines, *cljs-gen-col* just seems faster/simpler in this case. |
| 17:16 | bbloom | sorry, i mean (-> *cljs-mappings* last last) |
| 17:16 | bbloom | dnolen: not super important anyway |
| 17:16 | bbloom | dnolen: I'm glad the *position* thing was already done :-) that makes all this much easier! |
| 17:17 | dnolen | bbloom: oh definitely, when I started digging in I realized your work makes this trivial :) |
| 17:17 | bbloom | dnolen: that's why i did it :-) |
| 17:18 | bbloom | dnolen: I'd be twice as clever if I wasn't trying to run a startup at the same time! |
| 17:18 | dnolen | bbloom: it's very clean, lets us keep the source mapping code very self contained. |
| 17:19 | bbloom | dnolen: yeah, mostly. i'm still not sure if :var is the only place we want to omit stuff |
| 17:19 | bbloom | dnolen: because there are other places we generate javascript names… basically anywhere we emits (:name foo) |
| 17:19 | bbloom | dnolen: that's one of those things where we'll have to feel it out once it's working in the browser |
| 17:20 | dnolen | bbloom: it most definitely is not, we also probably want to generate position information for anon functions etc. |
| 17:21 | bbloom | right. some of this source map stuff is going to leak into the repl implementation if we want to support source mapping of eval-ed code |
| 17:21 | bbloom | at minimum, compile-file needs to emit a // source map comment |
| 17:21 | bbloom | and there was some talk of adding an X-SourceMap header, but that probably belongs in Ring or something as a middleware |
| 17:22 | dnolen | bbloom: source mapping of eval-ed code is for later :) yes on the // source map comment |
| 17:25 | bbloom | dnolen: i see you added a json lib. do we really need that extra dependency… i mean… we're a compiler that emits javascript… we've already got all the escaping code we need :-) |
| 17:27 | dnolen | bbloom: we don't have anything for emitting JSON from maps. |
| 17:27 | dnolen | maps/vectors etc I mean. |
| 17:29 | bbloom | dnolen: this is what i have in my local source-maps branch: https://www.refheap.com/paste/2982 |
| 17:31 | bbloom | dnolen: no dependency & the encoded mappings are guarenteed to be valid JSON strings. i don't think the "names" key is necessary, but even then, it would just be (string/join ",") and emit-constant for file names |
| 17:31 | dnolen | bbloom: ah right, yeah that's better |
| 17:31 | dnolen | bbloom: good point, no need for data.json here. |
| 17:32 | bbloom | dnolen: just need to make sure you rebind the various dynamic vars used during compilation. don't want to override *cljs-mappings* while emitting source maps. which brings me back to the question "do we need *cljs-gcol*?" |
| 17:33 | bbloom | dnolen: IMO, we should merge all of those with *cljs-file* into a single dynamic var for the current compilation state |
| 17:34 | dnolen | bbloom: I'd be wary of performance |
| 17:34 | dnolen | bbloom: should be measured before going down that route. |
| 17:35 | bbloom | dnolen: *shrug* you'd know the perf stuff better than me. |
| 17:35 | bbloom | dnolen: I'd be surprised (and saddened) if a top level record wasn't fast enough |
| 17:36 | dnolen | bbloom: updateing top level record will never compete w/ updating top level atom, ever. |
| 17:37 | bbloom | dnolen: fair enough. did those are-we-fast-yet graphs include benchmarks for the compiler itself? or just the output code? |
| 17:38 | dnolen | bbloom: yes they benchmark compile times, things have a gotten a little slower as we do more analysis, more optimizations. |
| 17:39 | bbloom | dnolen: ok. shouldn't be an issue at all for interactive development, but luckily, it should parallelize well by file for larger projects |
| 17:41 | bbloom | dnolen: anyway, i want to make a lot more refactoring to compiler.clj — the limiting factor however may be your time to understand and review them :-) |
| 17:44 | dnolen | bbloom: sure, always good to write up your notes somewhere on what you'd like to see improved. |
| 17:45 | bbloom | dnolen: i did that a bit with Vars, but no one seemed to notice |
| 17:45 | bbloom | dnolen: i don't want to feel like i'm always pestering you to get my patches accepted |
| 17:46 | dnolen | bbloom: I've looked a bit at your vars stuff, that patch/enhancement is just not high priority. |
| 17:48 | dnolen | bbloom: things that'll move faster is anything related to compiler modularity, debugging, and performance. |
| 17:48 | bbloom | dnolen: fair enough. i'm just interested in helping improve the cljs environment & working towards CinC. |
| 17:48 | bbloom | dnolen: fair enough. re: modularity, take another look at my munging patch :-) |
| 17:49 | bbloom | dnolen: untangling the layers in compiler.clj are a big step towards the lua backend, but i'm more interested in digging down to the module layer, so that we can enable the various optimizations you have on core to apply to other namespaces. stuff like direct dispatch |
| 17:50 | bbloom | dnolen: both goals follow many of the same steps, however |
| 17:50 | dnolen | bbloom: ah thanks for updating that ticket, sounds good will look into. |
| 17:50 | dnolen | bbloom: direct dispatch already works on all namespaces. |
| 17:51 | dnolen | bbloom: I mean I'll review CLJS-294 patch more closely, and probably apply. |
| 17:51 | bbloom | dnolen: k, thanks. |
| 17:51 | dnolen | bbloom: analysis follows namespaces now |
| 17:51 | bbloom | dnolen: ah, ok — missed that |
| 17:52 | dnolen | bbloom: the only patch you've submitted that I'm dragging my feet on is the vars enhancement, excited about the others :) |
| 17:53 | dnolen | bbloom: your contributions are most welcome. |
| 17:53 | bbloom | dnolen: thanks :-) |
| 17:54 | bbloom | dnolen: RE: the vars stuff. i greatly scaled back that patch. no changes to dynamic vars, etc. no iwatchable, etc. just implemented the #' reader and (var ) form. it simply emits a wrapper object which enables stuff like (comp f #'g) |
| 17:54 | bbloom | dnolen: should be much less objectionable :-) |
| 17:54 | dnolen | bbloom: k, thx for the update I'll take another look. Also thanks for getting in touch with raph_amiard! sorry I didn't follow up about the mentoring stuff - just got back from a trip today. |
| 17:55 | bbloom | dnolen: no worries. i don't mean to pester. i'm just excited :-) haven't had this much fun coding in years |
| 18:04 | johnmn3 | https://www.refheap.com/paste/2984 |
| 18:05 | johnmn3 | So, I'm getting noticable speedup with r/map with inc (after I cleaned up my chunkifier) |
| 18:06 | johnmn3 | but when I try it with other workloads, I can't repeat this |
| 18:16 | johnmn3 | trying to put together a simple example, but I'm working with a cellular automaton that has grown a little complex |
| 18:17 | dnolen | bbloom: nice patch, CLJS-294 patch merged into master. that removed quite a bit of ugliness thx. |
| 18:18 | bbloom | dnolen: cool, thanks |
| 18:38 | johnmn3 | so, reduce applies a fun to the first element, and then applies the fn to the result and the next element |
| 18:40 | johnmn3 | so for a 1d cellular automaton, I could reduce across by conjing the result.. but no, that wouldn't work |
| 18:40 | tomoj | (doseq [x cljs.core.PersistentQueue] (.log js/console x)) prints "null" for me |
| 18:40 | tomoj | er, cljs.core.PersistentQueue/EMPTY ofc |
| 18:42 | TimMc | Anniepoo! |
| 19:14 | Anniepoo | hey Tim! |
| 19:14 | mheld | is compojure worth following? |
| 19:14 | Anniepoo | 8cD I'm getting back into Clojure! |
| 19:15 | mheld | compojure over noir? |
| 19:16 | weavejester | mheld: Noir is a higher-level framework, but in some ways less flexible than Compojure. |
| 19:16 | weavejester | mheld: I'm kinda biased, but Compojure tends to be "simpler" while Noir tends to be "easier" |
| 19:22 | mheld | weavejester: I come from the rails world (but I'm a schemer) -- which would I be happier with? |
| 19:22 | weavejester | mheld: Noir is closest to the Rails/Ruby world, I think :) |
| 19:23 | Anniepoo | on the other hand, that's a strong argument for compojure |
| 19:23 | Anniepoo | 8cD |
| 19:23 | weavejester | Anniepoo: I think so :) |
| 19:23 | mheld | weavejester: isn't it a little less resource-focused and more page-focused, though? |
| 19:24 | dnolen | weavejester: Noir is not close the the Rails world at all from what I've seen. |
| 19:24 | dnolen | mheld: Noir seems Sinatra-like, minimal with standard patterns for the usual stuff. |
| 19:25 | dnolen | mheld: Compojure is lower level - a tiny bit of sugar over Ring - which is like Rack |
| 19:26 | weavejester | dnolen: It's closer than Compojure, I think. Though I agree it's pretty distant from Rails; it's more like Sinatra. |
| 19:26 | dnolen | mheld: Rail-ish stuff is not the kind of thing Clojure folks get excited about. |
| 19:27 | Anniepoo | ok, aaaargh, stupid question, started repl in foo, my sources are in ns tacos.core in tacos/src/tacos/core.clj, what's the arg to use? |
| 19:27 | Anniepoo | (brain's been twisted by prolog) |
| 19:27 | weavejester | mheld: Compojure tends to take the view that complex web applications should be compositions of smaller sets of routes. |
| 19:27 | weavejester | Anniepoo: Arg to use for what? |
| 19:27 | Anniepoo | to (use) |
| 19:28 | mheld | dnolen: I can appreciate that, I just like the idea of being able to structure my app based around resources that talk together |
| 19:28 | mheld | but I guess that's not impossible |
| 19:28 | Anniepoo | as in, I'd like to import into the repl's space. |
| 19:28 | weavejester | Anniepoo: load ? |
| 19:29 | Anniepoo | 8c( I've forgotten lots of details |
| 19:29 | pepijndevos | dnolen, I herad you're going to do something with cljs saturday at hackerschool :) Looking forward to meet you. |
| 19:29 | dnolen | pepijndevos: ah you got in! |
| 19:29 | Anniepoo | I'd do (load 'tacos.core) |
| 19:29 | Anniepoo | or somesuch |
| 19:29 | pepijndevos | dnolen, yea! They're amazing folks, had a picnic yesterday. |
| 19:30 | dnolen | pepijndevos: rad! congrats! |
| 19:30 | dnolen | pepijndevos: look forward to meeting in person as well! |
| 19:34 | pepijndevos | dnolen, there seem to be some ckanren related fns on github already. what's up with that? |
| 19:34 | dnolen | pepijndevos: half baked motions |
| 19:34 | dnolen | pepijndevos: got caught up in CLJS stuff so I haven't revisited. |
| 19:35 | dnolen | pepijndevos: challenge is coming up with good fast representations for the domains. |
| 19:35 | pepijndevos | dnolen, FYI, the only dead tree I brought is the reasoned schemer :D |
| 19:35 | dnolen | pepijndevos: haha nice |
| 19:35 | dnolen | pepijndevos: I can walk you through the cKanren stuff on Sat if you like. |
| 19:36 | pepijndevos | dnolen, That'd be amazing. I don't feel like I really understand minikanren itself though. |
| 19:38 | dnolen | pepijndevos: I can give you a run through on that as well |
| 19:39 | dnolen | pepijndevos: my talk won't be that long |
| 19:39 | dnolen | pepijndevos: taking off for a bit, talk soon. |
| 19:39 | pepijndevos | ok, splendid. |
| 19:40 | pepijndevos | see you Saturday |
| 19:55 | johnmn3 | how do I get the full stack trace from lein2 run? |
| 19:59 | sc_ | OO people have UML and several methodologies for large S/W design. What techniques do lisp people normally use for large S/W design? |
| 20:01 | bbloom | sc_: avoidance of writing large software by careful use of abstractions and layering :-) |
| 20:01 | Anniepoo | the question's less often an issue because programs tend to be about 10% of the length. |
| 20:04 | johnmn3 | is this inefficient? (drop 1 (drop-last (range (count coll)))) |
| 20:06 | bbloom | ,(doc drop-last) |
| 20:06 | bbloom | &(doc drop-last) |
| 20:06 | lazybot | ⇒ "([s] [n s]); Return a lazy sequence of all but the last n (default 1) items in coll" |
| 20:06 | bbloom | says it's lazy :-) |
| 20:07 | bbloom | &(first (drop-last (range))) |
| 20:07 | lazybot | ⇒ 0 |
| 20:07 | bbloom | johnmn3: looks efficient to me |
| 20:08 | johnmn3 | does it matter if coll is a vector or a list? |
| 20:08 | johnmn3 | or no |
| 20:08 | johnmn3 | I mean (drop 1 (drop-last (vec (range (count coll))))) |
| 20:09 | bbloom | well the "vec" will be eager |
| 20:10 | bbloom | laziness happens on seqs (that is: 'seq?) but anything that is 'sequential? supports the first/rest/lazy-cat/lazy-seq pattern |
| 20:10 | bbloom | via coercion to a seq: (seq [1 2 3]) |
| 20:48 | frozenlo` | I'm stuck again... The worse part is that I'm sure the solution is really simple. I have a function taking as argument an input (data) and an output (stream). I can easily send the output to a file, but how can I simply get the result directly? |
| 20:49 | frozenlo` | Here is the function I'm playing with: https://gist.github.com/1858654 . More precisely `gunzip' |
| 20:49 | bbloom | &(doc *out*) |
| 20:49 | lazybot | ⇒ "; A java.io.Writer object representing standard output for print operations. Defaults to System/out, wrapped in an OutputStreamWriter" |
| 20:50 | bbloom | &(doc binding) |
| 20:50 | lazybot | ⇒ "Macro ([bindings & body]); binding => var-symbol init-expr Creates new bindings for the (already-existing) vars, with the supplied initial values, executes the exprs in an implicit do, then re-establishes the bindings that existed before. The new bindings are m... https://www.refheap.com/paste/2985 |
| 20:50 | bbloom | &(doc with-out-str) |
| 20:50 | lazybot | ⇒ "Macro ([& body]); Evaluates exprs in a context in which *out* is bound to a fresh StringWriter. Returns the string created by any nested printing calls." |
| 20:50 | bbloom | frozenlo`: does that help? |
| 20:51 | frozenlo` | The last one is gold, thank you very much! |
| 20:51 | bbloom | :-) |
| 20:52 | frozenlo` | Works flawlessly. I can't believe I was stuck on this for more than a hour. |
| 20:52 | bbloom | &(source with-out-str) |
| 20:52 | lazybot | java.lang.RuntimeException: Unable to resolve symbol: source in this context |
| 20:52 | frozenlo` | Thank you very much indeed |
| 20:52 | bbloom | aw, no source…. run that one in your repl |
| 20:52 | bbloom | take a look at the source of it — it's not magic! :-) |
| 20:52 | amalloy | ~def with-out-str |
| 20:53 | bbloom | amalloy: no luck... |
| 20:53 | amalloy | he'll notice eventually |
| 20:53 | amalloy | i bet |
| 20:53 | bbloom | heh |
| 20:54 | frozenlo` | Interesting. Should I try to use StringWriter manually? Or is rebinding *out* common practice? |
| 20:55 | bbloom | Frozenlock: rebinding *out* is as designed — just wanted to show you how you could dig into the various things to understand how they work |
| 20:55 | bbloom | Frozenlock: for example, check out the source of prn, prn-str, pr-str, print-str, etc |
| 20:56 | Frozenlock | bbloom: That's what got me in this rabbit hole in the first place.. I was looking at slurp, then reader... Started in the wrong direction :P |
| 20:58 | bbloom | Frozenlock: heh, yeah. printing is quite the rabbit hole for sure. there are a bunch of printing vars worth understanding. see: http://clojure.org/other_functions#Other%20Useful%20Functions%20and%20Macros-Printing |
| 21:03 | Frozenlock | Now I see `str' (which I use quite often) with new eyes! |
| 21:04 | _ato | I wouldn't use *out* rebinding for gzip, because you're dealing with binary data (streams) not string data (readers) |
| 21:06 | bbloom | _ato: ah, good point. I didn't even look at his gist, had no idea it was binary |
| 21:07 | bbloom | Frozenlock: still, the pattern is worth mirroring for your use case |
| 21:07 | Frozenlock | _ato: So it only worked because I was encoding strings? |
| 21:09 | _ato | probably, not sure what you did, but if you're passing things through readers/writers/strings it'll likely break on byte sequences that aren't valid UTF-8 characters |
| 21:10 | _ato | personally I'd just keep it how it is in your gist and add an extra helper like gunzip-text-lines that passes a ByteArrayOutputStream |
| 21:11 | _ato | gunzip-to-array or something |
| 21:12 | _ato | beware that I'm not sure I'm fully understanding the question though |
| 21:12 | lynaghk | jimduey: ping |
| 21:14 | Frozenlock | In my case it isn't really a problem, as I intend to encode only strings. Still, could you point me towards a solution to convert a stream to an array? |
| 21:14 | tomoj | Frozenlock: a demonstration https://gist.github.com/6fe33dc93b1b15634245 |
| 21:15 | tomoj | er, except leave out the io/input-stream of course :) |
| 21:21 | Frozenlock | tomoj: thanks :) |
| 21:21 | Frozenlock | I should really come here more often |
| 21:22 | TimMc | Anniepoo: Did your question about loading namespaces get answered? Form the REPL you'd do something like (use 'tacos.core) |
| 21:22 | Anniepoo | no, never got answered |
| 21:22 | Anniepoo | and actually, I got distracted, now I'm back at it |
| 21:22 | Anniepoo | so I'm still trying to figure out the filename/require mapping |
| 21:23 | TimMc | Anniepoo: tacos/core.clj is the file in which the namespace tacos.core lives. |
| 21:23 | Anniepoo | yes- hang on, lets talk absolute paths a moment |
| 21:23 | TimMc | Anniepoo: Hyphens in namespaces map to underscores in file and folder names (because the JVM is limited.) |
| 21:24 | bbloom | dnolen: http://dev.clojure.org/jira/browse/CLJS-297 I've got a big ol bag of refactors in me :-) |
| 21:24 | Anniepoo | C:\development\lein\tacos\src\tacos\core.clj contains this short file |
| 21:24 | Anniepoo | (ns tacos.core) |
| 21:24 | TimMc | Anniepoo: OK. src/ is a classpath root, one of many. That's something Leiningen knows about, so it adds that to the classpath. |
| 21:24 | Anniepoo | ah, ok |
| 21:25 | Anniepoo | so my namespace is tacos.core |
| 21:25 | TimMc | Anniepoo: When Clojure's loader looks for the *namespace* tacos.core-with-hyphen, it asks the JVM for the *resource* tacos/core_with_hyphen.clj, and the JVM finds it in one of the classpath roots. |
| 21:25 | TimMc | Got to go, but that's the basics of namespaces and classpaths. |
| 21:26 | Anniepoo | hmm |
| 21:26 | Anniepoo | ok, but I can only start lein repl in dev\lein |
| 21:29 | jimduey | lynaghk: pong |
| 21:29 | TimMc | Anniepoo: Call it from the project root. |
| 21:29 | Anniepoo | ok |
| 21:30 | lynaghk | jimduey: hey, I'm just reading your blog. I was going to ask about the ring testing DSL you talked about at Clojure/West but I found the source on the githubs. |
| 21:30 | TimMc | Then it will see the project.clj and read it, loading the right classpath. |
| 21:30 | jimduey | For anyone interested in monads, I just put up a new post: |
| 21:30 | jimduey | http://www.clojure.net/2012/06/03/Monad-Protocols/ |
| 21:30 | Anniepoo | gripes about |
| 21:30 | jimduey | lynaghk: cool. Hope it's understandable. |
| 21:31 | lynaghk | jimduey: I have some time to clean up an old project (API that spits out charts), so I'm looking around for a good way to put together a test suite. |
| 21:31 | Anniepoo | gripes it can't find the lein self install jar |
| 21:31 | lynaghk | jimduey: do you have any suggestions for doing http tests in Clojure? At this point I'm thinking about just using clj-http with Midje |
| 21:32 | jimduey | lynaghk: Not really other than what's in that library. |
| 21:33 | Anniepoo | ah, clue - the complaint is it can't find leiningen-1.6.2-standalone.jar |
| 21:33 | lynaghk | jimduey: okay, cool. I didn't know if you wrote that up for funsies or if there was a big work project behind it or somethin |
| 21:33 | Anniepoo | and running lein self-install asserts that leining-1.7.7-standalone.jar already exists |
| 21:34 | jimduey | lynaghk: I needed it for a personal project. What's there was enough for me. It should be easy to extend |
| 21:35 | jimduey | If you want to add anything, I'd be glad to help. |
| 21:37 | lynaghk | jimduey: okay, thanks! Yeah, my needs aren't really huge. Half of what I'm wondering about is whether there are clever things out there for doing parallel requests or structuring/generating tests for a RESTful API. |
| 21:41 | TimMc | Anniepoo: Deleting ~/.lein (and if necessary, the ~/.m2/repository cache) has helped some folks in the past... |
| 21:42 | TimMc | then lein self-install again |
| 21:42 | Anniepoo | ok, will do that next |
| 21:42 | Anniepoo | I decided to try grepping my whole drive for lein |
| 21:43 | TimMc | Nah, it's all in those two places. |
| 21:43 | Anniepoo | I actrually have an old one in c:\Program Files (x86)\Clojure Box\swank-clojure |
| 21:44 | Anniepoo | (an old leiningen directory) |
| 21:46 | Anniepoo | oooh! I now have 25 hits |
| 21:46 | Anniepoo | I think I should clean up some of this |
| 21:46 | Anniepoo | =8co |
| 21:50 | johnmn3 | confused by this: |
| 21:50 | johnmn3 | Caused by: java.lang.NoSuchMethodError: clojure.lang.Numbers.lt(II)Z |
| 21:50 | johnmn3 | what is .lt(II)Z |
| 21:51 | TimMc | I = Integer, I think. Z = Long? |
| 21:52 | TimMc | &(class (boolean-array [])) |
| 21:52 | lazybot | ⇒ [Z |
| 21:52 | TimMc | &(class (int-array [])) |
| 21:52 | lazybot | ⇒ [I |
| 21:52 | TimMc | Oh, that makes sense. Wonder what's up. |
| 22:15 | mheld | noir vs conjure? |
| 22:20 | technomancy | compojure! |
| 22:21 | weavejester | I haven't heard a lot from conjure in a while. |
| 22:21 | weavejester | Conjure also seemed not very Clojure-like... |
| 22:22 | weavejester | I agree with technomancy's choice, too ;) |
| 22:29 | johnmn3 | weird errors |
| 22:29 | johnmn3 | Exception in thread "main" java.lang.NoSuchMethodError: clojure.lang.Numbers.min |
| 22:29 | johnmn3 | us(I)I |
| 22:29 | johnmn3 | Exception in thread "main" java.lang.NoSuchMethodError: clojure.lang.Numbers.minus(I)I |
| 22:30 | johnmn3 | is this because I'm using clojure 1.5alpha1? |
| 22:30 | johnmn3 | do Numbers not implement minus? |
| 22:31 | johnmn3 | in the repl (- 1) works fine |
| 22:32 | johnmn3 | but the top of the stack trace points to this line: (let [left-index (- (int (/ the-width 2))) ... |
| 22:32 | mheld | yeah, I don't see much going on with conjure |
| 22:32 | tomoj | johnmn3: it sounds like the clojure version at runtime probably doesn't match the clojure version used to AOT compile some code you're using |
| 22:33 | mheld | I'm going to secede from trying to use anything *other* than compojure |
| 22:33 | johnmn3 | tomoj: I did a lein2 dep again |
| 22:33 | mheld | what do y'all use for url routing? |
| 22:33 | tomoj | but did you AOT compile, or do any of your deps contain AOT compiled clojure code? |
| 22:34 | johnmn3 | I have a main class, but none of the namespace declarations ask to be :aot compiled |
| 22:34 | tomoj | you have a (:gen-class)? |
| 22:35 | johnmn3 | no |
| 22:35 | tomoj | where does the stacktrace on the error lead? |
| 22:35 | johnmn3 | should I just empty out the libs and bin folder and re-dep? |
| 22:35 | johnmn3 | it leads back to the main class |
| 22:36 | tomoj | clojure.main? or how do you have a main class without (:gen-class) ? |
| 22:37 | johnmn3 | -main |
| 22:39 | tomoj | can you gist the stack trace? |
| 22:42 | johnmn3 | https://www.refheap.com/paste/2986 |
| 22:43 | tomoj | huh |
| 22:44 | johnmn3 | ewe, my pasting lost the line numbers |
| 22:44 | johnmn3 | I can re try that |
| 22:44 | tomoj | error is on line 68 in your paste I assume |
| 22:44 | tomoj | so looks like aot is not the problem? |
| 22:45 | johnmn3 | well, for some reason it is saying: All namespaces already :aot compiled. |
| 22:45 | tomoj | I guess just try `lein2 clean` `lein2 compile` to be sure |
| 22:45 | johnmn3 | k |
| 22:45 | tomoj | also check lib and lib/dev for multiple copies of clojure |
| 22:46 | dnolen | bbloom: heya looks like CLJ-294 broke ^:export |
| 22:46 | dnolen | CLJS-294 I mean. |
| 22:46 | johnmn3 | hah, that worked |
| 22:47 | johnmn3 | strange. Now pmap is beating reducers |
| 22:48 | tomoj | with fold? |
| 22:59 | johnmn3 | tomoj: yea, the new reducers/fold thing |
| 23:02 | bbloom | dnolen: can you elaborate on "broke" ? will it be obvious if i try it? |
| 23:06 | dnolen | bbloom: it will be obvious |
| 23:06 | dnolen | bbloom: goog.exportSymbol("cljs.foo_bar", cljs - foo - bar) |
| 23:06 | dnolen | bbloom: :export is now broken. |
| 23:07 | bbloom | dnolen: ok, ill look at it in a few minutes. should be a quick fix |
| 23:07 | bbloom | dnolen: i'll also try to get a test case in there |
| 23:07 | dnolen | bbloom: great thx |
| 23:14 | bbloom | dnolen: yeah, trivial fix -- just add a call to munge on line 463 |
| 23:15 | bbloom | dnolen: can you just make that change for me? |
| 23:16 | bbloom | dnolen: or ill just make a patch :-P |
| 23:17 | dnolen | bbloom: I see it thx |
| 23:18 | bbloom | dnolen: it's actually two calls |
| 23:18 | bbloom | i'm uploading the patch now |
| 23:18 | dnolen | bbloom: k thx |
| 23:19 | bbloom | dnolen: updated http://dev.clojure.org/jira/browse/CLJS-298 |
| 23:22 | bbloom | dnolen: sorry i missed that! |
| 23:28 | rhdoenges | is there a way of mapping over a seq without worrying about the return value? ie (map println a-bunch-of-strings) but without returning a big list of nils? |
| 23:28 | rhdoenges | I mean, map works fine |
| 23:28 | bbloom | &(doc doseq) |
| 23:28 | lazybot | ⇒ "Macro ([seq-exprs & body]); Repeatedly executes body (presumably for side-effects) with bindings and filtering as provided by \"for\". Does not retain the head of the sequence. Returns nil." |
| 23:29 | bbloom | &(doc do all) |
| 23:29 | lazybot | clojure.lang.ArityException: Wrong number of args (2) passed to: sandbox7502$doc |
| 23:29 | bbloom | &(doc doall) |
| 23:29 | lazybot | ⇒ "([coll] [n coll]); When lazy sequences are produced via functions that have side effects, any effects other than those needed to produce the first element in the seq do not occur until the seq is consumed. doall can be used to force any effects. Walks through t... https://www.refheap.com/paste/2987 |
| 23:29 | bbloom | rhdoenges: does that help? |
| 23:31 | rhdoenges | ah |
| 23:31 | rhdoenges | ok |
| 23:31 | rhdoenges | thanks! |
| 23:31 | bbloom | rhdoenges: although, for println, you may want apply |
| 23:31 | bbloom | &(apply println [1 2 3]) |
| 23:31 | lazybot | ⇒ 1 2 3 nil |
| 23:32 | bbloom | println takes a variable number of arguments & apply can operate on lazy collections |
| 23:33 | rhdoenges | oh no I'm using a more complicated function |
| 23:33 | rhdoenges | I was just using that as an example. |
| 23:34 | bbloom | rhdoenges: ah, ok. well you want to use dorun, doseq, doall, etc with side effects |
| 23:34 | rhdoenges | oooh while I'm in here: is there something like apply that applies to the rest of its args instead of a list of args? |
| 23:34 | tomoj | johnmn3: what's the size of the collection? |
| 23:34 | rhdoenges | ie (magic-function println 1 2 3) |
| 23:35 | bbloom | isn't that just (println 1 2 3) ? |
| 23:35 | tomoj | johnmn3: did you already try passing a different n to fold? |
| 23:35 | johnmn3 | tomoj: was 100,000... just bumped it to 1,000,000 |
| 23:35 | johnmn3 | playing with the dials |
| 23:36 | bbloom | rhdoenges: i'm not sure what you're asking |
| 23:36 | tomoj | I wonder if there are performance differences between jdk7 and jsr166y |
| 23:36 | tomoj | or is it pretty much the same thing? |
| 23:38 | rhdoenges | bbloom: well currently I am doing (map #(apply % []) list-of-functions) |
| 23:38 | johnmn3 | not sure. |
| 23:38 | rhdoenges | bbloom: and I wanted a better way of doing it |
| 23:38 | bbloom | &(doc juxt) |
| 23:38 | lazybot | ⇒ "([f] [f g] [f g h] [f g h & fs]); Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to the args (left-to-right). ((juxt a b c) x) => [(a x) (b x) (c x)]" |
| 23:38 | rhdoenges | s/better/shorter/ |
| 23:39 | rhdoenges | ooooh |
| 23:39 | rhdoenges | I forgot about juxt |
| 23:39 | bbloom | rhdoenges: juxt is awesome. took me a while to get used to it, but now i find excuses to use it surprisingly frequently |
| 23:41 | bbloom | rhdoenges: it would simply be ((apply juxt list-of-functions) xyz) |
| 23:41 | rhdoenges | neato |
| 23:41 | rhdoenges | thanks! :D |
| 23:41 | bbloom | rhdoenges: you're welcome! |
| 23:41 | rhdoenges | as an aside, quil is making my brain hurt and it is wonderful. |
| 23:43 | bbloom | rhdoenges: damn. i hadn't even seen quil. too many cool projects to play with! |
| 23:43 | rhdoenges | so much to do so little time, right? |
| 23:44 | bbloom | rhdoenges: way too little time. |
| 23:44 | rhdoenges | it beat out opengl for my attention because opengl involves more... |
| 23:44 | rhdoenges | typing? |
| 23:45 | bbloom | opengl is a pretty old API. it's this weird hybrid between a nice API & what was fast back in the day on older gfx cards & vendor specific extensions for actual perf of modern games/etc |
| 23:46 | bbloom | especially from java -- it's just not much… um… fun. yeah. fun is the word. |
| 23:46 | rhdoenges | I was writing c but yeah |
| 23:46 | rhdoenges | not much fun :( |
| 23:46 | bbloom | it's main problem is that it tries to be both high level & expose the hardware at the same time |
| 23:47 | bbloom | directx actually much better represents the underlying hardware architecture & layers the higher level stuff on top in terms of batching |
| 23:47 | rhdoenges | hmm |
| 23:47 | bbloom | it's the logical equivilent of building a file system on top of a block storage device. opengl tries to do the former without the later |
| 23:47 | rhdoenges | hahaha, good analogy |
| 23:47 | bbloom | as a result, all modern opengl apps just use nvidia and ati extensions that emulate the direct3d api |
| 23:47 | bbloom | lol |
| 23:48 | bbloom | i worked on xna/xbox/directx/etc at msft for a bit -- say what you will about msft's dev tools, but damn direct3d is a solid piece of software |
| 23:50 | rhdoenges | I've never done serious win dev |
| 23:51 | muhoo | what's the trick for adding a non-clojars, non-maven repo to a clojure heroku project? |
| 23:52 | technomancy | muhoo: s3-private-repo is currently the best bet |
| 23:53 | muhoo | thanks |
| 23:54 | muhoo | technomancy: this? https://github.com/technomancy/s3-wagon-private |
| 23:55 | technomancy | yeah |