#clojure log - Jan 12 2012

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

0:00 jyaan: maybe a quote missing or something, idk

0:00 bbhoss: that's the whole file

0:00 jyaan: just teh add-to-list??

0:00 lazybot: jyaan: What are you, crazy? Of course not!

0:03 jyaan: on github you just posted the error

0:04 bbhoss: jyaan: on github format: https://gist.github.com/6c67774920f6c1367d58

0:10 any idea jyaan?

0:18 jyaan: ok let's see

0:18 sorry i'm trying to help my brother install his wifi too haha

0:18 bbhoss: haha np jyaan

0:19 jyaan: i don't understand it

0:20 well basically what Emacs is saying is that package-archives is unbound

0:20 but you're using emacs 24 which has package.el included right

0:20 tmciver: bbhoss: do you have the package initialization stuff before the 'add-to-list' line?

0:20 jyaan: my only guess is to add (require 'package)

0:20 bbhoss: yeah this is emacs 24, package stuff should be included already I think

0:20 jyaan: but i thought it was already part of it

0:21 yea exactly

0:21 bbhoss: so no tmciver, I don't have anything other than that in there

0:21 jyaan: are you sure you have emacs 24??

0:21 lazybot: jyaan: What are you, crazy? Of course not!

0:21 jyaan: ugh i hate that bot, always does that to me

0:21 bbhoss: that fixed it

0:21 tmciver: bbhoss: the begining of my .emacs looks like this: https://gist.github.com/1598928

0:21 bbhoss: that's before the marmalade stuff

0:21 bbhoss: This is GNU Emacs 24.0.91.1 (x86_64-apple-darwin, NS apple-appkit-1038.36) of 2011-11-20 on bob.porkrind.org

0:22 jyaan: that's probably what you need

0:22 i don't use package.el so i wouldn't know

0:22 tmciver: that would explain the void package-archives var.

0:23 jyaan: makes sens, package.el probably depends on something else in emacs so they amke you call an init function explicitly to avoid problems

0:57 scottj: clojurescript libs and messages on ml have really picked up in the last month

0:59 y3di: whats ml?

1:00 scottj: mailing list

1:00 jyaan: ??

1:00 lazybot: jyaan: What are you, crazy? Of course not!

1:00 jyaan: yea thought it would do that

1:00 night

1:45 tadr: i was expecting 10, 11 tops, people in here

1:45 was i wrong

1:46 bartj: tadr, the Clojure IRC is very active

1:46 Raynes: Heh.

1:46 I'm not sure why you'd assume such low popularity.

1:46 tadr: i must be clojist

1:46 so, i'm trying to fill in the gaping holes of my java/jvm knowledge as related to clojure

1:46 bartj: Raynes, Try hanging out at machine-learning, nlp etc

1:47 Raynes: But this is neither of those things.

1:47 :p

1:47 tadr: any one have a book title for me?

1:47 Raynes: Practical Clojure is one. The Joy of Clojure is a more in-depth and less beginnerish book.

1:48 Clojure Programming is coming out soon.

1:48 I'm writing a book, but that one is going to take a while.

1:48 tadr: so those books cover some java api as well as clojure?

1:50 Raynes: Well, they tend to focus on what matters in Clojure. There are, of course, some fundamental Java APIs mixed in there, but it wont really teach you Java/Java APIs.

1:52 tadr: i think i'm going with the manning MEAP on well-grounded java, and then... dunno

2:26 technomancy_: brehaut: did I see that you are dispensing Emacs advice now? what happened?

2:27 Raynes: technomancy_: You!

2:28 technomancy_: Raynes: impossible; I only tell people not to use emacs.

2:28 Raynes: technomancy_: Did you ever get to try out the refheap elisp? I might force it down your throat.

2:29 technomancy_: I've been partying basically all day; give me a break

2:29 Raynes: Hah, for three days?

2:29 I think it was like three days ago that you said you were going to look at it. :p

2:29 bbhoss: I am back, I finally got emacs rigged up with Clojurescript One, but it's throwing an odd error on something that works fine when running from a "real" shell: https://gist.github.com/d74ea1e5473041abb6f4

2:30 technomancy_: well yesterday was traveling and adding Leiningen to the nix package manager

2:30 Raynes: technomancy_: Dude! I'm totally installing nix like right now.

2:30 :D

2:30 technomancy_: it's basically super mega bonusrad.

2:30 brainproxy: recommendations for an academic paper, or something write-up, which explores relationship between RESTful concepts and functional programming?

2:31 s/something/some kind of/

2:32 technomancy_: I'm working on adapting emacs 24 to nix, but makefiles. =(

2:33 Raynes: technomancy_: wut

2:33 technomancy_: No Emacs on nix? :'(

2:33 technomancy_: no 24 yet

2:33 Raynes: Work harder.

2:34 I was playing with Vim earlier because I wanted to write a refheap plugin for it. Then I looked at gist.vim. And then I stopped.

2:34 technomancy_: http://article.gmane.org/gmane.linux.distributions.nixos/7363

2:34 Raynes: https://github.com/mattn/gist-vim/blob/master/autoload/gist.vim#L188

2:34 I thought Emacs's URL package was primitive. This thing is over 1000 lines.

2:34 technomancy_: what is this i don't even

2:36 I remember reading about a bug in vimscript where the if and else branches in conditionals got swapped.

2:36 or something equally outrageous; I wish I could find the link

2:37 Raynes: I think I'll write a plugin for Sublime Text 2 instead. At least Python knows the order of if and else branches.

2:38 technomancy_: is that new in python 3?

2:38 * technomancy_ ducks

2:38 Raynes: ~rimshot

2:38 clojurebot: Badum, *tish*

2:39 Raynes: technomancy_: Gonna run nix in virtualbox with xmonad and pretend OS X isn't installed.

2:40 technomancy_: taste demands no less.

2:43 Raynes: nixos or nix on another OS?

2:44 Raynes: technomancy_: nixos

2:44 technomancy_: hardcore

3:06 devn: hmph

3:08 people (this community included) needs to focus less on building a list of people who approve of using clojure or clojurescript, and focus more on building things other people should be jealous of.

3:08 s/needs/need/

3:36 lpetit: morning

3:42 angerman: g'morning :)

3:45 brehaut: technomancy_: sort of!

3:46 technomancy_: although only of the simplest kind

4:16 kral: devn: I agree with you

5:27 fhd: Where can I find clojure.contrib.string in the new modularised clojure-contrib?

5:31 raek: fhd: it's included in clojure itself since 1.2: clojure.string

5:33 fhd: raek: Ah, thanks :)

5:34 raek: Have been using it from clojure-contrib all this time although I was on 1.2

5:40 adiabatic: I'm familar enough with list comprehensions from Python like [f(x) for x in xs if p(x)]. What's the difference between :when and :while, though?

5:52 lpetit: adiabatic: :when skips, :while stops

5:52 adiabatic: ah, thanks!

5:52 lpetit: ,(for [x [1 2 3] :when (even? x)] x)

5:52 clojurebot: (2)

5:52 lpetit: ,(for [x [1 2 3 4] :when (even? x)] x)

5:52 clojurebot: (2 4)

5:53 lpetit: ,(for [x [1 2 3 4] :while (odd? x)] x)

5:53 clojurebot: (1)

5:53 lpetit: ,(for [x [1 2 3 4] :when (odd? x)] x)

5:53 clojurebot: (1 3)

5:53 adiabatic: What sort of background would you need for this to be obvious?

5:54 lpetit: ,(for [x [1 2 3 4] :when (odd? x) y [2 3 4 5] :when (even? y) ] (x y))

5:54 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>

5:54 lpetit: ,(for [x [1 2 3 4] :when (odd? x) y [2 3 4 5] :when (even? y) ] [x y])

5:54 clojurebot: ([1 2] [1 4] [3 2] [3 4])

5:54 adiabatic: Be familiar with a language that has dropwhile in it?

5:54 lpetit: ,(doc for)

5:54 clojurebot: "([seq-exprs body-expr]); List comprehension. Takes a vector of one or more binding-form/collection-expr pairs, each followed by zero or more modifiers, and yields a lazy sequence of evaluations of expr. Collections are iterated in a nested fashion, rightmost fastest, and nested coll-exprs can refer to bindings created in prior binding-forms. Supported modifiers are: :let [binding-form expr ...], ...

5:55 adiabatic: yeah, (doc for) just has ":while test, :when test"

5:56 lpetit: adiabatic: dunno. It's right that the doc is not explicit about it.

5:56 ,(for [x [1 2 3 4] :when (odd? x) y [2 3 4 5] :while (even? y) ] [x y])

5:56 clojurebot: ([1 2] [3 2])

5:57 lpetit: adiabatic: I should have written :when keeps, not :when skips

5:58 adiabatic: er, right

5:58 * adiabatic updates his notes

6:02 adiabatic: bedtime here. thanks!

9:22 tsdh: raek: Do you remember our discussion from yesterday?

9:23 raek: It turned out that calling java methods using Reflector + try/catch is twice as fast as searching the matching method using reflection from clojure.

9:26 raek: ok

9:27 tsdh: raek: And its twice as fast in both cases: calling existing methods and calling non-existing methods catching the exceptions.

9:50 babilen: Hi all -- I am fairly new to Clojure and unsure if a function I've just written is idiomatic or not. You can find it on http://paste.debian.net/152018/ -- The main problem is that "token-stream" is not actually a sequence and that extracting an item of the sequence involves calling (.incrementToken token-stream) first before one is able to get the actual token with (.term term)

9:52 I somehow have the feeling that there is a more beautiful way to solve this - I would love to be able to actually turn token-stream into a real sequence, by defining a "step" function that will be called to get the next item in the sequence. Would that be possible or is that function actually fine?

9:52 joegallo: i think you want lazy-seq, brother

9:56 here's how i did the same thing (roughly) once: https://gist.github.com/44c5f71da6aa3b5383c8

9:58 tsdh: joegallo: fn is still not concise enough. :-)

9:59 joegallo: oh, i'm sure it can be made smaller, but at this point it was working well enough for me, so i moved on to other things ;)

10:00 babilen: joegallo: Thank you -- I'll look into it. I take it that you've worked with Lucene before if you've written that function before. Mind sharing the complete library or would that be problematic due to its license?

10:00 joegallo: I can't -- it's just some support code for some stuff I happened to do once, not really a library.

10:00 babilen: joegallo: I know that feeling -- It was just that I didn't quite like my solution and had the feeling that there has to be a better way.

10:00 joegallo: But, you should totally check out drewr's esperanto. https://github.com/drewr/esperanto/blob/master/src/esperanto/lucene.clj

10:01 his token-seq uses lazy-seq, too

10:01 so that's a good example as well

10:02 babilen: joegallo: Ah, wonderful -- That looks as if it might come in handy. I am working with/on clucy right now, but esperantly/lucene comes with some handy functions.

10:03 wastrel: esperanto what now?

10:04 babilen: joegallo: Thanks for the pointers and may you have a nice day

10:05 joegallo: you're quite welcome, best of luck with your stuff

10:51 nerdfunk: hi there

10:54 I'm working through 4clojure and I'm a bit stuck on problem 30... Here's what I came up with but unfortunately I'm stuck :/ http://pastebin.com/FCwN3uUr

10:58 jamiltron: The first thing that sticks out is that first recur to compr "(compr (rest i))" should be (recur (rest i)).

10:59 TimMc: nerdfunk: You're gonna kick yourself when you see other people's solutions.

10:59 jamiltron: TimMc: I kick myself everytime I see anyone elses solution to any problem :P

11:00 nerdfunk: haha

11:00 indeed, self kicking is part of the game

11:02 Fossi: i feel like those are sometimes more about library knowledge than "real" programming

11:03 which is fine, but doesn't make me wanna start doing them

11:03 nerdfunk: It's only an early problem

11:03 jamiltron: Library usage is real programming, though.

11:04 nerdfunk: and I wanted to solve it in a more basic way . . than simply finding the "remove duplicates" method

11:04 Fossi: same goes for "mathy" problems

11:04 jamiltron: I think that's something to 4clojure's credit - I've learned more about the core Clojure library by getting stuck and looking things up than I would have working any other kind of "fizz buzz" type koan site.

11:05 Fossi: yeah, it's nice to get to know all the tools in the toolbox

11:05 and they will *really* help you as well

11:05 but to me it feels kinda tedious

11:05 and sometimes overly clever

11:06 as i didn't do them yet, i don't know the question, but on one of them the "best" answer is (into [])

11:06 from what i got here

11:07 nerdfunk: hmm.. recursion just isnt clicking tonight haha

11:07 I guess I need to add more scaffolding to keep the already looked at letters . .

11:07 jamiltron: nerdfunk: You can do this without recursion using sequencing functions.

11:10 nerdfunk: OK.. I'll look into it..

11:15 jamiltron: So lets say you had a collection filled with a single kind of duplicate, say "eeeeeee". You'd know how to remove all the duplicates there right?

11:18 nerdfunk: well.. get first char, while subsequent equal first move to the next until next doesnt exist

11:19 jamiltron: Given that you know they're all the same, you don't even need to move through the rest (at least, not yourself), you can just take the first.

11:20 jodaro: which problem is this?

11:20 jamiltron: So say you had a collection of sequences filled with duplicates - [[1 1 1] [2 2] [3 3 3 3 3]], you know each element strictly contains duplicates - do you know how you'd transform it into a sequence with duplicates removed?

11:21 jodaro: Compress a Sequence (http://www.4clojure.com/problem/30)

11:21 jodaro: ok

11:21 nerdfunk: map first ?

11:22 jamiltron: nerdfunk: Exactly. And the beautiful thing about map first is that it will work on sequences with only 1 value, as well.

11:22 nerdfunk: hmm.

11:23 I guess I need to learn how to break apart sequences into duplicates then.

11:24 jamiltron: Right. Now if you want I can point you half of the way there and show you a higher-order function I used to do that, or you can write it yourself, or you can look though clojure docs until you find it. I don't want to point you towards it if you'd feel that's cheating somehow.

11:24 kral: nerdfunk: can't you use a set?

11:24 nerdfunk: That's OK, I'll try first and then come back when I'm stuck

11:25 jamiltron: kral: A set wouldn't work for this problem. You're only removing consecutive duplicates, not all of them.

11:26 kral: jamiltron: oh, i see

11:28 jamiltron: So what's the defacto pattern-matching library for Clojure these days?

11:30 core.match? I'm starting to work through Pierce's TAPL and would prefer to use Clojure over Ocaml, just because I don't know Ocaml :P

11:33 jodaro: heh

11:33 the first case is easy with frequencies

11:33 breaks down for the rest, though

11:34 lnostdal: ,(doseq [i (range 2)] (future (defonce -jarra- (println "blah"))))

11:34 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

11:35 lnostdal: ok, well .. anyway .. defonce seems racy

11:35 in some cases i see "blah" outputted twice here

11:35 jodaro: java.lang.SpellingException: SANBOX or SANDBOX?

11:35 lnostdal: ( this is a recent 1.4.x from git )

11:42 nerdfunk: well.. looks like I was kind of on the right track.. http://pastebin.com/nkfQTMbM I'll try to work out how to do it with map first too

11:50 Vinzent: Hi, I have 'ClassNotFoundException com.google.common.collect.ImmutableList java.net.URLClassLoader$1.run' after running 'script/run' from ClojurescriptOne. Although REPL still starts, there is nothing on localhost:8080

11:50 adamspgh: Vinzent: did you do "script/deps" first?

11:50 Vinzent: Ok, this is already on the issue list: https://github.com/brentonashworth/one/issues/58

11:50 adamspgh, yes

11:53 looks like the problem is that I haven't curl installed

12:08 timvisher: anyone interested in helping me debug my leiningen proxy settings?

12:21 jfields: If I have (ns a-a) (defrecord Foo [x]) and I want to extend a protocol in (ns b), is it still correct to (:import [a_a Foo]) or can I reference Foo in some other way?

12:22 I need Foo so I can (extend-protocol APro Foo (a-meth []))

12:22 Vinzent: jfields, why import a_a? you can require it as a normal clojure ns

12:22 jfields: Vinzent, I tried that and I get Unable to resolve symbol: Foo in this context

12:23 dnolen: jfields: I think that's the only way

12:23 Vinzent: jfields, you still need to import Foo

12:23 jfields: if you require you get access ->Foo and the other fns, but you can't reference the class... at least it looks that way to me.

12:24 Vinzent: jfields, you need require the namespace and import the record class in order to reference it as a Foo

12:25 jfields: right, that's what I'm doing, but when I reload those files during dev I end up getting errors because the versions of a_a Foo and a-a Foo get out of sync and my protocol ends up not having the right def. :\

12:25 jamiltron: How comparable is core.match's pattern matching to that of Ocaml or SML?

12:27 Vinzent: jfields, hm, this happens even after recompiling (e.g. C-c C-k) both files?

12:28 jfields: Vinzent, I'm doing a ton of java interop so I'm stuck in IntelliJ. :\ that's probably the root of my problem. :)

12:29 Vinzent, I am doing a load-file on both files, and that seems to get things out of sync

12:30 Vinzent, if I load-file the ns with the protocol everything is fine, but if I load-file the file with the record def it all goes downhill.

12:37 dnolen: jamiltron: it's pretty similar tho more flexible - you can extend it and there are no constraints about what types appear.

12:38 jamiltron: dnolen: Can you place type constraints using core.match?

12:39 Vinzent: jfields, hm, I think emacs' C-c C-k is the same as load-file, maybe I just didn't noticed the problem becuase I not change records and protocols frequently... Sorry I couldn't help

12:39 dnolen: jamiltron: like matching on a class / interface / deftype / protocol ?

12:39 jamiltron: dnolen: Yes :)

12:40 dnolen: jamiltron: not yet, it's on the todo list

12:43 jamiltron: dnolen: Awesome, thank you. I'm currently enrolled in a class using TAPL and am trying to decide between biting the bullet and learning Ocaml, or having fun and trying to use Clojure for it.

12:44 dnolen: jamiltron: Types And Programming Languages?

12:44 jamiltron: dnolen: Yes, the Orange Book.

12:45 dnolen: jamiltron: Ocaml seems worthy of study. I've only played with Standard ML which is pretty cool.

12:46 jamiltron: dnolen: Yeah, it's something I wouldn't mind doing, its just a lot of extra work in combination with a job and school work. I'm sure it would be really beneficial to learn Ocaml, though.

12:48 jfields: Vinzent, no problem, thanks for the help anyway

13:06 wiseen: is there a way to do (if-let [x (...)] x y) without the if-let ie. eval expression and if the result is nil return alternative ?

13:08 ben_m: wiseen, yes, there is, I'm trying to find what it's called

13:08 joegallo: (or (some-expression...) the-default)

13:08 ben_m: It's a function that takes another function and a default value, and returns a function :S

13:09 joegallo: works nicely

13:09 wiseen: joegallo, or returns a value and not True/False ?*

13:09 joegallo: or is the way and the truth and the light

13:09 ben_m: ,(or false 'default)

13:09 clojurebot: default

13:10 ben_m: ,(or 'not-default 'default)

13:10 clojurebot: not-default

13:10 wiseen: joegallo, the path is clear now that I've seen the light

13:10 joegallo: go forth and sin no more

13:10 ben_m: I still want to find that function I had in mind.

13:11 TimMc: ben_m: fnil ?

13:11 lpetit: ben_m: it's fnil

13:11 TimMc: It takes a default input, actually.

13:11 ben_m: Exactly, thanks.

13:12 jodaro: seems like fnil is trending higher than juxt these days on the coolest clojure function charts

13:12 amalloy: BLASHPEMY

13:13 makes me so incensed i can't even spell anymore

13:13 jodaro: is that like SANBOX?

13:13 TimMc: (juxt (fnil (comp (partial (apply ...) ...) ...) ...) ...)

13:13 fill in the blanks, kids

13:13 amalloy: yeah, except sanbox is an age-old tradition

13:14 ben_m: ,(doc juxt)

13:14 clojurebot: "([f] [f g] [f g h] [f g h & fs]); Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to the args (left-to-right). ((juxt a b c) x) => [(a x) (b x) (c x)]"

13:14 ben_m: Nice, reminds me of Factor combinators.

13:14 yoklov: oh thats cool.

13:14 TimMc: ben_m: amalloy is nuts for juxt.

13:15 amalloy: i was into fnil before it was cool

13:15 ben_m: Me too! high-five!

13:18 lpetit: amalloy: you should start a "I was into fnil before raynes" blog post :-p

13:18 just kidding

13:19 amalloy: lpetit: well, chouser and technomancy are the ones telling the world how exciting fnil is

13:19 and Raynes so treasures his superior coolness; i couldn't do that to him

13:19 lpetit: amalloy: oh you refer to some of the previous tweets earlier this day ?

13:20 :)

13:20 amalloy: lpetit: yeah, within the past week or so. i assume that's what jodaro was referring to

13:21 lpetit: amalloy: ok :)

13:21 amalloy: (if anyone is interested though, http://amalloy.hubpages.com/hub/The-evolution-of-an-idea is a blog post of mine where i praise fnil a bit. even if you don't care about fnil, i'll toot my own horn by saying it's an interesting read)

13:21 sritchie: technomancy, do you have a guide on how to deploy jars to s3-wagon-private?

13:22 lpetit: amalloy: fnil saved my life a couple times in the past especially when used with nested update-in calls

13:22 amalloy: yeah, fnil is great friends with update-in

13:24 technomancy: sritchie: no, once s3-wagon-private is installed, s3p:// repository URLs should function just like any other.

13:25 if it doesn't work out of the box then it's a bug

13:25 sritchie: I just don't know how to deploy to a maven repo other than clojars using lein

13:26 technomancy: oh, gotcha. "lein help deploying"

13:27 man... lein 2 is so close to being usable for the basics... nom.

13:27 amalloy: any chance you'd want to port the pom stuff from depot to lein 2?

13:28 sritchie: ah, cool

13:29 amalloy: technomancy: what is there to port? depot doesn't depend on cake at all

13:29 technomancy: amalloy: I guess it's more about making leiningen.pom use depot rather than the other way around?

13:30 amalloy: and also figuring out with cemerick if that functionality belongs in pomegranate?

13:30 sritchie: technomancy: it doesn't look like the deploy task does anything: https://github.com/technomancy/leiningen/blob/master/src/leiningen/deploy.clj

13:30 I'm trying to figure out how to push a separate jar up to this bandwagon

13:30 technomancy: sritchie: not on the master branch, no.

13:30 try the stable branch.

13:31 amalloy: technomancy: where would i look in the lein source to see where that change belongs?

13:31 technomancy: amalloy: should just be src/leiningen/pom.clj

13:33 jodaro: aha!

13:34 amalloy: ugh, depot still depends on prxml. my attempt to release a working version of data.xml to maven was a failure AFAICT, and halloway wants someone to simplify the POMs before another release attempt is made

13:35 technomancy: grumblecakes

13:35 well tomorrow is open source friday, so cross your fingers?

13:36 hiredman: I had to figure out how to get clojure-maven-plugin working yesterday

13:36 that was bracing

13:37 bitpimp: grumblecakes. mmmmm.

13:59 zmaril: Hey in a little bit may I bring some high schoolers and show them #clojure?

14:01 amalloy: quick, hide the <various illegal/immoral activities>

14:01 ben_m: Why would you ask for permission? I could be a high schooler for all you know.

14:01 zmaril: Cause there are 32 of them

14:01 TimMc: haha

14:01 zmaril: And they can be unruly

14:02 ben_m: The horrors

14:02 emezeske: I think I might have been in high school once

14:03 Flash-mobbing #clojure might have been good fun :)

14:14 Azumarill: ALL THE IMSA STUDENTS

14:14 akim1: hello

14:14 mlee1: hello

14:14 ssomasun: hello

14:14 tvadakumchery: Hello

14:14 aschell: HI everyone!!!

14:14 hello

14:14 tvadakumchery: All these new guys are from the same class

14:14 jhu: hi drew

14:14 ssavya: hollo

14:14 aschell: hi jon

14:15 ssomasun: hollo sajishnu

14:15 aschell: is zack getting on?

14:15 uagrawa: hiiiii

14:15 aschell: oh yeah

14:15 sjain1: hey

14:15 aschell: oooh cool

14:15 who is jigglypuff?

14:15 that one of us?

14:15 ssomasun: idk

14:16 jigglypuff_: JIGGLY

14:16 rhelm: woa!

14:16 are you sure?

14:16 akim1: no he's not sure

14:16 tvadakumchery: Sure about what?

14:16 ben_m: jigglypuff_ has the best nickname

14:16 Just saying.

14:17 Azumarill: I have the best nickname

14:17 Bromosome: i disagree

14:17 ssomasun: no

14:17 jmo1: ikr

14:17 aschell: i wanna be sheldor...

14:17 tvadakumchery: Azumarill> jiggly

14:17 zmaril: I am confused about lazy sequences. How can I understand them?

14:17 ben_m: Is this the class of 16 year olds now?

14:17 tvadakumchery: Azumarill huge power aqua jet OP

14:17 aschell: yeah

14:17 Bromosome: Yep.

14:17 pjstadig: zmaril: come to my talk at Clojure/West

14:17 Azumarill: ^You, I like you.

14:17 zmaril: Yes this is the class of 16 olds.

14:17 rhelm: zmaril is very close to azumarill

14:17 amalloy: zmaril: step 1 is probably to ask a more specific question

14:17 ben_m: Well, jigglypuff_ is the coolest kid.

14:17 jhu: ^

14:18 aschell: my death strike crits 20k damage

14:18 jmo1: Yay, IRC.

14:18 vravi: lol drew

14:18 jhu: drew

14:18 lol

14:18 ssomasun: gg

14:18 tvadakumchery: But the max health you can have in pokemon is 718

14:18 nfilipac: ^amen

14:18 zmaril: amalloy: Why shouldn't I call doseq on an infinite list?

14:18 aschell: hello iwillig

14:19 emezeske: ,(take 32 (repeat "jiggly"))

14:19 clojurebot: ("jiggly" "jiggly" "jiggly" "jiggly" "jiggly" ...)

14:19 jigglypuff_: yehehehessssss

14:19 aschell: HI CLOJUREBOT!!!

14:19 amalloy: zmaril: feel free to call doseq on an infinite list, as long as you don't mind that it will never return

14:19 tvadakumchery: the max health you can actually have in pokemon is 714

14:19 I got it wrong

14:20 ssomasun: this is for clojure not pokemon

14:20 aschell: death knights beat mages any day

14:20 cata: you guys are on the internet

14:20 tvadakumchery: Can we program pokemon with clojure?

14:20 ben_m: Well that was successful.

14:21 zmaril: That was about as successful as I hoped it would be

14:21 Nobody swore which was a major win

14:21 Azumarill: You have no faith in us.

14:22 ben_m: zmaril, what was the point of that? :D Are you their teacher?

14:22 amalloy: he was probably worried about the regulars swearing, not his precious, innocent students

14:22 Bromosome: he's our teacher

14:22 zmaril: Both sides actually

14:22 I came back to my old high schoiol and am teaching them clojure

14:22 *them being a bunch of 16 year olds

14:22 technomancy: maybe start out in an empty channel to have them get over the "woooooo check it out I'm on the INTERNET" stage?

14:22 zmaril: They are chewing through 4clojure and clojure koans

14:23 amalloy: technomancy: eh, what was the harm of putting them in here, though?

14:23 zmaril: technomancy: that would have been a better idea

14:23 technomancy: amalloy: I'm thinking primarily to help them avoid embarrassing themselves =)

14:23 Bromosome: we have no shame

14:23 zmaril: They have no shame

14:23 jamiltron: Well I'm still embarrassing myself several years later.

14:24 WorldOfWarcraft: hello

14:25 franks: technomancy: about that "cljsh", that lightweight lein repl-server client...

14:26 WorldOfWarcraft: i luv clojure

14:26 Skyrim: who doesn't <3 clojure

14:27 Raynes: chouser_: FYI, they're setting up for a spamfest.

14:28 franks: technomancy: right now, i need some custom clojure code that ideally would be part of this lein repl server, like turning repl-prompt on/off, printing of eval results on/off - you think that you could provide that funcionality in lein?

14:28 Skyrim: lol

14:29 technomancy: franks: actually the code in leiningen.repl is probably going to be replaced in lein 2 with nrepl

14:30 irp: C is better

14:30 technomancy: it should be doable to use nrepl with a lein1 plugin too

14:30 jlr: does Sam Aaron frequent this channel?

14:30 WorldOfWarcraft: hey guys i need help

14:31 BLASTOISE: ok

14:31 Bromosome: what do you guys think of this guide to clojure

14:31 WorldOfWarcraft: (= __ (conj '(2 3 4) 1))

14:31 technomancy: jlr: IIRC he's known here as naeu

14:31 Bromosome: http://blackstag.com/blog.posting?id=5

14:31 WorldOfWarcraft: any help?

14:31 franks: technomancy: the nrepl that i looked at had a real protocol... would prefer the simple socket extension of the interactive repl interface - or did i misunderstand?

14:31 WorldOfWarcraft: i think the answer is (1 2 3 4) but its wrong

14:31 jlr: thanks Mr. Hagelberg :)

14:31 Raynes: technomancy: No. He is known as samaaron.

14:31 WorldOfWarcraft: any help?

14:32 technomancy: Raynes: oh, the olde switcheroo

14:32 WorldOfWarcraft: (= __ (conj '(2 3 4) 1))

14:32 (1 2 3 4) right?

14:32 Bronsa: ,(conj '(2 3 4) 1)

14:32 clojurebot: (1 2 3 4)

14:32 technomancy: franks: I'm not sure; I haven't looked at nrepl much yet. I just don't want to continue maintaining my own repl server if I can outsource it

14:32 jlr: *shrug* if I see either, I'll message. Thanks!

14:32 WorldOfWarcraft: it says its wrong

14:32 amalloy: WorldOfWarcraft: to express a list literal you need to put a ' in front of it, like they did in the example: '(2 3 4)

14:33 WorldOfWarcraft: ok great :)

14:33 franks: technomancy: is anyone actually using your repl server right now?

14:33 technomancy: franks: yeah, basically all lein users who don't use slime.

14:33 BLASTOISE: (= __ (conj '(2 3 4) 1)) Any ideas?

14:34 Bromosome: what is a repl server exactly. when i start up clojurebox, it says "setting up server" or something of that ilk

14:34 technomancy: clojurebot: can you do my homework for me?

14:34 clojurebot: Excuse me?

14:34 amalloy: i never thought i would type this, but... BLASTOISE: ask WorldOfWarcraft

14:34 WorldOfWarcraft: oh yeah blastoise

14:34 he said its '(1 2 3 4)

14:34 BLASTOISE: You're sitting right next to me and have the same question as me, WorldofWarcraft lolol

14:35 franks: Bromosome: "lein repl" strts up both an interactive repl session and a network listener

14:35 WorldOfWarcraft: oh lol

14:35 BLASTOISE: trolol?

14:35 Bromosome: thanks

14:35 BLASTOISE: Ok final conclusion: 4 Clojure is wrong.

14:42 franks: technomancy: is the current lein repl written as a plugin?

14:44 technomancy: franks: no, it's a built-in task

14:44 it could be spun out if you want it to be usable in 2.x though I guess

14:45 WorldOfWarcraft: hello guys any suggestions: Write a function which returns a personalized greeting. (= (__ "Dave") "Hello, Dave!")

14:46 franks: technomancy: that's what i thought... that would be one way for you to get of of the repl-business... while still having some backwards compatibility

14:46 TimMc: WorldOfWarcraft: What have you tried?

14:46 technomancy: nobody tell him about findfn, ok?

14:47 TimMc: heh

14:47 yoklov: is there a way to get a pair in clojure? cons requires the 2nd item to be a seq

14:47 WorldOfWarcraft: TimMc: I tried to just add in "Hello" but it needs a "!" at the end

14:47 yoklov: or do people usually use 2 element vectors for that

14:47 amalloy: yoklov: we usually just use vectors

14:47 yoklov: okay

14:47 thanks

14:47 TimMc: yoklov: There are no pairs in Clojure -- sequences and lists are always proper.

14:47 ben_m: Somebody tell me about findfn though

14:47 amalloy: yoklov: if you want to be super-efficient you can use (clojure.lang.MapEntry. a b)

14:47 franks: technomancy: it would allow others (like me) to easily modify the repl code and publish it as a new plugin without adding to your support

14:50 technomancy: franks: yeah, if that's what you need you should probably go ahead and spin it off.

14:50 TimMc: WorldOfWarcraft: How did you succeed in adding "Hello"?

14:50 technomancy: I have never been fully comfortable maintaining the repl task since I never use it myself

14:50 amalloy: $findfn 1 2 3 6 ;; ben_m

14:50 lazybot: [clojure.core/+ clojure.core/* clojure.core/+' clojure.core/*']

14:50 TimMc: technomancy: Because you use swank instead?

14:50 WorldOfWarcraft: my idea was simply to use apply str but that did not work so im gonna keep working on it

14:51 ben_m: That's pretty cool.

14:51 TimMc: ben_m: Even better, it works in /query lazybot (hint hint :-P)

14:51 ben_m: TimMc, heh, I know better than to spam channels with bot commands

14:52 TimMc: THe hint wasn't for you.

14:52 Raynes: technomancy: Man, you and I are like complete opposites.

14:52 technomancy: TimMc: aye

14:52 Raynes: technomancy: You use swank and rarely lein repl, I just lein repl and rarely swank, I've looked at my refheap elisp, you're still bloody procrastinating. Completely different people, we are.

14:53 rhelm: how does a multimethod work?

14:55 franks: technomancy: what i need is just a 2-3 functions added to the current lein repl features... spinning off the repl code into a plugin would be more work than i anticipated... not sure if that's worthwhile if nobody seems to be using it...

14:55 TimMc: rhelm: For implementation details, read the source. Or are you asking how to use one?

14:56 technomancy: franks: maybe people would use it more if it didn't boot slowly? I don't know

14:56 rhelm: i'm looking for the basics, it seems like you declare a function for a set of keywords linked to a map, right?

14:58 TimMc: rhelm: You have a dispatch function that takes the arguments and produces a key of some sort.

14:59 Then you have a bunch of implementation functions for different keys. The keys are compared using isa?, which allows you to do all sorts of cool hierarchical stuff.

14:59 Go read the docs for isa?, it's not entirely trivial.

15:00 rhelm: timmc: where do i find said docs?

15:01 TimMc: rhelm: this site is great: http://clojuredocs.org/clojure_core/clojure.core/isa_q

15:01 rhelm: Or you can open a REPL and type (doc isa?)

15:01 Bromosome: does anybody know the solution to http://www.4clojure.com/problem/5

15:01 clojurebot: It's greek to me.

15:01 Bromosome: ?

15:02 Raynes: $examples isa?

15:02 lazybot: You must pass a name like clojure.core/foo or, as two arguments, clojure.core foo.

15:02 Raynes: $examples clojure.core/isa?

15:02 lazybot: No results found.

15:02 amalloy: huh, i never realized problem 5 was such a stumbling block

15:02 Raynes: Huh

15:02 Bromosome: hey now

15:02 yoklov: Bromosome: conj chooses the best way to add to a seq, so since that seq is a list it adds to the front

15:03 are you familiar with how lists work?

15:03 e.g. why the front is the best

15:04 Raynes: Teenagers. Impossible to work with.

15:05 ibdknox: srsly.

15:05 TimMc: Oh, and he's gone...

15:05 Raynes: Oh, wait...

15:05 yoklov: weird.

15:05 Raynes: ibdknox: Noir has exactly 404 watchers. Quick, screenshot!

15:06 pjstadig: Raynes: not found

15:06 jodaro: heh

15:07 franks: technomancy: just noticed that in the 1.7.0-SNAPSHOT, you're not using rlwrap at all... any reason for the removal?

15:08 technomancy: franks: whoa, that's a mistake

15:08 must have come from that trampolining change I made

15:08 thanks

15:08 ibdknox: I have to look up those screenshot commands everytime

15:10 TimMc: ibdknox: ...PrtScn?

15:11 ibdknox: TimMc: you mean command+shift+4, right ;)

15:11 TimMc: Oh, if you're on a mac I guess it's shift-squigglything-3.

15:11 yeah

15:12 franks: technomancy: that may be related to the fact that the repl-server keeps running as a background task after quitting out of lein's interactive repl with ctrl-d (?)

15:14 solussd: has anyone here used JNA (via chouser's jna-invoke) to retrieve a struct? I did using (jna-invoke int c/stat "/path/to/file" (:pointer mymembuffer)) and the struct doesn't have things where I'd expect them to be

15:17 hiredman: endianess?

15:23 nuclearsandwich: If I have a leiningen project and want to read from stdin, what's the best way to launch it since lein run doesn't work?

15:24 ibdknox: lein trampoline

15:25 lpetit: technomancy: Hello, in the upcoming 2.0 version, will the standard folders layout be changed (for example to be less clojure centric, like src/clojure, src/java, src/clojurescript, etc.) ? Or will it remain the same ? I'm asking because I'm changing the structure of CCW's source folders right now, and I'd like to move in the right direction (CCW will not be built by lein in the near future, so my intent is more to be lein-2.0-ready than

15:25 lein-1.0 compliant.

15:26 nuclearsandwich: ibdknox: thanks! Don't know how I missed that.

15:26 ibdknox: technomancy: when I do lein deps in 1.6.2 it occasionally eats 100% cpu for a long time

15:27 nuclearsandwich: it's one of those relatively secret features :) Few people know about it

15:27 technomancy: I've never let it sit long enough to finish, so I'm not sure how long, but I suspect indefinitely ;)

15:36 Raynes: lpetit: It is generally going to be the same. We're thinking of changing the default project skeleton a bit, but mostly just to stop encouraging the 'foo.core' phenomenon.

15:36 lpetit: Raynes: ok. What is the expected folder for holding clojurescript files? What is expected to replace the 'foo.core' phenomenon ?

15:37 amalloy: lpetit: well, i don't think cljs has any need for foo.core, right?

15:37 yoklov: what's wrong with foo.core?

15:38 lpetit: amalloy: there were really 2 separate questions ^^

15:38 Raynes: lpetit: I'm not entirely certain yet. It's still cooking.

15:38 amalloy: yeah, i realized after answering that they don't look related at all

15:38 Raynes: technomancy proposes we split names with a dot or dash and use that to avoid single segment namespaces.

15:39 lpetit: Raynes: there is one beenfit to 'foo.core', which is that this creates projects artifacts which can play well with OSGi

15:39 Raynes: But nothing is set in stone yet.

15:39 I don't know what that is.

15:39 duck1123: no one wants 'foo'

15:40 hiredman: lpetit: namespace names and artifactids and groupids are different things

15:40 lpetit: Raynes: OSGi is the current defacto standard for modularized things

15:40 hiredman: you're right, but you're wrong in assuming I was thinking about that

15:42 Raynes, hired man: in OSGi, the 'bundles' can be loosely wired by having them declare, at the package level, which packages bundle X 'imports' (requires), and also which packages bundle X 'exports' (makes visible to be 'imported' by other bundles)

15:42 Raynes: technomancy: We need some sort of group discussion about project skeletons, I think.

15:42 That way everybody can whine in a proper venue when we choose the least popular thing.

15:43 yoklov: err, why are you unhappy with 'foo.core'?

15:44 lpetit: Raynes, hired man: When you have developer john smith creating 2 libraries, say smith.lib1, and smith.lib2, if each library has a namespace named respectively smith.lib1 and smith.lib2, then each library has something to say about the contents of the package "smith".

15:44 Raynes: It isn't very useful.

15:45 anntzer: hi, is there a way to use `apply` on methods defined in a protocol?

15:45 Raynes: yoklov: I don't really care about namespaces as much as other people. As such, I'm not the one that instigated this radical change. Yell at cemerick|away.

15:45 amalloy: anntzer: yes, you just use apply

15:45 anntzer: afaict calling such methods also involves using the dot form

15:45 lpetit: Raynes, hiredman: then you cannot have a consumer library say "I want smith.lib1" version V1, and "smith.lib2" version V2

15:45 amalloy: i think your question is probably "is there a way to accept varargs in a protocol function", and the answer to that is no

15:45 anntzer: so I would have to do (apply .method object)

15:45 ah

15:46 ok

15:46 yoklov: oh, i don't want to yell at anybody, i just want to know the reasoning behind it. i believe its probably for the best i'm just curious why

15:46 * yoklov hasnt written enough clojure to have an opinion on something like that

15:46 Raynes: Haha

15:46 amalloy: no, use no .s - there's no reason to use interop syntax for protocols

15:47 lpetit: Raynes, hired man: so the advantage oI see to "foo.core", is that my example becomes namespaces "smith.lib1.core" and "smith.lib2.core", reps. packages "smith.lib1" and "smith.lib2". Now you can have your dependencies right again

15:47 Raynes: yoklov: I think the primary reason is that 'foo.core' doesn't tell you a lot. It isn't a very useful namespace. The reason we have the foo.core idiom in the first place is because it is hard to programmatically generate skeletons with a smart alternative.

15:47 yoklov: yeah, alright that makes sense

15:47 anntzer: amalloy, but if the protocol has been defined in some other ns then I have to use the dot form don't I?

15:48 amalloy: no, just require/use its functions like any other

15:48 lpetit: Raynes, hired man: I'm having the problem right now with all the contrib libraries contributing files to the same "clojure.contrib" package.

15:48 amalloy: if you use the dot form your code will be much slower in the best case, and break in other case

15:49 anntzer: ok

15:49 thx

15:50 lpetit: Raynes, hiredman: was I clear in my explanations?

15:50 amalloy: Raynes: that isn't quite the reason foo.core exists. it exists because namespaces named just "foo" cause all kinds of problems

15:51 hiredman: lpetit: I think you are thinking about problems so far into the solution domain that I've stopped caring

15:51 TimMc: amalloy: Do you have an example of one of those problems?

15:52 Raynes: amalloy: I'm not sure you're disagreeing with me.

15:53 amalloy: Raynes: i don't think i am, but i'm expanding/clarifying for you

15:53 TimMc: yoklov: You can also do things like org.yoklov.foo

15:53 Raynes: amalloy: That is just an extension of my point. We don't generate single segment namespaces because they are the devil, so something else had to be generated. foo.core exists because we don't want single segment namespaces and we suck at generating smart alternatives (for now anyway).

15:54 yoklov: TimMc: yeah, i could but…

15:54 hm.

15:54 Raynes: TimMc: I know of at least one bizarre thing with classloaders and single segment namespaces.

15:54 TimMc: But disregarding actual limitations of Java, they are pollution.

15:54 amalloy: Raynes: foo.core pollutes exactly as badly as foo, doesn't it?

15:55 Raynes: amalloy: Kind of. Which is probably why people are deeming these namespaces non-useful.

15:58 * Raynes sighs and wonders why he ever got into the project skeleton business.

16:00 Raynes: I'm going to use Sublime Text 2 until I get to a point where I need to reindent a whole large block of code, at which point I'll run screaming to Emacs and never again look back. But I'll be able to say "you know, I've been there."

16:01 I will have grown from the experience.

16:02 I do totally understand why I see Vim people and such committing code that is indented terribly. The great thing about Emacs is how hard it makes it to screw up. It is the king of contextual indentation.

16:02 technomancy: Raynes: the "split namespaces with a dot or dash to avoid *.core" is exactly what I'd like to see in lein new

16:02 Raynes: You can hit tab until the sun rises but it wont ever let you down.

16:02 technomancy: Can you show me an example?

16:03 I think I get the idea, but I'm not entirely sure how people are meant to use it. Like, if that were implemented right now, I wouldn't know what to do to create a new project with proper names.

16:05 technomancy: Raynes: like when I ran "lein new robert-hooke" the first thing I did was rm -rf src/*; mkdir src/robert; touch src/robert/hooke.clj

16:05 and the second thing should have been to adapt "lein new" to do that for me, but I was too lazy.

16:06 Raynes: What if I have a project called "sandwich"? `lein new sandwich.chicken` -> src/sandwich/chicken.clj?

16:07 technomancy: yeah, I think we may still have to fall back on core in that case

16:07 or we could go the elasticsearch route and have a big list of superheroes/villains included in the "new" task and pick a new one each time

16:08 src/sandwich/cyclops.clj

16:08 Raynes: technomancy: What about people who still insist on naming shit clj-foo? I don't care about them, not sure about you.

16:08 technomancy: waaaaaaaaaaait a minute

16:09 you sneaky bastard.

16:09 $ lein new buggerjure => Generating a project called buggerjure based on the 'default' template.

16:09 how did I let that slip by me‽

16:09 Raynes: Hahahahaha

16:09 I swear I would have added the blocker had I remembered it.

16:10 technomancy: ok, I'll open an issue to help aid your memory

16:10 lpetit: hiredman: if any, your answer has the merit to be clear. Not sure how I should feel after having read it, though.

16:13 hiredman: lpetit: :)

16:13 Raynes: technomancy: If there is a dash in a project name, the whole project is that name and it is split on the dash to create the file structure. If it has dots, the first segment becomes the project name but it is split and the file tree is created in the same way. With no dots or hyphens, one could just generate src/projectname. The problem with all of this is that it would complicate the hell out of things. I'm not

16:13 certain, but it'd probably take away any chance of lein newnew being flexible enough to generate things other than project scaffolding, but I'd be okay with that, I think.

16:14 It seems like it'd be difficult for this to work well for all templates.

16:14 technomancy: just skip creating a .clj file altogether with a single-segment name? yeah, that's not a bad solution.

16:14 Raynes: I'll have to look into it more.

16:14 technomancy: not sure why you want to treat dashes and dots differently

16:14 I guess having a dot in the project name is a bit weird?

16:14 Raynes: I'm not sure why you want to split on dashes.

16:14 *shrug*

16:15 lpetit: Raynes, hired man, technomancy: anyway to summarize. I exposed a real-world problem to you. It's not musing, I've faced it already in the near past, and will for sure be facing it in the (near) future: any conventions that facilitates independent libraries to pollute the same package will cause modularity problems with OSGi. I haven't investigated java modularization process, so I don't know if there will be problems with this also.

16:15 Raynes: I think we should just split on dots, which gives the user the ability to generate the initial project file layout himself when he creates the project, or just skip creating a .clj file altogether and do whatever he wants by himself.

16:15 lpetit: going to bed, *shrug*

16:15 Raynes: Splitting on dashes seems weird and error prone.

16:16 Man, I didn't mean to upset him. It's just that I can't really understand anything he has said. :\

16:16 duck1123: what if it prompts?

16:16 Raynes: duck1123: technomancy is allergic to prompts.

16:17 technomancy: I can't tell if lpetit is complaining about more than just single-segment namespaces?

16:17 Raynes: technomancy: Something about OSGi, but I didn't respond because I don't even know what that is/is for.

16:17 :\

16:19 mgnm: how can I avoid stackoverflow errors when dealing with large numbers?

16:20 franks: technomancy: managed to essentially copy the leiningen/repl.clj file and create my own task - a few renames of repl, and it just worked - 20min - lot easier than I thought - nice plugin architecture

16:20 technomancy: yeah, in my mind OSGi is in a shadowy place next to dependency injection and CL's asdf reserved for solutions to which the descriptions of the problems they attempt to solve are left as an exercise to the reader.

16:20 franks: excellent

16:22 duck1123: The only times I hear about OSGi, it's in the context of "... doesn't work with OSGi"

16:22 Raynes: I really didn't mean to ignore him though.

16:22 I get nervous when I talk to him in person.

16:22 I'm a southern guy -- I can't understand a word he says. :\

16:23 TimMc: mgnm: Not *stack* overflow, surely...

16:23 franks: only one caveat with the kill-switch definition of "::exit" in the code - for the leiningen/repl, I had to name it ":leiningen.repl/exit", but now I have to use my namespace identifier... maybe better to use fully qualified identifier for kill-switch

16:23 TimMc: &(+ Long/MAX_VALUE 1)

16:23 lazybot: java.lang.ArithmeticException: integer overflow

16:23 Raynes: TimMc: Maybe he has a really big stack of numbers.

16:23 TimMc: &(+' Long/MAX_VALUE 1)

16:23 lazybot: ⇒ 9223372036854775808N

16:24 ben_m: ,(doc +')

16:24 clojurebot: "([] [x] [x y] [x y & more]); Returns the sum of nums. (+) returns 0. Supports arbitrary precision. See also: +"

16:24 yoklov: +"?

16:24 oh

16:24 Bronsa: oh

16:24 yoklov: nevermind.

16:24 ben_m: Hah.

16:24 Raynes: &(+' 5 5)

16:24 lazybot: ⇒ 10

16:24 Raynes: &(+' Long/MAX_VALUE 1)

16:24 lazybot: ⇒ 9223372036854775808N

16:24 technomancy: franks: if it's meant to be used programmatically it's probably not a big deal what it's called as long as it's unique

16:24 Raynes: Omgwtf

16:25 ben_m: What's the difference between lazybot and clojurebot? :D

16:25 duck1123: run

16:25 Raynes: ben_m: One is awesome and the other is less awesome.

16:25 ben_m: Cool.

16:25 Raynes: ben_m: Seriously, they are completely different bots with entirely different codebases. One is by amalloy and I and the other is from hiredman.

16:25 lazybot is ours.

16:25 TimMc: and the awesome one

16:25 franks: technomancy: but now i have to send a different kill-switch to your repl and mine...

16:25 * yoklov loves chatting on freenode because of all the cool bots

16:26 Annoying: Hello.

16:26 technomancy: franks: if you don't need the kill-switch in mine I may just revert it back out

16:26 yoklov: the #emacs bots are hilarious

16:26 Raynes: amalloy and I are building robots for our world domination scheme.

16:26 Bronsa: hm

16:26 yoklov: rudybot is one of my favorites

16:26 i think he's on #emacs

16:26 technomancy: yoklov: have you tried ,botstack?

16:26 yoklov: and also on #racket

16:27 no?

16:27 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack>

16:27 amalloy: yeah, rudybot is a blast

16:27 technomancy: yoklov: go on, we'll wait. =)

16:27 franks: technomancy: that would take care of the issue ;-) (not sure anyone realized they needed such a beast...)

16:28 yoklov: err, i'm not sure if i know what you mean

16:28 ,botstack

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

16:28 clj_newb: I am buiding mh own typed vecto class -- it's a vector of objects, wheter all objects satisfies a given protocol/interface. Question: what interfaces does my typed-vector need to impelment to ensure that it plays nice with clojure builtins?

16:28 TimMc: technomancy: You mean with rudybot, right?

16:28 technomancy: TimMc: fsbot in this case, but yeah over in #emacs

16:28 amalloy: clojurebot: shut up |is| <reply>My new year's resolution is to remember that not every message with "is" in it is addressed to me.

16:28 clojurebot: Ok.

16:29 technomancy: heh

16:29 amalloy: i think he's going to parse that wrong, though, sadly

16:29 TimMc: of course

16:32 WorldOfWarcraft: something

16:32 n00b__: I have a question.

16:32 Bronsa: who doesn't

16:32 WorldOfWarcraft: geniuses...

16:33 Evan Li doesn't

16:33 n00b__: He took an arrow to the knee

16:33 WorldOfWarcraft: Was he an adventurer?

16:33 n00b__: Yeah, just like me.

16:34 Raynes: ibdknox: Welcome home.

16:34 WorldOfWarcraft: hello everyone xoxoxoxoxoxoxoxoxoxoxox

16:34 TimMc: >_>

16:34 ibdknox: Raynes: why thank you :p

16:34 n00b__: >.<

16:35 WorldOfWarcraft: EVAN GET OFF RUNESCAPE!!!!

16:35 Nerd: lolololololol

16:35 TimMc: clj_newb: Still working on your Typed Clojure? Here's a hint: ##(ancestors (class []))

16:35 lazybot: ⇒ #{clojure.lang.ILookup clojure.lang.APersistentVector clojure.lang.IMeta clojure.lang.Reversible clojure.lang.IObj clojure.lang.IFn java.util.List java.util.concurrent.Callable clojure.lang.IEditableCollection clojure.lang.IPersistentVector clojure.lang.AFn clojure.l... https://refheap.com/paste/243

16:35 ibdknox: does someone have chanops?

16:35 lol

16:36 Raynes: ibdknox: Yes, but nobody is actually here.

16:36 yoklov: lol, typed clojure

16:36 WorldOfWarcraft: how do i create a macro?

16:36 TimMc: WorldOfWarcraft: You know you can /join #whatever and it will create the channel for you?

16:36 hiredman: everyone has /ignore

16:36 Raynes: Ignore is a bandaid

16:36 But you didn't hear that because you've got me ignored. :\

16:36 TimMc: hiredman is covered in bandaids

16:36 WorldOfWarcraft: no a macro not a channel

16:37 TimMc: WorldOfWarcraft: defmacro

16:37 WorldOfWarcraft: lol nice tim

16:38 TimMc: WorldOfWarcraft: http://clojure.org/macros <-- lots of good stuff there

16:38 WorldOfWarcraft: hehe u troll :)

16:38 TimMc: ...

16:39 WorldOfWarcraft: alright im gonna go find out how to get shadowmourne from the lich king

16:39 Raynes: /join #clojureforpublicschool

16:39 technomancy: clojurebot: homework is<reply>You can do your own homework; you're a big kid.

16:39 clojurebot: Titim gan éirí ort.

16:39 Raynes: To any teachers in the audience: please don't tell your class to go to #clojure.

16:40 ibdknox: aww but...

16:40 Raynes: Unless, of course, your class is made up of sane human beings.

16:42 adiabatic: People teach clojure in at least one university?

16:42 Raynes: adiabatic: Not a university.

16:42 Those are 16 year olds.

16:42 TimMc: high school

16:42 Raynes: High schoolers.

16:42 TimMc: donny

16:43 Illinois Mathematics and Science Academy, if I can trust the host lookup

16:43 adiabatic: I can't imagine why they'd come in here, of all places, and goof around

16:44 technomancy: musta got booted off OFTC

16:44 Raynes: TimMc: I figured it was somewhere near the throne of the Lich king.

16:44 TimMc: adiabatic: Their teacher pointed them here.

16:45 ibdknox: why do all school websites suck?

16:45 Raynes: ibdknox: Because we didn't write them.

16:45 o/

16:45 ibdknox: lol

16:47 adiabatic: Oh, these people are *regulars*?

16:47 s/people/kids/

16:47 TimMc: NOt sure what that means.

16:47 Raynes: No. Their teacher sent them here. That's all.

16:48 yoklov: why would you tell your students to go on the irc channel

16:48 adiabatic: Oh. I ask because it's not clear that their teacher sent them here as of WorldOfWarcraft's back-and-forth as of 13:34 today (it's 13:50 here now)

17:17 yoklov: hrm, so i have this hash of keywords to sets, and i'm trying to find which set an item is in

17:18 like this: https://gist.github.com/1603487 . can anybody think of a way for me to do that without having to know all the sets ahead of time

17:18 e.g. allow that categorize function to take sets as a parameter

17:19 amalloy: use filter?

17:20 (first (for [[name items] sets :when (thing items)] name))

17:21 yoklov: oh

17:21 yeah that totally works thanks so much

17:27 semperos: neophyte clojurescript/emacs problem

17:28 I've followed these instructions to make my inferior-lisp-program start up a browser REPL

17:28 https://github.com/clojure/clojurescript/wiki/Emacs-&-inferior-lisp-mode

17:29 I can open a .cljs file and eval things like (+ 1 1), but when I try to eval the namespace form, it can't find the necessary file

17:29 does anyone have more detailed notes on doing cljs development with Emacs, or know what simple thing I might be missing?

17:33 dnolen: semperos: yes that script is very simple, needs to be changed to set the classpath to your project directory.

17:34 semperos: dnolen: great, that's what I was just editing in

17:35 glad I was at least in the right direction

17:35 brehaut: todays think relevance podcast interview about clojurescript one is great

17:35 semperos: agreed

17:38 JohnnyL: How mature is clojure script?

17:38 dnolen: JohnnyL: rough edges, but it's works pretty darn well

17:39 amalloy: PG13

17:39 ibdknox: lol

17:39 JohnnyL: dnolen: ok thanks. I was hoping to do some ajax/canvas work in it.

17:39 amalloy: :)

17:40 technomancy: JohnnyL: depends on if you're comparing it to clojure or javascript

17:41 JohnnyL: technomancy: nope, just functionality-wise and bug free related maturity.

17:44 dnolen: JohnnyL: lots of functionality - Relevance actually used ClojureScript One for a client project, so likely few show stopping bugs

17:45 ibdknox: hm

17:45 I think cljs one is positioned in a very weird way

17:47 dnolen: ibdknox: how so?

17:47 ibdknox: dnolen: it's shortsighted to assume it's not a library

17:47 the way in which it is presented, it will absolutely become a library

17:48 whether intentional or not

17:49 JohnnyL: dnolen: kj

17:49 dnolen: k

17:51 dnolen: ibdknox: true, but I think the point is to show how to compose a Clojure <-> ClojureScript solution via a full fledged example w/ thorough documentation.

17:51 brandel: dnolen: talking about cljs one? as a clojure newbie I have found that super helpful

17:52 dnolen: ibdknox: there are a couple things in there that are really neat but not fully baked - the dispatch thing.

17:52 ibdknox: dnolen: which is awesome, but it's now cljs is in an awkward state

17:52 dnolen: brandel: yes it's meant to be helpful, especially for people new to Clojure

17:52 ibdknox: -it's

17:52 Raynes: That sentence is in an awkward state.

17:52 dnolen: ibdknox: ?

17:52 brandel: honestly I found getting started with clojurescript a bit daunting when it was released initially

17:52 ibdknox: brandel: definitely

17:52 Raynes: Well, it was never really 'released'.

17:52 dnolen: brandel: yup

17:53 Raynes: Which is the source of all the problems in the universe.

17:53 ibdknox: a simple release + a lein plugin would've addressed that

17:53 brandel: well, when I first came across it months ago I should say then

17:53 Raynes: Hunger, poverty -- it's all caused by lack of a release.

17:53 emezeske: I'm trying to make up for things with lein-cljsbuild :)

17:53 * technomancy just implemented plugins in lein 2 yesterday and I'm already tired of lein1-style plugins.

17:53 Raynes: Even a superalphalphabetaomega-0.0.0.0001

17:54 technomancy: oops; pronoun fail.

17:54 brandel: I love how easy it is to test serverside and clientside code and to develop using the repl - it's so different from the way I've worked with js/java etc in the past

17:54 * technomancy flees the /me police

17:54 technomancy: (ZUM)

17:55 Raynes: technomancy: How are we doing on existing lein tasks in 2.0? Maintaining lein-newnew is daunting.

17:55 TimMc: weeEEEOOOoooo

17:55 lazybot: Can you describe the culprit??

17:55 lazybot: TimMc: Uh, no. Why would you even ask?

17:55 Raynes: Sublime Text 2's multi-select only goes so far!

17:56 ibdknox: dnolen: cljs one just told people how they should do CLJS, and how we're supposed to do it is download a sample app the has the underpinning of a new library in it that isn't fully baked

17:56 dnolen: it sets convention

17:56 technomancy: Raynes: what about making lein 2 just depend on lein-newnew?

17:57 single canonical source

17:57 Raynes: Man. You're so fickle about dependencies that I never know anymore.

17:57 Vinzent: Hello, I need to connect logic programmning engine with a database. I'm a complete noob in logic programming and all that stuff. Where should I start? How can I use core.logic with relational database? Or I don't need relational database at all?

17:57 JohnnyL: there an option to create the jquery at the server in clojure and then push it to the client? is there a name for this?

17:57 dnolen: ibdknox: if alpha software sets a convention sure. in any case I think CLJS1, and noir+pinot are all part of growing ecosystem - I'm not too worried about it.

17:58 Vinzent: you might want to look at this, http://tsdh.wordpress.com/2012/01/06/using-clojures-core-logic-with-custom-data-structures/

17:58 ibdknox: yeah, pinot needs to change a lot

18:00 Vinzent: dnolen, thanks, I'll check it out...

18:01 dnolen: ibdknox: exciting times IMO, will be cool to see where this stuff is by the next Conj

18:01 ibdknox: dnolen: definitely. I'm doing a big project in CLJS

18:01 seancorfield: as opposed to by the next Clojure conference (which is March) :)

18:01 ibdknox: seancorfield: I'll have very cool stuff to show by then too :)

18:02 seancorfield: with ClojureScript:One using Enlive, i'm looking forward to seeing what I can learn from it and apply to FW/1...

18:02 Domina... rings a bell... who wrote that library?

18:03 ibdknox: lukevanderhart

18:03 seancorfield: ah, right...

18:04 he's doing a talk on it at West...

18:04 ibdknox: yessir

18:04 seancorfield: i was surprised there wasn't a pinot or noir or korma talk on the schedule

18:04 but i guess you're doing back to back web training beforehand and covering them all there?

18:05 ibdknox: seancorfield: I pitched a different talk, but it didn't fit in really

18:05 franks: technomancy: trying to built the plugin inside of my cljsh project, but get "Could not locate leiningen/core...", even though i do not have a leiningen/core.clj - is it an issue to have src/cljsh/core.clj for a main "cljsh" project with a src/leiningen/cljsh.clj for the plugin inside that one project?

18:05 technomancy: "could not locate leiningen/core.clj" sounds like maybe you are using lein2 by accident?

18:06 the files you mention should not interfere with anything

18:06 ibdknox: seancorfield: I'm sure there will be time to introduce some of them in lightning talks, but honestly, I think we'll see my time is better spent working on my secret project right now :)

18:06 seancorfield: lol... ok...

18:06 ibdknox: hint: people will have a very fun and interesting way to learn Clojure

18:07 * technomancy grins

18:07 Raynes: I've seen his secret project!

18:07 * Raynes looks down smugly upon the less privileged.

18:08 ibdknox: lol

18:09 seancorfield: it's using a lot of CLJS too, so I have some cool things coming out of that, which will be useful to folks

18:14 ritre: Can someone explain this: https://gist.github.com/1590801 to me? Why the first implementation gives stack overflow, and the second does not? The function should sum prime numbers less than n.

18:15 franks: technomancy: using lein 1.7 or 1.6.2... but i'm referring to vars in leiningen.cljsh in the project file and am using :project-init (require 'leiningen.cljsh) to force a load - could that have an effect?

18:15 technomancy: project-init... did I add that?

18:16 huh; apparently it exists

18:16 TimMc: haha

18:16 technomancy: franks: are you trying to load leiningen code inside a non-plugin project?

18:17 amalloy: $google stackoverflow dbyrne primes sieve

18:17 lazybot: [recursion - Recursive function causing a stack overflow - Stack ...] http://stackoverflow.com/questions/2946764/recursive-function-causing-a-stack-overflow

18:17 amalloy: ritre: ^

18:18 TimMc: oho

18:18 franks: technomancy: i'm trying to refer to my plugin vars from inside of the project.clj to set :repl-options...

18:18 ritre: amalloy: thanks

18:19 technomancy: franks: project-init runs inside the project's process itself

18:19 TimMc: hmm, gist doesn't have diffs?

18:19 franks: technomancy: before i did the same with vars that were part of my normal project files/ns, and only could make this work by requiring the var's namespace

18:20 amalloy: TimMc: none that i could find. you can clone the repo and run diffs locally, but...

18:20 TimMc: feh

18:22 ritre: Do you see how to fix it?

18:23 ritre: TimMc: I am not sure

18:24 TimMc: ritre: THe problem is that that 'remove is lazy, and with each iteration you are calling remove on the last iteration's remove.

18:25 ritre: and that consumes stack, ok?

18:25 TimMc: You also take one element from the front. To realize that element, n removes have to be asked for their first element if you have looped n times.

18:26 Right. Each remove is calling a remove which is calling a remove...

18:27 What you need to do is realize the entire lazy seq on each iteration. doall is the tool for that.

18:27 ritre: well I got it now, thx!

18:28 I am going to lern more about doall.

18:29 TimMc: ritre: also see dorun, for when you don't want the seq/don't want to hold onto the head

18:30 ritre: TimMc: yes I will

18:32 TimMc: amalloy: I'd seen that before but I hadn't really read it -- that was a bit new to me.

18:34 ritre: TimMc: But I am still curious why adding only 'if' solves the exception.

18:38 amalloy: it just delays the problem, i think

18:40 ritre: amalloy: So if I sum even more numbers I'll get the error again?

18:40 amalloy: probably

18:41 i don't see any reason that this addresses the underlying issue, but i'm not 100% sure that it doesn't

18:41 ritre: Yes, it sounds resonable

19:04 yoklov: is there a difference between (apply vector …) and (vec …)?

19:04 chhildeb: Hi there. Just testing my new IRC client privmsg function from the repl. I sure like Clojure.

19:04 amalloy: one of them has a lot more letters

19:04 yoklov: i know! i like the one with less but wanted to know if i was going to get tripped up by thinking they're the same

19:05 Raynes: Hi there. I recommend an empty channel for IRC testing.

19:05 ibdknox: amalloy: you're all over it today :p

19:05 chhildeb: Sorry, didn't actually think it would work on the first try.

19:05 Raynes: Hahaha

19:05 ibdknox: lol

19:06 chhildeb: I will do that now, please excuse the disturbance.

19:06 yoklov: hahaa

19:06 Raynes: chhildeb: Btw, I have an IRC library for Clojure called Irclj. I'm currently in the middle of a rewrite, but it might be useful to you in its current state.

19:06 https://github.com/Raynes/irclj

19:07 chhildeb: I'm really sorry, but this is my first ever IRC client so I really didn't realise it was that easy.

19:07 ibdknox: chhildeb: no worries

19:07 Raynes: You didn't actually bother anyone.

19:07 It was just a heads up.

19:07 :)

19:09 zzach: While trying to start swank-cdt using lein swank, an error message comes up: ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options. --- Error occurred during initialization of VM --- agent library failed to init: jdwp (using Java 1.6, Clojure 1.3). What has to be changed?

19:10 technomancy: zzach: I don't think anyone here understands how cdt works; you might need to try the mailing list.

19:34 lsh: I'm very new lisp/clojure and I'm trying to create a list of all directories and subdirectories using a recursive function but it doesn't appear to be appending to the list I pass down

19:34 http://pastebin.com/wnTaEmmG

19:34 can anyone offer any insight?

19:36 nuts - left out a function: http://pastebin.com/0b7Lg0P6

19:36 technomancy: lsh: you want (if (seq subdirs) [...]) rather than just if subdirs

19:36 the empty list is true

19:36 brehaut: lsh: you dont need to quote a vector literal

19:37 technomancy: also I hate to spoil the fun, but there's a built-in function called file-seq

19:37 lsh: I know, but I want to learn how to use a language

19:38 technomancy: ok, carry on =)

19:38 lsh: originally the function was to recurse through file-seq and build a list of ((parent children) (parent children))

19:38 but I've had to simplify and simplify and I'm still getting an empty result: (() () (()))

19:38 I figure it's something I'm fundamentally 'not getting'

19:39 brehaut: lsh: you probably dont want cons onto vectors eithe

19:39 lsh: cons and conj produce the same result

19:40 a list of empty lists

19:40 brehaut: ,(cons 1 [])

19:40 clojurebot: (1)

19:40 brehaut: ,(conj [] 1)

19:40 clojurebot: [1]

19:40 brehaut: thats two different results

19:40 lsh: I mean in terms of the program, not their use.

19:40 brehaut: it may not be your bug, but what you are doing is weird

19:40 lsh: I want a flattened list from a tree! how is that weird?

19:41 TimMc: lsh: tree-seq

19:41 brehaut: Lsh: consing onto a vector is weird

19:41 lsh: I give up. thanks guys

19:41 brehaut: if you want to flatten a tree, mapcat is your friend

19:41 or tree-seq

19:42 lsh: I'll look at mapcat

19:42 technomancy: it works if you (apply concat (for [...])) and do (if (seq subdirs) [...])

19:43 lsh: thanks, I'll try that

20:26 hah - it turns out a lot of my previous versions of that function were actually correct. I was using load-file to run the file but it was sometimes using a cached version (I guess?) rather than read in the changes

20:33 _carlos_: hi

20:33 I've got this:

20:33 $ lein ring server That's not a task. Use "lein help" to list all tasks.

20:33 was there some change in lein?

20:35 babilen: Hi all -- I am unsure how I can rebind earmuffed/^:dynamic vars in a different namespace. I can naturally change the current namespace and (def ^:dynamic foo new-val), but I am definitely missing something here. Any good resources/documentation about this?

20:37 alandipert: babilen, you can use/require them into your ns as with any var

20:38 babilen: _carlos_: Did you install the lein-ring plugin? (lein plugin install lein-ring 0.5.4)

20:39 _carlos_: babilen: no, I just put lein-ring in :dependencies. I guess that is the problem

20:40 babilen: so lein-ring is useless in that place right?

20:40 babilen: _carlos_: Please note that "lein plugin install ..." installs the plugin globally and not specifically for your project. You can also add it to dev-dependencies and run "lein deps"

20:40 ibdknox: _carlos_: you could put it in dev-dependencies, but it's much better to install plugins at the user level

20:40 babilen: +1

20:41 ibdknox: _carlos_: fwiw, if you're just starting out with web stuff in clojure, it might be worth taking a look at Noir: http://www.webnoir.org

20:41 _carlos_: babilen, ibdknox I undertstand now

20:41 babilen: alandipert: Ok - That might result in some namespace polution in the long run, but I guess it'll do for now.

20:43 _carlos_: ibdknox: I chose compojure for the sake of popularity. Is there better documentation for Noir? would compojure be better for the long run?

20:43 hiredman: alandipert: any news from core-wards regarding http://dev.clojure.org/jira/browse/CLJ-855

20:44 technomancy: hiredman: it's not friday, dude

20:44 ibdknox: _carlos_: I'm not sure that compojure is actually more popular than Noir is now, but I don't have hard evidence

20:45 babilen: alandipert: I already :require the namespace that var belongs to -- So there is no way to reference/rebind it directly but I have to explicitly use it? I am using a library and want to override some defaults

20:45 ibdknox: _carlos_: Noir is built on top of compojure and provides a lot of stuff to help you get started. It's capable of doing everything compojure is at this point.

20:45 _carlos_: and yeah, there's lots more documentation for it

20:46 _carlos_: ibdknox: thanks! I will look into it

20:47 hiredman: alandipert: it would also be great if someone from core could be nudged to comment on http://groups.google.com/group/clojure-dev/browse_thread/thread/dc46c4e80e895dd6?hl=en bug? feature? would a patch be greeted with the traditional indifference or out right hostility?

20:48 alandipert: babilen, peep https://refheap.com/paste/245 for an example

20:49 hiredman: I mean, I know everyone is frolicking through the new and exciting land of javascript developement with macros, but clj-855 could really use some attention, it is a major issue

20:49 alandipert: hiredman, unlike last week tomorrow is not a workday, and i bet it's on someone's agenda

20:49 that said, i'm just the conj guy!

20:50 ibdknox: haha

20:50 babilen: alandipert: yeah, that is exactly what I meant -- I tried this with the difference that I (ns foo (:require [clojure.pprint :as pprint]) and that didn't quite work. I might have made a mistake though -- let me check again and provide a small example if I am able to reproduce it.

20:50 hiredman: well, you do work in much closer proximity to core

20:51 alandipert: hiredman, i'll bring it up

20:51 hiredman: so I would like you to do some head cracking by proxy

20:51 thank you

20:52 alandipert: babilen, you should be able to bind pprint/*thingy* in that case

20:53 ibdknox: alandipert: how's your embedded lisp going? :)

20:54 jsnikeri`: Anyone willing to give me another set of eyes on something? I'm trying to add a pprint-ns function to clojure.pprint, and I think I'm just about there, but I'm having a weird issue that I think is related to dynamic binding. There is a loadable snippet here: https://refheap.com/paste/246

20:54 babilen: alandipert: Ok, that was my intuition as well, but I must have made a mistake then. Thanks a lot!

20:54 technomancy: jsnikeri`: have you talked to replaca?

20:55 alandipert: babilen, np, happy computing

20:55 jsnikeri`: technomancy: is that a person or a function?

20:55 alandipert: ibdknox, it's changing the world

20:55 ibdknox: alandipert: that's what I like to hear :D

20:55 technomancy: jsnikeri`: heh; both! in this case the person.

20:56 jsnikeri`: technomancy: :) I have not. Should I?

20:56 technomancy: jsnikeri`: he did some work on that problem. I should have pointed him to you but I forgot your nick

20:56 in my defense it seems to be a random jumble of vowels and consonants.

20:57 no offense

20:57 jsnikeri`: technomancy: you making fun of my name!

20:57 ;)

20:57 technomancy: =)

21:00 alandipert: ibdknox, also put in an oscon thing for a lisp/arduino tutorial, should be a good time if they accept

21:01 ibdknox: oh sweet

21:01 when is oscon?

21:01 alandipert: june i think

21:01 technomancy: usually late july

21:02 alandipert: oh yeah, july 16th, in portland

21:02 ibdknox: neat :)

21:02 alandipert: far enough away for me to not be concerned about working on uberlisp at the moment

21:02 ibdknox: haha

21:03 well good luck with it

21:03 alandipert: thanks

21:03 hiredman: alandipert: have you seen lively linear lisp?

21:04 lispish thing without gc

21:04 http://www.pipeline.com/~hbaker1/LinearLisp.html

21:04 avi_flax: Hi all, I’m new to Clojure — hopeing someone can help me with something probably dumb… I have an expression: (instance? date-time DateTime) and I'm getting java.lang.ClassCastException: org.joda.time.DateTime cannot be cast to java.lang.Class — I'm baffled.

21:04 hiredman: ,(doc instance?)

21:04 clojurebot: "([c x]); Evaluates x and tests if it is an instance of the class c. Returns true or false"

21:04 avi_flax: ohh

21:04 thanks!!

21:05 alandipert: hiredman, yeah man

21:05 avi_flax: thanks!

21:05 alandipert: hiredman, i wish henry baker was my dad, that guy is so freaking cool

21:06 technomancy: so much suffering could be averted if "Equal Rights for Functional Objects" were required reading for anyone inventing a language.

21:06 hiredman: oh, right, the egal guy

21:06 equality is a hard problem

21:07 babilen: alandipert: yeah, that works -- The only problem I have with that is that I would like to bind it once to the new value and forget about it. The binding approach requires me to wrap every call to a function that uses this var in (binding ..) -- I can give a more specific example if that would help.

21:08 hiredman: babilen: if you want to do that then you are doing something wrong

21:08 technomancy: hiredman: so I've been thinking that if we got knobs in clojure for varying lightness vs dynamicity, we could have serializable-fn as clojure.core/fn, right?

21:08 and then equality on function objects becomes implementable

21:08 but you would get it only when the knob was cranked all the way

21:08 and I don't know how to feel about that

21:08 hiredman: technomancy: well, it (as usual) depends on what you mean by equality

21:09 technomancy: elisp has the same problem; you can compare interpreted lambdas but not byte-compiled ones.

21:09 hiredman: eh? you mean more than just egal?

21:09 hiredman: for example #(% 1) and #(% 1) would never be equal

21:09 technomancy: ??

21:09 lazybot: technomancy: Uh, no. Why would you even ask?

21:09 hiredman: the gensyms would be different

21:10 neither would (fn [x] x) and (fn ([x] x)) etc

21:10 technomancy: well I wouldn't say never; it's not impossible to normalize locals.

21:10 I just said implementable

21:10 babilen: hiredman: I have exactly the same feeling which is why I am asking here. -- Ok, to be more specific: I want to use clucy with a different analyzer (cf. https://github.com/weavejester/clucy/blob/master/src/clucy/core.clj) -- That requires me to bind *analyzer* to something else, but I don't want to do this whenever I call any of the functions that use *analyzer*

21:12 hiredman: babilen: if you are running that with clojure 1.3 (and with your reference to ^:dynamic above I will assume you are) you will have more problems

21:12 *analyzer* is not declared as dynamic there

21:13 alandipert: technomancy, i quest for the lisp subset that is confluent and gives me a Real eq: http://en.wikipedia.org/wiki/Confluence_(abstract_rewriting)

21:13 babilen: hiredman: I've changed that already -- Just wanted to give a more specific example.

21:14 hiredman: alandipert: well, obiously we'll have to reduce to the λ calculus before we do any heavy lifting, which is great because we'll want that for the optimizing compiler anyway

21:15 technomancy: alandipert: is there much progress in that direction?

21:15 alandipert: hiredman, technomancy, i've let it go because i realized it's probably something dnolen will write eventually

21:15 (or one of his programs will write)

21:16 hiredman: babilen: you might consider generating wrappers that do the binding for you

21:16 babilen: hiredman: I mean if I have to wrap every single call to search/add/... in (binding [clucy/*analyzer* my-analyzer] clucy/search ...) so be it -- I would, however, prefer to set this *once* and be done with it. I apologise for still trying to wrap my head around this, but I hope you understand what I am trying to do.

21:16 hiredman: that take the analyzer as an argument

21:18 (def my-analyzer ...) (for [[v n] (ns-publucs clucy)] (intern n (fn [args] (binding [*analyzer* my-analyzer] (apply @v args))))) or something

21:18 (better yet use a macro to generate proper defns)

21:19 or even just run the code to generate the datastructures of the defns and copy and paste them in a file

21:19 babilen: hiredman: Ok -- That means that I have to manage an analyzer in every namespace in which I am using clucy wouldn't it?

21:19 hiredman: no

21:20 babilen: ah, I get what you mean now -- I essentially have foo.my-clucy which I use and that handles all new bindings that I might have to override

21:22 hiredman: cemerick had some kind of config idea about generating namespaces full of partially applied functions

21:25 babilen: To elaborate: Right now I see *analyzer* et al. as easy ways to change the default behaviour of a library. The problem is that I have to make sure that the same (in terms of behaviour) analyzer is used whenever I call *any* of the functions that use *analyzer*. I naïvely expected to be able to do something like (rebind clucy/*analyzer* new-value) *once* (in particular when parsing command line options) and don't care about it afterwards.

21:26 hiredman: babilen: but you can do that

21:26 babilen: how?

21:26 clojurebot: with style and grace

21:26 hiredman: ~botsnack

21:26 babilen: indeed :)

21:26 clojurebot: Thanks! Can I have chocolate next time

21:27 brehaut: hiredman: is http://cemerick.com/2011/10/17/a-la-carte-configuration-in-clojure-apis/ the thing you are thinking of?

21:27 hiredman: (binding [*analyzer* ...] (do-stuff)) in you entry function will take care of it, unless you running multiple threads, and even then in many cases with clojure 1.3 it will work

21:28 bindings are dynamic and threadlocal

21:28 dynamic as opposed to lexical (or static) and threadlocal (with some special cases) as opposed to globally visible

21:29 brehaut: yes

21:30 babilen: brehaut: Ah, great. I've stumbled over that some time ago, but I guess it is time to read it again.

21:30 brehaut: theres a heap of great discussion in the comments there

21:30 hiredman: meh

21:32 alandipert: i'm outta here chaps, g'night

21:32 oh btw, everybody's cool with conj in vegas this year?

21:33 technomancy: hah

21:33 brehaut: alandipert: im not

21:33 needs to be somewhere more southern

21:35 babilen: hiredman: Ok, thanks for the pointers and discussion -- I see much clearer now and am sincerely grateful for that.

21:35 brehaut: Thank you too for bringing that post to my attention again.

21:47 wall: hello

21:47 cmwelsh: hey there wall

21:47 wall: can anybody help me with fnparser?

21:47 brehaut: do you mean joshua choi's fnparse ?

21:48 ~anyone

21:48 wall: yes

21:48 clojurebot: Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."

21:49 brehaut: wall: just ask. there are people here who have used fnparse

21:49 wall: please see http://pastebin.com/1cpr13RZ

21:50 this code must parse 3 token "false" "true" and space

21:51 but then i call (parse "false true") i'm get java.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.CharSequence

21:51 [Thrown class java.lang.RuntimeException]

21:51 why?

21:51 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack>

21:51 brehaut: because a string is a seq of characters

21:51 regexps match strings

21:51 and the :remainder in fnparse is expected to already be tokenized

21:52 wall: oh...

21:52 i must write own lexer for fnparse?

21:52 brehaut: not necessarily

21:53 hiredman: there is some thing for matching strings I think

21:53 https://github.com/hiredman/Howler/blob/master/src/Howler/parser.clj

21:54 brehaut: wall, for your program (re-seq #"\w+" input) is all the lexer you need

21:55 wall, otherwise hiredmans example of using a conc of lit's is what you probably want

21:56 hiredman: https://github.com/hiredman/clojurebot/blob/master/src/hiredman/clojurebot/factoids.clj even worse

21:56 brehaut: ,*clojure-version*

21:56 clojurebot: {:major 1, :minor 3, :incremental 0, :qualifier nil}

21:57 TimMc: brehaut: Both bots are these days.

21:57 brehaut: TimMc: yeah, i wasnt aware that anyone had ported fnparse to 1.3

21:57 * brehaut is behind the times

21:58 hiredman: clojurebot uses a classloader to run 1.3 in the same jvm as 1.2

21:58 TimMc: brehaut: I thought you were in the future!

21:58 hiredman: so clojurebot is still 1.2

21:58 jsnikeri`: How does one decide whether to use (bindings ...) or (with-bindings ...) in a given situation?

21:58 brehaut: TimMc: i am!

21:58 hiredman: never use with-bindings

21:58 TimMc: brehaut: The *sandboxes* are 1.3.

21:58 hiredman: (unless you really really want to)

21:59 brehaut: hiredman, TimMc: huh. thats very clever

21:59 wall: another bot with an fnparse parser: https://github.com/brehaut/burningbot/blob/master/src/burningbot/logging.clj

21:59 wall: thanks

22:00 but another question

22:00 brehaut: wall, and the tutorial you are reading is serious about not using run-p for a real project (when you get to that). its just a tool to make repl exploration easier

22:00 wall: yes, i mean it

22:00 sory my bad english

22:01 another quiestion, i want to do own interpreter of small subset basic

22:01 jsnikeri`: can you declare two bindings within the same binding form: (binding [*vector-newline-style* :fill *list-newline-style* :fill] ...)

22:01 wall: may be exists projecst what be like?

22:03 brehaut: wall, in clojure?

22:03 wall: yes

22:04 TimMc: wall: You are trying to write a BASIC interpreter?

22:04 wall: yes

22:04 brehaut: how specific do you mean? there are compilers and interpreters of various sorts in clojure yes. i dont think ive specifically seen a basic interp though

22:05 wall: i want anything like (basic "let x = 1; let y=2; print x+y") and at result see number 3 in REPL

22:07 brehaut: wall, how much do you know about simple interpreters?

22:07 TimMc: ,(binding [*print-readably* 'foo *print-meta* 8] [*print-readably* *print-meta*]) ; jsnikeri`

22:07 clojurebot: [foo 8]

22:09 wall: yes i want write simple interpreter

22:09 jsnikeri`: TimMc: thanks

22:16 babilen: One more question regarding dynamic vars that are used for configuration -- Assume I am writing a library that makes use of yet another library. The latter uses dynamic variables for configuration, but I don't want to expose that implementation detail to users of my (the former) library. How could this be done? What are good approaches?

22:19 tmciver_: babilen: couldn't you just make them private vars?

22:24 babilen: tmciver_: I don't quite follow -- The situation is this: I write a library foo that uses another library bar. bar has (def ^:dynamic *setting1* true) but users of my library might want the behaviour of bar when bar/*setting1* is false -- I do, however don't want to force them to know/care about me using bar at all, let alone force them to wrap calls to my library in (binding [...] foo/great-function-that-calls-a-f-in-bar) for every conceivable ...

22:24 ... third-party lib bar' that I might use.

22:28 I guess that *I* have to make sure that every call to bar is wrapped in a suitable (binding [...] ...) and maintain and expose my own set of dynamically rebindable *configuration-vars*

22:30 tmciver_: babilen: I see. It's not that you don't want to expose them, it's the burden on users of the lib.

22:31 babilen: yeah, but that unnecessarily forces them to care about me using specific libraries -- It also means that they have to change a lot of code when I decide not to use bar any longer, but switch to quux

22:33 * babilen is sure that he is still missing an important part of the picture

22:34 tmciver_: babilen: so am I. sorry I can't help.

22:35 babilen: No problem - Others might. :)

22:39 tomoj: anybody playing with cljque? is #'attend broken on master, or do I just not understand it?

23:16 Frank__: hey

23:16 WorldOfWarcraft: hi Frank

23:17 so my question is if I want to create the Fibonnacci sequence how would i go about doing that?

23:17 Frank__: Well, it's quite simple

23:17 all you have to do

23:17 is

23:18 to make a program

23:18 WorldOfWarcraft: oh sweet

23:18 thanks i got it

23:18 Frank__: i got another question

23:18 i mean a question

23:19 what exactly is the nature of "loop?"

23:19 WorldOfWarcraft: oh well u see a loop is something that holds values

23:19 for instance (1 2 3) is a loop

23:19 Frank__: oh

23:19 i see

23:19 so in order to make a loop,

23:19 what would you need to do?

23:20 WorldOfWarcraft: to make a loop type in make (loop)

23:20 Frank__: umm

23:20 that's kinda a problem for me

23:20 alexbaranosky: where am I? is the #clojure?

23:20 Frank__: my keyboard is broken

23:20 yes

23:20 WorldOfWarcraft: yes this is clojure

23:20 im teaching Frank about loops

23:20 alexbaranosky: ok, was pinching self

23:21 WorldOfWarcraft: he should use the command make (loop)

23:21 alexbaranosky: WorldOfWarcraft, ahhhh

23:21 Frank__: what is "command?"

23:21 WorldOfWarcraft: a command is something called a string

23:21 it is a word

23:21 Frank__: wait, what?

23:22 alexbaranosky: "this is a string"

23:22 WorldOfWarcraft: what is your question, as you know i am a pro at clojure

23:22 Frank__: i don't understand

23:22 please assist

23:22 WorldOfWarcraft: so to create a string type in makestring "string"

23:22 Frank__: so then what?

23:22 how do i get from a string to a loop?

23:23 do i need to know how to knot?

23:23 is there such thing as a "knot?"

23:23 WorldOfWarcraft: yes how can you make a loop without a knot?

23:23 alexbaranosky: rlol

23:23 Frank__: well, is "knot" command also a loopp?

23:23 WorldOfWarcraft: i believe u mean rofl

23:23 Frank__: ?

23:24 is this funny to you?

23:24 WorldOfWarcraft: and did u know if u type in rofl in clojure it displays a large man laughing

23:24 Frank__: rofl

23:24 you lied

23:24 okay

23:24 WorldOfWarcraft: no no open boxclojure

23:24 Frank__: this is serious

23:24 i need to learn how to program

23:24 alexbaranosky: everything he says is a lie pretty much

23:24 Frank__: really...

23:24 WorldOfWarcraft: what r u talking about

23:24 Frank__: so there is no "knot?"

23:25 alexbaranosky: its like listening to an insane programmer

23:25 Frank__: or "yarn?"

23:25 WorldOfWarcraft: no there is not a "knot" lol

23:25 alexbaranosky: definitely not

23:25 WorldOfWarcraft: but there is yarn

23:25 alexbaranosky: seriously, stop listening to this nutter

23:25 Frank__: is that like a whole of "string?"

23:25 WorldOfWarcraft: yes you create a yarn by looping string

23:25 alexbaranosky: this is too much

23:26 Frank__: so "yarn" effectively hold a lot of data?

23:26 wait

23:26 WorldOfWarcraft: no no

23:26 Frank__: he's lying right?

23:26 WorldOfWarcraft: u see "yarn" holds strings of data

23:26 Frank__: i thought that you said that "loops" held data

23:26 WorldOfWarcraft: yes that is correct

23:26 ivan: Frank__: yeah. you might want to avoid talking to crazy.

23:26 WorldOfWarcraft: however a yarn is slightly different

23:27 alexbaranosky: unless Frank__ is in on the fun

23:27 Frank__: what?

23:27 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack>

23:27 WorldOfWarcraft: what

23:27 WHAT!!!

23:27 * ivan did suspect a two-man troll job

23:27 Frank__: can you help me than?

23:27 WorldOfWarcraft: omg what r u talking about

23:27 troll?

23:27 what is a troll?

23:27 Frank__: is he serious?

23:27 WorldOfWarcraft: im innocent of trolling

23:27 i mean...i dont know what a troll is

23:28 ivan: Frank__: no. and most of the time this channel is pretty sane.

23:28 WorldOfWarcraft: im being called insane :(

23:28 Frank__: dude... i really don't like it when i am in need of help from people, and i just meet trolls that i then believe because of my inexperience

23:28 WorldOfWarcraft: thats it im gonna rage quit

23:28 Frank__: wait.. but i need help

23:29 WorldOfWarcraft: my death knight crits 20k damage

23:29 ivan: Frank__: do you know how to program in any other languages?

23:29 WorldOfWarcraft: yes

23:29 alexbaranosky: this is the mot insane moment I've seen on here

23:29 Frank__: other than what?

23:29 there's more than english?

23:29 ivan: programming languages

23:29 alexbaranosky: see? two man troll

23:29 ivan: yeah.

23:29 Frank__: wait

23:29 WorldOfWarcraft: wait what is a programming language?

23:29 alexbaranosky: they're an act

23:29 Frank__: i'm new to programming

23:29 WorldOfWarcraft: clojure is slang english i thought

23:30 Frank__: so mr.WoW doesn't know how to program?

23:30 WorldOfWarcraft: program? whats a program?

23:30 Frank__: ...

23:30 i thought i could get help here

23:30 ivan: well, Frank__ is connecting from Illinois Mathematics and Science Academy

23:30 WorldOfWarcraft: i thought we were learning clojure not programming

23:30 alexbaranosky: dude's spinning you a yarn :)

23:30 ivan: WorldOfWarcraft from who knows where

23:31 Frank__: i need to learn how to program for school

23:31 alexbaranosky: well #clojure is the place for help with clojure

23:31 Frank__: what's clojure?

23:31 WorldOfWarcraft: ok enough trolling...that was fun thx guys

23:31 Frank__: i needed help and they told me to come here

23:31 alexbaranosky: yep, adios

23:31 WorldOfWarcraft: i actually do know clojure and Frank__ is my helper in crime

23:32 Frank__: what?

23:32 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack>

23:32 Frank__: DUDE

23:32 alexbaranosky: figures

23:32 WorldOfWarcraft: it was fun yes?

23:32 Frank__: I WAS LIED TO

23:32 alexbaranosky: an interesting diversion

23:32 WorldOfWarcraft: lol gg back to my raid

23:32 alexbaranosky: I need a better bs detector

23:32 Frank__: so clojure is a language in programming?

23:32 like java

23:32 ?

23:33 WorldOfWarcraft: no java is coffee

23:33 Frank__: ...

23:33 you troll

23:33 WorldOfWarcraft: Frank__ i luv u

23:33 Frank__: i'm sorry... i can't say the same to you because you lied to me so much

23:34 jcromartie: is WorldOfWarcraft a new bot?

23:34 WorldOfWarcraft: no im not a bot lol

23:34 oh dang it i should have said i was

23:34 jcromartie: so, slightly OT: has anybody here read "Code" by Charles Petzold?

23:34 Frank__: are bots programs?

23:35 WorldOfWarcraft: no what is it?

23:35 Frank__: how can i make one?

23:35 jcromartie: it's a pretty good introduction to digital logic circuits and computer architecture

23:35 WorldOfWarcraft: cool

23:35 ill look it up

23:35 Frank__: what?

23:35 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack>

23:35 Frank__: digital logic?

23:35 jcromartie: like, I went from nothing to understanding latches, flip-flops, RAM, program counters, Von Neumann machines, etc., in about 200 pages

23:35 Frank__: what's that...

23:36 ivan: Frank__: Wikipedia knows things

23:36 Frank__: was wikipedia made in clojure?

23:36 ivan: no

23:36 WorldOfWarcraft: how long did it take u to read

23:36 jcromartie: oh I see what's going on here

23:36 WorldOfWarcraft: hmm?

23:38 PEACE!!!!!!

23:38 Frank__: ?

23:39 wiat.. then whose gonna help

23:39 aaelony: has anyone here gone through clojure script one yet? https://github.com/brentonashworth/one/wiki/Getting-started states (js/alert "hello") but I am unclear where "js" gets defined or imported from

23:43 amalloy: jcromartie: yeah, Code is a good book. i read it in high school, or thereabouts

23:43 jcromartie: amalloy: you make me feel old

23:44 (me being the ripe old age of 28… and feeling rather unaccomplished)

23:44 amalloy: i'm only 26, bro

23:45 jcromartie: :P OK

23:45 http://upload.wikimedia.org/wikipedia/commons/0/02/80486dx2-large.jpg

Logging service provided by n01se.net