#clojure logs

2012-03-26

00:19yani'm trying to get clojure repl to load up in emacs
00:19yani keep getting into clisp repl
00:20yanwhat do i need to fix my .emacs file
00:20yansorry i'm new to both emacs and clojure
00:20yancan anyone help?
00:21oakwise_yan: have you tried https://github.com/technomancy/swank-clojure ?
00:21yan ;; 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.
00:22yanthat's what i have in my .emacs file
00:22muhooyan: swank is good, but the simplest thing i've found is to just use comint-mode.
00:22sorenmacbethif 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?
00:22yanah i haven't tried that
00:22sorenmacbethseqs
00:23muhooyan: like, try this elisp: (make-comint "clojure" "lein" nil "trampoline" "repl")
00:23yanthanks oakwise and muhoo for pointers
00:23amalloysorenmacbeth: 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
00:25sorenmacbethamalloy: mostly, yes, I want a vector and it's being converted to a seq along the way
00:25amalloyif you are resolute, you can probably fake something up pretty easily with ##(doc map-indexed)
00:25lazybot⇒ "([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."
00:28oakwise_yan: no problem. As a newb to emacs myself, I've found swank-clojure and technomancy's emacs-starter-kit exceptional useful
00:31holoin 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
00:44ibdknoxholo: (defpage ..) is a view concept, it shouldn't be in models :)
00:56holoibdknox: 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
00:56RaynesYou can do whatever you want.
00:56holoibdknox: shouldn't that be a models job by Noir's standard? a fat model doing alot of non-presentation job
00:56RaynesSome people aren't as strict about MVC as others.
00:57ibdknoxholo: sure, that doesn't have to be done in the defpage
00:57RaynesNoir doesn't have a standard. It is flexible enough to work with your standards. :)
00:59holothe thing is, if I want to do it in the model, how do I do it? I really don't have a clue
00:59ibdknoxholo: I guess I'm not entirely sure what your question is
00:59ibdknoxholo: clojure is very open ended language, very few things will tell you you have to do things a specific way
00:59ibdknoxholo: I good example of how I do things, and how I encourage others who are starting to do them is the noir blog
00:59ibdknoxholo: just (:require [my-cool-model])
00:59ibdknoxand use functions
00:59ibdknoxfrom there
01:00unlinkDoes the Clojure standard library have an "unzip"? (partial reduce (fn [[as bs] [a b]] [(conj as a) (conj bs b)]) [[] []]) or similar...
01:00Raynesholo: Take a look at https://github.com/Raynes/refheap
01:00holooh, I have to call the model -.-
01:00ibdknoxyeah :)
01:00Raynesholo: I don't really have a 'MVC' pattern, but I have views and models. You can see how it works.
01:01holoso there isn't an implicit call of a model, lets say, right?
01:01RaynesNo. You require the code you need.
01:01RaynesI'd argue that it is better to be explicit about things.
01:02ibdknoxunlink: (juxt keys vals) ?
01:02RaynesIt is precisely one line of code to require a model.
01:02holojeez, I was forcing my mind with ror on this
01:02muhooif i need to add a git-based project as a dependency, how do i do that in git?
01:02muhoosorry, in lein?
01:02ibdknoxmuhoo: checkouts
01:03ibdknoxclone it into a checkouts/ dir
01:03ibdknoxholo: also this: https://github.com/ibdknox/Noir-blog
01:03unlinkibdknox: How do I use that?
01:03ibdknox,((juxt keys vals) {:a 2 :b 3 :c 4})
01:03RaynesYou might notice the purposeful lack of controllers.
01:03clojurebot[(:a :c :b) (2 4 3)]
01:04ibdknox(def unzip (juxt keys vals))
01:04ibdknox(unzip some-map)
01:04muhooibdknox: thanks
01:05unlinkibdknox: Oh. I guess in my case it would be more (juxt (partial map first) (partial map second))
01:05holoRaynes: requiring plus calling stuff there -> explicit call of the model
01:06ibdknoxunlink: oh, sorry I misunderstood
01:06ibdknoxyou have a vector of tuples?
01:06unlinkibdknox: What is a tuple?
01:07ibdknoxin your case, a pair
01:07ibdknox[[a 2] [b 2]]
01:07unlinkibdknox: but yes, conceptually, I would like [(a,b)] -> ([a],[b])
01:08holoRaynes: I already read the answer from the author about the absence of controllers. thanks
01:08ibdknoxyour reduce is probably the most efficient way
01:08ibdknoxthe double maps will run over the collection twice
01:08amalloyuntil one of the lists is infinite, then the efficiency of reduce gets pretty bad
01:09ibdknoxlol
01:09ibdknoxtrue true
01:10lynaghk`ibdknox: I was reading up on your Waltz library this morning
01:11ibdknoxlynaghk`: oh?
01:11lynaghk`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.
01:12lynaghk`I assume you've done the former (and/or MVC), so I'm wondering if you have any thoughts on the relative merits
01:12holoibdknox: 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 :)
01:13ibdknoxlynaghk`: mvc doesn't help you all that much when it comes to managing highly interactive things
01:13ibdknoxin my experience
01:13RaynesI know of at least 4 websites using noir.
01:13ibdknoxthere are lots of closed source ones actually
01:13Raynesholo: A very simple (very very simple) example site is https://github.com/Raynes/tryclojure
01:13devnholo: you're awesome.
01:13Raynesibdknox: I meant open source.
01:14ibdknoxlynaghk`: I've used it on a few different things, none of them are up anywhere currently though
01:14RaynesAnd 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
01:14ibdknoxlynaghk`: we started moving that way at RFZ in normal JS
01:14ibdknoxlynaghk`: it made things way, way better
01:14devnRaynes: it might be better that way
01:14devnRaynes: i think im watching 550 projects
01:14lynaghk`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.
01:14ibdknoxholo: you're quite welcome, the way I intended for it to be found was from here: http://webnoir.org/tutorials
01:15ibdknoxlynaghk`: even those can get annoying with enough transitions
01:15devnibdknox: it might not be a bad idea to load your meta up and provide a sitemap, eh?
01:15holodevn: I'm awesome? ._. thanks, but why? you should be praising the guys that make all the good stuff instead
01:15lynaghk`ibdknox: that's believable. At that point it's time to move onto a hiearchical FSM of some kind, I take.
01:15devnholo: because you're appreciative. that's of equal value IMO.
01:15ibdknoxdevn: yeah, I didn't do a great job of my seo on webnoir or sqlkorma
01:16devnibdknox: 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
01:16ibdknoxlynaghk`: 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
01:17lynaghk`ibdknox: what is a non-deterministic state machine? Stochastic web app?
01:17ibdknoxdevn: I don't disagree
01:17ibdknoxlynaghk`: it can be in multiple states at once
01:18devnibdknox: time is a harsh mistress
01:18devnas is the moon
01:18lynaghk`ibdknox: (if it's any consolation, I just googled "c2" and gave up after page 15 =)
01:18ibdknoxlynaghk`: actually noir and korma are both on the first page despite my poor SEO currently :)
01:18ibdknoxpicked good names I guess lol
01:18ibdknoxlynaghk`: non-deterministic just means it can have multiple states at once
01:19ibdknoxlynaghk`: e.g. :high and :loading
01:19lynaghk`ibdknox: ah, I see. And the valid transitions are the union of transitions from the individual states?
01:20ibdknoxlynaghk`: sort of, I did a bad job naming things for waltz
01:20ibdknoxlynaghk`: deftrans should be definput
01:20ibdknoxlynaghk`: but basically it's up to you to define what is set and unset based on an input
01:21devnibdknox: have you used clojure-scheme?
01:21ibdknoxdevn: nope
01:21devnim trying to find someone who knows the workflow
01:21devni want to compile clojure to C damnit
01:22RaynesI want to compile Clojure to BEAM.
01:23holoRaynes: thank you, and sorry to bother with this no content one liner
01:23RaynesI'll never forgive you.
01:24lynaghk`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.
01:24devnit's true. he won't. until he does. just did, actually.
01:24lynaghk`ibdknox: I'll let you know if I end up using that approach on any public projects.
01:24mephist0looking for a function that makes this please (reduce str ["f" "g"]) -> "fg"
01:25ibdknoxlynaghk`: please do
01:25ibdknoxlynaghk`: I'll fix the names tomorrow
01:42oakwise_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))
01:54amalloy&(doc resolve)
01:54lazybotjava.lang.SecurityException: You tripped the alarm! resolve is bad!
01:54amalloy,(doc resolve)
01:54clojurebot"([sym] [env sym]); same as (ns-resolve *ns* symbol) or (ns-resolve *ns* &env symbol)"
01:58oakwise_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
02:04oakwise_(ns example.foo) (defn foo [] (resolve 'foo)) (foo) ;=> #'example.foo/foo, then (ns example.bar) (example.foo/foo) ;=> nil
04:53kijlazybot: help
04:53lazybotYou're going to need to tell me what you want help with.
05:17cYmenwindow stick
06:27dsabaninhi guys!
06:27dsabaninI'm trying to deploy my tiny clojure app to production and I'm seeing strange memory usage pattern
06:28jtoywhat is the idiomatic way to test if any item in a list matches x ? I'm a clojure newb
06:28dsabaninit'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")
06:29dsabaninokay, I lied, the app is <400 LOC
06:30dsabaninI built uberjar with leiningen, maybe that's an issue?
06:33jtoyin ruby its list.any?{|x| x == blah}
06:33vijaykiran,(doc filter)
06:33clojurebot"([pred coll]); Returns a lazy sequence of the items in coll for which (pred item) returns true. pred must be free of side-effects."
06:33vijaykiranjtoy: ^^ ?
06:33dsabaninyou could try (some #(= % "blah") list)
06:34dsabaninit will return first element or nil
06:34jtoythanks, I'm reading through a couple of clojure books now, I still don't have a lot of clojure memorized
06:35vijaykirandoc and find-doc are your friends
06:35jayunit100jtoy: fwiw i think the ClojureInAction one is best
06:35jtoyI'm reading clojure in action now!
06:35jayunit100:)
06:35jayunit100Im just starting the multimethods chapter.
06:36jtoyi think thats the same as me, I'm on 4.2
06:36jayunit100jtoy: any interest in helping me out on this resurrection project : https://github.com/jayunit100/clojure-game-of-life
06:37jayunit100Forked 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
06:38jtoyjayunit100: looks cool, don't think i have enough time now though
06:38jtoyI've actually never played game of life
06:39jtoyi was thinking about making a cellular automata before though
06:40jayunit100cool... 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.
06:44jtoywhy is this wrong: (some #(= % "blah") ("foo" "bar")) => java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn
06:45jtoyah, i see
06:45jtoyquote
06:45jtoyis it normal to be using quote all the time?
06:47bsteuberjtoy: no, usually you use vectors instead
06:47dsabaninyou could use vector here
06:48dsabanin:)
06:48bsteuber^^
06:48dsabaninso, anybody knows if it's normal for clojure jar to get to 2160m of virtual memory before the app has even started properly?
06:48dsabaninmaybe I have my java misconfigured?
06:49dsabaninthe app is just a web server (webbit)
06:49jtoyis it fine to interchangeably use list and vector in normal cases?
06:50bsteuberjtoy: yes, there are only a few cases where the difference matters, e.g. when using conj
06:50bsteuberand some time characteristics, of course
06:52bsteuberbut all seq abstractions work perfectly on vectors
06:52bsteuberas well as on sets and maps (as sequence of key-value tuples)
06:56jtoywhy is the quoted hello not a string
06:56jtoy(= (nth '(hello world) 0) "hello")
06:57jtoyor is there a fast way to generate a list of strings?
07:06bsteuberjtoy: when the reader finds a token like hello, it generates a symbol out of it
07:06bsteuber,(symbol? (first '(hello world))
07:06clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
07:06bsteuberoups
07:07bsteuber,(symbol? (first '(hello world)))
07:07clojurebottrue
07:07bsteuberbut no, there's no real shortcut to writing ["hello" "world"] - unless you do something like:
07:08bsteuber,(clojure.string/split "one two three four" #" ")
07:08clojurebot["one" "two" "three" "four"]
07:08bsteuberjtoy: I guess that means you come from ruby? :)
07:20jtoybsteuber: yes, i use things like %w[ many random strings here]
07:21bsteuberjtoy: if you really need it, you can get that with a macro
07:22jtoyits ok, just wondering
07:22bsteuber(defmacro str-vec [& args] (vec (map str args))) should do the job
07:23bsteuberthen (str-vec many random strings here)
07:26jtoycool. i haven't learned vectors yet, but i will use them soon!
07:26jtoyi mean macros
07:27bsteuber^^
07:27bsteuberbeware of macros, you'll most like end up shooting yourself in the foot ^^
07:27bsteuber*likely
07:28bsteuberthere are only very rare cases one really needs a macro at all
07:28antares_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.
07:28bsteuberforgive the bad english ^^
07:29antares_jtoy: for example, you won't find macros here: https://github.com/michaelklishin/validateur
07:30bsteuberbut when you need them one time, you thank god they're available
07:30antares_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)
07:58dsabaninwhy my clojure program prints "<current date> clojure.lang.Reflector invokeMatchingMethod" to the stdout?
07:58dsabaninI'm using clojure.tools.logging
07:59dsabaninactually, what it prints is:
07:59dsabaninMar 26, 2012 7:54:47 PM clojure.lang.Reflector invokeMatchingMethod
07:59dsabaninINFO: New connection from 127.0.0.1:59993
08:00dsabaninlooks like I need to read tools.logging docs :)
08:06bsteuberdoes anyone have a clue how try/catch works in current cljs - if it works at all?
08:07antares_dsabanin: you do not have appender format configured
08:09antares_dsabanin: here is an example: https://gist.github.com/3d3ad91ed15ffb5e56cf
08:09antares_dsabanin: log4j.properties goes to src/resources or where do you have resources path set in your project.clj
08:10antares_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
08:36dsabaninantares_, thanks!
09:16rhcdevn: thanks for the ref to at-at
10:31RickInGAI am trying to put the partial function into words... (map (partial + 2) [1 2 3]) returns [3 4 5]
10:32RickInGASo partial adds 1 value as the last parameter to a function?
10:34fdaoudRickInGA: partial returns a new function with the parameter applied, left-to-right
10:34Bronsa,((partial + 1) 2 3)
10:34clojurebot6
10:34Bronsanot just one
10:34fdaoudRickG: so in your example, (partial + 2) is like (fn [x] (+ 2 x))
10:34Bronsait's kinda like ##(#(apply + 1 %&) 2 3)
10:34lazybot⇒ 6
10:35fdaoudRickInGA: so in your example, (partial + 2) is like (fn [x] (+ 2 x))
10:35fliebelHow did Clojure do away with checked exceptions?
10:36RickInGAbronsa: and the only reason I saw it as 1 parameter was because I put it in a map
10:37flazzhow can i measure memory consumption of different forms in clojure?
10:38Bronsayeah
10:39PhlogistiqueIsn't there any shorter name for "partial"?
10:39fdaoud,(let [m {:a 1 :b 2 :c 3 :d 4}] (reduce (partial dissoc m) [:b :c]))
10:39clojurebot{:a 1, :d 4}
10:39RickInGAbronsa: fdaoud: thanks
10:40fdaoudPhlogistique: what shorter name did you have in mind?
10:42TimMc((composition (juxtaposition plus minus) increment) 5)
10:43TimMc^ verbose is the new literate
10:48RickInGAlets say, hypothetically I set up an infinite loop in inferior lisp, is there a way to kill it?
10:49cemerickI don't think so.
10:49cemerickSLIME and nREPL have interruption facilities, but killing the process is your only option in inferior-lisp.
10:50RickInGAcemerick: thanks, C-x C-c it is then
10:51Bronsaactually, C-c C-c :)
10:51RickInGABronsa: what does that do?
10:51Bronsaoh.
10:52Bronsai thought you were using slime
10:52Bronsanevermind then.
10:52RickInGAmy emacs knowledge is about 5 bindings
10:53Bronsaif you're using clojure-mode running slime is just a matter of M-x clojure-jack-in
10:55RickInGAbronsa 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:58BronsaRickInGA: i don't think so
10:58RickInGABronsa: cool, thanks
10:59Bronsahttp://bc.tech.coop/blog/070424.html
10:59Bronsathis seems to do it
11:00RickInGASLIME Tips - part 6... that is going to be a handy link to have!
11:03Bronsaconfirmed it's working
11:04Bronsajust replace copy-region-as-kill-nomark with copy-region-as-kill
11:34edwI 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:35TimMcedw: Oh, the >= and < thing?
11:35edwExactly!
11:35TimMcNo good keywords come to mind.
11:35edwYeah, I'm floudering all over the plac on Google...
11:36TimMcedw: http://www.cs.utexas.edu/~EWD/transcriptions/EWD08xx/EWD831.html ?
11:37edwHow the hell did you find that?
11:38TimMcSearched on Google: Dijkstra natural range lower upper
11:38TimMc"natural" was serendipitously accurate -- I thought it would be used in a different sense
11:38edwAh. I was using comparison and interval
11:38edwRight, nat number, not a "natural" approach.
11:43edwBTW, TimMc I'm amazed that it was on #clojure and not #scheme that I got an answer. Speaks well of the Clojure community.
11:46DerGuteMoritzedw: I'd say it's a matter of timezones :-)
11:46DerGuteMoritzbut #scheme is not very active as of late, indeed
11:48edwDerGuteMoritz: Hmm. Makes me sad to think about how Clojure has basically replaced Scheme for me.
11:49DerGuteMoritzedw: really? how is that possible with jvm startup times? :-)
11:50DerGuteMoritzedw: check out the implementation specific channels, those of the actively used implementations are pretty active and lively (e.g. #chicken)
11:50edwYes, I hate restarting my REPL when I add a depenency, but in Scheme there is often nothing to be dependent on.
11:50DerGuteMoritzheh
11:51DerGuteMoritzwell, check out chicken's egg repo
11:51DerGuteMoritzwe have about ~400 extensions by now
11:51DerGuteMoritzhttp://api.call-cc.org/doc/ :-)
11:51DerGuteMoritz(end-plug)
11:52cemerickedw: 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:52cemerickI guess https://github.com/cemerick/pomegranate if you don't need the exposition.
11:53edwDerGuteMoritz: It's been a while; I actually contributed a bit to a couple eggs.
11:54edwcemerick: 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:54DerGuteMoritzedw: oh cool, drop by again some time then!
11:55cemerickedw: :-) In any case, pomegranate is baked into leiningen 2, so there's at least a reasonable baseline now.
11:55edwScheme48 won me over because I liked its module system.
11:55DerGuteMoritzwas that from before chicken had modules?
11:56DerGuteMoritzchicken has a pretty decent module system since version 4, it's similar to what will be in R7RS
11:56edwcemerick: ccm
11:57edwD'oh. cemerick: From that page: "So I guest you must have a lot of empty projects created for such purpose." OMFG yes!
11:58cemerickhah
12:00cemerickI 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:01DerGuteMoritzcemerick: well put, hehe
12:01edw"It's good enough to disturb people."
12:01cemerickor, good enough to avoid dev-time pain or save your ass in production for a bit.
12:02cemerickIn contrast to edw, I assume my servers are going to choke and die on a regular basis, for all sorts of reasons. ;-)
12:03edwcemerick: Yeah, I'm old school that way; I need to embrace the chaos monkey school of cord yanking.
12:04cemerickwell, depends on which old school you're talking about, viz. erlang
12:04edwNow 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:06cemerickpomegranate 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:06edwcemerick: Just a plain old school multi-user Unix background.
12:06edwcemerick: So clojars isn't among the stock repos?
12:07edwAlso, what are your thoughts on the Clojure One guy's git-dependencies plugin?
12:08cemerickedw: pomegranate has no "stock repos".
12:08cemerickThere's a prefab map for central, but it's not included by default either.
12:08edwPlease excuse my slapdash terminology.
12:08edwAh.
12:09cemerickThere 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:09cemerick"Clojure One guy" being Brenton Ashworth? :-)
12:09edwI've run into that with deploying.
12:10edwIs 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:12cemerickPerhaps this? https://github.com/brentonashworth/one/wiki/Dependencies
12:12edwYes, exactly.
12:14cemerickI 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:15cemerickAt least for Clojure, source-level dependencies aren't sufficient in general.
12:20edwcemerick: 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:20edws/which/it/
12:21edwAlternatively, s/which makes all//
12:21cemerickI agree, that's a compelling thought.
12:22cemerickIn the end though, I don't think git is a suitable substrate for dependency management / resolution.
12:23ibdknoxI don't think people's repos are accurately formatted to be a dependency
12:23ibdknoxlet's say I include some random clj, things/resources that don't end up in my jar
12:23ibdknoxI've now potentially hosed your classpath
12:28cemerickibdknox: are there ever jars in this model though?
12:29ibdknoxcemerick: 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:29cemericki.e. the delivered app's project needs to know how to assemble all transitive deps into a deployable?
12:29ibdknoxoh
12:29ibdknoxmisunderstood
12:30edwMakes me think that there is well-formed-ness trait that a Git repo could be evaluated for.
12:30edw(Apropos the typing from a couple of minutes ago. Got distracted by the new office microwave.)
12:33y3dican you use clojure on android
12:37TimMcy3di: Very slowly, I believe.
12:40dnoleny3di: 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:41technomancydnolen: GC is also an issue
12:41technomancybut not nearly as big of an issue
12:41TimMc&(loop [c (long 5) acc (int Integer/MAX_VALUE)] (if (zero? c) acc (recur (dec c) (+ acc c))))
12:41lazybot⇒ 2147483662
12:42TimMc^ I thought this loop would use primitive int for acc
12:42technomancydalvik 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:44simardI 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:45fdaoudibdknox: 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:50TogoHi.
12:51jonasendnolen: https://gist.github.com/2205346
12:52dnolenjonasen: I saw that, looks interesting. You're discovering that you can easily meld FP w/ LP :D
12:55jonasendnolen: something like that, yes. We need a more powerful rule system, especially for the stuff lynaghk's trying to do.
12:58pandeirodnolen: 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:59pandeiroibdknox: did any of your slides or materials from the conference end up online somewhere?
13:04dnolenpandeiro: 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:34unlink`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:34unlink`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:35unlink`How can I factor out the cleanup logic without mixing the concerns of the caller and of produce-file?
13:40ibdknoxfdaoud: glad they worked out for you :)
13:41ibdknoxpandeiro: I didn't have anly slides
13:41ibdknoxpandeiro: I only did training and then a little unsession thing, neither of which had any keynote/powerpoint in them :)
13:41cemerickibdknox is smart, doesn't leave any evidence laying around :-P
13:41ibdknoxburned it all.
13:42fdaoudhehe
13:47raekunlink`: I essentially did that in one of my projects: https://github.com/raek/bokareis/blob/master/test/bokareis/util.clj
13:49raekmy 'with-temp-dir' follows the style of 'with-open'
13:49raekit lets you bind a variable to something that will be cleaned up when the body is left
13:50unlink`raek: but the problem is that I can't create the file soon enough without mixing concerns
13:50unlink`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:53unlink`raek: I guess the only other solution is to use finalizers
13:54raeksorry, I don't really follow. what would you want the code to look like?
13:55raekyou want to factor out just the cleanup stuff from produce-file and the call site of produce-file?
13:55unlink`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:57raekresource management is tricky
13:57raekI don't know a better solution
13:58raekI guess you could maintain a reference to a set of files that should eventually be cleaned up
13:59raekand provide a function that cleans up the files in the set and clears it
13:59raekthis reference would ideally be passed "behind the scenes" somehow
14:00raeke.g. through 'binding'
14:11pandeiroibdknox: ah ok, cool, was your training recorded ?
14:11ibdknoxtrainings rarely are, unless they're meant to be resold later
14:11dnolencemerick: so did you get further on how to support richer content in nREPL?
14:12fdaoudibdknox: what was the topic of this?
14:13ibdknoxclojure web
14:13fdaoudring, compojure, noir, the usual suspects?
14:14RickInGApandeiro: 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:14ibdknoxfdaoud: yessir :)
14:14pandeiroRickInGA: i can tell, if i could've i would've, no doubt
14:15cemerickdnolen: 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:15ibdknoxRickInGA: thanks Rick :)
14:15ibdknoxcemerick: 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:16fdaoudibdknox: not that it's not plenty, but did you cover any others?
14:16dnolencemerick: ibdknox: you guys should chime in on that GSoC thread on the ML
14:16pandeirofdaoud: imagine he talked about his cljs stuff and the new template plugin too?
14:17fdaoudpandeiro: yeah the cljs stuff is cool, and what is this new template plugin?
14:17pandeirocljs-template it's called
14:17ibdknoxfdaoud: 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:18cemerickdnolen: Yeah, I noticed that.
14:18hhutchibdknox: no enlive/enfocus ?
14:18ibdknoxdnolen: yeah, I will. I've been traveling the past few days so things have been a little scattered
14:18dnolencemerick: ibdknox: please both do when you get a chance - this could turn out to be a really amazing GSoC project
14:18fdaoudvery nice ibdknox
14:18lynaghkibdknox: Whenever I meet with clients I start by explaining how the internet works = P
14:18dnolenand super useful for all.
14:19ibdknoxhhutch: I mentioned it, but I've found the other three suit people's needs better most of the time.
14:19pandeirodnolen: thank you for suggesting he do that :) ibdknox: do you remember me bugging you about a 'cljsfiddle' a month or two back? :)
14:19fdaoudpandeiro: oic. I had my project all set up already so I haven't looked at that one.
14:19cemerickI've been focused on trying to raise the LCD. Interactive environments are awesome, but portability in tooling is very important to me.
14:20ibdknoxlynaghk: lol, I think few people really understand it - "what do you mean http is stateless?"
14:20dnolencemerick: do you see portability to be an issue here?
14:21ibdknoxhhutch: 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:21cemerickdnolen: well, building a super-compelling REPL / interactive dev environment is great, but I assume that frontends will come and go.
14:21ibdknoxpandeiro: yeah
14:21cemericki.e. I want to minimize switching costs between clojure dev environments
14:22ibdknoxcemerick: but why would you want to switch once the über dev environment exists ;)
14:22cemerickheh
14:22dnolencemerick: that's I'm suggesting focusing on something CLJS/HTML/CSS/Canvas based - browsers aren't going anywhere.
14:22dnolenpeople know how to customize that
14:22cemerickdnolen: and here I was going to say: if the über environment is web-based, that doesn't really work for me :-P
14:23ibdknoxcemerick: well, the visuals and such could be, right? We can embed webviews in eclipse
14:23cemerickthis is true
14:23dnolenibdknox: bingo
14:23cemerickThat's roughly what I'm hacking on these days.
14:23ibdknoxI see the browser as a way to make up for the terrible presentation limitations we have on most platforms
14:23dnolencemerick: so I don't see where we differ here :)
14:23cemerickibdknox: oh, you know this already
14:23ibdknoxwhile not the best...
14:24cemerickdnolen: no, perhaps not
14:24hhutchi have to agree with cemerick, I don't want any dev enviro i can't run in a terminal, personally
14:24ibdknoxat least you can relatively quickly and easily make some impressive things
14:24cemerickhhutch: whoa, dude. I don't use the terminal. ;-)
14:24hhutchand no matter how uber it is, i probably wouldn't use it
14:24ibdknoxlol
14:24ibdknoxhhutch: you're likely not the target for such a thing anyways :)
14:24hhutchcemerick: i know, you use eclipse right?
14:24cemerickTerminal.app might as well be named lein.app
14:24lynaghkEmacs has already been ported to the web: http://www.ymacs.org/
14:24dnolencemerick: 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:25dnolenif by this time year I can't use C2 directly in my REPL I'm gonna pissed
14:25dnolennext year
14:25hhutchi 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:25ohpauleezdnolen: haha
14:26ibdknoxdnolen: we'll get there way before then
14:26lynaghkdnolen: 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:26ibdknoxlynaghk: it won't be bad
14:26cemericklynaghk: BTW, macroexpand + kibit or conditional compilation?
14:26ibdknoxif I can make that game editor work from VIM, I'm fairly certain we can make C2 work just fine from anything
14:27lynaghkcemerick: I'm messing with kibit right now. Unfortunately it looks like something in core.logic is eating up metadata on forms.
14:27daniel__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:27lynaghkcemerick: (which probably means something in clojure.core is eating up metadata...)
14:27daniel__any idea what could be wrong there?
14:27ibdknoxdaniel__: do you by chance have two of them installed?
14:28ibdknoxdaniel__: take a look at ~/.lein/plugins
14:28daniel__ibdknox: yes, i think so
14:28cemerickibdknox: 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:28pandeirolynaghk: any breakthroughs on the cljs side of c2? i dig the vrepl for prototyping, very cool setup
14:28ibdknoxdaniel__: remove the old one
14:28daniel__cool, thanks
14:28daniel__works now :)
14:28lynaghkibdknox: 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:28ibdknoxcemerick: I didn't tell you about my side project on a touch-based editor did I?
14:29lynaghkibdknox: though you'll have to pry chrome dev tools from my cold dead hands
14:29cemerickibdknox: nope
14:29ibdknoxI think there's a way to visualize code meaninfully
14:30fdaoudC2?
14:30lynaghkpandeiro: 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:30hhutchlynaghk: links :)
14:30lynaghkhhutch: to what?
14:31fdaoudguess I'm the only one who doesn't know what C2 is besides "a pawn resides there."
14:31lynaghkfdaoud: http://keminglabs.com/c2/
14:31pandeirolynaghk: awesome, good luck w that... btw can your chrome inspector handle svg's with 5000+ paths? mine just locks up
14:31ibdknoxcemerick: 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:31hhutchlynaghk: i guess links doesn't support the proper version of JS
14:31fdaoudthx lynaghk
14:32hhutchbut it would be hi-larious
14:32lynaghkpandeiro: 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:33pandeirolynaghk: it renders it fairly quickly actually but the inspector becomes useful, ie no right clicking, inspecting elements, seeing their attributes, testing styles etc
14:33pandeiros/useful/useless
14:33ibdknoxdnolen: I'll comment on that thread later
14:33dnolenibdknox: cool, thx
14:34lynaghkpandeiro: yeah, sorry I don't have any better advice than "fewer elements" = )
14:34cemerickibdknox: sounds interesting; I have 40 questions, but I'll not try to push 'em through irc :-)
14:34pandeirolynaghk: no sweat sorry just wondering if that's my limited hardware or a prob for everyone
14:34ibdknoxcemerick: 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:35lynaghkdnolen: 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:36unlink`raek: How would you accomplish that through binding?
14:36dnolenlynaghk: I don't think I try to preserve metadata through unification. Feel free to open up a ticket.
14:37lynaghkdnolen: and unification is happening under the pattern-matching covers?
14:37dnolenlynaghk: well it's unification - not pattern matching.
14:39lynaghkdnolen: okay, I'll look into it a bit more and open up a ticket.
14:44cemerickOK, my ring authentication/authorization lib is only going to come with form and basic to start. OpenID is such a pit.
15:06DerGuteMoritz,(meta ^{:x 1} [1 2])
15:06clojurebot{:x 1}
15:06DerGuteMoritzwatr
15:06DerGuteMoritzthis doesn't work in my repl!
15:07Bronsacheck your ##(clojure-version)
15:07lazybot⇒ "1.3.0"
15:07DerGuteMoritz,(clojure-version)
15:07clojurebot"1.4.0-master-SNAPSHOT"
15:07DerGuteMoritzaha!
15:08DerGuteMoritzwell this specific example also works with 1.3.0 as I now realize
15:08TimMc^ is for the compiler
15:08TimMcnot runtime
15:08DerGuteMoritzwhat
15:09DerGuteMoritzdoes the compiler use a different reader?
15:09TimMc&(meta (with-meta [1 2] {:x 1}))
15:09lazybot⇒ {:x 1}
15:09TimMcDerGuteMoritz: No, ^ meta is just applied at a different execution phase.
15:10DerGuteMoritzTimMc: ok then why did my example above work with clojurebot?
15:10DerGuteMoritz,(meta ^{:x 1} (list 1))
15:10clojurebotnil
15:11DerGuteMoritz&(meta ^{:x 1} (list 1))
15:11lazybot⇒ nil
15:11DerGuteMoritz,(meta ^{:x 1} [1])
15:11clojurebot{:x 1}
15:11TimMcSome of the compiler metadata trickles through.
15:11DerGuteMoritz&(meta ^{:x 1} [1])
15:11lazybot⇒ nil
15:11DerGuteMoritzo_O
15:11DerGuteMoritz&(meta ^{:x 1} '(1))
15:11lazybot⇒ {:line 1}
15:12TimMc:-)
15:12DerGuteMoritzI don't dare looking at the code
15:13DerGuteMoritzthe docs just say "The metadata reader macro first reads the metadata and attaches it to the next form read"
15:14technomancyDerGuteMoritz: the lein2 repl?
15:14DerGuteMoritzthis doesn't seem to be true in all cases ... or something
15:14TimMcForms, not values.
15:14DerGuteMoritztechnomancy: I tried this just with clj
15:14technomancyok, I think there was a bug in reply where it would swallow metadata
15:15DerGuteMoritzTimMc: well but those forms get turned into values then ... what good are metadata when they can't be used? :-)
15:16technomancythinking 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:19ibdknoxtechnomancy: the GC thing?
15:19technomancyibdknox: yeah, that's already been fixed
15:19ibdknoxyay!
15:19ibdknoxthat's it for me :)
15:20edw"Still" on lein1? Is 2 recommended now?
15:21DerGuteMoritzah, I understand now
15:21technomancyedw: depends on who's doing the recommendation
15:21technomancyand who is being recommended at
15:24edwProduction-quality-ness is not something that concerns me. Non-complete-flakiness would be nice.
15:25technomancybugs have been both fixed and introduced. code has been written and deleted. only one way to find out
15:26edwBTW, 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:27technomancyit does tell you what the new version is
15:27technomancyI'll add printing of the original version though; good idea
15:28edwRight, but one has no idea what the old version was.
15:28edwRight.
15:28technomancybingo
15:28technomancypushed
15:29mrmekonSo I've been working on a math-heavy HTML5 game in ClojureScript. Just implemented a framerate monitor and tested it on different browsers
15:29mrmekonChrome is the best... not saying much, but 15-30 fps
15:29mrmekonFirefox is ok, 7 - 22fps
15:30mrmekonmobile safari on iphone is less than 1. Firefox on android is ~2
15:30mrmekonand safari took 2GB of RAM, and failed to ever render a single frame
15:30edwtechnomancy: Thanks!
15:31technomancyno problem
15:34edwAh! No more projects for futzing with every piece of new Clojure hotness that comes along!
15:35fdaoudedw: what's the fun in that? :)
15:38edwfdaoud: 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:38dnolenit boggles the mind why people continue to engage Cedric Greevey
15:39Raynesdnolen: If that's who I think it is, his existence burns my soul.
15:39emezeskednolen: I wish I hadn't even dipped my toes into that thread. Regretted it *immediately*.
15:39amalloydnolen: sadly, trolls will never go extinct. there are always enough people who misguidedly want to help him see the light
15:40amalloybut in a few months perhaps he will take a new name (again? still haven't seen ken recently)
15:40Raynesamalloy: Cedric was the guy who was complaining because 4clojure has a sandbox, right?
15:40amalloy*shrug*
15:44unlink`lol @ the set literal thread. what a troll.
15:44unlink`I mean the troll itself, not Cedric.
15:46edwSpeaking of trolls, I need to find someone dumb and/or boring enough to understand Pinterest who can explain it to me.
15:46TimMcedw: reddit for moms
15:46TimMc(that's how it was described to me)
15:46TimMcalthough it seems more tumblr-like
15:47rhcits like having multiple tumblrs
15:47edwOh, so a place that moms can talk about Peak Oil and the Ron Paul REVOLution?
15:47rhcbut it shares pictures in a grid
15:47rhcedw: its more for "style"
15:47rhclike, you'd make a category of "desserts you like"
15:47rhcor "bedding products you like"
15:48rhcand then its just a huge virtual wall of pictures and short captions
15:48rhclike if you were making a scrapbook from magazine clippings
15:48samaaronmy life is troll-free - i just don't bother reading the mailing list too much
15:48mkpictures on a grid is better than pictures in a little thumbnail
15:49samaaroni just bought a nanoKontrol2 - which is way more fun than picking through endless threads debating syntax changes
15:49ibdknoxsamaaron: what's that used for?
15:50ordnungswidrigsamaaron: I doubt the statement about troll-free
15:50samaaronibdknox: not sure yet - just hooking it up to Overtone now
15:50samaaronbut it has sliders and knobs
15:50samaaronwhich is a definite win
15:50TimMchaha
15:50samaaroni like BOTH sliders AND knobs!
15:50edwHmm. 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:51samaaronedw: twitter is great if you really control who you listen to
15:51TimMcsamaaron: I liked the look of that iPad app in the Overtone talk, but I think I'd want haptic feedback.
15:51ordnungswidrigsamaaron: exactly! clean up your timeline every week
15:51edwsamaaron: Right, I was referring to my "contributions". I use Twitter as my feed reader.
15:51samaaronedw: haha
15:52TimMcjust at the very basic level of "how hard am I pushing this slider"
15:52mkedw: many of these sites deal with content consumption, which is actually very interesting, and exactly the same thing that you're doing now
15:52samaaronTimMc: 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:52samaaronhence the nanoKontrol2 and the monome
15:53mkedw: 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:53edwmk: 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:54edwI think we're on the same page, mk.
15:54edwIt's hard to reductively consume and "share" written compositions because it requires thought.
15:55mkedw: 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:57mkI think a lot of opportunities are being wasted there, though
15:58mk(by the site operators - that users waste time there is obvious)
15:58unlink`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:58edwmk: 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:58unlink`sort of like a mapM for futures...
15:59cemerickedw: I'm here for warez. Can you help me with my modem?
16:00mkunlink: erm, have a look at seque, doseq, dorun, etc.
16:00edwFirst, wait a sec, and type +++... And then wait a bit and type ATH and hit return...
16:00AimHereI thought the Eternal September was the 1993 one
16:01unlink`(defn sequence-futures [f xs] (future (map (comp deref future f) xs))) or something.
16:01llasramunlink`: pmap might be close?
16:02llasramWell, 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:02mkedw: 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:02unlink`llasram: yes, but I'll be doing I/O in f, so 2+numprocs isn't good enough.
16:04edwPeople are the things on the sidewalk between me and my cup of coffee.
16:04samaaroncemerick: i can build you a new acoustic coupler with overtone if you need one...
16:04mkunlink`: you want seque
16:04cemericksamaaron: heh, that'd be fun :-)
16:04samaaronthen you can haz all the warez you needz
16:05samaaronalbeit after a very long wait ;-)
16:05edwThat's misthanthropic enough to tweet...
16:05cemerickomg uuencode
16:06mkedw: you're talking about "strangers". People are much more interesting. At the very least, they serve as content filters, and powerful CLIs
16:07samaaronmk: people can also give hugs too :-)
16:07unlink`mk: Thanks. seque looks wonderful.
16:07samaaronand smiles - don't forget the smiles - people are also good for those
16:08mkunlink`: the default seems to use 100 for n, but you can change that to taste.
16:08mksamaaron: :)
16:09edwIn New York no one smiles. They frown if you smile at them. They assume you're deranged.
16:09samaaronedw: that shouldn't stop you from smiling anyway
16:09mkedw: have you tried hugs?
16:10samaaroni can attest that cemerick gives a jolly good hug
16:10cemericksamaaron: you would appreciate the Hugging Busker.
16:10samaaroncemerick: sounds great
16:11samaarondoes he have a sign that says "FREE HUGS"?
16:11edwsamaaron: 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:11cemericksamaaron: exactly right
16:11cemerickhttps://www.amazon.ca/Hugging-Life-Practical-Guide-Artful/dp/0978059905
16:12cemerickHe operates in Montreal. Was quite a treat.
16:12cemerickhugod may know of him
16:12samaaronedw: fight it! Keep on smiling!
16:12edwI am a renowned hugger in Philly. Buy that was Philly.
16:12samaaron:-)
16:15edwThe bitter irony is that I left Philly because I feared I'd die single there...
16:15Wild_Cato.O
16:15Wild_Catcemerick: 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:17cemerickWild_Cat: we only saw him in old town
16:17cemerickthat's probably the only place where buskers can make a living anyway
16:17Wild_Catcemerick: dunno, there's a ton of buskers in metro stations.
16:17cemerickoh, sure
16:17cemerickmaybe he's down below in winter
16:18edwcemerick: I noticed that your docs for pomegranate are wider than 80 cols.
16:18Wild_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:29technomancywe have a "FREE HUGS" guy in seattle too
16:29technomancyor maybe the Montreal guy was vacationing here; who knows
16:29AimHereIt's a franchise
16:30dnolenif you're a student GSoC 2012 applications start today, http://www.google-melange.com/gsoc/homepage/google/gsoc2012
16:35pandeiroibdknox: 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:40mkwhat does memfn do?
16:41AimHere,(doc memfn)
16:41clojurebot"([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:41mkhow is it different from (.method ...)
16:42Bronsayou can map/apply it
16:42amalloy&(macroexpand '(memfn length))
16:42lazybot⇒ (fn* ([target__4045__auto__] (. target__4045__auto__ (length))))
16:42clojurebotIt's greek to me.
16:43TimMcThere's something weird about the &args, but I don't remember the details.
16:43Bronsa,(map (memfn toString) [1 2])
16:43clojurebot("1" "2")
16:43Bronsa,(map .toString [1 2])
16:43clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: .toString in this context, compiling:(NO_SOURCE_PATH:0)>
16:45mkso it's a curried function, or...? does the returned function take objects, or does it feed args to an original object/partial?
16:45AimHereWell it's 'first class', so you can throw it around like you would a normal clojure function
16:47AimHereUse the function proper as a function arg, or return it or whatever you like
16:47AimHere,(map .toString [1 2 3])
16:47clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: .toString in this context, compiling:(NO_SOURCE_PATH:0)>
16:47AimHere,(map (memfn toString) [1 2 3])
16:47clojurebot("1" "2" "3")
16:48AimHere,(map Integer/toString [1 2 3])
16:48clojurebot#<CompilerException java.lang.RuntimeException: Unable to find static field: toString in class java.lang.Integer, compiling:(NO_SOURCE_PATH:0)>
16:48AimHereThat's probably the better example of the problem
16:49mk,(map #(.toString %) [1 2 3])
16:49clojurebot("1" "2" "3")
16:50AimHereTMTOWTDI
16:55mk,(map (memfn indexOf) ["abc" "abc"] ["a" "b"])
16:55clojurebot#<ExecutionException java.util.concurrent.ExecutionException: clojure.lang.ArityException: Wrong number of args (2) passed to: sandbox$eval27$fn>
16:56mk,(map (memfn indexOf "abc") ["a" "b"])
16:56clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.security.PrivilegedActionException: java.lang.Exception: Unsupported binding form: abc>
16:56mkwhat am I confused about here...
16:56mkwhat sort of args is memfn supposed to take?
16:56amalloy,(map (memfn indexOf target) ["abc" "abc"] ["a" "b"])
16:56clojurebot(0 1)
16:57amalloyyou have to tell it how many args to expect, by naming any args other than the implicit first-arg object
16:58mkah, I see. This does seem cleaner than using #(.indexOf %1 %2)
16:59mkthanks
17:01TimMcmk: It just doesn't allow hinting, that's all.
17:01amalloyyeah, i was thinking a while ago it'd be nice to add hinting to memfn
17:01amalloy(memfn ^String indexOf ^String target)
17:02mktype can't be inferred on the basis of e.g. indexOf?
17:03mk...forget I asked
17:04mkdoes memoize ever recompute values? It seems like a memory-leak.
17:05Chousukemk: memoize is an intentional memory leak :p
17:05Chousukemk: it's best used for functions that are not called with arbitrary inputs
17:07mkChousuke: 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:07Chousukemk: nah, fib is exactly not what you want memoize for
17:08Chousukemk: but if you have eg. a template compiler, you might want to memoize that
17:08Chousukeyou won't usually have more than a few templates, so it won't grow indefinitely
17:08TimMcYou can also use it for limited-lifetime stuff.
17:09Chousukeright. if you pass the function returned from memoize as a parameter somewhere
17:09cemerickedw: Yup. Many of my source code files extend to 100 or 120 columns, too.
17:09Chousukeand it gets gc'd later
17:09replacacemerick: but how are you going to fit that on a punched card?
17:10technomancycemerick: eclipse does support splitting your window though, right?
17:10replacayou might want to leave col 73-80 free for a serial number too, in case you drop the card deck
17:11cemericktechnomancy: sure, 100 different ways. Why?
17:11TimMcreplaca: That's what permanent marker is for, just draw a diagonal line.
17:11TimMcMan, get with the times.
17:11technomancycemerick: usually it's the textmate users who are loud and proud about 100+-column-lines
17:11technomancydue to the fact that they can't split their editor
17:12replacaTimMc: 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:14mktechnomancy: why was the patch rejected?
17:15technomancymk: because core.cache exists, afaict
17:18yoklovI usually use 120 column and split emacs vertically
17:18yoklovif it's not split (horizontally) 80 columns always looks so small
17:18solussd__any lobos users in the room? :)
17:21acts_as_joelHi, 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:22Raynesbinding and let serve entirely different purposes.
17:23ibdknoxthe former should be used very sparingly
17:23Raynesbinding is there to rebind dynamically rebindable vars (usually named with asterisks).
17:23acts_as_joelah, ok, that's what I was wondering (re: sparingly)
17:23acts_as_joelthe asterisks are a convention?
17:23DerGuteMoritzs/rebindable/scoped/
17:24ibdknoxit introduces complexity that you only want if you have to have it
17:24Raynes(let [writer (java.io.StringWriter.)] (binding [*out* writer] (println "foo") (str writer)))
17:24RaynesDerGuteMoritz: Eh?
17:25DerGuteMoritzRaynes: well, lexically scoped vars (e.g. those bound by let) are also rebindable
17:26cemerickreplaca: I usually just staple two punch cards together
17:26cemerick:-)
17:26acts_as_joelok, so here we want *out* to have the same value in other functions scopes (within the binding scope)
17:26amalloyacts_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:26cemericktechnomancy: I probably wrote that README in textmate or sublime :-P
17:26cemerickthough I'm still not clear on what splitting of editors has to do with line length
17:26replacacemerick: you're the one who keeps jamming up the card reader!
17:27technomancycemerick: 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:27RaynesDerGuteMoritz: You can't rebind a name created by let with binding.
17:27RaynesDerGuteMoritz: It isn't a var.
17:27acts_as_joelamalloy true, working my way through the volkmann intro, no doubt those topics will come up further in
17:28DerGuteMoritzRaynes: no but you can rebind it with let is what I meant :-)
17:28edwSo wait, did I touch off a conversation with my "your docs are the wrong width" comment?
17:28RaynesYeah, but that's...
17:28acts_as_joelthanks, guys!
17:29DerGuteMoritzanyhow, I'm off, good night!
17:29ibdknoxlol
17:35mk,(conj [0 88 1 88] {0 99 1 99})
17:35clojurebot[0 88 1 88 {0 99, 1 99}]
17:36mkI 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:36AimHereWell it's asymmetric. conj adds the second argument to the collection that happens to be the first argument
17:37technomancymk: agreed; it's very strange
17:38mkAimHere: but for maps, it doesn't add the map on the right, it uses it to overwrite values
17:39tmcivermk: a map is not sequential; there is no adding to the right.
17:40mktmciver: sorry, I meant the right param map
17:40mk,(merge {0 9} {0 8} {1 8} {2 8}) (conj {0 9} {0 8} {1 8} {2 8})
17:40clojurebot{2 8, 1 8, 0 8}
17:41TimMc~maps
17:41clojurebotmaps are functions
17:41TimMc~maps
17:41clojurebotmaps are functions
17:41mkso are vectors and lists
17:41TimMcclojurebot: maps are the red-headed stepchild of the collection family
17:41clojurebotGabh mo leithscéal?
17:42TimMcclojurebot: botsmack
17:42clojurebotclojurebot evades successfully!
17:43tmcivermk: 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:44mktmciver: 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:44mk,(conj [0 9] {0 8} {1 8} {2 8})
17:44clojurebot[0 9 {0 8} {1 8} {2 8}]
17:45mkI want [8 8 8]
17:46mkoh well.
17:47TimMcmk: I would expect (conj [0 9] a b c) => [0 9 a b c] for all a b c
17:47tmcivermk: I think conj is doing what it's advertised to do. What you want will require code, I think.
17:47TimMcThe real problem is actually the other behavior you mention.
17:49mkTimMc: ,(conj {:a 0} {:b 9} :a :a)
17:49mk,(conj {:a 0} {:b 9} :a :a)
17:49tmcivermk: 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:49clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword>
17:52mktmciver: assoc handles that for vectors (and maps)
17:53mkI initially thought maybe I was missing something in terms of understanding conj, but probably not. It's just ugly.
17:55tmcivermk: well yes, but not as in your example above: (assoc [0 9] {0 8} {1 8} {2 8})
17:58mktmarble: right - I think I meant more that assoc was consistent over the various colls
18:01solussd__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:01septominmk: note that assoc on a vector doesn't extend the vector
18:03mkseptomin: interesting - thanks
18:03mkthough apparently it does extend it if it appends to the end
18:04tmcivermk: but you wouldn't use assoc for that - you'd use conj. ;)
18:05septominhuh, that's kind of odd actually
18:05mksolussd__: (keyword "abc")
18:05septomin,(assoc [] 1 :a)
18:05clojurebot#<IndexOutOfBoundsException java.lang.IndexOutOfBoundsException>
18:05cemericktechnomancy: if your editor can't wrap lines reasonably, then you're going to mind files that are wider than X ;-)
18:05septomin,(assoc [] 0 :a)
18:05clojurebot[:a]
18:06cemerickI mostly write code and prose to be maximally readable…which often stays below 80 cols in the former case. *shrug*
18:06RaynesI don't wrap lines anymore.
18:06RaynesI just never write code that is longer than my text editor window.
18:06RaynesIf I need to write longer lines, I make said window wider.
18:06mkseptomin: I suspect that the right thing to do is return a sparse array instead of throwing an exception
18:06technomancycemerick: yeah, for docs you can get away with wrapping
18:06mkseptomin: but then you lose proper iterability
18:07solussd__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:08zzachDoes anybody know a reference to Clojure source code implementing a TCP forwarding proxy?
18:08septominmk: is there a sparse array data structure in core?
18:10mksolussd__: is it really a keyword when it comes out of the database?
18:11solussd__mk, it's a keyword out of norma. :)
18:11solussd__*korma
18:11mkseptomin: yeah - map ;)
18:12mkseptomin: 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:13septominyeah, it seems like a lot of extra complexity
18:15septominmaybe you could use replace for this?
18:15mksolussd__: I ended up searching clojure-log.n01se.net for korma underscores. Somewhat amusing. Hi future reader of the logs.
18:15septominI'm not sure I understand the original problem
18:16septominyou have a map of ints to values, and you want to create a vector where the keys are the indices?
18:17mksolussd__: I'd just do the replacement. I wouldn't want the underscores leaking out into the rest of my code, yaknow?
18:17RaynesI've tried to search those logs before.
18:17RaynesDidn't work out.
18:17TimMcsolussd__: Sounds like a job for... conjugation!
18:17RaynesI just grep my own logs these days.
18:17Rayneslazybot keeps logs of this channel on his server.
18:18TimMcso does timbot
18:18TimMcI mean, so do I.
18:18solussd__TimMc: thanks
18:19solussd__TimMc: have a link? the googles are failing me
18:19TimMcsolussd__: It's the name of a technique. I don't think there's a helper in core.
18:20mkseptomin: 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:20TimMcname/keyword form an inverse pair of fns going between string and keyword space, and replace-underscores is being run in string-space
18:21mkseptomin: I have no practical question, I'm just reading the docs for all the clojure functions/macros
18:22septominoh 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:22amalloyTimMc: did you read that article about "under" in (i think) APL?
18:22TimMcHmm, no.
18:23TimMcbrehaut was telling me about conjugation -- not sure if it is reified in Haskell, but I think it is
18:23mkseptomin: 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:23TimMcamalloy: What is APL?
18:24solussd__fuckit (defn keyword_- [kw] (str/replace (name kw) #"_" "-"))
18:24dnolenA Programming Language (APL)
18:24brehautTimMc: ∆˝Ï˝ÔÚÇÎ‰ÔØ‡fi˝◊˜◊¨21
18:24TimMcOh, that.
18:24solussd__array programming language? :)
18:24TimMcI thought it was the name of a book.
18:24solussd__the predecessor to J.
18:24dnolengood read http://www.elliscave.com/APL_J/tool.pdf
18:24solussd__apl is cool
18:25amalloyah, here we go
18:25amalloyhttp://prog21.dadgum.com/121.html and then the sequel http://prog21.dadgum.com/122.html
18:26septominmk: I think it makes sense when you consider what it means to add to a map
18:28mkseptomin: right, but any ordered sequence is also a mapping (from N to values)
18:30septominsure, but other sequences are not just mappings
18:30mkseptomin: see clojure.lang.Associative
18:31mkseptomin: right, but if conj etc. treat one as a mapping, they should treat the others as such
18:32septominmk: i don't agree, conj has to let you add an arbitrary object to a vector
18:33septomingiven that you can't add an arbitrary object to a map, it's reasonable to have conj mean "add this key and value"
18:35mk,(conj {1 1} {1 9 2 9})
18:35clojurebot{2 9, 1 9}
18:35mk,(conj [1 1] [1 9 2 9])
18:35clojurebot[1 1 [1 9 2 9]]
18:36mkit merged the first, but appended the second
18:38mk,(conj {1 1} [2 2] [1 2]) ; this is how maps should work with conj
18:38clojurebot{2 2, 1 2}
18:41septominit would be kind of crazy for conj on a vector not to append
18:41mrmekonhow does dot-notation method access work in ClojureScript?
18:41mrmekonI want a partial function to a native JS method
18:42mkmrmekon: memfn
18:45mkseptomin: sure, but then it shouldn't sometimes behave like merge
18:45septominso it would just die on that map case?
18:45mrmekonmk: that doesn't seem to exist. is it new?
18:47mkmrmekon: it's since 1.0 ... (doc memfn) ?
18:48mrmekonerror. I just realized I can't tell what version I'm even using. whatever cljsbuild grabbed
18:49mkseptomin: yep, with an exception. You're never going to polymorphically mix what sort of collection you're applying it to
18:49mkmrmekon: (doc doc) ?
18:50septomini could buy that
18:51mrmekonclojurescript doesn't seem to have doc. You noticed the *script* on the end there, yeah? :)
18:51emezeskemrmekon: Could you just use something like #(.length %) ?
18:52emezeskemrmekon: I don't think memfn is implemented for clojurescript
18:52mrmekonyeah, looks like memfn is excluded in core.clj
18:54emezeskemrmekon: Err, my example should have been #(.-length %)
18:54mkmrmekon: err, I think I ignored that you were using js. partial doesn't work over there?
18:55mrmekonI have (.webkitRequestAnimationFrame (dom/getWindow) #(do-stuff)) working
18:55mrmekonor, alternatively, (. (dom/getWindow) webkitRequestAnimationFrame #(do-stuff))
18:56emezeskemrmekon: Is that not sufficient for what you're doing?
18:56mrmekonbut 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:56emezeskemrmekon: #(.-member-requiring-two-args first-arg %)
18:57mkwe don't have a javascript bot do we
18:57amalloywe call him...google chrome
18:58cemerickoh god no
18:59cemerickI'm going to add a jvm bytecode bot if a js bot shows up. :-P
18:59emezeskeI think mk meant a clojurescript bot
18:59mrmekonoh, there we go. Anonymous function notation works without the hyphen
19:00cemerickemezeske: ah. Sorry for the nerd rage in that case. ;-)
19:00emezeskecemerick: ^_^
19:01mk...I actually wouldn't even mind watching a bytecode bot get used properly
19:01brehautgfredericks: just make it silently ignore you
19:01gfredericksbrehaut: it will ignore you in different ways depending on your irc client
19:01brehautlol
19:02mrmekonok, new but similar question
19:02mrmekonhow do I test for whether a JS method exists?
19:02lynaghkmrmekon: see if the corresponding property is nil; (nil? (.-lehfn js-thing))
19:03mrmekonthat's what I tested first. it seems to return false no matter what
19:05mkit's unfortunate that in (assoc [8 9] 0 1) (dissoc [1 8 9] 0), the first works but the second fails
19:06gfredericksmk: you'd want [8 9]?
19:06technomancymk: finger trees can do that
19:06lynaghkmrmekon: ah, you're right. I could have sworn that's what I did in the past.
19:06gfredericks&(dissoc [1 8 9] 2)
19:06lazybotjava.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.IPersistentMap
19:06technomancythey're a lot more flexible than vectors, but there's a fair amount of overhead for them
19:07mrmekonif 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:07mkgfredericks: yep. Just seems strange that one plays with vectors and the other doesn't
19:07gfredericksmk: they work with as much as is natural for the data structure
19:07lynaghkmrmekon: ah you want the undefined? fn.
19:07gfredericksyou can't remove efficiently from the front of a vector
19:08mrmekonyeah, there we go, fn? works
19:08mrmekonthanks!
19:08mk,(assoc [8 9] 2 1)
19:08clojurebot[8 9 1]
19:08septominyou also can't remove sanely from the middle of a vector
19:08gfredericksmk: I think mostly assoc works with vectors because vectors allow updates in arbitrary locations efficiently
19:08mkgfredericks: if the above works, the rest should too
19:08gfredericksso otherwise you'd have to make up a new function for doing that
19:09gfredericksvassoc
19:09technomancymk: dissocing off the end should work; dissocing off the head should not
19:10gfrederickstechnomancy: it doesn't
19:10mkI'm ok with a structure failing an operation, but there's no reason you can't dissoc from the tail of a vector
19:10mktechnomancy: right, agreed
19:10technomancygfredericks: right; that's dumb.
19:10gfrederickstechnomancy: okay, I misinterpreted "should"
19:10gfredericks(dec english)
19:10lazybot⇒ -1
19:10technomancygotcha
19:11TimMcIs dissoc undefined for vectors because no one has written an O(log n) impl?
19:12mkTimMc: dissoc would only work at the tail, I think. The head is alright if it can be done quickly
19:13emezeskeTimMc: is O(log n) possible for a true contiguous vector?
19:13gfrederickstechnomancy: 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:13TimMcemezeske: Clojure's vectors are fancy underneath.
19:13emezeskeTimMc: Ah, so not contiguous, makes sense
19:13lynaghk(fancy = trees trees trees trees)
19:13TimMc$google clojure vector 32-way
19:13lazybot[Understanding Clojure's PersistentVector implementation | Higher ...] http://blog.higher-order.net/2009/02/01/understanding-clojures-persistentvector-implementation/
19:13gfredericksTimMc: you'd have to redo the structure to dissoc arbitrarily
19:14emezeskeTimMc: I was gonna say, O(log n) would be exciting news to me :)
19:14gfredericksthey'd end up being more like finger trees
19:14gfredericksand therefore less performant I guess
19:14septominif we're talking about dissoc for the tail specifically, there's butlast or pop
19:15TimMcgfredericks: 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:15gfredericksTimMc: I think removals are O(n), because you have to shift everything around
19:16mkarbitrary dissoc shouldn't affect the mappings of the other keys, but it would if you plan to shift everything
19:16gfredericksin a vector the position of an item in a chunk never changes
19:16TimMchmm
19:16TimMcif you had offsets...
19:16TimMcme too
19:16septominshifting indices seems like the clearly wrong thing
19:17mkseptomin: yep, hence tail (never head, as I said before)
19:19technomancyTimMc: if you had offsets, you'd have finger trees =)
19:19septominit just seems like pursuing completeness for its own sake to have a function only work on one value
19:19TimMctechnomancy: OIC
19:20septominthe number of times that behavior would be useful seems pretty outweighed by the number of times people would think it does something else
19:26mkseptomin: I think this sort of thing suggests that a cleaner distinction should be made between sparse and non-sparse, etc.
19:29amalloydistinction: vectors are non-sparse
19:36mk,(select-keys [0 1 2 3 4 5] [0 1 2])
19:36clojurebot{2 2, 1 1, 0 0}
19:36Frozenlock,(apply Integer/parseInt ["1" "2" "3"])
19:36clojurebot#<CompilerException java.lang.RuntimeException: Unable to find static field: parseInt in class java.lang.Integer, compiling:(NO_SOURCE_PATH:0)>
19:36mkwhy is this returning a map.
19:36Frozenlock-_-
19:37Frozenlockmk: select-KEYS ? (I suppose keys are expected in maps)
19:37mkFrozenlock: you wanna map that
19:38FrozenlockYeah, any idea how to do it? (without an anonymous fn)
19:38mkFrozenlock: I gave it an array, and it behaved correctly, but returned a map. Nevermind, I see why - no sparse arrays allowed.
19:38Frozenlock,(apply + [1 2 3])
19:38clojurebot6
19:39FrozenlockOh sure, THIS works.
19:39mkFrozenlock: apply injects the + into the start of the given list
19:40FrozenlockAhhhh, no wonder then.
19:42FrozenlockIs it because a method isn't a function?
19:42Frozenlock,(map (fn [a] (Integer/parseInt a)) ["1" "2" "3"])
19:42clojurebot(1 2 3)
19:43mkFrozenlock: I was thinking memfn, but apparently that doesn't work for static methods
19:43FrozenlockIsn't there a clojure function to parse strings?
19:46mk,(map bigint ["1" "2"])
19:47clojurebot(1N 2N)
19:47qbg&(read-string "(+ 2 2)")
19:47lazybot⇒ (+ 2 2)
19:47qbgFrozenlock: Like that?
19:48Frozenlock,(map read-string ["1" "2" "3"])
19:48clojurebot(1 2 3)
19:48mk,(map read-string ["1" "(drop-table)"])
19:48FrozenlockHmm yeah, that could do it :)
19:49clojurebot(1 (drop-table))
19:49qbgYou might want to set *read-eval* to be false ,depending on where that data comes from
19:50Frozenlock,(let [*read-eval* false] (map read-string ["1" "2" "3"]))
19:50clojurebot(1 2 3)
19:51qbgUse binding
19:51qbgnot let
19:51mkyou 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:51qbg&(Integer/valueOf "123")
19:51lazybot⇒ 123
19:52qbgIf you use let, you aren't setting *read-eval* to false
19:53mk,(map #(Integer. %) ["1" "2"])
19:53clojurebot(1 2)
19:53Frozenlockhttp://stackoverflow.com/questions/1523240/let-vs-binding-in-clojure
19:54FrozenlockI spend too much time in emacs (where let is dynamic).
19:58FrozenlockYay.. tried sqrt, square-root, sr, only to realize it must be something in java.
19:59Frozenlockie Math/sqrt
20:27yoklovaha! replacing the sets with arrays in clojurescript have brought the performance of this program from totally unusable to almost tolerable!
20:39technomancyemezeske: if nothing else, we can all take away a lesson on the value of a carefully-curated killfile
20:39emezesketechnomancy: Yeah, that and I also learned personally that feeding is bad.
20:40ibdknoxhey guys. Long time listener, first time caller - I don't like the syntax for maps. Can we change that?
20:40emezeske*click*
20:40ibdknoxhow rude!
20:40ibdknox;)
20:41emezeske*plonk*
20:41technomancykind of reminds me of https://github.com/clojure/clojure/pull/6
20:42ibdknoxlol
20:43mkwhere's this alt set literal thread?
20:43muhoomk: don't touch it!!!! it's evil!!!
20:43emezeskemk: don't do it!
20:43mkI just want to look! I promise!
20:45muhoowww.youtube.com/watch?v=mY9Z5OPzE78
20:46amalloyseancorfield: there seem to be some reflection warnings in clojure.java.jdbc - calling .getCause on exception objects but without hinting them as exceptions
20:46seancorfieldpatches welcome via jira :)
20:46seancorfieldsrsly i didn't think it was worth trying to optimize the exception handling case
20:47seancorfieldbut 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:52seancorfieldhow many folks are using pmap? how lazy is it in reality?
20:52amalloyseancorfield: oh, i agree it's not worth optimizing; it's only worth doing to reduce the "noise" so actually-important warnings stick out
20:52technomancyseancorfield: most of the time I've tried pmap I realized later I really wanted pdoseq.
20:53muhoois there a pdoseq?
20:53technomancyno
20:53seancorfield:)
20:54seancorfieldmaybe i should just try pmap in this case and see what happens :)
20:54technomancyseancorfield: it works fine if each element costs roughly the same amount of time
20:56mkI think dorun map is faster than doseq
20:56amalloysigh, jira is such a pain, seancorfield. what if instead, you just add ^Throwable to line 217 of internal.clj?
20:57technomancyoh man amalloy, are you on jira strike?
20:58amalloyi've confirmed that that change fixes all reflection warnings, and doesn't cause any tests to fail
21:02amalloydoes 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:06seancorfieldamalloy: so it would read (letfn [(throw-non-rte [^Throwable ex] ... ?
21:06amalloyyes
21:07seancorfielddone & pushed
21:07amalloythanks
21:08seancorfieldof course, if exceptions had never been wrapped in RTEs in the first place, we wouldn't need that code...
21:08amalloyyeah
21:08amalloynow that's fixed for 1.4 afaik, but you're probably stuck with the code forever to support 1.3
21:09seancorfieldyeah :(
21:09seancorfielddon't you have commit access to c.j.jdbc anyway?
21:10amalloyi do, but i don't really know when it's appropriate to use it
21:11amalloysince it's not a project i'm officially a participant of
21:12seancorfieldi think the general rule is just to ask the project lead for permission to do small stuff like that
21:13seancorfieldmost leads seem fine with reflection warning cleanup (although i've been known to break code with over-zealous cleanup - in congomongo - oops!)
21:13amalloy*chuckle*
21:16amalloyah, 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:17seancorfieldyeah, = got a specialized case for Character in 1.4 i think
21:17seancorfieldi remember seeing some discussion of it because it was causing lots of reflection warnings in a number of contrib libraries
21:17amalloyright, i remember it too but don't really know what the root problem was
21:17seancorfield= had numeric specializations but not character :)
21:18amalloyright, but what happened between 1.2 and 1.3 to create the problem?
21:19amalloywas there no numeric specialization in 1.2, maybe?
21:21seancorfielddunno much about 1.2 :)
21:21seancorfieldthe commit to fix it (in 1.4) was this https://github.com/clojure/clojure/commit/405d24dd49d649c01b7881f1394fc90924c54ef0
21:25amalloyhuh, okay. thanks
21:25jimdueydnolen: Are you around?
21:31FrozenlockNoooooo! Contains! Y u are for keys?!?!
21:32FrozenlockSomehow I thought it was something like "If the sequence -contains- the argument, return true".
21:32xeqithat comes up often
21:33FrozenlockWell at least I'm not the only fool :p
21:33xeqi&(some #{:a} [:a :b :c])
21:33lazybot⇒ :a
21:34xeqi&(some #{:d} [:a :b :c])
21:34lazybot⇒ nil
21:35blakesmithDo 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:36weavejesterblakesmith: A lot of deployments use the Jetty adapter, and then something like nginx to proxy.
21:37weavejesterThere's also pallet which is similar to chef
21:37weavejesterAnd there are tools like lein-beanstalk for deploying to AWS, and Heroku also supports Clojure.
21:38blakesmithAh, cool. I didn't think of using pallet for deployments.
21:38FrozenlockCan't jetty be used directly? Why would you want to proxy?
21:39gfredericksFrozenlock: I was thinking that too but I was too embarrassed to ask
21:39gfredericksmy guess is you use nginx for the static stuff?
21:39weavejesterFrozenlock: Proxying is useful so you don't have to run as route, and so you can load-balance
21:39weavejesterIt also helps with SSL
21:39blakesmithI like doing my rewrite rules and other lb stuff in nginx.
21:39weavejesterAnd if you want to run more than one service
21:40ibdknoxgzip is also much more efficient through nginx
21:40gfredericks"run as route"?
21:40weavejesterEr… root :)
21:40ibdknoxand you can run multiple apps on one box
21:40weavejesterClearly I'm thinking phoenetically.
21:40ibdknoxwithout reverse proxying, you couldn't really
21:40gfredericksweavejester: now I'll start using soudo
21:40weavejestergfredericks: :P
21:40blakesmithweavejester: Thanks for the advice, I appreciate it.
21:49metajackI'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:07FrozenlockClojure (the original Java-based implementation)
22:07FrozenlockClojureScript (compiles to JavaScript)
22:07FrozenlockClojureCLR (for Microsoft's .NET framework)
22:07Frozenlockclojure-py (Python-based)
22:07Frozenlockclojure-scheme (compiles to Scheme)
22:07FrozenlockAnd I believed there was only clojure and clojurescript
22:07FrozenlockSilly me.
22:09xeqiand CinC
22:09FrozenlockCinC?
22:10xeqiI've seen mention of someone working on clojure in clojure
22:10xeqimaybe https://github.com/remleduff/CinC ?
22:10technomancyI think that's intended to still be JVM-hosted
22:11Frozenlockhttp://blog.n01se.net/?p=41
22:14devntechnomancy: i dont think so
22:14mktechnomancy: but presumably a clojure in clojure can still run on the jvm, it just wouldn't touch any java code...
22:14Frozenlockmk: pa-ra-di-se :P
22:14Raynestechnomancy: Intended to be JVM-hosted and destined to be ignored by core. :(
22:14devnRaynes: why do you say that?
22:15FrozenlockNo more Integer/parseInt call :D
22:15RaynesThey've been pretty apprehensive about it. They actually told him to not get his hopes up, I think.
22:15ibdknoxthat thread made me sad :(
22:15RaynesI think he is not accepting pull requests though.
22:15devni didnt actually see that one
22:15RaynesSo perhaps he'll be able to keep track of everybody who contributes.
22:15devn(that thread)
22:15RaynesBut I fear it wont be enough.
22:16technomancyfile under "how not to encourage and empower your most enthusiastic users"
22:16RaynesNot to say that I don't think it is fair to turn it down if it was poorly implemented.
22:17RaynesBut pretty much any political reason would really bother me.
22:17devni have a feeling there is work going on behind the scenes for CinC
22:17devnthere always has been, clojurescript was behind the scenes work toward CinC
22:17RaynesThey do tend to do stuff behind the scenes.
22:18RaynesWhich makes sense, because people are so opinionated about things.
22:18devnyeah dude, cedric, jesus.
22:18FrozenlockCinC would be host independent? Your code could work everywhere?
22:18technomancyFrozenlock: that's not the main goal
22:19Raynesdevn: Cedric is a troll -- not opinionated.
22:19RaynesYour code would not work everywhere.
22:19devnthe 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:19RaynesThat's not really feasible.
22:19rlbFrozenlock: I would assume you would still need platform functions.
22:19RaynesAny significant code is likely to rely on platform specific libraries.
22:19rlbUnless there's some plan for a clojure "standard library".
22:19rlb(which would surprise me)
22:19RaynesBut then again, dnolen apparently did magic and made core.logic work on clojurescript.
22:20qbgcore.logic was not that close to the host
22:20technomancycore.logic is totally algorithmic
22:20RaynesI don't know anything about core.logic.
22:20qbgBesides it being pure win?
22:21RaynesI hear.
22:21RaynesConstantly.
22:21RaynesI'm sure I'll have a reason to use it eventually.
22:21qbgI just watched the miniKanren talk. "Lets generate 30 programs that evaluate to 6"
22:21devnive been reading, but it's slow going
22:21gfredericks Raynes: QUICK! who owns the zebra?
22:21devni bought the art of prolog
22:22Raynesgfredericks: Drugs are bad for you.
22:22devnbut that is heavy duty -- i backed off and am working through the reasoned schemer instead
22:22brehautRaynes: nah, its the albanian on the fifth floor
22:22RaynesI have no idea what we're talking about.
22:22brehautzebras
22:22qbgzebrao
22:23devnzebro
22:23RaynesOh.
22:23devnbtw, what *is* the reason for the -o suffix on logic fns?
22:23FrozenlockThere was something about core.logic. Then TSHTF.
22:23qbgdevn: It denotes that it is a relation
22:23RaynesThe zebra puzzle.
22:23devnqbg: thank you.
22:23mkRaynes: 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:23FrozenlockI'm the Doppler effect.
22:24RaynesYeah, if I ever need to solve that I'll pull out core.logic.
22:24devnmore like doppelganger
22:24qbgIf you ever need to get a start up idea, pull out core.logic
22:24devnkibit is using core.logic in a really cool way
22:24mkRaynes: and so on. Then, you use logic to figure things out. Also, something about books we've read, trolls, and um...
22:24qbgWrite good-startupo, and run it backwards
22:24muhooheheh
22:24devnambrose' plans to create drop in type checking in clojure are awesome
22:25RaynesApparently 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:25devnkibit is i think one of my current favorite projects
22:25brehautRaynes: failing that, you could always read bratko and learn about monkeys and bananas
22:26devnivan...such a weird dude.
22:27devnreminds 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:27devnstruck me as weird at the time, so weird in fact that i remember almost everything he said
22:27muhooit 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:27muhoowombats, btw, are awesome. they have an armoured ass.
22:28devnas long as you used "armoured" instead of "armored" I think I'm still allowed to respect that statement
22:28devnclassy.
22:28devnyou're a very "colourful" gent ;)
22:28muhooshould have used arse
22:29brehautseriously, donkeys in full plate? that'd be awesome
22:29FrozenlockOMG I need that!
22:29gfredericks"If I am the king of england and I am not the king of england, then I am the pope."
22:29mkthe problem with declarative code is that you lose track of the efficiency aspect of programming
22:30muhoowell, for some problems, that's ok
22:30muhooi wouldn't write a gui in core.logic :-)
22:30muhoobut a game in core.logic? hmm.
22:31mkI'd like to see kibit do a pass through clojure.core
22:32muhoowhat would happen running kibit on kibit?
22:32Frozenlockmk: would it choke on the java calls?
22:33mkFrozenlock: I hope not - I just recall seeing a bunch of def fns instead of defn and so on
22:34devnmk: i did that
22:34devnmk: there were about 5 things that it found -- all of which i think were deliberately done for performance or bootstrapping reasons
22:36devnmuhoo: running kibit on kibit shouldnt be a problem
22:36Frozenlockmuhoo: you create the singularity
22:36mkdevn: 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:36FrozenlockAI improving AI.
22:37devnmk: that's true...and it isn't.
22:37muhoorobots building robots.
22:37devnrich made a comment about pattern matching vs declarative programming
22:37devnpattern matching => order-complected. take it to your client and ask them if the logic is right.
22:38devntake a set of declarative facts about a domain and there is clarity there
22:38mkdevn: don't follow yet - pattern matching?
22:38devnhttp://en.wikipedia.org/wiki/Pattern_matching
22:39devncheck out dnolen's core.match library
22:39devnhttps://github.com/clojure/core.match
22:41mkin what sense is it order-complected?
22:43devnpatterns are tried in order, top to bottom
22:43devndeclarative programming allows the computer to rearrange your steps to achieve a result
22:43technomancyseems like logic queries just sidestep that by giving you all the answers
22:43technomancyyou still have to order them
22:44mktechnomancy: but presumably that's priority ordering, not execution ordering
22:44devnyes, but you can describe ways in which the computer should or might reorder your facts
22:45mkdevn: 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:45devnthe same isnt true in pattern matching to my knowledge, but honestly, most of this is still out my area of expertise tbqh
22:45devnmk: no. they arent objectively "bad", but that's not the perfect scenario for all problems
22:45devnnor is declarative programming
22:45devnnor is functional programming, and so on
22:46gtuckerkellogghmm, just loaded midje and midje.el.
22:46technomancymk: no, it's actually explicitly nondeterministic
22:47devnmk: 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:47devnhttp://stackoverflow.com/questions/129628/what-is-declarative-programming
22:47devn"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:47technomancyI 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:48mktechnomancy: 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:48devnmk: then implement your own STM ;)
22:49devnim just kidding, but yeah, i hear you -- "magic" is never magic
22:49gtuckerkelloggdoes 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:49devnbut there's a reason there's confidence behind a statement like that
22:49technomancyyeah, agents are used much less frequently than atoms
22:49solussdcan anyone point me at any medium to large-scale websites built using any of the clojure web frameworks? need some ammo for work. :)
22:49devnsolussd: http://flightcaster.com/
22:50devnim not sure that was built with a framework
22:50technomancythat was just clojure on the backend
22:50devnso dont quote me on that
22:50devnyeah, whoops, rails front end
22:50technomancyhttp://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:50devnthedeadline was definitely all in clojure
22:51devnon GAE
22:51solussdawesome- thanks everyone!
22:51devnwusoup too to my knowledge
22:51devnsolussd: if you need to compromise vote for a front end but insist on a clojure backend
22:51mkdevn: 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:52devnmk: those are things you determine up front by using your noggin
22:52devni dont see how that's different from if this, then that programming
22:52devni run into cases all the time where the else condition is costly in a way i didnt anticipate, etc.
22:53technomancymk: 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:53Raynessolussd: https://refheap.com is all Clojure.
22:53RaynesDoes it qualify as medium?
22:53devnsure, looks pretty too
22:53devnnice job
22:54RaynesAlex McNamara gets most of the credit for the look.
22:54mkdevn: noggin sure, but I can't use that if all I know is that it's arbitrary
22:55gfredericksI don't know what clank is but it should have been named ##(format "lib-%04d" (rand-int 10000))
22:55lazybot⇒ "lib-7743"
22:55mktechnomancy: 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:00devnmk: okay, so then is it fair to say that what we're really discussing here is a lack of familiarity?
23:00devni feel like we're coming to the point where we just agree and say "no silver bullet"
23:02devnbut 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:02devnwhich 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:03mkdevn: 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:05devnsure, but efficiency is not 1 dimensional. it not just about speed, right?
23:05mkright, space too
23:05devnand even then, what about the quality of the result?
23:05devncan you rely on that result? would you stake a pilot's life on it?
23:05devnetc.
23:06mkwell, that's the reason we want conceptual elegance
23:08devnso, 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:10devnhe 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:11devn... some point a value is requested
23:11dnolenmk: 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:11devndnolen: *wipes sweat* so glad you're here to explain how much im misguiding mk
23:11RaynesGood ol' dnolen.
23:12RaynesMaster of the human race.
23:12devnI hear he changes file permissions with a magnet and a pin...
23:13devnhttp://repo.or.cz/w/propagator.git <--cool
23:14mkdnolen: 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:17mkdevn: http://www.infoq.com/presentations/We-Really-Dont-Know-How-To-Compute < this one?
23:17devnmk: yeah
23:17devnit's a great presentation. entertaining speaker.
23:18RaynesI watch my talk every night with popcorn.
23:18devnlol
23:19duncanmoh, maybe i can ask my node.js questions here - the clojurescript people might be able to answer...
23:19duncanmhey dnolen
23:19duncanmfrom what i can tell, the node.js dev experience is very far away from using the lisp repl
23:20duncanmi can't seem to find an easy way to reload definitions
23:20dnolenduncanm: yep, somebody needs to work on that.
23:21devnhttp://stackoverflow.com/questions/1972242/auto-reload-of-files-in-node-js <--duncanm
23:23Frozenlockmk: damn you! I was supposed to go to bed! Now I can't! Because.. well Sussman.
23:23duncanmdevn: i saw that, but that's not quite the same thing
23:24devnduncanm: yeah, sorry -- all i could find for you
23:24mkFrozenlock: salamanders. They cut the arm off right here :)
23:24dnolenduncanm: I started on Node REPL support on a fork of CLJS, but it needs work.
23:24duncanmdnolen: i find it incredible that they've been developing all these big things in that system, and they still haven't implemented this
23:24Frozenlockmk: 3 elbows :P
23:24dnolenduncanm: the list of things to do is significan to say the least.
23:25duncanmdnolen: the incredibly thing is the list of things they've already accomplished in the existing system
23:25duncanmthings like ldap.js and other fairly big systems
23:25duncanmincredible
23:25duncanmdnolen: i'm trying to learn coffeescript right now
23:26devnduncanm: check out dnolen's fun.coffee
23:26dnolenduncanm: coffeescript is neat
23:26duncanmmy routine is: run coffee, Foo = require './foo', run Foo.test, something blows up, fix it in emacs, quit coffee, rinse and repeat
23:27rubber_duckis 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:27duncanmdnolen: is there a better way?
23:27devnduncanm: a filesystem watcher wont work?
23:27duncanmdevn: i suppose i could set that up
23:28duncanmi'm just used to scheme/clojure, where i can just send defns to the repl buffer
23:28jimdueydnolen: 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:28duncanmand do things like (load "foo") and fix up the repl state, etc
23:28dnolenduncanm: 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:29duncanmdnolen: i think with coffee, there's --bare mode
23:29devnrubber_duck: like ##(meta (with-meta '(+ 1 1) {:result 2})) ??
23:29lazybotdevn: What are you, crazy? Of course not!
23:29lazybot⇒ {:result 2}
23:29dnolenduncanm: https://github.com/swannodette/clojurescript/tree/node-repl
23:30dnolenduncanm: script/node-repl will launch a node-repl you can interact w/, use at your own peril, not very well documented.
23:30devnduncanm: there's a --bare mode yeah
23:30dnolenduncanm: improvements appreciated, but I don't have bandwidth to spend much time on it now.
23:30dnolenjimduey: I thought there was but I'm no fork/join expert
23:31Zokatechnomancy: have you seen lein-webrepl plugin fo Leiningen 2.0? https://github.com/zoka/lein-webrepl
23:32technomancyZoka: literally on my list of things to check out tomorrow =)
23:32duncanmdnolen: does cljs support clojure.string?
23:32dnolenduncanm: some of it yes
23:32jimdueydnolen: it's the last piece before this baby works. :)
23:32duncanmsigh, i already know clojure, and i wanted to learn the hipster thing with coffeescript ;-P
23:33dnolenduncanm: you could probably get the job done w/ CS, but I would miss a lot of CLJS features.
23:33duncanmdnolen: i've been writing my coffeescript with a lot of ()s - it's actually looking kinda lisp-ish
23:33duncanmdnolen: i'm writing a parser for org-mode files
23:33dnolenduncanm: CS syntax is terrible for real functional programming IMO.
23:33devndnolen: 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:33rubber_duckdevn, 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:33duncanmdnolen: what makes you say that?
23:33dnolenduncanm: the whitespace oriented syntax and right associate parsing rules stink.
23:33devndnolen: err when i say happen i mean, i saw someone ask on the list, wasn't sure if anyone got back to him
23:34dnolenduncanm: you need lots of extra parens all the time.
23:34dnolenduncanm: might as well be programming in Lisp.
23:34duncanmdnolen: yeah
23:34duncanmi was hoping i could find a comfortable non-lisp language to work with
23:35dnolenduncanm: 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:35dnolenbbiab
23:35duncanmhmm
23:37yoklovcoffeescript's syntax for functional programming is pretty annoying. -> -> ->
23:37yoklovit's hard to read after 2 nested functions imo
23:38duncanmi was sad to see that underscore.js didn't implement the multi-arity version of map
23:38yoklovyup. multi-arity map is awesome
23:38duncanmi think their signature is _map (coll, fn)
23:38duncanmwithout multi-arity map, you have to use a zip thing, which is how it is in ruby
23:39duncanm(a.zip b).map lambda {|x, y| ....} -- something like that
23:39yoklovyeah, i think i've done that in ruby
23:40duncanmit probably gets hairier when you want to go with 3 collections
23:40duncanmhmm, i wonder if coffeescript's comprehension syntax makes this better...
23:41yoklovyeah i'm sure. multi-arity map is also nice for doing 2d things like (map + point1 dist)
23:41yokloverr really delta
23:42duncanmboo
23:42yoklov?
23:43duncanmyoklov: how lame is that: https://gist.github.com/2212307
23:43duncanmmaybe i need to call .toString?
23:43duncanmthat's another thing i haven't figured out yet
23:43yoklovoh
23:44yoklovactually, i know whats wrong, you need to set your specify your print-depth to your call to print or something like that
23:44duncanmprint-depth?
23:45duncanmman, what is this, even 1970s lisp has a better repl/printer system than this
23:45yoklovwhat is it, http://nodemanual.org/0.6.10/nodejs_ref_guide/util.html#util.inspect
23:45duncanmwhen did they invent pretty-printer?
23:46yoklovi like clojure much more than js though :p
23:46duncanmboo
23:46duncanmcoffee> util.inspect [[x, y, z] for x in As for y in Bs for z in Cs]
23:46duncanm'[ [ [ [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:46duncanmhow lame
23:46duncanmi'm so disappointed
23:46yoklovno, look at the arguments to inspect
23:47yoklovutil.inspect obj, showHidden, depth
23:47duncanmyeah
23:47duncanmyoklov: the output is still ugly
23:47yoklovwell yeah.
23:48duncanmand that code is wrong either way
23:49duncanmyoklov: i think there's a niche for a non-lisp language with a sensible repl, to be built on top of node
23:50duncanmcoffeescript is so close to being that
23:51yoklovwrite it in clojurescript :p
23:51duncanmi was hoping that this will be like a better ruby
23:51yoklovwhat?
23:52clojurebotwhat is seq
23:52technomancythat'd be a hard sell without integers
23:52yoklovoh, writing a language in clojurescript?
23:53duncanmheh
23:54duncanmtechnomancy: you're talking about how all numbers in JS are floating point?
23:56technomancyright
23:56yoklovwhat would be a hard sell?
23:56duncanmwingo has a good blog on how things are represented in the JS runtimes
23:56duncanmhttp://wingolog.org/archives/2011/05/18/value-representation-in-javascript-implementations