#clojure logs

2016-02-24

00:28Guest73345I'm having a problem trying to create an uberjar with boot. I've set up a simple repository with a build.boot file containing a task called "build". After running "boot build" I don't find anything in my target directory. I'm following the instructions on several websites (https://lionfacelemonface.wordpress.com/2015/01/17/boot-getting-started-with-clojure-in-10-minutes/) but it doesn't seem to work. Can anyone point out what I'm do
00:28Guest73345wrong? Here's a link to the project on github: https://github.com/patterkyle/pietro/blob/master/build.boot
05:29WickedShelloO I just noticed that constant math expressions aren't evaluated at compile time... Is there anyway to get them to evaluate? I have some layout math in the hotloop that I did with some const def's as that was much more readable then hardcoding numbers, but since its actually doing the math per loop that's really painful...
05:32TMAWickedShell: you could try read-time evaluation
05:34WickedShellTMA I'm not quite following can you elaborate? Is there already a way to get this evaluated once instead of per loop?
05:37TMAWickedShell: say you have an expression (+ a (* 3 5)) ; you want to evaluate the (* 3 5) to 15 -- either you can (+ a #.(* 3 5)) or you can (defmacro eval-now [x] (eval x)) (+ a (eval-now (* 3 5)))
05:38TMAWickedShell: the #. is Common Lisp syntax, I would need to check, whether it is the same in clojure or whether it uses another squiggle
05:40TMAWickedShell: the first thing actually performs the evaluation at read time -- the compiler sees (+ a 15), while the second approach performs the evaluation at compile time
05:41WickedShellread time would be better, the first version causes the repl to choke though...
05:41TMAWickedShell: it's spelled #= in clojure
05:43TMA,'(+ a #=(* 3 5))
05:43clojurebot#<RuntimeException java.lang.RuntimeException: EvalReader not allowed when *read-eval* is false.>
05:44TMAWickedShell: you might get this error when in restricted environment though :)
05:46hyPiRion,(binding [*read-eval* true] '(+ a #=(* 3 5))) ; ??
05:46clojurebot#<RuntimeException java.lang.RuntimeException: EvalReader not allowed when *read-eval* is false.>
05:46hyPiRionmean
05:46WickedShellTMA it works on a simple expression bnut it appears to crash as soon as I put it in a expression that as ^:const member :/
05:46TMAhyPiRion: it has already been read by the time the binding comes in
05:47TMAWickedShell: oh, that means it's not a constant expression after all
05:48WickedShelland it can't evaluate nested expressions which is kinda weird :P #=(+ 3 (- 2 5)) wont work for example
05:48WickedShellTMA pretty sure it really is constant, its showing up in the bytecode successfuly replaced anyways
05:49TMAWickedShell: try the other approach with the named macro
05:51TMAWickedShell: there might be an issue with the #= that the thing to be evaluated is not yet in existence (I do not know when forms are evaluated when loading a clojure file, it might as well read the whole file before any of the forms therein gets evaluated)
05:52WickedShellTMA that still complies to a runtime eval based on the bytecode
05:52WickedShellRT.uncheckedFloatCast(((IFn)const__60.getRawRoot()).invoke(Numbers.unchecked_minus(Numbers.divide(-200L, 2L), 25L)))
05:53TMAWickedShell: could you share the source snippet?
05:55WickedShellTMA http://pastebin.com/yhBETpCm the actual float is used in an interop call but thats outside the scope
05:55clojurebotAlles klar
05:56hyPiRionTMA: oh yeah, true that
05:57TMAWickedShell: let me experiment a bit
06:00TMAsomehow running lein repl from a cygwin terminal and pasting into that from the clipboard is very slow -- one character per second or so
06:01TMAwould anyone know why that might be the case?
06:02TMAWickedShell: how did you obtain the RT.uncheckedFloatCast(((IFn)const__60.getRawRoot()).invoke(Numbers.unchecked_minus(Numbers.divide(-200L, 2L), 25L))) translation?
06:04WickedShellTMA jd-gui over the AOT'd result
06:05WickedShellI'm sure no.disassemble could also do it, but I haven't succeeded in making it work locally so jd-gui was the easiest way to go :P
06:07TMAWickedShell: try (defmacro eval-now [x] (eval x)) followed by (eval-now (float (- (/ HUD_WIDTH 2) 25)))
06:09WickedShellpretty sure thats what I tried (well the eval-now was inside the (float) will retry now
06:10WickedShellyeah thats what I did to get the disassembly I sent you
06:11TMAthat's weird
06:11WickedShellif I dont put that macro in the invoke() call will go away but the math is still there
06:11TMAor maybe it is not
06:19TMAI don't seem to be able to compile ahead of time. My magic is weak
06:39dazlowHow do I time function like "time" does but rather than print to stdout return time to me?
06:40TMAalas, when I figured it out, WickedShell is no more
06:40andyfdazlow: You could make your own slightly-modified version of the time macro that does that. It is pretty short and wouldn't be difficult to write a modified version.
06:42MJB47TMA: im still interested
06:43andyfdazlow: For example: (defmacro time2 [expr] `(let [start# (. System (nanoTime)) ret# ~expr] (/ (double (- (. System (nanoTime)) start#)) 1000000.0)))
06:43dazlowandyf: yeah, I'm writing macro now, thanks
06:45TMAMJB47: my (eval-now ...) approach does in fact work; if it is wrapped in a body of a function [say (defn do-foo [] (eval-now ...))], the compiled function doesn't do the computation. it has the result precomputed in static {} block and stored in const__1 static final field, which it loads and returns
06:45MJB47ty
06:48TMAMJB47: probably the difference is when the (eval-now ...) form is a top-level form
06:48MJB47i wonder if its actually due to inlining
06:50TMAMJB47: it should not be. macros perform transformations on the parse tree, which is then compiled after it is macro-free
06:51TMAMJB47: the eval-now forces the evaluation at compile time, inserting the reduced result into the tree, so the further stages of the compiler do not even see the original code
06:52TMAMJB47: in a sense it is manually inlining the result of the evaluation
09:56rcassidyTimMc: up() { for n ({1..$1}) do cd ..; done }
09:56rcassidyoops, that was waaaay in backscroll, didnt realize iw as reading the past
10:08sdegutisAnyone noticing wrap-file-info being highlighted with a red-ish background color by CIDER?
10:09sdegutisI just saw that this morning and don't know why it's happening, and the CIDER readme doesn't mention it at all.
10:10rcassidyis it because it's marked deprecated?
10:10sdegutisThat was my first guess, but -- oh yeah, I see it now in the metadata, :deprecated "1.2
10:10sdegutisThanks rcassidy.
10:11sdegutisCool feature!
10:20rcassidyyeah, that's super neat.
10:22sdegutisIs it possible to replace (if a b c) with a solution that uses (and) and/or (or)?
10:22sdegutisDisclaimer: this is a homework-style problem and not practical or something I would ever consider using
10:25rcassidy,(defn if-bad [a b c] (or (and a b) c))
10:25clojurebot#'sandbox/if-bad
10:25rcassidy,(if-bad true 1 2)
10:25clojurebot1
10:25rcassidy,(if-bad false 1 2)
10:25clojurebot2
10:25TimMc,(if-bad true false 2)
10:26clojurebot2
10:26rcassidyfiiiince
10:26rcassidy*fine
10:26rcassidythat's why I called it if-bad
10:26xemdetiaif-lucky
10:28Glenjaminuntil python 2.5, that was the only way to do ternary expressions :D
10:28TimMc,(({true (constantly 1)} (= 1 1) (constantly 2)))
10:28clojurebot1
10:28TimMc,(({true (constantly 1)} (not= 1 1) (constantly 2)))
10:28clojurebot2
10:29TimMc(the fundamentals of how to do it in swearjure)
10:39sdegutisrcassidy: nice!
10:40sdegutisGlenjamin: in Go it still is
10:41wutfwhat's a better way to do this? (->> ... (apply concat) (apply concat) (apply concat) (apply concat))
10:41sdegutisGlenjamin: also, your map-based solution uses strict evaluation on the clause that won't be run
10:41sdegutiswutf: flatten
10:56TimMc~flatten
10:56clojurebotflatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.
10:56TimMcwutf: ^
10:57sdegutisTimMc: either he has lists 4 levels deep and wants exactly only that gone away with, or he just wants the behavior flatten gives. I betted on the latter. It's a gamble I admit, but I took the chance anyway.
10:57sdegutiswutf: please confirm whether TimMc or I am right, so we can settle this dispute once and for good.
10:58TimMcOr you could do (for [a ..., b a, c b, d c] d) I think...
10:59TimMcmight need another level
11:01sdegutisTimMc: I don't think that'll produce the lists back, will it?
11:01sdegutisHmm. I wonder now.
11:01wutfi am working on it
11:01spion_is there a macro that acts like `use` for namespaces, but only within the passed s-expression?
11:02TimMc,(for [a [[[[4 5]]]], b a, c b, d c] d)
11:02wutfthe lists are super nested (((((
11:02clojurebot(4 5)
11:02TimMcwutf: Can you avoid the extreme nesting in the first place?
11:03spion_e.g. (using ['ns1 'ns2 'ns3] (expression))
11:03wutfit's due to using nested for loops to destructure a nested hash map
11:03TimMcwutf: You know that for can take multiple clauses?
11:04wutfyeah i guess i knew that. i don't technically need to nest them, it will destructure them right?
11:04wutfif i just include the appropriate bindings
11:04Glenjaminwutf: can you show us an example of the hash-map you're destructuring?
11:05wutfit's literally a nested hash map, exported to edn from json in python
11:06zerokarmaleftperhaps get-in would get you most of the way
11:06wutfi tried using that but couldn't get it to work
11:06Glenjaminyou can nest destructuring, i'm not clear why you'd need for loops
11:07wutfyeah so basically there is almost never a need for nested for loops right
11:07wutftrying this out
11:07Glenjaminthere are some needs, but it's not clear whether or not yours is one of them
11:08sdegutisspion_: you can make a macro that creates a temporary namespace (and destroy it when done) and calls 'use' inside it.
11:08zerokarmaleft,(let [[_ fruit _] (get-in {:foo {:bar {:baz ["cat" "apple" "car"]}}} [:foo :bar :baz])] fruit)
11:08clojurebot"apple"
11:08sdegutisspion_: I would advise against this however.
11:08sdegutiswutf: can you gist the json file or the hash-map itself?
11:09TimMcspion_: https://github.com/timmc/handy/blob/handy-1.7.0/src/org/timmc/handy.clj#L97 but I'd only use it for testing...
11:09TimMcorg.timmc.handy -- with-temp-ns
11:09wutf{"blah" : {"blerg" : {"bloom": {"blum": ...
11:10wutfi do have code that destructures it in one go using a doseq
11:10sdegutiswutf: there's gist.github.com
11:10spion_sdegutis: would be very convenient for things like om, e.g. (using ['om.dom] (dom goes here))
11:10sdegutisspion_: Personally I use (:require [some.lib :as lib]) and then just use (lib/foobar).
11:11sdegutisspion_: It's much easier to keep track of the symbols being used and where they come from.
11:11sdegutisspion_: also, you may want to split out some code into a namespace specific to using that library, where *all* the code in that file will be using that library.
11:11TimMcspion_: Yeah, don't use with-temp-ns for your main code. :-)
11:12spion_sdegutis: I think `using` would provide a compromise between ease of use and ease of tracking, as its very local so its only worth using if you are using many of those functions
11:12spion_(in that sense its better than :use)
11:12Glenjamin,(let [{ { { { :keys [blum] } :bloom } :blerg } :blah } {:blah {:blerg {:bloom {:blum 'abc} } } } ] blum) # wutf
11:12clojurebotabc
11:13sdegutisspion_: except then you can't scan the top of the file to see what other namespaces it requires, since you mix in uses anywhere in a file that could be any number of pages long
11:14wutfGlenjamin i'm having a hard time reading that :)
11:14spion_sdegutis: it would have to be require'd
11:14sdegutisspion_: but if you're firm-set in creating a macro like this, use basically does a combination of clojure.core/require and clojure.core/refer, so you could use those functions yourself in your own macro.
11:14sdegutisspion_: I can write that macro for you for $200 right now and be done in 20 minutes.
11:14wutfyou declared the structure of the data first, then provided the actual data, in the binding?
11:14Glenjaminyeah, the left-hand-side is the key bit
11:14wutfthen had transparent access to blum. i also need blah, blerg, bloom.
11:14spion_sdegutis: no need, I was just wondering if it was already there and I'm missing something. Thanks :)
11:14sdegutisSurely.
11:15Glenjamin,(let [{ { { { :keys [blum] } :bloom :as bloom } :blerg :as blerg } :blah :as blah } {:blah {:blerg {:bloom {:blum 'abc} } } } ] [blum bloom blerg blah])
11:15clojurebot[abc {:bloom {:blum abc}} {:blerg {:bloom {:blum abc}}} {:blah {:blerg {:bloom {:blum abc}}}}]
11:15wutfah
11:15wutfneat
11:15wutfi don't really understand the :keys [blum] part
11:16wutfalso not clear that this will actually loop over the entire map giving me access to all blah-blerg-bloom-blum combinations
11:16Glenjaminstarts to get a bit weird at that point, so a big (let [blarg (get-in data [...]) blah (get-in blarg [...]) might be clearer
11:16Glenjaminoh, you want to convert the entire map into locals?
11:17wutfyeah, i'm looping over the whole shebang and inserting it into datomic
11:17wutfi've done it like five different ways by now
11:17wutftrying to avoid side effects at this point
11:26wutfdestructuring is magic :)
11:29wutfi piped the (((()))) mess to flatten flatten which was at least less verbose than (apply concat) (apply concat)
11:52justin_smithTMA: regarding the discussion last night about evaluating things at compile time, anything defined with def is fully evaluated at compile time
11:53justin_smithI mean I guess reader macros could help if you want compile time eval inside a lambda somewhere, but defs are already compile time expressions
11:58sdegutisI'm back.
12:01xitriumAnyone here use transducers much? to programmatically build up a series of steps, do you typically pass around both the combined steps and the collection until you're ready to realize it?
12:02justin_smithxitrium: I've never actually used them that way. I've used them to replace a series of steps with a single combined transformation though.
12:03xitriumyeah, that's my aim too - just my steps are generated at runtime
12:03justin_smithsounds like a great use of transducers, yeah
12:04xitriumsweet
12:10sdegutisHi.
12:10sdegutisxitrium: what's the use-case btw? I'm intrigured by such a situation.
12:15sdegutisThis just in: All of my code sucks.
12:18sdegutisAbstractly, how would you implement a loop which runs (f) every 2 seconds until stopped?
12:18sdegutisI'm specifically asking you justin_smith and Glenjamin.
12:19Glenjaminerm, do you already have core async in the project?
12:19justin_smithsdegutis: how accurate does the timing have to be?
12:19sdegutisGlenjamin: not yet.
12:19sdegutisjustin_smith: not super accurate, just so long as it's no less than 2 seconds.
12:19justin_smithsdegutis: I'd use a ScheduledExecutorService (or a wrapper of that, like at-at)
12:20GlenjaminProbably Thread.new or future with a sleep then, and something to check for thread interrupts
12:20sdegutisAlso I'm using Clojure 8 and Java 8.
12:20Glenjamindepends how throwaway this is i suppose
12:20sdegutisNot very throwaway.
12:21sdegutisGlenjamin: I'm not opposed to including core.async.
12:21Glenjaminprobably go with justin's then
12:21sdegutisjustin_smith: thanks I will look into that Java Class.
12:21justin_smiththe advantage of ScheduledThreadpoolExecutorService or whatever it's called (I think I had it wrong above) is it gives nice tools for managing tasks and saying "start every X" or "run every X" (different things...)
12:21sdegutisjustin_smith: it's called ScheduledExecutorService I think.
12:21sdegutis"An ExecutorService that can schedule commands to run after a given delay, or to execute periodically."
12:21justin_smithsdegutis: https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ScheduledThreadPoolExecutor.html
12:22sdegutisSo yeah it sounds precisely as what i need.
12:22justin_smiththat's a class that implements SES
12:22justin_smithso I was right both times, one is the interface, the other is the class
12:23justin_smithsdegutis: anyway, the class is easy to use, but depending on how you feel about adding deps on random thin wrappers, at-at is even easier to use
12:24sdegutisjustin_smith: I think I'm somewhat similar to you philosophically in that I'm okay with using the Java class directly and dealing with slight Java ugliness in order to avoid adding an extra dependency.
12:25sdegutisYes ScheduledThreadPoolExecutor is right.
12:35sdegutisThis appears to be perfect.
12:36sdegutisjustin_smith: gratitude
12:41sdegutisjustin_smith: wow you weren't kidding! https://gist.github.com/sdegutis/d1109109bc56ab7ffb55
12:50max3if conversions is a map with functions as values (of the correct types) and vamp-key and value are both strings can someone tell me what this does: ((get conversions vamp-key) value)
13:00justin_smithsdegutis: nice, glad I could help - and yeah in my experience it is that simple
13:01TimMchyPiRion: Do you remember how to implement boolean in swearjure?
13:01justin_smithmax3: that looks up a function in conversions, and calls it with value as an argument
13:01justin_smith,((get {:frob inc} :frob) 0) ; max3 - it is doing this
13:01clojurebot1
13:02TimMcnvm, found it, I did the stupid thing: https://github.com/timmc/swearjure/blob/08895fd01e30b5c93225577ecb4165fd9dd3830e/src/org/timmc/swearjure.clj#L29-L31
13:09max3thank you justin_smith
13:17sdegutisStrange error.
13:17sdegutis"No matching method: SECONDS"
13:17sdegutisjava.util.concurrent.TimeUnit/SECONDS
13:17justin_smithsdegutis: I think your doto is a bit off...
13:18sdegutisSounds right.
13:18justin_smithsdegutis: SECONDS should be an arg, not something you call in the doto
13:18justin_smithso you need some parens somewhere
13:18sdegutisAhh yes. I see. Completely forgot parens.
13:18sdegutisjustin_smith: how did you know so quickly?
13:18sdegutisHow did you know it was a doto?
13:18justin_smithsdegutis: I was gonna say something but figured it was just a hasty paste with a bad edit
13:18justin_smithsdegutis: you shared a paste earlier, also I am psychic so there is that too
13:19sdegutisOh.
13:19sdegutisHaha.
13:19justin_smith"There are bugs, so many bugs"
13:19justin_smith"things throwing exceptions"
13:19justin_smithyour future is now known
13:20sdegutisLOL
13:21justin_smith"the stack traces - ongodly deep stack traces seemingly without end"
13:22sdegutisWow it's like you're reading the code right off my screen!
13:25sdegutisYay now my email queue can be a component!
13:34TMAjustin_smith: thanks, I did not knew that
13:38justin_smithsdegutis: on the psychic topic, I had the idea for an html widget to replace radio buttons and list selectors. It would be a magic eight ball (like the toy) and you click it and one of the options comes into view.
13:38sdegutisHaha! That is so impractical but fun.
13:38sdegutisLike 2048!
13:38sdegutisor http://mienfield.com/
13:40sdegutisThat was in response to justin_smith.
13:43justin_smithTMA: common source of bugs in deployment is the expectation that things inside def are not run when aot compiling (they are, because def is always fully evaluated as part of compilation)
13:45sdegutisTMA?
13:45sdegutisThe More A-you-know?
13:45sdegutisTime Matters Asynchronously?
13:45sdegutisHold on don't tell me, I can figure it out.
13:45justin_smithsdegutis: too many apples
13:46justin_smithhttps://en.wikipedia.org/wiki/TMA
13:46TMAsdegutis: you can figure out something, but I doubt it would be it
13:47rhg135I agree with the last one, cuz apples
13:47sdegutisOh! It's a nickname!
13:47sdegutisHaha I should pay more attention.
13:48sdegutisSo, I randomly emailed a random programmer whose blog I found via HN the other day. Actually had a pleasant correspondence! 9/10 would recommend.
13:56rhg135I thought it was normal to not be unpleasant to strangers
13:58sdegutisrhg135: but it's not normal to email strangers and discuss code
13:58sdegutisrhg135: what's your favorite proggin lang?
13:59rhg135sdegutis: I'm surprised you have to ask
13:59sdegutisrhg135: ah so Lua?
13:59TMArhg135: if you are right, I probably want to move to your country. which country that might be?
14:00rhg135Just*
14:00sdegutisrhg135: meh Lua's ok, but I don't see why it's your favorite, that's a bit excessive
14:00rhg135Somewhere in wonderland
14:02rhg135It's a midpoint between clojure and c
14:02sdegutisrhg135: true enough
14:03justin_smithI think the "politeness to strangers" thing mainly varies with population density. In less crowded places you have more incentive not to piss anyone off, in more crowded places you have less disincentive to be a jerk (both of thse because of probability of ever seeing the person again)
14:04justin_smithlike, in a town with 100 people making one enemy is a big problem, in a city you can make many enemies and usually never see them again
14:04sdegutisGuys help me work on the edges of the hole at http://mienfield.com/948_-957
14:05rhg135If I get a random email, I don't reply with 'f*** off' I just won't reply. Maybe that's what you meant
14:06sdegutisrhg135: well a more polite version of that, yeah
14:06sdegutisrhg135: "sorry, I don't know you and this is weird, please don't ever email me again, good bye"
14:06sdegutisrhg135: which I did get once actually a few years ago
14:07rhg135Lol
14:08sdegutisrhg135: they're actually the more prudent ones of the group, since they know better than to talk to strangers
14:09rhg135My approach has been to lure them on irc and convince them it's pointless
14:09sdegutisrhg135: in this case I'm not creepy or deranged, but they never know -- I would answer similar to that one person
14:09sdegutisrhg135: what's pointless? you mean "pointless" or point-free style in Haskell?
14:09sdegutisrhg135: why are you talking about Haskell suddenly? where'd that topic change come from?
14:10rhg135Ah, context. I get inquiries about an ancient device and its software
14:11sdegutisOh.
14:13rhg135It's pointless in the sense that even if by some miracle you got anything working, nobody knows wtf a gelato is (not the desert)
14:15justin_smithrhg135: the gelato desert is a harrowing wasteland of pistachios
14:15justin_smith(sorry)
14:17rhg135Mmm pistachios
14:17sdegutis:)
14:17sdegutisfwiw I don't know what a gilato is even as a dessert
14:18justin_smithsdegutis: gelato is italian style ice cream - more fat and less water than normal ice cream, the good stuff is like frozen butter with sugar and flavors
14:19sdegutisOh weird.
14:19justin_smithit's so heavy that the scoops are much smaller usually (but just as filling)
14:19sdegutisYesterday I learned that I really like Mexican food, which I never thought I would like. My wife made these chicken wraps, and they were delicious. It was chicken, mayo, salsa, cayanne pepper, a little cucumbers, and some honey, wrapped in a tortilla. It was great.
14:20sdegutisAlso she makes these nachos that are just excellent. Hold on I'll get a photo for you.
14:21sdegutisNever mind I can't find it you'll just have to trust me on it.
14:21justin_smithit's for the best I am on an immutable data structure diet so it would just be a tease
14:23rhg135Food in general is mutable
14:23justin_smithrhg135: oh man that makes me think of 2g1c as swap! and uck
14:23justin_smithsorry for that image
14:24rhg135My brain can't form imagery yet, so it's all good
14:25justin_smithlucky
14:26rhg135I tried writing C once, I've never been three same
14:38sdegutisrhg135: false
14:39sdegutisrhg135: food runs through a digest function which hashes it into poop
14:40sdegutisMy code has a really strange and ugly dependency tree.
14:41sdegutisMost of my components do not have any dependence on the app's primary business logic, so the graph strictly flows outward. But two do, and it's weird.
14:41sdegutisHow do you solve this? Extract it into a function that you give the component which it can then call?
14:43wouter_hello, i was wondering if anyone can help me. I have written a macro in Clojure for use in Clojurescript, but I get Uncaught SyntaxError: Unexpected token . . A simplified version of the macro I was writing is: (defmacro test [x] `(defmulti ~x (fn [& _] :default))). can someone help me?
14:44sdegutiswouter_: hi
14:44wouter_hi sdegutils
14:44sdegutiswouter_: Check if ClojureScript has defmulti.
14:44sdegutisMaybe it does not?
14:45wouter_i have used defmulti and defmethod in clojurescript before
14:45sdegutiswouter_: Then I'm wrong.
14:46sdegutiswouter_: That was as much assistance as I can be of. Good day.
14:46wouter_alright thank you
14:46sdegutiswouter_: You're very welcome. Best of luck to you finding out your solution.
14:46wouter_thanks
14:47justin_smithwouter_: have you tried macroexpanding the macro?
14:47justin_smithwhere does it insert a . ?
14:47wouter_yes, that works actually. wait, i will give you the result
14:48justin_smithwouter_: I think your [& _] has to be [& _#] because `
14:48wouter_so i try the following in clojurescript: cljs.user> (macroexpand-1 '(nedarch.helper/dm bla)) (clojure.core/defmulti bla (clojure.core/fn [& nedarch.helper/_] :default))
14:49justin_smith[& nedarch.helper/_] is the problem
14:49justin_smiththat is not a valid binding
14:49justin_smithif you change _ to _# that will be fixed
14:49wouter_alright, thanks a lot! i will try to see if it works!
14:52wouter_no, it does not work unfortunately. even if i remove the & and _ for the purpose of testing and replace it with (fn [y] ...), it does not work unfortunately
14:52justin_smithwouter_: NO
14:52justin_smithyou did not do what I said
14:52justin_smithreplace _ with _#
14:52justin_smithor replace your y with y#
14:53justin_smiththe problem isn't that _ is _, it is that it does not end with #
14:53justin_smith,`(fn [x] x)
14:53clojurebot(clojure.core/fn [sandbox/x] sandbox/x)
14:53justin_smith,`(fn [x#] x#)
14:53wouter_sorry, it works, i tried that first but somehow it was not compiled. this seems to work!
14:53clojurebot(clojure.core/fn [x__49__auto__] x__49__auto__)
14:53justin_smithsee the difference?
14:54wouter_yes, thank you very much justin, i can now continue with my program :)
14:54justin_smithcool, sorry for the CAPS
14:54justin_smithhaha
14:54wouter_no worries, thanks a lot! :)
14:56sdegutisYou know, I've been meaning to write my Clojure-like language for a few years now. But I keep thinking to myself "nobody will use this, in fact I will probably rarely use this," and it's been convincing me to use my time for other things instead.
14:56sdegutisBut I think it's time to just ignore that fact and start working on it.
14:57sdegutisBecause even if it's not useful to me or anyone I know, it could eventually be useful to someone. Maybe. Or something.
15:23sdegutis,`(fn [x#] x#)
15:23clojurebot(clojure.core/fn [x__25__auto__] x__25__auto__)
15:23sdegutisCool.
15:23sdegutis,`(fn [x#] (str 'x#))
15:23clojurebot(clojure.core/fn [x__50__auto__] (clojure.core/str (quote x__50__auto__)))
15:23sdegutis,(`(fn [x#] (str 'x#)) "foo")
15:23clojurebot#error {\n :cause "clojure.lang.Cons cannot be cast to clojure.lang.IFn"\n :via\n [{:type java.lang.ClassCastException\n :message "clojure.lang.Cons cannot be cast to clojure.lang.IFn"\n :at [sandbox$eval76 invokeStatic "NO_SOURCE_FILE" 0]}]\n :trace\n [[sandbox$eval76 invokeStatic "NO_SOURCE_FILE" 0]\n [sandbox$eval76 invoke "NO_SOURCE_FILE" -1]\n [clojure.lang.Compiler eval "Compiler.java"...
15:24sdegutis,((eval `(fn [x#] (str 'x#))) "foo")
15:24clojurebot"x__100__auto__"
15:24sdegutisHahaha. Silly Clojure, escaping details.
15:33KamuelaI think I'm looking for some pain tonight. Ok. So is it Emacs with Cider that's the ultimate setup?
15:33TimMcthat'll get you some pain, sure
15:33TimMcmore the cider part of things
15:34amalloywell, if you're not familiar with emacs there's some pain learning that stuff
15:35amalloyalso if you do start learning emacs, my advice is to do something to make the mouse and arrow keys both un-usable and then press ctrl-h, followed by t, to start the tutorial
15:37TimMcGood point. Kamuela, how familiar are you with Emacs to begin with?
15:38TimMcamalloy: I should go through the tutorial again at some point. :-P
15:44sdegutisKamuela: in my opinion it's the best interactive experience, but it also needs paredit
15:44KamuelaTimMc: pretty much zero
15:44sdegutisKamuela: ok then you're in for about 2 weeks of nothing but pain
15:44amalloynah
15:45Kamuelasdegutis: is paredit not part of cider?
15:45sdegutisKamuela: I'm super productive in Emacs with Paredit and Cider but I have absolutely no idea how to use it anymore, only my fingers remember how.
15:45sdegutisKamuela: it is not
15:46amalloysdegutis tries to be helpful sometimes but right now i think he is just trying to scare you
15:47sdegutisKamuela: yah I was exaggerating just a bit.. expect to have some bumps in the road and frustration while teaching your fingers how to use emacs, but in about 1 or 2 weeks you should be pretty comfortable using it.. and in another 2 weeks you should have a decent ~/.emacs.d/
15:47KamuelaIs this a decent guide? http://www.braveclojure.com/basic-emacs/
15:48sdegutisI forgot what guides I used for learning Emacs like 4 years ago.
15:48justin_smithKamuela: the C-h t thing amalloy mentions (the built in tutorial) has the most important basics
15:49KamuelaI'll follow this guide then and make sure to do the built in tutorial
15:49sdegutisyeah definitely, although it's written terribly and extremely verbose and time-consuming
15:49sdegutis(the builtin guide)
15:50sdegutisIt's almost as if it were written by RMS.
15:50justin_smithsdegutis: it needs big blocks of text so you can practice all the motion commands
15:50justin_smithsdegutis: I think it might have been written by RMS
15:50sdegutisjustin_smith: that explains it then
15:50sdegutisjustin_smith: if #2 is true then #1 is merely coincidence
15:50sdegutisAlthough I admit #1 is a real benefit.
15:51rcassidyi'm doing pretty OK with vim, paredit, and fireplace, if you're already somewhere in that camp, but i bet emacs/cider is awesome too. sounds like it's more integrated.
15:52sdegutisrcassidy: lately cider shows you the evaluated result in-line in your text file (highlighted as a comment) and it disappears as soon as you do anything, which is convenient
15:52justin_smithI've been using clojure-mode and evil, and might have to try the vim/fireplace thing one of these days. The new lady on my team uses vim/fireplace and it looks decent.
15:52rcassidysdegutis: in-line in the file? as a comment? woah.
15:52sdegutisrcassidy: in the buffer, yeah
15:52rcassidywoah
15:52sdegutisit's super neat
15:53justin_smithkind of like light-table?
15:53rcassidyi'm not sure if i want that, but it sounds flashy
15:53sdegutisjustin_smith: probably, I dunno
15:53sdegutisrcassidy: it's been very convenient, I have to admit
15:53sdegutisIt's also got var-aware, namespace-aware auto completion.
15:54sdegutisIt's pretty much a sweet IDE at this point.
15:55sdegutisIt's also got a nice function to replace the result of your function call in-line, so if you type (vec (range 5)) and then press C-c C-w, it replaces it with [0 1 2 3 4] in your file.
15:56sdegutisThat's not super useful but it's neat anyway for the few times you want to put literal data in your file for whatever reason.
15:56TimMcKamuela: This is an emacs pre-guide that I wrote when I was first learning it: https://www.brainonfire.net/blog/emacs-n00b-start/ The idea is to read that first, then go to some other guide. This one just teaches you the basics like how to cancel, how to quit, and some terminology.
15:57ystaeldidn't emacs used to have C-x C-c, C-g, and C-h t mentioned on the startup screen?
15:57sdegutisHmm. I wrote a starter kit slash cheat sheet a few years ago, but there was 0 interest in it so I deleted it.
15:57justin_smithystael: it still does, but who actually reads that stuff :)
15:58sdegutisjustin_smith, ystael: especially when you can just do (setq initial-scratch-message "" inhibit-startup-screen t inhibit-splash-screen t) to avoid seeing it
15:58ystaelooh, I didn't know about `initial-scratch-message`
15:59sdegutisYou'd be surprised how many variables Emacs comes with, especially ones that seem a bit redundant.
15:59justin_smithsdegutis: if you know how to do that you probably don't need C-h t, but maybe someone made a bad choice when designing a starter kit you use, who knows
15:59sdegutis:D
16:00sdegutisjustin_smith: meh I was more or less trying to make a bad joke
16:00sdegutisspeaking of bad jokes
16:00sdegutishold on im looking for it
16:02sdegutisi made this dad-joke this weekend http://i.imgur.com/oeLDBhB.jpg
16:12Kamuelai notice that i find ctrl on mac really hard to deal with
16:12Kamuelais emacs basically built around ctrl and alt commands?
16:13justin_smithKamuela: yeah, it helps to swap control and caps-lock
16:14postpunkjustinKamuela: how often do you use caps lock?
16:14postpunkjustindammit double justin again
16:14Kamuelahmm
16:14postpunkjustinI'll get you one of these days, justin_smith
16:14justin_smithpostpunkjustin: I'll rate limit and give you a chance
16:14KamuelaIt's possible that I can just work through my disability for a bit because I do tend to use caps lock without thinking
16:15postpunkjustinKamuela: that sounds... bad?
16:15justin_smithclearly a professional spammer or troll
16:15Kamuelahaha
16:15justin_smithwrites sql or basic or fortran?
16:16Kamuelasql and TOO_MANY_CONSTANTS
16:19spuzanyone here use Lighttable?
16:19spuzI am trying to run a test but it does not seem to load the definitions in the source file I am testing
16:19spuzhow do i get it to include definitions from another file when running the tests?
16:20justin_smithspuz: you use require to require the namespace you are testing
16:21spuzjustin_smith, i've done that
16:22spuzthe test file works if I run it with 'lein test'
16:22postpunkjustinspuz: do you have to evaluate the ns declaration maybe?
16:23spuzpostpunkjustin, maybe but it seems the state of one evaluation does not carry over to the next
16:23spuzwhen i evaluate the ns, I see the result is 'nil', but it doesn't seem to help resolve the function call when i evaluate the test definition
16:24postpunkjustinoh, that's really odd
16:24postpunkjustinI'm afraid I don't have much else to offer; I don't actually use LightTable
16:25spuzI will try something else
16:39Kamuelalol it said when you open emacs you may see a lot of activity while it downloads packages. so if I don't see it, here's my first hurlde
16:42spuzKamuela, are you trying to use emacs for the first time?
16:42spuzI am investigating it right now
16:42sdegutisKamuela: I have rebound caps lock to be control within Mac's system preferences -> keyboartd
16:43spuzdo you have any guides to point to?
16:43Kamuelayeah I'm using this spuz http://www.braveclojure.com
16:43Kamuelabut no one necessarily says it's the best or anything
16:43sdegutishaha
16:43sdegutissurely amalloy knows of some guide that he recommends or something
16:45spuzdoes spacemacs offer any advantage over vanilla emacs other than vim like keybindings?
16:45postpunkjustinspuz: most definitely
16:46postpunkjustinit also has better discoverability, sensible configurations for a lot of languages, basic package management
16:46postpunkjustinand some other stuff
16:46spuzpostpunkjustin, would you recommend it to someone who is totally unfamiliar with emacs and only a little familiar with vim?
16:47spuzmy primary aim is to have an intelligent clojure editor
16:47postpunkjustinI guess? It's hard for me to say since I was pretty familiar with both when I started using it
16:47KamuelaDoes this look like an emacs config to anyone here? https://github.com/flyingmachine/emacs-for-clojure
16:47j-pbspuz: use intellij + cursi e
16:47spuzi.e. with all the shiny things like inline docs, syntax highlighting, repl integration etc
16:47j-pbcursive, it's not open source but gets you started in no time without having to follow down any config rabit hole
16:48spuzj-pb, cursive is great but I want to see what the free options are like before settling on the $120 price tag
16:49spuzI've used it for 30 days an am reasonably happy with it but it is a little clunky in some respects
16:49Kamuelaspuz: are you using it commercially?
16:50spuzKamuela, no
16:50Kamuelaif you're honestly just dabbling or open source, apply for a license and you'll get one $0
16:50spuzhmm
16:50spuzwhat is the difference between a personal license and a non-commercial license?
16:51Kamuelapersonal is it's just for you but you sell software
16:51Kamuelanon-commercial means open source or practice
16:51Kamuelapersonal projects
16:51Kamuela<- not a lawyer
16:52spuzgreat
16:52spuzwell I can start coding again then :)
16:54KamuelaShould ~/.emacs.d be a directory full of themes?
16:58justin_smithKamuela: I'd say .emacs.d is a decent place to put a theme, but it should also have your init.el (your config file) and other elisp code
16:58Kamuelajustin_smith: I'm wondering if I set this up wrong by copying a directory into .emacs.d rather than the contents of that directory
16:59justin_smithKamuela: that could be, maybe it wants themes to be in a subdirectory - that seems cleaner at least
17:00justin_smithyou can probably explicitly tell the theme user where to find the themes, regardless
17:00Kamuelajustin_smith: well that init.el thing is currently in .emacs.d/subdirectory-of-thing/init.el
17:00justin_smithsubdirectory of what thing?
17:01justin_smithKamuela: emacs looks for init.el in specific places, the lib might have its own init, but you should have an init.el as well, and that should be directly in .emacs.d
17:01Kamuelai will see what explodes by moving it up one
17:02sdegutisAhh, I remember the first time I configured ~/.emacs.d/
17:02sdegutisI still have tons of "WTF" code in there that I just don't care about and it gets the job done so whatever.
17:02justin_smithhell I remember having to chance from ~/.emacs to ~/.emacs.d/init.el
17:02justin_smithsdegutis: mines all refactored into separate namespaces and stuff
17:03sdegutisjustin_smith: yeah mine too, kinda sorta
17:03sdegutisjustin_smith et al: This is my init.el https://gist.github.com/sdegutis/30b881ad500660c5abea
17:03sdegutisTerribly stupid way to load "modules" but meh it gets the job done.
17:04justin_smithright, pretty much how I do it, but I also have some conditionals for emacs versions and whatever
17:04sdegutisPlus things are not really in the right files, like necessities.el and startup.el and os.el are all conflated
17:04sdegutisjustin_smith: Ahh I just use the latest and be done with that.
17:05sdegutisAlso I have all of ~/.emacs.d/elpa under version control.
17:06sdegutisHonestly I did give that bundler thing a try, but I dunno it just didn't settle well.
17:07sdegutisForgot what it was called
17:08Kamuelaok moving it to the root did the trick
17:08KamuelaI'm at the very least at this guy's setup
17:09sdegutisI think it was Cask?
17:10Kamuelawell I think this setup includes paredit because that bit is happening
17:10KamuelaNot sure if the repl or cider bit is happening
17:11sdegutisOh yeah! Cask used to be called Carton. That's when I was trying it out.
17:19rhg135sdegutis: I was perfectly fine without that image
17:19sdegutisrhg135: sorry what image again?
17:20rhg135"<sdegutis> rhg135: food runs through a digest function which hashes it into poop"
17:20sdegutisrhg135: oh, right
17:20sdegutisrhg135: hey dont blame me i didnt invent digestion
17:21paul_muadib666can somone help me with a cider issue? I have ring setup to start nrepl when i run 'lein ring server', when I later try to use 'cider-connect' to connect to the nrepl port, it claims cider-nrepl isn't installed
17:21paul_muadib666though I have cider-nrepl declared in my profiles.clj file
17:23TristeFigureHi. I'm having a silly problem. I'm trying to (use 'some-name-space) I placed in the test folder, but I get FileNotFoundException Could not locate... The file is test/entomologist/gentests.clj and the ns statement reads like (ns entomologist.gentests ....) What am I doing wrong ?
17:24TristeFigureBesides, there is nothing wrong with underscores in my file names
17:24rhg135sdegutis: to be pedantic digestion is hardly of type Food->Poop
17:26amalloyFood -> (Calories, Poop)
17:26sdegutisrhg135: Yeah amalloy's correct it's more of a monad
17:26rhg135and Gas
17:26amalloythat's not really a monad at all
17:26amalloyyeah, (a,b) doesn't admit a monad instance
17:26sdegutisOh, well fine then.
17:26sdegutisThen DONT implement digestion in Haskell for all I care.
17:27rhg135and calories would be an input
17:27rhg135the canonical implementation is in DNA
17:30rhg135sdegutis: amalloy: technically all this is in the BodyProcess Monad which abstracts away the details of how the body finances it
17:30sdegutisUm, did str/split change behavior in Clojure 1.8? I'm not seeing it in the release notes.
17:31sdegutisIt's throwing an exception when I didn't think it should.
17:31rhg135It shouldn't have
17:32sdegutisOh no wait I'm just stupid ignore me.
17:32rhg135typo?
17:32sdegutisHaha! Nope. Someone created invalid data in production.
17:32sdegutisOh man. I should foolproof this stuff a little more.
17:33rhg135oh
17:34rhg135this is why db's have schemas, too bad they don't work well enough
17:35sdegutisThe more I look into it the more I think it's not actually an inconsistency in the database, it's just retarded code I wrote that assumed things which I guess are no longer true.
17:35sdegutisAlso, Datomic is just plain awesome.
17:38rhg135it'd be rather cool to have a db enforce invariants at transaction time
17:38TristeFigureResolved my own problem : I wasn't in my project folder :facepalm:
17:40sdegutisrhg135: what's an invariant btw
17:41cortexmanwhy is it called figwheel?
17:41rhg135sdegutis: an INvariant
17:41sdegutisrhg135: sorry whats an INvariant
17:41sdegutiswNNNNNbc
17:41csd_Can someone explain what exactly is happening in clojure.main on the first line REQUIRE.invoke(CLOJURE_MAIN)? When I try to reason out what's happening I end up with invoke() being applied to an an instance of Unbound, which is an exception. I'm sure I'm missing some assignment somewhere but not clear exactly what I'm missing
17:43rhg135sdegutis: "a function of the
17:43rhg135 │ │ coefficients of one or more forms, which remains unaltered, when these
17:43rhg135 │ │ undergo suitable linear transformations
17:43rhg135eh
17:43sdegutisrhg135: I'm scared
17:43rhg135sorry
17:43sdegutisrhg135: water under the bridge
17:44hiredmanwhy do you think REQUIRE is Unbound?
17:44rhg135I've since learned to get a good dictionary
17:44csd_hiredman: a newly created var sets root = Unbound
17:45hiredmansure, but using RT causes RT's static initializers to run
17:46csd_oh maybe now i'm hitting the edge of my java knowledge. what exactly happens w/r/t what you're referring to?
17:47hiredmanloading the RT class causes clojure.core to load
17:48sdegutisFixed. Phew.
17:49csd_hiredman: oh i see that now. but still how does REQUIRE's root not get set to Unbound?
17:52rhg135csd_: you have to do something like REQUIRE = RT.var(...) not just instatiate a var
17:52csd_rhg135: this is me trying to understand the the opening line of main.java's main()
17:53rhg135ah, then nvm
17:54csd_it seems that RT.var creates var REQUIRE with root = Unbound but that some static magic in RT changes the value of root, or something
17:57sdegutisbye
18:08Trioxinwhy hasn't Clojure and Scala overtaken the popularity of Java? It only makes sense. Academia?
18:09TrioxinJava is pretty much #1 and the other two are nowhere on the map
18:10csd_i think being effective in clojure requires some knowledge of java.. i imagine scala might be similar
18:10rhg135csd_: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/main.java#L20
18:11csd_rhg135: yeah that's the code i'm looking at
18:11rhg135that's what sets REQUIRE
18:12csd_rhg135: my question is about line 36. i cant find where REQUIRE is bound to anything prior to invoke()
18:12rhg135lines 19-23 are executed at class load
18:13csd_yeah i know
18:13Trioxinhell i would just stick with javascript since we have things like nwjs and cordova if concurrency weren't so damn annoying
18:13csd_but line 20 AFAICT only creates the var. i dont see where it binds it
18:15rhg135it doesn't. it looks it up in the environment and as hiredman said RT loads loads core
18:15rhg135then at line 36 clojure.main is required through it
18:15csd_ok but where does it do that lookup
18:16rhg135RT#var gets a var by name
18:16csd_it interns the var
18:17csd_doesnt that only mean declaring it
18:17csd_RT.var = return Var.intern(...
18:18rhg135but if it is bound then it will be a bound
18:19csd_but where does that happen
18:19rhg135and RT loads clojure.core
18:20rhg135thus #'clojure.core/require already exists and RT#var return the var already bound.
18:20csd_oh i see what you're saying
18:21rhg135and vars are mutable hence those vars like on line 21 are unbound until REQUIRE loads clojure.main
18:22csd_and so when load('clojure/core') is run, which files exactly are being loaded? i dont see any reference to the compiler so i dont think it can be the clj files yet
18:24rhg135I'm not sure, the clojure java code is a special kind of beautiful
18:25csd_haha
18:25rhg135the clojure clojure code though...
18:26csd_tell me about it... i was looking at the code for (destructure) earlier
18:26rhg135it's a mixed bag
18:26csd_if someone accustomed to haskell wrote clojure
18:26csd_but without the helpfulness of type signatures
18:27rhg135some of it is so minimal it's beautiful
18:33csd_thanks for your help
18:35rhg135np
18:57Guest50097hi, having this (defmacro mac [a] (list a 2 3 4)) I call it with (mac 1) and it returns (nil 2 3 4). Why?
18:58hiredmanit doesn't do that, you are mistaken
18:59Guest50097hiredman: you mean it returns (1 2 3 4)
18:59Guest50097?
18:59hiredman,(defmacro mac [a] (list a 2 3 4))
18:59clojurebot#'sandbox/mac
18:59hiredman,(mac 1)
18:59clojurebot#error {\n :cause "java.lang.Long cannot be cast to clojure.lang.IFn"\n :via\n [{:type java.lang.ClassCastException\n :message "java.lang.Long cannot be cast to clojure.lang.IFn"\n :at [sandbox$eval52 invokeStatic "NO_SOURCE_FILE" 0]}]\n :trace\n [[sandbox$eval52 invokeStatic "NO_SOURCE_FILE" 0]\n [sandbox$eval52 invoke "NO_SOURCE_FILE" -1]\n [clojure.lang.Compiler eval "Compiler.java" 6927]...
19:02AimHere,(mac +)
19:02clojurebot9
19:02AimHere,(mac list)
19:02clojurebot(2 3 4)
19:05Guest50097:]
19:43QuezionIs there a way to work-around namespace collisions from protocols in another namespace?
19:43QuezionE.g. Namespace A and B both protocol X. I want to use both versions of the protocol in the current namespace
19:45QuezionIf I require namespace A :as A, I still can't access the protocol. A/ProtoX/method naturally throws an error.
19:57QuezionIs there a way to import/use two protocols with the same name into the current namespace?
20:07justin_smithQuezion: it's not A/ProtoX/method it's just A/method
20:07justin_smithor (.method thing)
20:07justin_smithQuezion: just like in Java you wouldn't type the name of the interface into a call on an interface method
20:11Quezion@justin_smith: That fixed it, thanks! I'm guessing you can't have a protocol method and a function of the same name in the same namespace, then?
22:16srrubyHow do I accomplish (.indexOf "dog" ["cat" "dog"]) ? answer should be 1
22:17srrubyJava interop here
22:17TEttingerwell you're calling that on the String "dog"
22:17TEttinger(.indexOf ["cat" "dog"] "dog" )
22:17TEttinger,(.indexOf ["cat" "dog"] "dog" )
22:17clojurebot1
22:18TEttinger(.indexOf "dog" \g)
22:18TEttinger,(.indexOf "dog" \g)
22:18clojurebot#error {\n :cause "No matching method found: indexOf for class java.lang.String"\n :via\n [{:type java.lang.IllegalArgumentException\n :message "No matching method found: indexOf for class java.lang.String"\n :at [clojure.lang.Reflector invokeMatchingMethod "Reflector.java" 80]}]\n :trace\n [[clojure.lang.Reflector invokeMatchingMethod "Reflector.java" 80]\n [clojure.lang.Reflector invokeInst...
22:18TEttingerhm
22:18TEttingerwell the main takeaway is .method takes the object with that method as its first parameter
22:19srrubyok parameter order was wrong. (.indexOf [:a :b :c :d] :c) works
22:20srrubyTEttinger: Thanks
22:21TEttingerglad to help
22:34paul_muadib666two questions. what does :- mean? how can i search that pattern in google?
22:36srrubyHow come this works (update-in ["1" 2] [0] #(Integer/parseInt %))
22:37srrubybut this doesn't (update-in ["1" 2] [0] Integer/parseInt)
22:38TimMcpaul_muadib666: You probably found that in... let's see, something that uses schema?
22:39paul_muadib666TimMc: I believe so I'm playing around with compojure, yet me check the deps tree and see if anything uses that
22:39TimMchttp://symbolhound.com/ sometimes helps but not in this case
22:39TEttingersrruby: because oddly, java interop method calls don't act like normal clojure fns. there is memfn to turn something like that into a fn
22:40paul_muadib666yes compojure-api has a dependency on prismatic/schema
22:40TEttinger,(doc memfn)
22:40clojurebot"([name & args]); Expands into code that creates a fn that expects to be passed an object and any args and calls the named instance method on the object passing the args. Use when you want to treat a Java method as a first-class fn. name may be type-hinted with the method receiver's type in order to avoid reflective calls."
22:40TEttingerhm, not static
22:41TEttinger,(update-in ["1" 2] [0] read-string)
22:41clojurebot[1 2]
22:41srrubyTEttinger: Thank you.
22:42TimMcsrruby, TEttinger: read-string is a bit over-powered here...
22:42TEttingerit looks like you're getting into the trickier parts of learning clojure, srruby
22:42TEttingeryes
22:42TimMcI would use Integer/parseInt for sure.
22:42TEttingerI just needed a clojure fn for that that could be passed as an example
22:42TimMcah, ok
22:42srrubyNo, I just want to turn a string into an int.
22:42TimMcread-string has security implications, for one :-)
22:43srrubyRight
22:43TEttingersince Integer/parseInt isn't quite the same as a fn... what is the recommended way for static members like that?
22:44paul_muadib666TimMc: I'm not having any luck finding that symbol on symbolhound :(
22:44TimMcTEttinger: #(Integer/parseInt %) :-P
22:44TimMcor Long/parseLong, really
22:44TEttingerpaul_muadib666: it is a keyword, and it might be used in a map
22:44TEttingeryeah
22:45TEttinger,(:- {:- 1 :D 2})
22:45clojurebot1
22:45TimMcpaul_muadib666: What's the context?
22:45paul_muadib666TEttinger: oh. that makes sense. I assumed a reader macro or something
22:45TEttingerno, that would be # something
22:46TEttingerthe only cases where reader macros don't start with # are probably things you use all the time
22:47paul_muadib666TimMc: going through this tutorial http://nblumoe.github.io/mundane-clojure-for-mortals/org/api-for-mortals.html#sec-7-1 , the symbol is in the last code block
22:47TEttingerhttps://yobriefca.se/blog/2014/05/19/the-weird-and-wonderful-characters-of-clojure/
22:48paul_muadib666nice, yall are full of choice links today :)
22:48TimMcpaul_muadib666: http://clojure.org/reference/reader is a good thing to look through now and then -- that's effectively the page on syntax
22:48TEttingerah! https://github.com/metosin/compojure-api
22:49TEttingerthat uses :- and is require'd in that link
22:49TimMcpaul_muadib666: Oh, looks like it's a keyword that has special meaning for that GET* macro.
22:52paul_muadib666TEttinger: what do you mean it's require'd ?
22:53TEttingeroh, either :require or :use , didn't checj
22:54TEttingerI just noticed that that API was being used from the code
22:54paul_muadib666ok, so if i check ns-publics in that namespace it should be there
22:55paul_muadib666welp library's closing, thanks for hte help TimMc and TEttinger!
22:55TEttingerprobably. it looks like they might have not written out namespace GET* is in, which is the one that has the funny meaning for :-
22:55TEttingerlater!
23:21kenrestivowhat's the most clojure-ish way to deal with configuration management in a large clustered app?
23:22rhg135Environ I think
23:23kenrestivofor large clusters? i've used environ. i found it limiting, now i use large edn conf files (with schema). but i'm not sure how this would scale
23:23tolstoyAre you talking about multiple services that consult a central service for configuration?
23:23kenrestivosomething like that might be necessary. or is it?
23:24tolstoyIMHO, as soon as you start asking that question, you're into "domain specific" solutions that depend on so many things outside the language of the app. But maybe I'm misunderstanding?
23:24rhg135Oh for clusters, hmm
23:27tolstoyHm. Something like puppet/chef plops an EDN file in a known-location on every filesystem, and you slurp it in? ;)
23:30tolstoyA long time ago, someone made a Zookeeper thing that had atom semantics. I bet that's fallen by the way side.
23:30kenrestivoi mean, there's etcd in coreos, for example. there's also chef/puppet/ansible. there's also just putting conf files in git and scp'ing them up, which is what i've been doing.
23:30kenrestivomy main curiosity is in clojure specifically
23:30kenrestivohow do people do it? what's the best practices?
23:30kenrestivoin other languages, there's a whole gaggle of different things all competing with each other. in clojure-land, what's the answer? i'll bet it's somethign simple and elegant
23:30kenrestivothen again, maybe the fact that this hasn't been a problem for me means that it just isn't a problem in clojure-land.
23:32tolstoyWhat's an example in another language?
23:32kenrestivoetcd, chef, puppet, ansible
23:33kenrestivosome people also use redis for that stuff
23:33tolstoyAh, so you're wanting a version of one of those, but written in Clojure?
23:33kenrestivono, and i'm having a tough time making the question clear
23:33kenrestivoit's a devops question.
23:35rhg135I'd think synchronizing some data would be rather common actually
23:35tolstoyYeah. Sorry. I assume configuration management is independent of the language a thing that needs to be configured is written in, hence my confusion.
23:36kenrestivoif you're rolling out a system with a bunch of microservices, dependent on databases, ip addresses, load balancers, etc, how do i get all that configuration to the clojure artifacts running the services? right now i just do "java -jar someuber.jar config.edn" and i have the config pushed out via scp.
23:36kenrestivoit's been fine for my small apps. i wonder how the Big Guys do it with large, hairy clojure apps.
23:36tolstoyYeah, that's what I do (now that I'm small time).
23:37tolstoyIn the past, I've had an RPM what had the central config with a key for individual apps to pick out, then just make apps depend on that.
23:37tolstoyBut, datomic would be an intereting choice. Maybe.
23:38kenrestivothanks. maybe the only people who'd really know are buried deep inside cognitecht or somewhere, and they're not going to share their secrets.
23:39kenrestivowho builds massive clojure apps with dozens or hundreds of instances?
23:43tolstoyHere's this thing, but you can see it's bitrotted: https://liebke.github.io/avout/
23:47kenrestivothanks. i think *shrug* is a perfectly valid-- and in this case, probably the most accurate-- answer.
23:57solatiskenrestivo: it's fairly simple, actually
23:57solatisi'm not sure if we qualify as "big guy", but we have around 100 servers / services
23:57solatiswe use AWS CloudFormation
23:58solatisa *huge* template
23:58solatisand it automatically writes a config.edn
23:58solatisthat is indeed imported in the way you describe
23:58solatisand then we use luminus/config to read out the config files
23:59solatisif you want to get inspiration how the Really Fucking Big Guys do it, look at Erlang / Elixir and how they do configuration management
23:59solatisbut it's hairy, and full of "service lookup services", etc
23:59solatisi like the simplicity of working with CloudFormation