#clojure logs

2014-05-27

00:01tolstoyFrozenlock: I wonder if that info is in one of the dot files in the project root?
00:02FrozenlockI'm gonna go with 'no'
00:02FrozenlockUnless it's hidden in .nrepl-port :-p
00:02tolstoyThere is, I think.
00:03tolstoy-U
00:03tolstoySee bottom of this page: https://github.com/technomancy/leiningen/blob/master/src/leiningen/deps.clj
00:03tolstoyOr, "lein help deps".
00:04FrozenlockThat might just do it! Thanks!
00:04tolstoyNo prob. :) I had no idea myself.
00:31hellofunkIf anyone uses Om, I’m curious the advantage to building a separate component for each <li> rather than just a single component for the entire parent <ul>.
00:41ddellacostahellofunk: it entirely depends on your data model
00:41ddellacostahellofunk: it can make sense if you have a data model where the individual li elements get added to or removed from frequently
00:41hellofunkIs a component basically something that will be treatedly individually in the React virtual DOM ?
00:42ddellacostahellofunk: yes, as far as Om it may be re-rendered or not based on referential equality checks
00:42hellofunkIs see, so the advantage of having a separate component for each <li> would be if one were to change and the others not, then the entire <ul> would not be re-rendered, only that specific <li>
00:43ddellacostahellofunk: yep.
00:43hellofunkIs Om basically relying on React for this logic, or is Om also doing its own virtual checks
00:44ddellacostahellofunk: well, Om has its own check in place for shouldComponentUpdate so that it can take advantage of immutability to do the checks. Take a look here: http://www.infoq.com/news/2014/01/om-react
00:45hellofunkddellacosta thanks I shall read now
00:45ddellacostahellofunk: sure thing.
00:46ddellacostahellofunk: and actually the relevant code is quite simple: https://github.com/swannodette/om/blob/master/src/om/core.cljs#L225-L249
00:48hellofunkddellacosta what is that “this-as” function? It’s not in core or defined elsewhereon that page
00:49ddellacostahellofunk: ah, that's for referring to the javascript "this"
00:50ddellacostahellofunk: meh, having a hard time finding a reference to that
00:51hellofunkno problem ddellacosta, just hadn’t seen that before
00:51ddellacostahellofunk: it's mentioned here, but not described: http://himera.herokuapp.com/index.html
00:51amalloyhellofunk: (this-as x (foo x)) is like (foo js/this), if js/this were a real thing
00:51ddellacostahellofunk: yeah, once you see it in the code I suppose it's easy to figure out how it works
00:51hellofunki’m not a JS expert by any means, so hopefully that will not be a hinderance when using Om
00:51ddellacostahellofunk: oh, I don't think so, but obviously you'll hit some JS-specific stuff here and there that you'll have to learn
00:52ddellacostaamalloy: thanks
00:52beamsois it worth using om/react for rendering tables?
00:53ddellacostabeamso: yes? depends? need more context to answer that
00:53Jaoodwhat is not worth is using cljs without react :P
00:53ddellacostaJaood: I definitely disagree, but I think React certainly adds a lot of value.
00:54amalloyactually i'm now curious why js/this isn't a real thing. my guess is that if it were, you'd get into just as much of a mess using it as you do in javascript
00:55amalloyso you're forced to use this-as instead
00:56Jaoodddellacosta: I don't know, looks like there aren't many appealing features of using cljs directly on the dom
00:56hellofunkamalloy do you mean that having to the “this-as” macro explicitly will encourage you to not use the js native “this” so much?
00:56ddellacostaamalloy: good point. Seems like a reasonable theory...minimizing the use of "this" is a good idea in CLJS, methinks.
00:56amalloywell, i mean it will encourage you to not give it the same name everywhere, so you can sort out which this you're talking about
00:58ddellacostaJaood: I think using ClojureScript is a tremendous win over using JavaScript, regardless of whether you are interacting with the DOM or not.
00:58hellofunkso js/* is not a direct map to all of what is in JS, then? I guess I thought typing js/ was just opening a window to native JS land. But you suggest that it has been curated to only allow some native JS through, which I didn’t realize. If I understand you correctly amalloy
00:58amalloythat is, i presume that (fn [x] (this-as t1 (.foo x (fn [] (this-as t2 [t1 t2]))))) doesn't just expand to "this" twice, but to capturing two different this's at appropriate scopes
00:59amalloy*shrug* i dunno, i don't write any js
00:59amalloyer, cljs
00:59ddellacostahellofunk: nope, there are very specific js interop functions and special forms in ClojureScript, it's not one-to-one like that.
00:59amalloybut obviously js/foo can't map to *all* js constructs, like you can't write js expressions in there as js/"1 + 2"
00:59Jaoodddellacosta: isn't to much work to write idiomatic cljs in such a stateful world like the dom?
00:59ddellacostahellofunk: unfortunately I don't know of any good docs for that other than the code itself. Really need something better than this: http://himera.herokuapp.com/synonym.html
01:00ddellacostaJaood: it's easier than writing stateful JavaScript
01:02ddellacostaamalloy, hellofunk: ha, I guess it wraps "js* this" under the covers...interesting: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/core.clj#L651
01:02amalloyjs* is the real magic
01:02ddellacostaright
01:03ddellacostainteresting...
01:03amalloymy understanding is that js* appears to allow you to write arbitrary javascript, but if you try to use it yourself you'll be surprised
01:03Jaoodddellacosta: ok, I´ll going with it, I guess reacts makes thing much nicer anyway
01:03amalloyyou're certainly never supposed to use it
01:03Jaood*keep
01:04ddellacostaJaood: sure, I definitely agree wholeheartedly with that.
01:04hellofunkamalloy curious, where is js* defined? not in that source ddellacosta linked
01:07ddellacostahellofunk: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/analyzer.clj#L1276
01:08ddellacostahellofunk: it looks like it gets processed in the analyze phase
01:08ddellacostawhich makes sense
01:10hellofunkif I may ask a dumb question, looking at core.clj there, there is no require for cljs.analyzer, yet it can alias it. aren’t you supposed to require a ns before you can access it, or alias it?
01:13ddellacostahellofunk: in Clojure at least I know you can refer to stuff using the full namespace without require/use'ing it. I'm not sure about the mechanisms involved, so maybe someone more knowledgeable about it than I can give more background, I just know it does work.
01:14hellofunkddellacosta oh ok, I thought a source file could not know about another namespace unless it explicitly referred/required/used it
01:14hellofunkperhaps if you are not going to alias or refer any functions, then using require is just a convention to make the source more readable?
01:15ddellacostahellofunk: yeah, again, I suspect that there is some kind of dynamic dependency resolution going on there for namespaces which are fully qualified. Makes sense on some level, but again, I don't know the nitty-gritty well so I can't comment on it past my own experience.
01:39hellofunkIn Om, I’m trying to understand the difference between emitting an om/component from the om/root fn vs just emitting the contents of the om/component, such as a dom/ul. If you don’t use om/component macro, then technically what you return is not a component and just goes straight to the DOM with no virtual checks?
01:39hellofunki.e. (om/component (dom/ul …. )) vs just (dom/ul….)
01:41kelseygihi—in scala we have a call Future.successful{some-expression} that evaluates the expression in the current thread rather than spawning a new one. is there something similar in clojure? i need to pass a future into something in a test and i don’t need it to actually run in another thread
01:44dissipatekelseygi, if it evaluates in the current thread, it will take control of the current thread, no?
01:44kelseygithat’s totally fine—i just need to wrap something in a future for test purposes
01:44kelseygicause the method derefs it like it’s a future
01:44kelseygia dummy future basically
01:46dissipatekelseygi, sounds like you want a promise, not a future
01:46kelseygiso i’d need to do ((promise a) (deliver a whatever))?
01:46kelseygi:\
01:47dissipatekelseygi, yep, then pass the promise to the other function to be derefed
01:47kelseygiok was hoping there was a one liner/method i could call
01:47kelseygithanks
01:48kelseygiomg i could write a macro huh
01:48kelseygiwait would that be a good place to do that?
01:49kelseygii guess that’s just a func
01:49dissipatekelseygi, why not just pass a ref of the result though?
01:50dissipateif the other function just derefs, you can just create a ref of the result and pass that
01:50beamsoanyone used cljs-ajax? i'm getting some weird json parsing issues.
01:51dissipatekelseygi, it's considered bad style to write a macro where a function would do. usually you don't need a macro.
01:51kelseygiyeah i’m trying to figure out what you do need macros for
01:51kelseygidissipate cause i didn’t know you could pass a ref of something?
01:51kelseygithat’s what i was trying to ask...
01:52kelseygiref is exactly what i was looking for, thank you again
01:53dissipatekelseygi, this SO post has info on what macros are used for: http://stackoverflow.com/questions/7593931/how-do-clojure-programmers-use-macros
01:54kelseygiwonderful, thanks!
01:54dissipatekelseygi, the problem is that macros don't play as well with functions and vice versa, so it's better to keep macros to a minimum.
01:55dissipatekelseygi, just as an example, i found out the other day you can't use macros with the 'apply' function. you have to wrap the macro in a function in order to do so.
01:57amalloykelseygi: the simplest dereffable thing is just a delay
01:57amalloy@(delay 5) => 5
01:59kelseygiok, that’s preferable to @(ref 5) because ref carries around history & stuff?
02:00_ericwhat would be the best way to remove the values in one vector from another one?
02:01dissipatekelseygi, sounds like 'delay' is what you want
02:02kelseygiyeah agreed, although any of them (including future) do work…feel like i’m in the wild west without a static type system :)
02:03kelseygialso dissipate now i’m in a rabbit hole about whether macros compose so thanks for that :P
02:03hellofunkddellacosta from my readings it seems that both om.core/component and om.core/build are used to created components. The source for them is quite different. Is there a difference between “generating” a component vs “building” a component?
02:03dissipate_eric, are duplicates allowed in the vectors?
02:04_ericdissipate: no
02:04dbasch_eric: one way woud be (distinct (concat v1 v2))
02:05ddellacostahellofunk: component and build are doing different things. Component creates a simple component that does nothing other than create a reified instance of IRender
02:05dissipate_eric, then you could convert each vector into a set and use the 'difference' function
02:05dissipatehttp://clojuredocs.org/clojure_core/clojure.set/difference
02:05dbaschdissipate: but that might break the order, if that’s important
02:05dissipatedbasch, that's true
02:06dissipate_eric, does order matter?
02:06rhg135(remove (set v2) v1)
02:07ddellacostahellofunk: build takes a component and data structure as an argument and...builds the component
02:07_erichmmm, it would be nice to preserve order
02:07hellofunkddellacosta what does it mean to actually “build” a component vs generate one; why return just a component vs a build from the function passed as the first arg to om/root?
02:08dissipate_eric, then dbasch's solution is better
02:09_erichmmm
02:09_ericusing (distinct)?
02:09dbaschrhg135: that removes not just the duplicates but the elements themselves
02:09ddellacostahellofunk: just building a component doesn't register that as a React component; you need build to do that.
02:09_ericI'm trying to remove elements. I don't see how (concat) would do what I want
02:09ddellacostahellofunk: so it's not part of the app render cycle until you build it (or pass it into root)
02:10rhg135Oh ic, misread
02:10hellofunkoh i see, so I am getting confused in the difference between an “om component” and a “react component” — the term “component” can mean either depending on what you are reading.
02:10hellofunkddellacosta ^
02:10dbasch,(distinct (concat [1 2 3 4] [2 3 5 6])) ;; _eric
02:10clojurebot(1 2 3 4 5 ...)
02:11dbasch,(distinct (concat [1 2 3] [3 5 6]))
02:11clojurebot(1 2 3 5 6)
02:11_ericI'm looking for [2 3 5 6] to be removed
02:11dissipate_eric, concat will produce a lazy seq of both vectors concatenated. then, distinct removes the duplicates and produces another lazy seq.
02:11_ericin that first case
02:11dbaschin that case, what rhg135 said
02:12rhg135I was right :D
02:12dbasch,(remove (set [2 3 5 6] ) [1 2 3 4])
02:12clojurebot(1 4)
02:12_ericokay
02:13ddellacostahellofunk: well, there is a little bit of a translation layer is all. Basically, when you pass in a component it gets passed into React, with an implementation wrapper (so to speak: pure-methods). That implementation checks which lifecycle protocols you've implemented and calls them if they exist, or does a default action (maybe nothing, depending on the protocol) if not.
02:14kelseygi(realized? (delay 5)) => false :\
02:14ddellacostahellofunk: to clarify: *when you pass in a component to build/root (which just calls build)
02:14dissipateyep, rhg135's solution looks good
02:14hellofunkddellacost ok, i was able to build stuff that presented on the page but never used build or build-all so I guess this means they were not part of React, just living alone inside Om, right?
02:14hellofunkddellacosta ^
02:14dissipatekelseygi, it's not realized because it was not derefed
02:14kelseygiyeah i know, but i need it to be
02:15ddellacostahellofunk: not knowing exactly what you're talking about it's hard to say, but presumably if you generated a component and didn't pass it to build or root, it wouldn't get displayed.
02:15dissipatekelseygi, i thought you said it was derefed in the function you pass it into?
02:15kelseygiit checks if it’s realized first...
02:15dissipatekelseygi, then just deref it before it is passed in
02:16kelseygiyeah, it’s just clunky as hell
02:17amalloyi mean, checking whether a future is realized should probably not be part of something you're testing. no async process is ever guaranteed to be done by the time you want it
02:17dissipatekelseygi, your use case is strange.
02:17kelseygiis it? i’m testing a function that takes a core.async response object
02:17kelseygiwhich has a future for the status
02:17amalloyand if you only want to work with things that are already realized, don't pass the future at all, just pass a value
02:18kelseygii essentially need a dummy 200 response
02:18dissipatei agree with amalloy, doesn't make sense.
02:19kelseygihttps://github.com/mccraigmccraig/twitter-streaming-client/blob/master/src/twitter_streaming_client/impl.clj#L158-L159
02:19dissipatekelseygi, it sounds like the function you are passing into should be checking if the value passed in is a 'ref' or not
02:19kelseygithat’s the function i’m testing
02:19kelseygii want that check to pass
02:20kelseygishould that be doing something different? i am changing something in that function (hence why i’m testing it) but i wasn’t planning on changing that
02:21dissipatekelseygi, looks like a bug to me
02:22kelseygiok, what’s the bug?
02:23dissipatekelseygi, the only way the 'and' passes is if the promise/delay is realized and then tries to deref it within the same 'and'. makes no sense. if the promise/delay is not realized, the test fails, if it is realized, it might as well just be a value.
02:24hellofunkddellacosta here is a simple example i’m scrutinizing: https://www.refheap.com/85955
02:24kelseygii assume it’s to keep the program from blocking indefinitely if the promise isn’t realized?
02:25kelseygii dunno, i didn’t write this, just trying to make this library work
02:26kelseygialso, how does that not make sense? and is evaluated lazily, isn’t it? so it won’t try to deref it if it’s not realized?
02:27ddellacostahellofunk: ah, yeah, I've seen that kind of thing before. I assume that since build just tries to wrap it in the pure-methods implementation, and since it is a React.DOM element, it must just get rendered by React somehow.
02:28hellofunkddellacosta do you think there is a difference between using om/component or not here?
02:29dissipatekelseygi, think about it logically. if it is not realized, the test fails. that means that it should just be a value. the function shouldn't be concerned with something blocking, that's up to the calling function to deal with.
02:29kelseygiit’s calling another library
02:29kelseygiwell that’s a bit of a weird way to put it but it’s a callback being passed to another library i believe
02:29kelseygiso it doesn’t have control over what’s passed in
02:30kelseygianyway i’mma pull out the part that deals with the body to test that as a separate function
02:31dissipatekelseygi, if it must be a promise/future, just use 'delay' and deref immediately.
02:31ddellacostahellofunk: I honestly don't know the answer to that--presumably React is doing the work of rendering it, since it just gets passed into React as is. And otherwise it seems like it would still just work as a normal component works within the render cycle. Of course, it means that you don't have a function there, but a low-level React DOM element, so you can't really do anything with it like you can with a compon
02:31ddellacostaent
02:32ddellacostahellofunk: the obvious thing you lose is any kind of composability of functions, which you get when you use components, even just om/component.
02:33hellofunkok, maybe i’m spending too much time trying to understand the low-level stuff ddellacosta
02:33ddellacostahellofunk: no, this is great. I'm learning stuff too trying to answer your questions.
02:33ddellacostahellofunk: I definitely don't think this is a waste. It's good to read through the code and really try to understand it.
02:34beamsoddellacosta: do you use a library for ajax with om?
02:34hellofunkddellacosta, ok i’m working on another example snippet using build-all, i’ll share in a bit.
02:34ddellacostahellofunk: sounds good.
02:37ddellacostabeamso: sorry, missed your question. I use domina, but it's mostly for historical reasons. I'd use dommy now if I had a choice.
02:38beamsoi mean for xmlhttprequests, not for dom manipulation
02:39beamsoi'm having some weird issue with cljs-ajax where the response handler is being called with nil
02:39ddellacostabeamso: oh, sorry, thoughtlessly misread
02:40beamsoall good
02:40ddellacostabeamso: I am using shoreleave now, but it seems like it's dead or dying, development-wise
02:40ddellacostabeamso: I might consider https://github.com/JulianBirch/cljs-ajax now
02:40beamsoyeah, that's the one i'm currently trying.
02:41ddellacostabeamso: hmm, don't know what is up with your problem I'm afraid
02:41ddellacostaif you give me a snippet I'm happy to take a look though
02:43beamsoi'm attempting to use something like https://www.refheap.com/85959
02:45ddellacostabeamso: I see. And response in your :handler fn gives you nil?
02:46beamsoyeah
02:46ddellacostabeamso: are you seing that print out at all, or does it print out with "response == nil" ?
02:46ddellacosta*seeing
02:47beamsoresponse == ''
02:48ddellacostabeamso: btw, I might suggest putting this in IWillMount and setting the result in state via a channel in your handler, since you can't depend on this getting called in a synchronous fashion in init-state
02:49ddellacostabeamso: as far as your specific problem with the response, I don't have any simple answers, but I would suggest starting with the simplest get call possible and ensuring you are getting data back from the server at all
02:49ddellacosta(ajax/GET "/customers" {:hander #(println %)})
02:51ddellacostabeamso: along those lines, are you sure there is data coming back from the server? Don't mean to second guess you, but that is often a problem, I've found.
02:51beamsodata is coming back from the server
02:51ddellacostak
02:51beamsoi've checked that the response header is application/json
02:51beamsobecause it's an array i also tried chucking the array into a map
02:53beamsoi did change to use that IWillMount protocol as well. it's getting called after init-state and before render.
02:54whilo,(type {})
02:54clojurebotclojure.lang.PersistentArrayMap
02:54ddellacostabeamso: yeah I dunno, I'm sorry. :-( I would probably do the same as you at this point, and just try debugging stuff until I tracked down where the data is getting lost
02:55ddellacostabeamso: but reading the code for cljs-ajax it seems pretty clear.
02:55whiloin cljs this returns: cljs.core/PersistentArrayMap
02:55whilois there a reason why one is with . and the other with /?
02:55ddellacostabeamso: this is interesting though: https://github.com/JulianBirch/cljs-ajax/blob/master/src/ajax/core.cljs#L167
02:56whilotype does not return the same value for the same type (speaking of records for instance)
02:57ddellacostawhilo: probably because in Clojure PersistentArrayMap is a Java class, while in ClojureScript it is a type.
02:58whiloddellacosta: same for defrecord objects
02:58ddellacostawhilo: sorry, not sure what your last comment meant
02:59whilo,(defprotocol IFoo (-foo [this]))
02:59clojurebotIFoo
02:59whilo,(defrecord Bar [name] IFoo (-foo [this] name))
02:59clojurebotsandbox.Bar
02:59whilo,(type (Bar. "hello"))
02:59clojurebotsandbox.Bar
03:00whiloin cljs it is sandbox/Bar
03:00ddellacostawhilo: yeah, you got me, I dunno
03:01hellofunkddellacosta here is a slight addition to the example: https://www.refheap.com/85955
03:02whiloddellacosta: me neither. i am hashing this, so i'd prefer consistent behaviour. this is why i recognized it
03:05ddellacostahellofunk: I think the main point remains that you can't use any of the stuff that Om gives you--overriding lifecycle protocols, using set-state!/transact! etc. It's kind of pointless to use Om without the tools it gives you, even if technically you can just pass in low-level DOM elements to build
03:08hellofunkddellacosta so essentially all of Om’s power comes to elements that are explicitly built via “build” or “build-all” is what you are saying
03:09ddellacostahellofunk: I suppose you could say that, sure
03:09ddellacostahellofunk: otherwise, you are ignoring 90% of the API that the lib provides
03:11hellofunkddellacosta what is your IDE of choice when working in CLJS and Om?
03:11ddellacostahellofunk: to put it another way: Om becomes a really compelling library for building UIs when you start taking advantage of all the flexibility the protocol functions give you
03:12ddellacostahellofunk: I have used emacs forever...I'm stuck in my ways. :-)
03:12hellofunkddellacosta i’m working in Light Table for now, the automatic connection with a browser is nice.
03:12ddellacostahellofunk: there are a fair number of vim users in Clojure-land though, and people who seem to like intellij
03:12hellofunkemacs seems more stable though
03:13ddellacostahellofunk: and yeah, I've heard a lot of good things about Light Table, but I just don't need it. Emacs is quite powerful.
03:13ddellacostahellofunk: I can imagine, LT is still quite new
03:21beamsoin clojurescript, what is #_?
03:22TEttinger,(do "eh" #_"ignored")
03:22clojurebot"eh"
03:22TEttingerit's a sort of comment, it tells the reader to ignore the next form, not like (comment) which returns nil
03:23TEttinger^ beamso
03:25hellofunkbeamso it is a reader macro to suppress reading of the following form
03:25hellofunkunlike comment, where everything is still read by the reader but just not evaluated
03:26ddellacostabeamso: yeah, it is a general to Clojure and ClojureScript
03:27beamsookay
03:29hellofunkit is interesting to note that you can still get compiler errors on content inside a comment form since it is still read in. so #_ tends to be a better option in my opinion
03:31ddellacostahellofunk: really? Didn't know that, interesting
03:32hellofunkyeah if you treat the contents of comment as a free-for-all wild west of text where you just throw in whathever you want to say, you can have problems with certain characters, since they are read
03:34hellofunkand on another note ddellacosta are you using a particular tool in emacs to get autocompletion for all the def’d forms in libraries you require in your ns? i like how LT seems to do this, when I was playing around with emacs I couldn’t quite get this to happen, as you’d expect in more modern GUIs that know all the forms available to you as you code.
03:36ddellacostahellofunk: you know, it's still not ideal but the basic autocomplete seems to do a decent job of at least giving me the forms in the code I'm working in
03:36ddellacostahellofunk: I think it's this: http://www.emacswiki.org/emacs/AutoComplete
03:36hellofunkddellacosta it works with the source file you have open, but it won’t autocomplete based on contents of other source files you haven’t actually opened but can access, right?
03:36ddellacostahellofunk: I installed it via the packages feature available from 24.x
03:37ddellacostahellofunk: yeah, I think there's a way to get it to load other namespaces but I haven't done the yak-shaving to get it working
03:37ddellacostahellofunk: I'm lazy, but not lazy enough. ;-)
03:37hellofunkthat’s an interesting term, yak-shaving. what does that mean?
03:37ddellacostahellofunk: I guess this would help: https://github.com/clojure-emacs/ac-nrepl
03:37ddellacostahellofunk: $google yak-shaving
03:37FrozenlockI usually just use hippie-expand M-/ (when not in the repl)
03:37ddellacostad'oh
03:37ddellacosta$google yak-shaving
03:37lazybot[yak shaving - Wiktionary] http://en.wiktionary.org/wiki/yak_shaving
03:38ddellacostaFrozenlock: huh, okay, will check that out
03:38FrozenlockI use it everywhere in fact, even in ERC. I'm so lazy :-p
03:39ddellacostaFrozenlock: to misquote Larry Wall, laziness is a virtue for a programmer
03:39hellofunkfrozenlock wouldn’t you still need hippie expand to know where to look?
03:39Frozenlockhellofunk: It looks everywhere
03:40hellofunkby everywhere, you mean what exactly… how does it know to look in some other source file your current code has access to but that you have not opened in emacs? it can parse an ns form ?
03:40ddellacostahellofunk: you always ask good questions (seriously)
03:41Frozenlockhellofunk: Ah ok no, it looks into the buffers
03:41hellofunkddellacosta thanks
03:41FrozenlockBut then you probably used the function somewhere in the repl, so it will also be there.
03:42FrozenlockIf not, you need to type it by hand!! :-p
03:42ddellacostaand that would be a sin
03:42ddellacosta;-)
03:43FrozenlockI'm also a heavy user of M-.
03:43Frozenlock(in the REPL it opens the source)
03:43hellofunki find autocompletion to about a lot more than just saving some keystrokes. it acts as a form of inline documentation so you an quickly get to what you need and see what are the options.
03:43FrozenlockOnce the source is opened, you get the completion in hippie-expand
05:53hellofunklein cljsbuild is giving me an add error for a line that only says “reify” if anyone can spot the issue: https://www.refheap.com/85964
05:53beamsoyogthos: ever have issues with cljs-ajax where the handler for a GET receives nil as its parameter?
05:53hellofunk*odd not add
05:54beamsothe om/IRenderState and the render-state method appear to be outside of the reify form
05:56hellofunkbeamso ahh good catch. my eyes couldn’t see that
05:57beamsowatch your code style at line 13 too
05:57beamsono space before the 'xs'
05:59hellofunkok, fixed those, but still getting the same error. maybe it’s time to give my eyes a break
06:02hellofunkah the problem was the om/ namespace prefix on one of the protocol functions. I guess you aren’t supposed to qualify those
06:03borkdudeCan someone explain to me why you would migrate to Clojure from Ruby for more performance? What makes Clojure/JVM more performant?
06:03borkdude(I don't know much about Ruby)
06:07vijaykiranAFAIK, one issue is concurrency model
06:07vijaykiran... of JVM is way better than that of Ruby's
06:12mattfieldBigtime. Ruby has a very limited concurrency model.
06:14ohpauleezBetter garbage collection, JIT compilation, "full" concurrency model, overal, faster vm
06:14ohpauleeztrading off space for speed though
06:15ohpauleezsubjective reasons: Better support for application packaging, better sense of robustness in software packages, support for high-performance computations, better support for low-level constructs (arrays, etc)
06:16ohpauleezthat
06:16ohpauleezthat's all just JVM vs Ruby's VM
06:20borkdudewhat is limited about Ruby's concurrency model?
06:21borkdudevijaykiran I am waiting for euroclojure to come with extra tickets, probably tomorrow...
06:25mpenetI might have to sell mine, almost sure I cant make it, moving across countries on these days
06:26borkdudempenet I would be very happy to buy it from you
06:26mpenetborkdude: Sure I ll let you know asap, today for sure. I have 1 night at an hotel there too btw.
06:27borkdudempenet I'll send you a private message with my email, ok?
06:27mpenetborkdude: alright
06:33hellofunkFrozenlock I’m tring this M- you mentioned in emacs repl, not sure if I got that right. What is the keystroke to open source at repl you mentioned?
06:40mpenetanyone knows if there's some documentation for primatic/schema? or just the tests?
06:40mpenetprismatic*
06:41p14nThere's the github readme
06:41p14nhttps://github.com/Prismatic/schema
06:42p14nwhich also points to a mailing list
06:42mpenetit's not really documentation, a bit of pita to browse
06:43mpenetI guess the tests will do for now ...
06:45vijaykiranborkdude: cool - I hope you get the ticket :)
06:45otfrommorning
06:45otfromanyone having elisp trouble with the latest cider?
06:46otfrom(I've already asked on clojure-emacs but it is quiet over there atm)
06:48powrtochellofunk: M-. opens source at repl
07:12Morgawrwhat's a suggested clojure irc library to write a simple irc bot? nothing fancy like lazybot/clojurebot, just simple commands read and run
07:12MorgawrI know there's irclj but it seems abandoned/not updated in years (even before lein?)
07:16mpenetMorgawr: mpenet/ash could be a candidate
07:19Morgawrmpenet: what's its state? stable?
07:19mpenetyes
07:20Morgawrmpenet: awesome, I'll check it out, thanks
07:20mpeneti don't use it anymore, but it was working fine for a long time
07:20mpenetno reason it shouldn't now
07:20Morgawrgreat
07:26hellofunkpowroc when i do that i just git a minibuffer popup that says “Var”
07:30mpenetMorgawr: I think a new major version of pircbotx was release a while ago, if you have the motivation it could be worth evaluating if an upgrade is worth it
07:30Morgawrmpenet: ash wraps around pircbotx?
07:31mpenetyes
07:33Morgawrmpenet: alright, I can't promise anything but I might give it a look
08:17borkdudevijaykiran ok, booked a flight and got a ticket :-D
08:17borkdudempenet thanks :-)
08:19mpenetnp, thank you :)
08:20mpenetwhat's the current price for a ticket btw? I think you made a good deal :)
08:26vijaykiranborkdude: cool :) see you there then
08:26mpenetif anyone needs a hotel room for 60ish euros for 26-27 for euroclojure, super close to the venue, ping me
08:27whompi'm getting a weird error when trying to use incanter, here's the error output: https://gist.github.com/michaeleisel/7096e2eab117151d44a6
08:27whompany ideas?
08:28whomp*rincanter, not incanter
08:29drbobbeatywhomp: that looks like a real problem with the JVM... I noticed it's JDK 8 - have you tried the same thing with the latest JDK 7?
08:29whompi'll give it a shot
08:29whompdrbobbeaty, i had trouble getting my comp to find the headers like jni.h, could that be an issue?
08:30drbobbeatywhomp: If not, then follow the hint and include code dumps and then use gdb or similar to have a look. If you don't read core dumps, then this won't help you, but if you want to still be debugging this, that's the path I'd take.
08:30drbobbeatywhomp: Yes, that's *exactly* the problem.
08:30drbobbeatyJNI is tricky. It's useful, but very very tricky.
08:31opqdonutfwiw under linux jni.h is usually under /usr/lib/jvm/java-7-openjdk-amd64/include/jni.h or so
08:31Morgawrmpenet: your irc bot is awesome, thanks a lot!!!
08:31mpenet:) glad you like it
08:32Morgawrseems really easy to use and make plugins, really nice job
08:32mpenetit was my main goal
08:32drbobbeatywhomp: the headers should be shipped with the JDK, and you need to be certain that you're using the ones that ship with that exact version of the JDK.
08:32opqdonutyeah
08:34mpenetMorgawr: I'd gladly take PRs or even add you to the repo if you want to improve it. MapDB can be upgraded too I think
08:34Morgawrheh, I'm using this for a very simple/fun project,nothing serious, so I don't know if I have time to improve it or work actively on it
08:34Morgawrif I find some serious problems or bugs or stuff that can be fixed, I'll hit you up
08:34Morgawrbut I can't promise anything
08:35clgvwhomp: was rincanter updated at all?
08:35mpenetalright
08:35clgvwhomp: seems not. that project seems to be abandonned since 2 years ago
08:37whompclgv, f haha
08:39Morgawrmpenet: is there a way to specify multiple nicks in case the original nick is already taken?
08:40mpenetMorgawr: I think pircbotx supports it, but it's not on ash/make-bot options
08:40Morgawralright
08:40Morgawrthat might be something to look into for myself, maybe :P
08:40mpenetmight be possible to do on the instance returned by make-bot
08:49numbertenis there a built in log base 2 function?
08:50whompdrbobbeaty, i see where the headers are, and i have JAVA_HOME set to `/usr/libexec/java_home -v 1.8`, but nothing seems able to find jni.h or jni_md.h. what should i try to fix this?
08:52drbobbeatywhomp: I'm no JNI expert, but I've used it in the past when I had to. What I remember is that when the JDK (not JRE, mind you) was unpacked, there was a 'headers' directory in the unpacked directory. Do you see that at all? I ask because it's certainly possible that Oracle now packages them separately, and it's an additional download to get these headers.
08:53Glenjamin,(defn log2 [b] (- 31 (Integer/numberOfLeadingZeros (int b)))) (log2 2)
08:53clojurebot#'sandbox/log2
08:54Glenjamin,(do (defn log2 [b] (- 31 (Integer/numberOfLeadingZeros (int b)))) (log2 2))
08:54clojurebot1
08:54Glenjaminnumberten: according to http://stackoverflow.com/a/3305710/173062 thats how to do it
08:54whompdrbobbeaty, i do, i see a whole bunch of headers
08:54Glenjamin,(log2 2048)
08:54clojurebot11
08:54numbertenlooking at nhttp://clojuredocs.org/incanter/incanter.core/log2 now
08:55Glenjaminsounds like a good plan
08:56drbobbeatywhomp: OK, then I'd look at the build instructions for the library that needs JNI, and there has to be some README or something about how to build it. This should include some tests that it's been built OK. Are there docs like this you can follow for the build?
08:56drbobbeatywhomp: As importantly, are you sure there are pre-compiled jars available?
08:56whompdrbobbeaty, for what?
08:57uruvielHey, for some reason leiningen keeps recompiling my java sources. On every command (test, run, repl ...) it says Compiling 3 source files to ... even though I didn't touch the Java source
08:57drbobbeatywhomp: I thought you were using incanter - the stats/math library - was I wrong?
08:57uruvielis there way to prevent that? (as the compile is rather slow)
08:58whompdrbobbeaty, rincanter, but now i'm just trying to use jri with clojure, because rincanter is apparently dead
09:00drbobbeatywhomp: OK, if you are trying to make JNI work with clojure, you first need to make it work with Java. And that is a challenge all in itself. If you are building something from scratch - on your own, there are some resources out there to help with JNI. It's not easy, as I said, and there are specific functions for mapping values across the C-Java boundary. But it can be done.
09:01drbobbeatywhomp: If you're trying to build a package that someone else has written, and has JNI in it, then I'd look for a README that explains how to do this.
09:03mdrogalisambrosebs: Looks like I'll see you again this year. :)
09:03ambrosebsmdrogalis: cool!
09:03ambrosebsmdrogalis: you're speaking right?
09:04mdrogalisambrosebs: Terrifyingly, yes.
09:04ambrosebsnice
09:05mdrogalisambrosebs: When do you move here permanently?
09:05ambrosebsearly August
09:06mdrogalisambrosebs: Sweet, look forward to having you in the same country. :D
09:06ambrosebsdefinitely
09:07Glenjaminthe ó is missing from the talk title on the strangeloop site mdrogalis, its odd as it seems to be there in the URL and title
09:07Glenjaminerm, missing in the list & page heading
09:08mdrogalisGlenjamin: Yeah, character rendering issue. I think Alex is working on it, didn't want to rush him over the holiday.
09:08Glenjaminah cool, figured i might as well point out in case you hadn't seen
09:09Glenjaminall these talks look great, i think i'm going to have to go to strangeloop again
09:09mdrogalisGlenjamin: Appreciated. :) Yeah, gosh there's so much good content up there.
09:10Glenjaminlast time i had an extra day in the hotel, and ended up watching videos of some talks i didn't make it to!
09:10Glenjamini hope they do the early access video thing again, that was ace
09:11mdrogalisGlenjamin: I wouldn't be surprised if they do what they did at clj/west. External hardware capture
09:11mdrogalisVideos were up in a few hours, bottleneck was Youtube upload lol
09:11mdrogalisThat's a really impressive service.
09:16szymanowskihello, i've got a schema related question: is it safe to extend the Schema protocol to clojure.lang.Symbol?
09:17ambrosebswhat's an example of an type that extends ISeq but not Sequential?
09:18ohpauleezambrosebs: I don't think one of those exists
09:18ohpauleezYou can have it the other way around though
09:19ohpauleezoh wait
09:19ohpauleez,(seq? [])
09:19clojurebotfalse
09:20ohpauleez,(contains? (ancestors (class [])) clojure.lang.Seqable)
09:20clojurebottrue
09:21ambrosebsI'm interested in clojure.lang.Sequential
09:22ohpauleezHmm, I think if it contains ISeq it always has Sequential
09:23ayiaHi guys,
09:23ambrosebshttps://github.com/clojure/clojure/blob/master/changes.md#12-iseq-no-longer-inherits-from-sequential
09:23ambrosebshas me confused
09:23ayiais there a way to achive the same as ~@(map inc [1 2 3]) ? because the latter does not work in cloujure
09:24ohpauleezayia: You probably want the `apply` function. Unless you're writing a macro where you need to unroll like that
09:24wkellyambrosebs: https://groups.google.com/forum/#!topic/clojure-dev/xY7ELXggnuA
09:26ayiaohpauleez: yeah, I need something like apply... but apply applies "something"... And I just want to unroll what i Have in a list returned from (map....)
09:26ambrosebswkelly: thanks
09:26ambrosebslooks like it's an invalid implementation to extend ISeq but not Sequential?
09:27ambrosebsmy particular context is: is this valid for all seqables? (nth (seq coll) n)
09:27ambrosebscos nth relies on Sequential as a last resort
09:30wkellyaccording to my reading of the docs, it should fall back to O(n) seq behaviors if necessary
09:30wkellyso it should work on anything seq works on
09:32uruvielI've had this function in my code for a while to read a var from an unloaded file (with namespace) https://gist.github.com/joelkuiper/38ff5b7cadc1b18339cd but I assume there is a better way of doing this?
09:32uruvielmaybe with load-file?
09:32ambrosebsit doesn't actually call seq on the argument unless it's Sequential I think
09:32ambrosebs,(nth #{1} 0)
09:32clojurebot#<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: PersistentHashSet>
09:34uruvieljust added an example usage, for clearity
09:34wkellyambrosebs: ah! I see your trouble now. Yeah, calling seq first should always work if seq works
09:35borkdudempenet I have no idea what the current price is, the website doesn't name a price
09:54tickingany thoughts on how to parse something like whitespace string whitespace in instaparse where the whitespace is greedy and the string reluctant?
10:01tickingso it looks like instaparse is less powerfull than regex...
10:03ohpauleezI don't know if that's correctly - they express different grammars.
10:03ohpauleezcorrect**
10:04ohpauleezIf you're just trying to grab some text out of a single string, I'd just use regex
10:05tickingohpauleez: it's a whole file format
10:05tickingrobot operating system message declaration format, horrendous stuff
10:05mattfieldre: EuroCLJ price (I think someone asked further up...) the standard rate was €195, iirc
10:06Morgawrmpenet: is it possible to add a plugin to the bot at runtime?
10:08mpenetyep
10:08mpenetthat's what it does at startup more or less if I recall
10:09mpenetyep, confirmed
10:10Morgawrso I can just call the new handler and pass the bot as a parameter, right?
10:10mpenetyes
10:10Morgawrah, awesome, thanks
10:40arrdemls
10:40lazybotbin etc home lib lost+found mnt proc root selinux srv sys tmp usr var
10:42Glenjaminls mnt
10:42lazybotbin data root selinux src srv tmp var
10:42Glenjaminis that actually real?
10:42arrdem$mail gtrak aware of any bugs with cider? I'm getting Error: (error "Cannot decode object: 1") and Error: (wrong-type-argument integer-or-marker-p nil) when I boot a freshly upgraded cider
10:42lazybotMessage saved.
10:42arrdemGlenjamin: it's a random subset of lazybot's real /
10:42Glenjaminah, neat
11:31owl-v-is there hardware-float on JVM for ARM ?
11:36mpenetowl-v-: there's a jdk8 ARM I think
11:41arrdemmpenet: Oracle's JVM has an ARM build?
11:42arrdemBronsa: ping
11:43mpenetarrdem: seems so http://www.oracle.com/technetwork/java/javase/downloads/jdk8-arm-downloads-2187472.html
11:54owl-v-*surprise*
11:55justin_smithI hear the arm jvm is not as well optimized as the x86 one
11:56owl-v-*oh no*
11:56owl-v-i was going to use it in beagle...
11:56justin_smithbeagle board or beagle bone?
11:57arrdemjustin_smith: well that's no surprise... although we can expect that situation to improve with time.
11:57owl-v-then i shall get minnowboard-max..
11:57owl-v-justin_smith: i have beagle-bone
12:03master_ophello, when i attempt to read orderset withscores from redis iget NumberFormatException
12:03master_ophow can i resolve this
12:07master_opshould i ask in redis room ?
12:08cbpyou are trying to do a parseLong or something on invalid input
12:11technomancyowl-v-: iirc you have to get some terrible oracle thing to get decent perf on arm
12:11technomancyI just went with racket instead
12:13Bronsaarrdem: pong
12:15philandstuffI'm looking to implement OpenID Connect in clojure (both IdP and RP side) but I'm not really sure where to start. I've had a look at clauth and friend, and also the Java section of http://openid.net/developers/libraries/ but I'm not really sure how to assess them for suitability. Does anyone have any expirience with OIDC in clojure?
12:15philandstuffI did find https://github.com/pelle/clauth/issues/15 but there hasn't been much activity since then
12:16philandstuffit looks like I want to use friend, but I'll need to implement my own workflow fn to manage the OIDC-specific bits
12:17arrdemBronsa: currently working on lambda lifting, which means rewriting fn forms to make implicit parameters explicit. conceptually straightforwards, but I was wondering if you could think of a better way to do the function rewriting than to rewrite the :form as required and re-analyze the result to get a t.a(.jvm) tree back.
12:21philandstuffooh, found http://connect2id.com/products/nimbus-oauth-openid-connect-sdk/examples which looks promising. apache2 licensed.
12:27rasmustobagel bone?
12:28rasmustoisn't that the node.js asic?
12:28Bronsaarrdem: I don't see any obvious alternative
12:29arrdemBronsa: that's kinda what I figured. Actually rewriting the entire analyzer AST seems like more effort than doing the transform at the source level and re-analyzing. Thanks, I'll go with that.
12:29Bronsaarrdem: yeah definitely
12:30Bronsaarrdem: you probably want to use (emit-form sub-ast) rather than (:form sub-ast) though
12:30Morgawrif I have a vector of strings like ["Hello" "World"] what is the most elegant way to merge that vector into a single string separated by a specific value?
12:30Morgawrlike "Hello World" for " " or "Hello+World" for "+"
12:30arrdemMorgawr: string/join and interpose
12:30rasmusto(clojure.string/join sep xs)
12:31Morgawrnice!
12:31Morgawrthanks
12:31arrdemrasmusto: oh right join does include a sep....
12:31MorgawrI was using a botched version of reduce and it felt so ugly
12:31rasmustoarrdem: yeah, I prefer using interpose though, since making a string right off the bat can feel heavy-handed
12:36gfrederickstechnomancy: yo leiningen has this warning about :user profile :repositories entries
12:36gfredericksdue to "repeatability"
12:36arrdemBronsa: noted, thanks.
12:39gfredericksbut I think it's necessary for using project templates from a custom repository?
12:40technomancygfredericks: you should be able to use :plugin-repositories for that
12:40technomancythough I don't understand the use case for private templates
12:41technomancy(this might only work on master)
12:42arrdemis there a better pattern for (reduce (f [x y] (if (p y) (f x y) x)) xs)?
12:42arrdemit seems like the if with the identity case is a repeated pattern and could be abstracted/eliminated...
12:43gfrederickstechnomancy: I realize you don't understand the use case for private anything :P
12:43technomancyI support the notion of private property.
12:43technomancybut I'll smack anyone who says "intellectual property"
12:43gfredericksthat's an entertaining policy
12:44rasmustoarrdem: (reduce f (filter p xs)) ?
12:44arrdemrasmusto: herp a derp...
12:45arrdemthis is what I get for writing C in my head and translating...
12:45rasmusto,(interpose "a" ["herp" "derp"])
12:45clojurebot("herp" "a" "derp")
12:45arrdem,(repeatedly "derp")
12:45clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn>
12:46clgvrepeat ;)
12:47arrdemclgv: I noticed :P
12:47arrdem,(interpose "herp" (repeat "derp"))
12:47clojurebot("derp" "herp" "derp" "herp" "derp" ...)
12:48Glenjamin,(defn herp [derp] (str "herp a " derp))
12:48clojurebot#'sandbox/herp
12:49Glenjamin,(repeatedly herp)
12:49clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: sandbox/herp>
12:49arrdem,(repeatedly herp "derp")
12:49clojurebot#<ClassCastException java.lang.ClassCastException: sandbox$herp cannot be cast to java.lang.Number>
12:49Glenjamindammit
12:49arrdemoh. partial?
12:49Glenjaminah, iterate
12:49arrdem,(doc repeatedly)
12:49clojurebot"([f] [n f]); Takes a function of no args, presumably with side effects, and returns an infinite (or length n if supplied) lazy sequence of calls to it"
12:49Glenjamini think
12:49Glenjaminhrm
12:49arrdem,(doc iterate)
12:49clojurebot"([f x]); Returns a lazy sequence of x, (f x), (f (f x)) etc. f must be free of side-effects"
12:50arrdem,(iterate herp "derp")
12:50clojurebot("derp" "herp a derp" "herp a herp a derp" "herp a herp a herp a derp" "herp a herp a herp a herp a derp" ...)
12:50Glenjaminclose enough :)
12:52rasmustomove over "Hello World!"
13:01owl-v-technomancy: why oracle thing is bad?
13:03technomancyowl-v-: because it's oracle?
13:04arrdemOracle: they may make the best JVM but they're still worse than Hitler
13:04Glenjamins/make/bought/ ?
13:05Glenjaminor is it genuinely better now, i dunno
13:05technomancyit's better now that they've crushed competition in the mobile space with lawsuits
13:05arrdemI haven't seen JDK 6/7/8 benchmarks
13:06dbaschat my old company we did a thorough performance comparison of jdk6 options (in 2011) and for our specific application Oracle was slightly more performant
13:06cbphttps://pbs.twimg.com/media/BaW3NZbCAAAa0i3.png
13:06arrdemdbasch: against OpenJDK or what other imp'ls?
13:06arrdem(inc cbp)
13:06lazybot⇒ 6
13:07dbascharrdem: OpenJDK was the only one that was close
13:07arrdemdbasch: sounds about right.
13:08dbaschfor us it was all about GC really
13:08arrdemI hear that IBM and some other companies have specialized JVMs and JVM→metal translators that are even more competitive with Oracle's JVM, but I haven't seen benchmarks and kinda doubt they exist openly.
13:08dbaschwe were running with large memory footprints and the GC pauses were significant
13:08arrdem
13:09technomancyarrdem: you probably have to sign something that says you won't release performance measurements to use them
13:09technomancylike datomic
13:09arrdemtechnomancy: ikr
13:10owl-v-why. what's so wrong about oracle ?
13:10technomancywhich is a great indicator that you probably wouldn't want to use software written by them in the first place.
13:10dbaschOracle, the legal firm that also sells software
13:10arrdemOracle, destroyer of Sun
13:11arrdemOracle, the downfall of OpenOffice
13:11technomancythey're doing their best to destroy mysql too
13:11technomancy(oh wait, that's actually not evil)
13:12technomancya broken clock is right twice a day?
13:12arrdemtechnomancy: only if you don't use Unix time...
13:12owl-v-so. it's just license that is bad?
13:13owl-v-is it okey to use oracle jam?
13:13owl-v-is it okey to use oracle JVM?
13:14dbascha broken digital clock is right never
13:15owl-v-broken clock is not a clock but a trash
13:17owl-v-what's that code security on LLVM? >> http://en.wikipedia.org/wiki/Comparison_of_application_virtual_machines
13:18owl-v-clojure on mono?
13:18arrdemmay run better than jvm clojure
13:19owl-v-lol
13:19owl-v-M$ would love that
13:19owl-v-but seriously
13:19arrdemmono and .net have better GC & memory performance than the JVM.
13:19technomancy"code security" probably refers to sandboxing
13:20technomancyarrdem: o_O
13:20technomancyI heard mono's generational GC was really immature
13:20arrdemtechnomancy: maybe, but for JVM apps I've seen run atop mono they've done better memory wise.
13:21arrdems/run atop/ported and run atop/g
13:21technomancyarrdem: sure, because of not being stuck with utf-16 probably
13:21technomancybut I don't think that means the GC is comparable
13:21arrdemtechnomancy: maybe, also the codes I've seen ported were pretty shitty to start with so the port was probably a cleanup.
13:21arrdemin a big way
13:22owl-v-(and LLVM MONO) for the next clojure
13:22arrdemtim++ has put a lot of effort into llvm clojure, but I don't know if we'll ever see that. it'd kinda invalidate my GSoC project :P
13:23owl-v-if oracle is that bad, that is..
13:26owl-v-how is OpenJDK?
13:27arrdemit's good enough for most things
13:27owl-v-compared to JDK?
13:27arrdem$google openjdk vs oracle jvm
13:27lazybot[OpenJDK - Wikipedia, the free encyclopedia] http://en.wikipedia.org/wiki/OpenJDK
13:27technomancyopenjdk is great for everything but ARM
13:32owl-v-lol that (but ARM)
13:33technomancythe JVM is optimized for big-iron servers anyway; running it on arm is weird
13:33owl-v-damn... then... i should use x86 for java? wtf
13:33arrdemowl-v-: oooh yeah
13:33technomancythe only reason Sun engineers got away with OSSing it was that it would supposedly help sell servers
13:33technomancythat's also why the client JVM was abandoned
13:34arrdemowl-v-: my previous shop was Calxeda, and our #1 and #2 failure reasons were lack of a good ARM JVM and lack of a 64 bit arm chip.
13:34arrdem$google caxleda
13:34arrdemtechnomancy: client JVM?
13:35owl-v-lol that right once and run anywhere... it's more like "anywhere"
13:35technomancyarrdem: back in the day you could do `java -client ...` and it would run a different variant of hotspot optimized for low memory usage and fast startup
13:35technomancyarrdem: it never got ported to 64bit
13:35arrdemowl-v-: well who really treats arm machines as real PCs yet....
13:35arrdemowl-v-: for real
13:35amalloyarrdem: it sounds like #0 must have been the decision to stick with arm despite #1 and #2
13:37rasmusto$google Jazelle
13:37lazybot[Jazelle - Wikipedia, the free encyclopedia] http://en.wikipedia.org/wiki/Jazelle
13:37arrdemamalloy: our entire sales pitch was arm low power servers and ARM didn't deliver a 64 bit reference imp'l before we ran out of cash. :C it was a fun crew and we still get drinks... mostly at Qualcomm and Oracle now.
13:37owl-v-arrdem: no no, not pc but in embedded systems and robotics
13:41PigDudei asked this yesterday, but which is better? (when-let [v (f)] (f2 v)) or, (some-> (f) f2)
13:42arrdemI'd use the former if you just have one case...
13:42PigDudei prefer some-> but i don't want my code to be confusing
13:43cbpwhen-some? :P
13:43whilo,(satisfies? clojure.lang.ISeq '())
13:43clojurebot#<NullPointerException java.lang.NullPointerException>
13:44gfredericks,(instance? clojure.lang.ISeq '())
13:44clojurebottrue
13:44whilogfredericks: interesting, satisfies works that way in cljs
13:45whilo(satisfies? cljs.core/ISeq '()) ;=> true
13:46dbaschwhilo: that’s because ISeq is a protocol in cljs
13:47whilodbasch: ok, and in clojure it is a java interface?
13:47dbaschwhilo: correct
13:47amalloyPigDude: some-> seems weird to me there. might just be because some-> is still newish to the language, though
13:48arrdem,(doc when-let)
13:48clojurebot"([bindings & body]); bindings => binding-form test When test is true, evaluates body with binding-form bound to the value of test"
13:48arrdemreally... why does that exist when we have if-let...
13:49amalloyarrdem: why does when exist? we have if, after all
13:49gfrederickswhy does let exist? we have fn after all
13:49dbaschwhy does clojure exist? we have java after all
13:49technomancyinb4 why do computers exist
13:49gfrederickswhy does existence exist? we have non-existence after all
13:49arrdemfuck it I'm just gonna rewrite all this in pure lambda calculus
13:50arrdemchurch numerals ftw
13:50dbaschhow can computers be real if our binary numbers aren’t real
13:54SlackwiseHopefully quick question, but is there any cleaner way to filter a vector of maps by key? https://gist.github.com/Slackwise/2ea39ae4ec465d74fb70
13:56PigDudeamalloy: yea, i'd hope some-> becomes an idiom for that sort of thing because it's so much more to the point
13:56dbaschSlackwise: from the example it doesn’t look like you want to filter it, you’re just getting one element
13:56SlackwiseIndeed.
13:56SlackwiseI essentially wish to query it.
13:56amalloySlackwise: no; if your seq of maps has a conceptual "key" you want to look things up by, you want a map, not a seq
13:57amalloyalso, clojure.core hasn't seen fit to add the function frst yet - not enough people misspell first, i guess
13:58SlackwiseFixed. Typed it up rather than copying and pasting my actual code. I'm just learning here.
13:58SlackwiseThis is, though, common in JSON files.
13:58rasmustoSlacwise: ##(let [v [{:name "Chris" :age 28} {:name "Adam" :age 25}] m (zipmap (map :name v) v)] (update-in m ["Chris" :age] inc))
13:58lazybot⇒ {"Adam" {:age 25, :name "Adam"}, "Chris" {:age 29, :name "Chris"}}
13:58rasmustoyeah, maps are what you want
13:59SlackwiseDestruicturing using a let?
13:59rasmustonah, just making a map in the let
13:59amalloySlackwise: sure, a seq of maps is common enough as input. but if you want to work with it, make it into a data structure that performs well
13:59rasmusto(inc amalloy)
13:59lazybot⇒ 112
14:00Slackwiseamalloy: So, no common way to do query nested collections?
14:00Slackwise^to query
14:01amalloy$mail Slackwise if you want just an answer to your specific question, and would rather ignore the tengential advice you've received, then: yes, there is no better way to look something up in a seq than to iterate over the seq and stop when you get what you want
14:01lazybotMessage saved.
14:02dbaschSlackwise: for associative collections, get-in
14:02dbasch(doc get-in)
14:02clojurebot"([m ks] [m ks not-found]); Returns the value in a nested associative structure, where ks is a sequence of keys. Returns nil if the key is not present, or the not-found value if supplied."
14:02SlackwiseYea, I found that for nested maps. That was nice.
14:03dbaschSlackwise: but really sequential collections are made for efficient traversal or o(1) lookup, not for querying by value
14:07Slackwisedbasch: I know, but, semantically, I do not have a unique key here. I was just hoping there was a way since it's such a common data structure. I found vectors of maps all over the example code as well.
14:08rasmustoSlackwise: if :name isn't unique, why are you changing peoples' :age based on it?
14:08SlackwiseGood point.
14:08SlackwiseIt is example code, but you do make a valid point.
14:09SlackwiseI wouldn't be able to do that in real data WITHOUT a unique key.
14:09SlackwiseI guess, unless I was trying to match.
14:09rasmustoand with a real unique key, it'd work to have that as keys in a map, no?
14:10rasmustoand you'd be albe to liberally use group-by if you wanted to query on a specific field
14:12rasmusto,(let [v [{:name "Chris" :age 10 :id 0} {:name "Chris" :age 28 :id 1} {:name "Adam" :age 25 :id 2}] m (group-by :id v)] (update-in m [0 :age] inc))
14:12clojurebot#<NullPointerException java.lang.NullPointerException>
14:13rasmustooh right, you'd have to call first if you're using group-by on a unique key
14:14rasmusto,(let [v [{:name "Chris" :age 10 :id 0} {:name "Chris" :age 28 :id 1} {:name "Adam" :age 25 :id 2}] m (zipmap (map :id v) v)] (update-in m [0 :age] inc))
14:14clojurebot{2 {:age 25, :name "Adam", :id 2}, 1 {:age 28, :name "Chris", :id 1}, 0 {:age 11, :name "Chris", :id 0}}
14:15rasmusto,(let [v [{:name "Chris" :age 10 :id 0} {:name "Chris" :age 28 :id 1} {:name "Adam" :age 25 :id 2}] m (group-by :name v)] m)
14:15clojurebot{"Chris" [{:age 10, :name "Chris", :id 0} {:age 28, :name "Chris", :id 1}], "Adam" [{:age 25, :name "Adam", :id 2}]}
14:15rasmustoSlackwise: ^ fyi
14:22owl-v-,([1 2 3] 0 )
14:22clojurebot1
14:22owl-v-lol vector is a function
14:22owl-v-,([1 2 3] 1)
14:22AWizzArdowl-v-: exactly
14:22clojurebot2
14:23owl-v-i was watching this talk >> http://youtu.be/wASCH_gPnDw
14:23AWizzArdKeywords also, and sets and hashmaps.
14:23owl-v-it's a great talk
14:23AWizzArd(:b {:a 1, :b 2}) ; keywords are functions
14:23AWizzArd,({:a 1, :b 2} :a) ; hashmaps are functions
14:23clojurebot1
14:24owl-v-lol
14:24AWizzArd,(#{10 20 30} 30)
14:24clojurebot30
14:24owl-v-very interesting
14:24AWizzArdThis worked also in Clojure 1.0 back in 2008 :)
14:25AWizzArdThose were the times when Rich hung out here with us every day.
14:26owl-v-:)
14:26owl-v-i thought i had to do like (nth [1 2 3] 1) something like that
14:28owl-v-,(type 'A)
14:28clojurebotclojure.lang.Symbol
14:28owl-v-ah!
14:28owl-v-,(type 'A')
14:28clojurebotclojure.lang.Symbol
14:28owl-v-,(type "A")
14:28clojurebotjava.lang.String
14:28owl-v-:-)
14:29AWizzArdowl-v-: using nth would make it very clear to the reader of your code that they are dealing with a sequence, such as a vector.
14:29owl-v-is there 'cons' to use (nth) ?
14:30AWizzArd,(cons 0 (list 10 20 30))
14:30clojurebot(0 10 20 30)
14:30AWizzArdowl-v-: you did CL?
14:30owl-v-,(let [v [1 2 3]] (v 1))
14:30clojurebot2
14:30owl-v-what's CL?
14:31AWizzArdCommon Lisp. Not uncommon to use `cons` there.
14:31AWizzArdIn Clojure however it is rarely used.
14:32owl-v-clojure? i used it for solving problems for fun like >> https://projecteuler.net/
14:33rasmustoI use cons/conj a lot when writing recursive code
14:33owl-v-i used racket for solving some physics because i can draw some projectile path.
14:33owl-v-oh, i meant cons and (pros/cons)
14:34rasmustocons has none
14:34AWizzArdowl-v-: aaah, I see. Well, nth is slower.
14:34owl-v-okey
14:34llasram`nth` is slower than what?
14:34AWizzArd([10 20 30] 1) calls directly the correct function. nth first has to do a little bit more work.
14:34rasmustollasram: vector access methinks
14:35llasramAWizzArd: `nth` has an inline-able fast-path for objects which implement `Indexed` (like vectors)
14:36AWizzArdllasram: funny, I just tried it and found `nth` to be actually faster.
14:36llasramI'd be very very surprised if there was a measurable difference
14:37AWizzArdAnd I thought I remember how I benchmarked such things a few years ago.
14:37qerubOK, who will check with https://github.com/hugoduncan/criterium ? :)
14:38rasmustollasram: looking at the nth definition, I can't really tell what the :inline thing does differently
14:39llasramrasmusto: I meant inline-able by the JIT
14:39rasmustollasram: ah, ok. Is this :inline something different completely?
14:39llasramYes
14:39rasmustollasram: kk, thanks
14:39llasramSorry, wasn't clear
14:39AWizzArdAnd get however seems to really be slower.
14:40rasmustollasram: no problem, just trying my best to keep up :)
14:40amalloyi'd be surprised if calling it as a function isn't at least a little faster than nth
14:41amalloyand yet, i seem to be wrong. the jit works in mysterious ways
14:41AWizzArdamalloy: I thought that a direct call such as ([10 20 30] 1) should have an edge on nth and get.
14:41rasmusto~jit
14:41clojurebotNo entiendo
14:42arrdemjit?
14:42amalloyyeah, i agree, that seems natural to me, AWizzArd
14:43rasmustojit??
14:43lazybotrasmusto: Uh, no. Why would you even ask?
14:43amalloyand yet a quick-bench with criterium suggests it's 50% slower
14:43AWizzArdI just tried it on tryclj and funnily (time (dotimes [i 100000000] ([10 20 30] 1))) was 568 msecs while the version with nth clocked in at 181 msecs
14:43amalloyclojurebot: The JIT |works| in mysterious ways
14:43clojurebotYou don't have to tell me twice.
14:43amalloyAWizzArd: that's a terrible benchmark. you're going to be overwhelmed by the time taken creating that vector over and over
14:44AWizzArdamalloy: even if the JIT can optimize calls of nth… why are then nth vs. direct use not exactly the same?
14:45amalloy~the jit
14:45clojurebotPardon?
14:45amalloydangit, clojurebot, work with me here
14:45AWizzArdamalloy: if you already have a clj repl with criterium up, could you throw in `get` into the comparison?
14:46amalloyAWizzArd: my repl always has criterium. adding stuff like that to my ~/.lein/profiles.clj has been a godsend
14:46dbaschon my machine they are about the same
14:46AWizzArdamalloy: also have it in my profiles.clj but have no access right now
14:46dbaschget is twice as slow though
14:47amalloydbasch: i've been running (let [xs (vec (range 1e6))] (quick-bench (get xs 100000))). you?
14:49dbaschI was using a small vector, with your example it’s only 50% slower
14:49dbaschbut nth and the vector are still about the same
14:49amalloyi guess a smaller one is probably better, so that lookup time doesn't weigh into it
14:50whilodbasch: ok, thx. why doesn't it throw an exception, btw.?
14:51dbaschwhilo: why would you expect it to throw an exception?
14:52whilodbasch: i mean if you pass in an interface instead of a protocol, a npe is not very helpful. only wondering...
14:54whilodbasch: thx, works now crossplatform: https://github.com/ghubber/hasch/blob/master/src/clj/hasch/platform.clj#L123
14:54dbaschwhilo: sorry, I had lost the context. You meant satisfies? and the interface
14:55whilodbasch: yes
14:57dbaschwhilo: this line assumes you passed in a protocol https://github.com/clojure/clojure/blob/master/src/clj/clojure/core_deftype.clj#L497
14:58dbaschperhaps it could be a bit more defensive and tell you that it’s not a protocol
15:09whiloyes
15:19owl-v-lol Linus Torvalds >> http://youtu.be/Aa55RKWZxxI
15:20mdeboardowl-v-: Does he mention clj?
15:21owl-v-i'm so scared about (oracle)
15:21mdeboardOhh, right
15:22mmitchellAny prismatic/schema users here? Works fine in dev, but when I deploy my webapp to jetty, schema.core/defrecord doesn't exist.
15:26nopromptprinting collections with strings containing numbers kind of sucks :-(
15:26nopromptor rather, strings that only contain numbers.
15:27dbaschnoprompt: how so?
15:27noprompti guess that's what prn is for though.
15:28nopromptdbasch: uh (print [1 "1"]) => [1 1]
15:28pjstadigmmitchell: do you have schema as a dependency or a dev dependency?
15:28mdeboardmmitchell: You need to require schema.macros
15:28mdeboardnot schema.core
15:28mdeboardmmitchell: Ctrl-F ":as sm" here https://github.com/Prismatic/schema
15:28dbaschnoprompt: yeah, prn
15:28mmitchellpjstadig: hey there :) - I have it set as a dependency (not dev)
15:28noprompt(print "X:" (pr-str data)) is kind of annoying though.
15:29pjstadigmmitchell: hey :)
15:29mmitchellmdeboard: schema.macros ahh, cool. Will give that a shot.
15:30dbaschnoprompt: it’s the same as read-string, only backwards :)
15:30mmitchellmdeboard: This comment makes it sound as if I don't need schema.macros: ";; only necessary for cljs, macros are imported to schema.core in clj"
15:31mdeboardohh
15:31adammhthis is more of a clojurescript question but is it possible to use a javascript "namespace" (such as chrome.bluetooth) in a more direct fashion than (-> js/chrome .-bluetooth .getDevices) ... i.e. (require [chrome.bluetooth :as bt]) (bt/getDevices ...)
15:31mdeboardmmitchell: idk then, you're on your own :P
15:31pjstadigmmitchell: if schema is on the class path and schema.core/defrecord doesn't exist, then it needs to be required
15:31nopromptadammh: no
15:32arrdemBronsa: inside an update-children the AST is a transient, right?
15:32pjstadigmmitchell: are you using it with it's fully qualified name, or something like (:require [schema.core :refer [defrecord]]) in your ns?
15:32nopromptadammh: well, i take that back, you could create a namespace for it and then yes.
15:32noprompt:P
15:32mmitchellpjstadig: yeah i have (:require [schema.core :as sc]) in my ns declaration, then (sc/defrecord ...)
15:33pjstadigmmitchell: hmm, sometimes you can get that error if something fails when compiling a namespace. like maybe something that schema.core depends on is failing for some reason
15:34owl-v-lol vector is implemented as a tree
15:34pjstadigwe've been using schema in production at outpace without difficulty
15:34adammhnoprompt: in that I could write a script to generate templates for all the chrome APIs?
15:34nopromptpjstadig: i didn't know that.
15:34llasramowl-v-: You laugh at the strangest thing
15:34llasrams
15:34nopromptpjstadig: we need to try it out on the clojurescript side.
15:34mmitchellpjstadig: That's very good to know
15:35nopromptadammh: you could write a macro, sure.
15:35Bronsaarrdem: internally update-children uses transients but that's not something that should matter to a user of update-children, why do you ask?
15:36pjstadignoprompt: yeah it's been useful. when you're passing around lots of sequences of hash maps and such, it can get to be inscrutable, and it's nice to have schema definitions at least for the borders between libraries and such
15:36clojurebotGabh mo leithscéal?
15:36pjstadigclojurebot: no one asked you
15:36clojurebotPardon?
15:36mmitchellpjstadig: what version of schema are you using?
15:36pjstadigclojurebot: NO. ONE. ASKED. YOU.
15:36clojurebotCool story bro.
15:36pjstadig~botsmack
15:36clojurebotclojurebot evades successfully!
15:36mmitchellha
15:37arrdemBronsa: just pondering how much my lambda lift operation can cheat
15:37pjstadigmmitchell: 0.2.1
15:37mmitchellpjstadig: ok i'm on 0.2.2
15:37dbasch~everybody
15:37pjstadigmmitchell: hmm. weird.
15:37clojureboteverybody do the dinosaur
15:37owl-v-ah, i see. clojure requires gc
15:38owl-v-persistent data structure... even when original reference is gone.
15:39mmitchellpjstadig mdeboard I'm changed from schema.core/defrecord to schema.macros/defrecord and all is well
15:39pjstadigi kind of think that schema's coercions would make parsing JSON much, much better, but haven't gotten to try it as yet
15:39pjstadigmmitchell: yeah now that I think of it we aren't actually using defrecord from schema, so we may not have run into this problem
15:40mmitchellinteresting
15:40nopromptadammh: i would avoid the code generation/macro unless there is real benefit. wrapping a javascript api isn't that painful.
15:41nopromptadammh: if you plan to package it up as a library you'll need to think about externs as well (which may or may not exist).
15:42adammhnoprompt: wrapping in what sense - like rearchitecting the whole thing to be more clojurey? My initial goal it to just be able to use it without a ton if yuckyness :)
15:43nopromptmmitchell: is it possible to send the schema definitions down to the client? ex. when you're not sharing code between the server and client a la cljx?
15:43adammhwhat I really want (for now) is just (def getDevices (-> js/chrome .-bluetooth .-getDevices))
15:44nopromptpjstadig, mmitchell i'd love to be able to do that vs. having to hack together a schema-json-esque layer to go back and forth.
15:45pjstadignoprompt: since schema definitions are "just data" i want to say you could
15:45mmitchellI'd imagine so yeah
15:45pjstadigas always there may be security concerns to trusting data that a client sends to a server
15:46nopromptadammh: (ns chrome.bluetooth) (def bluetooth js/chrome.bluetooth) (def get-devices (.-getDevices bluetooth))
15:46adammhnoprompt: ah, that's not too bad at all
15:46nopromptadammh: (ns my-app (:require [chrome.bluetooth :as bt])) (let [ds (bt/get-devices)] ..)
15:47nopromptadammh: you could even use specify! to add ISeq and ILookup functionality on the return values from the api.
15:49adammhnoprompt: cool. thanks for the help!
15:49nopromptpjstadig: mostly what i want is to be able to be able to write more declarative code on the client. ex. using a schema as template for form element contruction etc.
15:50nopromptrequest the schema from the server and write generic code. if the schema changes i don't have to change the code.
15:51adammhnoprompt: also, would this be a super weird sort of thing to do to avoid chaining callbacks? (defn get-devices []
15:51adammh (let [p (promise)]
15:51adammh ((.-getDevices js/chrome.bluetooth) (fn [arr] (deliver p arr)))
15:51adammh p))
15:51nopromptthat's been the PITA part of the whole client/server relationship for me. having to change html because data changed. :(
15:52nopromptor at least, change *less* code.
15:52mdrogalisOmmmmmmm :)
15:52nopromptmdrogalis: already doing that ;)
15:53mdrogalisnoprompt: I just realized the hurt in that statement.
15:53mdrogalisDisregard that :P
15:58nopromptadammh: i leave callback oriented code alone. if the api wrap it the same way. never make those choices there.
15:58nopromptadammh: that way if i want to use core.async, promises, lies, cheats, dirty hacks, or whatever later on i can because my base functions are minimal.
15:58adammhnoprompt: well - not gonna be able to use promises in clojurescript anyway
15:59nopromptadammh: promises are pretty weak compared to what you get with core.async anyway.
16:00amalloynoprompt: easy solution: never call print with anything but a string. it's just not a very sophisticated function
16:06nopromptamalloy: pssssssssssh. simple > easy. ;)
16:08rasmustowhat does quick-bench do with a memoized function?
16:10amalloyrasmusto: uhhh...nothing? those two things are entirely orthogonal. quick-bench just runs the code you gave it N times
16:10amalloyso: whatever your code does with a memoized function
16:10rasmustoamalloy: ok, so if I've cached a piece of it, it'll use the cached calls
16:12amalloywhatever intuitions you have about, say, dotimes, will apply equally to quick-bench. it doesn't do anything magical
16:13rasmustoamalloy: ok, thank you
16:27beepbeep_Can anyone tell me why I get following error at line 26? https://gist.github.com/aaronmu/48ac3a42f64499feaa0d#file-gistfile4-clj-L26
16:28beepbeep_I don't understand why clojure looks for user/apply.
16:28Bronsabeepbeep_: it'd look like you did (def apply)
16:29beepbeep_Bronsa, I pasted the entire file.
16:29beepbeep_Perhaps it's a light table instarepl bug
16:30beepbeep_I was working on a function called apply-message-to
16:30beepbeep_but even after removing it, error persists
16:30rasmustotry restarting the repl connection
16:30arrdembeepbeep_: is this clojure or clojurescript.... also if you ever did def apply you'll have to restart
16:30beepbeep_oh okay
16:31beepbeep_that's 15m well spent :D
16:31gtrakyou have to remove it from the ns, restarting obviously will do that for you :-)
16:32beepbeep_\o/
16:32rasmusto,(apply str "grats" " " ["beep" "beep"])
16:32clojurebot"grats beepbeep"
16:33beepbeep_I actually tried reconnecting to the instarepl earlier but that's apperantly not enough :)
16:34rasmustoarrdem: whats the grumbling about?
16:34arrdemrasmusto: I'm writing lambda lifting for my gsoc compiler and apply is currently deviling me
16:35rasmustohmm
16:35arrdemrasmusto: the issue is what can be done about (let [x 3] (apply #(+ x %1) <>))
16:36arrdemrasmusto: 'cause what I want to do is rewrite this to (def fn_90001 [x _1] (+ x _1)) (let [x 3] (apply (partial fn_90001 x) <>)) but that doesn't work because partial returns another lambda function and now I'm chasing my tail...
16:38rasmustohmm, I think I see the issue
16:38arrdemI'm not sure it exists tho because I don't actually resolve that partial at compile time (yet) so I can legally do that transformation because partial is just a function invocation at this point
16:39arrdemyeah this is legal nevermind. I retract my grumbling.
16:39arrdemclojurebot: compilers |are| hard
16:39technomancypretty sure that's a dupe
16:40arrdemtechnomancy: hum?
16:40technomancyI mean I think he already had that exact factoid.
16:40rasmustoclojurebot: compilers?
16:40clojurebotI don't understand.
16:40arrdemI wouldn't be surprised.
16:47PigDudeif i have a hash with a key that refers to antohre key in the hash, is this a good way to acces it or is there a function i missed? (-> h :k h)
16:48lavokadhi
16:48PigDude,(let [h {:a 1 :b :a}] (-> h :b h))
16:48clojurebot1
16:49BronsaPigDude: that only works if your key is a keyword
16:49PigDudemy key is a keyword
16:49{blake}Heyo! Trying to follow along with this doc page: http://clojuredocs.org/clojure_contrib/clojure.contrib.zip-filter.xml/xml-%3E
16:49PigDudebut i am interested in how to do it if not also :)
16:50{blake}I can define the parse-str shown in the first step (03-05) but then the "def sometree" fails with "CompilerException java.lang.IllegalArgumentException: No matching method found: createXMLStreamReader for class com.sun.xml.internal.stream.XMLInputFactoryImpl".
16:50BronsaPigDude: (get m (get m k)) is safer
16:50lavokadhi
16:51lavokadmaybe someone can try to answer this?
16:51lavokadhttp://stackoverflow.com/questions/23898230/clojure-evaluation-process-the-readers-job-and-directly-passed-data-structures
16:51lavokadwould appreciate a lot
16:52FrozenlockIs there any good web interface for a repl? Like tryclojure, but better... :-p
16:52RaynesFrozenlock: Could you elaborate on what 'better' means.
16:52RaynesI mean
16:52RaynesI can repackage tryclojure without sandboxing if you'd like to host it on your machine ;)
16:53FrozenlockRaynes: I already have that
16:53llasramlavokad: Yes; and yes
16:53FrozenlockI mean able to select text
16:53llasram,'(+ 1 2 3)
16:53clojurebot(+ 1 2 3)
16:53FrozenlockShowing arguments list
16:53llasramlavokad: And "programs directly generating data sent to the compiler" is essentially what Clojure macros are
16:54RaynesFrozenlock: https://github.com/chrisdone/jquery-console
16:54RaynesFrozenlock: I'm bound by what this can do.
16:54RaynesFixing issues with tryclj means fixing issues with that.
16:54RaynesI do not know of a 'better' tryclj that exists that does not use this library.
16:55FrozenlockRaynes: Hey I didn't say it wasn't good! I was just looking around to see if there was alternative.
16:55RaynesIf you find one, let me know, because I'll happily steal their repl.
16:55RaynesI take no offense.
16:55FrozenlockIIRC catnip was pretty sweet, but more complex
16:56RaynesAlso did something completely different.
16:57DomKMIs the docstring for core.match/match inaccurate? It says "Take a vector of occurrences, vars. Clause question-answer syntax is like `cond`. Questions must be wrapped in a vector" https://github.com/clojure/core.match/blob/master/src%2Fmain%2Fclojure%2Fclojure%2Fcore%2Fmatch.clj#L1966-1976
16:57DomKMSeems to work just fine without wrapping them in vectors. https://www.refheap.com/85986
16:58amalloyDomKM: i think you're encouraged to use a vector so that it's easier to add guards and stuff like that
17:07DomKMamalloy: I'm not familiar with guards but a quick search looks like they are a way of testing properties of values. Is that correct? Anyway, I'd expect docstrings to be as accurate as possible; maybe it's outdated.
17:16technomancyit just struck me how weird it is that clojure.core/name works on strings
17:16technomancy,(doc name)
17:16clojurebot"([x]); Returns the name String of a string, symbol or keyword."
17:16technomancy"the name String" ??
17:16lazybottechnomancy: Uh, no. Why would you even ask?
17:17technomancyit's convenient but weird
17:17amalloyTimMc: just stumbled upon https://github.com/amalloy/clojopts/commit/b78e71f00c9afe5c29c0cc1dfee1553ef1404631 - "Replace separate with a juxty thing because heck yes"
17:17technomancy \m/
17:18technomancythrowin' up the horns, mang
17:19gfredericksit's so obvious in hindsight
17:19hiredmantechnomancy is pretty metal
17:20technomancyclojurebot: juxt is pretty metal
17:20clojurebotAck. Ack.
17:20amalloyoh my gosh. clojopts.util is like the predecessor to amalloy-utils. this is like the first stuff i ever wrote
17:20amalloyi wonder if i can find out what my first commit on github is
17:27lavokadpls someone
17:27lavokadhttp://stackoverflow.com/questions/23898230/clojure-evaluation-process-the-readers-job-and-directly-passed-data-structures
17:29TimMcamalloy: :-D
17:30PigDudethanks Bronsa
17:30TimMclavokad: Looks like your question was already answered 20 minutes ago.
17:32TimMcAlso, begging is not very attractive.
17:33amalloyyou just don't hang out with the right beggars
17:33TimMcIt's true.
17:34TimMcamalloy: Some day I'm going to rewrite clojopts to make it better suited to dynamic configuration.
17:35amalloyTimMc: you mean working with data instead of the clojopts macro?
17:36amalloyclojopts desugars into something that's at least kinda usable, i think
17:37amalloylooking at that file now i remember being *very* confused about how to write a macro that just wraps a function. there are numerous failed attempts just sitting there
17:38TimMcYeah, I found the macro insufficient. It has been a while, but I have use for it again.
17:39amalloyTimMc: it looks like all the macro does is prevent you from having doing a bit of quoting and grouping: (clojopts "drake" (with-arg var v "Set a workflow variable.")) desugars to (clojopts* "drake" (with-arg ["var" "v"] "Set a workflow variable.")), which is all functions and values
17:39cbpIf I have a function that returns two or more items, eg [1 2], [3 4], etc. And I want to turn it into a lazy-seq (1 2 3 4..) how do I do that?
17:40gfredericksso it returns [[1 2] [3 4] ...]?
17:40cbpyes
17:40gfredericks(apply concat items)
17:40gfredericks,(apply concat [[1 2] [3 4] [5 6]])
17:40clojurebot(1 2 3 4 5 ...)
17:41cbpbut that resolves the whole thing
17:41amalloyi'm actually impressed by how well clojopts has held up, given how little clojure i knew at the time
17:41gfrederickscbp: no it's lazy
17:42cbpOh
17:42cbpsilly me
17:42cbpthanks!
17:43gfredericksnp
17:44p_lanyone got a macro to cleanup dispatch based on type-overloading (a'la Java)?
17:52gfredericksp_l: like...with protocols?
17:53p_lgfredericks: like "an interface that exports single method that dispatches on class of the first argument" :)
17:53p_li.e. what I'm implementing on Clojure side
17:54gfredericksa protocol would be fine for that
17:54gfredericks,(defprotocol IFoo (single-method [first-arg]))
17:54clojurebotIFoo
17:55gfredericks,(extend-protocol IFoo Number (single-method [n] (inc n)))
17:55clojurebotnil
17:55gfredericks,(single-method 41)
17:55clojurebot42
17:55p_lgfredericks: I am not writing the protocol, I am implementing an existing Java Interface
17:55gfredericksooooh
17:55gfredericksthis makes more sense :)
17:55gfredericksso you're creating your own types to do this?
17:56p_lended up currently with something that looks like this (defn transform ([this x] (transform1 this x)) ([this x y] (transform2 this x y)) ([this x y z] (transform3 this x y z )))
17:56p_land yes, gen-class is involved
17:57gfredericksgen-class is the last-ditch way to make a type
17:57gfredericksthe first ditch ways are
17:57lavokadTimMc: if you can't help or say anything usefull, u should shut up because nobody cares about moral comments
17:57gfredericksreify, defrecord, proxy, and deftype
17:57p_lgfredericks: And the only one that apparently works in my case
17:57TimMclavokad: THat's the ticket, you're sure to get plenty of assistance now!
17:58lavokadTimMc: begging is different thing than asking for an answer to a question
17:58gfredericksp_l: why so?
17:58lavokadTimMc: i dont care, ill then have to read and understand myself
17:58amalloygfredericks: the zeroth ditch way is to use a hashmap. probably not really relevant to this discussion, but fun to say
17:58p_lgfredericks: class that must be used by Java code, implementing Java interface, and usable as normal class in Java...
17:59p_lI suspect I could have managed with proxy and a factory method...
18:00amalloyp_l: you can usually manage by exporting an interface (written in java, say) that your clojure object should conform to; then provide a clojure function that creates instances of that interface. it's a little tedious for java consumers to call that function, but not actually difficult
18:00amalloyand then once they have an instance, it feels like any other java class
18:00p_lamalloy: that's the proxy method I mentioned right now, yes
18:00amalloywell, reify
18:01amalloynot proxy
18:01p_lamalloy: unfortunately, in progress of dealing with the interface, I found that the best thing to do to maintain data integrity was to subclass a java class
18:02amalloyare you sure you wouldn't be better off writing this in java? you want a named class that subclasses another class and dispatches based on types of arguments passed to it. that's all easy in java and all hard in clojure
18:03p_lamalloy: the really hard parts are way too annoying in Java :)
18:03amalloyso have the hard parts delegate to clojure via a less awful api
18:03amalloymove the clojure/java boundary so that the java-friendly stuff is on the java side, and the rest is on the clojure side
18:04gfredericksdoing class stuff isn't too hard with instance? and condp maybe
18:05gfredericksor a multimethod
18:05p_lgfredericks: yeah, going through multimethods right now
18:05gtrakjust don't do what we did.
18:05amalloytechnomancy: `lein deploy clojars` tells me to see `lein help deploy` for help with credentials; but that just sends me to `lein help deploying`. is there a reason i'm not sent to the right place to begin with?
18:05p_lgtrak: ?
18:06gtrakNested protocols mirroring interfaces :-).
18:06amalloyor rather, is there a reason the second place isn't the right place, i guess
18:06gtrakto support a java-plugin system that falls back to clojure ones.
18:10technomancyamalloy: nope, looks like an oversight
18:11owl-v-what makes developers fear Oracle?
18:11technomancyamalloy: fixed
18:11amalloythanks
18:13gtrakowl-v-: google lawsuit?
18:13owl-v-is that all?
18:14owl-v-oh, oracle won the game
18:14owl-v-lol java back-stab
18:15gtrakI think that's also why James Gosling left
18:15TimMcamalloy: And the last time I used clojopts seriously I didn't know nearly as much Clojure either. :-P
18:16TimMcI think I probably didn't know how to dig underneath macros at that point.
18:16amalloyTimMc: every so often i find someone who actually uses clojopts, and i'm surprised
18:16gtrakerr maybe not
18:16amalloyfactual has got to be the primary user by far: they use it for drake
18:18amalloythe thing that really bugs me about clojure.tools.cli (nee clargon) is that it rolls its own option parsing, instead of just using gnu getopt. that wouldn't be so bad if it were actually compatible, but instead you get a command-line environment that just seems foreign
18:19technomancyit doesn't do the "single-dash for long opts" atrocity does it?
18:20turbofailno
18:21amalloynot anymore
18:22owl-v-but google was violating the copyright
18:22p_lgtrak: dunno about language people, but from someone who interned in Sun's hw-related division around the time of takeover, the general outlook on employment of existing crew was glum even without moral issues :)
18:22p_lowl-v-: Except that nowhere except USA is API covered by copyright, and that's the first ruling, ever, to claim that API fell under copyright
18:22technomancyowl-v-: that's absurd
18:23amalloytechnomancy: actually it looks like last december tools.cli started parsing things pretty normally. it's still hand-rolled, but seems fairly compatible
18:23turbofailimplementation of an API being regarded as copyright infringement is insanity
18:23p_lowl-v-: except USA copyright law as usual forgot to put down important things in the sheeple-like run towards turning copyright around from its purpose
18:24p_lTimMc: don't forget to take away the house because it had round pipes
18:25arrdemTIL standard == copyright.
18:26p_larrdem: the ruling about API essentially meant that the standard is copyrightable...
18:26owl-v-wait, i thought oracle won the game.
18:26p_lowl-v-: it won an appeal
18:26p_land lost the game for everyone in USA in exchange, including possibly themselves
18:26owl-v-how about final boss?
18:26arrdemowl-v-: they did win that round with a bull ruling that likely will not stand in a 2nd appeal.
18:27owl-v-is it still on-going?
18:27p_lowl-v-: it's not final
18:27owl-v-omg
18:28p_lthey got it to ignorant/"helpful" court for the appeal, so I've got yet another reason to avoid USA ;)
18:28arohneris there a library that has a replacement for clojure.contrib.repl-utils/show ?
18:32amalloyarohner: clojure.reflect is less friendly but exposes more information
18:32amalloywell. it's less human-friendly, much more computer-friendly
18:32arohneryeah
18:32arohnerI just want a simple user-friendly thing for REPL debugging
18:32arohnerand it's irritating pasting (defn show [] ...) into every project
18:33amalloyarohner: well, don't do that. put it in a library
18:33owl-v-is that why google is holding back dalvik development?
18:33arohneramalloy: yes, which is why I was asking if there was a library first :-)
18:34technomancyarohner: there are a few ports of the swank inspector
18:34amalloyoh yeah, i always forget about the swank inspector
18:34{blake}I need to walk through this doc example but I can't get past the "def sometree": http://clojuredocs.org/clojure_contrib/clojure.contrib.zip-filter.xml/xml-%3E
18:35owl-v-so.. what happens if oracle wins? what changes.
18:36technomancyowl-v-: most software becomes illegal in the US
18:36technomancywhich is already the case
18:36technomancybut now it's illegal on copyright terms as well as patent terms, woooo
18:36p_lincluding oracle's
18:37owl-v-including OpenJDK?
18:37arrdemif Oracle tries to shut down the OpenJDK project they will be shooting themselves in the foot with a Davy Crocket.
18:38p_lowl-v-: OpenJDK might be safe from Oracle copyrights, but it would be open to other claims because, for example, they implemented in a support library on some platform an API that wasn't theirs...
18:38owl-v-what happens to clojure then, if oracle wins the game?
18:39p_lowl-v-: to clojure itself probably nothing
18:39amalloytechnomancy: i have no idea what pgp key i used to push to clojars on my previous computer, and am setting it up anew here. should i just replace the old key at https://clojars.org/profile with a new one, or do something else?
18:40owl-v-then clojure is locked on proprietary platform i guess...
18:40technomancyamalloy: yeah, that's probably best
18:40technomancyowl-v-: it's already impossible to fork openjdk in the US
18:40technomancybecause of patents
18:40TimMcarohner: https://github.com/timmc/handy/blob/master/src/org/timmc/handy/repl.clj
18:40owl-v-then somebody should fork clojure
18:41arohnerTimMc: thanks!
18:41TimMc(show object) or (show Class)
18:41technomancyowl-v-: that doesn't make any sense
18:42technomancyowl-v-: a port is not a fork
18:42TimMcOh huh, (show nil) gives an NPE. Oh well.
18:42owl-v-they can literally put price tags on every machine if they want by simply changing license terms.
18:42technomancyowl-v-: no they can't
18:43technomancythey can't change the license terms of openjdk 8
18:43owl-v-but it has java api
18:43owl-v-right?
18:43technomancyit's already licensed as free software
18:43technomancythe worst they could do is lock out future improvements post-8
18:44owl-v-locking future improvement means death of software
18:44technomancysure, in the long term
18:45technomancyit's still so far ahead the competitors that it would be possibly decades before any other runtime could catch up
18:45technomancypossibly a decade, rather
18:45owl-v-x-jvm engineer should work on llvm or something else-vm
18:47hiredmanllvm really would have saved a lot of confusion if they had left out vm
18:47technomancy"it's the zeromq of virtual machines!"
18:48p_lhiredman: confusion among people who don't have even basic grounding involved in using something like LLVM...
18:48hiredmanhey, it's a vm, we should run on it!
18:49technomancyI think there's a dilbert about that
18:50cbpwait gfredericks i think i asked the wrong question
18:51p_lyour OS is a VM, a lot of CPUs kinda count as VM (definitely in combination with modern firmware on many platforms), etc.
18:51owl-v-if clojure is locked up in proprietary JVM then clojure is not so open after all.
18:51p_lowl-v-: there's more than Oracle's JVM
18:51cbpI have a fn that returns a lazy-seq of ((a b) (c d e) ..) and want to turn it into a lazy-seq of (a b c d e ..)
18:52cbpapply will resolve the lazy-seq
18:52gfrederickscbp: still sounds like apply concat
18:52gfrederickswhat makes you say that?
18:52cbp,(take 10 (apply vector (range)))
18:52clojurebot#<OutOfMemoryError java.lang.OutOfMemoryError: Java heap space>
18:52gfrederickscbp: that's vector not apply
18:53gfredericks,(take 10 (apply concat (repeat '(1 2 3))))
18:53clojurebot(1 2 3 1 2 ...)
18:53gfrederickscbp: ^ called apply with an infinite seq
18:54stormeHello
18:54gfredericksstorme: hello
18:55stormeQuestion, if I have a hash like so: {:b 4 :c 3 :e 7}; what would be the best way to pick out the key with the lowest value?
18:55gfredericks,(let [m {:b 4 :c 3 :e 7}] (key (apply min-key val m)))
18:55clojurebot:c
18:56technomancyclojurebot: why the long face?
18:56clojurebotexcusez-moi
18:56stormegfredericks++
18:56Jaooddoes lein uberjar handles jar conflcts?
18:56amalloy(inc technomancy)
18:56stormethanks!
18:56lazybot⇒ 109
18:58arrdem(inc gfredericks)
18:58lazybot⇒ 64
18:58technomancyJaood: by default it's last-one-wins, but you can change it
18:59gfredericksdo chatbots on other planets respond to foo++?
18:59TEttingergfredericks: yes
18:59{blake}(inc ++)
18:59lazybot⇒ 1
18:59gfredericksI grew up here so this is all I know
18:59technomancyin #emacs the bot claims to track points but just emits random numbers when you try to query it
19:05amalloy#emacs is a weird place
19:05arrdem#emacs is seldom on topic
19:05cbp,(defn foo [i] (lazy-seq (do (println i) (cons (list i) (foo (inc i))))))
19:05clojurebot#'sandbox/foo
19:05cbp,(def x (foo 0))
19:05clojurebot#'sandbox/x
19:05Frozenlo`#emacs is fun. They talk about all-dressed pizza :-p
19:05cbperm
19:06arrdemcbp: wat
19:06cbpwell that prints the first 3 numbers on my repl
19:06owl-v-i didn't know mono uses llvm o_O
19:06amalloyRaynes: feature request: lazybot randomly adds or subtracts up to a thousand from karma when it's queried
19:06gfrederickscbp: concat is slightly not lazy
19:06amalloyi look forward to people typing $karma amalloy a hundred times to get decent error bars on it
19:06gfredericksit will realize the first 3 or so elements
19:06cbpgfredericks: aha!
19:06amalloycbp: no way that prints anything in your repl
19:06amalloyif you used concat it might
19:07cbperr
19:07cbp,(def x (apply concat (foo 0)))
19:07clojurebot0\n1\n2\n3\n#'sandbox/x
19:07gfrederickscbp: related: http://dev.clojure.org/jira/browse/CLJ-1218
19:07cbp^ I meant that
19:07cbpWell
19:07cbpDo I have to write my own lazy concat?
19:08cbpBecause each recursion of the lazy seq does a network call
19:08gfredericksthat ticket has a fully lazy version that you could probably use
19:08cbpgfredericks: thanks
19:08gfredericksit's mapcat instead of apply concat but that's probably what you want anyways?
19:09gfredericksoh wait
19:09gfredericksno it isn't
19:09gfredericksit's exactly what you already wanted, just without the apply
19:09hiredmanobviously you should use a reducer instead
19:10gfrederickshiredman: I'm going to interpret this as irony.
19:10hiredmanit may or may not be
19:11gfredericksclojurebot: it |may or may not be|
19:11clojurebotTitim gan éirí ort.
19:11hiredmanI think reducers are much better for io kinds of things than lazy seqs, and I don't think clojure.core.reducers/mapcat has the realizing too many bits problem
19:12gfredericksI don't think I knew that reducers + IO made any sense
19:12cbp^
19:12hiredmanI have some literature for you
19:12hiredmanhttp://ce2144dc-f7c9-4f54-8fb6-7321a4c318db.s3.amazonaws.com/reducers.html
19:15apricotsi created a nrepl middleware and it works in my nprepl project’s dir, but when i reference it from ~/.lein/profiles.clj it can’t find it even though i’ve added it as a dep in the :plugins list. is there something I have to do to “install” my nrepl middleware?
19:16hiredmanon the other hand, rewriting every is very tedious as is reprogramming people from lazy seqs to reducers
19:16hiredmaneverything
19:17amalloyhiredman: i don't think "The reduce operation as defined by the reducers library makes no promises about the order in which elements will be reduced" is true at all
19:17amalloyit promises to go in the same fold-left order as clojure.core/reduce
19:18amalloyit's the fold operation that makes no such promise
19:18owl-v-lol clojure-py and ClojureCLR
19:19hiredmanamalloy: the reduce operation as an abstract notion doesn't
19:19arrdemowl-v-: why lol?
19:20gfrederickshiredman: sweet
19:21owl-v-arrdem: i didn't expected those
19:21owl-v-i'm not sure ClojureCLR is compatible with mono
19:24Jaoodtechnomancy: thanks
19:25Jaoodowl-v-: ClojureCLR is on the front page of clojure.org ;)
19:28owl-v-Jaood: nice, but i don't have MS Windows
19:29noprompt,(gensym "+")
19:29clojurebot+27
19:29noprompt,(gensym "-")
19:29clojurebot-52
19:30danielcomptonWhat's the lein tool that runs eastwood + a bunch of others as well?
19:32noprompti'm not sure where the bug is but the cljs repl reports (gensym "+") will display that as 27 and not +27.
19:32noprompts/will display that//
19:32danielcomptonGot it, it's checkall
19:35technomancydanielcompton: you can compose an alias to run a bunch of tasks with do
19:36danielcomptonso I would run lein do checkit ?
19:36owl-v-dalvik is outdated and android will change... maybe use V8 as main programming language?
19:36owl-v-we have clojurescript :-)
19:37Frozenlo`doesn't cljs require clojure to compile to js?
19:37arrdemFrozenlo`: it does. neither clj nor cljs is self hosting out of the box.
19:38nopromptcljs will be self-hosted in the distant future. i hope anyway...
19:39noprompttools.analyzer ftw
19:41arohnerwhat does "Can't call public method of non-public class" mean?
19:42amalloyarohner: you can't use reflection to call methods on a non-public class, even if those methods are public and are specified by a public interface
19:42amalloyyou can fix it by type-hinting the thing you're calling a method on as an instance of whatever interface
19:43arohnerthanks
19:45dannoI just learned I can name stuff with a prime (')
19:45danno(def x' 10)
19:45dannoAny side effects I should know about doing that?
19:46arohneramalloy: thanks, that was the last bug. Now I can read audio out of my rocksmith guitar cable into clojure!
19:46amalloyyou may be mistaken for a mathematician
19:46amalloyalso your code won't work in versions of clojure before 1.3
19:47hiredmandanno: that is not prime, that is single quote
19:47dannoCool, screw the the <1.3 crowd anyway
19:47hiredmanthere is an actual unicode prime mark, and you can use that too
19:47dannokidding
19:47amalloywell, that's a reasonable attitude to have, danno. even old curmudgeons like me are on newer versions than that
19:48dannohiredman: good call, points for exactness, thanks
19:48hiredman
19:48arrdem,(def foo′ 3)
19:48clojurebot#'sandbox/foo′
19:48arrdem^ foo prime
19:53dannothanks all
20:05danlamannalost on require/use/import - i essentially want to import edu.stanford.nlp.ie.crf.CRFClassifier.main (static method) as train-model
20:06danlamannawhich should i be using? (this is from a local jar i put on :resource-paths in my project file)
20:09technomancydanlamanna: you can't alias classes, only namespaces
20:12gfredericksdanlamanna: you want (:import edu.stanford.nlp.ie.crf.CRFClassifier) and then (CRFClassifier/main)
20:18gfrederickshiredman: this literature might be about to change my life
20:21rasmusto,((fn [& _] 'foo) 'blah)
20:21clojurebotfoo
20:21hiredmancool
20:26rasmustooh, constantly is a thing
20:27gfredericks,(((constantly constantly) constantly) constantly)
20:27clojurebot#<core$constantly$fn__4085 clojure.core$constantly$fn__4085@197fe9>
20:27gfredericks,(take 10 (iterate constantly constantly))
20:27clojurebot(#<core$constantly clojure.core$constantly@1ed13a3> #<core$constantly$fn__4085 clojure.core$constantly$fn__4085@1a4500a> #<core$constantly$fn__4085 clojure.core$constantly$fn__4085@82fff0> #<core$constantly$fn__4085 clojure.core$constantly$fn__4085@711710> #<core$constantly$fn__4085 clojure.core$constantly$fn__4085@a13863> ...)
20:27rasmusto,(reduce constantly (repeat constantly))
20:27clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core/constantly>
20:28rasmustodarn
20:28amalloyITYM (reduce (constantly constantly) (repeat constantly))
20:28rasmustohahha
20:28rasmustoso constantly is useful for one thing in my code, where is it used otherwise?
20:29rasmustobrb, grepping clojure.core
20:29gfredericksother places in other peoples' code
20:29rasmustogfredericks: ah, okay
20:29amalloyanytime you've got a function that's "too general" for your specific case
20:30amalloylike, map lets you pass a function to decide what each value should be. but maybe you want it to always be the same thing: then you can use (map (constantly 'whatever) xs)
20:30rasmustoahh, right
20:30rasmustowhich is exactly how I'm using it. I have a high-order function that takes a "function" that might be constant
20:30rasmusto:)
20:31gfredericksalso useful for stubbing functions with with-redefs
20:31gfredericks,(with-redefs [+ (constantly 42)] (map + [1 2 3] [4 5 6]))
20:31clojurebot(42 42 42)
20:32amalloyflatland.useful.fn used to have an entertaining use of constantly
20:32amalloywe have this (vaguely gross) policy that if you pass something that could be a function but isn't, we wrap it in (constantly) for you
20:33amalloyso what it currently looks like is https://github.com/amalloy/useful/blob/develop/src/flatland/useful/fn.clj#L25, but it used to look like (fix x (! ifn?) constantly)
20:33rasmustohm, I could do that instead of dropping (constantly myfn) into like 10 places
20:35gfredericksamalloy: duck wrapping!
20:35rasmusto(constantly 'turducken)
21:26owl-v-installing SBCL
21:33cbpowl-v-: is everything ok?
21:34p_lcbp: sounds like bad case of locked-in panic
21:39owl-v-dang! ROS has roslisp >> http://wiki.ros.org/roslisp
21:40TEttingerowl-v-: you're doing robotics stuff?
21:40owl-v-java is not there because... well, not an open source (code and license).
21:40TEttingeropenjdk?
21:41owl-v-yes, robotics is my main target, not pc
21:41owl-v-openjdk will die as soon as oracle wins the game
21:41TEttingeryeah, I would imagine SBCL might be a bit better for that. clojure uses a lot of memory usually
21:42owl-v-ah, but that JVM...
21:42cbpI'd go for racket =)
21:43owl-v-isn't racket slower than SBCL?
21:43p_lprobably
21:43p_lbut those two implement different languages
21:44owl-v-mm, small memory foot-print...
21:44arrdemsbcl has a really good compiler... plenty of tricks I hope to steal :D
21:45owl-v-i don't know... clojure-sbcl maybe?
21:45arrdemowl-v-: meh it could be done but why
21:45p_llol @ "small memory footprint" and "SBCL" without a negation
21:45arrdemp_l: br0 jvm looses hard sometimes. pick your battles :P
21:46owl-v-i only use subset of clojure, so it would be easy to migrate to sbcl
21:46p_lstill can suck hard when you spinup poor laptop's disk to load 140 MB executable :P
21:47arrdemif 140MB is a problem, then you're looking in the wrong place with lisps.
21:47arrdembust out that K&R C book and like it
21:47owl-v-where does 140MB comes from?
21:47p_larrdem: just for comparison - CCL routinely generates 2~4x smaller images, and LW has no problems making full application take less than 10M
21:47owl-v-sbcl?
21:48p_lowl-v-: that was for a full application
21:48p_lSBCL itself... let me check
21:48arrdemp_l: my CL experience is limited at best, I decided rapidly that Scheme was a dead end and that the CL community was cruftier than I was willing to deal with so I ran for Clojure when a mate suggested it.
21:49p_l45MB for "naked" SBCL core on amd64
21:49p_lthe one that I normally load takes 80M of dynamic space after load
21:49owl-v-only 45MB?
21:51owl-v-if i get minnowboard-max ddr3-2GB ram then i should be fine :-)
21:51owl-v-if beaglebone-black, i should still be ok
21:52p_lwell, there's new port for ARM, but I haven't tested it
21:52p_lshould take ~25 MBs of RAM, due to 32bit pointers
21:52owl-v-why not 64bit pointers?
21:52owl-v-if 64bit processors
21:53owl-v-oh, minnowboard-max is x86 atom board
21:53owl-v-64bit
21:55owl-v-finished installing sbcl/1.1.18
21:55owl-v-lol 51M
21:56p_lhttp://bpaste.net/show/308485/
21:57p_lmaybe I should setup precompiled core for QL...
22:00cbpI thought sbcl 1.2 was just released?
22:00p_lcbp: I didn't bother to update for some time :P
22:00owl-v-yes
22:00p_land yes, 1.2 is quite fresh
22:01owl-v-no bug fix (if exists)
22:01p_las in I think I observed last bug squashing before release yesterday or two days ago
22:01owl-v-i mean bug on 1.2
22:02p_lI meant "last bug squashing before 1.2.0 release so that arm support could go in" :)
22:02owl-v-lol strong ARM
22:02arrdemheh
22:04owl-v-p_1: what's quick lisp u posted?
22:04owl-v-this? >> http://www.quicklisp.org/beta/
22:04p_lhttp://www.quicklisp.org/
22:04p_lyes
22:04p_lalso, fix your font
22:05owl-v-fong?
22:05owl-v-font?
22:05owl-v-oh, 1 -> l?
22:05owl-v-p_l: ok
22:07amalloyp_l: fix your nick? i mean, it'd be nice to have a font where it's easy to tell the difference, but you know it's common not to
22:07p_lamalloy: it's less about the nick, tbh - 1/l mistakes in code are much funnier :)
22:11owl-v-amalloy: p_l: no, it's just my input font and screen font are different
22:14owl-v-lol sbcl worst case is slower than clojure? >> http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?test=all&amp;lang=sbcl&amp;lang2=clojure&amp;data=u64q
22:14owl-v-x3 slower and x3 more code
22:15yediprismatic using om in production, pretty cool
22:18p_lowl-v-: looks like bad typing in few places
22:23eraserhdwhy is aget so slow?
22:29p_lowl-v-: http://benchmarksgame.alioth.debian.org/u64q/program.php?test=binarytrees&amp;lang=sbcl&amp;id=2 <--- in this worst case benchmark, you can see compiler complaining about types ;)
22:29justin_smitheraserhd: what type of array? if it is an array of Object you could have a reflection issue
22:30amalloyeraserhd: if you don't type-hint the array then aget uses reflection
22:30amalloyregardless of what type of array it is
22:32p_ltype erasure makes reflection necessary in absence of hint, iirc
22:36justin_smithp_l: well "type erasure" is a javac thing, and since clojure isn't using javac for this stuff, it's just the issue that the array itself is untyped
22:37justin_smithso you need to provide that info out of band somehow
22:38yediis there a function that does this: #(if (% username) (disj % username) (conj % username)) where % is a set
22:42owl-v-p_l: i wonder what's FIXNUM is...
22:46bbloomhttp://clhs.lisp.se/Body/t_fixnum.htm
22:47bbloomgenerally, a fixnum is an integer that fits in to a pointer, where the highbits being set indicate a dynamic object pointer vs a fixnum
22:48bbloomexplaination in the java context here: https://blogs.oracle.com/jrose/entry/fixnums_in_the_vm
22:53owl-v-so sbcl was slow because of std-output?
22:54hellofunkis there a reflective technique by which you can tell if a particular defrecord instance implements a particular protocol?
22:58owl-v-11th case was omitted because bad output :-(
22:59gunshellofunk: see clojure.core/satisfies?
23:04p_lowl-v-: SBCL was slow because it essentially did reflection on + and - due to improper type derivation
23:04owl-v-p_l: i think this is the worst case, which is 10th case >> http://benchmarksgame.alioth.debian.org/u64q/program.php?test=knucleotide&amp;lang=sbcl&amp;id=4
23:05owl-v-yes, k-nucleotide
23:05p_lJava 'long' is plain dead simple, meanwhile SBCL's fixnum on 64bit is (unsigned-byte 62) (2 bits less than java). In this case, Clojure calculated with primitive, while SBCL constantly checked if it wasn't fed a BigNum :)
23:05owl-v-that's the last one
23:06p_lyeah
23:08owl-v-p_l: so the output was ok, it just checks number too many times?
23:13p_lfor the binary-trees thing
23:13p_lk-nucleotides I'm not in shape to decode right now
23:13p_land no idea about the broken one
23:22owl-v-lol optimization >> (declaim (optimize (speed 3) (debug 0) (space 0) (safety 0)))
23:33technoma`owl-v-: FWIW racket has had JIT support on ARM for longer than SBCL, so I wouldn't be surprised if it's ahead in performance
23:33technoma`owl-v-: though making assumptions like that without data is silly
23:34owl-v-*shrug* racket is quite big because it has stuff like graphical interface
23:35technoma`racket/base leaves all that stuff out
23:35technoma`it's about 700kb for a standalone executable
23:35owl-v-ah.
23:35owl-v-osx version is 333.3mb
23:36technoma`right; that's the full development environment
23:37p_ltechnoma`: the question is how well Racket does type derivation and such (and whether it can do hotspot-style optimizations in JIT)
23:37owl-v-racket and sbcl >> http://benchmarksgame.alioth.debian.org/u64q/racket.php
23:38owl-v-much lesser code hm..
23:39technoma`p_l: I'm actually more curious what "SBCL supports ARM" means. it seems likely that it means the interpreter works on ARM, which probably means they haven't optimized it anything close to what they've got for x86, but I could be wrong.
23:39technoma`owl-v-: that's an x86 comparison
23:39p_ltechnoma`: the interpreter is not considered a port to anything :)
23:40p_ltechnoma`: SBCL does *NOT* work without native code generation
23:40technoma`p_l: huh, I didn't know that
23:40p_l(it's quite simply impossible for the runtime to operate in other way than compiled)
23:41p_lthere's an evaluator that barely anyone remembers it exists, is by general consensus considered to be buggy, and it depends on the compiled code anyway (as it can only be used to run user's code, not internals)
23:42p_lit's the funny effect when your "interpreter" is written in the language it interprets
23:43owl-v-lol without regex, sbcl looks too many codes
23:43owl-v-racket has regex
23:46p_lSBCL doesn't do much in terms of contribs. Also, as can be seen, CL similarly to clojure starts to get full of type hints when you start optimizing :D
23:48p_lhttp://benchmarksgame.alioth.debian.org/u64q/program.php?test=mandelbrot&amp;lang=sbcl&amp;id=1 <--- though this is overkill - the code adds new instructions to compiler (SSE intrinsics)
23:49p_l(and the code still has compiler notes saying it can't optimize due to wrong or unclear types...)
23:49amalloybbloom: usually lowbits, not highbits, right?
23:49amalloynot that it matters much
23:50owl-v-sbcl is like 'not so much in ready to market'
23:51p_lowl-v-: it's just a compiler (that has been around longer than Racket existed). Rest is to be loaded from 3rd party libraries
23:52owl-v-there is 3rd party?
23:52kwertiiAnyone here use friend-oauth2? I added the workflow to my app as per the example code, but it redirects unauthenticated users to "/login" rather than to the 3rd party auth provider. What am I doing wrong?
23:53p_lowl-v-: that's the difference between Scheme and Common Lisp, yes, we have libraries that are compatible between implementations