#clojure logs

2013-09-06

00:00bbloomcjfrisz_: i don't understand how haskell programmers can stomach all that manual lifting :-)
00:00cjfrisz_bbloom: I just don't understand how to Haskell
00:01bbloomcjfrisz_: i can't read infix :-P
00:01cjfrisz_I get types for the most part, and I've written some toys, but I just can't get it to stick with me
00:01dobry-denhttp://docs.datomic.com/schema.html explains that you'd want to create a new partition for different logical groups but I'm not sure what that means (and despite its example, the Seattle demo doesn't create a :communities partition).
00:01seabreI like Haskell a lot, I just don't know what to do with it.
00:01cjfrisz_I get this odd sensation that I'll end up playing with it some more if I spend some time with core.typed
00:02dobry-denIf you had a forum schema (Users have many Threads have many Topics), would those be in the same logical group since you query across them?
00:03bbloomcjfrisz_: some particularly weird things i just can't deal w/ tho… like i can't move code between models w/o changing the encapsulation behavior & i now have to manually make public accessor functions? wtf?
00:03bbloomcjfrisz_: i just wanna cut and paste some code dammit! stop trying to protect me from me!
00:03dobry-denfamous last words from my time with php
00:04cjfrisz_bbloom: I hate to cut off our chat, but I need to go sleep
00:05bbloomcjfrisz_: psha. you people and your real jobs
00:05cjfrisz_bbloom: Yeah, man…keeping a schedule in line with other people's is a drag
00:05cjfrisz_Being an adult is a dumb idea and we should beat up whoever thought of it
00:06cjfrisz_I just wanna circles move around in my browser all day
00:06bbloomcjfrisz_: agreed. that's why i quit being an adult
00:07cjfrisz_bbloom: I'm off. I'll be back on sometime soon
00:07bbloomcya
00:07catacan anyone advise me how to write this idiomatically without my silly helper function? http://paste.lisp.org/display/138795
00:16bbloomcata: have you see ##(doc for) ?
00:16lazybot⇒ "Macro ([seq-exprs body-expr]); List comprehension. Takes a vector of one or more binding-form/collection-expr pairs, each followed by zero or more modifiers, and yields a lazy sequence of evaluations of expr. Collections are iterated in a nested fashion, rightmost f... https://www.refheap.com/18381
00:23sdegutis_Okay I'm stumped.
00:24sdegutis_I have a defprotocol, I extend-type a few types to implement it, and I try calling it. And it throws java.lang.ClassCastException: nepenthe.core$eval200$fn__201$G__191__212 cannot be cast to clojure.lang.IFn$OOLLO
00:25brehautOOLLOO = Object Object Long Long Object Object i think? thats the method type signature
00:25sdegutis_Ah, OOLLO means it takes 2 objs and 2 longs
00:26sdegutis_Ah, it was a bad type hint.
00:26sdegutis_Thanks.
00:28seabreThis might be kind of an off the wall question: Is there something like rake for clojure?
00:32ddellacostaseabre: not really; part of the problem is that you have to spin up the jvm
00:33seabreyeah
00:33ddellacostaseabre: you could see if this scratches any of your itches tho: https://github.com/technomancy/grenchman
00:34xeqiseabre: like rake in what sense?
00:37seabreI just want to be able to define some tasks in a file
00:37seabreand run them when I want
00:37seabreLike in a Rakefile
00:38xeqiseabre: I usually put project specific tasks in a file in the project and add an alias for lein
00:38xeqifor example
00:39xeqihttps://github.com/ato/clojars-web/blob/master/src/clojars/db/migrate.clj#L56 - is a file that will run database migrations
00:39xeqihttps://github.com/ato/clojars-web/blob/master/project.clj#L39 is an alias to make it nicer
00:39xeqithen `lein migrate` will run the db migrations
00:40sdegutis_In all my years of Ruby I'm not sure I ever defined a rake task or needed to.
00:40seabreWell, yeah, but that only works if you're working in a clojure project.
00:41technomancysdegutis_: when you do it's because rake doesn't make it all that easy to abstract things out and share tasks
00:46seabreI keep some personal documents in LaTeX and use rake and guard to autocompile while I work on them.
00:47technomancyseabre: why not just a ruby script with a shebang?
00:47seabreMy rake file is like four lines of code.
00:49technomancyoh, do you mean like a library that tracks timestamps of various files and relationships between them?
00:51seabreSure
00:52seabreI was really just wondering if there was a clojure equivalent to rake, in general.
00:53nightflylein
00:54technomancyrake is used for a lot of different things, but I don't think there's any generalized file timestamp tracking library in clojure
00:55ddellacostais there a reason why a channel in a go block wouldn't pick up the first message passed in?
00:56xeqiddellacosta: because someone else read from the channel first?
00:56ddellacostaxeqi: sorry, I'm not being clear: the first message I pass into a channel doesn't seem to be getting read, but subsequent messages are
00:57ddellacostaxeqi: nothing else is reading it, that much I can confirm--it is all the same go block right now
00:58xeqino good ideas. I haven't seen that behavior in my cljs core.async explorations
00:58ddellacostaI'm setting up a go block to handle messages coming in via browserchannel, THEN I set up the browser channel with a request on open, which I see passed in--but nothing comes out of the channel in the go block which I set up initially. Very perplexing.
00:58ddellacostaI'm sure it's something stupid I'm doing, but not sure how to break it down, since it seems like everything is so obvious.
00:59xeqi"which I see passed in" - are you doing a println right before?
00:59ddellacostaxeqi: yep…is that the stupid thing I'm doing?
01:00xeqiI don't think so. I just wanted to make sure I understood
01:00ddellacostayeah, let me make up a refheap, it's hard to explain
01:08ddellacostaxeqi: this hopefully explains it: https://www.refheap.com/18382
01:08ddellacostaxeqi: I gloss over some of it, but hopefully is obvious from the output at the bottom
01:11ddellacostaxeqi: never mind, think I solved it…but writing up that refheap was necessary for me to do so. haha
01:11xeqiddellacosta: quack
01:11ddellacostaxeqi: thanks for being my "foil" so to speak.
01:11ddellacostaxeqi: what does "quack" mean?
01:11xeqihttp://en.wikipedia.org/wiki/Rubber_duck_debugging
01:11xeqiI am a duck
01:12ddellacostaxeqi: ah! Thanks for being the duck. (and apologies…)
01:16rhg135lol
01:17rhg135i had never heard of that
01:18riggerit works
01:19riggersometimes i talk to myself outloud while debugging and my wife thinks i've lost it
01:19seancorfieldddellacosta: and what was the problem?
01:20seancorfieldglad you've solved it and all... but don't keep us in suspense! :)
01:21ddellacostaseancorfield: haha…honestly, I'm still a bit confused
01:22mtgrubbhello all, I'm having some issues with defrecord and extend-type interaction. You can see some code that I used to reproduce the problem at https://gist.github.com/mgrubb/3dcfff07433314002afd
01:22ddellacostaseancorfield: I'm using browser channel, and I solved it by passing in an operation on opening of the browser channel channel, and that seemed to happen at the right time
01:22ddellacostaseancorfield: but it almost seems like dom/log was being called outside of the scope of the function it was declared within--it's very strange to me.
01:23mtgrubbThe tl;dr is that when I try to extend-type and use a protocol that was defined in a different namespace i'm getting the interface X is not a protocol exception
01:23ddellacostaseancorfield: I will have to investigate further, 'cause how it is behaving doesn't make sense.
01:24seancorfieldaccording to that code you were sending {"success" false} first? or am i misunderstanding the gist?
01:24xeqimtgrubb: try compiler/Render instead of compiler.Render
01:24seabrerigger: Make your wife think you're even crazier http://en.wikipedia.org/wiki/Rubber_duck_debugging
01:25seancorfieldseabre: i talk to my cats to debug problems...
01:25riggeryep, i do have a rubber duck sitting on top of my rubik's cube collection
01:25mtgrubbxeqi: Thanks! I new it was something simple that I was missing.
01:26rhg135I should buy one lol
01:26seancorfieldrhg135: a rubber duck or a cat? :)
01:27rhg135Clojure needs a debugger
01:27seabreOh, xeqi posted the same thing, haha didn't see it.
01:27rhg135River sick ;-)
01:27rhg135KB :'(
01:27rhg135Rubber duck*
01:29danlentzpardon the diatomic centric question, but #datomic channel seems to be less active. If I have 2 entities each with the same many-values attribute is it possible to efficiently union the two sets of values into a new entity with that same attribute?
01:29ddellacostaseancorfield: sorry, got distracted, one sec
01:29rhg135Define efficiently :'(
01:30rhg135;-) *
01:30ddellacostaseancorfield: yeah, that code reference is a bit confusing, but it all has to do with sending stuff on the client side, within the context of receiving browserchannel responses from the server
01:30danlentzin my particular use-case i have two graphs [collections of statements] and i want a third graph that is the union of those two
01:31ddellacostaseancorfield: so, I'm not sure what was going on with the initial {"success" false}--it's very strange that there was no sending to the channel
01:32danlentzrhg135: well i don't want to just iterate over both sets one by one building the union with all that wasted overhead
01:33xeqidanlentz: clojure.set/union ?
01:33rhg135look at clojure.set/union
01:33rhg135sorry i'm also new to clojure :P
01:33danlentzbut then i have to insert 2n nodes back into the db
01:34danlentzi want it computed without sucking them all out and then shoving them all back in again
01:36danlentzw/o much experience with diatomic yet my initial thought was to implement my own collections using a trap structure implemented using diatomic tuples
01:37danlentzbut i just thought there had to be an easier way
01:37danlentztrap rather
01:37danlentztreap
01:38danlentzdamn autoincorrector
01:39rhg135Ah
01:39xeqidanlentz: using :db/ref as pointers ?
01:39danlentzy
01:41danlentzi actually have the basics of the tree model built already but bedore i start getting too far i thought i might ask someone wiser in the ways of datomic
01:42xeqihow would that prevent having to insert the nodes again?
01:42lynaghkping: dnolen
01:42danlentzits actually a weight balanced tree not a trap. wb will perform better because it does a lot less rebalancing
01:43danlentzwell i can union two wb trees within the db more efficiently nthan 2n
01:44danlentzthe trees are functional and share structure
01:45danlentzand don't require eager evaluation
01:46danlentzits essentially like adams tree / purely functional data structures based
01:47danlentzi've used them to implement collections before both in memory and on disk. but by on-disk i mean at a lower level using mmap
01:48danlentzseems like if i have a diatomic database it should be doing that bit for me
01:50danlentzthings should be at least a little more convenient then working directly in memory using octets… :)
01:50xeqithe sharing structure seems like it could be beneficial to reduce the node insertion
01:51danlentzit seems lile this would be a common type of requirement
01:51xeqithough work never happens "in the db". the client pulls the data out, and works on it locally
01:52danlentzy but I'm just surprised i have to go and implement my own index structure from scratch rather than some facility of diatomic existing indexes
01:54xeqieven trying to use an ordered list attribute requires building your own index
01:54danlentzalso wb trees are ordered whoch enables some other optimizations
01:55danlentzxeql: meaning your own data structure?
01:56danlentzalso in the future i had in mind that i wanted to add and remove indexes dynamically at will
01:56danlentze.g. some graphs may have multi-constituent indexes, etc
01:56xeqia :db.cardinality/many of :db.type/ref, and those refered entities need to have a :db.type/long representing their index. so yes?
01:57danlentzbut the union of two many-valued attributes just seems like such a basic thing i thought perhaps i was missing sopmethging
02:00danlentzseems a little do-it-yourself for a commercial product like diatomic aims to be
02:01danlentzand a closed source one at that
04:20mklappstuhlUsing a (try (catch)) block as it is used here: http://en.wikibooks.org/wiki/Clojure_Programming/Examples/JDBC_Examples#Dropping_a_Table — my functions always return nil on error case — I looked into various SO threads but wasn't able to figure out how to get the stracktrace to be printed
04:23jack_rabbitmklappstuhl, what have you tried?
04:24jack_rabbithave you tried the printStackTrace() method?
04:24mklappstuhl(catch Exception e (.printStackTrace (.getCause e)))
04:24mklappstuhlthis one?
04:26jack_rabbityeah.
04:26jack_rabbitwhy are you doing getCause, though?
04:29mklappstuhljack_rabbit: to be honest I dont really know. I found that on SO. tried it without getCause now and the output is actually far more verbose
04:30jack_rabbitwell. Stack traces are usually verbose.
04:30jack_rabbitALL of Java is usually verbose.
04:30mklappstuhlI was looking for that so it's good :)
04:31mklappstuhlI'm trying to delete tables btw and printStackTrace gives me that: java.sql.BatchUpdateException: Batch entry 0 DROP TABLE migrations was aborted. Call getNextException to see the cause.
04:31jack_rabbitSo do that if you want the next exception.
04:31mklappstuhlthe table doesnt exist but I wonder if getNextException provides me with more sql related info
04:32jack_rabbitI have no idea. it seems to be a java.sql thing.
04:32mklappstuhloh, wow. just replacing .printStackTrace with .getNextException is pretty good
04:33mklappstuhlmaybe I didn't get this working yesterday because it was late already :D
04:34jack_rabbitcould be.
04:35jack_rabbitdo you know Java?
04:41mklappstuhljack_rabbit: no, not at all
04:41jack_rabbitthat's your problem.
04:41mklappstuhljack_rabbit: yeah, apparently. It's a bit sad that you get to Java so fast just wanting to use clojure :)
04:42jack_rabbitI agree.
04:46clgvmklappstuhl: there is the clojure.stacktrace namesapce that offers you print-stack-trace and print-cause-trace
04:47clgvI often use print-cause-trace during development
04:47jack_rabbitclgv, good to know.
04:51sheldonhreverse is not lazy. does that mean that (filter some-filter (reverse lazy-sequence)) will end up building the entire sequence into memory before some-filter sees the first entry?
04:51jack_rabbitsheldonh, yes.
04:51mklappstuhlclgv: I will look into that, thank you :)
04:51sheldonhjack_rabbit: owch.
04:52clgvsheldonh: yes. but the filtering is lazy again
04:52sheldonhclgv: right. so on a monster sized lazy-sequence, reverse is an extremely bad idea if i have other options. true?
04:53clgvshadlonh: you can implement a lazy reverse though. but it takes O(n) time
04:53jack_rabbitclgv, you could implement a lazy reverse on vectors that was in constant time, though, no?
04:55clgvjack_rabbit: yes
04:55clgvoh no I think I misjudged lazy-reverse is not possible for lazy-seq. since you need the last element as first
04:56clgvsheldonh: just reverse the data after you know how much you need to realize
04:58sheldonhclgv: i'm trying to learn how to a) take a sequence and return a sequence (to minimize memory usage when it matters) while at the same time b) dealing with the fact that my use of conj in reduce gives me the result in reverse
04:59clgv sheldonh: conj with a list?
05:00sheldonhclgv: yes. like so: https://www.refheap.com/18386
05:00clgvsheldon: if you conj on a list and do not like the order being reversed then use a vector in the reduce instead of the list
05:00sheldonhclgv: hmmm, thinking...
05:01clgvsheldon: as a rule of thumb: for sequential data you almost always use vectors except you have a special goal that definitely needs a list
05:02clgvsheldon: I meant eager calculation. for lazy calculation you have lazy-seq and the sequence functions built on it
05:02sheldonhclgv: so... "as a rule of thumb: for eager calculation you almost always use vectors except ..." ?
05:03clgvyes
05:03clgveager calculation of sequential data ;)
05:04jack_rabbitIt also makes me wonder that if you have a single sequence so large that it is deserving of memory consumption consideration, if you shouldn't be splitting the data somehow into smaller chunks.
05:05sheldonhjack_rabbit: well exactly. the exercise i'm working on is to implement core's partition function :)
05:06clgvjack_rabbit: assuming the data isnt generated on the fly and does not fit into memory it must originate somewhere: network or file/database
05:06clgvin the memory case you can build a function reading the file applying a function on each read datum
05:06jack_rabbitclgv, exactly.
05:13sheldonhmaybe my approach to reducing is wrong. i start with [[]], filling the inner vector until it has the right size. that requires a lot of (conj previous-partitions (conj current-partition x))
05:19sheldonhhmmmmm... assoc applies to vectors :)
05:31clgvsheldonh: problem link?
05:39sheldonhclgv: it's just "implement partition yourself" http://www.4clojure.com/problem/54 current attempt here: https://www.refheap.com/18387 ... seems what's tripping me up is that rest returns a list, not a vector
05:39clgvsheldonh: you do not have to be lazy for that one.
05:40sheldonhclgv: it just feels like i should be able to get away with not having the whole input set in memory at any time. maybe that's a bad intuition
05:40clgvsheldonh: dont overcomplicate the task ;)
05:41sheldonhclgv: i must! laziness is a huge reason i'm interested in clojure, and (as you can see) i don't understand it very well :)
05:41sheldonhclgv: it's very exciting to see a chunk of code that looks like it'd be a single thread in ruby, flattening 5 of my cores :)
05:44clgvsheldonh: how are those two statements connected?
05:44sheldonhclgv: i'm going to have to go with tangentially :)
05:45sheldonhclgv: but i'm guessing it's because referential transparency plus laziness provide easy opportunities for exploiting concurrency
05:45sheldonhclgv: (because you can execute a producer and a consumer concurrently)
05:46krgnmorning
05:46clgvsheldonh: no. lazyness is the archenemy of concurrency. that's why the important lazy functions from clojure.core are reimplemented in clojure.core.reducers
05:46jack_rabbitsheldonh, laziness just allows you to compute only what you need.
05:47krgnI have a question: if I have a 'resources' folder in a project, I'd like to get the contents into the uberjar as well, but they don't get included
05:47Brand0sheldonh, did you try a for loop?
05:47clgvs/important lazy functions/important sequence functions/
05:48Brand0or take
05:48sheldonhexcellent. i don't understand laziness. i will go back to plodding through the exercises and revisit this next time around block :)
05:48jack_rabbitmeanwhile in ##java....
05:48Brand0^JavaSpaghettiOO
05:51clgvsheldonh: you could use lazy-seq + take + drop ;)
05:52sheldonhclgv: bloody hacker :)
05:53Brand0cheater!!!
05:53Brand0;-)
05:53clgvsheldonh: well, I would not reimplement `partition` in the first place if it wasnt an exercise... :P
05:53Brand0sheldonh, did you look at the source to partiton before you started?
05:54sheldonhnooooooooooooooo!!!!!
05:54Brand0good first step to alert you to functions that you may or may not have know existed (or could be used that way)
05:54clgvBrand0: well, looking at the source is cheating...
05:54sheldonhclgv: you have a point. why am i worrying about this? when i find myself in a situation where my solution to this problem is necessary, i can just use partition!!!
05:54Brand0not always
05:55clgvsheldonh: indeed
05:55clgvBrand0: for 4clojure exercises to reimplement a core function always ;)
05:56Brand0clgv, a lot of the time the functions are written using java interop and would bring your score way up (bad!)
05:56Brand0but you're right for some of them
05:56sheldonhyou guys must be so sick of 4clojure :)
05:56Brand0nah it's the best way to learn clojure
05:58Brand0and there's few better feelings than entering your answer and seeing yours is the shortest (or = to)
05:58sheldonhBrand0: glad to hear it. i meant, those of you who already know clojure, answering questions about 4clojure here :)
05:58Brand0oh lol ... I don't think anyone in here is sick of talking about clojure yet
05:58Brand0for any reason really
05:58sheldonhand now for something completely different. does clojure have sugar like haskell's $? so far, comp is the next best thing i can find
05:58llasramThere's a pretty clear self-selection process there :-)
05:59llasramsheldonh: The threading macros (->, ->>, etc) can yield a similar result
06:00llasram&(->> 5 range second inc)
06:00lazybot⇒ 2
06:00sheldonhoooo. great! thanks
06:31sheldonhyou've got to marvel at the perverse pedantry of students, that demanded the use of the word distinct in this exercise: "Write a function which returns a map containing the number of occurences of each distinct item in a sequence." :)
06:34clgvsheldonh: much better than underspecified descriptions
06:50sheldonhclgv: absolutely. i've encountered a few serious headscratchers :)
06:52Brand0distinct = unique
07:16ambroseb_hyPiRion, callen, technomancy: core.typed needs to stick to Clojure semantics wrt keywords. There's some room for warning on potentially non-existent keyword lookups, but then you've got macros that use keywords as predicates and it might all get a bit messy.
07:17ambroseb_and you don't have control over other peoples macros, so you might get lots of "Potentially missing keyword lookup" warnings.
07:18ambroseb_I can add a flag if people are interested to turn these warnings on though.
07:18ambroseb_(this is RE: http://clojure-log.n01se.net/date/2013-09-05.html#18:35a)
07:46noncomhow often fo you find yourself using mapply? i feel like i am doing some kind of a hack with it. although my reason says that there is nothing bad, the fact that it is not in the language core tickles me..
07:47ambroseb_noncom: apply?
07:47noncomno, mapply
07:47ambroseb_ok
07:47ambroseb_I don't know what that is.
07:48llasramnoncom: Reminder what `mapply` is?
07:49noncomit is same as apply, but used in case if you have a function that acceps a map of optional parameters like (defn my-func [& {:keys [a z]}] ...), and then you have {:a 1 :z 2}. So you need mapply to pass that map easiy
07:49noncomcode: (defn mapply [f & args] (apply f (apply concat (butlast args) (last args))))
07:50ambroseb_hehe that's nasty. looks useful though.
07:51llasramnoncom: Ok. Yeah, for me -- honestly, never
07:51noncomheh..
07:52noncommust be a sign of code smell?
07:52ambroseb_it seems like it exposes something about the way Clojure implements kw args.
07:52ambroseb_I can't put my finger on it though.
07:52ambroseb_I'll have to think about that one
07:55noncomthis code is what hyPiRion gave me when i asked how can i apply a map like that. Also, i remember someone said that Clojure's kw args mechanism looks like it is not as it intended to be. The keyword args were added later and issues like this one can happen... something like this..
07:55ambroseb_noncom: I guess if your stuck with a map of data and a function that takes that map as keywords, it's a nice utility.
07:56noncomsee, yes, my mind is calm. but there is an itch - why isn't this in the core as of 1.5.1 ?
07:56ambroseb_noncom: I haven't seen any demand for it in core.
07:57ambroseb_usually you need to kick up a fuss to get something in.
07:57ambroseb_perhaps the jury is still out whether mapply is encouraged.
07:58noncomyeah, maybe...
07:58noncombut it looks VERY natural for a language with such destructuring abilities..
07:59ambroseb_good point.
07:59ambroseb_the lack of mapply certainly encourages the use of a map arg over kw args.
08:00ambroseb_which seems against Clojure's decision to flatten almost every piece of syntax.
08:01noncomi guess maybe i should ask in the user group and some from the creators team could answer. it very interesting why is it so.
08:03ambroseb_also consider it's very hard getting things into clojure.core.
08:03ambroseb_everyone has their own set of convenience macros
08:04ambroseb_there's nothing wrong with dissoc-in, but it's not being added to core.
08:06noncomno problem with this, rather i want to know the bias behind the situation.. but this even seems more fundamental than dissoc-in.. it feels something like if in Java you could not pass, well, say, double args, instead you'd have to pass floats and then make them double.. hehe :)
08:07ambroseb_yes.
08:08clgvjust out of curiosity: is there a pipeline construct in core.async? pipeline means I have a function to put data in the pipeline and the pipeline function running in several different threads process the data and I have a function to retrieve the results afterwards
08:12noncomyet i did not get to extensive use for core.async... a little sad this is.. what is your domain of application for core.async, if it is not secret :)?
08:18clgvnoncom: I do not use core.async. I just head need for the described pipeline
08:18clgvI wrote it myself now
08:19clgvnoncom: the use case is processing data from a huge file in parallel with only a limited number of entities in memory at the same time
08:22noncominteresting!
08:22clgvit's build on java.util.concurrent now
08:58xeqiclgv: that sounds like 2 channels and N go blocks reading from one channel, processing, and sticking the result in the other channel
08:59xeqiI don't know of anything yet that wraps that structure up into an api ala http://immutant.org/documentation/current/messaging.html#messaging-pipelines
08:59clgvxeqi: yes. but without having to construct that yourself. I think it is general purpose enough to be implemented in some lib..
09:00clgvah nice. approximately like the immutant one
09:00clgvexcept that I have limited queues and thus backpressure for all participant
09:02xeqiI've seen some gists from dnolen that are exploring error handling and mentions of pipelining where channels exist for the intermediate steps, but I don't think anything is wrapped up in a lib yet
09:10silasdavisCan I print to the console from a lein ring app?
09:12mathiaspI think with pprint, at least it works under immutant
09:13crocketIs there a good database library for clojure?
09:13crocketDatomic is just too expensive.
09:14crockettoo expensive for individuals
09:17xeqicrocket: what are your qualifications for "good" ?
09:17drbobbeatycrocket: I've used postgresql with clojure as well as hadoop and both are working really well for me.
09:17crocketxeqi, I don't have any yet, but I heard Datomic was good.
09:17crocketdrbobbeaty, Both?
09:17crocketdrbobbeaty, postgresql is not a library.
09:18drbobbeatycrocket: Sorry, I saw your request for a database to use with clojure.
09:18drbobbeatycrocket: I've used korma as a library into postgresql, and it's nice.
09:18AnderkentIs there a nicer way of saying (condp apply expr #{foo} ... bar? ..._
09:19Anderkenti.e. the equivalent of (cond (fun-a expr) ... (fun-b expr) ... ...)
09:19drbobbeatycrocket: I've created a webhdfs-clj library to interface with a WebHDFS system - which is the heart of hadoop.
09:19crocketdrbobbeaty, What is hadoop?
09:20drbobbeatycrocket: http://hadoop.apache.org
09:20drbobbeatyIt's a large, distributed, clustered, database with map/reduce capabilities.
09:20xeqicrocket: https://github.com/clojure/java.jdbc is the base level everything builds on. Some people like http://sqlkorma.com/ ; others like https://github.com/jkk/honeysql for nice querying and doing create/update/delete with c.j.jdbc
09:20xeqifor normal sql databases
09:21BalvedaWhat libraries are good for webapp development?
09:21crocketWhat does Rich Hickey build?
09:21xeqicrocket: none of those. He built datomic
09:21xeqi* and others
09:21crocketxeqi, And datomic is expensive.
09:21crocketxeqi, It seems he earns money from datomic.
09:21xeqiyou can push datomic-free quite far
09:22crocketxeqi, datomic-free doesn't include SQL backend.
09:22xeqicorrect
09:22crocketLoss of SQL backen is loss of everything.
09:22crocketIf I can't use Datomic with postgresql or mysql, it's not worth for individual devs.
09:22crocketCompanies might be tempted to pay for it.
09:23xeqithat is an interesting position to take
09:23crocketxeqi, Who doesn't use SQL nowadays?
09:23BalvedaIs Noir handy?
09:24noncomi don't use sql
09:24xeqiBalveda: noir has been deprecated. Most people are using compojure, possibly with lib-noir and other libs to build a stack. check out http://www.luminusweb.net/ for a starting point
09:24BalvedaThanks!
09:25xeqicrocket: I feel like this is moving into troll territory. but on the case you are sincere, I know of several companies using mongo, riak, cassandra, couchdb, and others that are not sql
09:26crocketxeqi, However, I think absence of SQL backend in datomic-free is a serious mistake.
09:27xeqicrocket: out of curiousity, what benefits does the sql backend provide?
09:27crocketAbsence of it excludes a significant portion of individual devs.
09:27crocketxeqi, Lots of people still use SQL DBs.
09:33noncomthat is true
09:33crockethmm
09:34crocketDatomic-free seems to support embedded datalog backend.
09:39crockethmm
09:39crocketIs datalog better than SQL?
09:40bamfordFolks, when I run parallel calls to functions with println, the output lines can sometimes be interleaved:
09:41bamford(doall (apply pcalls (repeat 3 (fn [] (dotimes [_ 3] (println "Hey hello!"))))))
09:41bamfordbut AFAIK, in Java it is guaranteed that System.out.println output lines won't ever be interleaved
09:41bamfordis there a way to make Clojure's println also "thread-safe" in this respect?
09:42Balvedahm
09:42Balvedacounterclockwise crashes when i try to make a project with a luminus +cljs template
09:42clojurebotExcuse me?
09:45Balvedaapparently it doesnt like the parameters
09:46xeqibamford: you could use bound-fn instead of fn
09:47AnderkentHow can I go from a non-namespaced symbol to a fully namespaced one, on runtime? I.e. (let [sym 'foo] (fully-qualify sym))
09:47AnderkentI guess (symbol (-> sym resolve meta :ns) sym) kinda works, but fugly
09:48bamfordxeqi: thanks, unfortunately that doesn't help, same problem
09:49ambroseb_Anderkent: do you mean `resolve`?
09:49ambroseb_I guess that returns a Var, but do you want the symbol that is currently in scope?
09:51Anderkentambroseb_: I want a fully qualified symbol that would resolve to the same var
09:51Anderkentor the symbol back if it resolves to a non-namespace-qualified special
09:51Anderkent(or doesnt resolve at all)
09:52ambroseb_Is this in a macro?
09:52ambroseb_Do you mean a local variable?
09:52ambroseb_or a special form?
09:53Anderkentyes
09:53AnderkentI check that it's not a local already, so that's not a problem
09:53Anderkentbut basically if I get 'if
09:53Anderkentthen I want 'if
09:53Anderkentbut if I get 'loop, I want 'clojure.core/loop
09:53Anderkent(unless of course there's a loop defined that shadows clojure.core)
09:53ambroseb_,(clojure.core/if 1 2 3)
09:53clojurebot#<CompilerException java.lang.RuntimeException: No such var: clojure.core/if, compiling:(NO_SOURCE_PATH:0:0)>
09:54ambroseb_didn't know that.
09:54ambroseb_then again I don't think I wanted to know.
09:54Anderkenthttps://www.refheap.com/18393 does the job, I think. But .... :P
09:54ambroseb_,(clojure.core/do)
09:54clojurebot#<CompilerException java.lang.RuntimeException: No such var: clojure.core/do, compiling:(NO_SOURCE_PATH:0:0)>
09:55Bronsaambroseb_: only clojure.core/import* is namespaced of all the special forms
09:55Anderkenthttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java here, anything that doesn't intern as (clojure.core, ...) is not namespaced
09:55ambroseb_Bronsa: ah yes. I think I wrote some docs about that, must have been pushed out of my brain.
09:57Anderkentreally, I just want what ` does
09:57eric_normandanother day, another sexp
09:57ambroseb_,(-> 'do resolve class)
09:57clojurebotnil
09:58Anderkentspecials dont resolve
09:58Anderkentthe compiler picks them up
09:58ambroseb_if I was more proud of my Clojure knowledge I'd do that privately ;)
09:58ambroseb_I knew that! :)
09:58Anderkenthah :P
09:59ambroseb_;)
09:59Anderkentit's not something that comes up most of the time
09:59ambroseb_Anderkent: so you will have to special case the specials.
09:59Anderkentbut when doing full program transfomrations
09:59Anderkentit's pretty damn annoying
09:59Anderkentnah
09:59BronsaAnderkent: https://github.com/clojure/tools.reader/blob/master/src/main/clojure/clojure/tools/reader.clj#L456
09:59Anderkentsince they dont resolve, they dont get ns, so I treat them as any symbol that doesnt resolve
09:59Anderkenti.e. return it back
10:00ambroseb_Anderkent: sounds amazing.
10:00ambroseb_amazingly fun that is.
10:01crocketDoes anyone use datalog for database queries/
10:01Anderkentyuck, that feel when your change breaks all the tests without actually breaking anything useful
10:02ambroseb_is it actually 100% reliable to lookup :ns in Var meta?
10:02ambroseb_I always just get the Java field.
10:02Anderkentah, that I wouldn't know
10:02Anderkentwhy wouldn't it be? :P
10:02ambroseb_I don't know. I don't trust metadata very often :)
10:02ambroseb_probably because ... yea types.
10:07Anderkentclojure.lang.ArityException: Wrong number of args (-1) passed to: instrument$form-type
10:07Anderkenti love this
10:07ambroseb_what does that mean?
10:07Bronsathat happens when you have a runtime error inside a macro
10:08Bronsae.g (defmacro x [] (map)) (x) ;=> ArityException Wrong number of args (-2) passed to: core$map clojure.lang.Compiler.macroexpand1 (Compiler.java:6473)
10:09ambroseb_,(inc Bronsa)
10:09clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: Bronsa in this context, compiling:(NO_SOURCE_PATH:0:0)>
10:09ambroseb_(inc Bronsa)
10:09lazybot⇒ 10
10:09Anderkentyes, I believe I was explaining that to someone months ago just here :P
10:09Anderkentor rather, it happens when you have an ArityException inside a macro
10:10Anderkentbecause macroexpand catches that and substracts 2
10:10mikerodjust don't pass -2 arguments to map, no problem
10:10BronsaI tracked it down in Compiler.java but could never come up with a fix
10:10BronsaAnderkent: yeah, for &form and &env
10:10mikerodah
10:10AnderkentBronsa: use a different exception for macro arity exceptions, perhaps?
10:11Bronsahow? macros are just fns
10:12Anderkenthm. check your metadata when throwing it? :D
10:12crocketWhat is a good datalog library for clojure?
10:13crocketLet's exclude Datomic for now.
10:13BronsaAnderkent: I don't believe AFn.throwArity can access the var's metadata
10:14AnderkentCould you tell AFn if it's a macro when constructing it?
10:14Bronsano
10:14Bronsathe macro is set at the Var level, not the fn level
10:14Anderkentright, because it's just (with-meta (fn*) ...)
10:14Anderkentyeah i see your point
10:14Anderkentugh
10:14Bronsanot really, it's (def x (fn* ..)) (.setMacro #'x)
10:15Anderkent,(apply @#'or [false false true])
10:15clojurebottrue
10:15Anderkentheh
10:16Bronsayou're calling (or true) with that
10:16Anderkentoh right
10:16Anderkent,(apply @#'or nil nil [false false true])
10:16clojurebot(clojure.core/let [or__3943__auto__ false] (if or__3943__auto__ or__3943__auto__ (clojure.core/or false true)))
10:16Anderkentthat makes more sense
10:24BalvedaWhat's a good CLJS library for jquery like functionality?
10:25Anderkentonly one I've heard of is dommy
10:26xeqiBalveda: https://github.com/ibdknox/jayq is a wrapper around jquery. I've been using https://github.com/Prismatic/dommy/ lately
10:26ddellacostaBalveda: I've used a lot of domina, which works well enough, but I feel like the library is rapidly falling into disuse as maintenance seems to really have lagged. To echo Anderkent, dommy really seems to have promise.
10:26ddellacostaand what xeqi says re: jayq, if you want something that explicitly wraps up jQuery
10:27ddellacostaBalveda: I should add, you can use the google closure lib stuff directly pretty easily as well, they are "built in" so to speak.
10:27ddellacostaactually, I came on here to ask if anyone knows the fate of domain--are there any plans to revive it?
10:28ddellacostadomain -> domina
10:28xeqigoogle closure lib stuff: http://docs.closure-library.googlecode.com/git/closure_goog_dom_dom.js.html
10:37silasdaviswhat's a nice clojurey way to fire an async task, but only start it if the last one has finished, and only ever queue at most one
10:46silasdaviscan I set a maximum queue size for an agent
10:46crocketIs there a good Datalog library?
10:48crocketI'm looking for SQL DB alternatives.
10:51Rubix&(doseq [e (list 0 1 1 2 3)] (println e))
10:51lazybot⇒ 0 1 1 2 3 nil
10:52Rubix&(map :name (filter #(contains? :type) (:members (clojure.reflect/reflect "foobar"))))
10:52lazybotclojure.lang.ArityException: Wrong number of args (1) passed to: sandbox91102$eval135274$fn
10:55noncomread-string reads one form from the string, but is there any common method to read the next form, and then next.. so i have a sequence of forms?
10:56Rubix&(map :name (filter #(contains? % :type) (:members (clojure.reflect/reflect "foobar"))))
10:56lazybot⇒ (count value CASE_INSENSITIVE_ORDER serialVersionUID hash offset serialPersistentFields)
10:57Rubixthere we go... any idea how I can use data member names to automagically build a key-value map from a pojo ?
10:57jkkramernoncom: you can find that in several utility libs, such as flatland's useful
10:58noncomthank you very much!
11:00noncomRubix: maybe you find some inspiration here: http://aurellem.org/cortex/html/util.html
11:01Rubixnoncom: what is all this
11:01Rubix?
11:05noncomRubix: sorry, i totally messed it up
11:06noncomthat's a very different thing
11:11Rubixnoncom: it's okay
11:13noncomRubix: somewhere on that website i saw a good example of wrapping java classes and stuff into clojure,much like you said, but I can't it find there now.. maybe i remember it wrong or it has moved..
11:14crockethmm
11:14crocketClojure doesn't seem to have nice database libraries yet.
11:14crocketsqlkorma and ClojureQL look promising, but they lack ORM capabilities.
11:14Rubixnoncom: I've got some hacky java.data from-java defmethods, but I don't want to write them for every java class I have
11:14sdegutiscrocket: datomic is the best db lib I've seen to date
11:15sdegutiscrocket: (in any language actually)
11:15crocketsdegutis, However, datomic-free puts a lot of restrictions.
11:15sdegutiscrocket: like?
11:15noncomRubix: there he somehow took the names of the fields/classes, turned them into keywords or symbols and related them to clojure.. sorry, can't say more, I don't remember..
11:16crocketsdegutis, datomic-free supports embedded datalog engine, and embedded memory database.
11:16sdegutiscrocket: I don't see how that's a restriction...
11:16callencrocket: Korma is pretty intentionally designed not to be an ORM and you're going to have a very hard time convincing anybody capable of writing the sort of library you want that it's a good idea.
11:16crocketsdegutis, I don't plan to use memory database.
11:17sdegutiscrocket: you don't have to use a memory database, that's only there to help you for testing
11:17callencrocket: if you have specific recommendations or requests, I highly suggest you post them to the github issues for Korma.
11:17Rubixnoncom: if you find it again, please send a link
11:17callensdegutis: inmem dbs make test runs a lot faster <3
11:17crocketsdegutis, I don't know which databases datalog engine supports.
11:17callencrocket: the default free edition of Datomic has free and mem. Free is h2.
11:17crocketh2 is mem
11:17callenthe pro edition...man why don't you just read the documentation?
11:18callenfree persists to disk.
11:18sdegutiscrocket: Free includes "Transactor-local Storage" which persists to disk
11:19crocketsdegutis, oops
11:19noncomRubix: maybe point 1.3 here: http://aurellem.org/cortex/html/world.html
11:19crocketsdegutis, Does it mean it can persist on postgresql?
11:19callenefjknrghnldfghg
11:19sdegutiscrocket: I know several people who say they use Free in production and don't have a need to upgrade to Pro
11:19callencrocket: it uses H2.
11:19sdegutiscrocket: I dunno what H2 is but it uses that
11:19crocketCan H2 persist on disk?
11:19sdegutiscrocket: http://www.h2database.com/html/main.html
11:20callencrocket: http://docs.datomic.com/storage.html just read the docs.
11:20sdegutiscallen: to be fair, I couldn't easily find that page from their home page
11:21callensdegutis: found it with google and a two word query
11:21callenand I just woke up.
11:21sdegutiscallen: then you're smarter than us
11:21callenno I'm just less lazy.
11:21callenand actually google things and read documentation.
11:21sdegutisif you say so
11:22callenin no way is googling `datomic storage` novel.
11:23sdegutiscallen: not everyone thinks the same way, give us a break
11:23crocketcallen, It's sad that datomic-free doesn't support postgresql anyway.
11:23callensdegutis: that's what I'm fixing. I'm impressing into you two that you should just google/read.
11:24sdegutiscallen: no, you're just making people defensive
11:24callenquerying other humans (a high latency request) should be reserved for when it's not actually facile to get the answer with obvious google queries.
11:24sdegutisAnd defensive people don't usually think about how to improve themselves, they think of how to defend themselves.
11:24callenby a sleepy coffee-less grumpy programmer first thing in the morning no less.
11:25sdegutisYou catch more flies with honey than with vinegar.
11:28seangrov`sdegutis: We have a fruit-fly trap here... telling you, apple-cider vinegar, dozens and dozens more flies
11:28callenseangrov`: you missed out on a great conversation after the meetup.
11:28seangrov`Will scroll up and check it out in a bit
11:29callenseangrov`: no no, it was in person.
11:29callenseangrov`: at the meetup, after the meetup. there were 5 of us.
11:29seangrov`Ah, bummer
11:34sdegutisHeh, I wanted str.indexOf() the whole time.
11:34sdegutisShould have figured it would be in Java.
11:35TimMcseangrov`: No fair, those are vinegar flies.
11:35sdegutisSo btw, with type hints, parsing my string is the same speed as tokenizing the same string without type hints, which is a 5x increase in speed. That's pretty cool.
11:41Rubixnoncom: that will give me a starting point, thanks very much!
11:53cmajor7given a snippet of "lazy-select" for korma: https://gist.github.com/toby/3783867 how to call that given a full "statement": e.g. (lazy-select users (fields :x :y) (where {:x 42 :y "fourty-two"})) ?
11:53cmajor7I feel there is something quote/paren/slice related..
11:54coventryWould it make sense for multiarity-for-speed functions to be built with macros, so that they could go all the way out to 20-arity?
11:54cmajor7,(source partial)
11:54clojurebotSource not found\n
11:55cmajor7coventry: take a look at (source partial), it is built upto 3 though..
11:55coventrycmajor7: I was looking at it. Doesn't use macros.
11:56cmajor7coventry: right, and it is fast too
11:56cmajor7coventry: and composable
11:57coventryWRT fast, it only goes to three arguments. WRT composable, it would still be a function, just constructed programattically. Like `(defn partial ~@(loop which makes the various arity signatures.))
11:58cmajor7coventry: is there a real performance problem, or just "curiosity"?
12:00cmajor7coventry: in your example there could only be a single "defn partial" with a fixed n params for a given namespace
12:01coventryCuriosity. It might be an easy win, though. I think you could do a multi-arity defn the way I outlined. Hang on...
12:12hyPiRionnoncom: it was clojurebot who gave it to you, I've just overheard earlier conversations
12:12hyPiRion~mapply
12:12clojurebotYou have to do something like (defn mapply [f & args] (apply f (apply concat (butlast args) (last args)))), which just goes to show why unrolled keyword args are a bad idea
12:12pizzasauces
12:14silasdavisI'm trying to implement an agent that effectively has a maximum queue of length 1
12:14silasdavisI'd like to avoid using an is_running flag that I have to set and unset if possible
12:14silasdavisis there a nice way to do this
12:14silasdavis?
12:14eric_normandsilasdavis: what happens when you send to an agent that already has a full queue?
12:16hyPiRionAnd what happens when you request an agent that has no elements in the queue?
12:16hyPiRion(And, why not use Java's blocking queues?)
12:17tobypcmajor7 also see this: https://gist.github.com/toby/113814480a4e79d186c9
12:17silasdaviseric_normand, didn't know the queue could be full...
12:17tobypwhich I use in addition to the other one
12:18eric_normandsilasdavis: you said it had a maximum of 1. if there's one in it, it's full, no?
12:19tobypkc = korma.core
12:20mdrogalissilasdavis: Yeah, using a queue is definitely what you want here.
12:20silasdaviseric_normand, sorry that's what I'm trying to implement. I can think of various ways to do it, but not being very familiar with clojure's async plumbing I'm wondering if I can exploit some feature of agents that already exists
12:21mdrogalisBlocking queues & core.async are straightforward, you can pick it up fast.
12:21eric_normandsilasdavis: So I don't understand exactly what you want to do.
12:22eric_normandsilasdavis: but perhaps you should check out executor service.
12:22eric_normandsilasdavis: which has a queue (you decide which) and runs jobs in n threads (you decide n)
12:22cmajor7tobyp: thx. not sure I get it :) can the first one (https://gist.github.com/toby/3783867) be used by itself? and if yes, how do I pass that statement.. as a string?
12:23eric_normandsilasdavis: and I am happy to help
12:23muhoowhenever i have more than 3 args i end up just passing a map instead
12:23eric_normandsilasdavis: I recently did something similar myself
12:24muhoohaven't really dug into keyword args. huge lists of args smells funny to me.
12:26tobypcmajor7 yes the first one can be used by itself but it takes a korma query as the "statement" not a string
12:27tobypanything you'd make with (select* ...) in korma
12:30silasdaviseric_normand, thanks
12:30silasdavisI'll be using a ScheduledExecutor through at-at
12:30silasdavisI have one thread-pool watching some filessytem locations
12:30sandbagsafternoon
12:31silasdavisI'll have those functions add to a blocking pool
12:31silasdavisblocking queue sorry
12:32silasdavisand have some other periodic funciton process the queue
12:33eric_normandsilasdavis: and the queue needs to be length 1?
12:33eric_normandsilasdavis: sounds like you can use agents that read from a blockingqueue
12:34aaelonyA few days ago I set DISPLAY=localhost:10 to be able to view x11 things from a clojure project. I didn't anticipate that this would interfere with anything, but now when I try "lein ring server-headless" I get a nasty error msg of "Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using '' as the value of the DISPLAY variable." I've tried various values for the DISPLAY without success. Any help
12:34aaelonyinsight as to the cause appreciated.
12:35silasdaviseric_normand, actually I think I can actually just use an atom 'next' instead of a queue
12:35silasdaviseither it is a function or nil
12:36silasdavisthen just poll it
12:38eric_normandbe careful with race conditions
12:39s4muelaaelony: give DISPLAY=0:0 a shot
12:39s4muelaaelony: that's the default IIRC
12:40mtp:0
12:40technomancyserver-headless shouldn't care though
12:40mtpnot 0:0
12:40mtpaaelony: also 'export DISPLAY'
12:40mtpotherwise the subprocesses your shell spawns won't get that in the environment
12:41coventrycmajor7: Not sure how to get the eval out of there, but this demonstrates that it is possible to define multiarity functions in this way: https://www.refheap.com/18396
12:42coventryThe multiarity-for-speed functions in clojure/core all have a similar structure, so you could probably make a macro to get them all.
12:45noncomhyPiRion: right, now I remember! it was him
12:48coventryOh, that leaves off the higher-arity branch, too. Anyway...
12:50sdegutisIn programming, there's a fine line between right/wrong and subjective opinion.
12:51sdegutisAlso, core.async is really really cool.
12:53dnolensdegutis: it is!
12:53sdegutisI think I now have no more reason to envy Go.
12:57callenthe moment I started working with a queue and callbacks, I suddenly had a lot of reasons to enjoy using core.async
12:57callenimmensely grateful it exists.
12:58sdegutis:)
12:59dnolensdegutis: for ClojureScript it's a killer app, might be for Clojure as well but I'm more of a front end person.
13:00kmicukiller lib
13:06mdrogalisdnolen: Combining j.u.c blocking queues and go blocks make life pretty awesome too
13:06mdrogalisSuddenly you can produce/consume with much much greater parallelism
13:06sdegutisdnolen: That surprises me, since I figured core.async on CljS would be less useful on account of lack of threads.
13:08dnolensdegutis: client side apps are highly asynchronous and thus highly concurrent, so core.async is a pretty fantastic tool. as Rob Pike says, concurrency != parallelism
13:08bbloomdnolen: s/client side apps/networked apps/
13:08technomancyI've never understood Pike's definition of parallelism
13:09bbloomdnolen: personally, i'm much more excited about doing streaming protocols instead of REST style APIs
13:09dnolenbbloom: yes, but GUIs trump networked apps in nearly everywhere in terms of complexity IMO ;)
13:09bbloomdnolen: i don't buy in to the notion that UIs are inherently asynchronous :-P
13:09technomancyit seems he uses it to mean "two things are literally happening at once" rather than "the same computation is being performed on different pieces of data at the same time"
13:09dnolenbbloom: I'll wait patiently for that blog post.
13:09bbloomdnolen: but that's just the game developer in me talking
13:09technomancywhich doesn't really make sense given ... the English definition
13:09sdegutisdnolen: heh good point
13:10bbloomdnolen: i've got far too many projects going on at once. working on the UI stuff today, trying to make that the #1 priority
13:11sdegutistechnomancy: I think he focuses more on "concurrency" (by which he means a program designed to be split up into multiple linear steps that communicate with one another via channels) and defines "parallelism" as "what you thought concurrency was but it isn't because of my defintion"
13:11dnolensdegutis: I don't think his definition is that complicated, people had to deal with concurrency long before they had real parallelism
13:11technomancysdegutis: yeah but doesn't he use "concurrency" to mean "you can think of it as things happening at the same time even if they're not"
13:12technomancywhich I would call "the illusion of concurrency"
13:12bbloomtechnomancy: it's pretty simple: concurrency means that two things occur over overlapping time spans. parallelism means that any some particular point sample, two things are simultaneously occurring
13:12dnolentechnomancy: that doesn't make sense to me.
13:12bblooms/any/at/
13:12sdegutistechnomancy: the best analogy I know of that explains what Rob Pike thinks concurrency means is "source-code-centric parallelism" rather than "execution-time parallelism"
13:12technomancybbloom: that's not what concurrency means in english though
13:12sdegutisi.e. your source code is doing multiple things at once, not the runtime.
13:13technomancysdegutis: right, hence the illusion
13:13dnolentechnomancy: if it's single core and something is diving up the time for your it's effectively concurrent. whether it's really running at the same time is irrelevant.
13:13bbloomtechnomancy: and parallel means something different in english too
13:13dnolentechnomancy: not an illusion, since you have to deal w/ it.
13:13sdegutisheh
13:14sdegutisBut even if it wasn't running in parallel, I really liked thinking in goroutines/channels.
13:14technomancytaking words and inventing new meanings that are the opposite of their existing definitions is literally the worst thing you can do.
13:14sdegutisIt's another step in structuring my code properly.
13:14bbloomtechnomancy: i don't think it's the opposite definition at all....
13:15callenwe've had this conversation before guys
13:15callenit didn't end well
13:15sdegutisLook, let's all just agree that Erlang > Go, ok?
13:16technomancydnolen: "effectively concurrent" would be a good way to put it
13:16technomancyvs "literally concurrent"
13:17bbloomtechnomancy: i think the point your missing is that parallelism implies concurrency
13:17technomancybbloom: eh; I understand that
13:17sdegutisWhen I first started learning about channels/goroutines, I remember being confused by this, so I looked up "concurrency" in the dictionary and it said "existing, happening, or done at the same time".
13:17callenbbloom: it doesn't have to.
13:17callenparallelism and concurrency are independent of each other.
13:18sdegutisAnd that strongly implies that at runtime, the things are executing ("happening") all "at the same time"
13:18bbloomcallen: how can something be parallel and not concurrent?
13:18technomancythat's just another way of saying literal concurrency is a subset of effective concurrency, which is basically a truism
13:18callenbbloom: half the stuff Haskellers do.
13:19coventryIs there a way to make ##`{~@(range 10)} DWIM?
13:19bbloomcallen: you're gonna have to be more specific
13:19callenbbloom: contrived example, array with two elements
13:19bbloomcoventry: what do you mean?
13:19callenmap an fn across said array
13:19callensingle thread? no concurrency, no parallelism.
13:19dnolen,`(~@(into [] (range 10)))
13:19clojurebot(0 1 2 3 4 ...)
13:19dnolencoventry: ^ or something like that
13:20callenmap across the fn in parallel haskell style and you're parallelizing but not introducing concurrency or non-determinism into your code.
13:20technomancyI'm gonna keep calling it "literally concurrent" kthxbai
13:20callenyou're just performing the work "simultaneously" for the purposes of the user-programmer.
13:20coventrybbloom, dnolen, some way to syntax-quote straight into a map.
13:20TimMc&`{~@(range 10) ~@[]}
13:20lazybot⇒ {0 1, 2 3, 4 5, 6 7, 8 9}
13:20hyPiRion(inc TimMc) ; beat me to it
13:20lazybot⇒ 47
13:20Bronsacoventry: not without some trick
13:21TimMccoventry: ^ Only via a trick.
13:21technomancyBronsa: tricks are what we do best around here
13:21coventryTimMc: thanks. What is the trick there?
13:21TimMc(inc hyPiRion) ; for actually coming up with that in the first place
13:21lazybot⇒ 22
13:21callenbbloom: thus, parallelism without concurrency.
13:21dnolencoventry: oops sorry missing the bit about hash-map
13:21callenhttp://existentialtype.wordpress.com/2011/03/17/parallelism-is-not-concurrency/
13:21TimMccoventry: Reader expects even number of *expressions* in the { form.
13:21callenas I've said time and time before, concurrency is non-determinism.
13:21silasdavishow can I do something like (map .getProtocol urls) instead of (map #(.getProtocol %) urls)?
13:21coventrydnolen: No worries. TimMc: Got it, thanks.
13:22rasmusto&`{~@(range 9) ~@[]}
13:22lazybotjava.lang.IllegalArgumentException: No value supplied for key: 8
13:22TimMccoventry: So you give it a second one that expands to nothing.
13:22technomancypike's way of redefining things kinda reminds me of http://martinfowler.com/articles/mocksArentStubs.html
13:22technomancy"hey everyone, it would be great if you could start using these existing terms the way I say you should, thanks"
13:23callenPike is a religious lout.
13:23sdegutisWelp, my parser's not complete, but getting there.. https://www.refheap.com/18399
13:24bbloomcallen: i've read that before & i don't know if i buy that argument. Bob Harper is clearly a smart guy, but I'm not sure I buy in to many of his view points
13:24callenbbloom: I don't buy into everything he says but he's far from the only person that understands concurrency and parallelism are independent of each other conceptually.
13:24dnolenbbloom: understatement about Mr. Harper :)
13:24callenbbloom: concurrency is principally about non-determinism, systems for managing concurrency are about controlling non-determinism.
13:25bbloomdnolen: the smart guy point, or the non-buyin part? :-P
13:25dnolenbbloom: both
13:25callenthis is something I've understood since even back before I'd taken FP seriously, I don't know why this is a contentious point to make.
13:25dnolenbbloom: incredibly smart, and says things I don't buy at all.
13:25dnolencallen: +1
13:26bbloomcallen: i don't buy the argument that concurrency is inherently about non-determinism either
13:26bbloomcallen: there are deterministic concurrency models
13:27callenthe second part of my sentence was designed to address that
13:27bbloomcallen: such as http://lambda-the-ultimate.org/node/4699
13:28bbloomcallen: "determinism" and "non-determinism" are already useful adjectives. if you redefine concurrency to be about non-determinism, then you've eliminated a useful word without gaining anything
13:28callenno, it's a bit more subtle than that.
13:28bbloomit's also worth mentioning that words change meaning over time, particularly subtle ones
13:28callenand the second part of my sentence was designed to address deterministic methods for controlling concurrency
13:28bbloomparticularly in engineering fields
13:28callenyou could think of it in terms of interleaving if you wanted, but that's usually missing the more critical point.
13:29hyPiRionwords change meaning over time, except in Clojure, where we reverse the flow of time and say that simple is not easy
13:29bbloomi need 1) a pair of words to describe whether or not things happen with predictable order & repeatable results and 2) a pair of words to describe whether any point sample will include simultaneously occurring operations
13:29callenbbloom: also that system you linked isn't fully deterministic by any means.
13:30bbloomdnolen: i take particular issue with the "uni-typed" languages nonsense
13:31shaungilchristI suggest something related to groundhog day
13:31dnolenbbloom: I take massive issue with that as well. Far as I can tell non of strong typing goons have actually read any Haskell B. Curry
13:31bbloomdnolen: it's an issue of whether or not your VM's objects are tagless. Haskell is tagless… you know… except for sum types, which have tags…. and represent 99% of useful code in haskell
13:31dnolens/non/none
13:32bbloomdnolen: but i don't understand why anybody would want a tagless VM except for some key performance cases…. seems obvious to me that the preferable default is to have fully reflective objects for debugging, which implies tags
13:33dnolenbbloom: I think the point of tagless is simplicity and performance - but I agree it's a big tradeoff
13:33bbloomdnolen: but it's certainly not simple!
13:33bbloomdnolen: in order to be tagless, that means you must infer type from context
13:33bbloomdnolen: you're complecting type with access path
13:33dnolenbbloom: well simple in one regard, certainly the ramifications of reflection are pervasive
13:34bbloomdnolen: but consider discriminated vs non-descriminated unions in C
13:34bbloomdnolen: if i know from context, this union is a Foo and that one is a Bar, then i don't need that FooBarType enum
13:34bbloomdnolen: that's what tagless is about, to me anyway
13:35bbloomdnolen: that's why tagless representations are *insane* to me on the wire
13:35dnolenbbloom: this is true
13:35bbloomdnolen: b/c you have fundamentally two different paths: the code on both ends of the wire
13:36bbloomdnolen: this is also what the CLR's "value types" are about
13:36bbloomdnolen: only value types complect tagless with copy by value
13:37bbloombrb
13:40dnolenthis is kind cool https://github.com/niitsuma/Racket-miniKanren/tree/recursive
13:40dnolenminiKanren with support for infinite structures
13:40eric_normandbbloom: I think the uni-type idea (which only makes sense from a static typing point of view) IS the advantage
13:40eric_normandbbloom: one type means one interface
13:41eric_normandbbloom: which means better interoperability and reuse
13:41dnoleneric_normand: but this critique of uni-type is just false IMO. Haskell said you can overlay types based on what context you care about.
13:42eric_normanddnolen: so in that sense, type is more like haskell (language) type class?
13:43eric_normanddnolen: I must read this. Have a reference?
13:43dnoleneric_normand: not really, he specifically said keep pure untyped lambda calculus and you can place the types elsewhere
13:43dnoleneric_normand: which is effectively what Clojure programmers are doing!
13:43eric_normanddnolen: I see.
13:44dissipate__hmm, has anyone considered a web framework that is like opa where you write your entire web app in 1 language and the framework decides where to run the code automatically (on the server or the client)? except instead of javascript, it would be clojurescript?
13:44eric_normanddnolen: you are opening my head, which seems to be a can of worms!
13:44dnoleneric_normand: this is pretty dense and I've only skimmed it but http://people.uleth.ca/~jonathan.seldin/RCS2.pdf
13:45dnoleneric_normand: I only came to this realization because I heard Philip Wadler point this out
13:45eric_normanddnolen: static type checking is like parsing: easy to write a checker/parser, but hard to give error messages
13:45dnoleneric_normand: then I started hunting around for references
13:45eric_normanddnolen: thanks
13:46dnoleneric_normand: author of that paper also co-authored this which looks really good http://www.amazon.com/Lambda-Calculus-Combinators-Introduction-Roger-Hindley/dp/0521898854
13:46dissipate__has anyone considered a clojurescript web framework that uses node.js on the back end?
13:49callendissipate__: you're the first. go for it.
13:49dnolendissipate__: I fail to see the advantage over using the JVM on the backend. But I think people like the fact they can use Clojure on front/back even if it can't really be done transparently
13:49dissipate__callen: are you aware of the Opa web framework?
13:49callendissipate__: yes
13:50dissipate__callen: so you know what i am talking about? how it is all done in Opalang and it figures out where to run any particular function automatically, but still allows you to tag a function to run on either one specifically
13:50callendissipate__: yes.
13:50eric_normanddnolen: so much to read
13:50dissipate__callen: so why not the same with clojurescript? write your entire web app in clojurescript and the framework determines where to run the code?
13:50callendissipate__: take a look at shoreleave. cleaner model.
13:52eric_normanddnolen: I agree with the "weak uni-typed argument" (my own name)
13:52dissipate__callen: link? shore leave is giving me a bunch of unrelated hits on google
13:52eric_normanddnolen: which basically states that given a language with static type system, the only way to implement a dynamic type system (a la type tags) is to make every value of the same type
13:52callendissipate__: https://www.google.com/search?q=github+clojure+shoreleave&amp;oq=github+clojure+shoreleave&amp;aqs=chrome..69i57j69i64.4161j0j1&amp;sourceid=chrome&amp;ie=UTF-8
13:52eric_normanddnolen: (same static type)
13:53dnoleneric_normand: yes this whole view is just wrong
13:53callenSegFaultAX: wakie wakie ^^
13:53dnoleneric_normand: it's Church notion of typing vs. Curry notion of typing
13:53callenSegFaultAX: your uni-typed bullshit manifesto is getting called out. Time for school.
13:54eric_normanddnolen: well, I agree that it is wrong. but it's the only thing Haskell lets you do!
13:54bbloomeric_normand: http://existentialtype.wordpress.com/2011/03/19/dynamic-languages-are-static-languages/
13:54dissipate__callen: and how is that cleaner?
13:54bbloomeric_normand: that's what dnolen and i were discussing
13:54callendissipate__: it involves less cancer.
13:54dnoleneric_normand: yes Church notion of typing is a straight jacket, my theory why Milner got bored and moved onto Ubiquitous Abstract Machine
13:54cmajor7tobyp: had to take off to play some ping pong. thank you for defining the "statement", I'll give "select*" a shot
13:54dissipate__callen: cancer??
13:54lazybotdissipate__: Definitely not.
13:55tobypcmajor7 cool, let me know how it goes
13:55bbloomeric_normand: dnolen: in my opinion, tags are concrete things that exist on objects to help you differentiate them. like the .getType method on java objects. I'd call that getTag :-P
13:55eric_normandbbloom: yes, I recently read that
13:55callendissipate__: http://pages.citebite.com/b2x0j8q1megb
13:56sdegutisdnolen: I can imagine how core.async could turn an otherwise ugly callback chain into a linear workflow.
13:56bbloomeric_normand: dnolen: types are a more abstract notion. i view types as little monotonically increasing database values, like logic variables in core.logic or sussman's propegators. there are many type systems, since they are many logic systems. a type is the sum of proven or asserted facts about some particular variable or object
13:56dnolensdegutis: internally yes, though you do have lift all your async code into world of channels. But I think it's fair tradeoff for being able to write sensible code
13:57bbloomeric_normand: dnolen: the other interesting concept that isn't discussed much was pointed out to me recently by kovas: http://en.wikipedia.org/wiki/Head_(linguistics)
13:57dissipate__callen: you have a point. i'm definitely no fan of node.js
13:58eric_normandbloom, dnolen: I totally disagree with the major thesis of the uni-type argument: "rather than affording the freedom to ignore types, they instead impose the bondage of restricting attention to a single type!"
13:58sdegutisdnolen: not that I'm a huge front-end dev, but I've seen solution after solution for this problem in the past 5 years, and none of them seemed very elegant. This one may be.
13:58bbloomeric_normand: dnolen: you might have an object '(+ 2 4) with tag clojure.lang.PersistentList, and it might have a type that includes IPersistentList, and ISequential, and a whole bunch of other stuff, the *head* of that expression is clojure.core/+
13:58bbloomeric_normand: dnolen: but the "head" of 5 is Integer :-P
13:58dnolensdegutis: it's the best I've seen, that's for sure. If we can drag everybody into maybe we'll actually come up with something better
13:58sdegutisheh
13:58dnolenbbloom: interesting
13:58callensdegutis: if somebody asked me how to write a SPA, I'd say to do it in core.async or angularjs.
13:59bbloomdnolen: tags, types, and heads… on my infinitely growing blog TODO list :-P
13:59callenbbloom: what's infinite growth?
13:59calleninfinite acceleration or unceasing incremental growth?
14:03eric_normandbbloom, dnolen: adhering to a single type is no more a bondage than adhering to HTTP is bondage
14:03eric_normandbbloom, dnolen: in fact, it is freeing in that it solves a very difficult n x m problem
14:04dnoleneric_normand: honestly part of me agrees w/ Harper on this point. There no such thing as uni-typed anyway the types are somewhere. It's just a matter of whether they are part of the terms or somewhere (including your head)
14:04dnolen"somewhere else"
14:05eric_normandbbloom, dnolen: and this is on top of the fact that static checking and dynamic type tags are not mutually exclusive
14:05eric_normanddnolen: agreed
14:05bbloomeric_normand: yeah, i think at the representation level, it's a good thing
14:06eric_normanddnolen: uni-typed is always "for a given static type checker"
14:07bbloomeric_normand: right. it's always a matter of perspective
14:08eric_normanddnolen: for instance "the only way X expression is allowed by Y type checker is if X uses a single type in Y"
14:09bbloomeric_normand: any given object might have a VM tag, a metadata tag, a first element in a list that acts as a tag, a key in a map, etc. same idea applies to types
14:09eric_normandbbloom, dnolen: I'm glad we're all in agreement!
14:09bbloomeric_normand: heh, yup :-)
14:10eric_normandbbloom, dnolen: I'd love to see a plethora of static analysis (not only type!) checkers for Clojure
14:10eric_normandbbloom: especially programmable ones that you can customize for your invariants
14:10bbloomeric_normand: well, we got type hints for java tags, plus core.typed for general type theoretic consistency checking & there are like half a dozen schema systems
14:11bbloomeric_normand: i'd personally like to see a core.logic powered pluggable theorem prover… get on that dnolen :-P
14:11eric_normanddnolen: yeah, why haven't you done that? :)
14:13coventryThe first two arguments to the "." special form are special, and the rest are evaluated as clojure, right? I'm talking about just "." by itself, not any of the macros which expand into it like (.length "foo")
14:13bbloom(doc .)
14:13clojurebotHuh?
14:13bbloomaw.
14:14bbloomwait a minute....
14:14bbloom##(doc .)
14:14lazybot⇒ "Special: .; The instance member form works for both fields and methods.\n They all expand into calls to the dot operator at macroexpansion time."
14:14bbloomyeah. wtf. i wanna file a bug report on clojurebot
14:15coventrybbloom: That has a lot about the macros, not so much about the special form "." which they macroexpand into. ##(macroexpand '(.length "foo"))
14:15lazybot⇒ (. "foo" length)
14:15bbloomhttp://clojure.org/java_interop#dot explains it
14:15bbloomcoventry: go to "The Dot special form" section
14:20coventryThanks, I read that before but was confused. Reading it again having played around a bit, I get it now. I guess the answer is no, (. instance-expr (method-symbol args*)) doesn't match that pattern.
14:25sdegutisOh, I get it.
14:26TimMchyPiRion: nephila has an example graph in its README now; thanks for the tip. https://github.com/timmc/nephila
14:26sdegutisThe Ruby community fell into the trap of putting bikeshedding into action.
14:26sdegutisAnd the JS community.
14:26sdegutisThat explains everything.
14:26coventryHmm, "." will silently take extra arguments ##(. "foo" (charAt 2) 5)
14:26lazybot⇒ \o
14:27TimMccoventry: As will var.
14:27eric_normandwould love a static information system that told me the invariants of an expression (locally)
14:27coventryTimMc: Thanks.
14:28TimMcThe perils of hardcoded forms.
14:28eric_normandmeaning, given (map f xs), it would tell me "f has to implement IFn, xs must be ISeqable, etc"
14:28TimMc*special forms
14:33sdegutisI think Google has the right approach: any sufficiently complex tool needs to be built custom-made from scratch.
14:33sdegutisWhen's the next Conj?
14:33sdegutisoh wait, googling
14:33callensdegutis: you're learning >:)
14:34TimMc"The beatings will continue until googling improves."
14:35sdegutiscallen: more like "now I'm remembering"
14:35sdegutisI used to be a bad IRC citizen and then turned into a good one, and sometimes bad habits resurge for a tiny while.
14:42callensdegutis: http://i.imgur.com/6DXhpyF.png
14:44sdegutisuhh
14:46TimMcTo get your random API learnin' of the day, just run: (->> clojure.core quote the-ns ns-publics seq rand-nth val meta ((juxt :name :doc)) (map println) dorun)
14:47bbloomTimMc: glorious.
14:47callenTimMc: <3 love it.
14:48TimMcalias learn=java -jar ~/.m2/repository/org/clojure/clojure/1.5.1/clojure-1.5.1.jar -e '(->> clojure.core quote the-ns ns-publics seq rand-nth val meta ((juxt :name :doc)) (map println) dorun)'
14:48technomancylearnyousomeclojure
14:49TimMc(Oh, put some quotes around "java ...")
14:50callenTimMc: thank you. :)
14:51rasmustoTimMc: haha, cool
14:53TimMcAn alias I already have is alias cljhere="java -jar ~/.m2/repository/org/clojure/clojure/1.5.1/clojure-1.5.1.jar -e" which allows me to write things like cljhere '(java.util.UUID/randomUUID)'
14:53rasmustoTimMc: you can put :arglists in there too
14:55technomancyTimMc: grench eval dude
14:56TimMcheh
14:57TimMcStill calling it grench?
14:57drusellerstrying to find a word I can google for so I can understand the #' - context - (-> #'compojure-routes middle-ware middle-ware2)
14:57technomancywell... yeah
14:57callenTimMc: why not?
14:57TimMcOK, for some reason I thought you were planning on changing it.
14:58callendrusellers: (-> (var compojure-routes) middle-ware middle-ware2)
14:58TimMc&'#'foo
14:58lazybot⇒ (var foo)
14:59drusellersthanks :)
15:00hyPiRionTimMc: I want to add this in for a dependency too. Is that possible? E.g. leiningen-core AND leiningen
15:00hyPiRionnephila, that is
15:01TimMcNot yet!
15:01technomancyTimMc: I'm irrationally attached to the name despite it being objectively bad
15:01TimMcThat's what I figured. :-)
15:01TimMchyPiRion: Patches welcome! :-D
15:01hyPiRionTimMc: Argh, now I have something to do for this weekend
15:01hyPiRionclever girl.
15:02TimMcThis is still mostly a throwaway project.
15:04callenTimMc: wait what project?
15:04TimMcnephila
15:04callenhttps://github.com/timmc/nephila ?
15:04TimMchttps://github.com/timmc/nephila
15:04callenokay, thanks.
15:05sdegutisTimMc: to expand on that a bit: http://clojuretip.herokuapp.com/
15:05TimMcsdegutis: Nice.
15:05callensdegutis: did you just make that?
15:05sdegutisYes.
15:05callenlol.
15:05callen(inc sdegutis)
15:05lazybot⇒ 3
15:06TimMc(inc sdegutis)
15:06lazybot⇒ 4
15:06sdegutisFor v2, I plan to make it cycle all of them per session.
15:06sdegutisSo you don't get the same one for a long time.
15:06callenvery cool.
15:07TimMcsdegutis: You could grovel over github and build a frequency table, then weight rarer vars more heavily.
15:07sdegutisTimMc: if it skips common ones, that wouldn't help newbies as much
15:07gfredericksand it would probably lean toward useless things
15:07TimMcJust like me!
15:07gfredericksunchecked-add
15:07seangrov`TimMc: Any way to get nephila to work with cljs?
15:07gfrederickslocking
15:08TimMcseangrov`: No idea!
15:08hyPiRionTimMc: http://hypirion.com/imgs/leincore-deps.png <- Leiningen core. Trust me, it's not complex at all.
15:08TimMchyPiRion: That's nice and clean.
15:08coventryCan clojure objects have any influence over how they are displayed at the repl? Something like python's __repr__ and __str__ special methods?
15:08hyPiRionTimMc: many arrows though
15:09technomancyhyPiRion: doesn't catch the runtime-require =(
15:09amalloy&(doc print-method)
15:09lazybot⇒ "; "
15:09amalloy...
15:09llasramwhaaaat?
15:09hyPiRiontechnomancy: TimMc would probably say "patches welcome"
15:09coventryamalloy: Thanks.
15:09llasram##(doc print-method)
15:09lazybot⇒ "; "
15:09technomancylazybot: cool docstring bro
15:09llasramNice
15:10hyPiRionBetter to do source
15:11hyPiRion&(source print-method)
15:11lazybotjava.lang.RuntimeException: Unable to resolve symbol: source in this context
15:11callencute.
15:11hyPiRionat least that gave a better error message
15:11TimMcThe Midje graph is pretty unreadable. http://i.imgur.com/KIrwPXo.jpg
15:12technomancyrelevant: https://github.com/technomancy/bludgeon
15:12hiredmanTimMc: well so is midje
15:12TimMc:-P
15:13callenlol
15:13seangrov`TimMc: Looks like this is the responsible fn: https://github.com/clojure/tools.namespace/blob/master/src/main/clojure/clojure/tools/namespace/file.clj#L25
15:13TimMcseangrov`: Actually, could you file an issue?
15:13seangrov`Wonder how worthwhile it is to differentiate between clj and cljs files
15:14TimMcI don't know if I'll ever do more work on this plugin, but it would be nice to collect ideas.
15:14seangrov`TimMc: Sure, was just poking around to see how nephila determined which files to map
15:14callenTimMc: ava.io.IOException: Cannot run program "dot": error=2, No such file or directory
15:14hyPiRioncallen: install graphwiz man
15:14callendammit.
15:14hyPiRiongraphviz*
15:14TimMcsudo apt-get install graphviz or whatever
15:14callenhyPiRion: is graphwiz the graphviz for Wussians?
15:14hyPiRionWell, I think I didn't get the name for this
15:15hyPiRionI can't spell it.
15:15upwardindexAnyone using seesaw to make applets? I can't get anything to load (the java warning doesn't even popup)
15:20ztellmanapplets!
15:22upwardindexyes indeed!
15:23upwardindexlocalstorage is not enough for my clients
15:24callenhrm yes. indubitably.
15:24callenupwardindex: have you considered a database?
15:28squidzis anybody using schema with clojurescript? I can't seem to get this working (s/validate {"key" s/Number} {"key" 1}). if the keys are string it doesnt validate, if the key is a keyword it works fine though
15:29callensquidz: don't use strings? read the code?
15:29callenswizzle some pop rocks and cocaine?
15:29upwardindexcallen: yes unfortunately not possible in the context...
15:30callenupwardindex: is someone holding a gun to your head?
15:30squidzcallen: doesn't clojurescript automatically read json keys as strings?
15:31callensquidz: http://i.imgur.com/siOU3kj.gif
15:32TimMccallen: <_<
15:32upwardindexMy problem with laoding applet is actually bug in firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=907600
15:32squidzalright then, I guess somebody isn't in a helpful mood today
15:32bbloomcallen: you're being a dick again
15:32callenbbloom: so are you.
15:32squidzit may be the mrHyde library that is automatically converting js object keys to strings in clojure maps
15:32TimMcsquidz: What's the context, you're parsing JSON and then trying to validate it?
15:33callensquidz: clojure.walk.keywordize-keys
15:34squidzyes i'm reading in some json and it is being converted to maps like {"key" "somekey" "vals" [...]}, but I just realized it is the library that is automatically parsing it that way
15:35squidzI assumed that was how clojurescript parses js objects by default but I guess not.
15:36callensquidz: there's a patch-js-with-key-lookup in hyde that keywordizes.
15:36callenor should be, anyway.
15:38gfrederickssquidz: that looks like the sort of pattern you'd use when serializing to json from a context where keys can be arbitrary data
15:38gfrederickse.g., clojure/edn
15:38jkkramersquidz: for schema, believe you can do {(s/required-key "key") "somekey"}
15:39squidzjkkramer: right that is exactly what I was looking for
15:40squidzI see at the bottom of schemes tests now
16:00nopromptthere's way to much good stuff happening in the clojure world. it's distracting. :P
16:04upwardindexnoprompt: indeed, i fell off my chair this morning when I saw the piplin presentation
16:04unlinkI am able to create a working war file with `lein ring uberwar' and host it under tomcat; however `lein ring serve' exits without printing a message.
16:06dnolennoprompt: nice console lib
16:10seangrov`noprompt: I agree, looks very nice
16:13learner_hi. A newbie question here. At work I need to build an application that transforms XML. It should be able to accept Type A, B, C xmls and convert it to some internal format. then I can export it to other format. For example. If I get type A, I convert it to internal format and store it, which can later be converted to B or C. I am planning to use Java & some apache libraries that support XSLT. I am wondering if I can use Clojure fo
16:13ToxicFrog"can use Clojure fo"...it cuts off.
16:13learner_I am wondering if I can use Clojure for this. need your opinion. thanks
16:14upwardindexlearner_: the answer is yes
16:15learner_upwardindex: Thanks. are there any clojure libraries for this kind of need?
16:15rurumate_How to generate clojurescript compiler from source, please?
16:16upwardindexlearner_: depends on the format you want when you say "other format"
16:16seangrov`rurumate_: hrm?
16:17manutter_learner_: http://stackoverflow.com/questions/1194044/clojure-xml-parsing
16:17ToxicFroglearner_: clojure has built in clojure.xml library (parsing
16:17ToxicFrog) and xml-seq (walking the DOM produced by parsing); there's also more powerful libs like data.xml
16:18manutter_and clojure has good Java interop, so anything that's available for Java can generally be used in clojure.
16:18rurumate_seangrov`: I know I should not ask that here ;)
16:19seangrov`rurumate_: Just a bit confused about what you're looking for
16:21learner_upwardindex: manutter_: ToxicFrog: Thanks for your answers. So instead of writing XSLT, I will be writing functions. Am I right? or will I need XSL also?
16:22upwardindexlearner_: I don't know enough about your project to answer that question
16:22rurumate_seangrov`: oh, is it just a library? no standalone version?
16:23seangrov`rurumate_: If you're looking for the clojurescript compiler, it's here: https://github.com/clojure/clojurescript/
16:23rurumate_got that, I was just wondering how to build it
16:24manutter_learner_: is your internal/intermediate format supposed to be XML also, or are you ok with building a non-XML data structure
16:24manutter_If non-XML is ok for your internal data structure, you should be find just using clojure functions
16:24seangrov`rurumate_: script/bootstrap && script/build
16:24rurumate_seangrov`: there is no project.clj
16:25learner_manutter_: Internal format doesn't need to XML. it can be anything as long as it's structured
16:25seangrov`rurumate_: You can add a dummy one in
16:25teemujinhi im trying the tutorial on github - and ran into an issue.. is it ok to ask here?
16:25seangrov`Bronsa was on the hook to provide a dev one, I believe... :)
16:25manutter_learner_: Ok, so clojure functions should be fine.
16:25seangrov`anyone?
16:25clojurebotanyone is anybody
16:25seangrov`anybody?
16:25clojurebotanybody is anyone
16:25manutter_teemujin: ask away
16:26learner_manutter_: Thanks mate
16:26seangrov`Well, can't argue with that logic
16:26teemujini got to where it shows you how to load docs — and got this
16:26teemujinmy-stuff.core=> (user/clojuredocs pprint)
16:26teemujinLoading clojuredocs-client...
16:26teemujinWarning: Could not load the ClojureDocs client, so `clojuredocs` will be unavailable
16:26teemujin Details: #<FileNotFoundException java.io.FileNotFoundException: Could not locate cd_client/core__init.class or cd_client/core.clj on classpath: >
16:27teemujinits from this github tutorial: https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md
16:27learner_teemujin: did you try? (doc pprint)
16:27manutter_teemujin: You can use gists or similar services and then just paste the URL, looks better than pasting into IRC
16:27teemujinah ok sorry
16:27Bronsaseangrov` yeah, I put a patch on jira with a dev project.clj
16:27teemujinlet me try (doc pprint)
16:27manutter_teemujin: np, let me check out that tutorial so I'm on the same page as you
16:29teemujinthanks - it seems to not be following what the tutorial seems to imply will happen at that point
16:30manutter_Trying to duplicate your results in my local REPL
16:32technomancyteemujin: looks like the tutorial is out of date
16:32teemujinah just my luck :( well at least I don't feel as dumb now.
16:33technomancycdoc was removed because of common dependency conflicts
16:33teemujinok thank you for that info then - Ill continue past that part - hopefully the rest will be ok?
16:34technomancyyeah, I think so
16:34manutter_You can always just go to clojuredocs.org to get the docs, it just won't be within the repl
16:34technomancyhm; you should get a better error message too; that is kind a crappy
16:34manutter_I think clojure-docs.org is more up-to-date, though?
16:34technomancyteemujin: can you open a github issue reporting the problem?
16:35teemujinah yes sure I will - ill do so right now
16:35technomancythanks
16:35teemujinmany thanks for all you guys helping
16:35teemujincheers
16:35technomancyyou can add back in clojuredocs manually too; I will make sure the next release mentions that
16:37TimMcclojurebot, forget anybody |is| anyone
16:37clojurebotI forgot that anybody is anyone
16:37TimMcclojurebot, forget anyone |is| anybody
16:37clojurebotI forgot that anyone is anybody
16:40nopromptdnolen: thanks for the hat tip.
17:01upwardindexI uberjar :aot :all and :omit true and somehow something is trying to read file data_readers.clj at run time?
17:01upwardindexhttps://www.refheap.com/18404
17:02llasramupwardindex: Yeah. data_readers.clj isn't actually a clojure source file -- it's an EDN data file
17:03llasramupwardindex: It needs to be available as a resource (i.e., on the classpath somehow) to work
17:04upwardindexllasram: is that recent? 1.5?
17:07upwardindexllasram: am I right to conclude that applets cannot simply be uberjars anymore?
17:10eggheadapplets, hissssss
17:12mercwithamouthhi, would anyone say haskell is much harder to get a grasp on than clojure?
17:13Rubixmercwithamouth: the answer is contextual. In the extreme.
17:13nDuffmercwithamouth: I wouldn't say that it's harder to learn. It's harder to use for real-world programs involving lots of side effects.
17:14mercwithamouthhmm, fair enough
17:14nDuffmercwithamouth: ...but before you start getting into the real-world side of it (heck, even after you do), haskell has a lot of conceptual beauty.
17:14dobry-denAnyone doing Clojure Cup?
17:15mercwithamouthnDuff: it's syntax looks rather scary though cleaner than clojure(at first)
17:15mercwithamouthor well it seems like a HUGE language...
17:15technomancydepends on how you feel about memorizing a lot of precedence rules
17:15rurumate_seangrov`: thanks (sorry I'm a bit slow)
17:16somethingis there any good way to make a vector into a queue? since conj and pop make it work like stack, but queue seems more difficult
17:16amalloy&(into clojure.lang.PersistentQueue/EMPTY [1 2 3 4])
17:16lazybot⇒ #<PersistentQueue clojure.lang.PersistentQueue@e41ad382>
17:16amalloydoesn't print nicely, but works fine
17:17somethingthen conj and pop work opposite?
17:17amalloythey act like queues
17:17coventryIs there a function which gives an empty version of whatever collection is passed? Like (cond (list? arg) () (vector? arg) [] etc.
17:17amalloycoventry: have you tried...empty
17:17rasmusto,(empty [])
17:17clojurebot[]
17:18coventryThanks.
17:19bbloomamalloy: sadly: ##(empty 123)
17:19lazybot⇒ nil
17:19bbloomamalloy: i've run in to this problem several times ##(-> {:x 1} first empty)
17:19lazybot⇒ nil
17:22dobry-denamalloy: awesome. i never would have known about that.
17:22bbloomamalloy: makes it hard to write generic operations that also work on maps…. MapEntries are generally vectors, except when they aren't...
17:22dobry-denPersistentQueue
17:22mikerodI will com.stuartsierra/clojure.walk2 had a version out on clojars :)
17:23xeqitop
17:27dobry-den {:db/id #db/id[:db.part/db]
17:28dobry-denWhoops. The above is a key/val you'd use in Datomic. How can I understand what the syntax #db/id[...] is doing?
17:29dobry-denNot what it does in Datomic, but what that actually means in Clojure.
17:32coventrydobry-den: That is a reader literal. http://clojure.org/proposed-updates
17:34dobry-dencoventry: awesome. thanks
17:42coventryI'm working on a tool which walks into a fully macroexpanded form and instruments it with tracing wrappers, sort of like emacs's edebug. Different special forms in clojure need different wrapping logic, and I've grouped the forms where I can use the same logic into maps and sets, which I then dispatch off in a big cond. It feels clumsy. I welcome suggestions about better ways to do it. https://www.refheap.com/18409
17:42coventry(BTW, I haven't written the handlers for the different logic, so that code is untested and probably contains errors. I'm just looking for suggestions about the overall organization at the moment.)
17:43seangrov`coventry: Sounds pretty interesting to use, but no suggestions
17:46mimieuxHi all
17:46mimieux!
17:47mimieuxHow would be the fn signature for a send to agent call?
17:49technomancymimieux: should take the current value of the agent plus any other args you provide to send
17:50mimieuxtechnomancy: Ok, I got it.
17:58clj_newb_2345i'm switching off of emacs live
17:58clj_newb_2345anyone have a suggestion for a tutorial on manually settting up a powerful emacs / clojure setup?
17:58clj_newb_2345something like "emacs/clojure" from scratch in the spirit of "linux from scratch"
17:58clj_newb_2345a tutorial that walsk me through what to isntall, why I wnat to use it, and how to use it
17:58technomancyclj_newb_2345: start here: https://github.com/technomancy/better-defaults
17:59clj_newb_2345that's it?
18:00technomancyI've been meaning to write such a guide about recommended packages but haven't gotten much done yet
18:00clj_newb_2345I was thikning more alonnt the liens of nrepl, paredit, git stuff, ...
18:00technomancyhttps://github.com/technomancy/emacs-starter-kit/blob/v3/README.markdown
18:01clj_newb_2345it doesn't do anything besides lnk to better-defaults
18:01clj_newb_2345are you resting on your laurels from writing lein these days? :-)
18:01technomancyright; see the big "TODO"? =)
18:01technomancythat's where it would go
18:02technomancyvisualize some nicely-typeset, conversational prose walking you through which packages you should care about and why
18:02technomancythat's the starter kit v3; currently a work in progress
18:03rasmustoclj_newb_2345: magit, nrepl.el, paredit.el?
18:03clj_newb_2345we should do this
18:03clj_newb_2345we should force every contributor to clojure.core / clojure.contrib to lsit out which emacs packages they use
18:03clj_newb_2345that'd be enough for me
18:03technomancyI would add smex, idle-highlight, find-file-in-project, ido-hacks, elisp-slime-nav
18:05technomancyalso http://p.hagelb.org/nrepl-words.el.html obviously
18:05eggheadall the nice ido stuff disappear when I left starter-kit for better-defaults
18:06technomancyreally don't like the default nrepl-words-of-inspiration
18:06eggheadlol
18:07clj_newb_2345random curiosity
18:07clj_newb_2345has the clojure data structures by any chance ported to emacs?
18:08technomancyclj_newb_2345: emacs lisp doesn't have the necessary means of abstraction to create new data structures
18:09clj_newb_2345technomancy: what?
18:09clj_newb_2345emacs lisp is a lisp
18:09clj_newb_2345lisps are powerful
18:09clj_newb_2345powerful things can create new data structures
18:09clj_newb_2345wtf
18:10dnolentechnomancy: huh really, I see it has a vector type
18:10technomancyclj_newb_2345: emacs lisp is designed around the notion that mutable cons cells should be good enough for anyone
18:10technomancydnolen: sure, it ships with vectors out of th ebox
18:10technomancybut no one uses them; they are terrible
18:11technomancythey implicitly quote their contents, and none of the list-centric existing functionality works on them
18:11technomancyand anyway, you can't define new data structures beyond structs; nothing that can be anything close to first-class
18:12hiredmanquoted mutable lists are lots of fun
18:12callentechnomancy: you could do it.
18:12callenit just wouldn't be fun.
18:12dnolentechnomancy: oof implicit quoting, killer
18:12technomancyright
18:12technomancycallen: even if you had immutable lists, you couldn't get immutable strings
18:13technomancy(at least without sacrificing interop)
18:13technomancyit is a tale of heartache and woe
18:13callenyeah I'm not expecting interop
18:14callenI'm talking about a clj-universe-unto-itself in elisp.
18:14callenbuilt from the decaying corpses of bindat trees.
18:14technomancyhttp://technomancy.us/159
18:14callenso yeah, it's doable, but you shouldn't do it.
18:15technomancyright; it would be more like Kawa than Clojure
18:15callenmore or less.
18:15callenbut I'm not bothered that much by elisp, so I wouldn't do it.
18:17technomancyequality in elisp/cl is so gross =\
18:17callencore.async in Emacs would be fucking cool though :)
18:17technomancyI'd take referential transparency over homoiconicity any day
18:17callenprobably the strongest argument I know of for editors based on JS like LightTable.
18:17callentechnomancy: I'm headed in that direction, but I originally showed up to this party for the Lisp, not the FP.
18:18technomancyI think it means I'm getting old
18:18callenI do FP as a means to an end (preserving my sanity)
18:18technomancyvaluing correctness over flexibility
18:18callenI like to think of principled, well designed flexibility as a means to producing correct-ness.
18:18callenI think I'm in line with hickey on that.
18:19callenI think part of the problem with correct-ness is that all, *all* programs will forever and always be under-specified by their very nature - and should be. that's part of what makes producing software economical. You have to pick your battles.
18:20callenI'm not hostile to referential transparency or type-assisted programming by any means, I just refuse to be wholly subservient to either.
18:23technomancysure; I just mean if I had to pic kone
18:27callentechnomancy: mind a query?
18:27callenI won't be offended if you don't want me to bug you.
18:27technomancysure
18:46nopromptlein cljsbuild example <-- i want this.
18:46CaptainLexI mispronounced "doseq' when I read it the first time
18:46rasmustoCaptainLex: did you pronounce it like the beer?
18:46CaptainLexI thought "I don't always work with side effects, but when I do - I use doseq"
18:47rasmustoCaptainLex: :)
18:47CaptainLexrasmusto: You guessed it!
18:47dnolennoprompt: something more thnan this? http://github.com/swannodette/hs-async/blob/master/project.clj
18:47s4muelHahahaha.
18:47nopromptor rather `lein cljsbuild sample`
18:47nopromptdnolen: i want to see it on the cli though
18:47dnolenoh right, just to remember the options?
18:48nopromptdnolen: yeah. some of the more esoteric options i forget and either have to look it up or dig through my projects.
18:57nopromptincluding lein <command> sample seems like it would be a good staple for plugins with several options
18:58noprompthaving to revisit the READMEs or the source is a bit of a drag sometimes :/
18:58MisterSinisterSpeaking of Leiningen - how do I include local jars in a Leiningen project (i.e. without having them be in some repository online)?
18:59nopromptguess i'll could always roll up my sleeves and pitch in :)
19:00seancorfieldcore.async has found its way into our code base :)
19:00MisterSinisterI've tried reading the various online stuff about local jars and Leiningen, and *none* of them make much sense to me
19:02technomancyMisterSinister: probably because the question doesn't really make sense
19:02technomancywhy are you trying to avoid repositories?
19:03MisterSinistertechnomancy: So if I have a jar of Clojure utilities that only I ever use, I still have to reposit it somewhere before Leiningen can automatically manage it?
19:04technomancysure
19:04dissipate__what's the best book for learning in depth about macros? joy of clojure?
19:04MisterSinisterOK then.
19:04technomancyis `lein deploy clojars` too much work?
19:04MisterSinistertechnomancy: I get your point.
19:04CaptainLexdissipate_: I too wonder about this!
19:05MisterSinisterYeah - I'd like a resource on macros too, since I suck at them.
19:07dissipate__hmm, the current 'joy of clojure' book only looks like it has about 20 pages on macros
19:07MisterSinisterdissipate_: The others aren't much better.
19:08dissipate__that sucks.
19:08MisterSinisterThe only macro-focused book I know of is Paul Graham's 'On Lisp', but that's targeted at CL, not Clojure.
19:08dissipate__super lame
19:08MisterSinisterIt's got some good tips and ideas, but having to convert across the languages is annoying as fuck.
19:08MisterSinisterMostly because I really dislike CL syntax.
19:09CaptainLexMisterSinister: It's good for theory, though, right?
19:09llasramWhen I started using Clojure I was pretty excited about the potential of macros. In practice, you don't use them very often, and there really isn't anything "hard" about how you do use them
19:09CaptainLexI don't really understand the full theoretical power of macros
19:09dissipate__MisterSinister: but clojure smells of the 'cube farm'
19:09MisterSinisterCaptainLex: I *guess* so, but I'm not the best person to ask, honestly.
19:09MisterSinisterdissipate_: Explain?
19:09llasramThey're built-in code-generation in the same language you're writing in in the first place
19:10dissipate__MisterSinister: see this screed on clojure: http://www.loper-os.org/?p=42
19:10llasramWhich is amazing, but also not that difficult to get a handle on if you've gone code-generation anywhere else
19:11dissipate__"Clojure is the False Lisp, which Reeketh of the Cube Farm. A Lisp unworthy of the name; one which encourages users to pepper their code with calls to opaque routines having no underlying Lispiness. A Lisp which barfs Java stack traces. It promotes – no, mandates - the use of undigestable foreign matter in Lisp code: primitives on which you cannot pop the hood to reveal intelligible innards."
19:11llasramSo hilarious
19:11MisterSinisterdissipate_: I think that's a *little* extreme.
19:11MisterSinisterI guess for me, this is less of an issue, given that the programming I have to do is mostly for academic purposes.
19:11nDuffThe purists have a point. But that doesn't mean they can actually get anything *done* in their pure little world.
19:11arrdemMisterSinister: it's comming from the loper-os guy. what did you expect?
19:12MisterSinisterWhich means I don't have to use Java for... pretty much anything.
19:12CaptainLexYeah, I originally got into Clojure so I could use a specific Java library
19:12CaptainLexI'd probably be focusing more on Scheme if outside libraries weren't a concern :P
19:13dissipate__MisterSinister: he does have a point, but it is exaggerated.
19:13CaptainLex(Though I also really like Clojure's focus on immutability, which I think is missed too often by LISPs)
19:13MisterSinisterCaptainLex: I quite like the immutability as well. It makes it a hell of a lot easier to write programs for hacks like me. :P
19:13arrdemnDuff: yeah were one too bootstrap a simple bytecode interpreter capable of hosting Clojure from clojure onto raw metal, you may have a "pure" system but that doesn't make it useful in the slightest.
19:14dissipate__MisterSinister: what about the Java stack traces?
19:14nopromptoh that article and the comment thread are a riot.
19:14nopromptsome gems in there.
19:14MisterSinisterdissipate_: My programs don't exceed 300 SLoC of Clojure in most cases.
19:14MisterSinisterOK, I get an ugly stacktrace.
19:14dissipate__noprompt: i think the post is a riot. but why the comments?
19:14MisterSinisterIt's not like it's gonna matter much in a program of that size.
19:15nopromptdissipate_: quotes like "Fine… I will dine on chocolate ice cream while you eat “filtered” liquid shit."
19:15dissipate__hehehe
19:16MisterSinisterPlus, if I don't use mutable state (referentially-transparent functions and so on), I can just test each bit individually and incrementally.
19:16noprompt"My position is that lying is wrong, and that a turd is still a turd even when you call it sausage and eat with relish. "
19:16dissipate__noprompt: i didn't see any linkage to this guy's 'beautiful' common lisp code
19:16MisterSinisterdissipate_: Sorry, CL syntax is pretty hideous.
19:16MisterSinisterI know that car and cdr have historical origins.
19:16MisterSinisterBut honestly?
19:16nopromptdissipate_: he's probably too busy dining on his ice cream to write any software.
19:16CaptainLexCL is undeserving of being the default LISP :P
19:16MisterSinisterCaptainLex: I think it got that title by default.
19:16technomancyCaptainLex: MACLisp 4 lyfe
19:17dissipate__noprompt: he's a big baller common lisp shot caller. everyone else is in a 'cube farm'
19:18CaptainLextechnomancy: I think I'd be rep Scheme myself, except all the SLoC of LISP I've written in the past six months have been in clj or cljs
19:18CaptainLexThose two languages are so useful :(
19:18CaptainLex(If I were into systems, it'd be Guile, but seriously, who does that?)
19:18technomancyhttp://vintage-digital.com/hefner/misc/lisp-programmers.jpg
19:19MisterSinisterSo.... we're the Borg?
19:19MisterSinisterI take that as a compliment. :D
19:19technomancyrelated: http://www.motivateusnot.com/resize.php?name=LzM3OC9DYXB0YWluLUphbWVzLVQuLUtpcmstSSdtLXNvcnJ5LC1JLWNhbid0LWhlYXIteW91LW92ZXItdGhlLXNvdW5kLW9mLWhvdy1hd2Vzb21lLUktYW0uanBn&amp;w=550&amp;h=9999&amp;extension=.jpg
19:19CaptainLexHahaha Scheme is Spock! :O
19:19CaptainLex:D*
19:19noprompttechnomancy: that's halurious. :P
19:20nopromptthe ruby one cracks me up.
19:20nopromptsmalltalk is bill nye the science guy. can it get any funnier?
19:20CaptainLexHahahaha @ Javascript
19:21CaptainLexI have never even heard of Arc, Forth, or Factor
19:21technomancyarc should have been wesley crusher
19:21llasramTotal missed opportunity
19:21technomancyother than that it is perfect
19:21dissipate__CaptainLex: Arc is Paul Graham's experimental LISP langauge
19:22MisterSinisterThe ASP.Net one amuses me the most.
19:22technomancyracket can be zachary quinto's spock
19:25nopromptdissipate_: "Right now I have very little working code. " -- loper-os
19:25noprompthe goes on to say " This is because I have spent much of my time so far developing an understanding of the Lisp Machine systems which inspired Loper, and of the X86-64 architecture – the only consumer-market CPU sufficiently capable for my purposes."
19:27noprompta commenter says "Sounds like you might be kind of a douche. Ever thought about redesigning the car? Because driving with my feet always made more sense that these hands on a clumsy wheel."
19:27nopromptthat about sums it up.
19:30rasmustohaha, just got to the icecream comment
19:31MisterSinisterIce-cream is tasty. That was a derp comment. :P
19:32CaptainLexI actually find myself on loper-os's side, philosophically
19:32CaptainLexBut in the short-term, I'm a turncoat :P
19:32MisterSinisterI just consider it too extreme a position. I get a mental image of Angry German Kid while I read that.
19:32MisterSinisterYelling 'STOP LIKING WHAT I DON'T LIKE!'
19:32dissipate__CaptainLex: how are you on his side philosophically? he's butt hurt that common lisp got pushed aside
19:32MisterSinister(In German)
19:33CaptainLexdissipate_ MisterSinister: I also think it's an extreme position, but I'm all about compromise in situations like this.
19:34CaptainLexI would like to have a Lisp-All-the-Way-Down, but I'd also like to have widespread adoption of LISP and functional design patterns
19:34MisterSinisterCaptainLex: Does that article have much of a compromisory tone?
19:34CaptainLexIt doesn't matter to me what order they come in
19:34MisterSinister'Compromise' requires both sides to be OK with giving a little. This guy isn't giving a millimeter.
19:34CaptainLexNo, I know. I mean
19:34CaptainLexI agree with him, but I am compromising
19:35CaptainLexIn 50 or 100 years, I'd be on his side. If Clojure took the world by storm and enterprise became functional, I'd start telling them to implement it all in pure LISP from the beginning
19:35hiredmanuse belt cpus
19:35dissipate__CaptainLex: enterprise is broken and seems like it always will be no matter what language enterprise is using
19:35MisterSinisterThe thing is, in 50 or 100 years, we might well have strong AIs to do all our programming for us, and all we'd need is a specification language, making this whole thing meaningless.
19:36MisterSinisterHere and now is what counts.
19:36dissipate__CaptainLex: don't expect *any* language to fix enterprise, period
19:36MisterSinisterAnd also, I'm not in any way selfish to say that I evaluate a language based on how much it serves my needs.
19:36MisterSinisterClojure serves my needs. Therefore I like it and use it.
19:36dissipate__CaptainLex: if enterprise adopted clojure, they would just crank out bad clojure code
19:36CaptainLexHaha I don't mean functional like it works, I mean functional like using FPLs :p
19:37dissipate__CaptainLex: how would FP fix enterprise, at all?
19:38CaptainLexdissipate_: It'd make my skillset more marketable xP
19:38RaynesI agree with dissipate__ -- FP doesn't make shitty coders less shitty.
19:38MisterSinisterRaynes: I would argue it makes shitty coders shittier.
19:38dissipate__CaptainLex: yeah, you might make more money, but get ready to deal with a bunch of Java heads who have 0 concept of craftsmanship.
19:38MisterSinisterSince FP actually requires more thinking.
19:39RaynesMisterSinister: I would disagree because I think the premise is untrue.
19:39MisterSinisterRaynes: Could you explain that a bit more?
19:39CaptainLexMisterSinister: Sadly, you're probably correct. I'd ideally hope that it would force everyone think more, but probably not
19:39RaynesFP doesn't require more thinking. Haskell requires more thinking. You can mostly take a dump in a .clj file and have it work just fine.
19:40dissipate__CaptainLex: no, they wouldn't think more. if they thought more, their code would already be a lot better.
19:40MisterSinisterRaynes: In that case, we agree.
19:40dissipate__CaptainLex: perhaps Haskell is your savior. but i don't see that being adopted by enterprise *anytime* soon
19:40noprompthow does one become less "shitty" at anything?
19:41CaptainLexdissipate_: Perhaps so. I've often thought it was the most enterprise-ready FPL, though
19:41Brand0practice
19:41MisterSinisternoprompt: Practice? Thinking? Work?
19:41dissipate__noprompt: acknowledge you are doing stuff badly and correct your actions
19:41MisterSinisterdissipate_ is right - knowing you suck is the first step in improvement.
19:41sdegutisRaynes: which I often do.
19:41riggerchoosing good peers
19:41MisterSinisterrigger: And mentors.
19:41dissipate__CaptainLex: but enterprise has a huge culture problem, and that is namely rewarding programmers who dump out shit code
19:41noprompti guess that's probably it then.
19:42noprompti always feel like i'm "shitty" programmer.
19:42riggerand actually caring about improving your skill set
19:42nopromptso i'm always practicing.
19:42rasmusto"sharpening the saw"
19:42dissipate__CaptainLex: you can make six figures cranking out shit code
19:42nopromptand constantly banging out shitty code.
19:42dissipate__that's a culture problem
19:42dissipate__that will not be fixed by any programming language
19:42CaptainLexdissipate_: Definitely true. But I'm young and idealistic! I wanna change the woooooorld!
19:42MisterSinisternoprompt: I always feel like I'm shitty in everything I do. Funnily enough, this has been my most productive year. :P
19:43MisterSinisterCaptainLex: I guess some of us have been disabused of that notion. :P
19:43nopromptMisterSinister: yes, it's always interesting when you look back and see how much you've accomplished.
19:43dissipate__CaptainLex: find a shop where people care about their craft. that's what i recommend.
19:43nDuff"enterprise", eh.
19:43MisterSinisternoprompt: I prefer to look forward. Right now, my supervisor is pushing me to publish a paper in SToC.
19:43MisterSinisterWhich is *crazy-hard*.
19:44Raynesnoprompt: You're not a shitty programmer.
19:44noprompti can atest to the hypothesis that deliberate practice and interest is key to becoming less "shitty".
19:45rasmustoits friday, isn't it
19:45MisterSinisterSaturday for me.
19:45riggeri work at a company that has 1M (yes one million) lines of csh as a core of an application
19:46noprompti've been teaching an introductory javascript class and i really stress the importance between practicing and becoming a better programmer.
19:46MisterSinisternoprompt: Where do you teach?
19:46hiredmanrigger: I smell the next clojurescript compiler target
19:46riggerand the guy who made that decision is still working for the company :|
19:46nopromptMisterSinister: it's just a six week intro class through one of the tech companies here in fresno.
19:46dissipate__noprompt: why aren't you teaching clojurescript? :P
19:46rasmustocljs -> tcsh -> csh
19:47arrdemcljs -> c?
19:47nopromptdissipate_: i'm teaching *beginners*
19:47MisterSinisternoprompt: Ah, I see. I figure pretty much everyone here is from the States.
19:47nopromptnaturally i'm taking the functional route.
19:47dissipate__clojurescript isn't for beginners?
19:47nopromptdissipate_: :P
19:48nopromptthere seems to be a consensus that if you teach functional programming before object oriented it's easier for the student to understand.
19:48riggeri believe that to be a fair statement
19:48nopromptinterestingly enough it seems to be true.
19:48MisterSinisternoprompt: I only wish my university would let me *show* this.
19:48riggeri learned lisp/scheme before c++ then java
19:48MisterSinisterSince around here, they have OO on the brain so hard, they might as well be a cult.
19:48dissipate__yeah, i think FP should be taught, but OO is absolutely entrenched
19:49MisterSinisterThere is actually a non-trivial subset of the teaching staff at the university who honestly believe that Object Oriented Design (no programming, just the theory) should be a first-year class.
19:49MisterSinisterBefore *any* programming gets taught.
19:49MisterSinister*That's* how bad it is.
19:49wkellyget some UML up in there!
19:49dissipate__oh hell no
19:49dissipate__UML?? oh hell no
19:49MisterSinisterwkelly: Kill me now.
19:49arrdemMisterSinister: ah here at UTAustin that _was_ a first year class
19:50wkellyhaha
19:50nopromptdissipate_: i definitely had an option and took advantage of the situation to do the "right" thing.
19:50MisterSinisterarrdem: My sympathies.
19:50arrdemMisterSinister: I survived and learned clojure :D
19:50dissipate__noprompt: how are you doing the right thing?
19:50MisterSinisterarrdem: I did too. I just wish other people could take a less painful pathway.
19:50arrdemMisterSinister: I'm not convinced it was actually a bad thing... there are some domains for which OO does make sense
19:50nopromptdissipate_: by the quotes i meant what i think is right.
19:51arrdemMisterSinister: in fact I'm trying to draw an OO model for my next clojure app as I type
19:51nopromptdissipate_: and that is teaching the students to learn how to program in a functional style with JavaScript.
19:51MisterSinisterarrdem: Teaching it as the One True Model of programming and saying it's the best thing since sliced bread?
19:51arrdemMisterSinister: yeah that's a load of ****
19:51MisterSinisterI will (grudgingly) accept that OO is useful *sometimes*.
19:51MisterSinisterBut this is *definitely* not the way it gets taught at my uni.
19:51nopromptMisterSinister: i don't dis OO in class and don't deny it's usefulness.
19:51CaptainLexMy University used to have its intro class for majors taught in Scheme (such as when I was a freshman)
19:52MisterSinisternoprompt: I'm a Master's student. I'm done with classes. :P
19:52CaptainLexThey just approved a plan to change it to Python, then Java, THEN Scheme
19:52arrdemMisterSinister: I'm jelly
19:52MisterSinisterarrdem: Why would you be jelly? You wanna be an algorithm researcher?
19:52nopromptMisterSinister: however, being skilled with functional programming in JS is far more useful than OO.
19:52dissipate__noprompt: fair enough
19:52arrdemMisterSinister: the grad student part, not the research :P
19:53MisterSinisternoprompt: You don't need to convince me. I dislike OO. :P
19:53hyPiRionwell gurr. Polymorphism is good, not sure what classes are.
19:53MisterSinisterarrdem: It's a lotta work, because my supervisor is a slavedriver.
19:54dissipate__isn't it funny that in the past decade OO best practices have essentially gutted inheritance?
19:54arrdemhyPiRion: classes are an excuse to complect datastructures and fns
19:54noprompthyPiRion: completely agree.
19:54MisterSinisterdissipate_: Yeah, I read 'Operator new considered harmful' too. :P
19:55dissipate__arrdem: complect data structures??
19:55lazybotdissipate__: Uh, no. Why would you even ask?
19:55hyPiRionarrdem: I'd rather say that it complects state and value, although I get your point.
19:55nopromptit's funny. as bad as javascript could be it could be a lot worse.
19:56dissipate__ah, i see
19:56dissipate__hyPiRion: objects are used to hide data, essentially
19:57hyPiRionWell, the main issues with js is weak typing, scoping rules and namespace issues, isn't that it?
19:57dissipate__hyPiRion: don't forget objects and mutable state
19:57CaptainLexdissipate_: To be fair, that's not a bug, that's a feature
19:57CaptainLexThe earlier things are pretty universally condemned
19:58hyPiRionWell, that could be dealt with. It's harder to change scoping rules and namespacing
19:58hyPiRionyeah, what CaptainLex said
19:58noprompthyPiRion: yes there are those issues. but for beginners just trying to get started you can impress upon them some good practices w/o getting too deep.
19:58technomancyhyPiRion: equality too
19:59MisterSinisterSpeaking of equality: Why does CL have like, four equality tests?
20:00hyPiRionthree
20:00nopromptRaynes: so are you like a core elixir team member now or something? ;)
20:00ThatOneGuybecause CLOS
20:00ThatOneGuy:P jk I have no idea
20:00hyPiRioneq, eql, equal
20:00MisterSinisterIsn't there a string equal thing or something as well?
20:01hyPiRionthat's equal
20:01CaptainLexScheme has some of them too
20:01CaptainLexOne is pointers-equals, one is value
20:01arrdemwhen does the clojure challenge start?
20:01CaptainLexFor performance reasons
20:01nopromptdamn this mrhyde lib is kinda cool
20:01hyPiRionoh right, string equal is kind of performancey
20:01arrdems/challenge/cup/
20:01dfuenzalidayou also have (.equals "foo" "bar") with Java interop
20:02technomancyMisterSinister: pretty sure there's more than four actually
20:02technomancyequalp
20:02MisterSinistertechnomancy: Maybe. CL is a huge language and I don't even pretend to know most of it.
20:02technomancyit's insane
20:02technomancy(equality specifically)
20:02technomancyclojurebot: egal?
20:02clojurebotegal is http://home.pipeline.com/~hbaker1/ObjectIdentity.html
20:02technomancyMisterSinister: ^ great coverage of why it's necessary in CL and why that's a horrible thing
20:02Brand0Dang, I cannot get clojure.contrib to load
20:03MisterSinisterI think I might enter the ClojureCup next year. Not this year - too busy.
20:03arrdemBrand0: first of ohai, second off contrib is dead
20:03Brand0arrdem, 2 the rescue
20:03hiredmanbecause there is no such thing
20:03technomancyeq, eql, equal, equalp, =, plus then string=, char=, etc
20:04MisterSinisterEeeek.
20:04MisterSinisterWow.
20:04hyPiRionoh right, equalp
20:04MisterSinisterThat's worse than I thought.
20:05MisterSinisterOne thing I actually like about Clojure - the damn language is easy to look up.
20:05MisterSinisterLooking up stuff about CL is painful.
20:05arrdemMisterSinister: oh you want HyperDoc? good luck finding one...
20:06MisterSinisterarrdem: I've tried reading HyperDoc. It's not fun.
20:06MisterSinisterThe first Lisp I tried was CL.
20:06MisterSinisterYeah.... Clojure was much easier.
20:07arrdemMisterSinister: yeah the clojure-doc, clojuredocs and github.com/clojure documentation may be confising but at least you can always (doc) or find the docs with a single google search
20:07MisterSinisterarrdem: I actually found all of those things to be really easy to work with.
20:07MisterSinisterAlso, why is ClojureDocs stuck at Clojure 1.3?
20:07arrdemMisterSinister: it got abandoned I think
20:07MisterSinisterAwwwwwwwwww.
20:07MisterSinisterThat sucks.
20:08noprompt,e,s
20:08clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: e in this context, compiling:(NO_SOURCE_PATH:0:0)>
20:08MisterSinisterThe examples of use on there are so useful.
20:08arrdemMisterSinister: someone else here has an examples site...
20:08arrdemMisterSinister: that's new shiny and active
20:08MisterSinisterarrdem: Link please?
20:08arrdemMisterSinister: trying to remember...
20:09arrdemMisterSinister: brain cache fault, incurring google latency..
20:09brainproxyI suggested that Clojure's API be adapted to DevDocs
20:09MisterSinisterHappens to all of us.
20:09brainproxythe maintainer said he would at least think about it :)
20:10arrdemnoprompt: false. my new buisness cards look like a `whois`
20:10MisterSinisterSo, what do you guys all do? Are you all software-making folks?
20:10nopromptarrdem: that's so awesome.
20:10ThatOneGuyoui
20:10brainproxyif you're doing webdev and not using DevDocs, it's the bomb, give it a go: http://devdocs.io/
20:11CaptainLexI'm a student, and will be a software-making folk when the time comes
20:11callenbrainproxy: no clojure? gerd dermmert.
20:11brainproxycallen: i asked for it
20:11arrdemCaptainLex: I'm still a college undergrad but aspire to the `hacker` and `lisper` mixins. `sofware-maker` seems inevitable.
20:12brainproxycallen: you can voice your support for clojure here: https://trello.com/c/PVnfdeaN/26-suggest-new-docs-here
20:12CaptainLexarrdem: My long term goal is indie game dev, but until then I'll be a contractor
20:12callenbrainproxy: I'd rather not ask, and just use dash.
20:12callenbrainproxy: https://itunes.apple.com/us/app/dash-docs-snippets/id458034879?mt=12 you can upload your own docs, you don't have to beg some dude with a website.
20:13nopromptbrainproxy: that's pretty cool.
20:13MisterSinisterarrdem and CaptainLex: Nice. I got the impression everyone here was a professional already. :P
20:13brainproxycallen: cool, wasn't aware of dash
20:14nopromptcallen: has that app gotten better? it used to be kinda "balls" to use a "modern" adjective.
20:14brainproxycallen: hopefully at some point the maintainer will turn it into a community effort, where new docs can be submitted by pull request, you can fork and run your own devdocs, etc.
20:14arrdemMisterSinister: nah. hyPiRion and a bunch of other people are academic(ish) too but for the most part it's library maintainers, the honorable technomancy and fulltime clj-users
20:14nopromptfuck it. i give up. i'm not getting anything done today.
20:14CaptainLexMisterSinister: I'm a "professional" in some senses, but basically not :P
20:14arrdemnoprompt: needs more redbull. I've had to much so IRC.
20:15MisterSinisterarrdem: Ah, I see.
20:15dobry-denDamn, I love Schema
20:15MisterSinisterAlso, lol at 'the honourable technomancy'.
20:15arrdem$karma leiningen
20:15lazybotleiningen has karma 2.
20:15hyPiRionI'm a professional Swearjure programmer, but that's about it.
20:15MisterSinisterSwearjure?
20:15clojurebotSwearjure is http://hypirion.com/swearjure
20:16MisterSinisterLol.
20:16hyPiRion~quicksort
20:16clojurebotquicksort is https://www.refheap.com/paste/284a0552a6b69c6037faa2db5
20:17arrdemhyPiRion: I'm still in awe of how far you've gotten that.
20:17MisterSinisterThis feels like reading Brainfuck.
20:17CaptainLexhyPiRion: Hahahaha that's awesome
20:18callennoprompt: it's usable. I like it.
20:18CaptainLexI've always wanted an esolang that wasn't just more stack manipulation nonsense
20:19hyPiRionYeah, this is splice unquoting abuse and SKI calculus hacks and whatnot
20:20MisterSinisterhyPiRion: Now write eval in Swearjure. :P
20:21hyPiRionHrm. It's possible to write eval in Swearjure for Swearjure code, but not sure you can further than that
20:21MisterSinisterAlso, what can we do with the clojurebot?
20:22hyPiRion,((-> [!] #([!](+))) (*))
20:22clojurebot1
20:23MisterSinisterSo I can feed it s-expressions starting with a comma, and it'll eval them?
20:23hyPiRionyea
20:23hyPiRionh
20:23MisterSinister,(+ 1 2)
20:23clojurebot3
20:23MisterSinisterWhee.
20:23MisterSinisterIt's like a talking REPL.
20:23dissipate__can i feed it sex expressions?
20:23llasramThere's also lazybot!
20:24llasram&(println "hi")
20:24lazybot⇒ hi nil
20:24MisterSinisterdissipate_: Try it.
20:24llasramAnd also ##(println "hi")
20:24lazybot⇒ hi nil
20:24MisterSinisterJust make sure you use prefix notation. :P
20:24dissipate__,8====D
20:24clojurebot#<NumberFormatException java.lang.NumberFormatException: Invalid number: 8====D>
20:24MisterSinisterWhat's the difference between the bots?
20:24llasramThey're entirely different bots :-)
20:24TEttingerMisterSinister, yes
20:24TEttinger,(range 1 10)
20:24clojurebot(1 2 3 4 5 ...)
20:24TEttinger&(range 1 10)
20:24lazybot⇒ (1 2 3 4 5 6 7 8 9)
20:24dissipate__,(fib 5)
20:24clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: fib in this context, compiling:(NO_SOURCE_PATH:0:0)>
20:26MisterSinisterI'm guessing I shouldn't feed the bot infinitely-recursive things?
20:26technomancytry it and see
20:26MisterSinisterOr ask it to realize an infinite seq? :P
20:27MisterSinister,(doc iterate)
20:27clojurebot"([f x]); Returns a lazy sequence of x, (f x), (f (f x)) etc. f must be free of side-effects"
20:27technomancyunless you are more devious than Raynes and xeqi you can't hurt it
20:27MisterSinister,(iterate inc 0)
20:27clojurebot(0 1 2 3 4 ...)
20:27MisterSinisterI doubt I'm more devious.
20:27MisterSinisterI was just curious.
20:27rasmusto&(iterate inc 0)
20:27lazybotjava.lang.OutOfMemoryError: Java heap space
20:27MisterSinisterSo now I know the difference between the bots.
20:30Raynesxeqi is the only one who can break lazybot.
20:31MisterSinisterI'll take your guys' word for it.
20:32hyPiRionRaynes: http://clojure-log.n01se.net/date/2012-12-17.html#22:30
20:33hyPiRionNot sure if it's breakage, but still proud of that one
20:33MisterSinisterWow....
20:33MisterSinisterI am such a programming noob.
20:36CaptainLexhyPiRion: You are my hero. That's incredible!
20:36ThatOneGuywe all are. no one knows everything
20:37MisterSinisterYeah, that is pretty incredible.
20:37RayneshyPiRion: amalloy thinks that this was the final straw that made us ignore clojurebot in lazybot.
20:37RayneshyPiRion: Good work.
20:37hyPiRionRaynes: yeah, I know
20:38MisterSinister,((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x)))))
20:38clojurebot((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x)))))
20:38hyPiRionCaptainLex: haha. Well, I've mostly done very... unorthodox things with Clojure. I haven't made anything extremely useful
20:38RayneshyPiRion: You've contributed quite a bit to leiningen. You're doing fine
20:39llasramIndeed!
20:39ztellmanunorthodox things are the best things
20:39llasram(inc hyPiRion)
20:39lazybot⇒ 23
20:39CaptainLexYou know what would be useful? If you could make the bots output things to each other indefinitely
20:39Raynes(inc hyPiRion)
20:39lazybot⇒ 24
20:39RaynesCaptainLex: That's exactly what hyPiRion did which we made impossible afterwards.
20:39MisterSinister(inc hyPiRion)
20:39lazybot⇒ 25
20:39CaptainLexHahahaa :(
20:40MisterSinisterAlrighty, I think I better get some actual work done. Thanks all, it's been fun.
20:40hyPiRionOh, you guys
20:41CaptainLexI better take a break too! Food's on, plus I oughtta finish the enlive business
20:41CaptainLexI think IRC is wonderful I love having communities around :)
20:41technomancyit is the best.
20:42CaptainLexOopsy put a delimiter in there somewhere
20:42technomancyit's ok, commas are whitespace
20:42CaptainLex(partition 5 "I think IRC is wonderful I love having communities around")
20:42mmoriaritynot enough irc in the world
20:43CaptainLexNeed more IRC IRL
20:44ThatOneGuy…pub coding meet-ups?
20:44ThatOneGuy…hacker spaces?
20:45Pupnik_game jams
20:45CaptainLexMy metro did just git a hacker space recently
20:45CaptainLexI have no memory of where it is
20:49TEttingerRaynes, if you have two bots that auto-announce youtube links... https://www.youtube.com/watch?v=O1QZqQQOPfs
20:49TEttingerthank god
20:50TEttingerthe title of that video was meant to test title and eval stuff
20:51RaynesTEttinger: Already had that problem once.
20:51RaynesFixed it too.
20:51TEttingerone channel I'm in has two bots like that, and I set up "~whatis annoying" to yield that video
20:52Raynes$title https://www.youtube.com/watch?v=O1QZqQQOPfs
20:52lazybot"##(str " http://www.youtube.com/watch?v=O1QZqQQOPfs ") ; noto - YouTube"
20:52RaynesI used to have that on all the time.
20:52RaynesBut people complained about it so I turned it off.
20:52RaynesBut before I did, people invented web pages with titles to cause a bot chain.
20:52RaynesSo I added the quotes around the title to stop it.
20:52TEttingerI have it on for youtube and youtu.be
20:52RaynesThis was way before I ever bothered to ignore clojurebot -- I spent a lot of time trying to mitigate attacks.
20:54TEttingerlazybot's good stuff
20:57Pupnik_except for its memory usage
21:07dobry-denIs there a way to check for String map keys with Schema? (s/validate {"foo" s/String} {"foo" "bar"}) doesn't work while (s/validate {:foo s/String} {:foo "bar"}) does
21:13dobry-deni guess {(s/eq "foo") s/String} works
21:17ambrosebsdobry-den: looks like the way to do it.
21:20dobry-denambrosebs: actually, i don't know. So, this workd: (s/validate {:foo s/String s/Any s/Any} {:foo "bar" "abc" "def"})
21:20dobry-denBut not this (s/validate {(s/eq "foo") s/String s/Any s/Any} {"foo" "bar" "a" "b"})
21:20akurilinRandom REST/MVC-related question: if I'm creating 3-4 unrelated resources from the controller of one of these resources, is that a good indication that I should create a wrapper resource for all of them?
21:21dobry-denBasically the error I'm getting when trying to ensure String keys is "More than one non-optional/required key schemata"
21:25ambrosebsdobry-den: just going by the docs I don't know.
21:32ambrosebsdobry-den: https://news.ycombinator.com/item?id=6336062
21:32dobry-denambrosebs: thanks, i'll close my own issue
21:35dobry-denambrosebs: thanks for the help.
21:35ambrosebsdobry-den: np
21:36yedihow do you do 301 redirects in ring
21:38yedido you just return {:status 301 :headers "Location" someurl}
21:38akurilinyedi, that sounds about right, I could be missing something though.
21:40dobry-denyedi: https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/util/response.clj
21:43dobry-denakurilin: do you have an example?
21:58xeqiRaynes, hyPiRion: oh, are we breaking lazybot again?
22:02yedii'm trying to test if a string has an ending slash, how would I go about that?
22:02xeqi&(.endsWith "asdf/" "/")
22:02lazybot⇒ true
22:02xeqi&(.endsWith "asdf" "/")
22:02lazybot⇒ false
22:03yedithanks
22:11yedii'm trying to write a middleware for redirecting slashless uris to their slashed counterpart: e.g. (/about redirects to /about/)
22:11yedican someone help me figure out what i'm doing incorrectly here: https://gist.github.com/yedi/106252dde45f40a75f89
22:14xeqiyedi: line 7 doesn't need to have the () around the map
22:16yediah beautiful, thanks
22:23Raynesxeqi: Please God no. My heart can't take it.
22:31coventry`Is there an easy way to change (foo) to [foo] in paredit? My current technique is C-w the current parens, do '[' at the start of the form, then C-) till the closing paren is in the right place.
22:32amalloycoventry`: learn to use: paredit-wrap-square, paredit-raise
22:32coventry`Also, anyone have a binding for saving (or reloading at the repl) a file before running its tests file with C-c C-,?
22:32amalloywell, i guess not raise. splice
22:33coventry`Oh, I see how to do it with splice. Thanks.
22:33coventry`Well, join.
22:43weavejesterHas anyone started using smartparens over paredit?
22:43akurilinWhat do folks use for procedurally generating parameterized queries for PG around here? Is it pretty much korma? I have all these situations where sometimes I want an insert with or without returning, sometimes with limit, sometimes sorted etc.
22:44weavejesterAnd if so, how on earth do you turn paredit off globally?
22:44akurilin:let paredit_mode=0 , but I imagine you're not on vim :P
22:45weavejesterUnfortunately not...
22:45weavejesterYou'd have thought disabling paredit would be in the documentation somewhere
22:45weavejesterOr discoverable through Google
22:45Raynesakurilin: WAT YOU CAN DO THAT
22:46weavejesterBut it seems to be something no-one ever thought would be needed.
22:46nopromptmaybe check the authors dotfiles (if they are available)?
22:46akurilinRaynes, what specifically?
22:46Raynesakurilin: I have this: command! Ptoggle call PareditToggle()
22:47akurilinRaynes, never used that tbh, what paredit plugin are you using?
22:47nopromptthis core.async stuff is confusing :|
22:47Raynesakurilin: paredit.vim. I thought there was only one.
22:48akurilinRaynes, ok, just making sure
22:48akurilinRaynes, maybe you had discovered something amazing and I wasn't aware of it
22:48akurilinvim users need every little hack to survive against fancy emacs support :P
22:48weavejesterIt looks like the problem is that the starter-kit enables it by default, and the assumption is that if you don't want paredit, don't enable it.
22:50nopromptakurilin: i use emacs with vim keybindings. the only time i miss from vim is syntax highlighting for multiple modes (like erb, php).
22:51scottjweavejester: maybe you could redefine paredit-mode function to do nothing
22:51akurilinnoprompt, got it. I've thought about it, but then vim fireplace happened and it eased things a little bit.
22:52akurilinWe all owe tpope big time here on the vim side
22:52nopromptakurilin: yeah i bailed on vim right around the time fireplace was coming out.
22:52weavejesterscottj: Is that standard elisp practice?
22:52scottjweavejester: nope
22:52weavejesterIt looks like the emacs starter kit insists certain things are started, with no option not to.
22:52nopromptakurilin: i still use it whenever i ssh or whatever. i'm glad i know how to use it too. :)
22:52weavejesterscottj: Thought so :)
22:53SegFaultAXnoprompt: How did you get started with the switch?
22:53SegFaultAXnoprompt: Did you use one of the various starter kits or did you just dive right in fresh?
22:53SegFaultAXnoprompt: And did you start use evil mode from the start?
22:53SegFaultAXUsing, even.
22:53nopromptSegFaultAX: i used the starter kit and evil-mode then spent about a month learning how to tweak various things.
22:54nopromptSegFaultAX: i'm very happy with it. there are some annoyances, but over all i really love it.
22:54weavejesterscottj: Aha, I took your advice, but made it slightly less hacky by overriding esk-turn-on-paredit instead.
22:55SegFaultAXnoprompt: Can I look at your dotfiles? Are they on gh/bb?
22:55nopromptit's very nice to, say, have a terminal open inside your editor.
22:56nopromptSegFaultAX: sure. https://github.com/noprompt/matilde/blob/master/emacs.d/init.el
22:56SegFaultAXnoprompt: Thanks!
22:57nopromptSegFaultAX: i also discovered keychord-mode is a nice little package to install and customize too.
22:57SegFaultAXnoprompt: As you may have seen me talking about recently, I'm trying to give emacs an honest go. I've been using vim for many many years.
22:57nopromptmy vim config uses a lot of ,<key> stuff and keychord can help with some of that.
22:58SegFaultAXnoprompt: Where , is your <leader>
22:58SegFaultAXI'm assuming
22:58nopromptSegFaultAX: oh sure. i like both editors very much. i'm honestly glad i spent a few years with vim before trying emacs.
22:58nopromptSegFaultAX: modal editing is great.
22:59SegFaultAXnoprompt: What caused you to make the switch?
22:59nopromptSegFaultAX: clojure. at the time i wanted a good integrated REPL experience and fireplace/vim-clojure were frustrating me.
23:00nopromptSegFaultAX: also for a long time i've wanted things like shells, etc inside my editor and vim doesn't do a good job with that.
23:00nopromptSegFaultAX: then there's vimscript.
23:00SegFaultAXnoprompt: Don't get me started on vimscript.
23:01jack_rabbitlol
23:01nopromptyeah, don't get anyone started on vimscript.
23:01SegFaultAXnoprompt: That's actually the number one driver for me to switch, although lisp support is a close second.
23:02noprompti'm not saying vim is a bad editor for lisp. people certainly seem to be doing just fine with it.
23:02muhooi do not mind switching back and forth between emacs and vim all day. what really fucks with my head is having to use some windows or mac derived editor. kills me. i keep tying emacs commands in them.
23:03nopromptmuhoo: right. there are somethings i love to use vim for and others not so much.
23:03muhooi do a lot of sysadmin stuff and vi is just a fact of life. if i'm ssh'ed in or sudo'ed, it's vi. if i'm doing development, repl, etc, it's all emacs.
23:03SegFaultAXmuhoo: I thought most people just use the remote stuff in emacs to do that.
23:03nopromptbut i'm not definitely not going to be one of those "let's start an editor war" type of folks. unless someone tries to push, you know, sublime on me or some shit like that.
23:03muhooalso, just try using emacs on an android phone. i dare you.
23:03scottjnoprompt: there is evil-leader. I would be careful about keychord-mode, it can create major lag while typing
23:03SegFaultAXmuhoo: Eg have the ssh session /inside/ emacs.
23:04muhooSegFaultAX: sure, and lock up your whole emacs waiting for the file to save :-/
23:04muhoothere is one thing emacs does really poorly at and that's multithreading. in fact it doesn't do it at all. anything that's i/o bound is painful
23:04nopromptscottj: i noticed that. i think i only have a handful of keychords defined and most of them are defined only in normal mode. but i will look at evil-leader.
23:04SegFaultAXmuhoo: vim has the same problem.
23:05SegFaultAXmuhoo: Anyway, callen was trying to convince me that this is something common and natural in emacs.
23:05SegFaultAXGuess not.
23:05muhooright, but i can use emacs for my local stuff and vi in a mosh/screen for remote
23:05muhooi really could not live without either vi or emacs, now that i think of it.
23:05muhoowithout BOTH, i mean.
23:06muhooSegFaultAX: pop into #emacs channel and have a chat about that. last i asked, i didn't hear any solutions for remote stuff that appealed to me.
23:06nopromptughh, i sware. this weekend i'm gonna sit down and learn how to use core.async.
23:07muhoocore.async is very tasty.
23:07muhooit's like a simpler, easier-to-understand version of lamina/aleph.
23:07SegFaultAXUnless you try to read the source.
23:07SegFaultAXHave you looked at the go macro?
23:07clj_newb_2345what is the cheapest machine I can buy if all I want is for it to host a clojure web server?
23:07clj_newb_2345(a web server running on clojure)
23:08clj_newb_2345i.e. needs to be able to handle the jvm
23:08SegFaultAXclj_newb_2345: Probably digital ocean.
23:08SegFaultAX$5/mo
23:08clj_newb_2345not rent
23:08muhooreally? that cheap?
23:08clj_newb_2345buy
23:08SegFaultAXSingle core, half a gig-ish of ram, ssd.
23:08clojurebotCool story bro.
23:08muhoooh, for single core and 500mb that's normal
23:09SegFaultAXclj_newb_2345: Oh, to build yourself? Probably $300 or so for the bare essentials. $800 for something pretty powerful. $1500+ for something production class.
23:09SegFaultAX$2.5k+ for something you expect to heavily virtualize.
23:10clj_newb_2345hmm
23:10clj_newb_2345so I should just get a mac mini
23:10SegFaultAXNo. definitely not.
23:11SegFaultAXclj_newb_2345: Mac minis do not make good server hardware, especially not for CPU bound stuff.
23:12clj_newb_2345are clojure web apps io bound?
23:12clj_newb_2345I thought it was just the jvm hogging up crap tons of memory
23:12SegFaultAXclj_newb_2345: Depends on the app.
23:16SegFaultAX... I just typed "vim ~/.emacs.d/init.el"
23:16CaptainLexWhat silliness has caused this name?
23:16CaptainLexclojure.lang.ArityException: Wrong number of args (1) passed to: layout$fn--2653$fn
23:17TEttingerCaptainLex, that sounds like an anonymous fn
23:17supersymaren't the dashes normally not there?
23:17CaptainLexOkay, that makes sense in retrospect. Sadly, that anon is probably deep in the library I'm using :(
23:18clj_newb_2345is "core i3" the same as "-piece of shit" ?
23:18TEttingerlike you made something like ##(map #(print "whee") [1 2 3])
23:18lazybotclojure.lang.ArityException: Wrong number of args (1) passed to: sandbox91102$eval137053$fn
23:18TEttingerwhen...
23:18TEttinger##(map (fn [] (print "whee")) [1 2 3])
23:18lazybotclojure.lang.ArityException: Wrong number of args (1) passed to: sandbox91102$eval137064$fn
23:18TEttinger##(map (fn [_] (print "whee")) [1 2 3])
23:18lazybot⇒ (wheewheewheenil nil nil)
23:18TEttingerworks fine
23:19TEttingerclj_newb_2345, no
23:19TEttingerthey still make celeron procs I think
23:19TEttingeri3 is low end, but not THAT low end
23:19clojurebotOk.
23:19TEttingerdammit
23:19TEttinger~i3
23:19clojureboti3 is low end, but not THAT low end
23:20TEttingerit's not AMD low end
23:21clj_newb_2345oh
23:21clj_newb_2345so it's i7 > i5 > i3 > celeron > AMD ?
23:21TEttingernot exactly
23:22TEttingerI mean
23:22TEttingerlow end AMD is extremely low end
23:22clj_newb_2345i7 > i5 > i3 > celeron > 386 > AMD ?
23:22TEttingerbut there's decent AMD procs too
23:22TEttingercheck the benchmarks at notebookcheck
23:23TEttingerhttp://www.notebookcheck.net/Mobile-Processors-Benchmarklist.2436.0.html
23:25TEttingerclj_newb_2345, you can see that the highest end AMD-made chip is worse than a mid-range chip from intel, both latest generation. ouch.
23:28muhooatom was the lo end of intel last i looked
23:29muhoohell i ran clojure on a beaglebone
23:29muhooit was slow and nrepl didn't work, but it worked
23:35qwerwhat's the deal with clojure.contrib.math?
23:35xeqi~contrib
23:35clojurebotMonolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/community/Where+Did+Clojure.Contrib+Go
23:36qwerso it's not included in standard clojure? I'm looking for the expt functionality
23:38uvtcqwer, are you looking for this: <https://github.com/clojure/math.numeric-tower&gt;?
23:38hiredmanMath/pow
23:39qwer(Math/pow 2 8)
23:39uvtc,(Math/pow 2 8)
23:39clojurebot256.0
23:39qwerahh
23:39qweranyway to make it and int other than cast it?
23:40qwer,(long (Math/pow 2 50))
23:40clojurebot1125899906842624
23:46weavejesterAgh, I *still* can't get emacs-starter-kit not to load paredit for everything.
23:46weavejesterI think I might have to dump it.
23:50supersymyeah hate it when those things are a show-stopper... actually a reason I haven't taken on emacs yet
23:50supersymtoo much to figure out atm
23:50weavejesterI'm just going to use my own version of it, I think.
23:50uvtcI remember not getting emacs-starter-kit, so instead I just started with the basics.
23:51uvtcHm. Doesn't seem to be much at <https://github.com/technomancy/emacs-starter-kit&gt; anymore (well, since the last time I looked)...
23:55weavejesterYeah, maybe the inflexibility is one of the reasons technomancy is changing it.