#clojure logs

2013-11-27

00:01amalloyjustin_smith: i can't tell which of his proposed forms you're saying you prefer
00:02justin_smithI'm saying the latter is better, and that maybe it doesn't need to be a macro (it is so close to being a normal let with some symbols scrambled)
00:02bellkevThat's a fair point... I guess my thinking was just that since a "template" is such a key entity in the world of AWS, it would be nice if there was a 1:1 mapping between clojure-based template file with a single root element (like project.clj) and AWS JSON-based CloudFormation template
00:03justin_smithand I guess that would be my "replicating something in the domain that makes it clearer"
00:04justin_smithI don't know the thing you are translating to, so the value of that could have been lost to me
00:05bellkevYeah... It's still definitely a judgement call...
00:05bellkevThe context though is that, basically these templates are huge JSON files that a lot of people hand edit
00:06justin_smithwhat about a toolkit that breaks down the json file into clojure maps, provides some convenience functions for manipulating and recombining them, and then turns the maps back into json?
00:06bellkevAnd AWS makes tools, like an Eclipse plugin (shudder) that make it easier to write them, with code completion, etc, but it's still just hand-edited JSON
00:07bellkevThat's a possibility
00:07justin_smiththat way we get clojure's extensive data manipulation power
00:08justin_smiththat is what I would hope to find if I had to deal with this format
00:08bellkevAnother thing I want to do is allow custom resource types, some deftypes/defprotocols for resources, which would definitely involve multiple external entities in addition to just the templates
00:08justin_smiththe json -> clojure should be very easy (cheshire or data.json), the hard part probably bein enforcing whatever properties cloudfront expects when you go from clojure data back to json again
00:09justin_smithwhy do you want deftypes?
00:09justin_smithdo they make something easier?
00:09bellkevAlso, there are API calls launch these templates, so there are a lot of cool use cases you could come up with to combine my idea with amazonica or just the AWS Java API to launch stacks
00:10bellkevYou can make custom resources, which have to implement create/update/delete methods, so I thought that might be a reasonable thing to have a protocol for
00:11bellkevYeah, I already played with the conversion to/from JSON, and it's no sweat
00:11justin_smithI had to use a protocol today because I wanted people to be able to use zookeeper to coordinate caribou.core instances, but did not want zookeeper to be a prerequisite to using caribou.core
00:11bellkevThey also publish a JSON schema, which enables programmatic validation
00:11justin_smithif all you need is to ensure certain functions are implemented, why not a function that takes three functions as args?
00:12bellkevOh yeah, I saw the Caribou announcement BTW, congrats!
00:12justin_smiththanks
00:13justin_smithwhat I am saying is that stuff like protocols and types are helpful if you need to make optional implementations more modular, or you need a speed boost, but they can just encumber things if they are not needed
00:13justin_smiths/types/deftypes
00:14bellkevsorry, what do you mean "s/types/deftypes"?
00:14justin_smithI said something about types above, and more precisely meant usage of deftype
00:15justin_smithor defrecord (which is probably closer to what you want if you wanted either)
00:15bellkevSo, Caribou is like Spring for Clojure?
00:15bellkevDoes it do cool stuff with xml? :P
00:15justin_smithumm, should I be insulted?
00:16justin_smithit's a map view controller framework - we translate clojure maps into sql records and back again
00:16bellkevhaha, I'm just kidding, I haven't even really looked at it
00:16bellkevOh, that sounds cool
00:17bellkevSo it's like a Clojure ORM?
00:17bellkevj/k
00:17justin_smithnot arbitrary maps, but we try to keep things as simple and vanilla clojure as possible
00:17justin_smithomm
00:17justin_smitherrr
00:17justin_smithmrm
00:17justin_smithmap relational model :)
00:17bellkevI was just checking out ClojureQL today, and wondering if there was something like that
00:18justin_smithcaribou uses sql because that is a well understood way to persist structured data describing content (slideshow -> slides -> captions that kind of thing)
00:19justin_smithit isn't meant as a way to use sql
00:19justin_smithit uses sql because it happened to be handy for the job we wanted to do
00:25yediso a while back i somehow got nrepl set up in emacs, i wanna start using cider now and am looking into some emacs bundles. anyone have experience with https://github.com/overtone/emacs-live ?
00:25yedior emacs-prelude
00:25clojurebotI don't understand.
00:25bellkevamalloy: I was just going to ask you for more info about the "anaphoric" macro examples, but I just found your blog post about it ;)
00:26bellkevI'll check it out!
00:26yediis there a general suggestion you have for newcomers looking to get set up on emacs?
00:26justin_smithif you start with one of those quick-starts, I wouldn't look to switch to a new one, I would look to customize it to your needs
00:27justin_smithbut then again I started with emacs totally vanilla, and only got into the good stuff slowly
00:28justin_smithI think many learners get overwhelmed with all the gee-whiz and optional awesomeness, where it is more useful if you learn the core movement / cutting / yanking / auto-documentation stuff first
00:28justin_smiththat's just my opinion though
00:29yediyea i have been using emacs for clojure dev recently and am familiar with the controls, my concern is that i'm using emacs to its fullest potential for interactive clojure dev
00:30justin_smithI have heard conflicting reports about whether cider is really ready
00:30justin_smithif you have nrepl and paredit, you should be good
00:32`cbpemacs-live is cool if you're only doing clojure but it doesnt use cider
00:34devnmeh to emacs-live
00:35yedi`cbp: yea that's what emacs-live's repo seems to say
00:35devnnot trying to be a jerk or anything, but i find the amount of opinions to be rather annoying
00:35yedihttps://github.com/clojure-emacs/cider#emacs-live is lyin
00:36devnlike fn becoming the lambda, rainbow parens, the nrepl settings, indentation settings, etc.
00:36devnthe structure to the whole thing is a big rat's nest too IMO
00:36devnthere are these nested modules which have special user configs, yadda yadda -- layers of indirection
00:37devnit feels like java + elisp
00:37devn</rant>
00:37devnthat being said, i really appreciate some of the cosmetic touches they've added, it's just too much for me personally
00:38technomancyyedi: the most popular one is the emacs starter kit
00:38technomancywhich is deprecated because the whole idea is flawed at its root
00:38technomancyhttps://github.com/technomancy/emacs-starter-kit/blob/v3/README.markdown
00:38devntechnomancy: i liked the starter kit when it wasn't modular
00:39devn:X
00:39technomancydevn: it was a necessary evil
00:39technomancysince at the time no one used package.el
00:39clojurebotCool story bro.
00:39technomancythese days everything is a package; just pull in the stuff you want and leave out what you don't
00:40yedii guess i'm just worried i'm missing out on useful emacs functionality for devving clojure
00:40justin_smithhttps://github.com/technomancy/better-defaults the better-defaults are close to what I eneded up at naturally after years of use
00:41justin_smithfor optional packages, use package mode, try them out, uninstall them if you don't like them
00:41technomancyyedi: you can find useful emacs functionality more easily by exploring packages than adopting a big pile of preselected junk all together
00:41justin_smithexactly
00:41technomancythat said, better-defaults is not a bad place to start
00:41justin_smithlooks like it is all stuff that comes with vanilla emacs, just a better config for them
00:42yedisweet thanks guys
00:43justin_smithmy most recent upgrade was simple shortcuts for hs-hide-block and hs-show-block
00:43justin_smithmakes reading source files much easier
00:45technomancywtf; the cider google group isn't visible to non-members
00:45justin_smithout-ciders are not welcome
00:46technomancy>_<
00:46technomancyhttps://github.com/clojure-emacs/cider/issues/424
00:48cemericktechnomancy: funny, just pinned the latest for a reply tomorrow or friday :-P
00:48clojurebotIt's greek to me.
00:48cemerickThis is what happens when I create google groups
00:49yedijustin_smith: ahhhh that was too good xD
00:50technomancycemerick: I might end up cross-posting
00:50technomancyto the main one
00:50technomancyor maybe I'll wait till I have a POC
00:51yediso how would I actually go about getting better-defaults.el on emacs? i'm assuming i add some code to the .emacs.d/init.el file?
00:51justin_smithI'm out, night all
00:51technomancyyedi: M-x package-install better-defaults
00:51yedioh what so easy
00:51technomancyjustin_smith: me too
00:51cemericktechnomancy: I think it's safe to say that anyone who hasn't thought about that particular topic before probably isn't equipped to dive in and grok the constraints in any period of time you'll be willing to wait.
00:51cemerickOr maybe I'm just being a cynical ass.
00:52technomancycemerick: I am a bit impatient when it comes to sweet tooling hacks
00:52technomancyI would like to make it easier for regular clojure hackers who've never touched elisp to enhance their environment though
00:53yeditechnomancy: it says it can't be found, is there somewhere package library i need to import or something?
00:53cemericktechnomancy: as long as you keep other environments in mind, just spike it. Target something other than emacs to prove the "portability" of the approach, and you'll be ~good.
00:54technomancyyedi: yeah, if you don't already have marmalade on your package list it won't work
00:54technomancysee http://marmalade-repo.org
00:54technomancycemerick: "target something other than emacs" I'm not gonna learn vimscript chas =P
00:54cemerickheh
00:55technomancycemerick: what do you think about HTML responses that have local hyperlinks?
00:55technomancyit's easy to redirect those to nrepl messages in emacs
00:55cemericktechnomancy: hey look, if I can write Eclipse plugins, vim plugins, _and_ submit PRs to clojure-mode… :-P
00:55technomancyhehe
00:55technomancybut I have no idea if that's possible with other HTML renderers
00:55bitemyappcemerick: vim is sie enemy.
00:56technomancyit would really be a bummer not have that capability portably
00:56bitemyapptechnomancy: what capability?
00:57cemericktechnomancy: this would be accomplished by having the local tool hang click handlers on buttons in webkit, etc?
00:57technomancybitemyapp: the ability for an nrepl handler to return HTML containing hyperlinks that point to other nrepl endpoints
00:57technomancycemerick: aye
00:57technomancybitemyapp: useful for porting the slime inspector (for instance) to nrepl
00:57cemericktechnomancy: if an environment can embed webkit, that's a pretty reasonable piece of functionality to assume
00:57bitemyappyeah...that's a good idea.
00:58technomancycemerick: right; the question is whether the webkit stuff can be bidirectional
00:58bitemyappwait why does this functionality need webkit?
00:58bitemyappwhat's going on QQ
00:58technomancygonna just assume it's possible
00:58technomancybitemyapp: webkit is just how it would probably happen for CCW
00:58cemericktechnomancy: as in, delivering incremental updates for a particular view
00:58technomancycemerick: right, without going over HTTP
00:58bitemyapptechnomancy: just to have clickable links to nrepl stuff? wut
00:59technomancybitemyapp: webkit to have rich rendering in general
00:59technomancyintra-nrepl links is just the icing
01:00bitemyapptechnomancy: can we just have a working stepping debugger first?
01:00technomancybitemyapp: I'm just laying the groundwork; you can build on it
01:00bitemyappwe have every toy except the one every ghetto language on the planet has.
01:00cemerickbitemyapp: I think "patches welcome" is the general party line.
01:00technomancyI want to make drracket stuff possible
01:00bitemyappuntil I found out about schmettertoomanyfuckingletters I thought it was a lost cause after seeing Ritz.
01:01bitemyappRitz made me lose all hope in a usable debugger. Seriously.
01:01technomancybitemyapp: http://p.hagelb.org/make-it-sew.gif
01:01bitemyappso, next step is to make schmetterwhateverthefuck abstracted into just an HTML frontend for an nrepl provider?
01:02technomancyif you want hyperlinks, I guess?
01:02bitemyapp that's...what no.
01:02coventryschmetterling is so easy to read, compared to ritz.
01:02bitemyapp`cbp: still looking for a project or is Haskell keeping you occupied?
01:02bitemyappk, I'm calling it zergling.
01:02bitemyappk? k.
01:02zRecursive,(doc ->>)
01:02clojurebot"([x form] [x form & more]); Threads the expr through the forms. Inserts x as the last item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the last item in second form, etc."
01:03cemerickbitemyapp: HTML is just the start. Hoping to abstract over canvas for proper visualization of data structures and such. It shouldn't be a very large change to the nREPL protocol.
01:03bitemyapp~zergling is https://github.com/prismofeverything/schmetterling
01:03clojurebotYou don't have to tell me twice.
01:03bitemyappactually sometimes I do.
01:04hiredmanugh
01:04hiredmanyuck
01:04`cbpbitemyapp: always up for ideas. Atm im starting the heckle thing + apparently rdb got an update so i gotta sync up revise with that
01:04hiredmansending data over the is better than sending a rendering of the data
01:05bitemyapp`cbp: cool. Those sound like great ideas.
01:05bitemyapp`cbp: I saw the RethinkDB update, couldn't tell what, if any, parts of the protocol changed.
01:05bitemyappI bumped Revise in the Hacker News thread.
01:05hiredman#chart/rows [[1 2] [3 4] [5 6]] over a blob of canvas anyday
01:05`cbpbitemyapp: :D
01:05`cbpbitemyapp: did you have another project?
01:06bitemyapp`cbp: not a terribly serious one, but zergling could be abstracted into a generic nrepl thing so that Clojure would have a decent debugger.
01:06bitemyappthen you'd make nrepl frontends for the debugger in Emacs, vi, etc etc
01:07bitemyappwell, not *you* you, you know what I mean.
01:07`cbpoh
01:08`cbpthat looks cool
01:08bitemyappthe nrepl protocol has been on my brain lately.
01:14SegFaultAXHeh, vi.
01:14bitemyappHeh indeed.
01:15SegFaultAXI haven't used actual vi in like 5+ years.
01:20Apage43I probably last used it 4 or so years ago
01:20Apage43when I had to touch HP-UX and AIX A lot
01:20bitemyappApage43: do you seek out mental agony in your career on purpose?
01:21Apage43I stumble into it, and never figured out how to stumble out
01:21SegFaultAXI haven't used a distro in 5+ years that didn't make vi a symlink to vim with set compat.
01:22bitemyappApage43: You live in the bay area, just work at one of those companies with with an xbox in the office. Suddenly the tech becomes easy mode but you're surrounded by people that might be a little soft-headed.
01:22Apage43these boxes ran ksh '88
01:22bitemyappSegFaultAX: does anybody use vim without compat?
01:22bitemyappsadists?
01:22Apage43I was using software that hadn't been updated *in my lifetime*
01:22bitemyappmasochists*
01:22`cbpi used it this morning ;-;
01:22SegFaultAXbitemyapp: Dudewut? No one sets compat
01:22Apage43bitemyapp: we have an xbox. and a kegerator.
01:23Apage43noone has ever turned on the xbox
01:23Apage43also I have to write C89 sometimes
01:23SegFaultAXApage43: To be clear, I've been a vim user for most of my Linuxing life. I was merely noting how uncommon actual vi is.
01:24bitemyappApage43: right, so you're surrounded by soft-headed people that like Golang. But I repeat myself.
01:24bitemyappI find C apologists really funny, it's like they don't actually know many death-traps there are without upgrading to C++.
01:24Apage43I wonder if I could argue that it also falls into that "doesn't include any advancements that have been made in my lifetime" category
01:25bitemyappjust wade into ##C for a week, look at the raw paranoia and fear surrounding the massive swath of territory that constitutes "undefined" behavior in the standard.
01:25Apage43SegFaultAX: Me too.
01:25Apage43I mean, to find actual vi I had to actually not be on a linux machine
01:25bitemyappmost of the "undefined" behavior in Clojure people bump into is "is hash-map guaranteeing an order?"
01:25yediomg cljs are so sex
01:26bitemyappyedi: are you okay?
01:26bitemyappyedi: well here, have more sex.
01:26bitemyapp~zergling
01:26clojurebotzergling is https://github.com/prismofeverything/schmetterling
01:26Apage43i saw that today
01:26Apage43i had an accident
01:27bitemyapp+1 please https://github.com/prismofeverything/schmetterling/issues/3
01:28yedithat is amazing
01:29`cbpgithub has no voting :(
01:29bitemyapp`cbp: there are emoticons, just +1 in a comment.
03:03winkhehe, awesome
03:04winkpossibly related: http://www.youtube.com/watch?v=ZlATOHGj9EY (no flash, but should be correct vid)
03:32wei__what's a good way to get java.jdbc to put a biginteger type into a Postgres BIGINT field?
03:42yedihmmm... should i store this state within a closure or using an atom
03:54amalloyyedi: storing it in an atom that's *not* in a closure sounds like a mistake. making it global is such a commitment
04:53sm0kewhen i run 'lein repl' outside a project how do i find out the port for nrepl server?
04:55lumafiit says something like this when it starts: nREPL server started on port 55636 on host 127.0.0.1
05:23rurumateis there a variant of (if) that returns identity by default, instead of nil?
05:24nightflyor?
05:24rurumatehm
05:24rurumateyes that would be possible
05:25rurumatebut then you have to nest your condition in an and, making it a bit harder to read
05:25clgvyou mean instead of (if x y x)?
05:25rurumateyes
05:25rurumatebecause the x at the end looks a bit ugly
05:26rurumateand is easily overlooked when y gets big
05:27rurumatemore like (if (test x) y x)
05:27ohcibiok, I have this NxM matrix which I want to partition into all columns into 4-tuples, I do this with (map #(partition 4 1 %) myMatrix), which yields something like (a1, a2, a3, a4), (a2, a3, a4, a5).... I now need not only the values but also the coordinates of each value.. e.g. (([0 0] a1), ([0 1] a2),....). i like my partition solution but I think I need to generate all coordinates and then (get-in) from myMatrix, or does anyone know a cool trick how to do this
05:27ohcibiat once?
05:28rurumateohcibi: lisp may not be the ideal language for vector manipulation
05:29ohcibirurumate: so you also think (get-in) is the way to go?
05:30rurumatethere is map-indexed, not sure if it helps
05:31ohcibirurumate: hm,, i'll see but i guess this is only good for one coordinate...
06:04clgvohcibi: there is core.matrix for vectors and matrices
06:15zeebrahis there a defn* macro available somewhere which allows nested defn*s?
06:16clgvzeebrah: you can use (letfn [(f [x] ...)] ...) therefore
06:16clgvzeebrah: the defn* you describe makes no sense in clojure
06:16zeebrahclgv: avoiding lets, they're obscuring
06:17llasramlol
06:17zeebrahwhyh doesn't it make sense?
06:17clgvzeebrah: since every `def` operates on namespace level and thus is always globally accessible
06:18clgvzeebrah: avoiding `let` won't work if you ever want to write proper Clojure
06:30zeebrahclgv: defn*s inside would expand to a (let [... tho
06:31clgvzeebrah: then they are wrongly named.
06:31clgvzeebrah: and for that task just use (letfn [(f [x] ...)] ...)
06:33zeebrahlike i said it looks ugly :P
06:34zeebrahwhat i am after is a define like scheme's for working through sicp because I can't bring myself to use scheme and apparently clojure is not quite right
06:34llasramzeebrah: Without mutation, you need to create some sort of new lexical scope for each binding
06:34llasram`def` doesn't create a scope because it actually does work through mutation
06:35llasramIn order for your `def*` to somehow expand to `let`, it would need to have the forms where the binding is visible be *inside* the `def*`
06:35llasrame.g., just be a `let`
06:35llasramer, i.e.
06:35clgvllasram: good explanation, zeebrah: following the explanation you'll end with something "let-like" ;)
06:36zeebrahi'll have to think about it, i don't understand right away
06:36llasramWhile you're doing that, try using `let` :-)
06:37llasramI thought it would be awkward at first, and is something other people I've introduced to Clojure have complained about at first
06:37llasramBut the benefits of an obvious lexical scope for each binding quickly outweigh any initial awkwardness
06:58magopianhello
06:59llasramsalutations
07:00magopiancan't remember how to have a bot here run clojure, can somebody tell me?
07:00amalloyi mean, scheme's internal define isn't the worst thing ever
07:00amalloy,1
07:00clojurebot1
07:00magopianthanks amalloy
07:00llasramamalloy: ALL MUST PERISH BEFORE THE MIGHT OF `let`
07:01magopian,(for [row [:top :middle] column [:left :middle]] (vec row column))
07:01clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core$vec>
07:01magopian,(for [row [:top :middle] column [:left :middle]] (vector row column))
07:01clojurebot([:top :left] [:top :middle] [:middle :left] [:middle :middle])
07:01llasramamalloy: Aren't you PST? Clojure all night long?
07:01amalloyit would be a fun little exercise to write a define macro that acts like scheme's
07:01magopian,(for [row [:top :middle] column [:left :middle]] [row column])
07:01clojurebot([:top :left] [:top :middle] [:middle :left] [:middle :middle])
07:01amalloyllasram: well, i drift pretty far towards nocturnal when i don't have a job :P
07:02llasramamalloy: Ah, I see. To the night!
07:02magopian,(= (1 2) [1 2])
07:02clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
07:02magopian,(= '(1 2) [1 2])
07:02clojurebottrue
07:02llasramamalloy: Where would you keep the current environment though?
07:02amalloymagopian: if you're just using clojurebot as your repl, please private-message him
07:02magopianoh, sure, truly sorry about that :/
07:03amalloyllasram: what environment? you just have the macro transform (define (a x) (define (b y) y) (b x)) into (defn a [x] (letfn [(b [y] y)] (b x)))
07:04magopianamalloy: how should I tell clojurebot to display the full result, instead of "ellipsing" it?
07:04amalloyand just in like scheme, you require that all "internal define"s come first in the function body
07:04amalloymagopian: ask lazybot instead
07:04amalloy&(range 40)
07:04lazybot⇒ (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39)
07:04amalloy&(range 400)
07:04lazybot⇒ (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 ... https://www.refheap.com/21283
07:04magopianah, i then use the other one, thanks amalloy ;)
07:05llasramamalloy: Ah, of course. I was trying to puzzle around having a top-level form containing all the `define`s, but you really can't do without it
07:05amalloywhat do you mean, top-level?
07:06llasramContaining all the `define`s
07:06amalloyuhhhhh, are you talking about something like (with-scheme-stuff (define ...))? i think you can do it without that wrapping macro
07:07magopianmmm, I'm working through the clojurescript koans, and I'm stuck on http://clojurescriptkoans.com/#sequence-comprehensions/5 with what I believe is the correct answer (which is to type in "[row column]" without the quotes)
07:07llasramYou need *something*, like a `defn` replacement
07:07amalloyllasram: right. define is that defn replacement
07:07llasramRight :-)
07:07magopianand it seems lazybot is also ok with that, however, i'm being tolk Ii have not yet attained enlightenments.
07:07llasramI was missing that part, which makes it a bit more elegant
07:07magopians/tolk/told
07:08amalloymagopian: works for me. maybe you typed it wrong?
07:09magopianamalloy: i tried several times... strange, i'll try to clear the cache or something
07:10magopiannope, no better... it's just [row column], right?
07:10amalloyyep. i just copy/pasted that from you, hit enter, and it moved on
07:11magopianmpf
07:12llasramamalloy: If it's not impolite to ask, what's the next project?
07:19magopianamalloy: actually, it works if I use chromium, but not firefox, this is so strange... what browser did you use for your test?
07:23amalloychrome
07:24magopianamalloy: might be some issue with Firefox, I created an issue on github, thanks for the feedback amalloy
07:27amalloyllasram: dunno yet. taking a little time to relax, looking at opportunities
07:30llasramThat seems like the right way to do it
07:33dabdwhat is the most idiomatic way to use a var from a namespace? (:require [some-ns :refer [some-var]]) or instead (:use [some-ns :only [some-var]])
07:33llasramdabd: the former, although
07:33dabdok the style guide adivses using :require :refer :all instead of :use in the ns macro
07:33llasramI'd argue more for (:require [some.ns :as some]) then some/var
07:34llasramWhich style guide?
07:34dabdhttps://github.com/bbatsov/clojure-style-guide
07:34llasramOh, that one
07:35dabdwhat is the difference between using each form in my first question?
07:35amalloyit really should recommend using neither of those
07:35llasramI mean, I'd agree with it in this case, although I'd also argue that :refer :all is rarely the right thing to do either
07:35dabdamalloy: how should i use a single var from a ns then?
07:36llasramI keep meaning to for that thing... I disagree without maybe 30% of it, but AFAICT nobody else has bothered to codify style
07:36amalloydabd: nono, :refer foo is fine
07:36llasrams,for that,fork that,
07:36amalloybut :refer :all is bad
07:36dabdwhat about this document? http://dev.clojure.org/display/community/Library+Coding+Standards
07:36dabdshould be more "official"
07:36dabda lot of the first document was taken from here anyway
07:37llasramThey're largely at different levels though
07:47sverianybody compared pedestal to luminus here?
07:58winkI heard some criticism of https://github.com/bbatsov/clojure-style-guide but can't remember which
07:59winklet's rephrase it to: it seems to be controversial for a less silly statement
08:17dabdthe style guide also advises: Use seq as a terminating condition to test whether a sequence is empty (this technique is sometimes called nil punning). So should we use (seq s) instead of (empty? s)?
08:17dabdI meant (not (empty? s)
08:21TEttingerdabd, yes
08:21TEttinger(doc empty?)
08:21clojurebot"([coll]); Returns true if coll has no items - same as (not (seq coll)). Please use the idiom (seq x) rather than (not (empty? x))"
08:22dabdI wonder why this idiom is used when we are interested in the boolean value
08:24clgvdabd: in bottlenecks of your application I'd avoid seq
08:26dabdI don't understand why should i construct a seq if I want to test if it is empty
08:26dabd(doc seq)
08:26clojurebot"([coll]); Returns a seq on the collection. If the collection is empty, returns nil. (seq nil) returns nil. seq also works on Strings, native Java arrays (of reference types) and any objects that implement Iterable."
08:31CookedGryphondabd: presumably though it's just trying to get an iterator and giving nil if it can't
08:31CookedGryphonit's not like it's doing anything heavyweight to construct the seq
09:12allsystemsaregon00b question: what's the simplest way to add core.logic to the classpath so I can start experimenting with it with minimal fuss?
09:13clgvallsystemsarego: create a leiningen project and add core.logic to the dependencies
09:13hyPiRion^
09:13allsystemsaregook, thanks
09:13clgvallsystemsarego: there is also the leiningen plugin lein-try but for the first setup it is not easier - you only benefit from it if you want to try libs without projects more than once ;)
09:15allsystemsaregook, and afterwards do I need to use clj or lein repl as the interactive console?
09:15justin_smith,(subs "😸😾" 0 2)
09:15clojurebot"??"
09:15justin_smith(failed test from http://mortoray.com/2013/11/27/the-string-type-is-broken/)
09:17xsynPlease can someone help me
09:17xsynI think I'm using map incorrectly
09:17justin_smithxsyn: let me guess: you are mapping but the function you call in the map is not getting called?
09:17justin_smithand you are not using the output of the map call anywhere?
09:18xsynjust setting up a gist
09:18xsynjustin_smith: the map errors and says it can't cast a long to an iseq
09:19xsynhttps://gist.github.com/anonymous/7676445
09:19justin_smithnot the usual error then
09:19justin_smithyeah, every arg to map after the second must be a sequence
09:19justin_smith(inc depth) is not a sequence
09:20xsyna
09:20xsynah!
09:20xsynis there a better way to iterate that?
09:20justin_smithis (inc depth) meant to be an argument to map?
09:20xsynno, to the function
09:21xsynso that's where I'm confused
09:21xsynthe function takes two arguements
09:21xsynthe coll, and then (inc depth)
09:21justin_smiththen use an anonymous function, or swap the arg order and use partial
09:22xsynah, thanks for the help
09:22justin_smith(map #(followers-followers % (inc depth)) (get-folower-ids id))
09:22xsynMan, I almost got there
09:22justin_smithmap works on multiple sequences
09:22xsynthanks
09:22justin_smithanother option: (map + (range 10) (constantly 2))
09:23justin_smithyou can use constantly to get a single value an indefinite number of times in a collection
09:23justin_smith,(map + (range 10) (constantly 2))
09:23clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.core$constantly$fn__4051>
09:23justin_smitherr
09:23justin_smith,(map + (range 10) (repeatedly 2))
09:23clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
09:23justin_smith,(map + (range 10) (repeat 2))
09:23clojurebot(2 3 4 5 6 ...)
09:23justin_smithfinally!
09:23justin_smithI should really get those straight
09:28xsynit doesn't work quite like expected, but you answered my question thanks
09:29clgv,[(repeat 10 (rand-int)) (repeatedly 10 rand-int)]
09:29clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core$rand-int>
09:29justin_smithrand would work
09:29clgv,[(repeat 10 (rand-int 20)) (repeatedly 10 #(rand-int 20))]
09:29clojurebot[(15 15 15 15 15 ...) (12 8 18 5 14 ...)]
09:30justin_smithor that
09:30justin_smithfor some reason I get constantly / repeat / repeatedly conflated - I should use them all more so I can keep them straight
09:36gfredericksI have 2 core.async questions
09:36gfredericksA) Can a producer detect that a channel is closed?
09:37gfredericksB) What's the best mechanism for detecting that a not-message-dropping channel is full?
09:41dsrx,(doc repeatedly)
09:41clojurebot"([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"
09:41justin_smithhttps://github.com/clojure/core.async/blob/master/examples/walkthrough.clj the examples seem to suggest using thread for the latter situation (so the thread can block, but your other code does not)
09:42halogenandtoastIs there a cleaner way to do (get-in json ["data" "children" 0 "data" "title"])
09:42dsrxoh i misread 'with side effects' as 'without side effects' and was totally confused
09:43justin_smithgfredericks: never mind what I just said
09:57xsynjustin_smith: NOW I'm having that problem, where map isn't producing expected output
09:57xsynreturns a (nil nil)
09:57xsynand the a prntln in the function doesn't get called
09:57justin_smithcan you paste the latest?
09:59xsynhttps://gist.github.com/anonymous/7677135
10:00justin_smithsmall tip: (vector (map ...)) can be replaced by mapv
10:01justin_smithalso, it looks like the depth and id args may be getting used out of order?
10:02justin_smithyou are passing in (inc depth) in the position that is called id
10:03justin_smithlooks like I got the order wrong when I was trying to show you how to do it ealier
10:03justin_smith*earlier
10:06xsynno no, that was me
10:07xsynhah, that's awesome
10:09justin_smithso you got it working?
10:14moquistI'm trying to figure out how to (require ...) libs in a clojurescript browser-REPL. For some reason, I'm just not getting it right. I've tried googling around a bit, and I find instructions for requiring libs in a .cljs file, but not in a bREPL.
10:15moquistCan somebody point me in the right direction?
10:16xsynjustin_smith: Yeah, thank you
10:22halogenandtoastWould something like this be frowned upon: (map #(-> % :data :title) (-> json :data :children)))
10:23justin_smithlooks cromulant to me, though you could use get-in instead of ->
10:23pjstadigor (comp :title :data)
10:23`cbp~cromulant
10:23clojurebotGabh mo leithscéal?
10:23justin_smithpjstadig: that is how I would usually do it, yeah
10:24justin_smith`cbp: http://en.wiktionary.org/wiki/cromulent
10:25pixie79Hi All - any ideas how i fix this clojure error ? - https://gist.github.com/pixie79/7677546
10:27justin_smithlooks like SpoutConfig. expects the first arg to be an instance of BrokerHosts
10:27ToBeReplacedhalogenandtoast: (map #(get-in % [:data :title]) (get-in json [:data :children]))
10:27justin_smithbut it is a persistent list
10:28halogenandtoastSo get-in is preferred over the arrow in this case (that or comp)?
10:28justin_smithpixie79: said list created on line 7
10:28justin_smithhalogenandtoast: eh, it's kind of a style thing I think
10:29ToBeReplaced(map (comp :title :data) (get-in json [:data :children])) is okay, but is less clear imo b/c really we are talking about getting a key out of a data structure, not applying a set of functions
10:29ToBeReplacedor threading data
10:29justin_smithToBeReplaced: my most frequent usage of comp is as an arg to filter - to drill down to the sub-element in a collection that I want to be filtering on
10:30justin_smithcomp is kind of a natural way to express finding some item nested in collections
10:30ToBeReplacedjustin_smith: example?
10:30justin_smith(filter (comp even? :a) [{:a 0} {:a 1} {:a 2}])
10:30justin_smith,(filter (comp even? :a) [{:a 0} {:a 1} {:a 2}])
10:30clojurebot({:a 0} {:a 2})
10:31justin_smithhaving to filter by some part of a larger nested collection is something that comes up fairly often for me
10:32justin_smithusually more than one level of nesting, also
10:33pixie79I have no idea how to make an instance of BrokerHosts - that is my problem
10:33ToBeReplacedin that specific case i'd use comp as well -- for me, the difference is that you are applying a function to the element instead of retrieving the element -- the focus is on "even?" not the seq of keys
10:34pixie79as far as I can tell BrokerHosts is defined here - https://github.com/nathanmarz/storm-contrib/blob/master/storm-kafka/src/jvm/storm/kafka/KafkaConfig.java
10:34pixie79which is the java module i am using
10:35justin_smithpixie79: looks like KafkaConfig.StaticHosts.hosts
10:35justin_smithif you can figure out how something gets added to that, you can then use it?
10:35justin_smithI could be wrong
10:35jtoyhow can I install a library locally and then include it in all my projects without having to put it on clojars/maven?
10:36justin_smithjtoy: lein install
10:36justin_smithbut then you need to lein install it on any machine where you want to use it
10:36jtoyjustin_smith: that is fine for development, but how can I do this in a more scalable way if I dont want to put it on clojars ?
10:37justin_smithand having a particular coworker who I will not name here lein install while developing and forget to actually lein push to clojars is a source of more agony...
10:37nDuffjtoy: set up a local Maven repository, then.
10:41pixie79nope that makes me none the wiser on how to do it
10:41dnolenoh, optimizing for JS - https://github.com/clojure/clojurescript/commit/f69bc25720009f4727febacd0d6b77149a08926f
10:42justin_smithpixie79: maybe that convertHosts method is what you want
10:42justin_smithit needs a java list as input, so you need to turn your lazyseq into a java List.
10:43justin_smithand then feed it to that static method
10:43justin_smithI think
10:43justin_smithbbl, breakfast
10:43pixie79ok thanks
10:48dnolenmoquist: there's not really a way to load libraries in the REPLs that ship with CLJS, long out standing ticket. Maybe fixed in 3rd party REPLs like Austin, cljs-node-repl?
10:48jtoyanyone know of any simple clojure libraries that cache to disk?
10:49jtoyI want to pull in webpages and cache them to disk for the next call
10:53alexyakushevdnolen: David, I'm currently watching your g33ktalk about core.async, and there you mention that `filter` function you wrote is a channel version of conventional filter for sequences. But it is not equivalent since it is mutable (consumes values on the channel), right?
10:55dnolenalexyakushev: it's stateful, but it's not a mutable reference type - the statefulness of channels hardly matters in actual programs since you cannot act on it any general way.
10:57dnolenalexyakushev: but yes, it not precisely equivalent - but close enough IMO when writing channel pipelines
10:57alexyakushevdnolen: That's what I thought, thank you for clarification. I'm just wondering if it makes sense to put bangs or some other clues to functions operating on channels, in order to avoid possible confusion; and if this confusion is dangerous at all
10:58dnolenalexyakushev: not useful, channel consuming produce functions produce values - the channel
10:58dnolenalexyakushev: the actual channels ops are already marked
11:01alexyakushevdnolen: OK, I start to understand it now. Functions that go channel->global-loop or global-loop->channel are already marked, those that consume and return channels don't have to be marked
11:01alexyakushevdnolen: Thanks again, I will go investigate core.async further now
11:02dnolenalexyakushev: you are correct that if you're not careful and you read from something someone else is also reading from you may get unexpected behavior if you are expecting to get all values.
11:02dnolenbut of course there are cases where this may not be important you
11:02dnolenas well as core functionality for tapping a channel to avoid this
11:03dnolenif that's the behavior you want
11:09majykIs there a version of the jQuery externs file available for 2.0.x? I don't see one listed here: https://github.com/iplabs/closure-compiler/tree/master/contrib/externs
11:09majykI'm sure Clojurescript developers aren't all using 1.9 branch
11:16sisciahi all, I have a weird problem with slurp + regex...
11:16seangrovednolen: Very nice array enhancement.
11:17seangrovednolen: What about inlining other constants?
11:17dnolenseangrove: yeah we should do that
11:18dnolenseangrove: should be more straighforward to implement now that we have *passes*
11:18seangrovednolen: You should just make a list of things like that so you can start parallelizing the work amongst others ;)
11:18sisciai have a regex that DOES match the text if a copy-paste it in the repl, but it doesn't work if a slurp the file containing the same text...
11:18seangroveDo we have a generic way of dealing with constants across different optimization settings, etc.?
11:18gfrederickssiscia: are the strings equal?
11:19sisciagfredericks: yest they are
11:19allsystemsaregohow do I find out what the latest version of core.logic is, so that I can type the correct thing in project.clj dependencies?
11:19sisciai just slurp the file, and C-a, C-y in the repl...
11:19seangroveallsystemsarego: https://github.com/clojure/core.logic says it's 0.8.5
11:19dnolenseangrove: I think we should just optimize constants if advanced optimizations applied for now
11:20seangroveallsystemsarego: There's also lein ancient, which will tell you if there's a new release
11:20allsystemsaregoseancorfield, thanks
11:20dnolenallsystemsarego: many contrib libs show dependency information on their README
11:21allsystemsaregodnolen, thanks
11:21seangrovednolen: Yeah, that seems perfectly reasonable. Just thinking of how to avoid headaches for developers as we get more of these improvements.
11:22seangrove(dec seancorfield) ; bastard gets all my thanks with his alphabetatically first name
11:22lazybot⇒ 4
11:22seangrove(inc seancorfield) ; still like him and appreciate his work though
11:22lazybot⇒ 5
11:22seangrove(inc seancorfield)
11:22lazybot⇒ 6
11:23seangrovednolen: Anyway, I haven't contributed much to cljs recently, wouldn't mind picking up a feature/bug/ticket to work on
11:23dnolenseangrove: I think what we have in place for :optimize-constants is fine
11:24dnolenseangrove: trying CLJS-698 http://dev.clojure.org/jira/browse/CLJS-658 would be cool, source maps for browser REPLs
11:25dnolenseangrove: going through and adding the requested warnings would be good too, usually easy to do if a little boring.
11:25seangrovednolen: Adding warnings is fine, certainly did it before.
11:26seangroveWill take a look at the browser-repl source maps
11:26dnolenseangrove: there's only a few really big things I'd like to see in the near term - :libs, :main, and optimizing away protocols
11:26dnolenthen there's needed brain storm about boot strapping directly to Node.js
11:30seangrovednolen: Where are the requested warnings to be added?
11:31dnolenseangrove: protocol form validation
11:31dnolenseangrove: but also a bunch warnings we don't do that we could do
11:31dnolenseangrove: around deftype
11:31dnolenseangrove: warnings about missing libs, missing macro files
11:31dnolenseangrove: a lot of these are in JIRA
11:33seangrovednolen: Yeah, I go through JIRA from time to time, see if there's anything that looks like something I could do in my freetime
11:37dnolenseangrove: I just added a bunch of protocol deftype issues that have been bugging me recently
11:38seangrovednolen: Ok, I see them. I'll go through them this weekend then
11:39dnolenseangrove: also if you want to tackle the constants things, cool w/ me
11:39seangrovednolen: Also, what optimizations do you use when developing? any?
11:39dnolenseangrove: when I'm actually writing CLJS I use no optimizations
11:39seangroveI'd like to turn on source maps (haven't used them personally yet), but the overhead is a bit high with :whitespace optimization
11:40seangroveBut I'm not sure how to include all the generated files in the html
11:40dnolenseangrove: unless I'm benchmarking - then :optimizations :simple :static-fns true
11:40dnolenseangrove: recompile w/ :whitespace + :source-map should never be more than 3-4s
11:41dnolenprobably more like 2s
11:41dnolenseangrove: oh but you're probably doing this on huge codebase?
11:41seangroveOk, that's acceptable then. Was pleasantly surprised to see my :whitespace optimization on a small-ish codebase recompiling in ~0.5-1s
11:41seangroveWill try turning on source maps
11:41dnolenseangrove: yeah source maps don't add much overhead
11:42seangroveBut when avoiding any optimizations, do you manually add each generated js file to the html files you're working with?
11:42dnolenIME, but I haven't tried on huge amounts of CLJS
11:42dnolenseangrove: not at all
11:42seangroveThis is on a new project, so it's still pretty small
11:42dnolenseangrove: https://gist.github.com/swannodette/7678991
11:43dnolenseangrove: you just need slightly different markup is all, easily configured if you have some webserver setup
11:43dnolenseangrove: no manual inclusion required - it's way more productive, recompiled take tenths of second
11:43dnolens/recompiled/recompiles
11:43dnoleneven w/ sourcemaps
11:44seangroveFiles are automatically concatenated that way though?
11:44dnolenseangrove: no, and there's no need
11:44dnolenyou have extremely accurate source maps
11:45seangroveBut in that case, does example.js contain example.core and other namespaces as well? What if you example.utils, would that be a separate file you'd have to add a new <script> tag for?
11:46dnolenseangrove: heh, no, all of this is magically handled by the goog.require goog.provide stuff
11:46seangroveAh, ok
11:46dnolenseangrove: they actually do something if no optimizations present
11:46seangroveInteresting!
11:46dnolenseangrove: http://swannodette.github.io/2013/11/07/clojurescript-101/
11:46dnolenseangrove: ^ try this if you want to get a sense of my workflow
11:46dnolenit's coffee-script responsive - sans first compile
11:47seangroveI think it was the behavior of goog.require that was the missing piece for me
11:47dnolenseangrove: admittedly :optimizations :none used to suck in the past, it's my goto now
11:49seangroveHrm, source maps seems to consume 700% cpu and never completes an initial compile. Will have to check this out....
11:49dnolenseangrove: sounds weird
11:49seangroveAh, well, OoM error, GC overhead limit exceeded.
11:49seangrove2080 is the latest release, right?
11:49dnolenseangrove: what cljsbuild are you using?
11:50seangrove1.0.0
11:50seangroveShould I be on 1.0.1-SNAPSHOT?
11:50dnolenseangrove: 1.0.1-SNAPSHOT lets you use your own memory setting. But how big is this project?
11:51seangrove~1000 lines of cljs, and one foreign lib (flotr2.js) if that matters
11:51clojurebotI don't understand.
11:51seangroveAlso, there are two warning about using undeclared vars wich I need to clean up
11:51dnolenseangrove: a public project?
11:51seangroveAnd yeah, looks like 1.0.1-SNAPSHOT at least finished a compile
11:51seangroveSadly not
11:52seangroveI'm ok with it not working since I don't have an immediate repro case
11:52allsystemsaregocan someone help troubleshoot this core.logic issue: http://lpaste.net/96290
11:53dnolenallsystemsarego: you need to (require '[sample.core]) and (in-ns 'sample.core)
11:53gfrederickswhat happens if an agent's queue gets large? it grows until OOM?
11:53dnolenallsystemsarego: before trying anything
11:53allsystemsaregodnolen, thanks, I'll try it
11:53tbaldridgegfredericks: yes, OOM
11:54gfrederickstbaldridge: thanks
12:05moquistdnolen: OK; thx. I'll check out the other cljs REPLs.
12:09gtrakdnolen: so, I managed to make hacking cljs protocols work for js objects, assoc-in and update-in work fine, but I'm having some trouble with arrays->seqs and back. Do you have a quick hack to make something like (update-in js-object [:array-key] #(remove pred %)) do the right thing?
12:12gtrakIndexedSeq is backed by an array, I imagine I'll have to copy the array for each seq op (doesn't bother me). The one I was trying to make work was (update-in rest), where the final assoc would end up calling clj->js on the returned value from a 'rest' call.
12:22gtrakwondering if that's how others have done it :-)
12:52dnolengtrak: I can't think of an easy way to make that work
12:52trptcolinis it correct to say that the ^{:once true} metadata in the future and delay macros is helpful because those fns get used asynchronously? i get that it allows locals clearing for closed-over locals, but not quite grasping the implications, i think.
12:52gtrakdnolen: that itself is valuable information, so I don't pull my hair out :-)
12:53trptcolinor should every macro that creates a fn really stick that metadata on?
12:54justin_smithtrptcolin: every creation of a function that you know will only get called once
12:54justin_smithwhich is usually going to be in a macro yeah
12:54hiredmantrptcolin: because the function is only called once, it can clear anything it has closed over after the first call, instead of needing to hang on to them incase it gets called again
12:55justin_smithtrptcolin: otherwise each of those one off generated fn objects will effectively be a memory leak
12:55hiredman,(let [x 1 f (fn [] x)] (f) (f))
12:55clojurebot1
12:56hiredmanfeh
12:56llasramtrptcolin: relevant blog post: http://clj-me.cgrand.net/2013/09/11/macros-closures-and-unexpected-object-retention/
12:56gfrederickscan a core.async message producer detect that a channel is closed?
12:56hiredmanI forget how to do :once
12:56Bronsa^:once fn*
12:56hiredman,(let [x :a f (^:once fn* ([] x))] (f) (f))
12:56clojurebotnil
12:57hiredmanthere we go
12:57trptcolinok awesome, this makes much more sense and should've been obvious. thanks
12:57Bronsayeah, with 1 there would be no locals clearing since it's a primitive
12:57gfredericks,(let [x1 12, x2 :twelve, f (^:once fn* ([] [x1 x2]))] [(f) (f)])
12:57clojurebot[[12 :twelve] [12 nil]]
12:58justin_smithin "Clojure HIgh Performance Programming" Shantanu Kumar claims that PersistentVector is O(1) for conj, but O(n) for last
12:58justin_smiththat makes no sense to me?
12:58gfredericksjustin_smith: last is not optimized for vectors
12:58hyPiRionjustin_smith: see how last is implemented
12:58hyPiRion$source last
12:58lazybotlast is http://is.gd/RzMqTn
12:58clojurebotRoger.
12:58Bronsajustin_smith: you want to use peek in that case
12:59justin_smithhow can it do insertion to the end in O(1) but not get the last element in O(1)? that seems weird
12:59justin_smithBronsa: ahh, so peek gets the end, nice
12:59justin_smith,(peek [1 2 3 4])
12:59clojurebot4
12:59justin_smiththanks all
12:59gfredericksI don't think insertion is technically O(1)
12:59gfredericksbut O(1)-enough
13:00trptcolin^^^ math
13:00gfredericks,(peek '(range 20))
13:00clojurebotrange
13:00justin_smithhah
13:00gfredericks,(peek (range 20))
13:00clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to clojure.lang.IPersistentStack>
13:01llasram,(peek (apply list (range 5)))
13:01hyPiRionO(log32 n) with a low constant factor
13:01clojurebot0
13:01llasram,(peek (vec (range 5)))
13:01clojurebot4
13:01gfredericksI wonder how ofter persistent lists are used in programs
13:01justin_smith,(peek (apply list (range 10)))
13:01clojurebot0
13:01gfrederickshyPiRion: cuz it only does that once every 32 conj's amirite?
13:02justin_smith,(class (apply list (range 10))) ; gfredericks - timing!
13:02clojurebotclojure.lang.PersistentList
13:02hyPiRiongfredericks: well, yeah, that's included in the low constant factor, but it has nothing to do with the branching factor
13:02gtrakheh, why don't we just fix 'last'? I can't see any downside in making it faster for some things.
13:03hyPiRionamortized it could probably be seen as O(1/32 log32 n)
13:03justin_smithgtrak: yeah, I think intuitively I kind of just expected that
13:03hyPiRionwhich is like, uh, O(1/160 log n)?
13:04justin_smithcool, glad I asked, thanks again all
13:05allsystemsaregoIs there a way to run user-defined commands every time the REPL starts up?
13:05gtrakI'm reading through a 2012 mailing list thread on this, seems like it's a silly argument. I'd rather get burned occasionally by my choice of ds than be slow always.
13:05justin_smithallsystemsarego: I think :injections may be for that sort of thing
13:07gtrak'last' is semantically, intentionally, more meaningful than 'peek'
13:07justin_smithallsystemsarego: specifically, :profiles {:dev {:injections [(code goes here)]}}
13:07justin_smithunless there is a profile that is more specifically for repls
13:07allsystemsaregojustin_smith, thanks
13:09gfredericksgtrak: agreed.
13:09gfredericksfor existing functions that are slow for some data structures and optimized for others, see count
13:10dnolenseangrove: for profiling/optimizing I recommend Google Chrome, :optimizations :simple, :static-fns true
13:10justin_smithgfredericks: that same book I was mentioning claims O(1) for all the standard collection types
13:10gfredericksjustin_smith: for...insertion? count?
13:10justin_smiththough it could be wrong - but overall the book looks well researched
13:10justin_smithgfredericks: count
13:11gfredericksjustin_smith: if you don't include lazy seqs as collections, then yes
13:11gfredericksbut lazy seqs are ubiquitous
13:11gtrakyea, I mean, I'd expect to get burned by my choice of ds, I wouldn't expect 'last' to be a seq thing, but something that matters for things with order and limited length. Seq is the only thing in clojure that may not have a last element, anyway :-).
13:11gfredericksgtrak: should last be fast on sets/maps?
13:11justin_smithahh, yeah, lazyseq is not on that list
13:11justin_smiththanks
13:11gtrakI wouldn't use it that way, so I wouldn't care.
13:11gtrakgfredericks: ^
13:12gfredericks"Performance of last on unordered data structures is undefined due to gtrak"
13:12seangrovednolen: Thank you, I made a note for when the time comes. A bit worried about the amount of data the client has to deal with, and I'm not sure about the normal limits
13:12technomancygfredericks: if they're sorted sets/maps
13:12gtrakgfredericks: :-)
13:12seangroveI'll find out soon enough though...
13:12gfrederickstechnomancy: yeah that'd be useful
13:12gfrederickstechnomancy: how does that work currently? (comp first rseq)?
13:12dnolenseangrove: you're sending a huge amount of EDN to the client or something?
13:12gtrakgfredericks: last is just first on unordereds :-).
13:12technomancyno idea
13:13seangrovednolen: No, it's json which is parsed and then converted into clj data structures, but then running lots of filters, maps, reduces over it, etc.
13:14gfredericksgtrak: ...sorta
13:14dnolenseangrove: got, you've got reducers in CLJS too
13:14seangroveTrying to see how much we can keep client side to keep ui iteration fast. And then see if it's possible to pin point the bottlenecks and speed it up enough for daily use
13:14seangroveAh, yes, good point
13:14gfredericksgtrak: it would be weird if (last x) and (last (seq x)) didn't return the same thing
13:14gtrakgfredericks: I also think it's bad to rely on key order, but it's nice that keys followed by vals line up.
13:15dnolenseangrove: I would be surprised if those filter/maps/reduces are bottlenecks though - unless it's a crazy amount of data
13:15seangrovednolen: I don't think it's a crazy amount of data, so it'll be interesting to start pinning it down
13:15gtrakgfredericks: I don't think that would be weird for unordered data. You wouldn't notice it until you impose an order.
13:16dnolenseangrove: I spent a ton of time optimizing lazyseqs some time ago - very close to JVM there under V8 and looks fine elsewhere
13:17seangrovednolen: The GC pauses are definitely killers though
13:17seangroveRegularly hitting ~1.3s of gc
13:17seangroveOften one after another
13:18seangroveYeah, looking at the timeline view, looks like it's entirely dominated by continuous GC
13:18seangroveWell, it'll be fun to deal with that later, but premature optimization and all that
13:19dnolenseangrove: ah interesting, we don't have locals clearing in JS
13:19dnolenCLJS I mean
13:20dnolenseangrove: though I suppose we could?
13:20gtrakgfredericks: I think the fact that (first x) and (first (seq x)) are the same is an implementation detail. Seqs shouldn't care about how they're created.
13:21dnolenseangrove: still this may be an argument to switch to reducers in the near term
13:21gfredericksgtrak: I don't have any reasons to disagree; I just find the current behavior endearing.
13:21gtrakyes, it's definitely convenient :-)
13:22dnolenseangrove: http://dev.clojure.org/jira/browse/CLJS-705
13:22gtrakbut not simple
13:26drorbemetHi, I am trying to pull parse large xml (> 200Gb) in clojure. Is StAX supposed to be the pull parser for the JVM? I tried to count the elements in a large xml file using clojure/data.xml which uses StAX, but I got an out of memory exeption. Do you know some code samples that show how to avoid building up large values in mamory while pull parsing xml in clojure?
13:26gtrakdrorbemet: you're probably holding on to the root somewhere
13:26aconberehey folks, I'm learning clojure and I have a simple irc server I'm writing to learn with. I have a parser that returns me results like (parse "USER a b c :d") => { :command "USER" :params ["a" "b" "c" "d"] }
13:27aconberethis is a useful generic representation of a command, and easy to parse into and serialize from
13:27aconberebut doesn't captture any of the semantics about the user command (like the meaning of a b c and d)
13:27gtrakdrorbemet: if the head end of the seq is bound, then those elements can't be garbage collected, and the entire thing would have to fit in memory during a count.
13:27aconbereusername hostname servername and realname respectively
13:27drorbemetgtrak: ah thanks that coud be, how do I avoid that?
13:28aconberewhat are strategies people employ to specialize in these cases?
13:28seangrovednolen: Thanks, watching the ticket. I'll get the functionality in place and then dive into performance issues.
13:28drorbemetgtrak: yes that makes sense
13:28aconbereso far I've come up with building records, or just making specific maps
13:28S11001001aconbere: you don't have to smash all your parse/serialize into one step
13:28gtrakdrorbemet: be careful with locals (let), vars (defs).
13:28drorbemetgtrak: ok understood
13:28justin_smithaconbere: you can make a vector of keys for each command, and zipmap to create a map for each one
13:28S11001001aconbere: e.g. have a second step which translates from your :command :params representation to something more useful, and then back from that
13:28Bronsaseangrove: dnolen: the logic is complex but http://bit.ly/1c8YQZx http://bit.ly/1ifNYOF this is how I do it in tools.analyzer
13:28gtrakmaybe pass the xml seq straight into count
13:29aconbereS11001001: right so I mean the way I would approach specialization is have a step that converts from the specialized representation to the easy to serialize one
13:29S11001001aconbere: it's fine to just make maps when starting out, don't mess with records right away
13:29dnolenseangrove: now that we have lot of type information in the AST we should limit clearing locals to locals bound to lazy seqs, and it should have a knob to disable it for debugging
13:29S11001001aconbere: yeah
13:30drorbemetgtrak: basically I want to chunk the xml into the "pages" it holds
13:30justin_smith,(let [part-command [:command :message]] (zipmap ["part" "leaving"] part-command)) ; aconbere - one possibility
13:30clojurebot{"leaving" :message, "part" :command}
13:31justin_smithI got the order in zipmap wrong, but modulo that, hope it makes sense
13:31aconberejustin_smith: ha, no worries I can translate
13:31drorbemetgtrak: ok thanks, that was the hint I needed, have a nice day or night :-)
13:31justin_smithaconbere: then you can just define a vector of keynames for each command, and pick one based on the first element in the command sequence
13:32justin_smithet voila, structured data
13:32aconbereyeah
13:32aconberethat seems pretty reasonable to me
13:32aconbereat least starting out
13:32aconberethanks justin_smith S11001001
13:39gtrakdrorbemet: if you want to lazily chunk the xml, maybe it's convenient to use 'partition'
13:40gtrakor partition-by
13:40drorbemetgtrak: ok, I'll try that
13:41gfredericksSo my guess is that detecting a full channel is best done by using alts!! with :default
13:42justin_smithgfredericks: wouldn't that just check if no other channel has data?
13:42gfredericksjustin_smith: alts!! with just one channel
13:42gfrederickswill return immediately if the channel can't take a message
13:43gfredericksthe other question is how to detect the channel is closed
13:43justin_smithI thought alts!! was for input
13:43gfredericksyou can use it for puts as well
13:43justin_smithahh, so if it returns immediately, it must be a closed channel
13:44gfredericksno
13:44gfredericksit must be full
13:44justin_smithfor puts
13:44justin_smithok
13:44gfredericksif the channels closed it pretends that it worked
13:44gfrederickswhich I cannot fathom
13:44gfredericksthere's gotta be some way to detect a closed channel but I haven't found one yet
13:45justin_smithI think the implied model of core.async is very much "launch messages into the ether and forget about them"
13:45justin_smithas far as the sender is concerned, at least
13:47gfrederickshmm
13:47gfredericksI guess if I'm shutting down a system I might not mind messages being lost.
13:47gfrederickshadn't thought of it that way
13:54dnolengfredericks: if you get nil you know it's closed
13:55dnolengfredericks: there is no way to know beyond that, and from the sound of it there may never be.
13:57gfredericksdnolen: I'm talking about the writer, not the reader
13:57Raynesgfredericks: candlejack was he
13:58gfredericksRaynes: that's the most sense you've made all day
13:58RaynesI don't think I've said anything all day.
13:58gfredericksphew
13:59justin_smithsounds like we got that all cleared away
13:59dnolengfredericks: seems like a weird to want to know if something you're pushing to is closed if you weren't involved it's construction in anyway
13:59dnolengfredericks: if closing matters that it seems like the channel you want to push to give you some means to know about that event
13:59dnolenexplicitly
14:00gfredericksdnolen: why would a producer not be involved in channel construction?
14:00gtrakspeaking core.async, does anyone have a snippet demonstrating what to do with exceptions?
14:01dnolengfredericks: if it's involved then the thing it constructed should give it capability to know explicitly
14:02gtraksetting a default error handler or somesuch
14:03gfredericksdnolen: I must not have any design sense about async yet, as I can't see why an alternate "explicit" mechanism is any better than being able to explicitly find out that the channel is closed
14:03dnolengfredericks: control channels use them
14:03dnolengtrak: there are many error handling approaches, supervisor, or you can catch and write error to a channel, or provide an error control channel
14:04gfredericksdnolen: I can't parse that sentence, but I imagine you're suggesting if there's a function that creates a channel and writes to it until it's closed, I could achieve that by passing in a control channel that will get a single message when the other one is closing?
14:05dnolengfredericks: yep
14:05gtrakdnolen: potentially, I could make a macro around try-catch, binding an error channel, to be used within a go-block? that sounds reasonable enough.
14:06gfredericksseems hard to avoid race conditions, but I don't think I have a use for this at the moment so that's okay
14:06gfredericksat least, if you care about knowing exactly what got onto the channel and what didn't
14:06dnolengfredericks: this is generally true anyway
14:06dnolenthus buffered channels
14:07gfredericksbuffered channels don't help you know what got accepted and what didn't, do they?
14:07dnolengfredericks: what I mean there are many cases where you'll lose information and that's OK
14:07gtrakhrm, what's a 'control channel'?
14:07gfredericksdnolen: okay, so caring whether the message is accepted is a design flaw?
14:07dnolengfredericks: you'll just be fighting against the design
14:08gfredericksI'm just making sure that the intention is for me not to care about that
14:30justin_smithI have app state that I want to share between instances - what is the best way to ensure that it can be serialized and shared - put it all in vanilla clojure datatypes, define the print method and a reader for each record I want to serialize?
14:34gfredericksjustin_smith: records are supposed to be serializable; what sort of failure are you worried about?
14:34justin_smiththe one I am getting in my stacktrace
14:34justin_smith"Unreadable form"
14:34justin_smithmaybe it is not the record that is doing it
14:35justin_smiththat was my first suspect
14:35gfrederickscheck for a #< somewhere
14:36gfredericksI think that's the only place that error gets thrown
14:37justin_smithfound it
14:38justin_smith#<JdbcClob...
14:38justin_smiththanks
14:41gfrederickshave people centralized around a particular schema lib yet?
14:41gfredericksI think the two I know about are flatland/schematic and prismatic/schema
14:57l1xhi
14:58l1xanybody has any recommendation to split a file that has multiple json documents in it? http://www.githubarchive.org/
14:59gtrakl1x: cheshire has stream-parsing stuff
15:03l1xthanks
15:23bitemyappand thank god for that.
15:32eric_normandpedestal questIon: starting a new app, should I use the 0.3.0 construct namespace? or stick with app, which looks like it is being replaced?
15:32rkneufelderic_normand: "0.3.0 construct"?
15:33eric_normandrkneufeld: project.clj says it's 0.3.0-SNAPSHOT
15:33eric_normandrkneufeld: the tutorial is still using io.pedestal.app
15:33rkneufelderic_normand: ahh, that. No, you should not try building an app with 0.3.0
15:34eric_normandrkneufeld: not ready yet?
15:34eric_normandrkneufeld: it's so much nicer!
15:34rkneufelderic_normand: hehe, thanks. There is still a lot left to do
15:35eric_normandrkneufeld: aw, shucks. just got done reading the walkthrough and was ready to jump in
15:36rkneufeldPace should probably pick up into december and the new year. Conj was crazy for all of us.
15:42eric_normandrkneufeld: I bet. Any word when it will be ready for bleeding edge consumption
15:42eric_normandrkneufeld: we've got an internal app (read: can have bugs) that we'd like to try it on
15:43rkneufeldWell, if you want to *bleed*, you could play with it now. I just don't suggest you do that ;)
15:44rkneufeldOnce I finish the book on the 10th I want to take a pass at reducing tooling quite a bit. It'd be amazing if dataflow was just a library you could use.
15:56pwojnowskiHi. I'm writing tests using clojure-test and it's ok for Clojure code, but now I need to mock Java classes. Can it be done in clojure-test? If not how to do it in Clojure?
15:57gfrederickspwojnowski: what part do you need to mock? you need classes that have particular named methods? implement particular interfaces?
15:58pwojnowskiI have a WS port generated from WSDL and just want to return predefined response from it.
15:58gfrederickswhat does that mean in terms of classes/methods/interfaces? a "WS port" is a class?
15:59gfrederickshow are you going to interact with the mock object?
15:59pwojnowskiAFAIR it's just a class (no statics, finals), so simple mock should be enough.
15:59justin_smithif the port is an input stream, you could define a stream with the contents you want the port to return
15:59pwojnowskiIn Java I would just use Mockito or something like that.
16:00seangroveAh, bummer, flatland/useful isn't available in clojurescript
16:01gfrederickspwojnowski: okay, what methods do you need on it? is there an interface associated with the methods?
16:01justin_smithseangrove: I see a future in "pure clojure" variants of the best libs
16:01seangroveI wish clojure had map-keys and map-vals was just in the language :P
16:01bitemyappif anyone is wondering what maintaining an OSS project is like
16:02bitemyappit means time spent trying to read the tea leaves of other peoples' pull requests, trying to figure out what the hell they're fixing/adding/changing/removing
16:02justin_smithpwojnowski: you could just use mockito
16:02pwojnowskigfredericks: I don't remember at this moment, but lets say it a method doing some logic and I just want to return 42 from it.
16:03pwojnowskijustin_smith: I know that I can use Java libs, but I thought that there is some Clojure solution for this. But thanks anyway.
16:03gfrederickspwojnowski: it's easier if the method is defined on an interface; otherwise you might have to whip up something custom but I can probably do that in five lines
16:04justin_smithpwojnowski: there is no clojure solution for this
16:05justin_smiththe need to stub classes comes from a bunch of java design decisions that are much less likely to apply in purely clojure code (ie. every defrecord makes a stateless constructor which makes mocking trivial)
16:05cYmenGood evening clojurians!
16:05bitemyappcYmen: good morning
16:05bitemyapp~UGT
16:05clojurebotUGT is Universal Greeting Time http://www.total-knowledge.com/~ilya/mips/ugt.html
16:06cYmenLet's party!
16:06cflemingpwojnowski: do you provide the instance of the WS port class?
16:06cflemingIf so you could proxy it
16:06bitemyappcYmen: I'm at work :P
16:07bitemyappmongodbfacts: Good thing the NPM repository is built with Node.JS, otherwise they might have needed $2MM to scale.
16:08bitemyappmongodbfacts: "writing JavaScript without npm: np-hard"
16:08cYmenbitemyapp: The competent *cough* people at where I work have blocked irc so I can only use it using the web client or with tunneling.
16:08seangroveAmazing some people haven't just been removed from the ml
16:08bitemyappseangrove: thinking of that one bloke, what's his name...
16:08bitemyappgreevey. cedric greevey.
16:08bitemyapphe's a sloshy bucket of bile everytime I see him on the ML.
16:08bitemyappcYmen: all my IRC goes through ssh. *shrug*
16:09bitemyappmosh, specifically.
16:09cYmenbitemyapp: The really very competent people blocked ssh as well.
16:09bitemyappgg.
16:09llasramcYmen: Where the heck do you work?
16:09cYmeniTunes of course is available because somebody important has an iPad...
16:10cYmenllasram: I'm going to keep that secret so this doesn't turn into name-calling. :p
16:10llasramheh
16:10bitemyappcYmen: never try to recruit me.
16:11cYmenabout?
16:12pwojnowskiThanks everyone for help. I'll try to do it in pure Clojure.
16:12gfrederickshere's a probably buggy (in three different ways?) way to do mocks: https://www.refheap.com/21301
16:13llasramcYmen: Oh, probably name collision actually
16:14cYmenWhat did you find? :)
16:14seangrove8th light?
16:14bitemyappcYmen: https://github.com/cymen this you?
16:14bitemyapphe writes clojure.
16:14cYmenno
16:14bitemyappwelp.
16:14seangroveOk, that explains it then
16:15cYmenI certainly hope his clojure is better than mine.
16:15seangroveWas just strange that software craftsmen would block ssh
16:16gfredericksworks a little better with definterface
16:19gfredericksoh weird. it works only when called at the top level
16:20gfredericksotherwise the interface name doesn't resolve
16:21justin_smithgfredericks: macros are weird
16:21gfredericksI think this is more about the compiler than the macro
16:22gfrederickshuh...is reify* a special form?
16:23gfrederickslooks like it is
16:23gfredericksTIL
16:24gfredericksokay if I resort to using eval to generate the interface at macroexpand time it seems to work and I don't know if there are any downsides
16:25llasramgfredericks: alternative:
16:25llasramJust actually call `definterface` during maroexpansion, then expand to code referencing the interface
16:26gfredericksllasram: how do you call definterface with a programmatically chosen interface name?
16:27llasramOh, there's the rub. You'd need to call the lower-level `gen-interface`
16:27freshhawkleiningen newbie here, I've got some java files to import and i've got my :java-source-paths set up correctly (lein compiles them anyway) but I can't import them. Any ideas what I'm missing or what docs I need to read?
16:27gfredericksllasram: ...which is also a macro?
16:28llasramgfredericks: Yep, I have been wild-goosing you apparently
16:28llasramgfredericks: Have fun with eval :-)
16:28gfredericksthe presumably final version: https://www.refheap.com/21301
16:29magnarshow do you handle the "odd man out" in a chain of (-> threading macro functions) ? The single function that wants a ->> instead?
16:29gfredericksmagnars: you can embed ->>
16:29justin_smithmagnars: I use as->
16:29gfredericksor alternatively use as->
16:29magnarsthanks, I'll look into those :)
16:29gfredericks,(-> 3 (+ 5) (->> (- 100)) (* 2))
16:29clojurebot184
16:30magnarsof course, that makes sense
16:30gfrederickshard to think up on your own though
16:30justin_smith,(as-> 3 n (+ n 5) (- 100 n) (* n 2))
16:30clojurebot184
16:30justin_smithslightly longer, I find it easier to read
16:30magnarsyeah, that was interesting.
16:30gfredericksalso more flexible; the ->/->> thing doesn't work the other way
16:31gfredericksnot to mention when you have more than a couple args. I often resort to as-> when I'm using reduce
16:31gfredericksbecause it goes in the middle
16:31magnarsexactly
16:31gfredericks...sometimes
16:32bitemyappas-> is lovely.
16:32jared314can you name it ?
16:33jared314"?" ?
16:33bitemyapp-> is the Winchester.
16:33justin_smithhell, you could name it ☃
16:33gfredericks,(as-> "x" ? (str "bwaaz" ?))
16:33clojurebot"bwaazx"
16:34justin_smithname it $* and pretend you are writing a shell script
16:41hiredman b
16:42bitemyappahhh nothing like rewriting quickcheck in Python for the 5th time.
16:42bitemyappWe have done this before...and we are growing exceedingly efficient at it...
16:43justin_smithis that more or less fun than tracking down the various ways clobs are sneaking into the things you create from your db data I wonder
16:45bitemyappjustin_smith: clobs?
16:45justin_smithhttp://docs.oracle.com/javase/tutorial/jdbc/basics/blob.html
16:46bitemyappjustin_smith: what the fuck
16:46bitemyapp :|
16:46justin_smithwe had some coming back from a query, everything was good until the result of the query had to go in an avout distributed atom
16:46justin_smithand they are not serializable
16:47devnblech -- i can't figure out what's up with my cider and eldoc
16:47devnI keep getting this in the minibuffer: eldoc error: (void-function -elem-index)
16:48justin_smithhave you tried setting debug-on-error to a truthy value?
16:48justin_smithit will pop up a stack trace and let you see the el source where the problem happened
16:48justin_smithand you'll be all like "this is a lisp language, I know this" and you'll fix the bug
16:49coventryjustin_smith, devn: Someone was complaining about this error in cider here a few weeks ago.
16:49cYmenHm...any hints for this: http://www.4clojure.com/problem/146
16:50cYmenI can't even figure out how to use for on maps.
16:50devnis eldoc maybe a dep on nrepl?
16:51devnerr no, it's a built-in
16:51devnhmmm
16:51magnarsdevn: seems like you're missing dash. Try a M-x package-install dash
16:51justin_smith,(for [[k v] {:a 0 :b 1}] [k k (* v 2)]) ; cYmen
16:51clojurebot([:a :a 0] [:b :b 2])
16:51seangrove,(into {} (for [[k v] {:a 0 :b 1}] [k (* v 2)]))
16:51clojurebot{:a 0, :b 2}
16:52technomancyelisp without dash =(
16:52magnarsit's harsh
16:52devnmagnars: hmm, i never needed it before?
16:52devnI upgraded from nrepl to cider
16:52justin_smithif that is the case, cider should add an explicit requirement for dash
16:53devnThat fixed it. Thanks magnars.
16:53cYmenjustin_smith: I came so close to guessing this syntax correctly. >_<
16:53devn<3
16:53technomancyjustin_smith: it does
16:53magnarsIt is an explicit dependency of cider, but something's gone wrong somewhere.
16:53technomancyat least on master
16:54bitemyappWheeeee reduce(dict_conj, zip(*[string_seq(num_pairs)]*2), {})
16:54llasrambitemyapp: `reduce` in Python? You dare oppose the will of the BFDL?
16:54devnbitemyapp: heh
16:54technomancy~guards
16:54clojurebotSEIZE HIM!
16:54bitemyappllasram: I actually just tweeted the code at him.
16:55devnlol
16:55llasramniiice
16:55justin_smithsamizdata reduce
16:55devnstick it to the man
16:55justin_smithsmuggled past the python border
16:55bitemyappI'm not happy about being back to writing Python at work, but I can make the most of it.
16:55bitemyappnow I just need a short-circuiting reduce.
16:55bitemyapptime to make a foldr!
16:55brehautbitemyapp, llasram: we all know that you should be writing a class that implements __add_ with your reduction and just use sum. its much clearer
16:56brehautmonoids for all!
16:56justin_smithjust hearing that kind of logic makes me feel like my reasoning skills have been abused
16:57bitemyappbrehaut: you're right, but I hate you for making it sound silly.
16:57technomancyhttp://wingolog.org/archives/2013/11/26/a-register-vm-for-guile <- andy wingo is always fun to read
16:58winkyup, I read that at 12 am my time already :P
16:58winkstill wonder why I always used to read his blog via planet python
16:58winkthe non-python stuff is much more interesting
16:59technomancyheh; I found it on planet.gnome.org =)
16:59winkI love gnome as a concept
16:59devnThis might come in handy for some of you: http://en.wikipedia.org/wiki/Tall_poppy_syndrome
16:59winkbut I can't stand using their stuff anymore (mostly WM etc, apps are fine)
17:00technomancywink: their infrastructure is fine even if you don't like gnome-shell
17:00technomancybut yeah, I mostly read it to follow what's going on in free software land more than anything else
17:00winkhey, it's just a lame excuse that I don't have to skim 100 more blog posts a day ;)
17:01winkit's still interesting, but I don't need/want gnome3
17:01llasramThe first chart in that post is awesome
17:01winkso amaze
17:01bitemyappvery graph
17:02technomancyI've pretty much given up trying to understand what software for normal people should be like.
17:02technomancyso I respect the gnome folks even if it's not for me
17:02winkdevn: Tall poppy syndrome doesn't apply to bitemyapp though. He's just - in general - grumpy
17:03technomancyman, this post makes me wish I had an excuse to dive into some scheme
17:04hyPiRionI dug into Guile because... I needed to learn automake
17:04technomancyor maybe I should just write a lisp that targets guile bytecode
17:04winks,everbody and his dog,everybody and his lisp,
17:04bitemyappdoge lisp
17:04technomancywink: I already have a toy lisp impl; it's ok
17:05winkalthough LISPs are, to my knowledge, not yet sentient
17:05winkbitemyapp: too bad it's too terse. the syntax doesn't lend itself to be replaced by so/much/wow
17:06winkyou need a language where you could replace ; with "wow" or if with so much
17:06magnarsso interface much generics wow
17:06winkactually that's been so often it would be cooler to write a meta-meme language
17:06wink*done
17:07winka DSL to transform memes into languages
17:07winkmy head is spinning
17:11wink"the little monad that could"
17:12technomancyhaha; cider's version in master is "0.4.0-cvs"
17:12technomancythe heck
17:12winkyou can't delete it, you have to move it to the attic?
17:12justin_smithit's the branch they work on while using the free wifi at their neighborhood cvs pharmacy
17:14bitemyappHrm. recursing in Python is hella awkward.
17:15winkwhy?
17:15clojurebotwhy is the ram gone
17:15winkm(
17:15bitemyappwink: no TCO, despite having a VM that could've done it.
17:15bitemyappwink: no loop/recur equivalent either.
17:16winkclojurebot: because they're taking the hobbytes to isengard, silly
17:16clojurebotHuh?
17:16bitemyappso I have to write a while loop. Fantastic.
17:16mattmossOh great, now that song is stuck in my head. Thanks, wink.
17:16winkmattmoss: blame the bot
17:16technomancyIt's Pythonic.™
17:16winkbitemyapp: ah that
17:17bitemyapptechnomancy: sanity draining.
17:17mattmossThe bot looked confused to me.
17:17bitemyapptedious and petty.
17:19mattmoss(into isengard (take 2 hobbitses))
17:19bitemyappman this code is silly.
17:32cYmenIs this https://www.refheap.com/21304 an appropriate solution for 4clojure 146? I'm not sure what the lesson is supposed to be here or if I understand the problem correctly.
17:34justin_smithcYmen: that looks like it solves it, and if it does, yeah, looks great
17:35cYmenIt passes the tests.
17:35justin_smithit's about learning how to massage your data into the structure you need
17:35cYmenThat's all I can say. :)
17:35justin_smithyou could generalize to N depth
17:35justin_smithbut the problem is explicitly only for a fixed depth of 2
17:35cYmenI also have no idea how to generalize it to depth n :)
17:35justin_smithrecursion!
17:36cYmenWell, yeah that almost always works. :)
17:36justin_smithgeneralized depth == recursion :)
17:36justin_smithfor fixed depth you can explicitly unroll as you do here
17:37winkIf in doubt, recurse.
17:41justin_smithcYmen: that answer is a lot nicer than mine
17:41justin_smithI just finally checked, mine sucks
17:42justin_smithhttps://www.refheap.com/21305 do not emulate this crappy code
17:42justin_smiththough it does work
17:43cYmenoohhh...I need to friend you or whatever it is one does on 4clojure
17:43cYmenI always want to look at other peoples solutions but don't know anyone.
17:43justin_smithI
17:43justin_smith'll return the favor
17:44cYmenWhat's your account name?
17:45justin_smithnoisesmith (as mentioned on that refheap)
17:45cYmenhmpf
17:45cYmenI tried that. :)
17:45justin_smithit automatically generates a refheap from the share button if you solve one of the items
17:45cYmenAh I needed to show all first.
17:45justin_smithyeah, I am not in the top 100
17:46cYmenJust expected it to extend that when searching. Whatever.
17:47JaredRfirst day here... a friend is a hardcore clojurian, I'm still wrapping this imperative brain around FP... it currently hurts, but it seems to be a worthy pursuit. :)
17:47`cbpwelcome
17:47JaredRjust joined up on 4clojure... cYmen and justin_smith can I add you guys as friends?
17:47justin_smithyeah, please do
17:48cYmenSure, my account name is "Firefly" but I am just almost through the easy problems myself...
17:48cYmenBut I'd love to talk about alternative solutions and stuff. :)
17:48JaredRfinding this extremely helpful in the absorption of the concepts: http://www.defmacro.org/ramblings/fp.html
17:49`cbpclojurebot: what is good in life?
17:49clojurebotexcusez-moi
17:49JaredRthanks guys... and ooh, a fellow browncoat? :D
17:49bitemyappJaredR: that's a good intro, but the rabbit hole goes much deeper :)
17:49JaredRyeah, I've done the FIRST problem. lol I got it right though. hehe
17:49bitemyappoh look, he even says, "This article only scratches the surface of functional programming."
17:50justin_smithcYmen: capitalized or no?
17:50justin_smithI found a non-capitalized firefly
17:50cYmenjustin_smith: Does it matter? I think just firefly.
17:50justin_smithok, searching for capitalized found nothing
17:50cYmenJaredR: browncoat? What?
17:50justin_smithjust making sure
17:50justin_smithfirefly has not seen firefly
17:50JaredRFirefly... umm... heh never mind.
17:51bitemyappJaredR: I'm a browncoat, if that's any comfort.
17:51justin_smithcYmen: I recommend watching firefly, it is a good tv series
17:51JaredRyay! cYmen WRT Firefly the TV show... fans refer to themselves as browncoats.
17:51cYmenI've seen Firefly. Just didn't know the name for fans. :)
17:51JaredRalso, after the series, watch Serenity, the movie, the "final episode" of the show.
17:52justin_smithdude, they even talk about browncoats in the show, you couldn't have watched that closely
17:52cYmenjustin_smith: It's been 5 years or something....
17:52insamniacI watch lots of shows and don't remember everything from said show
17:52winkI also never heard the term in regard to fans
17:52insamniacHell, I just watched Firefly this year and don't remember browncoats
17:52winkah well, at least it's not reavers :P
17:53JaredRhere 5 minutes and already I drag the conversation off topic. lol
17:53winkofftopic would be pet grooming
17:53winkbut not firefly!
17:54JaredRbrowncoats is a term only comes up once in a while... most specifically in the bar scene later in the series. they're in a bar on the anniversary of the big battle that Cap'n was in, and the alliance guys in the bar are ripping on "browncoats"
17:54justin_smithI just got caribou core caching compatible with avout, so with the middleware that is almost ready, one will be able to run multiple caribou instances that have their concept of the data models in sync
17:54justin_smithin other words, win
17:54cYmenA caribou is still a bird in my world. :p
17:54bitemyappjustin_smith: wait, you're using avout for caching?
17:55insamniaclulz caribou bird
17:55winkwait what
17:55JaredRcaribou is a chain of coffee shops... they cache coffee.
17:55justin_smithbitemyapp: a special variant of caching: the data model for all stored data is cached so that it does not need to be retrieved as a prereq for every request
17:55bitemyappcYmen: a caribou is a ruminant mammal with antlers.
17:55bitemyappjustin_smith: I've clearly not dived into this corner of Caribou.
17:56JaredRbitemyapp: also known as a reindeer.
17:56justin_smitha problem we had was multiple instances, sharing a db, would move their models out of sync, such that when one instance expanded or modified the model schema, the others would get exceptions
17:56bitemyappso far as I was aware, it was a hybrid web framework/CMS that you used with a database.
17:56bitemyappjustin_smith: a changes feed works great here.
17:56bitemyappjustin_smith: cache in the process, asynchronously update when the changes feed says something needs updated.
17:56justin_smiththat was my first approach
17:56bitemyappokay, what went wrong?
17:57bitemyappJaredR: that's getting more specific, yes.
17:58justin_smithbitemyapp: the existing updates were already expressed in terms of swap! (we had been using an atom) and I realized it would be simpler to use avout/swap!!
17:58justin_smithand just treat the avout data as a distributed atom
17:58justin_smithand in fact it's class is distributedatom
17:59justin_smithif this ends up being a performance hit, from using the shared data model, I will go back to a change feed
17:59nDuffHas there been any work on Avout? Last time I looked, it didn't have any kind of exception handling support.
17:59justin_smithnDuff: its last changes are old, but I haven't run into any issues yet
17:59bitemyappjustin_smith: couldn't you just add a watch and cache the atom state locally?
18:00justin_smithI successfully turned some atoms in my codebase into avout/zk-atom s
18:00bitemyappjustin_smith: I'm not saying pre-optimize until you've got a benchmark and data, just speculating.
18:00nDuffjustin_smith: are you relying on cases where exceptions are thrown from within transactions that modify refs?
18:00bitemyappbecause right now you're just dereferencing on the fly right?
18:00justin_smithnDuff: no refs, just an atom
18:00justin_smith*some atoms
18:00justin_smithbitemyapp: right
18:01bitemyappjustin_smith: so you're still creating a potential overhead in requests.
18:01bitemyappjustin_smith: that'll probably fly until you topple the poor ZK cluster over.
18:01bitemyappthen you'll want to subscribe to atom state as a changes feed (add watch)
18:01justin_smithI turned the code that used reset! and swap! into usages of a simple protocol, then I inject avout's version of the protocol from the client app
18:01bitemyappstill don't know why you need this, interesting as it is :)
18:02justin_smithbitemyapp: when I an the frontend guy are hammering away at a new site, he will add a data model
18:02justin_smithor I will
18:02justin_smithor better yet, add or delete or modify a field in a model
18:02justin_smithsince the information about the models is stored
18:02justin_smithwe get sql errors if our concept of the data model goes out of sync with the db
18:02justin_smiththis keeps things consistent during dev
18:03justin_smithand also, if it performs well enough, can help us coordinate multi-server deploys
18:03justin_smithand maybe even rolling upgrade, etc.
18:03bitemyapphrm, yeah, I have a decidedly different way of handling this.
18:03bitemyappthat involves a lot less code.
18:03justin_smiththough the things synchronized on the deploys will not be data models, which should not change in production
18:03cYmenhmpf
18:03justin_smithbut things like client data
18:04justin_smithbitemyapp: your method is datomic, no?
18:04bitemyapphaha, no, I'm thinking of SQL databases.
18:04justin_smithso tell me about your approach
18:04bitemyappjustin_smith: I maintain/work on Clojure libraries for three different kinds of databases.
18:04bitemyappDatomic, RethinkDB, Korma.
18:04bitemyappjustin_smith: I just take the fuckin' servers down and migrate the database, redeploying the new code :P
18:05justin_smithremarkably enough, I have done this also :)
18:05bitemyappI've been going to some trouble to figure out how to do datomic migrations with minimal downtime.
18:05justin_smiththe issue is that caribou allows model definition from within the cms - that is the model schema itself is data in the db
18:06bitemyappyou've recreated EAV. gg.
18:06justin_smithso something like avout helps that stay in sync
18:06bitemyappseriously.
18:06bitemyappthat's EAV.
18:06bitemyappadd a T and you're halfway to reimplementing Datomic.
18:06justin_smithwe have talked about ditching it all and moving over to datomic, though we are logging data model changes to create migrations so that is a step toward t
18:07bitemyappyeah but this is a lot of code to be responsible for that doesn't actually bring the benefits of Datomic.
18:07justin_smithright
18:07bitemyappDatomic does a great job of handling user-defined models due to its EAV heritage.
18:08justin_smithI am not claiming this is the most beautiful design. but it has succeeded in helping us develop apps very quickly and eliminate bottlenecks in development workflow, so we carry on
18:08justin_smithwe are seriously considering abstracting out all sql dependencies
18:08JaredRjustin_smith: not to distract from this illuminating convo... but how do I find and add someone on 4clojure?
18:08justin_smithin fact I have decided on that, and just have to implement it
18:09justin_smithJaredR: change the top 100 view to all users and use the search box
18:09bitemyappjustin_smith: I don't doubt you guys work quickly, but I've noticed that the more talented a programmer or group of programmers are, the more likely they get into an unnecessary complexity trap that their talent is masking.
18:09bitemyapp*cough C++ cough*
18:09justin_smithbitemyapp: this is the truth
18:09justin_smithI have no doubt out design has reached a local minima
18:09bitemyappmaxima?
18:10bitemyappit's reached the pinnacle of what makes sense for this overall approach right? that'd be a maxima.
18:10justin_smithminima of unneeded complexity
18:10justin_smithor close to it
18:10justin_smithlocally :)
18:10justin_smithbut we do like to step back and reevaluate the big decisions
18:11justin_smithI have threatened ever since I got hired to re-implement the whole thing in ocaml or maybe haskell
18:11justin_smithspeaking of the big decisions
18:11bitemyappI'll help if Haskell.
18:11justin_smithI'll keep that in mind, thanks
18:11bitemyappjustin_smith: main frameworks to draw inspiration from (IMHO) would be Snap, Scotty, and Happstack.
18:12bitemyappScotty is basically a routing Monoid, Snap and Happstack are built on combinators.
18:15bitemyappjustin_smith: I'm considering porting a Clojure app to Haskell before releasing the official version of it for a variety of reasons, one is that the lack of a type system allowed things to get out of control.
18:15bitemyappI can report back my experiences in diving into the web stacks of Haskell when I do so.
18:16justin_smithcool
18:16bitemyappI'm working on a command-line app in Haskell as well.
18:19justin_smithIt is kind of cool to have two repls and a ring server, each in their own vm, and interact with them and see all applicable state reflected transperently between the three
18:19justin_smithI'll keep a lookout for those issues with refs though
18:20justin_smithbut so far avout has been perfect for my usage
18:23bitemyappjustin_smith: yeah the only thing that I don't really like about Haskell is no equivalent (yet) to an embedded nrepl.
18:25octagonhi! i'm looking for an example or docs that explain how to access the cljs analyzer from a macro. any pointers?
18:29bitemyappjustin_smith: I take that back, you can wrap: http://hackage.haskell.org/package/hint
18:29bitemyappjustin_smith: and just expose a secured client to it.
18:32justin_smithbitemyapp: cool
18:33justin_smithoctagon: what does the macro need to do?
18:33noprompthai
18:34bitemyappnoprompt: welcome back to the homeland
18:34winkbitemyapp: reading neubite source (because of the user-middleware question yesterday) - could you explain https://github.com/bitemyapp/neubite/blob/master/src/neubite/middleware.clj#L46 ? :)
18:34bitemyappnoprompt: I'm currently convincing justin_smith to rewrite caribou in Haskell and plotting the downfall of Simonides.
18:34nopromptbitemyapp: well, i've convinced my new coworkers that clojurescript is the answer.
18:34bitemyappwink: provides a hook point for disabling/logging wrappers
18:35bitemyappnoprompt: eggscellent.
18:35nopromptbitemyapp: boy, you sure are in haskell lately. don't pee in your pants.
18:35bitemyappnoprompt: I plan to work on either Simonides (in Haskell) or Grom with a buddy of mine. If you want in on the Haskell hack-fest let me know.
18:35noprompt:P
18:35winkbitemyapp: hm, I mean.. why not use apply directly in lines 51/56 - future expansability by encapsulation?
18:35nopromptbitemyapp: sure, why not? i'd be down.
18:35bitemyappwink: it's to enable clean AOP/override/hooking/logging.
18:35nopromptbitemyapp: what kind of a rollout do i need for emacs?
18:36winkbitemyapp: ok, thanks.
18:36bitemyappnoprompt: best environ I've found: https://github.com/nominolo/scion
18:36bitemyappwink: I don't do OOP generally, I do AOP when I need the ability to extend/modify/override.
18:36bitemyappwink: comes from having been a ruthless CL user.
18:36nopromptbitemyapp: why haskell though?
18:37bitemyappnoprompt: too much of my Clojure has entailed getting into the weeds with type errors lately.
18:37bitemyapplosing patience for it.
18:37winkbitemyapp: for that size it looked a lot like premature optimization, just how I would do it. so I thought I had missed something :P
18:37bitemyappnot just NPE (although definitely that too), all kinds.
18:38bitemyappwink: I didn't give it much thought beyond being my default approach when I write handler wrappers in Clojure.
18:38cYmengrmpf...how do I delete the next (...) with paredit?
18:38cYmendo I have to enter it and delete with C-k M-s?
18:38bitemyappwink: I provide a way to AOP the inner invocation behavior of wrapper HOFs.
18:38bitemyappjust how I code
18:38dnolencYmen: C-k
18:39dnolencYmen: oh from the one you are in? don't know how to do that, I guess slurp and C-k
18:39nopromptbitemyapp: interesting. i seldom have issues with type exceptions beyond NPE. although lately i've been wanting to investigate core.typed.
18:39dnolenbitemyapp: you know there is a Haskell channel for you to rant in
18:41bitemyappdnolen: I'm stealing people first.
18:41dnolenbitemyapp: considering the smash up job you're doing - I'd give up while you're ahead
18:43bitemyappdnolen: sho-thang ◕‿↼
18:43akurilinIs there way of completely omitting a form from a macro if I want to? For example, I'm calling Korma's (select mytable (order :id :ASC)) and I might want to completely omit the (order) part on a condition.
18:43akurilinso that effectively it looks exactly like (select mytable).
18:43bitemyappakurilin: compose it?
18:44akurilinbitemyapp, oh yeah, hmm let me look into that
18:44bitemyapp~fcomp is have you tried function composition?
18:44clojurebotCool story bro.
18:44bitemyapp~fcomp
18:44clojurebotI don't understand.
18:45bitemyapp...
18:45bitemyapp~botsmack
18:45clojurebotclojurebot evades successfully!
18:45akurilinbitemyapp, forgot about that select* option
18:45bitemyappWow, bot is snotty today.
18:45bitemyapp~fcomp
18:45clojurebotPardon?
18:45bitemyapp~fcomp is have you tried function composition?
18:45clojurebotexcusez-moi
18:45bitemyappI give up.
18:45bitemyapp~zergling
18:45clojurebotzergling is https://github.com/prismofeverything/schmetterling
18:45bitemyappokay so it hasn't gone totally nuts.
18:46nopromptdnolen: i've been messing around with core.async and pubsub to do two-way data-binding. part of the little system i've built uses atoms to store application state when specific messages are published. do you know if there are any drawbacks to this sort of design?
18:46bitemyappglobal mutable state seems like a drawback.
18:47nopromptbitemyapp: or a tradeoff.
18:47bitemyappIf it's a good fit for your problem, so be it, but there are alternatives.
18:47bitemyappI think I know what you're talking about, I can see why you'd want to do that.
18:47nopromptbitemyapp: this is the discussion i'm looking for.
18:48bitemyappnoprompt: you can do a fanout of listeners instead of an atom/
18:48bitemyapp(I had to pause to think about this)
18:48bitemyappgenerally people care about a model's state because they either need to read it now, or get an update when it happens.
18:48bitemyappso rewrite in terms of something more reactive and let state propagate via channels.
18:49dnolennoprompt: could work - I'm pretty curious about React.js's approach these days thanks to prodding from bbloom
18:49bitemyappyou could do a hybrid approach too.
18:50bitemyappnoprompt: this would be easier to explore over a skype convo or something, do you get where I'm headed though?
18:50nopromptbitemyapp: well yes, techically i can remove the atom and the system will continue to work just as it does now. occasionally, the state is of interest.
18:50bitemyappright but that's what I'm saying, you subscribe listeners to a fanout channel of updated state.
18:51bitemyappeverything gets bucket-brigaded via channel, no need to atom-smash.
18:51nopromptdnolen: i haven't looked at React.js but i will. essentially what i am trying to do is a controllerless angularjs style framework with cljs. i've been working on it for a little while now and mostly this is the part that concerns me. the compiler/parser/directive stuff was really not that difficult.
18:52nopromptthe offerings of purnam and clang are hackish ugly ideas to me.
18:52bitemyappnoprompt: what I'm talking about would eventually move you towards something like React.js'ish
18:52dnolennoprompt: just read through the first page - http://facebook.github.io/react/
18:52SegFaultAXIs React.js similar to RxJs?
18:52bitemyappalthough my mental model for something like this is typed, not untyped, and is more like Elm.
18:52nopromptwrapping a framework is silly.
18:52dnolennoprompt: maybe you can do something like this?
18:52nopromptlemme take a look.
18:52dnolennoprompt: React.js basically has a functional represenation of the DOM, a virtual
18:52dnolenone
18:53dnolennoprompt: turns out it faster to to diffs on the virtual DOM than it is to touch it!
18:53dnolentouch the real DOM
18:53dnolennoprompt: so kind of production quality version of WebFUI if you saw that
18:53nopromptdnolen: that's interesting.
18:54dnolennoprompt: yeah I don't really care about the other bits - but the batching of render ops, and the virtual DOM, those are solid ideas
18:54dnolennoprompt: their JSX stuff is basically Hiccup
18:54dnolenexcept ugly HTML in your code
18:55nopromptdnolen: yeah, eww, just saw that.
18:55dnolennoprompt: yeah skip all that, and look at the big ideas - I think they're pretty solid
18:56akurilinbitemyapp, not sure I quite got this pattern down. Is this was you were thinking? https://www.refheap.com/21310
18:56nopromptbitemyapp: we should definitely skype or gangout regarding the simonides hackfest.
18:57SegFaultAXakurilin: Ew, that's some ugly threading.
18:57SegFaultAXakurilin: Are you on 1.5 or above?
18:58bitemyappnoprompt: <3
18:58akurilinSegFaultAX, I'm all ears about how to make that better :) Thinking macro, but there's probably a better way.
18:58akurilinSegFaultAX, yes
18:58bitemyappwoof.
18:58SegFaultAXakurilin: as-> is a thing.
18:58nopromptdnolen: though the popular idiom in js is to use $ prefixed vars for dom selections, it's kinda cool you could actually do something like (let [<p> ($ "p")] ...) in cljs, heh heh.
18:59dnolennoprompt: heh
18:59nopromptdefinitely easier to spot than $p
18:59akurilinSegFaultAX, do you know of any examples of that being used?
18:59SegFaultAXBut angle brackets in a symbol is going to get annoying to type after about 10 seconds.
19:00bitemyappDOM variables get dem dollas.
19:01nopromptdnolen: btw, are the closure docs wrong? i see that gdom/$ and gdom/$$ are deprecated and there is now a gdom/query function, however, that doesn't seem to be the case. :-/
19:01nopromptgdom/query doesn't exist but the others do.
19:01dnolennoprompt: it's in third party and in order to get at it you gotta use :import because of the weird Closure coding style conventions
19:01dnolen(:import [goog.dom query])
19:01nopromptSegFaultAX: as-> is awesome. fuck haters, i love as->.
19:01SegFaultAXakurilin: It just gives a name to the value to be threaded through, then anywhere that symbol is given will be subbed.
19:02nopromptdnolen: ah, sweet! thanks.
19:02bitemyappnoprompt: who doesn't like as->? Can we burn them?
19:02SegFaultAX(as-> (...) foo (do-something foo) (do-something-else 1 2 foo 3))
19:02nopromptbitemyapp: ah, i can just imagine some fool going off about it.
19:02dnolennoprompt: oh, but it's no in 2080 yet, so you want that to work you'll need to install master
19:02SegFaultAXnoprompt: If you love as-> then you'll probably also appreciate synthread.
19:02dnolens/so/so if
19:03bitemyappnoprompt: http://www.haskell.org/haskellwiki/Emacs
19:03bitemyappnoprompt: SegFaultAX is right, synthread is cool. topic monads ftw.
19:03nopromptdnolen: sure thing. no worries. i usually wrap that sort of thing so when i upgrade, etc. i only need to change code in one place.
19:03SegFaultAXCan we take all the Haskell stuff to #haskell? As much as I love Haskell, this isn't the place for it.
19:03akurilinSegFaultAX, cool thanks, will give it a shot
19:03bitemyappSegFaultAX: noprompt isn't in #haskell
19:03bitemyapphe wanted to know how to set up his Emacs.
19:04technomancyhe's missing out
19:04bitemyapptechnomancy: you're not in #haskell either
19:04nopromptlol.
19:04SegFaultAXnoprompt: /join #haskell, n00b
19:04technomancyyeah, but I know how badly I'm missing out already
19:04nopromptSegFaultAX: it's all good. #clojure is enough irc at one time for me.
19:05SegFaultAXnoprompt: Yea, but that channel is quite unlike every other channel on freenode.
19:05SegFaultAXWell, except maybe #math
19:05technomancyhe's definitely missing out by not being in #emacs too; geez
19:05nopromptSegFaultAX: i've been there a few times. it's cool.
19:06noprompttechnomancy: life is always passing me by.
19:06SegFaultAXHas anyone tried pulsar/quasar?
19:06SegFaultAXAs a replacement for core.async in particular.
19:07bitemyappSegFaultAX: I don't know if I'd think of it as a "replacement"
19:07bitemyappSegFaultAX: they have some overlap but are suited to different kinds of problems.
19:08nopromptdnolen: how close are we to seeing a self hosted cljs compiler?
19:08SegFaultAXNot really.
19:08SegFaultAXPulsar apparently comes with a compatability layer that exposes an identical API to core.async.
19:08nopromptbitemyapp: on the client side there is definitely *no* replacement.
19:08SegFaultAXBut fundamentally it's coroutines for the JVM.
19:09SegFaultAXLike, real coroutines.
19:09nopromptif there isn't a #celeryman there should be.
19:11noprompt"this" has become one of my least favorite words.
19:11SegFaultAXIn the context of objects?
19:12nopromptSegFaultAX: mostly in the context of javascript objects.
19:13SegFaultAXnoprompt: Ugh, tell me about it. Javascript is so mindcrushingly horrible (sorry dnolen), and the semantics around `this` make up a large part of the horrible-ness.
19:13JaredRjustin_smith: still around?
19:13lnostdal"connecting to nREPL on localhost:52224...", but nothing happens .. strange .. no logs in any emacs buffer that i can see (emacs, clojure-mode, cider)
19:13justin_smithJaredR: yeah, what's up?
19:13glosolilnostdal: latest version ?
19:14nopromptin a traditional class based object oriented world, if i drop a glass on the floor how does it break?
19:14nopromptdoes the glass have method for breaking itself?
19:14noprompthow do i model this?
19:15JaredRyour solution for 4clojure #9 - sets conj was (inc 1)... explain please? :)
19:15lnostdalglosoli: yes, i think so .. M-x package-list-packages tells me "cider 20131127" is installed
19:16JaredRjustin_smith: your solution for 4clojure #9 - sets conj was (inc 1)... explain please? :)
19:16SegFaultAXnoprompt: Assuming the target is IBreakable, sure! :)
19:16glosolilnostdal: weird I just updated to that same version, seems to be working
19:17SegFaultAXlnostdal: Can you connect to the nrepl directly?
19:17nopromptdnolen: why was :imported decided to ony work with goog?
19:17JaredRjustin_smith: never mind... lol. I thought 1 was a reference to something, but it's just the literal. lol... so was there a reason other than cleverness for that answer?
19:17noprompterr :import.
19:17bitemyappnoprompt: Elm's tutorials teach reactive thinking nicely. Have you seen them?
19:17justin_smithJaredR: I was likely being a smartass
19:18justin_smith I got bored but wanted the easy stuff marked as done
19:18bitemyappnoprompt: http://elm-lang.org/learn/What-is-FRP.elm http://elm-lang.org/Examples.elm
19:18JaredRjustin_smith: roger. lol. thanks for breaking my newb brain. heh
19:18nopromptbitemyapp: a while back yeah. but other than factor or prolog i'm really not interested in dicking with another language right now.
19:18lnostdalSegFaultAX: you mean just `lein repl` from the CLI? yes, that works
19:19lnostdalSegFaultAX: or wait, i'll try lein repl then connect to that from emacs
19:19bitemyappnoprompt: I'm not saying to *use* Elm, I'm saying to let it convey a way of thinking.
19:19SegFaultAXnoprompt: Factor you say!? What got you on that?
19:19nopromptbitemyapp: ah yes.
19:19SegFaultAXlnostdal: Yes that.
19:19SegFaultAXlnostdal: I should have been clearer: can you connect to a running nrepl session.
19:19nopromptSegFaultAX: it looked interesting.
19:20SegFaultAXnoprompt: I'm also interested in it. From a purely "oh, that's kinda neat" perspective, though.
19:20SegFaultAXI would never actually do anything meaningful in it.
19:21lnostdalSegFaultAX: ok, nope; same thing .. stuck with the same "connecting to nREPL..." message
19:21nopromptSegFaultAX: i like to pick up a new language each year in a paradigm i haven't explored.
19:21SegFaultAXnoprompt: Let me just say this though: the factor pastebin is a cesspool. Stay as far away from that place as you can.
19:22nopromptSegFaultAX: roger that.
19:22nopromptSegFaultAX: did you hear about gershwin? https://github.com/gershwin/gershwin
19:23irctcwhois
19:23irctcwhoami
19:23lazybotirctc
19:23SegFaultAXnoprompt: Yup. I'm sure you've heard of bbloom's factjor? https://github.com/brandonbloom/factjor
19:24nopromptSegFaultAX: sure did. in fact bbloom's talk is what got me interested in looking at factor in the first place.
19:24SegFaultAXLikewise.
19:25nopromptSegFaultAX: i haven't messed with gershwin yet but like the idea.
19:25SegFaultAXI wonder if there are people that do actual work in a language like that. Not just fun-time hacking but like mission critical stuff.
19:25SegFaultAXWell, other than Forth.
19:25nopromptSegFaultAX: i'd bet there's some FORTH out there.
19:25SegFaultAXShitloads.
19:26bitemyappgod fucking dammit melpa.
19:26SegFaultAXSolaris, FTW.
19:26bitemyappanother dependency vendored, another reason to hate MELPA. *scratches a tally on the prison cell wall*
19:27bitemyappnoprompt: correction, don't use Scion.
19:27SegFaultAXmelpa is the emacs thing?
19:27bitemyappSegFaultAX: it's one of the emacs things that exist.
19:28nopromptbitemyapp: ok.
19:28SegFaultAXbitemyapp: Does package.el not know how to dependency or something?
19:29nopromptbitemyapp: i should ask @dysinger. he uses emacs and haskell.
19:29bitemyappnoprompt: I do too, but I'd never expanded beyond haskell-mode since 2010.
19:29bitemyappI wanted to check on the IDE functionality for your sake, turns out the cool kids use ghc-mod now.
19:29bitemyapppartly because haskell-mode subsumed shime.
19:30SegFaultAXJust ask in #haskell.
19:30bitemyappbefore anybody complains, he's still not in #haskell.
19:30bitemyapptoo late.
19:30SegFaultAXOr Twitter.
19:30nopromptSegFaultAX: i just asked @dysinger.
19:30bitemyappI just told dysinger what I'd found so far.
19:30nopromptSegFaultAX: he's cool guy.
19:30bitemyappand doesn't afraid of anything.
19:30nopromptlol
19:32nopromptbitemyapp: python is janky language btw.
19:32nopromptbitemyapp: itertools; garbage.
19:32SegFaultAXitertools is gold.
19:32nopromptSegFaultAX: a gold turd.
19:32technomancySegFaultAX: emacs dependencies are "just grab me the latest; cool" and melpa treats git master as fine to package, so you can imagine the breakage that abounds
19:32SegFaultAXGiven what the language provides in __builtin__, itertools and functools are gold.
19:33SegFaultAXtechnomancy: Ah, golang style deps. Got it.
19:33bitemyappwithout itertools and functools I would constantly cry bloody tears while writing Python.
19:33nopromptSegFaultAX: in the context of python sure. in the context of everything else, turds.
19:34nopromptimmutability is like heroin.
19:34bitemyapp"everything else" have you used anything that wasn't functional recently?
19:34SegFaultAXnoprompt: Python isn't a functional language to the extent of Clojure or Haskell or Scala or ML.
19:34nopromptSegFaultAX: originally i think it was supposed to be a functional language.
19:34bitemyappmori for Python would be kinda cool.
19:34bitemyappnoprompt: it wasn't
19:34SegFaultAXnoprompt: Nope. Never.
19:35bitemyappnoprompt: my Common Lisp brothers tried to force it on Guido, he got really mad.
19:35bitemyappnoprompt: that's why he whines about reduce.
19:35SegFaultAXnoprompt: filter/reduce/map were added by a disgruntled lisp hacker and will likely be removed.
19:35tos9noprompt: It's not. When we want functional we write clojure :)
19:35tos9(Or at least I do)
19:35noprompttos9: it's not like heroin?
19:35bitemyappI write functional'ish in Python.
19:36noprompttos9: or itertools is not turds?
19:36SegFaultAXtos9 knows. He's idled in #python at least as long as I have. Probably longer.
19:36bitemyapp༼ つ ◕_◕ ༽つ Give functional
19:36tos9noprompt: It's [Python] not [functional]
19:36tos9noprompt: itertools is certainly turds :)
19:37SegFaultAXtos9: Compared to what (in Python)?
19:37noprompttos9: exactly what *is* python? i mean, seriously? what is it?
19:37SegFaultAXnoprompt: A language.
19:37nopromptSegFaultAX: i guess.
19:38nopromptSegFaultAX: it's definitely the 3rd worst language i've messed with.
19:38technomancya cult? =)
19:39SegFaultAXnoprompt: I've been writing Python for about 8 years now. I have issues with it, but I don't hate it /that/ bad. What are 1 and 2 on your worst list?
19:40seangroveHonestly, clojurescript with an eye for performance and a sane ui metaphor/interface, and I wouldn't mind spending the vast majority of my time developing in the browser
19:40arrdempython gets the job done and people can read it. makes for a great interview language :P
19:40nopromptphp and js are the top two.
19:40seangroveThe UI is the missing piece here.
19:40arrdemnoprompt: perl should have 3...
19:40nopromptwell maybe php and c++.
19:40bitemyappPython is nicer than JavaScript.
19:40nopromptc++ was the first language that actually made my blood boil.
19:40seangroveClojureScript makes all the other hard lifting fine, doing some pretty intense data manipulation and filtering stuff that would be nightmarish in js.
19:40SegFaultAXnoprompt: PHP and JS are good choices. C++ though?
19:41SegFaultAXseangrove: Well said. I would extend that over Clojure, too. Clojure is easily the best data modeling language I've ever used in my life.
19:41akurilinWhat's an elegant way of comparing items in two vecs at the same index, from beginning to end? I can ghetto it up with map-indexed, but I imagine it'd be more along the lines of interleave + take-nth 2
19:41nopromptSegFaultAX: a compiler that tells me my problem is on line N of some file F while in fact the error is on line M in file G. yeah, fuck that.
19:41SegFaultAXakurilin: Map is variadic.
19:41technomancynoprompt: you've never had that happen in clojure?
19:42seangroveMongoDB C++ php ruby emacs eclipse iod templating npm node
19:42bitemyapp,(into {} (map vector [:a :b :c] [0 1 2]))
19:42clojurebot{:a 0, :b 1, :c 2}
19:42SegFaultAXnoprompt: Clojure does that all the time.
19:42bitemyappakurilin: ^^
19:42nopromptSegFaultAX: you forget a semicolon in c++ and it's like good luck!
19:42SegFaultAXnoprompt: Wow, that's an unbelievably minor complaint.
19:42SegFaultAXRelative to all the things you could have said about C++
19:42arrdemyeah. templates are so much worse than the semantic choise to use ; deminimated statements.
19:42akurilinSegFaultAX, bitemyapp wat.. you tell me now about this?! :)
19:43SegFaultAXakurilin: Given your newfound knowledge, see if you can work out the solution. :D
19:43bitemyappakurilin: you should do 4clojure puzzles.
19:43bitemyappyou'll find new toys.
19:43SegFaultAXYup.
19:43SegFaultAXOr Clojure koans.
19:43SegFaultAX(Well, /and/ Clojure koans)
19:43justin_smithand read code written by amalloy
19:43akurilinseems like a good idea, thanks for the tip
19:43bitemyappthat too.
19:44nopromptSegFaultAX: well there was definitely more. templates. linking hacks. other random weird shit. i've only used in algorithms classes so for all i know it might be a decent language.
19:44noprompttechnomancy, SegFaultAX normally when i get an error in clojure i don't look at the line numbers.
19:45SegFaultAXnoprompt: The most significant amount of C++ I've ever done was a cross-platform (Android+iOS) mobile rendering engine with Lua bindings. C++ has its shortcomings for sure, but ; isn't on the top 100. :)
19:45technomancynoprompt: because you've been subliminally trained that it's gonna be useless already =)
19:45dnolennoprompt: port of tools.reader, macros, faster multimethods, Node.js based IO
19:45dnolennoprompt: re: optional bootstrapping to JS
19:46seangrove"They should really move forward because JavaScript is becoming new IE6."
19:46seangroveToday's wat.
19:46dnolennoprompt: what good is :import except for Clojure
19:46noprompttechnomancy: that's probably it!
19:46SegFaultAXseangrove: The next ecmascript actually has some pretty cool features.
19:46SegFaultAXGenerators in particular are pretty neat.
19:47octagondnolen: do you know of an example of using the cljs analyzer from inside a macro?
19:47nopromptdnolen: i was just curious to know the motivation. i've been out of the loop for the passed couple months.
19:47clojurebotNo entiendo
19:47seangroveSegFaultAX: Yeah, saw Eich's talk in JSConEU. Some nice compile-target feature, but the syntax was pretty unpleasant looking (destructing, etc.)
19:47noprompt*past
19:47dnolenSegFaultAX: no offense taken re: JS I like it in the small, but I get tired of it when writing more than a thousand lines or so
19:48SegFaultAXdnolen: Out of curiosity, do you use cljs at work?
19:48dnolennoprompt: motivation for bootstrapping? writing Clojure sans JVM when there's value to that.
19:48akurilinSegFaultAX, Apparently I was trying to re-implement compare. "leverage", is that right, bitemyapp?
19:48dnolenSegFaultAX: no, most of the JS I write at NYT is of the trivial variety, we don't do many "apps"
19:48nopromptdnolen: no motivation for limiting :import to goog.*.
19:48noprompt*no,
19:49dnolennoprompt: oh, what else would it be used for?
19:49SegFaultAXdnolen: What is most of the stuff you hack on at NYT?
19:49dnolennoprompt: at one point we allowed importing a deftype but it caused more problems not less
19:49dnolenSegFaultAX: JS, HTML/CSS, Ruby on Rails
19:49SegFaultAXdnolen: Ah, just your run-of-the-mill full stack guy? Me too. :)
19:50dnolenoctagon: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/core.clj#L205
19:50dnolenSegFaultAX: yeah the whole team is on Rails, though currently there's been a lot of grumbling, but Rails is convenient and there's not a great replacement that doesn't suffer from the same problems
19:51SegFaultAXdnolen: Same at Rally.
19:51dnolenSegFaultAX: for services there's excited about Go, which is fine. Some talk about Node.js which sounds awful to me - for apps I'd take Ruby over Node.js any day.
19:51dnolenwell JS in Node.js anyway
19:51dnolenCLJS in Node.js another story
19:51octagondnolen: perfect! thanks a million! i'm trying to see if i can detect when a form is a macro or not from inside my macro, without doing a full macro expansion
19:51octagondnolen: this should get me started, thanks
19:52SegFaultAXdnolen: Have you given much thought to transitioning into something that would allow you to use CLJ[S] full-time?
19:53bitemyappSegFaultAX: even if he had it's unlikely he'd say so in public.
19:53SegFaultAXI thought about that the moment I asked.
19:53SegFaultAXHeh
19:53bitemyappdoing cljs full-time would probably mean doing less interesting cljs stuff than he currently does.
19:53SegFaultAXdnolen: Not trying to put you on the spot, just asking since you're so heavily involved in the clojure community at all levels.
19:54bitemyappso I don't think it would necessarily make sense.
19:54SegFaultAXdnolen: Anyway, nevermind. :D
19:54seangrovecljs for small apps could make a great deal of sense, if only we had the ui down.
19:54nopromptthe guys at the shop i just started at seem like they're excited about me bring clojurescript to the table.
19:54seangroveCertainly fine as it is, but this has been bubbling up for a bit now
19:54dnolenseangrove: agreed, it'll happen in there near future I suspect
19:55dnolens/there/the
19:55nopromptonce i showed them core.async the whole "it looks weird" argument started to fade quickly.
19:56seangrovednolen: Yeah, I have some experiments I've been working on, need to grab some ios devs to get a better understanding of how ui is generally/properly done
19:57dnolenseangrove: iOS stuff is well designed component wise, but control is still a mess - instead of callback you have lots of delegation and proliferating APIs
19:57dnolenaround delegation
19:57seangrovednolen: Thinking more in terms of the controls metaphors
19:58seangroveWorking on that + something like webcomponents + pedestal's functional-as-long-as-possible approach
20:00dnolenoctagon: the ability to call the analyzer from a macro in CLJS and get something easy to work w/ is my favorite less well known feature of CLJS
20:00dnolenseangrove: sounds awesome
20:00nopromptdnolen: wait. what?
20:00dnolenoctagon: the ad-hoc shenanigans can die
20:01dnolennoprompt: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/core.clj#L205
20:02akurilinIs loop a way to avoid defining and then calling a recursive function?
20:06noprompti look forward to the day when macros can be written in cljs.
20:07hyPiRionthey can?
20:08noprompthyPiRion: not yet.
20:08hiredmanI've played a little with tools.analyzer.jvm for "compiler" type macros in clojure it seems workable there too
20:09hyPiRionwhat do you mean by "not yet"? https://github.com/clojure/core.async/blob/master/src/main/clojure/cljs/core/async/macros.clj
20:09dnolenhiredman: right, nice
20:09hyPiRionPerhaps I joined the conversation at some strange point
20:10dnolenhyPiRion: he means mixing macros into the source file
20:10hyPiRionooh
20:10dnolenwhich will be low priority as there's a lot of churn involved in that which isn't necessary for boostrapping to JS
20:11nopromptdnolen: so 2014? :-)
20:11dnolennoprompt: I don't see why not
20:12seangroveThe cljs-in-cljs project looks quite cool, but I imagine it's diverged so far from master at this point merging would be painful and massive
20:33justin_smithhlship: I don't know if you are around, but I'd like to talk to you about integrating twixt as a drop in extension to caribou at some point - I want to look into it on my own first, I'll likely have some questions
22:37bitemyapphttp://erlang.org/pipermail/erlang-questions/2013-November/076112.html
22:39nopromptbitemyapp: "welcome to Computing :-)" lol
22:39bitemyappnoprompt: but clearly PHP is the superior choice for numerical problems.
22:40seangroveWell, only thing left to do is work on distributed PHP systems
22:40justin_smithdidn't python change at some point from the erlang behavior to the php one?
22:41bitemyappI don't know. Wouldn't surprise me.
22:41justin_smithI must be misremembering
22:41bitemyappbecause fucking with floats is "less surprising"? :P
22:41justin_smithmy python does the erlang one
22:41nopromptpython is the new php.
22:42seangrovenoprompt: We can only hope so.
22:42seangroveThat's a positive progression at least.
22:50seangroveI think the latest message on the ml could possibly qualify for a clojure wat bot.
22:51justin_smiththe clueless contractors have discovered clojure
22:51justin_smithyay
22:51tbaldrid_seangrove: is that the lisp to java class?
22:51Rayneshttps://groups.google.com/forum/#!topic/clojure/eociVedmzuE
22:51seangrovetbaldrid_: yeah, specifically the LISP portion
22:52seangrovejustin_smith: Or the markov chains are being pointed at ml's now.
22:52justin_smithsomeone get him a copy of the original McCarthy LISP stat
22:53bitemyappIf somebody doesn't know what month of the year (off by 5 months) the major holiday of their home nation occurs in, are they a spy?
22:53bbloomoh boy.
22:53bitemyappnoprompt: hey
22:54justin_smithbitemyapp: could be a very busy child prodigy who has been so busy with med school and law school and being a virtuoso painist that they never really learned anything about the normal world
22:54justin_smithit happens
22:54bitemyappnoprompt: /join #haskell
22:54bitemyappjustin_smith: physics major that decided to code for a living.
22:54seangroveI tried my hand a being a viruoso painist, but found the S&M clubs a bit too dirty for my tastes
22:56justin_smithhttp://i.imgur.com/ecCEQ04.jpg
23:09technomancyyesssss https://github.com/clojure-emacs/cider/tree/content-types my precious
23:12emaphiswow, hot of the press. :-)
23:23technomancyhawt
23:26bbloomtechnomancy: ok sooo i heard some mention of nrepl and content negotiation
23:26bbloomwhat are you up to you maniac?
23:32mercwithamouthwrong place to ask but is common lisp good for writing scripts?
23:33nopromptjavascript:{}
23:34bitemyappmercwithamouth: I use Haskell and Python for that. you could use nodejs + cljs too.
23:34bitemyappmercwithamouth: using packages in CL is too annoying for me to use it with scripts.
23:40technomancybbloom: racket envy?
23:40mercwithamouthbitemyapp: gotcha. i was hoping to start using a lisp for scripts
23:41bbloomtechnomancy: i saw the recent post & skimmed your link above. give me the 5 sentence summary of what you hope to realistically achieve in a way that reaches a large portion of the clojure community
23:41bbloomgo!
23:41nopromptmercwithamouth: cljs + node is not a bad target.
23:41nopromptmercwithamouth: https://github.com/guns/optparse-clj
23:42justin_smithon the latest osx you wouldn't even need node theoretically
23:42nopromptjustin_smith: go on.
23:43technomancybbloom: porting slime's inspector to nrepl; monitoring middleware that can provide svg graphs inside the editor; maybe some kind of game that could use images for tiles; incanter-type stuff.
23:43justin_smithnoprompt: https://developer.apple.com/library/mac/releasenotes/MacOSX/WhatsNewInOSX/Articles/MacOSX10_9.html
23:43justin_smithsomeone has to connect clojurescript to it of course
23:43justin_smithbut I am sure someone will do that
23:44technomancybbloom: there's two sides to the problem; one is moving more logic that has been traditionally editor-side into the server, but that depends on the server being able to send stuff back to the client using something less primitive than stdout
23:44bbloomtechnomancy: so i'm not totally familiar with nrepl's internals, but how much of it is "repl" and how much of it is standard embedded debugging server ?
23:45justin_smithnoprompt: looks like a js interpreter embedded in osx / ios, which you could target with your clojurescript, I assume
23:45bbloomtechnomancy: b/c what you're describing sounds like the latter
23:45technomancybbloom: also: you can rip out a ton of custom elisp in cider and replace it with clojure-side equivalents. slamhound.el, clojure-test-mode.el, and cider-trace.el can be totally ephemeralized; replaced with server-side stuff that isn't tied to emacs
23:46technomancybbloom: this is the groundwork you would need to be able to write a portable debugger
23:46bbloomtechnomancy: makes sense to me, so maybe i'm tripped up on the name of the thing having REPL in it :-P
23:46technomancybbloom: it's part of the P in REPL
23:46technomancyread eval display loop
23:47bbloomso where does the content-type part come in?
23:47technomancyneed a richer display mechanism than println
23:47bbloomi'd expect return values to be *clojure values*
23:47bbloomnot arbitrary content
23:47justin_smiththe difference as I see it is that with a dt-socket you totally control the target vm, to the degree of stopping / starting / manipulating the stack and bytecode
23:47nopromptjustin_smith: oh yeah, i heard about this.
23:47bbloomalthough i could understand uber stdin/stdout as messages instead of byte streams where each message has a content type
23:47justin_smithwhile this is an interpreter built into the program, not a direct control on the vm
23:47technomancybbloom: an nrepl middleware could come up with a better way to render a given clojure value
23:47bbloombut i don't want (+ 1 1) to return content-type number :-P
23:47technomancyhaha; sure
23:48technomancybut you don't want everyone to have to reinvent a bunch of rendering logic either
23:48justin_smithfor example, if you halt the target vm, you can't really count on the nrepl in that vm helping you at all
23:48bbloomi don't trust most ppl to write sane middleware
23:48bbloomtry printing a large object in chrome
23:49bbloomchange obj.x to some new value
23:49bbloomthen expand the object in the console
23:49bbloomthe x will be the LATER x, not the one at print time
23:49bbloomyeah, that's a js issue
23:49bbloombut so many people are all excited about "object shells" and other silly things, i get concerned :-P
23:50technomancyI haven't heard that term
23:50technomancywe're just talking about various representations of a given return value
23:50justin_smithtechnomancy: think like that old xterm from the mozilla project that could display a jpg or mpeg inline when you cat the file
23:50technomancyit's kind of restful in that regard
23:50justin_smiththat's an object shell
23:51technomancyjustin_smith: gotcha. yeah that makes sense to me.
23:52bbloomi'm worried about not having control over return values representations w/o loading some custom lib and whatnot
23:52technomancybbloom: just adjust the accept header that your client sends then
23:52bbloomno i mean right now how i handle this is by returning nil and printing w/ pprint or whatever
23:52justin_smithbbloom: isn't your issue about expecting live vs. static display? think gdb where you can have a watch, and that updates its display constantly vs. a trace that shows a log of each value
23:53bbloomjustin_smith: i'm mostly rambling
23:53justin_smithas long as you have informed consent to which you get, I don't see the problem
23:53bbloomi've had a long day :-P
23:53bbloombut yeah, i really don't want live displays in my repl. i want it to be a log
23:53technomancythis is about "we have some data. it's more readable as an svg, but you can have it as edn if that's how you roll. do you grok svg? k, here's an svg."
23:54bbloomok the real issue i'm concerned about is stdout vs return values
23:54bbloomright now if i want to print something pretty, i (pprint ...) which return snil
23:54bbloomreturns nil*
23:54bbloompprint writes text, explicitly
23:54bbloomi could see (svg-print ...) or whatever too
23:54technomancybbloom: plus it's all up to the nrepl handler to decide how it renders things. the eval operation is probably never going to return anything other than a textual representation, but you can add other operations than eval.
23:55bbloombut what about return values?
23:55bbloomlike if i do (load-image ...)
23:55bbloomand that returns a Bitmap or something
23:55technomancybbloom: then it depends on what nrepl middleware you install
23:55bbloomwhat happens? some middleware intercepts and renders it as image/jpg ?
23:55technomancyand what accept headers you send
23:55technomancybut there's no way we'd interfere with eval operations out of the box
23:56bbloomi guess what i'm saying is that i want complete control and predictable behavior for both return values and "emitted" (in leu of "printed") values
23:56technomancyI'm thinking more like M-x inspect-class -> results in a non-eval nrepl op being invoked that returns hypertext
23:56technomancybbloom: ok, so it sounds like you're only talking about eval
23:57technomancystuff that you enter directly into a repl
23:57justin_smithwhat about some extension of pr / print
23:57bbloomyeah, sorry, i don't use emacs & i have litterally one repl interaction: evaluate this range of text
23:57technomancyI'm talking about using nrepl as a transport by which you can invoke any kind of server-side op
23:57bbloomyeah, sure i get that
23:58bbloomnrepl is probably just a misleading name at that point, but fine
23:58bbloomif you don't fuck w/ the eval case at all and don't provide an API for emitting things, then i've got no further input to add
23:58technomancyyeah, it's a generic async protocol that happens to be used primarily for eval; kind of like how emacs is a generic lisp runtime that happens to be used primarily for editing
23:59bbloomok
23:59technomancy"don't provide an API for emitting things" what does that mean?