#clojure log - Jun 06 2012

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:00 dnolen: and that's for 2 kvs

0:00 performance degrades linearly for each new kv pair.

0:04 bbloom: dnolen: i'm looking at http://www.50ply.com/cljs-bench/#plot33 and http://www.50ply.com/cljs-bench/#plot40

0:04 dnolen: let me know if i'm reading this right: plot 33 is objmap with 2 keys, adding a 3rd

0:04 dnolen: and plot40 is a persistent map adding one key

0:05 dnolen: bbloom: plots out of date.

0:05 bbloom: run the benchmarks locally

0:06 bbloom: and plot40 is map w/ 32 keys.

0:07 bbloom: I pretty sure ObjMap will be >32X slower, we have to copy object and the array of keys

0:08 Sgeo_: Hmm

0:08 So, does Clojure have something like Haskell's algebraic datatypes?

0:08 I know Scala's case classes resemble that

0:09 amalloy: no

0:10 hashmaps

0:10 bbloom: dnolen: (time (let [m {:x 1 :y 2 :z 3}] (dotimes [i 100000] (assoc m :y 2)))); 2003 msecs

0:11 dnolen: (time (let [m (into cljs.core.PersistentHashMap/EMPTY [[:x 1 :y 2 :z 3]])] (dotimes [i 100000] (assoc m :y 2)))) ; 3477 msecs

0:11 Sgeo_: How much Java will I need to learn to work with Clojure comfortably?

0:11 bbloom: dnolen: i understand promotion for increasing number of keys, but i dont understand update-count

0:17 dnolen: bbloom: without more details about your setup / machine can't say much. 1000000 iters with 32 keys assoc takes ~480ms on my machine.

0:18 bbloom: JS what engine are you testing on?

0:18 technomancy: Sgeo_: you need to learn Java just for using Java libraries, so it totally depends on what you are trying to do

0:18 bbloom: that's repljs, soo rhino?

0:19 dnolen: bbloom: benchmarking with Rhino is not very representative.

0:19 bbloom: you need to benchmark with V8, JSC, and SM under advanced ops for any kind of idea of where CLJS perf is at.

0:19 bbloom: dnolen: :-/ we really need a v8 repl out of the box

0:20 dnolen: bbloom: if you're going to do any real perf work you need to install all three and verify your changes agains them all.

0:20 bbloom: I wasted many hours getting ObjMap to where it currently is on Big Three.

0:20 brainproxy: Sgeo_: there's a macro for creating algebraic datatypes

0:21 but I have no idea how it compares w/ Haskell's a.d.t's, and it's not part of clojure core

0:21 Sgeo_: http://richhickey.github.com/clojure-contrib/types-api.html#clojure.contrib.types/defadt

0:21 lazybot: Nooooo, 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.

0:22 * brainproxy gives lazybot a beer

0:23 dnolen: bbloom: if you check the "Are We Fast Yet" clojure-dev thread I have tips on installing JSC and SM

0:23 bbloom: dnolen: ill install those

0:23 dnolen: bbloom: v8 is pretty easy, don't use node, it's not consistent.

0:25 bbloom: dnolen: while i do that, can you sanity check a custom benchmark for me? https://www.refheap.com/paste/3010

0:25 dnolen: 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

0:28 brainproxy: Sgeo_: also, this chart may be of interest to you w/ respect to your question about "how much java..."

0:28 https://github.com/cemerick/clojure-type-selection-flowchart

0:28 technomancy: what no don't show that to newbies

0:28 it's scary =(

0:28 amalloy: and also not at all relevant to his question

0:28 technomancy: the flow chart for 90% of the time looks like this:

0:29 amalloy: (1) Use maps

0:29 brainproxy: okay, well, maybe I misunderstood, but I'm coming to clojure from no prior java experience (well not none, but almost none)

0:29 technomancy: [I need to define a type in Clojure.] -> [Really?] -> [No.] -> [K, cool.]

0:29 amalloy: ah, yours is better

0:29 brainproxy: and after reading the oreilly book for the past two weeks, I found the chart quite helpful

0:29 technomancy: amalloy: yours has the advantage of being succinct thougho

0:29 brainproxy: to kind of summarize what I've learned w/ respect to clojure and java interop

0:30 technomancy: brainproxy: it's helpful for solving problems that you currently don't have. =)

0:30 amalloy: technomancy: 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

0:30 brainproxy: i have them in spades, for better or for worse

0:30 need to build on a large commercial java sdk

0:30 so it was either learn java or learn java and clojure

0:30 i chose the latter, since I'm crazy

0:31 ;)

0:31 technomancy: amalloy: that's one way of thinking about it

0:31 kovasb: dnolen: is there a listing of all the notation used in core.logic somewhere? . :- etc

0:31 technomancy: what does the "1.2" refer to in this CSS rule? font: 13px/1.2 Arial, sans-serif;

0:31 not familiar with that shorthand

0:32 I have a feeling it involves kerning

0:32 sergey: hey there

0:32 can someone please help with this question? http://stackoverflow.com/questions/10908068/organizing-test-hierarchy-in-clojure-project

0:32 tmciver: technomancy: em?

0:32 brainproxy: technomancy: line height i think

0:33 tmciver: technomancy: http://en.wikipedia.org/wiki/Em_(typography)

0:33 technomancy: hm

0:34 sergey: why can't I require some clj file from test directory in the same project? It throws not found exception

0:34 brainproxy: technomancy: http://www.impressivewebs.com/a-primer-on-the-css-font-shorthand-property/

0:35 technomancy: brainproxy: thanks

0:35 brainproxy: technomancy: np

0:38 sergey: have you checked the classpath, e.g. from w/in the repl

0:38 Sgeo_: Do defrecords have more type-safety than maps?

0:38 I have a bit of a Haskell background

0:38 brainproxy: to see if in fact that directory containing the tests is on the classpath?

0:38 sergey: brainproxy, yeah, I've set it to the project root and root/src

0:38 technomancy: Sgeo_: not much safety round these parts, no

0:38 records are just more efficient

0:39 Sgeo_: Bluh

0:39 technomancy: Sgeo_: the only way types affect correctness in Clojure is via the typed-clojure inference project

0:39 but that's not even close to working

0:40 brainproxy: Sgeo_: 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

0:42 generally though, the language is dynamic and the emphasis isn't on building types but on working with collections

0:43 Sgeo_: Many of the Java libraries that Clojure is supposed to interop with don't use immutability pervasively?

0:43 brainproxy: Sgeo_: right, however, that's not the end of the story

0:44 for example, if you use defrecord to extend interfaces from java world, you can benefit from immutability

0:44 as opposed to deftype, which is "lower level" and doesn't get you the immutability stuff automatically

0:45 though you could still use deftype and manually wire up to to clojure's interfaces which provide for immutability

0:45 i think

0:47 amalloy: huh?

0:47 brainproxy: amalloy: if i've misspoken, please do correct, just trying to express some of what I've been learning

0:47 amalloy: deftype instances are, by default and unless you try pretty hard, immutable

0:47 defrecord just adds built-in implementations of some of the clojure interfaces, especially for "acting like a map"

0:50 bbloom: dnolen: wow, you're right. rhino isn't even close to representative… heh

0:50 dnolen: bbloom: yep

0:50 brainproxy: Sgeo_: 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

0:51 bbloom: dnolen: it's like entertainingly different

0:51 dnolen: bbloom: 100X slower

0:51 bbloom: dnolen: i want clojurescript self hosting if for no other reason than the test run will go 100x faster! :-)

0:52 either that, or i should buy a faster machine...

0:52 dnolen: bbloom: fogus slowed down the tests considerably with his time literal tests

0:53 bbloom: tests are actually pretty quick. compiling eats most of the time.

0:53 kovasb: dnolen: is there a listing of all the notation used in core.logic somewhere? . :- etc

0:54 dnolen: kovasb: hmm not really. . is the main special thing in patterns.

0:54 kovasb: what does it do?

0:55 dnolen: kovasb: for sequence matching (unification really). generally to make the head and tail of a sequence.

0:55 make -> match

0:55 kovasb: i see

0:56 dnolen: (defne g [x] ([[h . t]] ...))

0:56 amalloy: dnolen: whoa, core.logic uses dotted pairs?

0:56 i would have guessed [h & t]

0:56 dnolen: amalloy: it's not destructuring.

0:56 or even pattern matching

0:57 kovasb: i'm getting into bi-directional programming for my composable cljs ui stuff, looking around for inspiration

0:57 amalloy: so what does it mean, if not "h is the head, and t is the rest"?

0:57 brainproxy: kovasb: did you see Foster's book?

0:57 dnolen: amalloy: dotted pairs is not totally off the mark tho. core.logic allows improper tails - a tail could be logic var.

0:57 brainproxy: kovasb: there's also Greenberg's thesis project, lens.js, iirc

0:57 dnolen: tails other than seqs or logic vars are not officially allowed.

0:57 kovasb: brainproxy: have not.. been looking at the papers, but i should check that book out too

0:58 brainproxy: kovasb: http://www.cis.upenn.edu/~mgree/ugrad/lenses/docs/overview-summary-lens.js.html

0:58 dnolen: kovasb: cool!

0:58 kovasb: brainproxy: nice. the only implementations i saw before were in haskell, which i know nothing about

0:58 brainproxy: kovasb: the ebook version of Foster's dissertation is free of charge

0:58 http://www.lulu.com/shop/john-nathan-foster/bidirectional-programming-languages/paperback/product-6481621.html

0:58 amalloy: interesting. 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

0:59 brainproxy: kovasb: look to the bottom right for the $0.00 ebook link

0:59 kovasb: nice

0:59 u are on top of it :)

0:59 brainproxy: that's symmetric lenses only though, Foster's work i mean

0:59 there has since been work on "differential" lenses

1:00 which are more practical for the world of Internet apps

1:00 dnolen: amalloy: no, because a logic var is a hole which can be filled at anytime. it lets you do some interesting things.

1:00 [h . t] could unify with a fresh logic var

1:00 kovasb: right

1:01 i pretty much understand the concepts at this point, its sorta a matter of making it fit with clojure and the specific use case

1:01 dnolen: amalloy: constant time concat is the big idea.

1:01 brainproxy: kovasb: sorry, i meant "edit" lenses

1:01 kovasb: where do you draw the line on functionality etc

1:01 brainproxy: not "differential"

1:01 kovasb: http://dmwit.com/papers/201107EL.pdf

1:01 kovasb: brainproxy:yup, read that guy this weekend :)

1:01 brainproxy: that's Wagner's work ... the math is over my head

1:01 oh cool

1:02 lynaghk`: kovasb: I can't remember---did we talk about knockout.js?

1:02 kovasb: brainproxy: the algebraic notation drives me nuts tho

1:02 lynaghk`: yes, i think so

1:02 brainproxy: Greenberg, the lens.js guy, was also on the Flapjax team

1:03 kovasb: i think there is a unification to be made there

1:03 brainproxy: the Flapjax stuff is really really interesting ... look forward to attempting a re-impl w/ clojurescript and monads

1:03 kovasb: agreed 100%

1:03 kovasb: between the event streams, and the edit streams

1:03 brainproxy: yep

1:03 kovasb: once i refactored my notation it became obvious..

1:04 brainproxy: the hardest part of understanding flapjax is coming to understand how its internal scheduler actually relates to the arrays of listeners attached to estream instances

1:04 and their respective rank properties

1:04 kovasb: what do you mean by "rank"?

1:04 brainproxy: there is a topological ordering that keeps the propagation DAG well formed

1:05 there are some mistakes in the implementation of flapjax that took me forever to figure out

1:05 kovasb: i see

1:05 brainproxy: since i was starting from nothing and just reading the source until it made sense

1:05 kovasb: how long did that take?

1:05 5min?

1:05 ;)

1:06 brainproxy: for me, like 9 months, when I could spend time on it

1:06 don't laugh :p

1:06 kovasb: lynaghk`: i'm getting more convinced that auto-discvering dependencies is not the way to go..

1:06 brainproxy: but I eventually came up w/ a scheme for fixing the weak reference problem in their code

1:06 kovasb: nice

1:07 glad u figured it out, so i don't have to :)

1:07 lynaghk`: kovasb: performance issues?

1:07 kovasb: lynaghk`: if you provide explicit mapping, you a) don't need tricks and b) can do interesting operations

1:08 lynaghk`: 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)

1:09 kovasb: dependency-graph ranking and calculation is a "trick" in my book =P

1:09 kovasb: lynaghk`: i think the flapjax stuff is the way to go

1:09 brainproxy: lynaghk`: it's actually quite simple

1:09 the scheduler is a binary heap

1:10 as a chain of evenstreams is worked over, the propagation order is governed by the heap, which sorts on rank

1:10 lynaghk`: 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"

1:11 brainproxy: lynaghk`: yes, but more powerful i think, especially when you extract over estreams to realize "behaviors"

1:11 behaviors encapsulate state

1:11 lynaghk`: 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.

1:12 brainproxy: lynaghk`: i'm definitely going to work on it, even if I end up doing parallel work w/ respect to another implementation

1:12 but my time is limited atm

1:12 lynaghk`: brainproxy: yep, same story here = )

1:12 brainproxy: one of the beautiful things i realized when making my coffee-script based re-impl of flapjax

1:13 was that I could support fully variadic streams

1:13 lynaghk`: brainproxy: you are the zero-repo brainproxy on github?

1:13 brainproxy: lynaghk`: nope

1:13 well maybe, yes, actually, but i never did anything w/ that account

1:13 I'm michaelsbradleyjr

1:14 my attempt at a coffeescript rewrite of flapjax is github.com/projexsys/Jolt

1:14 dnolen: kovasb: it been brought up a number of times to me that something like Rx + a relational programming model could be very interesting.

1:14 brainproxy: it doesn't really work, and I'll be going w/ Eclipse lic rather than gplv3

1:14 when I rewrite again

1:14 dnolen: kovasb: also there's some interesting literature about Aspect Oriented Programming + Datalog

1:15 kovasb: dnolen: yeah, I'm getting excited about that possibility

1:15 dnolen: interesting, will google that too

1:15 brainproxy: but anyway, what I was saying is that I "discovered" monads in the process of making my lib fully variadic

1:15 lynaghk`: brainproxy: you are going to rewrite flapjax in cljs?

1:15 brainproxy: after a conversation w/ Sussman at Strange Loop last year, he told me i was doing monads and gave me a paper on it

1:15 it opened my eyes

1:16 and Hickey's talk on Clojure is what eventually led me here

1:16 lynaghk`: yes

1:16 bbloom: I'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

1:16 which is super cool … except it's totally the wrong default

1:16 lynaghk`: brainproxy: definitely ping me when you release that, I'd love to check it out.

1:16 brainproxy: lynaghk`: sure

1:17 i'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

1:17 but I'm learning :)

1:17 lynaghk`: 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)

1:17 kovasb: nice. well its all about picking the right problems, makes u learn cool shit

1:18 dnolen: bbloom: 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.

1:18 brainproxy: kovasb: taking apart flapjax and putting it back together was a transformative experience for me

1:18 kovasb: lynaghk`: i started a wiki, but then found my opinions kept evolving :)

1:19 but the summary of what i want to do still stands

1:19 https://github.com/kovasb/interface/wiki/Desired-Solution-Properties

1:19 brainproxy: lynaghk`: do we need a wiki or would a googe group and an irc channel be enough?

1:19 *and/or

1:19 dnolen: lynaghk`: 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.

1:20 kovasb: yeah its a whole new world

1:20 lynaghk`: dnolen: you mean the clojure mailing list? I was thinking something a bit smaller that would be easier to sort through.

1:20 kovasb: after the NYC clojure meet up rhickey told me to write my stuff up and send it to him

1:21 lynaghk`: 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.

1:21 kovasb: seems interested in maybe helping

1:21 a wiki has the benefit of being able to store decision trees of design tradeoffs and contraints

1:21 brainproxy: what do you guys think about the relationship between a nodejs style EventEmitter and a watcher on, say, an atom/

1:22 ?

1:22 dnolen: kovasb: lynaghk`: true, a Confluence page would be equally useful.

1:22 brainproxy: the two patterns seem very similiar to me

1:22 dnolen: it's been brought up that we might need a new ref type or abstraction - perhaps that can be explored.

1:22 lynaghk`: brainproxy: I'm a bit rusty on the node, but an EventEmitter is basically just a namespaced callback?

1:22 kovasb: dnolen: the issue with serialization still stands

1:22 brainproxy: lynaghk`: yeah, i think so

1:23 kovasb: dnolen: but i think the incremental update, and ref-within-ref problem is gonna get solved

1:23 dnolen: kovasb: separate issue though right?

1:23 brainproxy: emitter.emit('foo', 1, 2, 3)

1:23 any fn registered on emitter for the 'foo' event

1:23 would be called with args 1, 2, 3

1:23 kovasb: dnolen: basically project out pieces of the master ref, and combine that with an edit stream

1:24 brainproxy: when i was reading the oreilly book, i saw the diagram which matches up ref types in a sync/async, coordinated/uncoord grid

1:25 my thought is maybe that the func reactive estream/behavior stuff might fit in the async/coordinated cell

1:25 which the book noted isn't currently filled by a clojure ref type

1:25 not sure if I'm off base w/ that idea though

1:25 lynaghk`: 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)?

1:26 kovasb: lynaghk`: motivating use case is nested ui structures. like, a list of lists, where either list can change in length

1:27 lynaghk`: and when a sublist updates, you just want to update that part of the ui

1:27 lynaghk`: kovasb: and you want a diff?

1:27 kovasb: lynaghk`: no, i just want the thing to update :)

1:27 lynaghk`: ah

1:27 kovasb: lynaghk`: but i don't want to wrap every level that could possible update with a ref

1:28 lynaghk`: 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

1:28 kovasb: lynaghk`: since then you're always converted back and forth between ref-wrapped and pure-value versions

1:28 lynaghk`: kovasb: I am hoping with that approach we can avoid any explicit DOM manipulation in terms of adding or removing elements or attributes

1:28 brainproxy: kovasb: one thought that I had is that in a web setting, addressable resources (uris) could be modeled as behaviors a la flapjax

1:29 kovasb: brainproxy: i'm not sure what a behavior is exactly, but there is definitely interesting stuff to do with the uris

1:29 lynaghk`: dnolen: in response to your eariler comment: a confluence page would be rad.

1:29 brainproxy: when a behavior is updated, any dependent estreams are automatically notified, and there can be downstream "sinks" which then are automatically updated

1:29 so you could have behaviors in the client, and behaviors in the server

1:30 kovasb: lynaghk`: how do you know what needs do be updated? in terms of syncing up

1:30 brainproxy: and between them could be plumbing which will take the events flowing through the estreams and turn them into PATCH requests

1:30 or GET requests which specify in the header that they want a patchable response

1:31 lynaghk`: 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)

1:31 brainproxy: kovasb: a behavior is an extraction over an estream; a behavior always has a value, which can change over time

1:31 kovasb: brainproxy: you mean for keeping models in sync with the server? or for some other purpose?

1:32 i see

1:32 yes, now i remember

1:32 brainproxy: an estream is a series of values over time

1:32 i think it fits w/ hickey's notions of state and identity

1:32 kovasb: yup

1:32 sure does

1:33 lynaghk`: i basically agree that the dom should be write-only

1:33 brainproxy: kovasb: i have some ideas for combining this resources-as-behaviors auto-updating stuff w/ scxml

1:33 kovasb: lynaghk`: and just reflect some declarative description

1:34 lynaghk`: (even if the declarative description isn't stored in totality at any one time)

1:34 brainproxy: and a notification scheme which is orthogonal to otherwise stateless, properly restful architectures

1:35 lynaghk`: 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)

1:35 brainproxy: could 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

1:35 kovasb: brainproxy: i hadn't head of scxml, does it get used for stuff?

1:35 will check it out

1:36 brainproxy: kovasb: yes, and there is an implementation for javascript

1:36 but it's a bit rough

1:36 https://github.com/jbeard4/SCION

1:36 kovasb: lynaghk`: you could do something like (conj! dom-elt [hiccup….])

1:37 brainproxy: the 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

1:37 kovasb: kovasb: and sort of pretend that the dom element is like a write-only ref or something

1:37 whoops, meant : lynaghk` ;)

1:37 lynaghk`: 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.

1:38 kovasb: nah, that's dom/append!, which is direct manipulation

1:38 I'm saying, you should just be totally declarative about everything all the time. No dom/append, or dom/addClass or anything like that.

1:38 kovasb: lynaghk`: except you could perform the exact same operation on a ref

1:39 lynaghk`: the point being, you act as if you are manipulating clojure data the whole time, but internally it maps onto a dom implementation

1:39 clojurebot: "[Clojure ...] feels like a general-purpose language beamed back from the near future."

1:40 lynaghk`: 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

1:40 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.

1:40 kovasb: lynaghk`: yes I agree. you want to give the declarative mapping once and have it all taken care for you

1:40 lynaghk`: kovasb: yep. = )

1:40 kovasb: lynaghk`: but under the hood it still needs to do something

1:40 ibdknox: see WPF

1:41 lynaghk`: 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

1:41 kovasb: XAML is on my list of things to cycle back to.. should check it out sooner rather than later..

1:41 lynaghk`: 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.

1:41 kovasb: ibdknox: what are the best parts?

1:42 ibdknox: walking the dom is almost assuredly faster

1:42 kovasb: it's a truly declarative, and extremely flexible UI framework

1:42 I was able to do some amazing things with it

1:42 without really writing any "code"

1:43 kovasb: ibdknox: has it been ported to the web?

1:43 ibdknox: it has the best databinding implementation I've ever seen

1:43 lynaghk`: ibdknox: I'm pretty much resigned to dnolen and michalmarczyk opening up some kind of V8 performance wormhole with ClojureScript

1:43 kovasb: cool

1:43 ibdknox: kovasb: not really. MSFTers would argue through silverlight

1:44 lynaghk`: ibdknox: so I have no expectations about whether DOM walking or CLJS walking will be faster in six months = )

1:44 ibdknox: haha

1:44 lynaghk`: fair enough :)

1:44 kovasb: ibdknox: what is the best thing to read?

1:45 ibdknox: actually not sure, I learned it because we used it on VS

1:45 I can ask around

1:45 kovasb: hehe

1:45 the docs i found before seemed reasonable, so if u dunno anything i can figure it out

1:46 but man, isn't it a lot more civilized to just declaratively specify these high level contructs and put them together

1:46 lynaghk`: ibdknox: if I dig up $100k will LightTable have visual UI-building + databinding support out of the box?

1:46 ibdknox: haha

1:46 :p

1:47 one thing at a time

1:49 kovasb: man i can't wait to get all this shit figured out

1:50 its gonna be soo good

1:51 bbloom: ibdknox: 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*

1:52 Sgeo: Well, defonce vs def seems easier to remember than defvar vs defparameter

1:52 Although I seem to have remembered defvar vs defparameter just now

1:52 kovasb: its all about the tagged literals..

1:53 bbloom: well-designed xml is not that bad. i mean, compare xaml to html , so much better

1:53 bbloom: kovasb: msdn has a decent introduction

1:53 ibdknox: bbloom: what would it look like?

1:53 lynaghk`: kovasb: seriously. Even the primitive computed-observables stuff has been awesome compared to manually juggling lots 'o callbacks.

1:54 ibdknox: yeah my little databinding stuff in crate has been fun

1:54 kovasb: i seriously don't know how web programmers have survived all these years

1:54 bbloom: ibdknox: it would look like a blend between cappuchino & wpf with s-expressions instead of xml

1:54 ibdknox: basically, you build a static UI description out of a map of maps of maps

1:54 ibdknox: bbloom: if you ever end up with an example, I'd love to see it

1:54 kovasb: bbloom: this is what we want

1:55 bbloom: then you walk it and render it. the render function treats the DOM as a memo table

1:55 kovasb: yeah, i want it too, hence i was experimenting with it :-)

1:55 kovasb: i got side tracked working on the compiler tho. it's fun! :-)

1:55 lynaghk`: bbloom: memo table?

1:55 kovasb: haha

1:55 bbloom: the problem is, how to deal with interactivity

1:56 doing the mapping once is easy

1:56 Sgeo: From 4clojure

1:56 (.toUpperCase "hello world")

1:56 * Sgeo ighs

1:56 bbloom: kovasb: 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

1:56 Sgeo: There's no more "Clojury" way to do that?

1:56 dnolen: this stuff really goes back all the way Sketchpad, I'm starting look around, and there's a ton of literature on this stuff.

1:57 http://www.cs.cmu.edu/afs/cs/project/garnet/www/papers.html

1:57 "Separating Application Code from Toolkits: Eliminating the Spaghetti of Call-Backs" 1991

1:57 bbloom: dnolen: yup. i think that things get much easier if you have a good reactive layer to work with

1:57 which clojure doesn't yet & wpf came before rx in the .net world

1:57 amalloy: Sgeo: clojure doesn't encourage you to pretend it's not a hosted language. that said, i think clojure.string has an upper-case function

1:58 kovasb: this place is like a fountain of knowledge

1:58 Sgeo: I want to pretend it's not a hosted language

1:58 :/

1:58 amalloy: $findfn "f" "F"

1:58 lazybot: [clojure.string/upper-case clojure.string/capitalize]

1:58 dnolen: bbloom: I still think the Rx stuff is too low level, which is why everyone keeps talking about add a relational layer.

1:59 bbloom: maybe...

1:59 dnolen: bbloom: and these old papers talk about constraints.

1:59 bbloom: dnolen: do they mean layout constraints?

1:59 dnolen: bbloom: no

1:59 bbloom: dnolen: what kind then?

1:59 dnolen: bbloom: whole UIs

1:59 bbloom: ah

1:59 dnolen: bbloom: it's also why I brough up AOP

1:59 bbloom: gotcha

2:00 dnolen: bbloom: Rx doesn't handle cross cutting concerns, which occur often in UIs

2:00 bbloom: yeah, absolutely

2:00 and games too!

2:00 kovasb: i love these old papers, they remind me how much better ui design is these days

2:00 dnolen: even so none of this stuff took off.

2:01 bbloom: dnolen: 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

2:01 dnolen: yes, 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.

2:02 bbloom: also, the other problem with data binding is that, sometimes, you simply don't want 1-to-1 mappings

2:02 in fact, often

2:02 sometimes you want a save button & what not, so you need to create a backing model

2:02 kovasb: back in the day, UI platforms were too fragmented

2:02 bbloom: and it gets messy fast

2:02 kovasb: now, if you get it right and do it for the web, it can blow up overnight

2:02 bbloom: kovasb: yeah, and i think cljs is a unique opportunity to do that

2:03 kovasb: b/c you simply can't do it right without a compiler of some sort. js just isn't expressive enough

2:03 lynaghk`: bbloom: that sounds like inherent complexity in the specification though, no? Regardless of how you're managing the state and UI

2:03 bbloom: lynaghk`: exactly, but sometimes the big bag of callbacks is actually an easier way to specify

2:03 lynaghk`: bbloom: better to have an explicit view model expressing that requirement than just chaining the callbacks or what not

2:03 kovasb: bbloom: i think u can have a 1-to-1 mapping for a while, and then start reifying

2:03 michaelr525: EmberJs is built very much around data binding

2:03 A javascript framework

2:04 bbloom: michaelr525: i'm not saying it can't be done. I'm saying it's ugly

2:04 michaelr525: but more than that, error prone

2:05 brainproxy: dnolen: can give you give an example of "cross cutting" concerns wrt Rx

2:05 just so I can noodle on it :)

2:05 dnolen: programming around events often seemes like manually written constraints to me.

2:05 michaelr525: bbloom: so you like it more the way XAML does it? specify data binding on the markup?

2:05 bbloom: michaelr525: xaml is closer. i just can't get over the XML assault on my eyes

2:06 michaelr525: also, xaml has it's own little mini DSLs for binding descriptors and stuff

2:06 michaelr525: there are property converters, which are really just little parsers

2:06 michaelr525: so adding a new binding operation is extremely complex

2:07 michaelr525: well, not extremly but it is beyond just editing an attribute on an xml tag :)

2:07 i've worked with silverlight for a while

2:07 actually a very positive experience, especially after the nightmares of Flex

2:07 bbloom: michaelr525: oh yeah, the core dev div people at msft are a talented bunch

2:08 michaelr525: silverlight's failure was purely political, not technical

2:08 ibdknox: once you "get" WPF it's astoundingly cool

2:08 which isn't to say that it can't be done better, but the underlying ideas are very nice

2:08 lynaghk`: ibdknox: is there a nice way to play with WPF from, um, emacs and linux world?

2:08 ibdknox: nope

2:08 bbloom: ibdknox: definitely. that's why i was experimenting with it in cljs & basically just cloning names & ideas from the WPF docs w/ a cljs twist

2:09 i might take another crack at it when i get bored of compiler stuff :-)

2:09 brainproxy: kovasb: 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

2:09 michaelr525: there is mono, i think they have implemented wpf, no?

2:09 brainproxy: which handled all of the event bidingin in the dom for you

2:10 bbloom: dnolen: i have a bug that only happens in advanced mode & i have no idea how to figure out what's causing it :-(

2:10 ibdknox: michaelr525: oh did they?

2:10 michaelr525: but really the big part of the experience is the way it works in VS

2:10 brainproxy: so you never had to work with callbacks or event emitters manually

2:10 michaelr525: everything is integrated, slick and easy

2:10 ibdknox: bbloom: looking for string keys

2:10 look*

2:10 err, non-string keys

2:10 bbloom: ibdknox: yeah….i have been :-/ *gulp*

2:11 ibdknox: :(

2:11 lynaghk`: bbloom: in cljs, that would be (aset thing "key" val) vs. (set! (.-key thing) val)

2:11 brainproxy: my 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

2:11 kovasb: brainproxy: where is that aspect covered? i looked around to evidence of that kind of thing but it didn't pop out

2:11 lynaghk`: bbloom: in case you didn't know. But, um. I guess you're working on the compiler.

2:12 bbloom: yeah, i'm putzing with some lower level stuff than that… sooo it's not that simple

2:12 brainproxy: kovasb: it's mentioned in the student paper, getting the link...

2:12 dnolen: brainproxy: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.96.974

2:12 michaelr525: ibdknox: sorry, they didn't implement WPF but they have implemented

2:12 Silverlight

2:12 http://www.mono-project.com/WPF

2:12 brainproxy: kovasb: http://www.cs.brown.edu/~sk/Publications/Papers/Published/mgbcgbk-flapjax/paper.pdf

2:12 dnolen: thanks!

2:14 kovasb: brainproxy: what is their "foreach" operation?

2:14 dnolen: bbloom: if it only happens in advanced mode lynaghk` is probably right.

2:14 kovasb: brainproxy: how do they create a bunch of dom elements with the same behavior

2:14 like in the todo mvc

2:15 behavior, i mean in the general sense, not their technical sense

2:16 lynaghk`: kovasb: funny you mention that---I was playing with todomvc with the reflex data binding stuff and a ghetto-datomic this morning.

2:16 brainproxy: kovasb: it's been awhile since i played with the templating lang part of flapjax, tbh, i didn;t

2:16 .. i didn't "get it" and though it would be better to use flapjax as a js lib

2:16 kovasb: lynaghk`: ha, i was wondering what you were doing in the #datomic channel :)

2:16 lynaghk`: kovasb: Getting a few different approaches implemented with TODO would be pretty sweet.

2:17 bbloom: TODO == decent hello world

2:17 lynaghk`: 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.

2:17 brainproxy: kovasb: but having come to clj/cljs, i think i would revisit the idea in terms of macros

2:17 bbloom: brainproxy: what do you need macros for there?

2:17 kovasb: lynaghk`: the last time i was there, there was discussion

2:17 brainproxy: bbloom: well to combine behaviors, you can use operations like liftB

2:18 lynaghk`: kovasb: have you used datomic for anything? I like the idea a lot and am thinking about implementing it on an upcoming project

2:18 brainproxy: b3 = liftB(function(...) { do something w/ vals of b1, b2 }, b1, b2)

2:18 bbloom: brainproxy: *shrug* i'm not sure it needs to be that complex

2:18 brainproxy: but it would be nice to be able to do

2:18 b3 = b1 + b2

2:19 and a macro could make that possible

2:19 estreams and behaviors can be chained OO style or composed functional style, but if you want to do behavior-backed templates

2:19 neither is really attractive

2:21 bbloom: FOUND THE DOPEY ROUGE aget! w00t.

2:22 ibdknox: lynaghk`: what's the value in that approach?

2:22 bbloom: i'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

2:22 kovasb: lynaghk`: i've been hankering the play with it, but first things first

2:23 lynaghk`: definitely want to try to use it to store "session" data

2:23 lynaghk`: also very curious how it would integrate with this reactive web stuff

2:23 lynaghk`: like, just dialing into the transaction stream to update the ui

2:24 brainproxy: kovasb: yes, i think that is where it can go

2:24 but I need to understand the limitations dnolen foresees

2:25 kovasb: brainproxy: what limitations?

2:25 brainproxy: he said that Rx fails w.r.t. cross cutting concerns

2:25 kovasb: oh yea

2:25 well, maybe thats an orthogonal primitive

2:26 bbloom: brainproxy: yeah, i'm not sure what he meant by that

2:26 in general, i view the rx stuff as a lower level thing. cross cutting concerns can be implemetned as queries over the event stream

2:26 brainproxy: bbloom: me neither, but I'll try to grok the paper he linke

2:26 kovasb: "Datalog as a Pointcut Language in Aspect-Oriented Programming" ?

2:26 bbloom: kovasb: hell yes.

2:26 brainproxy: estream isn't really the high level Rx stuff

2:26 kovasb: they just need to mention immutability for full complience

2:26 lynaghk`: ibdknox: value of what approach? re-implementing a ghetto version of datomic?

2:27 brainproxy: behaviors on top of estreams is higher order

2:27 bbloom: kovasb: but you may need some explicit optimizations for UI specific queries

2:27 brainproxy: and behaviors of estreams

2:27 which is where i was trying to go

2:27 before I realized that js/coffee were too limiting, and I had other pressing concerns as well

2:28 kovasb: bbloom: anything specific the needs to be optimized?

2:28 bbloom: kovasb: primarily the two cases css optimizes for: specific elements (ids) and named categories of elements (css classes)

2:28 kovasb: i see

2:29 I'm all about using the browser to implement our abstractions for us

2:29 :)

2:29 bbloom: "apply this behavior to the save button"

2:29 or "apply this behavior to all buttons"

2:29 lynaghk`: bbloom: if you want to take a literal CLJS vacation you can come down to the PDX Clojerks meeting on the 20th

2:29 kovasb: right

2:29 yeah, theres a bunch of approaches to that

2:30 brainproxy: actually what you would probably want to do is implement the behavior interface on a button type

2:30 and then you could compose buttons with any other type that implements the behavior and/or estream interfaces

2:31 sorry, i mean protocol, not interface meaning a java thing as such

2:31 kovasb: right

2:31 bbloom: lynaghk`: might not be available that day, but i'll consider it. i'm in seattle

2:31 kovasb: i vacillate on using protocols for event stuff

2:31 i mean, there are too many possible events to have a protocol for each one

2:31 brainproxy: kovasb: exactly

2:32 that's why you have the estream abstractino

2:32 kovasb: so do you just have a 2 function interface

2:32 i see

2:32 brainproxy: you "extract" an estream from an event emitter

2:32 then you can compose the estream with estream transformers

2:32 kovasb: right, but you need to resolve that piece of data somehow or another

2:32 lynaghk`: bbloom: I know. Slightly less rain is only a few hour drive away =P

2:32 brainproxy: or "extract" a behavior fro the estream

2:32 and use behavior transformers

2:33 kovasb: eventually you need to call a function on your datatype tho right

2:33 or not?

2:33 brainproxy: i can probably answer, but can you be more specific

2:33 don't want to go off in a different direction than you're thinking

2:34 kovasb: i should read these papers in more detail.

2:34 brainproxy: let em be an emitter

2:34 kovasb: lol

2:34 my brain will be a behavior

2:34 brainproxy: $E(em) returns an evenstream

2:34 whoops, $(em, 'event')

2:34 err $E..

2:35 but anway, then $B($E(em, 'event'))

2:35 using the js syntax, of course

2:35 that gets you a behavior

2:36 kovasb: understood

2:36 brainproxy: what gets interesting is when you, say, pass an the return of $B to an event stream transformer

2:37 in my thinking, it should by convention represent a behavior of event streams

2:38 which then leads to some higher order things like "switches"

2:39 leku: i'm playing with a piece of code in the repl that does (clojure/refer 'clojure)

2:39 and it throws an error

2:39 no such namespace: clojure

2:39 http://jonathanwatmough.com/2008/02/google-charts-from-clojure/

2:39 i'm guessing this is just old code ?

2:39 kovasb: brainproxy: yeah these primitives are promising

2:40 brainproxy: kovasb: the other thing is how do you think about variadic emitters

2:40 flapjax is hardwired to arity 1

2:40 kovasb: right

2:40 brainproxy: but if you allow for N

2:40 kovasb: thats a problem I'm working on as well

2:40 brainproxy: then suddenly you need some way to think about that

2:40 my solution was a transformer which would allow you to set an estream in "zipped", "vectored

2:41 whoopps

2:41 "zipped", "vectored" or "sequenced

2:41 mode

2:41 kovasb: only 1 of the slots gets filled at a time tho right?

2:41 brainproxy: just depends

2:41 kovasb: if 1 of the 3 events fires, you get null in the other two

2:41 brainproxy: no, what i mean is

2:42 em emits three arguments

2:43 and downstream from em is a mapE

2:43 kovasb: right

2:43 brainproxy: should the fn tied to that mapE interpret as three args to the fn

2:43 or fn called three times

2:44 with each of the arguments

2:44 kovasb: if you want it called three times, can't u just emit three times?

2:44 might be a limitation of their design

2:44 brainproxy: their design is quite limited

2:44 but I worked up an alternative

2:44 kovasb: have u looked at the reducers framework?

2:44 brainproxy: a bit ... i read hickey's blog post, but I was just getting into clojure at the time

2:44 kovasb: wow u r brand new!

2:45 the way it handles the mapcat and filter cases are sweet

2:45 brainproxy: yes, just finished the o'reilly book, and am trying to get my game on

2:45 but I have to work on some other things for a few months to pay the bills, then I can come back to Rx

2:45 kovasb: cool well its good to have u on board

2:46 raek: leku: wow. yep. that's old.

2:46 brainproxy: thanks :)

2:46 kovasb: there is also an audio of his talk, which is quite comprehensible

2:46 http://www.meetup.com/Clojure-NYC/events/56212552/

2:46 if u read it along with the blog posts, its pretty good

2:46 brainproxy: cool

2:46 kovasb: anyway, the point being that you just layer your transformation functions in a certain way

2:47 and you can do map, mapcat, filter etc in a natural way without resorting to wrappers or empty values

2:47 not sure if it can be applied to this case, but a cool design precedent

2:47 brainproxy: yes, the mechanisms that clojure/clojurescript opens up are going to be so much nicer

2:48 kovasb: the implementation is pretty nuts, in how much it does with so little lines

2:48 brainproxy: flapjax and my Jolt have a datastructure called a pulse which moves the date through the propagation DAG

2:48 kovasb: reifying things left and right, currying

2:48 brainproxy: and things get really weird when you start doing "pulses of pulses"

2:48 kovasb: i can imagine

2:48 brainproxy: which is improtant for the higher order estream/behavior joins

2:49 also, immutability becomes a big deal

2:49 kovasb: how much of flapjax does your implementation cover?

2:49 brainproxy: kovasb: I redesigned the internals, and had a lot of the stream stuff working according to my redesign

2:50 kovasb: like, should i read your code, their code, or both?

2:50 just to get a sense of whats going on

2:51 brainproxy: kovasb: i started annotating a lot of my stuff w/ docco

2:51 http://projexsys.github.com/Jolt/docs/Jolt.html

2:51 what's there is how far i got, for the most part

2:51 if you use the "jump to" pull down in the top right

2:51 you can see how I build up

2:51 some of the annotations are crappy, and needed to be rewritten :(

2:51 kovasb: aww

2:51 ahh

2:52 i was like, just the license??

2:52 lazybot: kovasb: Definitely not.

2:52 kovasb: haha

2:52 cool

2:53 well thanks for the pointers. getting late out here in the EST

2:53 if 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

2:53 over and out

2:53 brainproxy: kovasb: have a good one

2:56 bbloom: clj 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

2:58 brainproxy: bbloom: you could write it in clojurescript and compile and then run with nodejs

2:58 it will be very fast and the node api is very nice for doing systems stuff

2:58 bbloom: hmmm

2:59 brainproxy: including spawning child processes

3:00 bbloom: there's also some project called jark where you can have a long-running jvm

3:00 bbloom: brainproxy: yeah, there are a bunch of things like that

3:00 brainproxy: i've used cljsh

3:01 brainproxy: bbloom: not familiar with cljsh

3:02 bbloom: https://github.com/franks42/lein-repls

3:02 brainproxy: ah

3:02 bbloom: i think that's what ill use

3:05 muhoo: the madness https://www.refheap.com/paste/3011

3:09 Sgeo: "Note: always use return value for later changes, never original!"

3:09 That 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.

3:15 Raynes: muhoo: Even Clojure can't make Java look good.

3:19 brainproxy: Sgeo: clojure supplies something called transients, but it's recommended that you insulate them, e.g. only use them for optimization w/in a function

3:20 Sgeo: brainproxy, I assume similarly to the ST monad in Haskell, although ST also supplies sort of "local variabes" that cannot escape outside of ST

3:20 (enforced by type-system)

3:25 brainproxy: Sgeo: see https://www.refheap.com/paste/3011

3:25 whoops

3:26 i meant see http://clojuredocs.org/clojure_core/clojure.core/transient

3:28 the idea is to use a mutable return value of (transient ...) and then use (persistent! ...) for returning an immutable

3:29 Sgeo: Refs are TVars

3:29 That's easy

3:32 wrt the vars made by with-local-vars, can they be "sneaked out" of the with-local-vars somehow?

3:32 Oh, no.

3:53 Is Clooj good?

3:54 bbloom: mail dnolon hacked this up for benchmarking, has been useful https://www.refheap.com/paste/3013

3:54 no idea if lazybot works or not :-P

4:00 muhoo: i have to wonder, is there already a function somewhere in ring that does this? https://www.refheap.com/paste/3014

4:02 ro_st: that'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?

4:07 Sgeo: "The following code demonstrates usage of def, defn, let, binding, and println.

4:07 "

4:07 http://java.ociweb.com/mark/clojure/article.html

4:07 Why doesn't the example surround v with **?

4:07 Which is conventional in CL and according to the tutorial in Clojure too

4:08 ro_st: usually people do. it's not enforced, however. it's just a convention

4:09 Sgeo: Hmm, let still behaves locally only with dynamic variables, binding is separate

4:09 That's different from CL, where let behaves like binding for those types of variables

4:12 ro_st: how do i get the slime repl to do the cool stuff that lein2's repl does? doc, find-doc, clojuredoc et al

4:12 bbloom: (use 'clojure.repl)

4:13 ro_st: and automatically?

4:14 Sgeo: Besides macro writing, when would I use a list instead of a vector?

4:14 ro_st: ie, no matter what ns i'm in, doc is always available. i'd like this in slime repl too

4:14 Sgeo: when doing clojure koans -grin-

4:16 bbloom: ro_st: dunno :-P I'm a vim guy!

4:16 ro_st: -grin- no worries

4:18 muhoo: how would i kick a java library into debug mode?

4:19 i see _log.isDebugEnabled() in interesting places

4:19 Sgeo: How frequently is stuff coded to make use of -?> easy?

4:20 amalloy: bbloom: 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

4:21 bbloom: amalloy: ah, thanks.

4:22 Sgeo: Ok, so Clojure doesn't have easy facilities for optional and keyword arguments? I mean, they look possible but annoying

4:22 bbloom: $mail dnolen I hacked this up for comparing benchmark runs: https://www.refheap.com/paste/3015 been super useful so far

4:22 lazybot: Message saved.

4:22 Sgeo: I'm starting to like the way Racket handles it

4:23 bbloom: Sgeo: You can make functions with multiple different arities

4:24 &((fn f ([x] (f x 2)) ([x y] (+ x y))) 3)

4:24 lazybot: java.lang.RuntimeException: Expecting var, but f is mapped to interface clojure.core.f

4:24 bbloom: ,((fn f ([x] (f x 2)) ([x y] (+ x y))) 3)

4:24 clojurebot: 5

4:24 bbloom: sorta like default arguments

4:26 Sgeo: But more typing

4:26 Guess there's no chance that each clause can be checked .... in a sort of pattern matchy way?

4:26 Because then I'd be happy

4:55 Can 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."

4:55 Why isn't Math/sin and #(Math/sin %) the same?

4:56 http://java.ociweb.com/mark/clojure/article.html

5:05 raek: Sgeo: java methods aren't first class objects

5:05 Sgeo: Ah. ugh.

5:06 raek: if you would have had a clojure function there, like clojure.core/inc, it would work in both cases

5:45 PKHG: hallo 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 ...

5:46 who knows to get a workign definition for this example?

5:46 means a round which rounds ;-)

5:47 borkdude: round is not a standard function in clojure

5:48 you can use Math/round

5:48 ,(Math/round 3.14)

5:48 PKHG: THAT does not work!

5:48 borkdude: ,(Math/round 3.55)

5:48 PKHG: only directly but not in the script (above)

5:49 borkdude: PKHG it's not even used in the script

5:49 clojurebot: 3

5:49 PKHG: how should I define roudn? moment ...

5:49 clojurebot: 4

5:49 PKHG: round is used!

5:49 borkdude: PKHG not Math/round

5:50 PKHG: so if I ry (fn round [x] (Math/round x)) is not working ...

5:50 borkdude: PKHG (round (/ (* scale (- v)) val-range)) -> (Math/round (/ (* scale (- v)) val-range)))

5:50 PKHG: Java has a round in some Math package .... how to make THAT usable ..???

5:50 lazybot: PKHG: Yes, 100% for sure.

5:52 PKHG: borkdude: do not understand ...

5:52 borkdude: ,(Math/round (/ (* 0.5 (- 1)) 3)))

5:52 clojurebot: 0

5:52 borkdude: ,(Math/round (/ (* 5 (- 1)) 3)))

5:52 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: round>

5:53 borkdude: ,(Math/round (/ (* 5 (- 1)) 3))

5:53 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: round>

5:53 PKHG: borkdude is there a . (point) before ?

5:53 borkdude: PKHG no, to call a static method from the class Math, use /, so (Math/round x)

5:54 PKHG: .... direct (Math/round 2.4) give to but now make it a round for the script ???? THAT is my problem)

5:55 borkdude: PKHG why don't you write (Math/round …) instead of (round …) in the script?

5:55 PKHG: I tried ,,, did not work

5:55 borkdude: PKHG I see what could cause an error though: ##(Math/round 3/4)

5:55 lazybot: java.lang.IllegalArgumentException: No matching method found: round

5:55 borkdude: you get this error?

5:56 PKHG I see what could cause an error though: ##(Math/round (float 3/4))

5:56 lazybot: ⇒ 1

5:56 PKHG: moment ... trying again ...

5:56 borkdude: PKHG the method round does not take a Rational, which is a Clojure type for fractions

5:57 PKHG: dear 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 ...

5:57 borkdude: PKHG ok, so: (defn round [n] (Math/round (float n)))

5:57 or double instead of float

5:57 PKHG: OH you mean the script uses 34/5 and that has to be changed into a float? have tolook

5:57 borkdude: ,(double 3/4)

5:58 clojurebot: 0.75

5:58 PKHG: moment trying ..

5:59 so loading the example I get java.lang.Exception: Unable to resolve symbol: round in this context (NO_SOURCE_FILE:29)

5:59 borkdude: PKHG I'll tell you one time and then I'll give up: there is no function round out of the box in Clojure

6:00 PKHG: clear but one can create it can't you?

6:00 borkdude: PKHG yes, like I wrote: (defn round [n] (Math/round (float n)))

6:00 PKHG good luck

6:00 PKHG: yes that I will rty now ...

6:05 borkdude: thanks, that defn works ;-) (though ascii-bar-chart does not yet work, but that will be solved ...)

6:07 muhoo: $mail cemerick progress on google step2 , next integrating with friend https://www.refheap.com/paste/3018

6:07 lazybot: Message saved.

6:10 PKHG: :) ascii-bar-chart works now thanks again guys

6:10 borkdude: PKHG you might want to replace float with double in the defn, I don't know, nice that it works

6:11 PKHG: ok ...

6:11 noted

6:12 borkdude: it depends on the precisioun you will need, probably not a big deal here

6:12 PKHG: ;-)

6:17 gfredericks: ,(rem 7/5 1)

6:17 clojurebot: 2/5

6:18 gfredericks: (defn round-rat [r] (let [f (rem r 1)] (if (< f 1/2) (- r f) (+ r (- 1 f)))))

6:18 ^ exact rounding for rationals

6:23 borkdude: gfredericks it returns a double when you put in a double but a BigInt when you put in a Rational

6:23 gfredericks: borkdude: which is what I'd want

6:24 e.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

6:24 borkdude: gfredericks great

6:25 it's a bit surprising that this function isn't included in clojure maybe?

6:26 gfredericks: eh :/ there's not too much for dealing with rationals. just the bare minimum

6:27 PKHG: borkdude: have a look here http://www.petergragert.info/pmwiki/uploads/Clojure/asciibarchart.jpg

6:27 the example of the script ;)

6:27 borkdude: PKHG great :-) I love ascii

6:27 PKHG: sometimes me too ...

6:29 gfredericks: borkdude: I can't think of another example of an equivalently useful rational number function, so maybe that one is blatantly missing from core

6:29 borkdude: PKHG are you Peter Gragert who teached Calculus at University of Twente?

6:29 PKHG: yes ;)

6:30 borkdude: great!

6:30 I attended your lectures in my first year

6:30 gfredericks: you guys aren't fooling anybody. We all know "University of Twente" is a made up name.

6:30 borkdude: lol

6:30 PKHG: was je een van mijn studenten?

6:30 borkdude: ja, bij Informtica

6:30 gfredericks: and that's a made up language.

6:30 PKHG: which year ?

6:30 borkdude: I started in '99

6:31 PKHG: nice ... and how did I do it for you? some math fable?

6:32 borkdude: I really liked Calculus (really), in opposite of many other students

6:32 PKHG: you remember by sure : Tante Maple and 'appelsientje' hi hi ...

6:32 borkdude: finally there were proofs for "stellingen" we used at VWO

6:32 PKHG: and now you are a Lisp fan? Reduce used standard Lisp ... formula manipulation wa there was no Maple ..

6:33 borkdude: I became a lisp fan around my fourth year

6:33 but functional programming in my first year influenced that already

6:33 PKHG: my PHD was based on Standard Lips using ..

6:34 Lips = Lisp :)

6:34 borkdude: still in NL?

6:34 borkdude: PKHG my internship and final thesis were done using Common Lisp

6:34 PKHG yes, Amersfoort

6:35 PKHG: nice ...! just started reading: Artificail Intellgent Programming (Common Lisp) Peter Norvig ;

6:35 oth t;yping errors but readable ...

6:36 may I ask a question?

6:36 borkdude: PKHG I read that book also

6:36 of course

6:36 PKHG: good ... strange result ... moment (in several lines ...) moment please

6:39 (setf a 'global-a)

6:39 (setf *b* 'global-b)

6:39 (defun fn () *b*)

6:39 (let ((a 'local-a)(*b* 'local-b))

6:39 (list a *b* (fn) (symbol-value 'a) (symbol-value '*b')))

6:39 What should be printed (the last result was 'local-b' and I expected '(global-b))

6:40 page 95 of the book

6:40 borkdude: let me see

6:41 PKHG: four times local and onlu the (symbol-value 'a) gave global?/??

6:41 lazybot: PKHG: Uh, no. Why would you even ask?

6:41 PKHG: lazybot: it was an exercise in the book!

6:42 gfredericks: $botsmack

6:42 borkdude: PKHG don't mind lazybot ;)

6:42 PKHG: so so ....

6:42 is lazybot some AI trying to ask 'intelligint' questions?

6:43 gfredericks: lazybot: are you???

6:43 lazybot: gfredericks: Yes, 100% for sure.

6:43 PKHG: lazybot: what is your real name?

6:43 lazybot: It's AWWWW RIGHT!

6:43 borkdude: PKHG lazybot can evaluate some clojure for you

6:44 &(+ 1 2 3)

6:44 lazybot: ⇒ 6

6:44 PKHG: so it is a clojure program ...

6:44 borkdude: or in text ##(+ 1 2 3)

6:44 lazybot: ⇒ 6

6:44 gfredericks: &(#(% %) #(% %))

6:44 lazybot: java.lang.StackOverflowError

6:44 PKHG: nice game ..

6:45 borkdude: PKHG if you like game, you should also see www.4clojure.org

6:45 PKHG: (Math/round (/ 34 5))

6:45 borkdude: PKHG put an ampersand (&) in front of it

6:45 PKHG: ok ...

6:45 &(Math/round (/ 34 5))

6:45 lazybot: java.lang.IllegalArgumentException: No matching method found: round

6:46 PKHG: &(Math/round (double (/ 34 5)))

6:46 lazybot: ⇒ 7

6:46 PKHG: really nice ;-)

6:47 borkdude: PKHG I'm reading on special variables now, it's been a while, but they seem similar to dynamic vars in Clojure

6:48 PKHG: hmmm ... does lazybot remember definitions as my example above (from the book)?

6:48 trying ;-)

6:48 borkdude: PKHG so in the exercise local-b should be printed

6:49 PKHG: borkdude it is ... but why? the difference between a and *b* *b* ===> Parmeter the stars ???

6:49 lazybot: PKHG: Oh, absolutely.

6:50 PKHG: &(setf *b* 'global-b)

6:50 lazybot: java.lang.RuntimeException: Unable to resolve symbol: setf in this context

6:50 borkdude: PKHG *b* is a "special variable" which you can rebind to a value, similar to dynamic vars in clojure

6:50 Sgeo: PKHG, are you coming from a Common Lisp background?

6:50 PKHG: ok... not yet so good in clojure (dynamic vars ..)

6:51 No Standard Lisp where Reduce was written in ...

6:51 Sgeo: binding in Clojure is basically how you'd do let on a special variable in Common Lisp

6:51 If I understand correctly

6:51 borkdude: PKHG see this: http://clojuredocs.org/clojure_core/clojure.core/binding

6:52 Sgeo: Not sure if that's helpful

6:52 PKHG: will have a (short) look ....

6:52 Sgeo: (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

6:53 borkdude: PKHG this is particularly helpful for example when you have a function that uses println which by default prints to *out*

6:53 PKHG: yes that nice API doc ... thanks borkdude ... my nap-time is coming ... hope to see (chat) you later againg bye

6:53 Sgeo: Wait, is PKHG coming from a CL background?

6:53 PKHG: Sgeo: no STANDARD LISP

6:53 borkdude: PKHG see you later, it was a pleasure talking to you again after all these years ;)

6:53 PKHG: me too ;-)

6:54 what is the world small ...

6:54 Sgeo: o.O never heard of Standard Lisp

6:54 borkdude: Sgeo that's because you are too young

6:54 PKHG: and PKHG is 70+ ;-)

6:54 borkdude: Sgeo it doesn't even have a wikipedia page: http://en.wikipedia.org/wiki/Portable_Standard_Lisp

6:55 PKHG: borkdude: phantastic!

6:55 theat link

6:56 borkdude: PKHG it can be confusing learning common lisp and clojure at the same time

6:56 PKHG: Stnadard lisp made it possible to compile to machinecode Reduce formala manimpulation programs!! facto up to 1000 measured in better perfomance

6:56 borkduce: ... oh will pay attention to it ...

6:58 borkdude: do you use emacs and slime ? and get clojure good running in emacs? succeeded only half ...

6:58 borkdude: PKHG I use it, but I also use Eclipse (a Java IDE)

6:59 PKHG: Eclipse can it run clojure =REPL in eclipse?

6:59 borkdude: PKHG yes!

6:59 PKHG: oh ... then maybe I should try .. ;-) (will ask later about this ) now rsally leaving

7:00 borkdude: I can't believe it… my old math professor

7:01 wow

7:01 :)

7:47 irc2samus: hi guys, anyone knows how to tell lein to pass -Xlint to javac?

7:48 borkdude: irc2samus try #leiningen

7:49 irc2samus: oh nice, didn't knew it had a channel thanks

8:06 ladyboy: What is the difference between Clojure and PHP?

8:07 Iceland_ERC: wat

8:09 michaelr525: php is for ladyboys?!

8:09 clojure is for real men (tm)

8:09 banseljaj: ladyboy: Is that an *actual* question or ae you trolling?

8:09 hyPiRion: Guys, he left immediately.

8:09 banseljaj: troll (tm)

8:10 S11001001: irc tab complete is your friend

8:10 michaelr525: just joking

8:10 hhh

8:10 banseljaj: Does clojure have bindings for GUI other than swt?

8:11 gfredericks: WELL now that you ask there are some differences between PHP and Clojure if I'm not mistaken.

8:11 hyPiRion: banseljaj: Do you mean like seesaw?

8:11 banseljaj: I might. I am a beginner, so was just looking for options

8:12 hyPiRion: Ah - as in non-swing GUI?

8:12 banseljaj: hyPiRion: Yes.

8:13 clgv: banseljaj: well one option is to use swing/swt as you would in java - but afair something like seesaw might be less pain ^^

8:13 banseljaj: clgv: Thanks

8:13 hyPiRion: Seesaw is using Swing, but it simplifies stuff at least.

8:31 gfredericks: TimMc: 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 [] ...)

8:38 bobry: is it possible to use futures in clojurescript?

8:39 gfredericks: well the "defer" concept is possible but not the "block until it finishes" concept

8:42 TimMc: and indeed all the core.logic tests pass after removing the function name

8:43 LauJensen: bobry: js is single-thread

8:46 borkdude: you can now have some kind of background workers right

8:46 https://developer.mozilla.org/En/Using_web_workers

8:47 don't know how well this is supported everywhere though

8:47 bobry: LauJensen: indeed, but it doesn't mean we can't make the usual 'callback'-style of doing things more readable

8:48 even jQuery has futures http://api.jquery.com/category/deferred-object/

8:48 S11001001: gfredericks: with one thread, future is delay

8:49 gfredericks: S11001001: but you can't deref it

8:49 S11001001: deref is run 0-arg function, assign to cache, return that

8:49 gfredericks: I guess that's true

8:50 S11001001: what you can't do is assume that it will eventually get around to doing something *before* you deref

8:50 gfredericks: it's sort of a crippled abstraction though

8:50 S11001001: but it's equivalent semantically for pure futures

8:51 gfredericks: so are they included? I haven't checked.

8:52 TimMc: gfredericks: Oho! So it's just there for debugging purposes.

8:53 gfredericks: TimMc: oh yeah? it shows up in the fn's class name I guess?

8:54 TimMc: Yeah, it's in the stack trace that way.

8:54 gfredericks: now I'm curious if there are any pathological constructions that actually _do_ trip up on the name collision

8:54 which presumably are not covered by the tests

8:55 TimMc: That would be an entertaining ticket to file if you could construct one.

8:55 gfredericks: :) and an easy fix

8:55 TimMc: Bastard version: Don't tell them the answer, let them figure it out.

8:55 gfredericks: lol

9:04 TimMc: I would think a couple nested fresh's would trigger it but they don't :/

9:05 e.g. in (macroexpand-all '(fresh [x] (fresh [y] s#)))

9:07 oh I bet it's backquote expanding it to clojure.core.logic/-inc before it gets resolved

9:07 TimMc: gfredericks: Ah, right. Because -inc (macro) doesn't defn -inc (function).

9:07 So hah! I was right. :-P

9:07 gfredericks: wat

9:08 I never thought it was a var issue I thought it was a lexical scope issue

9:08 if the -inc in fresh were changed for ~'-inc I think that would trigger it

9:18 Chiron_: Hi, any body using clj-hector?

9:19 clgv: ~anyone

9:19 clojurebot: Just 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 ..."

9:21 gfredericks: Does anyone know the question I really want the answer to?

9:22 gtrak: 42

9:23 gfredericks: clojurebot: 42?

9:23 clojurebot: 42 is forget (+ 2 3)

9:23 gfredericks: clojurebot: 42 is 6 * 9

9:23 clojurebot: Alles klar

9:23 Chiron_: clojurebot: para que la vida

9:23 clojurebot: blackdog is the star of Black Dawg Down

9:25 clgv: 42?

9:25 clojurebot: 42 is forget (+ 2 3)

9:26 clgv: clojurebot: 42?

9:26 clojurebot: 42 is forget (+ 2 3)

9:26 gfredericks: clojurebot: forget 42 is forget (+ 2 3)

9:26 clojurebot: Alles klar

9:26 gfredericks: 42?

9:26 clojurebot: 42 is the answer

9:33 hyPiRion: 42?

9:33 clojurebot: 42 is the answer

9:33 hyPiRion: hm.

9:34 Hodapp: o_O

9:36 S11001001: ,(get 42 42 42)

9:36 clojurebot: 42

9:37 gfredericks: ,((comp (partial apply get) (partial repeat 3)) 42)

9:37 clojurebot: 42

9:37 TimMc: Hodapp: clojurebot is our spontaneous non sequitur generator

9:38 gfredericks: he's not our spontaneous sequitur generator

9:39 Hodapp: TimMc: Um, I'm sorry, but that's my job, not a bot's job.

9:40 gfredericks: it's a shame all the honest hard-working folk being put out of a job by a machine

9:40 mprentice: dishonest and lazy folks too. let's not forget to mourn them.

9:40 cshell: ,(name :key)

9:40 clojurebot: "key"

9:41 cshell: sweet

9:41 gfredericks: ,(name :foo/key)

9:41 clojurebot: "key"

9:41 Hodapp: blah blah blah liberals government.

9:41 cshell: Can keys be namespaced?

9:41 Hodapp: see, I could have come up with a good non-sequitur there back in my day

9:41 S11001001: ,(clojure.pprint/cl-format nil "~:R" 42)

9:41 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.pprint>

9:41 gfredericks: cshell: ##::yep

9:41 S11001001: pth

9:41 gfredericks: (dec lazybot)

9:41 lazybot: ⇒ 5

9:41 gfredericks: ,::yep

9:41 clojurebot: :sandbox/yep

9:41 S11001001: &(clojure.pprint/cl-format nil "~:R" 42)

9:41 lazybot: ⇒ "forty-second"

9:57 clgv: &(doc clojure.pprint/cl-format)

9:57 lazybot: ⇒ "([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

9:58 S11001001: by far the most useful bit of clojure.pprint

9:58 twhume: I 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")?

9:59 S11001001: twhume: partition, pmap, apply concat

9:59 mrtentje1: For 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)?

9:59 clgv: twhume: pmap isnt using parallelity very well, since it's lazy-parallel

9:59 S11001001: not worth a library

10:00 twhume: clgv: 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:00 S11001001: thanks

10:00 clgv: S11001001: and a (map f ...) insteaf of f ;)

10:00 S11001001: clgv: truth

10:01 clgv: twhume: there is nothing built-in yet, afaik.

10:01 gfredericks: S11001001: and partition-all instead of partition

10:01 S11001001: and I'd start with blocks more like 1k elts

10:02 I think partition is now the same

10:02 &(partition 2 [1 2 3])

10:02 lazybot: ⇒ ((1 2))

10:02 S11001001: &(clojure-version)

10:02 lazybot: ⇒ "1.4.0"

10:02 S11001001: hmm

10:02 hyPiRion: heh

10:02 S11001001: disappointing

10:02 &(doc partition)

10:02 lazybot: ⇒ "([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:03 hyPiRion: You could always do some java parallelism

10:03 clgv: twhume: you can do (->> coll (map #(future (f &))) doall (map deref))

10:03 S11001001: I 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:04 gfredericks: clgv: could run out of memory that way

10:04 S11001001: &(partition 2 2 [] [1 2 3])

10:04 lazybot: ⇒ ((1 2) (3))

10:04 hyPiRion: &(doc partition-all)

10:04 lazybot: ⇒ "([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:04 S11001001: HAH

10:04 classy

10:04 clgv: gfredericks: you can always run out of memory in lots of ways ;)

10:04 gfredericks: clgv: good point. no more worrying about that!

10:05 laziness is for wusses

10:05 S11001001: &(doc future-call)

10:05 lazybot: java.lang.SecurityException: You tripped the alarm! future-call is bad!

10:05 S11001001: what

10:05 ,(doc future-call)

10:05 clgv: gfredericks: laziness sucks when you want to parallelize - hence the reducers ;)

10:05 clojurebot: "([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:06 hyPiRion: twhume: Do you really need the speed though?

10:06 gfredericks: clgv: it doesn't suck when you want to parallelize more things than can fit in memory

10:07 Hodapp: http://www.infoq.com/presentations/We-Really-Dont-Know-How-To-Compute - this lecture from Sussman is quite fascinating, I think

10:07 twhume: hyPiRion: I'd like to make use of it, yes. I'm processing a sequence which might be billions of items.

10:07 Hodapp: heard it from #scala but he mostly uses Scheme/Lisp in the lecture

10:07 dnolen: Hodapp: was cool to see him give that at StrangeLoop

10:07 S11001001: right, so maybe you want 64k-sized partitions instead :)

10:09 Hodapp: dnolen: you saw it too?

10:09 dnolen: Hodapp: yes

10:10 Hodapp: that's pretty cool

10:10 this is the first lecture I've seen of his in any form

10:10 but it makes me rather want to read SICP and watch his lectures of that even if they're 20 years old

10:10 ro_st: this is probably a long shot. but here goes… anything like http://activeadmin.info/ in clojure, yet?

10:11 clgv: gfredericks: well, that depends on the characteristic of the function applied - if its runtimes are pretty inhomogenoeus pmap really sucks

10:11 dnolen: Hodapp: SICP is incredible - old lectures are awesome.

10:11 hyPiRion: Billions of items? I'd be concerned with memory usage if I were you.

10:11 ro_st: Hodapp: whose lectures?

10:11 dnolen: ro_st: Sussman

10:11 Hodapp: ro_st: I think they are given by Sussman but I may be wrong.

10:12 hyPiRion: Regardless, I think futures is the way to go.

10:12 gfredericks: clgv: it doesn't depend. if you have a billion-item seq then materializing the whole thing is always bad.

10:12 clgv: hyPiRion: you might use custom futures since their standard thread pool is not fixed size which can decrease performance

10:13 gfredericks: you dont need to use pmap to not keep everything in memory ;)

10:13 gfredericks: clgv: I'm not arguing for pmap I'm arguing against your code

10:14 clgv: gfredericks: 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:14 gfredericks: k

10:14 hyPiRion: clgv: Or just Java-futures. Use a ThreadFactory.fixedThreadPool, put in callables, and save the futures.

10:15 clgv: hyPiRion: yeah. but you can write yourself a future+ or such with this implementation ;)

10:15 for convenience and ease of use ;)

10:15 hyPiRion: True.

10:19 clgv: in principle it would be pretty handy to modify the future threadpool in general

10:19 mrtentje1: For 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:25 borkdude: mrtentje1 I think you need to use some functions from ring to get them

10:25 https://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/middleware/session.clj

10:26 -> session (read-session store sess-key) …

10:28 mrtentje1probably 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:38 mrtentje1 I've got something now

10:38 mrtentje1: borkdude: so the only thing I need to do is to get the memory-store of the ring the get the current sessions?

10:38 borkdude: mrtentje1https://gist.github.com/2882250 <-- mem is atom with the map which contains all sessions

10:39 so when I execute this in two different browsers I see smth like this:

10:39 Welcome to foo{"68700737-41b6-41fa-9c9d-c2795c89bdb8" {:test "hello"}, "c1ed6479-01c3-455c-8bf8-1668cf3b6c06" {:test "hello"}}

10:40 two sessions with a map for sessions data

10:40 you could save the names in there

10:40 per session

10:40 and retrieve them from mem to list all the names

10:41 so (session/put! :name "username")

10:42 and then write a function that lists the names: (for [[k v]@session/mem] (:name v))

10:43 mrtentje1 so no need to use any ring stuff, just mem

10:57 nDuff: I'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:19 xumingmingv_: I just read an amazing sentense

11:20 "all Clojure functions implemented java.util.Comparator"

11:20 borkdude: they do

11:21 xumingmingv_: how and why?

11:21 borkdude: xumingmingv_ for use in sort for example

11:21 ,(sort > [1 2 3 4])

11:21 clojurebot: (4 3 2 1)

11:21 borkdude: ,(doc sort)

11:21 clojurebot: "([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:22 xumingmingv_: but obviously not all functions can be used as the comparator?

11:22 samaaron: it's only useful if the fn takes two args

11:22 and returns somethign sensible

11:22 but that doesn't just have to be -1 0 1

11:22 it can also be true and false

11:22 which means fns like < can act as a comparator

11:23 borkdude: you can see here how it is implemented: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/AFunction.java

11:23 foxdonut: ,(compare > 4 2)

11:23 clojurebot: #<CompilerException clojure.lang.ArityException: Wrong number of args (3) passed to: core$compare, compiling:(NO_SOURCE_PATH:0)>

11:23 foxdonut: ,(.compare > 4 2)

11:23 clojurebot: -1

11:23 foxdonut: cool

11:24 (inc borkdude)

11:24 lazybot: ⇒ 2

11:24 xumingmingv_: I understand why now, but seems a little werid

11:24 borkdude: ,borkdude

11:24 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: borkdude in this context, compiling:(NO_SOURCE_PATH:0)>

11:24 borkdude: ;-)

11:24 xumingmingv_: to let all functions implement a Comparator interface

11:24 foxdonut: $karma borkdude

11:24 lazybot: borkdude has karma 2.

11:24 borkdude: I see...

11:25 $karma Borkdude

11:25 lazybot: Borkdude has karma 2.

11:25 borkdude: is karma case sensitive?

11:25 foxdonut: no idea.

11:25 (inc Borkdude)

11:25 lazybot: ⇒ 3

11:25 borkdude: because I chose to lowercase my nick

11:25 foxdonut: (inc borkdude)

11:25 lazybot: ⇒ 4

11:25 borkdude: ah

11:25 it's not

11:25 foxdonut: guess not

11:25 borkdude: ;)

11:25 clgv: ,(map println (repeat 3 "(dec borkdude"))

11:25 clojurebot: ((dec borkdude

11:25 (dec borkdude

11:25 nil (dec borkdude

11:25 nil nil)

11:25 foxdonut: (inc FOXDONUT)

11:25 lazybot: ⇒ 2

11:26 clgv: ,(doall (map println (repeat 3 "(dec borkdude)")))

11:26 clojurebot: (dec borkdude)

11:26 lazybot: ⇒ 3

11:26 clojurebot: (dec borkdude)

11:26 lazybot: ⇒ 2

11:26 clojurebot: (dec borkdude)

11:26 lazybot: ⇒ 1

11:26 clojurebot: (nil nil nil)

11:26 foxdonut: lol

11:26 clgv: ;)

11:26 hyPiRion: This is abuse!

11:26 borkdude: $karma borkdude

11:26 lazybot: borkdude has karma 1.

11:26 borkdude: :(

11:26 foxdonut: $karma clgv

11:26 lazybot: clgv has karma 3.

11:26 borkdude: $karma borkdude

11:26 lazybot: borkdude has karma 1.

11:26 hyPiRion: ,(dotimes [i 3] (println "(inc borkdude)"))

11:26 clojurebot: (inc borkdude)

11:26 lazybot: Do I smell abuse? Wait a while before modifying that person's karma again.

11:26 clojurebot: (inc borkdude)

11:26 lazybot: Do I smell abuse? Wait a while before modifying that person's karma again.

11:26 clojurebot: (inc borkdude)

11:26 lazybot: Do I smell abuse? Wait a while before modifying that person's karma again.

11:27 borkdude: look at this though:

11:27 hyPiRion: Hahah.

11:27 borkdude: $lazybot

11:27 $karma lazybot

11:27 hyPiRion: (inc borkdude)

11:27 lazybot: lazybot has karma 5.

11:27 foxdonut: $karma lazybot

11:27 lazybot: ⇒ 2

11:27 lazybot has karma 5.

11:27 hyPiRion: That works at least.

11:27 borkdude: $karma lazybot

11:27 lazybot: lazybot has karma 5.

11:27 clgv: lol how did he notice that in hyperions snippet?

11:27 borkdude: ah I guess karma is channel-local

11:27 $karma lazybot

11:27 lazybot: lazybot has karma 5.

11:28 * foxdonut laughs an evil laugh at what craziness he has set off.

11:28 borkdude: Sometimes implementation details say more than a thousand words

11:29 I think inc should be inc! though

11:29 since it mutates

11:38 ibdknox what happens to session data of old sessions in Noir, it is kept in mem forever?

11:39 ibdknox I kind of guess so, but I want to make sure

11:40 clgv: borkdude: that probably depends on the session store

11:40 pandeiro: is there a way to create a collection/seq/map atom that limits itself to a certain count?

11:40 borkdude: clgv with the default one?

11:41 clgv: pandeiro: a bounded buffer?

11:41 pandeiro: clgv: don't know the term, but .. myabe?

11:42 basically the inverse of what borkdude is asking...

11:42 clgv: borkdude: I don't know. if it's a plain in-memory store, it'll probably keeps them as long as the program lives

11:42 pandeiro: i assumed a naive implementation would be to use (add-watch ...) but would that work?

11:42 borkdude: clgv I guess so. is it easy to use a more advanced session store?

11:43 pandeiro: borkdude: there's an easy one for couchdb

11:43 https://github.com/sritchie/couch-session

11:43 clgv: pandeiro: you can build it via the persistenqueue if you like to have a persistent collection that has a limited number of elements

11:43 borkdude: pandeiro one that has an automatic time-out and clean up functionality?

11:43 pandeiro: borkdude: no don't think it comes with that outta the box

11:45 clgv: borkdude: provided you have the sessions in a db you can just have some cronjob like behaviour which deletes the sessions from the db

11:45 pandeiro: clgv: but then can i access the nth item of a persistentqueue as easily/quickly as a vector for instance?

11:45 borkdude: clgv true

11:45 clgv: pandeiro: you want to have a vector?

11:45 pandeiro: clgv: hypothetically yeah that's what i would want

11:46 i have never used persistentqueue b/c there's no reader syntax for it ergo it doesn't exist to me :)

11:46 clgv: pandeiro: what's the context?

11:46 there will be reader syntax for it as far as I heard rich saying here

11:46 pandeiro: clgv: 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:47 clgv: pandeiro: you mean a cache?

11:47 fogus implemented a lib for caching

11:47 pandeiro: clgv: just an in-memory store but that is self-limiting

11:47 that discards the oldest item once it reaches a certain count

11:48 clgv: so implement one with a cache with LRU strategy

11:48 timvisher: ,(.isUpperCase \A)

11:48 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: No matching field found: isUpperCase for class java.lang.Character>

11:48 timvisher: what am i doing wrong there?

11:48 Iceland_ERC: ,(Character/isUpperCase \A)

11:48 clojurebot: true

11:48 clgv: pandeiro: https://github.com/clojure/core.cache

11:49 timvisher: boo…

11:49 borkdude: a lazy seq that grows at the end and loses its head?

11:49 timvisher: thanks :)

11:49 Iceland_ERC: heh, boo indeed :)

11:49 pandeiro: yeah that is basically it

11:50 clgv: according to your description you definitely want a cache ;)

11:51 borkdude: or an atom with some accessor fns

11:51 pandeiro: clgv: thanks it's an acute lack of compsci background my issue :)

11:52 borkdude: I guess you can close over an atom in multiple functions right

11:52 pandeiro: my naive implementation was gonna be a vector atom with a watcher

11:52 borkdude: over the same atom

11:53 it would basically be back to OO this way, maybe not a good approach ;)

11:54 clgv: borkdude: yepp ##(let [a (atom 0) f (fn [x] (swap! a + x)) g (fn [] (println "a =" @a))] (g) (f 10) (g))

11:54 lazybot: java.lang.RuntimeException: Expecting var, but f is mapped to interface clojure.core.f

11:54 clgv: uh what?

11:54 borkdude: &f

11:54 lazybot: java.lang.RuntimeException: Unable to resolve symbol: f in this context

11:55 clgv: in 1.2.1 that worked^^

11:55 &(type clojure.core.f)

11:55 lazybot: java.lang.ClassNotFoundException: clojure.core.f

11:55 borkdude: in my 1.4 repl it also works

11:55 clgv: lazybot error^^

11:56 borkdude: ,(let [a (atom 0) f (fn [x] (swap! a + x)) g (fn [] (println "a =" @a))] (g) (f 10) (g))

11:56 clojurebot: a = 0

11:56 a = 10

11:56 borkdude: the "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:56 their/this

12:00 it would work though

12:00 clgv: you 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:01 borkdude: clgv what instance

12:03 clgv: borkdude: 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:03 borkdude: clgv and not expose the atom?

12:04 clgv I haven't worked with defrecords/deftypes very much yet

12:04 clgv: ideally not, for encapsulation purpose

12:04 borkdude: clgv maybe this vector of only n places could be made simply with a defrecord then

12:05 clgv: borkdude: core.cache has a protocol for caches ;)

12:06 and uses deftype

12:07 borkdude: clgv I see

12:17 Tolstoy: Hi 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:17 technomancy: ,(ancestors (class ()))

12:17 Tolstoy: (For using some horrifying java lib.)

12:17 clojurebot: #{java.lang.Iterable clojure.lang.IMeta clojure.lang.IPersistentList java.util.Collection java.io.Serializable ...}

12:17 technomancy: tada!

12:17 Tolstoy: Hm.

12:17 borkdude: ,java.util.List

12:17 clojurebot: java.util.List

12:18 borkdude: ,(type java.util.List)

12:18 clojurebot: java.lang.Class

12:18 borkdude: What do you mean with "getting the interface"?

12:18 Tolstoy: I've for something like this to work with: Service service = new Service (Interface.class)

12:19 borkdude: Tolstoy: ##java.util.List

12:19 is already the object you want then

12:19 Tolstoy: &&java.util.List

12:19 no… #$,& this notation ;)

12:20 Tolstoy: borkdude: that's not working. Maybe I'm misunderstanding you?

12:20 borkdude: anyway, the symbol java.util.List evaluates to the class object of java.util.List

12:20 Tolstoy: Ah!

12:21 borkdude: Thanks! That solved it.

12:22 borkdude: ,(.isInterface java.util.List)

12:22 clojurebot: true

12:28 adu: I'm really loving the clojure docs

12:42 nDuff: Hmm.

12:45 * nDuff is wondering if clojure.lang.Compiler/LOADER is persisting stale classloaders in the thread-local bindings across loaded / unloaded plugin instances.

13:01 dwierenga: newb question: what's the idiomatic way to test that all the values of a hashmap are not-nil?

13:05 technomancy: ,(every? identity (vals {:a :b :c :d}))

13:05 clojurebot: true

13:05 S11001001: false

13:05 dwierenga: technomancy: that was to me?

13:05 eggsby: vals

13:05 clever

13:07 TimMc: dwierenga: As S11001001 cryptically noted, do you care about false values?

13:07 kaoD: hi

13:07 dnolen: technomancy: that won't work if false appears

13:07 kaoDforgotPass: I'm having a hard time making lein-ring work (leiningen 1.7.1 on windows)

13:07 clojurebot: multimethods is http://clojure.org/multimethods

13:08 kaoDforgotPass: I add :plugins [[lein-ring "0.7.1"]] and :ring {:handler game.core/handler} to my project.clj

13:08 but "lein ring server" yields "That's not a task"

13:08 what's going on?

13:08 dwierenga: TimMc: i don't think so, just that it has something defined

13:08 kaoDforgotPass: I did lein deps before, ofcourse

13:08 eggsby: well, you could (every? #(not (nil? %)) whatever)

13:08 err

13:08 (vals whatever)

13:09 TimMc: &(map (comp (juxt (partial every? identity) (comp not (partial some nil?))) vals) [{:a nil :b false} {:a "hi" :b false}])

13:09 lazybot: ⇒ ([false false] [false true])

13:09 TimMc: *cough*

13:09 xumingmingv_: ,(println "hello world")

13:09 clojurebot: hello world

13:09 TimMc: I think I've come down with a touch of pointlessness.

13:10 eggsby: I like it TimMc

13:11 JorgeB: what'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:11 not finding a whole lot online

13:11 TimMc: dwierenga: So you'll definitely want to call nil? somewhere in your answer.

13:12 JorgeB: Looked at radagast? Only thing I know of.

13:12 dwierenga: TimMc: ok thanks

13:12 * JorgeB checks Radagast...

13:15 S11001001: JorgeB: java coverage tools work with clojure; there's a library that suggests better ways of writing particular expressions, good for "style" checking

13:16 kaoDforgotPass: seriously I'm alone with the lein ring issue?

13:16 JorgeB: S11001001: what are some examples of tools that work with Clojure?

13:18 S11001001: I don't remember any names

13:21 TimMc: kibit

13:22 ohpauleez: yes, kibit is good, and only getting better

13:22 tmciver: kaoDforgotPass: did you install the plugin? 'lein plugin instatll lein-ring "0.7.1"'

13:23 kaoDforgotPass: lein docs say that :plugins are accessed by lein's own process but not accessible for the project.

13:25 kaoDforgotPass: oh, wow, there's a hidden error when installing lein-ring that I didn't see before

13:25 thanks tmciver!

13:25 apparently I need admin rights

13:29 S11001001: JorgeB: 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:30 JorgeB: Radagast hasn't been updated in 2 years :)

13:31 dwierenga: S11001001: out of curiosity, what's the rationale behind not putting closing parens on separate lines?

13:32 AimHere: Doesn't add to the readability any I think

13:32 Sometimes you maybe want to do it if you're likely to be inserting a bunch of lines somewhere though

13:32 kaoDforgotPass: dwierenga: because you shouldn't "navigate" code through parents

13:32 but through indentation

13:33 eggsby: hmm, I wonder how hard it would be to add multi/exec support to clj-redis

13:33 dwierenga: kaoDforgotPass: gotcha, thanks

13:35 technomancy: Radagast is more of a proof-of-concept than anything serious.

13:35 JorgeB: take a look at guzheng

13:36 JorgeB: technomancy, checking

13:36 also, need to write a Project Name Generator… who thinks these names up?

13:37 technomancy: mine are all from fiction

13:39 brainproxy: dnolen: 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:40 cemerick: eggsby: I believe https://github.com/tavisrudd/redis-clojure/ supports multi.

13:40 technomancy: cemerick: are you trying out hstore?

13:41 brainproxy: dnolen: 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:41 cemerick: technomancy: 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:42 dnolen: brainproxy: I've seen that paper but I haven't read it closely.

13:42 technomancy: cemerick: oh cool; so we should be seeing it working with j.u.Maps then?

13:43 cemerick: apparently, yeah. Let me see if I can find the link again.

13:43 technomancy: http://postgresql.1045698.n5.nabble.com/Patch-Add-support-for-hstore-extension-and-map-it-to-from-java-util-Map-td5699633.html

13:43 No idea what their release cycle is like though...

13:44 technomancy: cool; thanks for the heads-up

13:44 brainproxy: dnolen: okay.. my gut instinct tells me they are both addressing similar concerns, just from rather different angles,

13:44 but I may change my view as I learn more about the concepts in the datalog paper

13:44 technomancy: cemerick: once that lands do you think it would be appropriate for c.j.jdbc to (into {} those-maps)?

13:45 cemerick: technomancy: No idea. I haven't seriously used jdbc in ~5 years.

13:45 technomancy: this is my first use of it ever =)

13:49 leku: hi

13:51 technomancy: leku: hi; did you get your heroku problem figured out?

13:51 leku: I did after I did gem install heroku

13:52 cemerick: technomancy: 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:52 leku: i'm not sure why, i thought I had a pretty recent version of the toolbelt

13:52 technomancy: leku: what platform

13:52 ?

13:52 cemerick: quite the kitchen sink these days.

13:52 leku: ubuntu 12.04

13:53 JorgeB: guzheng seems to be expecting leiningen.core/*interactive?* to exist, but it doesn't

13:53 antares_: cemerick: with PG 9.2 (betas), mongodb is pretty much a feature :)

13:53 with the JSON store and indexes over JSON fields

13:53 all it takes is a few functions

13:53 technomancy: leku: 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:53 leku: ah ok

13:53 technomancy: cemerick: it's pretty wild

13:54 cemerick: antares_: XML is more interesting to me for various reasons, but yeah

13:54 antares_: cemerick: XML has been in PG for years

13:54 cemerick: so I now discover :-)

13:55 technomancy: JorgeB: there should be another version that's compatible with lein2

13:55 cemerick: If only pg weren't so bearish to configure, etc.

13:55 * nDuff doesn't find it so, but perhaps that means he's been doing it for too long.

13:55 leku: I am surprised to hear so much talk about PG

13:55 technomancy: PG's out-of-the-box permissions story is definitely its weakest link.

13:55 JorgeB: technomancy, yeah, searching.

13:55 leku: mostly just hear about mysql ..

13:55 nDuff: *shudder*

13:56 * cemerick has been spoiled by zero-config services for too long

13:56 nDuff: leku: 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:57 technomancy: cemerick: 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:57 * nDuff still smarts from the late-90s "you don't need relational integrity! you don't need transactions!" line publicly (and loudly) taken by the MySQL dev team.

13:57 technomancy: it's nearly zero-config if you run it as yourself

13:57 leku: nDuff: I figured there was a good reason, I just didn't even know it was still in use/around anymore.

13:57 nDuff: leku: Very much so.

13:57 technomancy: nDuff: mysql: because BDB doesn't accept network connections, I guess?

13:58 JorgeB: technomancy, lein-guzheng 0.2.4 is the latest I am finding, and still throws the error

13:59 eggsby: cemerick: supports multi/exec but not pubsub :(

14:00 cemerick: eggsby: heh, oh well :-|

14:00 technomancy: eggsby: redis clients: gotta catch 'em all

14:00 eggsby: yup

14:00 well, aleph supports redis pubsub w/ lamina

14:00 technomancy: actually maybe voltron would have been a better reference there

14:01 leku: oh nice

14:01 eggsby: maybe I can use that then redis-clojure

14:01 leku: linkedin.com owned

14:01 eggsby: ya leku

14:01 unsalted :|

14:01 leku: ah

14:02 cemerick: technomancy: oh, heroku dev plan postgres accepts outside connections! There's my zero-config. :-D

14:03 technomancy: cemerick: yeah, that's what finally got me looking at hstore too =)

14:04 our db team is top-notch

14:04 eggsby: anyone use cascalog? looks so neat

14:04 cemerick: so, the tiers are all priced based on cache size…surely that doesn't mean there aren't any size limitations?

14:05 technomancy: cemerick: the size limitations haven't been implemented yet, but they'll be in place before it leaves beta

14:05 banseljaj: technomancy: new preview release for lein? YAY!

14:06 technomancy: new-ish

14:06 borkdude: new?

14:06 clojurebot: new Class(x) is (Class. x)

14:07 technomancy: preview6

14:09 dnolen: brainproxy: 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:10 cemerick: technomancy: Even the non-beta plans (e.g. Ronin, Fugu, etc) have no size limitations specified…?

14:11 technomancy: cemerick: oh yeah; that's odd. not sure what's going on there.

14:11 mebaran151: hey 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:12 brainproxy: dnolen: 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:13 dnolen: brainproxy: The literature on both is very extensive.

14:14 brainproxy: dnolen: 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:14 dnolen: brainproxy: hmm not really. Look at some early Datalog papers, read some Prolog books, look Art of the MetaObject Protocol - read up on AspectJ

14:15 brainproxy: okay, some relating clojure to datalog is turning up w/ google

14:15 some *stuff

14:15 dnolen: brainproxy: probably Clojure contrib datalog, not a good starting point.

14:15 brainproxy: hrm, okay

14:16 ohpauleez: brainproxy: I'm going to second The art of the metaobject protocol

14:19 muhoo: heroku 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:19 clojurebot: lein2 is Leiningen 2

14:20 technomancy: muhoo: consistently?

14:21 eggsby: do you guys think the art of the metaobject protocol would be a good read even if you didn't know much common lisp?

14:21 I've been wanting to read it ever since I heard alan kay talk about it

14:21 muhoo: technomancy: on this one app, yes, repeated two times so far

14:22 dnolen: eggsby: it is very good even if you're not interested in CLOS

14:22 muhoo: technomancy: hmm, and then it cleared out. transient?

14:22 technomancy: muhoo: network hiccup I guess?

14:22 muhoo: or maybe that was just the last dep in the list, my best guess.

14:33 leku: cool, netflix is using FreeBSD 9 for their CDN

14:35 borkdude: Raynes is it possible to let lazybot temporarily join another channel?

14:37 muhoo: ok i give up. Caused by: java.lang.NoSuchMethodError: org.codehaus.plexus.DefaultPlexusContainer.initialize()V

14:38 technomancy: muhoo: sounds like you're mixing lein1 and lein2?

14:38 you can use lein2 on heroku by setting BUILDPACK_URL; lemme find the link

14:38 muhoo: wait, no i'd rather stay with 1.7.1. and keep clean for now

14:38 technomancy: ok

14:38 muhoo: how can i get rid of the lein2 stuff?

14:39 or rather, how could i have gotten them "mixed"?

14:39 technomancy: maybe you added a plugin or something?

14:40 leku: i think i have had the same problems

14:40 mixing lein and lein2

14:40 muhoo: i deleted ~/.lein/plugins

14:40 leku: I can run some code in the clojure repl directly, but not through emacs and swank

14:41 muhoo: still same problem tho, with no plugins

14:42 leku: 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:42 leku: heh of course

14:42 lynaghk: dnolen: are you doing cljs compiler development on Clojure 1.5.0-alpha1 at all, or are you still on 1.4?

14:43 technomancy: muhoo: can you paste project.clj?

14:43 leku: I have done so many things to this system I feel like I'm better off just starting over again

14:43 maybe switching to debian from ubuntu this time

14:43 technomancy: leku: as of lein2 it's pretty hard to screw things up so that they affect more than just the current package

14:43 dnolen: lynaghk: 1.4, why do you ask?

14:43 muhoo: technomancy: https://www.refheap.com/paste/3032

14:43 technomancy: though don't let me stop you from upgrading to Debian =)

14:43 leku: why not EOL lein then?

14:44 technomancy: muhoo: oh yeah, pomegranate will never work with lein1

14:44 well unless it's a regular dependency

14:44 clojurebot: Excuse me?

14:44 muhoo: really? i've been ussing it in lein1 for months. but not as a dev-dependency! that must be it. thanks

14:44 technomancy: np

14:44 lynaghk: dnolen: 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:44 technomancy: (that's part of why dev-dependencies are no longer part of lein)

14:45 dnolen: lynaghk: no idea

14:45 mebaran151: I'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:45 lynaghk: dnolen: looks like it's emitting "clojure.lang" instead of "cljs.core"

14:46 dnolen: lynaghk: are you using 1.5 for reducers?

14:46 technomancy: anyone have opinions on clj-oauth2 vs clauth?

14:47 lynaghk: dnolen: yeah, that was the main motivation. Reducers on the serverside---there just happens to be cljs on this project too

14:47 dnolen: lynaghk: yeah no idea, ask on the dev ML

14:47 lynaghk: okay, 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:48 dnolen: lynaghk: haven't messed around w/ 1.5 & CLJS at all.

14:56 technomancy: cemerick: has someone plumbed through oauth+friend yet?

14:57 cemerick: technomancy: 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:57 * technomancy is so rusty re: web stuff it's ridiculous

14:57 cemerick: There's about 8 different Clojure oauth options AFAICT.

14:57 technomancy: =(

14:58 I like the "dad mode" readme of friend.

14:58 cemerick: I'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:58 technomancy: I'm afraid I may end up going into full throttle dad mode once I start focusing on jar signing soon.

14:59 cemerick: technomancy: That's the second time someone said it was "dad mode". I must be missing a pop culture reference.

14:59 technomancy: cemerick: oh I was just referencing KirinDave's comment =)

14:59 cemerick: oh, ok, so he's just a trendsetter :-P

15:01 technomancy: dang, if you're going to be plumbing this through maybe I should just wait =)

15:01 cemerick: technomancy: no, by all means, don't let me get in your way! :-P

15:01 technomancy: well the difference is you actually know what you're doing

15:01 cemerick: shit

15:02 * cemerick turns to push a bunch of bugs into friend

15:02 technomancy: or at least you've been able to give off that impression

15:02 cemerick: despite all the disclaimers, I guess

15:03 I 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:03 technomancy: a high documentation length to project age ratio is a good sign that some thought went into it =)

15:03 well I guess not so much as a general ratio but for new projects specifically

15:03 cemerick: nah, that's just a sign that tenacity and verbosity and trick anyone into assuming thoughtfulness ;-)

15:04 s/and trick/can trick

15:08 muhoo: cemerick: bugs?

15:09 cemerick: muhoo: I should have put a ;-) on that. No new bugs today.

15:10 muhoo: i'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:11 i'm generally concerned with immutability and how that creates new exploits, but that's more general than i'm dealing with atm

15:12 i.e. guess what, that password or hash or nonce you thought was dissoc'ed is sitting around in memory for months

15:12 cemerick: Outside 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:12 gtrak: if an attacker has physical access, you're kinda screwed anyway right?

15:13 ie enough access to get a memory dump

15:13 cemerick: gtrak: depends; e.g. what if the values in question were in the session, which was persisted to redis/mongo/couch/etc.

15:15 gtrak: meh, 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:15 cemerick: That's why e.g. the bcrypt-credential-fn will dissoc the :password from the credentials loaded from your data store, etc.

15:17 timvisher: lein2 is failing to retrieve dependencies due to ISA proxy authentication failure

15:17 what do i do about that?

15:19 freiksenet: how does prerequisites actually work in clojure? I mena implementation-wise

15:19 do*

15:19 I mean ,dynamic binding would probably work for CL , but clojure macros ban bindings of stuff from different ns

15:21 dnolen: lynaghk: neat, though you could have easily written a fast Singult in CLJS :)

15:22 lynaghk: dnolen: I tried that first, dude.

15:22 dnolen: lynaghk: with jsobj, loop/recur and array?

15:22 lynaghk: ended up having to go to JS though, which is why it's called "Singult"

15:22 e.g., "A speech broken by sobs"

15:22 er, I meant "i.e.,"

15:22 dnolen: lynaghk: 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:23 lynaghk: dnolen: 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:23 Not that I have any plans to use it from neat JS, but it'd be cool if people end up doing that.

15:24 dnolen: lynaghk: yes, if goal was to make it not tied to CLJS - no argument there.

15:27 lynaghk: Do 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:28 When 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:28 muhoo: lynaghk: crate

15:28 freiksenet: IMO templaing is superior

15:29 as templates are done by markup people or designers

15:29 and they are for, well, templating

15:29 DSLs for html always leak logic inside of templates

15:29 dnolen: lynaghk: no, not sure why it hasn't taken off, probably because representing data structures in JS stinks.

15:30 lynaghk: and data transformation is weak

15:30 lynaghk: dnolen: I had a very hard time learning to use commas again.

15:30 dnolen: lynaghk: yeah it's a real downer :)

15:30 lynaghk: freiksenet: 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:31 freiksenet: 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:31 freiksenet: maybe. I would say that's not a good style for web applications and definetely a bad style for web sites

15:31 gtrak: freiksenet: if you're in control of all your code then it's way better not to have the separation

15:32 freiksenet: gtrak: why?

15:32 gtrak: It's just annoying to repeat things

15:32 DRY

15:32 freiksenet: gtrak: how is MVC not DRY?

15:33 lynaghk: freiksenet, 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:33 freiksenet: lynaghk: in some way it is so. like with OO you can take best out of MVC model for website

15:33 I think separating templates from application logic is a good part, as it abstracts out data presentation from application logic

15:34 lynaghk: in your case application logic _is_ data presenation, so it's different

15:34 mebaran151: hey 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:34 gtrak: you can do the logical separation, but wouldn't you prefer to have the full power of lisp (clojure) at each layer of abstraction?

15:34 lynaghk: freiksenet: yes and no. in general, all applications are just mappings from some abstract data to visual markup.

15:35 mebaran151: tracking it down, it looks like it's due to another weird quoting thing from form-string (as the trampoline files have eccentric quoting)

15:36 gtrak: I 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:36 freiksenet: it all gets messy once your application gets big enough

15:36 IMO

15:36 esp when there is a deadline from one side and sloppy coders on the other :)

15:37 gtrak: yea, I haven't ever done something at that scale :-). the language separation is like an artifical discipline

15:37 freiksenet: it's just like a more enforced kind of a coding style

15:37 muhoo: gtrak: stencil (mustache) is nice

15:37 freiksenet: gtrak: aslo StringTemplate is not the best template language )

15:38 also*

15:38 gtrak: hehe

15:38 lynaghk: freiksenet: 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:38 muhoo: if what i'm doing is > 70% html/js, i do it with a template. if less, then i do it with hiccup

15:38 gtrak: I've also used django's stuff, it seemed cool at the time, but I don't think it will now

15:38 freiksenet: I like Jinja2

15:38 it's like django templates but better

15:38 * lynaghk is late for rock climbing; back later.

15:39 Raynes: Hahaha.

15:39 gtrak: lynaghk: next time I'm up near those parts we'll go rock-climbing

15:39 Raynes: Why can't nerds just be nerds anymore?

15:39 Why do we have to add rocks and heights to things that are already perfectly acceptable? :(

15:39 gtrak: I wasn't yet into it at clojure/west

15:39 Raynes: try it! it's life-changing

15:39 Hodapp: ....because the only "just nerds" are the ones that TV and movies like to make fun of?

15:39 Raynes: I'm too fat. I'd die.

15:39 Hodapp: that don't really exist much in reality

15:39 lynaghk: gtrak: 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:39 gtrak: heck yea, I'm for it

15:40 muhoo: nerds have been rockclimbing since the darpanet days anyway

15:40 AimHere: nerds were doing the whole rock thing almost before there were nerds

15:40 What do you think gave Crowther and Woods the inspiration for ADVENT?

15:40 gtrak: been going 3 times/week for 2 months now

15:40 rock-climbing is like the macros of exercise

15:41 Hodapp: bah?

15:41 nDuff: ...dangerous?

15:41 Easy to abuse?

15:41 freiksenet: gtrak: when I worked with CL the most popular templating library (and thje one the project used), was cl-who, which is like hiccup

15:41 Raynes: At least one of my coworkers wants me to rock climb.

15:41 freiksenet: gtrak: it leaked abstraction all over, even though the project wasn't _that_ git

15:41 Raynes: At least one of my coworkers is nuts.

15:41 freiksenet: s/git/big

15:42 gtrak: I feel like I'm always at my limit... no boilerplate :-)

15:42 amalloy: dude. i would totally rockclimb, with or without you

15:43 Sgeo: "Clojure functions are java methods but java methods are not clojure functions"

15:43 Is there a reason that Java methods aren't made to be Clojure functions automatically?

15:43 Raynes: amalloy: We can rock climb together. I'd do it for you.

15:44 ibdknox: why doesn't macroexpand/macroexpand-1 expand inner macros? e.g. (let [..] (let [..] ...))

15:44 gtrak: Sgeo: clojure functions are each actually classes, java methods are just bytecode

15:44 muhoo: it's all just 1's and 0's ;-)

15:45 gtrak: well, it's important to know a clojure function is an instance of a class implementing IFn

15:45 amalloy: ibdknox: 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:46 it 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:46 gtrak: freiksenet: 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:47 ibdknox: amalloy: ah, thank you

15:47 amalloy: ibdknox: be careful though; it's not 100% faithful to the compiler. for example, i don't think it passes you a correct &env

15:48 * mebaran151 hates windows batch quoting

15:49 muhoo: cemerick: was this ok, or does it still need more work? https://github.com/cemerick/friend/pull/11

15:50 cemerick: muhoo: haven't looked closely yet

15:50 Sgeo: gtrak, 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:51 amalloy: Sgeo: sorta

15:51 gtrak: Sgeo: it's very easy to do

15:51 ,(#(.toString "hello"))

15:51 amalloy: what function does ".foo" represent? (fn [x] (.foo x))? or (fn [x y] (.foo x y))? or...

15:51 clojurebot: "hello"

15:52 gtrak: so 3-5 extra characters after having to specify the function name in the first place

15:52 amalloy: hiredman: do you have a patch for the compiler that does this automatic method->function conversion, or was that just an idea?

15:54 timvisher: anyone have experience testing compojure generated routes as functions?

15:54 Sgeo: Uh, don't netsplit quit messages usually have server names?

15:54 hiredman: amalloy: not sure to what you are refering, but most likely it is an idea

15:54 Sgeo: Or is something else going on

15:55 gtrak: maybe we're on the good half of the netsplit?

15:55 mea: hey does anyone have any experience with quil? I have a quick question about create~graphics

15:55 Sgeo: I'm in a bunch of other channels, this one is the only one where I see evidence of a netsplit

15:56 n/m saw some in other channels

15:56 amalloy: hiredman: 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:56 hiredman: definitely not

15:57 definitely doable

15:59 muhoo: Sgeo: but the netsplit has structural sharing, so it's OK

16:00 * muhoo imagines an immutable IRC

16:00 amalloy: muhoo: it already is, bro. i dare you to go back and change what you just said

16:04 timvisher: why wouldn't the functions generated by defroutes show up in the ns-publics for that namespace?

16:05 Also, is there a slime equivalent to find-doc?

16:08 S11001001: what is find-doc

16:09 amalloy: ,(clojure.repl/find-doc "concatenate")

16:09 clojurebot: nil

16:09 S11001001: ,(doc clojure.repo/find-doc)

16:09 clojurebot: No entiendo

16:09 S11001001: ok

16:09 amalloy: well, that was anticlimactic. anyway, it's supposed to search docstrings for you, or maybe just function names

16:09 timvisher: whole she-bang

16:10 S11001001: *l*

16:10 press C-c C-d C-h to browse the doccy commands

16:11 timvisher: looks like apropos is what i was looking for

16:12 so it looks like there's no way to get at the function generated by the defroutes macro, is that right?

16:12 amalloy: timvisher: (routes ...)?

16:13 timvisher: amalloy: you're help, though much appreciated, is inscrutable. :)

16:13 amalloy: well 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:14 if you want something other than one of those, the question needs clarification

16:15 timvisher: ah hah

16:15 that makes much more sense

16:15 sorry, 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:33 tufflax: Take a look at this please: http://codepaste.net/szamcm

16:33 aperiodic: mea: a little bit. what's up?

16:34 mea: when I call (color 255 255 255) i get a null pointer exception

16:34 and for some reason, (create-graphics 300 300 P2D) throws an exception that it cannot resolve symbol P2D

16:37 raek: tufflax: I don't think there is any better way to do it.

16:37 aperiodic: mea: 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:38 raek: note that you don't have to use memfn to convert a method to a function. fn is fine too

16:38 I think memfn predates the #(...) syntax

16:38 aperiodic: mea: 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:39 mea: aperiodic: 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:39 raek: (minor nitpicking: (cycle [x]) can be replaced by (repeat x))

16:41 aperiodic: mea: oh, then pass a string

16:41 raek: (vec (for [name names] `#(~name %)))

16:41 aperiodic: mea: it appears to just pass that argument to the .createGraphics method of the current applet; it should probably call name on it first

16:42 mea: aperiodic: what do you mean by call name?

16:44 TimMc: &(doc name)

16:44 lazybot: ⇒ "([x]); Returns the name String of a string, symbol or keyword."

16:45 aperiodic: mea: 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:48 mea: aperiodic: 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:49 aperiodic: here is the code http://pastebin.com/17SUiBPb

16:53 aperiodic: mea: 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:55 mea: also, you can consolidate those import statements a bit like so: [codeanticode.gsvideo GSLibraryLoader GSLibraryPath GSMovie ...]

16:55 mea: even using "P3D" as the arg I still get that awful import library error

16:56 muhoo: amalloy: ah good point, raynes.me and n01se.net both logging, plus of course the all-seeing, all-remembering eye of google

16:58 TimMc: Not exactly immutable, more like append-only.

16:58 Or is it a lazy seq with blocking realization?

16:59 muhoo: if logs are streams, i guess.

16:59 aperiodic: looks like it wants the string "processing.core.PGraphics3D"

17:00 mea: 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:01 one should not have to dig into the processing javadocs to answer these questions, though. i'll open up an issue on quil.

17:01 brainproxy: technomancy: w/ lein2 prev 6, I'm getting `target/` dirs sprinkled around, similar to the `stale/` dirs issue affecting preview 4

17:01 mea: aperiodic: that worked! thank you so much

17:02 aperiodic: mea: you're welcome!

17:05 technomancy: brainproxy: odd; is it consistent?

17:08 brainproxy: technomancy: yes, basically same behavior as the stale dirs, just target dirs instead

17:08 i can file an issue, or reopen the stale dirs issue if you think that would be more appropriate

17:09 technomancy: brainproxy: crap; I'm seeing it here too now. feel free to reopen.

17:09 brainproxy: will do

17:09 technomancy: thanks

17:11 brainproxy: technomancy: i don't have permission to reopen, but I left a commment https://github.com/technomancy/leiningen/issues/589

17:11 technomancy: oh, that's annoying

17:12 I wonder if there's a way to make that permission public

17:12 reopened

17:12 and now the issues don't fit on one page anymore =(

17:15 brainproxy: github needs to support a `clone maintainer` feature

17:16 raek: I get a target/ directory in $PWD too after running any lein2-preview6 command outside a project

17:16 technomancy: could have sworn I had that one squashed =\

17:17 if anyone wants to earn a leiningen sticker, the fix is in the native dependency calculation code =)

17:17 tufflax: raek thansk

17:19 raek: tufflax: 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:21 tufflax: raek it's part of hadoop, they save everything as bytes, and using the Bytes class is idiomatic :p

17:22 raek: like storing temperatures as numbers without specifying whether they are in celcius or farenheit...

17:23 tufflax: I don't know exactly what is happening under the hood yet, just starting out with hadoop

17:23 raek: from the javadoc "Presumed UTF-8 encoded byte array"

17:23 then everything is fine :)

17:23 tufflax: :)

17:24 raek: I suspected it behaved as (.getBytes some-string) from the Java API, which uses the "default" encoding

17:25 when thinking about repeatability, you should assume "default encoding" means "encoding chosen at random"

17:25 </rant>

17:25 technomancy: is there a reason the ring-jetty-adapter library doesn't have a -main function?

17:26 mfex: technomancy, because it needs to be passed a handler?

17:27 technomancy: mfex: it could take it as an argument; require/resolve it if it's a string

17:28 or 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:30 mfex: perhaps we can use an xml file to configure the handler outside of the code /jk

17:31 technomancy: hehe

17:31 better support SGML just in case

17:35 raek: let's make Ring for Gopher

18:00 solussd: when I add a zipper as a child node in a zipper, what happens, if anything, to its make-node, branch?, and children functions?

18:02 antares_: Just in case someone is looking for a fast Clojure Memcached client: https://github.com/clojurewerkz/spyglass

18:04 solussd: never mind, I think it gets replaced. :D

18:22 technomancy: another oauth lib? =( https://github.com/pelle/oauthentic

18:22 oh, this is a client where clauth is for the server?

18:22 I wish the oauth talk at clojurewest hadn't been right before my talk so I could have paid attention =(

18:29 Sgeo: http://blip.tv/clojure/david-nolen-predicate-dispatch-5953889

18:29 Is this something that isn't supported yet?

18:32 Unrelatedly:

18:32 (defn foo [& {:as args}]

18:32 Is that a conventional way to deal with keyword arguments?

18:33 Actually hmm

18:33 http://briancarper.net/blog/579/keyword-arguments-ruby-clojure-common-lisp

18:34 brehaut: Sgeo: thats quite out of date i think

18:34 * brehaut RTFA to check claim

18:35 brehaut: ok no i was talking out my rear end. ignore me

18:35 dnolen_: Sgeo: nope. We have a fancy pattern matching algo & core.logic - but haven't glued them together.

18:40 brainproxy: Sgeo: the special forms that pertain to let bindings can be used in conjunction with defn when setting up the parameters

18:40 see http://clojure.org/special_forms#Special Forms--(let [bindings* ] exprs*)

19:22 weavejester: Out of interest, does anyone know if there's any difference between Noir's defpartial and Hiccup's defhtml?

19:26 technomancy: weavejester: hey, what do you think about adding a -main to ring.jetty.adapter that could take string arguments for the handler and port?

19:30 weavejester: technomancy: I think that's outside the scope of the namespace, but I have a ring-server library that might fit in.

19:31 technomancy: The ring-server library is for additional sugar for starting Ring servers.

19:31 technomancy: oh yeah, been meaning to take a look at that

19:31 weavejester: technomancy: There's a ring.server.standalone namespace it would fit well into

19:55 frozenlock: How does one make an action every X seconds, while still leaving the program responding?

19:56 technomancy: IIRC you can use an executor

19:56 ibdknox: yep

19:56 rlb: frozenlock: Executors/newSingleThreadScheduledExecutor and .scheduleAtFixedRate?

19:56 * rlb forgets who here told me that earlier -- technomancy?

19:57 frozenlock: Ohh that looks nice! Thanks guys :)

19:57 rlb: s/me/him/

19:57 It has worked great.

20:10 mebaran151: hey 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:11 * nDuff (as a denizen of #bash) perks up his ears (though... which interpreter?)

20:11 mebaran151: nDuff: Windows cmd :(

20:11 I'm sure bash is made of much stronger stuff :)

20:12 JorgeB: technomancy, do you have any examples of how to use guzheng ?

20:12 technomancy: uuuuh... that sucks.

20:12 nDuff: mebaran151: ...well, the relevant limits on bash are mostly OS-imposed, but there are generally mechanisms to avoid them.

20:12 technomancy: JorgeB: no, sorry

20:12 nDuff: But... yar, can't help with Windows.

20:12 JorgeB: hmm, not having much luck with it

20:12 mebaran151: technomancy: is there any reason why the trampoline script is stuffed into -e rather than being spit in its own file?

20:12 * JorgeB will email the guzheng owner

20:13 technomancy: mebaran151: just easier if there's less mess to clean up afterwards

20:14 mebaran151: technomancy: quoting is also really weird in the generated file, but that seems to be related to the double pr-str

20:14 technomancy: yeah, I don't really know what's going on there

20:14 happy to take patches for that

20:15 mebaran151: yeah I'm gonna try to get cljsbuild repl-listen working ... agin

20:17 I don't think the extra pr-str is actually necessary

20:17 is possible to run lein from a checkout in my project?

20:17 technomancy: you can with the bash script

20:17 I think the logic is there for the .bat, but it may be out of date

20:17 mebaran151: ah alright

20:18 well I'll give it a go

20:18 I 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:20 technomancy: master's fine. either a pull request or git format-patch on the mailing list would be good.

20:21 timvisher: anyone know if it's possible to get the slime manual in info format?

20:21 mebaran151: cool thanks

20:21 hacking nao

22:42 mheld: what do y'all use for oauth?

23:07 what does ^:dynamic do when defining a variable?

23:08 amalloy: allows it to be rebound with 'binding

23:08 mheld: ah

23:08 gracias

23:09 I for some reason thought all vars (in def form) did that by default

23:09 brehaut: they were, things changed

23:09 amalloy: yeah, two years ago that was true

23:10 mheld: cool, good to know

23:12 lpvb: Hey, 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:12 more and reload the file in REPL

23:14 mheld: lpvb: I think you can do that with the plain old repl

23:15 just (use thing.core :reload)

23:15 lpvb: ok, I'll try that

23:16 mheld: maybe :reload-all

23:18 eggsby: reload-all reloads the deps of the namespace as well

23:18 nDuff: lpvb: ...if you want more interactiveness with your editor, look at SLIME for Emacs

23:19 lpvb: ...which will give you the ability to load new code into your running session with a few keystrokes

23:20 (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:20 amalloy: slime 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:21 nDuff: ...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:21 * nDuff is really, really annoyed at CCW for not having an equivalent to the slurp-right motion in its paredit mode.

23:24 lpvb: how do I do (use test) if test.clj is in the same directory as the REPL?

23:25 nDuff: lpvb: I strongly recommend using Leiningen, and letting it set up your source tree, maintain the classpath, and so forth.

23:25 lpvb: I am in lein repl

23:25 should I make a project just for a test file?

23:25 nDuff: Ahh, good.

23:26 * nDuff does make projects just for test files. YMMV, but...

23:26 nDuff: Otherwise -- you can check the classpath and/or do a .addURL to it to add the current directory

23:27 but 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:28 amalloy: wow, 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:29 lpvb: yes, just make a project to play around in

23:33 lpvb: nDuff: 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:33 nDuff: ...sure you want to use src/test rather than src/main?

23:34 ...oh, waitamoment, I may be thinking Maven layout rather than lein

23:34 lpvb: that's how leiningen setup the project automatically

23:34 amalloy: lpvb: (use 'test.core)

23:34 nDuff: (use 'test.core)

23:36 leku: hey technomancy you here?

23:36 lpvb: Oh ok that works, along with :reload. Thanks nDuff & amalloy.

Logging service provided by n01se.net