#clojure logs

2011-12-03

00:08seancorfieldquick 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...
00:08seancorfieldwhat's the "usual" way to connect emacs to a swank server?
00:09georgekslime-connect
00:10seancorfieldso obvious ... thank you!
00:10georgekit's funny I can't get jack-in to work at the moment :)
00:10georgektechnomancy, 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
00:11georgekoops just noticed that file path, weird
00:11seancorfieldwow, cdt is freakin' cool!!!!
00:30seancorfieldhow many different slime connection buffers can you have open in emacs?
00:32mtkoanis it possible to get syntax highlighting in the slime repl in emacs?
00:32seancorfieldand is clojure-jack-in just shorthand for run lein swank and then M-x slime-connect ? (but focused on the project in hand)
00:34mtkoani tried adding the line (add-hook 'slime-repl-mode-hook 'clojure-mode-font-lock-setup)
00:35mtkoanit 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
00:35mtkoanp
00:36georgekmtkoan: yes
00:36georgekare you connecting locally or remotely?
00:36mtkoanlocally
00:37georgekyou need to require clojiure-mode before adding the hook
00:37georgekif you're not jacking in but using slime-connect
00:38georgekseancorfield, if you're using different ports I imagine as many as you want
00:39mtkoanok
00:40mtkoanno error with slime-connect, but still not syntax highlighting either
00:40georgekstrange, just looked in my .emacs and that's what I have
00:41mtkoanhm
00:43mtkoanindividual words get highlighted?
00:43georgekI think I know what you mean, yes
00:45mtkoanhighlighting works editing clj files, but not the repl.. oh well
00:46georgekcan I see your .emacs?
00:46seancorfieldgeorgek: thanx. suspected as much but wanted to confirm "bad things" wouldn't happen :)
00:46seancorfieldi'm off for the night...
00:46georgekjust tried it here and it works fine
00:46georgekseancorfield, well I'm no expert on that :)
00:50mtkoani have no .emacs, its all in .emacs.d/init.el .. is that wrong?
00:50mtkoanI am new user to emacs as well ;)
00:50georgekno, that's it, sorry I was just using a different term
00:51tensorpudding.emacs.d/init.el is the same
00:51tensorpuddingi use it too
00:52georgekI 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
00:52mtkoangeorgek: http://pastebin.com/71YwSWV7
00:53georgekthere's a typo in clojure-mode
00:54mtkoanahh i rest removed and added it back in
00:54mtkoan*just
00:54mtkoanbut it wasn't working with it spelled right too I promise ;)
00:54georgekok, I believe you :)
00:54hiredmanis it a typo? or is in technomancy letting windows users fend for themselves?
00:55georgekdon't know hiredman, there's a somewhat related thread on the mailing list but I don't quite get it
00:55georgekjack-in used to work fine
00:55georgeklein swank from the command line works fine
00:55tensorpuddingjack-in has stopped working for me too
00:56tensorpuddingbut with a different error
00:56georgekwhat error?
00:56tensorpuddingcan't remember the wording right now
00:56georgekI only updated because earlier it wasn't working for a different reason
00:56hiredmanmost 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?"
00:56georgeksomething like that :), but that user is on cygwin
00:56georgekbut in any case, it used to work on Windows great
00:57tensorpuddingerror in process filter: Symbol's function definition is void: slime-face-inheritance-possible-p
00:57tensorpuddingthat was the error
00:57hiredmantechnomancy is not one to go out of his way for people that don't run on linux, don't use eshell or bash
00:58georgekthat's fine, the alternative is to have no tool after all
00:58hiredmantensorpudding: what version of swank clojure?
00:59tensorpuddingi'd have to check
00:59tensorpuddingit's the latest on marmalade
00:59hiredmanum
00:59tensorpuddingwhen i checked a few days ago
00:59hiredmanswank-clojure is not in marmalade
00:59hiredmanclojure-mode is
01:00hiredmanswank-clojure is a jar
01:00tensorpuddingoh wait, right
01:00tensorpuddingwas thinking clojure-mode
01:00hiredmanyou may want to try a SNAPSHOT of swank-clojure
01:00hiredmanhttps://github.com/technomancy/swank-clojure/commit/815a14db85c6512659752dde8f57d1f6145b3ddc
01:01tensorpuddingthis was the snapshot version
01:01tensorpuddingi haven't fetched a new one recently
01:08mtkoaneureka
01:09mtkoanif i mouse2 on REPL, de-select font lock, and re-select I get syntax highlighting xD
01:11tensorpuddingi can live with jack-in not working
01:33georgekI 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
02:45georgekOK, found a different fix that worked here https://github.com/technomancy/swank-clojure/issues/72.
03:00bloopI 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?
03:34tscheiblgood morning clojurians
06:06AnswerGuyIs there a Clojure REPL with enhancements analagous to those of iPython over the stock Python >>> interpreter/mode?
06:07AnswerGuyOr is Clojure + rlwrap or + Jline/Jline2 (analagous to Python >>> import readline, rlcompleter) the best option?
06:22ejacksonAnswerGuy: as far as base repl, yeah. What you want though is to have the repl within a larger environment CCW/Emacs
06:24AnswerGuyCCW? There's an Emacs (or XEmacs?) module/wrapper around (interface to) the Clojure REPL?
06:24ejacksonAnswerGuy: CCW = Counterclockwise, an Eclipse mode
06:25ejacksonAnswerGuy: check out http://dev.clojure.org/display/doc/Clojure+Tools
06:29zakwilsonMost people using Emacs use Slime and swank-clojure.
08:32licenserpauldoo: with point-free you mean not calling object functions?
08:33pauldooI mean no variable names (or function argument names)
08:33pauldoofunctions are made by composition
08:42licenseris that a good thing?
08:42licenserI mean I understand the elegance behind it but is it good for maintainabiltiy/readability?
08:43pauldooso far, it appears to be a terrible idea…. though perhaps a fun exercise in higher order functions
08:43pauldoomaybe the results can be reused more flexibly, since the shape of the function/args is even looser than normal
08:44pauldoolicenser: 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"
08:44licenserpauldoo: I love that there are people like you
08:45pauldoothanks :)
08:45licenserprogramming 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'
08:45tscheibluhm.. how do I check for a Java array? (sequential? ...) does not work
08:49tscheiblanyone? please...
08:49tscheiblI'm stuck
08:51pauldoojust thinking...
08:53pauldooyou can check for the class.. (class (int-array 3))
08:54pauldoogives [I for an int array..
08:54pauldoo[Ljava.lang.Object; for an object array..
08:55tscheiblyeah.. but I need this generically... don't wan't to check for every possible array type
08:55Bronsa,(-> (object-array 1) .getClass .isArray)
08:55tscheiblwant
08:55clojurebottrue
08:55tscheiblahh
08:56tscheibl,(.isArray (class (int-array [3 4 5])))
08:56clojurebottrue
08:56tscheiblthanks
08:56tscheiblvery much...
08:56Bronsanp
08:57tscheiblI was stuck for almost 30 minutes...
08:57tscheiblbefore I asked...
08:57Bronsatscheibl: do you need to check if it is an array or if it is seqable?
08:57tscheiblnah .. i it is a Java Array explicitly
08:57Bronsabecause in core.incubator you have "seqable?"
08:57Bronsaok
08:58tscheiblbecause jdbc returns java arrays from sql arrays and I need to convert them
08:58tscheiblI mean... seqable probably would also work and be more clojurish :)
08:59tscheibljust need to check if a String is also seqable?
09:00Bronsahttps://github.com/clojure/core.incubator/blob/master/src/main/clojure/clojure/core/incubator.clj#L85
09:00Bronsait does
09:00Bronsa*is
09:02tscheibli see.. so I'll go for .isArray, thx again :)
09:35pauldoowhat's the syntax for using goog.Timer in clojurescript? I've got (ns hello (:use [goog :only [Timer]]))
09:35pauldoothis works in normal compile, but not optimized compile
10:20TimMc$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:20lazybotMessage saved.
10:24TimMc&((fn [& {a :a}] a) :a 2 :b 4) ; oh, huh
10:24lazybot⇒ 2
10:25TimMcApparently you can destructure a vector as a map.
10:25TimMc&((fn [& {a :a}] a) :a 2 :odd...) ; this would be a cryptic error message
10:25lazybotjava.lang.IllegalArgumentException: No value supplied for key: :odd...
10:27TimMc$findfn + {1 2 3 4} 10
10:27lazybot[]
10:47_ulisescan anybody point me to some reading material that explains what is a symbol?
10:49chewbranca_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_ulisesawesome, thanks!
10:50_ulisesI 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_ulisesSo I'd definitely welcome some enlightenment in this area.
10:54TimMc_ulises: In other Lisps they often serve a dual purpose.
10:55_uliseshum, ok?
10:56TimMcand in Clojure, keywords have taken over part of that.
10:56Chousukeand vars
10:56TimMcmmm
10:56Chousukein CL for example the thing that holds a value is the actual symbol (as far as I know, anyway)
10:56Chousukein Clojure, the symbol is just a name for the var that holds the value
10:56_ulisesso in clojure a symbol points to a var which holds/points to a value?
10:57TimMcor is just a local binding.
10:57Chousukethe symbol names a var, it doesn't point to it
10:57_ulisesright
10:57_ulisesso it is a label
10:57TimMcSymbols name things which can get you values.
10:57_ulisesnot much more mystery to it?
10:57Chousukethere is no pointer or reference from a symbol to anything
10:57Chousukeyeah
10:57_uliseswhy was I then so confused? perhaps I read somewhere else about other lisps
10:57Chousukemight be
10:58_ulisesok, cool
10:58TimMcKeywords are *just* names, which multiple things might know about. They're used in informal APIs or data formats.
10:58_ulisesso, once you have a symbol, you get the thing it labels by evaling it?
10:58Chousukepretty much yeah
10:59Chousukethat only works for global things though; eval doesn't have access to local scope
10:59_ulisesoh?
10:59TimMc_ulises: Clojure doesn't have "reified environments" -- you can't inspect a let's bindings.
11:00TimMcWell... maybe. There's some macro hack...
11:00Chousukemacros have the &env parameter but it's not quite the same
11:00TimMcYeah, what *does* that give you?
11:00Chousukejust the expansion environment I think
11:01_ulisesok, now I'm definitely out of my depth :)
11:01Chousukeheh :P
11:02_ulisesok, so, symbols are labels and nothing else, keywords are like labels but have extra functionality such as value lookup in maps
11:02_ulisesright or wrong?
11:02TimMcKeywords don't name values.
11:03pauldookeywords evaluate to themselves, symbols evaluate to a value depending on the environment
11:03_ulisesah! true.
11:03_uliseshello Mr.Paul.
11:03pauldoo'lo o/
11:04_ulises\o.
11:04Chousukekeywords are useful as map keys because they evaluate to themselves
11:04_ulisesChousuke: oh? explain please?
11:04Chousuke,('foo {'foo :bal}) but this works too IIRC :P
11:04clojurebot:bal
11:04_ulisesbut 'foo is a symbol?
11:04Chousukeyes
11:05Chousukesymbols are just fine as map keys
11:05_ulisesand they look themselves up?
11:05ChousukeYes. keywords are just used because they're a bit more efficient since they're singletons
11:05_uliseswell, clearly, from the example above
11:05Chousukeand I guess the syntax is a bit nicer
11:05_ulisesah, hence the tendency to use them as map keys
11:05Chousuke,(identical? :foo :foo)
11:05clojurebottrue
11:06Chousuke,(identical? 'foo 'foo) ; I guess this might return true too
11:06clojurebotfalse
11:06_ulisesyes, awesome
11:06pauldooI think it's a bit subtle using unevaluated symbols as keys (imho)
11:07_ulisesI had no idea symbols could look themselves up in maps
11:07_ulises,('foo #{'foo 'bar})
11:07clojurebotfoo
11:07_ulisesyas
11:07Chousukeworks for anything associative really
11:07pauldoounentended symbols should really only be used for sexpressions, bits of code in otherwords
11:07pauldoos/unentended/unevaluated/
11:08pauldoootherwise, you might as well say we can use random expressions as keys..
11:08Chousukewell you can
11:08_ulisesheh
11:08Chousukethere's nothing wrong with using eg. a vector as a map key
11:08pauldoo,('(* 2 3) {'(* 2 3) 5})
11:08clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn>
11:08pauldoo,({'(* 2 3) 5} '(* 2 3))
11:08clojurebot5
11:09Chousukethat's perfectly valid
11:09pauldoobut I see what you mean there, about symbols acting as the fn
11:09Chousukeif you want to associate some data with a piece of code for example.
11:09pauldooyep - it's valid I agree
11:09Chousukealso you can add metadata to symbols
11:09pauldoobut perhaps a little subtle/misleading to use a small bit of code (an unevaluated symbol) like this..
11:09Chousukeso if you need metadata on map keys for some reason you can use symbols
11:10_ulisesinteresting
11:10TimMc(defmacro foo [] (vec (map str (keys &env))))
11:10TimMc(let [x 5] (let [y 9] (foo))) -> ["y" "x"]
11:11Chousukeit gives you the local env and the forms that they're bound to.
11:11Chousukenot values, mind you. that's not known until runtime :P
11:11pauldooplus I think you'll get into trouble with namesaces if you use symbols as map keys..
11:12TimMcThe vals of &env are clojure.lang.Compiler$LocalBinding
11:12TimMcYou can't pass them to the callsite.
11:12ChousukeI think the core.logic library uses &env to figure out free and bound variables.
11:12Chousukeso you don't need ?blah
11:12Chousukeit's pretty clever
11:13TimMcAnd entirely unhygienic. :-P
11:13Chousukepauldoo: why?
11:13ChousukeTimMc: dunno, I don't see how it could cause problems
11:14TimMcI'm not saying it does. Hygiene is not mandatory.
11:14TimMc(morally)
11:18mbacwhat's the idiom in clojure for iterating a sequence without returning a value? i want to work through side-effects
11:18tsallywhat's the prefered way to get readline support in the repl launched by clj ?
11:21TimMcmbac: dorun, I think.
11:21TimMcmbac: I believe doall holds onto th head and returns it, whereas dorun returns nil.
11:22TimMctsally: If you're using lein, install rlwrap
11:22pauldooChousuke: 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:23pauldooChousuke: but keywords are the same, no matter which namespace you use them in/from
11:24TimMcpauldoo: 'foo/a and 'bar/a and 'a are all different symbols entirely.
11:25pauldooTimMc: 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:26TimMcIf they use 'a, yes. If they use `a, no.
11:26pauldooTimMc: ahhh ok, slightly different quote
11:26TimMcbecause `a will *expand* to 'namespace/a.
11:26pauldooChousuke: in that case, I was incorrect about symbols and namespace confusion. :)
11:44_ulisesok, back to symbols ...
11:45_ulisesI just wrote some code which is ... well, let's not qualify it, but it definitely smells
11:45_uliseshttp://pastebin.com/56zhyR98
11:45_ulisesso, 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:45clojurebotAck. Ack.
11:46_uliseshowever it doesn't stop smelling
11:46TimMcclojurebot: You're terrible.
11:46clojurebotCool story bro.
11:46_uliseso_O
11:47TimMc~so, having access to symbols, etc. this way can lead you to writing can-of-worms code, and surely the responsibility
11:47clojurebotso, 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:47TimMcclojurebot: 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:47clojurebotI 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:47TimMcgood
11:47_ulisesgood bot
11:48TimMcmarginally o\__/o
11:57TimMcUgh, how can `git stash save && git stash pop` possibly cause a merge conflict?
11:58TimMcsave --keep-index, technically
12:11pauldoowhen 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:27mbacTimMc: what i meant is, i want something like foreach
12:28mbac(foo (fn [c] (printf "%c\n")) "abc")
12:29mbaci want a\nb\n\c\ sent to stdout, and the entire expression to evaluate to nil
12:31mbacoh, i guess i can do (doseq [c (seq "abc")] (printf "%c\n" c))
12:31mbacis there something more idiomatic?
12:32Chousukeyou don't need the seq call
12:32_ulisesmbac: maybe (dorun (map println "abc"))
12:32mbacif all collections implement the seq protocol what do you use seq for?
12:32Chousukembac: they don't.
12:33Chousukembac: but doseq internally calls seq
12:33_ulisesunless you want you want formatting with printf, then you need (partial printf "...")
12:33Chousukeso you don't have to
12:33mbacoh, that's kind of magicky
12:33Chousukenah, it's just idiomatic
12:34Chousukeif you write a function that expects a seq, it's your job to call seq on it
12:35mbacwait, i'm confused. are strings collections AND sequences?
12:36Chousukestrings are java Strings
12:36mbac(first "foo") is equivalent to (first (seq "foo"))
12:36Chousukebut seq works on them
12:36Chousukecurrently it's special cased in seq
12:37tsallyis (key map) just a reader macro over (get map key) ?
12:37Chousukeno
12:37Chousukekeywords implement the function interface
12:37tsallywhat bout (map key) ?
12:37Chousukeso you can treat them as functions. what they do is look themselves up in an associative thing
12:37Chousukemaps are functions
12:38Chousuke,(map {:a 1 :b 2} [:a :b :c])
12:38clojurebot(1 2 nil)
12:38Chousukesets are functions too
12:39tsallyinteresting.... is there a way to make the maps return a different value when key is not found?
12:39tsallyI see how to do that with get
12:39Chousuke(a-map foo :val-not-found)
12:40tsallyawesome
12:40nickmbailey,({:a 1} :b 2)
12:40clojurebot2
12:41Chousukemaps (and sets, and vectors) being functions is one thing I really like about Clojure
12:41tsallyand when you say keywords implement the function interface?
12:41Chousukejust like maps
12:41Chousukethey're functions too
12:41tsallyand they expect an associative thing as an arg
12:41Chousukeyeah
12:42tsallyreally interesting
12:42Chousukethis is one thing where Clojure is ahead of all other lisps
12:42tsallyone of a few things ^^
12:45tsallycan you use (key map) (map key) interchangably or is there a reason to prefer one over the other
12:46bloop(hours ago there was a discussion on writing Clojure ponit-free) if you think it's a fun exercise, try Unlambda
12:47Chousuketsally: sometimes map might be nil
12:47Chousukein which case using key first is more robust
12:47Chousukeor it might not be a clojure map, I guess
12:48Chousukedepends on the scenario
12:48Chousukein general I think (:key map) is more common
12:49pauldoobloop: that was me, I've stopped that little exercise now. it was preventing me from getting work done
12:53blooppauldoo: well, there's always something to be said for experimentation and mind-exercises, I think. .
12:54pauldoobloop: indeed - but it was distracting me from learning the real thing I wanted to learn
13:06tsallyI'm writing a toy function that counts the length of a seq. a little baffled by this error message... https://pastee.org/ycrc8
13:07foodootsally: 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:07jkkramertsally: "X cannot be cast to clojure.lang.IFn" generally means you're trying to call something that's not a function
13:08jkkramertsally: check your parentheses nesting
13:09tsallyfoodoo: is that happening in the loop binding ?
13:09foodootsally: dunno. I'm too lazy to find out ;)
13:09tsallyhehe fair enough ^^
13:10tsallyi understand what the error message means, I just dont see where i have a number in the first position of a sexp
13:10jkkramertsally: your function looks correct, you just have too many parens
13:10tsallyoh duh
13:10jkkramerit returns the right result (a number) and then tries to call that result
13:10tsallyit's attempting to call the result as a funciton
13:10tsallyjkkramer: nice catch thanks ^^
13:11jkkramertsally: two parens in a row is a usually a bug
13:13jkkramertsally: also, minor thing: (nil? (seq s)) -> (empty? s)
13:13tsallyjkkramer: ah, nice
14:29TimMcjkkramer: Two open parens.
16:49seancorfieldwhat'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:50seancorfieldant clean jar ;; creates the clojure..jar as expected
16:50seancorfieldmvn install ;; runs tests and builds / installs clojure..jar in the m2 repo
16:50hiredmaneither
16:52seancorfieldi'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:53hiredmanI tend to run 'mvn package' if I am checking out a patch
16:53seancorfield'k... i'm not familiar enough with maven to know what that does... i know clean, compile, test, install :)
16:54hiredmanme neither, I just picked the package command up somewhere and it works with the clojure build
17:03mbachow can i printf to stderr instead of stdout?
17:09duck1123(binding [*out* *err*] ...
17:11duck1123but you might want to look into a logging library for more control
18:12triyoIs 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:13seancorfield,(assoc {:id 2} :name "John" :age 31)
18:13clojurebot{:age 31, :name "John", :id 2}
18:13seancorfieldnot a nested map
18:14seancorfieldso you're trying to do (update-in 2 [:age] inc)
18:14seancorfield,(update-in 2 [:age] inc)
18:14clojurebot#<NullPointerException java.lang.NullPointerException>
18:15triyooh I see, I forgot that its for nested structures.
18:15seancorfielddid you mean:
18:15seancorfield,(update-in (assoc {:id 2} :name "John" :age 31) [:age] inc)
18:15clojurebot{:age 32, :name "John", :id 2}
18:15triyoyip
18:15triyoapply fn to all values of keys are `select`
18:15triyo*are=I
18:16triyoso I could select all unrounded decimal values in a map; select the keys that have decimal values and apply my round-places fucntion..
18:16TeXnomancyRaynes: reading about tentacles, have you considered the idea of a generalized rest-pagination lazy-seq?
18:17RaynesTeXnomancy: No, but that's a fantastic idea.
18:17TeXnomancythe 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:18RaynesBleh.
18:18TeXnomancycertainly not insurmountable, but worth pondering
18:19RaynesTeXnomancy: I'll make an issue for that. Great idea, so thanks.
18:20triyoseancorfield: 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:21triyothat `inc` could run for :id and :age in one pass/
18:21TeXnomancyRaynes: I've never been one to pass up the opportunity to convince someone else to write code for me.
18:21RaynesHeh
18:24RaynesI liek it.
18:25TeXnomancypossibly worth suggesting for clojure.core/drop, but definitely need to percolate the idea a bit more first
18:26RaynesTeXnomancy: What is mouse-2 in Emacs?
18:29seancorfieldtriyo: (reduce #(update-in %1 [%2] your-fn) your-map [:id :age])
18:30seancorfieldRaynes: isn't that "right-click"?
18:30TeXnomancyit reads left-to-right
18:30TeXnomancyso left is 1, middle is 2, and right is 3
18:31Raynesseancorfield: I thought so too, but I think it might be scroll button.
18:31RaynesRight. Damn. I need to figure out how to simulate that on a mac (with a trackpad).
18:31TeXnomancyor bind it to a key
18:31RaynesOr that, yes.
18:32seancorfieldhmm, what's "middle button" on a mac???
18:32lazybotseancorfield: Yes, 100% for sure.
18:32Raynesseancorfield: There isn't one, afaik.
18:34RaynesTeXnomancy: I can bind it to s-mouse-1!
18:34RaynesSlick.
18:36seancorfields-... on a Mac is the command (splat) key, yes?
18:36RaynesYes.
18:37Rayness-mouse-1 is unbound and easily accessible.
18:39seancorfieldi saw someone talking about syntax highlighting in the slime repl - what was the elisp magic for that?
18:39seancorfield(if it's even possible)
19:12jsnikerisis there a way to prime your REPL by always running a startup script?
19:19RaynesTeXnomancy, 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:25seancorfieldjsnikeris: I added code to ~/.lein/user.clj for startup stuff...
19:25seancorfieldjust so it auto-uses clojure.repl and clojure.java.javadoc if the project is clojure 1.3.0 or later
19:26seancorfield(for slime/swank repl sessions as i recall)
19:33duck1123I 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:33duck1123but that's only if you're running a server of some sort
19:39TeXnomancyjsnikeris: set :repl-init to a namespace you want loaded
19:42TeXnomancybut yeah, duck1123's way could be more convenient
20:50yellowif I have a record (defrecord A [w x y z]) what is the best way to get a submap {:w _w :x _x}?
20:50yellow(from an instance of that record)
21:07gfredericksselect-keys should work
23:24mbacif you (line-seq (io/reader filename)) have you leaked the file descriptor?
23:32TeXnomancymbac: yeah, you need with-open
23:48mbac(with-open [r (io/reader filename)] (do-thing (line-seq r))) ?