#clojure logs

2014-05-21

00:00blrquizdr: when you have some time, you could get austin setup https://github.com/cemerick/austin
00:00blrI've been meaning to check it out myself
00:08FrozenlockIf only emacs was written in clojure, I wouldn't have to leave it. Ever.
00:11quizdrFrozenlock, well they say Light Table is the new emacs, and it is written in clojure(script)
00:11quizdrlight table is so pretty and has many nice things, but it seems that as soon as i try something non-trivial in my workflow, things break
00:12quizdrand i've become perhaps overdependent on other emacs features, like shell and irc integration, directory browsing, etc. so not sure light table will replace those
00:12FrozenlockI don't really believe it. It if far as customizable as emacs.
00:12Frozenlock*from being
00:13gtraktechnomancy: seems like the meetup liked hacking on syme, we're going to keep pushing it forward: https://github.com/baltimore-clojure/syme/wiki/TODO
00:13quizdrJust doing something as simple as increasing or decreasing the font size of the code screen you are looking at is not simple in light table. Emacs, just as keystroke.
00:13quizdr*a
00:16justin_smithquizdr: oh, control+scroll doesn't do it? I thought they piggybacked on webkit
00:17quizdrjustin_smith by "scroll" you mean... scroll lock button? I'm on Mac, and I tried the standard zoom in/out keys (mapped to the + and -) buttons but they don't do anything in light table
00:17justin_smithquizdr: as in mouse scroll wheel
00:17Frozenlockscroll... mouse scroll
00:17justin_smithor two finger drag or whatever you know
00:17quizdrouch! did you say "mouse" ?!! perhaps another reason i prefer emacs :)
00:17justin_smithlol
00:17Frozenlock:-p
00:18FrozenlockHe might also be using an old 1 button mac mouse
00:18quizdrif light table depends on a mouse or touch pad, scroll wheel, scroll bar or anything else for basic navigation then I will not look at that app ever again
00:18FrozenlockBecause why would you need to use more than one finger on your hand? -Mac
00:18justin_smithFrozenlock: for multi-touch, of course
00:19Frozenlockquizdr: One of the deal-breaker for me is the lack of buffers
00:19quizdractually i take that back: two-finger scrolling on a touchpad is quite easy. but i'd had to use scrolling for anything else, especially in combination with a keystroke
00:19FrozenlockI tried to implement one, but the documentation is too spares.
00:19justin_smithFrozenlock: so it is "document" based?
00:19quizdrFrozenlock switching buffers in emacs is really nice too, and fast (without a mouse, of course). i would think light table should eventually support file view switching easily and quickly
00:20justin_smithI wish I had iswitchb for my web browser
00:20Frozenlockjustin_smith: Yes, what you see is your document; you can't see it in another tab.
00:20quizdrI would actually think that the future of code editing is in fact a web page interface. you could have tabs or buffers for your different views, etc.
00:21quizdrto edit code on a server, it's just a browser page on that server, etc...
00:21amalloyjustin_smith: switch to konkeror? it probably has that
00:21FrozenlockWell, perhaps you can. Like I said, I tried to implement it using the CodeMirror functions, but that opened a whole can of Worms, bugs appeared everywhere. The current LT isn't supporting multiple view of the same document.
00:21amalloybut seriously, there are extensions for the major browsers with features like that, i think
00:23justin_smithamalloy maybe you mean conkeror? konkeror mostly finds me konqueror results (kde's ur-webkit thing) http://conkeror.org/
00:23amalloyoh, i probably do
00:23FrozenlockIf anyone wants to try to solve it: https://github.com/Frozenlock/Bufferize/blob/master/src/lt/plugins/bufferize.cljs
00:23amalloyi forget how to spell it. the one that's got like the emacs keybinds
00:23amalloyyeah, conkeror
00:24beamsoquizdr: i've done that type of editing (online editing/remote compilation) through using salesforce. it's actually really annoying.
00:24quizdrbeamso probably because salesforce messes it up
00:24quizdrno reason why a nice GUI editor couldn
00:24beamsono, the latency is too huge.
00:24justin_smithamalloy: yeah, I see people talking about doing iswitchb in conkeror, doesn't look like it exists as a finished thing yet though
00:24quizdroh i see, latency
00:25quizdrbut latency would be an issue with any remote code editor, even emacs, no?
00:25justin_smithquizdr: I like how emacs handles it actually, via tramp
00:25bodie_uh, why would a web interface necessarily be laggy?
00:25justin_smithit replaces file load / write with remote access, everything else is local
00:26justin_smithI bet if your site uses standard rest put / get tramp can already be used to edit the content
00:26bodie_just because someone's done it wrong doesn't mean it can't be done right ;)
00:26beamsobodie_: the latency was terrible and it really showed how good/bad your internet connection actually was.
00:26quizdrbodie_ i agree. i have no doubt salesforce is not doing it the best way (having used other SF services)
00:27bodie_latency of what specifically?
00:27justin_smithbeamso: no reason you can't do it emacs style in javascript (everything is just local editing, only file load and file save use the network)
00:27beamsosaving and compilation
00:28beamsoif it was inside my local network i wouldn't have an issue
00:28quizdrbeamso but compilation doesn't depend on an internet connection. and saving should be just sending a file over the connection, which would be the same regardless of editor
00:28justin_smithanother option is sending diffs to the server instead of a full file upload (depending on file size and change size of course)
00:29beamsoquizdr: for salesforce it does. there is no compiler in their eclipse plugin, just a crappy parser.
00:29bodie_saving should really just be a matter of flushing the cached entry to a persistent location -- if it's not already doing so. think google doc
00:29bodie_s
00:29bodie_there's not even a save button
00:29justin_smithie. look at how the sam editor manages to edit files that are larger than the computer's working memory, things are lazily loaded and lazily updated as regards disk
00:30justin_smithbodie_: well with google docs they are definitely doing it diff / delta based rather than naive re-upload
00:30bodie_right
00:30bodie_i mean the remote cached version
00:31bodie_it seems reasonable to use an in-memory db for syncing a document between users, for example
00:33beamsoi feel kinda unclean for dropping salesforce references in the room.
00:33clojurebotPardon?
00:33beamsoyou heard me, clojurebot.
00:34bodie_justin_smith, do you know of any alternatives to datomic?
00:34FrozenlockNow I'll have to goolge salesforce. Thanks beamso.
00:35FrozenlockWhat a lousy landing page. I don't know what it's doing.
00:35quizdrbeamso a lot of people swear by the power of salesforce -- and they do own Heroku after all -- but getting their stuff to work always seems like a bigger job than necessary (Heroku excluded, but they didn't create that service themselves)
00:37beamsoit is a bigger job then necessary because you need to identify how you can or can't bend salesforce to your will.
00:37quizdrha ha technomancy you are proving the exception to the rule, no need to hide :)
00:38beamsothey are moving to a situation where you develop your front ends on heroku and keep your internal users on salesforce
00:39quizdrwe actually have a large system build on salesforce for many years, but now we are going to deploy a clojure app on Heroku and are trying to figure out if it makes sense to link the two systems or just let the new app be totally independent and self-contained
00:39beamsodepends on the data and usecases
00:40justin_smithbodie_: no, I really don't. I haven't even gotten a chance to play with datomic even... but I may just find the free time soon between some contract work now that I am laid off
00:40quizdri'm leaning to keeping the existing salesforce integration out of the new project for the sake of elegance because i know just what a hack job it may turn out to be
00:40quizdr(to integrate them)
00:40beamsoalso on how much you want/don't want to pay for licencing
00:40technomancyquizdr: have you seen the postgres bridge?
00:41quizdrpostgres on heroku offers a native bridge to existing salesforce data?
00:41beamsotechnomancy is referencing https://devcenter.heroku.com/articles/herokuconnect
00:41quizdrAhh, looks like that service is not yet widely available
00:42technomancyI don't know a lot about it, but from what I can gather not wanting to use salesforce apis is a pretty common thing
00:42technomancyhuh; I thought it was supposed to be open for everyone now
00:43quizdrit looks like a "we'll let you use it if we liked your project" kind of thing.
00:44quizdri wonder how expensive it is.
00:44beamsoi expressed interest through a webform when it was announced. i got an email 8 days ago referencing that document.
00:45FrozenlockWait, am I really the only one who didn't know about salesforce?
00:45quizdrFrozenlock they are huge, they are everywhere.
00:45technomancyFrozenlock: I don't know about salesforce
00:45technomancyand I work there
00:46Frozenlockquizdr: Pepsi kind of everywhere?
00:46quizdrThey offer a lot of conveniences and tools for cloud stuff, but frankly it all feels a bit old-school to me.
00:46quizdrIt could be in the quality of the code that our SF consultants have written that is giving me a bad impression
00:46beamsolooks like heroku app admins have to manage the fact that the databases go out of sync
00:46quizdrI don't work with SF directly (thank goodness) but it just seems like everything is handing together by threads.
00:47quizdr*hanging
00:47Frozenlockquizdr: that's the whole Internet...
00:47FrozenlockI'm amazed to see it still works every day :-p
00:47quizdrwell SF is *not* the whole internet.. it's an expensive system that is suppose to make things easier, and it doesn't seem to live up to that
00:47beamsoquizdr: from what i've seen salesforce haven't upgraded from jsfv1 to a later version so the platform for devs is kinda stale
00:48quizdrwhenever i login to the user admin system in our SF backend i am plagued by a variety of error pop-ups that have never gone away despite years of SF consultants doing work for us
00:49beamsothe only popups i used to get were about applying updates, but that was for the standard ui.
00:49quizdrbut when you are tying in a marketing platform, a Windows app licensing service, a payment processing system and more all in a single SF account, things are bound to get complex. but SF should make it easier than it is.
00:52quizdrApparently the impetus for the Salesforce system and services was the result of a conversation its founder had with Steve Jobs, who offered like a single sentence of advice that led to this huge corporation
00:53beamsonever knew that one. i just knew that the founder was a former oracle sales exec
00:54bodie_justin_smith, after watching the Rich Hickey vid on Datomic I got really excited, until I checked out the "pricing" page.
00:55bodie_thus, my desire to find something a little less soul-shattering ($10,000 is way outta my price range. I think twice before dropping $10 on a cloud service. ha!)
00:55bodie_maybe one day if something i'm working on takes off.
00:56bodie_but, planning for success right now means launching with a low cost solution
00:57Cr8there's pro starter
00:59dissipatebodie_, why u so cheap?
00:59bodie_I'm saving up for a new piggy bank
00:59bodie_gotta count my pennies
00:59FrozenlockBecause when you spend all you money, you end up poor?
00:59bodie_lol
01:00bodie_Cr8 -- I think I somehow got it into my head that pro starter wasn't free :) thanks for the pointer
01:00Frozenlock"Frozenlock, how could you afford this $2k accordion while being in school?" "By not spending it all in drinks, child."
01:10nkozoI want to define a macro mymacro that gets an expression and returns the same expressions with his symbols fully qualified, ej (mymacro [list vec]) => [clojure.core/list clojure.core/vec] . There is a short way to do this?
01:11justin_smith,list
01:11clojurebot#<clojure.lang.PersistentList$1@a60d19>
01:12nkozo,`list
01:12clojurebotclojure.core/list
01:12justin_smithright, that's the one you want
01:12justin_smith(resolve 'list) another option
01:13justin_smith,(resolve 'list)
01:13nkozobut I want to fully-qualify an arbitrary expression containing symbols
01:13clojurebot#'clojure.core/list
01:13nkozobasically what syntax-quote does, but you cannot use syntax-quote directly to do this
01:13justin_smithnkozo: then you need to iterate across the whole expression, or use syntax-quote (`) which acts on a whole expression
01:14nkozocannot use syntax quote, (defmacro mymacro [expr] `expr) will not work
01:14justin_smithwhat about `'expr
01:14justin_smith`'(list + vec)
01:15amalloywhy do you want it to be a macro instead of just using `?
01:15justin_smith,`'(list + vec)
01:15clojurebot(quote (clojure.core/list clojure.core/+ clojure.core/vec))
01:15amalloyjustin_smith: that doesn't work if expr is passed in
01:15justin_smithamalloy: in a macro it would, that's why I added the '
01:15amalloyno it wouldn't
01:16nkozoamalloy: long history, this is the distilled problem and I forgot the initial reason :)
01:16amalloytry writing a macro foo such that (foo (list + vec)) expands to that, using just ` and '. you can't do it
01:16nkozoI think I want a runtime syntax-quote, not a read-time one.
01:17amalloynkozo: i mean, people have written that. ztellman and bbloom each have an interesting take on it
01:17nkozosure, I can walk the expression, but I thought maybe it was simpler
01:17amalloyi think it's bbloom, anyway. hiredman has one too
01:17ztellmanbbloom has backtick
01:17nkozochecking it...
01:20justin_smithamalloy: right as usual
01:20justin_smith(inc amalloy)
01:20lazybot⇒ 110
01:21amalloyjustin_smith: the thing to remember is that ` only happens at read time, and your macro body is only read once, so it can't know about the contents of expr
01:21justin_smithright, I had forgotten that
01:22justin_smithrpaulo: do you mean kernel system calls as in sys.h or like shell calls?
01:23rpaulokernel syscalls
01:23rpauloI found a clojure-jna project online
01:23TerranceWarriorhow can you do RAII under clojure?
01:23justin_smithrpaulo: welcome to the joyful and exciting world of platform dependent java, via clojure interop, you are shure to have a load of fun
01:24rpaulo:p
01:24amalloyTerranceWarrior: how do you use perl's $_ in c? it's just not a thing you do; it doesn't exist in the language
01:24justin_smithrpaulo: there was a jni lib I really wanted to use, and I spent a long time trying to figure out how to integrate it with clojure, to no avail. Maybe someone else can provide more useful suggestions though.
01:24amalloyinstead of asking how to apply a specific technique/language feature in a new language, ask about how to solve a problem
01:26bbloomnkozo: you can use the backtick/syntax-quote-fn function
01:26bbloomor make your own variant of it
01:26justin_smiththe jvm has a lot of raii just built in to the default classes that come with it, you don't have to do anything special to benefit from it
01:26justin_smithit's kind of implicit for making the jvm gc even work properly
01:26rpaulojustin_smith: I'm currently trying this https://github.com/Chouser/clojure-jna/
01:26nkozobbloom: thanks, I'm studying your lib
01:28justin_smithrpaulo: using syscalls directly you can skip the C compatibility part - if jna lets you put values into registers and then invoke an opcode you just need to make a map of syscall name to integer value based on the C header file - that's how C is doing it anyway
01:29rpaulowell, how would I go about creating C structures in clojure?
01:29justin_smithsyscalls don't use c structures
01:29justin_smithyou put some numbers in registers, then invoke an interrupt
01:29justin_smiththat's it
01:30rpaulosure, but that's not what I meant
01:30justin_smithoh, ok
01:30justin_smithztellman has a lib for that actually
01:30rpaulofor statfs, I need to get a struct statfs
01:30justin_smithhttps://github.com/ztellman/vertigo
01:31rpauloIt's still not clear to me, how I could map that to clojure structures
01:31rpauloah, ok.
01:31justin_smithc uses a simple linear format, you tell vertigo how the bytes are laid out, and it should help do the rest
01:31rpaulogot it.
01:32FrozenlockWOW. That's a special kind of customer service attitude: https://www.refheap.com/85711
01:33bodie_lulz
01:33bodie_please don't bug us, kthx dummy.
01:33justin_smithwhoever writes their copy sounds like a pretty fun dude
01:34FrozenlockI think I'll ask them the time estimate just for the lulz.
01:35bodie_subject: hi
01:35bodie_body: has it shipped yet? pls to be knowing now.
01:35amalloyFrozenlock: send them a postcard asking for a time estimate. they only said not to call
01:35justin_smithFrozenlock: "we have superimposed the time estimate over the plates for your print run, HTH"
01:36Frozenlockjustin_smith: lol!
01:48jw`Are a lot of folks using CIDER for development? I'm starting out learning clojure, and I'm a huge emacs junkie, so I'm gravitating towards CIDER, but would it make more sense to not mess around with CIDER yet? I notice there isn't much docs :-).
01:53justin_smithjw`: the frequency of "I installed cider and everything is broken" posts on the cider repo bug tracker have slowed down quite a bit :)
01:53justin_smithI'm still on nrepl though, some day I will do a purge and upgrade to cider
01:53Frozenlockjw`: I still use nrepl.el
01:54rpaulojna-test.core=> (jna/invoke Integer c/printf "My number: %d\n" 5)
01:54rpaulo13
01:54jw`Ok :). I'm going to give 6.1 a shot
01:54rpaulo13 is the correct return value, though
01:56amalloyrpaulo: probably to stdout, instead of *out*. or it may not have been flushed
01:57rpauloyeah, lein run works fine
01:59quizdrjw` i use cide jack in for all my clojure repl work, never had a problem
02:00jw`quizdr - I'm going to give it a try now... I'm actually already running prelude, so this might just work out dandy.
02:01quizdremacs-live uses cider too i think
02:01quizdrit's quite popular
02:08jweaverOk, there we go.
02:08jweaverAll setup now (cider).
02:10rpaulowhat's being done to lower the startup time of clojure? I understand the problem because there are several explanations online.
02:10justin_smithrpaulo: there are at least two GSOC projects for a lean (faster startup) clojure
02:11justin_smithrpaulo: also if you have a finished app and just want faster run time, making an uberjar and running with java -jar has much better startup time (lein is a dev tool, not a launcher)
02:12rpauloright.
02:12justin_smith*faster load at run time that is
02:13justin_smithmaybe with a shell script that sets your jvm opts properly if you need it
02:37TerranceWarrior3~3~in '(take 10 (filter odd? (iterate inc 0)))' does filter "yield" to "take"?
02:38FrozenlockTerranceWarrior: yield?
02:38amalloyTerranceWarrior: lazy sequences aren't generators, but they're sorta similar
02:48quizdr,(take 10 (filter odd? (iterate inc 0))
02:48clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
02:49quizdr,(take 10 (filter odd? (iterate inc 0)))
02:49clojurebot(1 3 5 7 9 ...)
03:00TerranceWarrioramalloy: clojure is strict evaluation.
03:01quizdrI seem to remember reading once that using a map as function vs the key is that if the key is not present, you get nil, while with the key as function you get an exception. But I don't actually see that happening. Did this change in recent versions of Clojure?
03:02amalloyyes, but lazy sequences convert expressions to thunks, basically. so (map f xs) is a no-arg function which, when called, produces a single value, and a thunk for producing more of the sequence
03:02amalloyi mean, that's not really quite what happens, but it's the basic mechanism allowing the "strict evaluation" objection to not apply to lazy sequences
03:03amalloyquizdr: the difference is just that whichever one you use as a function will break if it's nil. ie, (k m) fails if k is nil, and (m k) fails if m is nil
03:03amalloysee http://stackoverflow.com/questions/7034803/idiomatic-clojure-map-lookup-by-keyword, for example
03:04amalloyactually, that doesn't really address your question
03:04TerranceWarrioramalloy: okay so the 'thunking' is part of eval. makes sense.
03:04amalloyi guess http://stackoverflow.com/a/14491027/625403 is what i meant
03:04amalloyTerranceWarrior: well, not really
03:04quizdramalloy oh i see what you mean. i was confusing "not present" with "nil"
03:05amalloy(lazy-seq x) is a macro, which expands to something like (fn [] x)
03:05dbaschnot to mention things like
03:05dbasch,(let [m 1] ({} m))
03:05clojurebotnil
03:05quizdramalloy in your answer to that question you mention "hotspot" what is that?
03:05dbasch,(let [m 1] (m {}))
03:05clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
03:06amalloy$google jvm hotspot
03:06lazybot[HotSpot - Wikipedia, the free encyclopedia] http://en.wikipedia.org/wiki/HotSpot
03:07quizdri see thanks
03:08amalloytldr, it's the JIT that optimizes your code while it's running
03:09TerranceWarriorit's easier to just think of the eval process as always yielding to the enclosing function.
03:14TerranceWarrior,(gensym "hi")
03:14clojurebothi75
03:14TerranceWarrior,(gensym "hi")
03:14clojurebothi100
03:14TerranceWarrior,(gensym "hi")
03:14clojurebothi125
03:16quizdrdo all defmethods take a single parameter, which is always the result of the dispatch function (which also returns just one value, of course) ?
03:21AimHere,(doc defmethod)
03:21clojurebot"([multifn dispatch-val & fn-tail]); Creates and installs a new method of multimethod associated with dispatch-value. "
03:21quizdrah nevermind i see the entire original form is passed on to the mulimethod
03:31TerranceWarrior,(gensym "hi")
03:31clojurebothi27
03:32TerranceWarrior,(= (str gensym "hi") "hi49")
03:32clojurebotfalse
03:32TerranceWarrior,(gensym "hi")
03:32clojurebothi76
03:32TerranceWarrior,(gensym "hi")
03:32clojurebothi101
03:32TerranceWarrior,(= (str gensym "hi") "hi126")
03:32clojurebotfalse
03:33Glenjaminyou can clojurebot via /msg too :)
03:33babilen(if you can't afford your own REPL)
03:34Glenjaminit's that jvm/clojure.core startup time :)
03:40TerranceWarrioryou hear me talkin hillybilly boy?
03:43quizdrok, look, first of all, how did you know my name is Billy?
03:48TerranceWarriorhow is inheritence used in lisp, through strict encapsulation?
03:48TerranceWarriorlisp=clojure
03:49beamsoinheritence, as in the object-oriented language concept?
03:50amalloyare you sure you wouldn't rather write c++? raii, inheritance, encapsulation - these are all things that clojure doesn't really do
03:50jkjwell java oo is supported and you can layer functionality on classes
03:50amalloyi mean, encapsulation, a little, yes
03:51jkjso i quess working with java stuff is quite doable, but with native clojure inheritance is likely not needed
03:55quizdri've seen examples of lexical scoping combined with optional keyword arg maps to provide the basic idea of encapsulated member variables and member functions. don't really see a point to it, but it's certainly possible. inheritance would be a bit more complex than that.
03:56quizdrlike (myobject :accelerate 50) and (myobject :stop)
04:01clgvquizdr: you are trying to build a FSM?
04:02quizdrclgv i don't know what FSM is, but no i was addressing question by TerranceWarrior
04:02quizdrfinite state machine?
04:02clgvyes
04:03quizdri would think that anyone needing to do that would be better off using another language as amalloy suggests or just using protocols, records, types, etc
04:04clgvquizdr: not the FSM part. but as I see in the log he was asking for inheritance specifically
04:04clgvthere are at least two clojure libs to define FSMs
04:06mr-foobarin a source code how do you detect the compiler as clojurescript or clojure ?
04:06quizdrfine extension clj vs cljs
04:06quizdr*file
04:07martinklepschis using env vars to store database details etc a thing clojure people do?
04:07mr-foobarmacros are clj in clojurescript
04:07quizdrmr-foobar but they are actually clojure not clojurescript
04:07quizdrthey are clj but you can use them in cljs
04:07Pugnaxhttps://github.com/ptaoussanis/sente/blob/master/src/taoensso/sente.cljx
04:08PugnaxThere are a few examples
04:08mr-foobarquizdr : true. its
04:09beamsomartinklepsch: env vars? you mean defs?
04:09clgvmartinklepsch: why not just use a config file in clojure data (or EDN)
04:09martinklepschbeamso, no more like $HOME
04:10martinklepschclgv would make it harder to supply details at runtime
04:10quizdrmr-foobar if you look at the javascript that results from using macros in clojurescript, you'll see that the macro is no a part of the javascript. the macro helps to create the clojurescript and is done on the compiler side. and the compiler is clojure anyway, so the macros fit right in there.
04:10beamsoi know for heroku the database url is an environment variable
04:10clgvmartinklepsch: what? please explain.
04:10mr-foobarquizdr: just that i am writing a debug macro ... pritnln vs console.log i could write the code in separate namespaces or have a if clojurescrpt
04:10mangemartinklepsch: I've seen http://yobriefca.se/blog/2014/04/29/managing-environment-variables-in-clojure/ discussing using environment variables for config.
04:11quizdrwell actually all println statements in clojurescript can be console.log if you use (enable-console-print!) mr-foobar
04:11quizdrso you could use the same macro for both in that case
04:11martinklepschclgv, when I start my jar it's simple to set env vars before doing that. when I'd store that in a file I'd have to change the file and starting the application wouldn't be a 1-liner anymore
04:11clgvmartinklepsch: I often use the pattern to have a commandline option "--config" which specifies the configuration file to use. the main method loads it and uses the parameters as needed
04:12mr-foobarquizdr: ah thanks
04:12clgvmartinklepsch: but therefore it is pretty easy to see what you started the program with
04:12TerranceWarriorquizdr: closure is the ultimate inheritence for clojure.
04:12clgvmartinklepsch: if thats your reason then its not really worth discussing since the "effort" you mention as marginal
04:13quizdrTerranceWarrior that sounds a bit cryptic to me
04:13TerranceWarriorthe flatness of functionality makes me believe that there are as large a scope of function as there are as many functions to scroll through.
04:14quizdrAnd potted plants shall inherit the Earth.
04:14TerranceWarriorit doesn't feel right to me there there are soo many functions t traverse through programmability, but i come from a c++ backgrund.
04:15TerranceWarriorprogrammably
04:15quizdrTerranceWarrior i too come from a c++ background, and while at first all those functions seem overwhelming, the end of it is that they each do so much with such short work that they prove worth knowing
04:17quizdrand there is something liberating about having the guts of your app be generic data structures that can be easily manipulated without restructuring large parts of your logic, as is often the casein c++
04:17clgvTerranceWarrior: classes in c++ usually also have much more than one emthod
04:18quizdrlisps in general tend to have more emphasis on data structure and less on actual app logic, since so much of the logic is built into these heavy functions that bend general data
04:18quizdrin c++ to get the same functionality requires a lot of work just to arrive at where clojure starts
04:18clgvTerranceWarrior: so if you take all those together there is maybe small factor between the numbers and thats because elementar widely usefull functionality is implemented as small functions in clojure
04:20quizdrWriting c++ feels more to me like engineering, while writing clojure seems more artful and creative
04:20pyrtsaquizdr: Knowing enough of clojure.core (or any other similar library) actually helps in using the C++ standard library better. There are a number of very useful algorithms 98% of C++ programmers don't know of but should.
04:21quizdrpyrtsa that is true. and Qt's library actually has many C++ tools for doing map, reduce and other similar functional tasks concurrently across many cores
04:21pyrtsaOf course, it's still not as nice as Clojure. :)
04:22quizdrbut using the STL cannot be compared to the ease of using clojure.core
04:22quizdrand rarely will you have a finished C++ app that is not at least 10x lines of code as a clojure app of the same scale. hence the engineering vs artfulness i experience
04:22clgvI wouldnt touch C++ at all without the STL or boost ;)
04:22pyrtsaquizdr: Clojure.core is actually missing a lot of algorithms that are found in the std.
04:23pyrtsaclgv: Likewise.
04:23quizdrpyrtsa example of one you find useful?
04:24clgvquizdr: logarithmic search on a sorted random-access "list" - if I remember correctly that is available in the STL
04:24pyrtsalower_bound
04:26quizdrhm, lower_bound looks a bit like "some" if you give it the predicate similar to lower-bound
04:27pyrtsaHere's a good list of algorithms, some of which have their counterparts in clojure.core, some of which don't but could, some of which are maybe too specific to immutable data structures (but could be implemented for transients, I concur): http://en.cppreference.com/w/cpp/algorithm
04:27pyrtsaquizdr: You must take into account that the algorithm always comes with a defined complexity. clojure.core/some has a complexity of O(n).
04:28quizdrtrue
04:28clgvquizdr: I meant binar search with "logarithmic search" ;)
04:29clgvquizdr: it is on the linked page as well ^^
04:30quizdrit's interesting to note that Rich Hickey was somewhat of a c++ superstar in the years before his invention of clojure
04:30pyrtsaclgv: Off-topic, but lower_bound is usually what you need when looking for binary search.
04:30clgvpyrtsa: ah right, I didnt use that since quite some time. ;)
04:32pyrtsaquizdr: FWIW, here's a very good talk on the use of algorithms instead of hand-written loops, by another "C++ superstar": http://channel9.msdn.com/Events/GoingNative/2013/Cpp-Seasoning
04:34quizdrwatching the beginning of it now
04:34pyrtsaTerranceWarrior: ^ Might interest you as well.
04:36TerranceWarriori like clojure's multiple dispatch.
04:38TerranceWarriorif I had a penny for each time a techie started a sentence with the word 'so'.
04:40martinklepschI'm trying to get environ setup but constantly get this when requiring it: CompilerException java.lang.ClassNotFoundException: environ.core
04:40quizdrpyrtsa i like how he says than when writing a general function, he always writes it very concretely at first, then learns later how it can become general.
04:40martinklepschI tried to kill all java processes and ran lein clean
04:41quizdri find it can be intimidating to always write good idiomatic ideal-end-result code in clojure (meaning very general) when i'm implementing an idea for the first time
04:41martinklepschis there some other cleanup stuff I could do? [environ "0.5.0"] is in my :dependencies map
04:46Glenjaminmartinklepsch: try `lein clean`
04:46Glenjaminoh
04:46Glenjaminyou did
04:46Glenjaminthat's all i had, sorry :(
04:46Glenjamin`lein classpath` maybe
04:48martinklepschGlenjamin from the error I'd assume that the dependency hasn't been installed but running lein repl usually does that on it's own
04:49Glenjamintry nuking the environ folder in ~/.m2 perhaps
04:56clgvmartinklepsch: lein deps :tree does not complain?
04:58martinklepschclgv, not more than this: "WARNING!!! possible confusing dependencies found" ... (which doesn't seem related to environ
04:58clgvmartinklepsch: if it is not listed there, right
04:58martinklepschmaybe I'll just ditch environ and go for (or (System/getenv "HOME") "/home/martin")
04:58clgvmartinklepsch: maybe some typo in the actual code then?
05:04martinklepschclgv, environ is in that list. there is a lot in that list actually
05:05clgvmartinklepsch: I meant a typo/error in the :require form
05:06martinklepschjust wanted to write "nevermind ..." — it was actually a missing quote
05:06martinklepsch(require [environ.core :refer :all]) vs (require '[environ.core :refer :all])
05:08phillordanyone got experience with visualvm? It seems to work and then just hangs whenever I do any work in the clojure vm
05:26clgvmartinklepsch: you use that on the REPL right? in a file you shoud use a :require form in the namespace definition
05:28szymanowskiHello, is there something like clojure.math.combinatorics for clojurescript?
05:53dbushenkois there a way to list all functions in the clojure namespace or buffer ?
05:53dbushenko(in emacs)
05:59quizdrdbushenko yes
06:00quizdrwell you can list everything that is def'd
06:01dbushenkoquizdr, how?
06:04vijaykirandbushenko: which emacs setup do you use ?
06:04vijaykirandbushenko: emacs-live .. or something or plain emacs ?
06:05dbushenkoplain emacs with clojure-mode and cider
06:06vijaykiranwell - usual grep for defn should work then
06:06dbushenkoyep, thats the rough way, is there a more smart one?
06:07vijaykiranI use emacs-live and it has https://github.com/overtone/emacs-live/blob/master/packs/dev/foundation-pack/config/ido-conf.el#L26
06:07vijaykiranto jump between functions
06:07dbushenkothanks!
06:08dbushenkono, thats go to symbol, I can do that with cider
06:08dbushenkoI mean, list of all definitions
06:08dbushenko*I need list of all definitions
06:10elephantTechnohttp://stackoverflow.com/questions/2747294/how-to-list-the-functions-of-a-namespace
06:18clgvwhat elephantTechno said ^^
06:18clgvdbushenko: just use ns-publics on the repl
06:19alexyakushevHello everyone
06:19clgvdbushenko: if you need private variables as well -> ns-interns
06:19alexyakushevI'm currently experiencing a terrible wtf syndrome
06:19clgv,(apropos "ns-")
06:19clojurebot(ns-unmap ns-publics ns-unalias ns-aliases ns-resolve ...)
06:19alexyakushevCan someone take a look at this? https://www.refheap.com/85715#L-20
06:20alexyakushevThis is a java bytecode for AOT-compiled clojure.core/first function
06:20clgvalexyakushev: what's you problem with that?
06:20alexyakushevLines 20-22
06:21alexyakushevFirst argument is assigned to null before calling RT.first
06:21clgvlocals clearing. it is not what you interpret it to be ;)
06:22alexyakushevOK, so how does exactly it work? Does RT.first receives an actual argument and not null?
06:22clgvalexyakushev: jvm bytecode has a stack architecture
06:22clgvor ebtter the jvm has
06:24clgvalexyakushev: afaik aload_1 loads the object on the stack, aconst_null creates a null constant above it astore_1 overwrites location (register?) 1 with the constant leaving the initial object on the stack which is used for the static function call
06:25alexyakushevTricky
06:26dbushenkoclgv: thanks
06:26clgv alexyakushev: locals clearing is need for lazy sequences to work. otherwise code that does not need to would keep a reference to the head of a lazyseq and thus it'll be impossible to garbage collect unneeded elements of the sequence
06:27alexyakushevclgv: Thank you, it makes sense now
06:27alexyakushevOK, right, astore_1 doesn't consume the object on the stack
06:27alexyakushevThat was what I misinterpreted
06:27clgvalexyakushev: it looks pretty weird in the decompilers especially when they try to reconstruct java code
06:28alexyakushevclgv: Hell yeah it does https://www.refheap.com/85716
06:28clgvalexyakushev: it's a good heuristic to just filter out those null assignments to function parameters
06:29alexyakushevYeah, got it now
06:29alexyakushevThanks a lot for clarification
06:29clgvalexyakushev: did you search for performance problems?
06:29alexyakushevclgv: No, just experimenting with the compiler
06:30clgvah ok
06:30clgvalexyakushev: try out effects of type hinting and primitve type hints on function arguments ;)
06:32alexyakushevLooks disgusting:)
06:35clgvhuh? I just wanted to recommend interesting cases to look at ;)
06:52alexyakushevclgv: I mean, now I understand why wrongfully placed type hints actually hurt performance
06:57clgvalexyakushev: non-primitive type hints shouldnt do that. primitive ones might, if they cause continously boxing and unboxing
07:11colockhallo
07:11agarmancolock: hihi
07:11colocklaugh or salute? :D
07:12colockgently approaching the language… i think a lisp is a good thing to have on one's luggage
07:15noncom|2colock: lisp is the end of the journey
07:15clgvcolock: luggage? use it as train or airplane! ;)
07:15colockrighto
07:15clgvspacecraft even :D
07:15colocki put myself in the luggage
07:16agarmana couple recent movies may have changed people's connotations of ()
07:16colocknamely?
07:16clgvagarman: explain please
07:16agarmanhttp://yaleherald.com/wp-content/uploads/2014/04/shia-labeouf-nymphomaniac-movie-poster-revealed-03.jpg
07:17colockoh...
07:17colockwell, lamba now denotes a fps game…
07:17clgvagarman: lol what?
07:17colock*lambda
07:17agarmanI saw that poster and thought maybe it's a movie about lisp
07:17agarmannope
07:17colockagarman: nil
07:18agarmanposter is just ()
07:18agarmanon a white background
07:18noncom|2'()
07:21ddellacostahomoiconimaniac
07:21clgvagarman: you could photoshop it to be about a clojuremaniac ;)
07:21clgvddellacosta: or that :D
07:21agarmanthat'd be awesome
07:21agarmannot sure I could hang that in my cube at work still
07:21colockor photoshop the original and change "coming soon" to "coming too soon"
07:21colocksorry.
07:22ddellacostathat was a terrible joke. You're fired.
07:22clgvagarman: we have a door full of funny cartoons at the inner side of our office door ;)
07:23colocka classic… http://stevemiles70.files.wordpress.com/2008/11/software_treeswing.jpg
07:28clgvcolock: yeah. that's on the door ;)
07:29colock:>
07:30agarmanclgv: you have a picture of your door?
07:32clgvagarman: no
07:33clgvagarman: the main sites of the cartoons there are dilbert, xkcd, nichtlustig and various cartoons from different sources
07:34agarmanclgv: nichtlustig is new to me...gonna check it out
07:34colockgerman i guess
07:34clgvyeah it is german.
07:34clgvagarman: translated it means "no funny"
07:34clgv"not"
07:35colocktought that… the little german i did long ago was not completely useless…
07:36clgv:D
07:36agarmanhttp://static.nichtlustig.de/toondb/140508.html is funny no matter the caption
07:37clgvagarman: "and here is another charge forward package from the company antidot corporation"
07:38agarmanthe voodoo cake is funny as well
07:42clgvagarman: right. didnt know that one until now ;)
08:08TimMcHuh, the treeswing software metaphor cartoon has been around in various forms for 45 years. http://www.businessballs.com/treeswing.htm
08:24magnarsAnyone know why empty list are not falsy in Clojure, unlike most lisps? I know it's a futile thing to bring up, but it would be interesting to see the reasoning behind the choice.
08:24jcromartie'()
08:24jcromartieer
08:24jcromartie,'()
08:24clojurebot()
08:24jcromartie,()
08:24clojurebot()
08:25jcromartieI thought that one of those evaluated to nil
08:25jcromartiehm
08:25beamso,(if '() true false)
08:25clojurebottrue
08:25magnarsthe empty list is nil in other lisps, but not Clojure
08:25jcromartieyeah
08:25agarmanmagnars: it bugged me at first, but then I forgot about it
08:25jcromartieI think I largely ignore it because I use functions that call seq on the arg or destructuring, which does the same
08:26jcromartie,((fn [x & more] (when more x)) 1)
08:26clojurebotnil
08:26jcromartie,((fn [x & more] (when more x)) 1 2)
08:26magnarsagarman: it's been a year of full time work with Clojure for me now, and I have to say that it still bugs me some times.
08:26clojurebot1
08:26phillordhttp://clojure.org/lazy#Making%20Clojure%20Lazier--The%20victim%20-%20nil%20punning
08:27jcromartiewhat if we had a type system instead
08:27jcromartie:P
08:27agarmanyeah, I occasionally forget to (seq (rest xs))
08:27agarmanmostly I've tried to stick to using next
08:31agarman,(inc phillord)
08:31clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: phillord in this context, compiling:(NO_SOURCE_PATH:0:0)>
08:31agarman(inc phillord)
08:31lazybot⇒ 1
08:32agarmanphillord: I'd forgotten about that change
08:32phillordI am unknown in this context -- what a blow to my ego
08:32agarman,(def phillord)
08:32clojurebot#'sandbox/phillord
08:32agarmanthere no you're a different sort of unknown
08:33phillord,(declare agarman)
08:33clojurebot#'sandbox/agarman
08:33crispinhey. whats the clojure zip. putting a number of sequences together.. eg
08:33phillordand you are unbound...
08:33agarman,phillord
08:33clojurebot#<Unbound Unbound: #'sandbox/phillord>
08:34crispin(zip [0 1 2] [3 4 5]) => ([0 3] [1 4] [2 5])\
08:34agarman,(map + (range 5 15) (range 9 11))
08:34clojurebot(14 16)
08:35agarman,(map vector [0 1 2] [3 4 5])
08:35clojurebot([0 3] [1 4] [2 5])
08:35crispinhaha. map and vector. cool
08:35crispindidnt know map behaved like that with multiple seqs
08:35crispinthanks agarman
08:36noncom|2is there a clojure version of emacs?
08:36crispinI just use emacs :P
08:36crispinis the answer lighttable?
08:36crispinthats in clojure and is very emacsey
08:37crispina little emacsey
08:37crispinnothings quite like emacs though
08:37agarmanI use emacs live
08:37agarmanprelude is nice as well
08:37noncom|2hmm.. probably! but somehow i do not feel lighttable to be emacsey enough.. like all stuff in it you know.. :)
08:37agarmanhttps://github.com/overtone/emacs-live
08:37noncom|2currenly i am using live, and gonna research prelude later.
08:38mercwithamouthemacs live felt too heavy for me...though it was cool
08:38noncom|2i was just wondering, is there something like emacs but written in clojure with the C core of emacs being replaced iwth JVM
08:39mercwithamouthi'm liking the setup from braveclojure along with ac-nrepl, yasnippets and rainbow delimiters at the moment...and of course cider
08:39noncom|2taking all the jvm and concurrency wins, it would be a cool thing i think
08:39agarmanmy various emacs configs from the last few months are here: https://gist.github.com/agarman/9728389/revisions
08:40agarmanemacs-live was just simpler to explain to coworkers than my previous user.el file
08:52crispini found emacs24 + elpa + melpa + marmalade has stripped my .emacs way down
08:53crispinused to be a full repository
08:53crispinnow its about 20 lines
08:54crispini find cide-jack-in a little unreliable though
08:54crispinfirst time it jacks in fine
08:54crispinbut loose your repl somehow and when you jack-in again I get nrepl
08:54crispinnot cider
08:55crispinits wierd
08:55agarmancrispin: you probably have both cider and older version of nrepl installed
08:56crispini do yes
08:56agarmancrispin: remove nrepl
08:56crispini was using nrepl aswell
08:56crispinyeah ill try that
08:56agarmancrispin: cider replaces nrepl
08:57crispinyeah. i was just fiddling around. had difficulty getting cider to behave how I wanted
08:57crispinlike want to eval last s-exp is the repl buffer
08:57crispinnot in the minibuffer
08:58crispinand have stdout of repl in another seperate buffer
08:58crispinthat kind of thing
08:58crispinbut maybe I should just drink the kool aid and go all cider blessed route
09:04mpenetcider has come a long way, it's really nice now
09:05mdrogalismpenet: That's good to hear. I'll have to give it a go again.
09:05clgvwe should add some guiness to cider ;)
09:06mpenetI like the new error screen in particular
09:10phillordis cider 0.6 on marmalade?
09:11clgvcider on marmalade sounds awful ;)
09:11joegallophillord: "P.S. I'm having problems uploading the package to Marmalade for the millionth time. Not sure when (if ever) CIDER 0.6 will land there."
09:11joegallofrom the release notes for 0.6
09:11phillordbummer
09:11phillordoh, yes, I totally missed that
09:11joegallome too
09:11phillordhmmm, well, that's irritating
09:11mpenetmarmalade has been kinda unreliable lately...
09:11joegallompenet: yeah :(
09:11phillordI know
09:12phillordbut If I move to melpa, then I get too many bleed edge packages
09:12mpenetthere's melpa stable
09:12joegalloanyway, phillord, you can solve it by adding '("melpa-stable" . "http://hiddencameras.milkbox.net/packages/&quot;) to your 'package-archives
09:12phillordoh? there is?
09:12joegallompenet: you beat me to it :)
09:12mpenet:)
09:12dans@fortune
09:13mpenetbut I have been ok with cider master
09:13phillordprobably it was during the change over from nrepl, but life became unstable
09:13mpenetI am on cider-nrepl 0.7.0-SNAPSHOT, seems stable
09:13mpenet
09:13mpenetstable'ish
09:15phillord-ish isn't good enough for me -- I develop on five or six machines, so if I use unstable, they all end up on slightly different versions
09:16clgv,(def fortune (atom "Help! I'm a slave worker trapped in a Chinese fortune cookie factory."))
09:16clojurebot#'sandbox/fortune
09:16clgv,@fortune
09:16clojurebot"Help! I'm a slave worker trapped in a Chinese fortune cookie factory."
09:17colockahahah
09:19mmitchellI'm using prismatics schema and am wondering if it's possible to specify a schema on a record methods *return value*. Anyone know?
09:20beamsono idea about the specific answer to your question but there are pre and post assertions that you can put on a function
09:24clgvmmitchell: you can easily check that, since they would need a special defrecord macro to do that
09:24clgvsimilar to the special defn they have
09:25mmitchellbeamso: oh thanks, yeah i want to see if i can get the schemas working as an alternative to :pre/:post
09:25mmitchellclgv: I tried schema/defrecord, but it's throwing an exception
09:28clgvmmitchell: two possibilities - either you are using it incorrectly or you found a bug. the existing docs (hopefully) should help to find out
09:29mmitchellclgv: good points. I'll check the docs
09:47CookedGryphonIs there a way with a macro to read the column/line number metadata of the s-expression you're about to expand?
09:49llasram,(defmacro form-meta [& args] (meta &form))
09:49clojurebot#'sandbox/form-meta
09:49llasram,(form-meta (whatever))
09:49clojurebotnil
09:49llasramWell, maybe it works in a file :-)
09:49CookedGryphonheh
09:50llasramYeah, it does
09:50CookedGryphonooh
09:50CookedGryphontotally does
09:50CookedGryphonokay, think I know what I'm hacking on tonight...
10:04CookedGryphonllasram: sorry, what does the & do?
10:06crispin,(use '[clojure.string :only (join split)])
10:06clojurebotnil
10:06crispin,(def fname "some/path/to/file.txt")
10:06clojurebot#'sandbox/fname
10:06crispin,(last (split fname #"\."))
10:06clojurebot"txt"
10:07crispinwhats a better way to get file extension?
10:08colocklast + split seems quite good way to me…
10:08colockcould reverse and use first
10:09crispinthey're be the same speed on vectors?
10:09crispinfirst and last?
10:09pyrtsa,(last (split ".lein" #"\.")) ;; not quite right
10:09clojurebot"lein"
10:09colockwell, the reverse is costly.
10:33CookedGryphonI have a macro which takes multiple args, if I was using backtick syntax I'd do ~@body to replicate all the inputted body
10:33CookedGryphondoes that just wrap the things in a do? Or is there some other trick for outputting multiple forms
10:34joegalloCookedGryphon: https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L2386
10:35joegalloyou need the do explicitly, or you need to be inside something that already is an implicit do, like a try/catch or a let or fn or something
10:35cbpbody is a list of forms. ~@body splices that list, which means it basically concats it with whatever you're putting it into
10:38CookedGryphonyeah, seems `~@body doesn't actually work
10:39CookedGryphonyou can't do that at a top level and splice in more than one form as a result of a defmacro, which makes sense as a restriction
10:42llasramCookedGryphon: Yeah, just wrap it in a `do`. The compiler specially handles top-level `do`s, compiling each sub-form as if it were an independent top-level form
10:43nkozallasram: what's the difference for the compiler between a top-level form and a non top-level one?
10:43llasramnkoza: The basic unit of compilation is the top-level form. Each top-level form is compiled independently and serially
10:44llasramWhich is e.g. why you need `declare` for forward references, but also keeps the macro model simple
10:45nkozallasram: did the compiler works in this way? if you have a (def a 1) top-level form, a compile-time var is created with the 1 value, so you can access later from macros, etc, and when al vars are created by interpreting all the top-level forms, the compiler gets their values and "freezes" them?
10:47arrdemclojurebot: channels is <REPLY> (#clojure #clojure-offtopic #typed-clojure #leiningen)
10:51CookedGryphonis there a way to get a map of everything that's bound locally in a frame
10:51CookedGryphonso (let [x 2, y 7] (desired-function)) => {'x 2, 'y 7, ...}
10:52gfredericks,(defmacro locals [] (zipmap (map #(list 'quote %) (keys &env)) (keys &env)))
10:52clojurebot#'sandbox/locals
10:52gfredericks,(locals)
10:52clojurebot{}
10:52gfredericks,(let [x 12] (locals))
10:52clojurebot{x 12}
10:52CookedGryphonperfect!
10:52CookedGryphonthanks!
10:53arrdemgfredericks: what, you don'
10:53arrdemt write macros for internet points?
10:54gfredericksI have whole libraries that are just internet-point-macros
11:01whomphow do i add surrounding parentheses to the current outermost set of parentheses that my cursor is within? i often work from the inside out, and i hate type "(", having it create "()", and then deleting the extraneous paren and adding it elsewhere
11:01whomp*hate to type
11:02CookedGryphondepends on your editor, with paredit you'd press M-(
11:02CookedGryphonto wrap the next form
11:02CookedGryphonor do what you were doing and then press C-RightArrow to move the bracket to wrap the next form
11:07whompCookedGryphon, got it, thx :)
11:34servofor reseting a value in a ref is it better to use ref-set or use something like (commute my-ref (fn [x] some-constant-value))
11:34servowhere "constant" is (deref some-other-ref)
11:40noncom|2how is lighttable now? is someone using it for a daily job?
11:41arrdemI understand from cbp and others that Light Table is pretty much the go to tool for srs clojurescript work, but I haven't tried to use it for "real" clojure hacking due to having doubled down on emacs recently.
11:42cbpI replaced it with emacs after i figured out austin and weasel after that
11:46ddellacostaarrdem: why is it the go-to tool for serious CLJS work? Emacs serves me well for CLJS
11:46ddellacostaarrdem: but would be interested in hearing what's better about LT
11:47arrdemddellacosta: my understanding was that it packaged a lot of stuff that's finicky to get set up for emacs but I'm not speaking from experience here.
11:47ddellacostaarrdem: ah, okay, that I can understand the appeal of
11:47nullptri think brepls are finnicky across the board, but LT does make it easier to set up
11:48nullptr[emacs/*] + cljsbuild auto + [f5] is a reasonably productive cljs env with fewer oddities to sort through
11:48ddellacostayeah, I've been using a hacked together piggieback installation for some time in my main project and haven't tried setting it up from scratch with austin or anything recently
11:48ddellacostanullptr: yeah, that's what I use usually
11:49nullptrjust make sure source maps are off :)
11:49visof,(reduce conj {} (list {:words "hello"} {:words "world"}))
11:49clojurebot{:words "world"}
11:49ddellacostafast, simple, does most of what i need w/repl
11:49ddellacostaeven source maps are not that slow recently
11:49visofhow can i get somethig like {:words ["hello" "world"]}, if there is the same key
11:51clgvvisof: merge-with
11:51arrdemvisof: merge-with conj
11:51visofah
11:51clgvnope "conj" wont work
11:51visof,(merge-with conj {} (list {:words "hello"} {:words "world"}))
11:51clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to java.util.Map$Entry>
11:51clgvonly if you specify an empty map first
11:51clgv,(merge-with conj {} {:words "hello"} {:words "world"})
11:51clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IPersistentCollection>
11:52clgvharr not even then ;)
11:52visof,(merge-with conj (list {:words "hello"} {:words "world"}))
11:52clojurebot({:words "hello"} {:words "world"})
11:52clgvyou need to check wwhether you already have a vector there
11:53nullptr,(map :words '({:words "hello"} {:words "world"}))
11:53clojurebot("hello" "world")
11:53clgv,(merge-with #(if (string? %1) [%1 %2] (conj %1 %2)) {:words "hello"} {:words "world"})
11:53clojurebot{:words ["hello" "world"]}
11:53clgvvisof: ^^
11:54clgvcould be worth it to write a single function similar to merge-with that does that
11:54arrdemI'm sure flatland's util library already has one...
11:54clgvarrdem: never used that one directly ;)
11:54arrdem$google flatland useful
11:54lazybot[org.flatland/useful - Clojars] https://clojars.org/org.flatland/useful
11:55clgvarrdem: hu right no docs. thats a reason ;)
11:56arrdem$google flatland.org
11:56lazybot[Flatland.org] http://flatland.org/
11:56visof(merge-with #(if (string? %1) [%1 %2] (conj %1 %2)) ({:words "hello"} {:words "world"}))
11:56arrdemclgv: do you see my name on that list?
11:56visof,(merge-with #(if (string? %1) [%1 %2] (conj %1 %2)) ({:words "hello"} {:words "world"}))
11:56clojurebotnil
11:56arrdem:P
11:56clgvarrdem: no why?
11:57visof,(merge-with #(if (string? %1) [%1 %2] (conj %1 %2)) {:words "hello"} {:words "world"} {:nothing "nothing"})
11:57clojurebot{:nothing "nothing", :words ["hello" "world"]}
11:57visof,(merge-with #(if (string? %1) [%1 %2] (conj %1 %2)) {:words "hello"} {:words "world"} {:nothing "nothing"} {:words "foobar"})
11:57clojurebot{:nothing "nothing", :words ["hello" "world" "foobar"]}
11:57clgvvisof: if you need it to operate on lists use (apply merge-with ...)
11:57visofyeah okay
12:01gfredericksamalloy_: here's a feature for the def-utils lib -- things for defining functions point-free but still getting useful arglists AND function class-names
12:06sandbagsanyone run into problems with tagged literals in test code? I'm not sure how to narrow this down but my reader function is coming up as an unbound function in my test where the same code in the REPL is working. I realise it's a bit vague but if this pings for anyone I'd appreciate a nudge in the right direction or useful questions...
12:09llasramsandbags: Is your test namespace `require`ing the namespace which provides the tagged literal data reader function?
12:09sandbagsllasram: yep
12:10llasramThat's the only issue I can think of off the top of my head... Code/paste?
12:11gfrederickssandbags: keep in mind how code is read/evaluated
12:11gfredericksyou need to make sure the namespace defining the reader function is finished loading before _any_ uses of your reader literal are read from your code
12:12sandbagsgfredericks: okay, is it not finished after the :require part of the ns?
12:12gfredericksit should be, yes
12:12gfredericksthis isn't normally difficult to get right
12:12sandbagsbecause my use is after the :require
12:12sandbagsi'm just assembling a paste of the relevant stuff
12:12sandbagshopefully i've just done something daft
12:12llasramMADNESS is GLADNESS
12:13CookedGryphondoes anybody have a clue how I might walk a tree extracting the metadata
12:13gtrakllasram: atlanta weather getting you down?
12:13CookedGryphonpostwalk and anything I roll by hand with recursive maps seems to lose the metadata past the top level
12:14sandbagsokay hopefully i didn't elide anything important: https://www.refheap.com/85727
12:14CookedGryphonI tried redefining clojure.walk/walk to create new structures and reattach the metadata of the parent, but it doesn't seem to work
12:14llasramgtrak: Actually, it's *gorgeous*. It's at that perfect point where everything is sunny, but not yet heat-stroke-inducing
12:14gtrakis everything covered in a layer of yellow yet?
12:14llasramgtrak: Oh, that's passed already
12:14sandbagsoh, i forgot to add the exception
12:15llasramsandbags: Oh, cljx. Hmmmm
12:15sandbagsokay i've resaved the paste with the exception
12:16sandbagsI don't get the impression this is CLJX related
12:16sandbagsthe CLJX part has to be out of the way in order for the CLJ code to be running
12:16sandbagsand the relevant CLJ code is all there in my targets/ folder
12:17llasramCheck the generated CLJ code, see if anything got weirded?
12:17sandbagsalso, if i require from the REPL and use my tagged literal it does work
12:17llasramI just haven't used cljx and don't know how it handles reading tagged literals
12:17sandbagsCLJX is a pre-processor
12:17llasramRight, but it pre-processes Clojure data, right?
12:17llasramWHich means it needs to `read` the code?
12:18sandbagsyes
12:18sandbagsnothing weird about my data_readers.clj
12:18sandbagsother clj files look as expected
12:19sandbagsAFAICS the CLJX pre-processor has emitted good code
12:19llasramok
12:21llasramhmmm
12:21sandbagsas you can see (https://www.refheap.com/85728) from REPL all appears okay
12:24llasramI don't know what's happening here. I've done very similar stuff w/o problem
12:25sandbagsokay, do appreciate you taking a look for me, thanks
12:26sandbagsat least i know it *ought* to work :)
12:26llasramProbably unrelated issue -- your `emit-entity` function is returning a form which evaluates to an Entity instead of a Entity value itself. Because the expansion happens at read-time, you can end up with weeeeirdness when then passing that form to e.g. threading macros
12:27sandbagsi'm afraid that's a little bit monkey-see monkey-do as i cribbed the code from the Clojure source for #uuid
12:27sandbagsi did wonder about it returning a form
12:27sandbagsbut i'm still new enough to clojure that i kind of glossed over it :)
12:28llasramIt looks to me like `default-uuid-reader` returns a UUID object itself... Where does it return a form?
12:28sandbagshrmm... possibly i cribbed that from somewhere else
12:28sandbagsi definitely wouldn't have done it myself as i would have naturally returned the Entity
12:28llasramkk
12:28sandbagsi'll change that
12:28sandbagsit took me a few goes to figure out how to setup tagged literals
12:29llasramAlso consider not using tagged literals. They're mostly only useful if you're slinging around EDN data
12:29Viestiblah, got hit by this: http://dev.clojure.org/jira/browse/CCACHE-15
12:29llasramAnd they're great then, but not amazingly useful otherwise
12:30gfredericksllasram: I had fun using them for chessboards
12:30sandbagsyes i'm mainly playing with them to see if it's a nicer
12:30llasramsandbags: Gotcha
12:30Viesticore.cache and core.memoize are really neat with pluggability, but sligthly sad that ttl cache performs poorly :/
12:30llasramgfredericks: Oh?
12:30sandbagsi kind of wanted to avoid needing the user of the library to know about Entity type & id's
12:30gfredericksllasram: #chess/fen "rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1"
12:31sandbagsbut, at the same time, i want a way to distinguish entity id's from other values
12:31llasramsandbags: For users in code, calling a function is pretty much identical
12:31gfredericksllasram: makes it sooper easy to copy/paste from other tools
12:31llasramgfredericks: Iiinteresting
12:31sandbagsyes i considered (entity "foo") as an alternative
12:31sandbagsbut wondered if #entity "foo" was more expressive
12:31gfrederickssandbags: I think reader literals setup in libraries might be frowned upon
12:32gfredericksbut I'm not 145383% sure about that
12:32sandbagsmy presumption was that, namespaced, it should be a non-issue
12:32sandbagscertainly if i was claiming #entity i would expect to be slow-roasted :)
12:33llasramJust don't use a short generic namespace like `db` and you'll be fine ;-)
12:33sandbags:)
12:33sandbagsi'm not sold on the reader literal
12:33sandbagsbut i do kind of like the clarity
12:33gfredericksI don't remember what happens if you have multiple data_readers.clj on the classpath
12:33sandbagsesp. when printing out values
12:34llasramgfredericks: It loads them all, and as of 1.5.1 only complains if the same literal is assigned different reader vars
12:34hiredmangfredericks: datomic does it, it must be fine...
12:35llasramgfredericks: And as of Leiningen 2.3.3, lein will merge data_readers.clj files when building an uberjar. So I don't really see any difference from use of namespaces+bases for normal code
12:35sandbagsman if something could just be done about clojure startup time....
12:35gfrederickshiredman: ooh I forgot about that; I'm convinced now.
12:35arrdemsandbags: several things being done about it :P
12:35sandbagsarrdem: i r pleased to hear so
12:35gfredericksfor example, lots of people are waiting for the jvm to startup
12:35sandbagswhen you're struggling to get a lein command running and try it over and over ... ;-)
12:38sandbagsin the normal course of events is there something that could cause a function to be unbound?
12:38sandbagsi mean without calling some hypothetical (unbind-fn 'my-fn)
12:38sandbagsi'm calling other functions from this namespace in the same code....
12:39gfredericks"calling functions" happens at a different time from reading your code though
12:39gfredericksif you minified this into a bare project with just enough to repro, you could share the whole project
12:41sandbagsokay well i can confirm that changing emit-entity to return an Entity rather than a form that return an Entity does not fix the problem, alas
12:41sandbagsgfredericks: your point is too subtle for me ... i mean code on adjacent lines is read at the same time right?
12:41sandbagsif this function is unbound, why are the others bound?
12:42arrdemsandbags: no. forms are read sequentially.
12:42arrdemsandbags: preceding forms are read and evaled first
12:42sandbagsarrdem: i mistyped
12:42gfrederickssandbags: e.g.
12:42gfredericks(my/fn #my/reader "123")
12:42gfrederickslet's say my/fn is defined in the same namespace as your reader
12:43gfredericksthe reader function will get called (and will have to have been defined) much earlier than the my/fn
12:43gfrederickssandbags: what testing library are you using?
12:44sandbagsgfredericks: Jay Fields expectations
12:44gfredericksif expectations was doing something crazy like trying to read all your tests before doing anything else...
12:44sandbagshrmm... interesting point
12:44sandbagsi'm still grokking what you wrote above
12:45llasramHmm. Are you using `lein test`, or an expectations-specific plugin?
12:45sandbagswhen you say "much earlier" you mean i.e. it's called during the reading phase, not the eval phase?
12:45gfredericksright
12:45sandbagsokay thanks
12:46sandbagsso yes that kind of suggests this may be about expectations trying to read the code up-front
12:46sandbagsi wonder if Jay is up, if not i may have to read the code :)
12:46gfredericksbut under sane conditions this should not be an issue as long as you're requiring at the top of any file that uses the literals
12:46gfrederickshe was up earlier this morning
12:47gfrederickson the tooters
12:47sandbagsindeed he seems up and about
12:49arrdem,(name :ast/forms)
12:49clojurebot"forms"
12:49arrdem,(let [{:keys [ast/forms]} {:ast/forms :foo}] ast/forms)
12:49clojurebot#<CompilerException java.lang.RuntimeException: No such namespace: ast, compiling:(NO_SOURCE_PATH:0:0)>
12:51llasramsandbags: Are you using the lein-expectations plugin?
12:52sandbagsllasram: lein autoexpect
12:54llasramsandbags: data reader literals are incompatible with reloading namespaces
12:54llasramAt least, they are incompatible with reloading namespaces by destroying the namespace and re-creating it
12:55llasramNot 100% certain that's what's going on, but is my guess *digging*
12:55sandbagshrmm... i hear but do not understand, is there something i could read about this?
12:56llasramsandbags: I guess the data readers source code... I'm not aware of any documentation
12:58sandbagshrmm... i just bounced off that code
13:00sandbagsbut i guess i am only seeing the def code, rather than where it's actually working?
13:00llasramWell, the gist is that the data_readers code embeds a reference to the var in the *data-readers* map
13:00sandbags(i'm looking at core.clj:6945)
13:00sandbagsokay yes i see that
13:01llasramAnd then... still digging in the tools.namespace code...
13:01sandbagsthis is a map inside of clojure.core right?
13:01llasramright
13:02jdludlowI'm reading http://clojuredocs.org/clojure_core/1.2.0/clojure.core/require -- Why does require use a single quote, but (ns … :require) skips the quote?
13:02llasramAh hah. So tools.namespace reloads namespaces by removing the namespace then re-creating it: https://github.com/clojure/tools.namespace/blob/master/src/main/clojure/clojure/tools/namespace/reload.clj#L21
13:03llasramActually, that doesn't explain anything
13:03llasrambah
13:03llasramOk, I'm still not certain exactly what's going on :-)
13:04llasramBut I'm well convinced that the reloading machinery is the source of the problems
13:04sandbagsheh... you're persistent though, i like that :)
13:05sandbagswhat was your hypothesis?
13:05llasramOoooh! IT does explain everything!!!!
13:05sandbagssomething about the var referring to a function that is now gone?
13:06llasramOk, so usually namespaces are created on-demand and never removed
13:06llasramWhen clojure.core is first loaded and initialized *data-readers*, it creates namespaces and vars for all the referenced reader functions, which will be at that point unbound
13:07llasramNormally, when you then load a namespace, if the namespace object already exists, it just creates/updates the bindings for vars in the namespace
13:07sandbagsso it creates a 'fate.core ns and puts a Var in it that will be bound to my emit-entity function?
13:07llasramYes, when the namespace gets loaded
13:08llasramBut the tools.namespace reload code is destroying the namespace itself, and creating a new one to then load code into
13:08sandbagsok
13:08llasramThe *data-readers* map is left holding a var in a namespace object which no-one else can see, and never gets new code loaded into it
13:08gfredericksis this all stuartsierra's fault?
13:09llasramyes
13:09sandbagsbut wouldn't the NS have been loaded (and the function bound) before the NS got reloaded?
13:09sandbagsshouldn't the Var still be holding on to a function
13:09gfrederickscould tools.namespace have some extra data-reader-refreshment logic built in?
13:09sandbagsor does a var not preserve what it points at
13:10llasramsandbags: Normally yes, but the autoexpect plugin is loading the namespace entirely through the tools.namespace reload plumbing, which destroys the namespace first
13:10sandbagswhat i am blindly reaching towards is shouldn't the Var have been bound once, when the NS was loaded
13:10sandbagsOh!
13:10sandbagsthe NS is never loaded normally you mean
13:10llasramExactly
13:10sandbagsso the NS created by the data-readers code gets blasted away
13:10sandbagsbefore the Var is ever bound
13:10llasramExactly again
13:10sandbagsI'm going to say "I see"
13:10llasramgfredericks: I believe so
13:11sandbagstake that with a pinch of salt
13:11sandbagsI see!
13:11llasramheh
13:11sandbagshrmmm
13:11sandbagswell, first, bravo
13:12sandbagsi guess this is an issue for autoexpect not expectations itself
13:12llasramyep
13:13llasramWell, really IMHO it's a bug in tools.namespace, but autoexpect is your proximate problem
13:13sandbagsyeah, i see where he is using the tools.namespace
13:13sandbagsso
13:13sandbagshand me my smock, torch, and pitchfork
13:13llasram:-)
13:14llasramHave fun storming the castle!
13:14llasramWith my lunchtime good deed done, I should probably get some actual work accomplished...
13:14sandbagsllasram: many thanks
13:14sandbagssterling detective work
13:14llasramnp!
13:14sandbagsand i even learned something!
13:16gtrakI learned 'I want feature expressions'
13:17sandbagsgtrak: is that equiv to the +clj +cljs stuff from CLJX?
13:17gtrakyea, but it doesn't exist yet.
13:17gtrakin clojure, anyway
13:17sandbagsright
13:18sandbags<-- uses CLJX for this reason
13:19sandbagsarrdem: don't rule out the possibility that it may be both :)
13:19sandbagsit works surprisingly well
13:20sandbagsbut no doubt i'd rather clojure supported this out of the box
13:20sandbagsthe major downside i have right now is that there's no easy interaction
13:20sandbagsbetween generating CLJX and running tests
13:31cbp(inc llasram)
13:31lazybot⇒ 24
13:47arrdemdae consider the absence of `clojure.core/atom?` a defect?
13:49technomancyI'd rather have ideref? than atom?
13:49michaelr525hi
13:52llasramditto re: ideref?
13:53michaelr525after going back using c-x c-spc how can i go forward to the
13:53michaelr525 location I was at before going back?
13:59agarman(defn ideref? [x]
13:59agarman (or
13:59agarman (instance? clojure.lang.IRef x)
13:59agarman (instance? clojure.lang.IPending x)))
13:59boblarrickmichaelr525: c-u c-space ?
14:00agarmanor I guess just (instance? clojure.lang.IDeref x)
14:00michaelr525boblarrick: this one goes back to previous location, right?
14:01boblarrickyep
14:01michaelr525boblarrick: well, what I'd like to have is the thing which goes forward (back to the location where I were before I went back using c-u c-spc).
14:02agarman,(def deref? #(instance? clojure.lang.IDeref %))
14:02clojurebot#'sandbox/deref?
14:03llasramagarman: It's not that it's difficult. It's that it would be useful in core :-)
14:03agarmanI agree
14:04agarmanbut it's like unfold, fix and other functions I miss from Haskell that aren't included because they're easy to implement
14:05agarmanof course I'm not sure how instance? stuff would work with cljs
14:05Jaoodagarman: are you using clojure instead of haskell because of the jvm?
14:05agarmanpretty much
14:05agarmaneasier to find teams working on JVM than on Haskell
14:06Jaoodthat seems to be a common reason
14:06agarmanJaood: I prefer the pragmatism of Clojure. And the lack of an ivory tower as well. :-)
14:08Jaoodagarman: I though Haskell was already pass that :)
14:08agarmanJaood: sadly, it's history causes it problems...at my previous employer, a coworker refused to use MVars because he wanted to do it the "right" way
14:10agarmanJaood: existential quantifiers & state transformed readers & writers make it easy to find the bugs...but you can write the same thing with MVars much faster
14:14whodidthisanyone written anything about tellman/automat yet?
14:15Jaoodagarman: a victim of its past I guess, don't really know haskell, just have skim a little through it, their type system does look like it empowers greatly the dev as they say
14:16Jaoodagarman: was curious about your clojure over haskell choice, since most common reasons seem to be the jvm and learning curve
14:18amalloyagarman: wait, fix isn't easy to implement in clojure
14:18amalloyit's like impossible
14:18cbpfix?
14:20arrdemamalloy: pray tell why? the definition of fix is nigh idiot proof.
14:21agarmanamalloy: about as simple as my deref? function above
14:21llasramThis? http://en.wikibooks.org/wiki/Haskell/Fix_and_recursion
14:22TravisDHmm, seems like the definition of fix from haskell relies pretty heavily on lazyness
14:23agarmanJaood: Haskell is awesome, but people can get pedantic about purity & the "right" way. Even if it means taking 10x longer to solve something trivial
14:23TravisDon the up-side, I'm relieved that I /finally/ understand how fix actually works in haskell, lol
14:23agarmanlol
14:24gfredericksHaskell: write once, get cabal compile errors everywhere
14:25arrdemheh
14:25amalloyarrdem, agarman: because fix only works if function application is non-strict
14:26amalloyright?
14:26TravisDamalloy: You also need sharing, no?
14:26technomancythis is different from useful's fix?
14:26amalloytechnomancy: talking about functions missing from haskell
14:26Raynesgfredericks: Hahahaha +111
14:26arrdemoh good useful has a fix implementation. I could use a better one...
14:27amalloyi'm surprised you remember flatland.useful.fn/fix, technomancy. i didn't think anyone but me liked it
14:27gfredericksRaynes: where in tarnation have you been
14:27technomancyamalloy: trying to remember what part of lein used that
14:27adsiscohow do you convert nested list into vectors?
14:27adsisco(partition 2 (vec (distance-list)))
14:27gfrederickstechnomancy: leiningen.haskell
14:27Raynesgfredericks: The middle of nowhere in Mexico.
14:27adsiscothe partition still returns a list
14:28gfredericksadsisco: why do you need vectors?
14:28technomancythe debianistas asked me to remove it since there were only three useful vars being used and they didn't want to have to package tools.macros or whatever just for that
14:28RaynesBUT I HAVE RETURNED!
14:28adsiscogfredericks: writing them into csv
14:28RaynesTad ill, but I'm alive.
14:28amalloyoh yeah, i remember that
14:28adsiscogfredericks: using data.csv lib
14:28technomancyI wonder what happened to them anyway
14:28gfredericksadsisco: that doesn't sound like something that would require vectors
14:28arrdemtechnomancy: amalloy: oh that's a nice fix!
14:28technomancysupposedly they were kinda close to getting it through
14:29amalloytechnomancy: https://github.com/technomancy/leiningen/commit/0f8d67d2e37
14:29adsiscohttps://www.irccloud.com/pastebin/vlCvE8Jc
14:30adsiscolazyness at work? i have to eval them somehow?
14:30gfredericksadsisco: you're trying to embed a vector as a single cell?
14:31amalloylooks like you used fix to parse project.clj and homogenize :foo x with :foo [x], technomancy
14:31hiredmanadsisco: that is what toString returns for lazy sequences, realized or not
14:31hiredmanadsisco: you have to use pr-str to get a readable printed representation
14:32technomancymap-vals <3
14:32adsiscohiredman and gfredericks: i am not sure i get you all ...
14:32gfrederickstechnomancy: I use map-vals all the time no matter what amalloy thinks
14:33pyrtsa,(let [xs (range 3)] [(str xs) (pr-str xs)]) ;; adsisco
14:33clojurebot["clojure.lang.LazySeq@7480" "(0 1 2)"]
14:33technomancygfredericks: keeping the dream alive
14:33gfredericksplumbing also has map-from-keys and map-from-vals
14:33arrdemgfredericks: nice!
14:34gfredericksand just yesterday I found a use for group-by-fn
14:34gfrederickswhich I think I want quite often
14:34adsiscohttps://www.irccloud.com/pastebin/Bqrynch3
14:34amalloygfredericks: map-from-keys is what? something like (zipmap ks (repeat v))?
14:34adsiscoso i guess i just have to wrap a pr-str?
14:34technomancywhat's the difference between group-by and group-by-fn?
14:35pyrtsaadsisco: Wrapping the result from partition with (vec ...) might work too.
14:35gfredericksadsisco: that code will give you a single row, no matter how long distance-list is -- is that what you're going for?
14:35gfredericksamalloy: no (zipmap ks (map f ks))
14:35gfredericksmap-from-vals effectively lets you make a uniq index from a collection
14:36wei__looking to do immediate mode graphics in clojurescript. any library recommendations? something like Om but for svg/canvas/webgl would be awesome
14:36cbpOm can work with svg
14:36amalloyi think useful has that somewhere? ninjudd was doing that all the time
14:37amalloyyeah, flatland.useful.map/map-to
14:38adsiscohttps://www.irccloud.com/pastebin/ktnOZxtN
14:38amalloyand index-by was the other direction (i guess map-from-vals)
14:38pyrtsaadsisco: (mapv vec (partition ...))
14:38gfredericksamalloy: yeah that's what I called it originally too
14:38adsiscohttps://www.irccloud.com/pastebin/lXzh2u4l
14:39gfredericksadsisco: call (mapv vec (partition 2 ...))
14:39adsiscopyrtsa: mapv works perfectly
14:39adsiscothanks guys!
14:40adsiscoi'm learning some new useful function everyday =) yesterday someone introduced me to partial, it was magical
14:40wei__cbp: I’ve tried Reagent with SVG and the framerate is too slow with 100+ elements. maybe I’m doing something wrong? I assumed React.js wasn’t built for game graphics
14:42adsiscogfredericks: you were right about the single row, what happened?
14:43cbpwei__: yeah.. I can't help you there sorry
14:43gfredericksadsisco: you have the vector literal there, ensuring that the arg you're passing is a vector with one thing in it
14:43gfredericksmy guess is you just want to remove those square brackets
14:44gfredericksand at that point you might not need (mapv vec ...) anymore
14:44CookedGryphonCan anybody give me a pointer how I might do something like a trace macro on some code which contains recurs?
14:45CookedGryphonI want to have a side effect print out the value of each s-expression as it completes by wrapping the s-expression in some code which evaluates, prints and then passes on the new value, but that falls down for recur, where the recur is no longer in the tail position
14:45adsiscogfredericks: how do i fix it?
14:45gfredericksadsisco: remove your square brackets
14:45Bosky101hello world.
14:45Bosky101whats the emacs shortcut to compile clojure
14:46turbofailCookedGryphon: it doesn't make sense to trace the value of a "recur" form
14:46adsiscogfredericks: great!
14:46adsiscoBosky101: C-c C-k ?
14:47CookedGryphonturbofail: fair point, I guess I should do some analysis to ignore forms for which this doesn't make sense... are there any others you can think of where a form isn't returning a value?
14:47llasramBosky101: If you hit C-h m, you should get a list of all the bindings provided by all the active modes in a buffer
14:47turbofailCookedGryphon: (throw ...)
14:49amalloyCookedGryphon: i'll be impressed if you can even detect all s-expressions which have a value
14:50amalloythe only solution i can think of is to use tools.analyzer, which seems a bit overkill but what do i know
14:50gfredericksclojurebot: tools.analyzer is a bit overkill but what do i know
14:50clojurebotAck. Ack.
14:51arrdemgfredericks: how so? t.a.jvm is potentially the only way to do so depending on the value.
14:51gfredericksarrdem: I don't have any opinions of my own I'm just teaching the bot new knowledge
14:52CookedGryphonamalloy: yeah, perhaps I sohuld be looking at tools.analyzer
14:52dbaschclojurebot: I don’t have any opinions of my own
14:52clojurebotPardon?
14:52gfredericksclojurebot: I |don't| have any opinions of my own
14:52clojurebotAlles klar
14:52amalloyCookedGryphon: i think you should be looking at something more targeted than "log the value of every expression that's evaluated"
14:53llasramclojurebot: I?
14:53clojurebotI don't have any opinions of my own
14:53CookedGryphonamalloy: I disagree, I want to pump that out as data with the location of the forms in the file, and then have an after-the-fact step through debugger
14:53gfredericksamalloy: CookedGryphon: sounds like that could get quite noisy if you do it after macroexpansion
14:54CookedGryphonamalloy: at which point I can hide all the noise with interface, but have it there if it proves useful
14:54CookedGryphontaking the profiler approach of dumping everything I know to a file then exploring it
14:55amalloywell, it's a cool idea. you've surprised me by making me think that logging every sexp's value might be a good approach
14:55amalloyalthough as gfredericks says, macros make it pretty hard
14:56amalloywhat do you do with (for [x (range 10) y (range x)] (+ x y))?
14:56amalloyor, god forbid, just (first (range))?
14:56CookedGryphonlet's find out...
14:56CookedGryphon(it should be limited by print-length)
14:57gfredericksa reader literal for truncated seqs!
14:57amalloyprint-length is fine, but for a stepping debugger i would find it maddening to be unable to look past the fifth (or whatever) element of a sequence
14:57gfredericks#truncated-seq (1 2 3 4) ==> (concat '(1 2 3 4) (lazy-seq (throw ...)))
14:58CookedGryphonamalloy: yeah, well you have options then, set print-length to an appropriate length for whatever you're debugging...
14:58CookedGryphonor have it run in the same process as your ongoing program then you can evaluate more as required
14:58gfredericksI get a lot of mileage out of having a debug-repl
14:58CookedGryphonthere's not a lot else you can ask of the program beyond that
14:58gfredericksyou can't step through things, but you can manually evaluate whatever comes next
14:59CookedGryphonbut yeah, i'm dumping locals too at each point which is a nice sanity check
14:59amalloyi still wish we had a real debugger
14:59CookedGryphonsohuld be able to turn this into an edebug like experience (but with a step backwards function)
15:02CookedGryphonamalloy: anyway, it works pretty much as I'd expect for your range example above
15:02CookedGryphonit doesn't try and evaluate the range
15:02CookedGryphonit doesn't do any evaluation which your program doesn't do anyway
15:02gfredericksum
15:03gfrederickshow do you serialize it then?
15:03CookedGryphonwait, sorry, I'm talking rubbish
15:05CookedGryphonbut yeah, it's fine with print-length set
15:06CookedGryphonand given that this is intended for debugging code paths etc. I think that'd be fine
15:06CookedGryphonyou very rarely want to look in detail at all the elements of a 100+ element vector
15:06CookedGryphonand in the case that you do, you should probably explicitly say so
15:09CookedGryphonbut yeah, this recur problem is a fairly fatal one, I don't know how I would rewrite for example (defn sample [x] (if (= x 0) :foo (recur (dec x)))
15:10CookedGryphonbecause I can't then wrap the if form without buggering up the recur, it's not as simple as not wrapping the recur form directly
15:10pkothbauerHi! Regarding core.logic: any tips on tutorials or gist for how to use pldb instead of defrel and facts would be super appreciated. I'm just getting started with core.logic and clojure.
15:11arrdemCookedGryphon: is there some reason you're trying to do a trace macro rather than just building a full single step linked environment interpreter for Clojure?
15:11arrdema full interpreting debugger shouldn't be too hard for single thread programs...
15:12CookedGryphonwell for a start, I wanted something at macro time so I link into the lexical representation, so I can debug what I see, rather than what it expands to
15:13CookedGryphonmy motivation for this was a particularly hairy go-block in core.async
15:13CookedGryphonfor which it worked a treat, then I tried using it with a go-loop
15:13CookedGryphonand yeah, my program isn't single threaded...
15:15amalloyCookedGryphon: i mean, you can rewrite that. it's not impossible, just ugly
15:15CookedGryphonand yeah, I don't always know what I'm looking for when I start looking at code, if I record everything then step through *that*, I can go back and look at things from earlier which i didn't realise were important at the time
15:15CookedGryphonwithout having to re run the entire thing and work out at what point I need to take note of locals, etc.
15:15CookedGryphonmakes more sense to me to record everything then explore it
15:16arrdemfair enough. just a thought.
15:16CookedGryphonI have to head off soon, but I could put what I have into a gist if anyone's interested
15:16amalloy(defn sample [x] (let [[action value] (if (= x 0) [:return :foo] [:recur (dec x)])] (if (= action :return) (do (log "returning") value) (do (log "recurring") (recur value)))))
15:16cbpCookedGryphon: sure
15:21TekhneI'm new to functional programming, and I'm writing some code which feels like it's a pattern that people have already written. I need to if it is and what it's called, if it has a name. The pattern: take a value and pass it through a series of funcs, each taking in the output of the last, but if any function changes the value, then the rest "short circuit" and the first changed value is returned from the end of the chain.
15:22amalloyTekhne: it doesn't sound like any function is actually taking the output of the last
15:22TekhneThe reason I need to know if there's a name for this pattern is so that I can go look it up and see if my naive code can be improved.
15:23duck1123Hello all. I am trying to get my Java/Clojure project (built with Maven) working with LightTable, but can't seem to get it right. When I launch my nRepl server (by loading a url) with the lighttable-ops handler, I get an error trying to load the cljs deps. Is there a way I can just get this to not use CLJS? https://gist.github.com/duck1123/b58a367f5e54412a6907
15:23stuartsierraTekhne: the only similar example I know is when one of the functions returns nil. In Clojure, that's `some->`
15:23Tekhneamalloy: I'm sorry. I'm probably not explaining this very well.
15:23amalloyyou're sorta implementing (defn first-change [x fs] (drop-while #(= % x) (for [f fs] (f x)))), Tekhne
15:23technomancyseems like (or (some-> val fns) val) would do the trick
15:24technomancyoh never mind; misread
15:24amalloythat is: because if any function "changes" the value being returned you stop calling other functions, you only ever call a function with the original input x
15:27amalloycertainly this isn't some common pattern i've heard of before; i don't know where you'd look up exemplar implementations
15:27nkozaTekhne: what information do you want? what function changed the data or you are doing this because the functions are making side-effects?
15:27Tekhneamalloy: I have a date in a string, and I want to pass it through a series of funcs which will transform the date into the "standard" format I need if the func understands the format of the original string. If any of the funcs should actually recognize and xform the original date, then I want the rest of the funcs to "turn off". I'm accomplishing this now with reduce, a "manager" func which knows if a date was recognized, and a collection of xform funcs. Maybe
15:29amalloyTekhne: right, that's just (first (drop-while not-recognized? (for [f recognizers] (f input))))
15:29CookedGryphonHere's my gist for anyone who wants a look (cbp, amalloy, arrdem) https://gist.github.com/AdamClements/e89cfe659be08abf2710
15:29Tekhneamalloy: okay, cool. I'm trying to understand what you wrote there (I'm pretty new to Clojure and trying to apply some Clojure ideas in my JavaScript).
15:30CookedGryphonthere are many flaws with the implementation, but I think the idea of recording the result of every s-exp and then exploring the data afterwards is sound
15:30Tekhneamalloy: ah, okay, so you're exploiting Clojure's lazy eval, right? That probably won't work for me directly in JavaScript.
15:30Tekhneamalloy: ...but maybe I can work around that problem.
15:31amalloyaren't you writing clojurescript?
15:31amalloyor you're just writing js and came to #clojure to ask for ideas?
15:31Tekhneamalloy: I truely wish, but my team is using JavaScript. I'm really the only one who's learning Clojure.
15:32Tekhneamalloy: Yea, just asking for ideas because I know y'all are very functional-savvy.
15:32amalloywe are, but javascript isn't
15:32Tekhne...and since I know some Clojure now.
15:32Tekhneamalloy: haha, true.
15:33amalloyin js i think you'd do best to just use a for/in with an early return
15:34nkozaTekhne: what about: (first (drop-while #(= % original-value) (map #(% original-value) [f1 f2 f3 f4])))
15:34Tekhneamalloy: Yea, I'm sure. I already have an imperative version of this that works, but I was trying, as an experiment, to create a functional version.
15:34amalloynkoza: that's the version i wrote twice already :P
15:34nkozaamalloy: ahh, didn't see it :)
15:36nkozabut maybe it has a problem, it the functions will raise an exception with wrong input, then the chunked-seq behaviour will crash it
15:36Tekhneamalloy: well, thanks for the ideas. I'll have a look and try to grok what you posted. Seems like this isn't a "standard" pattern, though, which is also good to know.
15:37nkozaso maybe is better to use reduce/reduced
15:37Tekhnenkoza: I'm using moment.js to parse out dates, so I'm checking validity with .isValid(). I don't think moment.js will raise an error if the date can't be parsed.
15:38Tekhnenkoza: my current solution is using reduce from lodash.
15:39nkozaTekhne: in clojure you can short-circuit reduce by using 'reduced' (a recent addition to the language), don't know about lodash
15:39Tekhnenkoza: oh cool. I hadn't heard of that.
15:39noncomis there a difference in time between defererencing an atom and a ref?
15:40noncom*time cost
15:44llasramSure -- it takes waaaaay more time to think of situations where you actually want refs
15:44TekhneThanks for the help.
15:45noncom:)
15:49thecontrarianI have a clojure java interop question
15:49thecontrariani have a java class with a public static interface inside it
15:50thecontrarianhow do i get at that interface from within clojure?
15:50amalloythe interface's name is class$interface
15:50thecontrariancool let me try that
15:50thecontrarianthat didnt work
15:51thecontrarianthe class is Emitter and the interface is Listener
15:51amalloyyou have to import it, just like any other class
15:51thecontrarianand i did Emitter$Listener
15:51thecontrarianoh you mean i import Emitter$Listener?
15:51amalloyfoo.bar.Emitter$Listener
15:51amalloyyes
15:51thecontrarianooh ok
15:51amalloyit's not related in any way to the Emitter class
15:51amalloyit is its own class, with a name that includes Emitter
15:52thecontrarianawesome, that worked thanks
16:01thecontrariananother quick question
16:01thecontrarianso my interface implements one method, call
16:01thecontrarianreturns void, takes in Object... args
16:02thecontrarian1. how do i return void in clojure?
16:02amalloyno such thing as Object... really. to the jvm, that's just Object[]
16:02thecontrarianso it would be a single arg method?
16:02amalloyyes
16:03thecontrariannot [& _]?
16:03noncomno
16:04thecontrariank
16:04thecontrarianis there anything special about specifiying the method name in a reify?
16:04thecontrarianwould it just be call?
16:04thecontrarianor Call?
16:04noncomcall i think
16:04thecontrarianhmm
16:04noncomavoid unjavaish characters is all i can think of
16:05thecontrarianok and what about the return void thing?
16:05noncomlike ! ? and other
16:05thecontrarianok and what about the return void thing?
16:05amalloythecontrarian: the compiler knows what type you're expected to return, and will emit the right bytecode
16:06thecontrariank cool. thanks you two. excellent support, super greatful
16:06noncomdo not use hyphens in the names also
16:06amalloynoncom: you seem to be answering questions nobody is asking
16:06noncomthecontrarian: and one more thing just for you to know - the optional arguments - that happen after the & are purely clojure feature
16:07noncomamalloy: that's ok, sometimes i speak to imaginary people..
16:07thecontrarianok cool
16:07thecontrarianand hes actually answering my question
16:08thecontrarianhe actually answered it right before i asked it
16:08thecontrariani was gonna say 2. what about the return void and Object... thing
16:08noncomweehee, my meds allow me to time travel
16:08thecontrarianlololol
16:08thecontrarianyou guys on the core team? or just avid users?
16:09noncomi am just a user, rather mediocre
16:09thecontrariani always like to ask that when i get support for something
16:09thecontrariancool, me too
16:09noncomamalloy however, is more involved afaik
16:10thecontrarianwhat do you yall use it for?
16:10noncomclojure?
16:10clojurebotclojure is not scheme
16:10thecontrarian(<- from texas)
16:10thecontrarianyeah
16:10amalloyno. i've had some patches applied, but i'm certainly not a part of clojure/core
16:10thecontrarianword
16:10thecontrarianyou make anything cool with it tho?
16:11thecontrarianuse it at work or something?
16:11noncomwell, i use it for everything where i can get out with JVM - my main jvm lang
16:11amalloywell, www.4clojure.com
16:11amalloyand yes, i've used it at work for three years
16:11noncomi used it at my work, programming 3D games and multimedia applications with OpenGL and stuff
16:11noncomand also networking
16:11thecontrarianyou made 4clojure?!?
16:12thecontrariannoncom: lwjgl?
16:12amalloynot all by myself, thecontrarian: https://github.com/4clojure/4clojure/graphs/contributors
16:13noncomi almost cannot find a reason not to use clojure for a task. the only reasons are: 1) need c/c++ speeds 2) can't jvm
16:13noncomi was using jmonkeyengine3 which is based on lwjgl yes
16:13thecontrarianamalloy: you heard of codewars?
16:14thecontrariannoncom: is there a good clojure wrapper for that?
16:14noncomalso many other libs for computer vision, sensors and stuff
16:14noncomwell, it is hard to say. when i started my way, i talked to the community and it happened that several people were already exploring the domain but they all were far from something definite
16:15Djgerar123HUMANS?
16:15noncomafaik only weavejester got some conceptual thing that he intended to finish and really employ
16:15arrdemonly robots and lambdas here. move along.
16:15thecontrariannoncom: id love it if you could point me in the direction of some good libs for doing that kind of stuff. thats the kind of stuff i do on the side as well (much like everybody in our field it seems)
16:17noncomme myself wrote a special environment for my job, it is an OS-like plugin-based environment for multimedia apps and JME wrapper is a part of it. however, i do not think that clojure community would appreciate some of the concepts it is built around, so i would not take it as a reference or even idiomatic implementation either
16:17noncomthecontrarian: what direction exactly? jme3 wrappers or other?
16:19thecontrarianreally anything that involves graphics (2d or 3d) or audio
16:20thecontrarianive looked at quil, overtone, shadertone, and seesaw recently
16:20noncomfor starters I googled "clojure lwjgl" and "clojure jmonkeyengine3"
16:20thecontrariani'm a web and game dev, so anything that does some sort of graphics/interface-y stuff would be cool
16:21noncomi could also share my JME3 wrapper which could simplify interfacing with the engine, but it is not a really useful thing withou the rest of the OS, it's just a thin wrapper afterall
16:21noncombut maybe a good starting point
16:21thecontrarianid love it if you could share your os-like thing
16:21thecontrarianit seems cool
16:22thecontrarianand i'm not a total stickler about the kinds of things that the clojure community at large is
16:23thecontrarianfor instance, i love using mutable closures in javascript, they are really useful
16:24thecontrarianmaybe thats not a very good example
16:24thecontrarianw/e
16:24thecontrarianthis you https://github.com/noncom?
16:25noncomyeah thats me but my main account is on bitbucket
16:25thecontrarianword
16:25gtrakthecontrarian: I'd rather write mutable code than figure out someone else's, does that make me a stickler?
16:25nathan7How on earth do I use (proxy) with a superclass that has a type parameter?
16:26amalloytype parameters are fictional
16:26noncomi can't share the core of the OS yet, it is not finished and I have a contract with the company. I can, however, share all the wrappers
16:27noncomwrappers will really get you going - they make it easy with the libs
16:27gtraki think it's probably my general hatred of pain :-)
16:28noncomgtrak: what do you mean?
16:28thecontrariangtrak: as far as i'm concerned, being a stickler is being anal retentive about following the suggested design paradigms laid out by a language, especially when not in a work environment. being a stickler isn't a bad thing, dont get me wrong
16:29thecontrariani just feel that SE is a wide field of alot of cool things and they all have their goods and bads
16:29gtraknoncom: I mean, I guess I'm a stickler, but it's more subtle than that, I don't know how it is for others.
16:30thecontrarianbeing a stickler is a really good way to consistently write "good" code in a given language
16:31thecontrarianalthough "good" code isnt necessarily good, its more of just consistent and conforming
16:31gtrakI think when you consider how how principled clojurists are, they choose practical relatively often.
16:31gtrakI wouldn't expect that from, say, haskell.
16:31noncomhmmmm.... if I tell you that the OS i'm working on includes a OO subsystem, then who am I? am I a stickler?
16:32noncomor anti-stickler?
16:32thecontrarianidk. generalizations about people, you know?
16:32gtraknoncom: not enough information :-)
16:32thecontrarianyeah
16:32thecontrarianwhy did you choose to do that?
16:33noncomheh. i needed classes and objects, but implemented in lisp, not java. that gave me the power over the OO system to make it in my own design
16:33gtrakplus I think of OO as map merges anyway.
16:34gtrakit doesn't mean much to me.
16:34noncomyes, it is based on that. no other good way here
16:34gtrakmessage passing, you mean 'apply'?
16:35thecontrarianlol
16:35noncomhaha
16:35thecontrarianyeah, i mean it doesnt really mean anything to be a stickler i guess
16:36thecontrariani would say you are not a stickler tho
16:36thecontrarianyou come across more as a pragmatist
16:37noncomyeah, kept telling this myself over and over when building that shit :)
16:38noncomin the end, you know
16:38thecontrariansometimes i miss OO when in clojure actually, but more for the organizational aspects than anything else. when you have a bunch of methods that act on a single data structure, having them all bunched together is pretty convenient
16:39noncomthecontratian: i tell you one thing that you might be already aware of, but i tell from my experience: games and multimedia imply state. the most sane way to manage state like that is objects.
16:39clojurebotRoger.
16:39noncomyes, state with instances and with associated methods
16:40thecontrariani do know that, yeah
16:40noncomit just cuts it, gets the work done
16:40thecontrarianthere are other ways, however
16:40noncomwithouth a huge pile of lambda piping
16:40gtrakI'd say people are more strict the closer you get to core projects.
16:40gtrakwhich is pragmatic imo
16:40noncomoh yes. those who build the core must be zealots
16:40noncomthat's the only way really
16:41noncomotherwise, the mission would fail
16:41thecontrarianlike having your state in a hash and mutating it the update loop and passing it back around through a recur
16:41gtrakthecontrarian: you should use transients xD
16:41whilononcom: objects don't give you performance, uncontrolled mutation might do
16:42thecontrarianwhat are the rules with transients?
16:42thecontrarianare there any?
16:42noncomthecontrarian: yes, ofcourse, but you know what... if you start building convinience around that state passed each cycle, in the end, you will come up with something that pretty much reminds a OO system
16:42gtrakthecontrarian: you still have to return them as values, you can't bash in place.
16:43gtrakbut they're faster.
16:43whilononcom: what are you building?
16:43gtrakalso, I think you can only do it from one thread.
16:43thecontrarianas values? you mean as persistent forms?
16:44turbofailhe means you can't do (let [a (transient {})] (assoc! a :foo 0) a)
16:44noncomwhilo: at least objects give a way clearer organization of code and reduce LOCs and lambda piping. there was not so big concern with speed in my program. but yes, if i am after speed, then uncontrolled mutation would be the right way
16:44gtrakwhat turbofail said
16:44whiloi think oo is mostly the way people learn to organize code, but in games things are not necessarily objects, but they definetly are data
16:45whiloi have managed to get decent performance by keeping all state in one atom in my game prototype and pass that around: https://github.com/ghubber/clj-projectr/blob/master/src/projectr/core.clj#L152
16:45noncomwhilo: i am building a multimedia environment for the company i am working in. think of it like something like Unity3D kind of thing, but made with Clojure
16:45thecontrarianhave any of you hear of the Entity component system?
16:45thecontrarianif so, what is it?
16:45whilononcom: cool they dropped my code for unity3d
16:45gtrakthecontrarian: ibdknox has a good blog post on this
16:45whilosadly
16:46thecontrarianyeah, i should read that
16:46noncomwhilo: yes, you are right. but do not forget about convenience. when you start building conveniece methods around your data blob, you end up with OOP
16:46thecontrariani've been meaning to
16:46gtrakthecontrarian: http://www.chris-granger.com/2012/12/11/anatomy-of-a-knockout/
16:46noncomwhilo: tell more about your story with unity3d?
16:46whilononcom: we wanted to build an augmented reality game simulation similar to ingress
16:47whilothis was a prototype as an internship with university, but they want to build a company
16:47thecontrariandid you use clojureCLR?
16:47whilodon't know their current status, but after they switched to unity3d i was not interested anymore
16:48whiloexactly because it is scripting around stateful objects and this will scale horribly in a game-world as big as the real world ...
16:48whiloimho
16:48whilomaybe some people have more experience, but nobody could convince me so far that gaming needs uncontrolled mutation
16:48whiloimo it needs scalability
16:49gtrakwhilo: GC pressure is a thing. an immutable physics engine might be impractical.
16:49whilogtrak: right, but still you shouldn't model your code mutably but hide it
16:49gtraknot sure how you can avoid it in that case.
16:49gtrakI mean, you can still pass things around, but they mutate.
16:50noncomwhilo: hmmmm i see... right. I guess, they switched to unity for other reasons however.. many prefer it because it makes many things easier and it employes the dumbass c#
16:50gtrakso, if you have more than one reference to a thing you'll still get bitten.
16:50whilononcom: right, this seems to have been the point, convenience. i don't have a problem with that, but it doesn't make you scale
16:51thecontrariani actually really like c#
16:51gtrakI have fond memories of XNA
16:51thecontrarianits better than java imo
16:51gtrakI booted up monogame the other day, it looked great.
16:51thecontrarianif c# ran on the jvm it would be amazing
16:51whilogtrak: right, it is tricky. but doing that only can increase your efficiency on a single thread, if you manage to build an immutable version that scales, you easily beat that
16:51noncomc# is ok, so as java... and c too, but after you tried lisp... well.. i don't know how to describe the feeling
16:51whilononcom: ^^
16:52locksC# rocks
16:52gtrakyes, C# and related tooling is loads better than java. but I don't miss it at all.
16:53thecontrariannoncom: you dont have to describe the feeling here dude XD
16:53gtraki mean, you learn core.async once, and you get to use it on the JVM and javascript :-)
16:53gtrakbeat that.
16:53whilononcom: Hickey: You can reach a point with Lisp where, between the conceptual simplicity, the large libraries, and the customization of macros, you are able to write only code that matters. And, once there, you are able to achieve a very high degree of focus, such as you would when playing Go, or playing a musical instrument, or meditating. And then, as with those activities, there can be a feeling of elation that
16:53whiloaccompanies that mental state of focus.
16:53whilohttp://www.codequarterly.com/2011/rich-hickey/
16:54whilogtrak: core.async is amazing
16:54noncomwhilo: actually in most games it rarely comes to problems with mutability i think... the immutability and other stuff is more like for distributed and networked systems
16:54noncomyeah, these words by Rich are great
16:55whilononcom: how do you mean it does not come to problems with mutability?
16:55thecontrarianwhilo: i've played around with core.async some and watched that one David Nolen video on it, but i still dont really understand it that well. you have any tips or places where i can get more familiar?
16:56whilothecontrarian: you can help me :-P
16:56whiloyes, examples are often only small
16:56gtrakthecontrarian: learning by doing worked for me. I had to read a lot of impl, but that's the case for most clojure libs.
16:56thecontrarianwhilo: lol what do you mean? what do you need help with?
16:56whiloit was a bit hard to get some things sorted out, for instance you might not write to a closed channel
16:56noncomwhilo: the structure of most games is so simple that it does not have many places to fail with inconsistant mutations
16:57noncomdatabases, distributed and network comms systems, however, is a different thing
16:57gtrakI think people recommend reading about 'go' and the original CSP text as well.
16:57gtrakbut i haven't gotten around to that.
16:57noncomthis article is also good: http://www.defmacro.org/ramblings/lisp-ducati.html
16:57whilononcom: ok, i was rather interested in games that have many players and significant simulations
16:57whilostill you can default to immutability then
16:58thecontrarianwhilo: what do you need help with?
16:58noncomwhilo: in that case only the simulations core would really require the immutability things. maybe the core server can be written in clojure and client - in unity3d :)
16:58whilofor instance i could drop in pmap and get 8 cores scaling immediately: https://github.com/ghubber/clj-projectr/blob/master/src/projectr/simulation.clj#L65
16:59noncomwhilo: idk, i'm just trying to advocate for those who choose mutability.. since there should be some secret hiding somewhere..
16:59whilothecontrarian: i am building a distributed git like repo system for data in clj and cljs with core.async: https://github.com/ghubber/geschichte
16:59whompwhat's the name of clojure contrib for my project.clj dependencies?
16:59whiloit heavily relies on it
16:59whompi can't find it on clojars
16:59gtrakI don't think mutability has a conceptual basis...
16:59noncomwhomp: what dependencies do you have?
17:00gfredericksamalloy: did you see my early-morning defense of a def-utils lib?
17:00whompnoncom, i just want to use a bunch of the functions from clojure contribs, esp in math
17:00gtrakbesides what's necessary for intended side-effects..
17:00whilothe pub-sub features in core.async are nice (although i don't have experience with other impls.): https://github.com/ghubber/geschichte/blob/master/src/cljx/geschichte/sync.cljx
17:00noncomgtrak: the conception of mutability is lowering the cost for hardware price / electric power consumption :P
17:01gtrakhehe, well, that's outside of the scope of the argument.
17:01noncomwhomp: aren't you looking for this? http://dev.clojure.org/display/community/Where+Did+Clojure.Contrib+Go
17:01whilothecontrarian: it is not very well factorized yet, but i could define the eventual-consistent synchronisation of the network fairly tersely
17:02noncomgtrak: yes. and that's the point. i have witnessed many weirdness in this world which had no logical explanation. and always always when i learned the reasons, them were money.
17:02noncomwell, sex too, but to alesser degree
17:02whompnoncom, thx
17:03noncomi wonder, what immutability will look like when we have quantum computers?
17:03whilothecontrarian: but it runs, we have tested it both on jvm and js with https://github.com/kordano/lambda-shelf, but then we realized we need consistent cross repository transactions and i am just finishing that and then we reimplement the messaging app
17:03noncomhow does it play with them
17:04gtrakimmutability and value-ness at least has math.
17:04gtrakand mutability can be described in terms of it.
17:05whilothecontrarian: for this problem core.async is perfect, but unless you have some serious problem it can look a little bit toyish from the simple examples
17:05noncomisnt the vice versa true?
17:05thecontrarianwhilo: ok cool. i dont fully understand what it is. i mean, i understand all of the separate concepts present in the pitch, but together i guess i'm having trouble visualizing it.
17:05thecontrarianwhilo: what is the use case?
17:05noncomi always perceived assembler and lisp as two poles of the world. of one single world... :)
17:06gtraknoncom: I guess set theory is more fundamental, and a better starting point than Von-Neumann, is my argument.
17:06whilothecontrarian: ok. just imagine git for data + an eventual consistent synching, so you instead of writing custom messaging for web-apps (or others) all the time, you just get an eventual consistent db-layer you can commit to
17:06whilo(locally, it works on indexeddb and couchdb atm.)
17:07whodidthishttps://www.refheap.com/85744 how do i write code like this betterer so i dont have to keep track of each validation stages position
17:07whiloso you can also have offline apps and commit (write) while offline
17:07noncomgtrak: so you're coming from above. but there are people who come from below.. personally i cling more to your POV, but i understand the other people too
17:07thecontrarianwhilo: so its a db of datastructure changelogs?
17:08whilothecontrarian: basically i want to have native like io-storage everywhere synched globally (the tradeoff is conflict resolution)
17:08QerubHas anyone attempted to unify Typed Clojure and Prismatic Schema yet? I.e. generate type signatures from schemas or so.
17:08noncomwhodidthis: well.. at first transform (if-not) into (if)...
17:08gfredericksQerub: I'm not sure how that would work
17:08gfredericksafaik typed clojure requires types to actually be present in the source code
17:09whilothecontrarian: i don't create diffs, but save a transaction function + params. this can be used with diff/patch to do git-like datastructure changelogs
17:10Qerubgfredericks: I thought that it only needed annotated vars.
17:10technomancyyeah, it can use var metadata now
17:10skottishHi all. I have a simple question that I can't seem to find an answer for. When printing bigints to a terminal, how do I get rid of the trailing 'N'?
17:11whilobut it also allows to define terse application specific transaction functions like (fn [old {:keys [amp period]}] (update-in [:values] add-sin-wave amp period))
17:11dwwoelfelQerub: There's this thing, but it's still pretty rough: https://github.com/circleci/schema-typer
17:12whiloin a git like diffing approach this would cause all values to be changed and transmitted, if i get properly. but maybe this can also be achieved via some theoretically optimal compression or so, not sure yet
17:13whilothecontrarian: core.async definitely played out nicely after i figured out the closing problem which caused random deadlocks
17:13Qerubdwwoelfel: Excellent. Thank you!
17:13Farehi
17:14noncomFare: hi!
17:14FareI want to add a trivial "backdoor" to a server. Can everything in clojure be done in a single expression, or is it like CL sometimes demanding two or more separate forms to do something (i.e. in-package in CL)
17:14Faree.g. ./foo --eval '(some expression)'
17:15Farevs ./foo --eval '(expr1)' --eval '(expr2)' ...
17:16noncomFare: I guess, either way.. look at (do ...)
17:16Qerubskottish: Maybe you can just convert it to a string with the str function first?
17:17Qerubskottish: (str (bigint 1)) => “1”
17:18skottishQerub: Thanks. I end up with quotes around it.
17:18technomancyFare: best to embed nrepl into your application
17:18skottishQerub: And I need the literal number.
17:19Qerubskottish: Are you printing with `pr`? Use `print` instead.
17:20Faretechnomancy, actually, my typical --eval argument would be '(clojure.tools.nrepl.server/start-server :port 12345 :bind "127.0.0.1")'
17:20Farebut I wanted to do something simpler — just read eval and print result from --eval
17:21Faresometimes, you don't want a repl, just a simple query as part of a small script
17:21skottishQerub: That's it! Thanks a million!
17:21Qerubskottish: YW. Check the documentation for `pr` and `print` if you wonder why they print differently.
17:22skottishQerub: I will. It's been a while since I've worked with Clojure, so i have a ton to remember.
17:25Fareare there namespace issues at read-time in clojure as in CL? how are namespaces resolved? can I change the default namespace and use it in the same form?
17:25technomancyFare: if you're sending stuff across the wire it's better to make sure everything is fully-qualified
17:27FrozenlockIs there a way to change a private array list in a java lib?
17:27Frozenlock (from clojure)
17:27Faretechnomancy: ok, then I need to support multiple commands, so I read and eval them in series
17:27technomancyFare: you can batch them up with do, which is progn
17:27Fareis there an existing clojure function to repeatedly read and eval from a string?
17:27Faretechnomancy, how would do do with respect to namespace resolution?
17:28technomancyFare: it depends on the listener; they can bind *ns* to whatever they want
17:28Farecan I (do (ns ...) (using new ns...)) ?
17:29technomancy~tias
17:29clojurebotTry it and see! You'll get results faster than asking someone in #clojure to evaluate it for you, and you'll get that warm, fuzzy feeling of self-reliance.
17:29technomancybut probably
17:30TimMcFare: Probably, as long as that (do ...) is at the top level.
17:31TimMcIf not, probably not. Clojure's compilation unit is the top-level expression, where "do" is collapsed to the top level.
17:31FareTimMc: calling from java, how do I make sure it's the toplevel?
17:32TimMcOh, like read-string and then eval that? I guess that's at the top level inside eval's context...
17:33Fareyes... except maybe I want to repeatedly read from the string, rather than just once
17:35Fareor is it just less hassle to demand specify forms as separate string arguments?
17:35Fareimpedance mismatch is a pain.
17:35technomancyeither separate strings or a single do form is best
17:35Fare(even better: is there a java way of dynamically loading the clojure jar and then calling into it, without having it included into my application jar?)
17:36Faretechnomancy, ok
17:36technomancyI mean you could splice a string into "(do %s)" or whatever
17:36Farethis way, I wouldn't have to either have a separate application binary, or to convince colleagues to ship with the clojure jar
17:37TimMcSo this would be a stateless backdoor, then? You don't want drawbridge running all the time?
17:37technomancyif you juggle classloaders you could load clojure at runtime, but it's awkward
17:37TimMcYou also risk leaking a classloader.
17:37FareTimMc: when I want stateful, I'd start a nrepl as the command
17:38Farefor casual queries, I'd remain stateless
17:38TimMcWe use liverepl from time to time at work to patch into a running JVM, but it leaks a classloader each time, so we usually bounce the server after debugging.
17:38Farewhat does "leaking" a classloader mean?
17:38TimMcNot sre.
17:39TimMcSomething about how the JVM GCs classloaders, or fails to.
17:39TimMcEventually you run out of PermGen space and things catch on fire.
17:39Farebut yeah, the idea is that this would be for interactive debugging, but not for permanent server change — and actually would be disabled or heavily restricted on a server
17:39roppongininjait seems to me that clojure has the best fucking community ever o.0
17:40Fareroppongininja, I can't say about "best", but it's got a good one.
17:40TimMcFare: liverepl is pretty nice for non-production servers if you can just SSH in. :-)
17:40Fare(at this point, I just want to be able to use clojure to explore concepts and demonstrate them, on top of an existing application)
17:45TimMcFare: A big downside of plain liverepl is that it doesn't give you line editing and history support. Wrapping the call in rlwrap or something might make it nice, though.
17:45whompis there a place to find clojuredocs for most projects out there?
17:46arrdemwhomp: there was a clojars based clojure universe explorer floating around yesterday lemme see if I can find it again.
17:46arrdemwhomp: but generally no.
17:47arrdemhttp://crossclj.info/
17:47FareTimMc: once again, for repeated interaction, the one and only command would be a call to clojure.tools.nrepl.server/start-server
17:48TimMcYou'd have to get that onto the classpath as well.
17:50Farecan I do that at runtime from my --clojure option processor?
17:50whomparrdem, thx :)
17:50whompyou'd think there'd be some integration with clojars or something to get it everywhere
17:51whompe.g. what ruby does with gems
17:51lockswhomp: thanks for volunteering ;P
17:52whompXD
17:52arrdemwhomp: clojuredocs is dead and a replacement for source level docs is badly needed :<
17:52arrdembut since we can all just use clojure.repl/doc a replacement has not really been forthcomming T_T
17:53TimMcFare: If you can load the Clojure library at runtime, I'm sure you can load the org.clojure/tools.nrepl library at runtime as well.
17:53lockswhat is Dash.app's docset based on?
18:01technomancyarrdem: I would say a replacement for source-level docs is *not* needed, the value of clojuredocs is in the user-contributed examples
18:01technomancyrendering docstrings as HTML is pretty pointless on its own
18:02Fareif I load clojure via a URLClassLoader, will it be able to use the primitives in my application?
18:03technomancyFare: my understanding is that it depends on the classloader hierarchy
18:04technomancyyour URLClassLoader needs to define a parent that knows about the rest of your classes
18:06arrdemtechnomancy: I would argue that at least for newcommers the lack of html docs is very offputting. I agree that it doesn't take a whole lot to get past that point and be able to use repl docs, but coming from Python with docs.python.org at my disposal it was exceedingly strange to pick up a language with no clear symbol by symbol documentation forget user examples.
18:06arrdemthat said, I personally probably wouldn't use a HTML documentation site myself at this point so I'm in the "loath to build one" camp.
18:08technomancythat kinda falls under the realm of encouraging people to continue in their bad habits though
18:08arrdemwhat, that providing HTML docs delays newcommers transitioning to repl docs?
18:09technomancyyeah, clojuredocs.org staying on 1.3 is actually doing the community a service =)
18:11Faretechnomancy, where is this parent definition explained?
18:11cbpit would do more service if it didnt exist at all
18:11cbpthen at least it doesn't look like we're lazy
18:11arrdemthere's that too...
18:13Faredoes clojure compile to bytecode?
18:13technomancyFare: yes
18:13Fareor does it interpret some data structure and use reflection?
18:13arrdemsorta kinda not really
18:13Farearrdem:?
18:15arrdemFare: technomancy is correct and I'm being nitpicky.
18:28arrdemBronsa: ping
18:29Bronsaarrdem: pong
18:29lemonodoreven just tfor docstrings, using google is a more usable interface. but yeah, the examples on clojuredoc are often very helpful
18:30technomancylemonodor: hm; if there are shortcomings to the repl we should address them.
18:30arrdemBronsa: thoughts on this? I'm trying to figure out what a useful pass structure will look like. https://github.com/arrdem/oxcart/blob/master/src/oxcart.clj#L211
18:31technomancylemonodor: people who rely on google end up with outdated, incorrect information on a regular basis
18:31lemonodorit doesn’t have to be that way, does it? how often do new versions of clojure come out?
18:31technomancyit's crazy how long it took people to get over confusion about clojure-contrib or swank-clojure
18:31arrdemlemonodor: sub yearly
18:31arrdemAFAIK
18:31technomancyit took years for the bad docs to sink off the first page of hits
18:32arrdemyeah. Google deals really really badly with API version changes, especially for APIs using real versioned URLs.
18:33technomancywe can control the fate of the repl, but we can't control SEO gone wrong
18:33technomancynot to mention peoples' blogs that aren't even outdated but just incorrect; ugh
18:34Farewhich class should I be loading from the clojure.jar to load it all? Or is it always loading it all, and it's just about getting a handle on an object to invoke methods on?
18:35amalloytechnomancy: "i discovered that you have to run lein clean before any lein command. i wish this were documented somewhere, but since it's not i guess i'll blog about it"
18:35amalloy(not an actual quote)
18:35technomancyhttp://p.hagelb.org/clap.gif
18:36technomancywell played
18:36lemonodorthe repl will have the closest thing to ground truth. google indexing stuff badly is suboptimal. but if it’s possible to get google to index stuff better i think that would be a huge win.
18:36Frozenlo`The truth is M-.
18:36technomancywait, do you work at google?
18:36lemonodorused to
18:36amalloythe best thing about teasing technomancy is the reaction gifs
18:37technomancylemonodor: maybe you could pull some stings, eh
18:38technomancyfrozenlock: the truth is ... complicated
18:38lemonodorno :) and i don’t know that some change in organization of pages or links would change anything, but it is worth thinking through.
18:38technomancyM-. just tells you what's on disk
18:39frozenlockIsn't that the closest you can get?
18:39technomancywithout a decompiler, probably
18:39frozenlockWhat's up with all these people connecting/deconnecting >.<
18:40amalloyfrozenlock: just get a client that hides the useless noise
18:40technomancyinc
18:40frozenlockamalloy: I have one, but I don't like to enable that. What if I talk to someone that just disconnected?
18:41amalloyfrozenlock: a smarter client than that. mine hides join/part for anyone who hasn't been talking recently
18:41frozenlockTho there's so much noise here that I might as well.
18:42amalloyanyway, you'll know they've disconnected because their name doesn't tab-complete anymore
18:45Bronsaarrdem: I don't have much to comment right now on your approach, the only thing that strike me as ovious is that your approach for matching defs assumes defs to be top-level. is not supporting things like (let [..] (def ..)) intended?
18:45Bronsa*strikes
18:45Bronsa*obvious
18:46arrdemBronsa: I neglected the possibility of closed defs, but I think that should work out because the implicit do in the let form will lead to the evaluation of the def with appropriate environment changes. I'll add testing explicitly that to my list.
18:47arrdemBronsa: I'm just pondering how to support pass driven modification of functions and injection of new function declarations.
18:48arrdemouch. defmulti doesn't kick out a :def node it seems...
18:50whomphas anyone here done an fft? i'm having some struggles
18:50whompin clojure i mean
18:55Farein the clojure git checkout, there is a file src/jvm/clojure/java/api/Clojure.java -- is it included in the clojure.jar, or is it an example of how to use it?
18:56arrdemBronsa: good call on the closed over let. totally broken.
18:56Kitty-good jawb
18:57arrdems/closed over/closing/g
18:59Faretyping clojure.java.api.Clojure suggests that it's not in the .jar
18:59Faregood to know — it's just an example of how to use it.
18:59technomancyFare: iirc it's new in 1.6 or something? dunno.
19:00amalloytechnomancy: right
19:08resolve-thishi
19:12resolve-thisI'm having trouble dynamically obtaining a var from a function "reference". Anyone know a solution?
19:12resolve-thisi.e. (defn my-fn [arg1 arg2 arg3] [arg1 arg2 arg3])
19:12resolve-thissomewhere in my code I'm passed #<user$my_fn user$my_fn@1f4b2e9> and now I want to obtain the var to this how could I do it?
19:13arrdemI don't think there's a fn->var mapping anywhere.
19:14arrdembut that value you get should be a var so...
19:14arrdemyou shouldn't need one either.
19:14resolve-thisI know
19:14resolve-thisbut the value is dinamically passed to me
19:14resolve-thislike nested call
19:14arrdem,(do (def foo [x] (inc x)) (class foo))
19:14clojurebot#<CompilerException java.lang.RuntimeException: Too many arguments to def, compiling:(NO_SOURCE_PATH:0:0)>
19:15arrdem,(do (defn foo [x] (inc x)) (class foo))
19:15clojurebotsandbox$foo
19:15resolve-thisso the solution would be to resolve it at calltime?
19:22roppongi_is emacs any good for clojure or are there better alternatives? (ie. light table)
19:24amalloyif you know emacs already, it is the best choice
19:25roppongi_amalloy: I used emacs but I woudln't say "I know it"
19:25amalloyresolve-this: not all functions have a var. most don't, really. do you really want to forbid your users to pass you a lambda?
19:26amalloyif you want to restrict yourself to functions with vars, just ask the user to pass you a var instead
19:27resolve-thisin this situation I do want to restrict it to functions defined with defn. passing #'the-fn works..
19:28resolve-thiswell, thanks
19:50frozenlockI just pushed a java library to clojars. When I try to require it, I get "ClassNotFoundException <name-of-some-class-I-tried-to-import> java.net.URLClassLoader$1.run (URLClassLoader.java:366)" Is there something special I need to do when uploading some java to clojars?
19:51frozenlockI used "jar cvf <lib-name>.jar com" to make the jar. When I look inside, it looks identical to previous jar I used for the same library. :-(
19:56frozenlockThe only obvious difference I see is in the manifest. My previous lib version had "Ant-Version: Apache Ant 1.8.2" and the one I just created doesn't.
19:57frozenlockicky java
19:58jeremyheilerfrozenlock: that shouldn't matter. did you happen to include the com directory itself, or just its contents?
19:59frozenlockI included it
20:00jeremyheileroh, uh, .java files or .class files?
20:00frozenlock.java files...
20:00jeremyheilerhehe
20:00frozenlockWhat's the command to make .class files?
20:01jeremyheilerjavac
20:01frozenlockthe only thing I found was 'jar cvf...', which gave me those .java in the .jar
20:01dbaschfrozenlock: how are you building your java library?
20:01frozenlockdbasch: I don't knoooooow
20:02resolve-thislol :)
20:02dbasch:P
20:02jeremyheileryou could have lein build the java project for you.
20:02turbofailyeah that's probably the easiest way
20:03jeremyheileror do you have the original source with the build.xml? (that's the ant build file.)
20:04frozenlockHmm nope, only a bunch of .java files in what appears to be the correct directory pattern.
20:09dbaschfrozenlock: create a simple build.xml, or a build.gradle and build the jar with ant or gradle
20:09dbaschprobably the sample ant file here will work http://ant.apache.org/manual/using.html
20:10frozenlockI'll see if I can get my hand on the original build.xml :-/
20:20frozenlockOk, found it... but there's some missing jar in the dependencies.
20:20frozenlockSearching for the jars... I will prevail!
20:25frozenlockI think I got it
20:28frozenlockSuccess! Thanks jeremyheiler and dbasch!
20:30jeremyheilerfrozenlock: you're welcome.
20:42thecontrarianhow do you deal with generic java classes in clojure?
20:42thecontrarianor generic interfaces
20:46thecontrariannevermind, i think i found it
20:54arrdemhum.... how to spike def....
20:58jo_dHello. I'm having issues initiating core.typed in my REPL. When I use check-ns, I get this error:
20:58jo_dIllegalStateException doseq already refers to: #'clojure.core.typed/doseq
20:59jo_dI can't seem to find the source of this problem. It seems core.typed added its own doseq. Do I have to exclude clojure's builtin doseq?
21:06gfredericksthecontrarian: you don't
21:07thecontrariangfredericks: yeah thats what i figured out
21:07thecontrariangfredericks: thank you
21:07gfredericksnp
21:09gfredericksjo_d: sounds kind of weird
21:09gfredericksdid you use :refer :all?
21:12jo_dYes, I used :refer :all, and it came up with warnings that I core functions like doseq and let were being overriden by the core.typed namespace values.
21:13gfredericksI always used :as t
21:13dbasch:refer :all is bad
21:14dbasch(unless you really really mean it)
21:15gfredericksyou have to double-pinky-swear before you :refer :all
21:15jo_dGotcha. I was following documentation and doing (use 'clojure.core.typed) produced the same results.
21:15gfredericksclojurebot: you |have to double-pinky-swear| before you :refer :all
21:15clojurebotRoger.
21:17jo_dAnd referring as t still throws errors when running (t/check-ns 'my-project.core). core.typed runs and requires all of the functions and gives me the namespace clash warnings.
21:20gfrederickssounds wrong; my best guess is you have some code lying around you forgot about?
21:26dbaschjo_d: can you refheap your project.clj?
21:28quizdrtop of the morning, folks
21:29dbaschquizdr: morning to you too, even though it’s early evening here in the SF Bay Area
21:30quizdrAh, SF. only been there once, a few years ago, for about 36 hours
21:31dbaschI wonder what’s the number of clojurians per square mile here in SF
21:31jo_dgfredericks, dbash: Looks like I finally fixed it. I think the docs weren't specific as to how to include the core.typed libraries and use the REPL alongside. Does anyone have any guides on getting started with it?
21:32quizdrdbasch i was just wondering that myself
21:35yedi_how come (last) on vectors don't use count under the hood?
21:37justin_smithyedi_: perhaps so that there is no ambiguity that last is always linear time
21:38justin_smithas opposed to peek which is always 0(1), and gets the last element of a vector, first of a seq
21:42dbaschif you want efficiency you can always use peek
21:44quizdranyone used Secretary for cljs? Routing client-side seems rather interesting, just read about it
21:49eggheadsure quizdr i've used it, it's nice, as advertised
21:50quizdrok, it's an intriguing idea to route URIs all in the browser
21:54kenrestivodbasch: happily, this is a good town for clojure
21:55dbaschkenrestivo: which town?
21:56amalloyjustin_smith: peek actually blows up on a seq. on a *list* it returns the first item
21:56pdk`comin down to clojuretown
21:56kenrestivosf
21:57dbaschkenrestivo: for clojure and lots of other things :)
22:00dbaschI’m planning to attend this, it should be interesting. http://www.meetup.com/The-Bay-Area-Clojure-User-Group/events/181057342/
22:02quizdri've considered relocating to SF. cost of living pretty high there. how's the air quality?
22:02dbaschquizdr: the air quality is good, the cost of living is exorbitant
22:03quizdryou get more for your rent money than you do in NYC however, even if price is comparable
22:07dbaschquizdr: I’m looking at craigslist for NY and I don’t think that’s true anymore
22:07dbaschat least not for comparable locations
22:09quizdri doubt downtown SF would be more expensive than the heart of manhattan, but i'd bet you'd have a nice place for the same cost
22:10jaimefit's pretty expensive here
22:10quizdrjaimef ny or sf?
22:10jaimefsf
22:10jaimefnicer here imho
22:10amalloylast i read, san francisco is the most expensive city in the US, but i think ny has parts that are more expensive (presumably manhattan)
22:11quizdrthe problem in nyc is generally poor conditions in the average apartment, even when those small 1-bedrooms sell for $2million, they are pretty average by nationwide standards
22:11jaimefall the kids moving here
22:11jaimefhowever it's a nice place
22:11dbaschI own a small condo very close to one of the Google bus routes. Last time I rented it I had to do an impromptu open house because I got a flood of emails within the first hour of the craigslist post
22:11jaimef:D
22:12jaimefyou should rent it to a lisp enthusiast
22:12quizdri am in singapore, so by comparison either of those cities would seem like a break in costs
22:13quizdrjaimef that sounds like a very SF thing to do. give propspective renters a code review/quiz before deciding
22:18quizdrWhat UI components do you typically use/recommend when building a web app in conjunction with Om?
22:18quizdrBootstrap?
22:18beamsoi'd recommend bootstrap.
22:19beamsogenerally.
22:19quizdrit looks like one of the most convenient to use
22:19eggheadehhh
22:19eggheadup to you, bootstrap has pretty deep jquery integration
22:20quizdrWouldn't Om's virtual DOM compete with jquery's DOM handling?
22:20dbaschquizdr: don’t include the js part of bootstrap, just the css
22:22quizdrso the css will get me basic form and button controls, but not the drop down menus, etc
22:23nullptrhttp://purecss.io/ was getting some love on #reactjs the other day, can do a lot just with class swapping
22:23sjysome of that stuff works without JS. personally i use purecss.io
22:24quizdrthat looks nice; a "flat" inspired design it seems
22:25fortruceif I defonce a db connection at the top of a namespace to be used by all the functions in the namespace, is there a way to ensure it calls disconnect before the jvm exits?
22:25quizdrlooks like purecss dropdowns are also javascript, so not quite "pure" css :)
22:26yedi_justin_smith: make's sense
22:28quizdrfortruce maybe not quite what you're looking for but Stu Sierra has an interesting workflow for things like db connections and other resources that can be started and stopped without restarting the JVM or server: http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded
22:28dbaschfortruce: I suppose you could add a shutdown hook to the jvm
22:29fortrucequizdr: that's quite the post, thanks. I'll sift through it and see if anything fits, should be a good read regardless
22:29quizdrfortruce just came across it earlier today myself
22:29beamsoi'm using database pooling against a database with quite a low number of connections and bonecp is working okay without me manually closing the connection.
22:29bjeanesfortruce: there's also https://github.com/stuartsierra/component which is stuart's library for that workflow
22:29fortruceright now I have my tests just using the connection that is spun up in my model ns, then my tests closes it at the end of the tests, but it feels like that might be bad form to reach in like that
22:29bjeanesand his presentation about it https://www.youtube.com/watch?v=13cmHf_kt-Q
22:30bjeanesI've been using it in my own projects and *loving* it
22:30fortrucebjeanes: holy links batman! thanks!
22:32fortrucethis might be talked about in those links, but I'm just curious...currently I have a dynamic string defined as the database name "shouts", which I with-redefs in my tests to "shouts-testing", is that a reasonable approach?
22:52bjacan I invoke a static method of a var pointing to a class?
22:52bjai.e. (let [foo Bar] (. foo someStaticMethod)) (but this doesn't seem to work)
22:57bjaoh, nvm
22:57bjaI just didn't understand what I was doing
23:12quizdrDoes the #js reader change behavior depending on what follows? it appears it does.
23:12quizdrfor exampel #js {:backgroundColor bgc} creates different JS than #js {:className "animals"}