#clojure logs

2014-02-25

00:05escherize,(+ 3 4)
00:05clojurebot7
00:22TravisDOut of curiosity, why is the IRC network graph a tree? Seems like the network should have redundancy
00:53pcnDunno.
00:54pcnBut usually even if you have redundancy, you treat the current reachable nodes as a DAG to prevent cycles
01:21nopromptdnolen_: if you're around i wanted to get your thoughts on some architecture around om and routing.
01:31quizdrif 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:32nopromptwhat?
01:32clojurebotwhat is seq
01:33pcnhow?
01:33clojurebotwith style and grace
01:33pcntell me something good?
01:34nopromptquizdr: are you asking if you can generate a list with loop/recur inside the body of a macro?
01:36pcnDoes anyone know if there's a way with lamina.core/receive-all to say... well... not all, but say, 1023?
01:36pcnat a time?
01:36pcnOr 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:36quizdrnoprompt actually i guess you could have a "do" prior to the "loop" and then close the "do" parenthesis after the loop
01:38nopromptquizdr: or just (cons 'do (list-of-stuff...))
01:39quizdrword.
02:02noprompttoday's lesson: don't swap!, reset! or bang fucking anything inside a go block. ever.
02:03nopromptand by "anything ever" i mean only when you know what you're doing.
02:03noprompthaha.
02:04abpnoprompt: what happened? :)
02:04nopromptabp: we had some code that was manipulating a piece of global state inside a go block making it really hard to test.
02:05nopromptabp: actually a few go blocks.
02:05nopromptabp: the solution was to just pull the state change out and have the go blocks return the next state.
02:05nopromptabp: now all the parts can be extracted and tested.
02:06abpnoprompt: ah, isn't that more like problems with scattered state manipulation and insufficient testing tools
02:06nopromptabp: definitely. but doing that in a go block definitely ampflifies that.
02:06abpnoprompt: right, sounds about how to program clojure, but good to hear it pays again. ;P
02:07nopromptabp: the funny thing is, i'm sure it started off as "we'll just do this now and later we'll refactor it"
02:07nopromptabp: "later" ended up being weeks later and then we were like "omg, this is a monster"
02:07nopromptabp: fortunately, one of the nice things about clojure is that it's not hard to fix.
02:08noprompttook about 20mins once i figured out the problem.
02:08abpnoprompt: yep, changing clojure code bases of a few thousand lines is totally trivial.
02:08abpnoprompt: love it when new requirements arive and have to change like ten lines
02:09abpnoprompt: seems like it could even make "temporary hacks" viable
02:10nopromptabp: well the codebase is only around 1200 lines and this part probably only a hundred.
02:10nopromptabp: still it was a nasty little knot we managed to make.
02:10nopromptabp: haha no kidding.
02:12abpnoprompt: 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:12abp*how often i
02:12nopromptabp: singleton state is good though for clojure programs imho.
02:12sm0ke_,[#inst]
02:13clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: ]>
02:13sm0ke_how do i use tagged literals?
02:13nopromptabp: better to have a single container for your state then a whole bunch of little stateful boxes.
02:13abpnoprompt: yeah but only when applying centralized and decoupled mutation vs unrestrained
02:13abpnoprompt: that's for sure
02:14nopromptabp: god, just look at a ruby test suite... "we gotta setup the world! half of this test is line noise!"
02:14abpnoprompt: that's where my metaphor breaks ;)
02:15abpnoprompt: yeah it's mocking the tests *and* you :)
02:16abpnoprompt: but i never wrote any ruby, just java, c++ and the likes
02:16nopromptabp: well i can't speak to those languages but i can't imagine it's any better.
02:17nopromptabp: i guess it all depends on your design right? if the code is bad the tests are probably bad too.
02:20SegFaultAXRandom JAX-RS question if anyone happens to know: can a resource returned by a sub-resource locator contain additional @Path directives?
02:20amalloypcn: (receive-all (take* 1023 ch) f)?
02:20SegFaultAXI'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:24SegFaultAXOh they totally do. Sweet.
02:25abpnoprompt: 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:25nopromptabp: i'm just happy i get to write it 90% of the time for a living.
02:34abpnoprompt: for me it's more like 50% but increasing. :) mostly legacy maintenance besides
03:04quizdris there a way to see the full expansion of all macros in a form, including subforms, as they are seen by the compiler?
03:06ambrosebsquizdr: 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:06quizdrthanks
03:08ambrosebsquizdr: note that the form is implicitly evaluated.
03:08amalloyambrosebs: how does c.j.t.a/macroexpand compare to clojure.tools.macro/mexpand-all?
03:09amalloyaside from implicitly evaluating, which seems pretty terrible to me
03:09quizdrthis 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:10ambrosebsquizdr: I only recommended it because you wanted "as seen by the compiler".
03:10quizdri'll play with it, thanks
03:11amalloyquizdr: like i said, clojure.tools.macro/mexpand-all
03:11ambrosebsamalloy: I assume mexpand-all just expands macros?
03:11amalloyambrosebs: yeah
03:11ambrosebsamalloy: that's probably exactly what quizdr wants.
03:11quizdramalloy sorry i missed that message of yours
03:12ambrosebsamalloy: j.t.a does the whole shebang.
03:12amalloyquizdr: you're forgiven, since i addressed it to ambrosebs
03:14ambrosebsj.t.a expands other things like :inline metadata
03:14quizdramalloy forgive me again, but how do I access it? I'm trying (require ['clojure.tools.macro :as mm] )
03:14ambrosebsshould just be used for static analysis
03:14amalloyquizdr: it's a library. you have to depend on it
03:14quizdrah
03:15quizdri guess that will be my project tomorrow.
03:16ambrosebsfwiw you can also disable implicit evaluation in j.t.a.
03:17ambrosebsit's on by default for side effects like `ns` and `def`.
03:17ambrosebsotherwise the analyzer leaves your code in a weird state.
03:18ambrosebstools.analyzer.* has similar caveats.
03:19amalloyah, if you can disable it that's fine, and reasonable given that you'll want to run it on a whole ns
03:19ambrosebsbut there's no implicit evaluation in t.a.
03:19amalloyfor a macroexpander it seemed crazy, since you expand one form
03:19ambrosebsamalloy: Yes, it's a whole trip and back around again just to expand a macro :P
03:19amalloythe readme makes it sound like a flaw in the approach that they haven't worked out a solution for yet
03:20ambrosebsamalloy: well if you know what you're doing, you're free to disable it.
03:20ambrosebsamalloy: I don't know all the implications of not evaluating the ast TBH.
03:22ambrosebsamalloy: again, I'd only recommend j.t.a if you *really* want to know what Compiler.java is giving you :)
03:22ambrosebsan excellent tool for that.
03:23amalloyyep. thanks for clarifying
03:38ggherdovhi folks, congrats for being accepted at GSoC
03:41ambrosebsyay!
03:42ggherdovhehe
04:13sm0keany elegant solution to dispatch on string conforming to a particular format, like abc$xyz:[optional].(madatorypart)
04:16sm0kealthough regex can be used
04:20BartAdvhey there, any lein-droiders here? I'm asking if anyone tried LightTable with it, or is it *just* impossible at the moment?
04:21ddellacostasm0ke: you can do that with a multimethod
04:22ddellacostasm0ke: not sure what you meant by elegant otherwise
04:26sm0keddellacosta: well there can be a dsl in which i can write exactly what i wrote above
04:27sm0keddellacosta: which will capture all the [] () parts in the variable name inside them
04:27edbondsm0ke, use regexp + core.match
04:28sm0kecore.match is no good that a multimethod
04:28sm0kethe problem is with regex and group capturing
04:28sm0keits work.
04:29sm0keits a nice idea for a library though
04:30sverihi, 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:30sm0kewith a macro like (let-match [#super/reg abc$xyz:[optional].(madatorypart) str] )
04:30sm0kenow inside the let-match i have bindings for optional and madatorypart
04:30sm0keif they match!
04:33sm0kemore like (let-match [#super/reg abc$xyz[:#optional].(#madatorypart) str] )
04:33sm0kewhere all #... are variable to be binded
04:35sm0keblah i will use a regex i guess
04:35ddellacostasm0ke: seems like you'd be better off writing something w/instaparse
04:36sm0keddellacosta: actually a macro and data_readers.clj converting it to a regex should be enough
04:36edbondinstaparse may be slow, if regexp is very simple and there is no special cases I would use regexp
04:37ddellacostasm0ke, 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:41ddellacostawth 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:42ddellacostahas this changed?
04:42ddellacostaI realized it works quite differently in ClojureScript
04:44sm0keddellacosta: i did that few weeks back, key is the import
04:44sm0keseems to work
04:45ddellacostasm0ke: seriously? I just keep getting "Exception in thread "main" java.lang.ClassNotFoundException: my.name.space.MyType, compiling:(core.clj:1:1)"
04:45sm0keddellacosta: hurm. weird. what about wen you out the ns in :aot?
04:45sm0keput*
04:47ddellacostasm0ke: 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:47sverihm, it seems like i cannot execute for statements in midjes facts in general, someone used midje here already?
04:48ddellacostasveri: 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:48sm0keddellacosta: a protocol is prefixed by the current ns
04:48ddellacostasm0ke: 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:48ddellacostasm0ke: I don't know what you mean by that
04:48ddellacostasm0ke: I'm talking about a type
04:49sm0keddellacosta: sorry i mean Record
04:49sm0keshouldbe the same for Type i guess
04:49sveriddellacosta: 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:49sm0ke,(defrecord Some (foo [this]))
04:49clojurebot#<AssertionError java.lang.AssertionError: No fields vector given.>
04:50sm0ke,(defprotocol Some (foo [this]))
04:50clojurebotSome
04:50sm0ke,(deftype Sometype [x] Some (foo [this] x))
04:50clojurebotsandbox.Sometype
04:50sm0kesee
04:50sm0kesandbox is the namespace
04:50ddellacostasm0ke: I understand all of that
04:50sm0ke,(import 'sanbox.Sometype)
04:50clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: sanbox.Sometype>
04:51ddellacostasm0ke: but it's not helping me load one namespace's type in another
04:51sm0keeh
04:51sm0keddellacosta: do you have - ?
04:51ddellacostasveri: in front of for. (doall (for [...] ...))
04:51sm0keimport would require to change it to _
04:52ddellacostasm0ke: where? What does that have to do with it?
04:52sm0keanywhere in ns, its typically what peopple do..my-namespace
04:52ddellacostasm0ke: and...?
04:53sveriddellacosta: thank you, it works now in a different setup, seems like i have two problems, however, thank you very much
04:53sm0kesome for import it needs to be changed to (:import my_namesapce.MyType)
04:53sm0keso*
04:53sm0kewth
04:53ddellacostasm0ke: ah, okay, that could be an issue, thanks
04:54ddellacostasveri: great, glad to hear it
04:55ddellacostasm0ke: I could hug you, that did it, thanks!
04:56sm0ke:P
04:56ddellacostadidn't know about underscores in import...only thought it was applicable for directory naming.
04:57sm0keimport translates to java directly i guess, and java doesnt like - in name resolution
04:57ddellacostasm0ke: yeah, good to know...will make a note of that.
04:58sm0keclojure handles a lot of crap in function naming etc, i have seen names like func! converted to funcBANG or something like that
04:58sm0kelegacy.
04:59ddellacostasm0ke: 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:00ddellacostawhat 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:00ddellacostasince they are supposed to be java-independent features
05:00ddellacostabut I suppose there must be some legacy reasons for that
05:01sm0kei would like to try clojurescript sometime
05:01ddellacostasm0ke: it's easy to try, you should! Just use dnolen's mies template to get going, it's super quick
05:01ddellacostasm0ke: lein new mies <project-name>
05:02sm0keyea, my perception is that clojurescript is really superior like ahead of time, compared to traditional javascript based front end development
05:02ddellacostaI've really grown to love ClojureScript. Especially with Om, sablono and core.async, it's just magical
05:03ddellacostasm0ke: 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:03ddellacostasm0ke: or really, anything not CLJS if it was front-end
05:03ddellacostaunless it was something like fay or elm perhaps
05:04sm0kenice
05:05sm0kehmm i hear a lot about om, need to check it out sometime, although hoplon also looks interesting
05:06ddellacostasm0ke: yeah, been meaning to check out hoplon but Om fits our development to-a-T right now, so been putting it off
05:06ddellacostasm0ke: 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:07sm0keso i hear
05:11ddellacostawow, so you also have to require the namespace *before* you import the type? Lame...
05:12sm0keis it?
05:12sm0ketry without it?
05:12sm0kei dont think thats required
05:13ddellacostasm0ke: hmm, I dunno, I moved the import to the top and it barfed, couldn't find it
05:13ddellacostabut then moving it back to the bottom resolved it
09:07loliveiraAny LightTable user in? I can't see log4j's console output. Any ideas?
09:44sverihi, when i want to insert some data into a unique attribute datomic, what does transact return if that attribute exists already?
09:44AeroNotixdudes
09:45AeroNotixI 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:45AeroNotixI want to use clojure.tools.logging in it. But when I do, I occasionally get a ClassNotFoundException
09:46mdrogalissveri: Pretty sure it throws an exception back.
09:47sverimdrogalis: ok, thank you, I will try that out
10:14AeroNotixany ideas?
10:16ToBeReplacedAeroNotix: there's not enough information there -- i think you just gotta step through it
10:17AeroNotixToBeReplaced: 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:18ToBeReplaced`lein do clean run` fails too?
10:19ToBeReplacedto me it sounds like a macro issue, like you're missing an unquote somewhere which works without the AoT but fails with it
10:20AeroNotixhmm
10:20AeroNotixToBeReplaced: https://gist.github.com/AeroNotix/9210902
10:21AeroNotixspecifically log-stack-trace uses clojure.tools.logging/warn
10:21AeroNotixwhich fails.
10:27ToBeReplacedman that's brutal -- you have log-stack-trace in another gist?
10:29ddellacostaAeroNotix: my boss who uses Intellij/Cursive had a really similar issue today...any chance you're using it too?
10:30ddellacostahe had to wipe out his config to get it working again, it had cached some stuff apparently.
10:31noncomhi, 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`cbpMaybe (ImagePainter$BlendMode/valueOf "SET")
10:34AeroNotixddellacosta: noppe
10:34AeroNotixToBeReplaced: it's trivial, it literally just builds the stack trace and sends it to warn
10:35sdegutisDoes writing a CSS parser in Clojure sound fun?
10:35AeroNotixToBeReplaced: https://gist.github.com/AeroNotix/f539482fa8b27db8794c5
10:35`cbpnothing with css is fun
10:35AeroNotixbut I dount it'll help much
10:35lockssdegutis: sure.
10:36sdegutisI want to automatically convert our .css files to .clj files.
10:36lockswhat, why
10:36sdegutishttps://github.com/noprompt/garden
10:36sdegutisFor that.
10:37locksyou want to convert your css files to clj to convert them to css?
10:37CookedGr1phonsdegutis: surely just leave the legacy css, write new stuff in garden to override it
10:37CookedGr1phonand then when you don't need any of the legacy stuff any more, delete it
10:38ToBeReplacedAeroNotix: second gist not working. i don't see your issue though -- good luck.
10:38AeroNotixToBeReplaced: what do you mean "not working"?
10:38`cbpA CSS parser should be pretty easy with instaparse. Yes?
10:38ToBeReplacedlink is broken
10:38AeroNotixToBeReplaced: https://gist.github.com/AeroNotix/f539482fa8b27db8794c5
10:38katoxcemerick: 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:38AeroNotixhuh wtf
10:39AeroNotixToBeReplaced: https://gist.github.com/AeroNotix/f539482f8b27db8794c5
10:39ToBeReplacedi'm getting 404 on that
10:39AeroNotixthe macro file is in the project's :aot vector
10:40sdegutis`cbp: oooh yes, maybe
10:41sdegutislocks: precisely!
10:41sdegutisOn Instaparse's readme: "What if context-free grammars were as easy to use as regular expressions?"
10:42sdegutisKey word there being the first "as".
10:42ToBeReplacedAeroNotix: is it possible to have a file that's being aot'd depend on a file that isn't?
10:42AeroNotixHmmm, dunno
10:44ToBeReplacedAeroNotix: what happens when you add tools.logging to the macro file?
10:44AeroNotixToBeReplaced: same deal
10:45noncom`cbp: it says CompilerException java.lang.RuntimeException: No such namespace: ImagePainter$BlendMode
10:45`cbpnoncom: well you need to import ImagePainter
10:46noncomi did..
10:46ystaelsdegutis: alternatively, note the usage of 'use' as opposed to 'get right' :)
10:46locks"Be aware Garden makes no attempt to validate your declarations and will not raise an error if other key types are used."
10:46AnderkentAeroNotix: 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:46locksthis sounds like a bug.
10:46AeroNotixAnderkent: lemme check on the snapshot, then
10:46`cbpnoncom: import ImagePainter$BlendMode too
10:46noncomoh maybe..
10:46AeroNotixAnderkent: 1.0.4-SNAPSHOT?
10:47Anderkentyeah
10:47AeroNotixit's not on clojars
10:47Anderkenthuh. lemme check
10:48AnderkentAeroNotix: works for me, do you have the clojars snapshot repo enabled?
10:48sdegutisI've tried writing DSLs before in Ruby and it just felt icky.
10:48AeroNotixAnderkent: ah, not the snapshot repo.
10:49sdegutisIn Clojure they usually use data that you analyze, rather than redefining functions, so it feels much cleaner.
10:49AnderkentTBH it works for me with no lein profile / default new repo
10:49AeroNotixAnderkent: wut
10:49AeroNotixAnderkent: :plugins [[lein-ring "0.8.5"]
10:49AeroNotix [lein-localrepo "0.4.0"]
10:49AeroNotix [lein-cloverage "1.0.4-SNAPSHOT"]
10:49Anderkentmaybe just try nuking ~/.m2/repository/cloverage, it might be caching
10:49AeroNotixok
10:49Anderkentoh nono
10:49sdegutisOops wrong channel.
10:49gtrakcemerick: pong
10:49Anderkentjust run CLOVERAGE-VERSION=1.0.4-SNAPSHOT lein cloverage, with the 1.0.2 plugin version
10:50AeroNotixAnderkent: why didn't you say :)
10:50cemerickgtrak: I have CLJS completions! :-)
10:50noncom`cbp: importing the BlendMode too worked! now my original way of ImagePainter$BlendMode/SET works)
10:50gtrakyay!
10:50Anderkentthe lib and plugin arent in sync
10:50cemerickgtrak: couple of dumb questions
10:50gtrakdoes it work in browser repl? haven't tried it.
10:50cemerickgtrak: 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:51cemerickgtrak: first, I have no completions in buffers, only in the REPL. Expected?
10:51gtrakah, I don't know how to actually use clojurescript, just how to hack the compiler.
10:51gtrak:-)
10:51gtrakI get completions in buffers, but it's C-Tab.
10:51gtrakM-x completion-at-point is the corresponding function.
10:52gtrakyou should also be running a melpa cider to test this.
10:52cemerickgtrak: OK, I'll give that a try. I'm using ~cider HEAD, so should be close enough.
10:52gtrakyea, cider head should work.
10:52gtrakthat's what I'm using.
10:53cemerickI guess my other Q is related, the first tab keystroke indents the REPL prompt by ~30 chars, the second does the actual completion.
10:53AeroNotixAnderkent: removing :aot and running it like that works. But I'm away from the computer which is causing the weird classpath error.
10:53cemerickI'm trying as hard as possible to not actually learn how to use emacs. :-P
10:53AeroNotixAnderkent: can you do a release onto clojars of 1.0.4?
10:53gtrakcemerick: oh, that's weird. Mine doesn't do that.
10:53AeroNotixAnderkent: I would like to be able to use it on my continuous integration server / colleagues computers.
10:53gtrakI am also trying not to use emacs, that's why I want nrepl ops to exist.
10:53`cbpnoncom: nice
10:54AnderkentAeroNotix: eventually, yes. :P Probably not any time soon (<2 weeks), busyish.
10:54AeroNotixAnderkent: but it takes like 5 minutes to do a clojars deploy :)
10:54AnderkentAeroNotix: can't you run the same command there?
10:56CookedGr1phonHow do I make javascript objects from clojure maps in current clojurescript?
10:56cemerickgtrak: 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:56CookedGr1phonand is there a handy cheatsheet somewhere to avoid me having to ask really basic sounding questions?
10:57cemericki.e. I get dozens of them when attempting to complete async/
10:57gtrakcemerick: yea, I'm not doing any filterings, lemme glance at it.
10:57gtrakI have a placeholder to filter public vars, that might help a bit.
10:57cemerickgtrak: it may be that it's not something that can be reasonably controlled, given the scale of the macrology in that lib
10:57gtrakjust glancing at the actual data
10:59AnderkentAeroNotix: non-snapshot versions are serious bsns :P
10:59AeroNotixAnderkent: wouldn't I have to build cloverage on the other machines?
10:59AeroNotixAnderkent: ?
11:00AnderkentAeroNotix: no, it should fetch the snapshot from clojars; the building is only needed for unpublished changesets
11:00`cbpwhat's the syntax for google
11:00`cbpah feck it https://github.com/readevalprintlove/clojurescript-cheatsheet
11:00gtrakcemerick: so, for t10554 there's a ':type true' flag, and for unmix-all there's a ':fn-var true'
11:00AeroNotixAnderkent: huh?
11:00AeroNotixAnderkent: ohhh ok
11:00AeroNotixnice
11:00AeroNotixlemme try this
11:01gtrakand a corresponding constructor function, I don't see anyway to filter that out.
11:01gtrakany way*
11:02gtrakI want to autocomplete types as well.
11:02cemericksure
11:05gtrakcemerick: https://gist.github.com/gtrak/9211851
11:06gtraklemme fix up the formatting a bit
11:07gtrakfixed
11:08pbostromCookedGr1phon: #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:12sdegutisWow, ClojureScript is simple yet powerful.
11:13gtraksdegutis: behold lisp
11:14sdegutisYes, Lisp is simple, but powerful.
11:14devnunfortunate but true: I have to deal with some keywords like :r/w/f
11:15devn,(name :r/w/f)
11:15clojurebot"w/f"
11:15devn*facepalm*
11:15perplexalisp = lots'a insignificant stupid parentheses
11:15perplexa;x
11:15gtrakcemerick: 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:17Anderkent,(name ::1)
11:17clojurebot"1"
11:17Anderkent,::1
11:17clojurebot:sandbox/1
11:17Anderkent,:sandbox/1
11:17clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: :sandbox/1>
11:17Anderkentcure
11:17Anderkent*cute
11:17cemerickgtrak: Maybe. I'd have to sink into it a bit before wanting to suggest anything.
11:18sdegutis,(->> (range) (remove odd?) (take 10))
11:18clojurebot(0 2 4 6 8 ...)
11:18sdegutisWow, so simple, yet so powerful.
11:18sdegutisI bet there's nothing like that line of code in Haskell.
11:20CookedGr1phonpbostrom: perfect, thanks
11:21CookedGr1phonpbostrom: is that any different to (js-obj {...})? because js-obj would seem to play better with paredit...
11:26sdegutisYeah paredit doesn't really play well with tagged literals.
11:27sdegutisWhen all you have is s-expressions, that's where paredit shines. It's so simple, yet so powerful.
11:29devthpossible to set metadata on a local in a let binding?
11:31llasramsdegutis: ? I've found paredit to work fine w/ tagged literals. The tag is just another symbol as far as paredit is concerned
11:31teslanickWhat is js-obj? is that what the tagged literal points at?
11:31teslanickI've been using clj->js
11:31sdegutisllasram: Yeah but ideally a tagged literally is really a single thing represented by two symbols. But paredit treats them separately.
11:32CookedGr1phonllasram: 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:32llasramHmmm. Good point. And it'd be pretty Clojure-specific to handle that case
11:39sdegutisRight, exactly. I want a Clojure-specific paredit.
11:40sdegutisI wrote most of one in C last year. It was not pleasant.
11:40sdegutisTried to rewrite it in Julia, not much more pleasant.
11:47llasramHandling 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:49CookedGr1phontagged literals are a bit ugly all round imo, what would have been wrong with (#inst "....") and (#js ...)
11:49CookedGr1phonkeep it lispy
11:50`cbpI'm not sure that improves it at all
11:50CookedGr1phon#inst is a function, just one which we know we can serialise
11:51`cbp(map #inst strs) ; lol
11:52technomancywouldn't removing the space fix the paredit issue?
12:01sdegutisYes!
12:02sdegutisBut you can't do that for tags where the following form is a symbol.
12:02technomancyyeah
12:02sdegutisGranted, I don't know of any such tags. It's either a string or number or list.
12:02technomancyit's not really a paredit issue, it's a consistency issue
12:02technomancywhere else do you have an object that reads as a single thing that has a space in it without delimiters?
12:04sdegutisOh! I know, I know!! PERL6!
12:04technomancyI heard perl6 was going to be simple, yet powerful.
12:04technomancy(did I do that right?)
12:04sdegutisAw 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:05sdegutistechnomancy: you're already a pro at it
12:06devnlol, the perl6 jokes never end
12:07devn"Camelia, the Perl 6 bug"
12:07devnleave the door wide open
12:08mpenetcool anonymous fn can have multiple arities too!
12:08mpenet,(def a (fn ([a] a ) ([a b] [a b])))
12:08clojurebot#'sandbox/a
12:08mpenet,(a 1)
12:08clojurebot1
12:08mpenet,(a 1 2)
12:08clojurebot[1 2]
12:08devnthey can have names too
12:08mpeneta bit useless here but I never thought of this one
12:09sdegutisdevn: beat me to it
12:09mpenetI knew about the name, but the arity thing escaped me
12:09sdegutis,((fn foo [x] (foo x)) 3)
12:09clojurebot#<StackOverflowError java.lang.StackOverflowError>
12:09devn,(fn hi [x] (if (= x "dude") "hi dude!" (hi "dude")))
12:09clojurebot#<sandbox$eval122$hi__123 sandbox$eval122$hi__123@ca5978>
12:09gtraknames aren't useless, means the function can pass itself around, like 'this'
12:09devn,(hi "man")
12:09clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: hi in this context, compiling:(NO_SOURCE_PATH:0:0)>
12:09devnoh right
12:09sdegutismpenet: yep, Clojure's defn etc are macros around fn as far as I know.
12:09devn,((fn hi [x] (if (= x "dude") "hi dude!" (hi "dude"))))
12:09clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: sandbox/eval171/hi--172>
12:09devn,((fn hi [x] (if (= x "dude") "hi dude!" (hi "dude"))) "man")
12:09sdegutismpenet: this technique is so simple, yet so powerful.
12:09clojurebot"hi dude!"
12:10mpenetindeed
12:11mping_hi
12:14sdegutiswow, clojurebot is so enthusiastic
12:16dnolen_seangrove: sounds like sfcljs meetup last night was a success?
12:17seangrovednolen_: 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:17dnolen_seangrove: haha, sweet :)
12:18seangroveI 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:18dnolen_seangrove: nice
12:21upwardindexAnyone remember the name of the library that keeps a long lived shell open to improve performance of shelling out (clojure.java.sh) ?
12:22seangrovednolen_: Omchaya got quite a bit of attention as well, excited about it becoming a good (or the good) reference Om app
12:23dnolen_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:24locksseangrove: omchaya?
12:25clgvwhen 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:26seangrovednolen_: 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:26seangrovelocks: https://github.com/sgrove/omchaya
12:27locksseangrove: cheers
12:27dnolen_seangrove: yep, too early to tell what best practices are precisely but omchaya is definitely a great reference point
13:09seangrovePut my Om presentation up http://sgrove.github.io/omchaya/docs/presentation.html
13:10seangrovednolen_: Would appreciate any feedback about any lies in there so I don't spread it too much :)
13:10loliveira_Does somebody know hew I can't see the log4j's console output in LightTable's console?