2014-02-25
| 00:05 | escherize | ,(+ 3 4) |
| 00:05 | clojurebot | 7 |
| 00:22 | TravisD | Out of curiosity, why is the IRC network graph a tree? Seems like the network should have redundancy |
| 00:53 | pcn | Dunno. |
| 00:54 | pcn | But usually even if you have redundancy, you treat the current reachable nodes as a DAG to prevent cycles |
| 01:21 | noprompt | dnolen_: if you're around i wanted to get your thoughts on some architecture around om and routing. |
| 01:31 | quizdr | if loop's last call is typically a recur, and if the last item returned from a defmacro is a code list, then it isn't really possible to generate this list inside a (non-quoted) loop inside defmacro, right? |
| 01:32 | noprompt | what? |
| 01:32 | clojurebot | what is seq |
| 01:33 | pcn | how? |
| 01:33 | clojurebot | with style and grace |
| 01:33 | pcn | tell me something good? |
| 01:34 | noprompt | quizdr: are you asking if you can generate a list with loop/recur inside the body of a macro? |
| 01:36 | pcn | Does anyone know if there's a way with lamina.core/receive-all to say... well... not all, but say, 1023? |
| 01:36 | pcn | at a time? |
| 01:36 | pcn | Or if there's another way to simply listen on a port and send off up to N messages, but no more at a time? |
| 01:36 | quizdr | noprompt actually i guess you could have a "do" prior to the "loop" and then close the "do" parenthesis after the loop |
| 01:38 | noprompt | quizdr: or just (cons 'do (list-of-stuff...)) |
| 01:39 | quizdr | word. |
| 02:02 | noprompt | today's lesson: don't swap!, reset! or bang fucking anything inside a go block. ever. |
| 02:03 | noprompt | and by "anything ever" i mean only when you know what you're doing. |
| 02:03 | noprompt | haha. |
| 02:04 | abp | noprompt: what happened? :) |
| 02:04 | noprompt | abp: we had some code that was manipulating a piece of global state inside a go block making it really hard to test. |
| 02:05 | noprompt | abp: actually a few go blocks. |
| 02:05 | noprompt | abp: the solution was to just pull the state change out and have the go blocks return the next state. |
| 02:05 | noprompt | abp: now all the parts can be extracted and tested. |
| 02:06 | abp | noprompt: ah, isn't that more like problems with scattered state manipulation and insufficient testing tools |
| 02:06 | noprompt | abp: definitely. but doing that in a go block definitely ampflifies that. |
| 02:06 | abp | noprompt: right, sounds about how to program clojure, but good to hear it pays again. ;P |
| 02:07 | noprompt | abp: the funny thing is, i'm sure it started off as "we'll just do this now and later we'll refactor it" |
| 02:07 | noprompt | abp: "later" ended up being weeks later and then we were like "omg, this is a monster" |
| 02:07 | noprompt | abp: fortunately, one of the nice things about clojure is that it's not hard to fix. |
| 02:08 | noprompt | took about 20mins once i figured out the problem. |
| 02:08 | abp | noprompt: yep, changing clojure code bases of a few thousand lines is totally trivial. |
| 02:08 | abp | noprompt: love it when new requirements arive and have to change like ten lines |
| 02:09 | abp | noprompt: seems like it could even make "temporary hacks" viable |
| 02:10 | noprompt | abp: well the codebase is only around 1200 lines and this part probably only a hundred. |
| 02:10 | noprompt | abp: still it was a nasty little knot we managed to make. |
| 02:10 | noprompt | abp: haha no kidding. |
| 02:12 | abp | noprompt: well, i think this atom was the equivalent of a singleton in an oop program, considering how core.async centralizes logic. thinking of how often refactored even those out in the days it's no wonder clojure doesn't make it any better |
| 02:12 | abp | *how often i |
| 02:12 | noprompt | abp: singleton state is good though for clojure programs imho. |
| 02:12 | sm0ke_ | ,[#inst] |
| 02:13 | clojurebot | #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: ]> |
| 02:13 | sm0ke_ | how do i use tagged literals? |
| 02:13 | noprompt | abp: better to have a single container for your state then a whole bunch of little stateful boxes. |
| 02:13 | abp | noprompt: yeah but only when applying centralized and decoupled mutation vs unrestrained |
| 02:13 | abp | noprompt: that's for sure |
| 02:14 | noprompt | abp: god, just look at a ruby test suite... "we gotta setup the world! half of this test is line noise!" |
| 02:14 | abp | noprompt: that's where my metaphor breaks ;) |
| 02:15 | abp | noprompt: yeah it's mocking the tests *and* you :) |
| 02:16 | abp | noprompt: but i never wrote any ruby, just java, c++ and the likes |
| 02:16 | noprompt | abp: well i can't speak to those languages but i can't imagine it's any better. |
| 02:17 | noprompt | abp: i guess it all depends on your design right? if the code is bad the tests are probably bad too. |
| 02:20 | SegFaultAX | Random JAX-RS question if anyone happens to know: can a resource returned by a sub-resource locator contain additional @Path directives? |
| 02:20 | amalloy | pcn: (receive-all (take* 1023 ch) f)? |
| 02:20 | SegFaultAX | I'm assuming it's just a normal resource, but the Jersey documentation doesn't have an example of doing that from what I can see. |
| 02:24 | SegFaultAX | Oh they totally do. Sweet. |
| 02:25 | abp | noprompt: right. probably in every language the case. clojure makes understanding that easier, at least for me but harder to go back to those languages or even think about architecture for them :) |
| 02:25 | noprompt | abp: i'm just happy i get to write it 90% of the time for a living. |
| 02:34 | abp | noprompt: for me it's more like 50% but increasing. :) mostly legacy maintenance besides |
| 03:04 | quizdr | is there a way to see the full expansion of all macros in a form, including subforms, as they are seen by the compiler? |
| 03:06 | ambrosebs | quizdr: if you want to see exactly what the JVM compiler sees, see jvm.tools.analyzer. https://github.com/clojure/jvm.tools.analyzer#syntax-from-ast |
| 03:06 | quizdr | thanks |
| 03:08 | ambrosebs | quizdr: note that the form is implicitly evaluated. |
| 03:08 | amalloy | ambrosebs: how does c.j.t.a/macroexpand compare to clojure.tools.macro/mexpand-all? |
| 03:09 | amalloy | aside from implicitly evaluating, which seems pretty terrible to me |
| 03:09 | quizdr | this jvm analyzer is a bit lower level than I want for my purpose. i just want to expand all macros in a form and see the final code. |
| 03:10 | ambrosebs | quizdr: I only recommended it because you wanted "as seen by the compiler". |
| 03:10 | quizdr | i'll play with it, thanks |
| 03:11 | amalloy | quizdr: like i said, clojure.tools.macro/mexpand-all |
| 03:11 | ambrosebs | amalloy: I assume mexpand-all just expands macros? |
| 03:11 | amalloy | ambrosebs: yeah |
| 03:11 | ambrosebs | amalloy: that's probably exactly what quizdr wants. |
| 03:11 | quizdr | amalloy sorry i missed that message of yours |
| 03:12 | ambrosebs | amalloy: j.t.a does the whole shebang. |
| 03:12 | amalloy | quizdr: you're forgiven, since i addressed it to ambrosebs |
| 03:14 | ambrosebs | j.t.a expands other things like :inline metadata |
| 03:14 | quizdr | amalloy forgive me again, but how do I access it? I'm trying (require ['clojure.tools.macro :as mm] ) |
| 03:14 | ambrosebs | should just be used for static analysis |
| 03:14 | amalloy | quizdr: it's a library. you have to depend on it |
| 03:14 | quizdr | ah |
| 03:15 | quizdr | i guess that will be my project tomorrow. |
| 03:16 | ambrosebs | fwiw you can also disable implicit evaluation in j.t.a. |
| 03:17 | ambrosebs | it's on by default for side effects like `ns` and `def`. |
| 03:17 | ambrosebs | otherwise the analyzer leaves your code in a weird state. |
| 03:18 | ambrosebs | tools.analyzer.* has similar caveats. |
| 03:19 | amalloy | ah, if you can disable it that's fine, and reasonable given that you'll want to run it on a whole ns |
| 03:19 | ambrosebs | but there's no implicit evaluation in t.a. |
| 03:19 | amalloy | for a macroexpander it seemed crazy, since you expand one form |
| 03:19 | ambrosebs | amalloy: Yes, it's a whole trip and back around again just to expand a macro :P |
| 03:19 | amalloy | the readme makes it sound like a flaw in the approach that they haven't worked out a solution for yet |
| 03:20 | ambrosebs | amalloy: well if you know what you're doing, you're free to disable it. |
| 03:20 | ambrosebs | amalloy: I don't know all the implications of not evaluating the ast TBH. |
| 03:22 | ambrosebs | amalloy: again, I'd only recommend j.t.a if you *really* want to know what Compiler.java is giving you :) |
| 03:22 | ambrosebs | an excellent tool for that. |
| 03:23 | amalloy | yep. thanks for clarifying |
| 03:38 | ggherdov | hi folks, congrats for being accepted at GSoC |
| 03:41 | ambrosebs | yay! |
| 03:42 | ggherdov | hehe |
| 04:13 | sm0ke | any elegant solution to dispatch on string conforming to a particular format, like abc$xyz:[optional].(madatorypart) |
| 04:16 | sm0ke | although regex can be used |
| 04:20 | BartAdv | hey there, any lein-droiders here? I'm asking if anyone tried LightTable with it, or is it *just* impossible at the moment? |
| 04:21 | ddellacosta | sm0ke: you can do that with a multimethod |
| 04:22 | ddellacosta | sm0ke: not sure what you meant by elegant otherwise |
| 04:26 | sm0ke | ddellacosta: well there can be a dsl in which i can write exactly what i wrote above |
| 04:27 | sm0ke | ddellacosta: which will capture all the [] () parts in the variable name inside them |
| 04:27 | edbond | sm0ke, use regexp + core.match |
| 04:28 | sm0ke | core.match is no good that a multimethod |
| 04:28 | sm0ke | the problem is with regex and group capturing |
| 04:28 | sm0ke | its work. |
| 04:29 | sm0ke | its a nice idea for a library though |
| 04:30 | sveri | hi, I have this small test: http://pastebin.com/bwDfZevP when I execute it, the "for" part is never reached, is it because "mails" is a lazy-seq? |
| 04:30 | sm0ke | with a macro like (let-match [#super/reg abc$xyz:[optional].(madatorypart) str] ) |
| 04:30 | sm0ke | now inside the let-match i have bindings for optional and madatorypart |
| 04:30 | sm0ke | if they match! |
| 04:33 | sm0ke | more like (let-match [#super/reg abc$xyz[:#optional].(#madatorypart) str] ) |
| 04:33 | sm0ke | where all #... are variable to be binded |
| 04:35 | sm0ke | blah i will use a regex i guess |
| 04:35 | ddellacosta | sm0ke: seems like you'd be better off writing something w/instaparse |
| 04:36 | sm0ke | ddellacosta: actually a macro and data_readers.clj converting it to a regex should be enough |
| 04:36 | edbond | instaparse may be slow, if regexp is very simple and there is no special cases I would use regexp |
| 04:37 | ddellacosta | sm0ke, edbond: depends on how complex of a dsl it is. Agree in general a regexp is better if simple and the dsl is small. |
| 04:41 | ddellacosta | wth do I have to do to use a deftype in a different namespace? I'm doing what Alex Miller suggests here but it's not working for me: http://tech.puredanger.com/2010/06/30/using-records-from-a-different-namespace-in-clojure/ |
| 04:42 | ddellacosta | has this changed? |
| 04:42 | ddellacosta | I realized it works quite differently in ClojureScript |
| 04:44 | sm0ke | ddellacosta: i did that few weeks back, key is the import |
| 04:44 | sm0ke | seems to work |
| 04:45 | ddellacosta | sm0ke: seriously? I just keep getting "Exception in thread "main" java.lang.ClassNotFoundException: my.name.space.MyType, compiling:(core.clj:1:1)" |
| 04:45 | sm0ke | ddellacosta: hurm. weird. what about wen you out the ns in :aot? |
| 04:45 | sm0ke | put* |
| 04:47 | ddellacosta | sm0ke: it expects to find it in a directory like my/name/space/MyType it seems...but it is setup like my/name/space.clj <- deftype is in this file |
| 04:47 | sveri | hm, it seems like i cannot execute for statements in midjes facts in general, someone used midje here already? |
| 04:48 | ddellacosta | sveri: never had that problem with Midje, are you sure you're just not forgetting about lazy evaluation? Have you tried doall before your for calls? |
| 04:48 | sm0ke | ddellacosta: a protocol is prefixed by the current ns |
| 04:48 | ddellacosta | sm0ke: but that's how Alex Miller has it set up in the article I linked to above, so I'm not sure why that would matter unless it's changed |
| 04:48 | ddellacosta | sm0ke: I don't know what you mean by that |
| 04:48 | ddellacosta | sm0ke: I'm talking about a type |
| 04:49 | sm0ke | ddellacosta: sorry i mean Record |
| 04:49 | sm0ke | shouldbe the same for Type i guess |
| 04:49 | sveri | ddellacosta: please look at: http://pastebin.com/bwDfZevP its really short, where would i put that doall? i already tried some places, but could not succeed |
| 04:49 | sm0ke | ,(defrecord Some (foo [this])) |
| 04:49 | clojurebot | #<AssertionError java.lang.AssertionError: No fields vector given.> |
| 04:50 | sm0ke | ,(defprotocol Some (foo [this])) |
| 04:50 | clojurebot | Some |
| 04:50 | sm0ke | ,(deftype Sometype [x] Some (foo [this] x)) |
| 04:50 | clojurebot | sandbox.Sometype |
| 04:50 | sm0ke | see |
| 04:50 | sm0ke | sandbox is the namespace |
| 04:50 | ddellacosta | sm0ke: I understand all of that |
| 04:50 | sm0ke | ,(import 'sanbox.Sometype) |
| 04:50 | clojurebot | #<ClassNotFoundException java.lang.ClassNotFoundException: sanbox.Sometype> |
| 04:51 | ddellacosta | sm0ke: but it's not helping me load one namespace's type in another |
| 04:51 | sm0ke | eh |
| 04:51 | sm0ke | ddellacosta: do you have - ? |
| 04:51 | ddellacosta | sveri: in front of for. (doall (for [...] ...)) |
| 04:51 | sm0ke | import would require to change it to _ |
| 04:52 | ddellacosta | sm0ke: where? What does that have to do with it? |
| 04:52 | sm0ke | anywhere in ns, its typically what peopple do..my-namespace |
| 04:52 | ddellacosta | sm0ke: and...? |
| 04:53 | sveri | ddellacosta: thank you, it works now in a different setup, seems like i have two problems, however, thank you very much |
| 04:53 | sm0ke | some for import it needs to be changed to (:import my_namesapce.MyType) |
| 04:53 | sm0ke | so* |
| 04:53 | sm0ke | wth |
| 04:53 | ddellacosta | sm0ke: ah, okay, that could be an issue, thanks |
| 04:54 | ddellacosta | sveri: great, glad to hear it |
| 04:55 | ddellacosta | sm0ke: I could hug you, that did it, thanks! |
| 04:56 | sm0ke | :P |
| 04:56 | ddellacosta | didn't know about underscores in import...only thought it was applicable for directory naming. |
| 04:57 | sm0ke | import translates to java directly i guess, and java doesnt like - in name resolution |
| 04:57 | ddellacosta | sm0ke: yeah, good to know...will make a note of that. |
| 04:58 | sm0ke | clojure handles a lot of crap in function naming etc, i have seen names like func! converted to funcBANG or something like that |
| 04:58 | sm0ke | legacy. |
| 04:59 | ddellacosta | sm0ke: yeah, I guess I'm surprised it doesn't do that as well in import calls, but I suppose it makes sense--that is one place where "the Java leaks through." |
| 05:00 | ddellacosta | what I think would make more sense is if deftype/defrecord worked the same way as ClojureScript, where you can simply require the type/record |
| 05:00 | ddellacosta | since they are supposed to be java-independent features |
| 05:00 | ddellacosta | but I suppose there must be some legacy reasons for that |
| 05:01 | sm0ke | i would like to try clojurescript sometime |
| 05:01 | ddellacosta | sm0ke: it's easy to try, you should! Just use dnolen's mies template to get going, it's super quick |
| 05:01 | ddellacosta | sm0ke: lein new mies <project-name> |
| 05:02 | sm0ke | yea, my perception is that clojurescript is really superior like ahead of time, compared to traditional javascript based front end development |
| 05:02 | ddellacosta | I've really grown to love ClojureScript. Especially with Om, sablono and core.async, it's just magical |
| 05:03 | ddellacosta | sm0ke: omg it's a different world. I would be really depressed if I had to take a JS front-end development job at this point |
| 05:03 | ddellacosta | sm0ke: or really, anything not CLJS if it was front-end |
| 05:03 | ddellacosta | unless it was something like fay or elm perhaps |
| 05:04 | sm0ke | nice |
| 05:05 | sm0ke | hmm i hear a lot about om, need to check it out sometime, although hoplon also looks interesting |
| 05:06 | ddellacosta | sm0ke: yeah, been meaning to check out hoplon but Om fits our development to-a-T right now, so been putting it off |
| 05:06 | ddellacosta | sm0ke: but there is a lot of great stuff happening in CLJS. I definitely think it is *way* ahead of the curve for front-end app development |
| 05:07 | sm0ke | so i hear |
| 05:11 | ddellacosta | wow, so you also have to require the namespace *before* you import the type? Lame... |
| 05:12 | sm0ke | is it? |
| 05:12 | sm0ke | try without it? |
| 05:12 | sm0ke | i dont think thats required |
| 05:13 | ddellacosta | sm0ke: hmm, I dunno, I moved the import to the top and it barfed, couldn't find it |
| 05:13 | ddellacosta | but then moving it back to the bottom resolved it |
| 09:07 | loliveira | Any LightTable user in? I can't see log4j's console output. Any ideas? |
| 09:44 | sveri | hi, when i want to insert some data into a unique attribute datomic, what does transact return if that attribute exists already? |
| 09:44 | AeroNotix | dudes |
| 09:45 | AeroNotix | I have a weird error. I have a file which is generating a lot of functions and such via macros, which I AOT due to wanting to run cloverage on it (which needs the class files) |
| 09:45 | AeroNotix | I want to use clojure.tools.logging in it. But when I do, I occasionally get a ClassNotFoundException |
| 09:46 | mdrogalis | sveri: Pretty sure it throws an exception back. |
| 09:47 | sveri | mdrogalis: ok, thank you, I will try that out |
| 10:14 | AeroNotix | any ideas? |
| 10:16 | ToBeReplaced | AeroNotix: there's not enough information there -- i think you just gotta step through it |
| 10:17 | AeroNotix | ToBeReplaced: I've been at this a couple of days. It just says that core.tools.logging is a class it cannot find. Running with lein test works, running with lein run does not. |
| 10:18 | ToBeReplaced | `lein do clean run` fails too? |
| 10:19 | ToBeReplaced | to me it sounds like a macro issue, like you're missing an unquote somewhere which works without the AoT but fails with it |
| 10:20 | AeroNotix | hmm |
| 10:20 | AeroNotix | ToBeReplaced: https://gist.github.com/AeroNotix/9210902 |
| 10:21 | AeroNotix | specifically log-stack-trace uses clojure.tools.logging/warn |
| 10:21 | AeroNotix | which fails. |
| 10:27 | ToBeReplaced | man that's brutal -- you have log-stack-trace in another gist? |
| 10:29 | ddellacosta | AeroNotix: my boss who uses Intellij/Cursive had a really similar issue today...any chance you're using it too? |
| 10:30 | ddellacosta | he had to wipe out his config to get it working again, it had cached some stuff apparently. |
| 10:31 | noncom | hi, how do I properly access the members of the enum from this java class? http://goo.gl/io93A1 I tried like ImagePainter$BlendMode/SET and all combinations of / and $ and it did not work.. |
| 10:34 | `cbp | Maybe (ImagePainter$BlendMode/valueOf "SET") |
| 10:34 | AeroNotix | ddellacosta: noppe |
| 10:34 | AeroNotix | ToBeReplaced: it's trivial, it literally just builds the stack trace and sends it to warn |
| 10:35 | sdegutis | Does writing a CSS parser in Clojure sound fun? |
| 10:35 | AeroNotix | ToBeReplaced: https://gist.github.com/AeroNotix/f539482fa8b27db8794c5 |
| 10:35 | `cbp | nothing with css is fun |
| 10:35 | AeroNotix | but I dount it'll help much |
| 10:35 | locks | sdegutis: sure. |
| 10:36 | sdegutis | I want to automatically convert our .css files to .clj files. |
| 10:36 | locks | what, why |
| 10:36 | sdegutis | https://github.com/noprompt/garden |
| 10:36 | sdegutis | For that. |
| 10:37 | locks | you want to convert your css files to clj to convert them to css? |
| 10:37 | CookedGr1phon | sdegutis: surely just leave the legacy css, write new stuff in garden to override it |
| 10:37 | CookedGr1phon | and then when you don't need any of the legacy stuff any more, delete it |
| 10:38 | ToBeReplaced | AeroNotix: second gist not working. i don't see your issue though -- good luck. |
| 10:38 | AeroNotix | ToBeReplaced: what do you mean "not working"? |
| 10:38 | `cbp | A CSS parser should be pretty easy with instaparse. Yes? |
| 10:38 | ToBeReplaced | link is broken |
| 10:38 | AeroNotix | ToBeReplaced: https://gist.github.com/AeroNotix/f539482fa8b27db8794c5 |
| 10:38 | katox | cemerick: hi, I have an austin vs. deployment q. If I do have a "dev" and "production" profiles (the second one used with "ring uberjar") - what's the recommended way of spliting the sources? I use environ for most of the stuff but it's runtime not compile time - that means the austin ns would have to be available (present in uberjar). What do you use? |
| 10:38 | AeroNotix | huh wtf |
| 10:39 | AeroNotix | ToBeReplaced: https://gist.github.com/AeroNotix/f539482f8b27db8794c5 |
| 10:39 | ToBeReplaced | i'm getting 404 on that |
| 10:39 | AeroNotix | the macro file is in the project's :aot vector |
| 10:40 | sdegutis | `cbp: oooh yes, maybe |
| 10:41 | sdegutis | locks: precisely! |
| 10:41 | sdegutis | On Instaparse's readme: "What if context-free grammars were as easy to use as regular expressions?" |
| 10:42 | sdegutis | Key word there being the first "as". |
| 10:42 | ToBeReplaced | AeroNotix: is it possible to have a file that's being aot'd depend on a file that isn't? |
| 10:42 | AeroNotix | Hmmm, dunno |
| 10:44 | ToBeReplaced | AeroNotix: what happens when you add tools.logging to the macro file? |
| 10:44 | AeroNotix | ToBeReplaced: same deal |
| 10:45 | noncom | `cbp: it says CompilerException java.lang.RuntimeException: No such namespace: ImagePainter$BlendMode |
| 10:45 | `cbp | noncom: well you need to import ImagePainter |
| 10:46 | noncom | i did.. |
| 10:46 | ystael | sdegutis: alternatively, note the usage of 'use' as opposed to 'get right' :) |
| 10:46 | locks | "Be aware Garden makes no attempt to validate your declarations and will not raise an error if other key types are used." |
| 10:46 | Anderkent | AeroNotix: cloverage should work without having to AOT stuff; I think there was a bug related to order of ns loading that stopped that but it shold be fixed in the latest snapshot |
| 10:46 | locks | this sounds like a bug. |
| 10:46 | AeroNotix | Anderkent: lemme check on the snapshot, then |
| 10:46 | `cbp | noncom: import ImagePainter$BlendMode too |
| 10:46 | noncom | oh maybe.. |
| 10:46 | AeroNotix | Anderkent: 1.0.4-SNAPSHOT? |
| 10:47 | Anderkent | yeah |
| 10:47 | AeroNotix | it's not on clojars |
| 10:47 | Anderkent | huh. lemme check |
| 10:48 | Anderkent | AeroNotix: works for me, do you have the clojars snapshot repo enabled? |
| 10:48 | sdegutis | I've tried writing DSLs before in Ruby and it just felt icky. |
| 10:48 | AeroNotix | Anderkent: ah, not the snapshot repo. |
| 10:49 | sdegutis | In Clojure they usually use data that you analyze, rather than redefining functions, so it feels much cleaner. |
| 10:49 | Anderkent | TBH it works for me with no lein profile / default new repo |
| 10:49 | AeroNotix | Anderkent: wut |
| 10:49 | AeroNotix | Anderkent: :plugins [[lein-ring "0.8.5"] |
| 10:49 | AeroNotix | [lein-localrepo "0.4.0"] |
| 10:49 | AeroNotix | [lein-cloverage "1.0.4-SNAPSHOT"] |
| 10:49 | Anderkent | maybe just try nuking ~/.m2/repository/cloverage, it might be caching |
| 10:49 | AeroNotix | ok |
| 10:49 | Anderkent | oh nono |
| 10:49 | sdegutis | Oops wrong channel. |
| 10:49 | gtrak | cemerick: pong |
| 10:49 | Anderkent | just run CLOVERAGE-VERSION=1.0.4-SNAPSHOT lein cloverage, with the 1.0.2 plugin version |
| 10:50 | AeroNotix | Anderkent: why didn't you say :) |
| 10:50 | cemerick | gtrak: I have CLJS completions! :-) |
| 10:50 | noncom | `cbp: importing the BlendMode too worked! now my original way of ImagePainter$BlendMode/SET works) |
| 10:50 | gtrak | yay! |
| 10:50 | Anderkent | the lib and plugin arent in sync |
| 10:50 | cemerick | gtrak: couple of dumb questions |
| 10:50 | gtrak | does it work in browser repl? haven't tried it. |
| 10:50 | cemerick | gtrak: Yup; no reason why it shouldn't. I was going to say, just run austin in your demos. I wince anytime I see Rhino spinning up for 10s when someone starts a piggieback REPL. :-) |
| 10:51 | cemerick | gtrak: first, I have no completions in buffers, only in the REPL. Expected? |
| 10:51 | gtrak | ah, I don't know how to actually use clojurescript, just how to hack the compiler. |
| 10:51 | gtrak | :-) |
| 10:51 | gtrak | I get completions in buffers, but it's C-Tab. |
| 10:51 | gtrak | M-x completion-at-point is the corresponding function. |
| 10:52 | gtrak | you should also be running a melpa cider to test this. |
| 10:52 | cemerick | gtrak: OK, I'll give that a try. I'm using ~cider HEAD, so should be close enough. |
| 10:52 | gtrak | yea, cider head should work. |
| 10:52 | gtrak | that's what I'm using. |
| 10:53 | cemerick | I guess my other Q is related, the first tab keystroke indents the REPL prompt by ~30 chars, the second does the actual completion. |
| 10:53 | AeroNotix | Anderkent: removing :aot and running it like that works. But I'm away from the computer which is causing the weird classpath error. |
| 10:53 | cemerick | I'm trying as hard as possible to not actually learn how to use emacs. :-P |
| 10:53 | AeroNotix | Anderkent: can you do a release onto clojars of 1.0.4? |
| 10:53 | gtrak | cemerick: oh, that's weird. Mine doesn't do that. |
| 10:53 | AeroNotix | Anderkent: I would like to be able to use it on my continuous integration server / colleagues computers. |
| 10:53 | gtrak | I am also trying not to use emacs, that's why I want nrepl ops to exist. |
| 10:53 | `cbp | noncom: nice |
| 10:54 | Anderkent | AeroNotix: eventually, yes. :P Probably not any time soon (<2 weeks), busyish. |
| 10:54 | AeroNotix | Anderkent: but it takes like 5 minutes to do a clojars deploy :) |
| 10:54 | Anderkent | AeroNotix: can't you run the same command there? |
| 10:56 | CookedGr1phon | How do I make javascript objects from clojure maps in current clojurescript? |
| 10:56 | cemerick | gtrak: A minor thing. Finally, I'm seeing all sorts of spurious completions in e.g. core.async, like async/->t15711; I assume those are factory fns from macro-generated records or something, but it'd be nice if such things could be filtered out somehow... |
| 10:56 | CookedGr1phon | and is there a handy cheatsheet somewhere to avoid me having to ask really basic sounding questions? |
| 10:57 | cemerick | i.e. I get dozens of them when attempting to complete async/ |
| 10:57 | gtrak | cemerick: yea, I'm not doing any filterings, lemme glance at it. |
| 10:57 | gtrak | I have a placeholder to filter public vars, that might help a bit. |
| 10:57 | cemerick | gtrak: it may be that it's not something that can be reasonably controlled, given the scale of the macrology in that lib |
| 10:57 | gtrak | just glancing at the actual data |
| 10:59 | Anderkent | AeroNotix: non-snapshot versions are serious bsns :P |
| 10:59 | AeroNotix | Anderkent: wouldn't I have to build cloverage on the other machines? |
| 10:59 | AeroNotix | Anderkent: ? |
| 11:00 | Anderkent | AeroNotix: no, it should fetch the snapshot from clojars; the building is only needed for unpublished changesets |
| 11:00 | `cbp | what's the syntax for google |
| 11:00 | `cbp | ah feck it https://github.com/readevalprintlove/clojurescript-cheatsheet |
| 11:00 | gtrak | cemerick: so, for t10554 there's a ':type true' flag, and for unmix-all there's a ':fn-var true' |
| 11:00 | AeroNotix | Anderkent: huh? |
| 11:00 | AeroNotix | Anderkent: ohhh ok |
| 11:00 | AeroNotix | nice |
| 11:00 | AeroNotix | lemme try this |
| 11:01 | gtrak | and a corresponding constructor function, I don't see anyway to filter that out. |
| 11:01 | gtrak | any way* |
| 11:02 | gtrak | I want to autocomplete types as well. |
| 11:02 | cemerick | sure |
| 11:05 | gtrak | cemerick: https://gist.github.com/gtrak/9211851 |
| 11:06 | gtrak | lemme fix up the formatting a bit |
| 11:07 | gtrak | fixed |
| 11:08 | pbostrom | CookedGr1phon: #js {:param1 "value" :param2 "value"} is how you make a javascript literal object; I think this got documented in the release notes for a cljs release a few months ago, not sure there is a handy cheatsheet anywhere |
| 11:12 | sdegutis | Wow, ClojureScript is simple yet powerful. |
| 11:13 | gtrak | sdegutis: behold lisp |
| 11:14 | sdegutis | Yes, Lisp is simple, but powerful. |
| 11:14 | devn | unfortunate but true: I have to deal with some keywords like :r/w/f |
| 11:15 | devn | ,(name :r/w/f) |
| 11:15 | clojurebot | "w/f" |
| 11:15 | devn | *facepalm* |
| 11:15 | perplexa | lisp = lots'a insignificant stupid parentheses |
| 11:15 | perplexa | ;x |
| 11:15 | gtrak | cemerick: if there's a better way to identify those gensyms than t-number, it would be easy to run a regex, sounds like a CLJS patch. |
| 11:17 | Anderkent | ,(name ::1) |
| 11:17 | clojurebot | "1" |
| 11:17 | Anderkent | ,::1 |
| 11:17 | clojurebot | :sandbox/1 |
| 11:17 | Anderkent | ,:sandbox/1 |
| 11:17 | clojurebot | #<RuntimeException java.lang.RuntimeException: Invalid token: :sandbox/1> |
| 11:17 | Anderkent | cure |
| 11:17 | Anderkent | *cute |
| 11:17 | cemerick | gtrak: Maybe. I'd have to sink into it a bit before wanting to suggest anything. |
| 11:18 | sdegutis | ,(->> (range) (remove odd?) (take 10)) |
| 11:18 | clojurebot | (0 2 4 6 8 ...) |
| 11:18 | sdegutis | Wow, so simple, yet so powerful. |
| 11:18 | sdegutis | I bet there's nothing like that line of code in Haskell. |
| 11:20 | CookedGr1phon | pbostrom: perfect, thanks |
| 11:21 | CookedGr1phon | pbostrom: is that any different to (js-obj {...})? because js-obj would seem to play better with paredit... |
| 11:26 | sdegutis | Yeah paredit doesn't really play well with tagged literals. |
| 11:27 | sdegutis | When all you have is s-expressions, that's where paredit shines. It's so simple, yet so powerful. |
| 11:29 | devth | possible to set metadata on a local in a let binding? |
| 11:31 | llasram | sdegutis: ? I've found paredit to work fine w/ tagged literals. The tag is just another symbol as far as paredit is concerned |
| 11:31 | teslanick | What is js-obj? is that what the tagged literal points at? |
| 11:31 | teslanick | I've been using clj->js |
| 11:31 | sdegutis | llasram: Yeah but ideally a tagged literally is really a single thing represented by two symbols. But paredit treats them separately. |
| 11:32 | CookedGr1phon | llasram: yeah, it doesn't break, but it takes away the strictness of paredit so you could end up with a floating literal tag which doesn't pertain to anything |
| 11:32 | llasram | Hmmm. Good point. And it'd be pretty Clojure-specific to handle that case |
| 11:39 | sdegutis | Right, exactly. I want a Clojure-specific paredit. |
| 11:40 | sdegutis | I wrote most of one in C last year. It was not pleasant. |
| 11:40 | sdegutis | Tried to rewrite it in Julia, not much more pleasant. |
| 11:47 | llasram | Handling tagged literals as an atomic thing seems like a pain. On every operation you'd need to read back one expression to see if the previous item is a tag |
| 11:49 | CookedGr1phon | tagged literals are a bit ugly all round imo, what would have been wrong with (#inst "....") and (#js ...) |
| 11:49 | CookedGr1phon | keep it lispy |
| 11:50 | `cbp | I'm not sure that improves it at all |
| 11:50 | CookedGr1phon | #inst is a function, just one which we know we can serialise |
| 11:51 | `cbp | (map #inst strs) ; lol |
| 11:52 | technomancy | wouldn't removing the space fix the paredit issue? |
| 12:01 | sdegutis | Yes! |
| 12:02 | sdegutis | But you can't do that for tags where the following form is a symbol. |
| 12:02 | technomancy | yeah |
| 12:02 | sdegutis | Granted, I don't know of any such tags. It's either a string or number or list. |
| 12:02 | technomancy | it's not really a paredit issue, it's a consistency issue |
| 12:02 | technomancy | where else do you have an object that reads as a single thing that has a space in it without delimiters? |
| 12:04 | sdegutis | Oh! I know, I know!! PERL6! |
| 12:04 | technomancy | I heard perl6 was going to be simple, yet powerful. |
| 12:04 | technomancy | (did I do that right?) |
| 12:04 | sdegutis | Aw dang, I should have said "pick me!" instead of "PERL6" and waited until I was called on to reply with "PERL6" for optimal humor-effectiveness. |
| 12:05 | sdegutis | technomancy: you're already a pro at it |
| 12:06 | devn | lol, the perl6 jokes never end |
| 12:07 | devn | "Camelia, the Perl 6 bug" |
| 12:07 | devn | leave the door wide open |
| 12:08 | mpenet | cool anonymous fn can have multiple arities too! |
| 12:08 | mpenet | ,(def a (fn ([a] a ) ([a b] [a b]))) |
| 12:08 | clojurebot | #'sandbox/a |
| 12:08 | mpenet | ,(a 1) |
| 12:08 | clojurebot | 1 |
| 12:08 | mpenet | ,(a 1 2) |
| 12:08 | clojurebot | [1 2] |
| 12:08 | devn | they can have names too |
| 12:08 | mpenet | a bit useless here but I never thought of this one |
| 12:09 | sdegutis | devn: beat me to it |
| 12:09 | mpenet | I knew about the name, but the arity thing escaped me |
| 12:09 | sdegutis | ,((fn foo [x] (foo x)) 3) |
| 12:09 | clojurebot | #<StackOverflowError java.lang.StackOverflowError> |
| 12:09 | devn | ,(fn hi [x] (if (= x "dude") "hi dude!" (hi "dude"))) |
| 12:09 | clojurebot | #<sandbox$eval122$hi__123 sandbox$eval122$hi__123@ca5978> |
| 12:09 | gtrak | names aren't useless, means the function can pass itself around, like 'this' |
| 12:09 | devn | ,(hi "man") |
| 12:09 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: hi in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 12:09 | devn | oh right |
| 12:09 | sdegutis | mpenet: yep, Clojure's defn etc are macros around fn as far as I know. |
| 12:09 | devn | ,((fn hi [x] (if (= x "dude") "hi dude!" (hi "dude")))) |
| 12:09 | clojurebot | #<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: sandbox/eval171/hi--172> |
| 12:09 | devn | ,((fn hi [x] (if (= x "dude") "hi dude!" (hi "dude"))) "man") |
| 12:09 | sdegutis | mpenet: this technique is so simple, yet so powerful. |
| 12:09 | clojurebot | "hi dude!" |
| 12:10 | mpenet | indeed |
| 12:11 | mping_ | hi |
| 12:14 | sdegutis | wow, clojurebot is so enthusiastic |
| 12:16 | dnolen_ | seangrove: sounds like sfcljs meetup last night was a success? |
| 12:17 | seangrove | dnolen_: Yeah, attendence was twice what we expecte (> 40 people), Pete's talk was great, and I don't know if jaws dropped, but people were pretty impressed by Om |
| 12:17 | dnolen_ | seangrove: haha, sweet :) |
| 12:18 | seangrove | I got to one-up Pete a few times - the modules they're thinking about releasing, we just get for free with a good design in cljs |
| 12:18 | dnolen_ | seangrove: nice |
| 12:21 | upwardindex | Anyone remember the name of the library that keeps a long lived shell open to improve performance of shelling out (clojure.java.sh) ? |
| 12:22 | seangrove | dnolen_: Omchaya got quite a bit of attention as well, excited about it becoming a good (or the good) reference Om app |
| 12:23 | dnolen_ | seangrove: sorry I didn't get a chance to give you much feedback but I did give a look yesterday. It's a sizeable app definitely gives a good picture what a non-trivial Om app might look like. |
| 12:24 | locks | seangrove: omchaya? |
| 12:25 | clgv | when I use a (definterface MyIfc ...) I get NoClassDefFoundError for a deftype declaration using that interface when evaluating the namespace in the repl. what is wrong here? |
| 12:26 | seangrove | dnolen_: No worries, I just don't want bad habits to start showing up in there. There are some challenges dealing with Om app, and I want people to be able to think "Oh, how did they solve that, let me go check.." |
| 12:26 | seangrove | locks: https://github.com/sgrove/omchaya |
| 12:27 | locks | seangrove: cheers |
| 12:27 | dnolen_ | seangrove: yep, too early to tell what best practices are precisely but omchaya is definitely a great reference point |
| 13:09 | seangrove | Put my Om presentation up http://sgrove.github.io/omchaya/docs/presentation.html |
| 13:10 | seangrove | dnolen_: Would appreciate any feedback about any lies in there so I don't spread it too much :) |
| 13:10 | loliveira_ | Does somebody know hew I can't see the log4j's console output in LightTable's console? |