#clojure log - Aug 07 2013

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

0:04 johnmn3: I'd like to use Austin as a browser repl. Is there a cljs function to put in my project's cljs source to do so, rather than having to inject from the clj/ring side?

0:05 I'd like to be able to make this an "off-line" app, so I am trying to limit logic on the server side for now.

0:06 callen: Raynes: whoa

0:12 johnmn3: plus, I'm not using enlive or hiccup or compojure, so I'm not sure how I'd inject it.

0:13 xeqi: johnmn3: I've copied the sample project but put the dependencies and src/clj in the :dev profile

0:14 added a helper method for setting up a brepl, basically made a runnable server for dev time

0:15 it seems like it would be possible to turn something similar into a plugin for starting "offline apps" for dev

0:19 johnmn3: xeqi: it appears that browser-connected-repl-js just inserts ";goog.require('clojure.browser.repl');clojure.browser.repl.connect.call(null, '%s');" into the html

0:19 where %s is filled by the function (cemerick.austin/repl-env)

0:20 which produces something like: http://localhost:42520/3141/repl/start

0:21 so it pretty much has to come from the server, otherwise it doesn't know what port/session to connect to.. okay, I think I understand.

0:21 cemerick: johnmn3: what's the use case?

0:22 johnmn3: I'm working on a project that doesn't already have enlive, composure or hiccup in use, so I didn't want to have to include those just to inject the repl

0:22 I am using ring already

0:22 cemerick: johnmn3: how are you producing your HTML?

0:24 johnmn3: mostly a static html file, and then modifying it on the client side. It does have ring.middleware.resource and ring.middleware.file-info on the server side. I'm playing with the clj-browserchannel project from github, trying to make a chat webapp out of it.

0:25 there is a function (defn handler [req] {:status 200 :headers {"Content-Type" "text/plain"} :body "Hello World!"})

0:25 does that take a :script argument?

0:26 callen: https://github.com/kickstarter/rack-attack does this exist for Ring yet?

0:27 cemerick: johnmn3: You can set up a ring handler to return the result of (browser-connected-repl-js), and add the result to a new <script> tag

0:29 callen: I'm going to assume it doesn't exist.

0:30 johnmn3: cemerick: okay, I'll take that route

0:31 cemerick: I should probably make that function accept an argument, so it can be dropped in as a ring handler

0:33 callen: technomancy: please talk about Skaro and OCaml :(

0:35 robink: cemerick: Gotcha, thanks.

0:35 cemerick: Does clj-http support requesting the cert for a certain CN when setting up an SSL socket?

0:36 cemerick: robink: I have no idea. But, if it's a PITA/impossible with java.net.*, it's either really easy with clj-http, or reasonable/possible with the underlying apache bits.

0:40 technomancy: callen: I was expecting it to be shorter than the scheme version because destructuring allowed the clojure version to be significantly shorter

0:41 but the board drawing code turned out to be hairy. probably could just be rewritten.

0:41 robink: cemerick: Gotcha

0:41 technomancy: callen: but not having any nil in the whole language? zomg <3

0:42 johnmn3: cemerick: do you mean something like (str "<script>" (browser-connected-repl-js) "</script>") ?

0:43 cemerick: johnmn3: perhaps; depends on how you're adding the script tag in the clojurescript/javascript in the static page

0:46 callen: technomancy: that is pretty sweet. :)

0:46 technomancy: I'd prepurchase RWO if there was a concurrent implementation.

0:46 I would kill for an OCaml LLVM with a concurrent GC

0:47 technomancy: supposedly there's an experimental concurrent implementation

0:47 the eigenclass.org guy was ranting about it years ago when all that was way over my head

0:47 callen: technomancy: nah, it's too much like my experiences with Guido van Rossum.

0:48 technomancy: grumpy bumblefuck francophone (OCaml) refuses to admit concurrency is necessary, is eventually grudgingly shoved along to a half-assed implementation suffering from the neglect of the BDFL

0:48 pass.

0:48 Rust doesn't have nil either.

0:48 Ocaml is 10 years too late.

0:48 seancorfield`: callen: for about a decade i worked with a language that had no concept of nil / null :)

0:48 technomancy: eigenclass.org hasn't been updated in years =(

0:49 callen: seancorfield`: you were using something arcane, not thoughtful :P

0:49 seancorfield`: if you managed to assign null somehow to a variable, you could no longer dereference that variable - it ceased to exist! :)

0:49 callen: that's still a runtime error :(

0:49 the point is to break out the Option/Maybe at compile time.

0:50 if you're going to bother at all anyway.

0:50 The GIGO of Clojure works well enough for me, if I'm honest.

0:50 hell, I even wrote a GIGO wrapper to some clj-time stuff out of laziness recently.

0:50 noidi: GIGO?

0:50 callen: garbage in garbage out.

0:50 I adore it.

0:50 noidi: ah, right

1:06 robink: cemerick: Actually, when I first ran into this issue, it was with drawbridge trying to connect to an HTTPS-secured nREPL, and failing since clj-http never requested anything but the default certificate.

1:17 cemerick: robink: do you think that drawbridge is somehow related to the cert problem?

1:17 robink: cemerick: Not at all.

1:17 cemerick: The problem is undoubtedly with clj-http, HttpClient or java.net.*.

1:17 cemerick: I just don't know where it lies.

1:18 cemerick: The default behavior of clj-http and/or HttpClient should be to request a cert with a CN equal to the value of the Host: header.

1:18 cemerick: but it doesn't, and I'm still trying to figure out how to override that.

1:19 cemerick: robink: if you're having issues with all of these libraries, I'd be worried about some network or JDK configuration problem

1:20 robink: cemerick: That's also a possibility, but with other HTTPS clients I'm able to obtain a cert whose CN matches the Host: header when connecting to a server that hands out multiple certs on a single IP/port.

1:20 cemerick: So the problem could indeed lie with the Java configuration, but it seems like a pretty glaring issue for a stock install of Java.

1:20 cemerick: robink: are you using an oracle jdk, or other?

1:21 robink: cemerick: Oracle JDK, mostly.

1:21 cemerick: Occasionally sun-jdk-1.6, but will probably stop using it now that it's clear it's not getting any more security updates.

1:21 cemerick: I'm also happy to give IcedTea a go.

1:22 cemerick: ok; some of the more neckbeardy JDKs have less-than-useful root certs, thought maybe there'd be a correlation

1:22 This might actually be a worthwhile #java topic, if you're willing to brave the hordes.

1:23 tsantos: neckbeardy! lol

1:23 robink: cemerick: Heh, I might. It would certainly be good to know how to directly coerce Java's net/SSL classpath to request a cert of my choosing.

1:24 johnmn3: cemerick: hah, I opened a normal browser repl and then connected to the austin repl by pasting in url :)

1:25 cemerick: johnmn3: yeah, that's the escape hatch

1:25 johnmn3: if you're just looking for any browser-repl, then use `cemerick.austin.repls/exec`

1:26 all the messing about with javascript is only necessary if you want a browser-REPL connected to your application running in a GUI browser

1:26 johnmn3: cemerick: yea, I may have both going.

1:27 harja: what validation library you guys suggest to be used nowadays? Valip has not updated since 1.2

1:27 or is it still a good bet?

1:28 johnmn3: my main reason for trying austin was that the brepl kept on crashing out on me. It would easily break and I'd have to relaunch cljsbuild's repl-listen and refresh the page

1:31 cemerick: johnmn3: "crashing out" is a bit nonspecific, but it is hoped that austin will be less persnickety than the cljs stock browser-REPL

1:33 johnmn3: cemerick: persnickety was the technical term I was looking for. :) if I manage to recreate one of the causes I'll report back.

1:34 cemerick: sounds good :-)

1:40 johnmn3: aye, tis the broken pipe

1:42 and now it refuses to reconnect no matter how many times I refresh and I have to restart the repl and then refresh again.

1:42 java.net.SocketException: Broken pipe

1:43 oh wait... it just worked after the 4th refresh... hmm

1:43 dark_element: johnmn3 turning off cache helps but i think you are doing that already.

1:44 johnmn3, also brepl crashes for me as well. It's very hard to know when brepl is actually connected to browser.

1:46 johnmn3: dark_element: I'm not sure if I'm turning off the cache. what's that about?

1:47 dark_element: johnmn3, well mostly you get older compiled js sometimes.

1:48 johnmn3: ah

1:53 dark_element: cemerick, Is it a good idea to show connection state of browser in cljs repl?

1:55 cemerick: dark_element: you mean, in the browser?

1:56 dark_element: cemerick, I was thinking of in emacs buffer actually but browser is not bad idea either.

1:56 cemerick: The browser is a more accessible target. Not everyone uses emacs. :-)

1:58 dark_element: cemerick, even though i can check network calls in browser dev tools I can't exactly say what's going on. Some status messages would be helpful.

1:58 cemerick: johnmn3: FWIW, it can take the compiler some time to get its business in order when you first connect; if you get impatient and reload, then you'll see a broken pipe error. I generally keep an eye on my CPU gauge as an indication of things...

1:59 dark_element: cemerick, Maybe push it to some global variable like window.cljsrepl.status

1:59 johnmn3: cemerick: okay. thanks. I'll wait it out next time.

2:01 cemerick: dark_element: I don't know how much that would end up telling you. If we can set that, then everything is working. If we can't, it's not. There's not a lot of room in between that is amenable to troubleshooting AFAICT.

2:02 mischov: Hmm. So does doing extend-protocol with clojure.lang.ISeq to catch PersistentVectors, etc?

2:02 not catch*

2:03 dark_element: cemerick ohh ok. I thought there are multiple states during the connection.

2:03 cemerick: dark_element: not at any level I'm aware of

2:03 dnolen: mischov: vectors are seqable but not seqs

2:03 mischov: dnolen: Bugger.

2:04 dnolen: mischov: you probably want to extend to ISequential

2:04 dark_element: cemerick, also the setting status in repl/emacs will take care of other cases like two browser windows fighting for one repl.

2:04 dnolen: mischov: er Sequential I think

2:05 johnmn3: (val {1 2}) doesn't work in clojurescript?

2:06 mischov: dnolen: You nailed it. A king among Clojurians, truly.. :D

2:06 dnolen: And I totally should have knew that. I just dealt with something about seq? vs sequential?...

2:06 known, even

2:06 johnmn3: ah, nevermind

2:07 (val (first {1 2}))

2:07 map is not mapentry

2:07 cemerick: dark_element: that will more likely just turn into a println...or, maybe an nREPL response with a particular shape, when it's running in an nREPL environment

2:10 dark_element: cemerick, yes println is good. Instead of trying to evaluate something to check if repl is connected to a browser, it's better that repl prints it.

2:11 cemerick: dark_element: nm, that will be incredibly irritating while things are working properly

2:14 harja: what's the idomatic way to map a variable name as string to the value contained in the var? (eval (symbol "foobar")) sounds a bit overkill :)

2:14 dark_element: cemerick, the message will print only when a new window or same window gets reloaded.

2:16 dnolen: harja: generally a bad idea, but you can use resolve for that

2:18 cemerick: dark_element: yeah, maybe; fundamentally, I'd rather work on fixing whatever makes connection problems more likely, etc

2:18 seancorfield`: harja: (deref (resolve (symbol "the-ns" "the-varname")))

2:18 harja: dnolen: okay, well I'm just doing a shorthand macro for doing stuff. is that a wrong approach to begin with?

2:18 i.e. given "user" i want to do validation that is named "user-validator" etc

2:19 dnolen: harja: you shouldn't need to resolve in a macro unless your interacting with the runtime in some way.

2:19 harja: okay, so what's the best way to refer "user-validator" when the user -part is given as the parameter

2:20 dark_element: cemerick, all right

2:21 dnolen: harja: you should explain your goals more clearly - why do you think you need a macro here in the first place?

2:22 harja: that is, is auto resolving the validator actually adding any value

2:23 harja: if you just want an answer, you don't need resolve for that, just generate the symbol you want from the symbol the macro received.

2:24 harja: dnolen: thats a discussion worth a while I think :) Basically I have just a bunch of database tables, and an API to insert stuff to it. Given that I want to check some constraints prior to inserting data to it, I thought that it would be neat to be able to just say (entities/set! foo foo-fields) from the API side and let that take care of the rest

2:24 foo-fields was the stuff that came from the client

2:25 dnolen: (defmacro foo [some-sym] `(do ~some-sym ~(symbol (str some-sym "-validator")))) should give you some ideas

2:27 harja: dnolen: Ah! I had something like that in mind but did not get that you could just use the symbol as is :)

2:27 as you can probably tell, I'm just at the beginning of my clojure/lisp -journey

2:28 dnolen: harja: np, enjoy!

2:31 harja: The possibilities with code generating code is just something that does not stop to amaze me... probably this is comparable to a situation I just found a hammer and want to find anything that resembles a nail :)

2:41 since I started, is this a good approach? It seems to work, at least :) https://www.refheap.com/e1fc429bed03ef4559cdbae18

3:19 Is there a "pdb.set_trace()" (python) equivalent in clojure? Such that I could see what is going on in the middle of a request coming from an HTTP client

3:25 noidi: ambroseb_, is it possible to mark a "Definition missing" warning as ignored?

3:25 ambroseb_: noidi: use (ann ^:no-check var t)

3:28 noidi: ambroseb_, that works, thanks!

3:29 I'm very positively surprised by how usable core.typed is already

3:29 it has come a long way in a short time (for such an ambitious project(

3:30 ambroseb_: noidi: I've been fairly quiet about it ;)

3:30 I'm building up to 0.2.0.

3:31 I shall then staple USE IT on the front

3:32 noidi: yes, it seems quite usable already

3:33 it wasn't quite there yet the last time I checked, but now I haven't run into any major problems after two days of use

3:35 ambroseb_: noidi: excellent.

3:41 callen: noidi: what is this you're using?

3:48 noidi: callen, core.typed

3:54 callen: ah okay

4:13 danielszmulewicz: dnolen: `brew install clojurescript`: cljsc, browser-repl and repljs become available from anywhere on a mac.

4:14 dnolen: I issued a pull request on homebrew

4:14 callen: well not "from anywhere", just from any shell with /usr/local/bin in the path.

4:14 danielszmulewicz: callen: you got the idea

4:18 * ro_st shuffles the things on callen's desk around

4:18 danielszmulewicz: dnolen: Basically, it does automatically what this instructs to do manually: https://github.com/clojure/clojurescript/wiki/Quick-Start.

4:24 llasram: danielszmulewicz: The "NOTE" at the top of that page isn't kidding. You really really really want to just use anything about Clojure/Script via Leiningen

4:25 All of the tooling and workflow stuff is built around Leiningen

4:25 callen: danielszmulewicz: just use Leiningen.

4:25 homebrew is for plebs.

4:26 llasram: Over here in rational argument corner...

4:26 danielszmulewicz: it is orthogonal from leiningen

4:26 callen: llasram: I'm bad cop, you're good cop. Remember?

4:26 llasram: The issue is that not using Leiningen nets a sub-optimal experience

4:26 ro_st: -polishes his pleb badge-

4:27 llasram: I know several people who bailed on Clojure because they installed the homebrew or fink package for it and found it unusable

4:28 danielszmulewicz: it gives you `cljsc` on the command line outside of any project

4:28 callen: funny how damaging such things can be.

4:28 danielszmulewicz: that's not really a good thing.

4:28 llasram: danielszmulewicz: I get that, but why do you want that?

4:28 callen: danielszmulewicz: you need to learn to use Leiningen.

4:28 danielszmulewicz: don't use it. You obviously don't get the use case

4:28 callen: clearly we're the ones who haven't thought of things

4:29 danielszmulewicz: troll

4:29 llasram: danielszmulewicz: What is the use case you have in mind?

4:32 danielszmulewicz: llasram: extensions in emacs

4:33 llasram: I want to have the compiler globally available for tooling purposes

4:33 llasram: danielszmulewicz: Writing Emacs extensions in ClojureScript, bouncing through a node.js process?

4:33 callen: there is no node.js bridge to emacs.

4:34 so you're not only not using leiningen, you're writing your own protocol to communicate between node.js processes and emacs?

4:34 danielszmulewicz: who is John Galt?

4:34 llasram: this man doesn't need us, he's a self-made man. Let him continue with his Objectivist ways.

4:35 llasram: callen: As nicely as possible -- please stay off my side :-)

4:35 callen: Leiningen is for weak socialists that need help managing their packages.

4:35 llasram: pfft, as if I were ever on the side of communists and backbiting anti-capitalists.

4:35 llasram: I say down with Leiningen, up with the peoples' proletariat!

4:35 a proletariat dictatorship of the homebrew will spread throughout the world!

4:36 llasram: heh

4:38 callen: llasram: has anybody tried a PR to delete the Clojure and ClojureScript recipes?

4:39 danielszmulewicz: llasram: it's part of a foundation, I'm still experimenting

4:40 llasram: callen: I don't know. I don't use OS X myself and hadn't really thought about it. If the Clojure one still exists, it might be a good idea

4:41 danielszmulewicz: Cool. That sounds interesting. Best of luck :-)

4:44 danielszmulewicz: llasram: thanks!

5:13 shdwprince: Is there a function or smth for swapping function arguments?

5:14 llasram: shdwprince: Example?

5:15 shdwprince: llasram: (defn x [a b] (prn a b)), (x 1 2) -> 1 2, ((swap x) 1 2) -> 2 1

5:16 llasram: Ah, no -- you just use the #(...) reader macro in that sort of situation

5:17 Although it doesn't arise that often, and frequently means the underlying function's arguments are in the wrong order in the first place :-)

5:18 shdwprince: llasram: drop and take in update-in...

5:19 llasram: Ah. Fair enough! Honestly not something I've run into myself, but definitely not insane

5:19 You can always write your own `swap` function if it makes your code read cleaner

5:20 shdwprince: llasram: but it's not in core

5:20 clojurebot: idiomatic clojure uses dashes to separate words

5:20 llasram: Well, yes. But why does that matter?

5:21 shdwprince: llasram: refer always, noone dont know function that you using as part of language

5:23 llasram: If I understand your first point, it honestly isn't a generally useful function. It's limited to two-argument functions, and there just aren't that many situations where you need to swap two arguments. You can always refer it where you need it

5:25 hyPiRion: llasram: (defn swap [f] (fn [& args] (apply f (reverse args)))) ?

5:25 llasram: And for the latter -- that's a nature of a Lisp. Building the language from both top-down and bottom-up. As long as you pick sane names, use them consistently, and make it easy to track down definitions (explicit :refer), it's fine

5:25 hyPiRion: Ok, that's a little more general :-) I'm still skeptical how frequently useful pure argument order-reversal is

5:26 shdwprince: llasram: haskell has like-that function in haskell's core, so it useful enough

5:26 llasram: The only case I can think of I where I frequently want that is str/split, and I'm pretty sure that's just because the argument order there is Clojure-wrong

5:26 TEttinger: (partial (swap /) 0)

5:26 shdwprince: llasram: and I afraid of writing my-own solution if there is another one from contributors

5:27 TEttinger: if it wasn't swapped it would error, if it is it just generates 0s

5:27 (defn swap [f] (fn [a b] (f b a)))

5:28 hyPiRion's is more flexible nvm

5:28 llasram: shdwprince: I'd argue it's more useful in Haskell because of the point-free style idiom. That style is much less common in Clojure because the necessary nesting of parens makes the alternative (explicit anonymous function) more readable after one or maybe two HOF combinations

5:29 shdwprince: As for needing to write it -- as the proposed definitions show, you'd probably spend more time digging it up from somewhere than just writing it

5:30 If you pull in something like flatland/useful, it's probably in there, but that's a purely personal preference

5:30 shdwprince: llasram: I'm only newbie in clojure, and wan't to do things right

5:32 llasram: Then I'd definitely suggest writing it yourself. Put it in your own kitchen-sink of utility functions. See how often you use it.

5:34 And I didn't mean that in a sarcastic "you won't use it" sense. I mean literally -- see how often you use it, and other utility functions you write. Keep the ones you use, cull the ones you don't.

5:35 shdwprince: llasram: but in most cases #() do the job, and nothing needed to be required

5:35 llasram: I'd argue so, yes

5:37 TEttinger: #() or (fn [a b] ...) if you're already in an anonymous function with #()

5:38 shdwprince: TEttinger: i'm newbie, but not so much :)

5:38 TEttinger: I think I recently stopped being a newbie, now I'm just inexperienced :) 4clojure has been very helpful

5:38 I still need to learn macros

5:39 jonasen: my (datomic) datalog tutorial is now live at http://learndatalogtoday.org

5:39 shdwprince: TEttinger: macroses is fantastic when you came from not lisp, but debuging it in clojure is really painfull

5:39 jonasen: feedback welcome

5:40 ejackson: jonasen: that'll be really useful

5:40 jonasen: ejackson: I hope so

5:44 shdwprince: jonasen: huh, never dig in logic programming

5:50 jonasen: HN submission at https://news.ycombinator.com/item?id=6171722

5:55 pocket: Hi.

5:55 I starting learning clojure with 'programming clojure 2nd'.

5:56 And when I trying to get very long list of Fibonacci number with example code in the book.

5:57 whitch define fibs as (def fibs (lazy-cat [0 1] (map + fibs (rest fibs))))

5:58 Then I try to run: (take 10000 fibs). It gives me an error about Integer Overflow.

5:59 But when I try it again. It doesn't give any error. Just return very short list, just containing 90~93 items.

6:00 llasram: pocket: In Clojure, the way lazy sequences are realized doesn't guarantee that self-referential sequences like that will work

6:00 You can do it, but only by knowing and depending on certain implementation details

6:00 The specific behavior you're seeing is that you're holding the head of a lazy sequence which is realized up to the point where the exception was thrown

6:01 pocket: So when I encountered such error, I should restart repl?

6:02 llasram: No -- you just need to recompile your namespace / repeat the definition

6:02 Although like I said, self-referential lazy seqs aren't a good idea

6:03 pocket: Hmm.. thanks.

6:03 aroemers: jonasen: nice website about datalog!

6:04 pocket: Is there any option or flag to shutdown repl when I encounter some exception?

6:04 shdwprince: pocket: humm.. why

6:04 ?

6:04 pocket: for what reason?

6:05 pocket: Sometimes I didn't notice such error and I just think 'why this code doesn't work?'. So shutdowning repl is good for me to notice an error.

6:06 (Sorry for my stupid head..)

6:06 shdwprince: pocket: (clojure.repl/pst) prints stack trace if you got an exception

6:07 pocket: errors noticed with exceptions, names of them printed in repl, but without stack traces

6:08 pocket: usually there is no errors in your's code, that can fail and repl can't handle it

6:09 oh, i should try it

6:10 &(/ 1 0)

6:10 lazybot: java.lang.ArithmeticException: Divide by zero

6:10 shdwprince: &(clojure.repl/pst)

6:10 lazybot: java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to java.lang.Throwable

6:13 pocket: Thank you for advice and examples.

6:25 harja: is there a way to call [f g] [a b] for lists? i.e. (f a) (g b)

6:25 llasram: harja: It's not quite clear to me what you mean. Can you elaborate?

6:26 harja: i have a list of elements, and i want to apply functions from another list to the elements in the same index

6:26 samrat: how can I check whether or not I'm running with a :dev or :prod profile? from within a program, I mean

6:27 harja: i think it can be done with map

6:28 samrat: I'm trying to hot-reload code with http-kit only if it is :dev. the docs mention an in-dev? function but doesn't say how thats implemented

6:29 llasram: harja: Oh, yeah: (map #(%1 %2) [f g] [a b])

6:29 harja: llasram: exactly.

6:29 llasram: Well, there you go :-)

6:30 sandbags: is the use of 'eval' bad form? In solving a macro example from "Clojure in Action" I took a different tack to the book and seem to need to use eval to make my approach work https://gist.github.com/mmower/c2fe70504df903ac2538

6:30 harja: Yeah, figured it out myself too

6:30 thanks!

6:30 llasram: np, and glad you so-figured!

6:30 ~eval

6:30 clojurebot: eval is DENIED

6:30 llasram: hah

6:31 sandbags: i'm condition, from other languages such as Ruby, to consider eval with suspicion

6:31 llasram: It used to have some pithy saying about `eval` usually meaning you didn't write your code to run at the correct time in the first place

6:32 sandbags: okay given the rand-nth approach i took to the macro, was there some other way to express it than using eval?

6:32 llasram: Oh, you don't need `eval` there

6:32 sandbags: without the eval my macro seemed to return the expression, rather than evaluating it

6:32 llasram: You can just call `rand-nth` on `exprs` at maro-expansion time

6:33 sandbags: Untested, but something like this: (defmacro randomly [& exprs] (rand-nth exprs))

6:34 Unless I misunderstand what you want?

6:35 sandbags: well from the gist, the book solution is below mine

6:35 the idea is to evaluate a random s-exp from those passed in

6:35 llasram: Oh, I see -- it's supposed to select a separate random expression to evaluate at run-time, not a single one at macro-expansion time

6:36 sandbags: i'm not quite sure how those would be different

6:37 llasram: The solution I proposed would pick one of the expression when macro expanded. Anywhere you used it would be fixed to that result, no matter how many times you call the function containing the expansion

6:37 clgv: sandbags: what is the exact goal? can you give examples?

6:37 sandbags: llasram: ah, i see, yes the former

6:37 llasram: The solution from the book picks a separate random expression each time the expansion is evaluated

6:37 sandbags: llasram: but isn't the macro expanded at each call site?

6:38 llasram: Yes, but only once at each site

6:38 sandbags: llasram: ah yes

6:38 llasram: sandbags: So the two problems with `eval` are: (a) It's expensive (needs to invoke the compiler each time it's called), and (b) doesn't have access to the lexcal scope

6:38 E.g., this raises an exception: (let [a 1] (eval 'a))

6:38 Which is probably not what you want

6:38 sandbags: right

6:39 llasram: So to avoid those problem, you generally avoid eval. When you really need it, it's usually obvious that you really need it

6:39 sandbags: (randomly (println "amit") (println "deepthi") (println "adi"))

6:39 clgv: ^^^ the book example

6:39 clgv: llasram: did you ever really need it?

6:40 sandbags: llasram: okay so i've learned that i also need to treat eval with suspicion in clj so that was valuable :)

6:40 llasram: clgv: I've got a few utility macros wrapping `case` which `eval` the target expressions

6:41 clgv: And I'm working on a project which needs to invoke the compiler at runtime to build schema-specific de/serilaization code

6:41 sandbags: llasram: so i'm having trouble making your version work which seems to be about variable scope of 'exprs'

6:42 llasram: but were you saying that your version would give you a single expansion at any particular call site?

6:42 llasram: Yes

6:42 clgv: llasram: ah ok. I did not need eval in the last 3 years ;)

6:42 llasram: clgv: Oh yeah, it's totally rare

6:43 sandbags: is there another way of doing my rand-nth based solution that doesn't require eval?

6:43 i was thinking of mapping the expressions into anonymous functions and applying or something like that

6:43 but it feels rather clunky

6:45 presumably the source to cond holds some clue

6:46 llasram: In Clojure, `cond` is just a macro over `if`

6:46 sandbags: and if is a special form right

6:46 clgv: sandbags: In principle there is no other way. in the details you may vary

6:47 sandbags: clgv: ?

6:47 llasram: The `rand-nth` on `fn` approach would definitely work, and is arguable the better solution (can be O(1), whereas the `cond` solution is O(n))

6:47 Although now that I'm thinking about it, you could just use `case` instead :-)

6:47 sandbags: Yeah, in Clojure `if` is a special form

6:48 sandbags: so the case solution would be an optimised form of the cond solution they use in the book

6:49 llasram: Pretty much

6:49 clgv: sandbags: the book solution is to complicate imho. since only one expression is selected...

6:49 llasram's solution does the same much simpler

6:50 sandbags: i can see how the case the solution would work... i didn't like the cond approach because it didn't seem especially elegant having those useless evaluations when you already know what the answer is

6:50 and rand-nth can deliver an expression more easily, but the lack of access to lexical scope from eval is a bummer

6:50 clgv: why don't you go with the already suggested (defmacro randomly [& exprs] (rand-nth exprs)) =

6:51 ?

6:51 sandbags: clgv: because it doesn't do the same thing

6:51 clgv: and this is, anyway, an exercise i am thinking about

6:51 not a problem i am trying to solve

6:51 (also if it doesn't actually seem to work)

6:51 clgv: sandbags: it does the same thing as the second macro in your gist

6:52 llasram: clgv: Oh, you're right. That's really bizarre.

6:52 I'm going to say that's a bug in the book

6:52 sandbags: You said this is /Clojure in Action/?

6:53 sandbags: ah, so i'm actually solving a different problem :)

6:53 llasram: yes

6:53 pg 184 of whichever MEAP version I have

6:53 clgv: I dont have the book ;)

6:53 sandbags: it's very hard to tell which one that is

6:53 llasram: Unless there's been a recent edition, I was really underwhelmed by that book. If you haven't checked it out already, I'd check out /Clojure Programming/ (the O'Reilly one) instead

6:53 sandbags: i have that one also

6:54 I'm reading CiA 2nd ed

6:54 clgv: then better read that one ^^

6:54 llasram: Ok, cool. And once/if you already have some Clojure under your belt, IMHO /Joy of Clojure/ is the best of the lot

6:54 sandbags: yes i have that one also :)

6:54 llasram: Excellent :-)

6:54 sandbags: CiA seemed best paced for me atm

6:54 clgv: you were on a shoppin spree? ;)

6:54 sandbags: pretty much

6:54 O'Reilly and Manning had deals

6:54 llasram: Ok. I haven't seen the MEAP / new edition yet, so will withold judgement

6:55 sandbags: so i hoovered them up

6:55 the O'Reilly book went a bit too fast at a certain point for me

6:55 CiA seemed a somewhat easier pace

6:55 i also have Brian Maricks FP for the OO programmer

6:56 but it wasn't really finished last time i tried reading it

6:56 to complete the set i also have the Prag's Clojure book by Stu Holloway

6:56 but i didn't get on with it at first reading

6:57 but i may have been trying to treat it like their Programming Ruby book which was more of a tutorial/intro

6:58 i've been an OO/imperative programmer a lot of years so i felt i could use all the FP ammo I could get :)

6:59 to return to the problem i have

6:59 the cond/case solution actually isn't right then?

6:59 in the sense that it will always select the same expression at each call-site

7:00 actually i guess i should re-read what problem they thought they were solving

7:01 oh, they solve it again later as

7:01 (defmacro randomly-2 [& exprs] (nth exprs (rand-int (count exprs))))

7:01 llasram: Which is the same as (rand-nth exprs) :-)

7:02 sandbags: right, without the use of quoting

7:02 ah, because they want to evaluate that

7:02 llasram: Exactly

7:03 sandbags: except, as you say

7:03 it has the problem that it's a single expression randomly choosen at expansion time

7:04 so when used in a function it might not be what you expect

7:04 llasram: Sounds like a documentation problem to me :-)

7:04 clgv: sandbags: it does not select the same expression at every call site - in case you want to see that fast add some more different printlns and evaluate that example repeatedly

7:04 sandbags: clgv: here's my example https://gist.github.com/mmower/43a7497569f9e9129789

7:05 oh wait

7:05 no that's right

7:05 clgv: if you redefine the function again you'll end up with a different println in 2 of 3 cases

7:05 sandbags: yes

7:07 clgv: a better example for a usefull macro would be an `if-let-all` or `when-let-all` provided you now `if-let`/`when-let`

7:07 sandbags: i misunderstood the distinction when i set out to solve the problem

7:08 so i was solving a slightly different problem of creating a macro that would expand to a construct that evaluated a randomly chosen expression

7:08 rather than expanding to a randomly chosen expression

7:08 clgv: well, then you indeed need no macro ;)

7:08 sandbags: ?

7:09 without a macro how do i avoid my expression set being evaluated at call time?

7:09 clgv: humm ok, with the expressions yes but for selecting at runtime a function suffices

7:09 sandbags: then i'd have to quote all the expressions no?

7:10 clgv: I meant only selecting things randomly at runtime is clearly a function ;)

7:10 sandbags: clgv: well, yes

7:11 llasram: clgv: Unless you don't want the non-selected forms to be evaluated. Kind of like an if/case/cond, but with random selection of the evaluated branch

7:12 sandbags: yes

7:12 i think i'm going to try writing it using the "hoist to function and apply" approach just to see if i can make it work

7:12 ro_st: jonasen: woo, front page on HN!

7:12 sandbags: thanks for the help llasram, clgv

7:14 llasram: sandbags: have fun!

7:14 jonasen: ro_st: heh.. thanks again for your help

7:14 ro_st: sure thing :-)

7:14 clgv: ro_st: how does HN rank? the post only has 8 points...

7:15 ro_st: no idea, clgv

7:15 jonasen: clgv: you should vote for it if you think 8 points is not enough :)

7:16 clgv: jonasen: I was curious how it came on the first page - since ro_st comment seemed to imply that this is an accomplishement. but unluckily he doesnt know...

7:17 jonasen: clgv: I have no idea how it works either... luck I guess

7:18 clgv: points divided by uptime?

7:18 kmicu: Give me a link!

7:18 ro_st: clgv: front page of HN is high exposure. that's an accomplishment. whether that's a difficult or easy accomplishment is another thing :0)

7:18 http://www.learndatalogtoday.org/chapter/2

7:18 http://www.learndatalogtoday.org/

7:19 clgv: hmm ranking decreased with more points so maybe it's that quotient

7:20 kmicu: Datalog? Upvoted by definition.

8:01 clgv: http://amix.dk/blog/post/19574 ^^

8:02 ro_st: nice find!

8:04 clgv: calling it algorithm is overkill ;)

8:09 nifff: hello room. how can i update a vector similar to a[4]=5;

8:10 ejackson: ,(assoc [1 2 3 4 5] 4 5)

8:10 clojurebot: [1 2 3 4 5]

8:10 ejackson: ,(assoc [1 2 3 4 5] 4 15)

8:10 clojurebot: [1 2 3 4 15]

8:10 h455m0: hi

8:42 lgs32a: Does anybody know what the criteria are to gain performance through reducers? Often I find that especially for medium-sized sequences, using reduce or reduce with pmap performs better.

8:51 snake-john: Igs32a: reducers use under the hood java fork-join so for medium size sqquences the over-head of fork-join does not pay of

8:52 lgs32a: Thank you. Do you have a #1 reading resource about fork-join?

8:53 clgv: lgs32a: if pmap gets you a speedup reducers should give you even more. but be careul to nut use sequences with reducers since processing those cannot be parallelized

8:54 lgs32a: not use sequences as input or output?

8:55 clgv: lgs32a: as input

8:55 lgs32a: ok so i shoud use them with sets and hash-maps only?

8:55 clgv: lgs32: you can try sequence as input and vecotr as input and compare

8:56 vectors preferrably. I dont know if hash-maps or sets work

8:56 you might try or check the source

8:56 llasram: lgs32a: To get a speed-up from using reducers, you need to (a) use a vector as input, (b) have the vector be very large (more than thousands), and (c) use `fold`, not `reduce`

8:56 clgv: do not use pmap, except you really want this half-lazy parallelized behavior

8:57 llasram: s,a speed-up,a speed-up due to parallelism,

8:57 If you have a small number of individually computationally expensive tasks, then `pmap` is more appropriate, although not really great

8:58 Clojure's concurrency story is great, but it's parallelism story could use some love :-)

8:58 lgs32a: hehe

8:58 clgv: pmap almost always sucks because of its lazy characteristics...

8:58 lgs32a: i am using pmap almost always in special places with doall

9:00 llasram: clgv: Eh. I'd argue that `pmap`'s bigger problems are the bad interaction w/ chunked input, the inability to control level of parallelism, and the inability to relax in-order result semantics

9:00 clgv: the doall doesnt solve its core problem. imagine you have 4 parallel processing threads for pmap. then pmap processes batches of size 4 in parallel and only starts a new batch after the previous is done. so if one job of the batches last much longer than the others you have 3 idle threads and that can happend for every batch...

9:01 lgs32a: ok

9:01 llasram: That's not quite true. It doesn't do batches like that. But it does enforce in-order production of results, so in clgv's example it won't start evaluating the 5th expression until the first is done

9:02 clgv: before reducers I just used javas executors...

9:02 llasram: But if the first one finishes before the other three, it will happily pick up the 5th etc

9:02 clgv: llasram: yes and if the first is the longer lasting 3 threads are idle that long

9:02 llasram: Yep

9:03 clgv: llasram: we observed that in experiments of one of my students

9:03 lgs32a: But is that a problem? I can wait for all threads to finish before I start consuming the sequence

9:04 i mean the result

9:05 llasram: lgs32a: Basically it sacrifices some degree of potential parallelism in order to give you your results in the same order as the input (in constant space)

9:05 If you don't need the results to be in-order, then it's sub-optimal

9:05 lgs32a: yes ok now that is a good argument

9:05 thanks

9:06 i have a quite expensive parser/interpreter/analyzer running over a large bunch of files, and the result order really does not matter

9:06 so i will try that with a vector as input and r/fold

9:06 into a set

9:06 llasram: As clgv suggested, I'd actually check out using Java executors more directly

9:07 clgv: llasram: by using reducers or javas executors you can have results also in the same order as they were in the input

9:07 lgs32a: thanks guys :)

9:07 ejackson: lgs32a, also check out the Iota library

9:08 it'll let you feed a file into reducers, to great effect

9:08 lgs32a: well loading the file actually consume the very least and insiginificant amount of time

9:09 ejackson: ok, I misread 'large bunch' for 'large'

9:09 lgs32a: no its just that its insiginifact compared to the time the parser, interpreter and analyzer take

9:10 and they should run for multiple files in parallel

9:10 llasram: clgv: Sure, but with different performance characteristic. E.g., you'd need potentially unbounded memory to realize just the first `n` results

9:10 lgs32a: but i will check out iota, thanks

9:10 llasram: clgv: (if executing over an infinite seq)

9:10 clgv: llasram: yeah if you need parallelized lazy that is the only valid case for pmap...

9:11 llasram: clgv: Right. So I'm just saying that's what it is :-). It's definitely not the end-all-be-all, and I think Clojure would greatly benefit from a library which provided more fine-grained but still straightforward ways of achieving parallism

9:16 Oh, and I was spreading some minor misinformation -- you can set the group-size run in parallel via reducers `fold`, so don't *require* a very large vector to see benefits

9:16 (default group-size is 512, which is what I was remembering)

9:33 gdev: last night our Java Users Group was all about edn datalog and simulant, good times had by all

9:33 hiredman, I even gave the presentation "edn Inaction"

9:41 dotemacs: Any issues if non ASCII names are used for function names ?

9:41 clgv: dotemacs: no, except that it might be difficult to write them depending on the characters ;)

9:42 Ember-: utf-8 is fine

9:42 dotemacs: clgv: thats great :) I mean, I tried it already it worked as expected, but I figured I'd ask about it here

9:42 Ember-: thanks

9:43 Ember-: in my honest opinion, any programming designed after year 2k which doesn't support utf-8 as basic encoding for it's source code files is braindead

9:43 clgv: dotemacs: I used alpha and beta for parameters in configuration ^^

9:43 Ember-: programming -> language <- designed

9:44 forgot a very important word from my sentence :)

9:48 gdev: (defn ¼ [n] (* n (/ 1 4)))

9:49 TheBusby: via proxy/reify, can you add a method to an existing map? Ex (.foo {:a 1})

9:50 tim__: TheBusby: no, but you can do that with protocols

9:51 gdev: (defn ¥->$ [n] (* n 0.01))

9:51 TheBusby: tbaldridge: you wouldn't have an example of the syntax for that would you?

9:52 tbaldridge: TheBusby: in the example here: http://clojuredocs.org/clojure_core/1.2.0/clojure.core/extend-type you can use any Java type as the first argument to "extend-type"

9:52 llasram: gdev: Not `¥→$` :-)

9:53 gdev: llasram, good catch thanks

9:54 llasram: Clojure: the new APL!

9:55 tbaldridge: APL is the one language that I can tell non-programmers: "It looks just as alien to me as it does to you". That stuff is scary.

9:56 llasram: It looks kind of like it might be straightforward once you get used to it. Just very, very dense, so you need to go token-by-token to unpack it

9:59 tbaldridge: BTW, if anyone wants a awesome example of APL, check this out: http://www.youtube.com/watch?v=a9xAKttWgP4

9:59 and yeah, it looks super dense

10:00 clj_newb_2345: is there a simple regex that describes nested /* */ comments ?

10:01 ordnungswidrig: tbaldridge: http://www.youtube.com/watch?v=xP5-iIeKXE8 (life in life)

10:03 tomjack: ordnungswidrig: :D

10:03 TheBusby: tbaldridge: much thanks!

10:04 ordnungswidrig: tomjack: and we all still wait for cinc :)

10:05 tomjack: cinc?

10:06 tbaldridge: tomjack: clojure-in-clojure

10:06 ciphergoth: There must be a better way than (map (partial + 5) (range))

10:07 to generate (5 6 7 ...)

10:07 tomjack: ah of course

10:07 tbaldridge: , (take 6 (range 5 Integer/MAX_VALUE))

10:07 clojurebot: (5 6 7 8 9 ...)

10:07 clgv: ,(range 5 Long/MAX_VALUE)

10:07 clojurebot: (5 6 7 8 9 ...)

10:07 clgv: print-limit ^^

10:07 tomjack: is the "inc" in there a coincidence? I don't think I had noticed it before

10:08 ciphergoth: heh :)

10:08 seems like something of a hack, but OK!

10:08 tbaldridge: ciphergoth: look at the source of range, the default max value is implemented almost the same way

10:11 clgv: ,(range 5 -1)

10:11 clojurebot: ()

10:11 clgv: oh damn ^^

10:11 tbaldridge: clgv: range has some odd edge-cases

10:12 ordnungswidrig: ciphergoth: (drop 5 (range))

10:12 ciphergoth: ordnungswidrig: (drop n (range)) gets slower as n grows

10:14 tomjack: (def ∞ Double/POSITIVE_INFINITY)

10:15 gdev: to implement infinity from scratch, you must first create the universe

10:19 clgv: ,(let [∞ Double/POSITIVE_INFINITY] (+ ∞ ∞))

10:19 clojurebot: Infinity

10:19 clgv: unluckily it does not convert to the symbol^^

10:20 gdev: if you want that, use APLbot

10:22 tomjack: (defmethod print-method Double ...)

10:22 :(

10:23 clgv: yeah I know..

10:23 what is APLbot?

10:25 gdev: clgv, an irc bot i just made up so that i could reference a previous joke about using utf-8 characters

10:25 * clgv hands gdev a cookie

10:30 gdev: *gdev doesn't have cookies enabled

10:46 Fer`: Hi all. Is there a release date for clojure 1.6?

10:47 tbaldridge: Fer`: no. Why do you ask?

10:47 Fer`: Also, is there a tutorial around for core.async? Do I have to know golang or read CSP?

10:47 nDuff: Fer`: many, of varying levels of quality. If you run across one that uses Thread/sleep, run away. :)

10:47 Fer`: tbaldridge: Just wondering when core.async will have an stable version

10:48 tbaldridge: Fer`: https://github.com/clojure/core.async/blob/master/examples/walkthrough.clj

10:48 nDuff: Fer`: that's not really tied to 1.6.

10:48 tbaldridge: Fer`: the two are unrelated, core.async runs on 1.5

10:48 Fer`: I see

10:48 silasdavis: I'm using liberator and trying to get redirected after a post request

10:49 I'm using the example of that library's site but using curl I don't get any text response

10:49 Fer`: But there's no date for an stable core.async release either then?

10:49 tbaldridge: Fer`: core.async is stable-ish. We haven't changed the public APIs in months, and I'm not aware of any breaking changes in the works

10:49 Fer`: ok

10:50 clgv: tbaldridge: maybe you should cut a stable release then ;)

10:51 tbaldridge: clgv: yeah, yeah, I know. :-P

10:52 clgv: tbaldridge: is it a considerable effort or can you just shout at stuart halloyway like david nolen does? ;)

10:56 * nDuff is reminded -- one of his friends used to have a significant other who sat a few desks down from Linus at Transmeta

10:59 clgv: nDuff: so that's how you hacked into the linux kernel? ;)

11:00 nDuff: clgv: Heh. Only kernel work I was doing back then was on the input core, and didn't end up escalating things in that direction, no. :)

11:02 ToBeReplaced: does anyone have an example of linking a seq of monotony periods to execution?

11:03 alandipert: ToBeReplaced: are you talking about discrete event simulation a la cron? maybe something like https://github.com/aredington/monotony interests you

11:03 snake-john: hi this is the first time that I am looking at pedestal. There is the "data model" and the "application model" Am I right the data model exists behind the seems as a tree in a atom. But the application model is just a queue where certain delta structures are added to and taken from?

11:03 alandipert: ToBeReplaced: also the newly released https://github.com/candera/causatum for something way fantastical

11:04 ToBeReplaced: alandipert: i'm referring to monotony, yes -- eventually though you need to go from the periods it returns to a thread processing current time against them; i'm looking for a gist of that

11:04 rkneufeld: snake-john: Close. The application model is still "kept" as a tree, but you're seeing deltas of what changes in that tree.

11:06 alandipert: ToBeReplaced: ah. i don't know of any examples of that but a queue or a core.async channel may be The Way

11:07 Fer`: Is the usual way to read/parse edn str/read-string?

11:07 alandipert: ToBeReplaced: e.g. you enqueue periods and they're processed every tick by some consumer based on wall time

11:07 Fer`: see the clojure.edn ns for various flavors of 'safe' read

11:07 ToBeReplaced: Fer`: clojure.edn/read

11:07 Fer`: Oh i see

11:08 apropos didnt return anything for "edn" :P

11:08 snake-john: Gee my feeling says to me that pedestel it is well thought and as I contain

11:08 sorry just hit the return button to early.. pedestal is well thought out but there are so many new terms

11:09 ToBeReplaced: alandipert: it wouldn't quite work that way; i think you are underselling the technical problem

11:09 alandipert: ToBeReplaced: i'm a programmer, it's in my nature :-)

11:09 rkneufeld: snake-john: definitely

11:10 ToBeReplaced: alandipert: i like that monotony separates creating sequences of periods from execution b/c that's a different problem; every scheduling system you ever find puts everything under one big enterprise product

11:12 snake-john: It is still difficult to see what transform-enable in the application model buys me. (since its not data)

11:17 alandipert: ToBeReplaced: by 'processing current time against them' do you mean 'periodically compare current time to the next period and determine if it should be processed' and then manage the processing such that there are timeouts/overrun protections?

11:20 ToBeReplaced: alandipert: possibly; haven't thought about the problem in detail -- i meant it broadly

11:20 alandipert: ToBeReplaced: if so i can't really imagine a better way to do it than by putting periods on a queue or channel and having a worker pool that consumes/processes

11:21 ToBeReplaced: i am underselling but i can't think of any other general advice that wouldn't be affected by specifics of your problem, things like resource contention and worker distribution

11:24 snake-john: from reading the docs transform-enable reminds me of REST and the link tag. So transform-enable states the possible changes that can be applied to a value. Am I right?

11:57 lgs32a: What are your suggestions on dynamically loadable (pre-compiled, without source-code) plugins for .jar standalone apps written in Clojure

11:57 i mean suggestions how to implement such thing

12:00 clgv: lgs32a: leiningen uses naming conventions. but you can also provide API functions to register the extensions of the plugin

12:01 lgs32a: so i could deploy a compiled jar, have a plugin loader in it, later deploy a plugin-jar, and have it possible for the compiled jar to load the plugin jar?

12:02 how would i write the api and expose it to the plugin-jar

12:02 and especially how would i access it from the main program

12:16 mheld: hey y'all

12:17 are there any books out there that specialize in using clojure in AI -- kinda like PAIP w/ clojure?

12:30 technomancy: library idea: a namespace full of right-variants of built-in functions (rpartial, rreduce) named dexter

12:41 justin_smith: I always thought clojure was sinister, now I realize why

12:41 technomancy: dun dun dun

12:42 * nDuff doesn't get it; does the joke require being familiar with more of Dexter than the first few episodes?

12:43 technomancy: https://en.wikipedia.org/wiki/Dexter_and_sinister

12:43 justin_smith: nDuff: nope, but some Latin would help

12:43 nDuff: Ahh.

12:44 babilen: *ba dum tsh*

12:44 rasmusto: I like it

12:47 diphtherial: for those of you who use lighttable, do you find its continuous evaluation feature to be a benefit or a hindrance?

12:47 i'm not sure if i'm doing something wrong, but it seems to significantly slow down my machine whenever i attempt to use it

12:48 i can also imagine it being disastrous if it tried to materialize an infinite sequence or something... (still a clojure newbie, not sure if that makes sense)

12:49 seancorfield: LT only materializes part of each sequence when displaying it - typing (range) is safe.

12:50 nDuff: diphtherial: when I use Light Table, I'm trying to quickly come to understand someone else's code. It's pretty handy for that.

12:50 seancorfield: I'm finding I like having my active file editor as a live eval REPL... I can try things out inline in amongst the code without having to switch windows etc

12:50 lgs32a: i prefer evaluation from the repl. if i want to inspect values inside of a function i can println them.

12:51 i recommend to learn emacs with nrepl, you can switch buffers then instead of windows

12:51 i find lighttable an interesting project but consider it far from being usable at the time.

12:52 seancorfield: I use Emacs with nrepl primarily. But I am also using LT one day a week to help Chris with testing etc.

12:52 diphtherial: interesting, thanks for the opinions, and good that it doesn't materialize the whole thing...

12:52 seancorfield: LT is a much more approachable experience for folks new to Clojure who are not already Emacs users

12:52 diphtherial: i went down the vim path, but i'm not any more productive with it than with using a graphical editor

12:53 this is likely some mental insufficiency on my part, so i don't blame the editor

12:53 lgs32a: @seancorfield i noticed that lighttable always complains about my ns declarations. i use vectors instead of lists like (:require [clojure [set :as set]])

12:55 @diphterial: if you can take a few days off to learn emacs you will find it very rewarding!

12:55 hiredman: a. you should use vectors b. you shouldn't do sub things like that

12:55 [clojure.set :as set]

12:55 c. this is irc not twitter you leave out the @

12:56 diphtherial: lgs32a: i'll try it :) i have nothing but time anyway

12:56 lgs32a: hiredman why b? when correctly indented, the namespace declaration is why more readable and it compiles.

12:57 hiredman: lgs32a: incorrect

12:57 diphtherial: i know editor opinions run deep; i apologize for asking about them again and risking conflict

12:57 lgs32a: ^^

12:57 hiredman: what do you mean?

12:58 ToxicFrog: I took four months off to learn emacs once and it didn't go well, although possibly it's just not well suited to C++ and Lua work?

12:58 hiredman: you are adding levels of nesting, and implying a grouping where none exists

12:59 technomancy: lgs32a: also it makes grepping hard if you want to rename a namespace or move a defn

12:59 (wouldn't be a problem except we don't have proper find-usages tools yet)

12:59 rasmusto: diphtherial: I haven't been able to make the emacs switch, and vim has suited my clojure work so far (fireplace + paredit.vim)

13:01 lgs32a: ToxicFrog: Doing C++ in emacs is not easy but certainly possible.

13:01 technomancy: C++ is never easy

13:01 justin_smith: diphtherial: nah, I have known some right idiots who are very productive in vim. Like any tool it needs usage before competancy gains. vim and emacs are the kind of tools where those gains can keep happening for a long time, that is the tradeoff for the sharp beginning curve

13:01 lgs32a: check out clang-complete

13:02 ToxicFrog: lgs32a: this was a few years ago, I don't do much C++ work these days.

13:02 diphtherial: justin_smith: fair enough, perhaps i just didn't stick with it for long enough

13:02 ToxicFrog: But my main objection was that most of the features I wanted were contained in huge, poorly documented elisp scripts that often needed manual updating/bugfixing.

13:03 lgs32a: well there are some ide environment like things

13:04 but again, what you say is right. however for a functional language it is a great environment. needless to say that I do 90% of all my computer work in emacs

13:04 even webbrowsing or chatting here

13:04 ToxicFrog: The impression I came away with is that emacs would be a great editor if I had started using it fifteen years ago when I had more patience and spent the intervening time gradually customizing it.

13:04 lgs32a: one great thing is that emacs extension language is elisp which will seem immediately familiar to clojure programmers

13:05 ToxicFrog: elisp reminds me a lot more of common lisp than it does of clojure. I'm not a fan.

13:05 justin_smith: yeah, calling elisp "scripts" is a bit funny, 95% of emacs functionality is implemented in elisp files - it basically would not be a usable editor without the elisp code

13:06 lgs32a: yes. somebody is already implementing emacs in clojure (deuce). certainly it would be nicer to have clojure instead of elisp as an extension language

13:06 but do you prefer vim-script over a lisp?

13:07 justin_smith: languages emacs is in the process of being implemented in (off the top of my head): haskell, guile scheme, ocaml, clojure, common lisp

13:07 technomancy: elisp and CL are very similar. it's pretty awkward but better than any other embedded language I've ever seen.

13:07 justin_smith: languages implementing a usable emacs: c+elisp

13:07 technomancy: heh; so true

13:08 ToxicFrog: lgs32a: no, I dislike vimscript slightly more. My solution thus far has been to use ST2 and customize in Python.

13:08 Although I did use JEdit with Scala extensions for a while.

13:09 (and yeah, I don't like CL either)

13:10 justin_smith: there are implementation reasons - dynamic vars really make sense in an editor ui, they map nicely to ui contexts / file modes

13:10 supersym: I found I need very little besides what LightTable atm gives me

13:11 regex search/replace, multiline editing.. for that I take subl2 though :P

13:11 technomancy: justin_smith: yeah, but lisp-2 is only justifiable in that "we didn't know better at the time; sorry"

13:11 supersym: figured not to want the pain of learning emacs atm

13:11 justin_smith: technomancy: true enough

13:12 technomancy: also equality is just such a mess

13:13 though not significantly worse than any other language that doesn't default to immutability

13:13 lgs32a: true true

13:14 mishok13: if I have a function and it's memoized version and I want to have both function available -- what would be the preferred naming convention?

13:14 *it's -> its

13:14 bbloom: equality is always a mess

13:14 clgv: mishok13: I did not hear of one so far

13:14 ToxicFrog: justin_smith: IMO, dynamic vars are great to have as an option, and I love clojure's support for them. Having them as default is questionable. Having them exclusively is mental, although I understand that elisp supports lexical scoping as of some recent version.

13:15 technomancy: bbloom: my favourite is not being able to use case on strings because they're not eq. uuuugh.

13:15 mishok13: clgv, that sucks

13:15 technomancy: bbloom: but "equality is always a mess" strikes me as something you're more likely to say if you spend too much time in JS land

13:15 clgv: mishok13: why? just establish a personal one

13:16 technomancy: mishok13: depends on why you're exposing the un-memoized variant

13:16 bbloom: technomancy: i don't use emacs or know elisp, but i say "equality is always a mess" b/c of all the stuff discussed in that EGAL article

13:17 technomancy: in JS (and php, etc) equality isn't just a mess. it's FUCKING BROKEN

13:17 mishok13: technomancy, that actually got me thinking if I should exposes non-memoized version

13:17 bbloom: clojure's equality is at least somewhat sensible

13:17 mishok13: but even than, how would you call the non-memoized version?

13:18 technomancy: mishok13: I submitted a patch to make c.c/memoize leave the non-memoized fn as metadata on the memoized one.

13:18 didn't get accepted, but I still think it's a great idea if you only need it for weird edge cases

13:19 mishok13: that's a nice idea

13:19 justin_smith: mishok13: (def +-5* (partial + 5)) (def +-5 (memoize +-5*))

13:19 mishok13: care to share the code?

13:19 clgv: technomancy: are there use cases where a lib really defines a memoized function in a variable? usually the user needs to be able to set the scope of memoization

13:20 justin_smith: mishok13: done that way, both are available, a * on the end usually indicates "for internal usage mostly but accessible"

13:20 mishok13: justin_smith, yeah, that's what I'm doing right now

13:20 but it just doesn't feel right

13:20 dunno why

13:20 technomancy: clgv: not necessarily in a lib, but in an application, sure.

13:21 fogus|away: technomancy: core.memoize does that. It's at the :clojure.core.memoize/original key

13:21 technomancy: clgv: "this should be memoized, but I need to blow away the cache or I can't test it properly"

13:21 clgv: technomancy: erm what?

13:22 technomancy: clgv: when using memoize to speed up idempotent fns that write to disk

13:26 callen: llasram: the Clojure formula is problematic too. I *do* use OS X and it's no excuse.

13:27 llasram: callen: I agree you should totally PR a removal then

13:34 tbaldridge: dnolen: can you get me a minimal use case for that set! core.async bug?

13:35 dnolen: tbaldridge: (let [x (js-obj)] (go (set! (.-foo x) "bar")))

13:35 tbaldridge: dnolen: thanks, I'll make that into a test

13:36 callen: Raynes: the atoms probably aren't going anywhere.

13:38 I might consider a multi-arity underlying function, but the top-level API would be the same.

13:38 at minimum, it would only be a case of removing the pathing thingy, the caching stuff would stay.

14:15 Raynes: callen: ...okay?

14:15 callen: We're talking about selmer?

14:15 Anyways, I'm indifferent. I won't likely be using it anyways. :3

14:17 callen: Raynes: I explicitly told yogthos that you, "weren't a customer"

14:17 Raynes: and yes, Selmer.

14:17 Raynes: that doesn't mean I don't like feedback and food for thought. There's one atom in particular I'm considering killing off.

14:17 Raynes: callen: I would hope that yogthos considers my advice regardless of whether or not I'm a customer.

14:18 yogthos: Raynes: under advicement :)

14:18 * Raynes fist bumps yogthos.

14:18 callen: Raynes: I'm sure we both do, but users get priority.

14:18 and solving their problems > code niceness

14:19 or at least, those are my priorities.

14:19 Raynes: I don't think it has anything to do with code niceness, but *shrug*.

14:19 yogthos: for now it's likely to stay as is though, until I get time to think of doing it with no impact ;)

14:19 callen: Raynes: I think having less stateful code is about code nicenss.

14:19 niceness*

14:19 Raynes: You're obviously set in these ways, and arguing about it doesn't help me get anything done.

14:19 So enjoy your global mutable state! :)

14:19 callen: Raynes: well, not so obviously, since because of your feedback there's an atom I'm considering killing off

14:19 and replacing with a config map.

14:19 * technomancy suspects listening to the guy who deprecated noir would be a good idea

14:19 callen: technomancy: you haven't even looked at the library in question.

14:20 technomancy: also I have a vested interest in avoiding global mutable state since I'm an http-kit user.

14:20 worse would be thread locals, but that's another horse.

14:20 technomancy: just sounds like awfully familiar discussion, that's all

14:20 callen: and I am considering improvements based on the feedback.

14:20 yogthos: so far the only solution I see is using a closure to initialize the parser

14:20 callen: I'm not about to turn the memoization atom into a series of self-returning closures though.

14:21 yogthos: but then the user has to manage it

14:21 I'm not sure there's a win from user perspective in that case

14:21 callen: yogthos: so the idea I had for the config/path atom stuff was to actually put an intermediate fn between the outer fn the user calls, and an inner one it wraps

14:21 yogthos: and the wrapped inner fn is multi-arity and optionally accepts a config map of sorts for what used to be the atom.

14:22 yogthos: yeah that would be fine

14:22 callen: yogthos: I'll cogitate on it more, but that's roughly what I was thinking of in the interest of maintaining API compat.

14:22 yogthos: we also want to stay compatible with clabango ideally

14:22 and I've got a meeting here :)

14:22 callen: there's nothing wrong with global state when it's necessary and makes sense. It's undue use thereof that is problematic.

14:22 yogthos: afk

14:23 callen: you're all using services and computers that make prolific use of mutable state, global and otherwise. It's a practical decision not a philosophical one.

14:23 tbaldridge: callen: famous last words...

14:23 callen: by complaining about code you haven't even looked at, on the basis of the mere mention of 'state', you discredit yourselves and make the community seem more dogmatic than it merits.

14:23 tbaldridge: don't shame yourself.

14:23 tbaldridge: http://xkcd.com/292/

14:23 Raynes: lol

14:24 callen: tbaldridge: have you seen the code in question?

14:24 tbaldridge: do you have a patch?

14:24 Raynes: One moment please.

14:24 tbaldridge: callen: of course not, I just randomly spew memes to mess with people

14:24 Raynes: https://github.com/yogthos/Selmer/blob/master/src/selmer/parser.clj Will everyone please look at this code so that callen will shut up about who has seen the code or not? :p

14:24 supersym: callen: agrees

14:25 tbaldridge: This is the internet, you can't censor me simply because I don't know what I'm talking about.

14:25 technomancy: I'm not talking about the code at all; I'm questioning the logic of listening to other users over the guy who's been through all this before.

14:25 callen: technomancy: what we're doing isn't comparable with the problems with Noir at all.

14:26 technomancy: and in fact, I'm planning improvements to lib-noir to *fix* problematic uses of state that break when used in non-affine async thread pools such as I use in my work

14:26 technomancy: so I am deeply and intimately familiar with the possible problems thereof, planning concrete fixes to address them, and know exactly where the code in question stands on that front.

14:27 technomancy: k, sounds good

14:27 callen: technomancy: it is also worth reminding that the primary author of Selmer is a major contributor/co-author to lib-noir as well.

14:27 technomancy: save the witch hunt for dumbfuck noobies, I'm not in the goddamn mood for critique from people who have no code to offer.

14:28 technomancy: I trust and respect Raynes as much as you do.

14:28 supersym: for my learning/amusement, whats the problem exactly? all the atoms scattered around or?

14:28 callen: supersym: not here, I'll answer questions in privchat.

14:28 I'm not in the mood for LEL MEMES right now.

14:28 supersym: sure

14:29 Raynes: supersym: FWIW, you're going to get exactly callen's side of this story in PM which is that we're all dumb fp programmers with superiority complexes who don't understand the problem scope.

14:29 Which isn't quite what I was going for with my concerns.

14:30 http://www.youtube.com/watch?v=YOXpKUu6pUg

14:31 callen: supersym: we use a few atoms. Some are necessary and not going anywhere, one or two are potentially unnecessary and could be replaced with something cleaner.

14:31 supersym: the first priority was maintaining API compatibility with a previous library, this means args/arity couldn't change

14:31 supersym: yeah

14:31 callen: atom not going anywhere: memoization atom.

14:31 supersym: gotcha

14:31 callen: it's legitimately global state, meaning, there's no coordination, all threads should actually be sharing the memo atom.

14:32 atom potentially going bye-bye: config path thingy.

14:32 supersym: well I just thought your arguments about not being a religion are actually pretty sane... as long as you/we are aware of side-effects/concurrency limitations

14:33 Raynes: So, how about that John Carmack?

14:33 supersym: Raynes: should I know him? :P

14:33 Raynes: Not if you never cared about video games at all.

14:33 callen: supersym: and we are. When global state is semantically intended to be global, it's thread-safe, and returning closures would actually involve coordinating and surfacing that state as a global anyway, a global atom makes perfect sense.

14:33 supersym: aha... yeah I see :P

14:33 I like wolf3d

14:33 cool titles on his name

14:33 ToBeReplaced: callen: from afar, looking at parser.clj, it seems like the cache / last-modified check belongs as a separate concern -- it seems like a bunch of different webdev type projects all implement their own methods of checking for changed files

14:33 Raynes: I <3 Doom.

14:34 ToBeReplaced: callen: have you seen that abstracted out anywhere?

14:34 Raynes: supersym: He joined the Oculus Rift team as CTO is why I mentioned him.

14:34 supersym: yeah doom was pretty damn sweet...

14:34 Raynes: :p

14:34 rasmusto: Raynes: I'm feeling good about jumping on the kickstarter bandwagon early

14:34 callen: ToBeReplaced: the last modified thing is a little questionable, it was a clever local dev thing yogthos chucked in.

14:34 ToBeReplaced: s/abstracted/separated

14:34 gtrak: Raynes: looks like good news

14:34 callen: ToBeReplaced: the memo atom for the memoization/caching isn't going anywhere. That's not even up for debate unless somebody has a specific implementation to discuss.

14:34 supersym: aha... those VR goggles,... nice :)

14:34 callen: the other atoms I'm more open to alternatives for.

14:35 ToBeReplaced: callen: i'm not questioning design here -- i'd need a lot more time with the code to say anything meaningful

14:35 callen: ToBeReplaced: Selmer is one in a long series of libraries modeled after a codebase I've spent the last 6 years with.

14:36 ToBeReplaced: this is partly why I'm not super interested in off the cuff remarks from people that see the word, "state" and reflexively whine.

14:36 tbaldridge: we need a clojurebot macro for that

14:37 ToBeReplaced: callen: the last-modified bit is interesting though; i'm wondering if there's room for a dev plugin that accomplishes tasks like that one that library creators could code against

14:37 ex. (watch-resources change-hook re)

14:37 callen: ToBeReplaced: there's a template lib utilities library floating around. I could add to that but there isn't a ton that's worth extracting.

14:37 ToBeReplaced: we explicitly avoided watch-resources/change-hook type behavior.

14:37 ToBeReplaced: that's shit is a fucking rathole and will eat you alive.

14:37 muhoo: my god, the template flamewards are still ongoing?

14:38 callen: muhoo: no, the war is won. Selmer is a thing.

14:38 muhoo: github.com/yogthos/Selmer

14:38 Raynes: Hah!

14:38 Classic.

14:38 ToBeReplaced: callen: isn't that what you do in that parser though?

14:38 callen: muhoo: the library the community needs, but not the one it wants.

14:38 Raynes: The king of the north announcing his victory before the fight as even begun.

14:38 callen: ToBeReplaced: not at all. We're checking last-modified on each render synchronously.

14:39 hyPiRion: oh what

14:39 ToBeReplaced: callen: oh oh oh, you meant like, background-job-with-hook vs. explicit-check-on-action

14:39 Raynes: muhoo: Anyways, this wasn't a flamewar about templating libraries but about the design of this particular templating library involving global mutable state as a library.

14:39 callen: ToBeReplaced: asynchronous filesystem event callbacks are horrendously unreliable and not a good idea for anything that needs to work reliably. That goes double for JVM services.

14:39 hyPiRion: emplate wars back from its 2 month hibernation?

14:39 muhoo: o_0

14:39 callen: hyPiRion: war is won son.

14:39 hyPiRion: battles are fought.

14:39 llasram: TemplateWars sounds like it could be a pretty fun video game

14:39 Raynes: After war, nobody wins.

14:39 technomancy: "crusade" might be a better term at this point.

14:40 callen: muhoo: they don't like pragmatic decision making where a solution fits the problem and semantics just because it has the word 'state' attached to it.

14:40 Raynes: I wish you'd stop dismissing everyone's opinions like that.

14:40 callen: muhoo: I'd already stated an openness to a particular change/improvement as a result of feedback about state, but the rest of them smelled blood and here we are.

14:40 Raynes: I mean, it's fine for you to be fine with this particular design and these decisions, but don't do that shit.

14:40 callen: Raynes: I wish people would stop pretending I haven't been humping problems like this for years.

14:40 Raynes: That's all I ask.

14:41 I wish you'd stop pretending that they haven't. :\

14:41 ToBeReplaced: callen: not going to disagree there; it just felt like the last-modified check was out of place... seems like a dev-time tool, where dirty hacks seem appropriate

14:41 callen: I've got the benefit of having already taken in feedback and plan to respond to it.

14:41 Nobody has budged an inch in response to anything I've said.

14:41 muhoo: ,gentlemen

14:41 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: gentlemen in this context, compiling:(NO_SOURCE_PATH:0:0)>

14:41 callen: muhoo: ouch.

14:41 muhoo: &gentlemen

14:41 lazybot: java.lang.RuntimeException: Unable to resolve symbol: gentlemen in this context

14:41 tbaldridge: ~gentlemen

14:41 clojurebot: You can't fight in here. This is the war room.

14:41 muhoo: tbaldridge: thank you

14:41 callen: ToBeReplaced: it is, there's a dev flag in the config for that.

14:41 dnolen: fn->ilookup idea from yesterday + hashmap destructuring is interesting - http://gist.github.com/swannodette/6176916

14:43 TimMc: callen: Having beat your head against a problem a lot does not mean you are Always Right.

14:43 Raynes: Le sigh.

14:43 What have we become

14:43 callen: given that we aren't discussing or analyzing any actual code

14:43 tbaldridge: dnolen: rofl...that last example.

14:43 callen: except for ToBeReplaced, god bless him.

14:43 ToBeReplaced: dnolen: cool -- every time i think about doing this i decide the reduce-kv version is more readable for the people aroud me

14:43 callen: this is essentially a waste of time.

14:43 Raynes: s/.*/dismissed/

14:44 dnolen: tbaldridge: :)

14:44 callen: dnolen: https://github.com/uncomplicate/fluokitten

14:44 dnolen: ToBeReplaced: definitely not something I recommend, but maybe there's something useful here in some cases

14:44 Raynes: "Fit well into idiomatic Clojure - Clojure programmers should be able to use and understand Fluokitten like any regular Clojure library."

14:44 hhheheheheh

14:45 ToBeReplaced: dnolen: can you think of an example? i'm assuming speed for when you don't actually need a map?

14:46 lgs32a: what is the war about?

14:46 callen: Raynes: that laughter made me choke, bravo.

14:46 hiredman: dnolen: shouldn't you pass the not found value in to the fn?

14:46 Raynes: callen: :p

14:47 gtrak: Raynes: is that sort of an admission that it's anything but idiomatic?

14:47 TimMc: Oh, speaking of templating libs -- I saw a really freaking cool idea on reddit the other day. Someone was talking about a templating engine that put parts of the template into the DEFLATE literal tables.

14:47 hiredman: ilookup is a great interface to implement because it is small, and once you do you get map destructuring

14:47 dnolen: hiredman: not-found seems weird since how can you know you're outside the domain of the function? (exceptions?)

14:47 TimMc: The idea is to make the browser's gzip expander do template expansion for you.

14:47 hiredman: dnolen: if you pass it in to the function the function can decide

14:47 dnolen: ToBeReplaced: hash-maps too large to express as a real map?

14:47 hiredman: ah good point

14:47 hyPiRion: ToBeReplaced: whenever you want to pass a function, but the API needs a map

14:48 technomancy: TimMc: whoa that's nuts.

14:48 TimMc: I think it's just vaporware, and might be fragile, but... *drool*.

14:50 arcatan: TimMc: that's really cool and really horrible at the same time. is there an implementation?

14:53 callen: https://github.com/mxcl/homebrew/pull/21733

14:53 ToxicFrog: TimMc: that's sick

14:54 dnolen: tbaldridge: have you watched the Advanced Go Concurrency Patterns video? What do you think of the nil channel pattern? cc bbloom

14:55 bbloom: dnolen: i watched it a while ago, but forget what that one is. link to slides to refresh my memory?

14:55 tbaldridge: dnolen: ditto

14:55 dnolen: bbloom: if you set a channel to nil it always blocks

14:56 tbaldridge: err, I haven't seen it, but I'd like slides

14:56 what use is that?

14:56 dnolen: http://www.youtube.com/watch?v=QDDwwePbDtw

14:56 http://talks.golang.org/2013/advconc.slide#1

14:57 bbloom: is that a memory management "feature"? ie if you try to write to a nil channel, you'll block & then your goroutine will be GCed?

14:58 tbaldridge: wouldn't a nil channel be the same as (chan) that no one ever writes to?

15:00 dnolen: tbaldridge: bbloom: actually I think this is a workaround for the fact that they don't have dynamic selecto?

15:00 dynamic select

15:00 bbloom: they have dynamic select, it's in the reflection package

15:01 hiredman: it is new

15:01 bbloom: http://golang.org/pkg/reflect/#Select

15:01 hiredman: prior to 1.1 they didn't

15:01 bbloom: ah ok

15:01 so you'd start w/ a maximal set and then force them to nil & select would basically block/ignore the nil channels?

15:01 yeah, sounds like a hack and a half to me

15:02 TimMc: arcatan: No implementation that I know of. This was in the context of a reddit.com/r/crypto discussion of compression attacks against HTTPS.

15:02 ToxicFrog: What's dynamic select?

15:02 tbaldridge: dnolen: to answer the question, I know Ghadi had an implementation at one point, and Rich vetoed it, I don't remember why, but this is probably it.

15:03 dnolen: bbloom: yeah, based on those slides it definitely what it's for, to take channels in/out select

15:03 bbloom: ToxicFrog: "dynamic" meaning the set of channels to multiplex on is known only at runtime

15:03 ToxicFrog: like a map lookup instead of a switch statement

15:04 ToxicFrog: Aah.

15:04 ...Go doesn't/didn

15:04 t have that?

15:05 bbloom: it has it now here: http://golang.org/pkg/reflect/#Select

15:05 hiredman says it was added post 1.0

15:05 tbaldridge: nope, and the original version of core.async didn't either. But that was back before it was announced.

15:06 hiredman: I remember it wasn't there when I original started playing with go, and as added around the time I stopped

15:07 bbloom: tbaldridge: it's super useful to have :-) glad it's in there. in general, i like having both dynamic and static versions of operators for explicit staging

15:09 dnolen: bbloom: tbaldridge: lovely you can alts! over a set :) gotta love Clojure

15:10 tbaldridge: dnolen: I think that's a docstring bug

15:10 bbloom: can you alts! over a set? there was a bug before where nth was a required operation :-)

15:10 tbaldridge: the random select requires nth

15:10 bbloom: ah.

15:10 tbaldridge: yeah, it's a bug. But (vec my-set) should work :-P

15:11 dnolen: tbaldridge: yes but nth works on seqables

15:11 tbaldridge: , (nth #{1 2 3})

15:11 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$nth>

15:11 bbloom: no, it works on seqs, not seqables

15:11 tbaldridge: , (nth #{1 2 3} 3)

15:11 clojurebot: #<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: PersistentHashSet>

15:11 dnolen: tbaldridge: bbloom: oh it works in ClojureScript :)

15:11 bbloom: heh, is that a clojure or a clojurescript bug? :-)

15:11 tbaldridge: yeah, well, real programmers use the JVM

15:12 bbloom: brb in a bit

15:12 dnolen: it probably should just work on seqables IMO

15:13 horofox: what web framework do u guys recommend me?

15:13 tbaldridge: although having nth work on a unsorted set is a bit odd. It's unsorted, so how would know what nth would be?

15:14 It makes sense in this use case, but doesn't really in the more general use.

15:15 hiredman: that nth works on seqs is odd

15:15 tbaldridge: (inc hiredman)

15:15 lazybot: ⇒ 24

15:15 dnolen: tbaldridge: there are two cases in ClojureScript where we basically make nearly an type work, IReduce and ICounted

15:15 hiredman: seqs are not good for random access

15:16 dnolen: we actually preserved this behavior from the original CLJS implementation

15:16 hiredman: but water under the bridge given destruction support for seqs I'd say

15:16 destructuring

15:16 technomancy: hiredman: I think the "n" in the name kinda implies O(n)?

15:17 tbaldridge: lol

15:17 hiredman: ,(doc nth)

15:17 clojurebot: "([coll index] [coll index not-found]); Returns the value at the index. get returns nil if index out of bounds, nth throws an exception unless not-found is supplied. nth also works for strings, Java arrays, regex Matchers and Lists, and, in O(n) time, for sequences."

15:17 hiredman: seqs with O(n) are called out as an exception there

15:17 dnolen: so for ClojureScript "for sequences" -> "for seqables"

15:18 Raynes: tpope: You need to get into Elixir, man. It's in dire need of someone to write a better vim indent script. :p

15:19 hiredman: dnolen: my point is just that the waters are a little murkier than "it probably should just work on seqables IMO" might lead someone to believe

15:22 dnolen: http://github.com/clojure/clojurescript/blob/791834558b61459ece6c124af6186580a65128a1/src/cljs/cljs/core.cljs#L928

15:22 that was almost 2 years ago

15:23 callen: Raynes: I need somebody to make my programming language papyrus compatible.

15:23 hiredman: so?

15:24 (it also shows nth taking linear time for everything, not just seqs)

15:25 oh, default impl

15:25 dnolen: hiredman: might be a bug might not be is all, anyways a minor thing - perhaps seqs is as far down the slippery slope as Rich intended it to go and this is an oversight in CLJS.

15:27 bbloom: fwiw, i agree that nth shouldn't work on sets

15:27 hiredman: anyway, I don't accept the clojurescript code base as an authority to be bowed to, it has flaws here and there and a scope

15:28 dnolen: bbloom: now it's question how many CLJS depend on this behavior :P

15:28 CLJS programs

15:28 hiredman: doing everything like it is done in the clojurescript codebase is not a recipe for making a language I like, you have a hand on the tiller of the clojurescript code base so it should not be a surprise you feel differently about that

15:28 dnolen: bbloom: not sets specifically but seqables

15:28 bbloom: dnolen: if it throws an exception, then it's a trivial fix to add "seq" to your code to opt in to undefined nth order :-)

15:29 anybody who relies on this is also relying on the particular order that their sets are seq-ed in

15:29 i bet they'd be happy to have that bug presented to them in terms of a sensible error message :-)

15:30 dnolen: hiredman: I don't have too strong opinion on this - we tried to avoid mucking around with what was originally done, certainly I didn't have any hand in this behavior.

15:30 tbaldridge: the only time having nth work on a set would be useful is when you're doing exactly what core.async is doing: (nth my-set (rand-int (count my-set)))

15:31 dnolen: bbloom: yeah, I actually prefer that core fns like nth don't have differing expectations

15:31 `fogus: ClojureScript should be viewed as a gift handed down from Olympus and never sullied!

15:31 bbloom: tbaldridge: and, in theory, each collection type could define a random sample function

15:31 just like coll-reduce, you could have coll-sample

15:32 hiredman: dnolen: sure

15:32 bbloom: b/c you can get log time sampling of sets, you don't strictly need ntyh

15:32 nth*

15:33 tbaldridge: bbloom: can you get random sampling assuming the same values in the set each time?

15:33 hiredman: maps don't support nth either at the moment

15:33 dnolen: so linear-nth should probably be changed to throw if not given ISeq

15:34 bbloom: tbaldridge: you mean like sampling multiple values without replacement?

15:34 reduce sample disj ?

15:34 aaelony: I seem to be misusing merge badly. What's the best way to get from '({:t "abc", :u "c"} {:t "def", :m "e"} {:t "abc", :m "d"}) to ({:t "abd" :u "c" :m "d"} {:t "def" :m "e" :m nil }) ?

15:34 hiredman: nth on sets could be seen as a deterministic random sampling of a range of values from an immutable datastructure

15:35 `fogus: But really, there are probably mistakes in it (I worked on it) if something doesn't makes sense then it should change.

15:35 hiredman: (nth s 0) is "in a repeatable way, give a random element from the set" (nth s 1) is "in a repeatable way, give me a random element from the set, but not what I would get for (nth s 0)" and so on

15:35 tbaldridge: bbloom: right we want non-deterministic sampling of the coll

15:36 bbloom: tbaldridge: sample == random == non-deterministic, no?

15:36 aaelony: sorry, that should have been… What's the best way to get from '({:t "abc", :u "c"} {:t "def", :m "e"} {:t "abc", :m "d"}) to ({:t "abc" :u "c" :m "d"} {:t "def" :m "e" :m nil }) ?

15:37 tbaldridge: bbloom: in that way, would you consider this to be random? (seq (set (range 10)))

15:37 stuartsierra: Why would you want `nth` to work on sets in the first place?

15:37 bbloom: tbaldridge: (comp seq set) is undefined, but deterministic

15:37 the other of … is undefined, but deterministic

15:38 hiredman: stuartsierra: I think destructuring in loops and stuff would be a little easier

15:38 bbloom: although that's an implementation detail, really. in theory the set could use randomness, like a skip list or something

15:38 tbaldridge: hiredman: huh?

15:38 bbloom: then it would be non-deterministic too

15:38 hiredman: (loop [[x & xs] foo] ...)

15:38 stuartsierra: (loop [[x & xs] (seq foo)] ...)

15:38 hiredman: you need to (seq foo) to make that really generic

15:38 stuartsierra: sure

15:39 bbloom: hiredman: right, but when you add that "seq" a red flag should go off that you're doing a coersion to an unknown order

15:39 tbaldridge: stuartsierra: this all comes from a CLJ vs CLJS bug with core.async. Passing a set to alts! breaks in CLJ not in CLJS, because CLJS supports nth on a set

15:39 bbloom: you're explicitly throwing the order away

15:39 hiredman: bbloom: generally I don't care about order, I just want to process the things

15:39 bbloom: sure, use reduce :-)

15:40 hiredman: bbloom: as my coworkers can tell you, I do

15:40 a lot

15:40 yazirian: haha yeah

15:40 * bbloom gives the thumbs up

15:40 hiredman: yazirian: thanks man

15:40 yazirian: reduce accumulates the men from the boys (so to speak)

15:41 bbloom: tbaldridge: so to clarify what i was saying…. if you need to take one or more random elements from a collection, you can do so in better than linear times for everything but linked lists, pretty much

15:41 hiredman: clojurebot: reduce |accumulates| the men from the boys

15:41 clojurebot: Roger.

15:41 bbloom: tbaldridge: not having nth doesn't mean you can't do it. you just need to bring datastructure specific knowledge to bear on the problem, like reducers do w/ fold/combine

15:41 tbaldridge: bbloom: right I understand now.

15:42 sooo....back to the problem at hand, I think we can fix this by having a guard in alts! that converts to a seq if needed.

15:42 bbloom: tbaldridge: now we just need an ICollSample protocol :-)

15:44 is dnolen gonna take the breaking fix? :-)

15:44 for cljs, i mean

15:44 dnolen: tbaldridge: that sounds reasonable, it would be nice to not have to do the conversion - but doesn't this wreck havoc for priority true?

15:44 :priority true

15:45 Raynes: callen: wat

15:46 tbaldridge: nah, it won't change much at all: https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L193

15:47 bbloom: tbaldridge: ah yeah, so if you just add a sequential? check on the very next line, you should be good for sets

15:47 tbaldridge: or do the conversion at the top so we don't take a perf hit every time

15:47 bbloom: (nth (if (sequential? ports) ports (seq ports)) idx)

15:48 oh right, in a loop. yeah

15:48 hoist my irc-based patch ^^ :-)

15:49 http://dev.clojure.org/jira/browse/ASYNC-6

15:51 dnolen: CLJS fixed, nth only works on ISeq now https://github.com/clojure/clojurescript/commit/a113b08a8c2811b0590cc6a36b2e9e5adc1c4c1e

15:52 there were no tests for the prior behavior so that's promising

15:52 bbloom: KABOOM

16:02 konr: Is anybody using datomic-pro? The jar at clojars is quite outdated

16:03 `fogus: konr: I don't think the pro jars are meant to be on Clojars

16:04 hiredman: konr: datomic has it's own maven repo they publish to these days

16:08 konr: hiredman: so I'd install a .jar from that repo? I've also noticed that there is a datomic.*.jar in the distribution zip, but it apparently doesn't include the dependencies, so I'd need to either add them to my project.clj or somehow add them to the jar, right?

16:10 callen: Raynes: vim is ancient and out of date. -> Papyrus.

16:10 Raynes: callen: Make sense, man.

16:11 I need to yell at evil-mode's author for using gitorious

16:12 callen: Raynes: gitorious is awful, sadly FSF nuts usually use Emacs.

16:13 I admire the FSF for what they're working towards, but working with them is ughhhhh sometimes.

16:15 konr: hiredman: nevermind, there is a maven-install script at bin/ :)

16:26 Raynes: I think I might switch back to Emacs tonight.

16:26 Or more like switch back to Vim living inside Emacs, since evil-mode pretty much implements the whole damn editor.

16:27 gtrak: is paredit and stuff usable that way?

16:27 rasmusto: Raynes: what's your hybrid setup like? I'm curious to try emacs, but I'm pretty stuck in vim muscle memory

16:27 Raynes: gtrak: Yes. It really doesn't effect Emac's normal behavior at all.

16:28 rasmusto: Just evil-mode. No extra configuration.

16:28 bbloom: i've said it before, but i know it's heresy around these parts: i don't feel the need for paredit in vim, since i'm pretty adept with text-objects

16:28 Raynes: Text objects don't solve the problems that paredit solves at all.

16:28 rasmusto: bbloom: have you used vim-sexp?

16:28 gtrak: I've seen a vim user try out evil-mode and like it, but I didn't understand enough about his crazy-fast finger hacks to know why or what implications it could have for my workflow.

16:28 rasmusto: it feels like paredit-lite to me, but still gives you slurps and barfs and the like

16:28 callen: bbloom: I'm the same way, but in Emacs.

16:29 I don't need paredit.

16:29 bbloom: Raynes: ok well text objects + other normal vim stuff

16:29 Raynes: Having text objects in Emacs is something I think people would eat right up if they knew about it.

16:29 callen: I think the way I structure my code might make paredit less apparently useful as well.

16:29 bbloom: rasmusto: nope

16:30 stuartsierra: konr: datomic-pro doesn't publish JARs to a Maven repository.

16:30 bbloom: rasmusto: this looks interesting though. seems like paraedit's ideas in a more-vim-like-package

16:30 stuartsierra: konr: datomic-free JARs should be available on Clojars, I think.

16:32 Yes, https://clojars.org/com.datomic/datomic-free

16:32 For some reason Clojars search doesn't show the latest version.

16:33 timvisher: cemerick: so i have a plain old html file that needs to connect out to the browser repl server

16:33 ToBeReplaced: if I do a (while true (swap! a inc) inside of a future, future-cancel returns true, but f continues to calculate -- why is this?

16:33 technomancy: (doc future-cancel)

16:33 clojurebot: "([f]); Cancels the future, if possible."

16:33 technomancy: "if possible" means it sets the thread interrupt flag IIRC

16:33 timvisher: i don't see any way to get the port in the javascript source to always be correct without templating it in via a dynamic request served by ring or summat

16:34 technomancy: if the flag is never checked ... welp.

16:34 timvisher: make any more sense?

16:34 Raynes: Cancelling futures is kind of like "Hey Mr future could you plz stop? No? Okay… I'm sorry."

16:34 dnolen: tbaldridge: now this looks fun (re net-chan) :) http://users.uom.gr/~iliass/Publications/Conferences/S05_cspcons_SETN.pdf

16:34 Raynes: canceling*

16:35 rasmusto: bbloom: yeah, that's how I felt about it. I'm going to give it a shot, as paredit gets in my way more than I'd like

16:35 tbaldridge: dnolen: yeah I'm going to have to read that one tonight.

16:35 ToBeReplaced: technomancy: almost there -- so even though @fut returns CancellationException, .isDone is true, etc, the thread in the future may still be computing

16:36 bbloom: rasmusto: i generally dislike when my editor does ANYTHING other than precisely what i instruct it to do. things like auto paren insertion drives me nuts. first shit to turn off if you ever have to use VS or IDEA

16:36 ToBeReplaced: technomancy: i'm all sorted, plenty of java docs for this stuff

16:36 technomancy: bbloom: the worst is when your runtime just GCs the memory out from under you. it's like "hey, I was gonna use those bytes"

16:36 rasmusto: bbloom: I agree except for when you're dealing with sexprs (mostly)

16:37 bbloom: technomancy: i don't see how that's remotely the same thing

16:37 rasmusto: bbloom: and auto-indent etc.

16:37 gtrak: rasmusto: if paredit gets in your way, you know there are some ways to override it, right? like C-w doesn't care.

16:37 bbloom: auto indent annoys the hell out of me whenever it fucks up

16:37 TimMc: bbloom: So you dislike indenta

16:37 Oh.

16:38 bbloom: i use it, but i frequently edit the rules

16:38 technomancy: emacs's auto-indent is never wrong, by definition =)

16:38 bbloom: lol

16:38 rasmusto: bbloom: 95% of the time it's a blessing, though

16:38 dnolen: Lisp World Problems

16:38 bbloom: rasmusto: 92% of the time ;-)

16:38 dnolen: i was explaining datomic to someone the other day and then they asked all these questions about "what happens if"

16:39 TimMc: It's always right 98% of the time.

16:39 bbloom: and every time the answer was "you already have this problem with your sql database"

16:39 gtrak: 98% of the time, it's right every time.

16:39 bbloom: dnolen: if all the hard bits are solved, you've got extra brain cycles to think about the bike sheding bits :-)

16:39 rasmusto: I've had ggVG= break indenting if I have especially nasty/long functions

16:39 (exactly 5% of the time)

16:46 shane__: Hello all I am new to clojure. Is this the correct chat room for getting started questions such as emacs, nrepl, etc?

16:46 nDuff: shane__: sure.

16:47 shane__: I think I have everything setup however when building web apps with clojure I can't seem to reload code in the repl

16:47 Is there some trick that I am missing?

16:48 nDuff: shane__: you need to be sure your vars are involved in runtime evaluation

16:48 shane__: otherwise, changing the functions they point to doesn't take effect without a reload.

16:48 shane__: can't really speak in _too_ much more detail without a specific implementation to poke at.

16:49 shane__: specifically with compjoure

16:49 I am working through the tutorial on heroku

16:49 https://devcenter.heroku.com/articles/clojure-web-application

16:50 Once I call run-jetty everything works however if I make modifications to defroutes

16:51 the changes don't show up unless i restart jetty

16:52 nDuff: shane__: yup. Short form is that it's not a new project, or related to your editor setup.

16:53 shane__: compojure is building composed functions; redef'ing the individual components doesn't change them, because the vars' targets have already been composed..

16:53 technomancy: shane__: argh; let me fix that

16:53 we have some people at heroku who don't understand how repls work =\

16:54 stuartsierra: You could always rebuild the functions when you want to reload….

16:55 technomancy: fixed

16:55 shane__: (run-jetty #'routes ...) is the way to do it

16:56 shane__: whoop that was fast!!!!

16:56 Thank you very much!!!!!

16:56 technomancy: no problem

16:57 shane__: Man I heard that the clojure community was great! I wasn't expecting such a quick and awesome response!

16:58 technomancy and stuartsierra thanks very much!

16:58 stuartsierra: I didn't do anything, just obliquely referenced a different technique. :)

17:05 gdev: shane__, most times, I still have a question I posted a few months ago I'm still waiting to hear back on though

17:09 stuartsierra: gdev: I doubt anyone here remembers what that question was. :)

17:10 gdev: stuartsierra, i can't even remember

17:10 it illustrates the importance of answering questions fast i guess

17:12 hiredman: *shrug* it's not like questions are entitled to answers

17:13 callen: +1's please: https://github.com/mxcl/homebrew/pull/21733

17:14 gdev: hiredman, I agree

17:14 and with that, I'm shutting the peanut gallery down for the rest of the day.

17:14 Raynes: I don't want to be involved with that.

17:14 They're just going to tell you to scatter and die, callen.

17:15 technomancy: removing a package without a deprecation notice? nice.

17:16 is that a thing people do in homebrew land?

17:16 callen: technomancy: it's more of a shot across the bow.

17:17 technomancy: this is what a deprecation typically looks like: https://github.com/mislav/homebrew/commit/0cba6491782127552e5d299b7337d3d6a00ca257

17:18 caveats don't actually stop install.

17:18 and the goal is a no-op.

17:18 Raynes: you want the result, you just don't have the taste for blood >:)

17:19 Raynes: Not really.

17:19 I want a caveat.

17:19 callen: I can PR a caveat.

17:19 Raynes: At least then we don't have to deal with the "BUT IF IT'S IN HOMEBREW IT MUST BE THE RIGHT WAY TO DO IT WTF UR RONG" people.

17:20 callen: that would be nice.

17:21 technomancy: I dunno; "I'm using homebrew and ..." is usually enough to trigger my "all bets are off" heuristic.

17:22 callen: we should add a macro/bot-response for homebrew.

17:22 if one doesn't exist.

17:22 technomancy: ~macports

17:22 clojurebot: macports is not a package manager, it's a satire about package management.

17:22 technomancy: would be difficult to top that unfortunately

17:22 callen: that's a good start.

17:24 technomancy: well I'll browse wondermark for a few hours looking for something appropriately snarky, but I can't promise results.

17:24 muhoo: ~java logging

17:24 clojurebot: java logging is clown shoes

17:24 muhoo: that's still my favorite

17:25 callen: it's accurate.

17:25 that's why I use Timbre :P

17:25 technomancy: not actually relevant but http://wondermark.com/121/

17:28 bts-: i'm trying to set up logging for my first production clojure app right now. what do most people do when a dependency uses its own arbitrary logging library?

17:29 Jay: IS there any opening in Closure ????????

17:29 JOB

17:29 clojure*

17:29 hiredman: bts-: most logging libraries in java are super duper configurable so you use a shim of that logging library to redirect logging to some other

17:29 Jay: typo**

17:30 ?????

17:30 bts-: hiredman: thanks

17:30 Jay: ????

17:31 Any opening in Clojure ?

17:33 ???????

17:34 callen: Jay: stop spamming.

17:34 TimMc: Jay: Everybody saw your question, stop adding more lines.

17:34 Jay: LOL!

17:35 Why i need learn language if there is no opening in that language :D

17:35 TimMc: Also, I probably wouldn't hire anyone who used on average three question marks per sentence.

17:35 callen: Jay: some people enjoy programming for its own sake, we're not here to find you a job.

17:35 nDuff: Jay: There are certainly openings. Nobody who behaves you do in public is going to get one of them, though.

17:35 callen: Jay: and you come off as a bit of an idiot, which makes people telling you about a job opening even less likely.

17:36 Jay: nDuff, LOL i work in Corporate LOL!

17:36 callen: Jay: even if you are a solipsist, you should learn how not to behave like one.

17:36 hyPiRion: TimMc: None of them contain two or three though. Clojurebot would've acted on it.

17:37 Jay: LOL

17:37 hyPiRion: clojurebot: any opening in clojure???

17:37 lazybot: hyPiRion: How could that be wrong?

17:37 callen: Jay: stop saying "LOL", it's devoid of content. Say something or don't speak at all.

17:37 hyPiRion: oh, that was a lazybot thingy

17:37 clojurebot: clojurebot is http://images2.fanpop.com/images/photos/3000000/Arrowed-teen-girl-squad-3099521-570-420.jpg

17:38 Jay: I have right callen who the hell are .. I might have sued you

17:38 callen: we really need mods.

17:38 TheMoonMaster: ^

17:38 gtrak: it's probably not good for clojure if people who sound childish learn it and get jobs?

17:39 TheMoonMaster: It's good for any language.

17:39 Jay: lol i already job

17:39 callen: Jay: then leave, since that's all you're interested in and your needs are satisfied.

17:39 TheMoonMaster: But you don't already English.

17:39 TimMc: technomancy: You around to squash a troll?

17:39 Jay: English is not my language**

17:40 bosie: gtrak:

17:40 TheMoonMaster: You don't already English.

17:40 clojurebot: English is the official language of the universe

17:40 bosie: gtrak: i wish i had a job where i could use clojure

17:40 Jay: I dont care for English

17:40 TheMoonMaster: Then stop using it.

17:40 Otherwise you do care.

17:40 The care is strong in you, Jay.

17:40 Jay: I will learn chinese

17:41 :D

17:41 gtrak: bosie: It's pretty sweet :-). I hope there will be more clojure jobs faster. Jay: go troll #english

17:41 Jay: troll ?

17:41 bosie: gtrak: you use it fulltime commercially?

17:41 gtrak: yes, I've been doing it full-time for almost 2 years.

17:42 Jay: I dont find any job in Clojure in my country... But i see lot of forums and things

17:42 hyPiRion: Hey guys, remember that there's a command named /ignore.

17:42 Just in case anyone forgot.

17:42 blrm: (inc hyPiRion)

17:42 lazybot: ⇒ 20

17:42 TimMc: And in some clients, /ignore -replies Jay

17:42 Jay: lol

17:42 TimMc: That's a nice one, because it nukes the entire conversation (if properly nick-addressed).

17:43 blrm: TimMc: i wasn't aware of that, awesome

17:43 muhoo: (inc TimMc )

17:43 lazybot: ⇒ 3

17:43 callen: TimMc: I didn't even know that one existed after years of irssi use! thank you!

17:43 bosie: gtrak: may i ask where? you can PM me if you dont want to make it public

17:43 callen: (inc TimMc)

17:43 lazybot: ⇒ 45

17:44 callen: muhoo: you inc'd the wrong person.

17:44 muhoo: note the space.

17:44 gtrak: sure, Revelytix, in Baltimore.

17:44 sinistersnare: hello, is there any way to add local dependencies without install maven, only lein?

17:44 Jay: LOL!

17:44 sinistersnare: i have a few jars i want to add to my project

17:44 but i dont want to install maven onto all my systems

17:44 gtrak: bosie: there's also a St. Louis office

17:45 bosie: gtrak: man. data science in clojure on hadoop. i am seriously jealous. its exactly what i am looking for hehe

17:46 technomancy: sinistersnare: you can do `lein deploy` on files from disk these days

17:46 gtrak: bosie: I do mostly compojure stuff

17:47 bosie: gtrak: thats odd. i figured you would be using cascading + cascalog and not clojure as a web language

17:47 callen: bosie: I do mostly web stuff as well.

17:47 gtrak: bosie: we have a query engine built on top of cascading, too, but it's in maintenance mode

17:47 hiredman: bts-: https://github.com/pedestal/pedestal/blob/master/service/project.clj#L42 is an example of pull in lots of logging framework shims that redirect logging all in to the logging system you really want

17:47 bosie: gtrak: why clojure for web?

17:48 Jay: clojure i dont like IT

17:48 sinistersnare: technomancy: so if my internal jars are in the ./lib/ folder, i can add that to my :dependencies in my project.clj?

17:48 gtrak: bosie: the whole product's clojure. NOT java, basically :-)

17:48 TheMoonMaster: I can't see myself using Clojure for web stuff. But I could see it being used for services that the web stuff might tlak to.

17:48 talk*

17:48 bosie: gtrak: gotcha. but no love for cascalog?

17:48 callen: TheMoonMaster: you just haven't used nice libraries yet :)

17:48 gtrak: bosie: I wasn't part of that decision, but it was evaluated

17:49 sinistersnare: im not quite sure what 'lein deploy' does, "Deploy jar and pom to remote repository."

17:49 im a clojure newbie...

17:49 callen: Raynes: I think they're into it.

17:49 mgaare: sinistersnare: it's used to upload your stuff to package repositories

17:49 technomancy: sinistersnare: hm; should remove the word "remote" from there

17:49 TheMoonMaster: callen: Well, that and I can't exactly justify using it for client sites.

17:49 gtrak: I would recommend cascalog unless you really need to drop down, imo hadoop is a messy beast.

17:49 Raynes: callen: Looks like it, yep.

17:49 technomancy: since it works on file:///home/me/.m2/repository too

17:49 callen: Raynes: thank you.

17:50 sinistersnare: can i use it on a non-maven repository?

17:50 callen: Raynes: your much more eloquent and constructive words are very helpful.

17:50 sinistersnare: i just want it to be *project.clj-location/lib

17:50 *

17:50 Raynes: callen: I'm still with you that I wish they'd not even consider the cljsc shit at all though, fwiw. Clojurescript is hard enough without that confusing them. :\

17:50 bosie: gtrak: are you a 'data scientist'?

17:50 technomancy: sinistersnare: you can create a new repository anywhere on disk

17:50 gtrak: bosie: nope :-). just a programmer.

17:50 technomancy: but it'd still be in maven format

17:50 bosie: gtrak: may i PM you?

17:50 gtrak: sure

17:51 sinistersnare: ok, i dont mind the format; the user will only have lein installed

17:51 though

17:51 Raynes: callen: And I also wish that they wouldn't have the any clojure-related packages except for leiningen. I just try to take the path that will be both sufficient for our needs as a community and not asking too much of people who don't understand how it works.

17:51 callen: TheMoonMaster: you're a contractor?

17:51 Jay: Clojure LOL !

17:51 callen: Raynes: well if I can fly a PR under the radar I'll do it.

17:51 technomancy: sinistersnare: right; there is no longer a need for mvn

17:51 sinistersnare: oh great

17:51 TheMoonMaster: callen: For now, yeah.

17:52 Jay: just a C !

17:52 callen: TheMoonMaster: meh. you can always advocate for using whatever you want. it's all a question of trade-offs.

17:52 technomancy: Jay: you're welcome to stay around if you wish to contribute to the conversation, but stuff like that is gonna get you booted

17:52 TheMoonMaster: callen: I'd kind of be screwing the client in a way. There aren't *that* many Clojure web devs.

17:52 callen: TheMoonMaster: that's up to you to determine.

17:53 patchwork: TheMoonMaster: The more clojure sites, the more clojure webdevs

17:53 callen: TheMoonMaster: all my projects are either personal or long-term maintenance (relative to the lifespan of the company)

17:53 TheMoonMaster: Right, a lot of the use cases I see don't make sense.

17:53 callen: TheMoonMaster: but until people start forcing the matter and start using Clojure even where it's not necessarily enabling maximum fungibility of developers it's not going to spread.

17:53 TheMoonMaster: Especially since I'm a Rails developer and it's way easier to sell people on that as well.

17:53 callen: Node.js took off because ignoramuses used it where it didn't remotely make sense.

17:53 Jay: technomancy : I understand But like i said no one needs clojure... If no clients i wont even touch the language

17:54 bts-: hiredman: thanks a lot!

17:54 callen: Jay: we don't care.

17:54 technomancy: Jay: you're free to not touch it; that's your decision

17:54 Jay: callen: I dont care either

17:54 callen: Jay: then /part

17:54 Jay: who the f! are u callen

17:54 mgaare: fwiw Jay is trolling in #haskell too :D

17:54 technomancy: mgaare: good to know; thanks

17:55 TheMoonMaster: I wouldn't call this trolling.

17:55 Jay: mgaare ?? :D LOL ! Not me

17:55 I love haskell

17:55 justin_smith: aaelony: did you get an answer earlier?

17:56 Jay: mgaare mind your words ...

17:57 sinistersnare: im sorry to keep asking the same words, but in other words, is using 'lein deploy' what i need to do to add local jars? all i want to do is append the classpath with a folder; and my lack of understanding 'lein deploy' isnt really going my way :p

17:57 aaelony: justin_smith: didn't get an answer but I've got something somewhat workable that i'm unhappy with...

17:58 mgaare: sinistersnare: no. If you have a .jar, put it in the project's lib folder and you will be able to get at it

17:58 sinistersnare: its in the lib/ folder

17:58 do i need to do anything else?

17:58 justin_smith: aaelony: maybe (def apply-default (partial merge {:t "abc" :m "d"}))

17:58 that may or may not improve on what you have

17:58 technomancy: sinistersnare: you can use `lein deploy` to put jars from anywhere on the filesystem into the repo where lein can find them

17:59 sinistersnare: i just want them in the dir where my project.clj is, i dont need them anywhere else

17:59 tieTYT: i've heard lisp referred to as "a programmable programming language". 1) I assume that is referring to macros 2) I assume that it's necessary to have homoiconicity to write macros the way lisp does. If my assumptions are correct, 3) why is homoiconicity necessary? Why can't java be just as programmable as clojure? (I've never written a macro)

17:59 justin_smith: sinistersnare: you can add to source-paths in your project.clj

17:59 aaelony: justin_smith: thanks, I will try that. I'm doing something terrible like a (get (merge-with merge (group-by …) (group-by …))) within a for loop

18:00 justin_smith: (map (partial merge {map with default values}) hashes) ?

18:00 aaelony: looks promising

18:01 mgaare: sinistersnare: this post has some more info for that: http://www.elangocheran.com/blog/2013/03/installing-jar-files-locally-for-leiningen-2/

18:02 nDuff: tieTYT: if you want an case-in-point type example, the core.async library is actually a pretty good one.

18:02 sinistersnare: thanks, ive been searching google, but have been fruitless; glad you found something

18:02 nDuff: tieTYT: ...it implements functionality for Clojure as a library which other languages need to have built into the compiler to support.

18:02 aaelony: it has to essentially construct a union of the things to look for from 2 (or more) seqs, then for each thing found, go through each seq by thing and consolidate the things that are found into one record

18:03 shane__: Does anyone know of any clojure user groups that meet in Boise Idaho

18:04 Nothing came up on google

18:04 Jay: I'm not saying i dont want to learn clojure all i'm saying is learning language must be fruitful ....like getting JOB :) ... NOT FOR TIMEPASS

18:04 nDuff: tieTYT: If you don't have homoiconicity, you have a completely different language to use when writing macros. A much, much harder one, because they're operating on parse trees that weren't really built to be manipulated or understood by humans.

18:04 tieTYT: nDuff: although i haven't looked, I assume that I won't be able to understand that code

18:04 patchwork: Jay: I have been using clojure professionally for 2 years now, several other people I work with do as well

18:04 aaelony: fwiw, here is what I have (that I'm unhappy with but mostly seems to work)… https://www.refheap.com/17365

18:05 nDuff: patchwork: don't feed the troll

18:05 justin_smith: aaelony: so you could use (set (mapcat keys hashes)) to get all the keys in all the hashes

18:05 aaelony: then (select-keys mp (vec keys-set)), if I understand you correctly

18:05 patchwork: nDuff: I keep a troll zoo, closet troll sympathizer

18:06 nDuff: tieTYT: ...there _are_ non-homoiconic languages that support macros, by the way -- Boo is one of them.

18:06 tieTYT: ...but while working with macros is supported in theory there, there's a huge difference between supported in theory and actually usable for difficult things.

18:06 mgaare: tieTYT: the main 'secret sauce' macro in core.async takes a normal-looking function call, and behind the scenes turns this into a state machine that implements go-like goblocks

18:07 justin_smith: working on things in terms of parsed tokens in a transperently defined nesting gains you much when constructing macros

18:08 Jay: Thank you patchwork

18:08 justin_smith: I mean you can cause a string to be evaluated in any language, if you jump through a hoop or two (and maybe have a copy of the compiler sitting around)

18:09 aaelony: justin_smith: not sure I follow your suggestion

18:10 tieTYT: i see

18:10 doesn't C++ have macros?

18:10 justin_smith: aaelony: I probably misunderstand what you were doing, looking at your paste now

18:10 tieTYT: that #NDEFIF stuff or whatever?

18:10 justin_smith: tieTYT: yes, both as macros and something they call templates

18:10 aaelony: justin_smith: ok, cool

18:10 justin_smith: which are really macros

18:11 tieTYT: i think the problem is I've yet to come across a problem in clojure that would make me write a macro

18:11 ToxicFrog: tieTYT: yes, although C/++ macros have some differences from Lisp macros that makes them rather sadmaking to use

18:11 tieTYT: so I have no way of saying, "what if I wanted to do this in java? How would I be screwed"

18:11 justin_smith: templates in c++ are a better comparison to macros

18:11 callen: Raynes: WE'RE BLACKLISTING THIS BITCH :D

18:11 Raynes: callen: Quick, hop on and warn them about the clojurescript pull request too!

18:12 justin_smith: tieTYT: macros are when you need to change how something is evaluated - imagine if every fn needed a do in it

18:12 image if every def needed the symbol arg quoted

18:12 *imagine if

18:12 pbostrom: tieTYT: think of it this way: public String foo() { return "bar" } is not a usable data structure in Java, you would have to take an extra step to parse that into something you can manipulate, however (defn foo [] :bar) is both Clojure code and a usable data structure, a list with 4 elements

18:12 ToxicFrog: (they are basically a textual expansion/token replacement phase that happens before compilation proper, using their own language, rather than fully fledged functions with the type AST => AST)

18:12 Raynes: callen: Look at us, a 'speakin for the Clojure community. We're warriors.

18:13 mgaare: C++ templates are also a good illustration of why homoiconicity is so important for macros. Templates are more or less only good for type polymorphism and generating extremely long compiler errors

18:13 callen: Raynes: I just want that fucking formula gone.

18:13 ToxicFrog: Formula?

18:13 Raynes: ToxicFrog: For krabby patties.

18:13 tieTYT: pbostrom: I feel like I understand the parts of that sentence, but not the whole :P

18:13 Raynes: They're taking all our business.

18:13 justin_smith: mgaare: so true

18:13 ToxicFrog: Raynes: I am terribly confused

18:14 tieTYT: thanks for the help. I feel like I don't get it yet, but I think i need to need a macro before I can understand this better

18:14 callen: ToxicFrog: killing off problematic Clojure homebrew Formula

18:15 ToxicFrog: tieTYT: clojure code is also valid clojure data structures. Clojure macros are not just a find-and-replace on the source code as they are in some other languages, but clojure functions themselves, which takes a data structure representing executable clojure code, and return a similar structure.

18:15 callen: Raynes: I pulled in the clojurescript issue/PR.

18:15 ToxicFrog: Which makes them both (a) vastly more powerful and (b) much more pleasant to use than e.g. cpp macros.

18:15 I used macros recently but I can't actually remember why.

18:15 Raynes: callen: Looks good. Progress.

18:15 callen: it's nearly impossible to write a reliable cpp macro, even a trivial one.

18:15 justin_smith: tieTYT: a key part of understanding it is that a compiler for almost any real language generates a data structure called an AST. Lisps are handy in that the source code is almost exactly the same, structurally, as the initial AST - so you can manipulate the AST without a huge conceptual burden to make programmer friendly syntaxes

18:15 callen: anybody who says otherwise hasn't written much C or cpp macros.

18:15 similarly, anybody who thinks C is "simple" hasn't dived very deep.

18:16 ToxicFrog: callen: "clojure homebrew formula"?

18:17 jtoy: silly question, why doesnt active_users get passed to sort-by? (cond->> (active_users) true ((sort-by params)))

18:17 callen: ToxicFrog: silly mac user stuff, we're trying to keep the muggles from stumbling about.

18:19 jtoy: can I pass (()) in the ->> macros and have the forms get data?

18:19 justin_smith: (()) wont' work because you cannot call ()

18:19 Raynes: callen: I got the comments.

18:20 jtoy: here is a better example: (cond->> [1 2 3 4] true ((sort-by count)))

18:20 justin_smith: so can I change it to work here?

18:20 justin_smith: I misread your question

18:20 rasmusto: jtoy: I think you have one too many sets of parens on '((sort-by count))

18:20 justin_smith: instead of ((sort-by count)) do (#(sort-by count %))

18:21 rasmusto: justin_smith: he's doing thread-last, so no need for the anon fn

18:21 justin_smith: ahh

18:21 heh

18:21 rasmusto: justin_smith: I tend to do that when I need to switch from thread-first to thread last, it's ugly :P

18:21 ToxicFrog: callen: aah

18:22 jtoy: I sort of see, so why do i sometimes need to do (#()) vs () ?

18:23 ToxicFrog: ,(doc cond->>)

18:23 clojurebot: "([expr & clauses]); Takes an expression and a set of test/form pairs. Threads expr (via ->>) through each form for which the corresponding test expression is true. Note that, unlike cond branching, cond->> threading does not short circuit after the first true test expression."

18:23 callen: Raynes: progress progress! Exciting :D

18:23 rasmusto: jtoy: (->> 'foo (#(somefn % 'bar)))

18:23 Raynes: callen: :D

18:23 sinistersnare: ,(doc ->>)

18:23 clojurebot: "([x form] [x form & more]); Threads the expr through the forms. Inserts x as the last item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the last item in second form, etc."

18:23 rasmusto: (->> 'foo (somefn 'bar)) will thread 'foo in after 'bar

18:23 ToxicFrog: ,(doc sort-by)

18:23 clojurebot: "([keyfn coll] [keyfn comp coll]); Returns a sorted sequence of the items in coll, where the sort order is determined by comparing (keyfn item). If no comparator is supplied, uses compare. comparator must implement java.util.Comparator. If coll is a Java array, it will be modified. To avoid this, sort a copy of the array."

18:23 callen: Raynes: samueljohn is awesome.

18:24 ToxicFrog: Hrm

18:24 Is there a reason you can't just

18:24 ,(cond->> [1 2 3 4] true (sort-by count))

18:24 clojurebot: #<UnsupportedOperationException java.lang.UnsupportedOperationException: count not supported on this type: Long>

18:25 ToxicFrog: Whups

18:26 jtoy: ic, thx

18:28 Raynes: callen: Let me answer this. You're going to get impatient. :p

18:28 ToxicFrog: ,(cond->> [1 2 3 4] true (sort-by identity))

18:28 clojurebot: (1 2 3 4)

18:29 ToxicFrog: ,(cond->> [1 2 3 4] true (#(sort-by identity %)))

18:29 clojurebot: (1 2 3 4)

18:31 justin_smith: ,(cond->> [1 12 :a 3 :b 4 :d] (comp even? number?) (sort-by #(java.lang.Math/sin %)))

18:31 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.lang.Number>

18:32 justin_smith: ,(cond->> [1 12 :a 3 :b 4 :d] (filter (comp even? number?)) (sort-by #(java.lang.Math/sin %)))

18:32 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$filter>

18:32 justin_smith: whatever

18:32 rasmusto: justin_smith: what are you trying to do with the cond->> macro?

18:32 hyPiRion: justin_smith: (comp even? number?) doesn't make sense

18:32 do (every-pred number? even?) instead

18:32 justin_smith: yeah, of course

18:32 thanks

18:33 I'll switch over to pming the bot

18:34 Raynes: callen: I'm impressed. You didn't chew anyones faces off or anything. :P

18:35 callen: Raynes: I can be nice when I care.

18:35 Raynes: I'm a fucking saint at work to my coworkers, comparatively.

18:35 * Raynes fistbumps callen

18:35 callen: because my coworkers are nice people.

18:35 * callen fistbumps Raynes

18:37 callen: Raynes: I think this might actually work.

18:37 Raynes: callen: Considering we have every single maintainer in that pull request, I bet.

18:38 callen: Holy balls we're the same person all of a sudden.

18:38 callen: I kno rite.

18:39 they're going to think we're a coordinated marketing team.

18:39 Raynes: LOL

18:39 Raynes: HE CLOSED the cljs PR!

18:39 * callen happy dances

18:39 Raynes: Hooray!

18:40 callen: We've inevitably made an enemy of that poor Daniel fellow.

18:40 callen: I'm prepared to do battle a decade from now by sword.

18:40 Raynes: should I add the Leiningen caveat?

18:40 I think it makes sense.

18:42 yeah, dunzo.

18:43 TimMc: What are you hooligans on about?

18:43 callen: TimMc: getting Clojure removed from homebrew :)

18:43 Raynes: callen: I'd add it.

18:43 callen: Raynes: caveat is in, what about doc URL?

18:44 Raynes: Probably worth adding. Link to whatever we'd link a new user to.

18:44 callen: got it.

18:44 technomancy: what's the best URL to Leiningen for documentation that isn't likely to change?

18:44 I know of the markdown in ./doc/ but I wasn't sure what would be best.

18:44 technomancy: callen: http:/leiningen.org#docs maybe?

18:45 callen: sweet, thanks.

18:46 technomancy: callen: if it's for people who just installed they should do `lein help tutorial`, `lein help faq`, etc

18:46 oh, with | less

18:47 callen: technomancy: we have lein help and lein repl in there.

18:47 I'm trying hard not to make things seem any more complicated than necessary so that the PR flies through.

18:47 Raynes: Pointing to the docs gets them to the tutorial.

18:48 callen: yep

18:48 technomancy: I guess you can assume they're online if they just installed the package, sure

18:48 callen: yep.

18:52 TimMc: Heh, best of luck.

18:52 callen: TimMc: >:D

18:59 subusnarl: hello, this is a fairly specific question, but how can i add the following files to me :dependencies in lein? http://libgdx.badlogicgames.com/nightlies/maven/com/badlogic/gdx/gdx/0.9.9-SNAPSHOT/

19:01 would it be [com.badlogic.gdx/gdx "0.9.9-SNAPSHOT"] with the :repository set as [["libgdx" "http://libgdx.badlogicgames.com/nightlies/maven/com/badlogic/gdx/&quot;]]

19:01 i mean http://libgdx.badlogicgames.com/nightlies/maven"

19:15 callen: Raynes: gerd dermmert, so close.

19:18 arthurmaciel: hello!

19:19 callen: arthurmaciel: hi

19:19 arthurmaciel: I'm quite new to clojure and I'd appreciate any web framework recommedation. Someone that has been used for production for example.

19:20 Trinary: is compojure + libnoir still a good starting point for web frameworks?

19:22 callen: Trinary: yes but a comprehensive example would be Luminus.

19:23 http://www.luminusweb.net/

19:23 arthurmaciel: Trinary ^^

19:24 Trinary: nice

19:28 arthurmaciel: callen: do you use it for day-to-day tasks? It seems marvellous

19:29 callen: arthurmaciel: yeah, I just got done helping yogthos move it from Clabango to Selmer.

19:29 arthurmaciel: I use http-kit + standard luminus libraries

19:33 arthurmaciel: callen: no SXML for clojure?

19:36 callen: arthurmaciel: I don't know what that is.

19:37 arthurmaciel: are you asking about templating?

19:38 arthurmaciel: ohhh that.

19:38 arthurmaciel: https://github.com/weavejester/hiccup

19:39 I recommend Selmer for actual views/templating

19:40 technomancy: hiccup is pretty great though

19:40 Raynes: callen: I think you might be accidentally arguing with someone who agrees with you.

19:40 callen: Raynes: not arguing.

19:40 just reinforcing.

19:41 arthurmaciel: callen: yes, something like that. After meeting SXML any templating strategy seems too bloated to my ignorant eyes.

19:41 callen: arthurmaciel: github.com/yogthos/Selmer/

19:45 Raynes: callen: I think my last comment iwll clear things up.

19:45 sinistersnare: hi again; this time around, im hoping someone has some libgdx (java library) experience! i found this piece of code on github, and am wondering if its necessary to call dispose on the BitmapFont and the SpriteBatch

19:45 https://gist.github.com/sinistersnare/6179928

19:46 you would regularly need to call dispose

19:46 on those objects because they are run natively via JNI, but they dont exist out of the context of the show function. so im not sure how i would call dispose onto it

19:47 arthurmaciel: callen: why do we need [%endfor%] when we already have a closing parenthesis? :)

19:48 callen: arthurmaciel: I've worked on large projects, DTL/Selmer style libraries were a godsend there.

19:50 and it works well in small projects too.

19:50 justin_smith: sinistersnare: if you need to call dispose, than something exists - should they be stored between calls to show? if so you need to make some allowance to allocate and dispose them explicitly

19:51 arthurmaciel: callen: just in case, is it possible to use luminous with hiccup?

19:51 sinistersnare: well, i guess they need to be stored in between calls to show, because i need to dispose of them eventually

19:52 justin_smith: you could have an init function that returns a handle to the resources, and a cleanup function that takes that handle as an arg

19:53 sinistersnare: im not sure how to do that :p

19:53 justin_smith: return a map

19:53 (from the init function)

19:54 and pull the values out of the map to dispose them

19:54 or, return an anonymous function that will dispose the resources from the init function, if that makes more sense

19:54 technomancy: Raynes: you could point the homebrew guys to http://dev.clojure.org/jira/browse/CLJ-366 as proof of the fact that they don't really have any interest in solving that particular problem

19:55 sinistersnare: justin_smith: so they would be stored globally still?

19:56 justin_smith: sinistersnare: pseudo-clojure: (defn allocate [] (let [resources {:font (BitMapFont.) :spirtes (SpriteBatch.)}] resources))

19:56 then you write a function that takes a resources map like that, and disposes of them

19:57 sinistersnare: or (defn allocate [] (let [sprites (SpriteBatch.) font (BitMapFont.)] (fn [] (dispose sprites) (dispose font))))

19:58 then you hold onto the function returned by allocate, and call it to dispose the resources

19:58 neither approach uses any global resource

19:58 sinistersnare: hmm

19:58 gimme a second to ponder that...

19:59 justin_smith: the general idea is that allocate returns something each time called, and you use that thing it returns in some way to do your cleanup

20:00 sinistersnare: ok

20:00 so give me a second to try and use it

20:00 justin_smith: np

20:02 callen: arthurmaciel: yes

20:02 arthurmaciel: you can use anything you want with Luminus, it's like anything else, just a bag of libraries. Pick and choose what you want.

20:02 arthurmaciel: the culture in Clojure is to let people use and combine libraries however they want, not to force decisions via a framework.

20:04 sinistersnare: im so confused. this is what i have now, but im not sure what to do

20:04 callen: Raynes: you're much better at this than I am.

20:04 dnolen: Ejecta is pretty sweet - make interactive iOS application with ClojureScript - http://impactjs.com/ejecta

20:04 arthurmaciel: callen: good to know (about hiccup and clojure philosophy)

20:04 sinistersnare: https://gist.github.com/sinistersnare/6179928 and with this, i just call (allocate) to release the objects?

20:04 dnolen: going to get even nicer with iOS 7 with official JSC Obj-C bridge

20:05 callen: arthurmaciel: it's worth noting that I describe this as the Clojure culture even though it's not something I'm 100% subscribed to for all use-cases.

20:06 arthurmaciel: callen: good to know you're being honest :)

20:06 justin_smith: sinistersnare: you would call the value returned by allocate

20:06 sinistersnare: yes

20:07 did i use it correctly in the let form of the show method?

20:07 im a clojure newbie, as you most probably know

20:07 justin_smith: sinistersnare: yeah, and then you would call (memory) to dispose it

20:07 so maybe memory should have a different name, like cleanup or dispose

20:07 sinistersnare: yes i agree

20:08 but doesnt memory itself have a scope that doesnt exist out of the show function anymroe

20:08 show function at all*

20:08 justin_smith: it does have that scope if you pass it out

20:08 sinistersnare: how can i pass it out?

20:09 justin_smith: what does (.addActor stage label) return?

20:09 sinistersnare: void

20:09 justin_smith: ok, so after that line, just have memory

20:09 as the return value

20:09 sinistersnare: oh that sounds good

20:09 very interesting proposition

20:10 justin_smith: and if multiple calls to show can share the same allocated sprites and fonts, then you can pass those in, and separate the allocation from the showing altogether

20:11 alternatively, since you are already using a def'd stage, you could similarly def a "cleanup" function on the top level of the namespace

20:11 with a similar declare / def pattern

20:11 but when you do things that way the code is not re-entrant

20:11 sinistersnare: im not quite sure i understood that D:

20:12 justin_smith: what if you wanted to use that namespace two places in the same app

20:12 sinistersnare: another question: what does the ^ do?

20:12 justin_smith: they would only have one stage

20:12 it is declaring the type

20:12 it indicates metadata, in general

20:12 sinistersnare: oh ok

20:12 so its ignored by the reader?

20:13 justin_smith: nope, used by the reader

20:13 sinistersnare: D:

20:13 damnit

20:13 ok

20:13 justin_smith: certain optimizations are possible with type tagging

20:13 it prevents reflection

20:13 kristof: Does anyone know if typed clojure does type inference?

20:13 sinistersnare: so would it be better if i called (declare) on the allocated objects?

20:14 technomancy: kristof: not really =(

20:14 kristof: I know that's hard if the whole program isn't typed to begin with but I think it'd be cool to, you know, annotate a block of code with only a few type annotations and then have a type checker infer the remaining types within the rest of that code

20:14 justin_smith: sinistersnare: the most durable design is to make a function that returns all allocated objects and configuration (an init), and then pass it or bind it when using other code in the namespace

20:15 sinistersnare: but for basic stuff that does not need to be re-entrant you can do quite a bit with def as long as you are aware of that limitation

20:15 sinistersnare: god damn im sorry, im just so confused; i understand what your saying, but im not sure how to implement it

20:15 technomancy: kristof: some people say there are inherent incompatibilities between hindley-milner and the JVM

20:15 as for as interop is concerned

20:15 justin_smith: sinistersnare: one sec, let me try to find some simple code that works that way

20:15 sinistersnare: thanks so much

20:16 hiredman: technomancy: with oop style sublcassing, like jvm types have

20:17 bbloom: yeah, you can do hindley-milner w/ protocols & just call all the java things "Object"

20:17 kristof: technomancy: Not even Haskell has true Hindley-Milner, to be honest. So it's not a true-to-the-paper implementation that matters, but reducing type annotations where they can be inferred.

20:18 Oh, question

20:18 What's the deal with pods right now?

20:18 Are they still happening or has no one taken the reins on that?

20:18 hiredman: let me ask you this

20:18 brehaut: haha pods

20:18 hiredman: kristof: what are pods?

20:18 clojurebot: Gabh mo leithscéal?

20:19 bbloom: hiredman: i think he means http://dev.clojure.org/display/design/Mutex+references+(pods,+nee+cells)

20:19 hiredman: bbloom: shhhhh

20:19 kristof: hiredman: It was in one of Hickey's keynotes. The idea is to remove policy dictation from transients.

20:19 bbloom: as far as i know, the only public info about them is rich chit chatting about them in a talk or two & here in irc a long time ago

20:19 technomancy: http://p.hagelb.org/mystery.gif

20:20 kristof: hiredman: A pod would be a tool for encapsulation. You shove in a value, and you have your transient inside, and you have procs (with type of proc: transient -> transient) and then something would cook inside and bam! A value comes out.

20:20 hiredman: kristof: sure, I was at the keynote

20:21 kristof: The point of separating policy would be to implement transients in a way that's not really possible right now, at least I think. Something to do with thread numbers or whatever.

20:21 hiredman: kristof: I ask because if your answer is hand wavey, then my answer to "what is going on with them?" would be "why do you care?"

20:21 kristof: Anyway, I don't know much about it, so I was just wondering what was going on with it at the moment since the web yields very little results.

20:22 hiredman: the answer is: nothing, they are sort of abstract concept you can draw on to design things, but no one has done a general reusable implemenation

20:23 kristof: hiredman: Alright! Thank you for explaining.

20:24 Foxboron: http://hastebin.com/jomotosupi.lisp

20:24 i can't seem to figure out why this wont work

20:30 aaelony: seeing something realy strange via lein deps: "Exception in thread "FileRepositoryConnector-1" …" https://www.refheap.com/17371

20:31 shoky: Foxboron: what's add? and then?

20:32 Foxboron: shoky: other functions. But i wrote the code again from scratch and it works

20:33 Raynes: Holy shit aaelony

20:33 You're pulling bytes from the twilight zone.

20:34 aaelony: aaelony: is that all?

20:34 Raynes: Dear God, now you're talking to yourself. Get this man some help!

20:34 aaelony: translation?

20:35 silence of the raynes?

20:36 Raynes: aaelony: I was making pointless jokes that apparently didn't quite hit home.

20:36 aaelony: raynes: ah, but I welcome attempts at humor

20:44 justin_smith: sinistersnare: maybe something like this https://www.refheap.com/17372

20:44 that doesn't do anything interesting, but it is the general idea

20:48 sinistersnare: ok, the dispose function is called at the destruction of the application

20:48 where is reset! coming from?

20:48 justin_smith: reset! is a function on atoms

20:48 sinistersnare: oh

20:48 justin_smith: http://clojure.org/cheatsheet

20:50 I learned much of what I know about clojure by following links on that cheatsheet

20:51 sinistersnare: yeah, ive seen it; but i dont think im experienced enough with programming in general to understand half enough of it

20:51 what are the point of atoms?

20:51 theyre mutable?

20:53 justin_smith: http://clojure.org/atoms

20:54 it holds an immutable value, but you can use it to manage state

20:54 sinistersnare: oh sorry, i was looking at this: and it wasnt helpful :p http://clojuredocs.org/clojure_core/clojure.core/atom

20:54 justin_smith: yeah

20:54 the cheatsheet is not perfect

20:59 dnolen: I made a ClojureScript Ejecta XCode project template, write native iOS games with Lisp & CSP today https://github.com/swannodette/Ejecta

20:59 cheers

21:00 bbloom: neat

21:00 sinistersnare: dnolen: i suppose you mean clojurescript, not necessarily Lisp?

21:00 bbloom: surely garbage collection will murder your perf and battery life

21:00 but hey, fuck javascript!

21:00 :-)

21:01 sinistersnare: justin_smith: thats so complicated D:

21:02 justin_smith: maybe overengineered (thinking like I am writing a library not an app)

21:02 you could just have run start by doing (reset! resource (get-resource)) and and by calling (cleanup @resource)

21:02 and handle the creation and disposal in get-resource and cleanup

21:04 sinistersnare: ok i need to think more and harder

21:05 justin_smith: https://www.refheap.com/17372/edit simplified

21:06 sinistersnare: ok let me try and implement it

21:06 may take a few minutes due to brain exhaustion

21:08 callen: technomancy: https://github.com/mxcl/homebrew/pull/21733 please speak up.

21:08 dnolen: you too ^^

21:08 sinistersnare: im so glad i have a friend on facebook i can talk to and do some good rubber duck debugging, because now it makes more sense. https://en.wikipedia.org/wiki/Rubber_duck_debugging

21:09 Raynes: callen: Dude doesn't know when to quit.

21:09 callen: Raynes: at all.

21:09 sinistersnare: but my question is: why do you use an atom? i understand, its like a wrapper around an immutable object, but im not sure what its use particularly is. maybe ill reread the article on it on clojure.org

21:10 ok

21:10 so for every thing i need to do (.dispose nativeObject) i need an atom for?

21:10 danielszmulewicz: dnolen: Hi, do you have a comment regarding whether or not the quick start guide for clojurescript should be made available as a homebrew formula? Ther's a discussion going on here: https://github.com/mxcl/homebrew/pull/21733

21:11 callen: danielszmulewicz: I already asked him to comment.

21:12 danielszmulewicz: callen: good

21:12 sinistersnare: justin_smith: ^

21:12 callen: danielszmulewicz: I think you'll find the sentiment here is against continuing to enable pathologically broken installations.

21:12 danielszmulewicz: which confuse new users and mislead them as to how to use Clojure.

21:13 danielszmulewicz: callen: clojure should be removed. I agree with that.

21:13 justin_smith: sinistersnare: the reason is because you should not do resource allocation at code reading time

21:13 callen: danielszmulewicz: then please say so in that thread. that wasn't clear from the comment.

21:13 justin_smith: so a top level def is not a good idea

21:13 danielszmulewicz: I did

21:13 I edited

21:13 justin_smith: an atom allows setting that up when you start the app running

21:13 *direct top level def

21:13 of course the atom is a def

21:13 sinistersnare: so its like how in java you declare methods, and instantiate them in the constructor?

21:14 (im a java guy...)

21:14 justin_smith: its like creating an array at compile time, and putting something in it at run time

21:14 sinistersnare: ok cool

21:15 so i need an atom for every resource?

21:15 justin_smith: you could use one to store them all if you get them all at once

21:15 like I was showing you before with the hashmap literal

21:15 {:font (BitMapFont.) :sprites (Sprite.)} or whatever

21:16 then you can get the things out and dispose them later

21:16 sinistersnare: ok great

21:16 that sounds good

21:16 :D

21:19 danielszmulewicz: callen: regarding last comment, please enlighten me. I have a directory with a single clojure source file, no project.clj. How do I compile it to js with lein alone?

21:21 Raynes: I'm not actually sure what callen meant there either, though I think it's a non-issue.

21:21 It would be trivial to add another subtask to lein-cljsbuild to invoke the compiler in a one off situation like you describe.

21:21 And if it doesn't already exist somebody should add it.

21:22 callen: instead of enabling broke-as-hell use patterns.

21:22 Raynes: After that, it's a trivial matter of adding lein-cljsbuild to your :user profile and wah-lah.

21:22 danielszmulewicz: Please stay on topic

21:22 I'm not talking about easing in new users into clojurescript

21:23 callen: danielszmulewicz: then you've seriously misapprehended what Homebrew cares about.

21:23 it's not a dumping ground for experienced users' convenience.

21:23 Raynes: I don't think I wandered off topic. Did you direct that at callen?

21:23 callen: Raynes: I don't think I was off-topic either.

21:23 danielszmulewicz: Well, I'll be happy to hear that from homebrew folks

21:23 callen: danielszmulewicz: read the thread, lol.

21:24 they care about users, especially ones operating with less than an abundance of information.

21:24 Raynes: I mean, I'm leaving the thread alone. I'm obviously not enough of a big shot ClojureScript guy to have an opinion on the matter, so *shrug*.

21:24 callen: I think that's rational, myself, and I'm trying to help them accomplish that with the benefit of some domain expertise.

21:24 Raynes: I know when I'm beat. :)

21:24 danielszmulewicz: Homebrew doesn't discriminate between users. It's a package manager for christ sake, not udemy

21:24 justin_smith: sinistersnare: hey, I think this is actually the best way to do it given the code you have: https://gist.github.com/noisesmith/6180538 (I forked your gist)

21:24 callen: danielszmulewicz: you always gotta pick your priorities/primary use-case.

21:24 package managers are definitionally not for experts.

21:25 experts don't need package managers to build things from source.

21:25 danielszmulewicz: you must've missed the boat on that one.

21:25 well now you know.

21:25 homebrew is principally about ease of use on the Mac.

21:25 justin_smith: sinistersnare: with what I posed, screen gets its resources automatically, then you just need to call its dispose when you are done with the screen

21:26 callen: because macports and Fink were *awful*.

21:26 Raynes: Here's what I see: "Hmm, I want to play with <insert ClojureScript library here>! brew install clojurescript. Wait… Wtf… Now what? Better go to #clojure and bitch for 30 minutes while I refuse to install leiningen because this exists and obviously must be The Right Way, and then I need to write a blog post about how bad Clojure is and how terrible the community is."

21:26 sinistersnare: justin_smith: it just dawned on me that that works, because the let form works for all of the Screen

21:26 Raynes: danielszmulewicz: ^

21:26 That's my opinion, plain and simple, and I'll leave it at that.

21:27 sinistersnare: WOOOHOOOO GIANT ERROR!

21:28 justin_smith: sinistersnare: congratulations?

21:28 sinistersnare: i dont think its with that code though

21:28 damn :(

21:28 danielszmulewicz: Raynes: This is why we display caveats, and I propose to rename the formula to clojurescript-compiler

21:28 sinistersnare: it says theres something wrong at (5:22) of this https://www.refheap.com/17373 which seems to bee the (clojure.gdx.MyGame.) call

21:29 callen: danielszmulewicz: won't change anything, they'll brew search clojurescript

21:29 they'll still think it's authoritative despite the caveats.

21:32 sinistersnare: i think it has a problem with generating the class, is there something wrong with this file? https://www.refheap.com/17374

21:33 fowlslegs: Hello!

21:34 (#(assoc %1 %2 0) {} [:a :b :c]) ;=> {[:a :b :c] 0}

21:34 justin_smith: sinistersnare: I have no experience with gen-class, maybe someone else here can help

21:34 fowlslegs: but

21:34 justin_smith: sinistersnare: but I would suggest trying to create an instance of the class in the repl

21:34 sinistersnare: ok, it worked before; im not sure what ive done D:

21:34 ok

21:34 justin_smith: narrow down your usage, find the simplest thing that makes an error happen

21:34 fowlslegs: ([:a :b :c] {[:a :b :c] 0}) ;=> IllegalArgumentException Key must be integer clojure.lang.APersistentVector.invoke (APersistentVector.java:265)

21:35 justin_smith: fowlslegs: that is trying to call the vector

21:35 what you want is to call the map

21:35 reverse the args

21:35 fowlslegs: Isn't it a vector of keys that all point to the same keyval?

21:35 Foxboron: First clojure lib shipped, woop :3

21:35 justin_smith: vectors only take number as args

21:35 ,([:a :b :c] 1)

21:36 clojurebot: :b

21:36 metellus: fowlslegs: the vector itself is the key in the map

21:36 justin_smith: fowlslegs: map lookup does not work that way

21:36 fowlslegs: Okay metellus that makes sense.

21:37 justin_smith: ,({[:a :b :c] 0} [:a :b :c])

21:37 clojurebot: 0

21:37 justin_smith: [:a :b :c] is not a list of keys, it is the key

21:37 fowlslegs: Then how do I make Clojure recognize that I am talking about the key [:a :b :c] and not the vector [:a :b :c]?

21:37 metellus: and in your original (#(assoc %1 %2 0) {} [:a :b :c]), %1 is the vector [:a :b :c] and %2 is nothing

21:37 justin_smith: what I showed above

21:37 fowlslegs: Oh thanks justin

21:37 justin_smith: or you could explicitly use get

21:38 fowlslegs: Yes you could

21:38 Danke everyone

21:59 TakeV: Is there any case when a precondition for a function under {:pre [(test? x)]} doesn't work?

22:02 gtrak: TakeV: does this answer your question? https://gist.github.com/gtrak/6180725

22:05 TakeV: gtrak: Not really. The problem is that my preconditions were working, and then for no apparently reason my unit tests just started failing. They weren't getting the exception thrown to them in the cases I set up to fail the preconditions.

22:06 gtrak: hmm, it's an AssertionError, firstly, not an Exception

22:07 TakeV: gtrak: My apologies.

22:07 gtrak: so maybe your tests are catching the wrong thing

22:07 ?

22:08 TakeV: gtrak: No, I'm catching an AssertionError. Let me paste the code.

22:09 gtrak: http://pastebin.com/jGTFWreE

22:11 bbloom: ambrosebs: i might actually use core.typed if there was a lein plugin to check a directory of type annotations just like i normally run unit tests

22:11 gtrak: I get the assertion error

22:11 bbloom: lein test => lein unit + lein type

22:11 gtrak: oh wait, I'm getting another exception first

22:12 ambrosebs: bbloom: is (is (check-ns 'my-ns)) too hard? ;)

22:13 bbloom: ambrosebs: yes, i want type "discovery" just like how lein searches for tests :-)

22:13 ambrosebs: bbloom: fair enough. Sounds boring to write though :)

22:14 TakeV: gtrak: Yeah, for some reason I feel like it's skipping the preconditions.

22:14 gtrak: it's running them, but they're both returning true

22:14 bbloom: ambrosebs: surely somebody around here enjoys that sort of stuff

22:14 gtrak: I can see it with the dbg macro

22:14 bbloom: ambrosebs: but the boring stuff is what drives adoption. ask technomancy

22:14 clojurebot: Roger.

22:15 gtrak: oh wait..

22:15 ambrosebs: bbloom: I'll make a discover-typed-namespaces function and then hopefully someone will plug it in.

22:16 bbloom: ambrosebs: heh :-) i just want to have a type/ directory next to my src/ and test/ directories

22:16 gtrak: doh :-)

22:16 ambrosebs: bbloom: ah.

22:17 gtrak: TakeV: flip the order of the docstring and precondition :-)

22:17 that'll teach you to use docstrings

22:17 ambrosebs: bbloom: you could just add it to the classpath no?

22:19 TakeV: gtrak: Oh man, that is a silly error. Thanks for the help. :)

22:19 gtrak: no probs

22:19 TakeV: (Also the official docs need to be updated, because they say to use doc strings first... >_>)

22:19 bbloom: ambrosebs: i realize that this is totally doable and relatively straightforward. but realize i often don't bother writing unit tests either. this is a plea for brain dead nice-to-haves that guide behavior. sometimes i copy paste my bottom-of-file tests into real unit tests when i release projects. if the lein project template had a type/ directory, i might put a type hint or two in there and run the type checker

22:20 ambrosebs: even better if i got 90% of the checking done via inference

22:21 ambrosebs: bbloom: sounds pretty optimistic :). core.typed needs a lot of handholding. You can put the annotations where you like though.

22:22 bbloom: ambrosebs: if i keep asking for impossible things, maybe some of them will become real :-)

22:22 ambrosebs: bbloom: true!

22:24 bbloom: core.typed may never be satisfying enough for someone of your ... patience

22:25 :)

22:25 bbloom: ambrosebs: many adjectives have been used to describe me. patient was never one of them.

22:25 ambrosebs: bbloom: haha

22:25 bbloom: dammit future. hurry up and get here!

22:27 ambrosebs: bbloom: I hope someone gets so pissed off with core.typed being so picky that they implement inference :)

22:27 gtrak: bbloom wants newer shinier things to complain about :-)

22:29 ambrosebs: bbloom: the unfortunately reality is you'd be putting a type annotation or 20 in type/

22:29 bbloom: ambrosebs: is inference particularly hard for clojure?

22:30 ambrosebs: i'd imagine that if you only cared "oh, this is a map" rather than "this has keys :x and :y", then inference would be pretty standard, no?

22:32 ambrosebs: bbloom: yes. Your probably wishing for a slightly different tool to core.typed.

22:32 bbloom: core.typed wants to be uncompromisingly precise.

22:32 brehaut: in contrast to javascript which is compromisingly imprecise

22:33 ambrosebs: bbloom: tools like Dialyzer for Erlang look kind of like inference but only give errors when things *always* go wrong. core.typed fails on "maybes".

22:33 bbloom: ambrosebs: playing devils advocate. isn't uncompromisingly precise equivalent to running the code? ;-)

22:34 ambrosebs: bbloom: I'll rephrase. I want it to be able to check interesting properties, so it needs to be unforgiving.

22:34 bbloom: ambrosebs: ah ok

22:35 ambrosebs: bbloom: that also means annotations.

22:35 bbloom: ambrosebs: i really want a few "levels" of type checking, just like i want a few levels of testing. i don't just have unit tests. sometimes i have integration tests or load tests or whatever

22:36 ambrosebs: bbloom: Yes, me too. It's a different tool though, core.typed can't have knobs like that.

22:36 bbloom: ambrosebs: the compiler does some kinda low level type *safety* checking & then i want to get fully inferred type "correctness" checking & only then move on to proving more interesting properties, like program correctness :-)

22:36 and, just as with testing, if i go after higher level tests like integration tests, i kinda have to assume the units are tested.

22:37 if i get fully inferred types, that's basically akin to low test coverage :-)

22:41 ambrosebs: bbloom: when you say inference, are you assuming the types will be inaccurate at that point, compared to the program correctness checking?

22:41 bbloom: because that sounds more feasible.

22:42 bbloom: ambrosebs: in theory, some level of type checking could happen with ZERO annotations going off the primitives & some annotations from core and libs and stuff. that type checking is of low value, since the type inferencer is a constraint solver TRYING to succeed. but that doesn't mean that's not useful to prove that the code at least MIGHT make some sense from a types perspective

22:43 ambrosebs: but if i find a bug, i might add like ONE type annotation to prove my understanding of the bug & act as a regression protection. then suddenly the inferenced types are marginally more valuable

22:46 ambrosebs: bbloom: I'm in my own little world in fully annotated land, so I'm struggling to see how that would look.

22:46 bbloom: I'm just seeing a sea of type errors and warnings

22:47 :)

22:49 bbloom: ambrosebs: on a purely "marketing" note. you're likely to get some more co-contributors if you can provide value to projects w/o them having to fully-annotate everything :-)

22:50 sinistersnare: hey guys, im getting an EOF while reading error, does anyone think they can help me with this code? https://gist.github.com/sinistersnare/44e3e50bcec04237c700

22:50 ambrosebs: bbloom: yes. that's the trick isn't it.

22:51 sinistersnare: compiling:(cljdx/core.clj:7:1)

22:51 is where it says it is

22:51 brehaut: sinistersnare: you have an extra ) at the end of the ns form for drop?

22:51 ambrosebs: bbloom: the Typed Racket ancestry makes it difficult :)

22:51 bbloom: blame samth

22:51 sinistersnare: woohoo another error

22:52 brehaut: sinistersnare: but you are missing one at the end of cljdx.core's ns

22:53 sinistersnare: =\ sometimes this IDE is weird, heres the error too https://gist.github.com/sinistersnare/44e3e50bcec04237c700

22:53 in that

22:53 brehaut: sinistersnare: unexpected EOF while reading in clojure typically means you've missed a closing paren

22:53 sinistersnare: oh that makes sense :D

22:53 woohoo another error!

22:53 :p

22:53 brehaut: sinistersnare: the error tells you the last form it started reading too

22:53 "starting at line 1," of core.clj

22:54 sinistersnare: ClassNotFoundException with drop, this is where i knew there was one, because i have no idea how to do classes in clojure

22:54 brehaut: sinistersnare: gen-class is kinda weird and requires AOT compilation i believe

22:54 sinistersnare: im trying to build it

22:54 when i hit the "build" button in the IDE, it gives me this

22:55 brehaut: sinistersnare: i believe you need a gen-class property in the namespace, as well as something in the lein project

22:55 sinistersnare: oh ok

22:55 i tried to find documentation, but i was having trouble

22:55 brehaut: apparently so

22:56 its a dark corner of clojure

22:56 sinistersnare: yep

22:56 im just trying to do a java framework interop :D

22:56 brehaut: apparently

22:58 zRecursive: ,(doc ->>)

22:58 clojurebot: "([x form] [x form & more]); Threads the expr through the forms. Inserts x as the last item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the last item in second form, etc."

22:58 brehaut: sinistersnare: is com.badlogic.gdx.Game a class or interface?

22:58 sinistersnare: Abstract Class

22:58 Screen is an interface

22:59 but you can see that with the proxy form i guess

23:00 brehaut: sure. i think you can reify interfaces btw

23:02 sinistersnare: how?

23:02 clojurebot: with style and grace

23:02 sinistersnare: LOL

23:02 brehaut: ~botsnack

23:02 sinistersnare: sometimes clojurebot brings some good points to the table

23:02 clojurebot: botsnack is scoobysnack

23:02 brehaut: http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/reify

23:05 sinistersnare: http://clojure.org/compilation http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/ns http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/gen-class i think thats the relevant documentation

23:05 sinistersnare: jesus

23:06 brehaut: nobody said it was friendly documentation

23:06 sinistersnare: true i guess

23:06 brehaut: you can skip the 'compile step with lein i think

23:06 sinistersnare: im using lein, but im still a little...idk

23:06 brehaut: you just need to put the relevant classes into :aot

23:06 sinistersnare: this was supposed to be a short project :p

23:06 brehaut: ha

23:06 sinistersnare: oh really? that makes sense

23:06 brehaut: err 'class' i mean namespace

23:06 sinistersnare: DAMNIT

23:07 java.io.FileNotFoundException D: this is some error filled code

23:07 brehaut: you have cljdx.core, and you want cljdx.drop i believe

23:08 sinistersnare: in :aot i have cljdx.drop now

23:08 that got rid of the ClassNotFoundException

23:09 now its the FileNotFound, cant find myscreen.clj on classpath

23:09 brehaut: and you've shifted your get-class to the ns form?

23:09 (and keywordized it?)

23:09 sinistersnare: yes, ill update the gist

23:10 https://gist.github.com/sinistersnare/44e3e50bcec04237c700 tjjis should work

23:10 this* what did i type

23:11 brehaut: sinistersnare: you need to move all the specifics from your (get-class up into the (:gen-class )

23:11 zenoli: Hmm...where did ceil and its ilk from the old clojure.contrib.math end up? Do I really have to use java.lang.Math/ceil?

23:13 sinistersnare: ok, but i still get the filenotfound

23:13 because i think that has something to do with it not seeing myscreen.clj on the classpath

23:14 brehaut: i have no idea sorry

23:14 i played with gen-class about 4 years ago, and havent needed or wanted to since

23:14 sinistersnare: its ok

23:14 i understand!

23:15 zRecursive: ,(+ 9.575 0.005)

23:15 clojurebot: 9.58

23:16 sinistersnare: thats some good math

23:16 zRecursive: ,(printf "%.2f" 9.575)

23:16 clojurebot: 9.58

23:17 zRecursive: great ! in C, it outputs 9.57

23:18 then Clojure doesnot use IEEE 754 resentation for float ?

23:21 (format t "~$~%" 9.575) => 9.57 in Common Lisp

23:23 futile: wat

23:23 johnmn3: evening

23:23 futile: morning

23:24 zRecursive: in fact 9.58 is what need :)

23:24 johnmn3: a long time ago, while learning clojurescript, I had a hard time working with the asynchrony while trying to get bytes from a file: https://www.refheap.com/12580/raw

23:24 wondering if the new core.async will allow me to get around that problem

23:24 and both set the callback and... call back in the same function

23:25 brehaut: zRecursive: clojure uses's javas doubles for its floats which im pretty certain are IEEE doubles

23:26 johnmn3: correction... I'm not setting a callback in that example

23:27 zRecursive: brehaut: even if using double, CL still returns 9.57: (format t "~$~%" 9.575d0) => 9.57 ...

23:27 brehaut: wait, since when has string formatting being an internal representation?

23:27 johnmn3: using callbacks is what I had to resort to to get it to work... But I'd wished it would just work like I'd written it, as that is how my brain thought about it in clojure

23:32 brehaut: zRecursive: http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#syntax for all the specific details about formating strings

23:38 zRecursive: brehaut: thx

23:51 callen: Clojure is no longer in Homebrew.

23:51 sinistersnare: is that bad?

23:52 callen: no, it's good.

23:52 people should be using Leiningen.

23:52 sinistersnare: is leiningen in homebrew?

23:52 callen: of course.

23:53 bbloom: seems like an alias from clojure -> leiningen would be nice

23:54 callen: bbloom: we decided against that.

23:54 for very good reasons.

23:54 if you attempt to install clojure from homebrew, it will tell you to use Leiningen and why.

23:54 bbloom: oh, that counts as an alias in my book

23:55 callen: sadly alias has a specific meaning in Homebrew-landia.

23:55 TEttinger: sinistersnare! I was just using libGDX! kinda

23:55 callen: what we did was a removel + blacklist + documentation update.

23:55 sinistersnare: TEttinger: with clojure? how?

23:55 i have it ok working, but idk

23:55 actually i dont...

23:55 TEttinger: no, actually I just got it as a maven dep

23:56 because libgdx was a dep of a java lib I needed

23:56 sinistersnare, if your problem was with leiningen and libgdx, I think I could help

23:57 otherwise, probably not

23:57 sinistersnare: i got the building workin

23:57 TEttinger: I only needed the non-GDX parts of "SquidLib"

23:58 sinistersnare: now i just need to get my knowledge of clojure working!

23:59 instead of using a local repo, this is my project.clj, it uses libgdx.badlogicgames.com maven repo

23:59 coventry: How can I determine where value-types is defined in <https://github.com/pedestal/pedestal/blob/master/app/src/io/pedestal/app/dataflow.clj>? Any why does entering the io.pedestal.app.dataflow ns in the repl not give me a value-types function?

23:59 sinistersnare: https://www.refheap.com/17377

Logging service provided by n01se.net