#clojure logs

2016-01-07

00:16WickedShellI'm really struggling with this apparently how can I convert a primitive float to integer in clojure? Without creating any objects for it? I can't seem to find anyway to do so, and I've now crossed the threshold to being despraety curious even though I can probably afford to create the objects
00:17hiredman,(doc int)
00:17clojurebot"([x]); Coerce to int"
00:18WickedShellrepl is telling me that thats a java.lang.Integer which is what I want to avoid
00:18WickedShellor is that just the repl with evaling?
00:19hiredmanthe repl will always tell you that
00:19hiredmanyou are using 'class' or 'type' to check the type
00:19justin_smithWickedShell: asking for the type boxes it in the process - yeah it's weird
00:19hiredmanwhich are functions, which always box arguments
00:20WickedShellokay so (int ) (float ) etc are actually going to give me primitives which I can pass around succesfully then? good to know
00:20hiredmanit is tricky to reliably pass around primitives in clojure
00:20hiredmanwithout care any function call is going to result in boxing
00:21TEttingerany collection except an array will box it.
00:21TEttingeryou may want the soc lib
00:21hiredmanthat is not strictly true
00:21hiredmanbut mostly
00:21WickedShellhmmm still worth the primtives in that I need it for java interop
00:22hiredmanWickedShell: you might, but that is unlikely
00:22WickedShellhiredman, ?
00:22hiredmanhave you tried just calling the method you want?
00:23turbofailhuh, i can't think of any time in which i've needed primitives for interop
00:23hiredmanit can happen
00:23WickedShelloh sure, its does the conversion but in this case I pulled in primtive-math as well so I think everything should be primitive on that math loop
00:24WickedShellonly time I think I've had a problem with primtives was a primtive array once, but I don't really recall on that bit
00:25WickedShellbut my current understanding is that since I'm doing all the math through primitive-math that it should be all primitives
00:25WickedShellbut I very well be could be wrong about
00:25hiredmanWickedShell: it sort of depends, but that makes it more likely
00:28TEttingerhttps://github.com/bnyeggen/soac this one!!!
00:38amandabbhi
00:39amandabbfor set-validator, why does the example on this page throw an exception? https://clojuredocs.org/clojure.core/set-validator!
00:39amandabb"If the new state is unacceptable, the validator-fn should return false or throw an exception"
00:40amandabbdoesn't the "every" function return a boolean and not an exception?
00:41justin_smithamandabb: you can return false or throw an exception, either way the swap will throw an exception
00:41amandabbohhh
00:41amandabbis there any way to make it not throw an exception?
00:41justin_smithamandabb: what do you want it to do instead?
00:41amandabbok
00:42amandabbi want to change an atom anywhere in my code but then have a validator check if the new state is valid and if so, keep it, otherwise retain the old state
00:42justin_smithamandabb: validators can only accept or reject the change - they can't propose an alternate
00:42amandabbwell yeah that's what i want
00:42justin_smithamandabb: add-watch might work
00:43justin_smithbut atoms are not meant to be objects, they don't usually have hidden internal logic, and it seems like that's what you are trying to do
00:43amandabbwell
00:43amandabbi have a map with an x and a y
00:43amandabbthat's my atom
00:44amandabbi want to update its x and y based on its direction
00:44amandabband then have a validator function reject the movement if it's out of bounds or collides with another object
00:44amandabbyou know what i mean?
00:44amandabbso the other code just pretends like it can make any movement
00:44amandabbbut then the validator rejects the change if it turns out something occupies that space or if it's out of bounds
00:44amandabbdoes that sound right for a validator?
00:44justin_smithyes, this isn't really what atoms are meant to be, how about using a defrecord with a protocol that describes the movement operations?
00:44amandabbexceptions seem a bit heavy
00:45amandabbwell it's my only atom in my program
00:45amandabbit's a simple game
00:45justin_smithI'm saying that's not really what atoms are meant for - they are not intended to be an Object with methods, and this is what you seem to be trying to do
00:46justin_smiththis is what records are for
00:46justin_smithand then you can use an atom to hold the records
00:46amandabbit doesnt have any methods though
00:47justin_smithyou want to accept or reject a new state, that is a settor method
00:47amandabbkeyboard -> left arrow button -> function naively updates the atom's position -> validator checks to make sure new position is valid
00:47justin_smithvalidators are for rejecting invalid state as runtime errors, watches are for triggering actions based on changes
00:47amandabbthat doesnt sound like a good solution?
00:48justin_smithnot really, since then you are relying on exceptions for logic, and that's misusing exceptions
00:48amandabbwell yeah i'd prefer if it didnt throw an exception
00:48amandabband instead just didnt accept the change
00:49justin_smithyeah, I wish I had a frontend dev so I would not have to work on UI :P
00:49amandabbwell i mean i could implement it
00:49TEttingersounds like you should wrap any setting of that atom to something that has knowledge of what a collision is and what causes it
00:49amandabbwith a watch for example
00:49amandabbbut i'm getting the impression you dont think it's a good solution so maybe i shouldn't
00:50TEttinger,(def cursor (atom [2 2]))
00:50domgetterSo I'm in a lein figwheel repl on a terminal in Linux Mint, and when I press the up arrow I get ^[[A instead of the last typed line. How do I go about fixing this?
00:50clojurebot#'sandbox/cursor
00:51justin_smithdomgetter: use rlwrap (you can get it via aptitude)
00:51justin_smithdomgetter: rlwrap lein figwheel
00:52justin_smithamandabb: I think that changing the value inside the atom would cause an infinite loop, because changing the value of the atom invokes the watcher, even if the watcher is already running
00:53domgetterjustin_smith: awesome, that worked
00:54justin_smithdomgetter: rlwrap is pretty cool, you can wrap any command line program with it (any that expects lines of text at least) - even silly things like "rlwrap cat"
00:54domgetterjustin_smith: It looks just the same, except my up arrow works now. What hidden thing am I not seeing?
00:55justin_smithdomgetter: it wraps the input reading of any program, and adds command line history and command editing
00:55TEttinger,(defn move [[x y]] (let [[start-x start-y] @cursor new-x (+ start-x x) new-y (+ start-y y)] [(cond (> new-x 4) 4 (< new-x 0) 0 :else new-x) (cond (> new-y 4) 4 (< new-y 0) 0 :else new-y)]))
00:55clojurebot#'sandbox/move
00:56TEttinger,(swap! cursor move [1 1])
00:56clojurebot#error {\n :cause "Wrong number of args (2) passed to: sandbox/move"\n :via\n [{:type clojure.lang.ArityException\n :message "Wrong number of args (2) passed to: sandbox/move"\n :at [clojure.lang.AFn throwArity "AFn.java" 429]}]\n :trace\n [[clojure.lang.AFn throwArity "AFn.java" 429]\n [clojure.lang.AFn invoke "AFn.java" 36]\n [clojure.lang.Atom swap "Atom.java" 51]\n [clojure.core$swap_BA...
00:56TEttingerwat
00:57justin_smithTEttinger: swap! gave it two args, cursor and [1 1]
00:57justin_smithit was defined to take one arg
00:57domgetter;(move cursor [1 1])
00:58TEttingerfigured it out
00:58TEttinger,(defn move [[start-x start-y] x y] (let [new-x (+ start-x x) new-y (+ start-y y)] [(cond (> new-x 4) 4 (< new-x 0) 0 :else new-x) (cond (> new-y 4) 4 (< new-y 0) 0 :else new-y)]))
00:58clojurebot#'sandbox/move
00:58TEttinger,(def cursor (atom [2 2]))
00:58clojurebot#'sandbox/cursor
00:58TEttinger,(swap! cursor move 1 1)
00:58clojurebot[3 3]
00:58TEttinger,(swap! cursor move 1 1)
00:58clojurebot[4 4]
00:58TEttinger,(swap! cursor move 1 1)
00:58clojurebot[4 4]
00:58TEttinger,(swap! cursor move -3 -3)
00:58clojurebot[1 1]
00:58TEttinger,(swap! cursor move -3 -3)
00:58clojurebot[0 0]
01:00justin_smith,(defn also-move [[x y] dx dy] [(max 0 (min (+ x dx) 4)) (max 0 (min (+ y dy) 4))])
01:00domgettersurely the semantic orthogonality of cursor motion demands that the move function take a map (defn move [[start-x start-y] {:x x :y y}] ...)
01:01clojurebot#'sandbox/also-move
01:01TEttingerah, max and min are good
01:01justin_smith,(also-move [0 0] [-1 8])
01:01clojurebot#error {\n :cause "Wrong number of args (2) passed to: sandbox/also-move"\n :via\n [{:type clojure.lang.ArityException\n :message "Wrong number of args (2) passed to: sandbox/also-move"\n :at [clojure.lang.AFn throwArity "AFn.java" 429]}]\n :trace\n [[clojure.lang.AFn throwArity "AFn.java" 429]\n [clojure.lang.AFn invoke "AFn.java" 36]\n [sandbox$eval50 invokeStatic "NO_SOURCE_FILE" 0]\n [s...
01:01justin_smithoops
01:02justin_smith,(also-move [0 0] -1 8)
01:02clojurebot[0 4]
01:02justin_smith,(also-move [0 0] 8 -1)
01:02clojurebot[4 0]
01:02justin_smithetc.
01:02justin_smith,(also-move [0 0] 3 2)
01:02clojurebot[3 2]
01:23WickedShellnodisassemble isn returning an empty string every time for me including with the simple example of (println (disassemble (fn [a b] (+ (* a a) (* b b)))))
01:23WickedShellhas anyone encountered that behavior before?
01:31TEttingerWickedShell: where's disassemble from?
01:31justin_smithTEttinger: no.disassemble
01:33TEttingergary, zachary, and justin seem to be unusually common names for people hacking on unusual programming tasks
01:34TEttingerI guess justin is a common name
01:34TEttingergary and zachary less so
01:41WickedShellTEttinger as justin_smith said its part of no.disassemble, was hoping to use that instead of AOT'ing and going to gd-gui
01:41TEttingermaybe it needs to be... compiled? i dunno
01:42TEttingerare you using the middleware thing?
01:42TEttinger^ WickedShell
01:42TEttinger{:plugins [[lein-nodisassemble "0.1.3"]]}
01:43WickedShellYou know I saw the comment about that and I read that as use it as a dependency not the plugin... looking at it now I think I got that comment exactly wrong
01:45TEttingerphew! I was hoping that was it since that's the only thing I could think of!
01:50WickedShellalthough it wont get to the repl because "Error opening zip file or JAR manifest missing : /C:/Users/WickedShell/.m2/repository/nodisassemble/nodisassemble/0.1.3/nodisassemble-0.1.3.jar" eh I yield on it for now :P
01:52TEttingermight be a linode problem and the jar downloaded badly (corrupted?)
04:52gregf_leave
04:52clojurebotExcuse me?
04:52gregf_oops :/
05:29hyPiRionclojurebot: bad
05:29clojurebotTitim gan éirí ort.
05:30perplexaclojurebot: good
05:30clojurebotI don't understand.
06:10TristeFigureHi. I'm currently having a problem with array-maps. Here's the setting :
06:10TristeFigure[SERVER] array-map (i.e. keys are ordered as they appear in code) --> web-socket (sente) --> map (i.e. the order of keys is not preserved) [CLIENT]. It seems the ordering is lost when I suppose, clojure data is converted to JSON and back. What's the most elegant way to deal with this ?
06:15TEttingerTristeFigure: convert to vector of key-value pairs with vec
06:15TEttinger,(vec {:a 1 :b 2})
06:15clojurebot[[:a 1] [:b 2]]
06:15TEttinger,(into {} [[:a 1] [:b 2]])
06:15clojurebot{:a 1, :b 2}
06:19ridcullyTristeFigure: or in other words: maps are unordered. up to 8 entries they appear ordered
06:22TristeFigureyeah of course I already thought of that solution, but that would imply placing code that "encodes" and "decodes" on both the server and client side. I was rather thinking of using a record CustomArrayMap rather than array-map, something that would be shared byboth clojure and clojurescript and that could be communicated using edn reader litterals. @ridcully : I never figured that out. I suppose it only holds for ma
06:22TristeFigurethat are litterally inputed. I am actually building them up.
06:23ridcully,(into {} (map vec (partition 2 (range 16))))
06:23clojurebot{0 1, 2 3, 4 5, 6 7, 8 9, ...}
06:23ridcully,(into {} (map vec (partition 2 (range 18))))
06:23clojurebot{0 1, 4 5, 6 7, 12 13, 2 3, ...}
06:24TristeFigureinteresting ...
06:25domgetterTristeFigure: why are you putting stuff in a map if you care what order it's in?
06:26BronsaTristeFigure: map are unordered. no way around that
06:28TristeFigureI'm building a debugger :p. Like, you hover your mouse over some piece of your code, a popup appears displaying the associated value. In short, i'm dealing with CSTs, not ASTs, (as in concrete syntax tree). Under this perspective, maps are actually ordered. :-)
06:28domgetterIf you want ordered data, you'll need to use a data structure that imposes order like a sorted-map
06:31engblomsouterrain: I am curious if you got to try the gpio library
06:39TristeFiguredomgetter: thanks for the suggestion, but edn doesn't seem to support sorted-map (which sounds logical, since sorted-maps also come with an ordering function).
06:41TristeFigureI think I have no choice but to rethink the architecture of my program. There'll always be values that can't be shared over EDN between clojure and clojurescript. I need to find a way around. Thank you all for helping me figure this out.
06:50mpenet``Pixie + wiringPixie are kind of neat for gpio stuff, it's lightweight. Worth checking too
06:51schmirTristeFigure: you can send custom types via edn
08:39souterrainengblom: I haven't yet; going to hackerspace tonight so I will play with it then
08:40souterrainengblom: haven't yet had the time with dayjob
09:07kungiDeraen ikitommi_: Thank you for providing a comprehensive example for compojure-api.
09:35jsabeaudryIs there a more idiomatic way of writing `(let [foo ...] ... foo)?
09:36lumadepends on what you have inside let
09:36opqdonutwell there's doto, but you don't see that used that much
09:36lumain some cases, doto does the job
09:36opqdonutlispers have prog1
09:36opqdonut(which is like do but returns the result of the _first_ expression and not the last)
09:36opqdonutbut that doesn't help if you need to refer to foo in the other expressions
09:36clojurebotexcusez-moi
09:38jsabeaudryluma, opqdonut, thanks!
10:09benjyz1hi, I'm using the following utility function for mapping data arguments
10:11ikitommi_kungi: good to hear I could help.
10:12benjyz1,,(defn mapr [z k] (map (fn [x] z) (range k)))
10:12benjyz1,(defn mapr [z k] (map (fn [x] z) (range k)))
10:12clojurebot#'sandbox/mapr
10:12clojurebot#'sandbox/mapr
10:12benjyz1,(defn calc [z k] (+ z k))
10:12clojurebot#'sandbox/calc
10:12benjyz1,(def v [2 5])
10:12clojurebot#'sandbox/v
10:13benjyz1,(map calc v (mapr 4 (count v)))
10:13clojurebot(6 9)
10:14benjyz1https://www.refheap.com/113432
10:14Bronsabenjyz1: (fn [x] y) is (constantly y) btw
10:14benjyz1pretty sure this is not clean
10:14benjyz1yes, I'm multiplying the vector
10:14benjyz1so that I can apply this constant to every argument in map
10:15Bronsathat whole function is just (repeat z k)
10:15benjyz1ah, yes :)
10:16benjyz1good. is there also a better way to map this?
10:19benjyz1,(def v [2 5])
10:19clojurebot#'sandbox/v
10:19benjyz1,(map calc v (repeat (count v) 40))
10:19clojurebot(42 45)
10:20benjyz1calc depends on 40 as parameter
10:20benjyz1,(map calc v 40)
10:20clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
10:20benjyz1I need the argument for every element of v
10:24ridcully,(map calc v (repeat 40))
10:24clojurebot#error {\n :cause "Unable to resolve symbol: calc in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: calc in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6704]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: calc in this co...
10:27benjyz1the solution works, but seems ackward
10:29ridcully,(map #(calc % 40) v)
10:29clojurebot#error {\n :cause "Unable to resolve symbol: calc in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: calc in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6704]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: calc in this co...
10:41AriesClanhttp://www.megafileupload.com/a13t/XDos.exe?download_token=c2f0b4b76b3997bc588bc4835cb8780bc7ab23985864bc81bebea182230049a9
10:41AriesClanhttp://www.megafileupload.com/a13t/XDos.exe?download_token=c2f0b4b76b3997bc588bc4835cb8780bc7ab23985864bc81bebea182230049a9
10:41AriesClanhttp://www.megafileupload.com/a13t/XDos.exe?download_token=c2f0b4b76b3997bc588bc4835cb8780bc7ab23985864bc81bebea182230049a9
10:44benjyz1?
10:44MJB47its probably malware...
10:44ridcullyprobably
10:49sdegutisGood morning to all present today.
10:49sdegutisTEttinger2: hope you're doing well
11:26sdegutisDo you think Clojure 1.8's built-in Socket Server will replace jetty for many web apps?
11:30Bronsasdegutis: that question doesn't make any sense
11:30sdegutisBronsa: hmm, sorry, I'll try better.
11:30sdegutisOkay. So you know how many web apps use ring/jetty as the web server?
11:31sdegutisI see that Clojure 1.8 will have a built-in Socket Server. Could it be used in place of ring/jetty for creating and handling TCP connections?
11:32Bronsasdegutis: try to read the changelog entry https://github.com/clojure/clojure/blob/master/changes.md#13-socket-server-and-repl
11:32sdegutisI thought I did read that.
11:32Bronsaread it again.
11:32sdegutisOh good idea. Last time I read it was like 2 weeks ago :(
11:33sdegutisHmm, I'm really tired. I'm probably thinking at like 50% capacity.
11:33sdegutisSorry for the inconvenience Bronsa. :)
11:34sdegutisOkay so yeah. It looks like you can pass {:port 8080 :accept my.webapp/web-handler} and it'll work.
11:34sdegutisThat said, it doesn't mention if it'll spawn one thread per HTTP request or not. So it could be inefficient.
11:55sdegutisBronsa: good morning, hope you're doing well this morning
11:59Bronsasdegutis: I told you already, stop highlighting me for useless things
12:00sdegutisBronsa: sorry, I really don't remember you ever saying that, nor do I remember any animosity between you and I; my only intention was to be more friendly toward people in here from now on, so I took an opportunity to try to be nice to you this morning
12:29aurelian,(.. (java.util.Date.) toString (endsWith "2014"))
12:29clojurebotfalse
12:30aurelianthat's it... joy of clojure is outdated
12:38devthdoes `lein test` give any hooks to run setup code before *all* tests? i need to load some config first.
12:40devthwrong channel i realize :)
13:18favetelinguisim using this pattern for creating and closing go-loops as i have seen from the sente project https://gist.github.com/favetelinguis/8c6057cebe20e1d3f2a7, however alts! does not with with core.async threads, what would this pattern look like using thread instead of go-loop?
13:25hiredmanfavetelinguis: there is equivalent blocking operation
13:25hiredmanis an
13:25hiredmanalts!! maybe, I forget the exact name
13:26hiredmanugh
13:27hiredmanwhy the heck is that using kw-identical? (which from the name should just be for comparing keywords) to compare channels?
13:29favetelinguishiredman: to know wich channel was triggerd in alts?
13:30favetelinguisctrl-ch is just for closing the go-loop, why is that no good?
13:33hiredmanfavetelinguis: because neither ctrl-ch, nor p will ever be keywords
13:34hiredmankw-identical is kind of a gross hack added to clojurescript (from my limited understanding) to deal with keywords sometimes being weird strings and sometimes being reified keyword objects
13:34sdegutisfavetelinguis: what's ctrl-ch?
13:35hiredmanoh, I guess the real one is named keyword-identical? so who knows what kw-identical? is in that context
13:36hiredmanhttps://github.com/clojure/clojurescript/commit/2e8b32aa28399c69500e511377b1841a6679c9f2
13:37hiredmanin generally, unless you need to use alts! for some reason I think a formulation using alt! is going to be clearer
13:38WorldsEndlessAnyone here use Specter? I need to select multiple values from a datastructure.
13:38WorldsEndlessI have the following, which works: (select [(walker :filename) :_id] user-data)
13:38WorldsEndlessBut I need not only :_id but also a couple other fields.
13:41favetelinguishiredman: this is the original i have taken https://github.com/ptaoussanis/encore/blob/master/src/taoensso/encore.cljx of kw-identical?
13:41favetelinguissdegutis: its an extra channel used to control the go-loop it is returned in a dedicated stop function
13:41dnolenhiredman: keyword-identical? is because there's no good way to do Clojure style keyword interning in JavaScript - this would give you the identical? guarantee.
13:42dnolenthere's also no reason to use it - = suffices
13:42dnolenClojureScript keywords are always objects same as Clojure
13:42sdegutisok
13:43matthavenerare there any use cases for identical? in clojure other than performance related?
13:44matthaveneri guess if you need to emulate some java that calls = ...
13:44dnolenmatthavener: mostly perf, since = uses identical?
13:45justin_smith,(= (java.util.Date. 0) (java.util.Date. 0))
13:45clojurebottrue
13:45justin_smiththose are mutable, so if you wanted to know if they were the same object or not you could use identical
13:45justin_smith,(identical? (java.util.Date. 0) (java.util.Date. 0))
13:45clojurebotfalse
13:46justin_smith,(= (java.util.HashMap.) (java.util.HashMap.)) ; even more likely to get mutated while you aren't looking
13:46clojurebottrue
13:52Trioxincould it be said that scala has a paradigmatic or otherwise advantage over clojure?
13:53Trioxinwithout arguing pureness
13:53justin_smithTrioxin: the advantages of scala over clojure is no compiler in the runtime, which means you don't need to load up the whole language to run the code, and strong typing which means less work is needed doing reflection at runtime.
13:54justin_smithalso arguably an advantage is that you can write normal java-like code in it which helps for transitioning
13:54Trioxinwell, you can drop down into java in clojure right?
13:55justin_smiththe advantages clojure has over scala is that clojure is simpler, and you are less likely to run into someone's code in your codebase that is effectively in a completely different language. Also scala has no between version compatibility with itself, and is unusable from other jvm languages.
13:55justin_smithTrioxin: you can use interop, or call java code if you feel like writing some java.
13:56justin_smithTrioxin: but even with interop, clojure has reflection issues that scala doesn't because scala has stronger typing.
13:56j-pbyeah, but I'd rather write java than scala
13:56j-pbscala loooooves magic
13:56j-pbwhich is great as long as nothing goes wrong
13:56Trioxinyou mean better type inference?
13:56justin_smithj-pb: I'd also consider frege as an option if you want typing / ml style stuff but don't like magic or fragmented design
13:57justin_smithTrioxin: I mean typing. Clojure uses reflection at runtime to ask what the type actually is, scala rejects your code because it doesn't know then type.
13:57justin_smitheach has its advantages/disadvantages but perf and correctness wise scala wins there
13:58j-pbjustin_smith: If iirc it can fail to type typable expressions though right?
13:58justin_smithj-pb: sure, that's always the tradeoff with strong typing. You get either correctness or completeness.
13:58j-pbsomething something accidentally embedded dependent types
13:58justin_smithright
13:59justin_smithso we can do things simply in clojure that would be an insane pain in the ass in a strongly typed language
13:59justin_smithas a tradeoff we can do insane incorrect things that wouldn't compile in a strongly typed language
13:59justin_smithwin some, lose some
13:59j-pbyeah
13:59j-pbit's basically the price we pay for macros
14:00j-pbhard to type, hard to do partial functions ^^
14:00justin_smiththat's part of it, yeah
14:01j-pbI really wish somebody would write a lisp that is as nice as clojure but uses lambda calc as its intermediary, that would be so fun :D
14:03justin_smithj-pb: I found this... https://github.com/haskell-lisp
14:04l1xhey guys
14:04l1xsorry for the dumb question, how do i use a java interface in clojure?
14:04l1xif it is like this -> public interface Writer
14:05justin_smithl1x: calling it or implementing it?
14:05l1xjustin_smith: i am not sure what it is for
14:05justin_smithl1x: what are you trying to do - make a new interface, use a class that extends the interface, or implement a new class that extends the interface?
14:06l1xhuh, maybe i am asking the wrong question
14:06l1xdo i need to "implement" an interface before using it the "normal" java way (def balh (JavaClass.))?
14:06justin_smithl1x: what do you mean by "use a java interface"
14:07lokienhello justin_smith :)
14:07l1xjustin_smith: just import it to my clojure code and use the functi^H^H^methods from it
14:07l1xi guess i have to implement it
14:07justin_smithl1x: no. If you have an object at hand that implements the interface, you can call the interface method like any other method.
14:07l1xyes
14:08justin_smithjust call it
14:08l1xso i need an object that implements the interface
14:08l1xok this is a good start
14:08justin_smithwait, what do you have and what are you trying to do with it?
14:08justin_smithlokien: hello
14:08l1xjustin_smith: i have this code https://github.com/apache/hive/blob/master/orc/src/java/org/apache/orc/Writer.java
14:08l1xand i want to write a file
14:08l1xorc file
14:09justin_smithOK. That defines an interface. What do you want to do that requires that interface?
14:09l1xhttps://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcFile.java#L37
14:09l1xthis is the implementation of the interface?
14:10l1xwhen you see x extends y
14:10l1xi guess
14:10justin_smithit's an implementation yes
14:10justin_smithdo you want to use that implementation, or make a new implementation?
14:11l1xhttps://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/io/orc/WriterImpl.java#L81
14:11l1xhuh found it
14:11l1xthis is probably what i need to use
14:11justin_smithl1x: I still have no idea what you are trying to do
14:11l1xwrite an orc file
14:11justin_smithbut good I guess?
14:11j-pbjustin_smith: haha nice
14:12l1xjustin_smith: i just need to figure out how java people think, and also figure out where to tap into this code base
14:13justin_smithl1x: I'd look for the javadoc
14:13hiredmandnolen: right
14:14hiredmanfavetelinguis: gross
14:17l1xjustin_smith: thanks
14:28tolstoyAnyone ever get "method code too large" when running `lein eastwood`?
14:29sdegutistolstoy: how do you like Eastwood as a linter?
14:29sdegutisis it more useful than not so far?
14:29tolstoyI don't know. I've always passed all its tests.
14:29sdegutis:)
14:29tolstoyIt hasn't been super useful, yet. I'm kinda just trying it out just in case.
14:30sdegutistolstoy: considering it's just recommending a smaller method, it might just be a matter of blind idealism.. whats the method look like?
14:30tolstoyI've got a
14:31tolstoyI've got a "data-svc" record which has a lot of protocol methods (if that's what you call them), each one of which is about 1 line long.
14:32tolstoySo, could be "too many functions on this protocol: are you serious?" or something.
14:33tolstoyMight be a bug in eastwood itself.
14:33ystaeltolstoy: is eastwood _telling_ you your method code is too large, or _failing_ because the compiler has exceeded the method code size limit? :)
14:34tolstoyystael: The second case.
14:35tolstoyYeah, it's a run time exception. My code is usually clear of any eastwood advice, so I confused the output a bit.
14:37justin_smithsdegutis: tolstoy: yeah the "method too large" thing is a bug in eastwood
14:38justin_smithit's something that happens when you go crazy with the macros :P
14:38tolstoyjustin_smith: Yeah, I just unset the :jvm params in project.clj just in case, but ... bomb.
14:38tolstoyOh. Hm. I've not written any. Perhaps it's one of the built ins?
14:39justin_smithtolstoy: no, I mean in eastwood
14:39tolstoyI do have a protocol with 20 functions (about) in it. Kind of just a data API holder.
14:39tolstoyAh.
14:39justin_smithright, but each protocol function is a method in each implementation
14:39justin_smiththey aren't shoved into one method
14:40tolstoyI'm seeing a lot of analyzer output.
14:44tolstoyHuh. Maybe it's a tools.analyzer.jvm issue. Anyway.
14:45justin_smithperhaps Bronsa or one of the other t.a.jvm / eastwood folks knows what's up. I recall it being talked about as an issue but don't recall details.
14:48tolstoyIt's mentioned once in a closed issue, but, yeah. I'd post an issue but, jeez, there are already so many.
14:54sdegutisDoes Component work best when everything in your system is defined as a component, with no free-floating var functions?
14:55tolstoyYou mean like not having a namespace of utility functions, or something like that?
14:56tolstoyI think Component can work however you want, but for me, it's best as an organizing principle.
15:06lokienjustin_smith: remember that one liner you wrote yesterday for me?
15:07lokienthat one using reductions
15:16lokien_I'm getting NPE every time I'm using it on a text file
15:17lokien_I want value in vector to stay if there's other value than "next" or "prev" in a text file
15:17lokien_"next next prev next ahava prev" -> [0 1 2 1 2 2 1]
15:18lokien_"" -> [0], still
15:18ridcully,(re-seq #"(prev|next)" "next next prev next ahava prev")
15:18clojurebot(["next" "next"] ["next" "next"] ["prev" "prev"] ["next" "next"] ["prev" "prev"])
15:18ridcully,(re-seq #"(?prev|next)" "next next prev next ahava prev")
15:18clojurebot#<SecurityException java.lang.SecurityException: denied>
15:19ridcully,(re-seq #"(?:prev|next)" "next next prev next ahava prev")
15:19clojurebot("next" "next" "prev" "next" "prev")
15:20lokien_oh hello ridcully
15:21lokien_let me grasp syntax a bit
15:21ridcullyif you need anything but "prev" to be inc, you can also do something like (if (= cmd "prev") dec inc) instead of that map
15:22ridcullythe regexp there just makes sure to get rid of anything, that is not mapped
15:22lokien_I need this to be two dimensional, I wanted to zip two outputs at the end
15:22lokien_like [[0 1] [1 1]] etc
15:24lokien_i don't know if zipping is the right approach
15:26ridcullyyou want the command and the current value?
15:30lokien_ridcully: what do you mean by "command"?
15:30lokien_I can paste you my fun in like 15 mins
15:30lokien_I'm outdoors now
15:31ridcullywould be best. i am not sure, i understood what you are after
15:31lokien_I'm pretty sure you didn't, it wasn't a good explanation
15:55lokienridcully: soo, zipping was a bad, bad idea
15:56lokienlike, really bad
15:58ridcullythe problem with the "unknown" commands is clear?
15:58lokienridcully: "up left down down right up" -> [[0 0] [0 1] [-1 1] [-1 0] [-1 -1] [0 -1] [0 0]]
15:58lokienI want to have it like this
15:58lokienspaces are only for readability
15:59blake_OK, I have a situation where I'm calling a web service to get some info. The service gives me the latest info first, then I use the information in that info to figure out whether or not I need to call it again. The information comes in reverse order (for my purposes) so I have to keep calling it until I find the "first" record.
15:59blake_I feel like I should be able to treat this as a sequence, but not sure of the best approach.
15:59lokienridcully: it won't work with zip, I don't know what I thought back then
16:00ridcullylokien: this is basically the same as with the next/prev. but instead of calling inc/dec you just map + with a vector storing the direction
16:01ridcully,(let [up [0 -1]] (map + up [42 66]))
16:01clojurebot(42 65)
16:01amalloyridcully: you want to use mapv there, not map, otherwise a bunch of laziness can pile up
16:02amalloy,(reduce (fn [pos dir] (map + pos dir)) [0 0] (repeat 10000 [1 0]))
16:02clojurebot#<StackOverflowError java.lang.StackOverflowError>
16:02amalloy,(reduce (fn [pos dir] (mapv + pos dir)) [0 0] (repeat 10000 [1 0]))
16:02clojurebot[10000 0]
16:02lokienridcully: ye-ah, but it's two dimensional now, so I.. have to include [0 0] instead of 0 as my starter?
16:02ridcullyic. good point!
16:02ridcully(inc amalloy)
16:02lokienhttp://lpaste.net/8678437113303138304
16:02lokienmy function
16:03lokiento count in one dimension
16:03amalloyit's a mistake a lot of people, including myself, have made a lot of times
16:04lokien(reduce-one "<<<><>" ">" "<") -> (0 -1 -2 -3 -2 -3 -2)
16:04ridcullylokien: right. you go from 1d x to 2d [x y]
16:04lokienridcully: so, two more arguments and [0 0] as a starter?
16:05ridcullylokien: wait, what now? <> are just prev/next. so 1d is fine her. you where talking about up/left/down/right?
16:05ridcullys/her/&e/
16:06lokienridcully: yeah.
16:13lokienridcully: yesterday I thought it'd be easier with imperative approach, but it's pretty much the same
16:25lokienridcully: oh damn I can't read. I need this function to output two dimensional thang. it's returning one dimension now
16:34WorldsEndlessHow do I add something to the back of a lazy seq?
16:34WorldsEndless"into" and "conj" aren't doing the trick
16:34justin_smithWorldsEndless: (concat lazy [e])
16:35justin_smithWorldsEndless: there is no operation that directly puts an item at the end, but you can fake it with concat
16:35WorldsEndlessAh, that does the trick!
16:35justin_smithWorldsEndless: but if you had a vector, you could use conj and that would be cheaper
16:51lokien_uh, I'll try to finish it tomorrow, I guess.
17:24WorldsEndlessDoes anyone use letfn much? Seems sensible for encapsulating code, but I almost never see it used.
17:24devthnope. never
17:26justin_smithWorldsEndless: mostly just for mutual recursion, but even then it can be more straightforward to just use declare
17:26justin_smithotherwise let with an fn in it works just as well
17:27ystaelWorldsEndless: I typically use letfn in preference to putting a fn in a let, but it sounds like I'm in the minority
17:28justin_smithystael: the thing is I usually need local bindings too, and it's easy to put an fn in a let, but you can't put a regular value in a letfn
17:28justin_smithand nesting a letfn inside a let feels odd too when you can easily bind an fn in a let anyway
17:28neoncontrailsWorldsEndless: I first saw it employed in the docs of Quil. It's handy for painterly applications
17:29ystaeljustin_smith: yeah -- but it frequently happens to me that either i don't need other local bindings, or i want the explicit visual separation
17:29tolstoyI use `letfn` every now and then.
17:30devthphilosophically i think letfn shouldn't exist. it makes it seem like a fn is some special thing instead of being a just a normal value.
17:31justin_smithdevth: except mutually recursive locally bound functions would be clumsy
17:31justin_smithif even possible
17:31devth(fn foo [x] .... (foo ...) ...)
17:31justin_smithdevth: mutually recursive
17:31justin_smithfoo calls bar, bar calls foo
17:31devthah
17:32devth(let [foo (fn ..) bar (fn ..)] ...) why can't they call eachother inside a let?
17:33justin_smithbar does not exist in the scope of foo's binding
17:33neoncontrailsdevth: aren't they? I tend to think of functions as environments, values as data.
17:33devthjustin_smith: oh i finally get your point. :)
17:33devthneoncontrails: well sure they are special in some regard, but in another, they are a value like everything else.
17:34devthi.e. i would be grossed out if (letstring [x "foo"]) was a thing :)
17:35justin_smith,(let [a (promise) b (promise)] (deliver a (fn [x] (if (< x 0) x (@b (/ x 2))))) (deliver b (fn [x] (if (> x 100) x (@a (- x 10)))) (@a 20))
17:35clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
17:35justin_smithanyway, it would look something like that without letfn
17:35justin_smithugly
17:35neoncontrailsdevth: Hah. Excellent illustration of the point
17:36devthjustin_smith: i'd probably use declare before letfn
17:37justin_smith,(let [a (promise) b (promise)] (deliver a (fn [x] (if (< x 0) x (@b (/ x 2))))) (deliver b (fn [x] (if (> x 100) x (@a (- x 10))))) (@a 20))
17:37clojurebot-10
17:41justin_smith,(let [a (promise) b (promise)] (deliver a (fn [x] (if (< x 10) x (@b (/ x 2))))) (deliver b (fn [x] (if (> x 100) x (@a (* x 13/10))))) (@a 42)) ; more interesting
17:41clojurebot599781/80000
17:43justin_smith,(letfn [(a [x] (if (< x 10) x (b (/ x 2)))) (b [x] (if (> x 100) x (a (* x 13/10))))] (a 42)) ; better
17:43clojurebot599781/80000
17:55devth> after using component for a project at work, I noticed that my code stopped looking like idiomatic Clojure code and more like OO Java I used to write
17:55devthhttp://danboykis.com/?p=2263
17:55devthjust when i was about to finally adopt component :)
17:55justin_smithyeah, I saw that
17:55devthjustin_smith: have you checked out mount?
17:56justin_smithyes, won't use it because it uses defs for stateful resources
17:56justin_smiththat's not acceptable for me
17:56devthe.g.? not totally sure what that means
17:56justin_smithdevth: eg (def db (connect to db))
17:57devthok
17:57justin_smiththey don't do that directly, but they still put a stateful resource in a top level definition
17:57devthvs storing it in an atom ?
17:57justin_smithan atom or not does not matter
17:57devthok, so you expect it to be passed in
17:57justin_smithwhat matters is that it is stateful, and you store it in a var
17:57justin_smithright
17:57justin_smithbecause putting it in a var means you hard code the fact that there can only be one
17:57justin_smithit means now you need mocks for tests
17:58devthright. (gross)
17:58justin_smithit means you need to duplicate code if you want to interact with two dbs
17:58justin_smith(or abstract it out and do what you would have done with component anyway)
17:59justin_smithcomponent isn't OO, it's using methods to manage stateful resources - that's a small slice of what OO is about
17:59devthk. i'm gonna read up a bit more on it
17:59justin_smithwriting code as if it was pure and not stateful while the thing still has state is just kicking the error to another place - it's going to catch up eventually
17:59amalloyjustin_smith: one thing i don't get about component is its assumption that every component is a named key in a map. are there not situations where you'd want a seq of components or something?
18:00justin_smithamalloy: they need names in order to be connected to one another
18:00justin_smithif you can chain some deps in a sequence, then that can be a single component
18:01justin_smithamalloy: it's like when you turn your tree into an adjacency list - you gain flexibility (and shapes that trees can't take on), but you take on the need to name every node
18:02justin_smithI could probably take "like" out of that statement
18:02hiredmanthere are
18:03hiredmanbut you can do things to, I dunno, emulate that
18:04hiredmanI've done stuff like had keys with a particular namespace treated as sort of a set of components
18:04hiredman{:foo/a … :foo/b …}
18:05hiredmana lot of how you end up using it depends on the granularity you use it at
18:06devthnot sure how i feel about so much `alter-var-root` in the component readme
18:07justin_smithdevth: that's totally optional
18:07justin_smithyou can put it in an atom, an agent, or a local binding
18:07justin_smithwhatever works in your own design
18:07devthyeah. wondering why he didn't
18:07devthto emphasize that it's the very top level controlling thread and doesn't need to be threadsafe?
18:08justin_smithvars are thread-safe
18:08devthoh. TIL :)
18:09devthpretty sure i've never actually used alter-var-root
18:09justin_smithyeah, this is a marginal case, since it should only do the alter once at startup (or during development once per startup of the system of course)
18:10hiredmanit is a granularity thing again, if the granularity you are using component at ends up with a single system per process, then it is nice to bind the system to a global name for poking at from the repl
18:11devthhm, liking what i'm reading in the mount docs
18:11hiredmangenerally you're start and stop comonent functiosn will be side effecting, so using an atom is silly
18:12hiredmanyour
18:13hiredmanthere is also a lot of stuff people assume you are doing if you use component (all the reloaded and whatever stuff) which you don't need to use at all
18:13amandabbhi
18:13hiredmanyou don't even need to use protocols and records/types for component, it is pretty easy to use maps and multimethods with it
18:14amandabbquestion: why does this work: (swap! x update-in [:row] inc) but this doesn't: (swap! x update :row inc)
18:14devthhiredman: oh really. that was one of my bigger aversions
18:14amalloy,(doc update)
18:14clojurebot"([m k f] [m k f x] [m k f x y] [m k f x y ...] [m k f x y ...]); 'Updates' a value in an associative structure, where k is a key and f is a function that will take the old value and any supplied args and return the new value, and returns a new structure. If the key does not exist, nil is passed as the old value."
18:14amalloyamandabb: those two should be identical
18:15amandabbshould be
18:15amandabbbut update is giving me an error
18:15justin_smithwhat's the error?
18:15hiredmanare you using a version of clojure with the update function?
18:15amandabbi hope so? using the latest light table instaclojure repl
18:15amalloyhiredman cutting to the chase here, i suspect
18:15amandabbjava.lang.RuntimeException: Unable to resolve symbol: update in this context
18:15amandabbonline repls didnt work eithe
18:15amandabbeither
18:15amandabbsame error
18:15amalloythat's a too-old version of clojure, indeed
18:15justin_smith*clojure-version*
18:16justin_smith,(:added (meta #'update))
18:16clojurebot"1.7"
18:16justin_smithyou need 1.7 or newer
18:16amandabbhttp://www.tryclj.com/ and lighttable's clojure instarepl both dont use 1.7..?
18:16amalloyamandabb: those are both projects that haven't been updated in a long time
18:16justin_smithamandabb: *clojure-version*
18:16justin_smith,*clojure-version*
18:16clojurebot{:major 1, :minor 8, :incremental 0, :qualifier "alpha3"}
18:16amandabbthats weird ok thanks
18:20hiredman,*clojure-version*
18:20clojureboteval service is offline
18:20hiredman,*clojure-version*
18:20clojurebot{:major 1, :minor 8, :incremental 0, :qualifier "master", :interim true}
18:27TEttingerwoo hiredman
18:32amandabbis there any way to do partial in arguments in different order?
18:32amandabblike if a function takes 3 arguments, partial the last 2 but not the first
18:32justin_smithwith flip, or by hand
18:33amandabbwhat's flip?
18:33justin_smith(defn flip [f] (fn [& args] (apply f (reverse args))))
18:33justin_smithreturns a new function that takes args in the opposite order
18:33amandabbwell what if you wanted to partial the 1st, 3rd, and 7th argument or something
18:33justin_smiththen do it by hand
18:33amalloyjustin_smith: i think if someone asks "what's flip", it's better to just go back to the original question and forget flip
18:34justin_smithk
18:34amalloyamandabb: define a function inline
18:34amandabbso as an example, how could i do this easily with partialing mod?
18:34amalloy(defn partial-137 [f x y z] (fn [a b c d] (f x a y b c d z)))
18:34amandabbi want to supply the 2nd not the 1st parameter
18:35justin_smith(fn [b] (fn [a] (mod a b))
18:35justin_smithor (flip mod)
18:35hiredmanamandabb: use an anonymous function, either (fn ...) or #(...)
18:35amandabbbrb
18:35hiredmanlet me play out the rest of this conversation:
18:35hiredman<amandabb> but I don't want to
18:35hiredmanwhy not?
18:36hiredman<amandabb> that seems less elegant than partial
18:36hiredmanwhat do you think partial does?
18:36hiredman<amandabb> I dunno, magic?
18:36hiredmannope
18:37MJB47im pretty sure its magic
18:38hiredmanall you have to do is load up core.clj and read the source
18:38hiredmanit returns an anonymous function that closes over the supplied arguments
18:39hiredman(and does a lot of argument unrolling for performance reasons)
18:52amandabbhiredman: back. lol yeah pretty much. was trying to make a function that increases the argument by 1 and then mods by 4 without using anonymous functions. ie with partial, comp, inc, and mod, but im not sure if i can elegantly
18:56TEttinger,((comp (partial bit-and 3) inc) 7)
18:56clojurebot0
18:57TEttinger,((comp (partial bit-and 3) inc) 6)
18:57clojurebot3
18:57TEttingerdoesn't work for negative
18:57TEttinger,((comp (partial bit-and 3) inc) -1)
18:57clojurebot0
18:57TEttinger,((comp (partial bit-and 3) inc) -2)
18:57clojurebot3
18:57TEttingererr, actually kinda does
18:57TEttinger,((comp (partial bit-and 3) inc) -3)
18:57clojurebot2
18:57TEttingersurprising
18:58amandabbwell the number would only ever be between 0 and 3
18:58amandabbsince when it would normally hit 4 it would just go to 0
18:59TEttinger,(map (comp (partial bit-and 3) inc) (range 4))
18:59clojurebot(1 2 3 0)
18:59TEttingerobviously this is a total hack
18:59TEttingerit only works because 4 is a power of two
19:00amandabbhaha yeah pretty neat
19:00amandabbprobably wont use it though because it would be confusing to reader
19:00TEttingerwell yes
19:00TEttingerpoint-free style has that trait
19:02johnny86hello
19:02TEttingerhello
19:02johnny86 I can't seem to find an example about the reduced? function
19:02johnny86can anyone help me with one?
19:03amalloyjohnny86: you probably don't need to care
19:03TEttingerhm, I haven't used reduced? but I have used reduced a lot
19:03TEttinger(doc reduced?)
19:03clojurebot"([x]); Returns true if x is the result of a call to reduced"
19:03johnny86(+ 1 2)
19:03justin_smith,(reduce (fn [_ e] (when (even? e) (reduced e))) [1 3 5 6 7 8])
19:03clojurebot6
19:03clojurebot3
19:04justin_smith,(reduced? (reduced 42))
19:04clojurebottrue
19:04johnny86nice, the bot :D
19:04justin_smiththat's what reduced? does
19:04justin_smithreturns true if its arg is a reduced
19:04justin_smithlike amalloy says you probably don't need it
19:04johnny86yes but in what context is it used?
19:04TEttinger,(reduced? (reduce (fn [_ e] (when (even? e) (reduced e))) [1 3 5 6 7 8]))
19:04clojurebotfalse
19:04justin_smithjohnny86: see my first example of reduce
19:04amalloyjohnny86: it is used almost exclusively in implementations of reduce
19:04justin_smithjohnny86: it's used internally by reduce
19:05johnny86can I use it on a value in the end of the reduction?
19:05justin_smithjohnny86: in the middle
19:05justin_smithand that becomes the end
19:05TEttinger"reduced?" doesn't seem to know whether a given value resulted from reduced if the reduce call already finished
19:06justin_smithjohnny86: to be clear, reduced? tells you if something is a reduced, and reduced generates a reduced, and now the word reduced looks funny
19:06TEttinger(which makes sense, it's internal)
19:06justin_smithTEttinger: reduce doesn't return a reduced
19:06justin_smith,(reduced 42)
19:06clojurebot#object[clojure.lang.Reduced 0x1da3450b {:status :ready, :val 42}]
19:06justin_smithTEttinger: reduced is just a container class that holds one value
19:06TEttingerok
19:07justin_smith,@(reduced 42)
19:07clojurebot42
19:07TEttinger,@@(reduced (reduced 42))
19:07clojurebot42
19:09johnny86so normally there is no use case for it?
19:09justin_smithjohnny86: right, exactly
19:10johnny86ok then, thanks :)
19:11turbofailsome transducers may need it as well, it looks like the `interpose' transducer uses it
19:46BRODUS'eval' should recognize symbols defined in any surrounding lets right ?
19:47BRODUShaving trouble with this code: http://pastebin.com/9JDVVsWN
19:48retrogradeorbitcan you bind to %? is that allowed?
19:48BRODUSyou can
19:48BRODUSprobably should use something else though
19:48retrogradeorbit,(let [a 20] (eval '(+ a a)))
19:49clojurebot#error {\n :cause "Unable to resolve symbol: a in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: a in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6688]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: a in this context"\n ...
19:51BRODUS,(let [a 20] (eval `(+ ,a ,a)))
19:51clojurebot#error {\n :cause "No such var: sandbox/a"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: No such var: sandbox/a, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6688]}\n {:type java.lang.RuntimeException\n :message "No such var: sandbox/a"\n :at [clojure.lang.Util runtimeException "Util.java" 221]}]\n ...
19:51amalloyBRODUS: no, eval has no access to locals
19:52BRODUSthats a bummer
19:52retrogradeorbitright. It has access to defs.
21:35neoncontrailsWhat could it mean that the browser isn't displaying specifically the DOM content of a clojurescript app?
21:35neoncontrailsThe app compiles fine.
21:35neoncontrailsThe browser is connected. js errors entered into figwheel pop up as expected
21:37neoncontrailsWorking now! Heh, well apparently it means you should run 'lein clean'
22:22amandabbhmmm
22:22amandabbanyone have an idea why this is throwing a null pointer exception? (every? #(zero? (get-in board [:row % :col %])) [{:col 6 :row 0} {:col 6 :row 1}])
22:22amandabbboard is just just a 2d array
22:24amandabbohhhhh nevermind
22:24amandabblol.. stare at it for 10 minutes -> don't know problem -> post in irc -> figure it out 30 seconds later
22:25amandabbwas missing parenthesis around the :row % and :col % calls
22:30g0wamandabb: is this from clj-brave and true?
22:30amandabbno im making a game
22:30g0wah ok! ncie
22:30g0w*nice
22:30amandabbyeah my first clojure project
22:31amandabbgoing decently so far
22:31g0whave fun =)
22:31g0wshare it with us once you're done
22:31amandabbsure
22:31amandabbshould only be a day or two
23:46BRODUSany cider experts here? have an elisp function that i'm calling thats using the cider client to evaluate some clojure, but i'm not seeing any of my print calls output to the repl.
23:47BRODUSbut it prints fine if i evaluate the clojure code directly from the buffer
23:50tolstoyDoes it print to the *nrepl-server* buffer?
23:51BRODUSno
23:53kovrikso you want something like `cider-eval-defun-at-point-in-repl`?
23:54fingertoestumped newbee here.... I have a vector ["(12.50)" "(7.49)" "(8.12)" "(9.99)" "(4.72)" "(5.98)" "(9.45)" "(25.79)" "(6.70)" "(22.43)" "(4.75)" "(4.69)"] Those need to be negative and summed.. I have been wrestling with it and no luck. any tips?