#clojure log - Mar 26 2012

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

0:19 yan: i'm trying to get clojure repl to load up in emacs

0:19 i keep getting into clisp repl

0:20 what do i need to fix my .emacs file

0:20 sorry i'm new to both emacs and clojure

0:20 can anyone help?

0:21 oakwise_: yan: have you tried https://github.com/technomancy/swank-clojure ?

0:21 yan: ;; clojure-mode (add-to-list 'load-path "~/opt/clojure-mode") (require 'clojure-mode) ;; color-theme (add-to-list 'load-path "~/opt/color-theme") (require 'color-theme) (eval-after-load "color-theme" '(progn (color-theme-initialize) (color-theme-vim-colors))) ;; color-theme-sloarized (add-to-list 'load-path "~/opt/emacs-color-theme-solarized") (require 'color-theme-solarized) ;;; This was installed by package-install.el.

0:22 that's what i have in my .emacs file

0:22 muhoo: yan: swank is good, but the simplest thing i've found is to just use comint-mode.

0:22 sorenmacbeth: if I have a seq and I want to do and assoc on it, what is the most efficient way or doing so? is there a function similar to assoc that works on sees?

0:22 yan: ah i haven't tried that

0:22 sorenmacbeth: seqs

0:23 muhoo: yan: like, try this elisp: (make-comint "clojure" "lein" nil "trampoline" "repl")

0:23 yan: thanks oakwise and muhoo for pointers

0:23 amalloy: sorenmacbeth: this sounds like a solution to a subproblem, not an actual problem. you've usually broken it down wrong if you've come to the conclusion you should assoc into a seq

0:25 sorenmacbeth: amalloy: mostly, yes, I want a vector and it's being converted to a seq along the way

0:25 amalloy: if you are resolute, you can probably fake something up pretty easily with ##(doc map-indexed)

0:25 lazybot: ⇒ "([f coll]); Returns a lazy sequence consisting of the result of applying f to 0 and the first item of coll, followed by applying f to 1 and the second item in coll, etc, until coll is exhausted. Thus function f should accept 2 arguments, index and item."

0:28 oakwise_: yan: no problem. As a newb to emacs myself, I've found swank-clojure and technomancy's emacs-starter-kit exceptional useful

0:31 holo: in webnoir.org at the home page: I know this sounds basic, but how do I know some defpage is in the models section or the view section? doesn't explicitly explain what to edit

0:44 ibdknox: holo: (defpage ..) is a view concept, it shouldn't be in models :)

0:56 holo: ibdknox: http://groups.google.com/group/clj-noir/browse_thread/thread/58e45ad02bb21571 here, I don't get it, defpage is doing alot of stuff I would say. getting the file, slurping it and parsing and returning the result the result to someone I don't know yet

0:56 Raynes: You can do whatever you want.

0:56 holo: ibdknox: shouldn't that be a models job by Noir's standard? a fat model doing alot of non-presentation job

0:56 Raynes: Some people aren't as strict about MVC as others.

0:57 ibdknox: holo: sure, that doesn't have to be done in the defpage

0:57 Raynes: Noir doesn't have a standard. It is flexible enough to work with your standards. :)

0:59 holo: the thing is, if I want to do it in the model, how do I do it? I really don't have a clue

0:59 ibdknox: holo: I guess I'm not entirely sure what your question is

0:59 holo: clojure is very open ended language, very few things will tell you you have to do things a specific way

0:59 holo: I good example of how I do things, and how I encourage others who are starting to do them is the noir blog

0:59 holo: just (:require [my-cool-model])

0:59 and use functions

0:59 from there

1:00 unlink: Does the Clojure standard library have an "unzip"? (partial reduce (fn [[as bs] [a b]] [(conj as a) (conj bs b)]) [[] []]) or similar...

1:00 Raynes: holo: Take a look at https://github.com/Raynes/refheap

1:00 holo: oh, I have to call the model -.-

1:00 ibdknox: yeah :)

1:00 Raynes: holo: I don't really have a 'MVC' pattern, but I have views and models. You can see how it works.

1:01 holo: so there isn't an implicit call of a model, lets say, right?

1:01 Raynes: No. You require the code you need.

1:01 I'd argue that it is better to be explicit about things.

1:02 ibdknox: unlink: (juxt keys vals) ?

1:02 Raynes: It is precisely one line of code to require a model.

1:02 holo: jeez, I was forcing my mind with ror on this

1:02 muhoo: if i need to add a git-based project as a dependency, how do i do that in git?

1:02 sorry, in lein?

1:02 ibdknox: muhoo: checkouts

1:03 clone it into a checkouts/ dir

1:03 holo: also this: https://github.com/ibdknox/Noir-blog

1:03 unlink: ibdknox: How do I use that?

1:03 ibdknox: ,((juxt keys vals) {:a 2 :b 3 :c 4})

1:03 Raynes: You might notice the purposeful lack of controllers.

1:03 clojurebot: [(:a :c :b) (2 4 3)]

1:04 ibdknox: (def unzip (juxt keys vals))

1:04 (unzip some-map)

1:04 muhoo: ibdknox: thanks

1:05 unlink: ibdknox: Oh. I guess in my case it would be more (juxt (partial map first) (partial map second))

1:05 holo: Raynes: requiring plus calling stuff there -> explicit call of the model

1:06 ibdknox: unlink: oh, sorry I misunderstood

1:06 you have a vector of tuples?

1:06 unlink: ibdknox: What is a tuple?

1:07 ibdknox: in your case, a pair

1:07 [[a 2] [b 2]]

1:07 unlink: ibdknox: but yes, conceptually, I would like [(a,b)] -> ([a],[b])

1:08 holo: Raynes: I already read the answer from the author about the absence of controllers. thanks

1:08 ibdknox: your reduce is probably the most efficient way

1:08 the double maps will run over the collection twice

1:08 amalloy: until one of the lists is infinite, then the efficiency of reduce gets pretty bad

1:09 ibdknox: lol

1:09 true true

1:10 lynaghk`: ibdknox: I was reading up on your Waltz library this morning

1:11 ibdknox: lynaghk`: oh?

1:11 lynaghk`: did you use it in production anywhere? The biggest clientside web apps I've done were in CoffeeScript with a Model-View-Presenter architecture, but I'm shopping around for nice ways to structure CLJS apps and state machines sound solid.

1:12 I assume you've done the former (and/or MVC), so I'm wondering if you have any thoughts on the relative merits

1:12 holo: ibdknox: just came to know you are the author of Noir. great job, and thanks. about "This is a fully functioning blog that serves as an example website written in noir." I was searching some hours ago for this and google wasn't kind enough, I would suggest some SEO into this topic :)

1:13 ibdknox: lynaghk`: mvc doesn't help you all that much when it comes to managing highly interactive things

1:13 in my experience

1:13 Raynes: I know of at least 4 websites using noir.

1:13 ibdknox: there are lots of closed source ones actually

1:13 Raynes: holo: A very simple (very very simple) example site is https://github.com/Raynes/tryclojure

1:13 devn: holo: you're awesome.

1:13 Raynes: ibdknox: I meant open source.

1:14 ibdknox: lynaghk`: I've used it on a few different things, none of them are up anywhere currently though

1:14 Raynes: And I don't mean to keep directing you to my projects, it's just the only ones I know of are actually my own. :p

1:14 ibdknox: lynaghk`: we started moving that way at RFZ in normal JS

1:14 lynaghk`: it made things way, way better

1:14 devn: Raynes: it might be better that way

1:14 Raynes: i think im watching 550 projects

1:14 lynaghk`: ibdknox: yeah, most of the MVC stuff I've done is single-page visualizations (of course) with at most a few modal popups and fetching data.

1:14 ibdknox: holo: you're quite welcome, the way I intended for it to be found was from here: http://webnoir.org/tutorials

1:15 lynaghk`: even those can get annoying with enough transitions

1:15 devn: ibdknox: it might not be a bad idea to load your meta up and provide a sitemap, eh?

1:15 holo: devn: I'm awesome? ._. thanks, but why? you should be praising the guys that make all the good stuff instead

1:15 lynaghk`: ibdknox: that's believable. At that point it's time to move onto a hiearchical FSM of some kind, I take.

1:15 devn: holo: because you're appreciative. that's of equal value IMO.

1:15 ibdknox: devn: yeah, I didn't do a great job of my seo on webnoir or sqlkorma

1:16 devn: ibdknox: it's not a requirement, you can find those through many other avenues, but maybe given how much adoption they've received it wouldn't be a terrible idea

1:16 ibdknox: lynaghk`: yeah, I've found the non-deterministic finite statemachine worked well. Though that's mostly just because having lots of statemachines interacting with eachother is kind of annoying

1:17 lynaghk`: ibdknox: what is a non-deterministic state machine? Stochastic web app?

1:17 ibdknox: devn: I don't disagree

1:17 lynaghk`: it can be in multiple states at once

1:18 devn: ibdknox: time is a harsh mistress

1:18 as is the moon

1:18 lynaghk`: ibdknox: (if it's any consolation, I just googled "c2" and gave up after page 15 =)

1:18 ibdknox: lynaghk`: actually noir and korma are both on the first page despite my poor SEO currently :)

1:18 picked good names I guess lol

1:18 lynaghk`: non-deterministic just means it can have multiple states at once

1:19 lynaghk`: e.g. :high and :loading

1:19 lynaghk`: ibdknox: ah, I see. And the valid transitions are the union of transitions from the individual states?

1:20 ibdknox: lynaghk`: sort of, I did a bad job naming things for waltz

1:20 lynaghk`: deftrans should be definput

1:20 lynaghk`: but basically it's up to you to define what is set and unset based on an input

1:21 devn: ibdknox: have you used clojure-scheme?

1:21 ibdknox: devn: nope

1:21 devn: im trying to find someone who knows the workflow

1:21 i want to compile clojure to C damnit

1:22 Raynes: I want to compile Clojure to BEAM.

1:23 holo: Raynes: thank you, and sorry to bother with this no content one liner

1:23 Raynes: I'll never forgive you.

1:24 lynaghk`: ibdknox: ah, I didn't mess around with the code at all; mostly looked at the implementation and then read about state machines in JS and Ruby.

1:24 devn: it's true. he won't. until he does. just did, actually.

1:24 lynaghk`: ibdknox: I'll let you know if I end up using that approach on any public projects.

1:24 mephist0: looking for a function that makes this please (reduce str ["f" "g"]) -> "fg"

1:25 ibdknox: lynaghk`: please do

1:25 lynaghk`: I'll fix the names tomorrow

1:42 oakwise_: is there a way to use resolve against the current lexical namespace without explicitly writing the name of the namespace? e.g. (non-dynamic-resolve (symbol a-string)) instead of (ns-resolve (find-ns 'example.core) (symbol a-str))

1:54 amalloy: &(doc resolve)

1:54 lazybot: java.lang.SecurityException: You tripped the alarm! resolve is bad!

1:54 amalloy: ,(doc resolve)

1:54 clojurebot: "([sym] [env sym]); same as (ns-resolve *ns* symbol) or (ns-resolve *ns* &env symbol)"

1:58 oakwise_: amalloy: but that resolves dynamically against *ns*, right? so if I use it in a func in example.core and then call that func from somewhere else, it will resolve to that somewhere else's ns

2:04 (ns example.foo) (defn foo [] (resolve 'foo)) (foo) ;=> #'example.foo/foo, then (ns example.bar) (example.foo/foo) ;=> nil

4:53 kij: lazybot: help

4:53 lazybot: You're going to need to tell me what you want help with.

5:17 cYmen: window stick

6:27 dsabanin: hi guys!

6:27 I'm trying to deploy my tiny clojure app to production and I'm seeing strange memory usage pattern

6:28 jtoy: what is the idiomatic way to test if any item in a list matches x ? I'm a clojure newb

6:28 dsabanin: it's really tiny app, maybe 200 LOC, but once it loads, even before it receives it's first request (it's a websocket server) it eats 100MB of RSS and what looks like more than 2.3GB of VSZ (in "ps aux")

6:29 okay, I lied, the app is <400 LOC

6:30 I built uberjar with leiningen, maybe that's an issue?

6:33 jtoy: in ruby its list.any?{|x| x == blah}

6:33 vijaykiran: ,(doc filter)

6:33 clojurebot: "([pred coll]); Returns a lazy sequence of the items in coll for which (pred item) returns true. pred must be free of side-effects."

6:33 vijaykiran: jtoy: ^^ ?

6:33 dsabanin: you could try (some #(= % "blah") list)

6:34 it will return first element or nil

6:34 jtoy: thanks, I'm reading through a couple of clojure books now, I still don't have a lot of clojure memorized

6:35 vijaykiran: doc and find-doc are your friends

6:35 jayunit100: jtoy: fwiw i think the ClojureInAction one is best

6:35 jtoy: I'm reading clojure in action now!

6:35 jayunit100: :)

6:35 Im just starting the multimethods chapter.

6:36 jtoy: i think thats the same as me, I'm on 4.2

6:36 jayunit100: jtoy: any interest in helping me out on this resurrection project : https://github.com/jayunit100/clojure-game-of-life

6:37 Forked it from an old project, and trying to comment every line and make sure all the functions work and are tested. its just a learning exersize

6:38 jtoy: jayunit100: looks cool, don't think i have enough time now though

6:38 I've actually never played game of life

6:39 i was thinking about making a cellular automata before though

6:40 jayunit100: cool... if you want to build a practice project let me know. Im trying to work on some more practice projects w/ people to learn more. got a couple of other contributors also interested in building some pet clojure projects.

6:44 jtoy: why is this wrong: (some #(= % "blah") ("foo" "bar")) => java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn

6:45 ah, i see

6:45 quote

6:45 is it normal to be using quote all the time?

6:47 bsteuber: jtoy: no, usually you use vectors instead

6:47 dsabanin: you could use vector here

6:48 :)

6:48 bsteuber: ^^

6:48 dsabanin: so, anybody knows if it's normal for clojure jar to get to 2160m of virtual memory before the app has even started properly?

6:48 maybe I have my java misconfigured?

6:49 the app is just a web server (webbit)

6:49 jtoy: is it fine to interchangeably use list and vector in normal cases?

6:50 bsteuber: jtoy: yes, there are only a few cases where the difference matters, e.g. when using conj

6:50 and some time characteristics, of course

6:52 but all seq abstractions work perfectly on vectors

6:52 as well as on sets and maps (as sequence of key-value tuples)

6:56 jtoy: why is the quoted hello not a string

6:56 (= (nth '(hello world) 0) "hello")

6:57 or is there a fast way to generate a list of strings?

7:06 bsteuber: jtoy: when the reader finds a token like hello, it generates a symbol out of it

7:06 ,(symbol? (first '(hello world))

7:06 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

7:06 bsteuber: oups

7:07 ,(symbol? (first '(hello world)))

7:07 clojurebot: true

7:07 bsteuber: but no, there's no real shortcut to writing ["hello" "world"] - unless you do something like:

7:08 ,(clojure.string/split "one two three four" #" ")

7:08 clojurebot: ["one" "two" "three" "four"]

7:08 bsteuber: jtoy: I guess that means you come from ruby? :)

7:20 jtoy: bsteuber: yes, i use things like %w[ many random strings here]

7:21 bsteuber: jtoy: if you really need it, you can get that with a macro

7:22 jtoy: its ok, just wondering

7:22 bsteuber: (defmacro str-vec [& args] (vec (map str args))) should do the job

7:23 then (str-vec many random strings here)

7:26 jtoy: cool. i haven't learned vectors yet, but i will use them soon!

7:26 i mean macros

7:27 bsteuber: ^^

7:27 beware of macros, you'll most like end up shooting yourself in the foot ^^

7:27 *likely

7:28 there are only very rare cases one really needs a macro at all

7:28 antares_: jtoy: macros is something that you should learn later. Unless you are building DSLs like Korma or have extreme performance requirements, almost everything can be done using just functions.

7:28 bsteuber: forgive the bad english ^^

7:29 antares_: jtoy: for example, you won't find macros here: https://github.com/michaelklishin/validateur

7:30 bsteuber: but when you need them one time, you thank god they're available

7:30 antares_: ugh, the use of atoms in that (fairly old) code is so wrong. Please don't use it as example (but other functions are probably fairly good examples)

7:58 dsabanin: why my clojure program prints "<current date> clojure.lang.Reflector invokeMatchingMethod" to the stdout?

7:58 I'm using clojure.tools.logging

7:59 actually, what it prints is:

7:59 Mar 26, 2012 7:54:47 PM clojure.lang.Reflector invokeMatchingMethod

7:59 INFO: New connection from 127.0.0.1:59993

8:00 looks like I need to read tools.logging docs :)

8:06 bsteuber: does anyone have a clue how try/catch works in current cljs - if it works at all?

8:07 antares_: dsabanin: you do not have appender format configured

8:09 dsabanin: here is an example: https://gist.github.com/3d3ad91ed15ffb5e56cf

8:09 dsabanin: log4j.properties goes to src/resources or where do you have resources path set in your project.clj

8:10 as for dependencies, some blog posts recommend really unnecessary dependencies list. slf4j API is typically enough (and many Java projects you may end up having among dependencies use it). You can think of SLF4J as "ActiveMerchant for logging" in the Java world

8:36 dsabanin: antares_, thanks!

9:16 rhc: devn: thanks for the ref to at-at

10:31 RickInGA: I am trying to put the partial function into words... (map (partial + 2) [1 2 3]) returns [3 4 5]

10:32 So partial adds 1 value as the last parameter to a function?

10:34 fdaoud: RickInGA: partial returns a new function with the parameter applied, left-to-right

10:34 Bronsa: ,((partial + 1) 2 3)

10:34 clojurebot: 6

10:34 Bronsa: not just one

10:34 fdaoud: RickG: so in your example, (partial + 2) is like (fn [x] (+ 2 x))

10:34 Bronsa: it's kinda like ##(#(apply + 1 %&) 2 3)

10:34 lazybot: ⇒ 6

10:35 fdaoud: RickInGA: so in your example, (partial + 2) is like (fn [x] (+ 2 x))

10:35 fliebel: How did Clojure do away with checked exceptions?

10:36 RickInGA: bronsa: and the only reason I saw it as 1 parameter was because I put it in a map

10:37 flazz: how can i measure memory consumption of different forms in clojure?

10:38 Bronsa: yeah

10:39 Phlogistique: Isn't there any shorter name for "partial"?

10:39 fdaoud: ,(let [m {:a 1 :b 2 :c 3 :d 4}] (reduce (partial dissoc m) [:b :c]))

10:39 clojurebot: {:a 1, :d 4}

10:39 RickInGA: bronsa: fdaoud: thanks

10:40 fdaoud: Phlogistique: what shorter name did you have in mind?

10:42 TimMc: ((composition (juxtaposition plus minus) increment) 5)

10:43 ^ verbose is the new literate

10:48 RickInGA: lets say, hypothetically I set up an infinite loop in inferior lisp, is there a way to kill it?

10:49 cemerick: I don't think so.

10:49 SLIME and nREPL have interruption facilities, but killing the process is your only option in inferior-lisp.

10:50 RickInGA: cemerick: thanks, C-x C-c it is then

10:51 Bronsa: actually, C-c C-c :)

10:51 RickInGA: Bronsa: what does that do?

10:51 Bronsa: oh.

10:52 i thought you were using slime

10:52 nevermind then.

10:52 RickInGA: my emacs knowledge is about 5 bindings

10:53 Bronsa: if you're using clojure-mode running slime is just a matter of M-x clojure-jack-in

10:55 RickInGA: bronsa if I use slime, when I evaluate a form, it shows it in a status at the bottom of the screen. Is it possible for me to evaluate a form in a code buffer and have the results show up in the slime buffer?

10:58 Bronsa: RickInGA: i don't think so

10:58 RickInGA: Bronsa: cool, thanks

10:59 Bronsa: http://bc.tech.coop/blog/070424.html

10:59 this seems to do it

11:00 RickInGA: SLIME Tips - part 6... that is going to be a handy link to have!

11:03 Bronsa: confirmed it's working

11:04 just replace copy-region-as-kill-nomark with copy-region-as-kill

11:34 edw: I believe Dijkstra wrote a short paper (maybe it was Knuth) that discuseed the canonical way to test whether a number was in a range. Anyone off hand know what I'm talking about?

11:35 TimMc: edw: Oh, the >= and < thing?

11:35 edw: Exactly!

11:35 TimMc: No good keywords come to mind.

11:35 edw: Yeah, I'm floudering all over the plac on Google...

11:36 TimMc: edw: http://www.cs.utexas.edu/~EWD/transcriptions/EWD08xx/EWD831.html ?

11:37 edw: How the hell did you find that?

11:38 TimMc: Searched on Google: Dijkstra natural range lower upper

11:38 "natural" was serendipitously accurate -- I thought it would be used in a different sense

11:38 edw: Ah. I was using comparison and interval

11:38 Right, nat number, not a "natural" approach.

11:43 BTW, TimMc I'm amazed that it was on #clojure and not #scheme that I got an answer. Speaks well of the Clojure community.

11:46 DerGuteMoritz: edw: I'd say it's a matter of timezones :-)

11:46 but #scheme is not very active as of late, indeed

11:48 edw: DerGuteMoritz: Hmm. Makes me sad to think about how Clojure has basically replaced Scheme for me.

11:49 DerGuteMoritz: edw: really? how is that possible with jvm startup times? :-)

11:50 edw: check out the implementation specific channels, those of the actively used implementations are pretty active and lively (e.g. #chicken)

11:50 edw: Yes, I hate restarting my REPL when I add a depenency, but in Scheme there is often nothing to be dependent on.

11:50 DerGuteMoritz: heh

11:51 well, check out chicken's egg repo

11:51 we have about ~400 extensions by now

11:51 http://api.call-cc.org/doc/ :-)

11:51 (end-plug)

11:52 cemerick: edw: Just in case you hadn't seen this (adding Clojure deps w/o restarting): http://sunng.info/blog/2012/03/my-favorite-feature-in-leiningen-2/

11:52 I guess https://github.com/cemerick/pomegranate if you don't need the exposition.

11:53 edw: DerGuteMoritz: It's been a while; I actually contributed a bit to a couple eggs.

11:54 cemerick: I'll check that out. I believe in multi-year uptime for my servers, and don't see why REPLs should be any different.

11:54 DerGuteMoritz: edw: oh cool, drop by again some time then!

11:55 cemerick: edw: :-) In any case, pomegranate is baked into leiningen 2, so there's at least a reasonable baseline now.

11:55 edw: Scheme48 won me over because I liked its module system.

11:55 DerGuteMoritz: was that from before chicken had modules?

11:56 chicken has a pretty decent module system since version 4, it's similar to what will be in R7RS

11:56 edw: cemerick: ccm

11:57 D'oh. cemerick: From that page: "So I guest you must have a lot of empty projects created for such purpose." OMFG yes!

11:58 cemerick: hah

12:00 I don't expect Clojure to ever beat a decent scheme module system on the merits, but I think we're solidly in uncanny-valley territory.

12:01 DerGuteMoritz: cemerick: well put, hehe

12:01 edw: "It's good enough to disturb people."

12:01 cemerick: or, good enough to avoid dev-time pain or save your ass in production for a bit.

12:02 In contrast to edw, I assume my servers are going to choke and die on a regular basis, for all sorts of reasons. ;-)

12:03 edw: cemerick: Yeah, I'm old school that way; I need to embrace the chaos monkey school of cord yanking.

12:04 cemerick: well, depends on which old school you're talking about, viz. erlang

12:04 edw: Now it would be nice if there were a way to see what dependencies had been added that weren't in the project.clj, so one can relatively easily update it after a hacking session.

12:06 cemerick: pomegranate will start keeping track of that shortly, so that it can make some attempt to perform conflict resolution (and potentially warn/error if something simply can't be added dynamically).

12:06 edw: cemerick: Just a plain old school multi-user Unix background.

12:06 cemerick: So clojars isn't among the stock repos?

12:07 Also, what are your thoughts on the Clojure One guy's git-dependencies plugin?

12:08 cemerick: edw: pomegranate has no "stock repos".

12:08 There's a prefab map for central, but it's not included by default either.

12:08 edw: Please excuse my slapdash terminology.

12:08 Ah.

12:09 cemerick: There are use cases where one only wants to touch a private repo, so then you get into overriding defaults and stuff, which always gets messy.

12:09 "Clojure One guy" being Brenton Ashworth? :-)

12:09 edw: I've run into that with deploying.

12:10 Is that who wrote the thoughtful paper/blog entry on release number based versioning using git as an alternative to the semantic versioning that many people currently love?

12:12 cemerick: Perhaps this? https://github.com/brentonashworth/one/wiki/Dependencies

12:12 edw: Yes, exactly.

12:14 cemerick: I still don't use ClojureScript for anything "real". So, it may work in that context. I've tried using git as a way of managing dependencies in the past (and seen others as well), and it generally ends in tears, at least for Clojure stuff.

12:15 At least for Clojure, source-level dependencies aren't sufficient in general.

12:16 * cemerick waits for a gentoo user to pipe up :-P

12:20 edw: cemerick: What appealed to me in his proposal is that since everyone (for certain values of "everyone") is using Git, which makes all the Maven machinery feel superfluous.

12:20 s/which/it/

12:21 Alternatively, s/which makes all//

12:21 cemerick: I agree, that's a compelling thought.

12:22 In the end though, I don't think git is a suitable substrate for dependency management / resolution.

12:23 ibdknox: I don't think people's repos are accurately formatted to be a dependency

12:23 let's say I include some random clj, things/resources that don't end up in my jar

12:23 I've now potentially hosed your classpath

12:28 cemerick: ibdknox: are there ever jars in this model though?

12:29 ibdknox: cemerick: hm? At the very least it forces you to think about it. I definitely think more about what goes into my jar than what goes into my repo

12:29 cemerick: i.e. the delivered app's project needs to know how to assemble all transitive deps into a deployable?

12:29 ibdknox: oh

12:29 misunderstood

12:30 edw: Makes me think that there is well-formed-ness trait that a Git repo could be evaluated for.

12:30 (Apropos the typing from a couple of minutes ago. Got distracted by the new office microwave.)

12:33 y3di: can you use clojure on android

12:37 TimMc: y3di: Very slowly, I believe.

12:40 dnolen: y3di: TimMc: as far as I know it's not Clojure runs that slowly, it's the boot time that's killer. y3di you could also use CLJS and target Rhino.

12:41 technomancy: dnolen: GC is also an issue

12:41 but not nearly as big of an issue

12:41 TimMc: &(loop [c (long 5) acc (int Integer/MAX_VALUE)] (if (zero? c) acc (recur (dec c) (+ acc c))))

12:41 lazybot: ⇒ 2147483662

12:42 TimMc: ^ I thought this loop would use primitive int for acc

12:42 technomancy: dalvik has a long way to go to catch up with hotspot, and persistent data structures make it more obvious. but if you have to you can use arrays and stuff.

12:44 simard: I invoke a static clojure function from a Scala source code in my project (epadEval). On my computer (Linux) it works perfectly, on a friend's computer (Windows7), it fails with an exception (https://gist.github.com/2199626). Any idea what is going wrong here ?

12:45 fdaoud: ibdknox: you rock, man! Thanks for all your Clojure web dev contribs. I had some time to myself during a recent airplane trip and tried out jayq, crate, fetch.. had lots of fun :-)

12:50 Togo: Hi.

12:51 jonasen: dnolen: https://gist.github.com/2205346

12:52 dnolen: jonasen: I saw that, looks interesting. You're discovering that you can easily meld FP w/ LP :D

12:55 jonasen: dnolen: something like that, yes. We need a more powerful rule system, especially for the stuff lynaghk's trying to do.

12:58 pandeiro: dnolen: have you seen any examples of clojurescript->rhino android apps? i wonder what the performance penalty of including rhino is, if any? totally guessing but it must be a similar size to clojure?

12:59 ibdknox: did any of your slides or materials from the conference end up online somewhere?

13:04 dnolen: pandeiro: I don't know of any cljs->rhino apps, but google for rhino android app and I'm sure you'll find some relevant experience stories.

13:34 unlink`: I have a function which returns the path to a temporary file which its caller is required to delete. The function itself may also fail, in which case it needs to remove the file.

13:34 The call site looks like: (let [path (produce-file)] (try ... (finally (.delete path)))) and produce-tempfile has (let [path (make-tempfile)] (try ... (catch Throwable e (.delete path) (throw e)))).

13:35 How can I factor out the cleanup logic without mixing the concerns of the caller and of produce-file?

13:40 ibdknox: fdaoud: glad they worked out for you :)

13:41 pandeiro: I didn't have anly slides

13:41 pandeiro: I only did training and then a little unsession thing, neither of which had any keynote/powerpoint in them :)

13:41 cemerick: ibdknox is smart, doesn't leave any evidence laying around :-P

13:41 ibdknox: burned it all.

13:42 fdaoud: hehe

13:47 raek: unlink`: I essentially did that in one of my projects: https://github.com/raek/bokareis/blob/master/test/bokareis/util.clj

13:49 my 'with-temp-dir' follows the style of 'with-open'

13:49 it lets you bind a variable to something that will be cleaned up when the body is left

13:50 unlink`: raek: but the problem is that I can't create the file soon enough without mixing concerns

13:50 raek: i.e. all of the functions in between the caller and the file which writes to the tempfile must know this and thread through the path to the tempfile

13:53 raek: I guess the only other solution is to use finalizers

13:54 raek: sorry, I don't really follow. what would you want the code to look like?

13:55 you want to factor out just the cleanup stuff from produce-file and the call site of produce-file?

13:55 unlink`: raek: ideally, yes, but I'd like to avoid threading a path from the consumer of the file through to the function that writes to that path

13:57 raek: resource management is tricky

13:57 I don't know a better solution

13:58 I guess you could maintain a reference to a set of files that should eventually be cleaned up

13:59 and provide a function that cleans up the files in the set and clears it

13:59 this reference would ideally be passed "behind the scenes" somehow

14:00 e.g. through 'binding'

14:11 pandeiro: ibdknox: ah ok, cool, was your training recorded ?

14:11 ibdknox: trainings rarely are, unless they're meant to be resold later

14:11 dnolen: cemerick: so did you get further on how to support richer content in nREPL?

14:12 fdaoud: ibdknox: what was the topic of this?

14:13 ibdknox: clojure web

14:13 fdaoud: ring, compojure, noir, the usual suspects?

14:14 RickInGA: pandeiro: if you ever have a chance to get training from ibdknox, it is well worth the money. he is a good teacher (and besides, he built the tools we were learning about.

14:14 ibdknox: fdaoud: yessir :)

14:14 pandeiro: RickInGA: i can tell, if i could've i would've, no doubt

14:15 cemerick: dnolen: Yeah. All the bits are there. I need to add a sane content-negotiation middleware to the base library, but that's mostly a tooling "standard" yak to shave. Anyone can write their own middleware or transport extension to send nontextual content back and forth.

14:15 ibdknox: RickInGA: thanks Rick :)

14:15 cemerick: dnolen: it seems like all of this is pointing back to the rich editor stuff I was talking about doing as a cljs project

14:16 fdaoud: ibdknox: not that it's not plenty, but did you cover any others?

14:16 dnolen: cemerick: ibdknox: you guys should chime in on that GSoC thread on the ML

14:16 pandeiro: fdaoud: imagine he talked about his cljs stuff and the new template plugin too?

14:17 fdaoud: pandeiro: yeah the cljs stuff is cool, and what is this new template plugin?

14:17 pandeiro: cljs-template it's called

14:17 ibdknox: fdaoud: we covered the basics of how the internet works, http, ring, compojure, noir, three templating options (stencil, comb, hiccup), mongodb, how to use js, and cljs

14:18 cemerick: dnolen: Yeah, I noticed that.

14:18 hhutch: ibdknox: no enlive/enfocus ?

14:18 ibdknox: dnolen: yeah, I will. I've been traveling the past few days so things have been a little scattered

14:18 dnolen: cemerick: ibdknox: please both do when you get a chance - this could turn out to be a really amazing GSoC project

14:18 fdaoud: very nice ibdknox

14:18 lynaghk: ibdknox: Whenever I meet with clients I start by explaining how the internet works = P

14:18 dnolen: and super useful for all.

14:19 ibdknox: hhutch: I mentioned it, but I've found the other three suit people's needs better most of the time.

14:19 pandeiro: dnolen: thank you for suggesting he do that :) ibdknox: do you remember me bugging you about a 'cljsfiddle' a month or two back? :)

14:19 fdaoud: pandeiro: oic. I had my project all set up already so I haven't looked at that one.

14:19 cemerick: I've been focused on trying to raise the LCD. Interactive environments are awesome, but portability in tooling is very important to me.

14:20 ibdknox: lynaghk: lol, I think few people really understand it - "what do you mean http is stateless?"

14:20 dnolen: cemerick: do you see portability to be an issue here?

14:21 ibdknox: hhutch: enfocus is awesome and I *will* recommend that one. Enlive is a little harder for me to recommend due to its complexity and the lack of effort being put into maintaining it.

14:21 cemerick: dnolen: well, building a super-compelling REPL / interactive dev environment is great, but I assume that frontends will come and go.

14:21 ibdknox: pandeiro: yeah

14:21 cemerick: i.e. I want to minimize switching costs between clojure dev environments

14:22 ibdknox: cemerick: but why would you want to switch once the über dev environment exists ;)

14:22 cemerick: heh

14:22 dnolen: cemerick: that's I'm suggesting focusing on something CLJS/HTML/CSS/Canvas based - browsers aren't going anywhere.

14:22 people know how to customize that

14:22 cemerick: dnolen: and here I was going to say: if the über environment is web-based, that doesn't really work for me :-P

14:23 ibdknox: cemerick: well, the visuals and such could be, right? We can embed webviews in eclipse

14:23 cemerick: this is true

14:23 dnolen: ibdknox: bingo

14:23 cemerick: That's roughly what I'm hacking on these days.

14:23 ibdknox: I see the browser as a way to make up for the terrible presentation limitations we have on most platforms

14:23 dnolen: cemerick: so I don't see where we differ here :)

14:23 cemerick: ibdknox: oh, you know this already

14:23 ibdknox: while not the best...

14:24 cemerick: dnolen: no, perhaps not

14:24 hhutch: i have to agree with cemerick, I don't want any dev enviro i can't run in a terminal, personally

14:24 ibdknox: at least you can relatively quickly and easily make some impressive things

14:24 cemerick: hhutch: whoa, dude. I don't use the terminal. ;-)

14:24 hhutch: and no matter how uber it is, i probably wouldn't use it

14:24 ibdknox: lol

14:24 hhutch: you're likely not the target for such a thing anyways :)

14:24 hhutch: cemerick: i know, you use eclipse right?

14:24 cemerick: Terminal.app might as well be named lein.app

14:24 lynaghk: Emacs has already been ported to the web: http://www.ymacs.org/

14:24 dnolen: cemerick: ibdknox: anyways, we're aligned - I'm not talking about webbased - I'm talking about browser-tech based, that is portable and isn't going to change anytime soon. Chime in on that thread!

14:25 if by this time year I can't use C2 directly in my REPL I'm gonna pissed

14:25 next year

14:25 hhutch: i just don't want to depend on anything more complex than a terminal for daily dev. i have too many bad experiences with big bulky desktop dev, including web browsers

14:25 ohpauleez: dnolen: haha

14:26 ibdknox: dnolen: we'll get there way before then

14:26 lynaghk: dnolen: yeah, I thought about doing integration but I'm terrified of that kind of project. That's why I punted and made the auto-reload webserver REPL-thing.

14:26 * cemerick agrees with ibdknox

14:26 ibdknox: lynaghk: it won't be bad

14:26 cemerick: lynaghk: BTW, macroexpand + kibit or conditional compilation?

14:26 ibdknox: if I can make that game editor work from VIM, I'm fairly certain we can make C2 work just fine from anything

14:27 lynaghk: cemerick: I'm messing with kibit right now. Unfortunately it looks like something in core.logic is eating up metadata on forms.

14:27 daniel__: i've installed lein-noir, trying lein noir new project_name ... I get 'That's not a task... Use lein help to list all tasks'

14:27 lynaghk: cemerick: (which probably means something in clojure.core is eating up metadata...)

14:27 daniel__: any idea what could be wrong there?

14:27 ibdknox: daniel__: do you by chance have two of them installed?

14:28 daniel__: take a look at ~/.lein/plugins

14:28 daniel__: ibdknox: yes, i think so

14:28 cemerick: ibdknox: the real challenge is going to be making it possible for people to expose/describe their data models as something that is readily visualizable

14:28 pandeiro: lynaghk: any breakthroughs on the cljs side of c2? i dig the vrepl for prototyping, very cool setup

14:28 ibdknox: daniel__: remove the old one

14:28 daniel__: cool, thanks

14:28 works now :)

14:28 lynaghk: ibdknox: I'm not sure what a portable architecture would look like. I know you can look at SVG in gtk-emacs (if you have some kind of rendering lib installed already), so it's just a matter of buffer juggling to get c2 working in there too

14:28 ibdknox: cemerick: I didn't tell you about my side project on a touch-based editor did I?

14:29 lynaghk: ibdknox: though you'll have to pry chrome dev tools from my cold dead hands

14:29 cemerick: ibdknox: nope

14:29 ibdknox: I think there's a way to visualize code meaninfully

14:30 fdaoud: C2?

14:30 lynaghk: pandeiro: I'm trying to shave the clj/cljs code sharing yak first, using Kibit to rewrite certain forms. I'm hoping to get something out this week, and cut a JAR that includes clj and cljs so people can just pull it as a dependency.

14:30 hhutch: lynaghk: links :)

14:30 lynaghk: hhutch: to what?

14:31 fdaoud: guess I'm the only one who doesn't know what C2 is besides "a pawn resides there."

14:31 lynaghk: fdaoud: http://keminglabs.com/c2/

14:31 pandeiro: lynaghk: awesome, good luck w that... btw can your chrome inspector handle svg's with 5000+ paths? mine just locks up

14:31 ibdknox: cemerick: basically it's a matter of just tracing what happens to the data, but in such a way where it's not just static - you can manipulate and see the effects immediately

14:31 hhutch: lynaghk: i guess links doesn't support the proper version of JS

14:31 fdaoud: thx lynaghk

14:32 hhutch: but it would be hi-larious

14:32 lynaghk: pandeiro: nope; chrome doesn't really handle that much SVG on the dom at once. If you need to do that much, you'll probably have to drop to canvas and handle the scenegraph yourself

14:33 pandeiro: lynaghk: it renders it fairly quickly actually but the inspector becomes useful, ie no right clicking, inspecting elements, seeing their attributes, testing styles etc

14:33 s/useful/useless

14:33 ibdknox: dnolen: I'll comment on that thread later

14:33 dnolen: ibdknox: cool, thx

14:34 lynaghk: pandeiro: yeah, sorry I don't have any better advice than "fewer elements" = )

14:34 cemerick: ibdknox: sounds interesting; I have 40 questions, but I'll not try to push 'em through irc :-)

14:34 pandeiro: lynaghk: no sweat sorry just wondering if that's my limited hardware or a prob for everyone

14:34 ibdknox: cemerick: it's going to be my sanity project I think, so I'll be talking more and more about it over time once things get off the ground on the startup

14:35 lynaghk: dnolen: do you have a gut feeling about whether or not metadata on forms is a fixable issue with core.logic, or do I need to rethink my approach (re: https://gist.github.com/2206272)

14:36 unlink`: raek: How would you accomplish that through binding?

14:36 dnolen: lynaghk: I don't think I try to preserve metadata through unification. Feel free to open up a ticket.

14:37 lynaghk: dnolen: and unification is happening under the pattern-matching covers?

14:37 dnolen: lynaghk: well it's unification - not pattern matching.

14:39 lynaghk: dnolen: okay, I'll look into it a bit more and open up a ticket.

14:44 cemerick: OK, my ring authentication/authorization lib is only going to come with form and basic to start. OpenID is such a pit.

15:06 DerGuteMoritz: ,(meta ^{:x 1} [1 2])

15:06 clojurebot: {:x 1}

15:06 DerGuteMoritz: watr

15:06 this doesn't work in my repl!

15:07 Bronsa: check your ##(clojure-version)

15:07 lazybot: ⇒ "1.3.0"

15:07 DerGuteMoritz: ,(clojure-version)

15:07 clojurebot: "1.4.0-master-SNAPSHOT"

15:07 DerGuteMoritz: aha!

15:08 well this specific example also works with 1.3.0 as I now realize

15:08 TimMc: ^ is for the compiler

15:08 not runtime

15:08 DerGuteMoritz: what

15:09 does the compiler use a different reader?

15:09 TimMc: &(meta (with-meta [1 2] {:x 1}))

15:09 lazybot: ⇒ {:x 1}

15:09 TimMc: DerGuteMoritz: No, ^ meta is just applied at a different execution phase.

15:10 DerGuteMoritz: TimMc: ok then why did my example above work with clojurebot?

15:10 ,(meta ^{:x 1} (list 1))

15:10 clojurebot: nil

15:11 DerGuteMoritz: &(meta ^{:x 1} (list 1))

15:11 lazybot: ⇒ nil

15:11 DerGuteMoritz: ,(meta ^{:x 1} [1])

15:11 clojurebot: {:x 1}

15:11 TimMc: Some of the compiler metadata trickles through.

15:11 DerGuteMoritz: &(meta ^{:x 1} [1])

15:11 lazybot: ⇒ nil

15:11 DerGuteMoritz: o_O

15:11 &(meta ^{:x 1} '(1))

15:11 lazybot: ⇒ {:line 1}

15:12 TimMc: :-)

15:12 DerGuteMoritz: I don't dare looking at the code

15:13 the docs just say "The metadata reader macro first reads the metadata and attaches it to the next form read"

15:14 technomancy: DerGuteMoritz: the lein2 repl?

15:14 DerGuteMoritz: this doesn't seem to be true in all cases ... or something

15:14 TimMc: Forms, not values.

15:14 DerGuteMoritz: technomancy: I tried this just with clj

15:14 technomancy: ok, I think there was a bug in reply where it would swallow metadata

15:15 DerGuteMoritz: TimMc: well but those forms get turned into values then ... what good are metadata when they can't be used? :-)

15:16 technomancy: thinking about cutting a 1.7.1 bugfix release for those of you still on lein1; any outstanding bugs that should be considered beyond the phantom jvm processes?

15:19 ibdknox: technomancy: the GC thing?

15:19 technomancy: ibdknox: yeah, that's already been fixed

15:19 ibdknox: yay!

15:19 that's it for me :)

15:20 edw: "Still" on lein1? Is 2 recommended now?

15:21 DerGuteMoritz: ah, I understand now

15:21 technomancy: edw: depends on who's doing the recommendation

15:21 and who is being recommended at

15:24 edw: Production-quality-ness is not something that concerns me. Non-complete-flakiness would be nice.

15:25 technomancy: bugs have been both fixed and introduced. code has been written and deleted. only one way to find out

15:26 edw: BTW, one thing that irritates me every time I upgrade lein: it would be nice to know what the old and new versions were. So if the last line said something like "Successfully upgraded lein from version 1.7.0 to 1.7.1."

15:27 technomancy: it does tell you what the new version is

15:27 I'll add printing of the original version though; good idea

15:28 edw: Right, but one has no idea what the old version was.

15:28 Right.

15:28 technomancy: bingo

15:28 pushed

15:29 mrmekon: So I've been working on a math-heavy HTML5 game in ClojureScript. Just implemented a framerate monitor and tested it on different browsers

15:29 Chrome is the best... not saying much, but 15-30 fps

15:29 Firefox is ok, 7 - 22fps

15:30 mobile safari on iphone is less than 1. Firefox on android is ~2

15:30 and safari took 2GB of RAM, and failed to ever render a single frame

15:30 edw: technomancy: Thanks!

15:31 technomancy: no problem

15:34 edw: Ah! No more projects for futzing with every piece of new Clojure hotness that comes along!

15:35 fdaoud: edw: what's the fun in that? :)

15:38 edw: fdaoud: I know you're joking (you *are*, *right*?!) but that was a huge problem because I had a "workspace" project that I used for everyday data munging, and having to bounce the thing just to e.g. add CSV support felt...dumb.

15:38 dnolen: it boggles the mind why people continue to engage Cedric Greevey

15:39 Raynes: dnolen: If that's who I think it is, his existence burns my soul.

15:39 emezeske: dnolen: I wish I hadn't even dipped my toes into that thread. Regretted it *immediately*.

15:39 amalloy: dnolen: sadly, trolls will never go extinct. there are always enough people who misguidedly want to help him see the light

15:40 but in a few months perhaps he will take a new name (again? still haven't seen ken recently)

15:40 Raynes: amalloy: Cedric was the guy who was complaining because 4clojure has a sandbox, right?

15:40 amalloy: *shrug*

15:44 unlink`: lol @ the set literal thread. what a troll.

15:44 I mean the troll itself, not Cedric.

15:46 edw: Speaking of trolls, I need to find someone dumb and/or boring enough to understand Pinterest who can explain it to me.

15:46 * ibdknox goes around trolling

15:46 TimMc: edw: reddit for moms

15:46 (that's how it was described to me)

15:46 although it seems more tumblr-like

15:47 rhc: its like having multiple tumblrs

15:47 edw: Oh, so a place that moms can talk about Peak Oil and the Ron Paul REVOLution?

15:47 rhc: but it shares pictures in a grid

15:47 edw: its more for "style"

15:47 like, you'd make a category of "desserts you like"

15:47 or "bedding products you like"

15:48 and then its just a huge virtual wall of pictures and short captions

15:48 like if you were making a scrapbook from magazine clippings

15:48 samaaron: my life is troll-free - i just don't bother reading the mailing list too much

15:48 mk: pictures on a grid is better than pictures in a little thumbnail

15:49 samaaron: i just bought a nanoKontrol2 - which is way more fun than picking through endless threads debating syntax changes

15:49 ibdknox: samaaron: what's that used for?

15:50 ordnungswidrig: samaaron: I doubt the statement about troll-free

15:50 samaaron: ibdknox: not sure yet - just hooking it up to Overtone now

15:50 but it has sliders and knobs

15:50 which is a definite win

15:50 TimMc: haha

15:50 samaaron: i like BOTH sliders AND knobs!

15:50 edw: Hmm. I've had an account for a while but it just perplexes me. "What am I looking at? WTF is the point of this?!" Those are the things that run through my head. Twitter and Fb were like this to me, until I realized the Twitter is basically an ocean (or toilet) for throwing bottled messages into. And Fb is cancer.

15:51 samaaron: edw: twitter is great if you really control who you listen to

15:51 TimMc: samaaron: I liked the look of that iPad app in the Overtone talk, but I think I'd want haptic feedback.

15:51 ordnungswidrig: samaaron: exactly! clean up your timeline every week

15:51 edw: samaaron: Right, I was referring to my "contributions". I use Twitter as my feed reader.

15:51 samaaron: edw: haha

15:52 TimMc: just at the very basic level of "how hard am I pushing this slider"

15:52 mk: edw: many of these sites deal with content consumption, which is actually very interesting, and exactly the same thing that you're doing now

15:52 samaaron: TimMc: yeah, i totally agree. I see the iPad app as an interface prototyping tool - but i really want to be manipulating real physical things

15:52 hence the nanoKontrol2 and the monome

15:53 mk: edw: the main problem with the ones you don't like is the culture, and some of the major problems are that it's more difficult to evaluate text, and that it's difficult to accurately rank content in general.

15:53 edw: mk: I don't know what content is or how one consumes it. I know what books and essays and articles are, and I know how to read such things. And I know how to look at paintings and photographs. But "content"? No.

15:54 I think we're on the same page, mk.

15:54 It's hard to reductively consume and "share" written compositions because it requires thought.

15:55 mk: edw: most of the ones you've mentioned (reddit, pinterest) are unappealing to you because they deal with very short term things - it takes seconds to look at a picture, and because it takes seconds, more people can rate it. That's a good first step towards figuring out how to provide you with essays and books

15:57 I think a lot of opportunities are being wasted there, though

15:58 (by the site operators - that users waste time there is obvious)

15:58 unlink`: Is there a baked-in method for spawning a bunch of threads, joining them, and exposing their results as a sequence wrapped in a future?

15:58 edw: mk: I'm much more radically oppossed to the the internet as it currently exists than you may realize, though I make my living off of it. To me it's all been down hill since September of '94. It's been Eternal September for almost 18 years.

15:58 unlink`: sort of like a mapM for futures...

15:59 cemerick: edw: I'm here for warez. Can you help me with my modem?

16:00 mk: unlink: erm, have a look at seque, doseq, dorun, etc.

16:00 edw: First, wait a sec, and type +++... And then wait a bit and type ATH and hit return...

16:00 AimHere: I thought the Eternal September was the 1993 one

16:01 unlink`: (defn sequence-futures [f xs] (future (map (comp deref future f) xs))) or something.

16:01 llasram: unlink`: pmap might be close?

16:02 Well, not really. It wraps each computation in a future, and tries to juggle a number of active computations relative to your number of cores, but doesn't wrap the whole thing up in a future

16:02 mk: edw: yeah. The eternal september problem (cf. a group is its own worst enemy etc.) is actually exactly the same as the "good content provision" problem, but the content is people

16:02 unlink`: llasram: yes, but I'll be doing I/O in f, so 2+numprocs isn't good enough.

16:04 edw: People are the things on the sidewalk between me and my cup of coffee.

16:04 samaaron: cemerick: i can build you a new acoustic coupler with overtone if you need one...

16:04 mk: unlink`: you want seque

16:04 cemerick: samaaron: heh, that'd be fun :-)

16:04 samaaron: then you can haz all the warez you needz

16:05 albeit after a very long wait ;-)

16:05 edw: That's misthanthropic enough to tweet...

16:05 cemerick: omg uuencode

16:06 mk: edw: you're talking about "strangers". People are much more interesting. At the very least, they serve as content filters, and powerful CLIs

16:07 samaaron: mk: people can also give hugs too :-)

16:07 unlink`: mk: Thanks. seque looks wonderful.

16:07 samaaron: and smiles - don't forget the smiles - people are also good for those

16:08 mk: unlink`: the default seems to use 100 for n, but you can change that to taste.

16:08 samaaron: :)

16:09 edw: In New York no one smiles. They frown if you smile at them. They assume you're deranged.

16:09 samaaron: edw: that shouldn't stop you from smiling anyway

16:09 mk: edw: have you tried hugs?

16:10 samaaron: i can attest that cemerick gives a jolly good hug

16:10 cemerick: samaaron: you would appreciate the Hugging Busker.

16:10 samaaron: cemerick: sounds great

16:11 does he have a sign that says "FREE HUGS"?

16:11 edw: samaaron: I know. I'm currently working on a finding-a-nice-friendly-smiling-girl-in-Washington-Square heuristic. It involves smiling. I'm a big smiler, but it's being beaten out of me.

16:11 cemerick: samaaron: exactly right

16:11 https://www.amazon.ca/Hugging-Life-Practical-Guide-Artful/dp/0978059905

16:12 He operates in Montreal. Was quite a treat.

16:12 hugod may know of him

16:12 samaaron: edw: fight it! Keep on smiling!

16:12 edw: I am a renowned hugger in Philly. Buy that was Philly.

16:12 samaaron: :-)

16:15 edw: The bitter irony is that I left Philly because I feared I'd die single there...

16:15 Wild_Cat: o.O

16:15 cemerick: wait, there's a hugging busker in Montreal? Where? (so that I can avoid that place and/or lure my unsuspecting friends there :p )

16:17 cemerick: Wild_Cat: we only saw him in old town

16:17 that's probably the only place where buskers can make a living anyway

16:17 Wild_Cat: cemerick: dunno, there's a ton of buskers in metro stations.

16:17 cemerick: oh, sure

16:17 maybe he's down below in winter

16:18 edw: cemerick: I noticed that your docs for pomegranate are wider than 80 cols.

16:18 Wild_Cat: (...admittedly, most of them suck and I have severe doubts about the logic of that choice of a career path for them -- but they must be making *some* money to keep coming back)

16:29 technomancy: we have a "FREE HUGS" guy in seattle too

16:29 or maybe the Montreal guy was vacationing here; who knows

16:29 AimHere: It's a franchise

16:30 dnolen: if you're a student GSoC 2012 applications start today, http://www.google-melange.com/gsoc/homepage/google/gsoc2012

16:35 pandeiro: ibdknox: is there a way disable the default public/css/* in the noir jar? I specified :resource-options and it works, but continues to serve the stuff from the jar

16:40 mk: what does memfn do?

16:41 AimHere: ,(doc memfn)

16:41 clojurebot: "([name & args]); Expands into code that creates a fn that expects to be passed an object and any args and calls the named instance method on the object passing the args. Use when you want to treat a Java method as a first-class fn."

16:41 mk: how is it different from (.method ...)

16:42 Bronsa: you can map/apply it

16:42 amalloy: &(macroexpand '(memfn length))

16:42 lazybot: ⇒ (fn* ([target__4045__auto__] (. target__4045__auto__ (length))))

16:42 clojurebot: It's greek to me.

16:43 TimMc: There's something weird about the &args, but I don't remember the details.

16:43 Bronsa: ,(map (memfn toString) [1 2])

16:43 clojurebot: ("1" "2")

16:43 Bronsa: ,(map .toString [1 2])

16:43 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: .toString in this context, compiling:(NO_SOURCE_PATH:0)>

16:45 mk: so it's a curried function, or...? does the returned function take objects, or does it feed args to an original object/partial?

16:45 AimHere: Well it's 'first class', so you can throw it around like you would a normal clojure function

16:47 Use the function proper as a function arg, or return it or whatever you like

16:47 ,(map .toString [1 2 3])

16:47 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: .toString in this context, compiling:(NO_SOURCE_PATH:0)>

16:47 AimHere: ,(map (memfn toString) [1 2 3])

16:47 clojurebot: ("1" "2" "3")

16:48 AimHere: ,(map Integer/toString [1 2 3])

16:48 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to find static field: toString in class java.lang.Integer, compiling:(NO_SOURCE_PATH:0)>

16:48 AimHere: That's probably the better example of the problem

16:49 mk: ,(map #(.toString %) [1 2 3])

16:49 clojurebot: ("1" "2" "3")

16:50 AimHere: TMTOWTDI

16:55 mk: ,(map (memfn indexOf) ["abc" "abc"] ["a" "b"])

16:55 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: clojure.lang.ArityException: Wrong number of args (2) passed to: sandbox$eval27$fn>

16:56 mk: ,(map (memfn indexOf "abc") ["a" "b"])

16:56 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.security.PrivilegedActionException: java.lang.Exception: Unsupported binding form: abc>

16:56 mk: what am I confused about here...

16:56 what sort of args is memfn supposed to take?

16:56 amalloy: ,(map (memfn indexOf target) ["abc" "abc"] ["a" "b"])

16:56 clojurebot: (0 1)

16:57 amalloy: you have to tell it how many args to expect, by naming any args other than the implicit first-arg object

16:58 mk: ah, I see. This does seem cleaner than using #(.indexOf %1 %2)

16:59 thanks

17:01 TimMc: mk: It just doesn't allow hinting, that's all.

17:01 amalloy: yeah, i was thinking a while ago it'd be nice to add hinting to memfn

17:01 (memfn ^String indexOf ^String target)

17:02 mk: type can't be inferred on the basis of e.g. indexOf?

17:03 ...forget I asked

17:04 does memoize ever recompute values? It seems like a memory-leak.

17:05 Chousuke: mk: memoize is an intentional memory leak :p

17:05 * technomancy is still annoyed his 3-line patch to expose the memoization cache got rejected

17:05 Chousuke: mk: it's best used for functions that are not called with arbitrary inputs

17:07 mk: Chousuke: I'm thinking of, what is it, fib numbers? If I'm doing recursive calls, I want a bit of caching, but I don't want it to hang around for too long after

17:07 Chousuke: mk: nah, fib is exactly not what you want memoize for

17:08 mk: but if you have eg. a template compiler, you might want to memoize that

17:08 you won't usually have more than a few templates, so it won't grow indefinitely

17:08 TimMc: You can also use it for limited-lifetime stuff.

17:09 Chousuke: right. if you pass the function returned from memoize as a parameter somewhere

17:09 cemerick: edw: Yup. Many of my source code files extend to 100 or 120 columns, too.

17:09 * cemerick is a heretic

17:09 Chousuke: and it gets gc'd later

17:09 replaca: cemerick: but how are you going to fit that on a punched card?

17:10 technomancy: cemerick: eclipse does support splitting your window though, right?

17:10 replaca: you might want to leave col 73-80 free for a serial number too, in case you drop the card deck

17:11 cemerick: technomancy: sure, 100 different ways. Why?

17:11 TimMc: replaca: That's what permanent marker is for, just draw a diagonal line.

17:11 Man, get with the times.

17:11 technomancy: cemerick: usually it's the textmate users who are loud and proud about 100+-column-lines

17:11 due to the fact that they can't split their editor

17:12 replaca: TimMc: I used to have a machine that would add the numbers for me :) and then sort them later. A big electormechanical thing that made great noises.

17:14 mk: technomancy: why was the patch rejected?

17:15 technomancy: mk: because core.cache exists, afaict

17:18 yoklov: I usually use 120 column and split emacs vertically

17:18 if it's not split (horizontally) 80 columns always looks so small

17:18 solussd__: any lobos users in the room? :)

17:21 acts_as_joel: Hi, I'm a beginner with clojure, working through ociweb..mark/clojure...tring to wrap my head around binding. Is binding difficult to work with, are there conventions about when to/when not to use that vs 'let'?

17:22 Raynes: binding and let serve entirely different purposes.

17:23 ibdknox: the former should be used very sparingly

17:23 Raynes: binding is there to rebind dynamically rebindable vars (usually named with asterisks).

17:23 acts_as_joel: ah, ok, that's what I was wondering (re: sparingly)

17:23 the asterisks are a convention?

17:23 DerGuteMoritz: s/rebindable/scoped/

17:24 ibdknox: it introduces complexity that you only want if you have to have it

17:24 Raynes: (let [writer (java.io.StringWriter.)] (binding [*out* writer] (println "foo") (str writer)))

17:24 DerGuteMoritz: Eh?

17:25 DerGuteMoritz: Raynes: well, lexically scoped vars (e.g. those bound by let) are also rebindable

17:26 cemerick: replaca: I usually just staple two punch cards together

17:26 :-)

17:26 acts_as_joel: ok, so here we want *out* to have the same value in other functions scopes (within the binding scope)

17:26 amalloy: acts_as_joel: the distinction is between dynamic scope (binding) and lexical scope (let). if you don't know the difference, you might read up on those two topics before trying to understand let/binding in particular

17:26 cemerick: technomancy: I probably wrote that README in textmate or sublime :-P

17:26 though I'm still not clear on what splitting of editors has to do with line length

17:26 replaca: cemerick: you're the one who keeps jamming up the card reader!

17:27 technomancy: cemerick: if your editor can't help you fit multiple files on screen at once, then you're not going to mind files so wide that you can only view one at a time

17:27 Raynes: DerGuteMoritz: You can't rebind a name created by let with binding.

17:27 DerGuteMoritz: It isn't a var.

17:27 acts_as_joel: amalloy true, working my way through the volkmann intro, no doubt those topics will come up further in

17:28 DerGuteMoritz: Raynes: no but you can rebind it with let is what I meant :-)

17:28 edw: So wait, did I touch off a conversation with my "your docs are the wrong width" comment?

17:28 Raynes: Yeah, but that's...

17:28 acts_as_joel: thanks, guys!

17:29 DerGuteMoritz: anyhow, I'm off, good night!

17:29 ibdknox: lol

17:35 mk: ,(conj [0 88 1 88] {0 99 1 99})

17:35 clojurebot: [0 88 1 88 {0 99, 1 99}]

17:36 mk: I don't think I'm a fan of how conj works with maps. If the left param were a map, the output would be {0 99 1 99}

17:36 AimHere: Well it's asymmetric. conj adds the second argument to the collection that happens to be the first argument

17:37 technomancy: mk: agreed; it's very strange

17:38 mk: AimHere: but for maps, it doesn't add the map on the right, it uses it to overwrite values

17:39 tmciver: mk: a map is not sequential; there is no adding to the right.

17:40 mk: tmciver: sorry, I meant the right param map

17:40 ,(merge {0 9} {0 8} {1 8} {2 8}) (conj {0 9} {0 8} {1 8} {2 8})

17:40 clojurebot: {2 8, 1 8, 0 8}

17:41 TimMc: ~maps

17:41 clojurebot: maps are functions

17:41 TimMc: ~maps

17:41 clojurebot: maps are functions

17:41 mk: so are vectors and lists

17:41 TimMc: clojurebot: maps are the red-headed stepchild of the collection family

17:41 clojurebot: Gabh mo leithscéal?

17:42 TimMc: clojurebot: botsmack

17:42 clojurebot: clojurebot evades successfully!

17:43 tmciver: mk: but overwriting is the only thing that makes sense. Otherwise you'd need duplicate keys, yes? If you want something other than overwriting, merge-with may be what you want.

17:44 mk: tmciver: the problem isn't with overwriting, the problem is with conj treating the maps as index-replacements for maps, and as simple values for everything else

17:44 ,(conj [0 9] {0 8} {1 8} {2 8})

17:44 clojurebot: [0 9 {0 8} {1 8} {2 8}]

17:45 mk: I want [8 8 8]

17:46 oh well.

17:47 TimMc: mk: I would expect (conj [0 9] a b c) => [0 9 a b c] for all a b c

17:47 tmciver: mk: I think conj is doing what it's advertised to do. What you want will require code, I think.

17:47 TimMc: The real problem is actually the other behavior you mention.

17:49 mk: TimMc: ,(conj {:a 0} {:b 9} :a :a)

17:49 ,(conj {:a 0} {:b 9} :a :a)

17:49 tmciver: mk: I should say it will require you to write code. I don't know of any existing function that does what you want to the vector.

17:49 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword>

17:52 mk: tmciver: assoc handles that for vectors (and maps)

17:53 I initially thought maybe I was missing something in terms of understanding conj, but probably not. It's just ugly.

17:55 tmciver: mk: well yes, but not as in your example above: (assoc [0 9] {0 8} {1 8} {2 8})

17:58 mk: tmarble: right - I think I meant more that assoc was consistent over the various colls

18:01 solussd__: is there an efficient way to translate :this_thing into :this-thing (e.g. when reading from a database that uses underscores into a map where i'd like dashes in my keys' keywords

18:01 septomin: mk: note that assoc on a vector doesn't extend the vector

18:03 mk: septomin: interesting - thanks

18:03 though apparently it does extend it if it appends to the end

18:04 tmciver: mk: but you wouldn't use assoc for that - you'd use conj. ;)

18:05 septomin: huh, that's kind of odd actually

18:05 mk: solussd__: (keyword "abc")

18:05 septomin: ,(assoc [] 1 :a)

18:05 clojurebot: #<IndexOutOfBoundsException java.lang.IndexOutOfBoundsException>

18:05 cemerick: technomancy: if your editor can't wrap lines reasonably, then you're going to mind files that are wider than X ;-)

18:05 septomin: ,(assoc [] 0 :a)

18:05 clojurebot: [:a]

18:06 cemerick: I mostly write code and prose to be maximally readable…which often stays below 80 cols in the former case. *shrug*

18:06 Raynes: I don't wrap lines anymore.

18:06 I just never write code that is longer than my text editor window.

18:06 If I need to write longer lines, I make said window wider.

18:06 mk: septomin: I suspect that the right thing to do is return a sparse array instead of throwing an exception

18:06 technomancy: cemerick: yeah, for docs you can get away with wrapping

18:06 mk: septomin: but then you lose proper iterability

18:07 solussd__: mk: I'm trying to map :this_thing to :this-thing, i.e. replace underscores with dashes. The only way I can think of doing it is (-> :this_thing name replace-underscores keyword), where replace-underscores is replacing a substring, which seems awfully inefficient for something that amounts to code style.

18:08 zzach: Does anybody know a reference to Clojure source code implementing a TCP forwarding proxy?

18:08 septomin: mk: is there a sparse array data structure in core?

18:10 mk: solussd__: is it really a keyword when it comes out of the database?

18:11 solussd__: mk, it's a keyword out of norma. :)

18:11 *korma

18:11 mk: septomin: yeah - map ;)

18:12 septomin: I'm not sure if there's a proper one though, and maybe it's for the best, because the ones we have now guarantee that they won't have holes

18:13 septomin: yeah, it seems like a lot of extra complexity

18:15 maybe you could use replace for this?

18:15 mk: solussd__: I ended up searching clojure-log.n01se.net for korma underscores. Somewhat amusing. Hi future reader of the logs.

18:15 septomin: I'm not sure I understand the original problem

18:16 you have a map of ints to values, and you want to create a vector where the keys are the indices?

18:17 mk: solussd__: I'd just do the replacement. I wouldn't want the underscores leaking out into the rest of my code, yaknow?

18:17 Raynes: I've tried to search those logs before.

18:17 Didn't work out.

18:17 TimMc: solussd__: Sounds like a job for... conjugation!

18:17 Raynes: I just grep my own logs these days.

18:17 lazybot keeps logs of this channel on his server.

18:18 TimMc: so does timbot

18:18 I mean, so do I.

18:18 solussd__: TimMc: thanks

18:19 TimMc: have a link? the googles are failing me

18:19 TimMc: solussd__: It's the name of a technique. I don't think there's a helper in core.

18:20 mk: septomin: I think my original query was something about conj and expected behaviour, and then I praised assoc for symmetry which you rightly pointed out it didn't have

18:20 TimMc: name/keyword form an inverse pair of fns going between string and keyword space, and replace-underscores is being run in string-space

18:21 mk: septomin: I have no practical question, I'm just reading the docs for all the clojure functions/macros

18:22 septomin: oh right - I think the thing is that if conj dispatches on the type of the collection (which it must) it can end up looking odd depending on what you're adding

18:22 amalloy: TimMc: did you read that article about "under" in (i think) APL?

18:22 TimMc: Hmm, no.

18:23 brehaut was telling me about conjugation -- not sure if it is reified in Haskell, but I think it is

18:23 mk: septomin: yeah, not only that, but it behaves like merge when you've got a map and pseudo-assoc when you've got anything else

18:23 TimMc: amalloy: What is APL?

18:24 solussd__: fuckit (defn keyword_- [kw] (str/replace (name kw) #"_" "-"))

18:24 dnolen: A Programming Language (APL)

18:24 brehaut: TimMc: ∆˝Ï˝ÔÚÇΉÔ؇fi˝◊˜◊¨21

18:24 TimMc: Oh, that.

18:24 solussd__: array programming language? :)

18:24 TimMc: I thought it was the name of a book.

18:24 solussd__: the predecessor to J.

18:24 dnolen: good read http://www.elliscave.com/APL_J/tool.pdf

18:24 solussd__: apl is cool

18:25 amalloy: ah, here we go

18:25 http://prog21.dadgum.com/121.html and then the sequel http://prog21.dadgum.com/122.html

18:26 septomin: mk: I think it makes sense when you consider what it means to add to a map

18:28 mk: septomin: right, but any ordered sequence is also a mapping (from N to values)

18:30 septomin: sure, but other sequences are not just mappings

18:30 mk: septomin: see clojure.lang.Associative

18:31 septomin: right, but if conj etc. treat one as a mapping, they should treat the others as such

18:32 septomin: mk: i don't agree, conj has to let you add an arbitrary object to a vector

18:33 given that you can't add an arbitrary object to a map, it's reasonable to have conj mean "add this key and value"

18:35 mk: ,(conj {1 1} {1 9 2 9})

18:35 clojurebot: {2 9, 1 9}

18:35 mk: ,(conj [1 1] [1 9 2 9])

18:35 clojurebot: [1 1 [1 9 2 9]]

18:36 mk: it merged the first, but appended the second

18:38 ,(conj {1 1} [2 2] [1 2]) ; this is how maps should work with conj

18:38 clojurebot: {2 2, 1 2}

18:41 septomin: it would be kind of crazy for conj on a vector not to append

18:41 mrmekon: how does dot-notation method access work in ClojureScript?

18:41 I want a partial function to a native JS method

18:42 mk: mrmekon: memfn

18:45 septomin: sure, but then it shouldn't sometimes behave like merge

18:45 septomin: so it would just die on that map case?

18:45 mrmekon: mk: that doesn't seem to exist. is it new?

18:47 mk: mrmekon: it's since 1.0 ... (doc memfn) ?

18:48 mrmekon: error. I just realized I can't tell what version I'm even using. whatever cljsbuild grabbed

18:49 mk: septomin: yep, with an exception. You're never going to polymorphically mix what sort of collection you're applying it to

18:49 mrmekon: (doc doc) ?

18:50 septomin: i could buy that

18:51 mrmekon: clojurescript doesn't seem to have doc. You noticed the *script* on the end there, yeah? :)

18:51 emezeske: mrmekon: Could you just use something like #(.length %) ?

18:52 mrmekon: I don't think memfn is implemented for clojurescript

18:52 mrmekon: yeah, looks like memfn is excluded in core.clj

18:54 emezeske: mrmekon: Err, my example should have been #(.-length %)

18:54 mk: mrmekon: err, I think I ignored that you were using js. partial doesn't work over there?

18:55 mrmekon: I have (.webkitRequestAnimationFrame (dom/getWindow) #(do-stuff)) working

18:55 or, alternatively, (. (dom/getWindow) webkitRequestAnimationFrame #(do-stuff))

18:56 emezeske: mrmekon: Is that not sufficient for what you're doing?

18:56 mrmekon: but I would really like a partial or anonymous function that I can later apply args to, and I can't seem to get it working with any combination of syntax that I know

18:56 emezeske: mrmekon: #(.-member-requiring-two-args first-arg %)

18:57 mk: we don't have a javascript bot do we

18:57 amalloy: we call him...google chrome

18:58 cemerick: oh god no

18:59 I'm going to add a jvm bytecode bot if a js bot shows up. :-P

18:59 emezeske: I think mk meant a clojurescript bot

18:59 mrmekon: oh, there we go. Anonymous function notation works without the hyphen

19:00 cemerick: emezeske: ah. Sorry for the nerd rage in that case. ;-)

19:00 emezeske: cemerick: ^_^

19:00 * gfredericks gets to work on a css bot

19:01 mk: ...I actually wouldn't even mind watching a bytecode bot get used properly

19:01 brehaut: gfredericks: just make it silently ignore you

19:01 gfredericks: brehaut: it will ignore you in different ways depending on your irc client

19:01 brehaut: lol

19:02 mrmekon: ok, new but similar question

19:02 how do I test for whether a JS method exists?

19:02 lynaghk: mrmekon: see if the corresponding property is nil; (nil? (.-lehfn js-thing))

19:03 * gfredericks doesn't want to know if cljs distinguishes between null and undefined

19:03 mrmekon: that's what I tested first. it seems to return false no matter what

19:05 mk: it's unfortunate that in (assoc [8 9] 0 1) (dissoc [1 8 9] 0), the first works but the second fails

19:06 gfredericks: mk: you'd want [8 9]?

19:06 technomancy: mk: finger trees can do that

19:06 lynaghk: mrmekon: ah, you're right. I could have sworn that's what I did in the past.

19:06 gfredericks: &(dissoc [1 8 9] 2)

19:06 lazybot: java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.IPersistentMap

19:06 technomancy: they're a lot more flexible than vectors, but there's a fair amount of overhead for them

19:07 mrmekon: if I print the type, one that exists is a function and one that doesn't exist is... an empty string? a newline? I can't tell what it's trying to represent there

19:07 mk: gfredericks: yep. Just seems strange that one plays with vectors and the other doesn't

19:07 gfredericks: mk: they work with as much as is natural for the data structure

19:07 lynaghk: mrmekon: ah you want the undefined? fn.

19:07 gfredericks: you can't remove efficiently from the front of a vector

19:08 mrmekon: yeah, there we go, fn? works

19:08 thanks!

19:08 mk: ,(assoc [8 9] 2 1)

19:08 clojurebot: [8 9 1]

19:08 septomin: you also can't remove sanely from the middle of a vector

19:08 gfredericks: mk: I think mostly assoc works with vectors because vectors allow updates in arbitrary locations efficiently

19:08 mk: gfredericks: if the above works, the rest should too

19:08 gfredericks: so otherwise you'd have to make up a new function for doing that

19:09 vassoc

19:09 technomancy: mk: dissocing off the end should work; dissocing off the head should not

19:10 gfredericks: technomancy: it doesn't

19:10 mk: I'm ok with a structure failing an operation, but there's no reason you can't dissoc from the tail of a vector

19:10 technomancy: right, agreed

19:10 technomancy: gfredericks: right; that's dumb.

19:10 gfredericks: technomancy: okay, I misinterpreted "should"

19:10 (dec english)

19:10 lazybot: ⇒ -1

19:10 technomancy: gotcha

19:11 TimMc: Is dissoc undefined for vectors because no one has written an O(log n) impl?

19:12 mk: TimMc: dissoc would only work at the tail, I think. The head is alright if it can be done quickly

19:13 emezeske: TimMc: is O(log n) possible for a true contiguous vector?

19:13 gfredericks: technomancy: although it would be weird for (partial dissoc my-vec) to have an infinite amount of args it crashes on and a single arg it doesn't crash on

19:13 TimMc: emezeske: Clojure's vectors are fancy underneath.

19:13 emezeske: TimMc: Ah, so not contiguous, makes sense

19:13 lynaghk: (fancy = trees trees trees trees)

19:13 TimMc: $google clojure vector 32-way

19:13 lazybot: [Understanding Clojure's PersistentVector implementation | Higher ...] http://blog.higher-order.net/2009/02/01/understanding-clojures-persistentvector-implementation/

19:13 gfredericks: TimMc: you'd have to redo the structure to dissoc arbitrarily

19:14 emezeske: TimMc: I was gonna say, O(log n) would be exciting news to me :)

19:14 gfredericks: they'd end up being more like finger trees

19:14 and therefore less performant I guess

19:14 septomin: if we're talking about dissoc for the tail specifically, there's butlast or pop

19:15 TimMc: gfredericks: I'll have to read that article again more carefully to figure out if it makes sense to me that random updates are fast but not random removals.

19:15 gfredericks: TimMc: I think removals are O(n), because you have to shift everything around

19:16 mk: arbitrary dissoc shouldn't affect the mappings of the other keys, but it would if you plan to shift everything

19:16 gfredericks: in a vector the position of an item in a chunk never changes

19:16 TimMc: hmm

19:16 if you had offsets...

19:16 * gfredericks goes off to dinner

19:16 TimMc: me too

19:16 septomin: shifting indices seems like the clearly wrong thing

19:17 mk: septomin: yep, hence tail (never head, as I said before)

19:19 technomancy: TimMc: if you had offsets, you'd have finger trees =)

19:19 septomin: it just seems like pursuing completeness for its own sake to have a function only work on one value

19:19 TimMc: technomancy: OIC

19:20 septomin: the number of times that behavior would be useful seems pretty outweighed by the number of times people would think it does something else

19:20 * TimMc adds to reading list

19:26 mk: septomin: I think this sort of thing suggests that a cleaner distinction should be made between sparse and non-sparse, etc.

19:29 amalloy: distinction: vectors are non-sparse

19:36 mk: ,(select-keys [0 1 2 3 4 5] [0 1 2])

19:36 clojurebot: {2 2, 1 1, 0 0}

19:36 Frozenlock: ,(apply Integer/parseInt ["1" "2" "3"])

19:36 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to find static field: parseInt in class java.lang.Integer, compiling:(NO_SOURCE_PATH:0)>

19:36 mk: why is this returning a map.

19:36 Frozenlock: -_-

19:37 mk: select-KEYS ? (I suppose keys are expected in maps)

19:37 mk: Frozenlock: you wanna map that

19:38 Frozenlock: Yeah, any idea how to do it? (without an anonymous fn)

19:38 mk: Frozenlock: I gave it an array, and it behaved correctly, but returned a map. Nevermind, I see why - no sparse arrays allowed.

19:38 Frozenlock: ,(apply + [1 2 3])

19:38 clojurebot: 6

19:39 Frozenlock: Oh sure, THIS works.

19:39 mk: Frozenlock: apply injects the + into the start of the given list

19:40 Frozenlock: Ahhhh, no wonder then.

19:42 Is it because a method isn't a function?

19:42 ,(map (fn [a] (Integer/parseInt a)) ["1" "2" "3"])

19:42 clojurebot: (1 2 3)

19:43 mk: Frozenlock: I was thinking memfn, but apparently that doesn't work for static methods

19:43 Frozenlock: Isn't there a clojure function to parse strings?

19:46 mk: ,(map bigint ["1" "2"])

19:47 clojurebot: (1N 2N)

19:47 qbg: &(read-string "(+ 2 2)")

19:47 lazybot: ⇒ (+ 2 2)

19:47 qbg: Frozenlock: Like that?

19:48 Frozenlock: ,(map read-string ["1" "2" "3"])

19:48 clojurebot: (1 2 3)

19:48 mk: ,(map read-string ["1" "(drop-table)"])

19:48 Frozenlock: Hmm yeah, that could do it :)

19:49 clojurebot: (1 (drop-table))

19:49 qbg: You might want to set *read-eval* to be false ,depending on where that data comes from

19:50 Frozenlock: ,(let [*read-eval* false] (map read-string ["1" "2" "3"]))

19:50 clojurebot: (1 2 3)

19:51 qbg: Use binding

19:51 not let

19:51 mk: you should use something that completely fails when it's not an int, and is guaranteed to not come near eval code. Also, *read-eval* should be let, if I have that right - you don't want to set, it, have someone unset it, and then you've got a hole

19:51 qbg: &(Integer/valueOf "123")

19:51 lazybot: ⇒ 123

19:52 qbg: If you use let, you aren't setting *read-eval* to false

19:53 mk: ,(map #(Integer. %) ["1" "2"])

19:53 clojurebot: (1 2)

19:53 Frozenlock: http://stackoverflow.com/questions/1523240/let-vs-binding-in-clojure

19:54 I spend too much time in emacs (where let is dynamic).

19:58 Yay.. tried sqrt, square-root, sr, only to realize it must be something in java.

19:59 ie Math/sqrt

20:27 yoklov: aha! replacing the sets with arrays in clojurescript have brought the performance of this program from totally unusable to almost tolerable!

20:38 * emezeske congratulates everyone on reaching Level 10 of the "Don't Bump the Alternative set literal syntax Thread" achievement.

20:39 technomancy: emezeske: if nothing else, we can all take away a lesson on the value of a carefully-curated killfile

20:39 emezeske: technomancy: Yeah, that and I also learned personally that feeding is bad.

20:40 ibdknox: hey guys. Long time listener, first time caller - I don't like the syntax for maps. Can we change that?

20:40 emezeske: *click*

20:40 ibdknox: how rude!

20:40 ;)

20:41 emezeske: *plonk*

20:41 technomancy: kind of reminds me of https://github.com/clojure/clojure/pull/6

20:42 ibdknox: lol

20:43 mk: where's this alt set literal thread?

20:43 muhoo: mk: don't touch it!!!! it's evil!!!

20:43 emezeske: mk: don't do it!

20:43 * emezeske is ashamed he even mentioned it.

20:43 mk: I just want to look! I promise!

20:45 muhoo: www.youtube.com/watch?v=mY9Z5OPzE78

20:46 amalloy: seancorfield: there seem to be some reflection warnings in clojure.java.jdbc - calling .getCause on exception objects but without hinting them as exceptions

20:46 seancorfield: patches welcome via jira :)

20:46 srsly i didn't think it was worth trying to optimize the exception handling case

20:47 but now the mood seems to be that all reflection warnings in contrib should be removed unless doing so makes the code more complex (e.g., functions that are already polymorphic on a group of Java types)

20:52 how many folks are using pmap? how lazy is it in reality?

20:52 amalloy: seancorfield: oh, i agree it's not worth optimizing; it's only worth doing to reduce the "noise" so actually-important warnings stick out

20:52 technomancy: seancorfield: most of the time I've tried pmap I realized later I really wanted pdoseq.

20:53 muhoo: is there a pdoseq?

20:53 technomancy: no

20:53 seancorfield: :)

20:54 maybe i should just try pmap in this case and see what happens :)

20:54 technomancy: seancorfield: it works fine if each element costs roughly the same amount of time

20:56 mk: I think dorun map is faster than doseq

20:56 amalloy: sigh, jira is such a pain, seancorfield. what if instead, you just add ^Throwable to line 217 of internal.clj?

20:57 technomancy: oh man amalloy, are you on jira strike?

20:58 amalloy: i've confirmed that that change fixes all reflection warnings, and doesn't cause any tests to fail

21:02 does anyone remember what the deal is with (= some-char another-char)? the compiler seems to inline that into (clojure.lang.Util/equiv some-char another-char), and then decides to compile it into something reflective, even when it knows both arguments are characters

21:06 seancorfield: amalloy: so it would read (letfn [(throw-non-rte [^Throwable ex] ... ?

21:06 amalloy: yes

21:07 seancorfield: done & pushed

21:07 amalloy: thanks

21:08 seancorfield: of course, if exceptions had never been wrapped in RTEs in the first place, we wouldn't need that code...

21:08 amalloy: yeah

21:08 now that's fixed for 1.4 afaik, but you're probably stuck with the code forever to support 1.3

21:09 seancorfield: yeah :(

21:09 don't you have commit access to c.j.jdbc anyway?

21:10 amalloy: i do, but i don't really know when it's appropriate to use it

21:11 since it's not a project i'm officially a participant of

21:12 seancorfield: i think the general rule is just to ask the project lead for permission to do small stuff like that

21:13 most leads seem fine with reflection warning cleanup (although i've been known to break code with over-zealous cleanup - in congomongo - oops!)

21:13 amalloy: *chuckle*

21:16 ah, this is nice. i've found another reason to prefer 1.4 over 1.3: (= \a (.charAt "a" 0)) has a reflection warning on 1.3, but not on 1.2 or 1.4

21:17 seancorfield: yeah, = got a specialized case for Character in 1.4 i think

21:17 i remember seeing some discussion of it because it was causing lots of reflection warnings in a number of contrib libraries

21:17 amalloy: right, i remember it too but don't really know what the root problem was

21:17 seancorfield: = had numeric specializations but not character :)

21:18 amalloy: right, but what happened between 1.2 and 1.3 to create the problem?

21:19 was there no numeric specialization in 1.2, maybe?

21:21 seancorfield: dunno much about 1.2 :)

21:21 the commit to fix it (in 1.4) was this https://github.com/clojure/clojure/commit/405d24dd49d649c01b7881f1394fc90924c54ef0

21:25 amalloy: huh, okay. thanks

21:25 jimduey: dnolen: Are you around?

21:31 Frozenlock: Noooooo! Contains! Y u are for keys?!?!

21:32 Somehow I thought it was something like "If the sequence -contains- the argument, return true".

21:32 xeqi: that comes up often

21:33 Frozenlock: Well at least I'm not the only fool :p

21:33 xeqi: &(some #{:a} [:a :b :c])

21:33 lazybot: ⇒ :a

21:34 xeqi: &(some #{:d} [:a :b :c])

21:34 lazybot: ⇒ nil

21:35 blakesmith: Do most people deploying ring/noir/compojure webapps go the "build a war and drop it into the webapps directory" approach? Are there any clojure based tools similar to capistrano for managing deploys?

21:36 weavejester: blakesmith: A lot of deployments use the Jetty adapter, and then something like nginx to proxy.

21:37 There's also pallet which is similar to chef

21:37 And there are tools like lein-beanstalk for deploying to AWS, and Heroku also supports Clojure.

21:38 blakesmith: Ah, cool. I didn't think of using pallet for deployments.

21:38 * blakesmith just thought about it for provisioning.

21:38 Frozenlock: Can't jetty be used directly? Why would you want to proxy?

21:39 gfredericks: Frozenlock: I was thinking that too but I was too embarrassed to ask

21:39 my guess is you use nginx for the static stuff?

21:39 weavejester: Frozenlock: Proxying is useful so you don't have to run as route, and so you can load-balance

21:39 It also helps with SSL

21:39 blakesmith: I like doing my rewrite rules and other lb stuff in nginx.

21:39 weavejester: And if you want to run more than one service

21:40 ibdknox: gzip is also much more efficient through nginx

21:40 gfredericks: "run as route"?

21:40 weavejester: Er… root :)

21:40 ibdknox: and you can run multiple apps on one box

21:40 weavejester: Clearly I'm thinking phoenetically.

21:40 ibdknox: without reverse proxying, you couldn't really

21:40 gfredericks: weavejester: now I'll start using soudo

21:40 weavejester: gfredericks: :P

21:40 blakesmith: weavejester: Thanks for the advice, I appreciate it.

21:49 metajack: I'm getting "No absolute path for file metadata" from autodoc. Any idea why that would be? It seems to only happen on some files, but there's no indication as to what causes it or how to fix it.

22:07 Frozenlock: Clojure (the original Java-based implementation)

22:07 ClojureScript (compiles to JavaScript)

22:07 ClojureCLR (for Microsoft's .NET framework)

22:07 clojure-py (Python-based)

22:07 clojure-scheme (compiles to Scheme)

22:07 And I believed there was only clojure and clojurescript

22:07 Silly me.

22:09 xeqi: and CinC

22:09 Frozenlock: CinC?

22:10 xeqi: I've seen mention of someone working on clojure in clojure

22:10 maybe https://github.com/remleduff/CinC ?

22:10 technomancy: I think that's intended to still be JVM-hosted

22:11 Frozenlock: http://blog.n01se.net/?p=41

22:14 devn: technomancy: i dont think so

22:14 mk: technomancy: but presumably a clojure in clojure can still run on the jvm, it just wouldn't touch any java code...

22:14 Frozenlock: mk: pa-ra-di-se :P

22:14 Raynes: technomancy: Intended to be JVM-hosted and destined to be ignored by core. :(

22:14 devn: Raynes: why do you say that?

22:15 Frozenlock: No more Integer/parseInt call :D

22:15 Raynes: They've been pretty apprehensive about it. They actually told him to not get his hopes up, I think.

22:15 ibdknox: that thread made me sad :(

22:15 Raynes: I think he is not accepting pull requests though.

22:15 devn: i didnt actually see that one

22:15 Raynes: So perhaps he'll be able to keep track of everybody who contributes.

22:15 devn: (that thread)

22:15 Raynes: But I fear it wont be enough.

22:16 technomancy: file under "how not to encourage and empower your most enthusiastic users"

22:16 Raynes: Not to say that I don't think it is fair to turn it down if it was poorly implemented.

22:17 But pretty much any political reason would really bother me.

22:17 devn: i have a feeling there is work going on behind the scenes for CinC

22:17 there always has been, clojurescript was behind the scenes work toward CinC

22:17 Raynes: They do tend to do stuff behind the scenes.

22:18 Which makes sense, because people are so opinionated about things.

22:18 devn: yeah dude, cedric, jesus.

22:18 Frozenlock: CinC would be host independent? Your code could work everywhere?

22:18 technomancy: Frozenlock: that's not the main goal

22:19 Raynes: devn: Cedric is a troll -- not opinionated.

22:19 Your code would not work everywhere.

22:19 devn: the Cedric guy on the mailing list bummed me out today. i think he's bumming a lot of people out. can't we just ban him?

22:19 Raynes: That's not really feasible.

22:19 rlb: Frozenlock: I would assume you would still need platform functions.

22:19 Raynes: Any significant code is likely to rely on platform specific libraries.

22:19 rlb: Unless there's some plan for a clojure "standard library".

22:19 (which would surprise me)

22:19 Raynes: But then again, dnolen apparently did magic and made core.logic work on clojurescript.

22:20 qbg: core.logic was not that close to the host

22:20 technomancy: core.logic is totally algorithmic

22:20 Raynes: I don't know anything about core.logic.

22:20 qbg: Besides it being pure win?

22:21 Raynes: I hear.

22:21 Constantly.

22:21 I'm sure I'll have a reason to use it eventually.

22:21 qbg: I just watched the miniKanren talk. "Lets generate 30 programs that evaluate to 6"

22:21 devn: ive been reading, but it's slow going

22:21 gfredericks: Raynes: QUICK! who owns the zebra?

22:21 devn: i bought the art of prolog

22:22 Raynes: gfredericks: Drugs are bad for you.

22:22 devn: but that is heavy duty -- i backed off and am working through the reasoned schemer instead

22:22 brehaut: Raynes: nah, its the albanian on the fifth floor

22:22 Raynes: I have no idea what we're talking about.

22:22 brehaut: zebras

22:22 qbg: zebrao

22:23 devn: zebro

22:23 Raynes: Oh.

22:23 devn: btw, what *is* the reason for the -o suffix on logic fns?

22:23 Frozenlock: There was something about core.logic. Then TSHTF.

22:23 qbg: devn: It denotes that it is a relation

22:23 Raynes: The zebra puzzle.

22:23 devn: qbg: thank you.

22:23 mk: Raynes: the zebra problem, aka einstein's riddle, which says things like "the guy who lives next to the woman who drinks coffee eats cakes"

22:23 Frozenlock: I'm the Doppler effect.

22:24 Raynes: Yeah, if I ever need to solve that I'll pull out core.logic.

22:24 devn: more like doppelganger

22:24 qbg: If you ever need to get a start up idea, pull out core.logic

22:24 devn: kibit is using core.logic in a really cool way

22:24 mk: Raynes: and so on. Then, you use logic to figure things out. Also, something about books we've read, trolls, and um...

22:24 qbg: Write good-startupo, and run it backwards

22:24 muhoo: heheh

22:24 devn: ambrose' plans to create drop in type checking in clojure are awesome

22:25 Raynes: Apparently I just need to read something by Byrd and the origin of life will become clear to me. And I'll grow wings and stuff.

22:25 devn: kibit is i think one of my current favorite projects

22:25 brehaut: Raynes: failing that, you could always read bratko and learn about monkeys and bananas

22:26 devn: ivan...such a weird dude.

22:27 reminds me of a logic professor i had who was australian. every example all semester was in some way related to wombats, marsupials, kangaroos, dropbears, etc.

22:27 struck me as weird at the time, so weird in fact that i remember almost everything he said

22:27 muhoo: it seems to me like another level of abstraction. instead of writing code that walks through stuff in time, procedurally or functionally, you write rules, and let the code decide how to solve the problem.

22:27 wombats, btw, are awesome. they have an armoured ass.

22:28 devn: as long as you used "armoured" instead of "armored" I think I'm still allowed to respect that statement

22:28 classy.

22:28 you're a very "colourful" gent ;)

22:28 muhoo: should have used arse

22:29 brehaut: seriously, donkeys in full plate? that'd be awesome

22:29 * Frozenlock looked at kibit

22:29 Frozenlock: OMG I need that!

22:29 gfredericks: "If I am the king of england and I am not the king of england, then I am the pope."

22:29 mk: the problem with declarative code is that you lose track of the efficiency aspect of programming

22:30 muhoo: well, for some problems, that's ok

22:30 i wouldn't write a gui in core.logic :-)

22:30 but a game in core.logic? hmm.

22:31 mk: I'd like to see kibit do a pass through clojure.core

22:32 muhoo: what would happen running kibit on kibit?

22:32 Frozenlock: mk: would it choke on the java calls?

22:33 mk: Frozenlock: I hope not - I just recall seeing a bunch of def fns instead of defn and so on

22:34 devn: mk: i did that

22:34 mk: there were about 5 things that it found -- all of which i think were deliberately done for performance or bootstrapping reasons

22:36 muhoo: running kibit on kibit shouldnt be a problem

22:36 Frozenlock: muhoo: you create the singularity

22:36 mk: devn: yeah, I don't expect it to be bad, but like you said, some conceptual clarity is given up for the sake of performance

22:36 Frozenlock: AI improving AI.

22:37 devn: mk: that's true...and it isn't.

22:37 muhoo: robots building robots.

22:37 devn: rich made a comment about pattern matching vs declarative programming

22:37 pattern matching => order-complected. take it to your client and ask them if the logic is right.

22:38 take a set of declarative facts about a domain and there is clarity there

22:38 mk: devn: don't follow yet - pattern matching?

22:38 devn: http://en.wikipedia.org/wiki/Pattern_matching

22:39 check out dnolen's core.match library

22:39 https://github.com/clojure/core.match

22:41 mk: in what sense is it order-complected?

22:43 devn: patterns are tried in order, top to bottom

22:43 declarative programming allows the computer to rearrange your steps to achieve a result

22:43 technomancy: seems like logic queries just sidestep that by giving you all the answers

22:43 you still have to order them

22:44 mk: technomancy: but presumably that's priority ordering, not execution ordering

22:44 devn: yes, but you can describe ways in which the computer should or might reorder your facts

22:45 mk: devn: I'm not sure if steps are bad (if that's what you mean to say). Sometimes "do this, then that, etc." is clearer

22:45 devn: the same isnt true in pattern matching to my knowledge, but honestly, most of this is still out my area of expertise tbqh

22:45 mk: no. they arent objectively "bad", but that's not the perfect scenario for all problems

22:45 nor is declarative programming

22:45 nor is functional programming, and so on

22:46 gtuckerkellogg: hmm, just loaded midje and midje.el.

22:46 technomancy: mk: no, it's actually explicitly nondeterministic

22:47 devn: mk: there are lots of things im just grabbing from the internet now to try and "prove" something about declarative programming that i honestly dont totally grok yet

22:47 http://stackoverflow.com/questions/129628/what-is-declarative-programming

22:47 "There is an interesting trade-off here: the machine has to work harder to figure out how to do something than it would in an imperative language, but when it does figure it out, it has much more freedom and much more information for the optimization stage."

22:47 technomancy: I can see how ordering might be restricting in some cases, but I can think of a lot more cases where nondeterminism is a huge can of worms

22:48 mk: technomancy: hmm. That's fine, but there should be a handle on what's going on. For example, when rich was describing agents as "you just give it to them and walk away, they'll execute it at some point in the future" - I get uncomfortable

22:48 devn: mk: then implement your own STM ;)

22:49 im just kidding, but yeah, i hear you -- "magic" is never magic

22:49 gtuckerkellogg: does anyone still run clojure-test-run-test when using a mixture of midje and clojure.test? I was suprised midje.el remapped both keys

22:49 devn: but there's a reason there's confidence behind a statement like that

22:49 technomancy: yeah, agents are used much less frequently than atoms

22:49 solussd: can anyone point me at any medium to large-scale websites built using any of the clojure web frameworks? need some ammo for work. :)

22:49 devn: solussd: http://flightcaster.com/

22:50 im not sure that was built with a framework

22:50 technomancy: that was just clojure on the backend

22:50 devn: so dont quote me on that

22:50 yeah, whoops, rails front end

22:50 technomancy: http://dev.clojure.org/display/community/Clojure+Success+Stories <- not sure how many of these use clojure on the front end, but it's a decent list

22:50 devn: thedeadline was definitely all in clojure

22:51 on GAE

22:51 solussd: awesome- thanks everyone!

22:51 devn: wusoup too to my knowledge

22:51 solussd: if you need to compromise vote for a front end but insist on a clojure backend

22:51 mk: devn: sure, but it can throw things off. We're not doing math, we're coding, and that involves keeping track of efficiency as well as conceptual elegance. "It'll be executed at an arbitrary time", and I've totally lost track of what's going on. Is it going to be stuck in a queue waiting for that one thread I told to compute something huge? ...

22:52 devn: mk: those are things you determine up front by using your noggin

22:52 i dont see how that's different from if this, then that programming

22:52 i run into cases all the time where the else condition is costly in a way i didnt anticipate, etc.

22:53 technomancy: mk: the cases in which an async approach are desired are a pretty small subset of all reference uses, but they are nearly always very clear

22:53 Raynes: solussd: https://refheap.com is all Clojure.

22:53 Does it qualify as medium?

22:53 devn: sure, looks pretty too

22:53 nice job

22:54 Raynes: Alex McNamara gets most of the credit for the look.

22:54 mk: devn: noggin sure, but I can't use that if all I know is that it's arbitrary

22:55 gfredericks: I don't know what clank is but it should have been named ##(format "lib-%04d" (rand-int 10000))

22:55 lazybot: ⇒ "lib-7743"

22:55 mk: technomancy: right - I don't mean that it's not clear to me now when I should use agents, I'm just recalling a feeling of unease with respect to not knowing enough about performance

23:00 devn: mk: okay, so then is it fair to say that what we're really discussing here is a lack of familiarity?

23:00 i feel like we're coming to the point where we just agree and say "no silver bullet"

23:02 but then ill poke you with a stick and say "yes, but the bullet we're talking about is according to this conversation of unknown material"

23:02 which is not true. it is knowable stuff. i just dont know enough about it to tell you with a straight face exactly when and how.

23:03 mk: devn: yeah, definitely, I don't think we disagree on that. I think that my main point is that efficiency issues are important, and they tend to get glossed over if you already know how things work

23:05 devn: sure, but efficiency is not 1 dimensional. it not just about speed, right?

23:05 mk: right, space too

23:05 devn: and even then, what about the quality of the result?

23:05 can you rely on that result? would you stake a pilot's life on it?

23:05 etc.

23:06 mk: well, that's the reason we want conceptual elegance

23:08 devn: so, here's something i think about a lot lately -- i saw sussman speak at strange loop this past year and he talked about propagators

23:10 he described how there are multiple ways to measure the size of a building. that's a small case. think about when there are 20,000 ways to achieve a similar end, when sensors are everywhere relaying information to one another. im sure im losing some of the power of how he described this, but... i think about declarative programming as the beginning of something new. programs that take their 150000 inputs which talk to inputs which talk to inputs, and at ...

23:11 ... some point a value is requested

23:11 dnolen: mk: reading bit of the backlog. I take it you've never actually really looked closely at Prolog :) there's a quite a bit of literature on how to write efficient Prolog programs.

23:11 devn: dnolen: *wipes sweat* so glad you're here to explain how much im misguiding mk

23:11 Raynes: Good ol' dnolen.

23:12 Master of the human race.

23:12 devn: I hear he changes file permissions with a magnet and a pin...

23:13 http://repo.or.cz/w/propagator.git <--cool

23:14 mk: dnolen: I haven't, no :) But I guess this is part of my point - prolog is billed as being interesting and declarative, functional programming as simple and immutable, but you gotta reassure the novices about how things actually work

23:17 devn: http://www.infoq.com/presentations/We-Really-Dont-Know-How-To-Compute < this one?

23:17 devn: mk: yeah

23:17 it's a great presentation. entertaining speaker.

23:18 Raynes: I watch my talk every night with popcorn.

23:18 devn: lol

23:19 duncanm: oh, maybe i can ask my node.js questions here - the clojurescript people might be able to answer...

23:19 hey dnolen

23:19 from what i can tell, the node.js dev experience is very far away from using the lisp repl

23:20 i can't seem to find an easy way to reload definitions

23:20 dnolen: duncanm: yep, somebody needs to work on that.

23:21 devn: http://stackoverflow.com/questions/1972242/auto-reload-of-files-in-node-js <--duncanm

23:23 Frozenlock: mk: damn you! I was supposed to go to bed! Now I can't! Because.. well Sussman.

23:23 duncanm: devn: i saw that, but that's not quite the same thing

23:24 devn: duncanm: yeah, sorry -- all i could find for you

23:24 mk: Frozenlock: salamanders. They cut the arm off right here :)

23:24 dnolen: duncanm: I started on Node REPL support on a fork of CLJS, but it needs work.

23:24 duncanm: dnolen: i find it incredible that they've been developing all these big things in that system, and they still haven't implemented this

23:24 Frozenlock: mk: 3 elbows :P

23:24 dnolen: duncanm: the list of things to do is significan to say the least.

23:25 duncanm: dnolen: the incredibly thing is the list of things they've already accomplished in the existing system

23:25 things like ldap.js and other fairly big systems

23:25 incredible

23:25 dnolen: i'm trying to learn coffeescript right now

23:26 devn: duncanm: check out dnolen's fun.coffee

23:26 dnolen: duncanm: coffeescript is neat

23:26 duncanm: my routine is: run coffee, Foo = require './foo', run Foo.test, something blows up, fix it in emacs, quit coffee, rinse and repeat

23:27 rubber_duck: is there a way to attach metadata to expressions ? I have a macro that transforms code and I would like to provide metadata on each emited expression that would contain the source expression for debugging purposes

23:27 duncanm: dnolen: is there a better way?

23:27 devn: duncanm: a filesystem watcher wont work?

23:27 duncanm: devn: i suppose i could set that up

23:28 i'm just used to scheme/clojure, where i can just send defns to the repl buffer

23:28 jimduey: dnolen: Do you know if there's a way to block on a fork/join pool becoming quiescent? Say i submit a bunch of tasks and wait until they all finish?

23:28 duncanm: and do things like (load "foo") and fix up the repl state, etc

23:28 dnolen: duncanm: you can do that to some degree but node.js is a bit broken in the sense that it implicity wrap modules in anon fns instead of providing a real NS abstraction like CLJS

23:29 duncanm: dnolen: i think with coffee, there's --bare mode

23:29 devn: rubber_duck: like ##(meta (with-meta '(+ 1 1) {:result 2})) ??

23:29 lazybot: devn: What are you, crazy? Of course not!

23:29 ⇒ {:result 2}

23:29 dnolen: duncanm: https://github.com/swannodette/clojurescript/tree/node-repl

23:30 duncanm: script/node-repl will launch a node-repl you can interact w/, use at your own peril, not very well documented.

23:30 devn: duncanm: there's a --bare mode yeah

23:30 dnolen: duncanm: improvements appreciated, but I don't have bandwidth to spend much time on it now.

23:30 jimduey: I thought there was but I'm no fork/join expert

23:31 Zoka: technomancy: have you seen lein-webrepl plugin fo Leiningen 2.0? https://github.com/zoka/lein-webrepl

23:32 technomancy: Zoka: literally on my list of things to check out tomorrow =)

23:32 duncanm: dnolen: does cljs support clojure.string?

23:32 dnolen: duncanm: some of it yes

23:32 jimduey: dnolen: it's the last piece before this baby works. :)

23:32 duncanm: sigh, i already know clojure, and i wanted to learn the hipster thing with coffeescript ;-P

23:33 dnolen: duncanm: you could probably get the job done w/ CS, but I would miss a lot of CLJS features.

23:33 duncanm: dnolen: i've been writing my coffeescript with a lot of ()s - it's actually looking kinda lisp-ish

23:33 dnolen: i'm writing a parser for org-mode files

23:33 dnolen: duncanm: CS syntax is terrible for real functional programming IMO.

23:33 devn: dnolen: i didnt see this happen or not, but do you know why ther are a couple of #_'d (throw ...) statements in cljs? I think they're holdover from when exceptions were in transition

23:33 rubber_duck: devn, lol yeah, I'm way to confused about macro compile time, thinking about serialization and whatnot, can't see the forest for the trees

23:33 duncanm: dnolen: what makes you say that?

23:33 dnolen: duncanm: the whitespace oriented syntax and right associate parsing rules stink.

23:33 devn: dnolen: err when i say happen i mean, i saw someone ask on the list, wasn't sure if anyone got back to him

23:34 dnolen: duncanm: you need lots of extra parens all the time.

23:34 duncanm: might as well be programming in Lisp.

23:34 duncanm: dnolen: yeah

23:34 i was hoping i could find a comfortable non-lisp language to work with

23:35 dnolen: duncanm: I've used CS at the Times on a project and I was reasonably happy with it even with the annoyances. But it doesn't solve the deeper issues, CLJS does.

23:35 bbiab

23:35 duncanm: hmm

23:37 yoklov: coffeescript's syntax for functional programming is pretty annoying. -> -> ->

23:37 it's hard to read after 2 nested functions imo

23:38 duncanm: i was sad to see that underscore.js didn't implement the multi-arity version of map

23:38 yoklov: yup. multi-arity map is awesome

23:38 duncanm: i think their signature is _map (coll, fn)

23:38 without multi-arity map, you have to use a zip thing, which is how it is in ruby

23:39 (a.zip b).map lambda {|x, y| ....} -- something like that

23:39 yoklov: yeah, i think i've done that in ruby

23:40 duncanm: it probably gets hairier when you want to go with 3 collections

23:40 hmm, i wonder if coffeescript's comprehension syntax makes this better...

23:41 * duncanm tries

23:41 yoklov: yeah i'm sure. multi-arity map is also nice for doing 2d things like (map + point1 dist)

23:41 err really delta

23:42 duncanm: boo

23:42 yoklov: ?

23:43 duncanm: yoklov: how lame is that: https://gist.github.com/2212307

23:43 maybe i need to call .toString?

23:43 that's another thing i haven't figured out yet

23:43 yoklov: oh

23:44 actually, i know whats wrong, you need to set your specify your print-depth to your call to print or something like that

23:44 duncanm: print-depth?

23:45 man, what is this, even 1970s lisp has a better repl/printer system than this

23:45 yoklov: what is it, http://nodemanual.org/0.6.10/nodejs_ref_guide/util.html#util.inspect

23:45 duncanm: when did they invent pretty-printer?

23:46 yoklov: i like clojure much more than js though :p

23:46 duncanm: boo

23:46 coffee> util.inspect [[x, y, z] for x in As for y in Bs for z in Cs]

23:46 '[ [ [ [Object], [Object], [Object], [Object], [Object] ],\n [ [Object], [Object], [Object], [Object], [Object] ],\n [ [Object], [Object], [Object], [Object], [Object] ],\n [ [Object], [Object], [Object], [Object], [Object] ],\n [ [Object], [Object], [Object], [Object], [Object] ] ] ]'

23:46 how lame

23:46 i'm so disappointed

23:46 yoklov: no, look at the arguments to inspect

23:47 util.inspect obj, showHidden, depth

23:47 duncanm: yeah

23:47 yoklov: the output is still ugly

23:47 yoklov: well yeah.

23:48 duncanm: and that code is wrong either way

23:49 yoklov: i think there's a niche for a non-lisp language with a sensible repl, to be built on top of node

23:50 coffeescript is so close to being that

23:51 yoklov: write it in clojurescript :p

23:51 duncanm: i was hoping that this will be like a better ruby

23:51 yoklov: what?

23:52 clojurebot: what is seq

23:52 technomancy: that'd be a hard sell without integers

23:52 yoklov: oh, writing a language in clojurescript?

23:53 duncanm: heh

23:54 technomancy: you're talking about how all numbers in JS are floating point?

23:56 technomancy: right

23:56 yoklov: what would be a hard sell?

23:56 duncanm: wingo has a good blog on how things are represented in the JS runtimes

23:56 http://wingolog.org/archives/2011/05/18/value-representation-in-javascript-implementations

Logging service provided by n01se.net