#clojure logs

2012-01-12

00:00jyaanmaybe a quote missing or something, idk
00:00bbhossthat's the whole file
00:00jyaanjust teh add-to-list??
00:00lazybotjyaan: What are you, crazy? Of course not!
00:03jyaanon github you just posted the error
00:04bbhossjyaan: on github format: https://gist.github.com/6c67774920f6c1367d58
00:10bbhossany idea jyaan?
00:18jyaanok let's see
00:18jyaansorry i'm trying to help my brother install his wifi too haha
00:18bbhosshaha np jyaan
00:19jyaani don't understand it
00:20jyaanwell basically what Emacs is saying is that package-archives is unbound
00:20jyaanbut you're using emacs 24 which has package.el included right
00:20tmciverbbhoss: do you have the package initialization stuff before the 'add-to-list' line?
00:20jyaanmy only guess is to add (require 'package)
00:20bbhossyeah this is emacs 24, package stuff should be included already I think
00:20jyaanbut i thought it was already part of it
00:21jyaanyea exactly
00:21bbhossso no tmciver, I don't have anything other than that in there
00:21jyaanare you sure you have emacs 24??
00:21lazybotjyaan: What are you, crazy? Of course not!
00:21jyaanugh i hate that bot, always does that to me
00:21bbhossthat fixed it
00:21tmciverbbhoss: the begining of my .emacs looks like this: https://gist.github.com/1598928
00:21tmciverbbhoss: that's before the marmalade stuff
00:21bbhossThis is GNU Emacs 24.0.91.1 (x86_64-apple-darwin, NS apple-appkit-1038.36) of 2011-11-20 on bob.porkrind.org
00:22jyaanthat's probably what you need
00:22jyaani don't use package.el so i wouldn't know
00:22tmciverthat would explain the void package-archives var.
00:23jyaanmakes sens, package.el probably depends on something else in emacs so they amke you call an init function explicitly to avoid problems
00:57scottjclojurescript libs and messages on ml have really picked up in the last month
00:59y3diwhats ml?
01:00scottjmailing list
01:00jyaan??
01:00lazybotjyaan: What are you, crazy? Of course not!
01:00jyaanyea thought it would do that
01:00jyaannight
01:45tadri was expecting 10, 11 tops, people in here
01:45tadrwas i wrong
01:46bartjtadr, the Clojure IRC is very active
01:46RaynesHeh.
01:46RaynesI'm not sure why you'd assume such low popularity.
01:46tadri must be clojist
01:46tadrso, i'm trying to fill in the gaping holes of my java/jvm knowledge as related to clojure
01:46bartjRaynes, Try hanging out at machine-learning, nlp etc
01:47RaynesBut this is neither of those things.
01:47Raynes:p
01:47tadrany one have a book title for me?
01:47RaynesPractical Clojure is one. The Joy of Clojure is a more in-depth and less beginnerish book.
01:48RaynesClojure Programming is coming out soon.
01:48RaynesI'm writing a book, but that one is going to take a while.
01:48tadrso those books cover some java api as well as clojure?
01:50RaynesWell, 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.
01:52tadri think i'm going with the manning MEAP on well-grounded java, and then... dunno
02:26technomancy_brehaut: did I see that you are dispensing Emacs advice now? what happened?
02:27Raynestechnomancy_: You!
02:28technomancy_Raynes: impossible; I only tell people not to use emacs.
02:28Raynestechnomancy_: Did you ever get to try out the refheap elisp? I might force it down your throat.
02:29technomancy_I've been partying basically all day; give me a break
02:29RaynesHah, for three days?
02:29RaynesI think it was like three days ago that you said you were going to look at it. :p
02:29bbhossI 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
02:30technomancy_well yesterday was traveling and adding Leiningen to the nix package manager
02:30Raynestechnomancy_: Dude! I'm totally installing nix like right now.
02:30Raynes:D
02:30technomancy_it's basically super mega bonusrad.
02:30brainproxyrecommendations for an academic paper, or something write-up, which explores relationship between RESTful concepts and functional programming?
02:31brainproxys/something/some kind of/
02:32technomancy_I'm working on adapting emacs 24 to nix, but makefiles. =(
02:33Raynestechnomancy_: wut
02:33Raynestechnomancy_: No Emacs on nix? :'(
02:33technomancy_no 24 yet
02:33RaynesWork harder.
02:34RaynesI 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.
02:34technomancy_http://article.gmane.org/gmane.linux.distributions.nixos/7363
02:34Rayneshttps://github.com/mattn/gist-vim/blob/master/autoload/gist.vim#L188
02:34RaynesI thought Emacs's URL package was primitive. This thing is over 1000 lines.
02:34technomancy_what is this i don't even
02:36technomancy_I remember reading about a bug in vimscript where the if and else branches in conditionals got swapped.
02:36technomancy_or something equally outrageous; I wish I could find the link
02:37RaynesI think I'll write a plugin for Sublime Text 2 instead. At least Python knows the order of if and else branches.
02:38technomancy_is that new in python 3?
02:38Raynes~rimshot
02:38clojurebotBadum, *tish*
02:39Raynestechnomancy_: Gonna run nix in virtualbox with xmonad and pretend OS X isn't installed.
02:40technomancy_taste demands no less.
02:43technomancy_Raynes: nixos or nix on another OS?
02:44Raynestechnomancy_: nixos
02:44technomancy_hardcore
03:06devnhmph
03:08devnpeople (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.
03:08devns/needs/need/
03:36lpetitmorning
03:42angermang'morning :)
03:45brehauttechnomancy_: sort of!
03:46brehauttechnomancy_: although only of the simplest kind
04:16kraldevn: I agree with you
05:27fhdWhere can I find clojure.contrib.string in the new modularised clojure-contrib?
05:31raekfhd: it's included in clojure itself since 1.2: clojure.string
05:33fhdraek: Ah, thanks :)
05:34fhdraek: Have been using it from clojure-contrib all this time although I was on 1.2
05:40adiabaticI'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?
05:52lpetitadiabatic: :when skips, :while stops
05:52adiabaticah, thanks!
05:52lpetit,(for [x [1 2 3] :when (even? x)] x)
05:52clojurebot(2)
05:52lpetit,(for [x [1 2 3 4] :when (even? x)] x)
05:52clojurebot(2 4)
05:53lpetit,(for [x [1 2 3 4] :while (odd? x)] x)
05:53clojurebot(1)
05:53lpetit,(for [x [1 2 3 4] :when (odd? x)] x)
05:53clojurebot(1 3)
05:53adiabaticWhat sort of background would you need for this to be obvious?
05:54lpetit,(for [x [1 2 3 4] :when (odd? x) y [2 3 4 5] :when (even? y) ] (x y))
05:54clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
05:54lpetit,(for [x [1 2 3 4] :when (odd? x) y [2 3 4 5] :when (even? y) ] [x y])
05:54clojurebot([1 2] [1 4] [3 2] [3 4])
05:54adiabaticBe familiar with a language that has dropwhile in it?
05:54lpetit,(doc for)
05:54clojurebot"([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 ...], ...
05:55adiabaticyeah, (doc for) just has ":while test, :when test"
05:56lpetitadiabatic: dunno. It's right that the doc is not explicit about it.
05:56lpetit,(for [x [1 2 3 4] :when (odd? x) y [2 3 4 5] :while (even? y) ] [x y])
05:56clojurebot([1 2] [3 2])
05:57lpetitadiabatic: I should have written :when keeps, not :when skips
05:58adiabaticer, right
06:02adiabaticbedtime here. thanks!
09:22tsdhraek: Do you remember our discussion from yesterday?
09:23tsdhraek: It turned out that calling java methods using Reflector + try/catch is twice as fast as searching the matching method using reflection from clojure.
09:26raekok
09:27tsdhraek: And its twice as fast in both cases: calling existing methods and calling non-existing methods catching the exceptions.
09:50babilenHi 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)
09:52babilenI 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?
09:52joegalloi think you want lazy-seq, brother
09:56joegallohere's how i did the same thing (roughly) once: https://gist.github.com/44c5f71da6aa3b5383c8
09:58tsdhjoegallo: fn is still not concise enough. :-)
09:59joegallooh, 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:00babilenjoegallo: 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:00joegalloI can't -- it's just some support code for some stuff I happened to do once, not really a library.
10:00babilenjoegallo: 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:00joegalloBut, you should totally check out drewr's esperanto. https://github.com/drewr/esperanto/blob/master/src/esperanto/lucene.clj
10:01joegallohis token-seq uses lazy-seq, too
10:01joegalloso that's a good example as well
10:02babilenjoegallo: 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:03wastrelesperanto what now?
10:04babilenjoegallo: Thanks for the pointers and may you have a nice day
10:05joegalloyou're quite welcome, best of luck with your stuff
10:51nerdfunkhi there
10:54nerdfunkI'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:58jamiltronThe first thing that sticks out is that first recur to compr "(compr (rest i))" should be (recur (rest i)).
10:59TimMcnerdfunk: You're gonna kick yourself when you see other people's solutions.
10:59jamiltronTimMc: I kick myself everytime I see anyone elses solution to any problem :P
11:00nerdfunkhaha
11:00nerdfunkindeed, self kicking is part of the game
11:02Fossii feel like those are sometimes more about library knowledge than "real" programming
11:03Fossiwhich is fine, but doesn't make me wanna start doing them
11:03nerdfunkIt's only an early problem
11:03jamiltronLibrary usage is real programming, though.
11:04nerdfunkand I wanted to solve it in a more basic way . . than simply finding the "remove duplicates" method
11:04Fossisame goes for "mathy" problems
11:04jamiltronI 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:05Fossiyeah, it's nice to get to know all the tools in the toolbox
11:05Fossiand they will *really* help you as well
11:05Fossibut to me it feels kinda tedious
11:05Fossiand sometimes overly clever
11:06Fossias i didn't do them yet, i don't know the question, but on one of them the "best" answer is (into [])
11:06Fossifrom what i got here
11:07nerdfunkhmm.. recursion just isnt clicking tonight haha
11:07nerdfunkI guess I need to add more scaffolding to keep the already looked at letters . .
11:07jamiltronnerdfunk: You can do this without recursion using sequencing functions.
11:10nerdfunkOK.. I'll look into it..
11:15jamiltronSo 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:18nerdfunkwell.. get first char, while subsequent equal first move to the next until next doesnt exist
11:19jamiltronGiven 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:20jodarowhich problem is this?
11:20jamiltronSo 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:21jamiltronjodaro: Compress a Sequence (http://www.4clojure.com/problem/30)
11:21jodarook
11:21nerdfunkmap first ?
11:22jamiltronnerdfunk: Exactly. And the beautiful thing about map first is that it will work on sequences with only 1 value, as well.
11:22nerdfunkhmm.
11:23nerdfunkI guess I need to learn how to break apart sequences into duplicates then.
11:24jamiltronRight. 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:24kralnerdfunk: can't you use a set?
11:24nerdfunkThat's OK, I'll try first and then come back when I'm stuck
11:25jamiltronkral: A set wouldn't work for this problem. You're only removing consecutive duplicates, not all of them.
11:26kraljamiltron: oh, i see
11:28jamiltronSo what's the defacto pattern-matching library for Clojure these days?
11:30jamiltroncore.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:33jodaroheh
11:33jodarothe first case is easy with frequencies
11:33jodarobreaks down for the rest, though
11:34lnostdal,(doseq [i (range 2)] (future (defonce -jarra- (println "blah"))))
11:34clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
11:35lnostdalok, well .. anyway .. defonce seems racy
11:35lnostdalin some cases i see "blah" outputted twice here
11:35jodarojava.lang.SpellingException: SANBOX or SANDBOX?
11:35lnostdal( this is a recent 1.4.x from git )
11:42nerdfunkwell.. 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:50VinzentHi, 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:50adamspghVinzent: did you do "script/deps" first?
11:50VinzentOk, this is already on the issue list: https://github.com/brentonashworth/one/issues/58
11:50Vinzentadamspgh, yes
11:53Vinzentlooks like the problem is that I haven't curl installed
12:08timvisheranyone interested in helping me debug my leiningen proxy settings?
12:21jfieldsIf 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:22jfieldsI need Foo so I can (extend-protocol APro Foo (a-meth []))
12:22Vinzentjfields, why import a_a? you can require it as a normal clojure ns
12:22jfieldsVinzent, I tried that and I get Unable to resolve symbol: Foo in this context
12:23dnolenjfields: I think that's the only way
12:23Vinzentjfields, you still need to import Foo
12:23jfieldsif 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:24Vinzentjfields, you need require the namespace and import the record class in order to reference it as a Foo
12:25jfieldsright, 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:25jamiltronHow comparable is core.match's pattern matching to that of Ocaml or SML?
12:27Vinzentjfields, hm, this happens even after recompiling (e.g. C-c C-k) both files?
12:28jfieldsVinzent, I'm doing a ton of java interop so I'm stuck in IntelliJ. :\ that's probably the root of my problem. :)
12:29jfieldsVinzent, I am doing a load-file on both files, and that seems to get things out of sync
12:30jfieldsVinzent, 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:37dnolenjamiltron: it's pretty similar tho more flexible - you can extend it and there are no constraints about what types appear.
12:38jamiltrondnolen: Can you place type constraints using core.match?
12:39Vinzentjfields, 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:39dnolenjamiltron: like matching on a class / interface / deftype / protocol ?
12:39jamiltrondnolen: Yes :)
12:40dnolenjamiltron: not yet, it's on the todo list
12:43jamiltrondnolen: 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:44dnolenjamiltron: Types And Programming Languages?
12:44jamiltrondnolen: Yes, the Orange Book.
12:45dnolenjamiltron: Ocaml seems worthy of study. I've only played with Standard ML which is pretty cool.
12:46jamiltrondnolen: 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:48jfieldsVinzent, no problem, thanks for the help anyway
13:06wiseenis 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:08ben_mwiseen, yes, there is, I'm trying to find what it's called
13:08joegallo(or (some-expression...) the-default)
13:08ben_mIt's a function that takes another function and a default value, and returns a function :S
13:09joegalloworks nicely
13:09wiseenjoegallo, or returns a value and not True/False ?*
13:09joegalloor is the way and the truth and the light
13:09ben_m,(or false 'default)
13:09clojurebotdefault
13:10ben_m,(or 'not-default 'default)
13:10clojurebotnot-default
13:10wiseenjoegallo, the path is clear now that I've seen the light
13:10joegallogo forth and sin no more
13:10ben_mI still want to find that function I had in mind.
13:11TimMcben_m: fnil ?
13:11lpetitben_m: it's fnil
13:11TimMcIt takes a default input, actually.
13:11ben_mExactly, thanks.
13:12jodaroseems like fnil is trending higher than juxt these days on the coolest clojure function charts
13:12amalloyBLASHPEMY
13:13amalloymakes me so incensed i can't even spell anymore
13:13jodarois that like SANBOX?
13:13TimMc(juxt (fnil (comp (partial (apply ...) ...) ...) ...) ...)
13:13TimMcfill in the blanks, kids
13:13amalloyyeah, except sanbox is an age-old tradition
13:14ben_m,(doc juxt)
13:14clojurebot"([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:14ben_mNice, reminds me of Factor combinators.
13:14yoklovoh thats cool.
13:14TimMcben_m: amalloy is nuts for juxt.
13:15amalloyi was into fnil before it was cool
13:15ben_mMe too! high-five!
13:18lpetitamalloy: you should start a "I was into fnil before raynes" blog post :-p
13:18lpetitjust kidding
13:19amalloylpetit: well, chouser and technomancy are the ones telling the world how exciting fnil is
13:19amalloyand Raynes so treasures his superior coolness; i couldn't do that to him
13:19lpetitamalloy: oh you refer to some of the previous tweets earlier this day ?
13:20lpetit:)
13:20amalloylpetit: yeah, within the past week or so. i assume that's what jodaro was referring to
13:21lpetitamalloy: ok :)
13:21amalloy(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:21sritchietechnomancy, do you have a guide on how to deploy jars to s3-wagon-private?
13:22lpetitamalloy: fnil saved my life a couple times in the past especially when used with nested update-in calls
13:22amalloyyeah, fnil is great friends with update-in
13:24technomancysritchie: no, once s3-wagon-private is installed, s3p:// repository URLs should function just like any other.
13:25technomancyif it doesn't work out of the box then it's a bug
13:25sritchieI just don't know how to deploy to a maven repo other than clojars using lein
13:26technomancyoh, gotcha. "lein help deploying"
13:27technomancyman... lein 2 is so close to being usable for the basics... nom.
13:27technomancyamalloy: any chance you'd want to port the pom stuff from depot to lein 2?
13:28sritchieah, cool
13:29amalloytechnomancy: what is there to port? depot doesn't depend on cake at all
13:29technomancyamalloy: I guess it's more about making leiningen.pom use depot rather than the other way around?
13:30technomancyamalloy: and also figuring out with cemerick if that functionality belongs in pomegranate?
13:30sritchietechnomancy: it doesn't look like the deploy task does anything: https://github.com/technomancy/leiningen/blob/master/src/leiningen/deploy.clj
13:30sritchieI'm trying to figure out how to push a separate jar up to this bandwagon
13:30technomancysritchie: not on the master branch, no.
13:30technomancytry the stable branch.
13:31amalloytechnomancy: where would i look in the lein source to see where that change belongs?
13:31technomancyamalloy: should just be src/leiningen/pom.clj
13:33jodaroaha!
13:34amalloyugh, 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:35technomancygrumblecakes
13:35technomancywell tomorrow is open source friday, so cross your fingers?
13:36hiredmanI had to figure out how to get clojure-maven-plugin working yesterday
13:36hiredmanthat was bracing
13:37bitpimpgrumblecakes. mmmmm.
13:59zmarilHey in a little bit may I bring some high schoolers and show them #clojure?
14:01amalloyquick, hide the <various illegal/immoral activities>
14:01ben_mWhy would you ask for permission? I could be a high schooler for all you know.
14:01zmarilCause there are 32 of them
14:01TimMchaha
14:01zmarilAnd they can be unruly
14:02ben_mThe horrors
14:02emezeskeI think I might have been in high school once
14:03emezeskeFlash-mobbing #clojure might have been good fun :)
14:14AzumarillALL THE IMSA STUDENTS
14:14akim1hello
14:14mlee1hello
14:14ssomasunhello
14:14tvadakumcheryHello
14:14aschellHI everyone!!!
14:14aschellhello
14:14tvadakumcheryAll these new guys are from the same class
14:14jhuhi drew
14:14ssavyahollo
14:14aschellhi jon
14:15ssomasunhollo sajishnu
14:15aschellis zack getting on?
14:15uagrawahiiiii
14:15aschelloh yeah
14:15sjain1hey
14:15aschelloooh cool
14:15aschellwho is jigglypuff?
14:15aschellthat one of us?
14:15ssomasunidk
14:16jigglypuff_JIGGLY
14:16rhelmwoa!
14:16rhelmare you sure?
14:16akim1no he's not sure
14:16tvadakumcherySure about what?
14:16ben_mjigglypuff_ has the best nickname
14:16ben_mJust saying.
14:17AzumarillI have the best nickname
14:17Bromosomei disagree
14:17ssomasunno
14:17jmo1ikr
14:17aschelli wanna be sheldor...
14:17tvadakumcheryAzumarill> jiggly
14:17zmarilI am confused about lazy sequences. How can I understand them?
14:17ben_mIs this the class of 16 year olds now?
14:17tvadakumcheryAzumarill huge power aqua jet OP
14:17aschellyeah
14:17BromosomeYep.
14:17pjstadigzmaril: come to my talk at Clojure/West
14:17Azumarill^You, I like you.
14:17zmarilYes this is the class of 16 olds.
14:17rhelmzmaril is very close to azumarill
14:17amalloyzmaril: step 1 is probably to ask a more specific question
14:17ben_mWell, jigglypuff_ is the coolest kid.
14:17jhu^
14:18aschellmy death strike crits 20k damage
14:18jmo1Yay, IRC.
14:18vravilol drew
14:18jhudrew
14:18jhulol
14:18ssomasungg
14:18tvadakumcheryBut the max health you can have in pokemon is 718
14:18nfilipac^amen
14:18zmarilamalloy: Why shouldn't I call doseq on an infinite list?
14:18aschellhello iwillig
14:19emezeske,(take 32 (repeat "jiggly"))
14:19clojurebot("jiggly" "jiggly" "jiggly" "jiggly" "jiggly" ...)
14:19jigglypuff_yehehehessssss
14:19aschellHI CLOJUREBOT!!!
14:19amalloyzmaril: feel free to call doseq on an infinite list, as long as you don't mind that it will never return
14:19tvadakumcherythe max health you can actually have in pokemon is 714
14:19tvadakumcheryI got it wrong
14:20ssomasunthis is for clojure not pokemon
14:20aschelldeath knights beat mages any day
14:20catayou guys are on the internet
14:20tvadakumcheryCan we program pokemon with clojure?
14:20ben_mWell that was successful.
14:21zmarilThat was about as successful as I hoped it would be
14:21zmarilNobody swore which was a major win
14:21AzumarillYou have no faith in us.
14:22ben_mzmaril, what was the point of that? :D Are you their teacher?
14:22amalloyhe was probably worried about the regulars swearing, not his precious, innocent students
14:22Bromosomehe's our teacher
14:22zmarilBoth sides actually
14:22zmarilI came back to my old high schoiol and am teaching them clojure
14:22zmaril*them being a bunch of 16 year olds
14:22technomancymaybe start out in an empty channel to have them get over the "woooooo check it out I'm on the INTERNET" stage?
14:22zmarilThey are chewing through 4clojure and clojure koans
14:23amalloytechnomancy: eh, what was the harm of putting them in here, though?
14:23zmariltechnomancy: that would have been a better idea
14:23technomancyamalloy: I'm thinking primarily to help them avoid embarrassing themselves =)
14:23Bromosomewe have no shame
14:23zmarilThey have no shame
14:23jamiltronWell I'm still embarrassing myself several years later.
14:24WorldOfWarcrafthello
14:25frankstechnomancy: about that "cljsh", that lightweight lein repl-server client...
14:26WorldOfWarcrafti luv clojure
14:26Skyrimwho doesn't <3 clojure
14:27Rayneschouser_: FYI, they're setting up for a spamfest.
14:28frankstechnomancy: 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:28Skyrimlol
14:29technomancyfranks: actually the code in leiningen.repl is probably going to be replaced in lein 2 with nrepl
14:30irpC is better
14:30technomancyit should be doable to use nrepl with a lein1 plugin too
14:30jlrdoes Sam Aaron frequent this channel?
14:30WorldOfWarcrafthey guys i need help
14:31BLASTOISEok
14:31Bromosomewhat do you guys think of this guide to clojure
14:31WorldOfWarcraft(= __ (conj '(2 3 4) 1))
14:31technomancyjlr: IIRC he's known here as naeu
14:31Bromosomehttp://blackstag.com/blog.posting?id=5
14:31WorldOfWarcraftany help?
14:31frankstechnomancy: 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:31WorldOfWarcrafti think the answer is (1 2 3 4) but its wrong
14:31jlrthanks Mr. Hagelberg :)
14:31Raynestechnomancy: No. He is known as samaaron.
14:31WorldOfWarcraftany help?
14:32technomancyRaynes: oh, the olde switcheroo
14:32WorldOfWarcraft(= __ (conj '(2 3 4) 1))
14:32WorldOfWarcraft(1 2 3 4) right?
14:32Bronsa,(conj '(2 3 4) 1)
14:32clojurebot(1 2 3 4)
14:32technomancyfranks: 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:32jlr*shrug* if I see either, I'll message. Thanks!
14:32WorldOfWarcraftit says its wrong
14:32amalloyWorldOfWarcraft: to express a list literal you need to put a ' in front of it, like they did in the example: '(2 3 4)
14:33WorldOfWarcraftok great :)
14:33frankstechnomancy: is anyone actually using your repl server right now?
14:33technomancyfranks: yeah, basically all lein users who don't use slime.
14:33BLASTOISE(= __ (conj '(2 3 4) 1)) Any ideas?
14:34Bromosomewhat is a repl server exactly. when i start up clojurebox, it says "setting up server" or something of that ilk
14:34technomancyclojurebot: can you do my homework for me?
14:34clojurebotExcuse me?
14:34amalloyi never thought i would type this, but... BLASTOISE: ask WorldOfWarcraft
14:34WorldOfWarcraftoh yeah blastoise
14:34WorldOfWarcrafthe said its '(1 2 3 4)
14:34BLASTOISEYou're sitting right next to me and have the same question as me, WorldofWarcraft lolol
14:35franksBromosome: "lein repl" strts up both an interactive repl session and a network listener
14:35WorldOfWarcraftoh lol
14:35BLASTOISEtrolol?
14:35Bromosomethanks
14:35BLASTOISEOk final conclusion: 4 Clojure is wrong.
14:42frankstechnomancy: is the current lein repl written as a plugin?
14:44technomancyfranks: no, it's a built-in task
14:44technomancyit could be spun out if you want it to be usable in 2.x though I guess
14:45WorldOfWarcrafthello guys any suggestions: Write a function which returns a personalized greeting. (= (__ "Dave") "Hello, Dave!")
14:46frankstechnomancy: 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:46TimMcWorldOfWarcraft: What have you tried?
14:46technomancynobody tell him about findfn, ok?
14:47TimMcheh
14:47yoklovis there a way to get a pair in clojure? cons requires the 2nd item to be a seq
14:47WorldOfWarcraftTimMc: I tried to just add in "Hello" but it needs a "!" at the end
14:47yoklovor do people usually use 2 element vectors for that
14:47amalloyyoklov: we usually just use vectors
14:47yoklovokay
14:47yoklovthanks
14:47TimMcyoklov: There are no pairs in Clojure -- sequences and lists are always proper.
14:47ben_mSomebody tell me about findfn though
14:47amalloyyoklov: if you want to be super-efficient you can use (clojure.lang.MapEntry. a b)
14:47frankstechnomancy: 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:50technomancyfranks: yeah, if that's what you need you should probably go ahead and spin it off.
14:50TimMcWorldOfWarcraft: How did you succeed in adding "Hello"?
14:50technomancyI have never been fully comfortable maintaining the repl task since I never use it myself
14:50amalloy$findfn 1 2 3 6 ;; ben_m
14:50lazybot[clojure.core/+ clojure.core/* clojure.core/+' clojure.core/*']
14:50TimMctechnomancy: Because you use swank instead?
14:50WorldOfWarcraftmy idea was simply to use apply str but that did not work so im gonna keep working on it
14:51ben_mThat's pretty cool.
14:51TimMcben_m: Even better, it works in /query lazybot (hint hint :-P)
14:51ben_mTimMc, heh, I know better than to spam channels with bot commands
14:52TimMcTHe hint wasn't for you.
14:52Raynestechnomancy: Man, you and I are like complete opposites.
14:52technomancyTimMc: aye
14:52Raynestechnomancy: 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:53rhelmhow does a multimethod work?
14:55frankstechnomancy: 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:55TimMcrhelm: For implementation details, read the source. Or are you asking how to use one?
14:56technomancyfranks: maybe people would use it more if it didn't boot slowly? I don't know
14:56rhelmi'm looking for the basics, it seems like you declare a function for a set of keywords linked to a map, right?
14:58TimMcrhelm: You have a dispatch function that takes the arguments and produces a key of some sort.
14:59TimMcThen 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:59TimMcGo read the docs for isa?, it's not entirely trivial.
15:00rhelmtimmc: where do i find said docs?
15:01TimMcrhelm: this site is great: http://clojuredocs.org/clojure_core/clojure.core/isa_q
15:01TimMcrhelm: Or you can open a REPL and type (doc isa?)
15:01Bromosomedoes anybody know the solution to http://www.4clojure.com/problem/5
15:01clojurebotIt's greek to me.
15:01Bromosome?
15:02Raynes$examples isa?
15:02lazybotYou must pass a name like clojure.core/foo or, as two arguments, clojure.core foo.
15:02Raynes$examples clojure.core/isa?
15:02lazybotNo results found.
15:02amalloyhuh, i never realized problem 5 was such a stumbling block
15:02RaynesHuh
15:02Bromosomehey now
15:02yoklovBromosome: conj chooses the best way to add to a seq, so since that seq is a list it adds to the front
15:03yoklovare you familiar with how lists work?
15:03yoklove.g. why the front is the best
15:04RaynesTeenagers. Impossible to work with.
15:05ibdknoxsrsly.
15:05TimMcOh, and he's gone...
15:05RaynesOh, wait...
15:05yoklovweird.
15:05Raynesibdknox: Noir has exactly 404 watchers. Quick, screenshot!
15:06pjstadigRaynes: not found
15:06jodaroheh
15:07frankstechnomancy: just noticed that in the 1.7.0-SNAPSHOT, you're not using rlwrap at all... any reason for the removal?
15:08technomancyfranks: whoa, that's a mistake
15:08technomancymust have come from that trampolining change I made
15:08technomancythanks
15:08ibdknoxI have to look up those screenshot commands everytime
15:10TimMcibdknox: ...PrtScn?
15:11ibdknoxTimMc: you mean command+shift+4, right ;)
15:11TimMcOh, if you're on a mac I guess it's shift-squigglything-3.
15:11TimMcyeah
15:12frankstechnomancy: 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:14solussdhas 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:17hiredmanendianess?
15:23nuclearsandwichIf 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:24ibdknoxlein trampoline
15:25lpetittechnomancy: 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:25lpetitlein-1.0 compliant.
15:26nuclearsandwichibdknox: thanks! Don't know how I missed that.
15:26ibdknoxtechnomancy: when I do lein deps in 1.6.2 it occasionally eats 100% cpu for a long time
15:27ibdknoxnuclearsandwich: it's one of those relatively secret features :) Few people know about it
15:27ibdknoxtechnomancy: I've never let it sit long enough to finish, so I'm not sure how long, but I suspect indefinitely ;)
15:36Rayneslpetit: 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:36lpetitRaynes: ok. What is the expected folder for holding clojurescript files? What is expected to replace the 'foo.core' phenomenon ?
15:37amalloylpetit: well, i don't think cljs has any need for foo.core, right?
15:37yoklovwhat's wrong with foo.core?
15:38lpetitamalloy: there were really 2 separate questions ^^
15:38Rayneslpetit: I'm not entirely certain yet. It's still cooking.
15:38amalloyyeah, i realized after answering that they don't look related at all
15:38Raynestechnomancy proposes we split names with a dot or dash and use that to avoid single segment namespaces.
15:39lpetitRaynes: there is one beenfit to 'foo.core', which is that this creates projects artifacts which can play well with OSGi
15:39RaynesBut nothing is set in stone yet.
15:39RaynesI don't know what that is.
15:39duck1123no one wants 'foo'
15:40hiredmanlpetit: namespace names and artifactids and groupids are different things
15:40lpetitRaynes: OSGi is the current defacto standard for modularized things
15:40lpetithiredman: you're right, but you're wrong in assuming I was thinking about that
15:42lpetitRaynes, 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:42Raynestechnomancy: We need some sort of group discussion about project skeletons, I think.
15:42RaynesThat way everybody can whine in a proper venue when we choose the least popular thing.
15:43yokloverr, why are you unhappy with 'foo.core'?
15:44lpetitRaynes, 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:44RaynesIt isn't very useful.
15:45anntzerhi, is there a way to use `apply` on methods defined in a protocol?
15:45Raynesyoklov: 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:45amalloyanntzer: yes, you just use apply
15:45anntzerafaict calling such methods also involves using the dot form
15:45lpetitRaynes, hiredman: then you cannot have a consumer library say "I want smith.lib1" version V1, and "smith.lib2" version V2
15:45amalloyi think your question is probably "is there a way to accept varargs in a protocol function", and the answer to that is no
15:45anntzerso I would have to do (apply .method object)
15:45anntzerah
15:46anntzerok
15:46yoklovoh, 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:46RaynesHaha
15:46amalloyno, use no .s - there's no reason to use interop syntax for protocols
15:47lpetitRaynes, 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:47Raynesyoklov: 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:47yoklovyeah, alright that makes sense
15:47anntzeramalloy, but if the protocol has been defined in some other ns then I have to use the dot form don't I?
15:48amalloyno, just require/use its functions like any other
15:48lpetitRaynes, hired man: I'm having the problem right now with all the contrib libraries contributing files to the same "clojure.contrib" package.
15:48amalloyif you use the dot form your code will be much slower in the best case, and break in other case
15:49anntzerok
15:49anntzerthx
15:50lpetitRaynes, hiredman: was I clear in my explanations?
15:50amalloyRaynes: that isn't quite the reason foo.core exists. it exists because namespaces named just "foo" cause all kinds of problems
15:51hiredmanlpetit: I think you are thinking about problems so far into the solution domain that I've stopped caring
15:51TimMcamalloy: Do you have an example of one of those problems?
15:52Raynesamalloy: I'm not sure you're disagreeing with me.
15:53amalloyRaynes: i don't think i am, but i'm expanding/clarifying for you
15:53TimMcyoklov: You can also do things like org.yoklov.foo
15:53Raynesamalloy: 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:54yoklovTimMc: yeah, i could but…
15:54yoklovhm.
15:54RaynesTimMc: I know of at least one bizarre thing with classloaders and single segment namespaces.
15:54RaynesTimMc: But disregarding actual limitations of Java, they are pollution.
15:54amalloyRaynes: foo.core pollutes exactly as badly as foo, doesn't it?
15:55Raynesamalloy: Kind of. Which is probably why people are deeming these namespaces non-useful.
16:00RaynesI'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:01RaynesI will have grown from the experience.
16:02RaynesI 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:02technomancyRaynes: the "split namespaces with a dot or dash to avoid *.core" is exactly what I'd like to see in lein new
16:02RaynesYou can hit tab until the sun rises but it wont ever let you down.
16:02Raynestechnomancy: Can you show me an example?
16:03RaynesI 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:05technomancyRaynes: 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:05technomancyand the second thing should have been to adapt "lein new" to do that for me, but I was too lazy.
16:06RaynesWhat if I have a project called "sandwich"? `lein new sandwich.chicken` -> src/sandwich/chicken.clj?
16:07technomancyyeah, I think we may still have to fall back on core in that case
16:07technomancyor 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:08technomancysrc/sandwich/cyclops.clj
16:08Raynestechnomancy: What about people who still insist on naming shit clj-foo? I don't care about them, not sure about you.
16:08technomancywaaaaaaaaaaait a minute
16:09technomancyyou sneaky bastard.
16:09technomancy$ lein new buggerjure => Generating a project called buggerjure based on the 'default' template.
16:09technomancyhow did I let that slip by me‽
16:09RaynesHahahahaha
16:09RaynesI swear I would have added the blocker had I remembered it.
16:10technomancyok, I'll open an issue to help aid your memory
16:10lpetithiredman: if any, your answer has the merit to be clear. Not sure how I should feel after having read it, though.
16:13hiredmanlpetit: :)
16:13Raynestechnomancy: 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:13Raynes 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:14RaynesIt seems like it'd be difficult for this to work well for all templates.
16:14technomancyjust skip creating a .clj file altogether with a single-segment name? yeah, that's not a bad solution.
16:14RaynesI'll have to look into it more.
16:14technomancynot sure why you want to treat dashes and dots differently
16:14technomancyI guess having a dot in the project name is a bit weird?
16:14RaynesI'm not sure why you want to split on dashes.
16:14Raynes*shrug*
16:15lpetitRaynes, 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:15RaynesI 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:15lpetitgoing to bed, *shrug*
16:15RaynesSplitting on dashes seems weird and error prone.
16:16RaynesMan, I didn't mean to upset him. It's just that I can't really understand anything he has said. :\
16:16duck1123what if it prompts?
16:16Raynesduck1123: technomancy is allergic to prompts.
16:17technomancyI can't tell if lpetit is complaining about more than just single-segment namespaces?
16:17Raynestechnomancy: Something about OSGi, but I didn't respond because I don't even know what that is/is for.
16:17Raynes:\
16:19mgnmhow can I avoid stackoverflow errors when dealing with large numbers?
16:20frankstechnomancy: 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:20technomancyyeah, 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:20technomancyfranks: excellent
16:22duck1123The only times I hear about OSGi, it's in the context of "... doesn't work with OSGi"
16:22RaynesI really didn't mean to ignore him though.
16:22RaynesI get nervous when I talk to him in person.
16:22RaynesI'm a southern guy -- I can't understand a word he says. :\
16:23TimMcmgnm: Not *stack* overflow, surely...
16:23franksonly 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:23TimMc&(+ Long/MAX_VALUE 1)
16:23lazybotjava.lang.ArithmeticException: integer overflow
16:23RaynesTimMc: Maybe he has a really big stack of numbers.
16:23TimMc&(+' Long/MAX_VALUE 1)
16:23lazybot⇒ 9223372036854775808N
16:24ben_m,(doc +')
16:24clojurebot"([] [x] [x y] [x y & more]); Returns the sum of nums. (+) returns 0. Supports arbitrary precision. See also: +"
16:24yoklov+"?
16:24yoklovoh
16:24Bronsaoh
16:24yoklovnevermind.
16:24ben_mHah.
16:24Raynes&(+' 5 5)
16:24lazybot⇒ 10
16:24Raynes&(+' Long/MAX_VALUE 1)
16:24lazybot⇒ 9223372036854775808N
16:24technomancyfranks: 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:24RaynesOmgwtf
16:25ben_mWhat's the difference between lazybot and clojurebot? :D
16:25duck1123run
16:25Raynesben_m: One is awesome and the other is less awesome.
16:25ben_mCool.
16:25Raynesben_m: Seriously, they are completely different bots with entirely different codebases. One is by amalloy and I and the other is from hiredman.
16:25Rayneslazybot is ours.
16:25TimMcand the awesome one
16:25frankstechnomancy: but now i have to send a different kill-switch to your repl and mine...
16:26AnnoyingHello.
16:26technomancyfranks: if you don't need the kill-switch in mine I may just revert it back out
16:26technomancyyoklov: the #emacs bots are hilarious
16:26Raynesamalloy and I are building robots for our world domination scheme.
16:26Bronsahm
16:26yoklovrudybot is one of my favorites
16:26yoklovi think he's on #emacs
16:26technomancyyoklov: have you tried ,botstack?
16:26yoklovand also on #racket
16:27yoklovno?
16:27clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack>
16:27amalloyyeah, rudybot is a blast
16:27technomancyyoklov: go on, we'll wait. =)
16:27frankstechnomancy: that would take care of the issue ;-) (not sure anyone realized they needed such a beast...)
16:28yokloverr, i'm not sure if i know what you mean
16:28yoklov,botstack
16:28clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: botstack in this context, compiling:(NO_SOURCE_PATH:0)>
16:28clj_newbI 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:28TimMctechnomancy: You mean with rudybot, right?
16:28technomancyTimMc: fsbot in this case, but yeah over in #emacs
16:28amalloyclojurebot: 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:28clojurebotOk.
16:29technomancyheh
16:29amalloyi think he's going to parse that wrong, though, sadly
16:29TimMcof course
16:32WorldOfWarcraftsomething
16:32n00b__I have a question.
16:32Bronsawho doesn't
16:32WorldOfWarcraftgeniuses...
16:33WorldOfWarcraftEvan Li doesn't
16:33n00b__He took an arrow to the knee
16:33WorldOfWarcraftWas he an adventurer?
16:33n00b__Yeah, just like me.
16:34Raynesibdknox: Welcome home.
16:34WorldOfWarcrafthello everyone xoxoxoxoxoxoxoxoxoxoxox
16:34TimMc>_>
16:34ibdknoxRaynes: why thank you :p
16:34n00b__>.<
16:35WorldOfWarcraftEVAN GET OFF RUNESCAPE!!!!
16:35Nerdlolololololol
16:35TimMcclj_newb: Still working on your Typed Clojure? Here's a hint: ##(ancestors (class []))
16:35lazybot⇒ #{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:35ibdknoxdoes someone have chanops?
16:35ibdknoxlol
16:36Raynesibdknox: Yes, but nobody is actually here.
16:36yoklovlol, typed clojure
16:36WorldOfWarcrafthow do i create a macro?
16:36TimMcWorldOfWarcraft: You know you can /join #whatever and it will create the channel for you?
16:36hiredmaneveryone has /ignore
16:36RaynesIgnore is a bandaid
16:36RaynesBut you didn't hear that because you've got me ignored. :\
16:36TimMchiredman is covered in bandaids
16:36WorldOfWarcraftno a macro not a channel
16:37TimMcWorldOfWarcraft: defmacro
16:37WorldOfWarcraftlol nice tim
16:38TimMcWorldOfWarcraft: http://clojure.org/macros <-- lots of good stuff there
16:38WorldOfWarcrafthehe u troll :)
16:38TimMc...
16:39WorldOfWarcraftalright im gonna go find out how to get shadowmourne from the lich king
16:39Raynes /join #clojureforpublicschool
16:39technomancyclojurebot: homework is<reply>You can do your own homework; you're a big kid.
16:39clojurebotTitim gan éirí ort.
16:39RaynesTo any teachers in the audience: please don't tell your class to go to #clojure.
16:40ibdknoxaww but...
16:40RaynesUnless, of course, your class is made up of sane human beings.
16:42adiabaticPeople teach clojure in at least one university?
16:42Raynesadiabatic: Not a university.
16:42RaynesThose are 16 year olds.
16:42TimMchigh school
16:42RaynesHigh schoolers.
16:42TimMcdonny
16:43TimMcIllinois Mathematics and Science Academy, if I can trust the host lookup
16:43adiabaticI can't imagine why they'd come in here, of all places, and goof around
16:44technomancymusta got booted off OFTC
16:44RaynesTimMc: I figured it was somewhere near the throne of the Lich king.
16:44TimMcadiabatic: Their teacher pointed them here.
16:45ibdknoxwhy do all school websites suck?
16:45Raynesibdknox: Because we didn't write them.
16:45Rayneso/
16:45ibdknoxlol
16:47adiabaticOh, these people are *regulars*?
16:47adiabatics/people/kids/
16:47TimMcNOt sure what that means.
16:47RaynesNo. Their teacher sent them here. That's all.
16:48yoklovwhy would you tell your students to go on the irc channel
16:48adiabaticOh. 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:17yoklovhrm, so i have this hash of keywords to sets, and i'm trying to find which set an item is in
17:18yoklovlike 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:18yoklove.g. allow that categorize function to take sets as a parameter
17:19amalloyuse filter?
17:20amalloy(first (for [[name items] sets :when (thing items)] name))
17:21yoklovoh
17:21yoklovyeah that totally works thanks so much
17:27semperosneophyte clojurescript/emacs problem
17:28semperosI've followed these instructions to make my inferior-lisp-program start up a browser REPL
17:28semperoshttps://github.com/clojure/clojurescript/wiki/Emacs-&amp;-inferior-lisp-mode
17:29semperosI 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:29semperosdoes anyone have more detailed notes on doing cljs development with Emacs, or know what simple thing I might be missing?
17:33dnolensemperos: yes that script is very simple, needs to be changed to set the classpath to your project directory.
17:34semperosdnolen: great, that's what I was just editing in
17:35semperosglad I was at least in the right direction
17:35brehauttodays think relevance podcast interview about clojurescript one is great
17:35semperosagreed
17:38JohnnyLHow mature is clojure script?
17:38dnolenJohnnyL: rough edges, but it's works pretty darn well
17:39amalloyPG13
17:39ibdknoxlol
17:39JohnnyLdnolen: ok thanks. I was hoping to do some ajax/canvas work in it.
17:39JohnnyLamalloy: :)
17:40technomancyJohnnyL: depends on if you're comparing it to clojure or javascript
17:41JohnnyLtechnomancy: nope, just functionality-wise and bug free related maturity.
17:44dnolenJohnnyL: lots of functionality - Relevance actually used ClojureScript One for a client project, so likely few show stopping bugs
17:45ibdknoxhm
17:45ibdknoxI think cljs one is positioned in a very weird way
17:47dnolenibdknox: how so?
17:47ibdknoxdnolen: it's shortsighted to assume it's not a library
17:47ibdknoxthe way in which it is presented, it will absolutely become a library
17:48ibdknoxwhether intentional or not
17:49JohnnyLdnolen: kj
17:49JohnnyLdnolen: k
17:51dnolenibdknox: 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:51brandeldnolen: talking about cljs one? as a clojure newbie I have found that super helpful
17:52dnolenibdknox: there are a couple things in there that are really neat but not fully baked - the dispatch thing.
17:52ibdknoxdnolen: which is awesome, but it's now cljs is in an awkward state
17:52dnolenbrandel: yes it's meant to be helpful, especially for people new to Clojure
17:52ibdknox-it's
17:52RaynesThat sentence is in an awkward state.
17:52dnolenibdknox: ?
17:52brandelhonestly I found getting started with clojurescript a bit daunting when it was released initially
17:52ibdknoxbrandel: definitely
17:52RaynesWell, it was never really 'released'.
17:52dnolenbrandel: yup
17:53RaynesWhich is the source of all the problems in the universe.
17:53ibdknoxa simple release + a lein plugin would've addressed that
17:53brandelwell, when I first came across it months ago I should say then
17:53RaynesHunger, poverty -- it's all caused by lack of a release.
17:53emezeskeI'm trying to make up for things with lein-cljsbuild :)
17:53RaynesEven a superalphalphabetaomega-0.0.0.0001
17:54technomancyoops; pronoun fail.
17:54brandelI 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:54technomancy(ZUM)
17:55Raynestechnomancy: How are we doing on existing lein tasks in 2.0? Maintaining lein-newnew is daunting.
17:55TimMcweeEEEOOOoooo
17:55TimMclazybot: Can you describe the culprit??
17:55lazybotTimMc: Uh, no. Why would you even ask?
17:55RaynesSublime Text 2's multi-select only goes so far!
17:56ibdknoxdnolen: 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:56ibdknoxdnolen: it sets convention
17:56technomancyRaynes: what about making lein 2 just depend on lein-newnew?
17:57technomancysingle canonical source
17:57RaynesMan. You're so fickle about dependencies that I never know anymore.
17:57VinzentHello, 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:57JohnnyLthere 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:57dnolenibdknox: 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:58dnolenVinzent: you might want to look at this, http://tsdh.wordpress.com/2012/01/06/using-clojures-core-logic-with-custom-data-structures/
17:58ibdknoxyeah, pinot needs to change a lot
18:00Vinzentdnolen, thanks, I'll check it out...
18:01dnolenibdknox: exciting times IMO, will be cool to see where this stuff is by the next Conj
18:01ibdknoxdnolen: definitely. I'm doing a big project in CLJS
18:01seancorfieldas opposed to by the next Clojure conference (which is March) :)
18:01ibdknoxseancorfield: I'll have very cool stuff to show by then too :)
18:02seancorfieldwith ClojureScript:One using Enlive, i'm looking forward to seeing what I can learn from it and apply to FW/1...
18:02seancorfieldDomina... rings a bell... who wrote that library?
18:03ibdknoxlukevanderhart
18:03seancorfieldah, right...
18:04seancorfieldhe's doing a talk on it at West...
18:04ibdknoxyessir
18:04seancorfieldi was surprised there wasn't a pinot or noir or korma talk on the schedule
18:04seancorfieldbut i guess you're doing back to back web training beforehand and covering them all there?
18:05ibdknoxseancorfield: I pitched a different talk, but it didn't fit in really
18:05frankstechnomancy: 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:05technomancy"could not locate leiningen/core.clj" sounds like maybe you are using lein2 by accident?
18:06technomancythe files you mention should not interfere with anything
18:06ibdknoxseancorfield: 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:06seancorfieldlol... ok...
18:06ibdknoxhint: people will have a very fun and interesting way to learn Clojure
18:07RaynesI've seen his secret project!
18:08ibdknoxlol
18:09ibdknoxseancorfield: 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:14ritreCan 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:15frankstechnomancy: 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:15technomancyproject-init... did I add that?
18:16technomancyhuh; apparently it exists
18:16TimMchaha
18:16technomancyfranks: are you trying to load leiningen code inside a non-plugin project?
18:17amalloy$google stackoverflow dbyrne primes sieve
18:17lazybot[recursion - Recursive function causing a stack overflow - Stack ...] http://stackoverflow.com/questions/2946764/recursive-function-causing-a-stack-overflow
18:17amalloyritre: ^
18:18TimMcoho
18:18frankstechnomancy: i'm trying to refer to my plugin vars from inside of the project.clj to set :repl-options...
18:18ritreamalloy: thanks
18:19technomancyfranks: project-init runs inside the project's process itself
18:19TimMchmm, gist doesn't have diffs?
18:19frankstechnomancy: 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:20amalloyTimMc: none that i could find. you can clone the repo and run diffs locally, but...
18:20TimMcfeh
18:22TimMcritre: Do you see how to fix it?
18:23ritreTimMc: I am not sure
18:24TimMcritre: THe problem is that that 'remove is lazy, and with each iteration you are calling remove on the last iteration's remove.
18:25ritreand that consumes stack, ok?
18:25TimMcYou 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:26TimMcRight. Each remove is calling a remove which is calling a remove...
18:27TimMcWhat you need to do is realize the entire lazy seq on each iteration. doall is the tool for that.
18:27ritrewell I got it now, thx!
18:28ritreI am going to lern more about doall.
18:29TimMcritre: also see dorun, for when you don't want the seq/don't want to hold onto the head
18:30ritreTimMc: yes I will
18:32TimMcamalloy: I'd seen that before but I hadn't really read it -- that was a bit new to me.
18:34ritreTimMc: But I am still curious why adding only 'if' solves the exception.
18:38amalloyit just delays the problem, i think
18:40ritreamalloy: So if I sum even more numbers I'll get the error again?
18:40amalloyprobably
18:41amalloyi don't see any reason that this addresses the underlying issue, but i'm not 100% sure that it doesn't
18:41ritreYes, it sounds resonable
19:04yoklovis there a difference between (apply vector …) and (vec …)?
19:04chhildebHi there. Just testing my new IRC client privmsg function from the repl. I sure like Clojure.
19:04amalloyone of them has a lot more letters
19:04yoklovi 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:05RaynesHi there. I recommend an empty channel for IRC testing.
19:05ibdknoxamalloy: you're all over it today :p
19:05chhildebSorry, didn't actually think it would work on the first try.
19:05RaynesHahaha
19:05ibdknoxlol
19:06chhildebI will do that now, please excuse the disturbance.
19:06yoklovhahaa
19:06Rayneschhildeb: 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:06Rayneshttps://github.com/Raynes/irclj
19:07chhildebI'm really sorry, but this is my first ever IRC client so I really didn't realise it was that easy.
19:07ibdknoxchhildeb: no worries
19:07RaynesYou didn't actually bother anyone.
19:07RaynesIt was just a heads up.
19:07Raynes:)
19:09zzachWhile 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:10technomancyzzach: I don't think anyone here understands how cdt works; you might need to try the mailing list.
19:34lshI'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:34lshhttp://pastebin.com/wnTaEmmG
19:34lshcan anyone offer any insight?
19:36lshnuts - left out a function: http://pastebin.com/0b7Lg0P6
19:36technomancylsh: you want (if (seq subdirs) [...]) rather than just if subdirs
19:36technomancythe empty list is true
19:36brehautlsh: you dont need to quote a vector literal
19:37technomancyalso I hate to spoil the fun, but there's a built-in function called file-seq
19:37lshI know, but I want to learn how to use a language
19:38technomancyok, carry on =)
19:38lshoriginally the function was to recurse through file-seq and build a list of ((parent children) (parent children))
19:38lshbut I've had to simplify and simplify and I'm still getting an empty result: (() () (()))
19:38lshI figure it's something I'm fundamentally 'not getting'
19:39brehautlsh: you probably dont want cons onto vectors eithe
19:39lshcons and conj produce the same result
19:40lsha list of empty lists
19:40brehaut,(cons 1 [])
19:40clojurebot(1)
19:40brehaut,(conj [] 1)
19:40clojurebot[1]
19:40brehautthats two different results
19:40lshI mean in terms of the program, not their use.
19:40brehautit may not be your bug, but what you are doing is weird
19:40lshI want a flattened list from a tree! how is that weird?
19:41TimMclsh: tree-seq
19:41brehautLsh: consing onto a vector is weird
19:41lshI give up. thanks guys
19:41brehautif you want to flatten a tree, mapcat is your friend
19:41brehautor tree-seq
19:42lshI'll look at mapcat
19:42technomancyit works if you (apply concat (for [...])) and do (if (seq subdirs) [...])
19:43lshthanks, I'll try that
20:26lshhah - 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_carlos_I've got this:
20:33_carlos_$ lein ring server That's not a task. Use "lein help" to list all tasks.
20:33_carlos_was there some change in lein?
20:35babilenHi 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:37alandipertbabilen, you can use/require them into your ns as with any var
20:38babilen_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_carlos_babilen: so lein-ring is useless in that place right?
20:40babilen_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:40ibdknox_carlos_: you could put it in dev-dependencies, but it's much better to install plugins at the user level
20:40babilen+1
20:41ibdknox_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:41babilenalandipert: 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:43hiredmanalandipert: any news from core-wards regarding http://dev.clojure.org/jira/browse/CLJ-855
20:44technomancyhiredman: it's not friday, dude
20:44ibdknox_carlos_: I'm not sure that compojure is actually more popular than Noir is now, but I don't have hard evidence
20:45babilenalandipert: 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:45ibdknox_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:45ibdknox_carlos_: and yeah, there's lots more documentation for it
20:46_carlos_ibdknox: thanks! I will look into it
20:47hiredmanalandipert: 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:48alandipertbabilen, peep https://refheap.com/paste/245 for an example
20:49hiredmanI 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:49alandiperthiredman, unlike last week tomorrow is not a workday, and i bet it's on someone's agenda
20:49alandipertthat said, i'm just the conj guy!
20:50ibdknoxhaha
20:50babilenalandipert: 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:50hiredmanwell, you do work in much closer proximity to core
20:51alandiperthiredman, i'll bring it up
20:51hiredmanso I would like you to do some head cracking by proxy
20:51hiredmanthank you
20:52alandipertbabilen, you should be able to bind pprint/*thingy* in that case
20:53ibdknoxalandipert: how's your embedded lisp going? :)
20:54jsnikeri`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:54babilenalandipert: Ok, that was my intuition as well, but I must have made a mistake then. Thanks a lot!
20:54technomancyjsnikeri`: have you talked to replaca?
20:55alandipertbabilen, np, happy computing
20:55jsnikeri`technomancy: is that a person or a function?
20:55alandipertibdknox, it's changing the world
20:55ibdknoxalandipert: that's what I like to hear :D
20:55technomancyjsnikeri`: heh; both! in this case the person.
20:56jsnikeri`technomancy: :) I have not. Should I?
20:56technomancyjsnikeri`: he did some work on that problem. I should have pointed him to you but I forgot your nick
20:56technomancyin my defense it seems to be a random jumble of vowels and consonants.
20:57technomancyno offense
20:57jsnikeri`technomancy: you making fun of my name!
20:57jsnikeri`;)
20:57technomancy=)
21:00alandipertibdknox, also put in an oscon thing for a lisp/arduino tutorial, should be a good time if they accept
21:01ibdknoxoh sweet
21:01ibdknoxwhen is oscon?
21:01alandipertjune i think
21:01technomancyusually late july
21:02alandipertoh yeah, july 16th, in portland
21:02ibdknoxneat :)
21:02alandipertfar enough away for me to not be concerned about working on uberlisp at the moment
21:02ibdknoxhaha
21:03ibdknoxwell good luck with it
21:03alandipertthanks
21:03hiredmanalandipert: have you seen lively linear lisp?
21:04hiredmanlispish thing without gc
21:04hiredmanhttp://www.pipeline.com/~hbaker1/LinearLisp.html
21:04avi_flaxHi 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:04hiredman,(doc instance?)
21:04clojurebot"([c x]); Evaluates x and tests if it is an instance of the class c. Returns true or false"
21:04avi_flaxohh
21:04avi_flaxthanks!!
21:05alandiperthiredman, yeah man
21:05avi_flaxthanks!
21:05alandiperthiredman, i wish henry baker was my dad, that guy is so freaking cool
21:06technomancyso much suffering could be averted if "Equal Rights for Functional Objects" were required reading for anyone inventing a language.
21:06hiredmanoh, right, the egal guy
21:06hiredmanequality is a hard problem
21:07babilenalandipert: 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:08hiredmanbabilen: if you want to do that then you are doing something wrong
21:08technomancyhiredman: 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:08technomancyand then equality on function objects becomes implementable
21:08technomancybut you would get it only when the knob was cranked all the way
21:08technomancyand I don't know how to feel about that
21:08hiredmantechnomancy: well, it (as usual) depends on what you mean by equality
21:09technomancyelisp has the same problem; you can compare interpreted lambdas but not byte-compiled ones.
21:09technomancyhiredman: eh? you mean more than just egal?
21:09hiredmanfor example #(% 1) and #(% 1) would never be equal
21:09technomancy??
21:09lazybottechnomancy: Uh, no. Why would you even ask?
21:09hiredmanthe gensyms would be different
21:10hiredmanneither would (fn [x] x) and (fn ([x] x)) etc
21:10technomancywell I wouldn't say never; it's not impossible to normalize locals.
21:10technomancyI just said implementable
21:10babilenhiredman: 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:12hiredmanbabilen: 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:12hiredman*analyzer* is not declared as dynamic there
21:13alandiperttechnomancy, i quest for the lisp subset that is confluent and gives me a Real eq: http://en.wikipedia.org/wiki/Confluence_(abstract_rewriting)
21:13babilenhiredman: I've changed that already -- Just wanted to give a more specific example.
21:14hiredmanalandipert: 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:15technomancyalandipert: is there much progress in that direction?
21:15alandiperthiredman, technomancy, i've let it go because i realized it's probably something dnolen will write eventually
21:15alandipert(or one of his programs will write)
21:16hiredmanbabilen: you might consider generating wrappers that do the binding for you
21:16babilenhiredman: 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:16hiredmanthat take the analyzer as an argument
21:18hiredman(def my-analyzer ...) (for [[v n] (ns-publucs clucy)] (intern n (fn [args] (binding [*analyzer* my-analyzer] (apply @v args))))) or something
21:18hiredman(better yet use a macro to generate proper defns)
21:19hiredmanor even just run the code to generate the datastructures of the defns and copy and paste them in a file
21:19babilenhiredman: Ok -- That means that I have to manage an analyzer in every namespace in which I am using clucy wouldn't it?
21:19hiredmanno
21:20babilenah, 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:22hiredmancemerick had some kind of config idea about generating namespaces full of partially applied functions
21:25babilenTo 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:26hiredmanbabilen: but you can do that
21:26babilenhow?
21:26clojurebotwith style and grace
21:26hiredman~botsnack
21:26babilenindeed :)
21:26clojurebotThanks! Can I have chocolate next time
21:27brehauthiredman: is http://cemerick.com/2011/10/17/a-la-carte-configuration-in-clojure-apis/ the thing you are thinking of?
21:27hiredman(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:28hiredmanbindings are dynamic and threadlocal
21:28hiredmandynamic as opposed to lexical (or static) and threadlocal (with some special cases) as opposed to globally visible
21:29hiredmanbrehaut: yes
21:30babilenbrehaut: Ah, great. I've stumbled over that some time ago, but I guess it is time to read it again.
21:30brehauttheres a heap of great discussion in the comments there
21:30hiredmanmeh
21:32alandiperti'm outta here chaps, g'night
21:32alandipertoh btw, everybody's cool with conj in vegas this year?
21:33technomancyhah
21:33brehautalandipert: im not
21:33brehautneeds to be somewhere more southern
21:35babilenhiredman: Ok, thanks for the pointers and discussion -- I see much clearer now and am sincerely grateful for that.
21:35babilenbrehaut: Thank you too for bringing that post to my attention again.
21:47wallhello
21:47cmwelshhey there wall
21:47wallcan anybody help me with fnparser?
21:47brehautdo you mean joshua choi's fnparse ?
21:48brehaut~anyone
21:48wallyes
21:48clojurebotJust 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:49brehautwall: just ask. there are people here who have used fnparse
21:49wallplease see http://pastebin.com/1cpr13RZ
21:50wallthis code must parse 3 token "false" "true" and space
21:51wallbut then i call (parse "false true") i'm get java.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.CharSequence
21:51wall [Thrown class java.lang.RuntimeException]
21:51wallwhy?
21:51clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack>
21:51brehautbecause a string is a seq of characters
21:51brehautregexps match strings
21:51brehautand the :remainder in fnparse is expected to already be tokenized
21:52walloh...
21:52walli must write own lexer for fnparse?
21:52brehautnot necessarily
21:53hiredmanthere is some thing for matching strings I think
21:53hiredmanhttps://github.com/hiredman/Howler/blob/master/src/Howler/parser.clj
21:54brehautwall, for your program (re-seq #"\w+" input) is all the lexer you need
21:55brehautwall, otherwise hiredmans example of using a conc of lit's is what you probably want
21:56hiredmanhttps://github.com/hiredman/clojurebot/blob/master/src/hiredman/clojurebot/factoids.clj even worse
21:56brehaut,*clojure-version*
21:56clojurebot{:major 1, :minor 3, :incremental 0, :qualifier nil}
21:57TimMcbrehaut: Both bots are these days.
21:57brehautTimMc: yeah, i wasnt aware that anyone had ported fnparse to 1.3
21:58hiredmanclojurebot uses a classloader to run 1.3 in the same jvm as 1.2
21:58TimMcbrehaut: I thought you were in the future!
21:58hiredmanso clojurebot is still 1.2
21:58jsnikeri`How does one decide whether to use (bindings ...) or (with-bindings ...) in a given situation?
21:58brehautTimMc: i am!
21:58hiredmannever use with-bindings
21:58TimMcbrehaut: The *sandboxes* are 1.3.
21:58hiredman(unless you really really want to)
21:59brehauthiredman, TimMc: huh. thats very clever
21:59brehautwall: another bot with an fnparse parser: https://github.com/brehaut/burningbot/blob/master/src/burningbot/logging.clj
21:59wallthanks
22:00wallbut another question
22:00brehautwall, 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:00wallyes, i mean it
22:00wallsory my bad english
22:01wallanother quiestion, i want to do own interpreter of small subset basic
22:01jsnikeri`can you declare two bindings within the same binding form: (binding [*vector-newline-style* :fill *list-newline-style* :fill] ...)
22:01wallmay be exists projecst what be like?
22:03brehautwall, in clojure?
22:03wallyes
22:04TimMcwall: You are trying to write a BASIC interpreter?
22:04wallyes
22:04brehauthow 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:05walli want anything like (basic "let x = 1; let y=2; print x+y") and at result see number 3 in REPL
22:07brehautwall, how much do you know about simple interpreters?
22:07TimMc,(binding [*print-readably* 'foo *print-meta* 8] [*print-readably* *print-meta*]) ; jsnikeri`
22:07clojurebot[foo 8]
22:09wallyes i want write simple interpreter
22:09jsnikeri`TimMc: thanks
22:16babilenOne 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:19tmciver_babilen: couldn't you just make them private vars?
22:24babilentmciver_: 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:24babilen... third-party lib bar' that I might use.
22:28babilenI 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:30tmciver_babilen: I see. It's not that you don't want to expose them, it's the burden on users of the lib.
22:31babilenyeah, 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:34tmciver_babilen: so am I. sorry I can't help.
22:35babilenNo problem - Others might. :)
22:39tomojanybody playing with cljque? is #'attend broken on master, or do I just not understand it?
23:16Frank__hey
23:16WorldOfWarcrafthi Frank
23:17WorldOfWarcraftso my question is if I want to create the Fibonnacci sequence how would i go about doing that?
23:17Frank__Well, it's quite simple
23:17Frank__all you have to do
23:17Frank__is
23:18Frank__to make a program
23:18WorldOfWarcraftoh sweet
23:18WorldOfWarcraftthanks i got it
23:18Frank__i got another question
23:18Frank__i mean a question
23:19Frank__what exactly is the nature of "loop?"
23:19WorldOfWarcraftoh well u see a loop is something that holds values
23:19WorldOfWarcraftfor instance (1 2 3) is a loop
23:19Frank__oh
23:19Frank__i see
23:19Frank__so in order to make a loop,
23:19Frank__what would you need to do?
23:20WorldOfWarcraftto make a loop type in make (loop)
23:20Frank__umm
23:20Frank__that's kinda a problem for me
23:20alexbaranoskywhere am I? is the #clojure?
23:20Frank__my keyboard is broken
23:20Frank__yes
23:20WorldOfWarcraftyes this is clojure
23:20WorldOfWarcraftim teaching Frank about loops
23:20alexbaranoskyok, was pinching self
23:21WorldOfWarcrafthe should use the command make (loop)
23:21alexbaranoskyWorldOfWarcraft, ahhhh
23:21Frank__what is "command?"
23:21WorldOfWarcrafta command is something called a string
23:21WorldOfWarcraftit is a word
23:21Frank__wait, what?
23:22alexbaranosky"this is a string"
23:22WorldOfWarcraftwhat is your question, as you know i am a pro at clojure
23:22Frank__i don't understand
23:22Frank__please assist
23:22WorldOfWarcraftso to create a string type in makestring "string"
23:22Frank__so then what?
23:22Frank__how do i get from a string to a loop?
23:23Frank__do i need to know how to knot?
23:23Frank__is there such thing as a "knot?"
23:23WorldOfWarcraftyes how can you make a loop without a knot?
23:23alexbaranoskyrlol
23:23Frank__well, is "knot" command also a loopp?
23:23WorldOfWarcrafti believe u mean rofl
23:23Frank__?
23:24Frank__is this funny to you?
23:24WorldOfWarcraftand did u know if u type in rofl in clojure it displays a large man laughing
23:24Frank__rofl
23:24Frank__you lied
23:24Frank__okay
23:24WorldOfWarcraftno no open boxclojure
23:24Frank__this is serious
23:24Frank__i need to learn how to program
23:24alexbaranoskyeverything he says is a lie pretty much
23:24Frank__really...
23:24WorldOfWarcraftwhat r u talking about
23:24Frank__so there is no "knot?"
23:25alexbaranoskyits like listening to an insane programmer
23:25Frank__or "yarn?"
23:25WorldOfWarcraftno there is not a "knot" lol
23:25alexbaranoskydefinitely not
23:25WorldOfWarcraftbut there is yarn
23:25alexbaranoskyseriously, stop listening to this nutter
23:25Frank__is that like a whole of "string?"
23:25WorldOfWarcraftyes you create a yarn by looping string
23:25alexbaranoskythis is too much
23:26Frank__so "yarn" effectively hold a lot of data?
23:26Frank__wait
23:26WorldOfWarcraftno no
23:26Frank__he's lying right?
23:26WorldOfWarcraftu see "yarn" holds strings of data
23:26Frank__i thought that you said that "loops" held data
23:26WorldOfWarcraftyes that is correct
23:26ivanFrank__: yeah. you might want to avoid talking to crazy.
23:26WorldOfWarcrafthowever a yarn is slightly different
23:27alexbaranoskyunless Frank__ is in on the fun
23:27Frank__what?
23:27clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack>
23:27WorldOfWarcraftwhat
23:27WorldOfWarcraftWHAT!!!
23:27Frank__can you help me than?
23:27WorldOfWarcraftomg what r u talking about
23:27WorldOfWarcrafttroll?
23:27WorldOfWarcraftwhat is a troll?
23:27Frank__is he serious?
23:27WorldOfWarcraftim innocent of trolling
23:27WorldOfWarcrafti mean...i dont know what a troll is
23:28ivanFrank__: no. and most of the time this channel is pretty sane.
23:28WorldOfWarcraftim being called insane :(
23:28Frank__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:28WorldOfWarcraftthats it im gonna rage quit
23:28Frank__wait.. but i need help
23:29WorldOfWarcraftmy death knight crits 20k damage
23:29ivanFrank__: do you know how to program in any other languages?
23:29WorldOfWarcraftyes
23:29alexbaranoskythis is the mot insane moment I've seen on here
23:29Frank__other than what?
23:29Frank__there's more than english?
23:29ivanprogramming languages
23:29alexbaranoskysee? two man troll
23:29ivanyeah.
23:29Frank__wait
23:29WorldOfWarcraftwait what is a programming language?
23:29alexbaranoskythey're an act
23:29Frank__i'm new to programming
23:29WorldOfWarcraftclojure is slang english i thought
23:30Frank__so mr.WoW doesn't know how to program?
23:30WorldOfWarcraftprogram? whats a program?
23:30Frank__...
23:30Frank__i thought i could get help here
23:30ivanwell, Frank__ is connecting from Illinois Mathematics and Science Academy
23:30WorldOfWarcrafti thought we were learning clojure not programming
23:30alexbaranoskydude's spinning you a yarn :)
23:30ivanWorldOfWarcraft from who knows where
23:31Frank__i need to learn how to program for school
23:31alexbaranoskywell #clojure is the place for help with clojure
23:31Frank__what's clojure?
23:31WorldOfWarcraftok enough trolling...that was fun thx guys
23:31Frank__i needed help and they told me to come here
23:31alexbaranoskyyep, adios
23:31WorldOfWarcrafti actually do know clojure and Frank__ is my helper in crime
23:32Frank__what?
23:32clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack>
23:32Frank__DUDE
23:32alexbaranoskyfigures
23:32WorldOfWarcraftit was fun yes?
23:32Frank__I WAS LIED TO
23:32alexbaranoskyan interesting diversion
23:32WorldOfWarcraftlol gg back to my raid
23:32alexbaranoskyI need a better bs detector
23:32Frank__so clojure is a language in programming?
23:32Frank__like java
23:32Frank__?
23:33WorldOfWarcraftno java is coffee
23:33Frank__...
23:33Frank__you troll
23:33WorldOfWarcraftFrank__ i luv u
23:33Frank__i'm sorry... i can't say the same to you because you lied to me so much
23:34jcromartieis WorldOfWarcraft a new bot?
23:34WorldOfWarcraftno im not a bot lol
23:34WorldOfWarcraftoh dang it i should have said i was
23:34jcromartieso, slightly OT: has anybody here read "Code" by Charles Petzold?
23:34Frank__are bots programs?
23:35WorldOfWarcraftno what is it?
23:35Frank__how can i make one?
23:35jcromartieit's a pretty good introduction to digital logic circuits and computer architecture
23:35WorldOfWarcraftcool
23:35WorldOfWarcraftill look it up
23:35Frank__what?
23:35clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack>
23:35Frank__digital logic?
23:35jcromartielike, I went from nothing to understanding latches, flip-flops, RAM, program counters, Von Neumann machines, etc., in about 200 pages
23:35Frank__what's that...
23:36ivanFrank__: Wikipedia knows things
23:36Frank__was wikipedia made in clojure?
23:36ivanno
23:36WorldOfWarcrafthow long did it take u to read
23:36jcromartieoh I see what's going on here
23:36WorldOfWarcrafthmm?
23:38WorldOfWarcraftPEACE!!!!!!
23:38Frank__?
23:39Frank__wiat.. then whose gonna help
23:39aaelonyhas 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:43amalloyjcromartie: yeah, Code is a good book. i read it in high school, or thereabouts
23:43jcromartieamalloy: you make me feel old
23:44jcromartie(me being the ripe old age of 28… and feeling rather unaccomplished)
23:44amalloyi'm only 26, bro
23:45jcromartie:P OK
23:45jcromartiehttp://upload.wikimedia.org/wikipedia/commons/0/02/80486dx2-large.jpg