#clojure logs

2015-01-05

00:08cfleming$mail hellofunk To reformat a block, select it and Cmd-Option-L. If you don't select it'll reformat the whole file.
00:08lazybotMessage saved.
00:56clojerWith all the brilliance in the Clojure[script] community has any thought been given to implementing a native Clojurescript version of React instead of going through react.js?
01:01clojertavistock: I was thinking of how Clojure[script] might give scope for improving on the ideas behind React.
01:02luxbockclojer: something like this: https://github.com/aaronc/freactive ?
01:03clojertavistock: For example, could virtual dom diff-ing be more efficient in Clojurescript?
01:04clojerluxbock: Thanks. I missed that one.
01:17aaelonyhi, can someone point me to good docs on how to upgrade to that latest cider-nrepl version? I'm getting warnings when I launch that required nREPL ops are not supported...
01:23alexyakushevaaelony: Should be as easy as adding cider-nrepl to your plugins vector in profiles.clj
01:23alexyakushevDid you get no warnings before, but now you do once upgraded?
01:25aaelonyalexyakushev: I've been getting them for some time, but didn't have the opportunity to upgrade and put it off. In the setup I'm refering to, there actually isn't a ~/.lein/profiles.clj yet -- maybe that's the problem...
01:26alexyakushevWell, if you have the dependency for cider-nrepl in the project itself, then it shouldn't matter. Now do you? Will be easier if you pasted your project.clj somewhere
01:28aaelonyIf I recall correctly, I simply installed the latest emacs, hooked up to marmalade, and installed clojure-mode and cider.
01:28aaelonybut I'm open to a cider-nrepl dependency in profiles.clj
01:29aaelonysince I'd prefer to have it available for all clojure projects
01:30aaelonyIt's a bit confusing because if I google for "cider-nrepl" I get a hit for clojure-emacs/cider-nrepl and another hit for clojure-emacs/cider
01:31aaelonylooks like perhaps cider-nrepl is deprecated
01:31luxbockaaelony: https://github.com/clojure-emacs/cider#cider-nrepl-middleware
01:31aaelonyI'll read up on https://github.com/clojure-emacs/cider and cut over
01:31aaelonycool
01:41aaelonyI've got cider running now, but it tells me it's not in sync with cider-nrepl: "WARNING: CIDER's version (0.7.0) does not match cider-nrepl's version (0.8.2)" Where do I upgrade cider-nrepl?
01:41aaelonyor the reverse, lol
01:41aaelonynevermind..
01:41aaelonythx
01:43alexyakushevDid the link luxbock shared solve it for you?
01:45aaelonyalexyakushev: it helped, yes. However, now that it's installed and in sync with cider and cider-nrepl, it's refusing to acknowledge a simple namespace declaration telling me "Namespace not found"
01:46alexyakushevBy simple you mean this namespace of yours doesn't depend upon anything else?
01:47aaelonythe dependency is in the project.clj file. By simple, I mean that there is exactly one.
01:49aaelonye.g. (ns blah.core (:require [clj-vw.core :as vw])) ;; Namespace not found. <-- this worked fine before the cider upgrade
01:49aaelonyproject.clj includes [engagor/clj-vw "1.0.0-RC6"]
01:50alexyakushevDoes it complain about "blah.core" or "clj-vw.core"?
01:50aaelonyhard to tell. it only says "Namespace not found"
01:50alexyakushev:-/ Those Clojure error reporting
01:50aaelonysame for (use 'clj-vw.core)
01:51luxbockaaelony: you can see the stacktrace with C-c C-s
01:51alexyakushev*exceptions
01:51aaelonyluxbock: C-c C-s is undefined
01:52luxbockM-x cider-visit-error-buffer then
01:52aaelony"No *cider-error* buffer"
01:52aaelonysomething is off
01:53aaelonyauto-completion works in repl window though...
01:53aaelony; CIDER 0.8.2 (Java 1.8.0_20, Clojure 1.6.0, nREPL 0.2.6)
01:54alexyakushevDid you launch cider via "cider-jack-in"?
01:54aaelonyI did: C-c M-j
01:55alexyakushevAnd you were in one of your project's files at the time you did it?
01:55aaelonyI was in the core.clj file
01:55aaelonyrelaunching with M-x cider-jack-in
01:56alexyakushevFrom core.clj it should be fine too
01:56aaelonythere may be another mode interfering because I need to M-x clojure-mode first
01:57alexyakushevHm, that should happen automatically
01:57luxbockaaelony: for me it shows cider[namespace-of-file-i-am-in] in my modeline after I've used cider-jack-in
01:58aaelonyFor me, it does not happen automatically. Evaluation of the (ns ..) still leads to "Namespace not found"
02:00aaelonyluxbock: I do see at the bottom of emacs, below the writing area an area with (Clojure cider[blah.core])
02:00aaelonynothing evaluates though. not even (range 10)
02:00luxbockaaelony: maybe you can post your project.clj and profiles.clj file to refheap or somewhere else?
02:01aaelonysure, but it is pretty barren
02:01luxbockthat's good :)
02:01aaelonyhttps://www.refheap.com/95735
02:03luxbockwhat about profiles.clj?
02:03luxbockand what does M-x cider-version tell you?
02:03aaelonyprofiles.clj: {:user {:plugins [[cider/cider-nrepl "0.8.2"]]}}
02:04aaelonyCIDER 0.8.2
02:05aaelonycould there be some mode interfering?
02:06alexyakushevLet's try again. Do "M-x cider-quit", and then just to be sure "killall java" from the shell
02:06aaelonylein repl works fine for the same code, so it's definitely a cider issue
02:06alexyakushevThen do M-x cider-jack-in again
02:07aaelonywhat does killall java do? I wouldn't want to kill all java progams on the box...
02:08alexyakushevHm ok, I just usually don't run any
02:08alexyakushevYou can do "ps aux | grep java" and verify that no of the running java instances refer to Clojure
02:09aaelonyto instances refer to CLojure
02:09alexyakushev?
02:10aaelonyps aux | grep java simply returns the grep command itself
02:10alexyakushevGood
02:11alexyakushevNow repeat "M-x cider-jack-in", ideally from project.clj file
02:11aaelonyok
02:11alexyakushevWere you thrown into REPL buffer?
02:12aaelonyyes
02:12alexyakushevAnd if you type something there it works?
02:12aaelonywith a nice autocomplete functionality
02:12aaelonythe REPL buffer works fine
02:12alexyakushevOK
02:12alexyakushevAnd code buffer still doesn't?
02:12aaelonythe trouble is that opening a source file and evaluation of any code block does not work
02:12aaelonycorrect
02:13alexyakushevLet's check this
02:13alexyakushevDo the following in the code buffer: "F1-k C-x C-e"
02:13alexyakushevAnd say which function this binding points to
02:13rritochIn a leiningen plugin, what is the best method of attaining the compiled classes folder? I'm using (str (:target-path project) "/classes/") but I'm not sure if that will still work if profiles modify the target-path.
02:15aaelonynormally, I evaluate a line with C-x C-e (which currently does not work). Doing F1-k C-x C-e on the ns codeblock opened a window stating "C-x C-e runs the command lisp-eval-last-sexp, which is an interactive compiled Lisp function in `inf-lisp.el'. ..."
02:15Viestihum, seeing this then using ClojureScript 0.0-2665 and simple-brepl 0.1.2 (which uses piggieback "0.1.3"): java.lang.IllegalArgumentException: No single method: _setup of interface: cljs.repl.IJavaScriptEnv found for function: -setup of protocol: IJavaScriptEnv, compiling:(cemerick/piggieback.clj:149:5)
02:15Viestis/then/when
02:16alexyakushevaaelony: that's what I was asking. It means that CIDER haven't properly initialized in code buffers
02:16alexyakushevTry doing "M-x cider-mode"
02:16aaelonyalexyakushev: I believe it. How to remedy?
02:16aaelonyM-x cider-mode: cider-mode enabled
02:17alexyakushevNow try evaluating anything in the buffer
02:17aaelonyno change
02:17aaelony"Namespace not found"
02:17alexyakushevBut "F1-k C-x C-e" now refers to "cider-eval-last-sexp", right?
02:18luxbockViesti: it's probably because of the new CLJS REPL changes, that the third party REPL's haven't adapted yet
02:18luxbockhttps://github.com/clojure/clojurescript/wiki/Custom-REPLs
02:18aaelonyalexyakushev: yes
02:19aaelonyalexyakushev: cider-eval-last-sexp &optional PREFIX)
02:19aaelony(cider-eval-last-sexp &optional PREFIX)
02:20aaelonyalexyakushev: something is still interfering though
02:20Viestiluxbock: yep, piggieback and maybe others need an update
02:20Viestishould look more into it :)
02:21Viestiseems that there is an issue for this already: https://github.com/cemerick/piggieback/issues/35
02:21alexyakushevaaelony: Well, I don't really know what could be the cause. I would try to reinstall CIDER and restart Emacs, slight chance that would help
02:22AWizzArdI just updated cider to 0.8.2 and now cider-connect does no longer automatically pick up the ports. I guess it still should?
02:23alexyakushevaaelony: Have you maybe tried other REPL stuff, like inf-clojure? That might interfere
02:23AWizzArdThe file .nrepl-port is written though.
02:23aaelonyalexyakushev: yes, I agree. What is the best way to reinstall CIDER? M-x package-install [ret] cider [ret] ?
02:23alexyakushevaaelony: That, or maybe remove the package first and then install anew
02:24aaelonyalexyakushev: ok, will try to remove and reinstall.
02:24alexyakushevAWizzArd: Can't say about 0.8.2, but that thing works for me quite intermittently
02:41aaelonyalexyakushev: if I do M-x cider-load-buffer, then things evaluate once again with C-c C-e
02:43patrkrishello people. I've made an uberjar with leiningen, but when I try to run it, I get the following exception:
02:43patrkrisException in thread "main" java.lang.NoClassDefFoundError: camel_snake_kebab/core$__GT_CamelCaseString (wrong name: camel_snake_kebab/core$__GT_camelCaseString)
02:44luxbockaaelony: are you using some kind of a Emacs starter-kit?
02:44patrkrisdoes this mean anything to any of you? for the camel-case-kebab dependency, I have excluded org.clojure/clojure
02:44aaelonyluxbock: I am not.
02:44aaelonyluxbock: but there may be other installed packages that interfere with cider somehow
02:44luxbockyeah so it seems
02:45alexyakushevaaelony: I think you should report this issue on Github, in CIDER's repository
02:46aaelonyalexyakushev: okay, will do
05:34masnunCan anyone here help me with the lazybot?
05:34masnun.help
05:34masnun-> help
05:34masnun,help
05:34clojurebot#<AccessControlException java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>
05:37masnun,list
05:37clojurebot#<AccessControlException java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>
05:42mearnsh,(+ 1 1)
05:42clojurebot#<AccessControlException java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>
05:42mearnshhm
05:42mearnsh&(+ 1 1)
05:42lazybot⇒ 2
05:43luxbock##(println "&(+ 1 1)")
05:43lazybot⇒ &(+ 1 1) nil
05:43masnun,(+ 1 1)
05:43clojurebot#<AccessControlException java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>
05:45mearnshmasnun: what do you want to know? it seems clojurebot (, prefix) is broken right now
05:46masnunmearnsh I was trying to setup lazybot for one of my rooms. I couldn't find out what the command character was
05:46masnunmearnsh just found out it's @
05:47masnunmearnsh configured as "prepend" in the config
05:47mearnshalright yeah, i see it
06:05luxbockis it cleaner to write (comp (partial = 7) :value) vs. #(= (:value %) 7) ?
06:05luxbockI feel like the first looks prettier but might be harder to parse
06:10hellofunkluxbock: it's a matter of taste in this particular example. but the two approaches are not always interchangable.
06:12luxbockI tend to use comp and partial for all the simple cases, but an anonymous function if I'd need to use them three times or more
06:15hellofunkluxbock: partial locks you into requiring the extra args at the end, hence why an anonymous fn is ultimately more flexible for many situations
07:36AWizzArdcore.async + transducers: why the 1 in `(chan 1 (map mouse-loc->vec))`? https://github.com/cognitect/async-webinar/blob/master/src/webinar/core.cljs#L133
07:36AWizzArdAn event gets written into the channel when the mouse moves. There will be one single message in the chan, namely the mousemove event.
07:36AWizzArdmouse-loc->vec extracts the coordinates into a vector. Why does the channel need that extra space for a second object before writing to the chan blocks?
07:54AeroNotixHmm, I can't seem to deploy to clojars. I get a 401. My login works on the clojars page itself. Just `lein deploy clojars` fails.
08:01AeroNotixand it works
08:20zotnot sure whether this belongs more here on #emacs, but will start here. i'm using cider, and working on code that uses threads/agents. from within emacs/cider/repl, is there a way to kill off all of the threads previously spawned, and restart?
08:20CookedGryphonzot: there's shutdown-agents for agents
08:21CookedGryphonand if you start all your threads from a thread pool you could probably shut them down from that
08:22zotCookedGryphon: my memory says that that will leave my repl un-agent-able. i think i just need to add a join bit to his main so that C-c C-c will work; but figured it's good to understand whether i can deal with this gracefully.
08:22CookedGryphonperhaps you should look at using something like component for lifecycle management
08:23CookedGryphonor are you working on a general cider feature?
08:23CookedGryphonif it's your own code, then killing everything is a litte heavy handed and I'd consider trying to capture all the threads/agents you use and shut them down properly
08:24zotthis is just for repl debugging — most of our code now uses component, but i'm mucking with old goo :)
08:25afhammadHow do I get a static html file to reload without restarting repl when using chestnut?
08:25CookedGryphonfair enough
08:25zotthe lein startup times are killing me, so i had crossed fingers that i could make it repl-friendly
08:25CookedGryphonI wonder if you could make something which resets the repl without restarting leiningen...
08:26CookedGryphonjust leaves leiningen running in the background at the point it would normally trampoline off your process, and then have the ability to make it kill the current one and quickly fire off another
08:26zotyeah, that's what i was trying to figure out, but i actually haven't used threads directly in clojure — only via core.async. (i'm relatively new to clojure.)
08:27CookedGryphonbecause you're losing a lot of time in leiningen's own startup/processing etc that isn't directly the running of your own app
08:30Frozenlockb
08:31zotCookedGryphon: i know that leiningen is mostly to blame. i shed a little tear for it already :)
08:32AWizzArdtbaldridge: ping
08:32tbaldridgeAWizzArd: morning
08:32AWizzArdMornin’! I have an async question.
08:33AWizzArdwhy the 1 in `(chan 1 (map mouse-loc->vec))`? https://github.com/cognitect/async-webinar/blob/master/src/webinar/core.cljs#L133
08:33AWizzArdAn event gets written into the channel when the mouse moves. There will be one single message in the chan, namely the mousemove event.
08:33AWizzArdmouse-loc->vec extracts the coordinates into a vector. Why does the channel need that extra space for a second object before writing to the chan blocks?
08:33tbaldridgeAWizzArd: it's due to the way transducers work, they can't be used with a channel without a buffer.
08:34AWizzArdAah okay, thanks.
08:34AWizzArdI supposed it has something to do with the Transducers. But my guess was more that they would, for some reason, unpack the vector that mouse-loc->vec creates, and put two elements back to the chan or something like that.
09:27gfredericksCookedGryphon: I think there's a lib for that actualy
09:27dnolen_Bronsa: ping
09:28Bronsadnolen_: pong
09:28gfredericksCookedGryphon: https://github.com/technomancy/grenchman
09:28dnolen_Bronsa: https://github.com/clojure/clojure/blob/master/src/clj/clojure/main.clj#L125
09:28dnolen_Bronsa: is this true of tools.reader ?
09:29dnolen_Bronsa: the requirement described in the docstring
09:31Bronsadnolen_: t.r supports *in* (LineNumberingPushbackReader) or a c.t.r.reader-types/PushbackReader, which behaves like LNPR in collapsing CR/LF/CRLF
09:32dnolen_Bronsa: so LNPR in tools.reader doesn't respect the requirement of the docstring?
09:32dnolen_Bronsa: or are you saying we're covered
09:33Bronsadnolen_: we're covered. you can either use LNPR directly or one of the t.r pushback readers, they do the right thing
09:33dnolen_Bronsa: ok great
09:33Bronsadnolen_: obviously you can't use .unread, you have to use the t.r unread protocol function
09:34Bronsadnolen_: as in, the t.r reader won't work with c.c read, but LNPR will work with t.r read
09:34daniel``libraries like timbre, what technique do they use to allow themselves to be configurable? like timbre/set-config!?
09:35daniel``im writing a library which i want to be configurable by the consumer
09:35Glenjamindaniel``: timbre uses a single globally referenced atom, but often the best advice is to have functions which take an configuration map as their first argument
09:36daniel``right, i thought it was an atom
09:36daniel``Glenjamin: why would that be better, more explicit and easier to test?
09:37Glenjaminroughly, yes
09:37daniel``monger is an example like that, you have to pass the db to most functions
09:37Glenjaminyou can always provide a convenience namespace built on top of the context-as-arg1 functions
09:38daniel``Glenjamin: i think that's what monger does actually
09:38daniel``ok, thanks for reassuring me that im not going completely off road
09:45IntegralistHi, I was wondering if anyone knew how many times a transaction retries? Is it only one retry or does it consistenly retry forever, potentially livelocking?
09:45IntegralistI'm referring specifically to a changing the value of a Ref within a STM transaction
09:46dnolen_Bronsa: ok great, thanks!
09:47stuartsierraIntegralist: it retries forever, but after the first try Ref transactions wait until their Refs become available, and there are some deadlock-breaking measures in the STM machinery.
09:57Integraliststuartsierra: thanks for that, any chance of a link or "point of reference" I can look up - I stumbled across https://groups.google.com/forum/#!topic/clojure/DBkKs7SiPj4 which suggests Clojure is effectively "deadlock" free. If that's the case then fine, but if it's not deadlock free then it would be good to know where to find information to resolve it :-)
09:58stuartsierraIntegralist: Try http://clojure.org/refs
10:06vijaykiranmdrogalis: Hi
10:07vijaykiranmdrogalis: I thought #onyx might be the place :)
10:07mdrogalisvijaykiran: Not quite yet. :P PM.
10:17hellofunkcan any heroku users comment on whether it is possible to host more than one root web domain on a single heroku app account?
10:22luxbockhow do I tell timbre to stop all logging from the REPL? (timbre/set-level! ??)
10:37katratxoluxbock: set it to a high logging value? e.g. :error :fatal ? https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre.clj#L69
10:37luxbockkatratxo: thanks, I thought I had set it to :error but I think I might've restarted my REPL in between and forgot about it
10:38luxbockalmost crashed my Emacs running an operation on 35k items where each function call was print-logging stuff via timbre
10:38jeusing Weasel to connect a REPL my project in a browser. Switching to my projects namespace I can see and interact with the "things" defined in it ie. an atom, but I don't have access to all the namespaces it requires through the aliases: (:require [retro-fever.asset :as asset])
10:38jeasset (not working), retro-fever.asset (working), anyone have an idea on why and possibly how to solve it?
10:44Glenjaminhttps://twitter.com/glenathan/status/552127891094650881
10:46Glenjaminor, just the gif alone: http://i.imgur.com/sEE9DI0.gif
10:47AWizzArdI upgraded from Cider 0.7 or so to 0.8.2. When doing cider-connect the minibuffer shows no longer “127.0.0.1” and not the nrepl port, but it connects correctly.
10:47AWizzArdIs that the normal behaviour?
10:47arrdemGlenjamin: niiiice
10:48Glenjamineven on context, he just goes "grrrr"
10:48Glenjamin*in context
11:18KristienDoes Hickey even like himself? The human body is quite complex.
11:29devnKristien: complex, eh? imagine if a human designed it.
11:29devna software engineer
11:30KristienIn a biotechnology industry of only seventy years old.
11:33devnKristien: i guess my point is that the body might qualify as "simple" by rich's definition
11:34KristienI guess I'm hungry.
11:34devnI guess you are.
11:34KristienI guess you're right.
11:35devnI think so.
11:35katratxoKristien: nice bot
11:35KristienI implemented protocols in JS. :> Protocols are very nice unlike Boo.prototype.bleh = function(…) { … }.
11:36GlenjaminKristien: recently? i was looking at a few JS protocols implementations recently
11:36Glenjaminended up starting a multimethod implementation: https://github.com/glenjamin/defmulti
11:37KristienGlenjamin: just now, actually. I'm writing a compiler that generates code that uses the library
11:37Glenjamini realised that because i so rarely use prototypes in JS, type dispatch wasn't useful
11:39KristienI have only one running JS program and I use prototypes for all data structures except the AST.
11:39Kristiens/program/project/
11:43dweaveanything running on the jvm is garbage collected right? That’s not a language feature
11:43dweavespecific to java or clojure
11:43justin_smithyeah, it's a vm level feature
11:44dweaveso there’s no operation in java byte code that parallels clearing a memory cell then is that right?
11:44justin_smithyou can assign something to nil (null)
11:44justin_smithbut usually that isn't needed
11:44dweavebut u don’t HAVE to
11:44dweaveok cool just learning me some JVM thanks
11:45justin_smithbut assigning something to null is pretty literally clearing a memory cell
11:45dweaveyeah
11:45dweavei’m interested in how JVM is different than python’s VM and it’s instruction set
11:45dweavepython byte code is more specific to the language it seems
11:46justin_smithI don't know about that. Python's GC is not concurrent, that is probably the biggest difference.
11:46dweavefor isntance I don’t think CALL_FUNCTION or anything like that would exist in java byte code
11:46justin_smithbut java byte code is full of "create class" and "invoke method"
11:46dweaveah.
11:47dweavenot jsut with GC but in general I don’t understand why one is called an interpreter and another is a vm
11:47justin_smithdoes python have a byte code spec?
11:47dweavenot sure it’s a documented spec
11:47dweavethat might be the biggest difference
11:48dweavebyte code is an implementation detail in python maybe
11:48dweavein java it’s a spec
11:48justin_smithwhich means something like clojure can create working byte code for the vm, without creating java code.
11:48hiredmanvirtual machine isn't a very precise term
11:48dweaveyeah
11:49dweaveyeah hiredman i agree
11:53Kristienjustin_smith: python has one
11:53Kristienbut it's CPython-specific
11:53KristienPyPy or Stackless may or may not implement i
11:53Kristienit*
11:53KristienIronPython and Jython almost certainly don't.
11:54stuartsierraModern JVMs are typically JIT-compilers rather than bytecode interpreters.
11:55KristienImplementing bytecode interpreters is a fun exercise.
11:56mgaare_Is there a rule against pushing all-java projects to Clojars?
11:57llasrammgaare: nope
11:58sovahellofunk: i am going through The Joy of Clojure and destructuring was actually the very next section of the book, haha; thanks for your help earlier with destructuring syntax and :keys (=
12:02arrdemdoes useful not have a fixed point imp'l?
12:08ziltiI have the following annotation for timbre's "info": "(ann ^:no-check taoensso.timbre/info [Any * -> nil])" But despite the :no-check, I get type errors for not annotating the timbre functions running in the background of "info". Solution?
12:09arrdemzilti: isn't info a macro?
12:09ziltiarrdem: Hmm. Yes, indeed... Ah, got it. I have to annotate taoensso.timbre/log
12:09arrdemzilti: I'd ask over in #typed-clojure, but my gut is that info is a macro and that you're annotating something that core.typed never checks.
12:09arrdemyep there you go.
12:12ziltiarrdem: Doesn't solve the issue though unfortunately... I'll go ask #typed-clojure
13:08daniel`can i force lein to refetch a dependency of the same version?
13:08arrdemdaniel`: only by purging ~/.m2
13:09daniel`arrdem: ok, thanks
13:09daniel`thats what i did
13:09justin_smitharrdem: well you could just remove that one artifact rather than emptying the whole .m2
13:12TimMcEmptying .m2 is OK until the day you have shitty internet access and need to rebuild something.
13:14justin_smithTimMc: did I ever mention the time I was at Powell's city of books, using their wifi, and I was getting odd errors so I cleared my .m2, then every artifact was corrupt, so I finally looked at the contents of one of the jars, and it was the html for a "click here to use our wifi page", which I was getting instead of any download I attempted.
13:14arrdemjustin_smith: nice
13:15justin_smithgoddamn them for thinking "using the internet" means "using a web browser" anyway, but I should have known better
13:16Aeolus0hey guys, i'm new to clojure and can't for the life of me figure out whats wrong in my Fizzbuzz
13:16Aeolus0can anyone help me?
13:16arrdem~ask
13:17justin_smithAeolus0: share a link to a paste of the code, and you'll get way more feedback on your code and style than you would ever want
13:17Aeolus0justin_smith: https://gist.github.com/Aeolus0/14ddebf48acc22401111
13:17mi6x3mcan I pass arguments from a fixture to a test?
13:17Aeolus0justin_smith: i know my style is atrocious :(
13:17noonianAeolus0: people are usually willing to help if you post a code snippet or give more information about your error
13:17justin_smithAeolus0: I made sure to say that before seeing any of your code :)
13:18Aeolus0noonian: code snippet here https://gist.github.com/Aeolus0/14ddebf48acc22401111
13:18noonianah, nvm
13:18mi6x3m-altAeolus0: OK, let's see about that
13:18justin_smithAeolus0: (= (mod x 5) 0) is the same as (zero? (mod x 5))
13:18mi6x3m-altfunction names are always lower case
13:18arrdemAeolus0: extraneous () wrapping your outermost if
13:19justin_smithyup - also I think the if conditions are a bit off
13:19Aeolus0how so?
13:19mi6x3m-altyes Aeolus0, false ) positioning
13:20Aeolus0mi6x3m-alt: so what would i remove, i don't see where i used an extra ()
13:20justin_smithAeolus0: oh, the conditions are OK, the formatting threw me off a bit
13:20noonian(+ (str x) " ") will throw an error because + expects a number
13:20mi6x3m-altAeolus0: an if has the form (if X Y)
13:20noonianit would probably be cleaner to use a cond instead of the nested ifs also
13:21justin_smithAeolus0: the erroneous extra brace is on the end of the first line
13:21Aeolus0noonian: ah, so i can cat two strings just by placing them next to each other right>/
13:21noonianAeolus0: the 'str' function will concatenate two strings
13:21justin_smithAeolus0: () is not for grouping in clojure, ever. It's for calling functions or building list literals
13:21Aeolus0noonian: thanks
13:21Aeolus0justin_smith: understood
13:21noonian,(str "one" 2 "three")
13:21clojurebot#<AccessControlException java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>
13:22noonian,(str 1 2 3)
13:22mi6x3m-altAeolus0: will paste asap
13:22clojurebot#<AccessControlException java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>
13:22noonian&(str 1 2 3)
13:22lazybot⇒ "123"
13:22noonianwhats wrong with clojurebot?
13:22justin_smithAeolus0: also, (FizzBuzz (range 1 100)) will not work because FizzBuzz takes a number, and you pass it a collection of numbers
13:22justin_smith(map Fizzbuzz (range 1 100)) will likely work
13:22Aeolus0justin_smith: so how do i have it iterate over a range, will map do that?
13:23justin_smithyes, that is what map does
13:23noonianbut since you are printing instead of returning a value you probably want (doseq [n (range 1 100)] (Fizzbuzz n))
13:23Aeolus0thanks jus
13:23Aeolus0justin_smith: so how do i have it iterate over a range, will map do that?
13:23justin_smithor you could redefine FizzBuzz to take a collection
13:23Aeolus0ARGH
13:23Aeolus0thanks justin_smith
13:23justin_smithnp
13:23noonianusually in clojure you would want to return a value of the answer instead of printing it out
13:23godd2(map f (a b c d ...)) == (f(a) f(b) f(c) f(d) ...)
13:24godd2oops, thats not correct syntax, but its pseudocode so its okay
13:24Aeolus0thanks godd2
13:24mgaarebetter if fizzbuzz returned a string, and the caller made decisions about how to handle/print
13:24Aeolus0noonian: i know, i'm just testing for now
13:25mgaarefor instance, your code right now isn't putting any newlines between prints, and also isn't showing the number
13:25mi6x3m-altAeolus0: is your fn supposed to print from 1 to x?
13:25justin_smithgodd2: yeah, more like ##(= (map inc [1 2 3 4]) [(inc 1) (inc 2) (inc 3) (inc 4)])
13:25lazybot⇒ true
13:25Aeolus0mi6x3m-alt: yup
13:26Aeolus0mi6x3m-alt: more like given number x, find out if it's Buzz, Fizz, FizzBuzz, or none
13:27Aeolus0justin_smith: one more thing, any idea about this? the output of ls is project.clj, nothing else, but lein run dosent work. Should i make a lein app and then put it in that project.clj?
13:28noonianproject.clj is where you project configuration for leiningen goes
13:28mgaareAeolus0: project.clj is a special file for configuring the project with lein - you shouldn't put application code in there
13:28noonianyou should make a new project with lein new my-proj and stick you code in src/my_proj/core.clj
13:28Aeolus0got it
13:29Aeolus0done, but lein run now says No :main namespace specified in project.clj.
13:29noonianusually you would test code like this in the repl
13:29Aeolus0true, and i've gotten it to work in the repl
13:30Aeolus0but now when it comes down to actually making it
13:30AeroNotixAeolus0: the project.clj file needs a :main key for lein run to work
13:30noonianto get lein run to work, write a function for your entry point like (defn go [] (doseq [n (range 1 100)] (Fizzbuzz n))) and run with: lein run -m my-proj.core/go
13:30Aeolus0it's derping hard. Most tutorials don't go into the structure of a formal program
13:30Aeolus0just how to make it work in the REPL
13:30AeroNotix:main my-proj.core
13:30Moses_Do people use this IRC for clojurescript, or is there a separate IRC for that?
13:30AeroNotixand in my-proj.core you should have a (def -main [] ) function
13:30AeroNotixMoses_: cljs is fine here
13:31noonianlein run with no options will look for a -main function in the namespace specified with the :main key in project.clj
13:31pandeiroMoses_: there is #clojurescript too
13:31noonianbut clojurescript questions are fine here too
13:31justin_smithMoses_: there is also a #clojurescript, but there is plenty of cljs traffic here, and more people
13:31alexyakushevI wonder why default leiningen template creates a scaffolding with -main function and gen-class, but misses :main in configuration
13:31AeroNotixalexyakushev: bollocks it misses it
13:31AeroNotixSource: You know, I use lein.
13:32AeroNotixderp, you're right
13:32mi6x3m-altAeolus0: your version fixed http://pastebin.com/K3uCTc7E
13:32AeroNotixI think maybe I have some templates then
13:32mi6x3m-altbut there are probably better ways
13:33Aeolus0mi6x3m-alt: i'm really sorry to ask this, but can you rehost on gists, as pastebin has been blocked in my country :(
13:33AeroNotixAeolus0: what country is that?
13:33Moses_Thanks AroNotix. I have a question regarding project structure and lein in cljs. I have a chess app I'm writing. I have the core chess code in a directory called chessengine. In it I have an engine.cljs file I'd like to reference from the web part of the project. I'm including it using chess-engine.engine :as ce.
13:33AeroNotixRussia?
13:33Moses_I'm getting nameToPath not found error
13:33Aeolus0India :|
13:33AeroNotixMoses_: I don't personally do cljs.
13:33crash_epwasn't GitHub also blocked in India?
13:33alexyakushevWow that's some really dangerous website to block
13:33Aeolus0i'm slowly working my way through high school here until i can go back to the USA
13:34Aeolus0AeroNotix: yup, technically, but it still works for me
13:34alexyakushevAll the cool kids access Pastebin from I2P to avoid being SWATed
13:34AeroNotixalexyakushev: Russia tried banning github.
13:34noonianMoses_: you can't use cljs code in clj, if you mean use it from another cljs file you just need it in :source-paths in leiningen
13:34alexyakushevAeroNotix: I know. And Pastebin too
13:34AeroNotixalexyakushev: Don't worry, your third-world countries will catch up soon.
13:35Moses_Its there noonian
13:35Moses_Wiat... its not there
13:35Aeolus0AeroNotix: can you rehost that paste for me please, i'd realy like to see where i went wrong
13:35Moses_Thanks
13:35mi6x3m-altAeolus0: PM'd
13:35AeroNotixAeolus0: https://gist.github.com/AeroNotix/180fb70487a2a18d6054
13:36noonianMoses_: you need to make sure the file path matches the namespace declaration also
13:36mgaaregood thing India didn't try to ban stackoverflow... whole country would grind to a halt
13:36Aeolus0mi6x3m-alt: thank you so much :)
13:36AeroNotixmgaare: can u send me a codes
13:36mi6x3m-altAeolus0: AeroNotix too, he shared it also
13:36Aeolus0mi6x3m-alt: yup, thank you too AeroNotix
13:36AeroNotixnp
13:36alexyakushevAeroNotix: I live dangerously close to Russia so I may catch up sooner than I want to
13:37AeroNotixalexyakushev: Ukraine?
13:37[blake|Alaska? =P
13:38mi6x3m-altFinland?
13:39arrdemcenter of the earth...
13:49alexyakushevAeroNotix: bingo
14:00csd_How does cider look for lein? It's in my path but cider says it can't find it.
14:01amalloycsd_: i bet you're using mac os
14:01nullptrare you starting emacs from the dock on os x?
14:01csd_yes
14:01csd_is it looking within the .app?
14:02nullptryour path is probably your shell path -- you could start from terminal or include this bit of hackery:
14:02nullptrhttps://github.com/derekslager/dotfiles/blob/master/emacs.d/derek/global.el#L80
14:02amalloyhttp://clojure-doc.org/articles/tutorials/emacs.html
14:03csd_amalloy: I've used emacs + cider for a while, but I just replaced my machine and decided to switch from the terminal to the GUI version
14:03nullptr(inc amalloy)
14:03lazybot⇒ 211
14:03amalloyi use linux so can't say which of those options will work; probably both mine and nullptr's are fine
14:04csd_nullptr: what do you mean by "your path is probably your shell path"? If you mean what's defined in .bashrc, lein is, and I can call `lein` from terminal.
14:04l3dxyesterday I got some suggestions regarding this issue https://gist.github.com/tskardal/4c149a1d8a5050b76a06 but I haven't figured out a solution yet. I would really appreciate it if someone bothered having a look :) all code available here https://github.com/tskardal/clj-snake
14:04amalloycsd_: i think he means that by "in my path" you mean "in my shell path", which the emacs gui doesn't know anything about
14:04l3dxI've tried juggling the dependency version numbers a bit, but without luck
14:05csd_amalloy: I see, ok.
14:12justin_smithhow would I go about never seeing "in /tmp/form-init-{[0-9]+}.clj" as the source of a compiler error?
14:13justin_smithbecause it is pointing me at a file that lein deletes
14:13justin_smithwhich is uselss
14:13justin_smith*useless
14:14justin_smithis there some workflow that would instead report an error in the actual source file being compiled?
14:14justin_smith(or in this case it looks like a runtime error, not compilation error, which makes getting the "compiling... " part of the message even more annoying
14:14justin_smith)
14:15amalloyjustin_smith: i think there's generally nothing of interest in those files. like, i have two that managed to avoid getting deleted, and all that's in them is like `(.deleteOnExit (java.io.File. "/tmp/form-init2777354737944781043.clj")) repl` what is it that you're doing that makes these turn up?
14:16justin_smithlein run
14:17justin_smithI know from the stack trace where the actual problem is, but the fact that it is reported as an error in compiling a temp file is distracting
14:17justin_smithalso, lein trampoline run doesn't change the message
14:23AeroNotixin a lein template how would I indicate that I want a template to be marked as executable?
14:23sdegutisHi Patrick.
14:27AeroNotixoh cool, :executable
14:27sdegutisWhat's some good background music to listen to while writing Clojure code (in either Emacs or IntelliJ)?
14:27AeroNotixsdegutis: di.fm/deep-house soma.fm/spacestation
14:27AeroNotixthose are my usual
14:27sdegutisAeroNotix: thanks
14:28mi6x3m-altsilence
14:31alexyakushevdi.fm/deephouse no dash
14:32sdegutismi6x3m-alt: hmm interesting idea...
14:32AeroNotixtrue
14:32sdegutismi6x3m-alt: I've tried that and it's not working.
14:33mi6x3m-altsdegutis: not trying hard enough
14:33vermasdegutis: I listen to sync24 on spotify .. also carbon based lifeforms .. chill music
14:33mi6x3m-altyour code is suffering degraded quality :P
14:33alexyakushevI prefer di.fm/liquiddnb though
14:33justin_smithrecommending the music I like to listen to would be indistinguishable from trolling
14:33csd_nullptr: thanks that gist was just what I needed
14:34sdegutisjustin_smith: that is fine
14:34mi6x3m-altrick roll?
14:34vermaAeroNotix: nice, deephouse is sound good :)
14:34sdegutismi6x3m-alt: I find that listening to certain kinds of non-intensive music my mind to focus much better on coding
14:34sdegutis*help my
14:35justin_smithhttps://www.youtube.com/watch?v=G4g2Zjolsa0
14:35sdegutisslagyr: what do you listen to when you code?
14:35mi6x3m-altsdegutis: do you also support the Ballmer peak theory?
14:35mi6x3m-alt(I am only joking btw)
14:36postpunkjustinCoding on Merzbow: not even once.
14:36postpunkjustinGive me some nice, soothing Glenn Branca
14:36justin_smithhaha
14:37justin_smithpostpunkjustin: a friend of mine played with Branca, and his hearing never fully reocvered
14:37postpunkjustinI believe it.
14:38postpunkjustinThat's cool, though, if you're into permanent hearing damage
14:38postpunkjustinI do love me some Branca, but I usually just listen to Boards of Canada or Autechre or something when I'm coding
14:39justin_smiththe most important thing is no lyrics, I can do Beethoven, Merzbow, Ryoji Ikeda, even Coltrane
14:39justin_smithbut today is a Merzbow day
14:47TimMcI've been enjoying Kalabi and Superdirt2 for programming recently.
14:55adamhiguerais anyone around to talk me through how, exactly, macros and namespaces interact in Clojure[Script]?
14:56adamhiguera[and would be kind enough to?]
14:56mikerodhas anyone ever seen the order of java.lang.Class#getMethods changing during a runtime?
14:56mikerodthe docs do say "The elements in the array * returned are not sorted and are not in any particular order"
14:57mikerodhowever, it always looks like they come out by name and in order of increasing arity
14:57mikerodper method name
14:57amalloymikerod: this sounds like dangerous talk...why would you care?
14:58mikerodamalloy: yes, I was looking at a third party lib that may have a reflection method selection issue. I think some behavior does depend on this order coming out this way.
14:58mikerodand it does typically when I check. I'm just curious if it could sporadically change. I'm sure this is just JVM impl details though...
15:03adamhigueraI'm getting a bunch of "no such namespace" warnings at compile time, all associated with my macro, and I have no idea why
15:06BobSchackadamhiguera: Are the symbols / keywords you're generating in the macro have namespaces that are defined in your application?
15:06adamhiguerayes
15:07adamhigueraspecifically i want my macro to (generate a) call to a function
15:07adamhigueradefined in my application
15:07adamhiguerathe macro also contains a let statement
15:07adamhigueraestablishing a bunch of bindings
15:07adamhiguerawhich should be generated
15:07adamhiguerabased on calls to functions defined in my application
15:08adamhigueramy macro lives in a namespace
15:08adamhigueracalled game.macros
15:08adamhiguerain a .clj jile
15:09adamhiguerawhich is required in the main file via clojurescript's :require-macro
15:09adamhigueraand at complication i get a bunch of warnings
15:09adamhiguera"no such namespace: game.macros"
15:10adamhiguerawhich leads me to believe that it's resolving symbols in its own namespace?
15:10amalloyadamhiguera: is there some reason you are writing a bunch of prose for a vague description of what's going wrong, instead of gisting some code and an actual compilation error?
15:10adamhiguerai figured it would be too bereft of context
15:10amalloylike, i have some guesses about what you're doing wrong, but it'd be so much easier with something real to work with
15:10adamhiguerabut if that's preferred, i'd be glad to
15:11adamhiguerais gist different from pastebin?
15:11amalloyadamhiguera: no
15:11tcrayford____it's a different website
15:11tcrayford____same concept
15:11TEttingerhttp://gist.github.com allows multiple files
15:12TEttingerrefheap is also liked in clojure community
15:13alexyakushevrefheap also has a really easy to install Emacs plugin
15:14adamhiguerahopefully relevant snippets
15:14adamhiguerahttp://pastebin.com/S2zvrZpT
15:14adamhigueraevery line
15:14adamhigueragiven
15:14adamhiguerais one where i am using the macro
15:14adamhiguera"effect-with-pending-input"
15:15adamhiguerai've also included the require statement in the file where i use the macro
15:15mercwithamoutho_O
15:16amalloyadamhiguera: @state looks like it should be @~'state, right?
15:16amalloyoh nm, i see the ~ around the []
15:16adamhiguerano, @state is an atom
15:17adamhigueraor rather state is an atom
15:17adamhiguerain the calling file
15:17adamhiguerathat i'm derenferencing
15:17amalloyright, i'm just saying i don't think you have the quoting right in all cases
15:17adamhiguerathat's definitely possible
15:17adamhigueraalso the following macro
15:18amalloylike look at target, in the (if target ...). that should be (if ~'target ...), if you're going to use bare symbols instead of gensyms
15:18mgaareI think you need to do @'~state
15:18amalloymgaare: no, he's already unquoting the whole let vector
15:19amalloyit's a really weird way to do things, but it's not actually wrong
15:19mgaareamalloy: in line 9-12 I mean
15:19amalloyi'm aware
15:19mgaareoh, yeah, ok
15:19mgaareI see what's happening now
15:20mgaareyeah, that's confusing :D
15:20adamhiguerai'm trying to contribute to someone else's project
15:20adamhigueraand they do it this way
15:20adamhigueracoming from CL
15:20adamhiguerai would just not unquote anything
15:20adamhiguerain the let vector
15:20adamhiguerahowever i definitely do not want gensyms
15:21amalloyadamhiguera: right, so then you still need to unquote target
15:21amalloyor rather, re-quote it, by taking it out of backquote and into normal quote
15:21amalloy~'target
15:21clojurebotCool story bro.
15:21adamhigueraso what's happening is
15:21adamhiguerathe "target" in (if target ...)
15:22adamhiguerais being generated as a gensym
15:22amalloywell, not a gensym
15:22amalloybut it's being namespace-qualified
15:22mgaareadamhiguera: no, it's being treated as a symbol in the current namespace, rather than the one in the function
15:22amalloyinto (if game.macros/target ...) or whatever
15:22adamhiguerafor some reason i was under the impression
15:22adamhiguerathat syntax-quoted forms
15:23adamhiguerae.g. `(etc and so on)
15:23adamhiguerawould macro-expand into the namespace
15:23adamhiguerawhere the form is expanding
15:23adamhiguera*with symbols qualified into
15:23adamhiguerais that not happening here for some reaons or do i fundamentally misunderstand backtick?
15:23amalloyadamhiguera: this is basically a mistaken impression
15:24mgaareadamhiguera: you want it to be the local binding, not a namespace qualified symbol
15:24amalloyalso, could you stop hitting enter after every four words? a sentence is easier to read on one line than on six
15:24adamhigueraand things in let vectors are not namespace-qualified?
15:25mgaareadamhiguera: no, those are local bindings
15:25adamhiguerasorry, habit i picked up from gchat and other irc channels, where the preference is the opposite. thanks for your patience.
15:27amalloyadamhiguera: so, basically it is like this. ` namespace-qualifies all symbols, using the context of the namespace in which the ` form exists. this is all divorced from macros entirely, but in practice the ` form is usually inside a macro definition, so the context is that of the macro, rather than where it's expanded into
15:28amalloyso in the cases where you want a symbol with no namepsace, typically to name a local, you have to use the basic quote instead, usually via like `(let [~'x ...] (inc ~'x))
15:29amalloyyour code expands to something like this: ##'`(let ~['target 1] (if target ...))
15:29lazybot⇒ (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/let)) (clojure.core/list [(quote target) 1]) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote if)) (clojure.core/list (quote clojure.core/target)) (clojure.core/list (quote ...)))))))
15:29amalloy&`(let ~['target 1] (if target ...))
15:29lazybot⇒ (clojure.core/let [target 1] (if clojure.core/target ...))
15:29amalloywhere of course what you really want is ##`(let ~['target 1] (if ~'target ...))
15:29lazybot⇒ (clojure.core/let [target 1] (if target ...))
15:29adamhigueraamalloy: so in my example, e.g. "target" resolves into game.macros/target because that's how backtick works, and then in the expanding context, that namespace doesn't know anything about game.macros, so i have problems.
15:30amalloyyes
15:30adamhigueraaaaahhhh
15:30adamhiguerai begin to understand
15:30adamhiguerai was indeed very mistaken about how syntax-quoting and namespaces interact, and this conversation has been very helpful
15:31adamhiguerado i need to be doing something similar with symbols i expect to be available in the expanding context, e.g. "if"?
15:31amalloyadamhiguera: if is available in every namespace
15:32adamhigueraok, but in my example, will "if" become a qualified game.macros/if in macroexpansion?
15:32amalloyadamhiguera: i mean, try it and see, right
15:33amalloy&`(if 1 2 3)
15:33lazybot⇒ (if 1 2 3)
15:33adamhigueraclojurescript adds an extra level of confusion to all of this, since macros have to live in a clojure namespace that none of the clojure code can know about
15:54sdegutisHow does Clojure compare to Scala in performance and speed?
15:56dnolen_sdegutis: http://benchmarksgame.alioth.debian.org/u32q/compare.php?lang=scala&amp;lang2=clojure
15:56sdegutisI never could understand this website
15:56stuartsierrasdegutis: In real-world application code, there is likely no difference.
15:57stuartsierraBoth are going to be orders-of-magnitude faster than interpreted scripting languages like Python or Ruby; but slower than hand-tuned C.
15:58ToxicFrogIME, clojure's startup times are worse than Scala's already pretty bad ones
15:58ToxicFrogBut once up and running there's not much difference
15:58sdegutisHow does Clojure compare to Java 8 in terms of developer-friendliness?
15:58TimMc~alioth
15:58clojurebotalioth is http://www.ro-che.info/ccc/02.html
15:58tcrayford____sdegutis: that's a very subjective question
15:59sdegutis(I'm biased towards liking static typing.)
15:59TimMchuh
15:59tcrayford____depends on your background alot
16:01TimMcCCC is gone?
16:01TimMcMaybe just down.
16:02ToxicFrogsdegutis: I haven't used Java 8, but I'm in favour of Java 7 dying in a fire and if I insisted on static typing on the JVM I'd use Scala instead, or, for simple things, clojure with core.typed
16:02TimMcclojurebot: forget alioth |is| http://www.ro-che.info/ccc/02.html
16:02clojurebotI forgot that alioth is http://www.ro-che.info/ccc/02.html
16:03TimMcclojurebot: alioth |is| https://ro-che.info/ccc/02.html
16:03clojurebotOk.
16:05sdegutisToxicFrog: why such contempt for J7?
16:06ToxicFrogsdegutis: because, like J6 and J1.5 before it, it's tedious and unpleasant to use.
16:06sdegutisIs the start-up time of J8 significantly faster than a pure-Clojure project?
16:07mgaareshould be
16:07ToxicFrogI don't know about J8, but J7 is dramatically faster.
16:07ToxicFrogLoading the clojure core libraries is cripplingly expensive.
16:07sdegutisCool, thanks.
16:08ToxicFrogThere's some investigation and number crunching from earlier in the year: http://nicholaskariniemi.github.io/2014/03/19/solving-clojure-boot-time.html
16:08ToxicFrog"Simple desktop Clojure programs start about 35x more slowly than their Java counterparts. Clojure Android apps start as little as 6x more slowly than their Java counterparts, but the base start time is much higher so the problem is worse."
16:09tcrayford____(and clojure programs typically ship code rather than bytecode, so you have too compile it all each time)
16:10sdegutisMy Clojure app ships as an uberjar.
16:10sdegutisLeiningen makes that very easy to do.
16:10ToxicFrogtcrayford____: do they? I always ship an uberjar, which I thought contained bytecode.
16:11tcrayford____yeah, but libs always ship as code
16:11tcrayford____so every compile you have to compile the world
16:12ToxicFrogtcrayford____: right, but if you're shipping an uberjar, everything is compiled into it.
16:12sdegutisMaybe the uberjar just contains jars containing raw source for each lib?
16:13tcrayford____it does that too, but if you :aot (which lein does by default), you'll have real bytecode in there
16:14gfredericksI think uberjars have everything at the top level (no nested jars) and if you're AOTing your own code then that applies to the libraries too
16:14gfredericksAOT is transitive whether that's your own namespaces or the lib's
16:15tcrayford____yeah, it does
16:15tcrayford____and yeah, no nested jars
16:16tcrayford____reminder that jar files are just zip files and emacs/vim can explore them
16:16tcrayford____(or you can just unzip em)
16:26celwellHi, my project runs well with 'lein ring server', but when I 'lein beanstalk deploy development' I get: Exception in thread "main" java.lang.NullPointerException, compiling:(auth.clj:1:1)
16:26celwellIt was deploying fine until I added clj-facebook-graph to the project
16:27celwellAny ideas?
16:27celwellI'm seeing this in the stacktrace: clj_facebook_graph.auth$loading__4958__auto__.invoke(auth.clj:1)
16:27AtarianAnyone familiar with the Cider package for Emacs?
16:28celwellAtarian: somewhat.
16:29AtarianEvery time I try to run cider-jack-in, it fails with " Unable to resolve var: cider.nrepl.middleware.apropos/wrap-apropos in this context"
16:29celwellAtarian: hmm idk
16:29AtarianI'm using 0.9.0-SNAPSHOT from MELPA
16:30llasramAtarian: And do you have the 0.9.0-SNAPSHOT plugin middleware in your profiles.clj?
16:31AtarianThis is my line in profiles.clj: {:user {:plugins [[cider/cider-nrepl "0.9.0-SNAPSHOT"]]}}
16:31AtarianI'm afraid I'm a complete clojure noob, just trying to set up my env
16:31llasramYeah, that should do it
16:31AtarianBah
16:32llasramWell, unfortunately MELPA's "build any old commit" policy makes it difficult to be certain things are synced up
16:32llasramI'd recommend using MELPA stable instead -- I can verify that 0.8.2 works
16:32AtarianIC, I'll delete my .emacs.d and start again, thanks
16:33llasramI don't know if you need to go that far...
16:33llasramBut whatever you find easiest
16:33llasramIf you're a new Emacs user, you might find it easier to use Lighttable or Cursive instead, and tackle Emacs later
16:34AtarianI use Emacs quite alot, but for builtin stuff (C / LaTeX etc)
16:34llasramGotcha
16:35AtarianI've never had to use the packages before... right, gotta quit emacs, tnx for your help
16:35llasramnp
16:35llasramgood luck
16:36AtarianChrs
16:37celwellI can't figure out why 'lein uberjar' would work but 'lein beanstalk deploy' get NullPointerException when presumably building the jar/war.
16:38TEttingercelwell, sounds like a problem with the beanstalk plugin
16:38celwellIt worked perfectly until I added clj-facebook-graph into the mix
16:38celwellcurrently runs fine with 'lein ring server'
16:38TEttingermaybe the version you're using of that is incompatible with... what even is beanstalk...
16:39celwellit handles upload / environment build of elastic beanstalk apps on AWS
16:39celwellit's a nice plugin overall
16:40weavejestercelwell: clj-facebook-graph has some pretty old dependencies. It may be that dependencies from clj-facebook-graph are overriding later ones
16:40celwellwhen i lein ring server I do get: WARNING: get already refers to: #'clojure.core/get in namespace: clj-facebook-graph.client, being replaced by: #'clj-facebook-graph.client/get
16:41weavejesterThat indicates sloppy design, but it probably isn't the cause of your problem.
16:41weavejesterMake sure that clj-facebook-graph isn't overriding any later dependencies.
16:43celwellI don't understand why it would override anything. Even if it uses the same packages but different versions, isn't the newer one used? this is its dependencies: https://github.com/maxweber/clj-facebook-graph/blob/master/project.clj
16:43celwellAs I said, it runs fine with 'lein ring server' so I don't know what would be different from 'beanstalk deploy'
16:44amalloycelwell: the newer one is not necessarily used. dependency versions are a giant hairball
16:45celwellA google api lib I'm using always throws the same warngin (for the same function name); that lib loads fine though: WARNING: get already refers to: #'clojure.core/get in namespace: clj-oauth2.client, being replaced by: #'clj-oauth2.client/get
16:45celwellWARNING: get already refers to: #'clojure.core/get in namespace: clj-facebook-graph.client, being replaced by: #'clj-facebook-graph.client/get
16:45celwellThat first one is that google api
16:45arrdemyeah that's just library maintainers being sloppy and not using exclusions to escape warnings
16:46weavejestercelwell: Lein/Maven uses the version "closest" to your project file. So any dependencies in your project file take priority, followed by dependencies of dependencies, and so forth.
16:48justin_smithcelwell: that clojure version? I have had issues with lein beanstalk and the 1.7 snapshots
16:48celwellThe only conflicts I see are [org.clojure/clojure "1.3.0"] in the fb library, and [org.clojure/clojure "1.6.0"] in my project.clj. And also 'compojure' 0.6.4 vs. 1.1.8
16:49celwelljustin_smith: sorry what';s your question "that clojure version?"
16:49justin_smithsorry s/that/what
16:49justin_smiththat answered it
16:50weavejestercelwell: There's likely a lot more than that. The Ring versions will be different, and the AWS SDK shares some dependencies with clj-http IIRC.
16:50AtarianSorry to interrupt again, same issues with cider/cider/nrepl, error: "java.lang.RuntimeException: Unable to resolve var: cider.nrepl.middleware.apropos/wrap-apropos in this context" Anybody else had this? emacs24, cider 0.8.2, cider-nrepl 0.8.2 java.lang.RuntimeException: Unable to resolve var: cider.nrepl.middleware.apropos/wrap-apropos in this context
16:50weavejestercelwell: lein deps :tree will give you a more detailed overview.
16:51celwelllein deps gives me: (Possibly confusing dependencies found:)
16:51celwell([org.clojars.freeagent/clj-facebook-graph "0.4.0"] -> [org.clojure/data.json "0.1.3"])
16:51celwell( overrides)
16:51celwell([gapi "1.0.1"] -> [org.clojure/data.json "0.2.3"])
16:51celwell(
16:51celwellConsider using these exclusions:)
16:51celwell([gapi "1.0.1" :exclusions [org.clojure/data.json]])
16:51celwellnil
16:51celwell([org.clojars.freeagent/clj-facebook-graph "0.4.0"] -> [ring/ring-core "1.1.6"])
16:51celwell( overrides)
16:51celwell([compojure "1.1.8"] -> [ring/ring-core "1.2.2"])
16:51celwell(
16:51sdegutisoh hi #clojure
16:51arrdemrefheap pls <3
16:51sdegutisnice to see you're extremely active suddenly
16:53celwelloops, got throttled in irc. basically i got some messages about "Consider using these exclusions"
16:53celwellIs there something I can read about exclusions I'm not sure how they work and if they would help me here
16:53TimMccelwell: Yes, IRC is not a pastebin. :-)
16:54celwellHere is the dump of lein deps :tree, thanks for any insight: https://gist.github.com/celwell/ab210910c531b56dc314
16:55celwellI still don't see why it would work in lein ring server and not when deploying, but oh well
16:55weavejestercelwell: Both lein-ring and lein-beanstalk inject dependencies into the project map
16:56weavejestercelwell: It's possible they're conflicting in some manner
17:00Atarianbrb
17:04matt`Think I got it btw, project was created using an OLD version of leiningen, created a new project and the nrepl ran!
17:04AtarianOops, that was me
17:07celwellI've added a bunch of exclusions (at the advice of :pedantic? :warn). Not more overrides it seems. But same NullPointerException...
17:44csd_Clojure is complaining because I have `def a (foo)` before `foo` is defined, although I do a `declare foo`. The error goes away if I wrap in an anonymous function: def a ((fn [] (foo))). Is there a better way to get around this error?
17:44sdegutiscsd_: are you using that library that lets you take away the top-level parens?
17:45ticking_sdegutis: don't tell me something like that exists?
17:45AeroNotixYeah it does
17:45csd_sdegutis: omitted due to my own sloppiness
17:45ticking_urgh
17:45sdegutisticking_: it's simple, yet powerful
17:46ticking_sdegutis: sounds braindead to me :P
17:46ticking_csd_: when you're not defining foo before the def I'm actually surprised the second one works
17:46csd_I didnt verify that it gives the correct value, but the error goes away
17:47csd_I thought declare was supposed to fix this sort of problem though
17:47ticking_csd_: I think the code get's actually evaluated multiple times
17:47ticking_during compile time to see if it creates a function that has to be compiled
17:47ticking_and during runtime to initialize up to date values
17:47sdegutiscsd_: declare is meant for when you use the thing in the body of an anonymous function
17:47sdegutiscsd_: so you actually found the correct way to use declare by accident
17:48ticking_sdegutis: hum?
17:48hiredmancsd_: declare just creates the var, which still has no value until def'ed, so (foo) is trying to invoke the value of a var that has no value
17:48sdegutiscsd_: it's there for the compiler, so it knows it's going to be defined later in the program's source code but will exist before that code runs at runtime
17:48hiredmancsd_: your anonymous function likely works only because you haven't restarted your repl
17:48hiredmanin a clean repl it would not work either
17:49csd_I'm guessin it's better practice to just rearrange the code rather than to try to use something like promises?
17:49hiredmandefinitely
17:49hiredmanpromises won't work either
17:49csd_whys that
17:49ticking_sdegutis: why anonymous function? declare should be there to allow for correct recursive function resolving in a single pass compiler world
17:49hiredmanyou will just lock up
17:49hiredmancsd_: you will be derefing a promise before it is delivered to
17:50hiredman(which blocks)
17:50csd_ok
17:50csd_thanks all
17:51sdegutisticking_: the entire file executes in order at runtime
17:51sdegutisticking_: so you cant use something before it exists, thats why you cant use foo before defining it, even if you declare it first, because declaring it doesnt make it exist
17:52ticking_sdegutis: yeah, but I'm not shure I get what anonymous functions have to do with it
17:52hiredmannothing
17:52sdegutisticking_: but if you use foo from within a closure before defining it, then declare tells the compiler that it will probably exist before it is defined, since the closure will probably be executed after foo is defined
17:52sdegutishiredman: am i mistaken?
17:53hiredmanonce you are confused it is very easy to confuse yourself further
17:53ticking_sdegutis: could you explain what you mean bu that
17:53sdegutisgtg
17:53ticking_sdegutis: I think the functionality you want is this (fn foo [] (foo))
17:54sdegutissorry i got myself all confused
17:54amalloy(inc hiredman)
17:54lazybot⇒ 65
17:54dnolen_ToxicFrog: I haven't been able to reproduce those claim on my OS X machine
17:54dnolen_s/claim/claims
17:56dnolen_ToxicFrog: and loading Clojure programs isn't crippling expensive - startup time for AOTed Clojure is ~750ms on my machine, ~8X slower than HelloWorld.java, not 35X
17:57rberdeenis there a convenient way to bind a dynamic var for the lifetime of a repl session?
18:00rberdeeni'd like to do something like this: https://gist.github.com/also/682bf3d3e0b0a9d7134c
18:02justin_smithrberdeen: in other words you want a dynamic var to act like a regular one, where you redefine it and the new definition is used in all places
18:03rberdeenjustin_smith: just in the repl, so that I don't have to wrap everything with (binding [*dynamic* 1] ...)
18:06postpunkjustinrberdeen: if it's in the REPL then can't you just use def?
18:07rberdeenpostpunkjustin: i'd like to bind a var in an existing namespace that i'm interacting with in the repl
18:08EvanR-work,(range)
18:08clojurebot#<AccessControlException java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>
18:08postpunkjustinRight, but I suspect that you can switch to that ns, def the dynamic var with whatever value you want, then switch back
18:09postpunkjustinOr just in the one ns if that's all you have going on
18:10postpunkjustinI haven't tried that myself, I usually just write a macro with a one-letter name
18:11postpunkjustinlike (defmacro c [& body] `(binding [*foo* ~fooval] ~@body))
18:13aaelonyif I define a function in a repl long session and want to re-visit it's definition, why won't clojure.repl/source find it? Is there a better way to view the current definitions of functions?
18:13aaelonye.g. https://www.refheap.com/95769
18:16postpunkjustinaaelony: check the docstring for that macro -- it says the .clj file has to be in the classpath
18:16postpunkjustinI don't think that's the case for functions that you're defining at the REPL
18:16aaelonypostpunkjustin: I realize that. I'm looking for the functionality.
18:17postpunkjustinOk, I was answering your question about why clojure.repl/source can't find the definition
18:18aaelonypostpunkjustin: I understand. I think it used to work a long time ago. thanks for kindly responding though.
18:18csd_How can I interact with a system library such as libpcap with Clojure? Would I need to use FFI, or can I use Java to make the library calls?
18:18aaelonyit's a handy thing to have that I've grown accustomed to from R
18:21amalloyaaelony: functions don't know their source code. if you have a decent repl it should have history search, so you can search for (defn foo
18:22zilticsd_: You'll have to use JNI for that
18:22csd_zilti: not familiar with that. sounds like a bag of worms
18:22aaelonyamalloy: thanks. I'm spoiled because in R every object prints itself or its definition (unless it's buried in an environment).
18:23zilticsd_: Neither am I, and I guess there also aren't any Clojure wrappers for it...
18:27ziltiIs there a way to tell core.typed the types of record methods?
18:30bridgethillyerWe did some cleanup of the Clojure user group page this weekend: http://dev.clojure.org/display/community/Clojure+User+Groups
18:30bridgethillyerIf anyone has a group that is not listed, please add it, or let me know, and I will add it for you.
19:05toxmeisterhappy 2015 clojurians! :)
19:06godd2I thought we were Clojans
19:06toxmeisterunfortunately am having once more deploy trouble w/ clojars, any one else experienced hickups in past couple of days?
19:07toxmeistergodd2: that sounds like trojans...
19:07grayston@toxmeister I was just about to ask about that
19:07godd2yea, they were a mighty army
19:07godd2er navy?
19:07graystonI have a bunch of dependancies, lein deps :tree shows the jar is loaded
19:07graystonbut try to use it and I get the FileNotFoundException, like it isn't even there
19:07ziltitoxmeister: Yesterday morning deploying to clojars worked fine for me
19:08graystonwas wondering is there was a way to debug lein dependancies?
19:09ziltigrayston: You can activate the pedantic mode, then it tells you when weird stuff is going on
19:10toxmeisterzilti: my last deploy was around 2 days ago also fine, this time it asked me for my gpg key twice, then first got a checksum validation error and later (2nd attempt) the dreaded "forbidden" again
19:19grayston@zilti ok, I was including an older version of the dep in project.clj. Updated the version number and lein decides to download everything
19:19graystonbit of a newb, but what if I had specifically wanted that older version?
19:50david987654345Sorry for a newbie question, but I'm having trouble getting my clojure program to uberjar. I have two files in the src/projectname folder: core.clj and sieve.clj. I import sieve.clj into core.clj where my -main function is. When trying to uberjar it can't find sieve.clj on classpath
19:51postpunkjustindavid987654345: does it work with "lein run"?
19:54david987654345oh, it gives me this error: No :main namespace specified in project.clj.
19:54david987654345
19:54david987654345oh wait
19:54david987654345nevermind, wrong folder (oops)
19:55ziltiYes, you also have to define :main in your project.clj, e.g. ":main 'projectname.core"
19:56david987654345Ok, I had that and "lein run" tells me it can't find symbol s (I import sieve.core :as s)
19:57ziltidavid987654345: :import is for classes, you have to use :require
19:57zilti(:require [projectname.sieve :as s])
20:00david987654345Ok, I get this: " namespace 'mail-sieve-e.sieve' not found after loading
20:00david987654345 '/mail_sieve_e/sieve"
20:04justin_smithdavid987654345: do you define a namespace in that file?
20:05david987654345At the top of my file is: (ns sieve.core) (plus all of the imports/requires)
20:07andyfNamespaces and file names they are defined in must "match" each other
20:07andyfWhere I put match in quotes because dashes in namespace names must be changes to underscores in file names.
20:08andyfEastwood lint tool can help you catch such mismatches in a project
20:09justin_smithdavid987654345: if the file is in ie. src/mail_sieve_e/sieve.clj it must define the namespace mail-seive-e.sieve
20:09andyfhttps://github.com/jonase/eastwood
20:09justin_smithif you want it to define sieve.core it should be in src/sieve/core.clj
20:09justin_smithand yeah, use eastwood
20:10justin_smith(inc eastwood)
20:10lazybot⇒ 6
20:10justin_smithalso, consider not doing sieve.core - the .core thing is not very useful
20:11david987654345That worked perfectly! I changed the sieve.clj ns to (ns mail-sieve-e.sieve)
20:11david987654345Thank you all!
20:11david987654345/quit]
20:31warzwhat services out there offer managed clojure app hosting, similar to something like azure or something
20:32ziltiwarz: Heroku does afaik
20:33justin_smithwarz: a ring webapp can be deployed as a war file, which has nice automation and management and automatic scaling via eg. amazon elastic beanstalk
20:33justin_smiththe tooling around jvm webapps is actually pretty slick when you get it sorted out
20:45warzive actually been in a funk for the past few months, and havent thought of anything to code on
20:46warzive had this urge for a few years to give clojure a year or more of my time, and im trying to use that to get out of this funk. haha.
20:47warzim close to defaulting to the real hello world, an irc client
20:48warzbut was also trying to find something that i could incorporate clojurescript into
20:51rritochwarz: There are lot's of unfilled niche's available in clojure. If your looking to work with clojurescript and clojure why not build a cross-platform web browser plugin development framework?
21:01warzso that browser plugins can be written with clojure?
21:02rritochwarz: Yes
21:03rritochwarz: I believe firefox and chrome both facilitate javascript plugins already, Ie. may be a bit of a challenge to integrate in since you need to deal with .NET, I'm not sure if there are any .NET resources for clojure either.
21:07dustingetzI am having a lot of trouble defining pedestal routes; here i try to define a dynamic route and I get “200 OK: exception route not found“ or some such, can anyone spot the error? https://gist.github.com/dustingetz/15a5eda645df9694fea7
21:08rritochwarz: I don't think it would be too difficult to build a .NET API though, I imagine you could develop a leiningen plugin which could generate C# code, compile it, and wrap it in Java using SWIG so you can access it from clojure.
21:09rritochwarz: I'm not entirely sure since it's been years since I did any Ie. plugin development.
21:09TEttingerIKVM should be fairly good at getting the JVM on MS .NET, it has issues with mono
21:17rritochTEttinger: Did you see my latest project, lein-sablecc? Version 1.1.0 is fully functional, I've successfully generated a Lexer and AST with it, right now I'm working on "compiling" an AST into java objects so the resulting interpreted language can be accessed from clojure.
21:18TEttingernice!
21:18TEttingerwhat is sable?
21:18rritochSableCC is a compiler compiler, it takes a grammar file and generates java source code for the lexer and AST generation.
21:19TEttingerwoah
21:19TEttingernice work
21:19rritochThe plugin I built integrates SableCC with leiningen, automating the compilation and integration with leiningen projects.
21:20lasergoatrritoch: i spend a good chunk of my day writing browser plugin code in CLJS, and yeah, more tooling there would be amazing. I may eventually get to make some
21:21cljsn00bis there a way to do a blocking read similar to <!! in cljs.core.async? afaik <!! doesn't exist..
21:21amalloycljsn00b: is there a way to block in javascript?
21:22cljsn00bamalloy, honestly I don't really know, I'm a js n00b too :)
21:22amalloythere's not
21:22cljsn00bamalloy: good, then I don't have to try
21:23amalloyyou should probably learn the basics of the platform you're trying to run clojure on (here, javascript), or you will be constantly surprised by simple stuff. clojure is a hosted language, so features of the host language will show through
21:24rritochamalloy: You can block from javascript, but it makes the browser non-responsive if you block for too long.
21:24cljsn00bamalloy: you're absolutely right.. I'm trying to pick up things as I go
21:25cljsn00brritoch: I wouldn't mind if my go block gets stalled until it gets input
21:25cljsn00bI was just wondering if there's any way at all or whether I should do it using a go-loop
21:25rritochcljsn00b: It isn't that simple, I'm not joking about the browser going non-responsive
21:26rritochcljsn00b: To do it safely you'll need a timeout
21:26cljsn00bactually that would be fine, I want to wait at most a second for response
21:26rritochcljsn00b: And put the timeout token on the channel so the code knows it needs to retry
21:27cljsn00bcan you give me a hint at which commands I should look at to achieve something like that
21:27rritochcljsn00b: In that case, just do a loop that checks for input, and checks the time on every iteration.
21:27rritochcljsn00b: The loop should end when you get input, or when the timeout occurs.
21:28rritochcljsn00b: I only know how to do it from javascript, I haven't yet had an opportunity to use cljs.
21:28cljsn00bhm a go-loop with alts! might work
21:28cljsn00bokay, I'll try that
21:28rritochcljsn00b: Just remember, the GUI thread won't be running, so all of your input will come during timeouts
21:29cljsn00bas I do timeouts in each loop cycle?
21:29dnolen_rritoch: you cannot block JS outside of doing something computational intensive, which isn't what was meant
21:30dnolen_cljsn00b: <!! is not possible, but you don't really need it anyway
21:31cljsn00bdnolen_: I agree, there's an ugly to get done what I need, but I was hoping for something simple
21:32rritochdnolen_: Incorrect. You can block javascript with ... var data; var t = new Date().getTime(); while('undefined' == typeof data && (Date().getTIme() - t) < 1000) {};
21:32dnolen_rritoch: what is that ... doing something computational intensive
21:32rritocherr, the laast Date is missing a new
21:32dnolen_rritoch: you're just pegging the CPU
21:33dnolen_rritoch: again not what was meant
21:36cljsn00b"otherwise alts! will park until the first operation to become ready completes"
21:36cljsn00bhm, I guess blocking means blocking the entire process and parking means just blocking the go block?
21:38dnolen_cljsn00b: that's right
21:39cljsn00bdnolen_: ok that makes sense, thanks
21:43rritochdnolen_: It should also be possible to block until input is available if you use HTML5 web workers
21:44dnolen_rritoch: except it isn't, the interface is only async
21:49rritochdnolen_: So your saying it isn't possible to run CLJS in a worker... If you don't know the technology yourself, why do you try to teach it?
21:50rritochdnolen_: I assure you that you can block using the technique I mentioned, and I believe you don't even need the timeout if you block in a worker.
21:52lasergoatis there some simple gotcha about classpaths and mains in lein? I have a project that works great from the repl, but when I create an ns with a -main and :gen-class and then run it via lein run, it can't find my dependencies
21:53lasergoati'm sure it's something ridiculous, but i'm not sure where to look
21:53dnolen_rritoch: I assure you are incorrect
21:53dnolen_rritoch: having used WebWorkers before
21:54rritochdnolen_: Why not try it before making yourself look stupid
21:54justin_smithlasergoat: your dependencies, or your namespaces in your project?
21:54dnolen_rritoch: lol
21:54dnolen_rritoch: successfully ignored
21:54justin_smith~gentlemen
21:54clojurebotYou can't fight in here. This is the war room.
21:55lasergoatjustin_smith: i get an error from one of my namespaces about a dependency it can't find
21:55lasergoatjustin_smith: so i guess it can find at least that one namespace
21:55justin_smithone of the dependencies from your project.clj?
21:56lasergoatright
21:56justin_smithlasergoat: are you requiring the namespace explicitly, or just using it fully qualified?
21:56justin_smith(for the dependency that is)
21:56lasergoatrequiring it explciitly
21:57lasergoat(the require is what fails)
21:57justin_smithso the error is on the require, OK
21:57lasergoatyeah
21:57justin_smithcan you share the namespace, or at least the ns block in a paste?
21:57lasergoatsure, one sec
22:06lasergoatjustin_smith: actually, i think i figured it out, that dependency is just wrong. the real question is how it seemed to working in the repl
22:06lasergoatjustin_smith: i'll ask again if there's anything interesting in follow up; thanks either way for your help
22:06justin_smithlasergoat: likely you previously loaded or required the right thing, and that doesn't go away even if you break it later
22:07justin_smithunless you start from scratch or use tools.namespace/refresh or whatever that is
22:09weijava.jdbc question, is there a good way to do string / enum interop when using postgres?
22:09weiI heard about using :stringtype "unspecified" in the db-spec, but it’s not working for me
22:10lasergoatjustin_smith: yeah, i make liberal use of that
22:10lasergoatjustin_smith: but yeah, it was probably something like that
22:12lasergoatwei: this should help: http://naiquevin.github.io/using-postgresqls-enum-types-with-korma.html
22:13rritochDoes anyone know of a clojure library that provides name value lists? I'd like to convert these AST's directly into clojure persistent data. The only thing I can think of right now is to output the AST as XML and parsing it with enlive, but that seems like overkill.
22:14lasergoatwei: you can ignore the korma stuff and skip down to the str->PgObject thing
22:14lasergoatyou can take those pg objects and stuff them in the maps that you insert into pg
22:14lasergoatwei: and it just works
22:14weilasergoat: thanks for the forward. sounds like it will work, though converting on read/write is a hassle
22:15lasergoatwei: it is, but it's all i got :)
22:24toxmeisterdnolen_: thx sooo much for all the recent cljs improvements!!! not to tease, but so excited to share this v.soon - an interactive cljs/webgl viz of github commits for multiple projects: http://dev.thi.ng/20150107/0317-commits.png - doesn't show actual data yet, but v.close & can't wait! :)
22:48luxbockwould it be possible to write a tool that walks an expression and replaces each call of a function / macro with the symbols replaced with the source code for the symbol?
22:49luxbockit would make interpreting stacktraces a lot easier if you could see the whole code that was getting executed
22:53TEttingerluxbock, that's not a bad idea, but it would need all source available to it, and once you drop into javaland...
22:54luxbockTEttinger: I was thinking you'd probably only want to expand symbols defined in Clojure, and not expand any of the clojure.core functions
22:54luxbockseeing everything expanded to the max would be interesting, but even just what I proposed would be a big help for debugging
22:56luxbockI'm looking at riddley's walk-exprs which takes a predicate, a transformation handler and an expression
22:58rritochluxbock: In any form the first item is always the function, once you have the function you should be able to use something like the following... ##(read-string (with-out-str (clojure.repl/source into)))
22:58lazybotjava.lang.SecurityException: You tripped the alarm! push-thread-bindings is bad!
22:58rritochluxbock: I don't think that will dump any macro's though, macro's are evaluated at compile time
22:58luxbockrritoch: I think clojure.repl/source only works for core functions though?
22:59luxbockbut I could create my own source function that checks the :file and :line tags in the meta-data of the symbol and read the next form there
23:00luxbockrritoch: thanks for your help the other day btw
23:01rritochluxbock: The documentation for source says it works as long as it can find th source .clj file
23:01clojurebotI don't understand.
23:02rritochluxbock: I assume that means it will work as long as the source wasn't produced via an eval, including entered in a REPL so it may be difficult to test.
23:03luxbockrritoch: yeah that appears to be the case
23:05lasergoatjustin_smith: after all that, it just turned out to be a runaway undo of a bunch of code changes between my last repl reset and my trying out the main
23:35patrickgombert,(binding [*assert* false] (assert false))
23:36clojurebot#<AssertionError java.lang.AssertionError: Assert failed: false>
23:36patrickgombertthat doesn’t seem to jive with https://github.com/clojure/clojure/blob/clojure-1.6.0/src/clj/clojure/core.clj#L4420
23:36patrickgombertI think I might be missing somthing
23:40rritochpatrickgombert: I think your problem is that this is a macro which means it gets evaluated at compile time. The assert isn't bound when the macro was expanded.
23:41patrickgombertright, thanks
23:41rritoch,(do (set! *assert* false) (assert false) (set! *assert* true))
23:41clojurebot#<IllegalStateException java.lang.IllegalStateException: Can't change/establish root binding of: *assert* with set>
23:41rritochHmm, well that works in my repl