#clojure logs

2009-02-24

00:00cmvkkpeople do that kind of thing all the time. it's not my bag, but if it works for you, why not?
00:00notallamai think parens are wonderful creatures.
00:00jbondesonit reminds me of the C macro packages that let you write code like it was Fortran
00:01notallamahas anyone made a python intepreter that requires a whole bunch of parens? that'd be great.
00:01jbondesonor people who go from windows to linux and rename everything C D E .. etc
00:02cmvkkheh...people do that? i have a partition on my drive mounted to /f, but this is the first time i saw that connection.
00:03notallamai went from windows to linux and it ate my boot sector. :/
00:03jbondesonpeople will do things that make no sense in a new environment just to make it seem like they're in familiar territory
00:03cmvkko dpm
00:03cmvkkcrud
00:03notallamai tried again when i got a laptop and it's running well now. having 2 computers is so nice for trying new stuff.
00:04cmvkki don't suppose anyone in here has messed around wtih the javax.sound.sampled package before have they? i am having a problem with it.
00:04hiredmanthe first time I installed linux it ate the boot sector of my dad's work computer
00:05hiredman(I was trying to install it and have it boot off a zip disk)
00:05notallamai had ubuntu running from a thumb drive when it happened. it was working for a couple days first.
00:13hiredman,(pl inc $ inc $ inc 0)
00:13clojurebotjava.lang.Exception: Unable to resolve symbol: pl in this context
00:15hiredman,(pl inc $ inc $ inc 0)
00:15clojurebotjava.lang.Exception: LazySeq used in 'if'
00:20hiredmanthat is most unfortunate
00:21hiredmanI am pretty sure that is false positive too
00:23danlarkin,(macroexpand-1 '(pl inc $ inc $ inc 0))
00:23clojurebotjava.lang.RuntimeException: java.lang.Exception: LazySeq used in 'if'
00:23danlarkingrrrrumble
00:26jbondesonhmmm, there's got to be a better way than (into {} (map vec (partition 2 '(:a "A" :b "B"))))
00:27hiredmanuh
00:27hiredman,(apply hash-map '(:a "A" :b "B"))
00:27clojurebot{:b "B", :a "A"}
00:27jbondesonhah
00:27jbondesonsee
00:28hiredman,(apply assoc {} '(:a "A" :b "B"))
00:28clojurebot{:b "B", :a "A"}
00:28hiredman,(apply (reduce assoc {} '(:a "A" :b "B")))
00:28clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: core$assoc
00:29hiredmanoh, right
00:29jbondesontried the reduce way, just not the apply
00:29hiredmananyway
00:31jbondesoni hardly ever use maps (i mean who could possibly need any other data structure besides a list?) so i always screw the map functions up
00:38dnolenjbondeson do you want to preserve the order?
00:39jbondesondnolen: nah, just looking to do keyed arg lookup with defaults
00:40dnolengotcha
01:14kalle135_http://alpha10.de
01:19DTrejoHello everybody. Does anyone know if clojure would work with GWT?
01:26DTrejoI guess you guys are all asleep. I'll check in later.
01:29hiredmantrolls is also <reply>Detritus like
01:29hiredman~trolls is also <reply>Detritus like
01:29clojurebotRoger.
01:30zakwilsonclojurebot: trolls?
01:30clojurebotDetritus like
01:34DTrejoclojurebot: trolls?
01:34clojurebotaccording to troll lore living beings move backwards through time
01:36DTrejoclojurebot: trolls?
01:36clojurebottrolls are like harmless particles that people have terrible allergies to. If you don't start shouting and blowing your nose at them, they're just misguided young men.
01:37DTrejohey hiredman, zakwilson do you know if gwt works with Clojure?
01:43DTrejonevermind, I got my question answered: compile Clojure to Java, decompile to source, then GWT that to JS
01:50danleianyone got slime working with r1303?
02:00jochudanlei: Works fine over here, is it broken for you?
02:01danleihm, i get a few errors
02:01danleijava.lang.Exception: Unable to resolve symbol: lazy-seq in this context (core.clj:70)
02:02danleiand so on, in the inferior-lisp buffer
02:03jochuAre you sure you're running r1303? lazy-seq is new / part of the recent lazier clojure. It should be defined.
02:04danleihm, i updated everything (clojure, clojure-contrib, swank-clojure and clojure-mode), but i'll double-check.
02:14danleihm
02:14danleii'll try restarting emacs
02:18danleiwell, i'm sure i'm at r1303, just ran mvn install, pulled clojure-mode/swank-clojure, and restarted emacs.
02:18danleierror messages:
02:19danleijava.lang.Exception: Unable to resolve symbol: lazy-seq in this context (core.clj:70)
02:19danleijava.lang.Exception: No such var: swank.swank/ignore-protocol-version (NO_SOURCE_FILE:9)
02:19danleijava.lang.Exception: No such var: swank.swank/start-server (NO_SOURCE_FILE:11)
02:19danleihm ...
02:23danleii think i've seen similar error messages some time ago ... but i'm not sure ...
02:37jochudanlei: Ack, sorry. Um - inside the *inferior-lisp* buffer can you evaluate (lazy-seq [1]) ?
02:41danleino, neither in the inferior-lisp buffer, nor when running clj from the command line
02:42danleihm, but svn info says r1303 and mvn install installed correctly
02:45danleiso i guess i'll have to install the branch with the lazy streams stuff, right?
02:45hiredmanno
02:45hiredmanlazy has been merged with the main branch
02:46danleiok, thanks hiredman
02:47hiredmanI would examine you classpath and make sure the clojure.jar in it is the right one
02:47hiredmanyour
02:48danleii'm just checking. the odd thing is, i just did as always: svn up mvn install ... fire up slime
02:49danleithere was no possibility to check the rev from the repl, i guess?
02:49jochuHmm - does 'unzip -l clojure.jar | grep lazy_seq' list anything?
02:49danleia sec
02:49hiredmandanlei: well, type lazy-seq
02:50danleino lazy-seq ... ok
02:50hiredman~def lazy-seq
02:51danleihm, but i did double check my path with the path mvn installed the jar at (at least it said it did)
02:51jochuis there a clean and re-build?
02:51hiredmanrun ant clean
02:51danleiok
02:51hiredmanand stop using maven :(
02:51danleisorry =)
02:51danleii'm not a java guy
02:52danleiwhat would be better? just typing ant?
02:52hiredmanyes
02:52danleidon't know much about that stuff
02:52hiredmanant clean then ant
02:52jochuI typically: ant clean && ant
02:52danleiok, i'll ditch maven
02:52danleithanks
02:52hiredmanant builds clojure.jar
02:56danleiok, got lazy-seq working, thanks
03:05danleiok, error messages are gone, but now i'll have another problem
03:05danleiConnection opened on local port 60599
03:05danleiConnecting to swank on port 60599
03:05danleiand nothing happens
03:07danleis/i'll/i/
03:14cmvkklet's say i have a million chunks of data that i have to generate, and i can generate that data in any order (or all at once concurrently), but i have to write it to file in a particular order.
03:14cmvkkwhat's the best way to make sure that happens while still preserving concurrency? watchers?
03:15cmvkkideally i want to minimize the amount of time a chunk stays in memory before being written to file.
03:16cmvkkmy idea right now is to number each chunk, then have a series of agents that grab a number off of an incrementing atom, generate that chunk, then put the data in a map ref assoced to its number.
03:17cmvkkthen have a watcher on the ref that checks to see if the next chunk-to-be-written is in the map?
03:18cmvkk...can refs even have watchers?
03:18danleiso, if i try to connect manually, by slime-connect 127.0.0.1 <port>, i get this:
03:18danlei Exception in thread "Read Loop Thread" java.lang.RuntimeException: java.lang.NumberFormatException: For input string: ""
03:18danleiet cetera
03:22cgrand1cmvkk: yup refs have watchers
03:23jochudanlei: Try deleting ~/.slime/cljclass and see if that helps - but I'm taking off for the night. If you wind up still having issues, shoot me an email including the *slime-events* buffer and I'll take a look at it tomorrow.
03:24danleiok, thanks jochu
03:26danleiworks, thank you very much
04:43BrackiHow do I prinln a vector of strings joining them with spaces?
04:45ayrnieu,(interpose " " (map str [1 2 3 4]))
04:45clojurebot("1" " " "2" " " "3" " " "4")
04:46ayrnieu,(apply str (interpose " " (map str [1 2 3 4])))
04:46clojurebot"1 2 3 4"
04:46ayrnieu,(apply str (interleave ["hi" "there" "mon" "frere"] (repeat "\n")))
04:46clojurebot"hi\nthere\nmon\nfrere\n"
04:47ayrnieuBracki - I noticed that you started watching clj-actos ; I'm not going to do anything with it, so if you're interested I'd advice that you fork it, or study it to get what you want out of it.
05:00BrackiYep, thx.
05:26BrackiFAQ
05:26Bracki,FAQ
05:26clojurebotjava.lang.Exception: Unable to resolve symbol: FAQ in this context
05:28BrackiDoes _ get a special treatment?
05:28Brackiwhen used in bindings?
05:29ayrnieu,((fn [a a] 3))
05:29clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: sandbox$eval--1178$fn
05:29ayrnieu,((fn [a a] 3) 1 2)
05:29clojurebot3
05:30ayrnieuI'd expect that to error in a future version of clojure. [_ _] should not.
05:31BrackiAh because the bindings weren't used in the body?
05:31ayrnieuand after AWizzArd writes his clojure lint, you can find unused variables in your code. This too should not warn on _
05:32Bracki,(doc frest)
05:32clojurebotjava.lang.Exception: Unable to resolve var: frest in this context
05:32BrackiHm, is frest gone?
05:35Bracki,(doc fnext)
05:35clojurebot"([x]); Same as (first (next x))"
05:43gregh,(doc second)
05:43clojurebot"([x]); Same as (first (next x))"
05:43greghgood to know. :)
05:45Bracki(doc last)
05:45clojurebotReturn the last item in coll, in linear time; arglists ([coll])
05:45BrackiHow do I convert a String[] into a list or vector?
05:46BrackiAh, lazy-seq.
05:46alinp(lazy-seq "abc")
05:47alinp,(lazy-seq "abc")
05:47clojurebot(\a \b \c)
05:47alinpoh, you want to convert an array of Strings
05:58Bracki,(import java.net InetAddress)
05:58clojurebotjava.lang.ClassNotFoundException: java.net
05:58BrackiWhy doesn't that work?
06:05leafwBracki: check java interop. You may use (import 'java.new.InetAddress) or (import '(java.net InetAddress))
06:06leafwthe second one lets you add multiple imports from the same namespace.
06:35djpowellyou probably just want seq rather than lazy-seq
06:36djpowellI heard rich mention a unit conversion language in one of his videos, does anyone remember what it was called?
06:38djpowellrhickey: what was that unit conversion program you mentioned in one of your videos
06:58AWizzArd,(doc drop-while)
06:58clojurebot"([pred coll]); Returns a lazy sequence of the items in coll starting from the first item for which (pred item) returns nil."
06:58AWizzArdclojurebot: max people
06:58clojurebotmax people is 149
07:05klibbigthttp://arclanguage.org/item?id=8903 <- the thing is, i dont know if this guy is joking or not, sadly i think he is serious(hopefully it is someone from this channel being ironic).
07:12ayrnieu[] is briefer than #() , fn is briefer than lambda , but clojure also lacks macrolet, symbol-macro, reader macros, several kinds of macro-useful puns. So it's not crazy to say that clojure is too verbose.
07:12ayrnieuas Let Over Lambda cautions: http://paste.lisp.org/display/75921
07:13ayrnieubut this guy might've been a J hacker.
07:19AWizzArdayrnieu: Rich decided against reader macros. They are a nice thing for a single hacker, but probably not a good thing for teams.
07:22ayrnieuthey're fine for teams, but it's very arguably a good marketing decision to leave them out.
07:23klibbigtayrnieu: are you kidding me? how is clojure possibly verbose? i dont think rdc instead of reduce or mp instead of map is anything to focus on. id would be stupid t do so. and ti makes things less readable
07:23AWizzArdMaybe they can be okay for teams too.. I asked Rich if we can get reader macros. Anyway, we can not prove if they are in general good for the productivity or not (= making software development cheaper).
07:23klibbigtwhat do I need to do to add my own reader-macros? just hack some of the java code right?
07:23ayrnieuklibbigt - sorry, are you talking to me from a mirror universe in which half of what I said was the opposide of what I'd written?
07:26AWizzArdayrnieu: you basically want to say: Clojure is not verbose, but it still has potential to reduce verbosity by introducing macrolet and symbol-macro?
07:26ayrnieuAWizzArd - did you read that paste?
07:28AWizzArdyes
07:29AWizzArdThe context for question is what you said before you posted that link.
07:29ayrnieuhm.
07:30AWizzArdthe: "So it's not crazy to say that clojure is too verbose."
07:30AWizzArdit sounds not that you say that Clojure is verbose, as klibbigt supposes, but instead you see potential for reducing verbosity in the non-verbose language Clojure.
07:32ayrnieuAWizzArd, there's a language called HQ9+. It has four instructions: H, Q, 9, and +. H prints "Hello, world!", Q prints a quine of the HQ9+ program, 9 does 99-bottles-of-beer, + increments an accumulator "to make it turing-complete".
07:33ayrnieuFor the ends, HQ9+ is about as terse as you can get.
07:33ayrnieuThere's no verbosity in 'h'. The language is very finely optimized.
07:34ayrnieuBut you would not be crazy to say that it's actually an incredibly verbose language, because the only way to do something seemingly very similar - to print one million "Hello, world!"s, is to put one million 'h' instructions in your program.
07:35ayrnieuThis is not to say that Clojure is exactly as impaired, but to bludgeon the terms you're using: that laguages 'are verbose', that I could be suggesting something to make it 'less verbose' in an absolute way.
07:38ayrnieuwith this in mind, http://groups.google.com/group/comp.lang.lisp/msg/28cb9d4217fe6dc3?dmode=source may also help you.
07:38BrackiHow do I log to the repl?
07:38ayrnieuI need to fight vmware.
07:41Bracki,(doc repl)
07:41clojurebotjava.lang.Exception: Unable to resolve var: repl in this context
08:08ChouserI think the problem with reader macros isn't so much teams as composing 3rdparty libs.
08:09rhickeyChouser: right, reader macros are bad for community
08:09rhickeyplus, I plan on using all the good characters :)
08:10ChouserIf hacker X writes lib XL and hacker Y writes YL, and both XL and YL define reader macro $, then when hacker Z wants to use both XL and YL, what should he do??
08:11Chouserrhickey: any opinion on the proposed changes to :use? Nothing to say on that subject yet I guess?
08:12Chouserrhickey: by which I mean, "good morning". :-)
08:12rhickeyChouser: is there a way to be backwards compatible? I think trying to do things compatibly should be the emphasis if possible
08:12leafwChouser: can reader macros be namespaced?
08:13Chouserleafw: I made such a proposal, but it was denied. Such is life under a BDFL. :-)
08:13rhickeyI think people see things like the seq changes and feel - "free-for-all!" let's rename things etc. That was inevitably breaking
08:13Chouserrhickey: my original proposal was minimally breaking, but if even that is too much a new keyword could be introduced. :demand
08:14rhickeyor even :uses
08:14Chouser:request
08:14Chouserright
08:15alinphi
08:16alinplazy and STM are borrowed from haskell ?
08:16alinpas concepts
08:16Chouserheh
08:16alinplazy evaluation I mean
08:16alinp(at least this is where I met these concepts)
08:17rhickeyalinp: Clojure doesn't really have lazy evaluation, just lazy sequences, but yes, Haskell inspired there
08:17Chouserrhickey: I would have suggest my change even if 1.0 had just been forked. I didn't need any encouragement from you. :-)
08:17rhickeyThe STM is not like Haskell's
08:17HolcxjoBackwards compatibility if overrated this early in the development...
08:17Chouserleafw: http://clojure-log.n01se.net/date/2008-11-06.html#19:36b
08:17alinpthanks rhickey
08:19klibbigt1
08:20rhickeyMy thought this morning was to do integers as unboxed longs, and floats as unboxed doubles, longs would check for overflow and throw, if you want bigints you have to say so
08:21rhickeyalso have some thoughts on supporting longs and doubles as args/returns
08:21rhickeysince tagged numbers are so far in the future, if ever
08:22leafwrhickey: float math is significantly faster than double math (as much as 2 or 3 times in some instances).
08:22rhickeyleafw: not in the future
08:22leafwrhickey: true.
08:23HolcxjoAnd integers will silently overflow?
08:23rhickeyHolcxjo: no, never
08:24rhickeyunless you explicitly say "unsafe"
08:24Holcxjoah! I missed the bit about "check for overflow and throw"
08:25rhickeyit ends up hotspot does a good job with the overflow-detection code, still many times faster than boxed arithmetic
08:25HolcxjoPython sort-of went the other way and made away with the need to explicitly request long ints...
08:25Holcxjo... I thought that was a big win
08:25rhickeyHolcxjo: long ints or bigints?
08:26HolcxjoI am a bit hazy about detauls -- you had to append a "L" to an int literal to request a long int (I think those didn't overflow silently)
08:27rhickeythey grew arbitrarily large?
08:27HolcxjoMakes for ugly code to have all the "L"s on you constants just to have correct math in all cases
08:28Holcxjorhickey: I think the long-ints were true bigints, yes
08:28rhickeyI'm not advocating incorrect math, just "pay for what you use"
08:28Holcxjorhickey: but don't quote me on that -- my mind has forgotten these things
08:28Chouseras always I'm in favor of uncluttered code over performance.
08:29Holcxjorhickey: Well there is only a shade of difference between "program doesn't work because it gives wrong results" (silent overflows) or "program doesn't work because it crashes" (throws exception that programmer didn't expect)
08:29rhickeyChouser: but how much of your code would overflow long, not counting fib and factorial silliness?
08:30Holcxjorhickey: and how much code will fail in the future when requirements change slightly and you have to deal with a lot more data / larger quantities all of a sudden?
08:31rhickeyHolcxjo: I understand the theoretical argument, and the absolute need for knowing what is happening, and an option for arbitrary growth, nonetheless, in practice, it's a non-problem for the vast majority of integer arithmetic
08:32rhickeythat arithmetic being 20x slower as a result
08:32Holcxjorhickey: I agree. What I am saying is that programmers suck at identifying which small bit of their arithmetic *does* matter here
08:32Holcxjo.. or might matter in the future...
08:32Holcxjo(remember: nobody will ever need more than 640KB so we can optimise things in the address space for performance)
08:33rhickeyI guess I've done too much work in C++/Java/C# to believe it's the problem it's made out to be
08:34rhickeyespecially if there is overflow detection
08:34HolcxjoCan't we make unboxed numbers being ugly and on-demand, so one can have them when needed?
08:34rhickeyHolcxjo: that's what we have now, and casual code is much slower at math than equivalent Common Lisp/ Smalltalk
08:35Holcxjorhickey: And that's because in the JVM we cannot tag unboxed numbers or what?
08:35rhickeythere are domains in which people would have to annotate almost everything
08:35rhickeyHolcxjo: right, no tags
08:36rhickeyeither primitive or Object
08:36Chouserrhickey: only my project euler solutions.
08:38Chousernothing else I do would overflow longs
08:38HolcxjoFor us JVM ignoramusses: how many bits in a java int? 32? or 31?
08:38rhickeyHolcxjo: 32
08:39rhickeythey map to machine instructions
08:39Chousereh, I don't have a horse in this race. I like that everything "just works" now, but it's hardly egregious to require marking numbers that need to grow past long.
08:40rhickeyChouser: or perhaps some (with-bignums ...)
08:40gnuvinceHello everyone
08:40rhickeythen we'll just have to argue over the default :)
08:40rhickey(with-primitives ...)
08:41gnuvinceHolcxjo: about Java's integral types, they're all signed.
08:41Holcxjorhickey: rather with-real-integers vs with-fake-integers :-)
08:42rhickeydo-it-now vs take-all-day :)
08:42leafwin image processing, we have to annotate a lot of numbers. The (with-primitives ...) construct would be wellcomed.
08:43Holcxjodo-it vs do-or-dont :-)
08:43leafwand I agree that the default should be infintely growing numbers (never overflow).
08:44rhickeynothing is going to overflow in any case, that is not the proposal
08:46rhickeyof course, this is still idle speculation, when things cross the call boundary they are boxed and you need to tell me what they are explicitly anyway, at least right now
08:49leafwI see how the latter can ruin the whole approach, since it can't be a proper 'binding' propagation.
08:49rhickeyleafw: not necessarily
08:50Holcxjoleafw: Inlining functions should help, or not?
08:53leafwI don't know enough of clojure's internal details to say anything about it.
08:54leafwI use clojure; I don't develop it.
09:01leafw(to further specify that: to me clojure is a full replacement to java the language. I need java the libraries.)
09:43BrackiSo what's best practice for logging? Can I log to the repl?
09:46AWizzArd,(doc drop-while)
09:46clojurebot"([pred coll]); Returns a lazy sequence of the items in coll starting from the first item for which (pred item) returns nil."
09:46AWizzArdrhickey: is it intended in the doc for drop-while to mention only nil? It could for example also read: "... for which (pred item) returns nil or false."
10:01Chousercgrand: have you seen seque?
10:03Chouseroh, sorry, the blog post prompting that question is from 8 months ago -- just popped up in my feed reader again.
10:05cgrandchouser?
10:07Chouserhttp://clj-me.blogspot.com/2008/06/lazier-than-lazy.html
10:07cgrandChouser: Hmm I guess that feedburner is messing with the feed
10:07Chouserseemed similar to seque, so I wondered if you knew about it.
10:08Chouseractually, it came to me this time via Clojure Pipe, so any number of intermediaries could be messing with it.
10:09danlarkinif only we had planet.clojure.org you could be sure...
10:14cgrandChouser: yes, I know seque. I remember that in a weel or so there were two or three independent attempts to generate a seq in another thread
10:15cgrand:s/its/his
10:16WizardofWestmarcand here I thought you were admitting to being an AI cgrand ;-)
10:20cgranddoes someone know how to test (in a macro) if a symbol denotes a local?
10:23Chouserbesides using eval, resolve, and a process of elimination?
10:24Chouserat runtime. :-P
10:25rhickeycgrand: there isn't yet an API for exposing the compiler's notion of the environment to a macro
10:26ChouserI guess the compiler has some information about the surrounding block by the time it's evaling interior macros?
10:26rhickeyclojure.lang.Compiler.LOCAL_ENV if you want to play around
10:27shooverChouser: are you off the hook for textjure? I can't actually get the download from sourceforge, so I can't tell where Waterfront stands
10:27cgrandrhickey: thanks, I was stupidly blocking on referenceLocal being package, while I didn't checked whether LOCAL_ENV was public...
10:27Chousershoover: I downloaded Waterfront, but haven't tried it yet.
10:28rhickeycgrand: referenceLocal is effectful in that it will cause bindings to become closed-over
10:48BrackiShould i use #^{:doc ""} or just ""?
10:49Brackifor documentation.
10:50danlarkin""
10:50BrackiWhen should I use the meta data?
10:51danlarkinthe other form? when you need to attach to keys other than :doc
10:53BrackiAnd how do I access the doc?
10:53Chouser(doc +)
10:53clojurebotReturns the sum of nums. (+) returns 0.; arglists ([] [x] [x y] [x y & more])
10:53Bracki,(:doc (meta meta))
10:53clojurebotnil
10:53lisppaste8ozzilee pasted "A Better Way?" at http://paste.lisp.org/display/76085
10:54ChouserBracki: that would give you the :doc value of the metadata of the *function* meta. But docs are usually attached to the *var*.
10:54Chouser,(:doc (meta (var meta)))
10:54clojurebot"Returns the metadata of obj, returns nil if there is no metadata."
10:54ozzileeHey all. Is there a better way to do the above? I want to re-use a factory object within a defined function.
10:55Chouserozzilee: you could just store the factory object in another var
10:56lisppaste8ozzilee annotated #76085 "Something like this?" at http://paste.lisp.org/display/76085#1
10:56Chouseroh! hm...
10:56ozzileeChouser: Right, but I don't really need access to the factory object anywhere else...
10:57ozzileeI saw memoize in contrib, but that's not quite what I want (I don't think).
10:57cgrandozzilee: invert the let and the def?
10:57Chouserozzilee: I'd normally but it in its own var, and maybe make the var private, but defn inside the let is ok too, I think.
10:58ozzileecgrand: Won't that re-evaluate the (FooFactory.) every time the function is called?
10:59lisppaste8cgrand annotated #76085 "inverted def and let" at http://paste.lisp.org/display/76085#2
10:59ozzileecgrand: Ah, of course. Hmm.
11:00Chousercgrand: nice. I totally missed that.
11:05BrackiWhat's the inverse of (keyword)?
11:06rhickeycgrand: like what?
11:06rhickeysymbol-macrolet?
11:07AWizzArd,(str :reverse-of-keyword)
11:07clojurebot":reverse-of-keyword"
11:07cgrandBracki: name
11:07AWizzArdcgrand: http://www.lispworks.com/documentation/HyperSpec/Body/s_symbol.htm
11:08cgrandAWizzArd: thanks
11:12cgrandrhickey: not quite, I'd like to pass some context information from a macro to another (potentially deeply nested) macro.
11:13rhickeycgrand: compile-time vars?
11:15rhickeyI know, not lexical, but that's how the compiler works
11:20cgrandrhickey: yes but, in the compiler, you control when you pop the bindings.
11:22Chousercgrand: deeply nested lexically, right?
11:22rhickeycgrand: what's your use case?
11:23cgrand(it's not an actual problem, I found a workaround but it keeps nagging me.)
11:23Chousercould you share a gensym value between the macros and bind a vlue to it using 'let'?
11:27cooldude127alright, my main system still has an old version of clojure before the merge, but i just installed the newest stuff in a VM, time to find out how much code doesn't work anymore
11:28cgrandbbl
11:30cooldude127and apparently i didn't rely on anything that got messed with, cuz my code just compiled with no errors after no modifications
11:30cooldude127seriously? i didn't use rest once?
11:30jbondesoncooldude127: you turned on lazy-seq in if assert, right?
11:30cooldude127jbondeson: no i did not
11:30jbondesoncooldude127: rest is still there
11:30jbondesonyou have to compile clojure with the flag -Dclojure.assert-if-lazy-seq=please
11:31cooldude127jbondeson: oh, so that's an option for the ant command?
11:31jbondesonyup
11:31Chouser"true" works instead of "please" if you're having a less whimsical day.
11:32jbondesonChouser: yes, but then you're dead inside...
11:33jbondesonbe nice to clojure and it will be nice to you!
11:33cooldude127still no errors, i don't think this code actually did anything like that
11:33jbondesonthe asserts happen when you run the code
11:33cooldude127shit
11:34jbondesonit modifies the if macro to check for a naked lazy-seq in the condition and assert if it finds one
11:34Chousercompiling successfully means you weren't using lazy-cons yourself, which is good. Those are the one that take the most thought to fix correctly.
11:34Chouserthough now that seq is cheap again, those probably are easier
11:35cooldude127well, some of this stuff is tested, so 78 assertions just all passed
11:35cooldude127that's good enough for me, i can't test everything
11:35gnuvincecooldude127: check out the random testing libs ;)
11:36cooldude127gnuvince: what libs would those be?
11:36gnuvinceFact, ClojureCheck
11:36cooldude127oh
11:36cooldude127like quickcheck for haskell?
11:36gnuvinceYep
11:36gnuvinceQuickCheck is an awesome tool
11:37BrackiLoosely based on technomancy's mire I've started to work on this: http://gist.github.com/69650
11:37BrackiIt's Urkle - the awkward IRCd
11:38AWizzArdis there a clause for condp that matches anything?
11:38BrackiAny reviews welcome.
11:38ChouserAWizzArd: a final single expression
11:39Chouserinstead of a pair
11:39AWizzArd,(condp = (first [1 2]) 2 (println "two") (println "thx"))
11:39clojurebotthx
11:40AWizzArd:)
11:41kotarakAWizzArd: w/o last expression and if no clause matches, condp throws..
11:41AWizzArdyes, I like that behaviour, it is just that during my explorative testing phase it is nicer to have something else
12:13cemerickAre default print-method and print-dup implementations for arrays coming soon? I have ones for byte[] and char[], but I suspect rhickey has better ideas for hwo such things should work.
12:18Chousercemerick: that's the first time I've heard it suggested
12:19cemerickheh
12:21cemerickI wrote one-offs for both byte[] and char[], but it occurs to me that in general, primitive arrays would be best print-dup'd using java serialization.
12:21cp2hi guys
12:24cemerickI guess it would still be better (and just as space-efficient) to prefer a human-readable form for char[], though.
12:27cooldude127jbondeson: chouser already wrote the stuff i want
12:27cooldude127it just isn't in the language yet
12:27jbondesonsuuuure, not you have other people doing your dirty work
12:27jbondeson-not+now
12:27cooldude127lol
12:28cooldude127i believe he wrote it before i even wanted it
12:28jbondesonstanding on top of a mountain of midgets also works, you just need more of them
12:30leafwjbondeson: that is not true -- becuse of what the "mythical man month" explains.
12:31cooldude127lol
12:32jbondesoni must have missed the chapter on the theoretical impossibilty of midget moutains in MMM
12:35cemerickmidgets generally can't see far enough to know which way to go though, so it's pretty easy to be led astray with a mountain of them.
12:43AWizzArdCan one (reset! a-future)?
12:43jbondesonAWizzArd: that wouldn't make much sense, why would you want to do that?
12:45AWizzArdI have something that takes about 5 seconds. I would like to run this is a separate thread, so the user can continue without waiting. Sounds like an agent. But it needs full replacement always, which sounds like an atom, but those don't run in their own thread.
12:45AWizzArdAnd I want it to block when the user actually does something that requsets this data. Sounds like a future.
12:46AWizzArdSo, I like the behaviour of futures to run in their own thread and to block until @future is available.
12:46AWizzArdBut I need to change it. A future is a constant.
12:47danlarkincan't you just use an agent with (fn [new-state old-state] new-state) as its modifier function or whatever?
12:47AWizzArdthe problem I see is that @agent immediately returns a result, even if the agent is still working
12:47jbondesonyou could have a ref to a future and a function to manage it for you.
12:47jbondesonthough you'd have to double de-ref
12:47durka42(await agent) will block
12:48hiredmanand futures can await
12:48durka42or you could have like an atom with a future in it and keep swapping the future out
12:48AWizzArdyes sure, I can get there.. but each of those have disadvantages. The (await agent) is a leaky abstraction, as I never may forget the await before I deref. This can not happen with a future
12:49cemerickit's a very common pattern for the implementation of print-method and print-dup to be the same for various dispatch types -- maybe defmethod should take a list of multimethods, rather than single one.....
12:49AWizzArddurka42: that's about what I am doing at the moment, but the @@atomfuture looks strange j)
12:49AWizzArdj) ==> ;)
12:49hiredmancemerick: write a macro where it does
12:50cemerickhiredman: sure, that's trivial -- I was suggesting that it would be useful generally
12:50AWizzArdcool would be: futures that can be resetted, or having atoms running in their own thread
12:56ChouserAWizzArd: I don't really understand -- when you deref or force this thing, you want the previously computed value, or you want it to always block until a new value is calculated?
12:57AWizzArdChouser: second, on derefferencing block until the calculation finished
12:57AWizzArda future is doing this, plus it runs in parallel
13:03durka42how does clojure deal with this problem? http://en.wikipedia.org/wiki/Software_transactional_memory#Implementation_issues
13:03tashafaquestion... is it safe to update to the latest SVN of clojure
13:03tashafa?
13:03tashafaand still be able to use swank
13:03tashafaand emacs/slime
13:03WizardofWestmarctashafa: if you update to latest swank last I heard it worked
13:03triddelltashafa: works for me
13:04tashafayay! thanks guys
13:13danlarkinI will say this about mark volkmann; he sure does post on the mailing list a _lot_
13:17jbondesonclojurebot: Object Computing?
13:17clojurebotsee Subject Computing, Inc
13:35gnuvincedanlarkin: that he does.
13:43Lau_of_DKGood evening guys
13:44fogusThere's a clojure mailing list?
13:44Chouserfogus: google group
13:44fogusahhhh, of course
13:45Chouserdanlarkin: he's not the top poster this month. He's actually 7th
13:45danlarkinis he the top thread starter though?
13:46technomancyit's kind of scary that Google considers it do be "low" traffic
13:47danlarkinit's a part time job reading all the threads as it is
13:48ChouserI don't have that number. http://groups.google.com/group/clojure/about
13:50shooverdanlarkin: ever look at comp.lisp.lang? full time job
13:50greghcomp.lang.lisp is even busier! :)
13:51technomancyshoover: heck, it's a full-time job just *ignoring* c.l.l.
13:51Chouserheh
13:51WizardofWestmarcyeah I finally gave up on following c.l.l
13:51WizardofWestmarcI was just skipping so many posts it wasn't worth keeping in the RSS reader
13:51AWizzArdtoo bad, there was such a nice thread in the past days ;)
13:52WizardofWestmarcespecially since I wasn't USING CL heh
13:52WizardofWestmarcthe clojure one? I read that when it got linked
13:52WizardofWestmarcup to at least one round of Rich pointing out how ignorant some people were about the language
13:52AWizzArdwhile the google group actually discusses Clojure and gives nice support, in c.l.l Clojure is discussed itself.
13:52WizardofWestmarc(clojure)
13:52fogusreading xah lee's posts on c.l.l is a full-time job
13:52WizardofWestmarcungh
13:52fogusmaybe that's why everyone ignores him? ;)
13:53WizardofWestmarcif I could have a kill file in RSS, he'd have gone in it.
13:53AWizzArdkill filing is not so much needed, just don't read his posts
13:53technomancyheh
13:54technomancythat's how I first discovered the /ignore command on IRC
13:54WizardofWestmarcbut it's all that scrolling to get past all of them :P
13:54WizardofWestmarchaha I've never used ignore really for irc
13:54WizardofWestmarcbut then about the only other channel I hang out in besides this one I'm an #op so ignore's a bad idea >_>
13:55AWizzArdlately some lisp experts did not portrait Clojure correctly
13:55AWizzArdin c.l.l
13:56fogusAWizzArd: In the "Road to CLojure" thread?
13:56technomancyof course, they're not biased at *all*, right?
13:56AWizzArdhistory repeats.. since decades people who don't know Lisp and have never tried it were explaining things about Lisp, and posted why it doesn't work
13:57AWizzArdnow the funny thing is: it happens again with the new dialect Clojure. But this time it's the Lispers who misrepresent it
13:57AWizzArdfogus: yes that thread
13:57AWizzArdI think I wrote 50% of it ;)
13:58fogusI tried my best to follow that thread, but I lost track after a couple days away from the computer. What's the general gist of the misrepresentation(s)?
13:58rhickeyAWizzArd: == Andre?
13:58AWizzArdrhickey: indeed
13:58AWizzArdI did not know that you were not aware of it ;)
14:12ChousukeI consider the c.l.l people's reaction towards Clojure quite expected.
14:13ChousukeClojure does break many traditions
14:13Chousukepeople like tradition :)
14:13Lau_of_DKc.l.l ?
14:13Chousukecomp.lang.lisp
14:14technomancythey're probably jealous of the interest it's getting too; CL has a hard time picking up inertia.
14:14ChousukeI don't think anyone should try to assert which language is "better" than the others. :/
14:15technomancyChousuke: not to anyone who has a vested interest in the others, at least. =)
14:15Chousukeit doesn't make sense in general
14:16Chousukeif I say Clojure is better than CL, that assertion contains no information at all.
14:16Chousukeexcept my opinion, which is worthless
14:16cemerickugh, having literals for array classes would be *really* handy right now...
14:16Chousercemerick: into-array is too verbose?
14:16p_lgah, Tilton made a real flamebait on c.l.l
14:16Chousukeunless of course I establish first that my opinion matters :)
14:17WizardofWestmarcp_l: Kenny's good at flame bait
14:17cemerickChouser: no, into-array is fine, but if I want the char[] Class, then you need (class (make-array Character/TYPE 0)) or somesuch (unless I'm missing something).
14:18cemerickI've got an arrayclass macro that does that, but even that is irritating
14:18hiredmanooo
14:18hiredmananother clojure editor in clojure
14:20durka42waterfront?
14:20hiredmanyeah
14:38cemerick(read-string "#=(.toCharArray \"foo\")") => Exception: can't resolve .toCharArray ..... any ideas why this?
14:38cemericks/this/this is
14:40cemerickah, but (eval (read-string "(.toCharArray \"foo\")")) works just fine -- I feel like I'm missing something about how the reader works within the context of #= forms
14:42brianh_wow. i'm going along, allowing life to interfere with my contrib updates over several days & wham! I've got C# code on my box
14:42brianh_i promise not to let it happen again! :)
14:46p_lbrianh_: ?
14:47brianh_there's a clojureCLR package in contrib now
14:49p_l:)
14:50brianh_btw good news. my manager has agreed to let me use clojure in an 'official' prototype/proof-of-concept project here at work
14:50clojurebotsvn rev 1304; fix nil pun in genclass
14:50jbondesonwaaaait a sec, you ask permission? just "accidentally" let it go to production! ;)
14:51WizardofWestmarcIf we used the jvm here at work there would already be code in production from clojure >_>
14:51Chouserbrianh_: nice!
14:51brianh_jbondeson: heh. that was going to be my next tactic ;)
14:51WizardofWestmarcthen hear all the shrieks of horror at sexpressions >_>
14:52jbondesoni'm about 2 shakes from getting some F# into production...
14:52jbondeson"compiles the same!"
14:52gnuvince"That's Sun's new extension to make concurrency easier. They changed the syntax a bit..."
14:52RaynesF# makes the hair on the back of my neck raise.
14:53jbondesonit's just O'Caml
14:53AWizzArdhas good ideas
14:53RaynesHow can you pack so much inelegance in a single language. @_@
14:53AWizzArdway better than coding Java or C# :)
14:54jbondesonRaynes: start with the ugly syntax of ML, add OO functionality to it, and then bring it to the CLR
14:54technomancywell, vaguely interested
14:54p_lnah, ML syntax is not bad
14:54Raynesp_l: Stop it.
14:54Raynes:|
14:54jbondeson;; is pretty bad
14:54p_lRaynes: Won't :P
14:54gnuvincejbondeson: you use that at the REPL only.
14:55jbondesongnuvince: or at as an explicit statement break
14:55gnuvincethat's a single ;
14:55jbondesonsingle was used inside of statements
14:55jbondesoniirc
14:55clojurebotsvn rev 1305; really fix nil pun in genclass
14:55gnuvinceprint_string "Hello";
14:55gnuvinceprint_int "world"
14:56gnuvinceerrr
14:56gnuvinceprint_string "world"
14:56gnuvincedur
14:59jbondesonyeah, ; can be used to separate array items, or sub-statements
14:59jbondeson(at least in ocaml
14:59gnuvinceyeah
14:59gnuvinceNot sure in F#
14:59jbondesonyou can use it, generally don't
15:00gnuvinceThe # pretty much assured that I wouldn't pick it up in my spare time.
15:00WizardofWestmarcwhat if it were Gb ?
15:00jbondesonthey can cross compile with ocaml pretty well
15:00hiredmanhar har
15:00gnuvinceWizardofWestmarc: it's .NET. I don't want to reboot into Windows to use Visual Studio
15:00WizardofWestmarcah ha
15:00WizardofWestmarcunderstandable
15:00jbondesongnuvince: yeah, see i work in a windows shop, sooooo
15:01jbondesoni'll take functional where i can get it
15:01gnuvinceyeah sure.
15:01gnuvinceI wouldn't mind using F#
15:01gnuvinceI just would mind doing it on my time.
15:01gnuvinceI'd rather go with languages that don't require me to buy a $700 IDE
15:01jbondesonyou don't
15:01jbondesonit works with the free VS
15:01fogusI have F# install on my Mac in Mono... played around with it a bit, but not extensively
15:02gnuvincejbondeson: still need to reboot.
15:02gnuvinceAnyway
15:02jbondesonvmware? ;)
15:02gnuvinceAs long as I'm going to get into statically typed functional languages, I may as well continue my Haskell journey.
15:02adakkakis there a different syntax for (:import ) in REPL?
15:02gnuvinceadakkak: no
15:03gnuvinceadakkak: (ns foo (:import (java.io File)))
15:03gnuvinceAlternatively: (import '(java.io File))
15:04p_lIf only Java didn't have borked X11 support (and requiring a big download for someone who doesn't have java installed) I might have used it for application writing more...
15:05WizardofWestmarcdon't most OSes come with Java prepackaged these days?
15:05gnuvincewindows doesn't
15:05p_lWizardofWestmarc: Only Solaris?
15:05WizardofWestmarcum
15:05WizardofWestmarcpretty sure my laptop had Java already on it, which is Vista
15:05p_lsrsly, only Solaris has not-broken, available-by-default Java install
15:05WizardofWestmarcJVM 1.6
15:06p_lWizardofWestmarc: MS doesn't have license to include JVM with operating system
15:06WizardofWestmarcI thought the courts required them to include it after the whole MS JVM debacle
15:06p_lWizardofWestmarc: It's your OEM's doing. Rare thing except for enterprise installs
15:06adakkakcan someone tell me what I doing wrong with this import then http://paste.lisp.org/display/76102
15:06p_lWizardofWestmarc: Actually it was removed with XP SP1a
15:07danlarkinos x ships with java
15:07hiredman~jdoc org.apache.http.client.HttpClient
15:07p_lWizardofWestmarc: Removed what was left of it, which wasn't enough to run anything other than simple applets that didn't use JVM 1.4 :)
15:08WizardofWestmarchuh
15:09p_lWizardofWestmarc: The only reason why my laptop came with JVM 1.6 preinstalled was because it had NetBeans, BlueJ and Eclipse included, for coursework (university-prepared system image)
15:09adakkakhiredman: the link does not work
15:09hiredmanadakkak: I am aware
15:09WizardofWestmarcp_l: mine was a Lenovo laptop
15:10p_lWizardofWestmarc: Then Lenovo bundles Java by default (mine was R61i)
15:10hiredmanadakkak: what does clj do?
15:10p_lHowever, I know that most don't include Java
15:10p_lAlso, getting java on some linux distros is a royal PITA
15:11adakkakjava.lang.ClassNotFoundException: org.apache.http.client.HttpClient (NO_SOURCE_FILE:0)
15:11hiredmanadakkak: what is in your launcher script
15:12adakkakthis is the one I am using http://paste.lisp.org/display/76104
15:14hiredmanadakkak: that script doesn't start the jvm (run the java command) anywere
15:15hiredmanso either that paste is incomplete, or that is not the script you are using
15:16hiredmanok
15:16adakkaksorry, it was incomplete here is an updated version http://paste.lisp.org/display/76104#1
15:16hiredmanok
15:17hiredmanthat script uses the -cp option which causes java to ignore CLASSPATH
15:18hiredmanit is setup to load jars out of ~/.clojure
15:18hiredmanso either change the script, or put your jars in ~/.clojure
15:19adakkakhiredman: thanks
15:19hiredmanthe alternative syntax thread is still going
15:19hiredman:|
15:19hiredmanadakkak: np
15:19adakkakadded $CLASSPATH to the script
15:21Chouserhm, no way to get 'future' to use the soloExecutor.
15:22gnuvinceShould Joshua Choi's fnparse library be considered for inclusion in clojure-contrib (if he agrees, of course)
15:23cooldude127what's fnparse do?
15:23jbondesonparse!
15:24jbondeson>_>
15:24gnuvincehttp://github.com/joshua-choi/fnparse/tree/fdeea49a1b0ba98456f8f401eab7c74f69ee6f1a/src/name/choi/joshua
15:24danlarkinit's a functional parser library
15:25danlarkinit's very useful, I like it
15:25jbondesonquite slick at that
15:26cooldude127i don't understand it, but that doesn't mean it's not useful
15:28danlarkinit took me a while to grok it but now that I do I'm seeing everything in terms of functions that return functions that parse :-o
15:29cooldude127lol
15:29adakkakNow that I figured out how to import the http-client apache library, I am having trouble using it. Why would (HttpClient.) give me a constructor error
15:30cooldude127adakkak: perhaps it has no default constructor?
15:30danlarkinadakkak: the constructor probably takes arguments
15:32hiredman~google apache HttpClient
15:32clojurebotFirst, out of 104000 results is:
15:32clojurebotHttpClient - HttpClient Home
15:32clojurebothttp://hc.apache.org/httpclient-3.x/
15:32gnuvinceI can't get the postscript file Josh links to :-/
15:33hiredmanadakkak: you know, I seem to remember walking down this path myself once
15:33hiredmanI ended up using xlightweb instead
15:33digash`(org.apache.http.impl.client.DefaultHttpClient.)
15:33hiredmanhttp://xlightweb.sourceforge.net/
15:34danlarkintechnomancy: I would like to see one
15:34p_ltechnomancy: Port drakma? :)
15:34danlarkinbut only if it's full featured!
15:35adakkakthanks
15:35danlarkinI want everything, toggles for following redirects, cookie support, the whole bag of tricks
15:35technomancydanlarkin: what qualifies as "full"?
15:35p_ldanlarkin: then a drakma port it should be... afaik drakma supported everything and a kitchen sink
15:35technomancyah yeah, sure
15:35Brackicooldude127: thx for the find-graph rewrite
15:36adakkakso I can use (org.apache....) without doing an import?
15:36technomancycustom HTTP headers is the main thing I would need
15:36danlarkintechnomancy: python's urllib2 + some... never heard of drakma, I'll look at it now
15:36cooldude127Bracki: funny story, this week in my data structures class i had to write a findPath function in java using both BFS and DFS
15:36Chouser(with-open [s (BufferedReader. (InputStreamReader. (.openStream (java.net.URL. "http://google.com/&quot;))))] (vec (line-seq s)))
15:37cooldude127Bracki: weird how those lined up
15:37digash`adakkak: sure
15:37technomancydanlarkin: once I get the screencast finished ...
15:37p_lhttp://weitz.de/drakma/ <--- that would be nice to have on clojure, I guess :)
15:37technomancythere are so many great ways I could end that sentence.
15:38technomancyprobably would do the date lib first though; there's more pain without that
15:39danlarkinhasn't cooldude127 done a date lib?
15:40cooldude127danlarkin: i've started one
15:40cooldude127it's on github in my fork of clojure-contrib
15:40cooldude127http://github.com/cooldude127/clojure-contrib
15:41jbondesonis there any clean way to do a recursive function when it takes "& args"? the double-listing is a pain.
15:42danlarkinjbondeson: can you define multiple arities, only one taking & args?
15:43jbondeson'spose, was hoping there was an easy answer with the recursive call doing some list destructuring.
15:46cemerickrhickey__: so, dotted ctors work OK in #=, but dotted method invocations don't. Do you expect that to persist? (read-string "#=(.toCharArray \"foo\")") => Exception
15:48technomancydanlarkin: yeah, I meant cleaning up his and getting it into contrib
15:56danlarkinjbondeson: well you can use destructuring with & args
15:56danlarkinnot sure exactly what you want to do, though
15:57jbondesoni would like to convert the (recursive-call (next args)) -> (recursive-call :the :actual :next :args)
15:57jbondesonthat would be nice
15:57danlarkinhm apply?
15:58hiredmanyou could just use trampoline
15:58jbondesonhiredman: interesting idea
15:59hiredmantrampoline is not a macro right?
15:59jbondesonthough it may have the same problem since it takes & args
15:59jbondesoncrap, gotta go to a meeting =/
15:59hiredman(apply trampoline func args)
15:59hiredmanand for recur, #(apply func args)
16:02danlarkinI'm assuming he's creating a lazy seq
16:02danlarkinfor obvious reasons
16:04hiredman,(doc lazy-seq)
16:04clojurebot"([& 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."
16:05hiredmanI do not think he is creating a lazy-seq
16:08danlarkinis there still lazy-cat?
16:08danlarkin(doc lazy-cat)
16:08clojurebotExpands to code which yields a lazy sequence of the concatenation of the supplied colls. Each coll expr is not evaluated until it is needed. (lazy-cat xs ys zs) === (concat (lazy-seq xs) (lazy-seq ys) (lazy-seq zs)); arglists ([& colls])
16:08danlarkinhe could be using that
16:26lisppaste8cemerick pasted "print-dup implementation for enums" at http://paste.lisp.org/display/76108
16:26cemerickThe above would work if http://groups.google.com/group/clojure/browse_frm/thread/34e4d47fc5144512 were resolved one way or the other.
16:33adakkakis there another way of writing (not (= a b)) in clojure, is there a != operator?
16:34cooldude127adakkak: not=
16:34cooldude127(not= a b)
16:36hiredman,((comp not =) 'a 'b)
16:36clojurebottrue
16:37adakkakthanks
16:37durka42,((complement =) 'a 'b)
16:37clojurebottrue
16:37hiredmanoooh
16:42adakkakhow do you raise exceptions in clojure
16:43adakkakis it just using (Exception. "name") , or is there something specific to clojure?
16:44technomancyI think you have to call throw on it. but it's pure Java IIUC
16:44technomancyno special lisp syntax
16:45jbondesonhiredman: trampoline worked, thanks
16:45Chouserunless you feel like trying clojure.contrib.error-kit
16:45durka42you can also play with chouser's error-kit
16:45durka42heh
16:45durka42which i keep meaning to do
16:45cooldude127error-kit is good stuff :)
16:45Chouserbah. missed an opportunity for false modesty.
16:48Lau_of_DKthats a shame Chouser.. btw did you try out ClojureQL yet? :)
16:48Chouserheh.
16:55adakkak,((comp java.io.FileInputStream. java.io.File.) "/tmp/f")
16:55clojurebotjava.lang.ClassNotFoundException: java.io.FileInputStream.
16:57hiredmanadakkak: java constructors and methods are not fns so not composable directly
16:57adakkakso it's reserved for clojure functions
16:58hiredmansure, if you want to put it that way
16:58hiredman(java.io.FileInputStream. x) is not a function call
16:58hiredmanit is wrapped in syntactic sugar to make it look like one
16:58hiredman,(macroexpand '(java.io.FileInputStream. x))
16:58clojurebot(new java.io.FileInputStream x)
16:59jbondesonwe're playing "tell me what idiotic things i'm doing" day with jbondeson.
16:59adakkakso macros are not composable
16:59jbondesonthere's nothing that is (and (seq? x) (seq x)), right?
17:00hiredmanonly fns are composable by the comp fn
17:01hiredman,(macro (meta #'comp))
17:01clojurebotjava.lang.Exception: Unable to resolve symbol: macro in this context
17:01hiredman,(:macro (meta #'comp))
17:01clojurebotnil
17:01hiredman,(:macro (meta #'for))
17:01clojurebottrue
17:01hiredmanI was pretty sure comp was a fn, but not completely sure
17:02Chouserjbondeson: 'seq' is the same as 'identity' on something that returns true for 'seq?'
17:02jbondesonexcept ()
17:03Chouserjbondeson: hm!
17:03jbondesonthat's the check i've been using for "No Really I'm Not a Non-Empty Seq!"
17:03ChouserI guess you're right. lazierness hasn't all sunk in yet.
17:04jbondesonerr i am a non-empty seq that is.
17:04jbondesoni just seem to do that quite a bit with the new lazy seqs
17:04Chouser(#(and (seq? x) (seq x)) '(1 2 3))
17:05Chouser,(#(and (seq? x) (seq x)) '(1 2 3))
17:05clojurebotjava.lang.Exception: Unable to resolve symbol: x in this context
17:05Chouser,(#(and (seq? %) (seq %)) '(1 2 3))
17:05clojurebot(1 2 3)
17:05hiredmanI would like #(or (and (seq? %) (seq %)) %)
17:06Chouserjbondeson: I guess you don't need to differentiate between lazy seqs and lists?
17:06jbondesonChouser: right, i want '() and (lazy-seq nil) to be treated the same
17:06Lau_of_DKGuys, new screenshots at http://wiki.github.com/Lau-of-DK/sofiaba - The new stuff is detailmaps and pre-made landscape (as opposed to fractals generated on the fly), and the entire world can now be controlled from the repl, ie. interactively. next up: Physics :)
17:06Lau_of_DK
17:07cemerickLau_of_DK: hey, that looks sick! :-D
17:07jbondesonI just need to make sure i'm not getting an empty list
17:08Lau_of_DKcemerick: Yea, but its gonna get real good soon :)
17:08jbondesonthe other option is (if (seq? x) (when-let [y (first x)] ... ))
17:08jbondesonwhich i don't particularly like
17:08Chouserjbondeson: why not just (seq x) -- true for non-empty collections and seqs, false for nil and empty seqs
17:09cemerickI'm glad to know about jmonkeyengine -- looks like fun stuff
17:09Lau_of_DKcemerick: It has huge potential, but until I get everything wrapped its a real pain the java Interop
17:09jbondesonChouser: I could do that, if i don't want to treat the non-lists differently
17:09Lau_of_DKAnyway, I gotta get to bed, if anybody want to contribute with porting the physics of models part - let me know, good night all
17:16tashafahmm.. is there a particular revision of clojure I need to get? 'cause when I start slime I get errors about being unable to resolve lazy-cons
17:16technomancytashafa: are you sure those are slime errors? can you try the same code from a bare REPL?
17:16jbondesonyour swank-clojure is out of date.
17:17tashafai just fetched swank-clojure from git though
17:18jbondesonodd, cause he got rid of lazy-cons last week
17:18technomancytashafa: it's probably not a slime problem then
17:18technomancyit's probably just an error in another library that's getting displayed by slime
17:18technomancytashafa: what's the codebase?
17:18jbondesondo you have any hooks that setup your slime repl?
17:18tashafayeah... its not a slime problem
17:19tashafabut thats where the java Exception is cropping up
17:20tashafahmm not that i know of
17:20tashafaeverything is fresh... fresh .emacs fresh clojure.jar, swank, clojure-mode, slime
17:21tashafaall pristine from their repos
17:22technomancytashafa: any dependency libs? contrib?
17:22tashafai use contrib
17:22tashafahmm ...
17:22technomancytashafa: some of the contrib libraries haven't been updated yet.
17:22tashafawait i havent updatated compojure
17:23tashafathats in my class path
17:31tashafano success
17:32tashafaeverything in my classpath is updated
17:32tashafasomething is calling lazy-cons still
17:32tashafawhich has been removed
17:33tashafa,(doc lazy-cons)
17:33clojurebotjava.lang.Exception: Unable to resolve var: lazy-cons in this context
17:34Chousertashafa: can't you get a stack trace?
17:35Chouserit should tell you the file and line number where it's finding a use of lazy-cons
17:36tashafait only shows one line errors, it does this right after 'M-x slime'
17:37technomancytashafa: you should be able to press 1 to see what caused the error
17:38tashafacore.clj line 70
17:40tashafanah it isnt quite connected to the REPL
17:40Chouserthat's certainly not svn 1305
17:40hiredmantashafa: actually someone last night ran into this
17:40tashafaits in that inferior lisp mode
17:40hiredmangetting errors about line 70 in core.clj
17:41tashafayeah i dont see lazy-cons in core.clj
17:41hiredmanof course
17:41hiredmanbecause it isn't there
17:43tashafayeah but something thinks it is
17:43tashafaor it should be
17:43tashafa... rebuilding clojure jar
17:44hiredmanrun ant clean first
17:45tashafawill do
17:49tashafahiredman: i found that thread you are trying to remember
17:50hiredmandoes it fix it?
17:50tashafafor him, yes
17:51tashafahe basically ran clean and rebuild ant tasks
17:51tashafadoing the same right now
17:56tashafa:(
17:56tashafano luck
17:59Chousertoo many moving parts
18:03tashafawhat is?
18:06whiddentashafa: you still having issues with slime?
18:08tashafayup
18:09tashafai've searched all core.clj files on line 70 for lazy-cons and I cant find were it being referenced
18:09whiddenits in commands
18:09tashafa?
18:09whiddenbasic.clj and indent
18:10whiddens/indent/indent.clj/
18:10tashafain clojure?
18:10whiddenno in swank
18:10whiddenin clojure lazy is gone if i understand the lazy stuff is now in head.
18:11whiddenor what i mean is there is all things are lazy thus
18:11jbondesonwhidden: that's all been updated
18:11whiddenno need to specify lazy.
18:11tashafayup thats where it is
18:11jbondesontashafa: wait, you found a lazy-cons?
18:11tashafayeah
18:11jbondesonif you did your swank-clojure is out of date
18:12jbondesonthey are all gone
18:12tashafain swank
18:12whiddenhow long ago did you get the swank-clojure head?
18:12tashafahmm i'll pull from github again
18:12tashafajust now
18:12whidden14 hours ago is when indent.clj was last updated.
18:13tashafalike an hour ago
18:15tashafajochu's swank from github right?
18:15whiddenyep
18:15jbondesonyes, master
18:15jbondesonas in that's the branch
18:15tashafaaight cool thx
18:18tashafaok that kinda worked...
18:18tashafa java.lang.RuntimeException: java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
18:18jbondesontashafa: yeah, you'll get that, but it doesn't affect slime any
18:18tashafathe repl says is connected but im not in the proper clojure repl
18:19whiddenhit return twice
18:19tashafatried that
18:19tashafano success
18:20tashafaquestion about hitting the enter twice... i used to not do that, but i updated and i started doing it, before today... is that normal?
18:21whiddeni have to catch a train in a couple of minutes. I'll try getting the newest clojure working with slime tonight or early tomorrow.
18:21tashafacool... thanks for all your help!
18:21whiddennot normal, but it had something to do with how repl and slime were communicating.
18:22whiddenthe fix for that was nonsensical to me.
18:22whiddenbasicaly asking clojure to generate a random number for silme.
18:23tashafaand how do i go about doing that, if you dont mind
18:23whiddenthis was part of the line added to fix that .. " "(println (java.util.UUID/randomUUID))\n""
18:23tashafasorry but, where does that go?
18:23whiddenbut you should have that in swank-clojure.el
18:24tashafa.el
18:24whiddenyes.
18:24whiddenemacs elisp file.
18:25tashafaeven though it calls java.
18:26lisppaste8whidden pasted "swank stuff" at http://paste.lisp.org/display/76114
18:26tashafawhidden: thanks
18:27tashafadont let me make you miss your train
18:27whiddenjust trying to give back the help i got.
18:27whiddenthanks.. 3 more minutes before the bell tolls :)
18:27whiddenneed to pack up thought.. later.
18:27tashafaalright my man, thanks again
18:31jkantzquestion about laziness: when doing (map my-fn stuff) if I want my-fn to refer to a dynamic binding, say foo do I need to capture the binding like this (map (let [x foo] (fn [arg] (binding [foo x] (my-fn arg))) stuff)?
18:32hiredman,(binding [*out* 1] (map #(+ *out* %) (range 5)))
18:32clojurebotjava.lang.ClassCastException: java.io.StringWriter cannot be cast to java.lang.Number
18:33hiredman,(binding [*out* 1] (doall (map #(+ *out* %) (range 5))))
18:33clojurebot(1 2 3 4 5)
18:33hiredman~map?
18:33clojurebotmap is *LAZY*
18:33hiredmananyway, no, you don't
18:34jkantzbut if I want to retain the laziness ... it looks like I would.
18:34hiredmanI guess
18:35Chouseryou want the fn you're giving to map to keep access to the dynamic context where it was defined?
18:35jkantzyeah
18:36Chouseryou'll have to capture the dynamic values you want in a lexical scope
18:36ChouserI saw a macro for that recently...
18:39Chouserhm, no that's specifically for agents
18:39Chouserhttp://clj-me.blogspot.com/2009/01/bindings-and-send.html
18:39Chouserbut I think you could do something similar
18:42jkantzok thks, is it desirable for a lazy seq to not capture it's dynamic context, or is this just the way it works?
18:44jkantzI guess that would require continuations
18:44tashafaok i have swank and everythig working... but its stuck in inferior lisp mode
18:45tashafahow do i get to clojure repl
18:45technomancytashafa: does your slime-setup call include slime-repl or slime-fancy?
18:46tashafanope ... just require slime then slime seup
18:46tashafasetup*
18:46hiredmanjkantz: I dunno, seems like the point of dynamic scopes is they are dynamic
18:47technomancytashafa: try this instead: (slime-setup '(slime-fancy))
18:47technomancytashafa: slime recently moved the repl into contrib, so you'll need to make sure slime/contrib is on your load-path
18:47technomancytashafa: have you tried using M-x clojure-install from the latest clojure-mode?
18:48technomancyit should automate away your woes
18:48tashafanope i havent...
18:49hiredmanbut I can see how people might want to hang on to the dynamic scope in lazy-seqs
18:49tashafaYAY!
18:49tashafaslime fancy-worked
18:50tashafatechnonacy: thanks!
18:50technomancycool
18:52jkantzChouser, I'm playing around with cl-style handlers and restarts and run into missing handlers when the signaling within a map fn
18:52jkantzerror-kit may have similar issues with raise
18:54tashafa,(doc frest)
18:54clojurebotjava.lang.Exception: Unable to resolve var: frest in this context
18:56jochu,(doc fnext)
18:56clojurebot"([x]); Same as (first (next x))"
18:56tashafaso frest has been removed... do i use (first (rest x)) or there's another cleaner way
18:57tashafaand rest is removed also right
18:58tashafa(doc next)
18:58clojurebotReturns a seq of the items after the first. Calls seq on its argument. If there are no more items, returns nil.; arglists ([coll])
18:59tashafa(doc nnext)
18:59clojurebotSame as (next (next x)); arglists ([x])
18:59hiredmanhaha
18:59hiredmanI never noticed those
18:59hiredmannnext
18:59tashafasorry for some reason I'd rather have the clojurebot tell me than my repl
19:00hiredman~botsnack
19:00clojurebotthanks; that was delicious. (nom nom nom)
19:01hiredmanI have no problem with clojurebot usage
19:10jbondesonhah, i just did a straight prn of a zip-xml object that was loaded from a 1MB XML file and on disk it's over 250MB and still writing to disk...
19:10durka42that's a pretty good compression algorithm...
19:10hiredmanSmooth
19:11jbondeson1.1MB -> 296MB
19:11jbondesoni guess it's good that it uses so much structure sharing in memory ;)
19:12jbondesoni think that maybe i won't store it on disk like that...
19:12hiredmanmaybe not
19:15jbondesoni think i'll have to do individual zippers as i don't care about the link back to the parent, that should eliminate most of ti
19:15jbondeson-ti+it
19:32slashus2http://code.google.com/p/clojure/issues/detail?id=68 <-- What do you think of the patch I submitted?
19:35hiredmanuh
19:35hiredmannil is false in clojure
19:35slashus2I tried :-(
19:35jbondesonif you're in a dosync do you have access to the values of other refs you just set?
19:35hiredmanthe boolean values true and false only exist in clojure for java interop
19:36hiredman,(doc deref)
19:36clojurebot"([ref]); Also reader macro: @ref/@agent/@var/@atom/@delay/@future. Within a transaction, returns the in-transaction-value of ref, else returns the most-recently-committed value of ref. When applied to a var, agent or atom, returns its current state. When applied to a delay, forces it if not already forced. When applied to a future, will block if computation not complete"
19:36jbondesonhah
19:36slashus2hiredman: I did it for consistency. The function returns false for most every other case, but in the case he showed it returned nil.
19:36slashus2,(every? (fn [x] (> x 6)) [1 2 3])
19:36clojurebotfalse
19:37hiredman,(> 1 6)
19:37clojurebotfalse
19:37slashus2Yes that is correct
19:37hiredmanit depends on the predicate
19:37slashus2,(every? #{\space} "dam")
19:37clojurebotnil
19:37hiredman,(#{1} 0)
19:37clojurebotnil
19:37slashus2My version just returns false in that case too.
19:38hiredman,(every? #(= % \space) "dam")
19:38clojurebotfalse
19:38hiredmanslashus2: I don't see any point
19:38hiredmanbut, who am I to say
19:39slashus2I guess my version makes it work with sets too.
19:39hiredmanit already works with sets
19:39slashus2I mean, return false with sets, not nil.
19:40slashus2Even though that are equivalent.
19:42hiredmanif anything I would change > and friends to return nil
19:43slashus2So we actually are shooting for everything to return nil?
19:43slashus2Within the core?
19:46technomancyhah; you can use add-classpath with URLs.
19:46technomancythis is crazy + awesome: http://clj-me.blogspot.com/2009/01/living-on-bleeding-edge.html
19:49slashus2That is neat.
19:50jbondesontechnomancy: yeah, they found that a while ago. don't think i'd ever do it though.
19:51technomancyjbondeson: reminds me of the hobix installation instructions: ruby -ropen-uri -e 'eval(open("http://go.hobix.com/&quot;).read)'
19:51technomancyyou have to be at least a *little* crazy to try that
19:51jbondesonyeeaaaah
19:52jbondesonfrom 298MB to 1.3MB!
20:03slashus2I was playing around with clojure, and openjdk crashed. Oh my.
20:03slashus2When I try to run java now, it gives me a strange message about saying that it could not determine my current working directory.
20:08technomancyslashus2: maybe cd .
20:08slashus2technomancy: It worked again after I changed the directory.
20:30powr-tocslashus2: are you on a network drive, like NFS?
20:30slashus2no
20:31powr-tocslashus2: are you in a directory which has been removed and then recreated?
20:34slashus2powr-toc: When java crashed, it started saying that problem. It fixed it when I changed directories and back again.
20:35Chouserjkantz: yes, error-kit would behave similarly.
20:36Chouseras would try/catch blocks, I believe.
20:36powr-tocslashus2: odd... you some systems give you errors like that when your terminal/program is running in a directory which has been deleted and rebuilt... you get it quite a bit with build scripts
20:39slashus2powr-toc: It was a segfault in openjdk.
20:39Chouser,(try (lazy-cat [1 2] (throw (Exception. "foo"))) (catch Exception e "caught"))
20:39clojurebotPardon?
20:39Chouseroh, he doesn't let you do try/catch
20:40Chouseranyway, that fails to catch the exception because it's not thrown until the seq is being printed, outside of the 'try' block
20:42cemerickwow, those c.l.l folks really know how to throw a party (re: the 'road to clojure' thread)
20:42hiredmanclojurebot: lazy?
20:42clojurebotlazy is hard
20:42ChouserI guess throwing an exception can be thought of as a kind of side-effect.
20:43cemerickI'm so happy that #clojure and the group are so pleasant.
20:45Chousercemerick: yes
21:38taliosDoes anyone know if the clojure compiler can generate jdk annotations on a method/class?
21:39ChouserI believe it currently cannot.
21:40talios:( Pity, that could be in handy.
21:41talioser, darn my thought patterns, -be+come :)
21:43Chouserit comes up. I guess I should learn what they are.
21:44talioscompile/runtime metadata for java classes. Such as say "@Test public void thisIsATestMethod() {...}" - other code can look for methods that have the @Test annotation.
21:44taliosjava classes/fields/methods that is.
21:51danleib
21:54gnuvince_Oh ZING! http://www.lispcast.com/why-clojure.html
21:54gnuvince_c.l.l is gonna have a field trip with that :)
21:56Chousersuccinct
21:58danlarkingentoo.org isn't responding for me, but downforeveryoneorjustme.com says it's up, can everyone else hit it?
21:59gnuvince_Funnily, people on reddit call him "fanatic". If he'd written "Subversion is a dead end. I want to be a part of Git's bright future", redditors would've fallen over themselves to agree with him
21:59Chouserdanlarkin: "Waiting for www.gentoo.org..."
21:59iceygnuvince_: the problem with the herd mentality is that it requires many many sheep ;)
22:00taliosbaaaaaaaaaaaaaaaaa
22:00danlarkinChouser, danlei: ok thanks, at least it isn't just me
22:01gnuvince_icey: yeah
22:01danlarkingnuvince_: is this post on reddit yet? or at you saying in general they call him a fanatic
22:01gnuvince_danlarkin: it is, but downvoted enough that it's not on the front page
22:01gnuvince_http://www.reddit.com/r/programming/comments/7zyla/i_want_to_be_a_part_of_clojures_bright_future/
22:02danleipersonally, i'd say: if cl is a dead end, then a very flexible one.
22:03gnuvince_awww, not mentioned on cll :)
22:04iceycll is a waste of time
22:04danleii don't think so
22:04danleii like them both (cl & clojure)
22:04iceyCL is not a waste of time. the newsgroup is
22:04danleiups
22:05iceythere are clearly very very smart people there, but the problem is they have too much time on their hands so they troll ;)
22:06stuarthallowayevening all
22:06iceyevening stuarthalloway
22:06stuarthallowayI am updating the sequences chapter and am hoping to get some feedback on the following nouns: seq, sequence, iseq
22:06iceyhow goes the book?
22:07stuarthallowayHaving read through mail and IRC logs, I want to define them as follows:
22:07danlei`but sometimes it's also a good place to learn. rich, for example, was very patient and informative during the discussion with pascal.
22:08stuarthallowaya seq (noun) is an abstract view of a collection, and is represented internally as an ISeq
22:08stuarthallowaya seq (function) returns a seq (noun) on a collection, or nil if nil/empty
22:09stuarthallowaya collection that can be seq-ed is said to be seq-able (that should be any collection!)
22:09iceydanlei`: sure, but for every good thread there are 3 posts about removing parens, 2 posts about someone's CS homework, a Xah Lee diatribe, Jon Harrop coming in to talk about F# and then a series of posts where Kenny Tilton talks about how he got Cells (tm) to work on his toaster oven.
22:09stuarthallowaya sequence is a seq-able collection
22:10danlei`icey: yes, the frogger, xah, jillian etc. can be really annoying ...
22:10stuarthallowayI know this all sounds pedantic, but it is important to nail this stuff down for beginners
22:10hiredmanthere is a sequence function too btw
22:10Chouserstuarthalloway: it is important. thanks for pursuing it.
22:10iceystuarthalloway: guys like me really appreciate it :D
22:11stuarthallowayhiredman: aaargh! :-)
22:12Chouseroh, I didn't know about that.
22:12hiredmanI dunno if it is a useful function, but rhicky obviously thinks it is
22:13stuarthallowayhiredman: I can see where it might be useful
22:13stuarthallowaybut it *totally* screws up the definitions I just laid out
22:13stuarthallowaywithout even invalidating them ....
22:14stuarthallowaygiven the definitions I proposed, sequence (function) ought to be named seq
22:14stuarthallowaybut of course that is already taken!
22:15stuarthallowaymaybe sequence could be renamed as-seq or something like that -- is there any naming idiom for coercion?
22:15hiredmanwell, (sequence ...) can return an emtpy ISeq
22:15hiredmanwhich (seq ...) cannot
22:16Chouserstuarthalloway: yeah, just the name of the type. (int 5) (float 3.0)
22:16Chouser(seq ...)
22:16stuarthallowayChouser: so seq is a doubly-bad name, since it returns nil when the coercion fails :-)
22:17hiredman,(seq 2)
22:17clojurebotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: Integer
22:17hiredmandoesn't look like nil to me
22:17stuarthalloway,(seq [])
22:17clojurebotnil
22:17hiredmanthat is not failure
22:18stuarthallowayhiredman: point taken, but
22:18danleiyou'll need it for conditionals
22:18stuarthalloway(backing up) I see the need for all the functions
22:19stuarthallowayit is the names that kill me
22:19stuarthalloway() is a legal seq
22:19stuarthallowayso if seq coerces, then (seq ()) === ()
22:19stuarthalloway,(seq ())
22:19clojurebotnil
22:20hiredmanthe docstring of seq says nothing about coercetion
22:20hiredmansequene on the other hand does
22:20hiredmansequence
22:20hiredman,(doc seq)
22:20clojurebot"([coll]); Returns a seq on the collection. If the collection is empty, returns nil. (seq nil) returns nil. seq also works on Strings, native Java arrays (of reference types) and any objects that implement Iterable."
22:21ChouserISeq no longer promises non-emptiness, but 'seq' still does.
22:21stuarthallowayhiredman: exactly! sequence coerces to seq, and seq doesn't coerce. Confusing!
22:21stuarthallowayespecially when sequence is a noun that (used to?) mean something
22:22hiredmanwe should start capitalizing types
22:22stuarthallowayClojure defines many algorithms in terms of sequences (seqs). (http://clojure.org/sequences)
22:22hiredmansequence returns a Sequence
22:22hiredmanor Seq
22:23ChouserThere is no Sequence
22:23ChouserASeq, ISeq, Sequential
22:23hiredmanChouser: I just magicked one
22:23stuarthallowayIf ISeq and seq (noun) are 100% equivalent, then we could say ISeq and stop using seq as a noun
22:24hiredmanstuarthalloway: makes sense to me
22:24ChouserExcept that colloqually, we often say seq when we mean "ISeq or nil"
22:25Chouserhm, we used to anyway.
22:25Chouserfilter returns
22:25Chouser"filter returns a seq"
22:25stuarthallowayChouser: well, and in that case seq (function) is a legit coercion to seq (noun)
22:25stuarthallowayit seems to me that seq (noun) as currently used cannot be nil
22:26stuarthallowayseqs can be empty / always an ISeq (http://clojure.org/lazy)
22:26danleistuarthalloway: Changed: seqs can be empty
22:26danleistuarthalloway: so i guess, you're right
22:26stuarthallowayMe right == bad thing. I'm confused. :-)
22:27stuarthallowayso far I am still happy with the definitions I threw out 20 minutes ago
22:27danleii'm working through the recent changes, too :)
22:28stuarthallowayif the (new?) sequence function could only have a different name
22:28stuarthallowaymaybe (iseq ...)
22:28hiredmanwell
22:29Chouserstuarthalloway: you might be able to make that happen -- it's pretty new.
22:30Raynes(doc new)
22:30Raynes(doc new?)
22:30clojurebotPardon?
22:30clojurebotI don't understand.
22:30RaynesJust had to.
22:30stuarthallowayif sequence and seq remain synonyms, all is well
22:30stuarthallowayand the name sequence is just fine with me
22:30stuarthalloway(for the new fn, that is)
22:33mblinnif you've got a file full of functions that you load into the repl, is there a way to use a function before it's defined?
22:34danlei,(doc declare)
22:34clojurebot"([& names]); defs the supplied var names with no bindings, useful for making forward declarations."
22:34hiredman^-
22:34mblinnthanks
22:40stuarthallowayI posted my seq/ISeq/sequence thoughts to the list and am going to bed. cya.
22:49hiredmanclojurebot: twitteronia is where shaq lives
22:49clojurebotIk begrijp
23:11technomancyso java.util.Calendar is kind of a higher-level java.util.Date?
23:13hiredmanshould clojurebot notify the channel of tweets mentioning clojure?
23:15technomancythat seems like it could go overboard quickly
23:16hiredmanI guess
23:16technomancyit looks like there've been twenty in the last twenty hours
23:16technomancyand it's only going to accelerate
23:20nietcan clojure have stack overflows because of laziness like haskell? or clojure doesnt have that kind of laziness?
23:30technomancyclojure can have stack overflows if you use regular recursion instead of explicit recur for large data structures, lazy or not
23:33hiredmanclojure's laziness is much more explicit then haskell's
23:35nietit seems so
23:36nietbut i mean can tailrecursive (loop/recurs) cause stack overflow due to laziness?
23:36technomancysay you've got a vector of numbers. how would you add N to the Mth element?
23:36hiredmanno
23:36hiredmanloop/recur is not lazy
23:37hiredman,(update-in [1 2 3] [1] inc)
23:37clojurebot[1 3 3]
23:37hiredmanthat is how
23:39technomancyhiredman: sweet; thanks
23:39hiredman,((fn [v m n] (update-in v [m] (partial + n))) [1 2 3] 1 3)
23:39clojurebot[1 5 3]
23:41hiredmannp
23:46hiredman,(last (take 4 (iterate list '())))
23:46clojurebot(((())))