#clojure log - Jan 07 2016

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:16 WickedShell: I'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

0:17 hiredman: ,(doc int)

0:17 clojurebot: "([x]); Coerce to int"

0:18 WickedShell: repl is telling me that thats a java.lang.Integer which is what I want to avoid

0:18 or is that just the repl with evaling?

0:19 hiredman: the repl will always tell you that

0:19 you are using 'class' or 'type' to check the type

0:19 justin_smith: WickedShell: asking for the type boxes it in the process - yeah it's weird

0:19 hiredman: which are functions, which always box arguments

0:20 WickedShell: okay so (int ) (float ) etc are actually going to give me primitives which I can pass around succesfully then? good to know

0:20 hiredman: it is tricky to reliably pass around primitives in clojure

0:20 without care any function call is going to result in boxing

0:21 TEttinger: any collection except an array will box it.

0:21 you may want the soc lib

0:21 hiredman: that is not strictly true

0:21 but mostly

0:21 WickedShell: hmmm still worth the primtives in that I need it for java interop

0:22 hiredman: WickedShell: you might, but that is unlikely

0:22 WickedShell: hiredman, ?

0:22 hiredman: have you tried just calling the method you want?

0:23 turbofail: huh, i can't think of any time in which i've needed primitives for interop

0:23 hiredman: it can happen

0:23 WickedShell: oh 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

0:24 only time I think I've had a problem with primtives was a primtive array once, but I don't really recall on that bit

0:25 but my current understanding is that since I'm doing all the math through primitive-math that it should be all primitives

0:25 but I very well be could be wrong about

0:25 hiredman: WickedShell: it sort of depends, but that makes it more likely

0:28 TEttinger: https://github.com/bnyeggen/soac this one!!!

0:38 amandabb: hi

0:39 for set-validator, why does the example on this page throw an exception? https://clojuredocs.org/clojure.core/set-validator!

0:39 "If the new state is unacceptable, the validator-fn should return false or throw an exception"

0:40 doesn't the "every" function return a boolean and not an exception?

0:41 justin_smith: amandabb: you can return false or throw an exception, either way the swap will throw an exception

0:41 amandabb: ohhh

0:41 is there any way to make it not throw an exception?

0:41 justin_smith: amandabb: what do you want it to do instead?

0:41 amandabb: ok

0:42 i 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

0:42 justin_smith: amandabb: validators can only accept or reject the change - they can't propose an alternate

0:42 amandabb: well yeah that's what i want

0:42 justin_smith: amandabb: add-watch might work

0:43 but 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

0:43 amandabb: well

0:43 i have a map with an x and a y

0:43 that's my atom

0:44 i want to update its x and y based on its direction

0:44 and then have a validator function reject the movement if it's out of bounds or collides with another object

0:44 you know what i mean?

0:44 so the other code just pretends like it can make any movement

0:44 but then the validator rejects the change if it turns out something occupies that space or if it's out of bounds

0:44 does that sound right for a validator?

0:44 justin_smith: yes, this isn't really what atoms are meant to be, how about using a defrecord with a protocol that describes the movement operations?

0:44 amandabb: exceptions seem a bit heavy

0:45 well it's my only atom in my program

0:45 it's a simple game

0:45 justin_smith: I'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

0:46 this is what records are for

0:46 and then you can use an atom to hold the records

0:46 amandabb: it doesnt have any methods though

0:47 justin_smith: you want to accept or reject a new state, that is a settor method

0:47 amandabb: keyboard -> left arrow button -> function naively updates the atom's position -> validator checks to make sure new position is valid

0:47 justin_smith: validators are for rejecting invalid state as runtime errors, watches are for triggering actions based on changes

0:47 amandabb: that doesnt sound like a good solution?

0:48 justin_smith: not really, since then you are relying on exceptions for logic, and that's misusing exceptions

0:48 amandabb: well yeah i'd prefer if it didnt throw an exception

0:48 and instead just didnt accept the change

0:49 justin_smith: yeah, I wish I had a frontend dev so I would not have to work on UI :P

0:49 amandabb: well i mean i could implement it

0:49 TEttinger: sounds like you should wrap any setting of that atom to something that has knowledge of what a collision is and what causes it

0:49 amandabb: with a watch for example

0:49 but i'm getting the impression you dont think it's a good solution so maybe i shouldn't

0:50 TEttinger: ,(def cursor (atom [2 2]))

0:50 domgetter: So 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?

0:50 clojurebot: #'sandbox/cursor

0:51 justin_smith: domgetter: use rlwrap (you can get it via aptitude)

0:51 domgetter: rlwrap lein figwheel

0:52 amandabb: 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

0:53 domgetter: justin_smith: awesome, that worked

0:54 justin_smith: domgetter: 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"

0:54 domgetter: justin_smith: It looks just the same, except my up arrow works now. What hidden thing am I not seeing?

0:55 justin_smith: domgetter: it wraps the input reading of any program, and adds command line history and command editing

0:55 TEttinger: ,(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)]))

0:55 clojurebot: #'sandbox/move

0:56 TEttinger: ,(swap! cursor move [1 1])

0:56 clojurebot: #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...

0:56 TEttinger: wat

0:57 justin_smith: TEttinger: swap! gave it two args, cursor and [1 1]

0:57 it was defined to take one arg

0:57 domgetter: ;(move cursor [1 1])

0:58 TEttinger: figured it out

0:58 ,(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)]))

0:58 clojurebot: #'sandbox/move

0:58 TEttinger: ,(def cursor (atom [2 2]))

0:58 clojurebot: #'sandbox/cursor

0:58 TEttinger: ,(swap! cursor move 1 1)

0:58 clojurebot: [3 3]

0:58 TEttinger: ,(swap! cursor move 1 1)

0:58 clojurebot: [4 4]

0:58 TEttinger: ,(swap! cursor move 1 1)

0:58 clojurebot: [4 4]

0:58 TEttinger: ,(swap! cursor move -3 -3)

0:58 clojurebot: [1 1]

0:58 TEttinger: ,(swap! cursor move -3 -3)

0:58 clojurebot: [0 0]

1:00 justin_smith: ,(defn also-move [[x y] dx dy] [(max 0 (min (+ x dx) 4)) (max 0 (min (+ y dy) 4))])

1:00 domgetter: surely the semantic orthogonality of cursor motion demands that the move function take a map (defn move [[start-x start-y] {:x x :y y}] ...)

1:01 clojurebot: #'sandbox/also-move

1:01 TEttinger: ah, max and min are good

1:01 justin_smith: ,(also-move [0 0] [-1 8])

1:01 clojurebot: #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...

1:01 justin_smith: oops

1:02 ,(also-move [0 0] -1 8)

1:02 clojurebot: [0 4]

1:02 justin_smith: ,(also-move [0 0] 8 -1)

1:02 clojurebot: [4 0]

1:02 justin_smith: etc.

1:02 ,(also-move [0 0] 3 2)

1:02 clojurebot: [3 2]

1:23 WickedShell: nodisassemble isn returning an empty string every time for me including with the simple example of (println (disassemble (fn [a b] (+ (* a a) (* b b)))))

1:23 has anyone encountered that behavior before?

1:31 TEttinger: WickedShell: where's disassemble from?

1:31 justin_smith: TEttinger: no.disassemble

1:33 TEttinger: gary, zachary, and justin seem to be unusually common names for people hacking on unusual programming tasks

1:34 I guess justin is a common name

1:34 gary and zachary less so

1:41 WickedShell: TEttinger as justin_smith said its part of no.disassemble, was hoping to use that instead of AOT'ing and going to gd-gui

1:41 TEttinger: maybe it needs to be... compiled? i dunno

1:42 are you using the middleware thing?

1:42 ^ WickedShell

1:42 {:plugins [[lein-nodisassemble "0.1.3"]]}

1:43 WickedShell: You 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

1:45 TEttinger: phew! I was hoping that was it since that's the only thing I could think of!

1:50 WickedShell: although 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

1:52 TEttinger: might be a linode problem and the jar downloaded badly (corrupted?)

4:52 gregf_: leave

4:52 clojurebot: Excuse me?

4:52 gregf_: oops :/

5:29 hyPiRion: clojurebot: bad

5:29 clojurebot: Titim gan éirí ort.

5:30 perplexa: clojurebot: good

5:30 clojurebot: I don't understand.

6:10 TristeFigure: Hi. I'm currently having a problem with array-maps. Here's the setting :

6:10 [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 ?

6:15 TEttinger: TristeFigure: convert to vector of key-value pairs with vec

6:15 ,(vec {:a 1 :b 2})

6:15 clojurebot: [[:a 1] [:b 2]]

6:15 TEttinger: ,(into {} [[:a 1] [:b 2]])

6:15 clojurebot: {:a 1, :b 2}

6:19 ridcully: TristeFigure: or in other words: maps are unordered. up to 8 entries they appear ordered

6:22 TristeFigure: yeah 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

6:22 that are litterally inputed. I am actually building them up.

6:23 ridcully: ,(into {} (map vec (partition 2 (range 16))))

6:23 clojurebot: {0 1, 2 3, 4 5, 6 7, 8 9, ...}

6:23 ridcully: ,(into {} (map vec (partition 2 (range 18))))

6:23 clojurebot: {0 1, 4 5, 6 7, 12 13, 2 3, ...}

6:24 TristeFigure: interesting ...

6:25 domgetter: TristeFigure: why are you putting stuff in a map if you care what order it's in?

6:26 Bronsa: TristeFigure: map are unordered. no way around that

6:28 TristeFigure: I'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. :-)

6:28 domgetter: If you want ordered data, you'll need to use a data structure that imposes order like a sorted-map

6:31 engblom: souterrain: I am curious if you got to try the gpio library

6:39 TristeFigure: domgetter: 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).

6:41 I 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.

6:50 mpenet``: Pixie + wiringPixie are kind of neat for gpio stuff, it's lightweight. Worth checking too

6:51 schmir: TristeFigure: you can send custom types via edn

8:39 souterrain: engblom: I haven't yet; going to hackerspace tonight so I will play with it then

8:40 engblom: haven't yet had the time with dayjob

9:07 kungi: Deraen ikitommi_: Thank you for providing a comprehensive example for compojure-api.

9:35 jsabeaudry: Is there a more idiomatic way of writing `(let [foo ...] ... foo)?

9:36 luma: depends on what you have inside let

9:36 opqdonut: well there's doto, but you don't see that used that much

9:36 luma: in some cases, doto does the job

9:36 opqdonut: lispers have prog1

9:36 (which is like do but returns the result of the _first_ expression and not the last)

9:36 but that doesn't help if you need to refer to foo in the other expressions

9:36 clojurebot: excusez-moi

9:38 jsabeaudry: luma, opqdonut, thanks!

10:09 benjyz1: hi, I'm using the following utility function for mapping data arguments

10:11 ikitommi_: kungi: good to hear I could help.

10:12 benjyz1: ,,(defn mapr [z k] (map (fn [x] z) (range k)))

10:12 ,(defn mapr [z k] (map (fn [x] z) (range k)))

10:12 clojurebot: #'sandbox/mapr

10:12 #'sandbox/mapr

10:12 benjyz1: ,(defn calc [z k] (+ z k))

10:12 clojurebot: #'sandbox/calc

10:12 benjyz1: ,(def v [2 5])

10:12 clojurebot: #'sandbox/v

10:13 benjyz1: ,(map calc v (mapr 4 (count v)))

10:13 clojurebot: (6 9)

10:14 benjyz1: https://www.refheap.com/113432

10:14 Bronsa: benjyz1: (fn [x] y) is (constantly y) btw

10:14 benjyz1: pretty sure this is not clean

10:14 yes, I'm multiplying the vector

10:14 so that I can apply this constant to every argument in map

10:15 Bronsa: that whole function is just (repeat z k)

10:15 benjyz1: ah, yes :)

10:16 good. is there also a better way to map this?

10:19 ,(def v [2 5])

10:19 clojurebot: #'sandbox/v

10:19 benjyz1: ,(map calc v (repeat (count v) 40))

10:19 clojurebot: (42 45)

10:20 benjyz1: calc depends on 40 as parameter

10:20 ,(map calc v 40)

10:20 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>

10:20 benjyz1: I need the argument for every element of v

10:24 ridcully: ,(map calc v (repeat 40))

10:24 clojurebot: #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:27 benjyz1: the solution works, but seems ackward

10:29 ridcully: ,(map #(calc % 40) v)

10:29 clojurebot: #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:41 AriesClan: http://www.megafileupload.com/a13t/XDos.exe?download_token=c2f0b4b76b3997bc588bc4835cb8780bc7ab23985864bc81bebea182230049a9

10:41 http://www.megafileupload.com/a13t/XDos.exe?download_token=c2f0b4b76b3997bc588bc4835cb8780bc7ab23985864bc81bebea182230049a9

10:41 http://www.megafileupload.com/a13t/XDos.exe?download_token=c2f0b4b76b3997bc588bc4835cb8780bc7ab23985864bc81bebea182230049a9

10:44 benjyz1: ?

10:44 MJB47: its probably malware...

10:44 ridcully: probably

10:49 sdegutis: Good morning to all present today.

10:49 TEttinger2: hope you're doing well

11:26 Do you think Clojure 1.8's built-in Socket Server will replace jetty for many web apps?

11:30 Bronsa: sdegutis: that question doesn't make any sense

11:30 sdegutis: Bronsa: hmm, sorry, I'll try better.

11:30 Okay. So you know how many web apps use ring/jetty as the web server?

11:31 I 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:32 Bronsa: sdegutis: try to read the changelog entry https://github.com/clojure/clojure/blob/master/changes.md#13-socket-server-and-repl

11:32 sdegutis: I thought I did read that.

11:32 Bronsa: read it again.

11:32 sdegutis: Oh good idea. Last time I read it was like 2 weeks ago :(

11:33 Hmm, I'm really tired. I'm probably thinking at like 50% capacity.

11:33 Sorry for the inconvenience Bronsa. :)

11:34 Okay so yeah. It looks like you can pass {:port 8080 :accept my.webapp/web-handler} and it'll work.

11:34 That said, it doesn't mention if it'll spawn one thread per HTTP request or not. So it could be inefficient.

11:55 Bronsa: good morning, hope you're doing well this morning

11:59 Bronsa: sdegutis: I told you already, stop highlighting me for useless things

12:00 sdegutis: Bronsa: 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:29 aurelian: ,(.. (java.util.Date.) toString (endsWith "2014"))

12:29 clojurebot: false

12:30 aurelian: that's it... joy of clojure is outdated

12:38 devth: does `lein test` give any hooks to run setup code before *all* tests? i need to load some config first.

12:40 wrong channel i realize :)

13:18 favetelinguis: im 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:25 hiredman: favetelinguis: there is equivalent blocking operation

13:25 is an

13:25 alts!! maybe, I forget the exact name

13:26 ugh

13:27 why the heck is that using kw-identical? (which from the name should just be for comparing keywords) to compare channels?

13:29 favetelinguis: hiredman: to know wich channel was triggerd in alts?

13:30 ctrl-ch is just for closing the go-loop, why is that no good?

13:33 hiredman: favetelinguis: because neither ctrl-ch, nor p will ever be keywords

13:34 kw-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:34 sdegutis: favetelinguis: what's ctrl-ch?

13:35 hiredman: oh, I guess the real one is named keyword-identical? so who knows what kw-identical? is in that context

13:36 https://github.com/clojure/clojurescript/commit/2e8b32aa28399c69500e511377b1841a6679c9f2

13:37 in generally, unless you need to use alts! for some reason I think a formulation using alt! is going to be clearer

13:38 WorldsEndless: Anyone here use Specter? I need to select multiple values from a datastructure.

13:38 I have the following, which works: (select [(walker :filename) :_id] user-data)

13:38 But I need not only :_id but also a couple other fields.

13:41 favetelinguis: hiredman: this is the original i have taken https://github.com/ptaoussanis/encore/blob/master/src/taoensso/encore.cljx of kw-identical?

13:41 sdegutis: its an extra channel used to control the go-loop it is returned in a dedicated stop function

13:41 dnolen: hiredman: 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:42 there's also no reason to use it - = suffices

13:42 ClojureScript keywords are always objects same as Clojure

13:42 sdegutis: ok

13:43 matthavener: are there any use cases for identical? in clojure other than performance related?

13:44 i guess if you need to emulate some java that calls = ...

13:44 dnolen: matthavener: mostly perf, since = uses identical?

13:45 justin_smith: ,(= (java.util.Date. 0) (java.util.Date. 0))

13:45 clojurebot: true

13:45 justin_smith: those are mutable, so if you wanted to know if they were the same object or not you could use identical

13:45 ,(identical? (java.util.Date. 0) (java.util.Date. 0))

13:45 clojurebot: false

13:46 justin_smith: ,(= (java.util.HashMap.) (java.util.HashMap.)) ; even more likely to get mutated while you aren't looking

13:46 clojurebot: true

13:52 Trioxin: could it be said that scala has a paradigmatic or otherwise advantage over clojure?

13:53 without arguing pureness

13:53 justin_smith: Trioxin: 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:54 also arguably an advantage is that you can write normal java-like code in it which helps for transitioning

13:54 Trioxin: well, you can drop down into java in clojure right?

13:55 justin_smith: the 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:55 Trioxin: you can use interop, or call java code if you feel like writing some java.

13:56 Trioxin: but even with interop, clojure has reflection issues that scala doesn't because scala has stronger typing.

13:56 j-pb: yeah, but I'd rather write java than scala

13:56 scala loooooves magic

13:56 which is great as long as nothing goes wrong

13:56 Trioxin: you mean better type inference?

13:56 justin_smith: j-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:57 Trioxin: 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:57 each has its advantages/disadvantages but perf and correctness wise scala wins there

13:58 j-pb: justin_smith: If iirc it can fail to type typable expressions though right?

13:58 justin_smith: j-pb: sure, that's always the tradeoff with strong typing. You get either correctness or completeness.

13:58 j-pb: something something accidentally embedded dependent types

13:58 justin_smith: right

13:59 so we can do things simply in clojure that would be an insane pain in the ass in a strongly typed language

13:59 as a tradeoff we can do insane incorrect things that wouldn't compile in a strongly typed language

13:59 win some, lose some

13:59 j-pb: yeah

13:59 it's basically the price we pay for macros

14:00 hard to type, hard to do partial functions ^^

14:00 justin_smith: that's part of it, yeah

14:01 j-pb: I 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:03 justin_smith: j-pb: I found this... https://github.com/haskell-lisp

14:04 l1x: hey guys

14:04 sorry for the dumb question, how do i use a java interface in clojure?

14:04 if it is like this -> public interface Writer

14:05 justin_smith: l1x: calling it or implementing it?

14:05 l1x: justin_smith: i am not sure what it is for

14:05 justin_smith: l1x: 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:06 l1x: huh, maybe i am asking the wrong question

14:06 do i need to "implement" an interface before using it the "normal" java way (def balh (JavaClass.))?

14:06 justin_smith: l1x: what do you mean by "use a java interface"

14:07 lokien: hello justin_smith :)

14:07 l1x: justin_smith: just import it to my clojure code and use the functi^H^H^methods from it

14:07 i guess i have to implement it

14:07 justin_smith: l1x: no. If you have an object at hand that implements the interface, you can call the interface method like any other method.

14:07 l1x: yes

14:08 justin_smith: just call it

14:08 l1x: so i need an object that implements the interface

14:08 ok this is a good start

14:08 justin_smith: wait, what do you have and what are you trying to do with it?

14:08 lokien: hello

14:08 l1x: justin_smith: i have this code https://github.com/apache/hive/blob/master/orc/src/java/org/apache/orc/Writer.java

14:08 and i want to write a file

14:08 orc file

14:09 justin_smith: OK. That defines an interface. What do you want to do that requires that interface?

14:09 l1x: https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcFile.java#L37

14:09 this is the implementation of the interface?

14:10 when you see x extends y

14:10 i guess

14:10 justin_smith: it's an implementation yes

14:10 do you want to use that implementation, or make a new implementation?

14:11 l1x: https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/io/orc/WriterImpl.java#L81

14:11 huh found it

14:11 this is probably what i need to use

14:11 justin_smith: l1x: I still have no idea what you are trying to do

14:11 l1x: write an orc file

14:11 justin_smith: but good I guess?

14:11 j-pb: justin_smith: haha nice

14:12 l1x: justin_smith: i just need to figure out how java people think, and also figure out where to tap into this code base

14:13 justin_smith: l1x: I'd look for the javadoc

14:13 hiredman: dnolen: right

14:14 favetelinguis: gross

14:17 l1x: justin_smith: thanks

14:28 tolstoy: Anyone ever get "method code too large" when running `lein eastwood`?

14:29 sdegutis: tolstoy: how do you like Eastwood as a linter?

14:29 is it more useful than not so far?

14:29 tolstoy: I don't know. I've always passed all its tests.

14:29 sdegutis: :)

14:29 tolstoy: It hasn't been super useful, yet. I'm kinda just trying it out just in case.

14:30 sdegutis: tolstoy: considering it's just recommending a smaller method, it might just be a matter of blind idealism.. whats the method look like?

14:30 tolstoy: I've got a

14:31 I'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:32 So, could be "too many functions on this protocol: are you serious?" or something.

14:33 Might be a bug in eastwood itself.

14:33 ystael: tolstoy: is eastwood _telling_ you your method code is too large, or _failing_ because the compiler has exceeded the method code size limit? :)

14:34 tolstoy: ystael: The second case.

14:35 Yeah, it's a run time exception. My code is usually clear of any eastwood advice, so I confused the output a bit.

14:37 justin_smith: sdegutis: tolstoy: yeah the "method too large" thing is a bug in eastwood

14:38 it's something that happens when you go crazy with the macros :P

14:38 tolstoy: justin_smith: Yeah, I just unset the :jvm params in project.clj just in case, but ... bomb.

14:38 Oh. Hm. I've not written any. Perhaps it's one of the built ins?

14:39 justin_smith: tolstoy: no, I mean in eastwood

14:39 tolstoy: I do have a protocol with 20 functions (about) in it. Kind of just a data API holder.

14:39 Ah.

14:39 justin_smith: right, but each protocol function is a method in each implementation

14:39 they aren't shoved into one method

14:40 tolstoy: I'm seeing a lot of analyzer output.

14:44 Huh. Maybe it's a tools.analyzer.jvm issue. Anyway.

14:45 justin_smith: perhaps 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:48 tolstoy: It's mentioned once in a closed issue, but, yeah. I'd post an issue but, jeez, there are already so many.

14:54 sdegutis: Does Component work best when everything in your system is defined as a component, with no free-floating var functions?

14:55 tolstoy: You mean like not having a namespace of utility functions, or something like that?

14:56 I think Component can work however you want, but for me, it's best as an organizing principle.

15:06 lokien: justin_smith: remember that one liner you wrote yesterday for me?

15:07 that one using reductions

15:16 lokien_: I'm getting NPE every time I'm using it on a text file

15:17 I want value in vector to stay if there's other value than "next" or "prev" in a text file

15:17 "next next prev next ahava prev" -> [0 1 2 1 2 2 1]

15:18 "" -> [0], still

15:18 ridcully: ,(re-seq #"(prev|next)" "next next prev next ahava prev")

15:18 clojurebot: (["next" "next"] ["next" "next"] ["prev" "prev"] ["next" "next"] ["prev" "prev"])

15:18 ridcully: ,(re-seq #"(?prev|next)" "next next prev next ahava prev")

15:18 clojurebot: #<SecurityException java.lang.SecurityException: denied>

15:19 ridcully: ,(re-seq #"(?:prev|next)" "next next prev next ahava prev")

15:19 clojurebot: ("next" "next" "prev" "next" "prev")

15:20 lokien_: oh hello ridcully

15:21 let me grasp syntax a bit

15:21 ridcully: if you need anything but "prev" to be inc, you can also do something like (if (= cmd "prev") dec inc) instead of that map

15:22 the regexp there just makes sure to get rid of anything, that is not mapped

15:22 lokien_: I need this to be two dimensional, I wanted to zip two outputs at the end

15:22 like [[0 1] [1 1]] etc

15:24 i don't know if zipping is the right approach

15:26 ridcully: you want the command and the current value?

15:30 lokien_: ridcully: what do you mean by "command"?

15:30 I can paste you my fun in like 15 mins

15:30 I'm outdoors now

15:31 ridcully: would be best. i am not sure, i understood what you are after

15:31 lokien_: I'm pretty sure you didn't, it wasn't a good explanation

15:55 lokien: ridcully: soo, zipping was a bad, bad idea

15:56 like, really bad

15:58 ridcully: the problem with the "unknown" commands is clear?

15:58 lokien: ridcully: "up left down down right up" -> [[0 0] [0 1] [-1 1] [-1 0] [-1 -1] [0 -1] [0 0]]

15:58 I want to have it like this

15:58 spaces are only for readability

15:59 blake_: 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:59 I feel like I should be able to treat this as a sequence, but not sure of the best approach.

15:59 lokien: ridcully: it won't work with zip, I don't know what I thought back then

16:00 ridcully: lokien: 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:01 ,(let [up [0 -1]] (map + up [42 66]))

16:01 clojurebot: (42 65)

16:01 amalloy: ridcully: you want to use mapv there, not map, otherwise a bunch of laziness can pile up

16:02 ,(reduce (fn [pos dir] (map + pos dir)) [0 0] (repeat 10000 [1 0]))

16:02 clojurebot: #<StackOverflowError java.lang.StackOverflowError>

16:02 amalloy: ,(reduce (fn [pos dir] (mapv + pos dir)) [0 0] (repeat 10000 [1 0]))

16:02 clojurebot: [10000 0]

16:02 lokien: ridcully: ye-ah, but it's two dimensional now, so I.. have to include [0 0] instead of 0 as my starter?

16:02 ridcully: ic. good point!

16:02 (inc amalloy)

16:02 lokien: http://lpaste.net/8678437113303138304

16:02 my function

16:03 to count in one dimension

16:03 amalloy: it's a mistake a lot of people, including myself, have made a lot of times

16:04 lokien: (reduce-one "<<<><>" ">" "<") -> (0 -1 -2 -3 -2 -3 -2)

16:04 ridcully: lokien: right. you go from 1d x to 2d [x y]

16:04 lokien: ridcully: so, two more arguments and [0 0] as a starter?

16:05 ridcully: lokien: wait, what now? <> are just prev/next. so 1d is fine her. you where talking about up/left/down/right?

16:05 s/her/&e/

16:06 lokien: ridcully: yeah.

16:13 ridcully: yesterday I thought it'd be easier with imperative approach, but it's pretty much the same

16:25 ridcully: oh damn I can't read. I need this function to output two dimensional thang. it's returning one dimension now

16:34 WorldsEndless: How do I add something to the back of a lazy seq?

16:34 "into" and "conj" aren't doing the trick

16:34 justin_smith: WorldsEndless: (concat lazy [e])

16:35 WorldsEndless: there is no operation that directly puts an item at the end, but you can fake it with concat

16:35 WorldsEndless: Ah, that does the trick!

16:35 justin_smith: WorldsEndless: but if you had a vector, you could use conj and that would be cheaper

16:51 lokien_: uh, I'll try to finish it tomorrow, I guess.

17:24 WorldsEndless: Does anyone use letfn much? Seems sensible for encapsulating code, but I almost never see it used.

17:24 devth: nope. never

17:26 justin_smith: WorldsEndless: mostly just for mutual recursion, but even then it can be more straightforward to just use declare

17:26 otherwise let with an fn in it works just as well

17:27 ystael: WorldsEndless: I typically use letfn in preference to putting a fn in a let, but it sounds like I'm in the minority

17:28 justin_smith: ystael: 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:28 and nesting a letfn inside a let feels odd too when you can easily bind an fn in a let anyway

17:28 neoncontrails: WorldsEndless: I first saw it employed in the docs of Quil. It's handy for painterly applications

17:29 ystael: justin_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:29 tolstoy: I use `letfn` every now and then.

17:30 devth: philosophically 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:31 justin_smith: devth: except mutually recursive locally bound functions would be clumsy

17:31 if even possible

17:31 devth: (fn foo [x] .... (foo ...) ...)

17:31 justin_smith: devth: mutually recursive

17:31 foo calls bar, bar calls foo

17:31 devth: ah

17:32 (let [foo (fn ..) bar (fn ..)] ...) why can't they call eachother inside a let?

17:33 justin_smith: bar does not exist in the scope of foo's binding

17:33 neoncontrails: devth: aren't they? I tend to think of functions as environments, values as data.

17:33 devth: justin_smith: oh i finally get your point. :)

17:33 neoncontrails: well sure they are special in some regard, but in another, they are a value like everything else.

17:34 i.e. i would be grossed out if (letstring [x "foo"]) was a thing :)

17:35 justin_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:35 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

17:35 justin_smith: anyway, it would look something like that without letfn

17:35 ugly

17:35 neoncontrails: devth: Hah. Excellent illustration of the point

17:36 devth: justin_smith: i'd probably use declare before letfn

17:37 justin_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:37 clojurebot: -10

17:41 justin_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:41 clojurebot: 599781/80000

17:43 justin_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:43 clojurebot: 599781/80000

17:55 devth: > 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:55 http://danboykis.com/?p=2263

17:55 just when i was about to finally adopt component :)

17:55 justin_smith: yeah, I saw that

17:55 devth: justin_smith: have you checked out mount?

17:56 justin_smith: yes, won't use it because it uses defs for stateful resources

17:56 that's not acceptable for me

17:56 devth: e.g.? not totally sure what that means

17:56 justin_smith: devth: eg (def db (connect to db))

17:57 devth: ok

17:57 justin_smith: they don't do that directly, but they still put a stateful resource in a top level definition

17:57 devth: vs storing it in an atom ?

17:57 justin_smith: an atom or not does not matter

17:57 devth: ok, so you expect it to be passed in

17:57 justin_smith: what matters is that it is stateful, and you store it in a var

17:57 right

17:57 because putting it in a var means you hard code the fact that there can only be one

17:57 it means now you need mocks for tests

17:58 devth: right. (gross)

17:58 justin_smith: it means you need to duplicate code if you want to interact with two dbs

17:58 (or abstract it out and do what you would have done with component anyway)

17:59 component isn't OO, it's using methods to manage stateful resources - that's a small slice of what OO is about

17:59 devth: k. i'm gonna read up a bit more on it

17:59 justin_smith: writing 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:59 amalloy: justin_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:00 justin_smith: amalloy: they need names in order to be connected to one another

18:00 if you can chain some deps in a sequence, then that can be a single component

18:01 amalloy: 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:02 I could probably take "like" out of that statement

18:02 hiredman: there are

18:03 but you can do things to, I dunno, emulate that

18:04 I've done stuff like had keys with a particular namespace treated as sort of a set of components

18:04 {:foo/a … :foo/b …}

18:05 a lot of how you end up using it depends on the granularity you use it at

18:06 devth: not sure how i feel about so much `alter-var-root` in the component readme

18:07 justin_smith: devth: that's totally optional

18:07 you can put it in an atom, an agent, or a local binding

18:07 whatever works in your own design

18:07 devth: yeah. wondering why he didn't

18:07 to emphasize that it's the very top level controlling thread and doesn't need to be threadsafe?

18:08 justin_smith: vars are thread-safe

18:08 devth: oh. TIL :)

18:09 pretty sure i've never actually used alter-var-root

18:09 justin_smith: yeah, 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:10 hiredman: it 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:11 devth: hm, liking what i'm reading in the mount docs

18:11 hiredman: generally you're start and stop comonent functiosn will be side effecting, so using an atom is silly

18:12 your

18:13 there 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:13 amandabb: hi

18:13 hiredman: you don't even need to use protocols and records/types for component, it is pretty easy to use maps and multimethods with it

18:14 amandabb: question: why does this work: (swap! x update-in [:row] inc) but this doesn't: (swap! x update :row inc)

18:14 devth: hiredman: oh really. that was one of my bigger aversions

18:14 amalloy: ,(doc update)

18:14 clojurebot: "([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:14 amalloy: amandabb: those two should be identical

18:15 amandabb: should be

18:15 but update is giving me an error

18:15 justin_smith: what's the error?

18:15 hiredman: are you using a version of clojure with the update function?

18:15 amandabb: i hope so? using the latest light table instaclojure repl

18:15 amalloy: hiredman cutting to the chase here, i suspect

18:15 amandabb: java.lang.RuntimeException: Unable to resolve symbol: update in this context

18:15 online repls didnt work eithe

18:15 either

18:15 same error

18:15 amalloy: that's a too-old version of clojure, indeed

18:15 justin_smith: *clojure-version*

18:16 ,(:added (meta #'update))

18:16 clojurebot: "1.7"

18:16 justin_smith: you need 1.7 or newer

18:16 amandabb: http://www.tryclj.com/ and lighttable's clojure instarepl both dont use 1.7..?

18:16 amalloy: amandabb: those are both projects that haven't been updated in a long time

18:16 justin_smith: amandabb: *clojure-version*

18:16 ,*clojure-version*

18:16 clojurebot: {:major 1, :minor 8, :incremental 0, :qualifier "alpha3"}

18:16 amandabb: thats weird ok thanks

18:20 hiredman: ,*clojure-version*

18:20 clojurebot: eval service is offline

18:20 hiredman: ,*clojure-version*

18:20 clojurebot: {:major 1, :minor 8, :incremental 0, :qualifier "master", :interim true}

18:27 TEttinger: woo hiredman

18:32 amandabb: is there any way to do partial in arguments in different order?

18:32 like if a function takes 3 arguments, partial the last 2 but not the first

18:32 justin_smith: with flip, or by hand

18:33 amandabb: what's flip?

18:33 justin_smith: (defn flip [f] (fn [& args] (apply f (reverse args))))

18:33 returns a new function that takes args in the opposite order

18:33 amandabb: well what if you wanted to partial the 1st, 3rd, and 7th argument or something

18:33 justin_smith: then do it by hand

18:33 amalloy: justin_smith: i think if someone asks "what's flip", it's better to just go back to the original question and forget flip

18:34 justin_smith: k

18:34 amalloy: amandabb: define a function inline

18:34 amandabb: so as an example, how could i do this easily with partialing mod?

18:34 amalloy: (defn partial-137 [f x y z] (fn [a b c d] (f x a y b c d z)))

18:34 amandabb: i want to supply the 2nd not the 1st parameter

18:35 justin_smith: (fn [b] (fn [a] (mod a b))

18:35 or (flip mod)

18:35 hiredman: amandabb: use an anonymous function, either (fn ...) or #(...)

18:35 amandabb: brb

18:35 hiredman: let me play out the rest of this conversation:

18:35 <amandabb> but I don't want to

18:35 why not?

18:36 <amandabb> that seems less elegant than partial

18:36 what do you think partial does?

18:36 <amandabb> I dunno, magic?

18:36 nope

18:37 MJB47: im pretty sure its magic

18:38 hiredman: all you have to do is load up core.clj and read the source

18:38 it returns an anonymous function that closes over the supplied arguments

18:39 (and does a lot of argument unrolling for performance reasons)

18:52 amandabb: hiredman: 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:56 TEttinger: ,((comp (partial bit-and 3) inc) 7)

18:56 clojurebot: 0

18:57 TEttinger: ,((comp (partial bit-and 3) inc) 6)

18:57 clojurebot: 3

18:57 TEttinger: doesn't work for negative

18:57 ,((comp (partial bit-and 3) inc) -1)

18:57 clojurebot: 0

18:57 TEttinger: ,((comp (partial bit-and 3) inc) -2)

18:57 clojurebot: 3

18:57 TEttinger: err, actually kinda does

18:57 ,((comp (partial bit-and 3) inc) -3)

18:57 clojurebot: 2

18:57 TEttinger: surprising

18:58 amandabb: well the number would only ever be between 0 and 3

18:58 since when it would normally hit 4 it would just go to 0

18:59 TEttinger: ,(map (comp (partial bit-and 3) inc) (range 4))

18:59 clojurebot: (1 2 3 0)

18:59 TEttinger: obviously this is a total hack

18:59 it only works because 4 is a power of two

19:00 amandabb: haha yeah pretty neat

19:00 probably wont use it though because it would be confusing to reader

19:00 TEttinger: well yes

19:00 point-free style has that trait

19:02 johnny86: hello

19:02 TEttinger: hello

19:02 johnny86: I can't seem to find an example about the reduced? function

19:02 can anyone help me with one?

19:03 amalloy: johnny86: you probably don't need to care

19:03 TEttinger: hm, I haven't used reduced? but I have used reduced a lot

19:03 (doc reduced?)

19:03 clojurebot: "([x]); Returns true if x is the result of a call to reduced"

19:03 johnny86: (+ 1 2)

19:03 justin_smith: ,(reduce (fn [_ e] (when (even? e) (reduced e))) [1 3 5 6 7 8])

19:03 clojurebot: 6

19:03 3

19:04 justin_smith: ,(reduced? (reduced 42))

19:04 clojurebot: true

19:04 johnny86: nice, the bot :D

19:04 justin_smith: that's what reduced? does

19:04 returns true if its arg is a reduced

19:04 like amalloy says you probably don't need it

19:04 johnny86: yes but in what context is it used?

19:04 TEttinger: ,(reduced? (reduce (fn [_ e] (when (even? e) (reduced e))) [1 3 5 6 7 8]))

19:04 clojurebot: false

19:04 justin_smith: johnny86: see my first example of reduce

19:04 amalloy: johnny86: it is used almost exclusively in implementations of reduce

19:04 justin_smith: johnny86: it's used internally by reduce

19:05 johnny86: can I use it on a value in the end of the reduction?

19:05 justin_smith: johnny86: in the middle

19:05 and that becomes the end

19:05 TEttinger: "reduced?" doesn't seem to know whether a given value resulted from reduced if the reduce call already finished

19:06 justin_smith: johnny86: to be clear, reduced? tells you if something is a reduced, and reduced generates a reduced, and now the word reduced looks funny

19:06 TEttinger: (which makes sense, it's internal)

19:06 justin_smith: TEttinger: reduce doesn't return a reduced

19:06 ,(reduced 42)

19:06 clojurebot: #object[clojure.lang.Reduced 0x1da3450b {:status :ready, :val 42}]

19:06 justin_smith: TEttinger: reduced is just a container class that holds one value

19:06 TEttinger: ok

19:07 justin_smith: ,@(reduced 42)

19:07 clojurebot: 42

19:07 TEttinger: ,@@(reduced (reduced 42))

19:07 clojurebot: 42

19:09 johnny86: so normally there is no use case for it?

19:09 justin_smith: johnny86: right, exactly

19:10 johnny86: ok then, thanks :)

19:11 turbofail: some transducers may need it as well, it looks like the `interpose' transducer uses it

19:46 BRODUS: 'eval' should recognize symbols defined in any surrounding lets right ?

19:47 having trouble with this code: http://pastebin.com/9JDVVsWN

19:48 retrogradeorbit: can you bind to %? is that allowed?

19:48 BRODUS: you can

19:48 probably should use something else though

19:48 retrogradeorbit: ,(let [a 20] (eval '(+ a a)))

19:49 clojurebot: #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:51 BRODUS: ,(let [a 20] (eval `(+ ,a ,a)))

19:51 clojurebot: #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:51 amalloy: BRODUS: no, eval has no access to locals

19:52 BRODUS: thats a bummer

19:52 retrogradeorbit: right. It has access to defs.

21:35 neoncontrails: What could it mean that the browser isn't displaying specifically the DOM content of a clojurescript app?

21:35 The app compiles fine.

21:35 The browser is connected. js errors entered into figwheel pop up as expected

21:37 Working now! Heh, well apparently it means you should run 'lein clean'

22:22 amandabb: hmmm

22:22 anyone 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:22 board is just just a 2d array

22:24 ohhhhh nevermind

22:24 lol.. stare at it for 10 minutes -> don't know problem -> post in irc -> figure it out 30 seconds later

22:25 was missing parenthesis around the :row % and :col % calls

22:30 g0w: amandabb: is this from clj-brave and true?

22:30 amandabb: no im making a game

22:30 g0w: ah ok! ncie

22:30 *nice

22:30 amandabb: yeah my first clojure project

22:31 going decently so far

22:31 g0w: have fun =)

22:31 share it with us once you're done

22:31 amandabb: sure

22:31 should only be a day or two

23:46 BRODUS: any 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:47 but it prints fine if i evaluate the clojure code directly from the buffer

23:50 tolstoy: Does it print to the *nrepl-server* buffer?

23:51 BRODUS: no

23:53 kovrik: so you want something like `cider-eval-defun-at-point-in-repl`?

23:54 fingertoe: stumped 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?

Logging service provided by n01se.net