#clojure log - Dec 03 2011

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

0:08 seancorfield: quick Q: playing with george jahad's cdt and his instructions say run lein swank and connect to it as you usually do... i have been doing clojure-jack-in from emacs...

0:08 what's the "usual" way to connect emacs to a swank server?

0:09 georgek: slime-connect

0:10 seancorfield: so obvious ... thank you!

0:10 georgek: it's funny I can't get jack-in to work at the moment :)

0:10 technomancy, I updated clojiure-mode and swank-clojure, I get the error error in process filter: Opening input file: no such file or directory, c:/Documents and Settingsgeorge/.emacs.d/swank/slime-cdf283b4.e

0:11 oops just noticed that file path, weird

0:11 seancorfield: wow, cdt is freakin' cool!!!!

0:30 how many different slime connection buffers can you have open in emacs?

0:32 mtkoan: is it possible to get syntax highlighting in the slime repl in emacs?

0:32 seancorfield: and is clojure-jack-in just shorthand for run lein swank and then M-x slime-connect ? (but focused on the project in hand)

0:34 mtkoan: i tried adding the line (add-hook 'slime-repl-mode-hook 'clojure-mode-font-lock-setup)

0:35 it seems to have no effect with M-x clojure-jack-in, and with slime-connect i get: Symbol's function definition is void: clojure-mode-font-lock-setu

0:35 p

0:36 georgek: mtkoan: yes

0:36 are you connecting locally or remotely?

0:36 mtkoan: locally

0:37 georgek: you need to require clojiure-mode before adding the hook

0:37 if you're not jacking in but using slime-connect

0:38 seancorfield, if you're using different ports I imagine as many as you want

0:39 mtkoan: ok

0:40 no error with slime-connect, but still not syntax highlighting either

0:40 georgek: strange, just looked in my .emacs and that's what I have

0:41 mtkoan: hm

0:43 individual words get highlighted?

0:43 georgek: I think I know what you mean, yes

0:45 mtkoan: highlighting works editing clj files, but not the repl.. oh well

0:46 georgek: can I see your .emacs?

0:46 seancorfield: georgek: thanx. suspected as much but wanted to confirm "bad things" wouldn't happen :)

0:46 i'm off for the night...

0:46 georgek: just tried it here and it works fine

0:46 seancorfield, well I'm no expert on that :)

0:50 mtkoan: i have no .emacs, its all in .emacs.d/init.el .. is that wrong?

0:50 I am new user to emacs as well ;)

0:50 georgek: no, that's it, sorry I was just using a different term

0:51 tensorpudding: .emacs.d/init.el is the same

0:51 i use it too

0:52 georgek: I updated to latest swank-clojure and clojure-mode, and now on jack-in slime is looking for filepaths like "C:\Documents and Settings\george/.emacs.d/swank/slime-cdf283b4.elc, which doesn't even exist

0:52 mtkoan: georgek: http://pastebin.com/71YwSWV7

0:53 georgek: there's a typo in clojure-mode

0:54 mtkoan: ahh i rest removed and added it back in

0:54 *just

0:54 but it wasn't working with it spelled right too I promise ;)

0:54 georgek: ok, I believe you :)

0:54 hiredman: is it a typo? or is in technomancy letting windows users fend for themselves?

0:55 georgek: don't know hiredman, there's a somewhat related thread on the mailing list but I don't quite get it

0:55 jack-in used to work fine

0:55 lein swank from the command line works fine

0:55 tensorpudding: jack-in has stopped working for me too

0:56 but with a different error

0:56 georgek: what error?

0:56 tensorpudding: can't remember the wording right now

0:56 georgek: I only updated because earlier it wasn't working for a different reason

0:56 hiredman: most likely thread the thread on the mailing list is someone saying "this doesn't work on windows" and technomancy saying "oh, well, windows, I don't have that so fix it and let me know how you did it?"

0:56 georgek: something like that :), but that user is on cygwin

0:56 but in any case, it used to work on Windows great

0:57 tensorpudding: error in process filter: Symbol's function definition is void: slime-face-inheritance-possible-p

0:57 that was the error

0:57 hiredman: technomancy is not one to go out of his way for people that don't run on linux, don't use eshell or bash

0:58 georgek: that's fine, the alternative is to have no tool after all

0:58 hiredman: tensorpudding: what version of swank clojure?

0:59 tensorpudding: i'd have to check

0:59 it's the latest on marmalade

0:59 hiredman: um

0:59 tensorpudding: when i checked a few days ago

0:59 hiredman: swank-clojure is not in marmalade

0:59 clojure-mode is

1:00 swank-clojure is a jar

1:00 tensorpudding: oh wait, right

1:00 was thinking clojure-mode

1:00 hiredman: you may want to try a SNAPSHOT of swank-clojure

1:00 https://github.com/technomancy/swank-clojure/commit/815a14db85c6512659752dde8f57d1f6145b3ddc

1:01 tensorpudding: this was the snapshot version

1:01 i haven't fetched a new one recently

1:08 mtkoan: eureka

1:09 if i mouse2 on REPL, de-select font lock, and re-select I get syntax highlighting xD

1:11 tensorpudding: i can live with jack-in not working

1:33 georgek: I think I found a patch that would fix the weird filepath issues I'm having with jack-in, but it's not pulled into the official swank-clojure...sorry I'm new at this, but I would have to rebuild the swank-clojure jar if I make that change myself, right? I can't just make the change in the .clj file in the swank-clojure jar and be good to go

2:45 OK, found a different fix that worked here https://github.com/technomancy/swank-clojure/issues/72.

3:00 bloop: I have a question about vars, but it pertains to this page: http://clojure.org/atoms why is it that the second call to fibs was already memoized? is it because that's how vars work or because the example is not precise?

3:34 tscheibl: good morning clojurians

6:06 AnswerGuy: Is there a Clojure REPL with enhancements analagous to those of iPython over the stock Python >>> interpreter/mode?

6:07 Or is Clojure + rlwrap or + Jline/Jline2 (analagous to Python >>> import readline, rlcompleter) the best option?

6:22 ejackson: AnswerGuy: as far as base repl, yeah. What you want though is to have the repl within a larger environment CCW/Emacs

6:24 AnswerGuy: CCW? There's an Emacs (or XEmacs?) module/wrapper around (interface to) the Clojure REPL?

6:24 ejackson: AnswerGuy: CCW = Counterclockwise, an Eclipse mode

6:25 AnswerGuy: check out http://dev.clojure.org/display/doc/Clojure+Tools

6:29 zakwilson: Most people using Emacs use Slime and swank-clojure.

7:13 * licenser waves

8:13 * pauldoo is, for no good reason, refactoring code to be point-free.

8:32 licenser: pauldoo: with point-free you mean not calling object functions?

8:33 pauldoo: I mean no variable names (or function argument names)

8:33 functions are made by composition

8:42 licenser: is that a good thing?

8:42 I mean I understand the elegance behind it but is it good for maintainabiltiy/readability?

8:43 pauldoo: so far, it appears to be a terrible idea…. though perhaps a fun exercise in higher order functions

8:43 maybe the results can be reused more flexibly, since the shape of the function/args is even looser than normal

8:44 * licenser laughs

8:44 pauldoo: licenser: http://en.wikipedia.org/wiki/Tacit_programming "Outside of the APL and J communities, tacit programming is referred to as point-free stylehttp://en.wikipedia.org/wiki/Tacit_programming#cite_note-0, or more pithily as pointless programming"

8:44 licenser: pauldoo: I love that there are people like you

8:45 pauldoo: thanks :)

8:45 licenser: programming would be so boring if everyone would just stick to what is good and not just try things even so they seem, and I quote you here 'a terrible idea'

8:45 tscheibl: uhm.. how do I check for a Java array? (sequential? ...) does not work

8:49 anyone? please...

8:49 I'm stuck

8:51 pauldoo: just thinking...

8:53 you can check for the class.. (class (int-array 3))

8:54 gives [I for an int array..

8:54 [Ljava.lang.Object; for an object array..

8:55 tscheibl: yeah.. but I need this generically... don't wan't to check for every possible array type

8:55 Bronsa: ,(-> (object-array 1) .getClass .isArray)

8:55 tscheibl: want

8:55 clojurebot: true

8:55 tscheibl: ahh

8:56 ,(.isArray (class (int-array [3 4 5])))

8:56 clojurebot: true

8:56 tscheibl: thanks

8:56 very much...

8:56 Bronsa: np

8:57 tscheibl: I was stuck for almost 30 minutes...

8:57 before I asked...

8:57 Bronsa: tscheibl: do you need to check if it is an array or if it is seqable?

8:57 tscheibl: nah .. i it is a Java Array explicitly

8:57 Bronsa: because in core.incubator you have "seqable?"

8:57 ok

8:58 tscheibl: because jdbc returns java arrays from sql arrays and I need to convert them

8:58 I mean... seqable probably would also work and be more clojurish :)

8:59 just need to check if a String is also seqable?

9:00 Bronsa: https://github.com/clojure/core.incubator/blob/master/src/main/clojure/clojure/core/incubator.clj#L85

9:00 it does

9:00 *is

9:02 tscheibl: i see.. so I'll go for .isArray, thx again :)

9:35 pauldoo: what's the syntax for using goog.Timer in clojurescript? I've got (ns hello (:use [goog :only [Timer]]))

9:35 this works in normal compile, but not optimized compile

10:20 TimMc: $mail tmciver [& more] says "Give me the rest of the args as a collection." [& [more]] says "The rest of the args is a collection, and just bind the first element as 'more'."

10:20 lazybot: Message saved.

10:24 TimMc: &((fn [& {a :a}] a) :a 2 :b 4) ; oh, huh

10:24 lazybot: ⇒ 2

10:25 TimMc: Apparently you can destructure a vector as a map.

10:25 &((fn [& {a :a}] a) :a 2 :odd...) ; this would be a cryptic error message

10:25 lazybot: java.lang.IllegalArgumentException: No value supplied for key: :odd...

10:27 TimMc: $findfn + {1 2 3 4} 10

10:27 lazybot: []

10:47 _ulises: can anybody point me to some reading material that explains what is a symbol?

10:49 chewbranca: _ulises: search for symbols on this page: http://java.ociweb.com/mark/clojure/article.html there is also a ton of other good stuff on that page, definitely worth reading

10:49 _ulises: awesome, thanks!

10:50 I always get confused by symbols. Sometimes I think they are just "labels" to name things, sometimes I think there's probably a lot more to them. At some point they were just keys in a map, almost like pointers, but surely that is wrong too.

10:51 So I'd definitely welcome some enlightenment in this area.

10:54 TimMc: _ulises: In other Lisps they often serve a dual purpose.

10:55 _ulises: hum, ok?

10:56 TimMc: and in Clojure, keywords have taken over part of that.

10:56 Chousuke: and vars

10:56 TimMc: mmm

10:56 Chousuke: in CL for example the thing that holds a value is the actual symbol (as far as I know, anyway)

10:56 in Clojure, the symbol is just a name for the var that holds the value

10:56 _ulises: so in clojure a symbol points to a var which holds/points to a value?

10:57 TimMc: or is just a local binding.

10:57 Chousuke: the symbol names a var, it doesn't point to it

10:57 _ulises: right

10:57 so it is a label

10:57 TimMc: Symbols name things which can get you values.

10:57 _ulises: not much more mystery to it?

10:57 Chousuke: there is no pointer or reference from a symbol to anything

10:57 yeah

10:57 _ulises: why was I then so confused? perhaps I read somewhere else about other lisps

10:57 Chousuke: might be

10:58 _ulises: ok, cool

10:58 TimMc: Keywords are *just* names, which multiple things might know about. They're used in informal APIs or data formats.

10:58 _ulises: so, once you have a symbol, you get the thing it labels by evaling it?

10:58 Chousuke: pretty much yeah

10:59 that only works for global things though; eval doesn't have access to local scope

10:59 _ulises: oh?

10:59 TimMc: _ulises: Clojure doesn't have "reified environments" -- you can't inspect a let's bindings.

11:00 Well... maybe. There's some macro hack...

11:00 Chousuke: macros have the &env parameter but it's not quite the same

11:00 TimMc: Yeah, what *does* that give you?

11:00 Chousuke: just the expansion environment I think

11:01 _ulises: ok, now I'm definitely out of my depth :)

11:01 Chousuke: heh :P

11:02 _ulises: ok, so, symbols are labels and nothing else, keywords are like labels but have extra functionality such as value lookup in maps

11:02 right or wrong?

11:02 TimMc: Keywords don't name values.

11:03 pauldoo: keywords evaluate to themselves, symbols evaluate to a value depending on the environment

11:03 _ulises: ah! true.

11:03 hello Mr.Paul.

11:03 pauldoo: 'lo o/

11:04 _ulises: \o.

11:04 Chousuke: keywords are useful as map keys because they evaluate to themselves

11:04 _ulises: Chousuke: oh? explain please?

11:04 Chousuke: ,('foo {'foo :bal}) but this works too IIRC :P

11:04 clojurebot: :bal

11:04 _ulises: but 'foo is a symbol?

11:04 Chousuke: yes

11:05 symbols are just fine as map keys

11:05 _ulises: and they look themselves up?

11:05 Chousuke: Yes. keywords are just used because they're a bit more efficient since they're singletons

11:05 _ulises: well, clearly, from the example above

11:05 Chousuke: and I guess the syntax is a bit nicer

11:05 _ulises: ah, hence the tendency to use them as map keys

11:05 Chousuke: ,(identical? :foo :foo)

11:05 clojurebot: true

11:06 Chousuke: ,(identical? 'foo 'foo) ; I guess this might return true too

11:06 clojurebot: false

11:06 _ulises: yes, awesome

11:06 pauldoo: I think it's a bit subtle using unevaluated symbols as keys (imho)

11:07 _ulises: I had no idea symbols could look themselves up in maps

11:07 ,('foo #{'foo 'bar})

11:07 clojurebot: foo

11:07 _ulises: yas

11:07 Chousuke: works for anything associative really

11:07 pauldoo: unentended symbols should really only be used for sexpressions, bits of code in otherwords

11:07 s/unentended/unevaluated/

11:08 otherwise, you might as well say we can use random expressions as keys..

11:08 Chousuke: well you can

11:08 _ulises: heh

11:08 Chousuke: there's nothing wrong with using eg. a vector as a map key

11:08 pauldoo: ,('(* 2 3) {'(* 2 3) 5})

11:08 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn>

11:08 pauldoo: ,({'(* 2 3) 5} '(* 2 3))

11:08 clojurebot: 5

11:09 Chousuke: that's perfectly valid

11:09 pauldoo: but I see what you mean there, about symbols acting as the fn

11:09 Chousuke: if you want to associate some data with a piece of code for example.

11:09 pauldoo: yep - it's valid I agree

11:09 Chousuke: also you can add metadata to symbols

11:09 pauldoo: but perhaps a little subtle/misleading to use a small bit of code (an unevaluated symbol) like this..

11:09 Chousuke: so if you need metadata on map keys for some reason you can use symbols

11:10 _ulises: interesting

11:10 TimMc: (defmacro foo [] (vec (map str (keys &env))))

11:10 (let [x 5] (let [y 9] (foo))) -> ["y" "x"]

11:11 Chousuke: it gives you the local env and the forms that they're bound to.

11:11 not values, mind you. that's not known until runtime :P

11:11 pauldoo: plus I think you'll get into trouble with namesaces if you use symbols as map keys..

11:12 TimMc: The vals of &env are clojure.lang.Compiler$LocalBinding

11:12 You can't pass them to the callsite.

11:12 Chousuke: I think the core.logic library uses &env to figure out free and bound variables.

11:12 so you don't need ?blah

11:12 it's pretty clever

11:13 TimMc: And entirely unhygienic. :-P

11:13 Chousuke: pauldoo: why?

11:13 TimMc: dunno, I don't see how it could cause problems

11:14 TimMc: I'm not saying it does. Hygiene is not mandatory.

11:14 (morally)

11:18 mbac: what's the idiom in clojure for iterating a sequence without returning a value? i want to work through side-effects

11:18 tsally: what's the prefered way to get readline support in the repl launched by clj ?

11:21 TimMc: mbac: dorun, I think.

11:21 mbac: I believe doall holds onto th head and returns it, whereas dorun returns nil.

11:22 tsally: If you're using lein, install rlwrap

11:22 pauldoo: Chousuke: I'd have thought the foo/a and bar/a would be different symbols, and won't be able to lookup the same entry in a map for instance

11:23 Chousuke: but keywords are the same, no matter which namespace you use them in/from

11:24 TimMc: pauldoo: 'foo/a and 'bar/a and 'a are all different symbols entirely.

11:25 pauldoo: TimMc: indeed, so if code inside foo adds an entry to a map keyed by 'a, will code inside bar be able to use ('a some-map) in order to find the entry?

11:26 TimMc: If they use 'a, yes. If they use `a, no.

11:26 pauldoo: TimMc: ahhh ok, slightly different quote

11:26 TimMc: because `a will *expand* to 'namespace/a.

11:26 pauldoo: Chousuke: in that case, I was incorrect about symbols and namespace confusion. :)

11:44 _ulises: ok, back to symbols ...

11:45 I just wrote some code which is ... well, let's not qualify it, but it definitely smells

11:45 http://pastebin.com/56zhyR98

11:45 so, having access to symbols, etc. this way can lead you to writing can-of-worms code, and surely the responsibility is on me as a programmer

11:45 clojurebot: Ack. Ack.

11:46 _ulises: however it doesn't stop smelling

11:46 TimMc: clojurebot: You're terrible.

11:46 clojurebot: Cool story bro.

11:46 _ulises: o_O

11:47 TimMc: ~so, having access to symbols, etc. this way can lead you to writing can-of-worms code, and surely the responsibility

11:47 clojurebot: so, having access to symbols, etc. this way can lead you to writing can-of-worms code, and surely the responsibility is on me as a programmer

11:47 TimMc: clojurebot: forget so, having access to symbols, etc. this way can lead you to writing can-of-worms code, and surely the responsibility |is| on me as a programmer

11:47 clojurebot: I forgot that so, having access to symbols, etc. this way can lead you to writing can-of-worms code, and surely the responsibility is on me as a programmer

11:47 TimMc: good

11:47 _ulises: good bot

11:48 TimMc: marginally o\__/o

11:57 Ugh, how can `git stash save && git stash pop` possibly cause a merge conflict?

11:58 save --keep-index, technically

12:11 pauldoo: when I try to use goog.Timer in clojurescript, it works fine in normal compile mode. but the advanced compile errors with: ERROR - required "goog" namespace never provided

12:27 mbac: TimMc: what i meant is, i want something like foreach

12:28 (foo (fn [c] (printf "%c\n")) "abc")

12:29 i want a\nb\n\c\ sent to stdout, and the entire expression to evaluate to nil

12:31 oh, i guess i can do (doseq [c (seq "abc")] (printf "%c\n" c))

12:31 is there something more idiomatic?

12:32 Chousuke: you don't need the seq call

12:32 _ulises: mbac: maybe (dorun (map println "abc"))

12:32 mbac: if all collections implement the seq protocol what do you use seq for?

12:32 Chousuke: mbac: they don't.

12:33 mbac: but doseq internally calls seq

12:33 _ulises: unless you want you want formatting with printf, then you need (partial printf "...")

12:33 Chousuke: so you don't have to

12:33 mbac: oh, that's kind of magicky

12:33 Chousuke: nah, it's just idiomatic

12:34 if you write a function that expects a seq, it's your job to call seq on it

12:35 mbac: wait, i'm confused. are strings collections AND sequences?

12:36 Chousuke: strings are java Strings

12:36 mbac: (first "foo") is equivalent to (first (seq "foo"))

12:36 Chousuke: but seq works on them

12:36 currently it's special cased in seq

12:37 tsally: is (key map) just a reader macro over (get map key) ?

12:37 Chousuke: no

12:37 keywords implement the function interface

12:37 tsally: what bout (map key) ?

12:37 Chousuke: so you can treat them as functions. what they do is look themselves up in an associative thing

12:37 maps are functions

12:38 ,(map {:a 1 :b 2} [:a :b :c])

12:38 clojurebot: (1 2 nil)

12:38 Chousuke: sets are functions too

12:39 tsally: interesting.... is there a way to make the maps return a different value when key is not found?

12:39 I see how to do that with get

12:39 Chousuke: (a-map foo :val-not-found)

12:40 tsally: awesome

12:40 nickmbailey: ,({:a 1} :b 2)

12:40 clojurebot: 2

12:41 Chousuke: maps (and sets, and vectors) being functions is one thing I really like about Clojure

12:41 tsally: and when you say keywords implement the function interface?

12:41 Chousuke: just like maps

12:41 they're functions too

12:41 tsally: and they expect an associative thing as an arg

12:41 Chousuke: yeah

12:42 tsally: really interesting

12:42 Chousuke: this is one thing where Clojure is ahead of all other lisps

12:42 tsally: one of a few things ^^

12:45 can you use (key map) (map key) interchangably or is there a reason to prefer one over the other

12:46 bloop: (hours ago there was a discussion on writing Clojure ponit-free) if you think it's a fun exercise, try Unlambda

12:47 Chousuke: tsally: sometimes map might be nil

12:47 in which case using key first is more robust

12:47 or it might not be a clojure map, I guess

12:48 depends on the scenario

12:48 in general I think (:key map) is more common

12:49 pauldoo: bloop: that was me, I've stopped that little exercise now. it was preventing me from getting work done

12:53 bloop: pauldoo: well, there's always something to be said for experimentation and mind-exercises, I think. .

12:54 pauldoo: bloop: indeed - but it was distracting me from learning the real thing I wanted to learn

13:06 tsally: I'm writing a toy function that counts the length of a seq. a little baffled by this error message... https://pastee.org/ycrc8

13:07 foodoo: tsally: Your code gets evaluated to something like this (1 2 3) and clojure tries to cast 1 to a function which doesn't work

13:07 jkkramer: tsally: "X cannot be cast to clojure.lang.IFn" generally means you're trying to call something that's not a function

13:08 tsally: check your parentheses nesting

13:09 tsally: foodoo: is that happening in the loop binding ?

13:09 foodoo: tsally: dunno. I'm too lazy to find out ;)

13:09 tsally: hehe fair enough ^^

13:10 i understand what the error message means, I just dont see where i have a number in the first position of a sexp

13:10 jkkramer: tsally: your function looks correct, you just have too many parens

13:10 tsally: oh duh

13:10 jkkramer: it returns the right result (a number) and then tries to call that result

13:10 tsally: it's attempting to call the result as a funciton

13:10 jkkramer: nice catch thanks ^^

13:11 jkkramer: tsally: two parens in a row is a usually a bug

13:13 tsally: also, minor thing: (nil? (seq s)) -> (empty? s)

13:13 tsally: jkkramer: ah, nice

14:29 TimMc: jkkramer: Two open parens.

16:49 seancorfield: what's the current "correct" way to build clojure from source? there appears to be both an ant build.xml and a maven pom.xml in the repo

16:50 ant clean jar ;; creates the clojure..jar as expected

16:50 mvn install ;; runs tests and builds / installs clojure..jar in the m2 repo

16:50 hiredman: either

16:52 seancorfield: i'm updating mark volkman's clojure article... (he put it on github for me to fork and update)... once i've done a basic pass and he's incorporated that pull request, i'll publicize it for more folks in the community to pile in and help update it

16:53 hiredman: I tend to run 'mvn package' if I am checking out a patch

16:53 seancorfield: 'k... i'm not familiar enough with maven to know what that does... i know clean, compile, test, install :)

16:54 hiredman: me neither, I just picked the package command up somewhere and it works with the clojure build

17:03 mbac: how can i printf to stderr instead of stdout?

17:09 duck1123: (binding [*out* *err*] ...

17:11 but you might want to look into a logging library for more control

18:12 triyo: Is there a bug in `update-in` function in clojure 1.3? I try: (update-in (assoc {:id 2} :name "John" :age 31) [:id :age] inc) and get a NPE.

18:13 seancorfield: ,(assoc {:id 2} :name "John" :age 31)

18:13 clojurebot: {:age 31, :name "John", :id 2}

18:13 seancorfield: not a nested map

18:14 so you're trying to do (update-in 2 [:age] inc)

18:14 ,(update-in 2 [:age] inc)

18:14 clojurebot: #<NullPointerException java.lang.NullPointerException>

18:15 triyo: oh I see, I forgot that its for nested structures.

18:15 seancorfield: did you mean:

18:15 ,(update-in (assoc {:id 2} :name "John" :age 31) [:age] inc)

18:15 clojurebot: {:age 32, :name "John", :id 2}

18:15 triyo: yip

18:15 apply fn to all values of keys are `select`

18:15 *are=I

18:16 so I could select all unrounded decimal values in a map; select the keys that have decimal values and apply my round-places fucntion..

18:16 TeXnomancy: Raynes: reading about tentacles, have you considered the idea of a generalized rest-pagination lazy-seq?

18:17 Raynes: TeXnomancy: No, but that's a fantastic idea.

18:17 TeXnomancy: the only hitch is that you would need a lazy seq that could perform no-ops when it was being forced from a drop call

18:18 Raynes: Bleh.

18:18 TeXnomancy: certainly not insurmountable, but worth pondering

18:19 Raynes: TeXnomancy: I'll make an issue for that. Great idea, so thanks.

18:20 triyo: seancorfield: so to clear up a bit I what one function to update all values for keys I `select` and not one at a time

18:21 that `inc` could run for :id and :age in one pass/

18:21 TeXnomancy: Raynes: I've never been one to pass up the opportunity to convince someone else to write code for me.

18:21 Raynes: Heh

18:24 I liek it.

18:25 TeXnomancy: possibly worth suggesting for clojure.core/drop, but definitely need to percolate the idea a bit more first

18:26 Raynes: TeXnomancy: What is mouse-2 in Emacs?

18:29 seancorfield: triyo: (reduce #(update-in %1 [%2] your-fn) your-map [:id :age])

18:30 Raynes: isn't that "right-click"?

18:30 TeXnomancy: it reads left-to-right

18:30 so left is 1, middle is 2, and right is 3

18:31 Raynes: seancorfield: I thought so too, but I think it might be scroll button.

18:31 Right. Damn. I need to figure out how to simulate that on a mac (with a trackpad).

18:31 TeXnomancy: or bind it to a key

18:31 Raynes: Or that, yes.

18:32 seancorfield: hmm, what's "middle button" on a mac???

18:32 lazybot: seancorfield: Yes, 100% for sure.

18:32 Raynes: seancorfield: There isn't one, afaik.

18:34 TeXnomancy: I can bind it to s-mouse-1!

18:34 Slick.

18:36 seancorfield: s-... on a Mac is the command (splat) key, yes?

18:36 Raynes: Yes.

18:37 s-mouse-1 is unbound and easily accessible.

18:39 seancorfield: i saw someone talking about syntax highlighting in the slime repl - what was the elisp magic for that?

18:39 (if it's even possible)

19:12 jsnikeris: is there a way to prime your REPL by always running a startup script?

19:19 Raynes: TeXnomancy, seancorfield: Oh man. It took me an hour to figure out how to do that. I ended up rebinding s-mouse-1 to flyspell-correct-word. I was trying to make s-mouse-1 exactly the same as mouse-2, but I gave up on that.

19:25 seancorfield: jsnikeris: I added code to ~/.lein/user.clj for startup stuff...

19:25 just so it auto-uses clojure.repl and clojure.java.javadoc if the project is clojure 1.3.0 or later

19:26 (for slime/swank repl sessions as i recall)

19:33 duck1123: I prefer to have my run function launch a swank server in addition to it's other services. That way my swank session always has all the initialization it needs, and all of my namespaces have been loaded

19:33 but that's only if you're running a server of some sort

19:39 TeXnomancy: jsnikeris: set :repl-init to a namespace you want loaded

19:42 but yeah, duck1123's way could be more convenient

20:50 yellow: if I have a record (defrecord A [w x y z]) what is the best way to get a submap {:w _w :x _x}?

20:50 (from an instance of that record)

21:07 gfredericks: select-keys should work

23:24 mbac: if you (line-seq (io/reader filename)) have you leaked the file descriptor?

23:32 TeXnomancy: mbac: yeah, you need with-open

23:48 mbac: (with-open [r (io/reader filename)] (do-thing (line-seq r))) ?

Logging service provided by n01se.net