#clojure logs

2014-11-18

00:03fairuz1Ok, seems I'm getting a hang of the piece of code you gave just now :)
00:09fairuz1justin_smith: this is difficult stuff :)
04:01zarkonehello all! Please, give me aquick explanation or link why " cond requires an even number of forms"
04:02andyfzarkone: Because it is always (cond <test1> <result1> <test2> <result2> ...)
04:02andyfevery test must have a corresponding result
04:02zarkoneandyf: oh, seeems like i write clauses wrong, thanks!
04:02justin_smithzarkone: for a default form, you can provide a truthy test
04:03justin_smith,(cond false 0 nil 1 :default 2)
04:03clojurebot2
04:03justin_smith,(cond false 0 nil 1 :foo 2)
04:03clojurebot2
04:03justin_smithanything works there, but :default is considered standard
04:04zarkonethanks all, im stupid, should look at docs next time. I just wrote it like in CL
04:04andyfjustin_smith: I think :else is somewhat more common than :default, but I've seen both used, and even true
04:04justin_smithzarkone: it took me a long time to stop trying to write CL style let :)
04:04justin_smithandyf: definitely
04:05andyfzarkone: clojuredocs.org is pretty decent for examples, in addition to the built-in doc strings.
04:05justin_smith,(cond false 0 nil 1 0 2) ; if you want to mess with the C programmers
04:05clojurebot2
04:06zarkoneandyf: thanks, i use docstring in emacs like C-c C-d d, very convinient. Like other things in CIDER
04:16justin_smith,(cond false 0 nil 1 () 2) ; if you want to mess with the lispers
04:16clojurebot2
04:32rurumate,(quote 'a)
04:32clojurebot(quote a)
04:32rurumate,(#(quote %) 'a)
04:32clojurebotp1__49#
04:33rurumate,(quote 'a)
04:33clojurebot(quote a)
04:34rurumateuhm
04:34rurumatewhat seems to be the problem here?
04:34rurumate,(quote 'a)
04:34clojurebot(quote a)
04:34justin_smithwhat's the problem? that's what quote does
04:34justin_smith,''a
04:34clojurebot(quote a)
04:34rurumatethat returns a in my repl, not (quote a)
04:34andyfquote is a special form, not a function
04:35justin_smith,(quote a)
04:35clojurebota
04:35hyPiRion,'#(quote %)
04:35clojurebot(fn* [p1__172#] (quote p1__172#))
04:40rurumate,''a
04:40clojurebot(quote a)
04:41clgvrurumate: one quote is "completed" during `eval`
04:42rurumate,'''a
04:42clojurebot(quote (quote a))
04:42clgv(eval (quote x)) -> x
04:43clgvfor all x ;)
04:44clgvrurumate: do you want a function that returns quoted forms?
04:44clgv,((fn [x] `(quote ~x)) 'b)
04:44clojurebot(quote b)
04:46fairuz1hey justin_smith. Just want to say thanks. I think I make it work. :)
04:46justin_smithvery cool
04:51fairuz1indeed
04:53rurumateclgv: splendid, thanks!
04:54clgvrurumate: that one is tricky. I think I rediscovered it at least twice in the last two years ;)
05:02dysfuni'm having a very bizarre error. wrap-session is causing a nullpointerexception to be thrown. commenting it out works fine, trying it in the repl, it appears to do the right thing. any ideas?
05:03justin_smithdysfun: do you have a cookie from the same host, but a different app, such that different keys are stored in the cookie?
05:03dysfunno
05:04justin_smithI have run into that one before... really weird bug
05:04justin_smith(ie. the app only breaks on one guy's browser...)
05:05dysfunonly cookies are ones i'm expecting to see
05:05justin_smithwith the expected contents?
05:05dysfunthere's only one related to ring, csrftoken
05:06dysfunthe session isn't being set, so there's no session cookie at all
05:06justin_smithwhat specific call or operation in wrap-session is getting the npe?
05:07dysfunheh, you don't think it gave me any such useful information do you?
05:07justin_smithso the stack stopped at wrap-session?
05:08dysfunit appears to come from the preceding middleware, keyword-params
05:09dysfunwrap-session is invoked thus : (wrap-session f {:store (cookie-store)})
05:11dysfunfrom the missing stacktrace line, it sounds like wrap-session is returning nil, effectively
05:11justin_smithdysfun: there are libs (including groundhog, which I wrote) that can serialize a ring request to a data literal, such that you can load or inline the data literal in a unit test, and narrow down which middleware is breaking (and sometimes, which parts of the request make it break)
05:12dysfunooh, groundhog looks nice
05:13dysfuni have some interesting ideas for using that for some other things
05:13justin_smithI've found it useful for narrowing down issues in ring handlers / middleware
05:31dysfunjustin_smith: so i've wrapped groundhog, and i still get my NPE. and no useful output?
05:32dysfunthose have presumably been stored somewhere?
05:32justin_smithdysfun: the idea is that with the serialized request you have a few options: write unit tests that run that request against your handler (the ring server need not be running) or modify and replay until you figure out the minimal cause of the error
05:33rurumate,(type (quote []))
05:33clojurebotclojure.lang.PersistentVector
05:34rurumate,(type (quote '[]))
05:34clojurebotclojure.lang.PersistentList
05:34rurumatehow does that become a list?
05:34justin_smith,(quote '[])
05:34clojurebot(quote [])
05:34justin_smiththat's a list
05:35hyPiRionlist with the symbol quote and the vector []
05:35rurumate,(first (quote '[]))
05:35clojurebotquote
05:35rurumate,(first (quote []))
05:35clojurebotnil
05:36dysfun,(= ''[] '(quote []))
05:36clojurebottrue
05:37rurumate(= '(quote []) (quote '[]))
05:37rurumate,(= '(quote []) (quote '[]))
05:37clojurebottrue
05:37dysfun' is a reader macro that is expanded into (quote )
05:38clgv,(read-string "'[]")
05:38clojurebot(quote [])
05:38dysfuni'd like to see some sort of source mapping in metadata for the reader one day
05:46clgvdysfun: what is that supposed to mean?
05:46clgvdysfun: there is :line and :col metadata for lists in clojure
05:47clgvsadly not for the other literals...
05:48dysfunno, i'd like to map reader macro expansion back to original syntax
05:49dysfunso you'd be able to distinguish for example between (quote ...) and '
05:49dysfuni'd also like to track it for "real" macro expansion
05:49dysfunbut it's nontrivial and i haven't thought of a good enough use case for it yet to tempt me
05:51clgvdysfun: ah ok. sounds interesting for macro expansion
05:51clgvdysfun: I have an algorithm DSL were it would be really handy
05:52dysfun*nod*
05:52dysfunthere are some interesting things i think you can do, but not interesting enough to warrant the time investment. yet.
05:54clgvdysfun: yeah, if you do not need it often, it's probably not worth investing time in it
05:55dysfunbut i might come up with a really cool use case and do it at some point
05:55dysfuni also need to go play with that llvm clojure-alike i saw on twitter yesterday
06:00RobT-Have you seen these resources yet? clojure.zeef.com
06:05engblomI'm able to write macros but not able to detect situations where a macro would do things easier than writing several functions. What material do you recommend for me to read?
06:06justin_smithengblom: macros are for syntax
06:07justin_smithuse them when you need to create a syntax
06:07justin_smithfor example if there is something you frequently do in your code, that is clumsy to express
06:08justin_smithlook at what the major macros in clojure are: defn, let, for, loop
06:08engblomjustin_smith: Thanks
06:28dysfunjustin_smith: the ring-session thingy was actually my mistake. amusingly i'd forgotten a paren and so it was doing a hash lookup -> nil -> NPE
06:28justin_smithnice
06:30dysfuntimes like these i wonder if paredit might help
06:34justin_smithit does
06:34justin_smithas do rainbo parens
06:34justin_smith*rainbow
06:36dysfuni use rainbow-parens
06:36BronsaI could never use rainbow parens
06:36dysfun$flatmate has suggested whitespace-mode might help if configured better
06:37dysfuner show-paren-mode even, you can change backgrounds of sexps apparently
06:37BronsaOTOH I love show-paren
06:37Bronsajinx
06:40clgvdysfun: which?
06:41clgvengblom: when you want efficient calculations with longs and floats in a reduce-like syntax, you'll need a macro
06:41clgvengblom: efficient in the sense that you need to keep unboxed floats and longs
06:44clgvs/floats/doubles ;)
06:44engblomclgv: Could you give a short example of what you mean?
06:46clgvengblom: there is no way to use reduce to calculate more than one long/double result value without boxing
06:47clgvengblom: a general example are statistic values aggregate over a collection of entities
06:49dysfunclgv: the idea is that you can change the background colour of the entire paren-delimited sexp based on nesting level
06:50clgvdysfun: damn, I should have added context - I meant the llvm clojure-alike (didnt see that you wrote sth else after that)
07:00dysfunclgv: there's more than one?
07:01dysfuni just saw it go by on twitter, had a look at the github page. let me see if i can find it
07:02clgvno, but I am not on twitter - I don't know how easy it is to find the correct one ;)
07:02dysfunrhine
07:02dysfunhttps://github.com/artagnon/rhine
07:02clgvhmm "clojure-inspired" - let's remove the "-inspired" ;)
07:03dysfunon the face of it, it looks like clojure
07:03dysfunbut the reason it piqued my interest is i have an interest in getting clojure working on llvm
07:03dysfunand frankly vmkit is unlikely to happen now. would be awesome if it did though
07:04clgv"vmkit" is the oracle project?
07:04dysfunno, vmkit is the jvm/clr-on-llvm project
07:04dysfuni did think about taking it over, but it's starting to look like real work
07:04clgvis that just a nickname you gave it?
07:04dysfunno, it's called vmkit
07:05dysfunhttp://llvm.org/viewvc/llvm-project/vmkit/
07:05dysfunhttp://vmkit.llvm.org/
07:06dysfunit's abandoned (hence my talk of possibly resurrecting it)
07:06clgvthose other language/vm projects (not jvm, clr and js) always lost their devs. would be awesome if one of the llvm approaches is continually developed
07:06dysfunbut i have way too much stuff on to do something like that. i think clojure on llvm might be much easier
07:06dysfunhaha. i tried to port perl to the jvm back in the day
07:06dysfunthat was fun for a while
07:07clgvwith efficient C/C++ interop there'd be no reason to start a project in C/C++ anymore ;)
07:08dysfunquite
07:08dysfunand it's an interesting project. if it's not too tedious it might even keep my attention
07:08justin_smithclgv: with efficient C/C++ interop we'd lose a bunch of the guarantees that make clojure nice to use, wouldn't we?
07:09dysfunjustin_smith: not necessarily. you can model a lot of it in terms of clojure things, like a derefable
07:09clgvjustin_smith: well you use a lot of guarantees with java interop as well ;)
07:09justin_smithclgv: fair point on that if by use you mean lose
07:10clgvjustin_smith: oops right
07:10justin_smithrhyming typos are a bane for me as well
07:10clgvis that a general thing for non-native speakers?
07:10justin_smithI'm a native speaker, and I do it all the time
07:10dysfunwords that noone is quite sure how to spell are a good one
07:11clgvoh ok. well then probably not ;)
07:11clgvjustin_smith: I did not notice that in my mother tongue so far...
07:11dysfun$previous_client had a 'remuneration' table that annoyed a few of the developers rather too much
07:11clgv:D
07:11justin_smithhaha
07:12dysfuner, 'renumeration'. see, my brain automatically corrected it
07:12clgv?
07:12justin_smithoh, I thought you meant the problem was that the var was misspelled - that's even worse
07:12justin_smithwhen a misspelling becomes canonical in the codebase...
07:12dysfunyeah
07:12dysfunand it was, because database classes were generated from the db schema
07:13dysfunand you'd constantly mistype them. handily the codebase was in perl so you'd at least get a compile time error because strict;
07:14clgv"real perl hackers don't use strict" :P
07:14dysfunin that case, i've worked with a few "real perl hackers"
07:14dysfun(sadly)
07:15dysfunbut less perl hate please.
07:15clgvI have seen those hashsums which were supposed to be programs from fellow students ;)
07:16dysfunyes. it's never taught properly. on the other hand, i've had quite a lot of joy programming modern perl in the last few years and have produced clean and elegant code
07:16dysfunthe reputation is ill-deserved and it's because back in the day it was the only option unless you were insane and so it caught the idiots that now plague php because php wasn't popular
07:17clgvit wasn't taught at all at university. they just learned it on there own and found "non-strict" perl that good to use it in most of the exercises ;)
07:17dysfunMatt's Script Archive was a bugger for that. to the point that one of the london perl mongers rewrote all of them in cleaner perl that actually understood basic security
07:18dysfunit was still ugly old style perl, but at least they weren't hurrendously insecure
07:22clgvdysfun: I only used perl once since they had a nice webpage crawler library
07:29dysfunWWW::Mechanize? Yes, I'm very fond of it
07:29dysfunbut i found it really hard after programming mostly clojure for 3 months to go back to dealing with mutable data
07:30dysfuneven though my perl is tinged with lots of functional idiom anyway
07:31dysfuni'd love to see what advice rich hickey would give the perl 5 porters if asked about how to improve perl as a language
07:31Ember-I know the answer
07:32Ember-"dump mutability, embrace immutability"
07:32dysfunyou'd be surprised how little you actually use mutability in perl
07:32dysfunquite a lot of things tend to be chaining of lists through function calls
07:33Ember-you can do that in every language :)
07:33Ember-more or less
07:33dysfunand yes, we did sort of implement a macro system for perl. and yes i know it's a silly complicated language
07:33Ember-hehe
07:34dysfunthere are even battle tested libraries using it to transform code into something resembling more familiar syntax
07:34dysfunimplementing try/catch for example
07:34dysfun(although Try::Tiny fakes it well enough, except that return() behaves wrongly
07:35clgvyes mechanize sounds about right. nowadays, I'd just use Clojure for that task
07:35dysfuni haven't found a DOM manipulation library that i like
07:35dysfunand there's a Mechanize wrapper that uses HTML::Tree which has a quite nice interface, so i'd use perl
07:40dysfuni'm a little confused about how compojure works. I see in all the examples (which i've been liberally copying and pasting from) that they setup routes like so: http://paste.scsys.co.uk/443138 . But i'm not sure of the flow order
07:40dysfuni see that route/not-found is just a simple function call?
07:40dysfunhow does that work? does the previous entry return nil if it doesn't match or something?
07:41dysfunor is it doing wrapping magic?
07:41weavejesterdysfun: There should be an explanation on the Compojure wiki
07:41dysfunif there is, i haven't found it :(
07:43weavejesterdysfun: The “routes in detail” section should explain it, but perhaps it isn’t clear enough…
07:43weavejesterdysfun: Essentially routes are handler functions that can return nil
07:43weavejesterdysfun: The `routes` function tries each handler function in order until it gets a non-nil response
07:44dysfunaha. brilliant, thanks.
07:44Ember-simple and brilliant
07:44dysfunshall i update the wiki?
07:44Ember-makes many things so easy
07:47weavejesterdysfun: If you like. The “routes in detail” page does mention that routes return nil or a response, but the information is spread across the page, and there’s no mention of what the compojure.core/routes function does.
07:47weavejesterdysfun: So maybe an extra paragraph at the beginning would work
07:47dysfunyeah, i didn't link them when i read it
07:49weavejesterRe-reading that page again, it could be a lot clearer on the overview about how Compojure uses routes.
07:50dysfuni'm editing now
07:51clgvreduce-kv works on arbitrary maps not only clojure hashmaps, right?
07:51weavejesterdysfun: I also wrote a blog entry on the design of routes: http://www.booleanknot.com/blog/2012/09/18/routing-in-compojure.html
07:53clgvhm no, it does not ...
07:53clgvyou have to extend the corresponding protocol
07:53edwping
08:03dysfunweavejester: https://github.com/weavejester/compojure/wiki/Routes-In-Detail ta-da!
08:04weavejesterdysfun: Thanks! I’ll tweak it a little though, as I’d prefer `routes` to be introduced first.
08:04dysfunof course. documentation is hard :)
08:05dysfunof course now i understand what's going on, i find i like compojure just that little bit more
08:09weavejesterdysfun: That’s a good sign :)
08:09dysfun:)
08:12H4nsis anyone aware of a clojure ftp+ssl client library? i have found miner.ftp, but that does not seem to support ssl right away.
08:18clgvH4ns: maybe you can inject javas SSLSockets via a factory
08:20H4nsclgv: sounds like something that is beyond my level of java expertise. i'll try using org.apache.commons.net.ftp.FTPSClient directly
08:24clgvH4ns: sounds reasonable as well. I have no idea how much that miner.ftp provides you anyway
08:25clgvH4ns: a pattern in java network programming is to have socket factory classes that construct the sockets to use - this way you can exchange a plain socket with ssl sockets for example
08:25H4nsclgv: it seems to rely on the java infrastructure to parse the url and then instantiates an FTPClient. It may not be too hard to change that so it can deal with ftps:// in addition to ftp://
08:26H4nsclgv: i'll have to understand how protocols are registered so that clojure.java.io/as-url understands them.
08:28justin_smith,(.getScheme (java.net.URI. "ftps://foo"))
08:28clojurebot"ftps"
08:29justin_smithdunno if that means much actually...
08:29justin_smith,(.getScheme (java.net.URI. "foo://foo"))
08:29clojurebot"foo"
08:29justin_smithyeah, probably doesn't mean much
08:29H4ns"MalformedURLException unknown protocol: ftps"
08:29clgv,(require '[clojure.java.io :as io])
08:29clojurebotnil
08:30clgv,(io/as-url "ftps://www.bla.com/lala.pdf")
08:30clojurebot#<MalformedURLException java.net.MalformedURLException: denied>
08:30justin_smith$source clojure.java.io/as-url
08:30lazybotSource not found.
08:30justin_smith:P
08:30clgvinteresting
08:30clgv,(io/as-url "ftp://www.bla.com/lala.pdf")
08:30clojurebot#<MalformedURLException java.net.MalformedURLException: denied>
08:31justin_smithhttps://github.com/clojure/clojure/blob/master/src/clj/clojure/java/io.clj#L35
08:31clgvso on to the javadocs of URL ;)
08:32justin_smith&(URL. "ftp://www.bla.com/lala.pdf")
08:32lazybotjava.lang.IllegalArgumentException: Unable to resolve classname: URL
08:32llasramJava URLs are explicitly resource "locators", which means there needs to be a (Java-)registered handler for the scheme which supports retrieval of a representation of the resource
08:32justin_smith&(java.net.URL. "ftp://www.bla.com/lala.pdf")
08:32lazybot⇒ #<URL ftp://www.bla.com/lala.pdf>
08:32llasramI thought
08:32TimMcj.n.URL and j.n.URI are the worst
08:32llasramURI is fine
08:32TimMceh
08:33soulman_hi
08:33justin_smithis it URL which can be side-effecting and unexpectedly load some network resource just in being created?
08:33llasramyes
08:34justin_smithI remember something like this that surprised and annoyed me
08:34justin_smithso why and what does it load exactly?
08:34TimMcllasram: OK, j.n.URL is clearly the worst; j.n.URI has some serious problems.
08:34llasramThey resolve the hostname to an IP address
08:34llasram(j.n.URLs do)
08:34justin_smithAHH
08:34llasramAnd use the IP address in the hash
08:34justin_smiththat's messed up
08:34llasramYeeees
08:35TimMcIf anyone wants to help hack on a URL library: https://github.com/brightcove/johnny
08:38TimMcjustin_smith: ##(= (java.net.URL. "http://www.example.net/&quot;) (java.net.URL. "http://www.example.com/&quot;))
08:38lazybot⇒ false
08:38tmarshany lighttable users know how to disable “remove trailing whitespace” on save?
08:38TimMchmmm
08:38TimMc&(= (java.net.URL. "http://example.net/&quot;) (java.net.URL. "http://example.com/&quot;))
08:38lazybot⇒ false
08:39llasramTimMc: Are those equal for you locally?
08:39jonathanjhow do things like Korma or Hyperion perform their queries? are they synchronous?
08:39jonathanjif i'm performing queries in a ring handler do i have to worry about blocking?
08:39justin_smithTimMc: returns true locally, oracle jdk 8
08:39justin_smith,(clojure-version)
08:39clojurebot"1.7.0-master-SNAPSHOT"
08:39TimMcllasram: I've had that (or .equals) return true.
08:40justin_smithllasram: can verify
08:40TimMcOh! lazybot is blocking the network lookup, I bet.
08:40justin_smithoh, yeah, sandbax magik
08:40TimMc,(.equals (java.net.URL. "http://example.net/&quot;) (java.net.URL. "http://example.com/&quot;))
08:40clojurebot#<MalformedURLException java.net.MalformedURLException: denied>
08:40llasramHeh
08:40kungiCan I prevent leiningen from running my test fixtures when I spcify a specific test-selector?
08:40TimMc,(.printStackTrace *e)
08:40clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching field found: printStackTrace for class clojure.lang.Var$Unbound>
08:40TimMc:-P
08:40kungiWhen I run lein test :unit it still runs the :once fixture from my integration tests
08:40justin_smithkungi: I bet you could, but I don't think it would be worth the effort it would take
08:41clgvTimMc: clojurebot is not a repl ;)
08:41TimMcnonsense :-)
08:41wiruzx(+ 2 2)
08:41clojurebot4
08:41wiruzxheh
08:42llasram`true` here too. That's actually even crazier behavior than I thought it had
08:42kungijustin_smith: my integration tests take a long time to start because they start a firefox with selenium stuff. So It would really make sense to exclude this fixture.
08:42justin_smithkungi: put them in a different namespace
08:43clgvkungi: isnt there selection by metadata?
08:43justin_smithclgv: that does not effect a :once fixture
08:43kungiclgv: Yes but only for the tests
08:43justin_smithclgv: that is just a fixture that decides which tests get called iirc
08:43clgvskip using the fixture and just explicitely wrap those test with robert.hooke?
08:44justin_smithI think putting unit tests and integration tests in different namespaces is the right thing to do anyway
08:44clgvjustin_smith: true
08:44justin_smithif they aren't in the same namespace, the fixture isn't an issue
08:45notofiHi, what is the idiomatic way to assoc something to a core.cache ? https://github.com/clojure/core.cache/wiki/Using says that the has?/hit/miss pattern should be used, what If I just want to call assoc on a cache ?
08:45kungijustin_smith: so I should use project-name.unit.test-1 and project-name.integration.test-1 as namespaces
08:46justin_smithkungi: yeah, that would be how I would do it, or maybe project-name.my-ns-unit and project-name.my-ns-integration
08:46clgvkungi: and the lein aliases :D
08:48mavbozojonathanj: yes, the query blocks the thread
08:51justin_smithwell, they will block the thread handling that request, which slows down your response, but it won't block other response threads
08:51jonathanjpresumably casually creating a thread for every request is not a terribly good design
08:52justin_smithjonathanj: it's a thread pool
08:52justin_smithjonathanj: the lib is doing it for you
08:52jonathanjhow do i create a thread? (thread)?
08:52justin_smithyeah, or (future)
08:52justin_smithbut you don't need to in this case
08:52jonathanji found this: https://groups.google.com/d/msg/clojure/Aj2njGQtPN0/PMVOigU2fDAJ
08:53jonathanjjustin_smith: how so?
08:53justin_smithjonathanj: your server creates a thread pool, and your handler is run in one of the threads
08:54justin_smithgo blocks are another beast entirely
08:54rurumateHow do I map with a macro? Can't take value of a macro. Is there a way around it?
08:54justin_smithrurumate: call the macro inside a function
08:54dysfun#()
08:54rurumatehmm
08:55TimMcrurumate: In the general case, no.
08:55justin_smith,(map #(and % %2) [1 2 nil] [3 4 5])
08:55clojurebot(3 4 nil)
08:55justin_smithand is a macro
08:56TimMcand/or are interesting because they can be used for control flow or for logical-boolean computations (or both).
08:56kungiclgv: Lein aliases?
08:57clgvkungi: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L204
09:02justin_smithjonathanj: to elaborate, notice he says "io should not be done inside a go block" - a requestion handler is the middle piece between two IO operations, that's what this particular thread pool is meant for
09:02TimMcrurumate: This is why macros are to be avoided unless necessary.
09:12clgvhow do you define overloads in `definterface`
09:12clgvall arities in one method declaration?
09:14clgvseems to be one by one
09:17clgvdifferent topic: are inliner with different arities possible? e.g. {:inline (fn ([x] ...) ([x y] ...))}
09:17Bronsayup
09:18Bronsa+/-/* etc do that for example
09:21clgvBronsa: ok, it was not the inliner arity but a strange reflection warning. it disappeared after lein clean and repl restart ... O_o
09:22clgvBronsa: does `definterface` have `defonce` semantic?
09:24Bronsadon't think so
09:26clgv*.class files prevail over dynamic definterface on repl?
09:27irctcif I have a lein profile :my-profile which defines resource-paths and I run "lein with-profile my-profile uberjar", shouldn't the resources be included in the jar, even if I also have a :uberjar profile
09:28irctcfor some reason the resources are not included
09:28mmitchellday 2 of trying to get a simple gen-class annotation to work :/ The clojure docs say annotations work, so I believe it! But I need to add a simple (@Stage), non-java.lang annotation, and that doesn't seem to work. Any Java + Clojure gurus here that could help shed some light on this?
09:29clgvmmitchell: which docs say that this will work? and why didnt you just write the class in java as adviced? ;)
09:30mmitchellclgv: I knew you were going to bust me on that :)
09:30mmitchellOK not "docs", but here in the clojure source/example: https://github.com/clojure/clojure/blob/master/test/clojure/test_clojure/genclass/examples.clj#L34
09:30justin_smithmmitchell: "simple", "gen-class" - does not compute
09:31mmitchellyeah, seriously
09:31clgvmmitchell: is there any test querying that class and the supposed annotations?
09:32clgvah that test is in a comment
09:32clgvmmitchell: did you try whether that test can pass ?
09:32justin_smithmmitchell: did you see this? https://gist.github.com/richhickey/377213
09:32justin_smithcomes from a reputable source :)
09:32mmitchellclgv: no I haven't tried that yet
09:32clgvmmitchell: but hey, about how many classes are we talking?
09:32mmitchelljustin_smith: cool will read
09:32mmitchellclgv: just 1
09:33justin_smithlooks like annotations in clojure don't use @
09:33clgvmmitchell: well then just write it in plain java, everything else is wasting time ;)
09:34clgvexcept for a learning exercise, but even then... well you learned to love gen-class right?
09:34mmitchellyes :)
09:35justin_smithclgv: we should petition to rename gen-class to generate-class-in-the-most-difficult-and-complex-manner
09:35black_13can clojure be used with eclipse
09:35clgvjustin_smith: haha :P
09:35mmitchellit was partially learning (it's a side project) but also was hoping to show a few java colleagues that clojure is an alternative, but better to just get things moving forward
09:35black_13from what google says "yes"
09:35justin_smithblack_13: yes, there is the counterclockwise plugin
09:35clgvjustin_smith: we just need reify-class and be done with it ;)
09:35justin_smithhaha
09:36clgvthere is actually a ticket for it
09:36justin_smithmmitchell: as you see in that gist, you can do annotations, and class creation (via deftype) without gen-class
09:36mmitchelljustin_smith: yeah reading that now, i'll give that a shot
09:36justin_smithgen-class is typically the hard way, and only worth trying if other options fail
09:37clgvjustin_smith: undocumented feature, yay. going to break without announcement
09:38justin_smithclgv: so do you think that gist indicates that annotations are inferred from metadata, or that metadata is implemented via the annotation mechanism?
09:38clgvjustin_smith: the compiler infers it from metadata
09:39justin_smithcool
09:39clgvjustin_smith: if it does, I have not tested any of it
09:39clgvmetadata itself is directly implemented in clojures java implementation
09:39justin_smithclgv: OK, so it's definitely not using annotation
09:40clgvjustin_smith: primitive types long and double are also possible for deftype fields
09:40clgvsame principle
09:41mmitchelljustin_smith: ahh, but my class must extend from another (java class) so I don't think deftype will work?
09:41justin_smithmmitchell: than maybe proxy would work
09:41justin_smith*then
09:42mmitchelljustin_smith: can you use proxy and export a named class somehow?
09:43justin_smithhmm...
09:43justin_smithnow you may be in gen-class territory, sadly
09:43mmitchellrats
09:43justin_smiththis interop code for putting annotations on things does not look to bad https://github.com/richhickey/clojure/commit/fa899d22dceb531d9f5af833ac6af0d956e6bdc7#diff-d951a5cd799ae841ffcc6b45598180dbR3846
09:48llasrammmitchell: My experience is that Java is a pretty decent DSL for defining Java classes
09:48mmitchellllasram: and do you then call clojure from your java classes? Or just go with java all the way?
09:48llasramAnd that the path of least resistence if you you need concrete classes esp with annotions is to create a small Java class which can trampoline into abritrary Clojure code via a passed-in IFn
09:48llasramThe former
09:49mmitchellinteresting
09:50mmitchellllasram: so your java class imports clojure-based classes, then calls methods on instances of the clojure class? Or something different?
09:50clgvmmitchell: so back again - write it in java ;)
09:50mmitchellha yes :)
09:50clgvyou can use the official clojure api to get hold of your functions
09:50mmitchelldefinitely learning something from this@
09:50llasrammmitchell: The former, exactly. Clojure 1.6 even introduced an official public Java API
09:50llasramhttps://github.com/clojure/clojure/blob/master/changes.md#21-java-api
09:50mmitchelloh?
09:50mmitchellclgv: is that what you mean ^^ ?
09:51clgvmmitchell: yes.
09:51mmitchellawesome, reading now
09:52justin_smiththis is what people refer to as "making a shim class", right?
09:52llasramAn instance of it, certainly
09:52clgvjustin_smith: heard it in that context yes
09:52justin_smithwhere the class is only just enough to have the properties the java code demands of it, and everything else is just calls to clojure stuff
09:52clgvin some datomic talk that was a topic, afair
09:53clgvjustin_smith: we could call it "inverse proxy" in contrast to clojure's "proxy" ;)
09:53llasramYeah, rhickey had a short impromptu lightning talk where he talked about that approach in terms of Datomic for the Java API it exposes
09:54llasrammmitchell: This class was supporting Clojure 1.5.1 so doesn't use the explicit 1.6+ API yet, but is an example of the basic approach: https://github.com/damballa/parkour/blob/master/src/java/parkour/hadoop/Partitioner.java
09:55mmitchellllasram: nice, that makes sense. Going to give it a go now
09:57llasramOne thing which may be non-obvious there is pushing the vars into a static nested class which are `require`d in a static initializer. I think it's going to be fixed in Clojure 1.7, but right now Clojure can be overly aggressive about initializing referenced classes
09:57clgvllasram: writing such a class feels like playing clojure compiler ;)
09:58llasramPushing the vars into a separate class defers the `require` until they are actually needed, which can simplify cases where you'd otherwise have a recursive dependency
09:58clgvllasram: ah you mean when clojure imports that class as well?
10:00llasramclgv: A tiny bit. This case would probably work mostly-okay with `gen-class` and AOT, but AOT isn't an option for libraries
10:01llasramYep, to configure Hadoop jobs to use the class, need to mention it in Clojure code doing the configuration
10:02clgvllasram: so in principle the problem is some kind of circular dependency between the Clojure ns using the class and implementing the used functions and the class itself
10:11llasramclgv: Exactly. And in principle you could avoid that by never mentioning the class in the namespace implementing its functionality, but I've found that to be that a pretty hand-tying contstraint in practice
10:17clgvllasram: ok. I haven't done that kind of interop so far
10:34EvanRso, jargon question. wtf is "decomplected"
10:35EvanRsounds cromulent
10:36mgaareEvanR: Rich Hickey talks about it here http://www.infoq.com/presentations/Simple-Made-Easy
10:37mgaareEvanR: "complect" means to tie or braid together. decomplect means to pull apart. It's part of a design philosophy which aims to take the different elements and concerns in a system and not intertwine them
10:39EvanRnoted
10:44black_13justin_smith: i have installed the conterclockwise plugin however every time i create a new project i get the error "connection reset Reason: Exception while creating new project"
10:46mishok13hey
10:47mishok13having a bit of a trouble with writing a macro that should generate functions
10:47mishok13https://gist.github.com/mishok13/d66156a6bf45f83c7247
10:48mishok13basically, I'ld like fnk-creator to behave the same way regardless of whether it was a map literal passed to it or a var
10:49stuartsierramishok13: You can't do that without evaluating the Var.
10:50stuartsierra`eval` would work, or `(var-get (resolve symbol))`
10:51Bronsais there any difference between var-get and deref on a Var I'm not aware of?
10:52mishok13stuartsierra: i'm confused as to where would I eval?
10:52stuartsierraBronsa: Oh, I think I meant var-get.
10:52stuartsierraI mean deref.
10:52stuartsierrasheesh
10:53stuartsierramishok13: Your macro would have to eval `args`
10:53Bronsait seems like var-get might be slightly faster than deref for non dynamic vars?
10:53stuartsierraI think var-get was intended for use in `with-local-vars`
10:54stuartsierra`deref` is the standard way to get the value bound to a Var.
10:56Bronsathey seem to behave exactly the same
10:56mishok13stuartsierra: seems to have done the trick
10:56mishok13cheers
10:56Bronsameh, I'll just keep ignoring var-get/var-set then
10:59RobT-Nice clojure resources https://clojure.zeef.com/vlad.bokov
11:01Bronsatechnomancy: it's the second time today that RobT- joins, spams that site and leaves
11:02Bronsatechnomancy: I'd say if he does it a third time he shouldn't get to do it a fourth
11:09bjawho are these top analyts? what are their credentials?
11:10bjas/analyts/analysts/
11:10clgvbja: ask technomancy he seems to be their pr guy ;)
11:13technomancyBronsa: just let me know; in a pm if need be
11:13the_freydoes anybody else have the issue that cider often starts and then dies with an end of process buffer error, but always works the second time you start it?
11:13technomancyalso: someone who talks with rich should get him to appoint another op
11:13the_freyI'm pretty new to emacs so assuming I've set something up wrong...
11:14technomancytbaldridge, stuartsierra: ^ east coast ops would be a good idea, just sayin'
11:14stuartsierratechnomancy: yeah. Are you the only op?
11:15stuartsierrathe_frey: yes, frequently
11:15technomancystuartsierra: apart from rich and chouser, who I haven't seen on in over a year
11:16stuartsierratechnomancy: Yeah, I'll try to remember for after the Conj. I could do it, maybe puredanger.
11:18the_freystuartsierra ah okay, is it just one of those things that happens from time to time then?
11:20stuartsierrathe_frey: Beats me. I don't expect consistent behavior from CIDER anymore.
11:21TimMcstuartsierra: Even without updating it?
11:22stuartsierraTimMc: yes, I'm still on 0.7
11:28technomancy0.6 was the best
11:28technomancy"cider classic"
11:32sdegutisDid you hear about this new Pixie language?
11:32sdegutisIt's a new kind of Clojure dialect.
11:33TimMcNot just a new dialect, but a whole new *kind* of dialect? Wow!
11:33sdegutisRight!
11:33sdegutisIt's magicalish.
11:33tbaldridgeand very, very alpha
11:33technomancya new kind of science
11:34sdegutistbaldridge: citation needed
11:34tbaldridgeI wrote it
11:34sdegutistbaldridge: I don't see that anywhere on the readme.
11:34sdegutisThat it's very very alpha.
11:34sdegutisIt says "pre-alpha" but I don't know what that means.
11:35tbaldridgethat means it's not even alpha yet. As in some things work really well, other things will segfault.
11:35sdegutisOh :)
11:36tbaldridgeand other stuff, like the ability to open and read files isn't implemented yet. But hey, I can count numbers and sum the contents of vectors really fast :-)
11:36sdegutisWell there you go, that's already half the battle.
11:36sdegutisAnd in only 6 instructions, too!
11:37technomancyhow fast is fibbonacci, that's what I want to know
11:38csd_Is there any way to dynamically load new dependencies from the REPL? ie without having to create a project.clj?
11:38sdegutiscsd_: lein-try
11:39csd_what if I'm inside cider though?
11:39cursorkcsd_: alembic.still
11:39sdegutiscsd_: I don't know what cider is sorry.
11:39csd_emacs repl for clojuree
11:40clgvso clojure on python gets revived with a different name?
11:41clgvor is it clojure on pypy?
11:41tbaldridgeclgv: no, it's not on python, it's rpython. Picture a lisp written in C with a GC/JIT
11:42clgvtbaldridge: ok, seems I need to find out what RPython is ;)
11:42csd_cursork: so i just add that to my profiles.clj and can then load whatever i want? sounds too great to be true
11:42cursorkcsd_: Yep. I haven't had any issues with it
11:42csd_wow
11:42csd_leiningen should just merge it
11:44sdegutiscsd_: So it's like nrepl.el?
11:44sdegutistbaldridge: what do you think of femtolisp?
11:45csd_ i would guess so, although i'm not familiar with that
11:48stuartsierracsd_: lein-try is for launching a new REPL with specific dependencies without a project.clj
11:49stuartsierraIf you're already running a REPL process, you can't change the dependencies without restarting.
11:49stuartsierraThere are tools that try (https://github.com/cemerick/pomegranate) but I'm not sure how well it works in practice.
11:50technomancyyou can add new deps without too much trouble, but upgrading usually won't work
11:50stuartsierraah, makes sense
11:50csd_I just want an easy way to experiment with a new library, thats all
11:50H4nsi'm such a java noob, sorry: if i use (gen-class foo), should i not be able to instantiate a foo instance using (foo.)? i see "Unable to resolve classname: foo" instead.
11:50stuartsierracsd_: lein-try if you want to launch a new REPL with the library included, that's what it's for.
11:51csd_stuartsierra: i cant use that with cider though
11:51stuartsierracsd_: once you've launched the REPL you can connect to it with cider
11:51csd_so start the repl server externally?
11:51stuartsierracsd_: yes
11:51csd_interesting
11:52stuartsierraH4ns: gen-class isn't interactive; it only works when Ahead-of-Time (AOT) compiling.
11:53H4nsstuartsierra: ah, ok. would compiling the buffer in cider do what i expect? or is there some other way?
11:53stuartsierraH4ns: No.
11:53technomancyyou can run clojure.core/compile from the repl
11:53technomancybut the gen-class has to be on disk
11:54H4nsah, okay, thank you both!
11:59cromwellHi. I have programming clojure by Stuart Holloway first edition. Has the language changed too much to make it not useful
12:00csd_stuartsierra: There's an hack evidently to use lein try with emacs.
12:00csd_(setq inferior-lisp-program "lein try <lib>") and then M-x inferior-lisp
12:00technomancyyou can do that without a plugin
12:00mavbozocromwell: it is still a useful book
12:01technomancyjust set it to lein update-in :dependencies conj '[whatever "version"]' -- repl
12:02csd_what's the last part, -- repl do?
12:02technomancycsd_: launches a repl with a modified project map
12:02technomancyupdate-in is a higher-order task; it takes a task as an arg
12:02cromwellMavbozo: ok good it is the core concepts I am keen to learn. New stuff like core.async etc I can learn elsewhere
12:03m1dnight_hrm, a (binding) seems to introduce an error "can not regur across try"
12:03cromwellAre there any useful core language features that have changed since 2009
12:03m1dnight_does it use that somewheree?
12:03m1dnight_I'm wanting to wrap a body of a function in a binding
12:04TimMcand you're using loop or recur or lazy-seq or something?
12:04m1dnight_Yeah, in the function body there is a recur
12:05m1dnight_h, so the binding should wrap the scope containing the recur?
12:05TimMcYou may need to extract a helper fn that just does the bindings.
12:05TimMc*wrapper fn
12:06justin_smithblack_13: do you have leiningen installed?
12:06hyPiRioncromwell: I think there are some new features, but I wouldn't say it's critical to get you up and running.
12:07cromwellOk thanks I will give it a go
12:07hyPiRioncromwell: The only thing I can think of is Leiningen, probably.
12:07cromwellI was given it so :)
12:16kzarI added "{:user {:plugins [[cider/cider-nrepl "0.8.0-SNAPSHOT"]]}}" to my ~/.lein/profiles.clj as instructed but when I M-x cider-jack-in I am told that cider-nrepl isn't installed. Is there another step to trigger the installation after adding the plugin to my profiles.clj?
12:18csd_kzar: Did you install the emacs package today?
12:18sm0keany duckling developers here?
12:18kzarcsd_: Well I already had it installed, unfortunately I also had a really old version of the pre-rename nrepl installed as well so I just removed that
12:19csd_upgrade and delete the old package
12:19csd_i had a similar problem and this fixed it
12:19kzarcsd_: Already deleted the old package, will see if I can upgrade the new one
12:19m1dnight_This got me up and running, if it can be of any help: http://www.braveclojure.com/using-emacs-with-clojure/
12:19csd_kzar: MELPA gets a new build basically every time there is an update on github
12:20kzarm1dnight_ csd_: My question really is do I need to do something to trigger cider-nrepl installing after I've added the relevant bits to my profiles.clj?
12:20csd_no it should happen automatically
12:24m1dnight_kzar: What i'm saying is that I haven't done it that way. I installed the cider package. If that works, great
12:24m1dnight_but I have only tried this way, and nothing else
12:25csd_kzar: my laptop battery is about to die very soon. one other thing you can try if this doesn't work though is to delete all the CIDER libs under ~/.m2
12:25kenrestivo lookupName(pfds[i].fd), pfds[i].fd);
12:25csd_i've also had weird problems caused by those before
12:25kzarcsd_ m1dnight_: OK thanks. Hmm upgrading didn't help but I'll restart emacs and then try that
12:25kenrestivomeh paste fail.
12:28kzar\o/ that worked :)
12:29csd_awesome
12:29kzarty for the help
12:29csd_which did, upgrading the package, or deleting the libs?
12:29kzarcsd_: So I had nrepl 0.2 or something installed, a random version of cider from I guess a few weeks / months ago. I uninstalled nrepl, upgraded cider, restarted emacs and then it started working
12:30kzarcsd_: (I also tried restarting cider before restarting emacs and that didn't work)
12:30kungiHow do I use cider-grimoire properly? I only get the html of the page?
12:30kzarcsd_: Not messed with the stuff in ~/.m2
12:30csd_kungi: if you're only getting html double check that you're actually doing it on top of a symbol
12:31kungicsd_ I am. C-c C-d h opens the proper symbol in my browser.
12:31kungimaybe my cider is too old ...
12:31arrdemkungi: waaaait before you update there's a ticket open for this
12:32arrdemhttps://github.com/clojure-emacs/cider/issues/867
12:32kungiarrdem: I always have a snapshot version number ready where everything works and copy my whole emacs config on a cider update
12:32kungicider broke too often in the past
12:33arrdemikr
12:33kungiikr?
12:33arrdemI know right
12:34arrdemkungi: so if that ticket is right, I'd try clearing the .elcs in your cider package dir and restarting emacs
12:35kungiarrdem: I will try this
12:40black_13justin_smith: i thought leinigen was installed with the eclipse plugin
12:40kzarAnyone use kioo here? I get a bunch of warnings when using it, that normal?
12:46kungiarrdem: \o/ removing the .elcs did the trick
12:46arrdemkungi: -_- okay please comment on that thread saying so.
12:46kungiarrdem: will do
12:47arrdemkungi: cheers. enjoy plaintext mode :D
12:47arrdemglad to know I'm not the only person using it :D
12:49kungicommented
12:51arrdemthanks.
12:52kungiI really have to learn emacs lisp properly.
12:55irctcDoes Clojure offer any significant benefits over Node.js for web developement. I'm a Node developer and Clojure looks quite interesting language wise, but how is the eco system for web developers? Thanks!
12:55arrdemkungi: if you have comments on the text/plain formatting I'd like to hear them.
12:55arrdemhttps://github.com/clojure-grimoire/grimoire/issues/68
12:56tuftirctc: one of the biggest advantages is the language itself. here's a good talk i watched the other day: https://vimeo.com/111214648
12:57tuftirctc: .. and yes, there's a pretty solid web development ecosystem AFAICT
12:57tuftboth client and server side
12:58tuftirctc: ClojureScript can run on Node.js, too, so you have a nice pathway for dabbling
12:59irctctuft, thanks. Have you used Clojure in production?
13:00tuftirctc: for my own projects, yes, but not commercially yet
13:00CljNoobhow would I call a function f with its argument x repeated n times? so f x x ... x where the number of x's is n
13:00arrdemCljNoob: (apply f (repeat n x))
13:01CljNoobarrdem: awesome, let me try that
13:02CljNoobarrdem: lovely, exactly what i needed. thanks
13:02irctctuft: alright. Have you faced any major hurdles when using Clojure on your projects?
13:04tuftirctc: *shrug* not really. it's something new to learn like anything else. tooling seems like it'd be on par with nodejs, but i have no experience with nodejs
13:06clrndclojrue has great constructs for functional programming, which node lacks (in general)
13:06tuftyeah no need to bolt on something like underscore.js to get a partial solution for FP
13:08irctctuft: I was considering using Clojure to build a commercial production grade system. Node.js is the safe bet for me since I know that best. But, Node projects have creative ways of failing in production :/. Well to be honest, it's more of a JS probelm than a Node problem.
13:08tuftirctc: yeah check out that talk i pasted -- it's super relevant to those concerns i think
13:09tuftirctc: it's hard to disagree with clojure being the better designed language i think
13:10tuftirctc: given JS was basically designed hurriedly over a few weeks, heh
13:11irctctuft: Indeed, but with Node.js its very easy to get things done fast, since the ecosystem is really good and npm is extremely straightforward to use.
13:11TimMcirctc: Don't worry, Clojure projects also have creative ways of failing in production! Yay software.
13:11tuftirctc: try lein and see what you think. i find it quite excellent. does npm install things system-wide?
13:11clrndin clojure it's very easy to get things done correctly
13:12tuft(inc clrnd)
13:12lazybot⇒ 1
13:12TimMcIt would be easier with some static typing but I'm happy with the compromise.
13:12technomancyTimMc: did you deploy another Enterprise Swearjure app again?
13:12tuftyeah fast isn't really fast when it breaks and you lose lots of time to debugging, heh
13:12technomancyI keep telling ya that's gotta stop
13:13TimMctechnomancy: Yes, but this time it uses SOAP so I'm sure it will all be fine.
13:13irctcTimMc: Of course :D. But JS is a complete hack.
13:13tuftTimMc: core.typed?
13:14TimMcI guess I haven't seen any surprises in production that are actually attributable to Clojure itself.
13:14TimMctuft: I'll look into it eventually. :-)
13:16clgvTimMc: what do you produce?
13:19irctc_tuft: yes, npm allows you to install system wide or only within the project
13:19TimMcclgv: I work for Brightcove, which sells online video as a service. Right now we're working on a new playback server (the thing that serves video metadata when a player loads.)
13:19TimMcSo, web servers.
13:20clgvTimMc: web servers and clojure then?
13:20TimMcyup
13:20tuftyay webservers
13:20tuftTimMc: which location are you at?
13:21TimMcThere are a couple of other public-facing Clojure projects here and I've worked on a couple of those as well.
13:21TimMctuft: Boston, the main office.
13:21tuftTimMc: cool. i'm near your seattle location
13:22TimMcOh, the Zencoder folks.
13:22TimMc(I actually don't know if they're all Zencoder or if there's more mixing than that.)
13:22bjatechnomancy: any tutorials on architecting a scalable enterprise swearjure javabean?
13:23technomancybja: it's running into some publication issues with censorship
13:23TimMcbja: Swearjure isn't so much architected as... extruded.
13:24bja:(
13:24clgvTimMc: brightcoves german translation for engineer is strange ;)
13:24TimMcOh yeah?
13:25clgvtranslated back it means technician ;)
13:25clgvbut the image corrects that by showing a guy in front of code ide ;)
13:25TimMcIs this on our jobs pages? Maybe I should poke someone.
13:26clgvyes
13:27TimMcThanks, I'll try to figure out who that would even be. :-P
13:30TimMcclgv: Someone pointed out that because we don't translate brand names, our "Once" product (acquired from another company) gets listed on the Spanish site as (effectively) "Brightcove Eleven".
13:31hlshipDoes "lein repl" compile Java classes before running the REPL?
13:31technomancyhlship: yeah
13:31technomancyprovided :java-source-paths is set
13:32hlshipI'm on 2.4.3 and I'm not seeing this.
13:33hlship :java-source-paths ["java-src"]
13:33hlship$ tree java-src/
13:33hlshipjava-src/
13:33hlship└── fan
13:33hlship └── logging
13:33hlship └── CorrelationIdConverter.java
13:33hlship2 directories, 1 file
13:34hlshipBut I'm getting a ClassNotFoundException on fan.logging.CorrelationIdConverter
13:34hlshipthings are working in the Cursive REPL
13:34hlshipI also don't see any *.class files
13:35technomancyhm; ok, well if you have a repro case please open an issue
13:35TimMc$ tree
13:35TimMc🌲
13:36hlshipIt's going to be a pain to extract out, is there any lein debugging I can enable to get some insight?
13:37bjaIIRC, you can set DEBUG=1 in your environment, and lein gets a lot more chatty
13:38hlshiplein jar does compile the Java class
14:01hyPiRionhlship: does CorrelationIdConverter.java start with `package fan.logging;`?
14:01hlshipyes
14:02hyPiRionhrm, then it should work fine
14:03hyPiRion(theoretically)
14:04hlshipOk, found it.
14:04hlshipI have a dev-resources/user.clj
14:04hlshipthat sets things up for testing
14:05whodidthiswhats a cool way to write string? but one that returns the string when true instead of just true
14:06hlshipand it was indirectly trying to load the Java class
14:07hlshipso I'm not happy that the javac step puts dev-resources on the classpath
14:10sdegutis,[{()()}]
14:10clojurebot[{() ()}]
14:11clgvTimMc: haha :D
14:11sdegutis,#{[{() ()}]}
14:11clojurebot#{[{() ()}]}
14:11sdegutis:D
14:12zanesAre profilers like YourKit capable of determining which reference(s) might be hogging memory?
14:13clgvzanes: not that easily, but yourkit contains tools for analyzing that - but it is more than hit a button and get the code lines
14:14zanesclgv: I’m struggling to figure it out. Any specific pointers for where to look?
14:14hlshipor trys to load namespace 'user
14:14hlshipquit
14:14clgvzanes: in your program or the profiler?
14:15zanesProfiler.
14:15zanesI’m pretty sure I’m hanging on to the head of one of several infinite lazy sequences somewhere.
14:16clgvzanes: "start object allocation recording" and "advance object generration number" - they have some more infos in their online docs
14:18sdegutisHow do I use the function that a macro is calling without using the macro itself?
14:18clgvsdegutis: what?
14:19Bronsasdegutis: ... invoking the function?
14:19sdegutisThe macro is defined like this: (defmacro foo [some args] (some-fn-call some args))
14:19sdegutisNo lie.
14:19clgvsdegutis: just call the functio
14:19sdegutisDo you see?
14:19clojurebotPardon?
14:19sdegutisIt omits the `
14:19clgvbut it probably just returns code ;)
14:19sdegutisThere's no semi-quote.
14:19clgvsdegutis: what do you want to achieve?
14:19Bronsasdegutis: so what? it means that some-fn-call returns the code for the macro
14:20Bronsa(defmacro x [] `(foo)) is the same as (defn bar [] `(foo)) (defmacro x [] (bar))
14:20sdegutisBronsa: Right, so how do I call the code returned by calling (some-fn-call some args) myself?
14:20Bronsaeval
14:20sdegutisclgv: I am trying to avoid someone else's DSL since it does not fit my use-case.
14:20sdegutisBronsa: That happens at runtime though, I want to have this happen at compile-time.
14:20justin_smithsdegutis: yeah, that sucks
14:20clgvas Bronsa said ;)
14:20sdegutisjustin_smith: which part?
14:20justin_smithhaving to use someone's DSL
14:20sdegutisAh.
14:21Bronsasdegutis: then use a macro
14:21sdegutisOh I know, I'll just write a macro will just call their fn dir-- yeah that.
14:21clgvhuh? you literally just want to avoid the macro but you want exactly what it does?
14:21sdegutisclgv: I want its implementation, but not its interface.
14:22sdegutisclgv: Surely you can understand.
14:22sdegutisI really feel like I'm speaking Greek here or something.
14:22clgvsdegutis: define your own macro with different parameters and call their function apropriately
14:22sdegutisRight, that's the solution I ended up with.
14:22Bronsasdegutis: you haven't expressed your problem clearly. Anyway you got your answer now
14:22sdegutisThanks anyway for trying.
14:23sdegutisI'm writing an alternative DSL to compojure.core/GET and friends.
14:23sdegutis(For my own personal use -- so don't worry.)
14:25sdegutisIt's turning into quite a difficult ordeal.
14:25sdegutisI suppose I can just try to omit '(GET ...) etc. instead.
14:25{blake}I've got a form created with hiccup and now I want to format the inputs and outputs. (Masks, dollar signs, percentage signs, etc.) Suggestions?
14:26weavejestersdegutis: Are you talking about calling compojure.core/compile-route ?
14:26sdegutisweavejester: Yes.
14:26weavejestersdegutis: You know it’s a public function?
14:27sdegutisweavejester: Yes, I'm calling it.
14:27weavejestersdegutis: Hm, so what’s the problem?
14:27justin_smith{blake}: ##(java.net.URLEncoder. "hello&world!%" "UTF-8")
14:27lazybotjava.lang.IllegalArgumentException: No matching ctor found for class java.net.URLEncoder
14:27justin_smitherr
14:27sdegutisweavejester: The difficulty is in trying to create a new `body` that wraps the one given to my new function, and giving that to compile-route.
14:27justin_smith{blake}: ##(java.net.URLEncoder/encode "hello&world!%" "UTF-8")
14:27lazybot⇒ "hello%26world%21%25"
14:27sdegutis*to my new macro
14:28justin_smith{blake}: ##(java.net.URLEncoder/decode (java.net.URLEncoder/encode "hello&world!%" "UTF-8"))
14:28lazybotjava.lang.IllegalArgumentException: No matching method: decode
14:28{blake}justin_smith: URLEncoder?
14:29justin_smith{blake}: yeah, it escapes things that aren't safe in a URL
14:29justin_smithmay not be an exact match for what you want, I guess
14:29weavejestersdegutis: What do you have so far? I don’t really follow what you’re doing.
14:32{blake}justin_smith: Yeah, doesn't seem like it'd work. Thanks, though.
14:33munderwoDoes anybody know how to kill nrepl-server processed in emacs?
14:33sdegutisweavejester: I'm trying to wrap the body of a (GET "/:foo" [foo] ...) call so that "..." is turned into "(do some more stuff ...)" but because compile-routes takes a seq for the `body` arg, I'm kind of lost on how to do this short of building up a list myself.
14:33stuartsierra,(java.net.URLDecoder/decode (java.net.URLEncoder/encode "hello&world!%" "UTF-8"))
14:33sdegutisOh, I suppose I can just pass `(do some more stuff ~@body) to the body arg.
14:33clojurebot"hello&world!%"
14:34sdegutismunderwo: Why not use cider?
14:34munderwowell im using cider and nrepl for clojure script…
14:35munderwoAnd i’ve killed the cider buffer, but the nrepl-servers are still around. and I can get my browser because they still have the port bound.
14:35munderwoI understand that to connect cider with a browser for clojurescript you need nrepl?
14:35weavejestersdegutis: Well, compile-route is just a wrapper to around make-route, so you could always drop down to that if you want to deal with functions instead of unevaluated lists of code.
14:35sdegutisThanks.
14:36weavejestersdegutis: But it sounds like you’re doing something like wrap-routes ?
14:36weavejestersdegutis: What’s the end goal?
14:37sdegutisweavejester: Part of the goal is to just bind some more variables to the body of each function.
14:38weavejestersdegutis: So… why not something like `(let [x 1] ~@body) ?
14:38sdegutisThanks.
14:38weavejestersdegutis: Even though you have unevaluated code, it’s not hard to wrap that in a let.
14:39sdegutisweavejester: It's slightly more complicated than that, since I want to use the values from some of the bound variables that will be bound in the 'args' arg. But either way, thanks for your help.
14:42whodidthiscan i clojure.string/trim in a prismatic's schema
14:42justin_smith{blake}: there is clojure.string/escape if you have a definitive list of what needs escaping https://clojuredocs.org/clojure.string/escape or some utilities from apache/spring http://stackoverflow.com/questions/1265282/recommended-method-for-escaping-html-in-java but the right thing is a proper encoder, because escape based techniques tend to be bad hacks...
14:44{blake}justin_smith: I'm not really looking for how to get a formatted string on the page. I'm looking for how to format the stuff to begin with. Like, given a mask of "$###,###" take "123456" and make "$123,456". I'm trying to avoid shoehorning a bunch of javascript in there.
14:45{blake}May be inevitable.
14:45justin_smithoh, I misunderstood what you meant by "formatting", sorry
14:46{blake}justin_smith: No problem. The escaping thing is bound to come up.
14:46justin_smithcl-format has a bunch of things along those lines baked in (the above is one of the printing formats for numbers)
14:47justin_smithhttps://clojuredocs.org/clojure.pprint/cl-format
14:47{blake}justin_smith: Cool. I'll have to do some translating (these formats come from Excel =8-0) but it shouldn't be too bad.
14:48{blake}I think the real issue is going to be formatting input. Maybe I'll see about cheating that.
14:48justin_smithlooks like ~d does the , thing
14:48justin_smithoh user input...
14:48{blake}justin_smith: Heh. Yeah.
14:50amalloy{blake}: java.text has methods for formatting strings and numbers
14:50amalloyeg, https://docs.oracle.com/javase/7/docs/api/java/text/NumberFormat.html
14:50justin_smith&(require 'clojure.pprint)
14:50lazybot⇒ nil
14:50justin_smith&(clojure.pprint/cl-format nil "~:d" 123456)
14:50lazybot⇒ "123,456"
14:50{blake}amalloy: Also cool, thanks.
14:51amalloyi don't think i would use cl-format; i'm sure it produces lovely output in a minimum of source-code characters in english, but java.text stuff is all nicely localized
14:51amalloyeg, the same formatstring will produce 123,456 here or 123.456 in countries that use a different decimal separator
14:52amalloyit also contains methods for parsing inputs with similar format specifiers
14:53{blake}amalloy: Any thoughts on the user-interface front?
14:53amalloyusers lie
14:53{blake}Chronically, habitually, unconsciously, yes.
14:55justin_smithamalloy: so with that approach, you would set the locale to match the user making the request?
14:56amalloyjustin_smith: i haven't paid much attention to what {blake}'s program actually is. localization is easier for a program that a user will actually run, but of course you can set the locale for webservers too
14:57{blake}It's pretty straightforward: A web page with data input fields on the left and results on the right.
14:57amalloyi'm just recommending it by default because it's something that java gets a lot more right than most languages, and it would be a shame to go back to the dark days of ascii-everywhere with cl-format
14:58justin_smithamalloy: fair point on that, yeah
14:59TimMcexplosion in the keyboard factory
15:00{blake}No QWERTYs were injured, however.
15:00technomancyPSA: having a small issue restoring clojars DB that's resulting in duplicate group memberships.
15:01technomancyshould not affect functionality but might look weird for a while
15:03TimMcDid Clojars explode?
15:03justin_smithTimMc: UHOH who'se gonna re-package all those bytes back into jars?
15:03amalloyit was caught in the qwertypocalypse
15:04technomancyTimMc: I accidentally deleted a whole table because korma syntax is weeeeird
15:04TimMcoy
15:04honzay u no yesql
15:04technomancy(korma.core/delete groups (values {:name "com.somesuch" :user "whoever"})) ; <- doesn't do what it looks like it does
15:04technomancyhonza: didn't exist at the time =P
15:05amalloytechnomancy: i guess clojars was using korma when you started maintaining it? i don't remember you being a fan of korma
15:06technomancyamalloy: yeah, it wasn't my choice
15:06technomancyamalloy: luckily I added an immutable event log that it wrote to redundantly
15:06technomancyand I was able to restore from that, though it's peppered with dupes
15:06technomancythe plan was to get off the DB and onto the event log, but that never happened
15:07technomancybut it's been very valuable for the restore
15:08technomancybash-in-place data stores: terrible idea or worst idea?
15:09mdrogalistechnomancy: Best terrible idea.
15:09amalloytechnomancy: but these days we have fancypants BIP data stores like hbase, which will store *several* past revisions of an entry, unless you configure it not to!
15:10mdrogalisamalloy: BIP?
15:10technomancyamalloy: or like ... a single .clj file
15:10sdegutisHow do you prevent a symbol from being fully resolved at such time as marco expansion?
15:10llasramsdegutis: do you mean like:
15:10llasram,`(this :vs ~'this)
15:10clojurebot(sandbox/this :vs this)
15:10amalloymdrogalis: Bash In Place
15:11sdegutisI mean 'foo vs 'user/foo
15:11mdrogalisamalloy: Ah :)
15:11justin_smithsdegutis: rewrite the macro
15:11sdegutisI am trying.
15:11mi6x3mwas 'positions' actually migrated to somewhere?
15:11dc_do agents in clojure have anything to do with agent-based design, over the network?
15:11sdegutisI type 'foo in the macro's definition, but at runtime its 'user/foo
15:11llasramsdegutis: see what clojurbot did with my example
15:11justin_smithsdegutis: that's what ` does
15:12llasramclojurebot even
15:12amalloythe expansion from foo to user/foo is not a macroexpansion feature
15:12sdegutisOh.
15:12dc_in other words, whats the best way in clojure to send a command over the network to have it executed by an agent
15:12sdegutisTaht worked.
15:12amalloydc_: i don't think they're related, no
15:12sdegutisllasram: You win.
15:12sdegutisamalloy: What would you call it?
15:12justin_smithdc_: well, it can be misleading, agents hold values and you pass them functions
15:13amalloysdegutis: syntax-quote does it
15:13amalloyas you can tell from llasram demonstrating it without writing a macro
15:13justin_smithdc_: usually agant-based design assumes a function, that you pass a value
15:13sdegutisamalloy: Oh. Thanks gentleman/scholar.
15:13dc_i've got a dependancy that forces me to use AoT compilation and makes it hard to use the repl. i'd rather have that dependency in a separate program that i can easily communicate with and possibly have multiple processes running it. is there an established way to do this inclojure?
15:13llasramdc_: What's the dep requiring AOT?
15:14dc_amalloy justin_smith: cool, so i may be able to use agents to accomplish this in some way
15:14dc_llasram: aparapi-matrix
15:14justin_smithdc_: you can launch an nrepl server from inside an aot'd program
15:14amalloyjustin_smith: i think dc_ has a completely different idea of what agent-based design means from yours
15:15justin_smithamalloy: fair enough!
15:15amalloyi don't really know what either of you means, though, so who knows
15:15justin_smithhah
15:15dc_llasram: aparapi-matrix lets you run matrix multiplication and a few other algorithms on the GPU, using aparapi and OpenCL. there's a few other algorithms i want to encode on the GPU myself, but i don't really want the dependancy in my main program
15:15llasramhuh
15:15kungiI am trying to use the component workflow while developing a web app in clojure and constructed the following minimal example. When I change the content of my only get handler and (reset) in the repl I still get tho old results. Can someone please have a look at my example and tell me where I got it wrong (https://github.com/Kungi/example-component-ring)
15:15llasramok
15:15justin_smithdc_: oh, yeah, don't run a repl from the GPU, that would be silly
15:16dc_justin_smith: ahh, so one program can connect to others via nrepl and pass code as data?
15:16justin_smithdc_: that's what nrepl is for, yeah
15:16justin_smithit's a socket based repl server
15:16dc_justin_smith: so far i've only used it as a repl :)
15:16justin_smithit's what lein repl uses
15:17justin_smithdc_: little did you know lein was launching both a client and a server
15:17justin_smithdc_: sometimes it is useful to run a compiled project, and then host an nrepl server inside it
15:17bobbywilson0What is the trick for getting a play-clj project to run with updates in cider? I keep getting "IllegalStateException Only one OpenAL context may be instantiated at any one time." when I try to eval (-main) again.
15:17dc_justin_smith: i realized i could connect to it over the network, but i guess i just didn't think about it like that
15:17justin_smithdc_: inside out from the usual launch-your-code-from-a-repl
15:18dc_justin_smith: ok that's awesome! that makes interacting with other programs very easy
15:18justin_smithdc_: as long as you fully trust them with all the capabilities of your own process, yes
15:18dc_basically i just need a clojure wrapper across a library or interfacing with an external program, then i can interact with it across the network.
15:18dc_ahh i see what you're saying
15:19weavejesterkungi: You have a fair bit of odd code in your example project, like macros that create records. You’re also writing a lot of your own code when there are libraries that give you things like Jetty components and user REPL functions.
15:19dc_justin_smith: so what should i look into to restrict the nrepl interface, so that only approved code can run?
15:19justin_smithdc_: I am not totally sure what you are doing, but there are also various inter-process queue setups
15:20justin_smithdc_: because it is easier to read from a queue, and use that value to execute a task, rather than try to run a sandboxed interpreter
15:20justin_smithrabbitmq, hornetmq etc.
15:20justin_smith*hornetq
15:20weavejesterkungi: I can’t see anything that would cause the error, but it’s very complex for what it does.
15:20dc_justin_smith: i'm working on a bioinformatics algorithms class on coursera. i want to accelerate some of the low-level algorithms with the GPU, but i don't really want to introduce certain dependencies to my main project.
15:21justin_smithdc_: what about doing it caveman style and launching its vm via ProcessBuilder, and then feeding it input via (.write (.getInputStream proc) bytes)
15:22justin_smithmaybe not your best option actually
15:22dc_justin_smith: ah ok. that makes sense. that's how i would have solved the problem in ruby. what i'm worried about now, is that implementing this will result in too much overhead passing data across the network, making it just as slow as it would be without using the GPU
15:22kungiweavejester: let me try to tidy it up a bit. I ripped this out of production code where the problem occurs. I did google a bit and did not find a library for a jetty component?
15:23weavejesterkungi: https://github.com/weavejester/ring-jetty-component
15:23dc_justin_smith: i wasn't aware of that option, i'll have to look into ProcessBuilder
15:23kungiO.o how have I missed this?
15:23justin_smithdc_: then maybe that ProcessBuilder option is usable then.
15:23weavejesterkungi: Also: https://github.com/weavejester/reloaded.repl
15:23amalloydc_: i have trouble believing you can move data across even the localhost network interface fast enough to make using the gpu profitable
15:24weavejesterkungi: I’ve been writing a fair few components recently, because I’ve been working on an opinionated template for component-based web apps. https://github.com/weavejester/duct
15:24zanesIs it possible to get object allocation profiling data from YourKit when in attach mode?
15:25justin_smithamalloy: what about things like unix domain sockets or stdio?
15:25weavejesterkungi: Rather than use a macro to create a record, I use a function with reify, which I think works a little better
15:26dc_amalloy: that's what i was worried about. i'll probably keep the gpu project separate then. i'm looking at this bioinformatics algorithms paper by Tuan Tu Tran, where he uses GPU acceleration on all kinds of algorithms: hamming-distance, motifs and string neighborhood.
15:26amalloyjustin_smith: it's still a lot of syscalls and buffer copying. but it's not really my area of expertise, even though i like to sound informed. maybe it really will be faster
15:26weavejesterkungi: So I have a function that takes in a config map and spits out a routing function: https://github.com/weavejester/duct/blob/master/lein-template/resources/leiningen/new/duct/example.clj#L8
15:26weavejesterkungi: And then I transform this into an endpoint using a function: https://github.com/weavejester/duct/blob/master/duct/src/duct/component/endpoint.clj
15:26justin_smithamalloy: if it's a truly parallelizable algo, it shouldn't be too dependent on the rate of input to the process anyway
15:27weavejesterkungi: Which I now realize doesn’t use reify as I said before. I think that was an earlier version I was thinking on.
15:27dc_justin_smith amalloy: i'm definitely in way over my head with this stuff, but the bioinformatics class has been a lot of fun so far. i just want to take some of these algorithms and see how ridiculously fast i can implement them.
15:28kungi weavejester wow thanks for the input! I will start refactoring right away :-)
15:28justin_smithdc_: it's pretty straightforward to just feed your data as bytes to a Process instance created via ProcessBuilder. It's not super flexible, because unlike with a network based input you can't send / receive data with arbitrary programs - you own its input and output within your own process
15:28dc_justin_smith amalloy: hamming-distance can be pretty much done in constant time already, but i'm pretty sure it can be accelerated across an array of bytes, so that it doesn't have to process one at a time.
15:30TimMc(defmarco polo)
15:30justin_smithTimMc: I almost went there but backed off
15:30TimMcSomeone needed to say it.
15:30dc_network as a bus, mannn... netowork as a bus. it's coming
15:31justin_smithwell, the network thing is much slower
15:31justin_smithbut unix domain sockets are a compromise
15:31justin_smiththey are faster, but localhost only
15:32dc_probably still be slow to read/write from network interfaces, regardless of how fast they are
15:32justin_smithbut sadly java can't use them without jni :(
15:32justin_smithdc_: unix domain sockets are not network interfaces
15:32justin_smiththey are interfaces for fast local IO between multiple programs
15:36anneliesI started working on clawk today.
15:36sdegutisWhat's that?
15:36justin_smithsweet
15:36arrdemw00t
15:36sdegutishttps://github.com/daveray/clawk ?
15:36anneliesshitwtf it already exists dammit
15:36annelieswith the same name
15:36annelies:V
15:36sdegutisannelies: what is your clawk?
15:36arrdem:C
15:37dc___oh no, now i haz three underscores. i really need to configure my nick
15:37justin_smithannelies: great minds think alike I guess - but I bet if you read the code you find like 50 ways to improve it
15:37sdegutisdc___: LLOL
15:37anneliesjustin_smith: yeah but I'll have to think up a different name :P
15:38anneliesawkjure
15:38anneliesI disabled that moronic lein restriction anyway.
15:38sdegutisawkjward
15:38dc___i've got a good irssi config, but i don't like that i have to use it from within terminal. makes it hard to switch back in forth. though i really do prefer irssi
15:38justin_smithsdegutis: I love that that word describes itself
15:38dc___lol
15:39sdegutisjustin_smith: well awkjward isn't a word thus it describes nothing
15:39sdegutisbut it describes nothing with exquisite accuracy and superb elegance
15:39anneliessdegutis: something like (defawk weather pattern rule, pattern rule, pattern rule) where pattern can be anything that implements Pattern protocol and rule can be anything that returns a sequence
15:39justin_smithdc___: registering your nick is not super hard to do, and /msg nickserv ghost ... works nicely once you've done that
15:39anneliesI want to implement Pattern for regex and boolean to start with
15:39justin_smithsdegutis: it describes trying to parse or pronounce itself
15:40anneliesand :begin and :end are special like in AWK
15:40anneliesBut I have to think of how to have it keep state.
15:40anneliesAWK without state isn't _very_ useful.
15:41sdegutisjustin_smith: :)
15:41sdegutis"awkuhjuhword"
15:41sdegutisI am writing macros.
15:41sdegutisIn real life.
15:41annelies,(shuffle "clojure awk")
15:41clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection>
15:41annelieswat
15:42dysfunis there any library that deals with sequences of functions? i.e. doing clever function things at runtime?
15:42annelies,(apply str (shuffle (seq "clojure awk")))
15:42clojurebot" cljarouekw"
15:42anneliesThat will be the name of my library.
15:42TimMcLike... composing them?
15:42TimMc&(format "lib-%04d" (rand-int 1e4))
15:42lazybot⇒ "lib-2945"
15:42justin_smithdysfun: lots, which kinds of clever things?
15:42TimMcannelies: ^ a suggestion from gfredericks
15:43llasramProbably monads
15:43dysfuncomposing them conditionally, perhaps
15:43anneliesTimMc: hm?
15:43dysfuni can see how i could have some fun with lazy-seq
15:43TimMcannelies: ##(format "lib-%04d" (rand-int 1e4))
15:43lazybot⇒ "lib-7208"
15:44TimMcThere's another one.
15:44TimMcI'm just giving him credit.
15:44anneliesoohh :P
15:44anneliesnice
15:45justin_smith,(str "cl" (java.util.UUID/randomUUID) "jure")
15:45clojurebot"cl0d50d7ba-1752-4e09-b6d5-5369a221a596jure"
15:45llasram(inc justin_smith)
15:45lazybot⇒ 132
15:45TimMc(inc justin_smith)
15:45lazybot⇒ 133
15:45TimMcThat one even starts with "cl0".
15:46justin_smith1 in 16 chance, so I basically just killed the orc in one hit
15:46arrdemGrimoire now officially moved to conj.io. No URL rewriting required, 301 redirect in place.
15:47not_arrdem,(let [characters (->> (range 48 58) (concat (range 65 89)) (concat (range 97 123)))] (defn generate-id [] (->> #(rand-nth characters) repeatedly (take 4) (map char) (apply str))))
15:47clojurebot#'sandbox/generate-id
15:47not_arrdem,(generate-id)
15:47clojurebot"jEz4"
15:47anneliesdebugging concurrent code is so much fun
15:47mavbozoorg.clojure/tools.awk ?
15:47arrdemmavbozo: org.clojure is by invite only :P
15:48mavbozocommunity.clojure/tools.awk ?
15:48arrdemhuh. wonder if anyone is using that group..
15:48arrdemnope
15:49TimMc"community" is long
15:49TimMcLet's abbreviate it "com".
15:49amalloyjustin_smith: words that describe themselves: "homological". today's fun trivia fact
15:50TimMcIs homological homological?
15:50justin_smithamalloy: thanks! I've wanted that word for a while.
15:50dysfunokay, the sequences of functions thing, the reason was i wanted to figure out how i could better model this function. the handlers take a ring request map and return a 2-tuple
15:51dysfunhttps://www.refheap.com/bea95b312aef4fbf0a190a037
15:51justin_smithTimMc: the editor edits all texts by people who do not edit their own texts, does he edit his own text?
15:51arrdemjustin_smith: yes
15:52weavejesterdysfun: What’s that meant to be doing?
15:52justin_smitharrdem: congrats, solved Russel's Paradox, claim your prize
15:52arrdemowl allow it
15:52dysfuni'm experimenting with abstracting web workflows on a RESTful-ish website
15:53TimMcjustin_smith: Yes.
15:53kungiweavejester: Thank you! I was able to make my code much easier. :-) https://github.com/Kungi/example-component-ring
15:53mavbozoTimMc: clojure.com domain name is owned by cognitect, so we go back to community.clojure group
15:53TimMcYou didn't say "and only".
15:53justin_smithoh, crap
15:53justin_smith:)
15:53dysfunin this case, my thesis is that on most sites, POST actions basically are a simple composition of logic that includes validation, canonicalisation, storage, testing and template/response rendering
15:53TimMcI'm also not clear on whether this editor has any of his own texts to edit.
15:53justin_smithTimMc: natural language is hard
15:54dysfunand i'm experimenting with making functins take ring request maps to try and ease composition
15:54dysfuni was inspired by your routes function, actually, weavejester
15:54weavejesterkungi: No problem.
15:56weavejesterdysfun: So… The “handlers” in the example return either [:success] [:failure] or [:request another-request] ?
15:56justin_smithamalloy: TimMc: arrdem: apropos http://en.wikipedia.org/wiki/Grelling%E2%80%93Nelson_paradox
15:56TimMcjustin_smith: In the case of homological there are at least two possible consistent states.
15:56dysfunweavejester: yes. it looks like a state monad if you squint a bit
15:57TimMcyeah
15:57weavejesterdysfun: What’s the purpose of returning a request? And what’s “i”?
15:58justin_smithof course, in all this talk of homological, and heterological, we are forgetting to include the very important members of our community, the bilogical, the alogical, and translogical
15:58TimMcweavejester: Philosophers have been asking that last question since time immemorial.
15:59weavejesterTimMc: What’s the command to downvote again…? :P
15:59anneliesTimMc: POSIX has a utility to find the answer.
15:59dysfunthe list of handlers going in is of function from request-map to instruction-tuple. :success and :failure cause the the instruction tuple to be returned as-is (that 'i' is a typo, should be 'ret') and :request continues down the chain, but with a modified request map
15:59dysfunso it provides a means of mutating the request map for things further down the chain
16:01weavejesterdysfun: Hm, okay. So your handler function can either modify the request or return a response.
16:01dysfunyes
16:01llasramdysfun: You can accomplish the same result with the middleware pattern
16:01amalloyTimMc: good; i had concluded the same thing: that homological could consistently be homological or not
16:02llasramdysfun: Each middleware function can either handle the request itself or pass (a potentially modified request) on to the next function in the chain
16:02justin_smithdysfun: with what you say about composition of logic to make a POST route, it sounds like you are getting close to the idea of what liberator tries to do
16:03dysfuni had a look at liberator way back when but i wasn't terribly impressed
16:03dysfuni'll take another look
16:03justin_smithdysfun: on a more theoretical level, I could imagine an alternate version of a middleware stack, where each step sees not just the next middleware in the cahin, but a data structure containing all the next steps, and has the option to modify, wrap, or destructure arbitrary elements in the chain. Down that road likely lies complete madness though.
16:04justin_smith*s/cahin/chain
16:04dysfuni went mad years ago, you can't scare me.
16:05arrdem(inc dysfun)
16:05lazybot⇒ 2
16:05arrdemsomeone pass the tea...
16:05llasramNo tea here. Just ravens and writing desks
16:05arrdembut are there burritos in the writing desk?
16:05dysfunllasram: it seems a bit stack-messy to go for the middleware pattern
16:06{blake}We all go a little mad sometimes.
16:06mavbozodysfun: your idea just looks like pedestal-service's service-routing and interceptors https://github.com/pedestal/pedestal/blob/master/guides/documentation/service-routing.md
16:07dysfunmavbozo: i shall read, thanks
16:10TimMcweavejester: (dec TimMc) :-)
16:11mavbozojustin_smith: "each step sees not just the next middleware in the cahin, but a data structure containing all the next steps" is one of pedestal-service interceptors idea
16:11TimMcI almost certainly deserve it at any given time for *some* reason.
16:11weavejesterTimMc: I was kidding :)
16:11justin_smithmavbozo: I had no idea they were so mad!
16:11ffwacomis it a Bad Idea to learn clojure without knowing java?
16:12justin_smithffwacom: clojure is a great way to use the java apis
16:12dysfunffwacom: definitely not!
16:12justin_smithand you don't need to know java itself for that
16:12ffwacomok cool
16:12justin_smithffwacom: I only learned java recently, as a long time clojure user. I prefer using java libs from clojure.
16:12{blake}ffwacom: Nope, but it helps not to be intimidated by Java when learning Clojure.
16:13ffwacom{blake}: would a familiarity with java help dealing with the java libs?
16:13justin_smithffwacom: {blake}: yeah - don't need to learn java, but should definitely learn to read javadoc and apply it to clojure interop
16:14ffwacomok cool
16:14ffwacomany recommended tutorials and books to start with?
16:14mavbozojustin_smith: see the madness for yourself https://github.com/pedestal/pedestal/blob/master/guides/documentation/service-interceptors.md
16:14justin_smithffwacom: javadoc search pane is a cool addon for firefox / chrome that makes javadoc easier to use
16:15kiwitobesAnyone here using Intellij / Cursive? I like LightTable but I don't think people are really working on it any more
16:15justin_smithffwacom: then, use the interop api as described at http://clojure.org/java_interop to access those apis
16:15{blake}ffwacom: Honestly, Java seems really well documented. I haven't used in a decade or so prior to picking up Clojure.
16:16justin_smithffwacom: I think, rather than needing a tutorial, you can start with the examples on that clojure.org page, and then try applying it to some simple java apis
16:16{blake}ffwacom: I just wrote an app that relied heavily on a Java library I wasn't even aware prior to starting the app. It was fine. No troubles just looking at the doc and going "OK, so, in Clojure..."
16:17justin_smithffwacom: simple ones to play with inclojure java.io.File, java.lang.String, java.net.URI
16:17ffwacomnice, that's good news
16:17{blake}ffwacom: Yeah, as someone who never really dug Java, I find Clojure makes it a lot more interesting.
16:18justin_smith,(.getCanonicalPath (java.io.File. "."))
16:18clojurebot#<SecurityException java.lang.SecurityException: denied>
16:18justin_smith:P
16:18justin_smiththat was supposed to be a simple example, heh
16:18ffwacomhaha no worries
16:19ffwacom,(+ 1 1)
16:19clojurebot2
16:19justin_smithanother convenient thing, for figuring out java objects quickly, is bean
16:19ffwacom:)
16:19justin_smith,(bean (java.io.File. "."))
16:19clojurebot#<AccessControlException java.security.AccessControlException: access denied (java.lang.RuntimePermission getFileSystemAttributes)>
16:19justin_smithbleh
16:20justin_smithanyway, if you run that locally, you get a nice hash map with a bunch of info reflecting the data the object can provide via getter methods
16:20tuft,(bean (java.util.HashMap.))
16:20clojurebot{:empty true, :class java.util.HashMap}
16:20ffwacomoh nice, good to know
16:20justin_smithit's not going to be complete mind you
16:20technomancyrunning group de-dupe
16:20technomancyfor clojars
16:20justin_smithbut sometimes it gives an interesting lead
16:21mavbozo(inc justin_smith)
16:21lazybot⇒ 134
16:22{blake}Reminds me, I owe a couple incs.
16:22{blake}(inc justin_smith)
16:22lazybot⇒ 135
16:22{blake}(inc amalloy)
16:22lazybot⇒ 194
16:22mdrogalisPretty sure I deserve a dec for that one.
16:23{blake}lol
16:23TimMc(identity mdrogalis)
16:23lazybotmdrogalis has karma 7.
16:23{blake}Do I owe you? 'cause, yeah, that cancels it out.
16:23mdrogalisP much
16:23TimMcHah, how long have we had that?
16:24technomancyraaaaaacket
16:25justin_smithocaml is pretty nice too - it makes small, quick running, quick compiling binaries
16:25technomancyif you're going to have clojure hackers modifiying them, racket is a lot quicker to pick up
16:25technomancybut you can't go wrong with either one
16:25justin_smiththat's very true
16:26mdrogalistechnomancy: You sure can go wrong. Just *look* at that GitHub syntax highlighting! Strike against Racket.
16:26technomancy._.
16:26sdegutisCan you put something like (symbol (str "clojure.string/" "lower-case"))) (not quoted) inside a Clojure macro and trust it'll evaluate as you intend?
16:26arrdem._.
16:26technomancymdrogalis: another couple weeks and clojure hackers will be numb to it though
16:27technomancyeither that or there'll be a mass github exodous
16:27akkadtechnomancy: yeah the racket-clojure and rackjure projects come close.
16:27mdrogalisSurely it can't be on purpose, right?
16:27technomancyakkad: rackjure is great, but raw racket is very passable too
16:28technomancyespecially for quick throwaway scripts
16:29akkadk
16:29sdegutisDoes Racket have a way to glue the interpreter into the script?
16:30technomancyyeah; you can have it spit out standalone executables
16:30gfredericksanybody know why I would have trouble with `lein deploy clojars` when my lib is on a snapshot but not when it's on a release?
16:30aperiodicsdegutis: why would you do that instead of 'clojure.string/lower-case?
16:30technomancygfredericks: that might be me; I'm performing intensive DB surgery and sqlite sucks at concurrency
16:30sdegutisThat is one of my favorite features of Lua is that there's a library that includes a Lua interpreter which loads the script attached to the end of its own binary and runs it.
16:31technomancygfredericks: can you hold off like 10m
16:31sdegutisaperiodic: I don't have the string at compile-time, I generate it at macro-expansion time based on macro args.
16:31technomancysdegutis: `raco exe` -> ~700kb standalone thingy
16:31sdegutishttp://lua-users.org/lists/lua-l/2004-08/msg00489.html
16:31gfrederickstechnomancy: I guess that explains timeouts in particular; I just gave up and did a full release which worked fine
16:31technomancygfredericks: you must have gotten lucky =)
16:32technomancyI should probably switch off uploads for a bit
16:32technomancyI would just like to point out that this is a great reason we should have a paid clojars admin
16:32justin_smithsdegutis: one of my favorite things about ocaml is that it compiles to a very small executable that only includes those parts of the lang you use in your code; and the compiler runs fast too
16:33sdegutisThat's cool.
16:33technomancyjustin_smith: welllll
16:33justin_smith?
16:33technomancyjustin_smith: the tree-shaking works to varying degrees
16:33technomancyjustin_smith: it doesn't work with jane street core
16:33sdegutisI like that about Google Clojure Library too, in theory.
16:33justin_smithtechnomancy: I've had good luck, but then I have never used jane street
16:33technomancyit's not very fine-grained, is all
16:33sdegutisEr sorry, Google Clojure Compiler.
16:33technomancyjustin_smith: yeah... grenchman is 10m =\
16:33technomancysupposedly they're working on that though
16:34justin_smithtechnomancy: right, big monolithic libs are going to be an issue
16:34arrdemtechnomancy: the problem is "we" :c I'd be happy to gittip or whatever fund clojars
16:34justin_smithtechnomancy: its still only including the libs you use! it's just that one lib is really big :P
16:34technomancyhehe
16:34TimMcsdegutis: Closure :-)
16:34justin_smith(dec frameworks)
16:34lazybot⇒ -1
16:34technomancyarrdem: xeqi tried to start a campaign targeting big corps, but with limited success. maybe something more grassroots would work better
16:34aperiodicsdegutis: this sounds crazy. if you don't want to let the user refer to the function directly, why not have, say, a map from expected macro args to the symbol to use when given that arg?
16:35TimMctechnomancy: I work at a company that uses Clojure. xeqi should poke me.
16:35sdegutisaperiodic: I originally had {"GET" 'compojure.core/GET "POST" 'compojure.core/POST}.
16:35TimMc(I have no idea if it would be a fruitful effort, but it's worth a shot...)
16:35sdegutisaperiodic: I was hoping to remove the redundancy by dynamically generating that symbol instead of using a lookup table.
16:36sdegutisAnd that's why I'm here! :)
16:36technomancyfor background, this restore is happening because I was asked to remove someone from a group and due to a combination of sloppy argument handling and infamiliarity with korma, I ended up removing EVERYONE from EVERY group
16:36technomancywhich wouldn't have happened if clojars were under active development
16:36sdegutisAlso because I'm super sleepy and my little daughter vomited on a lot of us last night and this morning so we lost some sleep and it's easy to get side-tracked.
16:36technomancyso next time someone asks me to perform manual DB ops, I'm just going to tell them to upgrade to clojars pro =)
16:36arrdemlol
16:36arrdemhttps://gratipay.com/on/github/xeqi/
16:36arrdemhuh
16:36sdegutisBut mainly because I'm trying to create a symbol.
16:37sdegutisOh wait! I think this is the wrong way to build a namespaced symbol.
16:37sdegutis(doc symbol)
16:37clojurebot"([name] [ns name]); Returns a Symbol with the given namespace and name."
16:38justin_smithtechnomancy: haha - you should just list consulting rates: remove someone from a group, $5, add someone $10, remove a jar your posted by mistake $100, fix something in the db for you $500
16:38sdegutistechnomancy: LLOL (re: the SQL op you ended up with)
16:38arrdemI've been fortunate that my $3/wk is enough to keep Grimoire online would be happy to throw money at clojars to keep things alove
16:38sdegutisoh wait no, not LLOL, just LOL
16:38arrdem*alive
16:39sdegutisaloof?
16:39weavejestertechnomancy: What about adding on a “donate” page to Clojars?
16:39TimMcThere really should be corporate users funding clojars.
16:40technomancyweavejester: well, I'm not in a position to accept monies in return for maintenance personally, but I think it would be wise for xeqi
16:40weavejesterWell, that’s kinda what I mean
16:40weavejesterIf there’s a donate page on Clojars
16:40weavejesterAnd we give people the option to make their donations public
16:40justin_smithtechnomancy: you know how people always have issues with setting up private maven repos for closed source / internal stuff? secure private repo as a service (spraas)
16:40weavejesterThen that would give Clojure-orientated companies an incentive to donate.
16:41technomancythere's lots of ways it could go, yeah. I think it was wise to start by approaching high-profile clojure-using companies first because it's less messy than a grassroots approach.
16:41technomancynot that they're mutually-exclusive
16:42weavejesterIf I’m giving, say, $100 a month to Clojars and I was listed as the only donator, then larger companies like Cognitect might say, “why aren’t we listed”?
16:42technomancyjustin_smith: yeah... liability is a big one with that though
16:42weavejesterSo kinda a shaming approach :)
16:42technomancyweavejester: sounds good to me =)
16:42technomancybut these kinds of subjects can be sensitive
16:43technomancybringing in money when you're used to it being a big hippie love-fest etc =)
16:43arrdemeh servers and time aren't free
16:43weavejestertechnomancy: Something like the EFF page maybe: https://www.eff.org/thanks
16:44technomancyTBH it's astonishing it's been as problem-free as it has
16:45taliosjustin_smith - how hard is it to unzip and run nexus? I don't see why people have a hard time with that..
16:45technomancytalios: it's more keeping a server running in general
16:45weavejesterThough I guess the hard part might be managing taxes and so forth.
16:45taliostrue
16:45technomancyapplying security patches, keeping user accounts up to date
16:46arrdememergency contracting on accidental pushes :P
16:46weavejesterIdeally we’d have a company responsible for managing Clojars
16:47weavejesterMaybe non-profit.
16:47technomancysomebody tell Marc Andressen
16:47technomancy(please don't actually do that)
16:48technomancyhe invested in npm, inc
16:48llasramMaybe some sort of non-profit Clojure foundation
16:48arrdemIt'd be nice if we did have a single entity wrapping the various clojure infrastructure projects
16:48sdegutisbrb googling "Unsupported binding form: clojure.lang.LazySeq@a97d5d6c"
16:48weavejesterxeqi has a consulting company, so donations could presumably be routed through that initially.
16:49arrdembut then that'll introduce a boatload of now absent politics..
16:49technomancyarrdem: exactly
16:49weavejesterI think a Clojure foundation is a little too broad.
16:50technomancyin general being distributed is great; fewer points of failure.
16:50justin_smithsdegutis: that means you are using the string representation of a lazy seq where a symbol or destructure is expected, I think
16:50justin_smithsdegutis: translation: your macro is too clever
16:50technomancymaybe someone brilliant will come up with a distributed clojars replacement and we won't have a spof
16:50sdegutisPhew! The only other person Google claims has encountered the error I'm seeing in writing my macro is the guy who wrote Mastering Clojure Macros.
16:51arrdemclojure over gittorent..
16:51nullptrsdegutis: achievement unlocked!
16:51sdegutis(ninc nullptr)
16:51weavejestersdegutis: The error says you’re trying to bind something to a seq, which won’t work.
16:51technomancyarrdem: it's hard for me to imagine it working without a block chain; you need consensus for how to apply updates
16:52weavejestersdegutis: Try using macroexpand to see what the code looks like you’re generating.
16:52justin_smithweavejester: ahh, of course. Not the string rep, just putting a seq rather than vector on the lhs
16:52sdegutisGood idea. I was only using (macroexpand) to test, but I should be using it to print it out too.
16:52llasram,(eval `(let [~(seq ['a]) [1]] a))
16:52clojurebot#<CompilerException java.lang.Exception: Unsupported binding form: (a), compiling:(NO_SOURCE_FILE:0:0)>
16:52weavejesterjustin_smith: Right
16:52arrdemtechnomancy: I think you could get surprisingly far by just distributing artifacts over bittorent as-is with signatures
16:53arrdemtechnomancy: that just leaves the artifact discovery problem open
16:53sdegutisAlso, how dumb of an idea is it to assert that (= (macroexpand '(my macro)) (macroexpand '(someone elses macro)))
16:53technomancyarrdem: well, how the heck else do you get decentralized consensus on a series of events
16:53weavejestertechnomancy: The latest version is controlled by the author of the app. There’s no double-spending problem to be solved because if I release 1.0.2 then by definition it’s later than 1.0.1.
16:54justin_smithsdegutis: false positives because ##(= '(1) [1]) but as we have seen, the former doesn't work in a destructure
16:54lazybot⇒ true
16:54arrdemtechnomancy: I'm with weavejester I don't think this is really a distributed problem at all. Really this is a global, signed, write-once datastore.
16:54sdegutisOooooh.
16:55sdegutisThat explains everything maybe!
16:55justin_smithsdegutis: like a more skeptical Archimedes
16:55weavejesterarrdem: Yeah. You can write a new version out to the datastore, or write a deprecation/retraction notice for that version.
16:56technomancyarrdem: what about two users attempting to claim a new group-id?
16:56justin_smithtechnomancy: race condition, first one there wins
16:56weavejestertechnomancy: That’s a good point :)
16:56weavejesterjustin_smith: Distributed race conditions = double spending problem
16:56justin_smithright
16:56sdegutisFound it I think? https://gist.github.com/trptcolin/418759
16:56hyPiRionjustin_smith: what happens if I somehow manage to get org.clojure first?
16:56arrdemweavejester beat me to it :P
16:56arrdemhyPiRion: GG no re
16:57justin_smithweavejester: I was just thinking about how literally that was a data race (they are racing for that identifier)
16:57technomancyanyway, there are jvm blockchain implementations, right?
16:57technomancysomeone do this plz
16:57weavejesterYeah, like BitcoinJ
16:57weavejesterHowever
16:57arrdemcljcoin
16:57sdegutisSo, (vec) saved the day.
16:57arrdemGUYS WE CAN USE DOGECOIN
16:57weavejesterMaven isn’t really blockchain friendly :)
16:57sdegutisOops I'm on the wrong channel.
16:57OceanBlueshi all
16:57justin_smitharrdem: CLOJECOIN
16:57sdegutisOh wait no this is right.
16:58weavejesterSometime we really have to move away from Maven. Their versioning makes me angry.
16:58arrdemkludgecoin...
16:58gfredericksarrdem: technomancy: so currently if somebody is obviously group-id squatting that's fixable
16:58hyPiRionOceanBlues: hello there
16:58weavejesterIt’s just. so. bad.
16:58technomancygfredericks: FSVO obvious
16:58OceanBluessomeone know were can I find clarix, it's not into clojars
16:58technomancygfredericks: it requires a judgement call, which means centralized authority
16:59llasramweavejester: IMHO everything else is slightly worse, but obviously YMMV
16:59weavejestertechnomancy: If I was going to email xeqi regarding Clojars, who do you think I should CC?
16:59ffwacomare all clojure types java types?
16:59technomancyweavejester: ato@meshy.org and myself, I guess
16:59gfrederickstechnomancy: I know, I'm pointing out that once you decentralize people could squat arbitrarily
16:59technomancywe are the current triumvirate
16:59weavejesterllasram: I haven’t seen versioning quite as crazy as Maven’s.
16:59gfrederickswould I guess would be a sort of DOS on the system
16:59technomancygfredericks: /me nods
16:59pandeirowhat's the smart way to check if an element exists in a vector by identity?
16:59sdegutisbrb gonna go roast some garlic and spread it on bread
16:59taliosweavejester - you've not seen Java's new versioning scheme then yet have you?
17:00arrdemweavejester: technomancy: gfredericks: we don't need a new coin.. namecoin exists
17:00{blake}ffwacom: No.
17:00justin_smithOceanBlues: do you know where to get the jar?
17:00ffwacom{blake}: cheers
17:00weavejestertalios: I’d be impressed if it was worse.
17:00weavejestertalios: How bad is it?
17:00OceanBluesno, I don't justin_smith
17:00llasrampandeiro: you mean like? (some (partial identical? x) v)
17:00justin_smithOceanBlues: if so, there is a way to put it into your local cache via lein
17:01justin_smithOceanBlues: so first step, is to find some source of that lib then
17:01OceanBluesI'm trying to get via lein
17:01gfredericksarrdem: http://bitcoin.stackexchange.com/questions/3644/namecoin-is-there-any-rationale-behind-the-apparently-foolish-choice-of-havin
17:01taliosweavejester - http://openjdk.java.net/jeps/223 - major.minor.security
17:01pandeirollasram: yeah that works
17:01llasramweavejester: Yeah, maybe specifically the versioning. But the way the overall package-management system works, I do prefer Maven
17:01llasram(via Leiningen, of course)
17:02justin_smithOceanBlues: like I said, if you can find the jar anywhere, you can use lein to install it locally once you have it
17:02OceanBluesbut tell me don't find
17:02weavejestertalios: Oh, I meant more Maven’s weird dependency resolution
17:02justin_smithOceanBlues: right, because nobody uploaded it to maven central or clojars, it seems
17:02technomancyhow convenient that this problem happened to be raised the week of the conj
17:02OceanBluesI problem is that I don't know where to find the jar
17:03technomancyanyway you guys go figure everything out at a pub after the sessions or whatever and let us know what you decide
17:03weavejestertalios: Like if package X requires Z 1.0-1.2, and package Y requires Z 1.1, what version number of Z do you think Maven will pick?
17:03llasramtechnomancy: Oh, are you not going this year?
17:03technomancyllasram: unfortunately I can't make it
17:04llasram*sad face*
17:04OceanBluesto install is not my trouble
17:04llasramWell now it hardly seems worth having the Conj at all
17:04TimMctechnomancy: I demand a bas relief of you, ato, and xeqi as the Fates
17:04arrdem(inc TimMc)
17:05lazybot⇒ 82
17:05technomancycardboard cutouts maybe?
17:05mavbozojoe armstrong has a crazy idea of using sha1 of source code as name & version and using service like kadimla as service-discovery
17:05justin_smithOceanBlues: how do you know this library exists?
17:05OceanBlueswhat I neet it to get the lib
17:05TimMctechnomancy: This is acceptable.
17:05technomancymavbozo: yeah, IMO the technical questions are less interesting than the social ones though
17:05OceanBluesbecause comes as reference into a book
17:05hyPiRionllasram: let's be sad together
17:06OceanBluesmaybe it's wrong, maybe not
17:06arrdemwell if we're gonna build a custom package manager for Clojure, we may as well take the opportunity to make sure that it enforces SemVer
17:06technomancyarrdem: haha, good luck
17:06llasramhyPiRion: I agree to this plan. I did buy non-refundable plane tickets
17:06arrdemtechnomancy: hey we can totally prove that you do or do not superset the existing API :D
17:07technomancyarrdem: technically every bug fix is an incompatible change
17:07hyPiRionllasram: I have 6 plates of chocolate I'll bring to (attempt to) remedy the absence of technomancy
17:07technomancyhave fun with that one =)
17:07arrdem(dec state)
17:07lazybot⇒ -1
17:07arrdemwow only -1? come on people what are we doing
17:07hyPiRionif someone bring the ice cream we're set
17:08llasramsomeone: got that?
17:08justin_smithOceanBlues: the reason I ask, is if I google search for clarix I find nothing that looks like a java or clojure library
17:08hyPiRionoh, that's an actual person.
17:08llasramWell, it's a real (poorly-chosen) handle :-)
17:08nullptrstate was -Infinity but it seems to have been reset ... just can't figure out where ... curse you, state!
17:09llasramAaaanyway, speaking of the Conj -- time to go home and pack
17:09OceanBluesjustin_smith I know I've asked to google so :D
17:09sdegutisIs there a Clojure pre-compiler that uses significant whitespace in place of parentheses?
17:10taliosweavejester - 1.2 - as specified. highest wins. "1.1" is a suggestion. If you want exact - "[1.1]". well known fact.
17:11weavejestertalios: Right, except that’s almost never what you want.
17:11alandipertsdegutis: https://github.com/one-more-minute/chiara is pretty excellent
17:11taliosweavejester - you want the build to fail? or constrain down to 1.1?
17:12weavejestertalios: One package is saying, “I’ll be happy with anything from 1.0 to 1.2”, and the other package is saying, “I kinda like 1.1”, then the obvious solution is to use “1.1”.
17:12weavejestertalios: Maven is really strict about version ranges. IIRC there’s no way to override them.
17:12taliosweavejester - maybe. "i kinda like 1.1, but I'll take anything higher".
17:13weavejestertalios: And open version ranges tend to suck up snapshots
17:13whodidthiscan i clojure.string/trim in a prismatic schema
17:13TimMcweavejester: You also have to handle alphas and such intelligently. (Which Maven does not.)
17:13sdegutisalandipert: That's.... interesting.
17:13taliosweavejester - well there is, dependency exclusions - but that gets really nasty. the core problem is that compile-time dependencies are transitive,
17:13talioswhich they shouldn't be
17:13weavejesterTimMc: Right, which is another problem with Maven
17:14weavejesterIdeally version ranges should be suggestions.
17:14weavejesterThe project owner should be able to override.
17:14OceanBluesjustin_smith thank you. I begin to think it could be an old library
17:15OceanBluesI've found some reference into github, but not a link
17:15weavejesterSo I release a library with a version range of 1.4-1.6, that just means I’ve tested this library on those versions. It’s not a hard lock.
17:15taliosweavejester - that's one of the ongoing discussions for the new POM format - global exclusions
17:16taliosamong others - sadly those changes can only really be done for the 'build pom', not the consumer pom
17:16sdegutisThe tests all pass when using the auto-runner but not when using the plain runner.
17:17sdegutisThis is a riddle btw.
17:18xeqiweavejester, arrdem, TimMc: theres a number of legal issues surrounding a service that allows users to upload almost anything that become more important once $$ is involved
17:18weavejesterIMO a dependency should look like: [name #{versions}]
17:18OceanBluesmistake resolved, library is not clarix, is clatrix, last version 0.4.0 into clojars
17:18arrdemxeqi: have you gotten a DMCAwesome complaint yet?
17:19xeqiarrdem: that requires having a DMCA registered agent
17:19technomancyI would actually seriously consider moving it out of the US
17:19xeqibut thats #1 or #2 on my list
17:20xeqimost of this is easy to solve
17:20xeqiI've just been stuck while reaching out to _ato, as I haven't heard anything from him in the past 2 months
17:21xeqi(since I got enough free time to start trying to maintain it)
17:21sdegutisweavejester: What was the motivation behind having (GET/POST/etc) be macros, rather than having (defroutes) accept pure data, such as [:get "/bla" ...]?
17:22weavejestersdegutis: It allows for flexible composition of routes.
17:22sdegutisOh.
17:22weavejestersdegutis: Routes can decide to accept or reject based on arbitrary criteria.
17:22xeqiI'd end up pulling everyhing clojars under my consulting company for the corporate sheild
17:22sdegutisweavejester: Oh, you mean how a route fn can return nil and pass the request on?
17:22amalloysdegutis: routes are functions, and you can combine two functions to get a function
17:22weavejestersdegutis: Right. There are alternatives to Compojure that use a static data structure. i.e. trade flexibility for transparency.
17:23technomancyarrdem: https://github.com/project-douglas/the-tao-of-dao/blob/master/_posts/2014-03-06-introducing-ethereum-package-manager.md
17:23sdegutisamalloy: thank you sir/gentleman/scholar
17:23weavejesterxeqi: That’s what I figured you’d do :)
17:23amalloyyou can't easily combine two of these data structure things and get out another one that makes sense
17:23sdegutisweavejester: interesting
17:23arrdemtechnomancy: huh that may actually get me to look seriously into ethereum
17:23xeqibut for anyone interested in the the more general discussion of a clojure foundation, you might talk to bridget hillyer and/or daniel solano gomez
17:24technomancyarrdem: don't take it too seriously; a few links are 404ing
17:24arrdemtechnomancy: sure but the idea is interesting
17:24xeqiwe've passed a few emails around along with puredanger about it, and I know they were seriously interested
17:24arrdemtechnomancy: and from what I understand ethereum does provide a bunch of the infrastructure that you'd need for this sort of thing
17:25weavejesterxeqi: If you need a corporate donator to encourage others to join in, I’d be happy to step up and contribute a modest amount each month to Clojars.
17:26weavejesterxeqi: So for a brief time I can be Clojar’s top sponsor ;)
17:26technomancyhttps://clojars.org/leaderboard
17:27arrdemlol
17:27xeqiweavejester: heh, thanks
17:27kzar(doto h (.setEnabled true)) could be written as (.setEnabled h true) right?
17:27xeqiI did get one serious offer that I've had to table while waiting
17:28arrdemI'd be happy to throw some money at clojars as well. that Cider gets $23/wk in tips and you don't is... silly to say the least
17:28technomancythe leaderboard would have both "code released" and "money contributed" axes
17:28arrdems/cider/bbatsov/g
17:28xeqibah, bbatsov should get more then that
17:28weavejesterkzar: The side effects would be the same, but the return value would be different.
17:29kzarweavejester: Right, thought so. I don't care about return value in this instance
17:29weavejestertechnomancy: I like that idea :)
17:29xeqialso, I guess I should publically lambast technomancy for trying to run untested code on a repl in a live server
17:30cprice404+1, would contribute some $$ to clojars
17:30technomancyI'll be the fall guy.
17:30justin_smith,(doto 'technomancy :lambast)
17:30clojurebottechnomancy
17:31arrdem(inc justin_smith)
17:31lazybot⇒ 136
17:31technomancy"Contribute to clojars, or technomancy will have to keep running random defns in a live repl using libraries he hasn't touched in three years"
17:31nickikMaybe im just stupid, but does anybody know how to get the data that I past into pedestal (its a POST request)?
17:32dbaschtechnomancy: you could have a “featured artifact” slot that refreshes every 24 hours and goes to whoever pledges the most BTC or something
17:33arrdemgoogle ads for clojars packages!
17:33xeqiso I guess you guys are for me totally selling out
17:35xeqibadges for users, special skins for packages
17:35xeqioooh oohh
17:35arrdeminb4 hats
17:35justin_smithxeqi: hats for package avatars
17:35justin_smithlol
17:35hfaafbbadgers for users
17:35xeqiyou have used X/1 upload energy this month. Buy crystals for recharging!
17:35arrdemjustin_smith: CALLED IT
17:35justin_smithyou did
17:35sdegutisweavejester: I like a ton of what Compojure does, I wouldn't want to switch to a different library just to get a DSL that takes data instead of functions, because then I'd be missing out on all the other stuff your library does.
17:35amalloyxeqi: in-app purchases
17:36OceanBluessee you
17:36dbaschclojars gold, just like reddit gold but less useful
17:36xeqidbasch: reddit gold is useful?
17:36amalloydbasch: how is this possible?
17:36dbaschxeqi: no
17:36mavbozonickik: what's the code look like?
17:36dbaschamalloy: usefulness can be negative
17:37amalloyah. so clojars gold comes with a free rabid beaver delivered to your apartment when you're not expecting it?
17:37mavbozonickik: your interceptor code?
17:38dbaschamalloy: I like that, but it has some probability of being useful depending on who visits you
17:38hiredmanalternatively someone should figure out how to graft maven on to bittorrent in a way that preserves some amount of trust
17:39amalloyhiredman: "i trust that maven grafted onto bittorrent will still result in downloading the whole internet"
17:39dbaschUbuntu Rabid Rodent, how did they miss that
17:39talioshiredman - bittorrentsync based wagon provider should solve that.
17:40hiredmantalios: I don't think it is that easy
17:41hiredmantalios: I don't think clients doing downloads run long enough to help serve other clients, so you would need something beyond just the wagon
17:42sdegutisspeaking of reddit http://www.reddit.com/r/shittyaskscience/comments/2mhbth/if_heat_rises_why_isnt_the_sky_on_fire/
17:42hiredmanyou would also need to either get really serious about artifact signing, or come up with something else
17:42TimMcdbasch: Maybe in 12 years when they come back around to R...
17:42technomancyhiredman: there's still the question of claiming group-ids.
17:42hiredmanright
17:43dbaschtechnomancy: you could claim one per bitcoin block?
17:43gfrederickshiredman: artifact just-leaving-it-on-the-front-step-and-crossing-your-fingers
17:43nickikmavbozo, hi, like this ["/:index" {:get get-index
17:43nickik :put make-move}]
17:44sdegutisIs (ns) officially the way to create Clojure files, or is it just a convention that happened to be adopted universally?
17:44nickikI do PUT /5 {:connect 5}
17:44nickikHow can I get the {:connect 5} body
17:45hiredmanwe just had a little bit of a hiccup at work were due to mucking with the kernel for $REASONS we lost the node that was running our archiva node, which lead to the discovery of not good enough backups, which lead to a recovery of our artifacts out of various persons ~/.m2 directories
17:45hiredmanwhich, well, if you formalized would be sort of like bittorrent
17:45TimMctechnomancy: Namecoin is a thing, although I haven't researched it.
17:45nickikmavbozo, see the hole routes table http://paste.lisp.org/display/144407
17:46TimMchiredman: We had a serious internet outage at the office some months back and I was *seriously* considering going around with a thumb-drive and having people rsync stuff onto it.
17:46TimMc(I guess it was very serious. Seriously.)
17:46arrdemnamecoin for groupids would probably work just because it'd be a shake and bake implementation of the blockchain "first registrant wins"
17:47arrdemI was kicking around the idea of Web of Trust, since apparently we trust xeqi and technomancy with our packages :P
17:47arrdemmost trusted package wins given a name conflict..
17:48mavbozonickik: assuming your make-move handler like this (defn make-move [req] ...)
17:48sdegutisLike, can you have a Clojure file that doesn't have an (ns) form at the beginning?
17:48AimHereSurely the most trusted package is the package manager
17:49arrdemnaturally
17:51nickikmavbozo, yes
17:52nickikI tried things like (:body request) and othres
17:52nickikI cant find documentation on this
17:52TimMcsdegutis: You could, but you'd have to manually set up the namespace in external code and then load the file in the context of that ns.
17:52sdegutisAnyone have thoughts on Joodo? http://joodoweb.com/
17:52TimMcSo.... why?
17:53justin_smithnickik: something I find useful is (def debug (atom nil)) and then inside the handler (reset! debug request), then in the shell (keys @debug) and whatever else I want to try until I see what data is where
17:53justin_smithnickik: assuming you have a shell inside the same process as the pedastal server
17:54justin_smithTimMc: clojure.core does it. Not to say that proves it is a good idea.
17:54hyPiRionTimMc: Couldn't you just connect via the intranet? I mean, you should be able to reach people even if the connection to the outside world fails.
17:55TimMchyPiRion: I think intranet was down, come to think of it.
17:55hyPiRionah
17:55TimMcsquirrels in the telecom room or something
17:55nickikinteresting idea in general, but how is that diffrent then just looking at the request param
17:56justin_smithnickik: it is interactively using it, which can be much more expedient than trying to read a large structure
17:56hyPiRionTimMc: wat
17:56TimMcJust guessing.
17:56TimMcIt was down and then it was back up. I never found out what the issue was.
17:56justin_smithnickik: also, lets you write code that accesses the exact request data in the repl, which can speed up development
17:57TimMcjustin_smith: clojure.core splits an ns into multiple files; I think sdegutis was suggesting not even having an ns block.
17:57hyPiRionWe had a broken water pipe right over our server room 2 weeks ago actually. That was a rather interesting experience.
17:57justin_smithTimMc: a classic is when someone plugs an ethernet cable, both ends into one box
17:58justin_smithTimMc: then he is just in ns user the whole time, but I thought he would be doing it from another file that does have an ns block
17:58sdegutisI've beg{a,u}n to disagree with the way mainstream Clojure is written as being the best way, and I'm experimenting with new techniques.
17:58sdegutisI like Clojure a lot, but I don't like the structure of our app at all. It's a stereotypical Clojure web app too.
17:59hyPiRionYou could always try swearjure
17:59nickikThe body is #<HttpInputOverHTTP HttpInputOverHTTP@38d2dd9b> im not sure what that means
17:59justin_smithsdegutis: well, that yak aint gonna shave itself
17:59justin_smithnickik: it's an input stream
18:00justin_smithyou can call slurp on it
18:00sdegutisAre ##(ns foo) and ##(in-ns 'foo) exactly identical?
18:00lazybot(ns foo) java.lang.SecurityException: You tripped the alarm! in-ns is bad!
18:00lazybot(in-ns (quote foo)) java.lang.SecurityException: You tripped the alarm! in-ns is bad!
18:00justin_smithnickik: or whatever else you would do with a java.io.InputStream
18:00sdegutisAh.
18:00sdegutisThanks lazybot for telling me that's a macro and expanding it for me.
18:00justin_smithsdegutis: in-ns does not create the default clojure.core mappings
18:00sdegutisAhh.
18:01nickikshould it not be easier then doing this by hand, can I not just tell pedestal that I expect edn?
18:01sdegutisSweet!
18:01sdegutisI have some very real ideas.
18:02justin_smithnickik: well, thanks to doing this much by hand, we have established that nothing is consuming / interpreting the request body. Yeah, the sane next step is to tell pedastal how to interpret the request body so you can access it more conveniently.
18:02nickikslurp seams to have crashed ...
18:03nickikSo there are no body parsing intersepters provided?
18:03justin_smithnickik: I would be very surprised if they are not available
18:03justin_smithbut you have evidence that they have not been applied
18:05mavbozonickik: put "Content-type: application/edn" in your request header
18:05mavbozonickik: like curl -H "Content-type: application/edn"
18:06nickikah, so if the header is correct it does it automaticlly
18:06sdegutisWait a second, why does (prn *ns*) say #<Namespace user> in a file that starts with (ns foobar.core) ?
18:06justin_smithsdegutis: is the prn happening inside a function or at the top level?
18:06mavbozonickik: {:connect 5} is in :edn-params key
18:06sdegutisOh, apparently it's set to 'user during -main
18:06sdegutisjustin_smith: during -main
18:06justin_smith*ns* is only foobar.core while that is being compiled
18:07sdegutisWhere is it documented to be 'user during -main?
18:07justin_smith'user is always the default ns
18:07amalloysdegutis: *ns* is only set to anything useful at compile time
18:07sdegutisOh. Thanks :)
18:07amalloyjustin_smith: tbh i would have guessed that clojure.core was the default
18:07arrdemit's application/json, right?
18:07justin_smithamalloy: but the repl
18:08amalloy$google json mime type
18:08lazybot[What is the correct JSON content type? - Stack Overflow] http://stackoverflow.com/questions/477816/what-is-the-correct-json-content-type
18:08sdegutisamalloy: wouldn't that make all defs be visible to all new namespaces?
18:08justin_smithsdegutis: defs are global, but namespaced
18:09amalloysdegutis: that's a good point, although not quite right: we're talking about what it is at runtime, and you aren't def'ing anything at runtime
18:09sdegutiso
18:09sdegutisOkay thanks.
18:10mavbozonickik: the body-params interceptor handle that automatically based on known content-type
18:12nickikI see, cool
18:12brucehaumanthis is soo late in the game but I’m checking to see if any of ya’ll want a Clojure conj ticket.
18:12film42424Question for anyone around: I'm trying to implement an interface, but I need several default state variables. Is it better to use reify and a let-block, or should I use deftype and create a function to make sure default state vars are assigned? code: https://github.com/film42/hn-follow/blob/gt/poller/src/hn_follow/core/poller.clj#L13-L16
18:14justin_smithfilm42424: reify+defaults doesn't make since, because reify creates one offs - or do you want a generator function for one-off classes that has defaults?
18:14justin_smiths/since/sense
18:14justin_smithbut either way, the most sensible thing is a function that creates an instance of the right thing, and that function can merge in defaults
18:15film42424justin_smith: ok. It just feels weird to open default params that shouldn't be exposed like that
18:15mavbozonickik: looking at the source code the default supported content-type are application/edn, application/json, application/x-www-form-urlencoded, application/transit+json, application/transit+msgpack
18:15justin_smithfilm42424: why would applying defaults inside a function be "opening" them?
18:16film42424Just because the type is still in the namespace
18:16amalloyfilm42424: reify in a let-block is a pretty normal way to get a stateful implementation of an interface
18:16{blake}brucehauman: For how much?
18:16brucehaumanI’m willing to work with ya at this point.
18:17brucehauman[blake] let me know what you are thinking
18:18{blake}brucehauman: Just wondering if I could swing it (ticket, flight, room).
18:18film42424Ok, thanks amalloy and justin_smith
18:18brucehauman[blake] i’d rather have someone who would benefit use it than let it go to waste
18:19m1dnight_is there a way to take a function (a set of expressions wrapped in a parameterless lambda) and execute it, but cancel it if needed?
18:19justin_smithm1dnight_: ##(doc future-cancel)
18:19lazybot⇒ "([f]); Cancels the future, if possible."
18:19m1dnight_I know in java you have for example isInterrupted() but that requires an explicit check
18:19justin_smithmy favorite doc string evar
18:20m1dnight_hrm, it's the "if possible" that bugs me
18:20nickikmavbozo justin_smith thanks for your help
18:20m1dnight_but I might be able to do something with that
18:20dbaschjustin_smith: lazybot was sent to find John Connor. Are you John Connor?
18:21arrdemlazybot is our only hope
18:21dbaschjustin_smith: but you can reprogram lazybot. Or have you already?
18:22justin_smithm1dnight_: https://www.refheap.com/93603 future-cancel works
18:23m1dnight_hrm, I might look into that
18:23m1dnight_I think I can use it as a tool in this scenario
18:23m1dnight_Ideally a call/cc wouldve been more elegant
18:23justin_smithm1dnight_: the output is a bit weird of course, but hopefully what happened there makes sense
18:23m1dnight_but you can't always get what you want
18:23m1dnight_yeah it sure does :) thnx
18:24m1dnight_I had a thesis meeeting today :p "i'm finding it a bit more difficult than anticipated"
18:24m1dnight_reply: "well.. of course.."
18:24justin_smithm1dnight_: I would be hesitant to do that without a sleep in the loop, even a fairly short one
18:24m1dnight_I realize that
18:24justin_smithcool
18:24m1dnight_But I think I don't really need granularity in cancellation
18:25m1dnight_but I do need assurance of cancellation
18:25m1dnight_I think trying it out would be best
18:25justin_smithm1dnight_: note the realized? function (and the return value of future-cancel)
18:29m1dnight_A few minutes on the whiteboard and I think it's perfect
18:29m1dnight_combined with an add-watch
18:29m1dnight_et voila :p
18:29m1dnight_I love it when a plan comes together! :p
18:29clojurebotPardon?
18:30justin_smithglad I could help
18:30m1dnight_well clojurebot, I mean that my brain excreted endorphines when a certain outcome of a scenario is what I want it to be. Is that clearer?
18:31kzarTrying to get a Clojurescript repl work, started the server with `lein trampoline cljsbuild repl-listen` and trying to connect to it using clojure.browser.repl/connect. When server is running and I load the page it never completes, but never connects. When the server isn't running I instantly get back a connection refused error
18:38csd_Really enjoying Clojure Cookbook
19:09justin_smith$ping
19:09lazybotjustin_smith: Ping completed in 0 seconds.
19:09justin_smithtechnomancy: fustirge is spamming
19:17amalloyjustin_smith: the ping command is really weird. it doesn't really seem to do what it says it does
19:18justin_smith$ping example.com
19:18lazybotjustin_smith: FAILURE!
19:18justin_smith$ping refheap.com
19:18lazybotjustin_smith: Ping completed in 0 seconds.
19:24andyfamalloy: https://github.com/jonase/eastwood#unused-meta-on-macro. I think you suggested this idea. Thx
19:25amalloyandyf: i didn't suggest the eastwood linter, just opened the jira ticket. someone else suggested a linter. glad to see it, though
19:26amalloyandyf: using def in that first example is a little weird, since the metadata there has no impact as far as i'm aware
19:27andyfamalloy: Yeah, example should be better
19:27amalloythe rest of the description is well-written, as i said about one of your earlier drafts
19:28andyfI should wrap them inside .close calls like later examples
19:30csd_Is it possible to reset *out* without opening a new REPL session? I somehow broke something while fooling around with `with-open`, and now I can't print to it.
19:31justin_smithcsd_: you can reconnect to the same nrepl server, and get a working *out* binding in that session
19:31justin_smithif you are running nrepl (which is likely if you are using lein)
19:31csd_ok
19:31justin_smithtechnically it is a different session, but it's the same clojure instance
19:32csd_do you know what happens when *in* and *out* break? i get a similar problem if I halt execution while (read-line) is looking for input
19:32justin_smithso everything you were defining is still there, but things like *out* and *in* and *1 and *e are all rebound
19:32justin_smithcsd_: not really, but I don't use (read-line) in the repl very often
19:34csd_that trick worked, thanks
19:34akkadclojure-py it is
19:35arrdemakkad: check out pixie :D
19:35AeroNotixWhat do people use for their graphite metric exporters?
19:35AeroNotixI'm not satisfied with the current stuff
19:36csd_justin_smith: how would you personally send a complicated string to stdout. right now it seems to me the best option is just to create a StringBuilder and append to it as necessary. i'm wondering whether there might be a better approach
19:36AeroNotixcurrent being codahale, dropwizard java libraries
19:36justin_smithcsd_: str uses a StringBuilder btw
19:36akkadpre-alpha./
19:36justin_smithbut some things are easier if you explicitly use a StringBuilder, yeah
19:37justin_smithbut definitely construct the whole thing before printing
19:37amalloycsd_: also, printf and format
19:37csd_i'd love to find some resource that makes me more comfortable on when to use mutability
19:38justin_smithcsd_: if there is no code-path that leaves the current thread, and you don't return the mutable value, it is probably OK - but still only opt into mutability when it is needed
19:38justin_smithsometimes returning a mutable thing can be OK, if it is only passed forward and not mutated concurrently, and using an immutible value is excessive overhead. But profile first.
19:38csd_what about atoms used infrequently to track state at a namespace level?
19:39amalloycsd_: an antipattern
19:39amalloybecause it makes your whole program a singleton
19:39justin_smithcsd_: I am OK with that if the atom is named "debug" and isn't in any code that ships
19:39justin_smithif any logic depends on the atom contents, probably a sign of poor design
19:40amalloyit's also okay-ish for an application, where you know that being a singleton is okay, although usually it turns out a lot cleaner if you design as if multiple instances are possible anyway
19:40justin_smithright
19:40csd_by singleton do you just mean that it prevents code reuse?
19:40justin_smithcsd_: it means two different parts of the same code base can't use the same lib
19:40justin_smithbecause it holds state
19:41justin_smithwhat if you write lib a, that uses a global atom, and I want to use libs b and c that both want to use lib a
19:41justin_smithI'm probably stuck
19:41csd_i was thinking though that the alternative to using globals for state is to cram them all into a map that gets passed from function to function, and that doesn't seem particularly elegant to me either
19:41justin_smithcsd_: it works
19:42sdegutisDo you absolutely need to use :gen-class when deploying a pure Clojure stand-alone .jar?
19:42justin_smithsdegutis: absolutely not
19:42justin_smithjava -cp some.uber.jar -m some.uber.main
19:43justin_smitherrr
19:43justin_smithjava -cp some.uber.jar -m clojure.main some.uber.main
19:43sdegutisThanks!
19:43justin_smithsomething like that
19:43justin_smithyou can make clojure load that ns/ run that main
19:43sdegutisfustirge: spambot
19:49sdegutisWhere did load-script go?
19:49sdegutis,load-script
19:49clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: load-script in this context, compiling:(NO_SOURCE_PATH:0:0)>
19:49dbaschsdegutis: clojure.main
19:50sdegutisAlso, is there a better way of doing this? (load (slurp (io/resource "bla.clj")))
19:50sdegutisOr maybe I meant s/load/eval/
19:50andyfload-file maybe ?
19:51sdegutisThat seems to not find stuff in my jar's resources.
19:53andyfsdegutis: Do you have :resource-paths in your project.clj ?
19:54sdegutisandyf: Ah no, but it's just ./resources/
19:54andyfVerified that bla.clj is really in your jar ?
19:54sdegutisNope :)
19:55andyfI don't know if there is a default for resource path or not
19:55justin_smithandyf: load-file wouldn't load from the classpath would it?
19:55andyfI haven't tried, but don't know a reason why not off hand
19:56sdegutisRight now I'm just doing (eval (read-string (slurp (io/resource "bla.clj"))))
19:56justin_smithsdegutis: perhaps you want load-string
19:56sdegutisYep!
19:56justin_smith(load-string (slurp (io/resource ...)))
19:56sdegutisThat's way better.
19:56justin_smithoooh
19:57justin_smithtry (load-reader (io/resource ...))
19:57justin_smiththat should work
19:57sdegutisjava.net.URL cannot be cast to java.io.Reader
19:57justin_smithOK
19:57justin_smithso load-string it is
19:59justin_smith(load-reader (io/input-stream (io/reader ...))) works
19:59justin_smiththree calls, either way
19:59sdegutisI'm still trying to find a way to make it work with load-file
20:00sdegutisOr maybe even (load).
20:00sdegutishttps://clojuredocs.org/clojure.core/load -- seems to suggest it looks in jar's resources.
20:00sdegutisExcept that I want it in the stand-alone uberjar.
20:08amalloysdegutis: resources are included in the uberjar
20:15justin_smithamalloy: (load (io/resource "name.clj")) gives "URL cannot be cast to String"
20:16amalloyjustin_smith: okay?
20:16justin_smithamalloy: sorry, misread some backscroll
20:24justin_smithsdegutis: oh, (load "/foo/bar") will find src/foo/bar.clj
20:25justin_smiththe trick is to leave off the .clj part
20:25justin_smith(and put in a / to make it classpath relative)
20:28sdegutisjustin_smith: But that won't find src/foo/bar.clj in the uberjar.
20:28justin_smithyes, it will
20:28sdegutis!!
20:28justin_smith the leading / means look int the classpath
20:28sdegutisMy earlier test must have then been faulty.
20:28justin_smithdid you have a leading / ?
20:28sdegutisAhh, nope.
20:28sdegutisjustin_smith = gentleman + scholar
20:31sdegutisjustin_smith: that even works without io/resource
20:31justin_smithsdegutis: right
20:31sdegutis(load "/foo/bar") will find src/foo/bar.clj
20:31sdegutisAwesome!
20:31justin_smithindeed
20:32sdegutisThis is going to make my view files a lot slimmer.
20:33justin_smithsdegutis: I like the greater referential transperency of require, and putting the whole ns definition in one file
20:33justin_smithsdegutis: in the very least, put a comment in the file you are loading indicating who loads it...
20:33sdegutisI'm doing a convention-over-configuration thing here.
20:33sdegutisSo it'll be clear who uses it by its path.
20:34sdegutisOh no! The return value from (load) seems to be nil now!
20:34justin_smithyeah, load-reader returns the last thing in the file, load returns nil
20:34justin_smithfor whatever reason...
20:34sdegutisWeird.
20:35sdegutisDang, it was just (load "/foo") for a second.
20:35sdegutisNow it's gotta be that 3-call long thing again :(
20:35arrdemmakes sense to me... we need a way to load reading a value for files like data-readers
20:35justin_smithor, you may even have to write a function that calls three functions!
20:35arrdembut in general load for side-effects is bad..
20:39sdegutisarrdem: Yeah I was hoping to get a return value from it, nothing else.
20:39sdegutisDang.
20:43sdegutisAhhh.
20:43sdegutis(load) runs a doseq on all the paths, thus it returns nil.
20:43sdegutisWhatever, I'll just use clojure.lang.RT/load
20:44sdegutisThat's public so why not, right?
20:44arrdembecause it's an undocumented implementation detail that's not portable?
20:44sdegutisPortable to what?
20:45sdegutisarrdem: Do you mean I won't be able to run my code in a JavaScript environment or the CLR?
20:46sdegutisarrdem: I'm already making use of JVM-specific features so this isn't really a show-stopper.
20:46sdegutisjustin_smith: the load-reader one seems to not work if it's in src/
20:46justin_smitheven if it is on the classpath?
20:47justin_smithwait, are you specifying the path classpath relative, or relative to current dir, or?
20:52sdegutisjustin_smith: I don't even know how to make the load-reader version work.
20:52sdegutisjustin_smith: I tried variations on your incantation from above and all threw exceptions.
20:53justin_smith(load-reader (clojure.java.io/reader (clojure.java.io/resource "foo/bar.clj")))
20:53sdegutisWon't that only work if the file is ./resources/foo/bar.clj ?
20:53sdegutisAnd not ./src/...?
20:54justin_smithsrc/ is on the classpath
20:54sdegutisI was hoping to avoid putting these files in ./src -- oh.
20:54justin_smithresource just means "look in the class path"
20:54sdegutisOh!
20:54justin_smithso you could add an extra "loadable/" dir, and put it on the classpath
20:54justin_smithand it would work
20:54sdegutisIT WORKED!
20:55sdegutisI am so excited.
20:55sdegutisI love how small a Clojure hello-world is.
20:56sdegutis31 lines total, counting all 4 files, for my little experiment.
20:56sdegutisAnd 9 of them are just a .gitignore!
20:56justin_smithheh
20:56sdegutisThanks justin_smith for saving the day.
20:56justin_smithnp
20:57amalloysdegutis: a clojure hello-world is 13 characters
20:57amalloy"hello world"
20:57justin_smithyou should add a bunch of crap to gitignore so you can say the majority of the lines in your codebase are .gitignore
20:57sdegutisamalloy: https://www.dropbox.com/s/mwl5o8tyb88np3k/Screen%20Shot%202014-11-18%20at%207.56.34%20PM.png?dl=0
20:58sdegutis(It was a pretty thorough experiment.)
20:58sdegutisjustin_smith: lol
20:59justin_smithsdegutis: what do you think of (-> "rtest/views/one.clj" io/resource io/reader load-reader)
21:01sdegutisjustin_smith: much sexier
21:02gfredericksI was trying to write a script to notify me when clojars came back up and it was back up before I could finish
21:02sdegutisjustin_smith: ultimately it'll be hidden away in a small function somewhere though anyway
21:02amalloyjustin_smith: i don't like it. if you i'd prefer something like (load-reader (-> "rtest/views/one.clj" (io/resource) (io/reader))), if you are going to use ->
21:02sdegutisgfredericks: ha
21:02sdegutisamalloy = gentleman / scholar
21:02amalloythe fully-arrowed version makes it hard to find the important part, ie that you are reading something
21:02amalloynon-arrowed makes it hard to find what you are reading
21:02gfredericks(inc technomancy) ;; keepin the clojars fire alive
21:02lazybot⇒ 158
21:03amalloypartial arrowing brings those both to the forefront and hides the boring details
21:03justin_smithamalloy: nice, I like that
21:03amalloybut i think fully arrowed is harder to read than no arrow at all, here
21:07TEttingerwell, it looks like many of the pros are here, except technomancy. I'm having a hard time understanding why this JRE bundler (Packr) works with a "Hello World" runnable jar made by java tools (eclipse and a java source file), but fails on any play-clj projects with lein uberjar. I suspect it maybe related to a macro in play-clj
21:08TEttingerthe macro in question: http://oakes.github.io/play-clj/core.defgame.html
21:08TEttingerI'm not sure if this does something that makes the uberjar's main class invalid somehow
21:09TEttingerthis issue is here on Packr, it might need posting on play-clj's issue tracker https://github.com/libgdx/packr/issues/33
21:10TEttingernotably, someone got it working with a java main class loading a clojure class, but I couldn't figure out how to do that in lein
21:12amalloyTEttinger: it's pretty easy to write a java shim that just loads the clojure runtime and then calls some var of yours
21:12clojurebotexcusez-moi
21:12TEttingerright, but can that be done from inside one mixed java-clojure project?
21:12justin_smithamalloy: is there a walk through or blog post about doing that anywhere?
21:12amalloyof course. i do it all the time
21:12amalloyuhhhhhhh
21:13TEttingerand the end goal of this is to run packr on arbitrary clojure projects
21:13amalloyhere, use https://github.com/amalloy/thrift-gen as your example
21:13TEttingeras a lein plugin
21:13TEttingercool thanks
21:13justin_smith(inc amalloy)
21:13lazybot⇒ 195
21:13justin_smiththanks
21:13gfrederickswhat's the standard leiningen setup for when you want to run tests with lots of clojure versions? I started with aliasing "test" to a bunch of calls to with-profile/test, but that feels weird
21:14gfredericksbut I worry if I call it "test-all" I'll just forget to run it
21:14amalloyit has a bunch of junk you don't care about for making stuff java-friendly; the core is just the static {} block at the top, the one-arg constructor, and buildSamples(int)
21:14TEttingeramalloy: there's no :main in there -- it won't work as an uberjar, will it?
21:14amalloyTEttinger: just add :main my.java.Class to project.clj
21:14amalloyi think
21:15amalloyand no, this is a library, not an application, so it has no main
21:15amalloybut this is how you write a java bridge to your clojure code all in one project
21:15xeqigfredericks: something like `lein all test` w/ https://github.com/xeqi/peridot/blob/master/project.clj#L28 ?
21:15amalloyor how i do it, anyway
21:15TEttingerk, the issue I had was that the java couldn't see the clojure files
21:15TEttingerclass files i mean
21:15gfredericksxeqi: woah look at those colons
21:15amalloywell yeah, it shouldn't have to
21:16amalloydepending on what kind of interop you're doing, i suppose
21:16amalloymy sample project only uses vars, doesn't create any classes from clojure; if you want to do that it's substantially harder
21:16TEttingerjava calling clojure code with a call to proxy in it
21:16amalloythat's fine
21:16amalloyjust call the function through its var
21:17amalloyyou don't need to see any classfiles
21:17justin_smithTEttinger: maybe you want to just use clojure.lang.RT to require and run the main namespace?
21:17xeqigfredericks: did you see technomancy's tweet about the new highlighting with racket? https://github.com/technomancy/atreus/blob/master/atreus.rkt#L222
21:17gfredericksI did see that :)
21:18justin_smithxeqi: it's a good thing that's highlighted, or he may not have noticed he was accidentally using vectors
21:18justin_smithxeqi: common mistake
21:18gfredericksxeqi: this is a cool lein trick thanks
21:19arrdemis there a good name for symbols like finally, catch and the core.async channel operators that are actually just tokens other macros look for?
21:20gfredericksheadaches
21:20brehautsentinals
21:20gfredericksclojure even uses keywords like that in one or two places
21:20amalloyarrdem: they are, in a way, anaphora
21:21justin_smithamalloy: what thing is "catch" a pronoun for?
21:21gfredericksmaybe that's slightly weirder
21:21amalloygfredericks: thinking of cond :->, or whatever the token is?
21:21technomancyaren't they just special forms?
21:21gfredericksamalloy: yeah
21:21amalloytechnomancy: no
21:21arrdemtechnomancy: but special form implies compiler rather than macro support
21:21technomancythe compiler* looks for them
21:21technomancy* - fsvo complire
21:21technomancyarrdem: macros are just compiler directives
21:22amalloytechnomancy: try is a special form, which handles nested catches specially, but catch is not itself a special form
21:22arrdembasically I'm looking for a name for a documentation entity that redirects to something else :P
21:22amalloyjustin_smith: i think you're right that anaphor is wrong
21:22arrdemas catch and finally punt to try right now
21:22brehautarrdem: i think its normally used as a terminator in lists and trees, but its kind of fullfilling the same role
21:23arrdembrehaut: sure
21:23TEttingeramalloy: what does this do: generator = Clojure.var("thrift.gen", "struct-gen");
21:23TEttingeris it calling struct-gen ?
21:23amalloyguys if you actually call it sentinal instead of sentinel i will die
21:23TEttingeror is that defined in thrift,gen
21:24amalloyTEttinger: it's (let [generator #'thrift.gen/struct-gen]). have you read any of the code or docs for clojure.java.api.Clojure?
21:24TEttingerno
21:25amalloywell, i recommend you do so. its javadoc contains an annotated example of how to call clojure code from java
21:25amalloyit's like the only class in all of the clojure source that has decent javadoc
21:25TEttingerso it's just getting a var from that ns, and assigning to one in this one?
21:25TEttingercool
21:25justin_smiththat's like a version of "bro, do you even lift?" for #clojure
21:25TEttingerI'll take a look, thanks
21:25TEttinger(inc amalloy)
21:25lazybot⇒ 196
21:39arrdemdanielcompton: OSS is totally a hardware store if you have enough karma to get other people to do work for you :P
21:39danielcomptonghadishayban: interesting https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/PersistentHashMap.java#L752
21:39danielcomptonoops
21:40danielcomptonarrdem: someone's got to sweep the floors still :)
21:40danielcompton(dec someone)
21:40lazybot⇒ 1
21:40weiis there an argument I can pass to take-last that will take the entire collection?
21:41danielcomptonwei: why do you need to take-last at all if you want the whole thing?
21:43weiin my function, you can specify a limit through an options map. if it’s nil, i want to return the whole thing. so I need a function that works like take-last, but (take-last nil (range 3)) => (0 1 2)
21:43danielcomptonwei: I'd probably just avoid the take-last call entirely in an if branch
21:43danielcomptonwei: if I understand you correctly
21:44danielcompton$karma aardem
21:44lazybotaardem has karma 0.
21:44danielcompton$karma arrdem
21:44lazybotarrdem has karma 39.
21:44danielcomptonaaardem the pirate
21:44arrdemnobody likes my jokes and the newbies don't know to inc :P
21:45metelluswei: you could maybe use fnil
21:46danielcomptonarrdem: you gotta sneak in at night and inc yourself when no-ones here
21:46arrdemhehe
21:46metellusi don't think lazybot allows that
21:46arrdemat night andyf and TEttinger come out to keep the peace
21:47arrdemclearly my only question is to ask myself questions
21:47arrdem*s/question/option/g
21:47danielcompton(inc danielcompton)
21:47lazybotYou can't adjust your own karma.
21:47danielcomptonkicks lazybot
21:49TEttingeramalloy, ok this is odd, certainly. I keep getting type errors when I try to take the var I get out of clojure and use its value (it's been def'd) in java
21:49danielcomptonIs ##java the right place to ask questions about Java stuff?
21:50TEttingerdanielcompton: someone once tried to pay me to do his homework in ##java
21:50TEttingerI think I convinced him to go into a business major instead
21:50andyfdanielcompton: Was that phm source link intended to point to something you believe is a bug?
21:50marshallhey clojure
21:50danielcomptonTEttinger: I hope you asked for his uni email address then reported him to his lecturer
21:50TEttinger"you certaily have the moral flexibility needed for business"
21:50danielcomptonandyf: nope, I was going through my previous replies and accidentally pressed enter
21:51marshallI have a ring server that sometimes 404s when I try to POST to /. like, it'll 404 when i try to do it using Postman (chrome app for making requests) and it'll work fine when I use cURL
21:54danielcomptonTEttinger: solved my problem, learned more about unicode, didn't need to delve into ##java
21:54TEttingernice
21:55amalloymarshall: sounds like you need to find out what's different between the two different kinds of requests
22:01gfredericksmarshall: `nc -l 9000` is helpful for debugging the difference between two http clients
22:01marshallok
22:02marshallthat'll show me everything going across port 9000, yeah?
22:02jgdaveymarshall: You would make a request using both clients to that listener
22:04jgdaveyi.e., run netcat (nc) in one pane, then curl in another. Repeat for Chrome.
22:04mindbender1pallet's api names are a disturbance to my thought process.
22:04marshallok, thanks
22:07andyfDoes anyone else wish Clojure compiler messages gave full paths and/or URIs instead of the path relative to where the file is in an unspecified one of your classpath items?
22:08danielcomptonandyf: after looking at python stack traces, not particularly
22:09andyfDo any existing dev environments figure out where those things are? If so, how? I guess they could just do io/resource on them?
22:10Jesterman81hey ladies/gents, how are you configuring your clojure apps?
22:10hiredmanwe had a patched clojure at work back around 1.2 I think that added full path names to compiler excetions
22:10arrdemandyf: io/resource is the smartest thing I'm aware of besides classpath introspection via tools.classpath
22:10marshallwhat's the most popular clojure web framework?
22:11marshallclojure and java are completely foreign to me, and i'm trying to create a simple api that uses duckling to parse date ranges in natural language
22:11marshalli'm having a lot of trouble with this compojure framework
22:12danielcomptonmarshall: is there a specific issue we can help with?
22:13marshallthis is my clojure app: http://pastebin.com/EyjSVcu9
22:15danielszmulewiczhowdy, is there anything new regarding generating externs for cljs advanced compilation. Anything else besides Chris Houser's gist?
22:16danielszmulewiczdnolen_ said something about integrating that functionality in the clojurescript compiler. Has it been done?
22:16alandipertdanielszmulewicz: https://github.com/myguidingstar/fence is pretty cool
22:16danielszmulewiczalandipert: Oh, thank you indeed, sir.
22:16marshallposting to the one route with cURL: http://pastebin.com/Rcf8VXex
22:19danielcomptonfence (verb) - to put a̶ ̶f̶e̶n̶c̶e̶ parentheses around something
22:26danielszmulewiczalandipert: Is fence only for js property access or for all js interop?
22:27alandipertdanielszmulewicz: i think it does everything, since everything desugars into dot. i haven’t used it myself tho, could be wrong
22:27danielszmulewiczalandipert: OK, I'll give it a try. Thanks.
22:28danielszmulewiczalandipert: it overloads .., and has no api, so it doesn't make sense in all forms.
22:28danielszmulewiczalandipert: But I might be wrong. I'll try.
22:29alandipertdanielszmulewicz: check out the readme, it has things :-)
22:29danielszmulewiczalandipert: Yes, but that's the thing. The README is what confuses me. I'm looking at source code now.
22:31alandiperti think myguidingstar is even among us, perhaps he can illuminate
22:33danielcomptonWhere are you myguidingstar? Did you just vanish from sight, a comet passing in flight?
22:39sdegutisWhy is it that ##(let [foo 3] (load-string "foo")) doesn't work?
22:39lazybotjava.lang.SecurityException: You tripped the alarm! load-string is bad!
22:40sdegutisDoesn't load-string evaluate it in the context of the calling function?
22:40sdegutisIf not, is there a way to accomplish this?
22:41TimMcsdegutis: Locals are a lie.
22:41danielcompton,(def foo 3)
22:41clojurebot#'sandbox/foo
22:41TimMcThe compiler checks where each local is going to be used and clears it after the last use.
22:42danielcompton,(load-string "foo")
22:42clojurebot3
22:42sdegutisSurely there has to be a way to do this without using def or with-redefs?
22:42TimMcYou can inspect the lexical environment from inside a macro, but once your code is *executing* it's too late to dynamically refer to locals.
22:43danielcompton,(println "(inc danielcompton)")
22:43clojurebot(inc danielcompton)\n
22:43danielcomptonfoiled
22:43TimMc&(defmacro locals [] (keys &env))
22:43lazybotjava.lang.SecurityException: You tripped the alarm! def is bad!
22:43TimMc,(defmacro locals [] (keys &env))
22:43clojurebot#'sandbox/locals
22:43sdegutisdanielcompton: lazybot ignores clojurebot
22:43TimMc,(let [a 1 b 2] (locals))
22:43clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
22:44TimMceh, I don't remember
22:45TimMc,(defmacro locals [] (vec (keys &env)))
22:45clojurebot#'sandbox/locals
22:45sdegutis,locals
22:45clojurebot#<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'sandbox/locals, compiling:(NO_SOURCE_PATH:0:0)>
22:45sdegutis,(locals)
22:45clojurebot[]
22:45sdegutis,(let [a 1 b 2] (locals))
22:45clojurebotnil
22:45sdegutisHaha
22:46TimMc,(defmacro locals [] (count (keys &env)))
22:46clojurebot#'sandbox/locals
22:46TimMc,(let [a 1 b 2] (locals))
22:46clojurebot2
22:47TimMc,(defmacro locals [] (vec (map keyword (keys &env))))
22:47clojurebot#'sandbox/locals
22:47TimMc,(let [a 1 b 2] (locals))
22:47clojurebot[:b :a]
22:47TimMcThere, now I'm not trying to call (2 1) or (:b :a) :-P
22:48sdegutisAnyway, this still doesn't give load-string any access to them :/
22:48TimMcright, you'd need a macro to grab the locals ahead of time
22:48sdegutisWell I'm not even talking about from that side of the picture.
22:48sdegutisI want to have a way to "create" locals inside the environment being run by load-string.
22:50TimMcI don't know what that means and I'm going to bed.
22:50TimMc(I'm curious, but up late.)
22:50sdegutis:)
22:51sdegutis(with-vars-somehow {:foo 3} (load-string "foo"))
22:51sdegutisI want 3.
22:51sdegutisThat's all :)
22:53danielcomptonsdegutis: what if you built up your let as a string inside your load-string
22:53sdegutisdanielcompton: What is this, SQL?
22:53danielcomptondata is code, code is strings
22:54sdegutisWhat is this, Korma?
22:54arrdemdanielcompton: pls don't go around telling people to eval strings. pls.
22:54danielcompton(inc sdegutis )
22:54lazybot⇒ 1
22:54danielcomptonarrdem: I figured he was already at load-string by himself
22:55danielcomptonsdegutis: in case my shudder wasn't clear, I don't think building up a let string is a good idea
22:56myguidingstardanielszmulewicz, danielcompton sorry, I'm back now
22:57danielszmulewiczmyguidingstar: oh, the star we've been waiting for :-)
22:57danielszmulewiczmyguidingstar: nice work on fence.
22:58myguidingstarcan you restate the question?
22:58sdegutisHmm, I can see building up a form with a combination of read-string and some semi-quotes, and then evaling it.
22:59sdegutis,(eval `(let [foo 3] ~(read-string "foo")))
22:59clojurebot#<CompilerException java.lang.RuntimeException: Can't let qualified name: sandbox/foo, compiling:(NO_SOURCE_PATH:0:0)>
22:59myguidingstarfence is a hack against Google closure compiler
22:59sdegutis,(eval `(let [foo# 3] ~(read-string "foo")))
22:59clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: foo in this context, compiling:(NO_SOURCE_PATH:0:0)>
22:59danielszmulewiczmyguidingstar: sure. Is it meant to be used for js property access only or all forms of js interop?
23:00myguidingstardanielszmulewicz, the example in README shows both property and method calls
23:00sdegutis,(eval `(let [foo# 3] ~(read-string "foo__793__auto__")))
23:00clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: foo__793__auto__ in this context, compiling:(NO_SOURCE_PATH:0:0)>
23:00sdegutislol
23:00sdegutisThere /must/ be a way!
23:01danielszmulewiczmyguidingstar: I don't understand the examples in the README.
23:01sdegutisz
23:02myguidingstarI'll update the README with technical details about the way Google Closure compiler renames symbols in advance optimization mode
23:02danielszmulewiczmyguidingstar: the line "(->> (.. js/something -someAttributes aMethod (anotherMethod "arg1" "arg2"))
23:02danielszmulewicz (.log js/console))" has too much in it. It would be good if you can break it down, and explain how to go about the different type of js interop cases.
23:03myguidingstarwithout extern files, a.longName will be renamed
23:03myguidingstarwhile a['longName'] won't
23:03danielszmulewiczmyguidingstar: I understand what it does.
23:03danielszmulewiczmyguidingstar: I don't understand how to use it.
23:04danielszmulewiczmyguidingstar: For example, I have (.bind js/Ladda) that I would like to use without externs.
23:04danielszmulewiczmyguidingstar: what would be the syntaxt for this scenario?
23:04danielszmulewiczwith fence, I mean.
23:04myguidingstardanielszmulewicz, two steps:
23:04myguidingstar1. refer to fence.core/.. in your ns form
23:05myguidingstar2. replace (.bind js/Ladda) with (.. js/Ladda bind)
23:05danielszmulewiczmyguidingstar: Ah, now I get it.
23:06myguidingstarokay. Any suggestion for a better README? danielszmulewicz
23:07danielszmulewiczmyguidingstar: Yes, but just to make it clear: when I do somewhere else (.. js/window -location -hostname), since .. is overladed, what happens?
23:07myguidingstarit works, of course ;)
23:08danielszmulewiczmyguidingstar: OK, but symbols get renamed or not in this case?
23:09myguidingstaras long as you use fence.core/.., NO symbols get renamed ;)
23:10myguidingstarfence.core/.. use `aget` which produces javascript like window['location']['hostname']
23:10danielszmulewiczmyguidingstar: Ah, so that's what I wanted to know.
23:11myguidingstarand Closure will optimize it to window.location.hostname, not window.a.b etc
23:11danielszmulewiczmyguidingstar: OK, but then just let me clarify the next thing if you will.
23:11myguidingstaryou're welcome
23:12danielszmulewiczmyguidingstar: The "promise" of fence is that when the cljs compiler will provide the functionality required, you could remove the reference to fence and everything should work without modification, right?
23:13myguidingstaryes
23:13danielcomptonwelp http://azure.microsoft.com/en-us/status/#current
23:13sdegutisHow do you do (load-reader) but don't evaluate it, just get a form back from it?
23:13danielszmulewiczmyguidingstar: However (.. js/Ladda bind) should actually be (. js/Ladda bind) without fence. So how do you keep that "promise" as it were?
23:15myguidingstardanielszmulewicz, it's the cljs compiler responsibility now
23:17danielszmulewiczmyguidingstar: I don't understand.
23:17danielszmulewiczmyguidingstar: js interop for method invocation is one dot. With fence is two dots. How will you reconcile that?
23:19myguidingstarbut .. just works, right? danielszmulewicz
23:20myguidingstarI tried to override ".", too but the cljs compiler doesn't allow that
23:20danielszmulewiczmyguidingstar: .. is meant for nested property acccess. (.. js/object -prop1 -prop2 -prop3) ;; JS output: object.prop1.prop2.prop3;
23:21danielszmulewiczmyguidingstar: it's not the same as one dot.
23:21myguidingstarand Clojure doesn't allow reader macros (which is good imo) so I can't change the way (.-something ...) behaves
23:21myguidingstardanielszmulewicz, but they're equivalent. Don't worry
23:23myguidingstardanielszmulewicz, I wish I could do that. See FAQ#3
23:26danielszmulewiczmyguidingstar: OK. So I guess I need to test it and see it for myself.
23:27danielszmulewiczmyguidingstar: I think you could break down the exaples in the README to clarify usage.
23:27myguidingstaryeah, I'm thinking of throwing away the console.log
23:27myguidingstarthanks
23:28danielszmulewiczmyguidingstar: That (.method js/object) should be written (.. js/object method), and stuff like that.
23:28myguidingstargot it ^^
23:32danielcompton,(doc aget)
23:32clojurebot"([array idx] [array idx & idxs]); Returns the value at the index/indices. Works on Java arrays of all types."
23:33danielszmulewiczmyguidingstar: In the README I would make extra clear that any usage with .. means no renaming, and also remind the option of using `aget to eschew fence in those cases.
23:33danielcomptonReading the docstring, I thought I could get it to return multiple values if I passed multiple indices.But it's actually for accessing sub-arrays. That was confusing to me, am I an outlier here?
23:35myguidingstardanielcompton, aget is a bit platform specific
23:35danielcomptonmyguidingstar: what does it do in cljs?
23:36myguidingstarin javascript, it just compiles to obj['prop-or-meth']
23:36bbloommyguidingstar: well it compiles to obj[...]
23:36bbloomit's not necessarily a string key
23:37myguidingstaryeah, string is in fence's case
23:47arrdemtechnomancy: late but ping
23:49tsanteropretty sure that ping timed out
23:49arrdem's fine