#clojure logs

2009-02-18

00:00technomancyI'm close
00:00cooldude127WOO
00:00cooldude127technomancy: after you push, the overlays should show on any failure, not just the last, right?
00:00cooldude127ideally?
00:01cooldude127also did you figure out why it was global?
00:01technomancywhy don't you look into making it buffer-local. =)
00:01technomancyI'm working on the multiple-failures-per-test problem.
00:04cooldude127technomancy: thing is, it is supposed to be!
00:07cooldude127technomancy: ok well one problem is that the body of (define-minor-mode) is run both when the mode is enabled and when it is disabled
00:07cooldude127i think
00:08technomancywoot; fixed it
00:08technomancyI might add that I beat you.
00:08cooldude127lol
00:08cooldude127push it
00:09technomancypushed!
00:11cooldude127technomancy: FAIL
00:11technomancywha?
00:11cooldude127wrong type argument: sequencep, :pass
00:11technomancycooldude127: you need to restart your slime
00:11cooldude127technomancy: may i ask why?
00:12technomancyor maybe just call clojure-test-load-reporting
00:12technomancythat second one should do it actually
00:13cooldude127technomancy: this is AWESOME
00:13technomancyyay!
00:13technomancycooldude127: it works fine on with-test?
00:13cooldude127technomancy: yes, idk how, but yeah
00:13technomancyheh; cool
00:14cooldude127yeah
00:14technomancyI think I'm going to use defface instead of setting the bg-color
00:14technomancyso you can have it look decent for dark or light backgrounds
00:15cooldude127technomancy: good plan. but now you should figure out this buffer-local thing, cuz it's got me baffled
00:16cooldude127also, have you noticed that it's been a while since anyone else in here spoke?
00:16cooldude127like, about an hour
00:20cooldude127technomancy: hmm, something's not working
00:20defnI think I just decided what I want to do with my life.
00:21technomancydefn: bind function literals to vals?
00:21defnDing ding ding!
00:21defnWhat do we have for them Johnny?
00:21defnA BRAND NEW CAR!
00:22cooldude127technomancy: i decided to start using the clojure-test-mode in a new file with a new ns, and i have a test i know show fail, but it's not getting highlighted
00:23defncooldude127: what does the 127 stand for?
00:23cooldude127defn: not a damn thing
00:23defncooldude127: 2nd question, are you actually a cool dude?
00:23cooldude127yes
00:23cooldude127defn: would you believe i have been asked that before?
00:23defncooldude127: final question, do you not have any desire to get rid of numbers on your nick?
00:24cooldude127not really, since i use this for a lot of things. i randomly picked it the first time i used IRC, and i just kept using it
00:24defnPart of me wants to chastize you for not being elite, while the other part of me would like to commend you for not falling victim to peer pressure.
00:24cooldude127lol
00:25cooldude127defn: if i were to remove them, i would have so many accounts to change
00:25defnAnother part of me wonders if you're over 30?
00:25cooldude127defn: nope. 18
00:25silkarnhow does memoize work? can it memoize a function internally? a (memoize naive-fib)?
00:25technomancypicking a nick is hard
00:25technomancyyou don't realize when you're in high school that it might stick with you the rest of your life
00:25cooldude127technomancy: exactly
00:25defnYeah, I've had a bunch of them. I can actually give you the whole history of my life in screen names.
00:25defnWell history from 12->
00:25cooldude127lol
00:26cooldude127technomancy: enough chit-chat. pay attention to my problems :p
00:26defnI was originally XxPuMT2KiLLxX on AOL
00:26technomancycooldude127: well I got faces working, but the one that works with the default colors is bad; you can't read strings in it
00:26cooldude127oh crap
00:26Chouser<-- Zorph
00:26technomancydefn: then you learned to keep your cat off your keyboard, right?
00:26defnhahaha!
00:27technomancycooldude127: you'll have to send me a test case to repro
00:27technomancyoh, actually I haven't really tried switching ns
00:28defnI was originally XxPuMT2KiLLxX, then I was known as "Jack" on Ultima Online not because my name is Jack, but because my lumberjack became my main character, then I was "code" (and still am on 1 irc server), then I became qed, then tao, and lately 'defn'
00:28lisppaste8cooldude127 pasted "this is what doesn't work" at http://paste.lisp.org/display/75684
00:28defnmy name is devin in real life, so defn just might stick
00:29cooldude127defn: that's cool, i like that
00:29cooldude127honestly sometimes i can't believe people take me seriously on here with this nick
00:29danlarkinsooo building jars is *the worst*
00:29defnhaha -- im trying hard!
00:30defnsometimes people who dont give a shit about certain things (like personal hygene for instance), are REALLY good at other things
00:30cooldude127defn: i figure that by helping people out enough, they won't care about my nick
00:30technomancydanlarkin: ugh. I've been putting that off.
00:30cooldude127lol
00:30technomancydistributing code as tarballs is not that bad. =)
00:31defncooldude127: it also lends a certain sort of legitimacy to what you say, too
00:31cooldude127yeah
00:31danlarkintechnomancy: for a project with a lot of deps (like mine) ohhhh what a headache
00:31defnpeople who are named "monad" or some shit tend to be arrogant ass hats
00:31cooldude127lol
00:31defnwhy the lucky stiff is the perfect balance of knowledge and moniker IMHO
00:31cooldude127i've considered switching my nick to something like my initials
00:32cooldude127something simple and short
00:32defnyeah using your real name is cool because its like "hey, i actually stand by what i say"
00:32silkarncan someone explaing memoizing to me? I see how to use it for caching, like check if in hashmap else retrieve from database but how do I memoize a function? like naive fibonacci? how does the memoize function catch the output? where in clojure.lang can I find memoize?
00:32cooldude127yeah
00:32technomancy_why is the man
00:32defn_why is literally my hero
00:32defni think the stuff he's working on with hackety is so incredibly noble and "right"
00:32defnhe is my moral programming compass
00:32durka42~source memoize
00:33cooldude127silkarn: memoization takes advantages of closures, so the function has a reference to a map that stores the args and corresponding values
00:34danlarkinsilkarn: http://clojure.org/atoms has a good example of memoization
00:34defn_why is also the first programmer i ever read or followed that wasn't 100% technical, with no apologetics for being artsy and abstract
00:34cooldude127danlarkin: in fact i think that is the actual memoize source code
00:34defnim a _why-type programmer
00:34cooldude127defn: yeah _why's poignant guide is AMAZING
00:35defnhe makes me feel like so much less of an outsider in the programming community -- my ideas are usually like "ooo let's make a generative art thingy that makes neat stuff to look at for no good reason!"
00:35technomancycooldude127: that file you pasted works if you toss a (run-tests) on the end
00:35defncooldude127: yeah that is a fantastic book
00:35cooldude127technomancy: you're right, it does! WHY?
00:35defncooldude127: i got my girlfriend to learn ruby with that book
00:36defnsomeone you would NEVER expect to dip their toes in
00:36cooldude127defn: was she a computer-type person before that?
00:36technomancydefn: at RailsConf I heard him stop someone in the hall to explain all about Dog Scouts: http://www.dogscouts1.com/
00:36defncooldude127: no, not at all
00:36cooldude127lol wow
00:36technomancyno context or anything, just "so there are these dogs that are scouts and get badges and stuff..."
00:36technomancyvery surreal.
00:36defndude wtf
00:36cooldude127i can't imagine my girlfriend learning how to program
00:36defnwhy cant i be that awesome
00:36cooldude127defn: i wonder about that sometimes
00:37technomancycooldude127: well I'm done for tonight. I'll push out my stuff, but if you have any leads please keep it rolling.
00:37cooldude127technomancy: of course
00:37defnthose are the thoughts going on in my head that i filter so as to look in control and useful
00:38defnsometimes in the middle of a meeting at work i just want to say "diana ross" or "muppet babies rule"
00:38technomancycooldude127: pushed out; lemme know how it goes.
00:38defncooldude127: sorry to interrupt you guys
00:39defni just like technomancy
00:39defni have a man crush on him
00:39cooldude127we all do
00:39cooldude127especially after emacs-starter-kit
00:40danlarkinI think I liked it better when this channel was 99% on topic :-/
00:40cooldude127lol
00:40defndoes a channel name always dictate what on-topic is?
00:41cooldude127it's supposed to
00:41defnwhat if all of the stuff im saying is generated by clojure?
00:41danlarkinthen I'd love to see your code :)
00:41cooldude127technomancy just pimped his clojure-test-mode on twitter
00:41defnhaha! touche
00:41cooldude127damnit growl
00:42defnwhat if what im typing is really just obfuscated clojure being interpreted and molded to fit the current context?
00:43defnafter all my nick is 'defn'
00:43slashus2What is a concrete example of where atoms would be very useful besides that of memoize. Would I use it inside of a function were I want a locally mutable reference?
00:43cooldude127slashus2: i think so, but you should probably try to avoid needing that
00:43hiredman(map (partial map inc) (replicate 10 (range 10)))
00:44cooldude127purely functional code is better
00:44hiredmanD[D[D[D[D[D,(map (partial map inc) (replicate 10 (range 10)))
00:44hiredmanthe hell
00:44hiredman,(map (partial map inc) (replicate 10 (range 10)))
00:44clojurebot((1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10))
00:44slashus2I know that, but an atom is much better than using a reference inside of a function?
00:45slashus2ref*
00:45cooldude127slashus2: yes
00:45hiredman,(let [f #(fn [& y] (apply % (reverse y))] ((f map) (replicate 10 (range 10)) (partial map inc)))
00:45clojurebotUnmatched delimiter: ]
00:46hiredman,(let [f #(fn [& y] (apply % (reverse y)))] ((f map) (replicate 10 (range 10)) (partial map inc)))
00:46clojurebot((1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10))
00:46slashus2I am still adjusting. Came from a world of mutability.
00:46cooldude127slashus2: try some haskell first. get forced out of it
00:46cooldude127:)
00:46slashus2noo
00:46slashus2:-P
00:46hiredmanatoms are better for local low contention things
00:46hiredmanrefs for global high contention
00:48slashus2Say in a genetic algorithm, I am trying to do a single crossover mating on two vectors. I could create an atom referencing the first part of the slice, and then use that atom to construct the rest of the offspring's dna.
00:49hiredman,(let [f #(fn [& y] (apply % (reverse y)))] ((f map) (replicate 10 (range 10)) ((f partial) inc map)))
00:49clojurebot((1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10) (1 2 3 4 5 6 7 8 9 10))
00:50defnHow hard would it be to make something similar to that of say, a TI-89?
00:51defnWhy does Texas Instruments have such a monopoly on the graphing calculator?
00:51slashus2A clojure powered graphics calculator!
00:51hiredmanslashus2: I have never done any genetic programming, but it seems like that could just be a function of the two vectors, why do you need some mutable state?
00:52slashus2I am still partial to looping and mutation.
00:52defnslashus2: Yeah I'd love to do it-- I just don't really know where to start, but I suppose if I think about it long enough...
00:52slashus2I will grow out of it.
00:52danlarkinit's very, very hard
00:52hiredman,(vec (map + [1 2 3 4] [10 20 30 40]))
00:52clojurebot[11 22 33 44]
00:52defndanlarkin: really?
00:53danlarkinreally
00:53defndanlarkin: What is so difficult in your estimation?
00:54danlarkinthey use very advanced formulae in those calculators for derivation and integration
00:54danlarkinin order to give you an answer in a reasonable amount of time
00:54hiredman,(let [f #(fn [& y] (apply % (reverse y)))] ((f map) (replicate 3 (range 3)) ((f partial) inc map)))
00:54clojurebot((1 2 3) (1 2 3) (1 2 3))
00:54cooldude127danlarkin: i have some symbolic math code in clojure that understands a few derivative rules :)
00:55defncooldude127: I would love to see it!
00:55cooldude127it's mostly ported from the PAIP book
00:55hiredmanobfuscation would be easier if clojure had a built in flip function
00:55cooldude127defn: it's in math/symbolic.clj on http://github.com/cooldude127/clojure-code/
00:56hiredman,(import '(java.util LinkedList Collections))
00:56clojurebotnil
00:56defncooldude127: thanks so much
00:57slashus2It would be cool if clojure had built-in symbolic math stuff.
00:57greghSICP also has some symbolic differentiation code: http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-18.html#%_sec_2.5.3
00:57slashus2It would be a really good thing.
00:57hiredman,(let [f #(fn [& y] (apply % (reverse y))) shuffle #(let [a (LinkedList. %)] (Collections/shuffle a) a)] ((f map) ((f map) (replicate 3 (range 3)) ((f partial) inc map)) (partial map shuffle)))
00:57clojurebotjava.lang.ClassCastException: java.lang.Integer cannot be cast to java.util.Collection
00:58cooldude127slashus2: i'm gonna keep working on this, maybe it will become the definitive
00:58hiredman,(let [f #(fn [& y] (apply % (reverse y))) shuffle #(let [a (LinkedList. %)] (Collections/shuffle a) a)] ((f map) ((f map) (replicate 3 (range 3)) ((f partial) inc map)) shuffle))
00:58clojurebot(#<LinkedList [3, 2, 1]> #<LinkedList [2, 1, 3]> #<LinkedList [3, 1, 2]>)
00:58cooldude127hiredman: don't you have your own repl? :-p
00:58slashus2Not very many good languages have thing feature built-in.
00:58hiredmanI am trying to inject some clojure into #clojure
00:58slashus2that*
00:59slashus2That code makes my heart skip a beat. :-P
01:01hiredmanI'll spare you the corrected shuffle that calls seq on the LinkedList
01:02slashus2Flexing his functional programming muscles.
01:02hiredman~hiredman
01:02clojurebothiredman is slightly retarded
01:03danlarkinok I'm off to bed, giving up on actually getting a jar tonight
01:04slashus2The behavior of the repl when you run java -jar clojure.jar doesn't have an up arrow history feature, or allow you to hit the back arrow. Is this normal?
01:04cooldude127woo! :
01:04cooldude127math.symbolic> (simp '(d (* 2 x) x))
01:04cooldude1272
01:05cooldude127math.symbolic> (simp '(d (* 2 (** x 2)) x))
01:05cooldude127(* 2 (* 2 x))
01:05cooldude127could use a few more rules :)
01:06defnWhy don't paint applications ever let you use a trackpad like a wacom? You have to click the mouse button.. It ruins the whole thing.
01:06defnIt should be like finger painting on a trackpad.
01:08hiredmanslashus2: use rlwrap
01:08hiredmanrlwrap java -jar clojure.jar
01:10slashus2rl is referring to the readline library right?
01:10hiredmanyes
01:10defnmath.symbolic> (simp '(d (* x (** 2 x)) -1))
01:13cooldude127defn: that doesn't sound right
01:14cooldude127nope, fails awesomely
01:14cooldude127(+ (* x (d (** 2 x) -1)) (* (** 2 x) (d x -1)))
01:14cooldude127math.symbolic> (simp '(d (+ (* 2 (** x 2)) (* 4 x)) x))
01:14cooldude127(+ (* 4 x) 4)
01:14cooldude127yay
01:15slashus2cooldude127: You should make to accept in-line input as well.
01:15slashus2it*
01:15cooldude127slashus2: what do you mean?
01:15slashus2dx x**2
01:15slashus2or something like that
01:16cooldude127slashus2: you mean infix
01:16slashus2yes yes
01:16cooldude127and to that i say: no
01:16slashus2sorry
01:16cooldude127not fun
01:16cooldude127lol
01:16cooldude127infix is gross and requires handling precedence
01:16slashus2It would be nasty.
01:17cooldude127the one i ported this from handles infix, but i didn't want to bother
01:17cooldude127if you want to use lisp, use prefix
01:18slashus2I know, I just wanted to see your reaction.
01:18cooldude127lol
01:18cooldude127well, i'm off to bed, i'm gonna work on this more tomorrow...err, today, but later
01:18slashus2I thought you might do something like *head explodes*.
01:18cooldude127haha
01:18cooldude127i should have
01:18cooldude127anyway, good night
01:19slashus2night
01:20defncooldude127: iyou gone yet?
02:38qmrwhow do I convert an integer into a Character or String? I tried (Character. 65) but that gives exception java.lang.ClassCastException: java.lang.Integer (NO_SOURCE_FILE:0)
02:39qmrwi guess i ask, how to convert Integer into a char?
02:40slashus2(char 56)?
02:42qmrwman i feel so relieved and stupid, thanks!
02:42slashus2(int \H) => 72
02:43qmrwah, now those two functions complete the picture
03:29alinp,(doc lazy-seq)
03:29clojurebot"([& body]); Takes a body of expressions that returns an ISeq or nil, and yields a Seqable object that will invoke the body only the first time seq is called, and will cache the result and return it on all subsequent seq calls. Any closed over locals will be cleared prior to the tail call of body."
03:30alinphi
03:31alinpcan anyone help me regarding a demo for lazy evaluation in clojure ?
03:31alinpI understand that the expression will not be evaluated unless needed
03:32alinp(I'm coming from strict env, java and it's little bit strange for me to understand the behavior of lazy evaluation)
03:44alinp,(doc lazy-cons)
03:44clojurebotjava.lang.Exception: Unable to resolve var: lazy-cons in this context
03:44achim_palinp: anything specific you don't understand?
03:45alinpI need something like for idiots to explain what is lazy evaluation :)
03:46alinpthe thing is that I know something about it, but I don't want to get the wrong idea and live with it
03:46alinpsome examples with and without lazy evaluation will help a lot
03:46alinpto see what's the difference in a real example
03:50alinpuser=> (doc lazy-cons)
03:50alinpjava.lang.Exception: Unable to resolve var: lazy-cons in this context (NO_SOURCE_FILE:1)
03:50alinpc'mon ...
03:51alinpso... where's my lazy-cons ?
03:51hiredmanlazy-cons is gone
03:51slashus2alinp: (range 10) would be a good example of a function returning a lazy sequence. I could do (range 1000000000) and it wouldn't take any time; it only guarantees that I will have up to that many numbers if I request them; not loading all of those numbers into memory. (take 5 (range 100000000)) will take the first 5 numbers of that lazy sequence.
03:52hiredman~def lazy-seq
03:52hiredman(doc lazy-seq)
03:52clojurebotTakes a body of expressions that returns an ISeq or nil, and yields a Seqable object that will invoke the body only the first time seq is called, and will cache the result and return it on all subsequent seq calls. Any closed over locals will be cleared prior to the tail call of body.; arglists ([& body])
03:53alinpslashus2: thanks, it's very clear now
03:53alinpat least as simple as it sounds
03:53alinpother q now: why lazy-cons was removed ?
03:54achim_palinp: are you using the latest svn revision?
03:54alinpyes
03:54hiredmanthe creation of seqs needed to move up a level of abstraction to provide fully lazy seqs
03:54alinpoh, I see
03:55achim_pclojure's laziness model changed very recently - most of the (unofficial) documentation you'll find online won't reflect that ...
03:55alinpachim_p: I noticed that
03:55alinpso, btw
03:55hiredmanachim_p: the official api page doesn't reflect it either
03:55alinpit's a good thing to use svn version ?
03:55alinpshould I use some release ?
03:55hiredmanalinp: most do
03:56alinpI see
03:56alinpit's very frustrating to find myself tomorrow without a function :)
03:56alinpI mean .. I write some piece of code today and tomorrow it makes no sense
03:57hiredmanweird
03:57alinpmaybe the doc should be up to release version ?
03:57alinpbtw, the API doc from clojure.org is for release version ?
03:57hiredmanthe api page is targeted at the latest release which was from december
03:58slashus2Is there a release schedule?
03:58alinpby realease I mean 20081217
03:58alinpoh, ok
03:58hiredmanslashus2: nope
03:59alinpthanks guys for infos
03:59slashus2It will probably be a while before the language stabilizes I trust?
03:59achim_palinp: i'd suggest switching back to svn <= 1286 for now
03:59hiredmanrhickey is trying to get everything in shape for 1.0 because after that the ideal would be no breaking changes
04:00alinpso, there will be a 1.0 version .. yey
04:00alinpI asked on mailing list ... that maybe some -v arg should be available for clojure
04:00hiredmanwell, I was expecting 1.0 a month or two ago, so...
04:00alinpI'm pretty sure that will be, right ? when a version will be
04:01alinpone more q ...
04:01alinphiredman: do you know if 1.0 will be a branch from current trunk ?
04:01alinpI mean, the trunk is targeted to be 1.0 ?
04:01slashus2After the integration of full laziness, it will probably be pretty unstable for a while?
04:02hiredmanwhat else would it be?
04:02alinpwell, I don't know
04:02alinpmaybe is working in parallel for version 1.0 to other branch
04:02hiredmanslashus2: maybe a few days, a week at the most I imagine
04:02alinpthat's why I'm asking
04:03hiredmanrhickey moves fast
04:03alinpI really noticed that :)
04:03hiredmanand contrib already builds, so it just needs so testing
04:03hiredmanthe main thing will be the libraries out there to catch up
04:05hiredmanclojurebot got updated to lazy today, the amount of changes required was a few lines here and there. I had one function that someone else contributed that I did not unstand stop working
04:06hiredmanuh, well, I guess it is yersterday now
04:16alinphiredman: can you please tell me (or link) what exactly is a special form ?
04:16alinpform and special form
04:16alinpform != special form ?
04:16alinp:)
04:17AWizzArdspecial form is a subset of the set of all forms
04:17AWizzArdA form is something that can be evaluated
04:18alinpso, a function is a form ?
04:18alinpa function can be evaluated, right ?
04:19AWizzArdthe code that you write down can potentially be a form
04:19AWizzArdthe Common Lisp Hyperspec defines it as: form n. 1. any object meant to be evaluated.
04:19hiredman"form" more else means a s-expression
04:19AWizzArdno
04:19AWizzArdthis is not a form:
04:19AWizzArd,(hahaha 15)
04:19clojurebotjava.lang.Exception: Unable to resolve symbol: hahaha in this context
04:20AWizzArdas long hahaha is not defined as a function the s-expression (hahaha 15) is not a form
04:20hiredmanAWizzArd: I am not attempting to pin the thing down
04:20AWizzArdgood :)
04:21hiredmanI am giving a very inprecise, but in most cases good enough answer
04:21AWizzArdright
04:21jdzAWizzArd: i don't agree
04:21alinpok, thank you
04:21AWizzArdjdz: what I said is from Kent Pitman
04:22AWizzArdI discussed this issue with him in April 2005.
04:22jdzso what you mean is that formness of an s-expression depends on dynamic context?
04:23jdzand one cannot talk about something being a form without first trying it in runtime environment?
04:23AWizzArdI asked him: "IF (foobar 1 2) is also a form, what then is /not/ a form?"
04:23AWizzArdHe answered: "Something you don't intend to evaluate."
04:23jdz)foobar 1 2( definitely is not a form
04:23AWizzArdagreed
04:24AWizzArdAn expression is an object that either does not appear at all in a form or appears in a place that doesn't follow normal evaluation rules. e.g., in (defun foo (x) (declare (fixnum x)) (+ x 3)) the expression (fixnum x) appears, but is not something intended to be executed (nor is it executed; its position in the expression prevents the evaluator from reaching it).
04:24AWizzArdAlso from Pitmans mail.
04:25hiredmanalinp: special forms are forms that having something is not a function or a macro as the first (the operator position)
04:25hiredmandef is not a function or a macro, (def a 1)
04:25AWizzArdhttp://www.lispworks.com/documentation/HyperSpec/Body/26_glo_s.htm#special_form
04:25jdzi'd say special forms are the ones you cannot express in the language itself (they have to be implemented by lower-level means)
04:25jdzlike, for instance, lambda
04:27jdzoh, i mean special operator above (using CL terminology)
04:27AWizzArdhttp://www.lispworks.com/documentation/HyperSpec/Body/26_glo_f.htm#form
04:27hiredmansee, my answer "forms are basically s-expressions" is far more useful an answer then arguing about symatics and pasting stuff from the hyperspec
04:28AWizzArdhiredman: it is not my answer vs yours. I already agreed that in most cases s-expressions can be seen as equal to forms. It is just the matter of providing the definitions.
04:29hiredmanAWizzArd: clojure is not common lisp, and while it may use some of the same terms as cl they do not have the same symantic content
04:29AWizzArdSeveral things of what the CLHS states are true for all members of the Lisp family.
04:30AWizzArdIt makes no sense to invent a completely new vocabulary for Clojure. And especially not one that contradicts the one that already is in use for some decades.
04:31hiredman"there are only so many good names"
04:31AWizzArdAnyway, I have a question, maybe you have an idea:
04:31AWizzArdProblem: generating n pairwise different random numbers between a and b. The general idea would be: (take 4 (set (repeatedly (rand-int 20))))
04:31AWizzArdbut this does not work, as set eagerly tries to eat as much it can from the infinit set of random numbers
04:32achim_pthe (non-)formness of "(foobar 1 2)" in clojure might be different from CL, because CL does different things to symbols read during read time. anybody remember the details? i sure don't :)
04:33hiredmanhmmm
04:33AWizzArd(take-while (not= 4 (count (set (repeatedly (rand-int 20))))))
04:33jdzachim_p: i don't think this example represents what you mean (whatever it is)
04:33AWizzArdI see no way to have infinit/lazy sets right now.
04:33AWizzArdOr is there maybe a nice trick to express this problem in a highlevel way?
04:34jdzAWizzArd: how about making a set from 4 elements taken from the inifinite sequence?
04:34jdzmake it 8
04:34hiredmanyou can, it just would not be a set, it would be a lazy seq
04:34hiredmanhmm
04:35AWizzArdand the lazy seq does not have the semantics of storing only one copy of each object
04:35hiredmanit could
04:35hiredmanhmmm
04:35hiredmanyeah, it would not be pretty
04:35AWizzArd,(take 4 (set (take 1000 (repeatedly #(rand-int 20)))))
04:36clojurebot(0 1 2 3)
04:36AWizzArd,(take 4 (set (take 1000 (repeatedly #(rand-int 20)))))
04:36clojurebot(0 1 2 3)
04:36AWizzArd:)
04:36AWizzArdthis guy orders them ;)
04:36achim_pi roughly remember rhickey stating "a symbol is just a symbol in clojure" and that it would be different in CL. thus i'd argue (hahaha 1 2) is a form regardless of hahaha being defined.
04:37hiredman(doc hash-set)
04:37clojurebotReturns a new hash set with supplied keys.; arglists ([] [& keys])
04:37AWizzArdachim_p: it has nothing to do with the behaviour of the reader.
04:37jdzachim_p: that would be the other way around actually, because CL has dynamic environment (there could be a symbol-unbound handler established, like it is in the REPL usually)
04:38hiredman,(take 4 (apply hash-set (take 1000 (repeatedly #(rand-int 20)))))
04:38clojurebot(0 1 2 3)
04:39hiredman,(take 4 (apply hash-set (repeatedly #(rand-int 20))))
04:39AWizzArdI suppose that killed the bot?
04:39hiredmannah
04:39AWizzArdah okay, it stopes after 5 secs, good
04:39hiredmanclojurebot: still good right?
04:39clojurebotNo entiendo
04:39jdzi don't understand why you'd expect that to work, actually
04:39hiredmanblew the heap
04:40AWizzArdjdz: how would you wish to state that problem to express the idea?
04:40AWizzArdI mean, in a highlevel and efficient way
04:40hiredmanjdz: I site the case of "you never know"
04:41AWizzArdset could be growing lazily
04:41hiredman,(let [a #(first %&)] (apply a (iterate inc 0)))
04:41clojurebot0
04:41jdzi don't quite understand what you want to achieve, because i think what you want is (hash-set (take 4 (repeatedly #(rand-int 20))), but it clearly is not because then you'd write it that way
04:42AWizzArdjdz: the random numbers should be pairwise different
04:42AWizzArdif we just take n out of that seq then there could be duplicates
04:42jdzoh, right, no duplicates
04:42AWizzArdthat is what makes it interesting imo
04:43AWizzArdthere are lots of inefficient ways, and of course the efficient low-level way
04:44AWizzArdI am just curious if I maybe missed something that allows to express the idea in an elegant way, but is efficient as well
04:44jdzwell, you can write your own lazy-sequence that has a set inbetween...
04:44AWizzArdfor example, for shuffeling a vector I would love to say (sort random my-vector)
04:44jdzyou can express it in a very elegant way using loop/recur :)
04:45AWizzArdbut Java does not like it that 2 > 1, and 1 > 5, and 5 > 2
04:45AWizzArdjdz: yes *g*
04:45jdzAWizzArd: shuffling a vector is not that trivial
04:45jdzif you want to do it correctly, that is
04:46achim_pAWizzArd: distinct?
04:46jdzand wanting your sort+random to work is a bad idea mio
04:47jdz*imo even
04:47achim_p,(take 4 (distinct (repeatedly #(rand-int 20))))
04:47jdz,(doc distinct)
04:47jdzwhat, clojurebot is not threaded?
04:52jdzlooks like distinct is what AWizzArd is after, but why does it not quite work?
04:56achim_pjdz: hmm, it doesn't?
04:56achim_puser=> (take 4 (distinct (repeatedly #(rand-int 20))))
04:56achim_p(7 4 16 14)
04:56jdzoh, it does. it's just that clojurebot is dead
05:03AWizzArdachim_p: looks good, I must try it
05:03AWizzArdthx hiredman, jdz and achim_p
05:03jdzAWizzArd: the source to distinct is actually the loop/recur i had in mind :)
05:06AWizzArdyes, of course
05:06AWizzArdjdz: can we maybe use this example code of achim_p to shuffle a vector?
05:07AWizzArdthough it would be damn inefficient, forget it
05:07AWizzArdidea was to use that code for generating the order of indexes
05:09djpowellSimpleDateFormat is a pain. It is so un-thread-safe that it mutates itself during a call to .parse if I remember. You can imagine the hilarity that caused when I was writing a web-based calendar sync app once.
05:09achim_pshould be n log n, right? you can shuffle in linear time, but not in pure clojure
05:09djpowellit might be handy if there was a way to have a dynamic var rebound to a new instance of an object in each thread for using such un-thread safe objects
05:09AWizzArdwtf, (time (def x (take 100000 (distinct (repeatedly #(rand-int 100000)))))) only takes 250-300 msecs on my machine?!
05:10jdzachim_p: why not? i'm just writing vector shuffling which i think will be linear time...
05:10AWizzArdah, damn.. of course, as take is lazy
05:12jdzAWizzArd: what does laziness has to do with it?
05:12jdz*have
05:13jdzAWizzArd: i mean, where did you expect any slowness?
05:13AWizzArdwell, just do (time (count x)) :)
05:13achim_pjdz, well, technically indexed access in clojure is logarithmic
05:13AWizzArdI wanted to see how big my vectors (which I want to shuffle) could be with that method
05:14achim_pthat might matter for huge vectors - you won't beat java's shuffle
05:14jdzachim_p: there are no indexed accesses in that code...
05:15achim_pjdz: fisher yates shuffle?
05:15AWizzArdachim_p: you mean there already is a shuffle in Java?
05:15AWizzArdachim_p: schau mal deine Messages an :p
05:15jdzachim_p: no, i was talking about the AWizzArd's nanobenchmark
05:15achim_pAWizzArd: http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collections.html#shuffle(java.util.List)
05:17jdzachim_p: i actually can't remember exact names of the correct shuffling algorithms because i came up with a correct one myself when i needed it :)
05:23AWizzArdclojurebot: max people
05:23clojurebotmax people is 149
05:23AWizzArd,(.shuffle (java.util.Vector. [10 20 30 40]))
05:23clojurebotjava.lang.IllegalArgumentException: No matching field found: shuffle for class java.util.Vector
05:24jdz,(java.util.Collections/shuffle (java.util.Vector. [10 20 30 40]))
05:24clojurebotnil
05:25jdz,(let [vec (java.util.Vector. [10 20 30 40])] (java.util.Collections/shuffle vec) (seq vec))
05:25clojurebot(30 20 10 40)
05:27AWizzArdokay, I missed that shuffle was a static method, thx
05:28AWizzArdHallo the Lau.
05:28Lau_of_DKHey AWizzArd
05:28Lau_of_DKAny gen-class gurus in here ?
05:35Lau_of_DKI have Class1, which is inherited from Class2, Class2 has a protected member: display, which I need to expose to my own class, which has Class1 as superclass, like
05:35Lau_of_DKpublic class MyClass extends Class1
05:35Lau_of_DKHow do I expose that field?
05:43cgrandLau_of_DK: :exposes {display {:get get-display :set set-display}}
05:45cgranderr I mean :exposes {display {:get getDisplay :set setDisplay}}
06:02Lau_of_DKcgrand: I get a "No matching field found" error - Do I need something like Class2$display ?
06:14cgrandLau_of_DK: hmm, let me check genclass.clj
06:19cgrandLau_of_DK: is "No matching field found" the exact message you get?
06:21cgrandor do you get "field, display, not defined in class, Class1, or its ancestors
06:25cgrandLau_of_DK: hmm I think I got it: how do you _use_ the exposed field?
06:28cgrandyou have to access it through (.getDisplay this) not through (.display this)
06:39djpowellhmm, anybody had any problems with using :load and :gen-class together?
06:40djpowellI seem to be getting Var blah/blah is unbound exceptions at runtime for a function that was in the loaded file
06:42djpowellIs :load pretty much a straight include
06:44Lau_of_DKcgrand: I think my usage was the problem :)
06:45Lau_of_DKIt was - Thanks alot!!
06:54djpowellAh, I think it might be cause I'm doing something with #=
07:07djpowellI think my problem was that #= stuff is read at read time, so having a file that defines a function used in an #= expression, and then tries to use it doesn't work, cause the function doesn't get implemented until after read time
07:07AWizzArdthe new clojure still does not work with slime, right?
07:08AWizzArdI just checked out 1291, but when starting slime it still complains java.lang.Exception: Unable to resolve symbol: lazy-cons in this context (core.clj:70)
07:09jwinterWhat do you get when you start Clojure's stand-alone Repl?
07:10AWizzArdthat works
07:10jwinteroh
07:10arbschtAWizzArd: that will be because swank-clojure has not been updated to work with the newly merged lazy features
07:11AWizzArdprobably
07:11arbschtas rich suggested in the announcement, if you're not interested in updating tools and libraries, best to wait instead of updating your clojure
07:11AWizzArdsure
07:13djpowellwhy? is there going to be some back compat added?
07:14djpowelloh ok - I see, just give time for tools to get updated
07:15AWizzArdericthorsen: does Enclojure already support the new clojure.jar?
07:15rfgpfeifferdjpowell: back compat is (binding [rest next] ...)
07:29djpowellHas anyone experimented with definline btw? Is it worth the effort?
07:35leafwdjpowell: it's just a thin layer over macros, really.
07:35ericthorsenAWizzArd: Not yet. As I understand it, Rich is in the midst of the merge (although it may already be up).
07:36ericthorsenAWizzArd: We have a release that will go up today and then we are going to integrate the new clojure.jar as the next task
07:38djpowellIs it related to the :inline metadata?
07:39Chouserdjpowell: yes, it's related
07:41AWizzArdericthorsen: sounds good, I will be glad to try out the new Enclojure then.
07:41AWizzArdI will try it with the version short before the lazy-merge
07:41Chousera fn with :inline metadata can be treated like a function (passed to 'map' or 'filter', stored in a collection, etc.) in which case the :inline stuff is ignored
07:42Chouserhowever if the fn is called simply, in a context where a macro would work, the :inline expansion is used instead.
07:43djpowellOh ok.
07:44Chouserdefinline produces both from a single macro-like definition, so you don't have to write both versions
07:45Chouserit's useful if your fn takes primitive args and passes them along to Java methods or other inline fns. It allows you to avoid a box/unbox round.
07:46jdzChouser: is it something like compiler-macros of CL?
07:46Chouserjdz: I don't know CL well enough to say. Got a link?
07:47jdzfile:///Users/jdz/Documents/Specifications/HyperSpec-7-0/HyperSpec/Body/26_glo_c.htm#compiler_macro
07:48jdzcompiler-macros are a cross breed of macros and functions
07:48jdzthat's why i think definline might be something similar
07:49jdzmore information on compiler-macro: file:///Users/jdz/Documents/Specifications/HyperSpec-7-0/HyperSpec/Body/m_define.htm#define-compiler-macro
07:53AWizzArddoes Java have bit arrays? Those that store bits in real bits, and not use bytes under the hood to represent a single bit?
07:54AWizzArdI want such an array of one billion bits which should eat around 125 MB ram
07:55jdzBigInteger
07:55Chouserjdz: after some quick reading, I think that CL compiler-macros are used for rather different purposes than :inline fns
07:56Chouserjdz: :inline is a little performance hack to work around Java's lack of tagged numbers.
07:57jdzChouser: i have not seen any uses of definline myself (actually now is the first time i first see it exists); can you please point to some uses of it?
07:57Chouserthe :inline and fn parts are expected to do the very same thing, not different things like compiler-macros
07:58Chouser~def +
07:59Chouser~def floats
07:59leafw[now that is a colol feature of clojurebot]
07:59leafws/colol/cool/
08:00Chouserhm, the floats link missed by a few lines.
08:00Chousergotta go, bbl.
08:00durka42yeah, some of the links are off. clojurebot could be reading metadata from a slightly out of date build
08:03jdzChouser: well, compiler-macros are expected to do the same thing as the original function; a conforming implementation can freely ignore them. the point of them is to perform some preprocessing if argument types or values are known at compilation time (like, it can rewrite (expt x 2) as (* x x))
08:04jdzlooks like compiler macros are a higher level abstraction of what :inline metadata tries to provide.
08:05jdzor, if somebody has written (expt 2 3) in their code, compiler macro could replace that by 8.
08:06jdzwould be an order of magnitude more useful if the envorinment access stuff was standardized (could use compiler inferences then, too)
09:28gnuvinceIs anyone currently working on getting swank-clojure to work with the latest clojure trunk?
09:28cooldude127is there a function in clojure that gives the first index of an element in a collection?
09:28gnuvincecooldude127: the first index?
09:29cooldude127gnuvince: the index of the first occurence of an item
09:29gnuvincelike (index-of \a "bar") => 1
09:29gnuvinceSomething like that?
09:29cooldude127yes
09:29gnuvinceNot built-in as far as I know.
09:30gnuvince,(some (fn [[i e]] (when (= e \a) i)) "bar")
09:30clojurebotjava.lang.UnsupportedOperationException: nth not supported on this type: Character
09:30cooldude127yeah, this is the sucky part about porting from CL. sometimes it has functions we don't
09:30gnuvince,(some (fn [[i e]] (when (= e \a) i)) (indexed "bar"))
09:30clojurebotjava.lang.Exception: Unable to resolve symbol: indexed in this context
09:30gnuvince,(use 'clojure.contrib.seq-utils)
09:30clojurebotjava.io.FileNotFoundException: Could not locate clojure/contrib/seq_utils__init.class or clojure/contrib/seq_utils.clj on classpath:
09:30gnuvincewell, I suck at clojurebot it seems
09:30cooldude127gnuvince: gotta use your own repl, clojurebot has no contrib
09:31cooldude127plus i'm not on trunk
09:31cooldude127and clojurebot is
09:32gnuvince(some (fn [[i e]] (when (= e \a) i)) (indexed "bar"))
09:32gnuvince1
09:32cooldude127gnuvince: well maybe i can write my own with that
09:32cooldude127cool
09:33gnuvincecooldude127: there's also a similar function in Stu's book
09:33gnuvincePage 70 in beta 7
09:33cooldude127the thing is i also need to make it support a start parameter
09:33cooldude127to start looking at a certain point
09:34durka42just take a substring of "bar"?
09:35cooldude127durka42: i was thinking just do a subseq, then add back the start parameter
09:35cooldude127it should be noted i don't plan to use this with strings
09:35cooldude127lists
09:35cooldude127are more what i'm interested in
09:36durka42what are you on besides trunk?
09:36cooldude127durka42: older trunk
09:36cooldude127before the laziness
09:36durka42ah
09:36cooldude127i'm not ready
09:37Chouserwise
09:37cooldude127i've got working clojure, i don't feel like messing with it yet
09:38Lau_of_DKswank-clojure and slime still are fitted to the new rev ?
09:39djpowellAWizard: Java has java.util.BitSet - will that do?
09:41AWizzArdyes, looks good to me
09:41cooldude127wait does subseq not do what i think it does?
09:42AWizzArddjpowell: do you happen to know if it will try its best to use really just bits under the hood? (BitSet. 1billion) <-- needs +/- 125 MB ram?
09:42Chousercooldude127: works on sorted collections
09:42Chousercooldude127: there's also subvec, but if you're just working on seqs, you probably just want drop
09:43cooldude127Chouser: yeah actually figured that out on my own :)
09:43Chousergood! :-)
09:43cooldude127the haskell experience before clojure was good for this
09:46cooldude127sweet i got it working for at least 2 test cases :)
09:48cooldude127make that 3
09:49cooldude127technomancy's clojure-test-mode is super cool, btw
09:50cooldude127buggy as all hell, but at the very least it will run your tests in the repl
10:22cooldude127pattern matching is some cool shit
10:23Chousercooldude127: you're doing that in clojure, or something else?
10:23cooldude127i'm porting the patmatch.lisp from PAIP to clojure
10:23Chouserok
10:23cooldude127for use with the symbolic math stuff
10:24cooldude127and it's awesome!
10:29AorHi. Is there anywhere to download the Clojure documentation, or will I have to scrape the site to get it?
10:29jbondesonregex are drugs: you start out in the gateway regex, and the next thing you know you're moving onto the hardcore stuff and you're writing 300+ char regex with multiple negative lookaheads...
10:30danlarkinwell they /can/ express anything, after all :)
10:30gnuvinceregexes are turing complete?
10:31danlarkinthey can express any DFA or NFA
10:31jbondesonthere are patterns they can't match, like counting.
10:32Chouserjbondeson: that's just weak Java regexen. Perl regex can do that.
10:32ChouserI think.
10:32jbondesonAor: you're probably going to have to scrape, the docs aren't in svn
10:33Hunperl regex are turing complete (even without using eval. you can do recursion)
10:33gnuvinceWhen I learned to program, the more I got comfortable with regexes, the more I tried to avoid them.
10:33danlarkinthat's an implementation detail.. regular expressions themselves (the formal language) are turing complete
10:33jbondesonChouser: no they can't (ex-perl regexer). you can't match x 'Q' chars followed by x+1 'R' characters
10:33jbondesonwhere x is variable
10:33Hunbut it's better in my experience to use a real parser generator once it gets more complicated than about 150 chars (all regex combined)
10:33gnuvincehttp://groups.google.com/group/comp.lang.lisp/browse_thread/thread/0d05837df1efe075
10:34Hundanlarkin: no, they aren't
10:34Hunturing complete is chomsky 0. regex cover regular strings (therefor the regular), which is chomsky 3
10:34Hunthere are a few layers between
10:34cooldude127SHIT! clojure doesn't have the dotted pair notation does it?
10:35Hunjbondeson: you can do that by using recursion or eval in the regex. but perl's regex aren't regular
10:35Chouserjbondeson: hm, even using (?{ }) ?
10:35jbondesonChouser: that's not regex, that's using perl IN the regex
10:35Chousercooldude127: use a vector length 2
10:35Chouserjbondeson: well...
10:35jbondesonit's not a regex anymore.
10:36jbondesonit's code embedded in a regex that fires on a match
10:36Huntrue
10:36Chouserjbondeson: then using your defintion of regex, I concur. :-)
10:36cooldude127Chouser: that's not what i mean tho. i'm dealing with the pattern matching, and i'm having a problem where i sort of need to splice in a match (substitute to get (+ 1 2 3) instead of (+ (1 2 3))
10:37Huni did that in CL once by using (apply #'apply list)
10:37Huni'm not sure if that's good style... don't think so
10:37jbondesonChouser: by the same token if you get the results of the match object in java and loop through to determine a match in java. perl just makes a shortcut
10:37danlarkinHun: you're right... seems my knowledge of automata is slipping :(
10:37cooldude127Hun: i was looking for an easy syntactical way because these are in a list of rules
10:38AWizzArdWhen someone connects to my compojure program, how can I find out which IP it was?
10:38Hunis this lisp or just a string? ergo can you be sure it's well-formed?
10:38cooldude127Hun: who you talkin to?
10:38Huncooldude127: to you
10:39cooldude127k, well then it's lisp: http://tinyurl.com/d49ddo
10:39cooldude127those are the current rules
10:40cooldude127i want one that splits up (+ 1 2 3 4 5) into (+ (+ 1 2) (+ 3 4 5)) and so on until i only have to deal with 2 addends
10:41Huni'd use something like a (reduce (lambda (x y) (list '+ x y)))
10:41cooldude127Hun: except this is not executable code. these are unevaluated lists of rules
10:41Hunhmm. ok, that breaks it down to a right-hanging tree. you could go on from there
10:42cooldude127maybe i shouldn't use rules for this part, maybe this is better done in code
10:42Huni'm not sure. can you do a funcall on a symbol in clojure?
10:42cooldude127Hun: i think you just resolve the symbol
10:42Hunergo can you (apply '+ '(1 2))
10:43cooldude127yes you can do that
10:43cooldude127which i didn't know
10:43cooldude127you can also do ('+ 1 2)
10:43Hunthen most of your problems should be solved, together with the reduce
10:44cooldude127oh wait, that doesn't work actually
10:44cooldude127it returns 2
10:44cooldude127not 3
10:44Hun(playing zippy) Looks like you are trying to build a math application. Maybe you want to read the corresponding pages in SICP.
10:44danlarkin,(#'+ 1 2)
10:44clojurebot3
10:44cooldude127oh
10:45Hunhttp://mitpress.mit.edu/sicp/full-text/book/book-Z-H-16.html
10:46danlarkindon't see why you need to quote it though
10:46danlarkin,(apply + [1 2 3])
10:46clojurebot6
10:46cooldude127danlarkin: wondering if we can call a symbol
10:46cooldude127as in something extracted from a quoted list
10:47Huncooldude127: that link's for you. they are doing something similar there
10:47danlarkin,(resolve '+)
10:47clojurebot#'clojure.core/+
10:47danlarkin,(apply (resolve '+) [1 2 3])
10:47clojurebot6
10:48cooldude127k
10:48cooldude127Hun: yeah i see
10:49cooldude127Hun: they're avoiding the problem that i'm dealing with here
10:49cooldude127they only deal with two items as well
10:50Hunthey're doing some really cool stuff in that book. like constructing a numeric tower from scratch
10:50cooldude127yeah i've seen some of it
10:50cooldude127SICP is pretty awesome
10:52cooldude127Hun: damnit, now you've got me wondering whether this rule-based method is the way to go.
10:52Hun:)
10:52cooldude127i like the elegance of the SICP method. all my logic is in code
10:52Hunnever underestimate the code some guys wrote 20 years ago
10:52cooldude127and to fix this problem, i would just change the way make-sum works
10:52cooldude127have it handle this problem
10:53cooldude127i've watched the lectures, these guys are brilliant
10:53cooldude127sussman was a co-creator of scheme, wasn't he?
10:53Huniirc yes
10:53Huntogether with the mighty steele
10:53cooldude127of course
10:54cooldude127hey well i'll bbiab. i'm in class and it just ended so i have to head to the next one
10:54yasonhey, I have a quick question. Is there a high-level changelog for Clojure somewhere?
10:55yasonI spent lots of time learning it a few months ago but now there's lots of new stuff and I'd just like to see the diffs, in the sense of what to read about in order to catch up
10:56jbondesonyason: the svn log is pretty high level
10:56jbondesonthough it doesn't give any specifics about how to call the new stuff
10:56yasonjbondeson: it's not the primary version control that developers use?
11:02AWizzArdbut don't forget:
11:03AWizzArd,('+ 1 2)
11:03clojurebot2
11:03AWizzArd:)
11:03cooldude127ok i'm back, and now for a new git branch to scrap all my old work :)
11:03Hunhrhr
11:04cooldude127Hun: was that supposed to be haha?
11:04Hunsomething like that
11:04AWizzArdI think he means:
11:04AWizzArd,('+ 1 2)
11:04clojurebot2
11:04cooldude127Hun: what's your keyboard layout?
11:05Hundvorak
11:05AWizzArdIt will try to look up the 1st element in '+ and if it doesn't find it, returns the default of 2
11:05Hunhrhr can be typed with one hand, haha needs both
11:05AorHm, so no-one knows if there's offline documentation? I'll take that as a no then...
11:06cooldude127Hun: i thought it could be colemak, what i use, cuz a and r are right next to each other
11:06AWizzArdHun: I use the NEO-Layout. For me it's the same as with dvorak.
11:06Chouseryason: you might get such a changelog with the next release.
11:07Chouseryason: until then the svn log is probably your best bet
11:07Hunalso i think of ernie from sesame street :)
11:07yasonChouser: ok, that sounds reasonable. I've spotted some experimental stuff such as streams by observing the clojure mailing list but it's probably best to catch-up with non-experimental features first
11:08Chouserthere's definitely demand for some kind of weekly or monthly high-level update on the world of clojure, but nobody has taken on the task that I know of.
11:08Chouseryason: I haven't heard definitively, but I think streams will be abandoned.
11:08yasonChouser: there are both low-level and high-level commits in the svn changelog but their number is low enough for one person to skim through them
11:09yasonChouser: Part of the constant change :)
11:09ChouserItems on the issues page name the svn rev where the change went in, but I don't think there's currently any link the other direction.
11:10ChouserIt'd be nice to have an automated page for that too.
11:11yasonChouser: method calls inside doto seems to require the prefix .dot now...
11:12yasonI guess most of such changes are found automatically when the program doesn't work. Might take time to spot the documentation change though
11:13Chouserthis might be useful too: http://clojure.org/space/changes
11:15yasonChouser: it is, thank you
11:21cooldude127damnit clojure, now i can't name my stuff var? cuz you took it!
11:21clojurebotsvn rev 1292; fixed (= (lazy-seq nil) nil)
11:25AWizzArdis it possible to name something + in ones own namespace?
11:26cooldude127AWizzArd: yes, if you shadow the old one i think
11:26clojurebotsvn rev 1293; fixed bean, patch from Chouser
11:26cooldude127AWizzArd: not a wise choice
11:26cooldude127but i think you can
11:28AWizzArd,(find-doc "shadow")
11:28clojurebotnil
11:29cooldude127it's something in use i think
11:32rhickeySo, for lazy destructuring - && ?
11:34AWizzArdrhickey: looks good
11:34danlarkinwe'll have to use that when destructuring a lazy sequence? would that be incompatible with regular seqs?
11:35rhickeydanlarkin: no, you can use & or && with any sequential thing, the former will force to seq/nil, i.e. it maps to next, the latter will not, i.e. it maps to rest
11:38danlarkinrhickey: ah, good. yeah && seems fine to me
11:40Chouserthat's better than '&rest'?
11:40ChouserI don't have an opinion yet, just asking.
11:42Chouser:rest
11:44BrackiWhat's clojure's equivalent of Python's dir()?
11:44BrackiAnd how do I inspect a struct?
11:44Chouser,(keys (ns-publics 'clojure.zip))
11:44clojurebot(lefts down insert-left up next path children vector-zip append-child zipper branch? end? leftmost edit replace insert-right root insert-child prev seq-zip xml-zip make-node rights node right left remove rightmost)
11:45ChouserBracki: I guess it depends on what you're inspecting. For a struct just print it -- either 'prn' or return it at the repl.
11:45shoover`Chouser: the variable to capture the rest is usually called rest, so I think [a b && rest] is better than [a b &rest rest]. &rest start to look like CL or elisp
11:46BrackiJust returning leads to this: java.lang.IllegalArgumentException: Wrong number of args passed to: PersistentStructMap
11:46Chousershoover`: no, you can't call it rest unless you wan to shadow the builtin fn by that name -- i'd recommend against it.
11:47Chouser[a b :rest etc :as all] doesn't look too bad, does it?
11:47shoover`Chouser: oh yeah, that :) guess I shouldn't look at clojure.core/and and /or
11:48Chousershoover`: yes, clojure.core shadows builtins too much for my liking.
11:48shoover`I'll buy :rest
11:48ChouserBut I guess it's more dangerous in code that will be edited by mere mortals.
11:49danlarkinI like && more than &rest
11:49BrackiWhat's clojure's toString equivalent?
11:49ChouserBracki: sounds like you're calling something instead of just returning a value.
11:49ChouserBracki: str
11:49cooldude127Bracki: str
11:50BrackiChouser: so how do I return it?
11:50Chouserdanlarkin: I think I do too. &rest is kinda ugly. I think I'd prefer :rest or && over &rest
11:51achim_pi prefer && too. it stands out more than :rest + it's shorter + it's more consistent (unless we get :next too)
11:51dreishMe three.
11:51Chouser,(create-struct foo :a :b :c)
11:51clojurebotjava.lang.Exception: Unable to resolve symbol: foo in this context
11:51cgrandwould (fn [x && args] ...) be possible?
11:51rsynnott1:rest is a little weird, as there's confusion with key arguments
11:52Chouser,(create-struct :a :b :c)
11:52clojurebot#<Def clojure.lang.PersistentStructMap$Def@1e03a61>
11:52Chouser,(struct (create-struct :a :b :c) 1 2 3)
11:52clojurebot{:a 1, :b 2, :c 3}
11:52Bracki,(defstruct thingy :a :b)
11:52clojurebotDENIED
11:53dreish,(.format System/out "P4 %d %d\n" (into-array [100 100]))
11:53clojurebot#<PrintStream java.io.PrintStream@194566d>
11:53dreish,(.format System/out "P4 %d %d\n" #=(into-array [100 100]))
11:53clojurebotjava.lang.RuntimeException: Can't embed object in code, maybe print-dup not defined: [Ljava.lang.Integer;@11456c5
12:01danlarkinwell there's a patch for hiredman, he shouldn't be allowing create-struct
12:01Chouserdanlarkin: why not?
12:02Chouserdefstruct has a side effect of creating a Var, but create-struct does not.
12:02achim_plisppaste8: url
12:02lisppaste8To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.
12:03danlarkinoh... yes... I rescind my comment
12:03lisppaste8achim_p pasted "destructuring too eager?" at http://paste.lisp.org/display/75719
12:04achim_pdestructuring expressions like [x & xs] seem to do more work than before since full laziness has been introduced ...
12:04Chouserwith && that ought to be reduced to printing just 1
12:04Chouserbut going to 3 now is interesting.
12:06dreishDoes it macroexpand to roughly the same things, plus or minus s/rest/next/?
12:13achim_pdreish: & is just a symbol, it's not a macro. the destructuring is happening on the java side of things
12:15Chouser,(macroexpand '(let [[a & r] s]))
12:15clojurebot(let* [vec__1958 s a (clojure.core/nth vec__1958 0 nil) r (clojure.core/nthnext vec__1958 1)])
12:17ozy`,(macroexpand '(let [a b] (f x)))
12:17clojurebot(let* [a b] (f x))
12:17danlarkinisn't there like a destructure function or something
12:18danlarkin~source destructure
12:19danlarkincurious, wrong line number
12:20Chouserbut I don't think that's being used here
12:20Chouser(defn f [& ls] (let [[x & xs] ls] x)) only consumes 2 items, as we'd expect for & (as opposed to &&)
12:20Chouser,(macroexpand '(fn f [x & xs] x)
12:20clojurebotEOF while reading
12:21Chouser,(macroexpand '(fn f [x & xs] x))
12:21clojurebot(fn* f ([x & xs] x))
12:32wlrhow about &n -> next and &r -> rest ?
12:32rhickeyif it's going to include a word, a keyword like :rest is best
12:33ChouserI doubt we'll get a gratuitous breaking change making & invalid.
12:33rhickey& maps to & in fn
12:33Chouserrhickey: are you looking at the fn & being less lazy than before?
12:34achim_p,(macroexpand '(fn [x & xs]))
12:34clojurebot(fn* ([x & xs]))
12:34rhickeyChouser: trying not to think about that - only matters for apply
12:36Chouserheh, ok.
12:36rhickeythe only problem with :rest is its length - doesn't feel like pattern matching
12:38rhickey[x : xs] might make Haskellers happy
12:38rhickey: is currently not a valid token
12:39Chouserlooks suspiciously like infix notation. ;-)
12:39Chouserthough I suppose & does too, come to think of it.
12:39rhickeyright
12:41rhickeyexcept they'd expect [a : b : cs] instead of [a b : cs]
12:41Chouserand since i've not heard anybody ask for (x & xs) to do cons, I guess nobody will ask for (x : xs)
12:41Chouserah
12:41rhickey:& is valid
12:45rhickeyif not suggestive of anything
12:47rhickey&& kind of suggests you are a step away from &
12:47achim_p[x ? xs], [x &? xs] ?
12:47achim_p'?' is currently a legal name though
12:49gnuvincerhickey: might it not be confused with logical and like in Java?
12:49jbondesoni don't think : is the way to go simply because it has those roots in list construction in haskell. something with & would be ok to me (even &:)
12:49rhickeygnuvince: oh yeah, Java, sure, it might
12:50rhickeyjbondeson: but its meaning here would match Haskell's at least for the [x : xs] case
12:51Chouserwould fn get this too?
12:51jbondesonrhickey: true, but then you do get to the issues of : not actually *being* a list construction. dunno. it's a tough one.
12:51rhickeyChouser: what would it mean for fn?
12:51jbondesonit would certainly make me feel at home to use :
12:52rhickeyjbondeson: it's not construction when used in pattern matching, which is similar to this binding situation
12:53jbondesonrhickey: it is a deconstruction, but it's the list deconstruction because it matching the construction as x -> x' : xs -> x
12:53Chouser(fn [a : b]) would get b as an unforced lazy-seq instead of a forced seq. But of course you asking means I must be missing something...
12:54Chousersomething like the fact that I'm asking for 'b' at all means I'm likely to at *least* see if it's empty or not.
12:54rhickeyChouser: outside of apply that doesn't matter, unless you want () when no extra args supplied?
12:55rhickey(defn foo [&& xs] xs)
12:55rhickey(foo) -> ()
12:55Chouserright, very little value. I withdraw my request.
12:56rhickeyI'm not sure it won't come up eventually, lazy apply
12:56gnuvinceIt might be surprising for some people to discover that [x & xs] works in both fn and let, but [x : xs] only works with let.
12:56gnuvinceI know it would surprise me.
12:57rhickeygnuvince: you can't use :as in fn already
12:58rhickeyChouser: I wonder about the empty test always being present
12:58gnuvince,((fn [x & xs :as all] [x xs all]) [1 2 3])
12:58clojurebotjava.lang.RuntimeException: java.lang.RuntimeException: java.lang.Exception: Unsupported binding form: :as
12:58gnuvinceDid that change recently?
12:58gnuvinceuser> ((fn [[x & xs :as all]] [x xs all]) [1 2 3])
12:58gnuvince[1 (2 3) [1 2 3]]
12:59gnuvinceoh
12:59gnuvinceduh
12:59rhickeygnuvince: the actual fn args are not a destructuring form
12:59gnuvince,((fn [[x & xs :as all]] [x xs all]) [1 2 3])
12:59clojurebot[1 (2 3) [1 2 3]]
12:59gnuvincerhickey: oh, I get it.
13:08danlarkinI still prefer && over all the other suggestions
13:10danlarkinI pronounce & as "and-args", and && makes sense to me as "lazy-and-args"
13:10danlarkinbut that's probably just me
13:15rhickeyI likes &&, it feels like :rest punishes those who want lazy, slightly
13:16jbondesoni can live with &&. i'll just have to stop thinking "boolean-and"
13:16Chouserwere you thinking bit-and for &
13:16Chouseror does Java not have that?
13:16rhickeyChouser: it does, good point
13:17jbondesonhaven't used too much of the destructuring forms, but yeah, years of C have ingrained the ampersands into my brain
13:17jbondesoni don't think it's an issue though
13:18jbondesonthe existance of & makes && logical
13:28cooldude127how long was it before scheme got macros?
13:29cooldude127cuz as far i can tell, SICP has no trace of them
13:29Hunpretty early. but scheme's macros are a whole different case
13:29cooldude127oh i know
13:29Hunhttp://www.cs.indiana.edu/~dyb/pubs/tr356.pdf
13:29cooldude127stupid hygienic macros
13:30jbondesonwhoa now... hygenic macros can be nice
13:30Hunyour down-to-earth-macros are afaik only implementation specific
13:30cooldude127jbondeson: hygienic macros can be REALLY daunting tho
13:31cooldude127clojure and CL macros are really easy to wrap your head around by comparison: here's some code, now translate it into some other code
13:33cooldude127wow i'm being a good little coder: all my functions have a with-test block around them
13:34jbondesonthe only problem with that is it makes your functions harder to read.
13:34cooldude127only a little, but it's SO CONVENIENT
13:37jbondesonwhen i first opened up a code file with everything wrapped in with-test i said, "holy crap there are no functions defined!"
13:37cooldude127haha
13:38cooldude127it reminds me of python's doctest, but more useful
13:38jbondesonit could probabaly be a bit more readable if the function body is explicitly separated from the test cases by a comment or something
13:38rhickeyIt's not either/or - I'd welcome a hygienic macro package for Clojure
13:40jbondesonclojure makes it a little nicer since you don't have to clutter your code with 8billion gensyms
13:40greghI saw an implementation of hygenic macros in terms of lisp macros once
13:40jbondesongregh: that had to be one nasty macro.
13:40greghhttp://www.ccs.neu.edu/home/dorai/mbe/mbe-lsp.html
13:44jbondesonsome times i miss CL code: "(cddadr synruledef)"...
13:46jbondesonlooking at that code, porting to clojure may not *to* terrible
13:47jbondesoncould be an interesting exercise.
13:50jbondesoni am just having a horrible typing day.
13:54cooldude127is there a standard clojure mechanism for signaling an error?
13:54cooldude127do i need to throw an exception?
13:58jbondesoni do believe so
13:59danlarkinor you can use error-kit!
13:59jbondesonthough i think it was Chouser that was working on a CL-like error system
13:59jbondesonis error-kit functional?
13:59cooldude127idk, i just made a function to wrap throwing the exception
13:59cooldude127(defn error [& message]
13:59cooldude127 (throw (Exception. (apply str message))))
13:59danlarkinfunctional as in usable? yes
14:00jbondesonhey look at that, error-kit is in contrib
14:00jbondesoni missed him adding it in
14:00danlarkinthere's some documentation in his mailing list posting about it
14:01jbondesonhaha, i love the "== EXPERIMENTAL ==" comment
14:02rsynnott1jbondeson: you could always write your own version of the cadadr-type things
14:02rsynnott1(though I'm not sure why anyone would WANT them)
14:02jbondesonrsynnott1: nostalgia
14:03jbondesonnext up: clojure.contrib.pretend-you-are-coding-cl
14:03cooldude127haha
14:06clojurebotsvn rev 1294; fixed reverse and sort to return () on empty coll
14:12cooldude127error kit looks cool
14:15cooldude127so what is the right way, in a ns declaration, to say use this namespace renamed as this
14:15cooldude127do i require it, then alias?
14:17achim_pcooldude127: (ns foo (require [clojure.zip :as zip]))
14:17cooldude127that's what i was looking for
14:22Chouserassert-if-lazy-seq only complains on lazy seqs, not on empty persistent lists.
14:22Chouser,(if (reverse nil) :t :f)
14:22clojurebot:f
14:23Chouser^^ that returns true as of 1294
14:23Chouseror :t rather
14:23Chouserand no exception thrown.
14:29rhickeyChouser: yeah, some of the library stuff still uses LazySeq.EMPTY, like ASeq.more(), but long-term, that's not going to be the case, will eventually use PersistentList.EMPTY. That is also its own type - PersistentList.EmptyList - we could check for that too I guess
14:30cooldude127Chouser: nice work with error-kit, i like
14:30Chousercooldude127: using any continues yet?
14:31cooldude127Chouser: nope, this is a really simple use
14:31Chouserok
14:31cooldude127i have one defined error and it's only raised from one place
14:31cooldude127and there's no real way to recover
14:31cooldude127so yeah, about as basic as it can be
14:32ChouserI don't know if I'll be comfortable calling it non-experimental until I (or somebody at least) has a real-world use case involving continues.
14:32hiredmanclojurebot: ping?
14:32clojurebotPONG!
14:32cooldude127haha
14:33Chouserrhickey: so LazySeq.EMPTY would go away?
14:34rhickeyChouser: I think so
14:35Chouserand nil punning on something that returns PersistentList-or-nil is ok, so the assert would indeed be more useful if it checked for PersistentList.EmptyList as well.
14:36Chouserbleh, tea bag burst.
14:37danlarkinthat'll teach you to use tea bags
14:39jbondesonclearly another point in the argument for coffee and against tea
14:40danlarkinnah, I just think he should brew loose leaf tea
14:40slashus2Just cut open the tea bag and put it in a coffee maker.
14:48rsynnott1and then never use the coffee maker for coffee again, as it will taste odd
14:49rsynnott1(tea likes to lay down layers of basically unremovable tannin)
14:50rhickeydanlarkin: yes, loose tea rules
14:51jbondesoni'm surrounded by tea lovers! D=
14:52ChouserI've considered loose tea, though never very seriously. I'd need to do research. :-)
14:53jbondesonChouser: if i'm reading this right, 'handle' + 'continue-with' are analogous to 'handle-bind' + 'invoke-restart', right?
14:53rhickeymy supplier: http://www.specialteas.com/
14:53rsynnott1just get a teapot; it's fairly simple
14:54rsynnott1(and then you can follow the memory aid 'one spoon per person and one for the pot' which I always found slightly creepy; apparently the pot requires a sacrifice of tea leaves)
14:54danlarkinI shop here: http://goodleaftea.com/ :)
14:55danlarkinChouser: once you taste fresh tea you'll never go back
14:56Chousercan I still put cream in it?
14:57rhickeyChouser: the strong Assam black teas take milk just fine
14:58danlarkinI like to take breakfast teas with milk
14:59slashus2http://www.adagio.com/ <-- They make some good tea. I use that little tea infuser on the front page.
15:00ChouserSo CachedSeq and FnSeq went away, but LazyCons did not?
15:01rhickeyChouser: it will
15:01Chouserprobably right after I update the graph?
15:01Chouser:-)
15:03rhickeygone
15:06clojurebotsvn rev 1295; got rid of LazyCons
15:06Chouserare streams dead?
15:07hiredmanrhickey: zip/next is throwing LazySeq used in 'if', sometimes, when using a seq-zip
15:08defn,(assoc [1 2 3] 3 4)
15:08clojurebot[1 2 3 4]
15:08defnthat is so bad ass
15:08cooldude127is it completely evil to want to take over the + and * bindings to add symbolic math to them?
15:08defncooldude127: i think the short answer is yes
15:09defntechnomancy: 14:07:15 < cooldude127> is it completely evil to want to take over the + and * bindings to add symbolic math to them?
15:09mrsolohmm how outdated is programming clojure?
15:09defnmrsolo: as in the book?
15:09mrsoloyes
15:09hiredmanmrsolo: it gets updated
15:09defnit isn't outdated. it's not even released yet.
15:09cooldude127defn: i mean it would preserve the old functionality when given numbers, just do it different when it gets symbols and stuff
15:09defnyou can get the beta though
15:09hiredmancooldude127: I think it is fine, that is what namespaces are for
15:09mrsolook
15:09defncooldude127: yeah that's cool
15:09cooldude127WOOO
15:09mrsolothanks
15:10defnmrsolo: no problem
15:10rsynnott1mrsolo: it was updated about two days ago, I think
15:10cooldude127this means i can piggyback off of eval and stuff
15:10rsynnott1(actually, pragmatic programming's weird release style is particularly suited to clojure for that reason)
15:10defnyeah
15:10defni really like the book tbh
15:11defnthe book is fairly short, and if you are a lisp coder you wont have a problem
15:11technomancycooldude127: I'm not seeing the clojure-test minor mode getting invoked for every buffer like you were mentioning
15:11defnhowever for me, it seems like a good two runs of the book start to finish is a requirement
15:11defnluckily it's only about 250pgs
15:11cooldude127technomancy: hmm, idk my emacs has been running for a while, i'll check it fresh later
15:12cooldude127technomancy: the rest of it is still buggy. overlays don't always happen
15:12technomancyI got errors highlighted differently now.
15:12cooldude127/ aren't timed right
15:12mrsolo*cough* my lisp/scheme whatever is actually better than java.. can anybody recommend some java api books?
15:12cooldude127oh cool
15:12technomancyoh, one known problem is that Cc
15:12technomancy* that C-c ' won't work if you're on the first char of the overlay
15:12technomancyyou have to be further into it
15:12defnson of a bitch weavejester!
15:12cooldude127technomancy: well even that isn't working. the overlay always seems to show up on C-c C-, if it is there
15:12defnhttp://github.com/weavejester/clojure-over-ajax/tree/master
15:12defnstole my idea
15:13technomancyoh nice.
15:13hiredmanrhickey: jumped the gun on zip/next, moving up to the tip of trunk fixed it
15:13technomancyshould put up an interactive tutorial like http://tryruby.hobix.com
15:13defnyeah i was just about to buy tryclojure.com
15:14hiredmanyay! my pet macro works again!
15:16technomancycooldude127: the slime-needs-to-be-loaded-first problem is still there, but I think I know the workaround
15:16cooldude127what is it?
15:16technomancyneed to use slime-connected-hook
15:16cooldude127oh
15:16technomancysince it's async
15:16technomancyall this callback stuff is crazy... it feels like I'm writing JS.
15:16cooldude127lol
15:17jwinterare you working on slime-clojure?
15:17technomancyjwinter: sort of
15:17jwintererrr swank-clojure
15:17technomancyjwinter: I'm building a tool on top of it
15:17defntechnomancy: the install tool?
15:17technomancyno, a test runner: http://github.com/technomancy/clojure-mode/tree/clojure-test-mode
15:17defnoh cool!
15:18technomancythe install tool is more or less done, I think.
15:18defnthat's a great project technomancy
15:18technomancymodulo bug fixes
15:18technomancyit's still pretty rough around the edges
15:18defnso is production-ready code
15:18defn;)
15:18jwintertechnomancy: cool
15:18cooldude127WOO! i just took over +, and it still workes
15:18cooldude127*works
15:19technomancybrb; lunch
15:19cooldude127and it does cool stuff
15:19defntechnomancy: you need to write a testing framework and then write a book on doing TDD with it
15:19defn... profit.
15:23cooldude127holy shit i now have clojure understanding symbols in math
15:23cooldude127this is awesome
15:24defncooldude127: cant wait to see your code
15:24lisppaste8cooldude127 pasted "i love life (symbolic math)" at http://paste.lisp.org/display/75730
15:25defnim very interested in doing algebra/calculus with clojure
15:25cooldude127defn: this is the result
15:25cooldude127i'll get the current code online and post a link
15:27defncool
15:28cooldude127defn: started out as porting code from SICP, but this made it branch out into a whole new world of awesomeness
15:28cooldude127http://tinyurl.com/bg3365
15:28cooldude127there is the code
15:29cooldude127if you have a variable that you're going to use a lot, you could clean up the expressions by doing something like (def x 'x)
15:30defnbrilliant
15:30cooldude127oh man this is fun
15:31cooldude127now to make it know a few more rules
15:32cooldude127if the cond in deriv gets out of hand, i might turn that into a map of predicates to functions for results
15:32cooldude127you know, a rule system that doesn't suck
15:32Chousernew graph up: http://tinyurl.com/clojure-classes
15:34gnuvinceTime for Rich to move some classes around ;)
15:38jbondesonno, no, he'll wait until Chouser fixes ClojureScript as well.
15:38jbondesonyou know, two birds with one stone
15:38Chouserheh
15:39rhickeyChouser: nice
15:39Chouserwe all wonder that at times
15:39rhickeyhah
15:40rhickey!
15:40ChouserChousuke's idea of using "badges" insted of trying to make every interface a box with arrows has helped a lot
15:40danlarkinhaha, I think he meant we all wonder that of ourselves, but I guess it works both ways
15:40Chouserit allows you to see the ref stuff at the bottom right, vs. the collection stuff above, and also the points of interaction
15:41Chouserdanlarkin: no, he understood me correctly. :-)
15:41danlarkin:-o
15:41cooldude127WOO! clojure now understands the power rule of differentiation
15:42cooldude127math.symbolic> (deriv (* 2 (** x 2)) x)
15:42cooldude127(* 2 (* 2 x))
15:42cooldude127not completely simplified, but it knows the answer!
15:42rhickeygoogle group now over 1500 members!
15:42jbondesonnow try (deriv (sin (**x 2)))
15:42cooldude127jbondeson: :(
15:42jbondeson>=D
15:42jwinterChouser: new graph looks great, nice job.
15:42Chouserjwinter: thanks!
15:43defnChouser: yeah im checking it out right now
15:43defnvery nice
15:44cooldude127ah crap, how is this thing going to understand the chain rule
15:46jbondesonChouser: i think my error-kit question got lost in the sea of tea-talk earlier.
15:46jbondeson"if i'm reading this right, 'handle' + 'continue-with' are analogous to 'handle-bind' + 'invoke-restart', right?"
15:47Chouserah, i saw that, but forgot to follow up, sorry.
15:47ChouserLet me go look at the CL docs for a sec...
15:47cooldude127nvm, i made it understand the chain rule :)
15:48jbondesonthat should be "handler-bind" not "handle-bind"
15:48defnChouser: that's great man
15:48defnerr cooldude127
15:49Chouserjbondeson: invoke-restart is more like continue
15:49cooldude127defn: yeah, hang on i'll post some more examples in a minute
15:49Chouserjbondeson: I didn't see a CL equiv. of continue-with
15:50Chouserjbondeson: note that continue-with doesn't take the name of a continue/restart, just a value.
15:50jbondesonChouser: aahhhh
15:50cooldude127defn: note that it only understands chain rule on a case by case basis.
15:53jbondesonChouser: i'm trying to see if error-kit can do an automatic restart (continue) without a stack unwind. bind-continue looked close
15:55jbondesoncondition and restart logic is all muddled in my head from lack of recent use
15:55Chouserbind-continue will do a partial stack unwind
15:56Chouserup to the point of the bind-continue, instead of all the way up to the handler/continue-with that calls it.
15:56danlarkinhey I know this is pretty far off topic, but what part of speech would "these" be considered in the following sentence: "I've determined these documents to be invalid."? it's not a verb, noun, pronoun, adverb, conjunction, interjection, proposition... so does that make it an adjective?
15:57jbondesonChouser: hmmm... interesting. wonder how CL manages a no-unwind
15:57Chouserjbondeson: the only construct currently in error-kit that does *no* stack unwind on a raise is continue-with
15:58Chouseran I messed up earlier. bind-continue is called by continue, not continue-with. :-P
15:58Chouserand
15:59Chouserjbondeson: Unless I'm misunderstanding CL (quite possible!) it does do an unwind to the handler-bind given by an invoke-restart
16:00ChouserI was trying to do the same thing there.
16:01Chousukedanlarkin: it's a demonstrative, says wikipedia
16:01Chouserdanlarkin: I vote adjective: http://www.merriam-webster.com/dictionary/this[2]
16:01shoover`demonstrative pronouns?
16:02danlarkinChousuke: link?
16:02Chousukehttp://en.wikipedia.org/wiki/Demonstrative
16:06danlarkinso wikipedia says it's a demonstrative determiner
16:07technomancyis anyone currently working on fixing swank-clojure to work with the lazy branch?
16:07technomancyI have a sinking feeling that it won't happen unless I do it. =)
16:07jbondesonChouser: i believe you are correct, however, handler-bind will call the provided function without unwinding the stack, which along with restarts taking arbitrary arguments allows for in-place recovery.
16:07danlarkinbut merriam webster indicates it's an adjective, *sigh*
16:08defnAny ideas on doing formant analysis on parts of speech?
16:09Chouserjbondeson: where does the return value of the provided function go?
16:09danlarkinHm, I think demonstrative determiners /are/ adjectives... adjective it is then.
16:10shoover`technomancy: I bet it will happen in a week or two, but you can't know when for sure
16:10jbondesonChouser: i belive it is disregarded, as typically they are used to call a restart. but i haven't looked at the spec
16:10Chouserso where does control go after invoke-restart?
16:11technomancyshoover`: I've had some patches to clojure-mode that have been sitting around for a few weeks. (same maintainer)
16:11ChouserMy impression was that it goes to the handler-bind, and returns from there.
16:11Chouserwhich seems like the definition of a stack unwind to that point.
16:12jbondesoni belive it continues from the restart-case
16:12ChouserI suppose I could actually write some CL code and see what it does. *grimace*
16:13jbondeson(i'm refreshing my memory with the exception handler chapter from practical cl)
16:13Chouserhey, me too.
16:14defni need to read PCL
16:14Chouser"programming clojure" is more fun.
16:14defndid you do PCL before clojure though?
16:14Chouserno
16:14defnhmmm
16:15defnwhat langs are you familiar with
16:15jbondesonthe last time i used that was for repairing out of context objects from very high up in the stack
16:15ChouserI'm still messing up my use of CL terminology
16:16defnim having some trouble getting started
16:16defnim just at the curve right now i think
16:16defnjust need to keep marinating myself in it and ill start to understand it
16:17jbondesonChouser: yeah, i am almost positive now that the restart-case will allow for immediate execution of a restart-case when a handler-bind is defined for the error
16:17Chouserhandler-bind is up high, uses invoke-restart to send control to a restart-case, which is higher than where the 'error' was raised.
16:17technomancydefn: it can be tempting to try something non-trivial as your first project; I found it helpful to not be too ambitious.
16:17cooldude127how did it take me so long to find "git add -p"
16:17Chouserdoesn't that mean that the stack unwinds from error up to the restart-case?
16:17cooldude127it reminds me of darcs record, and i loved it
16:17technomancycooldude127: that's nothing; you should see magit.
16:17cooldude127technomancy: i use magit
16:17cooldude127technomancy: i know what it does
16:18defntechnomancy: yeah i just have never programmed in a language like this, so i dont know what ambitious is
16:18cooldude127technomancy: but i don't know how to split hunks in magit
16:18jbondesonChouser: restart-case throws the error
16:18defnand im still struggling to understand how to keep things functional, etc.
16:18defnid idnt know anything about persistence or immutable data until clojure
16:18technomancycooldude127: yeah, that's the one thing that's missing for me
16:18defni mean i suppose i knew of them, but not by those terms
16:18Chouserjbondeson: doesn't the original detection of the error happen below that?
16:18cooldude127technomancy: i discovered that just now, and it's perfect!
16:18cemerickrhickey: I seem to remember you saying that at some point after AOT was in place, that generated classnames would become deterministic -- e.g. user/foo would compile into a class like user$foo, which would make invoking arbitrary fns from java-land pretty easy. Is that still in the works, or did I misunderstand something?
16:19technomancydefn: what languages have you used before?
16:19Chouserjbondeson: like the first example under "Condition Handlers", the def of parse-log-entry
16:20defntechnomancy: Ruby, C++, Limbo
16:20Chouserjbondeson: the error is thrown right there with (error ...) isn't it?
16:20jbondesonChouser: right, i believe you are correct
16:20defnI've played with a lot more, but not as seriously as those
16:20jbondesonChouser: i guess the throwing of the error there just makes it the immediate restart
16:20technomancydefn: I'm working on an introductory screencast to Clojure
16:21defnChouser: I'm just struggling with the API -- I don't really know how to put the pieces together
16:21rhickeycemerick: the classnames are not a path to the fn object in any case. proxy names are now deterministic
16:21technomancyshould be ready in a week or so
16:21jbondesonChouser: so if you have an error further down it will have to wind back to the restart-case
16:21defntechnomancy: is that going to be peepcode?
16:21jbondesonI think i finally understand this.
16:21Chouserjbondeson: yes, ok, I think that's exactly how error-kit works.
16:21technomancydefn: yeah
16:21defncan i beta it if it is? ;)
16:21cemerickah, it was proxy names!
16:21technomancyit won't be long...
16:22defntechnomancy: here is a question that i dont really know the answer to: Is learning clojure a good idea for someone who might not need concurrency or some of the other benefits?
16:22Chousercemerick: you see that's been done?
16:23defni mean, is using clojure going to be beneficial for doing basic stuff?
16:23Chouserdefn: yes
16:23cooldude127defn: clojure is a good overall language
16:23technomancydefn: depends on how basic, I guess.
16:23cemerickChouser: I'm not working with proxies at all, I don't think.
16:23defni just see a lot of people using it for doing complex, expensive calculations
16:23Chousercemerick: oh, ok.
16:23defnso i start to wonder if im playing with something that is beyond what i need
16:24cooldude127defn: there's plenty of basic stuff that can be done in clojure
16:24technomancydefn: well learning to express your problems in functional terms is valuable no matter what your needs.
16:24cooldude127agreed
16:24defntechnomancy: yeah ill buy that for sure
16:24defnim taking calculus concurrently with this, so that's been kind of interesting
16:24cooldude127defn: what kind of calculus?
16:24cemerickChouser: that may change as the java portion of our codebase gets smaller, and now that proxy construction isn't reflective
16:24defncooldude127: just differential
16:24vjrlisps are new again with clojure!
16:25defnanalytic geometry
16:25defnetc.
16:25cooldude127defn: wait, like derivatives and integrals and stuff?
16:25defnyea
16:25technomancyyou might still end up using ruby for putting up a simple CRUD web app, but it's always good to have access to more tools.
16:25Chouserdefn: you liked that graph? Take a look at the clojure code that produced it. no STM, no multithreading. It's the kind of thing I would have done in perl/python/ruby before.
16:25jbondesonChouser: now all i have to do is translate all that back into the functions in error-kit
16:25cooldude127defn: my symbolic math is probably interesting to you isn't it?
16:25technomancysince the kinds of things clojure is good for are generally more interesting that simple CRUD web apps. =)
16:25defnChouser: that makes me happy to hear :)
16:26defncooldude127: yeah it is -- i would like to write something like that because i did something similar in C++ with my Logic course
16:26Chouserdefn: there's one tiny little macro that would have been too much trouble to try to do in those langs (except maybe ruby).
16:26jbondesonthink i may just translate all those function in practical cl into error-kit...
16:26defncooldude127: it is nice to program your way to understanding
16:26defncooldude127: that way you learn a lang and math at the same time
16:26cooldude127defn: that's what i'm doing in calculus 3 (which is basically linear algebra)
16:26Chouserjbondeson: yeah, well -- it could use the CL names, but I didn't want to create any false expectations. the arg lists for example don't work exactly the same way, I don't think.
16:27defncooldude127: i saw your other source files for your symbolic math
16:27cooldude127defn: look at the math/linalg* stuff in my clojure-code repo, i coded a lot of that stuff in class while we learned the concept
16:27defnlots of linalg
16:27defn:)
16:27vjranyone ever read the Edward Lee paper on "The Problem with Threads"?
16:27jbondesontechnomancy: you got swank-clojure fixed yet, you know now that you know it's you or nothin? ;)
16:27cooldude127defn: if i don't do it, i won't learn it
16:27defncooldude127: yeah, and you learn clojure in the process!
16:28jbondesonChouser: i think you're absolutly right to have distinct names
16:28defnwhen im sitting there doing problems in math I think: you know, I could just code this and understand every case pretty easily
16:28technomancyjbondeson: give me a few days.
16:28technomancyjbondeson: I want to finish this testing thing first. =)
16:28jbondesontechnomancy: DAYS?!? =P
16:28defncooldude127: you're too smart for 18
16:28cooldude127defn: well, that wasn't my first experience in clojure, but you could say that you're always learning a language, no matter how much
16:28defnim 23 and am just taking calculus I
16:28defni had a very bad public school education in math
16:28cooldude127defn: i'm a freshman at georgia tech
16:28defnah, congrats
16:29cooldude127thanks :)
16:29technomancyjbondeson: I'm sure it would go faster with help. =)
16:29defnim a junior at UW Madison (technically)
16:29defnbut i have at least 3 more years of study
16:29cooldude127oh
16:29defni just transfered into their Computer Science program
16:29defnI have to learn Java which sucks, so I found Clojure and here I am
16:30defnI'm going to try and talk my professor into letting me do my homework in Clojure
16:30defn:)
16:30Chouserjbondeson: ok, thanks for the vote of confidence. :-)
16:30cooldude127defn: well, the problem is there aren't too many good choices for a data structures class like what i'm in, since the nice languages don't have low-level enough data structures (like arrays)
16:30leafwwould be such a pun if all these java schools suddently turned into lisp schools via clojure.
16:30cooldude127the better languages do too much for you
16:31vjrjava is great for writing real langs like ruby and clojure - maybe. :)
16:31Chouserjbondeson: I'd be very interested to know if you get a real working case using continue/bind-continue
16:31cooldude127defn: but i've done certain homework assignments in clojure before i did them in java just to wrap my head around it
16:31cooldude127made me understand AVL trees
16:31cooldude127and red-black (even tho they weren't assigned) ;)
16:32defni need to understand java better just for interop purposes
16:32defni was in AP computer programming and did some J# stuff
16:32cooldude127defn: yeah it helps
16:32defn(this is in high school)
16:32cooldude127ewwww
16:32defnbut i dont remember much
16:32cooldude127defn: yeah we did real java in AP comp sci
16:32cooldude127but i knew it before that
16:32cooldude127and nobody learned anything
16:32defnYeah I finally talked my professor into letting me do C for 2nd semester
16:33defnbecause I was a rowdy little anti-establishment, fuck M$ kid
16:33cooldude127oh lol
16:33cooldude127well so was i, i just used java on the mac :)
16:33defnhaha nice
16:33defnbrb 2seconds
16:35vjrso who here has done threaded apps?
16:35rhickeyI have
16:35vjrok! we all know you have..
16:35cooldude127lol
16:36leafwvjr: I have as well.
16:36vjrhave you done the same app or two in clojure as a comparison?
16:36shoover`I'm looking at a lock right now and wondering why it's there!
16:36leafwvjr: for some small ones, yes.
16:36mrsoloi have but no
16:37leafwvjr: clojure wins flat: no verbosity, no forgetting locks, trivial creation of Runnables and Callables.
16:37vjrleafw: and? what was the verdict. Pretend rich isn't here.
16:37vjrleafw: you answered thanks.
16:38leafwvjr: and pmap is just the right thing. If only I could specify the maximum number of cores that it uses.
16:38leafwwould need a global mvar *max-cores* and then use a binding around it or something.
16:39vjrleafw: very cool. I asked this earlier. Has anyone read the Edward Lee from Berkley paper on the problem with threads?
16:39leafwvjr: I use threads, I am happy that someelse designs them. So no.
16:40vjrI was wondering what some here might think where clojure fits in that paper..
16:40vjrI'll post it to the mailing list.
16:41leafwrhickey: haven't seen any enhancement proposal to regulat max-threads for pmap. Would you consider it?
16:42leafwa global var would do; then with a binding one could modify it.
16:46vjras i read that paper, it gets better and better. Quite a few remarks about Java.
16:49rhickeyleafw: I don't like the global var idea, but am amenable to controlling the threads
16:52jbondesontechnomancy: how are you planning on debugging swank-clojure?
16:52technomancyjbondeson: grep -r rest ?
16:52defn,(defn func [x y z k] (assoc [x y z] z k))
16:52clojurebotDENIED
16:52technomancyI haven't really thought about it much. =)
16:52Lau_of_DKIs Slime/swank-clojure still broken in latest versions ?
16:52jbondesonhaha
16:53jbondesonLau_of_DK: yeah, unless someone updated in the last hour
16:53defnwhy doesn't this work?
16:53Lau_of_DKk
16:53defn(defn func [x y z k] (assoc [x y z] z k))
16:53defn(func [6 7 8 10])
16:54cooldude127defn: (fun 6 7 8 10)
16:54cooldude127or add an extra set of brackets
16:54jbondesontechnomancy: i did a very naive replace of (lazy-cat ..) -> (lazy-seq (cat ...)) and ended up with no errors in swank, but slime went into infinite loops, so i was just curious if you had any ideas how to debug that
16:54cooldude127(defn funct [[x y z k]] ...)
16:54cooldude127jbondeson: i think that's (lazy-seq (concat ...))
16:54jbondesonerr cons
16:55jbondesonis what i meant
16:55defncooldude127: #<IllegalArgumentException java.lang.IllegalArgumentException: Wrong number of args passed to: user$func>
16:55cooldude127oh
16:55technomancyjbondeson: the lack of a test suite is frustrating.
16:55durka42,(doc concat)
16:55clojurebot"([] [x] [x y] [x y & zs]); Returns a lazy seq representing the concatenation of the elements in the supplied colls."
16:55cooldude127defn: is that the original, or with what i said?
16:55durka42what is this?
16:55technomancyjbondeson: If you fork it on github to start the effort, I'll jump in once I get a chance.
16:55durka42=> (doc concat)
16:55durka42#<CompilerException java.lang.NoClassDefFoundError: clojure/lang/Compiler$TheVarExpr (REPL:14)>
16:56defncooldude127: with what you said
16:56technomancyprobably announce it on the list as well
16:56cooldude127defn: with both, or just one?
16:56defnboth and just one
16:56jbondesontechnomancy: that would require me to not suck with git, but if i get anywhere will do
16:56cooldude127either one alone should work
16:56technomancyjbondeson: eh; github can hold your hand through it. =)
16:56defncooldude127: (defn func [[x y z k]] (assoc [x y z] z k))
16:56defn(func [6 7 8 10])
16:56jbondesonwill it make me warm hot chocolate when i get scared?
16:57defncooldude127: #<IndexOutOfBoundsException java.lang.IndexOutOfBoundsException>
16:57cooldude127defn: i know why
16:57cooldude127defn: z = 8, so assoc is trying to place 10 at index 8 of the vector
16:57cooldude127but the vector is only 3 elements
16:58cooldude127but anyway, i need to go eat some food
16:58technomancyjbondeson: it'll probably pour you some scotch if I know the github guys.
16:59jbondesontechnomancy: it better be 18 year Glenmorangie...
17:12lisppaste8hiredman pasted "amazingly frustrating zippers" at http://paste.lisp.org/display/75738
17:13jbondesonholy lazy-seq in if hunting batman
17:15durka42when do you turn that flag on?
17:15durka42is it when you compile clojure, or when you run programs
17:15durka42the assert-on-lazy-seq flag
17:16Chouserdurka42: when you compile clojure
17:19hiredmanI cannot seem to make a general function that takes the loc (in zipper speak) of a � and removes the the element preceding it(p) the elementing following it(f) and replaces the � with some kind of list containing p and f
17:19hiredmanugh
17:20hiredmanI always get left over bits hanging around
17:24jbondesonprogress... i got slime to show up
17:25jbondesonbut i get an initialization error...
17:29BrackiIn a list of structs how can I access a specific struct?
17:33durka42nth?
17:38BrackiWell, wrong question. How do I check if something is in a list?
17:38ChouserBracki: if you put your structs in a set instead, then you can call the set as a function.
17:38technomancy,(doc clojure.contrib.seq-utils/includes?)
17:38clojurebotjava.lang.Exception: Unable to resolve var: clojure.contrib.seq-utils/includes? in this context
17:39technomancyI call BS; there's totally an includes? function in seq-utils.
17:40BrackiWell to model a graph would you use a map of maps? I currently have a map of lists.
17:41BrackiThe lists contain the neighbors.
17:42BrackiValid approach or what could be improved?
17:43Chouserdoes the order of the neighbors matter?
17:46BrackiNo.
17:46BrackiNot yet.
17:46jbondesonhmmm.. what does the 'and' used with a lazy-seq get you? i'm assuming a wrong result, right?
17:46jbondeson-the
17:46ChouserThen I'd recommend a map of sets, which would allow quick answers to the question "is x your neighbor".
17:47Chouser,(and (map inc ()) :wanted?)
17:47clojurebotjava.lang.Exception: LazySeq used in 'if'
17:47technomancyjbondeson: yeah, that's suspect since nil won't get returned
17:48technomancyjbondeson: you probably want to check for empty?
17:48technomancyjbondeson: or switch to using next instead of rest maybe?
17:49jbondesontechnomancy: false positive, that will trip a LazySeq in if condition
17:49technomancyoh you mean it will cause it to get realized?
17:49jbondesonit'll trip an assertion
17:50jbondesontrying to track down this last exception...
17:50jbondesonthe repl works, it just aborts every slime action like tab-completion and doc lookup
17:54Chouser,(and (seq (map inc ())) :wanted?)
17:54clojurebotnil
17:54Chouser,(and (seq (map inc '(4))) :wanted?)
17:54clojurebot:wanted?
18:02hiredman,(use 'clojure.contrib.seq-utils)
18:02clojurebotjava.io.FileNotFoundException: Could not locate clojure/contrib/seq_utils__init.class or clojure/contrib/seq_utils.clj on classpath:
18:02hiredman:\
18:03lisppaste8bracki pasted "This doesn't work yet" at http://paste.lisp.org/display/75741
18:03BrackiCan somebody help me to get this recursive? (find-path) should return an empty set otherwise conj the found value to itself.
18:04BrackiOr do I have to pass the set containing the found edges as an argument?
18:05cooldude127Bracki: i'm still learning graphs
18:05cooldude127:)
18:05hiredmanBracki: instead of calling find-path recursively you would use recur
18:06Brackiah. how does that work?
18:06hiredmanwell, you just replace (find-path ...) with (recur ...)
18:07hiredmanand you do need to carry around the set containing the result
18:07gridlockis the current working directory included in the classpath for java by default?
18:07durka42no
18:07durka42add . to the classpath to include it
18:07hiredmanBracki: have you looked at (for ...)?
18:08hiredmanactually
18:08hiredmanI think you can use reduce
18:11BrackiDoes clojure support optional arguments that have a default value?
18:12hiredmanno, but you can use hash destructuring to much the same effect
18:13Chousernot directly, but you can do (fn foo ([x] (foo x 2 3)) ([x y] (foo x y 3)) ([x y z] ...main body here...))
18:14hiredmanthat would be a simpler way
18:15hiredman,((fn [{:keys a :or {a 2}}] a) {:a 1})
18:15hiredmanhmmm
18:15Chouserheh
18:15hiredmanwow
18:15hiredmanthe jvm crashed hard
18:15hiredman# SIGSEGV (0xb) at pc=0x2817b39e, pid=55066, tid=0x28201c00
18:15cooldude127lol
18:16leafwj #gnome
18:16gridlocki seem to be quite confused as to how the lib facility is supposed to work; the docs make it seem like it should be straight forward
18:17hiredman,((fn [{:keys a :or {a 2}}] a) {:a 1})
18:17clojurebotjava.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: Symbol
18:17gridlocki have a path net.brehaut.mylib
18:17gridlockand inside it i have a file mylib.clj
18:17gridlock(sorry net/brehaut/mylib)
18:17gridlockthe file has (ns net.brehaut.mylib)
18:17cooldude127gridlock: you probably just want net/brehaut/mylib.clj
18:18hiredman,((fn [{:keys [a] :or {a 2}}] a) {:a 1})
18:18clojurebot1
18:18hiredman,((fn [{:keys [a] :or {a 2}}] a) {:b 3})
18:18clojurebot2
18:18gridlockcooldude127: should i then be able to use require ?
18:19gridlockeg (require net.brehaut.mylib)
18:19hiredman(require 'net.brehaut.mylib)
18:19cooldude127gridlock: as long as it's on your classpath
18:19hiredmanand whatever directory "net" is in needs to be in your classpath
18:19gridlockhiredman: aha! thanks :)
18:19hiredmanif you use :require inside (ns ...) you don't need the quote
18:28BrackiOh well, I'm not able to do this. Too late.
18:33technomancycooldude127: pushed out a new rev of clojure-test-mode; should handle launching slime automatically
18:33technomancyI am seeing an intermittent failure to highlight errors though.
18:34cooldude127technomancy: yeah that's confusing the hell out of me
18:34technomancywould love to have some more eyes on it, maybe see if you can get it consistently reproducible
18:34technomancycooldude127: this snippet may help with debugging: (map #(cons (str (:name (meta %))) (:status (meta %))) (vals (ns-interns *ns*)))
18:34technomancyit should show all the test-result-metadata for all the vars in the namespace
18:38cooldude127technomancy: in a minute i will take a look
18:41cooldude127technomancy: what's been changed in clojure-mode.el?
18:43technomancycooldude127: now after slime connects it will automatically enable slime-mode for any clojure-mode buffers
18:44cooldude127sweet
18:46technomancyyeah, adapted from a patch submitted on the mailing list
18:46technomancyI wonder if I should try to usurp the maintainership of clojure-mode in the absence of jochu... =)
18:54cooldude127technomancy: so the expected behavior is when i load a clojure buffer, a slime repl will open?
18:54cooldude127assuming it has tests?
18:55cooldude127also i still don't know why but the first test i tried to make fail didn't show
18:55technomancycooldude127: yeah. I don't like the way it screws with the window setup, but it's better than having to invoke it manually
18:55cooldude127technomancy: i don't really mind, since i probably wanted that anyway
18:56cooldude127but yeah, my tests aren't highlighting, and also, i'm not sure how C-c ' is supposed to work, cuz i've never seen it done anything
18:57technomancyit should give you an "expected FOO, got BAR" if you press it while the point is in an overlay
18:57technomancythat actually works pretty reliably for me
18:57cooldude127technomancy: doesn't work at all for me, keep in mind mine are all with-test blocks
18:58technomancyoh right; dang
18:58cooldude127plus if i can't see the highlight, doesn't that mean the overlay didn't work?
18:59technomancyyeah
18:59technomancyno overlay means no message
18:59cooldude127oh, well then this is expected :)
18:59gnuvince_argh
18:59gnuvince_I hate it when you two talk together
19:00technomancycooldude127: it works for me on that match-variable sample you sent me
19:00gnuvince_My coloring script gives you both the same color and your nicks are the same length
19:00gnuvince_So I need to actually read to know who says what
19:00technomancycooldude127: it could also be the slime version too. =\
19:00cooldude127technomancy: well i'm working with a completely different file now
19:00technomancygnuvince_: hehe.
19:00cooldude127technomancy: are you on the merged trunk yet?
19:00technomancystill in my branch
19:01tetech & cooldude127 -- do you guys have jobs
19:01teyou've been here all day on a wednesday
19:01te:)
19:01cooldude127te: no, i'm in school
19:01technomancycooldude127: there's your incentive for dropping the number from your nick; to make gnuvince happy. =)
19:01tecooldude127: well im in school and working 50 hours a week
19:01tei envy you
19:01cooldude127lol
19:01technomancyte: I'm taking a break. =)
19:01teluckily my work lets me play with clojure and such
19:01technomancybeen very productive today
19:01te:)
19:01cooldude127te: then i envy you
19:01gnuvince_Still no word on swank-clojure?
19:01cooldude127i'm poor
19:02technomancygnuvince_: jbondeson was looking into it.
19:02gnuvince_ok
19:05cooldude127technomancy: what's the date on your slime?
19:08cooldude127apparently i tried to change the font-size in emacs and i crashed it
19:09technomancycooldude127: http://groups.google.com/group/clojure/browse_thread/thread/2acedf58af32de77
19:09technomancy(lists all the shas of the dependencies)
19:09cooldude127technomancy: broken link
19:09technomancyoh well, it's the latest thread in the group
19:10cooldude127lol
19:10technomancy"test-is integration via SLIME"
19:10technomancymerged into trunk finally btw.
19:11gnuvince_I'm looking into swank-clojure: is there more than changing the calls to lazy-cons into lazy-seq/cons?
19:11technomancygnuvince_: jbondeson said he tried that and it seemed to work on the swank side, but then slime would go into conniptions.
19:12gnuvince_ok
19:12cooldude127technomancy: ok i'm two git commits ahead of you on clojure
19:12cooldude127but i don't think they're relevant
19:12technomancygnuvince_: search for jbondeson: http://clojure-log.n01se.net/
19:13technomancycooldude127: I merged yours already
19:14cooldude127technomancy: no i mean clojure.git, and i'm on the same swank and slime versions
19:14technomancyoh, right
19:14technomancycooldude127: I need to add a "last-known-good" defvar for each dep in clojure-mode
19:14technomancyso the updater doesn't break things for you
19:15cooldude127or things just need to be less fragile
19:15technomancythat too. =)
19:15technomancythough early breakage is better than later breakage
19:15cooldude127but i don't think version differences are the problem here
19:15cooldude127yeah
19:16gnuvince_OK
19:17gnuvince_I'll probably look into that tomorrow at work when I pretend to do something ;)
19:17technomancygnuvince_: send a shout out to the mailing list
19:17technomancydon't want to duplicate effort
19:18gnuvince_technomancy: I'll wait until I'm sure no emergency come up at work
19:18gnuvince_Like *another* fucking website
19:19jbondesongnuvince_: i've gotten to the point where i have a slime repl, but the extra stuff with doc-strings and tab-completion are still not working.
19:20gnuvince_jbondeson: do you have a fork on github?
19:21jbondesonnot yet, was going to do that as soon as i got this pesky exception on load out of the way
19:21technomancyI've got to say... after all this Clojure, elisp is starting to sound like tarzan-speak.
19:21cooldude127technomancy: tell me about it
19:21technomancy"Me get list. Me add to list. GRaaaah!"
19:22cooldude127haha
19:23technomancyI wonder what the odds would be of getting hash-table literals into 24.
19:23technomancythey'd probably be better if I could write C. =)
19:23cooldude127lol
19:24jbondesoni think i found the next problem... swank uses seq?, and (seq? '()) => true
19:24technomancythat would do it
19:25chavo_jbondeson: is this a ClassCastException when you load slime?
19:25hiredman,(seq? nil)
19:25clojurebotfalse
19:25jbondesonchavo_: no, Compiler error when loading swank/slime functions
19:25hiredman,(seq? (seq '()))
19:25clojurebotfalse
19:26hiredman(def are-you-really-a-seq? (comp seq? seq))
19:26jbondeson,(seq? 1)
19:26clojurebotfalse
19:26jbondeson,(seq? (seq 1))
19:26clojurebotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: Integer
19:26hiredmanah
19:27jbondesonyeah
19:27hiredmanthat would be a problem
19:27jbondesonneed to have some utility function
19:28hiredman(#(or (not (seq? %)) (seq %)) '())
19:28hiredman,(#(or (not (seq? %)) (seq %)) '())
19:28clojurebotnil
19:28hiredman,(#(or (not (seq? %)) (seq %)) [:a :b :c])
19:28clojurebottrue
19:28jbondeson,(and (seq? '()) (not (empty? '())))
19:28clojurebotfalse
19:28hiredmanhmmmmm
19:29jbondesonthough yours is a little more clojure-esqe
19:30hiredmaneh?
19:30hiredmanmine fails
19:30hiredman[:a :b :c] is not a seq, but it said true
19:30jbondesonoh, yeah.
19:30jbondesonwell
19:31hiredman,(#(or (and (seq? %) (seq %)) %) [:a])
19:31clojurebot[:a]
19:31jbondesoni could change my (not (empty? ..)) to a (seq ...)
19:32hiredman,(#(or (and (seq? %) (seq %)) %) '())
19:32clojurebot()
19:32hiredmanhmmm
19:32hiredman,(seq? '())
19:32clojurebottrue
19:32hiredman,(seq '())
19:32clojurebotnil
19:33hiredman,(#(and (seq? %) (seq)) :a)
19:33clojurebotfalse
19:33hiredman,(#(and (seq? %) (seq)) '())
19:33clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: core$seq
19:33hiredman,(#(and (seq? %) (seq %)) '())
19:33clojurebotnil
19:33hiredman,(#(or (and (seq? %) (seq %)) %) '())
19:33clojurebot()
19:33hiredmanoh!
19:33hiredmanhaha
19:34hiredmanof course
19:34taggart,(doc seq?)
19:34clojurebot"([x]); Return true if x implements ISeq"
19:36jbondesonseq? is used in 8 places...
19:38jbondesonseq? replacement didn't fix slime... hmmm
19:40jbondesonnow to somehow find any potential (if '() .. ) forms which don't trip the lazy-seq if detection
19:40hiredman,(doc sequence)
19:40clojurebot"([coll]); Coerces coll to a (possibly empty) sequence, if it is not already one. Will not force a lazy seq. (sequence nil) yields ()"
19:40hiredmanugh
19:41hiredman(doc inverse)
19:41hiredmanhuh
19:41hiredman,(doc inverse)
19:41clojurebotjava.lang.Exception: Unable to resolve var: inverse in this context
19:41hiredman,(doc invert)
19:41clojurebotjava.lang.Exception: Unable to resolve var: invert in this context
19:42hiredman,((complement sequence) '())
19:42clojurebotfalse
19:42hiredman,((complement sequence) 1)
19:42clojurebotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: Integer
19:43AWizzArd,((complement sequence) [1])
19:43clojurebotfalse
19:44cooldude127technomancy: curious about your emacs appearance settings (from that screenshot)
19:45technomancycooldude127: inconsolata and zenburn
19:45technomancyplus possibly hl-line-mode
19:45cooldude127technomancy: 2/3 :)
19:46cooldude127technomancy: something went horribly wrong
19:46cooldude127technomancy: M-x zenburn ... CRASH
19:46technomancy...?
19:46technomancyusing the starter kit?
19:46cooldude127yeah
19:46jbondesoni wonder if i can patch clojure to assert on finding a persistent empty list in an if
19:46cooldude127technomancy: idk i'm updating my emacs to a newer build
19:47cooldude127technomancy: also, what's your font-size?
19:47technomancycooldude127: 22 since I have a really high-dpi display
19:47cooldude127technomancy: wow
19:47technomancyyeah, I've got a 12-inch laptop with a reasonable number of pixels
19:47cooldude127i'm on a 22" 1680x1050, i don't think i can pull that off
19:48cooldude127technomancy: what laptop?
19:48technomancythinkpad X61
19:48cooldude127nice
19:48technomancywhich afaik is the only such laptop that qualifies as both 12-inch and reasonable number of pixels unfortunately
19:48cooldude127k brb upgrading emacs
19:49cooldude127technomancy: yeah that didn't fix shit
19:50technomancyI've heard of problems with color-theme on cocoa
19:52cooldude127technomancy: it's definitely something to do with my config, cuz with no init-file, once i actually get the right stuff loaded, zenburn applies fine
19:52hiredmantechnomancy: what is the resolution on that?
19:53technomancyhiredman: 1440x1024
19:53hiredmanhmm
19:53hiredmanthat doesn't seem high enough for 22
19:53technomancyhiredman: unfortunately the newer thinkpads aren't as high-res =\
19:53hiredmanI still used 10 on my 1920x1200 display
19:54technomancyhiredman: it's a little on the big side; I usually use that size at the end of the day
19:54hiredmanah
19:54technomancywith dejavu sans mono at 18 or so otherwise
19:55technomancywhat's the physical size of your 1920x1200?
19:55cooldude127technomancy: remember that .emacs bisecting thing we wanted? yeah, REALLY wish we'd done something with that right now
19:56hiredman24" so the dpi is not so good
19:56technomancycooldude127: wasn't someone going off to write that?
19:56technomancyhiredman: yeah, the DPI makes all the difference
19:56cooldude127technomancy: not that i knew of
19:58cooldude127technomancy: shouldn't i have a ~/.emacs.d/custom.el file?
19:59technomancycooldude127: only if you use M-x customize
20:01cooldude127technomancy: well, considering i set the font using emacs' gui, i assumed it had
20:02cooldude127ok it got changed outside customize, but god knows where
20:04cp2ahhhhhhhhhhh snake
20:04technomancycooldude127: I use the set-default-font function
20:04technomancyand .Xdefaults, but that's an X thing
20:06cooldude127nvm i'm stupid
20:09cooldude127technomancy: ok, i've eliminated fonts as the cause, the default font messes it up too
20:09cooldude127technomancy: in fact, i'm pretty sure that the only stuff left is emacs-starter-kit
20:10technomancycooldude127: sorry; I can't test on OS X. =\
20:10cooldude127technomancy: only way to be sure is to pull a fresh emacs-starter-kit and check
20:12cooldude127technomancy: nvm, fresh emacs-starter-kit is clean
20:12cooldude127WTF am i doing wrong?
20:13technomancyfresh clone from me or you?
20:13cooldude127technomancy: from you
20:14cooldude127it's very much one of my changes
20:15technomancyoh well in that case you might be able to git bisect
20:15cooldude127oh snap!
20:19technomancygotta take off... later folks.
20:21jbondesondamnit, i'm in a chicken and egg problem with changing the if macro. i need or, but or uses if...
20:22durka42changing the if macro?
20:22jbondesonwant to expand the assert-if-lazyseq to also assert when it sees a clojure.lang.PersistentList/EMPTY
20:22jbondesonso i can track down the swank-clojure problems
20:24jbondesonmulti-level if*'s it is
20:26gnuvince_Am I the only one who thinks wrapping with-open inside a try/catch form is not as elegant as it could be?
20:26jbondesonerror-kit? >_>
20:28jbondesonanybody got any bets on how badly i screwed stuff up by messing with such a fundamental macro?
20:29cooldude127jbondeson: i safely messed with fundamental mathematical operators
20:29cooldude127like + :)
20:29jbondesonhahaha
20:29jbondeson= isn't defined before if
20:30jbondesonof course
20:30jbondesonbecause = uses if
20:31jbondesonclojure.lang.Util/equiv it is!
20:31jbondesonholy crap it compiled
20:35Chouserjbondeson: congrats. As Rich said, it's hard working up that high in core.clj, isn't it?
20:35silkarnim playing around with scheme and opengl now and I see the vectors in Scheme are not dynamically resizeable. how are clojure vectors implemented so achieve automatic resizing? is there a hidden penalty instead? because it is very nice not having to reverse a lot at the end of tailrec functions.
20:36jbondesoncourse it didn't find the issue, heh. back to the drawing board (still keeping in the change)
20:37durka42silkarn: the vectors never change. you get a new one
20:38silkarnisnt tht very innefficent?
20:38silkarnhow do you spell inefficient?
20:38silkarnlast one?
20:38durka42yes, the last spelling
20:39durka42it would be if they were really copied
20:39durka42but the new vector generally shares structure with the old
20:39durka42this stuff is rather advanced and there's no way i can explain it
20:39durka42but i think rhickey has a video about it
20:40durka42this is where someone more experienced than me jumps in and explains structural sharing and bagwell's data structures
21:10Chouserjbondeson: does Rich have your CA? He seemed open to that change, perhaps you could get a patch in.
21:11jbondesonChouser: yeah, i've had a couple patches in.
21:11Chouserah, cool.
21:58hiredman,(pl (?map (replicate 3 (?apply (vector (?map (range 10) inc � inc � inc)) call � (?* 10) � call � (?+ -2) map)) shuffle))
21:58clojurebot((90 40 80 50 30 70 100 20 10 60) (90 70 80 100 20 60 30 10 50 40) (40 10 90 60 80 70 50 100 20 30))
21:59danlarkin?
21:59danlarkininteresting
22:00danlarkinwhy are you wingdinging clojure!
22:00hiredman:)
22:00hiredman?map is replaced by (flip map)
22:03gnuvince_(doc flip)
22:03danlarkinwhy all the effort into flipping and making unreadable code
22:03hiredmanflip returns a function that does the same thing, but takes arguments in oppposite order
22:04hiredmandanlarkin: once you start it's hard to stop
22:06hiredman,(pl (?map (replicate 3 (?apply (vector (?map (range 10) inc � inc � inc)) char � call � (?* 10) � call � (?+ -2) map)) shuffle))
22:06clojurebot((\( \d \ \P \2 \newline \F \Z \< \) (\ \< \ \( \Z \F \d \newline \2 \P) (\P \ \newline \ \Z \2 \( \< \d \F))
22:08gnuvince_eerily looks like bad Haskell
22:11hiredmanorly
22:12hiredmanI was thinking of using arrrows for function application without parens
22:16hiredmanI guess I should $
22:19danlarkinthat is, hiredman obfuscated style
22:23dreishThis is all my fault for pointing out that cjbot could be made to do anything using #=(eval x), isn't it?
22:27hiredman,(pl inc $ 3)
22:27clojurebot4
22:27dreishUnless this is all being done through a macro called pl. I thought maybe you had gone nuts editing the reader.
22:27hiredmaneh
22:28hiredmanit is a macro
22:28dreishOkay, nevermind then.
22:28dreishHow about a macro called apl that implements APL?
22:29dreishSince you seem to be moving in that direction.
22:29hiredman,(pl (map call � ?+ $ 5 range $ 3))
22:29clojurebotjava.lang.Exception: Unable to resolve symbol: � in this context
22:30hiredmanhmm, works in the repl
22:30dreish,(apl (~R?R�.�R)/R<-1??R)
22:30clojurebotInvalid token: /R<-1??R
22:30hiredman,(pl (map call � ?+ $ 5 range $ 3))
22:30clojurebotjava.lang.Exception: Unable to resolve symbol: � in this context
22:31hiredman,(macroexpand-1 '(pl (map call � ?+ $ 5 range $ 3)))
22:31clojurebot(do (map call � ((uncurry +) 5) (range 3)))
22:41cooldude127hiredman: i must say i'm often scared of the code you create
22:42hiredmanit's ok, my code doesn't make it into anything important
22:42hiredman,(pl (map call � ?+ $ 5 range $ 3))
22:42clojurebot(5 6 7)
22:43danlarkin,(map + 5 (range 3))
22:43clojurebotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: Integer
22:43danlarkinblah blah blah
22:44danlarkinyou know what I meant, compiler!
22:45hiredman? uncurries, but I can't tell when to stop taking arguments, so you need to either call the uncurried function at the end with no args, or call call on it
22:46hiredman,(((?+) 1) 2)
22:46clojurebotjava.lang.Exception: Unable to resolve symbol: ?+ in this context
22:46hiredman,(pl (((?+) 1) 2))
22:46clojurebotjava.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn
22:46hiredmanhmmm
22:57cooldude127why are we messing around with APL anyway?
23:03ozy`what's that about APL?
23:05hiredman,(pl (((??filter � map inc � dec range $ 5) call � ?not= $ 2 )))
23:05clojurebot(0 1 3 4)
23:05durka42aah
23:05cooldude127WHYY!!!
23:06hiredmanI don't know
23:06ozy`that looks more like haskell than APL
23:09durka42especially the $
23:09durka42is it the haskell $?
23:11ozy`without knowing what all the functions are supposed to do I'd guess in the affirmative
23:12cooldude127looks more like an argument placeholder
23:13durka42,(doc $)
23:13clojurebotjava.lang.Exception: Unable to resolve var: $ in this context
23:14cooldude127yeah not an operator
23:17durka42just a symbol that the pl macro interprets
23:17durka42where's kotarak these days
23:17hiredmana $ b -> (a b)
23:18durka42right
23:18ozy`,(doc pl)
23:18clojurebot"([& forms]); "
23:18hiredman:P
23:18ozy`that's helpful
23:18cooldude127doc fail!
23:19cooldude127it should replace the empty message with something like "Document your code, dumbass!"
23:20durka42maybe that should be automatically included in :test
23:22hiredman(doc pl)
23:22hiredman,(doc pl)
23:22clojurebot"([& forms]); magic"
23:22durka42~google more magic switch
23:22clojurebotFirst, out of 1700000 results is:
23:22clojurebotA Story About 'Magic&#39;
23:22clojurebothttp://catb.org/jargon/html/magic-story.html
23:23durka42that's the one
23:23cooldude127clojurebot: you rule!
23:23clojurebotIt's greek to me.
23:23cooldude127:(
23:23cooldude127can't understand my compliments
23:25hiredmanhttp://github.com/hiredman/odds-and-ends/blob/41a1d49a52e4b559dc9599b444a69174ea0e5f55/functional.clj
23:25ozy`if you want to get truly APL-like behavior, you need every function to be an infix operator, with reader macros for HOF application (compose, fold), implicit scalar->vector->matrix and scalar->function auto-promotion, and a strict regiment of naming all functions with single characters
23:27hiredman,(macroexpand-1 '(pl a � b))
23:27clojurebot(do (comp a b))
23:28ozy`that's what I thought that did :p
23:28cooldude127that's nifty
23:28ozy`,(macroexpand-1 '(pl a $ b))
23:28clojurebot(do (a b))
23:28cooldude127hiredman: what are you doing to insert those damn interpuncts?
23:28ozy`,(macroexpand-1 '(pl +/ a b))
23:28clojurebotInvalid token: +/
23:28durka42,(macroexpand '(pl (??filter)))
23:28clojurebot(do ((uncurry (flip filter))))
23:29durka42is uncurry like partial?
23:29hiredmancooldude127: I have "/." mapped
23:29cooldude127oh
23:29hiredmandurka42: the url for the source I pasted it
23:30durka42yes, it confuses me
23:30hiredmanit is like a partial that keeps going
23:31hiredman,(pl (call (((?+ 1) 2) 3)))
23:31clojurebot6
23:31hiredmanuntil you call it with no args
23:32durka42oh, cool
23:32durka42kind of a lazy partial
23:39durka42but hiredman, what are you going to use ? for?
23:49cooldude127so apparently you can't define your own var called "/"
23:49cooldude127clojure can do it, but i can't!?
23:49durka42well clojure already did
23:49cooldude127yeah but i want to :(
23:50hiredman"/" is special
23:50cooldude127i'm trying to take over the math operators
23:50hiredmanfind a similar unicode character :P
23:50cooldude127hiredman: that's just mean to users
23:50durka42please don't :p
23:50cooldude127hiredman: this is why you scare me :)
23:51hiredmanI have no users
23:51cooldude127there is no good alternative
23:51durka42user=> (binding [/ +] (apply / [2 3]))
23:51durka425
23:52cooldude127durka42: yeah, but i can't say (def / ...)
23:52durka42true
23:52durka42because of the name conflict
23:52hiredmanno
23:52cooldude127durka42: no that's not why
23:52hiredmanit is because / is special
23:52cooldude127durka42: i already renamed it
23:52durka42i see
23:52cooldude127hiredman: well this blows
23:52durka42yeah, you can't do user//
23:52hiredman*shrug*
23:53cooldude127why not!? why shouldn't i be able to?
23:54cooldude127as long as it is just slashes, there should be no ambiguity
23:54hiredmanbecause / is generally namespace/function serperator
23:54cooldude127yeah, but / is obviously the "/" symbol in the current namespace
23:54cooldude127and user// is obviously the "/" symbol in the user namespace
23:54hiredmanobviously
23:55cooldude127so i should be able to do that
23:55hiredmanobviously
23:56cooldude127in the meantime, is there a decent symbol ON THE KEYBOARD that could substitute
23:56cooldude127?
23:56cooldude127i wish this was a typewriter, i would do : on top of -
23:56hiredmantoo bad % is taken too
23:56cooldude127lol
23:56durka42/ ?
23:56durka42i mean, //
23:57cooldude127durka42: also not allowed
23:57cooldude127anything with a slash in it
23:57cooldude127and backslash is also already taken
23:57hiredman"div"
23:57cooldude127hiredman: yeah i might have to, but it's much uglier
23:58cooldude127someone in charge, this must not go unnoticed!
23:58durka42user=> (eval `(def ~(symbol "user" "//") +))
23:58durka42#'user///
23:58durka42but then you can't use it :p
23:59durka42i seem to have nullpointered the LispReader
23:59cooldude127durka42: if i successfully remove the mapping to / in clojure.core, i could probably use it