#clojure logs

2012-06-06

00:00dnolenand that's for 2 kvs
00:00dnolenperformance degrades linearly for each new kv pair.
00:04bbloomdnolen: i'm looking at http://www.50ply.com/cljs-bench/#plot33 and http://www.50ply.com/cljs-bench/#plot40
00:04bbloomdnolen: let me know if i'm reading this right: plot 33 is objmap with 2 keys, adding a 3rd
00:04bbloomdnolen: and plot40 is a persistent map adding one key
00:05dnolenbbloom: plots out of date.
00:05dnolenbbloom: run the benchmarks locally
00:06dnolenbbloom: and plot40 is map w/ 32 keys.
00:07dnolenbbloom: I pretty sure ObjMap will be >32X slower, we have to copy object and the array of keys
00:08Sgeo_Hmm
00:08Sgeo_So, does Clojure have something like Haskell's algebraic datatypes?
00:08Sgeo_I know Scala's case classes resemble that
00:09amalloyno
00:10amalloyhashmaps
00:10bbloomdnolen: (time (let [m {:x 1 :y 2 :z 3}] (dotimes [i 100000] (assoc m :y 2)))); 2003 msecs
00:11bbloomdnolen: (time (let [m (into cljs.core.PersistentHashMap/EMPTY [[:x 1 :y 2 :z 3]])] (dotimes [i 100000] (assoc m :y 2)))) ; 3477 msecs
00:11Sgeo_How much Java will I need to learn to work with Clojure comfortably?
00:11bbloomdnolen: i understand promotion for increasing number of keys, but i dont understand update-count
00:17dnolenbbloom: without more details about your setup / machine can't say much. 1000000 iters with 32 keys assoc takes ~480ms on my machine.
00:18dnolenbbloom: JS what engine are you testing on?
00:18technomancySgeo_: you need to learn Java just for using Java libraries, so it totally depends on what you are trying to do
00:18bbloomthat's repljs, soo rhino?
00:19dnolenbbloom: benchmarking with Rhino is not very representative.
00:19dnolenbbloom: you need to benchmark with V8, JSC, and SM under advanced ops for any kind of idea of where CLJS perf is at.
00:19bbloomdnolen: :-/ we really need a v8 repl out of the box
00:20dnolenbbloom: if you're going to do any real perf work you need to install all three and verify your changes agains them all.
00:20dnolenbbloom: I wasted many hours getting ObjMap to where it currently is on Big Three.
00:20brainproxySgeo_: there's a macro for creating algebraic datatypes
00:21brainproxybut I have no idea how it compares w/ Haskell's a.d.t's, and it's not part of clojure core
00:21brainproxySgeo_: http://richhickey.github.com/clojure-contrib/types-api.html#clojure.contrib.types/defadt
00:21lazybotNooooo, that's so out of date! Please see instead http://clojure.github.com/clojure-contrib/types-api.html#clojure.contrib.types/defadt and try to stop linking to rich's repo.
00:23dnolenbbloom: if you check the "Are We Fast Yet" clojure-dev thread I have tips on installing JSC and SM
00:23bbloomdnolen: ill install those
00:23dnolenbbloom: v8 is pretty easy, don't use node, it's not consistent.
00:25bbloomdnolen: while i do that, can you sanity check a custom benchmark for me? https://www.refheap.com/paste/3010
00:25bbloomdnolen: that's a map that never grows in size, but is updated a lot. i know rhino isn't representative, but the latter test (with the unbounded threshold) significantly outperforms the former
00:28brainproxySgeo_: also, this chart may be of interest to you w/ respect to your question about "how much java..."
00:28brainproxyhttps://github.com/cemerick/clojure-type-selection-flowchart
00:28technomancywhat no don't show that to newbies
00:28technomancyit's scary =(
00:28amalloyand also not at all relevant to his question
00:28technomancythe flow chart for 90% of the time looks like this:
00:29amalloy(1) Use maps
00:29brainproxyokay, well, maybe I misunderstood, but I'm coming to clojure from no prior java experience (well not none, but almost none)
00:29technomancy[I need to define a type in Clojure.] -> [Really?] -> [No.] -> [K, cool.]
00:29amalloyah, yours is better
00:29brainproxyand after reading the oreilly book for the past two weeks, I found the chart quite helpful
00:29technomancyamalloy: yours has the advantage of being succinct thougho
00:29brainproxyto kind of summarize what I've learned w/ respect to clojure and java interop
00:30technomancybrainproxy: it's helpful for solving problems that you currently don't have. =)
00:30amalloytechnomancy: also IMO yours is a bit misleading, because you need to define types all the time; you just don't have to tell the compiler about them
00:30brainproxyi have them in spades, for better or for worse
00:30brainproxyneed to build on a large commercial java sdk
00:30brainproxyso it was either learn java or learn java and clojure
00:30brainproxyi chose the latter, since I'm crazy
00:31brainproxy;)
00:31technomancyamalloy: that's one way of thinking about it
00:31kovasbdnolen: is there a listing of all the notation used in core.logic somewhere? . :- etc
00:31technomancywhat does the "1.2" refer to in this CSS rule? font: 13px/1.2 Arial, sans-serif;
00:31technomancynot familiar with that shorthand
00:32technomancyI have a feeling it involves kerning
00:32sergeyhey there
00:32sergeycan someone please help with this question? http://stackoverflow.com/questions/10908068/organizing-test-hierarchy-in-clojure-project
00:32tmcivertechnomancy: em?
00:32brainproxytechnomancy: line height i think
00:33tmcivertechnomancy: http://en.wikipedia.org/wiki/Em_(typography)
00:33technomancyhm
00:34sergeywhy can't I require some clj file from test directory in the same project? It throws not found exception
00:34brainproxytechnomancy: http://www.impressivewebs.com/a-primer-on-the-css-font-shorthand-property/
00:35technomancybrainproxy: thanks
00:35brainproxytechnomancy: np
00:38brainproxysergey: have you checked the classpath, e.g. from w/in the repl
00:38Sgeo_Do defrecords have more type-safety than maps?
00:38Sgeo_I have a bit of a Haskell background
00:38brainproxyto see if in fact that directory containing the tests is on the classpath?
00:38sergeybrainproxy, yeah, I've set it to the project root and root/src
00:38technomancySgeo_: not much safety round these parts, no
00:38technomancyrecords are just more efficient
00:39Sgeo_Bluh
00:39technomancySgeo_: the only way types affect correctness in Clojure is via the typed-clojure inference project
00:39technomancybut that's not even close to working
00:40brainproxySgeo_: from what I've learned so far, types are important when you have serious performance concerns and need to fine tune something you've already got working, and/or you need to deal with java interop
00:42brainproxygenerally though, the language is dynamic and the emphasis isn't on building types but on working with collections
00:43Sgeo_Many of the Java libraries that Clojure is supposed to interop with don't use immutability pervasively?
00:43brainproxySgeo_: right, however, that's not the end of the story
00:44brainproxyfor example, if you use defrecord to extend interfaces from java world, you can benefit from immutability
00:44brainproxyas opposed to deftype, which is "lower level" and doesn't get you the immutability stuff automatically
00:45brainproxythough you could still use deftype and manually wire up to to clojure's interfaces which provide for immutability
00:45brainproxyi think
00:47amalloyhuh?
00:47brainproxyamalloy: if i've misspoken, please do correct, just trying to express some of what I've been learning
00:47amalloydeftype instances are, by default and unless you try pretty hard, immutable
00:47amalloydefrecord just adds built-in implementations of some of the clojure interfaces, especially for "acting like a map"
00:50bbloomdnolen: wow, you're right. rhino isn't even close to representative… heh
00:50dnolenbbloom: yep
00:50brainproxySgeo_: i think the general idea is that it's good to work with the collections and STM facilities (etc., etc.) that clojure provides you, and see how far you can get, and then fine tune
00:51bbloomdnolen: it's like entertainingly different
00:51dnolenbbloom: 100X slower
00:51bbloomdnolen: i want clojurescript self hosting if for no other reason than the test run will go 100x faster! :-)
00:52bbloomeither that, or i should buy a faster machine...
00:52dnolenbbloom: fogus slowed down the tests considerably with his time literal tests
00:53dnolenbbloom: tests are actually pretty quick. compiling eats most of the time.
00:53kovasbdnolen: is there a listing of all the notation used in core.logic somewhere? . :- etc
00:54dnolenkovasb: hmm not really. . is the main special thing in patterns.
00:54kovasbwhat does it do?
00:55dnolenkovasb: for sequence matching (unification really). generally to make the head and tail of a sequence.
00:55dnolenmake -> match
00:55kovasbi see
00:56dnolen(defne g [x] ([[h . t]] ...))
00:56amalloydnolen: whoa, core.logic uses dotted pairs?
00:56amalloyi would have guessed [h & t]
00:56dnolenamalloy: it's not destructuring.
00:56dnolenor even pattern matching
00:57kovasbi'm getting into bi-directional programming for my composable cljs ui stuff, looking around for inspiration
00:57amalloyso what does it mean, if not "h is the head, and t is the rest"?
00:57brainproxykovasb: did you see Foster's book?
00:57dnolenamalloy: dotted pairs is not totally off the mark tho. core.logic allows improper tails - a tail could be logic var.
00:57brainproxykovasb: there's also Greenberg's thesis project, lens.js, iirc
00:57dnolentails other than seqs or logic vars are not officially allowed.
00:57kovasbbrainproxy: have not.. been looking at the papers, but i should check that book out too
00:58brainproxykovasb: http://www.cis.upenn.edu/~mgree/ugrad/lenses/docs/overview-summary-lens.js.html
00:58dnolenkovasb: cool!
00:58kovasbbrainproxy: nice. the only implementations i saw before were in haskell, which i know nothing about
00:58brainproxykovasb: the ebook version of Foster's dissertation is free of charge
00:58brainproxyhttp://www.lulu.com/shop/john-nathan-foster/bidirectional-programming-languages/paperback/product-6481621.html
00:58amalloyinteresting. i think that's still basically in the same arena as pattern matching. but i can totally see choosing [h . t] because . can traditionally be improper, while & in clojure is strictly proper
00:59brainproxykovasb: look to the bottom right for the $0.00 ebook link
00:59kovasbnice
00:59kovasbu are on top of it :)
00:59brainproxythat's symmetric lenses only though, Foster's work i mean
00:59brainproxythere has since been work on "differential" lenses
01:00brainproxywhich are more practical for the world of Internet apps
01:00dnolenamalloy: no, because a logic var is a hole which can be filled at anytime. it lets you do some interesting things.
01:00dnolen[h . t] could unify with a fresh logic var
01:00kovasbright
01:01kovasbi pretty much understand the concepts at this point, its sorta a matter of making it fit with clojure and the specific use case
01:01dnolenamalloy: constant time concat is the big idea.
01:01brainproxykovasb: sorry, i meant "edit" lenses
01:01kovasbwhere do you draw the line on functionality etc
01:01brainproxynot "differential"
01:01brainproxykovasb: http://dmwit.com/papers/201107EL.pdf
01:01kovasbbrainproxy:yup, read that guy this weekend :)
01:01brainproxythat's Wagner's work ... the math is over my head
01:01brainproxyoh cool
01:02lynaghk`kovasb: I can't remember---did we talk about knockout.js?
01:02kovasbbrainproxy: the algebraic notation drives me nuts tho
01:02kovasblynaghk`: yes, i think so
01:02brainproxyGreenberg, the lens.js guy, was also on the Flapjax team
01:03kovasbi think there is a unification to be made there
01:03brainproxythe Flapjax stuff is really really interesting ... look forward to attempting a re-impl w/ clojurescript and monads
01:03brainproxykovasb: agreed 100%
01:03kovasbbetween the event streams, and the edit streams
01:03brainproxyyep
01:03kovasbonce i refactored my notation it became obvious..
01:04brainproxythe hardest part of understanding flapjax is coming to understand how its internal scheduler actually relates to the arrays of listeners attached to estream instances
01:04brainproxyand their respective rank properties
01:04kovasbwhat do you mean by "rank"?
01:04brainproxythere is a topological ordering that keeps the propagation DAG well formed
01:05brainproxythere are some mistakes in the implementation of flapjax that took me forever to figure out
01:05kovasbi see
01:05brainproxysince i was starting from nothing and just reading the source until it made sense
01:05kovasbhow long did that take?
01:05kovasb5min?
01:05kovasb;)
01:06brainproxyfor me, like 9 months, when I could spend time on it
01:06brainproxydon't laugh :p
01:06kovasblynaghk`: i'm getting more convinced that auto-discvering dependencies is not the way to go..
01:06brainproxybut I eventually came up w/ a scheme for fixing the weak reference problem in their code
01:06kovasbnice
01:07kovasbglad u figured it out, so i don't have to :)
01:07lynaghk`kovasb: performance issues?
01:07kovasblynaghk`: if you provide explicit mapping, you a) don't need tricks and b) can do interesting operations
01:08lynaghk`kovasb: I spent a few weeks spinning my wheels reading some of the flapjax stuff and FRTime, then decided I should probably go with the simple approach first and then see what I found lacking in it (if anything)
01:09lynaghk`kovasb: dependency-graph ranking and calculation is a "trick" in my book =P
01:09kovasblynaghk`: i think the flapjax stuff is the way to go
01:09brainproxylynaghk`: it's actually quite simple
01:09brainproxythe scheduler is a binary heap
01:10brainproxyas a chain of evenstreams is worked over, the propagation order is governed by the heap, which sorts on rank
01:10lynaghk`brainproxy: that is still more complex than, "these atoms were dereferenced in the calculation of X. Add watchers to each to update X when they change"
01:11brainproxylynaghk`: yes, but more powerful i think, especially when you extract over estreams to realize "behaviors"
01:11brainproxybehaviors encapsulate state
01:11lynaghk`brainproxy, kovasb: I'm definitely not opposed to a more general explicit streams library though. I'd love to see one in CLJS that I can use.
01:12brainproxylynaghk`: i'm definitely going to work on it, even if I end up doing parallel work w/ respect to another implementation
01:12brainproxybut my time is limited atm
01:12lynaghk`brainproxy: yep, same story here = )
01:12brainproxyone of the beautiful things i realized when making my coffee-script based re-impl of flapjax
01:13brainproxywas that I could support fully variadic streams
01:13lynaghk`brainproxy: you are the zero-repo brainproxy on github?
01:13brainproxylynaghk`: nope
01:13brainproxywell maybe, yes, actually, but i never did anything w/ that account
01:13brainproxyI'm michaelsbradleyjr
01:14brainproxymy attempt at a coffeescript rewrite of flapjax is github.com/projexsys/Jolt
01:14dnolenkovasb: it been brought up a number of times to me that something like Rx + a relational programming model could be very interesting.
01:14brainproxyit doesn't really work, and I'll be going w/ Eclipse lic rather than gplv3
01:14brainproxywhen I rewrite again
01:14dnolenkovasb: also there's some interesting literature about Aspect Oriented Programming + Datalog
01:15kovasbdnolen: yeah, I'm getting excited about that possibility
01:15kovasbdnolen: interesting, will google that too
01:15brainproxybut anyway, what I was saying is that I "discovered" monads in the process of making my lib fully variadic
01:15lynaghk`brainproxy: you are going to rewrite flapjax in cljs?
01:15brainproxyafter a conversation w/ Sussman at Strange Loop last year, he told me i was doing monads and gave me a paper on it
01:15brainproxyit opened my eyes
01:16brainproxyand Hickey's talk on Clojure is what eventually led me here
01:16brainproxylynaghk`: yes
01:16bbloomI've been thinking about aspect oriented programming a little bit with all the CSS stuff I do at work -- CSS is aspect oriented programming basically
01:16bbloomwhich is super cool … except it's totally the wrong default
01:16lynaghk`brainproxy: definitely ping me when you release that, I'd love to check it out.
01:16brainproxylynaghk`: sure
01:17brainproxyi'm self taught, not cs background, so some of this stuff comes hard for me because i don't know the proper terms to express it
01:17brainproxybut I'm learning :)
01:17lynaghk`kovasb, brainproxy: how do you feel about a mailing list or some kind of wiki for this stuff? I'd love to have a single place to throw papers and comments on this subject (reactive programming / UI in cljs)
01:17kovasbnice. well its all about picking the right problems, makes u learn cool shit
01:18dnolenbbloom: yes, it's powerful when you need it. For me the problem w/ CSS is lack of tools for introspecting on the relationship between rules. Probably not even possible to do well since it just letes you do too much.
01:18brainproxykovasb: taking apart flapjax and putting it back together was a transformative experience for me
01:18kovasblynaghk`: i started a wiki, but then found my opinions kept evolving :)
01:19kovasbbut the summary of what i want to do still stands
01:19kovasbhttps://github.com/kovasb/interface/wiki/Desired-Solution-Properties
01:19brainproxylynaghk`: do we need a wiki or would a googe group and an irc channel be enough?
01:19brainproxy*and/or
01:19dnolenlynaghk`: kovasb: I think it's actually worth putting on the ML. I think Clojure is well suited for systems programming - but CLJS is foisting client side stuff on us.
01:20kovasbyeah its a whole new world
01:20lynaghk`dnolen: you mean the clojure mailing list? I was thinking something a bit smaller that would be easier to sort through.
01:20kovasbafter the NYC clojure meet up rhickey told me to write my stuff up and send it to him
01:21lynaghk`brainproxy: I'm just thinking something that I don't have to wander in on at the right time---I feel lucky to have stumbled on you guys talking about this right now.
01:21kovasbseems interested in maybe helping
01:21kovasba wiki has the benefit of being able to store decision trees of design tradeoffs and contraints
01:21brainproxywhat do you guys think about the relationship between a nodejs style EventEmitter and a watcher on, say, an atom/
01:22brainproxy?
01:22dnolenkovasb: lynaghk`: true, a Confluence page would be equally useful.
01:22brainproxythe two patterns seem very similiar to me
01:22dnolenit's been brought up that we might need a new ref type or abstraction - perhaps that can be explored.
01:22lynaghk`brainproxy: I'm a bit rusty on the node, but an EventEmitter is basically just a namespaced callback?
01:22kovasbdnolen: the issue with serialization still stands
01:22brainproxylynaghk`: yeah, i think so
01:23kovasbdnolen: but i think the incremental update, and ref-within-ref problem is gonna get solved
01:23dnolenkovasb: separate issue though right?
01:23brainproxyemitter.emit('foo', 1, 2, 3)
01:23brainproxyany fn registered on emitter for the 'foo' event
01:23brainproxywould be called with args 1, 2, 3
01:23kovasbdnolen: basically project out pieces of the master ref, and combine that with an edit stream
01:24brainproxywhen i was reading the oreilly book, i saw the diagram which matches up ref types in a sync/async, coordinated/uncoord grid
01:25brainproxymy thought is maybe that the func reactive estream/behavior stuff might fit in the async/coordinated cell
01:25brainproxywhich the book noted isn't currently filled by a clojure ref type
01:25brainproxynot sure if I'm off base w/ that idea though
01:25lynaghk`kovasb: I remember you talking about the ref-within-ref stuff a while back. What's the motivating use case? How does it compare with a computed observable that is (get-in [some-key-seq] @ref)?
01:26kovasblynaghk`: motivating use case is nested ui structures. like, a list of lists, where either list can change in length
01:27kovasblynaghk`: and when a sublist updates, you just want to update that part of the ui
01:27lynaghk`kovasb: and you want a diff?
01:27kovasblynaghk`: no, i just want the thing to update :)
01:27lynaghk`ah
01:27kovasblynaghk`: but i don't want to wrap every level that could possible update with a ref
01:28lynaghk`kovasb: I've been sidestepping that issue in our apps by just always having a mapping of what the UI should look like (i.e., a hiccup vector derived from the application data) and then having something just walk the actual DOM and the hiccup represention to sync the former with the latter
01:28kovasblynaghk`: since then you're always converted back and forth between ref-wrapped and pure-value versions
01:28lynaghk`kovasb: I am hoping with that approach we can avoid any explicit DOM manipulation in terms of adding or removing elements or attributes
01:28brainproxykovasb: one thought that I had is that in a web setting, addressable resources (uris) could be modeled as behaviors a la flapjax
01:29kovasbbrainproxy: i'm not sure what a behavior is exactly, but there is definitely interesting stuff to do with the uris
01:29lynaghk`dnolen: in response to your eariler comment: a confluence page would be rad.
01:29brainproxywhen a behavior is updated, any dependent estreams are automatically notified, and there can be downstream "sinks" which then are automatically updated
01:29brainproxyso you could have behaviors in the client, and behaviors in the server
01:30kovasblynaghk`: how do you know what needs do be updated? in terms of syncing up
01:30brainproxyand between them could be plumbing which will take the events flowing through the estreams and turn them into PATCH requests
01:30brainproxyor GET requests which specify in the header that they want a patchable response
01:31lynaghk`kovasb: you walk the existing dom and compare. Collections are a special case where you provide a keyfn to match data-items with node-items (like C2 / D3)
01:31brainproxykovasb: a behavior is an extraction over an estream; a behavior always has a value, which can change over time
01:31kovasbbrainproxy: you mean for keeping models in sync with the server? or for some other purpose?
01:32kovasbi see
01:32kovasbyes, now i remember
01:32brainproxyan estream is a series of values over time
01:32brainproxyi think it fits w/ hickey's notions of state and identity
01:32kovasbyup
01:32kovasbsure does
01:33kovasblynaghk`: i basically agree that the dom should be write-only
01:33brainproxykovasb: i have some ideas for combining this resources-as-behaviors auto-updating stuff w/ scxml
01:33kovasblynaghk`: and just reflect some declarative description
01:34kovasblynaghk`: (even if the declarative description isn't stored in totality at any one time)
01:34brainproxyand a notification scheme which is orthogonal to otherwise stateless, properly restful architectures
01:35lynaghk`kovasb: (not sure what you mean there; it seems like a big advantage of merging hiccup onto the DOM as the only form of DOM manipulation is that everything will always be described totally by the data)
01:35brainproxycould be the makings of a framework, but we'll see; clojure and clojurescript will be my choice tools of implementation, though I want the ideas to be distinct from any one implementation
01:35kovasbbrainproxy: i hadn't head of scxml, does it get used for stuff?
01:35kovasbwill check it out
01:36brainproxykovasb: yes, and there is an implementation for javascript
01:36brainproxybut it's a bit rough
01:36brainproxyhttps://github.com/jbeard4/SCION
01:36kovasblynaghk`: you could do something like (conj! dom-elt [hiccup….])
01:37brainproxythe guy is writing a js-backed implementation of the SCXML spec, but i think it would be better realized as an applicatino of estreams and behaviors
01:37kovasbkovasb: and sort of pretend that the dom element is like a write-only ref or something
01:37kovasbwhoops, meant : lynaghk` ;)
01:37lynaghk`brainproxy: hot damn, I had no idea about scxml. Though, I'm pretty sure every time you write your own state machine library you know you're reinveting the wheel for the 2^16th time.
01:38lynaghk`kovasb: nah, that's dom/append!, which is direct manipulation
01:38lynaghk`I'm saying, you should just be totally declarative about everything all the time. No dom/append, or dom/addClass or anything like that.
01:38kovasblynaghk`: except you could perform the exact same operation on a ref
01:39kovasblynaghk`: the point being, you act as if you are manipulating clojure data the whole time, but internally it maps onto a dom implementation
01:39clojurebot"[Clojure ...] feels like a general-purpose language beamed back from the near future."
01:40lynaghk`kovasb: oh, my issue is with manipulation. Banging on something is banging on something, DOM or ref. What I'm thinking is that if you need to bang on something, you should just do it with a single hammer
01:40lynaghk`e.g. a declarative specification. As soon as you start hitting on one thing from lots of different places, you're back into inversion-of-control mutable-state hell.
01:40kovasblynaghk`: yes I agree. you want to give the declarative mapping once and have it all taken care for you
01:40lynaghk`kovasb: yep. = )
01:40kovasblynaghk`: but under the hood it still needs to do something
01:40ibdknoxsee WPF
01:41lynaghk`kovasb: ahhh, yeah. I see what you're saying. Yeah, maybe you can walk a clojure datastructure rather than the DOM. I suspect the latter will be faster, actually
01:41kovasb XAML is on my list of things to cycle back to.. should check it out sooner rather than later..
01:41lynaghk`though if I'm proven wrong, I'd be happy to change up the implementation. That's a detail though; the public API would be the same.
01:41kovasbibdknox: what are the best parts?
01:42ibdknoxwalking the dom is almost assuredly faster
01:42ibdknoxkovasb: it's a truly declarative, and extremely flexible UI framework
01:42ibdknoxI was able to do some amazing things with it
01:42ibdknoxwithout really writing any "code"
01:43kovasbibdknox: has it been ported to the web?
01:43ibdknoxit has the best databinding implementation I've ever seen
01:43lynaghk`ibdknox: I'm pretty much resigned to dnolen and michalmarczyk opening up some kind of V8 performance wormhole with ClojureScript
01:43kovasbcool
01:43ibdknoxkovasb: not really. MSFTers would argue through silverlight
01:44lynaghk`ibdknox: so I have no expectations about whether DOM walking or CLJS walking will be faster in six months = )
01:44ibdknoxhaha
01:44ibdknoxlynaghk`: fair enough :)
01:44kovasbibdknox: what is the best thing to read?
01:45ibdknoxactually not sure, I learned it because we used it on VS
01:45ibdknoxI can ask around
01:45kovasbhehe
01:45kovasbthe docs i found before seemed reasonable, so if u dunno anything i can figure it out
01:46kovasbbut man, isn't it a lot more civilized to just declaratively specify these high level contructs and put them together
01:46lynaghk`ibdknox: if I dig up $100k will LightTable have visual UI-building + databinding support out of the box?
01:46ibdknoxhaha
01:46ibdknox:p
01:47ibdknoxone thing at a time
01:49kovasbman i can't wait to get all this shit figured out
01:50kovasbits gonna be soo good
01:51bbloomibdknox: I was experimenting with a WPF-style thinggie in cljs. i def think it's doable & would actually be far nicer than working with the XML/XAML stuff. *cringe*
01:52SgeoWell, defonce vs def seems easier to remember than defvar vs defparameter
01:52SgeoAlthough I seem to have remembered defvar vs defparameter just now
01:52kovasbits all about the tagged literals..
01:53kovasbbbloom: well-designed xml is not that bad. i mean, compare xaml to html , so much better
01:53bbloomkovasb: msdn has a decent introduction
01:53ibdknoxbbloom: what would it look like?
01:53lynaghk`kovasb: seriously. Even the primitive computed-observables stuff has been awesome compared to manually juggling lots 'o callbacks.
01:54ibdknoxyeah my little databinding stuff in crate has been fun
01:54kovasbi seriously don't know how web programmers have survived all these years
01:54bbloomibdknox: it would look like a blend between cappuchino & wpf with s-expressions instead of xml
01:54bbloomibdknox: basically, you build a static UI description out of a map of maps of maps
01:54ibdknoxbbloom: if you ever end up with an example, I'd love to see it
01:54kovasbbbloom: this is what we want
01:55bbloomthen you walk it and render it. the render function treats the DOM as a memo table
01:55bbloomkovasb: yeah, i want it too, hence i was experimenting with it :-)
01:55bbloomkovasb: i got side tracked working on the compiler tho. it's fun! :-)
01:55lynaghk`bbloom: memo table?
01:55kovasbhaha
01:55kovasbbbloom: the problem is, how to deal with interactivity
01:56kovasbdoing the mapping once is easy
01:56SgeoFrom 4clojure
01:56Sgeo(.toUpperCase "hello world")
01:56bbloomkovasb: yeah, for sure. that was the part i was only starting to toy w/ and is definitly the hard part. i was mimicing the WPF binding stuff to some extent
01:56SgeoThere's no more "Clojury" way to do that?
01:56dnolenthis stuff really goes back all the way Sketchpad, I'm starting look around, and there's a ton of literature on this stuff.
01:57dnolenhttp://www.cs.cmu.edu/afs/cs/project/garnet/www/papers.html
01:57dnolen"Separating Application Code from Toolkits: Eliminating the Spaghetti of Call-Backs" 1991
01:57bbloomdnolen: yup. i think that things get much easier if you have a good reactive layer to work with
01:57bbloomwhich clojure doesn't yet & wpf came before rx in the .net world
01:57amalloySgeo: clojure doesn't encourage you to pretend it's not a hosted language. that said, i think clojure.string has an upper-case function
01:58kovasbthis place is like a fountain of knowledge
01:58SgeoI want to pretend it's not a hosted language
01:58Sgeo:/
01:58amalloy$findfn "f" "F"
01:58lazybot[clojure.string/upper-case clojure.string/capitalize]
01:58dnolenbbloom: I still think the Rx stuff is too low level, which is why everyone keeps talking about add a relational layer.
01:59bbloommaybe...
01:59dnolenbbloom: and these old papers talk about constraints.
01:59bbloomdnolen: do they mean layout constraints?
01:59dnolenbbloom: no
01:59bbloomdnolen: what kind then?
01:59dnolenbbloom: whole UIs
01:59bbloomah
01:59dnolenbbloom: it's also why I brough up AOP
01:59bbloomgotcha
02:00dnolenbbloom: Rx doesn't handle cross cutting concerns, which occur often in UIs
02:00bbloomyeah, absolutely
02:00bbloomand games too!
02:00kovasbi love these old papers, they remind me how much better ui design is these days
02:00dnoleneven so none of this stuff took off.
02:01bbloomdnolen: a big part of that is b/c it's too damn complicated for the average developer. WPF, for example, feels like you have to grind up a design patterns book and snort it
02:01dnolenyes, so as Chambers says - you gotta come up with a simple interface - even if you've got some serious stuff happening underneath. Otherwise people won't pay attentions.
02:02bbloomalso, the other problem with data binding is that, sometimes, you simply don't want 1-to-1 mappings
02:02bbloomin fact, often
02:02bbloomsometimes you want a save button & what not, so you need to create a backing model
02:02kovasbback in the day, UI platforms were too fragmented
02:02bbloomand it gets messy fast
02:02kovasbnow, if you get it right and do it for the web, it can blow up overnight
02:02bbloomkovasb: yeah, and i think cljs is a unique opportunity to do that
02:03bbloomkovasb: b/c you simply can't do it right without a compiler of some sort. js just isn't expressive enough
02:03lynaghk`bbloom: that sounds like inherent complexity in the specification though, no? Regardless of how you're managing the state and UI
02:03bbloomlynaghk`: exactly, but sometimes the big bag of callbacks is actually an easier way to specify
02:03lynaghk`bbloom: better to have an explicit view model expressing that requirement than just chaining the callbacks or what not
02:03kovasbbbloom: i think u can have a 1-to-1 mapping for a while, and then start reifying
02:03michaelr525EmberJs is built very much around data binding
02:03michaelr525A javascript framework
02:04bbloommichaelr525: i'm not saying it can't be done. I'm saying it's ugly
02:04bbloommichaelr525: but more than that, error prone
02:05brainproxydnolen: can give you give an example of "cross cutting" concerns wrt Rx
02:05brainproxyjust so I can noodle on it :)
02:05dnolenprogramming around events often seemes like manually written constraints to me.
02:05michaelr525bbloom: so you like it more the way XAML does it? specify data binding on the markup?
02:05bbloommichaelr525: xaml is closer. i just can't get over the XML assault on my eyes
02:06bbloommichaelr525: also, xaml has it's own little mini DSLs for binding descriptors and stuff
02:06bbloommichaelr525: there are property converters, which are really just little parsers
02:06bbloommichaelr525: so adding a new binding operation is extremely complex
02:07michaelr525well, not extremly but it is beyond just editing an attribute on an xml tag :)
02:07michaelr525i've worked with silverlight for a while
02:07michaelr525actually a very positive experience, especially after the nightmares of Flex
02:07bbloommichaelr525: oh yeah, the core dev div people at msft are a talented bunch
02:08bbloommichaelr525: silverlight's failure was purely political, not technical
02:08ibdknoxonce you "get" WPF it's astoundingly cool
02:08ibdknoxwhich isn't to say that it can't be done better, but the underlying ideas are very nice
02:08lynaghk`ibdknox: is there a nice way to play with WPF from, um, emacs and linux world?
02:08ibdknoxnope
02:08bbloomibdknox: definitely. that's why i was experimenting with it in cljs & basically just cloning names & ideas from the WPF docs w/ a cljs twist
02:09bbloomi might take another crack at it when i get bored of compiler stuff :-)
02:09brainproxykovasb: one of the goals of the flapjax team was a dsl which let you compose behaviors as if they were values, i.e. a behavior-backed templating language which when compiled spit out markup + javascript
02:09michaelr525there is mono, i think they have implemented wpf, no?
02:09brainproxywhich handled all of the event bidingin in the dom for you
02:10bbloomdnolen: i have a bug that only happens in advanced mode & i have no idea how to figure out what's causing it :-(
02:10ibdknoxmichaelr525: oh did they?
02:10michaelr525but really the big part of the experience is the way it works in VS
02:10brainproxyso you never had to work with callbacks or event emitters manually
02:10michaelr525everything is integrated, slick and easy
02:10ibdknoxbbloom: looking for string keys
02:10ibdknoxlook*
02:10ibdknoxerr, non-string keys
02:10bbloomibdknox: yeah….i have been :-/ *gulp*
02:11ibdknox:(
02:11lynaghk`bbloom: in cljs, that would be (aset thing "key" val) vs. (set! (.-key thing) val)
02:11brainproxymy thought is that a similar thing could be realized with macros, so you could do hiccup like things to compose behavior symbols, which would expand into behavior, estream, callback functions all wired up to event emitters in the DOM
02:11kovasbbrainproxy: where is that aspect covered? i looked around to evidence of that kind of thing but it didn't pop out
02:11lynaghk`bbloom: in case you didn't know. But, um. I guess you're working on the compiler.
02:12bbloomyeah, i'm putzing with some lower level stuff than that… sooo it's not that simple
02:12brainproxykovasb: it's mentioned in the student paper, getting the link...
02:12dnolenbrainproxy: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.96.974
02:12michaelr525ibdknox: sorry, they didn't implement WPF but they have implemented
02:12michaelr525Silverlight
02:12michaelr525http://www.mono-project.com/WPF
02:12brainproxykovasb: http://www.cs.brown.edu/~sk/Publications/Papers/Published/mgbcgbk-flapjax/paper.pdf
02:12brainproxydnolen: thanks!
02:14kovasbbrainproxy: what is their "foreach" operation?
02:14dnolenbbloom: if it only happens in advanced mode lynaghk` is probably right.
02:14kovasbbrainproxy: how do they create a bunch of dom elements with the same behavior
02:14kovasblike in the todo mvc
02:15kovasbbehavior, i mean in the general sense, not their technical sense
02:16lynaghk`kovasb: funny you mention that---I was playing with todomvc with the reflex data binding stuff and a ghetto-datomic this morning.
02:16brainproxykovasb: it's been awhile since i played with the templating lang part of flapjax, tbh, i didn;t
02:16brainproxy.. i didn't "get it" and though it would be better to use flapjax as a js lib
02:16kovasblynaghk`: ha, i was wondering what you were doing in the #datomic channel :)
02:16lynaghk`kovasb: Getting a few different approaches implemented with TODO would be pretty sweet.
02:17bbloomTODO == decent hello world
02:17lynaghk`kovasb: does anything happen in that channel? I asked a question in there last weekend and as far as I'm aware that's the only thing that was said for days.
02:17brainproxykovasb: but having come to clj/cljs, i think i would revisit the idea in terms of macros
02:17bbloombrainproxy: what do you need macros for there?
02:17kovasblynaghk`: the last time i was there, there was discussion
02:17brainproxybbloom: well to combine behaviors, you can use operations like liftB
02:18lynaghk`kovasb: have you used datomic for anything? I like the idea a lot and am thinking about implementing it on an upcoming project
02:18brainproxyb3 = liftB(function(...) { do something w/ vals of b1, b2 }, b1, b2)
02:18bbloombrainproxy: *shrug* i'm not sure it needs to be that complex
02:18brainproxybut it would be nice to be able to do
02:18brainproxyb3 = b1 + b2
02:19brainproxyand a macro could make that possible
02:19brainproxyestreams and behaviors can be chained OO style or composed functional style, but if you want to do behavior-backed templates
02:19brainproxyneither is really attractive
02:21bbloomFOUND THE DOPEY ROUGE aget! w00t.
02:22ibdknoxlynaghk`: what's the value in that approach?
02:22bbloomi'm taking a sort of vacation from work to um… work… on cljs stuff… but that took me way too long, it must be bed time soon
02:22kovasblynaghk`: i've been hankering the play with it, but first things first
02:23kovasblynaghk`: definitely want to try to use it to store "session" data
02:23kovasblynaghk`: also very curious how it would integrate with this reactive web stuff
02:23kovasblynaghk`: like, just dialing into the transaction stream to update the ui
02:24brainproxykovasb: yes, i think that is where it can go
02:24brainproxybut I need to understand the limitations dnolen foresees
02:25kovasbbrainproxy: what limitations?
02:25brainproxyhe said that Rx fails w.r.t. cross cutting concerns
02:25kovasboh yea
02:25kovasbwell, maybe thats an orthogonal primitive
02:26bbloombrainproxy: yeah, i'm not sure what he meant by that
02:26bbloomin general, i view the rx stuff as a lower level thing. cross cutting concerns can be implemetned as queries over the event stream
02:26brainproxybbloom: me neither, but I'll try to grok the paper he linke
02:26kovasb"Datalog as a Pointcut Language in Aspect-Oriented Programming" ?
02:26bbloomkovasb: hell yes.
02:26brainproxyestream isn't really the high level Rx stuff
02:26kovasbthey just need to mention immutability for full complience
02:26lynaghk`ibdknox: value of what approach? re-implementing a ghetto version of datomic?
02:27brainproxybehaviors on top of estreams is higher order
02:27bbloomkovasb: but you may need some explicit optimizations for UI specific queries
02:27brainproxyand behaviors of estreams
02:27brainproxywhich is where i was trying to go
02:27brainproxybefore I realized that js/coffee were too limiting, and I had other pressing concerns as well
02:28kovasbbbloom: anything specific the needs to be optimized?
02:28bbloomkovasb: primarily the two cases css optimizes for: specific elements (ids) and named categories of elements (css classes)
02:28kovasbi see
02:29kovasbI'm all about using the browser to implement our abstractions for us
02:29kovasb:)
02:29bbloom"apply this behavior to the save button"
02:29bbloomor "apply this behavior to all buttons"
02:29lynaghk`bbloom: if you want to take a literal CLJS vacation you can come down to the PDX Clojerks meeting on the 20th
02:29kovasbright
02:29kovasbyeah, theres a bunch of approaches to that
02:30brainproxyactually what you would probably want to do is implement the behavior interface on a button type
02:30brainproxyand then you could compose buttons with any other type that implements the behavior and/or estream interfaces
02:31brainproxysorry, i mean protocol, not interface meaning a java thing as such
02:31kovasbright
02:31bbloomlynaghk`: might not be available that day, but i'll consider it. i'm in seattle
02:31kovasbi vacillate on using protocols for event stuff
02:31kovasbi mean, there are too many possible events to have a protocol for each one
02:31brainproxykovasb: exactly
02:32brainproxythat's why you have the estream abstractino
02:32kovasbso do you just have a 2 function interface
02:32kovasbi see
02:32brainproxyyou "extract" an estream from an event emitter
02:32brainproxythen you can compose the estream with estream transformers
02:32kovasbright, but you need to resolve that piece of data somehow or another
02:32lynaghk`bbloom: I know. Slightly less rain is only a few hour drive away =P
02:32brainproxyor "extract" a behavior fro the estream
02:32brainproxyand use behavior transformers
02:33kovasbeventually you need to call a function on your datatype tho right
02:33kovasbor not?
02:33brainproxyi can probably answer, but can you be more specific
02:33brainproxydon't want to go off in a different direction than you're thinking
02:34kovasbi should read these papers in more detail.
02:34brainproxylet em be an emitter
02:34kovasblol
02:34kovasbmy brain will be a behavior
02:34brainproxy$E(em) returns an evenstream
02:34brainproxywhoops, $(em, 'event')
02:34brainproxyerr $E..
02:35brainproxybut anway, then $B($E(em, 'event'))
02:35brainproxyusing the js syntax, of course
02:35brainproxythat gets you a behavior
02:36kovasbunderstood
02:36brainproxywhat gets interesting is when you, say, pass an the return of $B to an event stream transformer
02:37brainproxyin my thinking, it should by convention represent a behavior of event streams
02:38brainproxywhich then leads to some higher order things like "switches"
02:39lekui'm playing with a piece of code in the repl that does (clojure/refer 'clojure)
02:39lekuand it throws an error
02:39lekuno such namespace: clojure
02:39lekuhttp://jonathanwatmough.com/2008/02/google-charts-from-clojure/
02:39lekui'm guessing this is just old code ?
02:39kovasbbrainproxy: yeah these primitives are promising
02:40brainproxykovasb: the other thing is how do you think about variadic emitters
02:40brainproxyflapjax is hardwired to arity 1
02:40kovasbright
02:40brainproxybut if you allow for N
02:40kovasbthats a problem I'm working on as well
02:40brainproxythen suddenly you need some way to think about that
02:40brainproxymy solution was a transformer which would allow you to set an estream in "zipped", "vectored
02:41brainproxywhoopps
02:41brainproxy"zipped", "vectored" or "sequenced
02:41brainproxymode
02:41kovasbonly 1 of the slots gets filled at a time tho right?
02:41brainproxyjust depends
02:41kovasbif 1 of the 3 events fires, you get null in the other two
02:41brainproxyno, what i mean is
02:42brainproxyem emits three arguments
02:43brainproxyand downstream from em is a mapE
02:43kovasbright
02:43brainproxyshould the fn tied to that mapE interpret as three args to the fn
02:43brainproxyor fn called three times
02:44brainproxywith each of the arguments
02:44kovasbif you want it called three times, can't u just emit three times?
02:44kovasbmight be a limitation of their design
02:44brainproxytheir design is quite limited
02:44brainproxybut I worked up an alternative
02:44kovasbhave u looked at the reducers framework?
02:44brainproxya bit ... i read hickey's blog post, but I was just getting into clojure at the time
02:44kovasbwow u r brand new!
02:45kovasbthe way it handles the mapcat and filter cases are sweet
02:45brainproxyyes, just finished the o'reilly book, and am trying to get my game on
02:45brainproxybut I have to work on some other things for a few months to pay the bills, then I can come back to Rx
02:45kovasbcool well its good to have u on board
02:46raekleku: wow. yep. that's old.
02:46brainproxythanks :)
02:46kovasbthere is also an audio of his talk, which is quite comprehensible
02:46kovasbhttp://www.meetup.com/Clojure-NYC/events/56212552/
02:46kovasbif u read it along with the blog posts, its pretty good
02:46brainproxycool
02:46kovasbanyway, the point being that you just layer your transformation functions in a certain way
02:47kovasband you can do map, mapcat, filter etc in a natural way without resorting to wrappers or empty values
02:47kovasbnot sure if it can be applied to this case, but a cool design precedent
02:47brainproxyyes, the mechanisms that clojure/clojurescript opens up are going to be so much nicer
02:48kovasbthe implementation is pretty nuts, in how much it does with so little lines
02:48brainproxyflapjax and my Jolt have a datastructure called a pulse which moves the date through the propagation DAG
02:48kovasbreifying things left and right, currying
02:48brainproxyand things get really weird when you start doing "pulses of pulses"
02:48kovasbi can imagine
02:48brainproxywhich is improtant for the higher order estream/behavior joins
02:49brainproxyalso, immutability becomes a big deal
02:49kovasbhow much of flapjax does your implementation cover?
02:49brainproxykovasb: I redesigned the internals, and had a lot of the stream stuff working according to my redesign
02:50kovasblike, should i read your code, their code, or both?
02:50kovasbjust to get a sense of whats going on
02:51brainproxykovasb: i started annotating a lot of my stuff w/ docco
02:51brainproxyhttp://projexsys.github.com/Jolt/docs/Jolt.html
02:51brainproxywhat's there is how far i got, for the most part
02:51brainproxyif you use the "jump to" pull down in the top right
02:51brainproxyyou can see how I build up
02:51brainproxysome of the annotations are crappy, and needed to be rewritten :(
02:51kovasbaww
02:51kovasbahh
02:52kovasbi was like, just the license??
02:52lazybotkovasb: Definitely not.
02:52kovasbhaha
02:52kovasbcool
02:53kovasbwell thanks for the pointers. getting late out here in the EST
02:53kovasbif you can work yourself up to understanding the reducers framework (may take a while, i still don't completely) i think it will be informative
02:53kovasbover and out
02:53brainproxykovasb: have a good one
02:56bbloomclj has ruined me… i want to write a little script in ruby or python b/c i want to run it often & not have to wait for jvm startup time.. but maaaan i just wish i had clojure.core
02:58brainproxybbloom: you could write it in clojurescript and compile and then run with nodejs
02:58brainproxyit will be very fast and the node api is very nice for doing systems stuff
02:58bbloomhmmm
02:59brainproxyincluding spawning child processes
03:00brainproxybbloom: there's also some project called jark where you can have a long-running jvm
03:00bbloombrainproxy: yeah, there are a bunch of things like that
03:00bbloombrainproxy: i've used cljsh
03:01brainproxybbloom: not familiar with cljsh
03:02bbloomhttps://github.com/franks42/lein-repls
03:02brainproxyah
03:02bbloomi think that's what ill use
03:05muhoothe madness https://www.refheap.com/paste/3011
03:09Sgeo"Note: always use return value for later changes, never original!"
03:09SgeoThat reminds me of CL, where there are functions that mutate the object yet you're meant to rely on the return value, the mutations is only for efficiency purposes.
03:15Raynesmuhoo: Even Clojure can't make Java look good.
03:19brainproxySgeo: clojure supplies something called transients, but it's recommended that you insulate them, e.g. only use them for optimization w/in a function
03:20Sgeobrainproxy, I assume similarly to the ST monad in Haskell, although ST also supplies sort of "local variabes" that cannot escape outside of ST
03:20Sgeo(enforced by type-system)
03:25brainproxySgeo: see https://www.refheap.com/paste/3011
03:25brainproxywhoops
03:26brainproxyi meant see http://clojuredocs.org/clojure_core/clojure.core/transient
03:28brainproxythe idea is to use a mutable return value of (transient ...) and then use (persistent! ...) for returning an immutable
03:29SgeoRefs are TVars
03:29SgeoThat's easy
03:32Sgeowrt the vars made by with-local-vars, can they be "sneaked out" of the with-local-vars somehow?
03:32SgeoOh, no.
03:53SgeoIs Clooj good?
03:54bbloommail dnolon hacked this up for benchmarking, has been useful https://www.refheap.com/paste/3013
03:54bbloomno idea if lazybot works or not :-P
04:00muhooi have to wonder, is there already a function somewhere in ring that does this? https://www.refheap.com/paste/3014
04:02ro_stthat's usually done by stuff like url_for route_name or route_name_url in rails, which are mostly used in views. p'raps hiccup has something?
04:07Sgeo"The following code demonstrates usage of def, defn, let, binding, and println.
04:07Sgeo"
04:07Sgeohttp://java.ociweb.com/mark/clojure/article.html
04:07SgeoWhy doesn't the example surround v with **?
04:07SgeoWhich is conventional in CL and according to the tutorial in Clojure too
04:08ro_stusually people do. it's not enforced, however. it's just a convention
04:09SgeoHmm, let still behaves locally only with dynamic variables, binding is separate
04:09SgeoThat's different from CL, where let behaves like binding for those types of variables
04:12ro_sthow do i get the slime repl to do the cool stuff that lein2's repl does? doc, find-doc, clojuredoc et al
04:12bbloom(use 'clojure.repl)
04:13ro_stand automatically?
04:14SgeoBesides macro writing, when would I use a list instead of a vector?
04:14ro_stie, no matter what ns i'm in, doc is always available. i'd like this in slime repl too
04:14ro_stSgeo: when doing clojure koans -grin-
04:16bbloomro_st: dunno :-P I'm a vim guy!
04:16ro_st-grin- no worries
04:18muhoohow would i kick a java library into debug mode?
04:19muhooi see _log.isDebugEnabled() in interesting places
04:19SgeoHow frequently is stuff coded to make use of -?> easy?
04:20amalloybbloom: lazybot would work if you used $mail instead of just mail. he's too lazy to magically guess when you want him to do something
04:21bbloomamalloy: ah, thanks.
04:22SgeoOk, so Clojure doesn't have easy facilities for optional and keyword arguments? I mean, they look possible but annoying
04:22bbloom$mail dnolen I hacked this up for comparing benchmark runs: https://www.refheap.com/paste/3015 been super useful so far
04:22lazybotMessage saved.
04:22SgeoI'm starting to like the way Racket handles it
04:23bbloomSgeo: You can make functions with multiple different arities
04:24bbloom&((fn f ([x] (f x 2)) ([x y] (+ x y))) 3)
04:24lazybotjava.lang.RuntimeException: Expecting var, but f is mapped to interface clojure.core.f
04:24bbloom,((fn f ([x] (f x 2)) ([x y] (+ x y))) 3)
04:24clojurebot5
04:24bbloomsorta like default arguments
04:26SgeoBut more typing
04:26SgeoGuess there's no chance that each clause can be checked .... in a sort of pattern matchy way?
04:26SgeoBecause then I'd be happy
04:55SgeoCan someone explain this? "If this were written as a function instead of a macro, we would have to pass #(Math/sin %) instead of simply Math/sin for the function."
04:55SgeoWhy isn't Math/sin and #(Math/sin %) the same?
04:56Sgeohttp://java.ociweb.com/mark/clojure/article.html
05:05raekSgeo: java methods aren't first class objects
05:05SgeoAh. ugh.
05:06raekif you would have had a clojure function there, like clojure.core/inc, it would work in both cases
05:45PKHGhallo I have problems to get https://gist.github.com/757834 to work.... some told me about Math/round, which works direclty in a clojure repl but not in the script java lang exeptions ...
05:46PKHGwho knows to get a workign definition for this example?
05:46PKHGmeans a round which rounds ;-)
05:47borkduderound is not a standard function in clojure
05:48borkdudeyou can use Math/round
05:48borkdude,(Math/round 3.14)
05:48PKHGTHAT does not work!
05:48borkdude,(Math/round 3.55)
05:48PKHGonly directly but not in the script (above)
05:49borkdudePKHG it's not even used in the script
05:49clojurebot3
05:49PKHGhow should I define roudn? moment ...
05:49clojurebot4
05:49PKHGround is used!
05:49borkdudePKHG not Math/round
05:50PKHGso if I ry (fn round [x] (Math/round x)) is not working ...
05:50borkdudePKHG (round (/ (* scale (- v)) val-range)) -> (Math/round (/ (* scale (- v)) val-range)))
05:50PKHGJava has a round in some Math package .... how to make THAT usable ..???
05:50lazybotPKHG: Yes, 100% for sure.
05:52PKHGborkdude: do not understand ...
05:52borkdude,(Math/round (/ (* 0.5 (- 1)) 3)))
05:52clojurebot0
05:52borkdude,(Math/round (/ (* 5 (- 1)) 3)))
05:52clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: round>
05:53borkdude,(Math/round (/ (* 5 (- 1)) 3))
05:53clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: round>
05:53PKHGborkdude is there a . (point) before ?
05:53borkdudePKHG no, to call a static method from the class Math, use /, so (Math/round x)
05:54PKHG.... direct (Math/round 2.4) give to but now make it a round for the script ???? THAT is my problem)
05:55borkdudePKHG why don't you write (Math/round …) instead of (round …) in the script?
05:55PKHGI tried ,,, did not work
05:55borkdudePKHG I see what could cause an error though: ##(Math/round 3/4)
05:55lazybotjava.lang.IllegalArgumentException: No matching method found: round
05:55borkdudeyou get this error?
05:56borkdudePKHG I see what could cause an error though: ##(Math/round (float 3/4))
05:56lazybot⇒ 1
05:56PKHGmoment ... trying again ...
05:56borkdudePKHG the method round does not take a Rational, which is a Clojure type for fractions
05:57PKHGdear helpers .... I need a round which works in the script ... so before loading the script I need a definition of round which would work in the script , sorry ...
05:57borkdudePKHG ok, so: (defn round [n] (Math/round (float n)))
05:57borkdudeor double instead of float
05:57PKHGOH you mean the script uses 34/5 and that has to be changed into a float? have tolook
05:57borkdude,(double 3/4)
05:58clojurebot0.75
05:58PKHGmoment trying ..
05:59PKHGso loading the example I get java.lang.Exception: Unable to resolve symbol: round in this context (NO_SOURCE_FILE:29)
05:59borkdudePKHG I'll tell you one time and then I'll give up: there is no function round out of the box in Clojure
06:00PKHGclear but one can create it can't you?
06:00borkdudePKHG yes, like I wrote: (defn round [n] (Math/round (float n)))
06:00borkdudePKHG good luck
06:00PKHGyes that I will rty now ...
06:05PKHGborkdude: thanks, that defn works ;-) (though ascii-bar-chart does not yet work, but that will be solved ...)
06:07muhoo$mail cemerick progress on google step2 , next integrating with friend https://www.refheap.com/paste/3018
06:07lazybotMessage saved.
06:10PKHG:) ascii-bar-chart works now thanks again guys
06:10borkdudePKHG you might want to replace float with double in the defn, I don't know, nice that it works
06:11PKHGok ...
06:11PKHGnoted
06:12borkdudeit depends on the precisioun you will need, probably not a big deal here
06:12PKHG;-)
06:17gfredericks,(rem 7/5 1)
06:17clojurebot2/5
06:18gfredericks(defn round-rat [r] (let [f (rem r 1)] (if (< f 1/2) (- r f) (+ r (- 1 f)))))
06:18gfredericks^ exact rounding for rationals
06:23borkdudegfredericks it returns a double when you put in a double but a BigInt when you put in a Rational
06:23gfredericksborkdude: which is what I'd want
06:24gfrederickse.g. if your rational is larger than the max double value, I don't even know what you'd get if you tried to convert to double first
06:24borkdudegfredericks great
06:25borkdudeit's a bit surprising that this function isn't included in clojure maybe?
06:26gfrederickseh :/ there's not too much for dealing with rationals. just the bare minimum
06:27PKHGborkdude: have a look here http://www.petergragert.info/pmwiki/uploads/Clojure/asciibarchart.jpg
06:27PKHGthe example of the script ;)
06:27borkdudePKHG great :-) I love ascii
06:27PKHGsometimes me too ...
06:29gfredericksborkdude: I can't think of another example of an equivalently useful rational number function, so maybe that one is blatantly missing from core
06:29borkdudePKHG are you Peter Gragert who teached Calculus at University of Twente?
06:29PKHGyes ;)
06:30borkdudegreat!
06:30borkdudeI attended your lectures in my first year
06:30gfredericksyou guys aren't fooling anybody. We all know "University of Twente" is a made up name.
06:30borkdudelol
06:30PKHGwas je een van mijn studenten?
06:30borkdudeja, bij Informtica
06:30gfredericksand that's a made up language.
06:30PKHGwhich year ?
06:30borkdudeI started in '99
06:31PKHGnice ... and how did I do it for you? some math fable?
06:32borkdudeI really liked Calculus (really), in opposite of many other students
06:32PKHGyou remember by sure : Tante Maple and 'appelsientje' hi hi ...
06:32borkdudefinally there were proofs for "stellingen" we used at VWO
06:32PKHGand now you are a Lisp fan? Reduce used standard Lisp ... formula manipulation wa there was no Maple ..
06:33borkdudeI became a lisp fan around my fourth year
06:33borkdudebut functional programming in my first year influenced that already
06:33PKHGmy PHD was based on Standard Lips using ..
06:34PKHGLips = Lisp :)
06:34PKHGborkdude: still in NL?
06:34borkdudePKHG my internship and final thesis were done using Common Lisp
06:34borkdudePKHG yes, Amersfoort
06:35PKHGnice ...! just started reading: Artificail Intellgent Programming (Common Lisp) Peter Norvig ;
06:35PKHGoth t;yping errors but readable ...
06:36PKHGmay I ask a question?
06:36borkdudePKHG I read that book also
06:36borkdudeof course
06:36PKHGgood ... strange result ... moment (in several lines ...) moment please
06:39PKHG(setf a 'global-a)
06:39PKHG(setf *b* 'global-b)
06:39PKHG(defun fn () *b*)
06:39PKHG(let ((a 'local-a)(*b* 'local-b))
06:39PKHG (list a *b* (fn) (symbol-value 'a) (symbol-value '*b')))
06:39PKHGWhat should be printed (the last result was 'local-b' and I expected '(global-b))
06:40PKHGpage 95 of the book
06:40borkdudelet me see
06:41PKHGfour times local and onlu the (symbol-value 'a) gave global?/??
06:41lazybotPKHG: Uh, no. Why would you even ask?
06:41PKHGlazybot: it was an exercise in the book!
06:42gfredericks$botsmack
06:42borkdudePKHG don't mind lazybot ;)
06:42PKHGso so ....
06:42PKHGis lazybot some AI trying to ask 'intelligint' questions?
06:43gfrederickslazybot: are you???
06:43lazybotgfredericks: Yes, 100% for sure.
06:43PKHGlazybot: what is your real name?
06:43lazybotIt's AWWWW RIGHT!
06:43borkdudePKHG lazybot can evaluate some clojure for you
06:44borkdude&(+ 1 2 3)
06:44lazybot⇒ 6
06:44PKHGso it is a clojure program ...
06:44borkdudeor in text ##(+ 1 2 3)
06:44lazybot⇒ 6
06:44gfredericks&(#(% %) #(% %))
06:44lazybotjava.lang.StackOverflowError
06:44PKHGnice game ..
06:45borkdudePKHG if you like game, you should also see www.4clojure.org
06:45PKHG(Math/round (/ 34 5))
06:45borkdudePKHG put an ampersand (&) in front of it
06:45PKHGok ...
06:45PKHG&(Math/round (/ 34 5))
06:45lazybotjava.lang.IllegalArgumentException: No matching method found: round
06:46PKHG&(Math/round (double (/ 34 5)))
06:46lazybot⇒ 7
06:46PKHGreally nice ;-)
06:47borkdudePKHG I'm reading on special variables now, it's been a while, but they seem similar to dynamic vars in Clojure
06:48PKHGhmmm ... does lazybot remember definitions as my example above (from the book)?
06:48PKHGtrying ;-)
06:48borkdudePKHG so in the exercise local-b should be printed
06:49PKHGborkdude it is ... but why? the difference between a and *b* *b* ===> Parmeter the stars ???
06:49lazybotPKHG: Oh, absolutely.
06:50PKHG&(setf *b* 'global-b)
06:50lazybotjava.lang.RuntimeException: Unable to resolve symbol: setf in this context
06:50borkdudePKHG *b* is a "special variable" which you can rebind to a value, similar to dynamic vars in clojure
06:50SgeoPKHG, are you coming from a Common Lisp background?
06:50PKHGok... not yet so good in clojure (dynamic vars ..)
06:51PKHGNo Standard Lisp where Reduce was written in ...
06:51Sgeobinding in Clojure is basically how you'd do let on a special variable in Common Lisp
06:51SgeoIf I understand correctly
06:51borkdudePKHG see this: http://clojuredocs.org/clojure_core/clojure.core/binding
06:52SgeoNot sure if that's helpful
06:52PKHGwill have a (short) look ....
06:52Sgeo(let [*b* 1] (f)) where f mentions *b* doesn't work in Clojure the way it would in CL, you have to use binding instead of let for that
06:53borkdudePKHG this is particularly helpful for example when you have a function that uses println which by default prints to *out*
06:53PKHGyes that nice API doc ... thanks borkdude ... my nap-time is coming ... hope to see (chat) you later againg bye
06:53SgeoWait, is PKHG coming from a CL background?
06:53PKHGSgeo: no STANDARD LISP
06:53borkdudePKHG see you later, it was a pleasure talking to you again after all these years ;)
06:53PKHGme too ;-)
06:54PKHGwhat is the world small ...
06:54Sgeoo.O never heard of Standard Lisp
06:54borkdudeSgeo that's because you are too young
06:54PKHGand PKHG is 70+ ;-)
06:54borkdudeSgeo it doesn't even have a wikipedia page: http://en.wikipedia.org/wiki/Portable_Standard_Lisp
06:55PKHGborkdude: phantastic!
06:55PKHGtheat link
06:56borkdudePKHG it can be confusing learning common lisp and clojure at the same time
06:56PKHGStnadard lisp made it possible to compile to machinecode Reduce formala manimpulation programs!! facto up to 1000 measured in better perfomance
06:56PKHGborkduce: ... oh will pay attention to it ...
06:58PKHGborkdude: do you use emacs and slime ? and get clojure good running in emacs? succeeded only half ...
06:58borkdudePKHG I use it, but I also use Eclipse (a Java IDE)
06:59PKHGEclipse can it run clojure =REPL in eclipse?
06:59borkdudePKHG yes!
06:59PKHGoh ... then maybe I should try .. ;-) (will ask later about this ) now rsally leaving
07:00borkdudeI can't believe it… my old math professor
07:01borkdudewow
07:01borkdude:)
07:47irc2samushi guys, anyone knows how to tell lein to pass -Xlint to javac?
07:48borkdudeirc2samus try #leiningen
07:49irc2samusoh nice, didn't knew it had a channel thanks
08:06ladyboyWhat is the difference between Clojure and PHP?
08:07Iceland_ERCwat
08:09michaelr525php is for ladyboys?!
08:09michaelr525clojure is for real men (tm)
08:09banseljajladyboy: Is that an *actual* question or ae you trolling?
08:09hyPiRionGuys, he left immediately.
08:09banseljajtroll (tm)
08:10S11001001irc tab complete is your friend
08:10michaelr525just joking
08:10michaelr525hhh
08:10banseljajDoes clojure have bindings for GUI other than swt?
08:11gfredericksWELL now that you ask there are some differences between PHP and Clojure if I'm not mistaken.
08:11hyPiRionbanseljaj: Do you mean like seesaw?
08:11banseljajI might. I am a beginner, so was just looking for options
08:12hyPiRionAh - as in non-swing GUI?
08:12banseljajhyPiRion: Yes.
08:13clgvbanseljaj: well one option is to use swing/swt as you would in java - but afair something like seesaw might be less pain ^^
08:13banseljajclgv: Thanks
08:13hyPiRionSeesaw is using Swing, but it simplifies stuff at least.
08:31gfredericksTimMc: after reading some of byrd's thesis, I now suspect that the spooky properties of -inc might not be actually invoked; i.e. it might be able to be (fn [] ...) instead of (fn -inc [] ...)
08:38bobryis it possible to use futures in clojurescript?
08:39gfrederickswell the "defer" concept is possible but not the "block until it finishes" concept
08:42gfredericksTimMc: and indeed all the core.logic tests pass after removing the function name
08:43LauJensenbobry: js is single-thread
08:46borkdudeyou can now have some kind of background workers right
08:46borkdudehttps://developer.mozilla.org/En/Using_web_workers
08:47borkdudedon't know how well this is supported everywhere though
08:47bobryLauJensen: indeed, but it doesn't mean we can't make the usual 'callback'-style of doing things more readable
08:48bobryeven jQuery has futures http://api.jquery.com/category/deferred-object/
08:48S11001001gfredericks: with one thread, future is delay
08:49gfredericksS11001001: but you can't deref it
08:49S11001001deref is run 0-arg function, assign to cache, return that
08:49gfredericksI guess that's true
08:50S11001001what you can't do is assume that it will eventually get around to doing something *before* you deref
08:50gfredericksit's sort of a crippled abstraction though
08:50S11001001but it's equivalent semantically for pure futures
08:51gfredericksso are they included? I haven't checked.
08:52TimMcgfredericks: Oho! So it's just there for debugging purposes.
08:53gfredericksTimMc: oh yeah? it shows up in the fn's class name I guess?
08:54TimMcYeah, it's in the stack trace that way.
08:54gfredericksnow I'm curious if there are any pathological constructions that actually _do_ trip up on the name collision
08:54gfrederickswhich presumably are not covered by the tests
08:55TimMcThat would be an entertaining ticket to file if you could construct one.
08:55gfredericks:) and an easy fix
08:55TimMcBastard version: Don't tell them the answer, let them figure it out.
08:55gfrederickslol
09:04gfredericksTimMc: I would think a couple nested fresh's would trigger it but they don't :/
09:05gfrederickse.g. in (macroexpand-all '(fresh [x] (fresh [y] s#)))
09:07gfredericksoh I bet it's backquote expanding it to clojure.core.logic/-inc before it gets resolved
09:07TimMcgfredericks: Ah, right. Because -inc (macro) doesn't defn -inc (function).
09:07TimMcSo hah! I was right. :-P
09:07gfrederickswat
09:08gfredericksI never thought it was a var issue I thought it was a lexical scope issue
09:08gfredericksif the -inc in fresh were changed for ~'-inc I think that would trigger it
09:18Chiron_Hi, any body using clj-hector?
09:19clgv~anyone
09:19clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
09:21gfredericksDoes anyone know the question I really want the answer to?
09:22gtrak42
09:23gfredericksclojurebot: 42?
09:23clojurebot42 is forget (+ 2 3)
09:23gfredericksclojurebot: 42 is 6 * 9
09:23clojurebotAlles klar
09:23Chiron_clojurebot: para que la vida
09:23clojurebotblackdog is the star of Black Dawg Down
09:25clgv42?
09:25clojurebot42 is forget (+ 2 3)
09:26clgvclojurebot: 42?
09:26clojurebot42 is forget (+ 2 3)
09:26gfredericksclojurebot: forget 42 is forget (+ 2 3)
09:26clojurebotAlles klar
09:26gfredericks42?
09:26clojurebot42 is the answer
09:33hyPiRion42?
09:33clojurebot42 is the answer
09:33hyPiRionhm.
09:34Hodappo_O
09:36S11001001,(get 42 42 42)
09:36clojurebot42
09:37gfredericks,((comp (partial apply get) (partial repeat 3)) 42)
09:37clojurebot42
09:37TimMcHodapp: clojurebot is our spontaneous non sequitur generator
09:38gfrederickshe's not our spontaneous sequitur generator
09:39HodappTimMc: Um, I'm sorry, but that's my job, not a bot's job.
09:40gfredericksit's a shame all the honest hard-working folk being put out of a job by a machine
09:40mprenticedishonest and lazy folks too. let's not forget to mourn them.
09:40cshell,(name :key)
09:40clojurebot"key"
09:41cshellsweet
09:41gfredericks,(name :foo/key)
09:41clojurebot"key"
09:41Hodappblah blah blah liberals government.
09:41cshellCan keys be namespaced?
09:41Hodappsee, I could have come up with a good non-sequitur there back in my day
09:41S11001001,(clojure.pprint/cl-format nil "~:R" 42)
09:41clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.pprint>
09:41gfrederickscshell: ##::yep
09:41S11001001pth
09:41gfredericks(dec lazybot)
09:41lazybot⇒ 5
09:41gfredericks,::yep
09:41clojurebot:sandbox/yep
09:41S11001001&(clojure.pprint/cl-format nil "~:R" 42)
09:41lazybot⇒ "forty-second"
09:57clgv&(doc clojure.pprint/cl-format)
09:57lazybot⇒ "([writer format-in & args]); An implementation of a Common Lisp compatible format function. cl-format formats its arguments to an output stream or string based on the format control string given. It supports sophisticated formatting of structured data. Writer i... https://www.refheap.com/paste/3026
09:58S11001001by far the most useful bit of clojure.pprint
09:58twhumeI have a question about parallelisation; I'd like to speed up my program by using pmap instead of map. I understand that this delivers the most benefits when the function passed to pmap is doing more work. Is there a library or equivalent out there for Clojure which lets me use pmap and fiddle with the batch size of jobs passed into it (i.e. "give each thread the next 30 items in the sequence", instead of "give each thread one item")?
09:59S11001001twhume: partition, pmap, apply concat
09:59mrtentje1For a webnoir program I want to have all the sessions, so I can create a list of all the current players... There is a way to get all the sessionid´s in Clojure: with: (cookies/get "ring-session"). Now I have the id´s how do I get the corresponding session(s)?
09:59clgvtwhume: pmap isnt using parallelity very well, since it's lazy-parallel
09:59S11001001not worth a library
10:00twhumeclgv: is there something else I should look at? My application is literally iterating over a vast sequence, testing each element… so it feels light it ought to be possible to parallelise it easily.
10:00twhumeS11001001: thanks
10:00clgvS11001001: and a (map f ...) insteaf of f ;)
10:00S11001001clgv: truth
10:01clgvtwhume: there is nothing built-in yet, afaik.
10:01gfredericksS11001001: and partition-all instead of partition
10:01S11001001and I'd start with blocks more like 1k elts
10:02S11001001I think partition is now the same
10:02S11001001&(partition 2 [1 2 3])
10:02lazybot⇒ ((1 2))
10:02S11001001&(clojure-version)
10:02lazybot⇒ "1.4.0"
10:02S11001001hmm
10:02hyPiRionheh
10:02S11001001disappointing
10:02S11001001&(doc partition)
10:02lazybot⇒ "([n coll] [n step coll] [n step pad coll]); Returns a lazy sequence of lists of n items each, at offsets step apart. If step is not supplied, defaults to n, i.e. the partitions do not overlap. If a pad collection is supplied, use its elements as necessary to co... https://www.refheap.com/paste/3027
10:03hyPiRionYou could always do some java parallelism
10:03clgvtwhume: you can do (->> coll (map #(future (f &))) doall (map deref))
10:03S11001001I wonder what this part of that doc means then: "In case there are not enough padding elements, return a partition with less than n items."
10:04gfredericksclgv: could run out of memory that way
10:04S11001001&(partition 2 2 [] [1 2 3])
10:04lazybot⇒ ((1 2) (3))
10:04hyPiRion&(doc partition-all)
10:04lazybot⇒ "([n coll] [n step coll]); Returns a lazy sequence of lists like partition, but may include partitions with fewer than n items at the end."
10:04S11001001HAH
10:04S11001001classy
10:04clgvgfredericks: you can always run out of memory in lots of ways ;)
10:04gfredericksclgv: good point. no more worrying about that!
10:05gfrederickslaziness is for wusses
10:05S11001001&(doc future-call)
10:05lazybotjava.lang.SecurityException: You tripped the alarm! future-call is bad!
10:05S11001001what
10:05S11001001,(doc future-call)
10:05clgvgfredericks: laziness sucks when you want to parallelize - hence the reducers ;)
10:05clojurebot"([f]); Takes a function of no args and yields a future object that will invoke the function in another thread, and will cache the result and return it on all subsequent calls to deref/@. If the computation has not yet finished, calls to deref/@ will block, unless the variant of deref with timeout is used. See also - realized?."
10:06hyPiRiontwhume: Do you really need the speed though?
10:06gfredericksclgv: it doesn't suck when you want to parallelize more things than can fit in memory
10:07Hodapphttp://www.infoq.com/presentations/We-Really-Dont-Know-How-To-Compute - this lecture from Sussman is quite fascinating, I think
10:07twhumehyPiRion: I'd like to make use of it, yes. I'm processing a sequence which might be billions of items.
10:07Hodappheard it from #scala but he mostly uses Scheme/Lisp in the lecture
10:07dnolenHodapp: was cool to see him give that at StrangeLoop
10:07S11001001right, so maybe you want 64k-sized partitions instead :)
10:09Hodappdnolen: you saw it too?
10:09dnolenHodapp: yes
10:10Hodappthat's pretty cool
10:10Hodappthis is the first lecture I've seen of his in any form
10:10Hodappbut it makes me rather want to read SICP and watch his lectures of that even if they're 20 years old
10:10ro_stthis is probably a long shot. but here goes… anything like http://activeadmin.info/ in clojure, yet?
10:11clgvgfredericks: well, that depends on the characteristic of the function applied - if its runtimes are pretty inhomogenoeus pmap really sucks
10:11dnolenHodapp: SICP is incredible - old lectures are awesome.
10:11hyPiRionBillions of items? I'd be concerned with memory usage if I were you.
10:11ro_stHodapp: whose lectures?
10:11dnolenro_st: Sussman
10:11Hodappro_st: I think they are given by Sussman but I may be wrong.
10:12hyPiRionRegardless, I think futures is the way to go.
10:12gfredericksclgv: it doesn't depend. if you have a billion-item seq then materializing the whole thing is always bad.
10:12clgvhyPiRion: you might use custom futures since their standard thread pool is not fixed size which can decrease performance
10:13clgvgfredericks: you dont need to use pmap to not keep everything in memory ;)
10:13gfredericksclgv: I'm not arguing for pmap I'm arguing against your code
10:14clgvgfredericks: it was a quick example how the main problem of pmap can be solved - I didnt know what his amount of data was by then
10:14gfredericksk
10:14hyPiRionclgv: Or just Java-futures. Use a ThreadFactory.fixedThreadPool, put in callables, and save the futures.
10:15clgvhyPiRion: yeah. but you can write yourself a future+ or such with this implementation ;)
10:15clgvfor convenience and ease of use ;)
10:15hyPiRionTrue.
10:19clgvin principle it would be pretty handy to modify the future threadpool in general
10:19mrtentje1For a webnoir program I want to have all the sessions, so I can create a list of all the current players... There is a way to get all the sessionid´s in Clojure: with: (cookies/get "ring-session"). Now I have the id´s how do I get the corresponding session(s)?
10:25borkdudemrtentje1 I think you need to use some functions from ring to get them
10:25borkdudehttps://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/middleware/session.clj
10:26borkdude-> session (read-session store sess-key) …
10:28borkdudemrtentje1probably the memory store is already a map with session ids as keys? https://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/middleware/session/memory.clj
10:38borkdudemrtentje1 I've got something now
10:38mrtentje1borkdude: so the only thing I need to do is to get the memory-store of the ring the get the current sessions?
10:38borkdudemrtentje1https://gist.github.com/2882250 <-- mem is atom with the map which contains all sessions
10:39borkdudeso when I execute this in two different browsers I see smth like this:
10:39borkdudeWelcome to foo{"68700737-41b6-41fa-9c9d-c2795c89bdb8" {:test "hello"}, "c1ed6479-01c3-455c-8bf8-1668cf3b6c06" {:test "hello"}}
10:40borkdudetwo sessions with a map for sessions data
10:40borkdudeyou could save the names in there
10:40borkdudeper session
10:40borkdudeand retrieve them from mem to list all the names
10:41borkdudeso (session/put! :name "username")
10:42borkdudeand then write a function that lists the names: (for [[k v]@session/mem] (:name v))
10:43borkdudemrtentje1 so no need to use any ring stuff, just mem
10:57nDuffI'm trying to support unloading/reloading of JIRA plugins written in Clojure. The initial load works -- but if I simply use remove-ns, the namespaces aren't recreated when the classes are loaded again (this happens through a different classloader, so they really _should_ be freshly loaded). What should I be paying attention to?
11:19xumingmingv_I just read an amazing sentense
11:20xumingmingv_"all Clojure functions implemented java.util.Comparator"
11:20borkdudethey do
11:21xumingmingv_how and why?
11:21borkdudexumingmingv_ for use in sort for example
11:21borkdude,(sort > [1 2 3 4])
11:21clojurebot(4 3 2 1)
11:21borkdude,(doc sort)
11:21clojurebot"([coll] [comp coll]); Returns a sorted sequence of the items in coll. If no comparator is supplied, uses compare. comparator must implement java.util.Comparator."
11:22xumingmingv_but obviously not all functions can be used as the comparator?
11:22samaaronit's only useful if the fn takes two args
11:22samaaronand returns somethign sensible
11:22samaaronbut that doesn't just have to be -1 0 1
11:22samaaronit can also be true and false
11:22samaaronwhich means fns like < can act as a comparator
11:23borkdudeyou can see here how it is implemented: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/AFunction.java
11:23foxdonut,(compare > 4 2)
11:23clojurebot#<CompilerException clojure.lang.ArityException: Wrong number of args (3) passed to: core$compare, compiling:(NO_SOURCE_PATH:0)>
11:23foxdonut,(.compare > 4 2)
11:23clojurebot-1
11:23foxdonutcool
11:24foxdonut(inc borkdude)
11:24lazybot⇒ 2
11:24xumingmingv_I understand why now, but seems a little werid
11:24borkdude,borkdude
11:24clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: borkdude in this context, compiling:(NO_SOURCE_PATH:0)>
11:24borkdude;-)
11:24xumingmingv_ to let all functions implement a Comparator interface
11:24foxdonut$karma borkdude
11:24lazybotborkdude has karma 2.
11:24borkdudeI see...
11:25borkdude$karma Borkdude
11:25lazybotBorkdude has karma 2.
11:25borkdudeis karma case sensitive?
11:25foxdonutno idea.
11:25foxdonut(inc Borkdude)
11:25lazybot⇒ 3
11:25borkdudebecause I chose to lowercase my nick
11:25foxdonut(inc borkdude)
11:25lazybot⇒ 4
11:25borkdudeah
11:25borkdudeit's not
11:25foxdonutguess not
11:25borkdude;)
11:25clgv,(map println (repeat 3 "(dec borkdude"))
11:25clojurebot((dec borkdude
11:25clojurebot(dec borkdude
11:25clojurebotnil (dec borkdude
11:25clojurebotnil nil)
11:25foxdonut(inc FOXDONUT)
11:25lazybot⇒ 2
11:26clgv,(doall (map println (repeat 3 "(dec borkdude)")))
11:26clojurebot(dec borkdude)
11:26lazybot⇒ 3
11:26clojurebot(dec borkdude)
11:26lazybot⇒ 2
11:26clojurebot(dec borkdude)
11:26lazybot⇒ 1
11:26clojurebot(nil nil nil)
11:26foxdonutlol
11:26clgv;)
11:26hyPiRionThis is abuse!
11:26borkdude$karma borkdude
11:26lazybotborkdude has karma 1.
11:26borkdude:(
11:26foxdonut$karma clgv
11:26lazybotclgv has karma 3.
11:26borkdude$karma borkdude
11:26lazybotborkdude has karma 1.
11:26hyPiRion,(dotimes [i 3] (println "(inc borkdude)"))
11:26clojurebot(inc borkdude)
11:26lazybotDo I smell abuse? Wait a while before modifying that person's karma again.
11:26clojurebot(inc borkdude)
11:26lazybotDo I smell abuse? Wait a while before modifying that person's karma again.
11:26clojurebot(inc borkdude)
11:26lazybotDo I smell abuse? Wait a while before modifying that person's karma again.
11:27borkdudelook at this though:
11:27hyPiRionHahah.
11:27borkdude$lazybot
11:27borkdude$karma lazybot
11:27hyPiRion(inc borkdude)
11:27lazybotlazybot has karma 5.
11:27foxdonut$karma lazybot
11:27lazybot⇒ 2
11:27lazybotlazybot has karma 5.
11:27hyPiRionThat works at least.
11:27borkdude$karma lazybot
11:27lazybotlazybot has karma 5.
11:27clgvlol how did he notice that in hyperions snippet?
11:27borkdudeah I guess karma is channel-local
11:27borkdude$karma lazybot
11:27lazybotlazybot has karma 5.
11:28borkdudeSometimes implementation details say more than a thousand words
11:29borkdudeI think inc should be inc! though
11:29borkdudesince it mutates
11:38borkdudeibdknox what happens to session data of old sessions in Noir, it is kept in mem forever?
11:39borkdudeibdknox I kind of guess so, but I want to make sure
11:40clgvborkdude: that probably depends on the session store
11:40pandeirois there a way to create a collection/seq/map atom that limits itself to a certain count?
11:40borkdudeclgv with the default one?
11:41clgvpandeiro: a bounded buffer?
11:41pandeiroclgv: don't know the term, but .. myabe?
11:42pandeirobasically the inverse of what borkdude is asking...
11:42clgvborkdude: I don't know. if it's a plain in-memory store, it'll probably keeps them as long as the program lives
11:42pandeiroi assumed a naive implementation would be to use (add-watch ...) but would that work?
11:42borkdudeclgv I guess so. is it easy to use a more advanced session store?
11:43pandeiroborkdude: there's an easy one for couchdb
11:43pandeirohttps://github.com/sritchie/couch-session
11:43clgvpandeiro: you can build it via the persistenqueue if you like to have a persistent collection that has a limited number of elements
11:43borkdudepandeiro one that has an automatic time-out and clean up functionality?
11:43pandeiroborkdude: no don't think it comes with that outta the box
11:45clgvborkdude: provided you have the sessions in a db you can just have some cronjob like behaviour which deletes the sessions from the db
11:45pandeiroclgv: but then can i access the nth item of a persistentqueue as easily/quickly as a vector for instance?
11:45borkdudeclgv true
11:45clgvpandeiro: you want to have a vector?
11:45pandeiroclgv: hypothetically yeah that's what i would want
11:46pandeiroi have never used persistentqueue b/c there's no reader syntax for it ergo it doesn't exist to me :)
11:46clgvpandeiro: what's the context?
11:46clgvthere will be reader syntax for it as far as I heard rich saying here
11:46pandeiroclgv: something like sessions, where i want to keep them in memory w/o worrying about the object getting too large, while also being searchable and indexable
11:47clgvpandeiro: you mean a cache?
11:47clgvfogus implemented a lib for caching
11:47pandeiroclgv: just an in-memory store but that is self-limiting
11:47pandeirothat discards the oldest item once it reaches a certain count
11:48clgvso implement one with a cache with LRU strategy
11:48timvisher,(.isUpperCase \A)
11:48clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching field found: isUpperCase for class java.lang.Character>
11:48timvisherwhat am i doing wrong there?
11:48Iceland_ERC,(Character/isUpperCase \A)
11:48clojurebottrue
11:48clgvpandeiro: https://github.com/clojure/core.cache
11:49timvisherboo…
11:49borkdudea lazy seq that grows at the end and loses its head?
11:49timvisherthanks :)
11:49Iceland_ERCheh, boo indeed :)
11:49pandeiroyeah that is basically it
11:50clgvaccording to your description you definitely want a cache ;)
11:51borkdudeor an atom with some accessor fns
11:51pandeiroclgv: thanks it's an acute lack of compsci background my issue :)
11:52borkdudeI guess you can close over an atom in multiple functions right
11:52pandeiromy naive implementation was gonna be a vector atom with a watcher
11:52borkdudeover the same atom
11:53borkdudeit would basically be back to OO this way, maybe not a good approach ;)
11:54clgvborkdude: yepp ##(let [a (atom 0) f (fn [x] (swap! a + x)) g (fn [] (println "a =" @a))] (g) (f 10) (g))
11:54lazybotjava.lang.RuntimeException: Expecting var, but f is mapped to interface clojure.core.f
11:54clgvuh what?
11:54borkdude&f
11:54lazybotjava.lang.RuntimeException: Unable to resolve symbol: f in this context
11:55clgvin 1.2.1 that worked^^
11:55clgv&(type clojure.core.f)
11:55lazybotjava.lang.ClassNotFoundException: clojure.core.f
11:55borkdudein my 1.4 repl it also works
11:55clgvlazybot error^^
11:56borkdude,(let [a (atom 0) f (fn [x] (swap! a + x)) g (fn [] (println "a =" @a))] (g) (f 10) (g))
11:56clojurebota = 0
11:56clojurebota = 10
11:56borkdudethe "problem" with their approach is that in order to def the functions you would have to use def somewhere in the let, which I don't find very clean
11:56borkdudetheir/this
12:00borkdudeit would work though
12:00clgvyou should switch to protocol and deftype/defrecord if you plan to do something like that - since you can return the instance from a function then
12:01borkdudeclgv what instance
12:03clgvborkdude: well if you want to return 2 functions closing over the same atom you end up with some "instance". it might be a vector of functions, a map of keyword and function - so you can do it right as well by using defprotocol and deftype/defrecord ;)
12:03borkdudeclgv and not expose the atom?
12:04borkdudeclgv I haven't worked with defrecords/deftypes very much yet
12:04clgvideally not, for encapsulation purpose
12:04borkdudeclgv maybe this vector of only n places could be made simply with a defrecord then
12:05clgvborkdude: core.cache has a protocol for caches ;)
12:06clgvand uses deftype
12:07borkdudeclgv I see
12:17TolstoyHi folks. In Groovy, I can println (java.util.List.class) and get "interface java.util.List". But in clojure, (class java.util.List) returns java.lang.Class. Is there a way to get the interface in clojure?
12:17technomancy,(ancestors (class ()))
12:17Tolstoy(For using some horrifying java lib.)
12:17clojurebot#{java.lang.Iterable clojure.lang.IMeta clojure.lang.IPersistentList java.util.Collection java.io.Serializable ...}
12:17technomancytada!
12:17TolstoyHm.
12:17borkdude,java.util.List
12:17clojurebotjava.util.List
12:18borkdude,(type java.util.List)
12:18clojurebotjava.lang.Class
12:18borkdudeWhat do you mean with "getting the interface"?
12:18TolstoyI've for something like this to work with: Service service = new Service (Interface.class)
12:19borkdudeTolstoy: ##java.util.List
12:19borkdudeis already the object you want then
12:19borkdudeTolstoy: &&java.util.List
12:19borkdudeno… #$,& this notation ;)
12:20Tolstoyborkdude: that's not working. Maybe I'm misunderstanding you?
12:20borkdudeanyway, the symbol java.util.List evaluates to the class object of java.util.List
12:20TolstoyAh!
12:21Tolstoyborkdude: Thanks! That solved it.
12:22borkdude,(.isInterface java.util.List)
12:22clojurebottrue
12:28aduI'm really loving the clojure docs
12:42nDuffHmm.
13:01dwierenganewb question: what's the idiomatic way to test that all the values of a hashmap are not-nil?
13:05technomancy,(every? identity (vals {:a :b :c :d}))
13:05clojurebottrue
13:05S11001001false
13:05dwierengatechnomancy: that was to me?
13:05eggsbyvals
13:05eggsbyclever
13:07TimMcdwierenga: As S11001001 cryptically noted, do you care about false values?
13:07kaoDhi
13:07dnolentechnomancy: that won't work if false appears
13:07kaoDforgotPassI'm having a hard time making lein-ring work (leiningen 1.7.1 on windows)
13:07clojurebotmultimethods is http://clojure.org/multimethods
13:08kaoDforgotPassI add :plugins [[lein-ring "0.7.1"]] and :ring {:handler game.core/handler} to my project.clj
13:08kaoDforgotPassbut "lein ring server" yields "That's not a task"
13:08kaoDforgotPasswhat's going on?
13:08dwierengaTimMc: i don't think so, just that it has something defined
13:08kaoDforgotPassI did lein deps before, ofcourse
13:08eggsbywell, you could (every? #(not (nil? %)) whatever)
13:08eggsbyerr
13:08eggsby(vals whatever)
13:09TimMc&(map (comp (juxt (partial every? identity) (comp not (partial some nil?))) vals) [{:a nil :b false} {:a "hi" :b false}])
13:09lazybot⇒ ([false false] [false true])
13:09TimMc*cough*
13:09xumingmingv_,(println "hello world")
13:09clojurebothello world
13:09TimMcI think I've come down with a touch of pointlessness.
13:10eggsbyI like it TimMc
13:11JorgeBwhat's the latest word on Clojure code coverage tools? Static analysis? Syntax/style checks? All the good stuff that's part of a Continous Integration environment...
13:11JorgeBnot finding a whole lot online
13:11TimMcdwierenga: So you'll definitely want to call nil? somewhere in your answer.
13:12TimMcJorgeB: Looked at radagast? Only thing I know of.
13:12dwierengaTimMc: ok thanks
13:15S11001001JorgeB: java coverage tools work with clojure; there's a library that suggests better ways of writing particular expressions, good for "style" checking
13:16kaoDforgotPassseriously I'm alone with the lein ring issue?
13:16JorgeBS11001001: what are some examples of tools that work with Clojure?
13:18S11001001I don't remember any names
13:21TimMckibit
13:22ohpauleezyes, kibit is good, and only getting better
13:22tmciverkaoDforgotPass: did you install the plugin? 'lein plugin instatll lein-ring "0.7.1"'
13:23tmciverkaoDforgotPass: lein docs say that :plugins are accessed by lein's own process but not accessible for the project.
13:25kaoDforgotPassoh, wow, there's a hidden error when installing lein-ring that I didn't see before
13:25kaoDforgotPassthanks tmciver!
13:25kaoDforgotPassapparently I need admin rights
13:29S11001001JorgeB: additionally, if there are any lisp newbies involved, you can include the simple test for egrep '^ *\)', rejecting on matching lines (a frequent mistake is to put closing parens on separate lines)
13:30JorgeBRadagast hasn't been updated in 2 years :)
13:31dwierengaS11001001: out of curiosity, what's the rationale behind not putting closing parens on separate lines?
13:32AimHereDoesn't add to the readability any I think
13:32AimHereSometimes you maybe want to do it if you're likely to be inserting a bunch of lines somewhere though
13:32kaoDforgotPassdwierenga: because you shouldn't "navigate" code through parents
13:32kaoDforgotPassbut through indentation
13:33eggsbyhmm, I wonder how hard it would be to add multi/exec support to clj-redis
13:33dwierengakaoDforgotPass: gotcha, thanks
13:35technomancyRadagast is more of a proof-of-concept than anything serious.
13:35technomancyJorgeB: take a look at guzheng
13:36JorgeBtechnomancy, checking
13:36JorgeBalso, need to write a Project Name Generator… who thinks these names up?
13:37technomancymine are all from fiction
13:39brainproxydnolen: read the paper you suggested, "Datalog as a Pointcut Lang in AOP"; have you read this paper "Deprecating the Observer Pattern" http://lampwww.epfl.ch/~imaier/pub/DeprecatingObserversTR2010.pdf
13:40cemerickeggsby: I believe https://github.com/tavisrudd/redis-clojure/ supports multi.
13:40technomancycemerick: are you trying out hstore?
13:41brainproxydnolen: the Datalog... paper had a number of terms and concepts that are new to me, so it will take me some time to sort them out, but I couldn't help but thinking there was some crossover w/ the "Deprecating..." paper
13:41cemericktechnomancy: just eyeballing it. Re: jdbc, I saw that patches to support it only just landed in the driver in the past week or two.
13:42dnolenbrainproxy: I've seen that paper but I haven't read it closely.
13:42technomancycemerick: oh cool; so we should be seeing it working with j.u.Maps then?
13:43cemerickapparently, yeah. Let me see if I can find the link again.
13:43cemericktechnomancy: http://postgresql.1045698.n5.nabble.com/Patch-Add-support-for-hstore-extension-and-map-it-to-from-java-util-Map-td5699633.html
13:43cemerickNo idea what their release cycle is like though...
13:44technomancycool; thanks for the heads-up
13:44brainproxydnolen: okay.. my gut instinct tells me they are both addressing similar concerns, just from rather different angles,
13:44brainproxybut I may change my view as I learn more about the concepts in the datalog paper
13:44technomancycemerick: once that lands do you think it would be appropriate for c.j.jdbc to (into {} those-maps)?
13:45cemericktechnomancy: No idea. I haven't seriously used jdbc in ~5 years.
13:45technomancythis is my first use of it ever =)
13:49lekuhi
13:51technomancyleku: hi; did you get your heroku problem figured out?
13:51lekuI did after I did gem install heroku
13:52cemericktechnomancy: all sorts of rube goldberg concoctions seem plausible using postgres; e.g. port enlive to cljs, load into the db to run in plv8 in order to construct absurd indexes on xml columns, etc.
13:52lekui'm not sure why, i thought I had a pretty recent version of the toolbelt
13:52technomancyleku: what platform
13:52technomancy?
13:52cemerickquite the kitchen sink these days.
13:52lekuubuntu 12.04
13:53JorgeBguzheng seems to be expecting leiningen.core/*interactive?* to exist, but it doesn't
13:53antares_cemerick: with PG 9.2 (betas), mongodb is pretty much a feature :)
13:53antares_with the JSON store and indexes over JSON fields
13:53antares_all it takes is a few functions
13:53technomancyleku: I'm also the maintainer of the toolbelt packaging, so I'm happy to debug further, or if you have the gem working that's cool too.
13:53lekuah ok
13:53technomancycemerick: it's pretty wild
13:54cemerickantares_: XML is more interesting to me for various reasons, but yeah
13:54antares_cemerick: XML has been in PG for years
13:54cemerickso I now discover :-)
13:55technomancyJorgeB: there should be another version that's compatible with lein2
13:55cemerickIf only pg weren't so bearish to configure, etc.
13:55lekuI am surprised to hear so much talk about PG
13:55technomancyPG's out-of-the-box permissions story is definitely its weakest link.
13:55JorgeBtechnomancy, yeah, searching.
13:55lekumostly just hear about mysql ..
13:55nDuff*shudder*
13:56nDuffleku: I'd argue that folks in #clojure are more likely than average to care about correctness and elegance, areas in which MySQL doesn't have a track record.
13:57technomancycemerick: I'm told the Right Way during development is to run postgres as your own user, but the $PATH setup isn't always amenable to this
13:57technomancyit's nearly zero-config if you run it as yourself
13:57lekunDuff: I figured there was a good reason, I just didn't even know it was still in use/around anymore.
13:57nDuffleku: Very much so.
13:57technomancynDuff: mysql: because BDB doesn't accept network connections, I guess?
13:58JorgeBtechnomancy, lein-guzheng 0.2.4 is the latest I am finding, and still throws the error
13:59eggsbycemerick: supports multi/exec but not pubsub :(
14:00cemerickeggsby: heh, oh well :-|
14:00technomancyeggsby: redis clients: gotta catch 'em all
14:00eggsbyyup
14:00eggsbywell, aleph supports redis pubsub w/ lamina
14:00technomancyactually maybe voltron would have been a better reference there
14:01lekuoh nice
14:01eggsbymaybe I can use that then redis-clojure
14:01lekulinkedin.com owned
14:01eggsbyya leku
14:01eggsbyunsalted :|
14:01lekuah
14:02cemericktechnomancy: oh, heroku dev plan postgres accepts outside connections! There's my zero-config. :-D
14:03technomancycemerick: yeah, that's what finally got me looking at hstore too =)
14:04technomancyour db team is top-notch
14:04eggsbyanyone use cascalog? looks so neat
14:04cemerickso, the tiers are all priced based on cache size…surely that doesn't mean there aren't any size limitations?
14:05technomancycemerick: the size limitations haven't been implemented yet, but they'll be in place before it leaves beta
14:05banseljajtechnomancy: new preview release for lein? YAY!
14:06technomancynew-ish
14:06borkdudenew?
14:06clojurebotnew Class(x) is (Class. x)
14:07technomancypreview6
14:09dnolenbrainproxy: my suspicion is Datalog allows you to compose at a much higher level than Scala. There still seems to be a lot of wiring go on, but I need to read more closely.
14:10cemericktechnomancy: Even the non-beta plans (e.g. Ronin, Fugu, etc) have no size limitations specified…?
14:11technomancycemerick: oh yeah; that's odd. not sure what's going on there.
14:11mebaran151hey all, I'm having a little trouble with compiling some Clojurescript: it seems to throw an EOF error strangely but doesn't tell me the file
14:12brainproxydnolen: possibly.. do you have any suggestions for background material on datalog and aop? bonus points if the info/examples can be experimented with in terms of clojure stuff
14:13dnolenbrainproxy: The literature on both is very extensive.
14:14brainproxydnolen: i'm sure it is, wasn't sure if you knew of anything that might be suitable for someone new to those things who has clojure and js knowledge, but not a lot else
14:14dnolenbrainproxy: hmm not really. Look at some early Datalog papers, read some Prolog books, look Art of the MetaObject Protocol - read up on AspectJ
14:15brainproxyokay, some relating clojure to datalog is turning up w/ google
14:15brainproxysome *stuff
14:15dnolenbrainproxy: probably Clojure contrib datalog, not a good starting point.
14:15brainproxyhrm, okay
14:16ohpauleezbrainproxy: I'm going to second The art of the metaobject protocol
14:19muhooheroku lein deps appears to be hanging at Downloading: org/clojure/tools.logging/0.2.3/tools.logging-0.2.3.jar from repository central at http://repo1.maven.org/maven2
14:19clojurebotlein2 is Leiningen 2
14:20technomancymuhoo: consistently?
14:21eggsbydo you guys think the art of the metaobject protocol would be a good read even if you didn't know much common lisp?
14:21eggsbyI've been wanting to read it ever since I heard alan kay talk about it
14:21muhootechnomancy: on this one app, yes, repeated two times so far
14:22dnoleneggsby: it is very good even if you're not interested in CLOS
14:22muhootechnomancy: hmm, and then it cleared out. transient?
14:22technomancymuhoo: network hiccup I guess?
14:22muhooor maybe that was just the last dep in the list, my best guess.
14:33lekucool, netflix is using FreeBSD 9 for their CDN
14:35borkdudeRaynes is it possible to let lazybot temporarily join another channel?
14:37muhoook i give up. Caused by: java.lang.NoSuchMethodError: org.codehaus.plexus.DefaultPlexusContainer.initialize()V
14:38technomancymuhoo: sounds like you're mixing lein1 and lein2?
14:38technomancyyou can use lein2 on heroku by setting BUILDPACK_URL; lemme find the link
14:38muhoowait, no i'd rather stay with 1.7.1. and keep clean for now
14:38technomancyok
14:38muhoohow can i get rid of the lein2 stuff?
14:39muhooor rather, how could i have gotten them "mixed"?
14:39technomancymaybe you added a plugin or something?
14:40lekui think i have had the same problems
14:40lekumixing lein and lein2
14:40muhooi deleted ~/.lein/plugins
14:40lekuI can run some code in the clojure repl directly, but not through emacs and swank
14:41muhoostill same problem tho, with no plugins
14:42muhooleku: i also had this problem some time ago, but i have totally forgotten how it got resolved. i think it got fixed by accident.
14:42lekuheh of course
14:42lynaghkdnolen: are you doing cljs compiler development on Clojure 1.5.0-alpha1 at all, or are you still on 1.4?
14:43technomancymuhoo: can you paste project.clj?
14:43lekuI have done so many things to this system I feel like I'm better off just starting over again
14:43lekumaybe switching to debian from ubuntu this time
14:43technomancyleku: as of lein2 it's pretty hard to screw things up so that they affect more than just the current package
14:43dnolenlynaghk: 1.4, why do you ask?
14:43muhootechnomancy: https://www.refheap.com/paste/3032
14:43technomancythough don't let me stop you from upgrading to Debian =)
14:43lekuwhy not EOL lein then?
14:44technomancymuhoo: oh yeah, pomegranate will never work with lein1
14:44technomancywell unless it's a regular dependency
14:44clojurebotExcuse me?
14:44muhooreally? i've been ussing it in lein1 for months. but not as a dev-dependency! that must be it. thanks
14:44technomancynp
14:44lynaghkdnolen: just tried running 1.5.0-alpha1, ran into some issues =) There are a ton of reflection warnings during compile ("call to create can't be resolved"). Cljsbuild runs fine, but the resulting cljs doesn't work: "cannot read property PersistentHashMap of undefined"
14:44technomancy(that's part of why dev-dependencies are no longer part of lein)
14:45dnolenlynaghk: no idea
14:45mebaran151I'm getting a weird error running cljsbuild and clojurescript on my machine: after complaining of a general EOF, my cmd prompt: 'args]' not founded. The Clojurescript Repl does print that it is starting at port 9000 though before the whole thing crashes.
14:45lynaghkdnolen: looks like it's emitting "clojure.lang" instead of "cljs.core"
14:46dnolenlynaghk: are you using 1.5 for reducers?
14:46technomancyanyone have opinions on clj-oauth2 vs clauth?
14:47lynaghkdnolen: yeah, that was the main motivation. Reducers on the serverside---there just happens to be cljs on this project too
14:47dnolenlynaghk: yeah no idea, ask on the dev ML
14:47lynaghkokay, I'll look into it a bit more and see if I can't figure it out. Just thought I'd run it by you first. Thanks
14:48dnolenlynaghk: haven't messed around w/ 1.5 & CLJS at all.
14:56technomancycemerick: has someone plumbed through oauth+friend yet?
14:57cemericktechnomancy: A couple of people have gone far enough to get things working locally, but no one's packaged stuff up into a workflow library yet.
14:57cemerickThere's about 8 different Clojure oauth options AFAICT.
14:57technomancy=(
14:58technomancyI like the "dad mode" readme of friend.
14:58cemerickI'm going to need it myself in the not-too-distant-future, so that'll force the issue if no one's put something out by then.
14:58technomancyI'm afraid I may end up going into full throttle dad mode once I start focusing on jar signing soon.
14:59cemericktechnomancy: That's the second time someone said it was "dad mode". I must be missing a pop culture reference.
14:59technomancycemerick: oh I was just referencing KirinDave's comment =)
14:59cemerickoh, ok, so he's just a trendsetter :-P
15:01technomancydang, if you're going to be plumbing this through maybe I should just wait =)
15:01cemericktechnomancy: no, by all means, don't let me get in your way! :-P
15:01technomancywell the difference is you actually know what you're doing
15:01cemerickshit
15:02technomancyor at least you've been able to give off that impression
15:02cemerickdespite all the disclaimers, I guess
15:03cemerickI can't wait until there's an exploit on some popular site with a Clojure front-end, and it's traced back to a friend vulnerability.
15:03technomancya high documentation length to project age ratio is a good sign that some thought went into it =)
15:03technomancywell I guess not so much as a general ratio but for new projects specifically
15:03cemericknah, that's just a sign that tenacity and verbosity and trick anyone into assuming thoughtfulness ;-)
15:04cemericks/and trick/can trick
15:08muhoocemerick: bugs?
15:09cemerickmuhoo: I should have put a ;-) on that. No new bugs today.
15:10muhooi'm being super anal-retentive about dealing with friend, openid, noir session, etc, just exactly because i do NOT want any of my sites to get haxx00red
15:11muhooi'm generally concerned with immutability and how that creates new exploits, but that's more general than i'm dealing with atm
15:12muhooi.e. guess what, that password or hash or nonce you thought was dissoc'ed is sitting around in memory for months
15:12cemerickOutside of having someone with expertise and experience in these areas doing a review/audit, only ongoing usage and lots of eyes will build up that confidence.
15:12gtrakif an attacker has physical access, you're kinda screwed anyway right?
15:13gtrakie enough access to get a memory dump
15:13cemerickgtrak: depends; e.g. what if the values in question were in the session, which was persisted to redis/mongo/couch/etc.
15:15gtrakmeh, the memory dump situation is kinda dumb, I think in java you're supposed to eschew String for char[] for passwords for the same reasons, how many actually do that?
15:15cemerickThat's why e.g. the bcrypt-credential-fn will dissoc the :password from the credentials loaded from your data store, etc.
15:17timvisherlein2 is failing to retrieve dependencies due to ISA proxy authentication failure
15:17timvisherwhat do i do about that?
15:19freiksenethow does prerequisites actually work in clojure? I mena implementation-wise
15:19freiksenetdo*
15:19freiksenetI mean ,dynamic binding would probably work for CL , but clojure macros ban bindings of stuff from different ns
15:21dnolenlynaghk: neat, though you could have easily written a fast Singult in CLJS :)
15:22lynaghkdnolen: I tried that first, dude.
15:22dnolenlynaghk: with jsobj, loop/recur and array?
15:22lynaghkended up having to go to JS though, which is why it's called "Singult"
15:22lynaghke.g., "A speech broken by sobs"
15:22lynaghker, I meant "i.e.,"
15:22dnolenlynaghk: I looked over you code and there's nothing that you couldn't do blazing fast w/ jsobj, loop/recur, array & deftype + Object methods
15:23lynaghkdnolen: yeah, I tried doing some stuff like that but then decided that if I was going to just rely on native JS for everything I might as well write it in native JS to lose the cljs dependency.
15:23lynaghkNot that I have any plans to use it from neat JS, but it'd be cool if people end up doing that.
15:24dnolenlynaghk: yes, if goal was to make it not tied to CLJS - no argument there.
15:27lynaghkDo you have any feeling on JS devs tend to do so much with lil' templating mini languages rather than a data-structure representation like Hiccup?
15:28lynaghkWhen I first came across Hiccup I was so amazed at what a great, simple idea it was. Also confused as to why I hadn't seen anything like it in JavaScript world.
15:28muhoolynaghk: crate
15:28freiksenetIMO templaing is superior
15:29freiksenetas templates are done by markup people or designers
15:29freiksenetand they are for, well, templating
15:29freiksenetDSLs for html always leak logic inside of templates
15:29dnolenlynaghk: no, not sure why it hasn't taken off, probably because representing data structures in JS stinks.
15:30dnolenlynaghk: and data transformation is weak
15:30lynaghkdnolen: I had a very hard time learning to use commas again.
15:30dnolenlynaghk: yeah it's a real downer :)
15:30lynaghkfreiksenet: yeah, I've thought about that issue. Maybe it's just the work that I do (data visualization), but there always seems to be very legit cases to put logic in the markup.
15:31lynaghkfreiksenet: I think doing logic-free templates and view models and that kind of thing is similar to overeager boxing of data into types in OO world.
15:31freiksenetmaybe. I would say that's not a good style for web applications and definetely a bad style for web sites
15:31gtrakfreiksenet: if you're in control of all your code then it's way better not to have the separation
15:32freiksenetgtrak: why?
15:32gtrakIt's just annoying to repeat things
15:32gtrakDRY
15:32freiksenetgtrak: how is MVC not DRY?
15:33lynaghkfreiksenet, gtrak: yeah, that's the real issue. If the markup is something that makes sense outside of the application or not. Thus far it's been a ton easier for us to just do a lot of inline markup creation in CLJS (directly from the data), but I know that it's herasy in some circles.
15:33freiksenetlynaghk: in some way it is so. like with OO you can take best out of MVC model for website
15:33freiksenetI think separating templates from application logic is a good part, as it abstracts out data presentation from application logic
15:34freiksenetlynaghk: in your case application logic _is_ data presenation, so it's different
15:34mebaran151hey technomancy, I'm getting another weird trampoline related issue with cljsbuild: I get these strange file less EOF's and a final error that "args]" is not recognized as a command
15:34gtrakyou can do the logical separation, but wouldn't you prefer to have the full power of lisp (clojure) at each layer of abstraction?
15:34lynaghkfreiksenet: yes and no. in general, all applications are just mappings from some abstract data to visual markup.
15:35mebaran151tracking it down, it looks like it's due to another weird quoting thing from form-string (as the trampoline files have eccentric quoting)
15:36gtrakI started trying to write some web stuff with StringTemplate and I had to stop before I punched myself in the face, surely there's better templating engines but I don't see an advantage if I'm the guy writing it all
15:36freiksenetit all gets messy once your application gets big enough
15:36freiksenetIMO
15:36freiksenetesp when there is a deadline from one side and sloppy coders on the other :)
15:37gtrakyea, I haven't ever done something at that scale :-). the language separation is like an artifical discipline
15:37freiksenetit's just like a more enforced kind of a coding style
15:37muhoogtrak: stencil (mustache) is nice
15:37freiksenetgtrak: aslo StringTemplate is not the best template language )
15:38freiksenetalso*
15:38gtrakhehe
15:38lynaghkfreiksenet: I agree with you there. I'd be interested in mashing up Singult with Enlive somehow. Specifying using explicit selectors instead of the entire DOM structure.
15:38muhooif what i'm doing is > 70% html/js, i do it with a template. if less, then i do it with hiccup
15:38gtrakI've also used django's stuff, it seemed cool at the time, but I don't think it will now
15:38freiksenetI like Jinja2
15:38freiksenetit's like django templates but better
15:39RaynesHahaha.
15:39gtraklynaghk: next time I'm up near those parts we'll go rock-climbing
15:39RaynesWhy can't nerds just be nerds anymore?
15:39RaynesWhy do we have to add rocks and heights to things that are already perfectly acceptable? :(
15:39gtrakI wasn't yet into it at clojure/west
15:39gtrakRaynes: try it! it's life-changing
15:39Hodapp....because the only "just nerds" are the ones that TV and movies like to make fun of?
15:39RaynesI'm too fat. I'd die.
15:39Hodappthat don't really exist much in reality
15:39lynaghkgtrak: for sure. Keming will sponsor a trip at StrangeLoop if you're going to be there (and we can find a gym that is easy to get to)
15:39gtrakheck yea, I'm for it
15:40muhoonerds have been rockclimbing since the darpanet days anyway
15:40AimHerenerds were doing the whole rock thing almost before there were nerds
15:40AimHereWhat do you think gave Crowther and Woods the inspiration for ADVENT?
15:40gtrakbeen going 3 times/week for 2 months now
15:40gtrakrock-climbing is like the macros of exercise
15:41Hodappbah?
15:41nDuff...dangerous?
15:41nDuffEasy to abuse?
15:41freiksenetgtrak: when I worked with CL the most popular templating library (and thje one the project used), was cl-who, which is like hiccup
15:41RaynesAt least one of my coworkers wants me to rock climb.
15:41freiksenetgtrak: it leaked abstraction all over, even though the project wasn't _that_ git
15:41RaynesAt least one of my coworkers is nuts.
15:41freiksenets/git/big
15:42gtrakI feel like I'm always at my limit... no boilerplate :-)
15:42amalloydude. i would totally rockclimb, with or without you
15:43Sgeo"Clojure functions are java methods but java methods are not clojure functions"
15:43SgeoIs there a reason that Java methods aren't made to be Clojure functions automatically?
15:43Raynesamalloy: We can rock climb together. I'd do it for you.
15:44ibdknoxwhy doesn't macroexpand/macroexpand-1 expand inner macros? e.g. (let [..] (let [..] ...))
15:44gtrakSgeo: clojure functions are each actually classes, java methods are just bytecode
15:44muhooit's all just 1's and 0's ;-)
15:45gtrakwell, it's important to know a clojure function is an instance of a class implementing IFn
15:45amalloyibdknox: at some level there has to be a function that doesn't expand the inner ones, and something responsible for walking the tree and calling that function. so that's macroexpand and the compiler, respectively
15:46amalloyit would be nice to have a blessed implementation of macroexpand-walk or something, but i believe mexpand-all from clojure.tools.macro does what you want
15:46gtrakfreiksenet: yea, I think if you're using lisp in the first place you're saying something about your level of trust in coworkers/discipline
15:47ibdknoxamalloy: ah, thank you
15:47amalloyibdknox: be careful though; it's not 100% faithful to the compiler. for example, i don't think it passes you a correct &env
15:49muhoocemerick: was this ok, or does it still need more work? https://github.com/cemerick/friend/pull/11
15:50cemerickmuhoo: haven't looked closely yet
15:50Sgeogtrak, is it not possible to, when Clojure sees a Java method being used in a context where a clojure function is expected, implictly make a clojure function or something like that?
15:51amalloySgeo: sorta
15:51gtrakSgeo: it's very easy to do
15:51gtrak,(#(.toString "hello"))
15:51amalloywhat function does ".foo" represent? (fn [x] (.foo x))? or (fn [x y] (.foo x y))? or...
15:51clojurebot"hello"
15:52gtrakso 3-5 extra characters after having to specify the function name in the first place
15:52amalloyhiredman: do you have a patch for the compiler that does this automatic method->function conversion, or was that just an idea?
15:54timvisheranyone have experience testing compojure generated routes as functions?
15:54SgeoUh, don't netsplit quit messages usually have server names?
15:54hiredmanamalloy: not sure to what you are refering, but most likely it is an idea
15:54SgeoOr is something else going on
15:55gtrakmaybe we're on the good half of the netsplit?
15:55meahey does anyone have any experience with quil? I have a quick question about create~graphics
15:55SgeoI'm in a bunch of other channels, this one is the only one where I see evidence of a netsplit
15:56Sgeon/m saw some in other channels
15:56amalloyhiredman: at some point we talked for a few minutes about how you could automatically turn Foo/bar into a function, if it's used in a context where it can't be anything else. i couldn't remember if you'd actually done it
15:56hiredmandefinitely not
15:57hiredmandefinitely doable
15:59muhooSgeo: but the netsplit has structural sharing, so it's OK
16:00amalloymuhoo: it already is, bro. i dare you to go back and change what you just said
16:04timvisherwhy wouldn't the functions generated by defroutes show up in the ns-publics for that namespace?
16:05timvisherAlso, is there a slime equivalent to find-doc?
16:08S11001001what is find-doc
16:09amalloy,(clojure.repl/find-doc "concatenate")
16:09clojurebotnil
16:09S11001001,(doc clojure.repo/find-doc)
16:09clojurebotNo entiendo
16:09S11001001ok
16:09amalloywell, that was anticlimactic. anyway, it's supposed to search docstrings for you, or maybe just function names
16:09timvisherwhole she-bang
16:10S11001001*l*
16:10S11001001press C-c C-d C-h to browse the doccy commands
16:11timvisherlooks like apropos is what i was looking for
16:12timvisherso it looks like there's no way to get at the function generated by the defroutes macro, is that right?
16:12amalloytimvisher: (routes ...)?
16:13timvisheramalloy: you're help, though much appreciated, is inscrutable. :)
16:13amalloywell your question is kinda confusing. i mean, defroutes defines a var, and if you want to get at the function, just use that var. or call routes instead of defroutes, and it returns the function it would have def'd
16:14amalloyif you want something other than one of those, the question needs clarification
16:15timvisherah hah
16:15timvisherthat makes much more sense
16:15timvishersorry, I started out with compojure and never really took the time to fully understand it or ring, so it's still very magical to me
16:33tufflaxTake a look at this please: http://codepaste.net/szamcm
16:33aperiodicmea: a little bit. what's up?
16:34meawhen I call (color 255 255 255) i get a null pointer exception
16:34meaand for some reason, (create-graphics 300 300 P2D) throws an exception that it cannot resolve symbol P2D
16:37raektufflax: I don't think there is any better way to do it.
16:37aperiodicmea: so, for the first thing, i'd have to see the code, but almost everything in quil.core uses the underlying PApplet, so it must be called from draw/setup, or you'll need to provide an applet some other way
16:38raeknote that you don't have to use memfn to convert a method to a function. fn is fine too
16:38raekI think memfn predates the #(...) syntax
16:38aperiodicmea: the problem with your create-graphics call is that you shold pass the renderer as a keyword, not a symbol, since create-graphics is a function, hence its arguments are evaluated
16:39meaaperiodic: when I tried that, I got this error: Exception in thread "main" java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.lang.String, compiling:(core.clj:30)
16:39raek(minor nitpicking: (cycle [x]) can be replaced by (repeat x))
16:41aperiodicmea: oh, then pass a string
16:41raek(vec (for [name names] `#(~name %)))
16:41aperiodicmea: it appears to just pass that argument to the .createGraphics method of the current applet; it should probably call name on it first
16:42meaaperiodic: what do you mean by call name?
16:44TimMc&(doc name)
16:44lazybot⇒ "([x]); Returns the name String of a string, symbol or keyword."
16:45aperiodicmea: it would just allow one to pass :P2D, "P2D" or (if you wanted) 'P2D as the renderer arg, rather than requiring a string, which is inconsistent with how the renderer is specified in the defsketch macro
16:48meaaperiodic: well now, I put in the setup function with :P2D but Im getting this error now: Exception in thread "Animation Thread" java.lang.RuntimeException: You need to use "Import Library" to add P2D to your sketch.
16:49meaaperiodic: here is the code http://pastebin.com/17SUiBPb
16:53aperiodicmea: according to the current processing javadocs, P2D is not a supported renderer with createGraphics. it also says the default JAVA2D renderer gives "mixed results", and they recommend using P3D
16:55aperiodicmea: also, you can consolidate those import statements a bit like so: [codeanticode.gsvideo GSLibraryLoader GSLibraryPath GSMovie ...]
16:55meaeven using "P3D" as the arg I still get that awful import library error
16:56muhooamalloy: ah good point, raynes.me and n01se.net both logging, plus of course the all-seeing, all-remembering eye of google
16:58TimMcNot exactly immutable, more like append-only.
16:58TimMcOr is it a lazy seq with blocking realization?
16:59muhooif logs are streams, i guess.
16:59aperiodiclooks like it wants the string "processing.core.PGraphics3D"
17:00aperiodicmea: that's the value of the P3D constant field, which is what one passes to createGraphics in processing (see http://processing.googlecode.com/svn/trunk/processing/build/javadoc/core/constant-values.html for a full list)
17:01aperiodicone should not have to dig into the processing javadocs to answer these questions, though. i'll open up an issue on quil.
17:01brainproxytechnomancy: w/ lein2 prev 6, I'm getting `target/` dirs sprinkled around, similar to the `stale/` dirs issue affecting preview 4
17:01meaaperiodic: that worked! thank you so much
17:02aperiodicmea: you're welcome!
17:05technomancybrainproxy: odd; is it consistent?
17:08brainproxytechnomancy: yes, basically same behavior as the stale dirs, just target dirs instead
17:08brainproxyi can file an issue, or reopen the stale dirs issue if you think that would be more appropriate
17:09technomancybrainproxy: crap; I'm seeing it here too now. feel free to reopen.
17:09brainproxywill do
17:09technomancythanks
17:11brainproxytechnomancy: i don't have permission to reopen, but I left a commment https://github.com/technomancy/leiningen/issues/589
17:11technomancyoh, that's annoying
17:12technomancyI wonder if there's a way to make that permission public
17:12technomancyreopened
17:12technomancyand now the issues don't fit on one page anymore =(
17:15brainproxygithub needs to support a `clone maintainer` feature
17:16raekI get a target/ directory in $PWD too after running any lein2-preview6 command outside a project
17:16technomancycould have sworn I had that one squashed =\
17:17technomancyif anyone wants to earn a leiningen sticker, the fix is in the native dependency calculation code =)
17:17tufflaxraek thansk
17:19raektufflax: additionally, if you convert some bytes into a string you should specify the encoding somehow (don't know how to do it with this "Bytes" class)
17:21tufflaxraek it's part of hadoop, they save everything as bytes, and using the Bytes class is idiomatic :p
17:22raeklike storing temperatures as numbers without specifying whether they are in celcius or farenheit...
17:23tufflaxI don't know exactly what is happening under the hood yet, just starting out with hadoop
17:23raekfrom the javadoc "Presumed UTF-8 encoded byte array"
17:23raekthen everything is fine :)
17:23tufflax:)
17:24raekI suspected it behaved as (.getBytes some-string) from the Java API, which uses the "default" encoding
17:25raekwhen thinking about repeatability, you should assume "default encoding" means "encoding chosen at random"
17:25raek</rant>
17:25technomancyis there a reason the ring-jetty-adapter library doesn't have a -main function?
17:26mfextechnomancy, because it needs to be passed a handler?
17:27technomancymfex: it could take it as an argument; require/resolve it if it's a string
17:28technomancyor you could do (def -main (partial jetty/-main #'app)) in your code and not have to repeat the "take the port either as an argument or from the environment" over and over =)
17:30mfexperhaps we can use an xml file to configure the handler outside of the code /jk
17:31technomancyhehe
17:31technomancybetter support SGML just in case
17:35raeklet's make Ring for Gopher
18:00solussdwhen I add a zipper as a child node in a zipper, what happens, if anything, to its make-node, branch?, and children functions?
18:02antares_Just in case someone is looking for a fast Clojure Memcached client: https://github.com/clojurewerkz/spyglass
18:04solussdnever mind, I think it gets replaced. :D
18:22technomancyanother oauth lib? =( https://github.com/pelle/oauthentic
18:22technomancyoh, this is a client where clauth is for the server?
18:22technomancyI wish the oauth talk at clojurewest hadn't been right before my talk so I could have paid attention =(
18:29Sgeohttp://blip.tv/clojure/david-nolen-predicate-dispatch-5953889
18:29SgeoIs this something that isn't supported yet?
18:32SgeoUnrelatedly:
18:32Sgeo(defn foo [& {:as args}]
18:32SgeoIs that a conventional way to deal with keyword arguments?
18:33SgeoActually hmm
18:33Sgeohttp://briancarper.net/blog/579/keyword-arguments-ruby-clojure-common-lisp
18:34brehautSgeo: thats quite out of date i think
18:35brehautok no i was talking out my rear end. ignore me
18:35dnolen_Sgeo: nope. We have a fancy pattern matching algo & core.logic - but haven't glued them together.
18:40brainproxySgeo: the special forms that pertain to let bindings can be used in conjunction with defn when setting up the parameters
18:40brainproxysee http://clojure.org/special_forms#Special Forms--(let [bindings* ] exprs*)
19:22weavejesterOut of interest, does anyone know if there's any difference between Noir's defpartial and Hiccup's defhtml?
19:26technomancyweavejester: hey, what do you think about adding a -main to ring.jetty.adapter that could take string arguments for the handler and port?
19:30weavejestertechnomancy: I think that's outside the scope of the namespace, but I have a ring-server library that might fit in.
19:31weavejestertechnomancy: The ring-server library is for additional sugar for starting Ring servers.
19:31technomancyoh yeah, been meaning to take a look at that
19:31weavejestertechnomancy: There's a ring.server.standalone namespace it would fit well into
19:55frozenlockHow does one make an action every X seconds, while still leaving the program responding?
19:56technomancyIIRC you can use an executor
19:56ibdknoxyep
19:56rlbfrozenlock: Executors/newSingleThreadScheduledExecutor and .scheduleAtFixedRate?
19:57frozenlockOhh that looks nice! Thanks guys :)
19:57rlbs/me/him/
19:57rlbIt has worked great.
20:10mebaran151hey technomancy: I've been working on another trampoline bug, and I think I've stumbled upon yet another cmd'ism that is going to end up really annoying: with a certain perverse list of dependencies, my trampoline batch files produces a command line that is too long for the interpreter
20:11mebaran151nDuff: Windows cmd :(
20:11mebaran151I'm sure bash is made of much stronger stuff :)
20:12JorgeBtechnomancy, do you have any examples of how to use guzheng ?
20:12technomancyuuuuh... that sucks.
20:12nDuffmebaran151: ...well, the relevant limits on bash are mostly OS-imposed, but there are generally mechanisms to avoid them.
20:12technomancyJorgeB: no, sorry
20:12nDuffBut... yar, can't help with Windows.
20:12JorgeBhmm, not having much luck with it
20:12mebaran151technomancy: is there any reason why the trampoline script is stuffed into -e rather than being spit in its own file?
20:13technomancymebaran151: just easier if there's less mess to clean up afterwards
20:14mebaran151technomancy: quoting is also really weird in the generated file, but that seems to be related to the double pr-str
20:14technomancyyeah, I don't really know what's going on there
20:14technomancyhappy to take patches for that
20:15mebaran151yeah I'm gonna try to get cljsbuild repl-listen working ... agin
20:17mebaran151I don't think the extra pr-str is actually necessary
20:17mebaran151is possible to run lein from a checkout in my project?
20:17technomancyyou can with the bash script
20:17technomancyI think the logic is there for the .bat, but it may be out of date
20:17mebaran151ah alright
20:18mebaran151well I'll give it a go
20:18mebaran151I suppose rather than patch bomb I should probably checkout my own copy: should I do work on a branch or can I hack on master and just pull request you or does it even matter?
20:20technomancymaster's fine. either a pull request or git format-patch on the mailing list would be good.
20:21timvisheranyone know if it's possible to get the slime manual in info format?
20:21mebaran151cool thanks
20:21mebaran151hacking nao
22:42mheldwhat do y'all use for oauth?
23:07mheldwhat does ^:dynamic do when defining a variable?
23:08amalloyallows it to be rebound with 'binding
23:08mheldah
23:08mheldgracias
23:09mheldI for some reason thought all vars (in def form) did that by default
23:09brehautthey were, things changed
23:09amalloyyeah, two years ago that was true
23:10mheldcool, good to know
23:12lpvbHey, I'm learning clojure and was wondering how I could get the workflow similiar to haskell, where I edit the source file, load it in the REPL, edit the source some...
23:12lpvbmore and reload the file in REPL
23:14mheldlpvb: I think you can do that with the plain old repl
23:15mheldjust (use thing.core :reload)
23:15lpvbok, I'll try that
23:16mheldmaybe :reload-all
23:18eggsbyreload-all reloads the deps of the namespace as well
23:18nDufflpvb: ...if you want more interactiveness with your editor, look at SLIME for Emacs
23:19nDufflpvb: ...which will give you the ability to load new code into your running session with a few keystrokes
23:20nDuff(well, you can also do that with inferior-lisp mode, but SLIME+swank lets you connect over a socket to an instance that isn't necessarily a subprocess, provides tab completion, some minimalish debugger support, and lots of other shiny)
23:20amalloyslime is great, but i'm not going to recommend it to someone who's just learning the language and is looking for a repl
23:21nDuff...there's also the Eclipse plugin counterclockwise, but in my experience it has a ways to go before catching up with emacs at LISP
23:24lpvbhow do I do (use test) if test.clj is in the same directory as the REPL?
23:25nDufflpvb: I strongly recommend using Leiningen, and letting it set up your source tree, maintain the classpath, and so forth.
23:25lpvbI am in lein repl
23:25lpvbshould I make a project just for a test file?
23:25nDuffAhh, good.
23:26nDuffOtherwise -- you can check the classpath and/or do a .addURL to it to add the current directory
23:27nDuffbut just having a project with a src/ directory everything is set up for is arguably the easier road, especially as soon as what you're testing starts to include external library dependencies.
23:28amalloywow, missing forward-slurp is terrible, nDuff. i dug around to find the source because you *had* to be wrong, how could anyone write a paredit mode without that. but it's just not there
23:29amalloylpvb: yes, just make a project to play around in
23:33lpvbnDuff: I set up a project and it made a src/test/core.clj where I defined some functions, but I'm not sure how to import the functions in REPL =(
23:33nDuff...sure you want to use src/test rather than src/main?
23:34nDuff...oh, waitamoment, I may be thinking Maven layout rather than lein
23:34lpvbthat's how leiningen setup the project automatically
23:34amalloylpvb: (use 'test.core)
23:34nDuff(use 'test.core)
23:36lekuhey technomancy you here?
23:36lpvbOh ok that works, along with :reload. Thanks nDuff & amalloy.