#clojure logs

2011-04-09

00:02joshua__amalloy, Somehow I wasn't in the master branch.
00:02amalloytada!
00:02joshua__amalloy, All better now =).
00:16carllercheIf I'm looking to implement an HTTP proxy (in clojure), should I be focusing on using aleph?
00:23mecaccording to joy of clojure, rest is more lazy than next, but if I need to do (seq (rest coll)) is that the same thing as (next coll)?
00:23amalloy$source next
00:23sexpbotnext is http://is.gd/dijgWa
00:23amalloy(in short: yes)
00:24mecI looked at the source but its just a .next call now, i think at one point it wasnt
00:26amalloymec: if you read the java source, next is (seq (rest coll)
00:26mecah ok
00:26amalloyor just read the docstring
00:26amalloy&(doc next)
00:26sexpbot⟹ "([coll]); Returns a seq of the items after the first. Calls seq on its argument. If there are no more items, returns nil."
00:27amalloyer no, i guess rest says the same thing
00:27mecya ;p
00:34livingstoncan you have circular uses ? (ns a (use b)) (ns b (use a)) ?
00:34amalloyno
00:35livingstondidn't think so. so, how do I get around that? (I might not actually have it, still working though)
00:36amalloylivingston: basically, pull out part of the cyclic dependency into a new namespace b that they both depend on
00:37amalloytransform that DAG into a tree
00:37amalloyman
00:37amalloythat is not a DAG. i am dumb. but the advice stands
00:37livingstonyuch. I had a reasonable cut in my code but there are pieces that refer across them
00:40livingstoncan I use declare to forward declare something in another namespace?
00:40amalloylivingston: i don't believe so. (declare foo) is ~= (def foo nil)
00:40amalloyand you can't def someone else's namespace
00:42livingstoni think I could if the namespace existed already?... ugh this is a pain
00:47tomojyou couldn't even if it did
00:53livingstoncan I signal non-Object return types on defrecord / defprotocol definitions? it keeps telling me it's seeing boolean and expecting Object (I think I have everything flagged as boolean)
00:56amalloylivingston: what version of clojure? i don't really keep up but i think that changes in 1.3
00:56livingstonI'm on 1.2 still
00:57livingstonso soon we'll be able to set return types on protocols/defrecord that will get back to the java interface?
00:58amalloyi think that's always been possible for definterface
00:58amalloyand for...some types, you can return/pass primitive long/double values. i don't think boolean is getting in
00:59livingstonyes it is (based on the examples I see) protocols just generate an interface too
00:59amalloybut i think you can set *non*-primitive hints with ^Boolean, rather than ^boolean?
00:59livingston^ -- possible for definterface don't know about your second (and now third ) comment
01:00livingstondon't know, didn't try that. I'll try again later, all of this is just to be kind to the java users and it has taken way to looong now.
01:02mecgoing to need a new book just to clarify all the 1.3 changes
01:03livingstonthat's odd I have a function with the call signature [a b & _] and when I try to make another function with this body ([x y] (foo x y)) it says unsupported call signature?
01:03livingstonmec: yeah I've been a bit out of the loop with my head in the sand lately
01:05mecis it in an interface or protocol?
01:06amalloylivingston: code snippet? not clear what you're talking about
01:06livingstonthe protocal defines (bar [x y] [x y z]) I have the defrecord doing (bar ([x y] (foo x y)) ([x y z] (foo x y z)))
01:07livingstonwhere foo is signature [x y & _] it says no binding pattern [x y]
01:08amalloyprotocols don't support multiple arities in a single declaration. they're java-level methods
01:09amalloyyou would need (bar [x y]) (bar [x y z]) iirc
01:09livingstonreally? I've been doing it (or at least I think I've been doing it
01:09amalloyi could be wrong. i don't do a lot of interop
01:09livingstonz is optional
01:10amalloyeither way protocols "shouldn't" have optional args really. just demand that the implementor supply a version for x y z, and then wrap a function around it that handles the optional-ness of z
01:10livingstonwell it worked with extend but not trying to instantiate it into a defrecord now
01:11amalloythen instead of everyone who extends the protocol having to supply N versions of bar, they all supply one and you add an extra wrapper to handle the rest: protocols love minimalism
01:11livingstonthat'd kinda suck for the java people to call the plain function but yeah..
01:12livingstonyeah that's kinda what I have it works great with a set of functions from clojure world it's the java world that's always a pain...
01:13livingstonI do have some legitimate multi-signature function though and wait there are exiting java APIs that work fine that way. (addTriple s p o) (addTriple t) etc.
01:14amalloymkay
01:15livingstonI'm not saying l like those java apis but they are out there, and when you need to pick one of a dozen call signatures to hit from clojure they are really fun
01:17amalloylivingston: i specialize in opinionated advice about things i don't actually do, so feel free to ignore the bits that you don't like
01:18livingstonI just know java can do it, I don't know that protocol can too
01:19livingstonI'm also a bit grouchy this re-factor is taking forever, I haven't eaten, it's 11pm and my friends are drinking
01:22livingstonbut I just poked my head into the real world an at least the government is still running (for some definition of running)
01:26amalloylivingston: most governments are indeed running
01:26livingstonour's almost just shut down. (you're not in the US are you?)
01:27amalloyi am, but i was objecting to the american tendency to treat the US as the only interesting country
01:27tomoj..our government almost shut down?
01:28amalloytomoj: squabbling over the budget
01:28livingstonamalloy: oh. isn't it? get in line or we'll bring democracy to you lol
01:28tomojtoo bad
01:29amalloytomoj: it's all over the news. lots of name-calling across the aisle
01:29livingstontomoj: last minute deal. 800,000 people would have been furlowed (or whatever) it would have been a huge mess wasted time and money (it's already done enough of that)
01:29amalloylivingston: oh, they worked it out?
01:29amalloyi stopped watching once i got home
01:30cemerickIt's always a game of chicken.
01:30cemerickAnd someone always blinks.
01:30livingstonyeah, apparently. I should look at see what the new NIH budget is.
01:30amalloycemerick: recently it's been the democrats blinking, from what i hear
01:31cemerickamalloy: Democrats are born with a twitch that induces it.
01:31cemerickThough it looks like the deal just reached is pretty even-handed.
01:32livingstonnow it says it a short term deal. is there a long term one behind it? or are we going to keep winging it every couple of weeks?
01:33cemerickAFAICT, it's a 1-week temporary patch, with the real thing essentially locked down.
01:33tomojpopular dynamics necessitate a great degree of winging, I suspect
01:34cemerickWe're only 5 months from the start of the next fiscal year though, so "long term" is shakily-defined.
01:34livingstontomoj: there's no need for this. it's half way into the year. there's been stupidity on both sides long before now dragging this out.
01:35livingstoncemerick: yeah, that's why worrying about this one is so silly. how long you think they'll go before they start to think about the next one
01:35tomojI meant in general. the public doesn't have a mind of its own
01:35justinlillyis there something like "Practical Common Lisp" in clojure? ie: "We're going to make an X, and you'll learn clojure along the way"?
01:35cemerickJust wait until the round this year into 2012. Them'll be some fireworks.
01:36justinlillyWhat X is doesn't entirely matter, just that it doesn't amount to "do all of project euler, then come back to me"
01:36amalloycemerick: it won't matter. the world will end six months after that, so the budget can take a back seat
01:37cemerickoh, right
01:37tomojI am not looking forward to the hysteria
01:37cemerickIs this 2012 thing Mayan, Nostradomus, Jehovah's Witnesses, or a melange?
01:38justinlillyvariatons on a theme?
01:38amalloyrather small-minded of you to even consider the budget, really
01:38tomojthe real hysteria will be humorous, but the flurry of books and tv shows and other things sold will be hard to take
01:38livingstonjustinlilly: poor guy asks an on topic question and we're talking about how stupid people are... yes there are some good tutorials (although I don't know one off the top of my head)
01:38tomojI think there was some effort to translate PCL?
01:39tomojor was that another book
01:39amalloytomoj: little schemer, i think?
01:39livingstonthere's "casting spels" or whatever
01:39amalloythat's Land of Lisp, i think
01:39tomojhttp://thinkrelevance.com/blog/2008/09/16/pcl-clojure.html
01:39tomojcertainly less compelling than this hypothetical one written from scratch would be
01:40justinlillythx.
01:48livingstonthe reddit commentary comparing the budget the oregon trail is kinda amusing
01:52cemericklivingston: wha?
01:52cemerickNo, nevermind, I don't want to know.
01:54amalloycemerick: "i wish they'd all die of dysentery". i haven't read the reddit stuff, but this is at least as good
01:54livingstoncemerick: "Spend all the money on ammunition so you can shoot at stuff, then wonder why your wagon is falling apart and everyone is dying of dysentery"
01:54cemerickScholarly.
01:55cemerickMany thanks for the tidbit, saving my sanity in the process. :-)
01:55cemerick"#clojure reads reddit so you don't have to"
01:57livingstonthat would do wonders for my productivity -- so would having this @#$% refactor done
01:59amalloylivingston: cemerick will write it for you, in exchange for your help with reddit
01:59amalloy#inadreamworld
01:59livingstoni'd much rather be reading reddit right now. actaully I'd rather be at the pub with my friends.
02:01justinlillythere's an interesting thing called "hacker news daily".. takes the latest top 10 posts based on total score that hasn't been on the daily list yet.
02:01justinlillyhttp://hnfluence.com/ -- also this.. which is hacker news ratings mushed with bitly clicks, tweets, etc.
02:02cemericklivingston: I can wish you well, at the very least. :-)
02:02cemerickGood night all.
02:02livingstonoh great more distractions...
02:02livingstoncemerick: thanks
02:22livingstonoh finally made it (half way but enough to know the rest is good) ... good night and thanks everyone
09:01ejacksonis there anything about map that should destroy a dynamic binding ?
09:15ejacksonhere's a gist of the unfortunate behaviour: https://gist.github.com/911386
09:17mrBliss`ejackson: I've also noticed bindings are ignored in (fn ..). But I think with-redefs (1.3) will do what you're looking for.
09:18ejacksonhmmm.... its the (fn ...) thanks. I wonder what this is about
09:18ejacksoni'm scared to try moving my project to 1.3
09:21ejacksonmrBliss`: thanks, though, this puts me on the correct track
09:21pimeysis there some magic you have to do to get mysql connection work with clojure. I'm writing my first web app with clojure+ring, installed mysql adapter with maven (lein didn't work) and my sql query throws an error: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306
09:21pimeysgoogle doesn't find any decent answers
09:22pimeysI'm making a decision which language+library to use: clojure+ring or haskell+lift for my future web apps
09:23pimeyslisp is easier for me than haskell though...
09:24ejacksonpimeys: it looks you don't have the jdbc mysql setup
09:24pimeysoh, I meant snap+haskell :)
09:24ejacksonthere is a jar you need in your classpath, let me go look quickly
09:24pimeyslift is for scala
09:24pimeysejackson: I have some jar in my project lib
09:24pimeys3304179 Apr 9 16:10 mysql-connector-java-5.5.15.jar
09:25ejacksonyeah, that's the one
09:25ejacksonin that case you need to diagnose the jdbc itself
09:25ejacksonthere is a util somewhere that does that
09:26pimeysall the other libs work just fine, but those installed without errors using leinegen, that mysql adapter is installed with maven because lein couldn't find the adapter library
09:27ejacksonyeah, i had to jiggle and shake to make it work, but it does !
09:27pimeysof course I could use postgresql, but our server has mysql already installed and configured...
09:27ejacksonmrBliss`: the answer is bound-fn !
09:28pimeysoh and also, how do you guys deploy clojure/ring apps?
09:28ejacksonhttps://gist.github.com/911386
09:28pimeysI'm looking for something like capistrano
09:29ejacksonpimeys: people tend to dev with jetty and then deploy into tomcat or such
09:29ejacksonpimeys: its a bit different. You package as a .war file and send that to tomcat
09:29ejacksonits much less fiddling about than rubyland
09:30pimeysmy setup would be something like this: nginx serving static html+js from the project's public dir and clojure+ring would serve only json
09:30pimeysso clojure listens some other port and everything is rendered with jquery/ajax
09:30ejacksonout of my depth now, I don't do web apps :)
09:49ScorchinWhat are the best examples of taking a Java API/Lib and converting it into an idiomatic Clojure API/Lib?
10:45x6763is there a way to use clojure.contrib.http.agent/http-agent with an http proxy server?
11:17angermanDid anyone else note reCaptcha to ask for math formulas recently?
12:56jweiss_how come this doesn't work
12:57jweiss_,`{~@[:c :d]}
12:57clojurebot1
12:57jweiss_on my repl i get ArrayIndexOOB
12:57jweiss_i expect {:c :d}
13:01jweiss_huh, i didn't realize syntax quote, unquote splicing etc don't have non-shortcut equivalents like quote.
13:02trptcolin,(let [things [:c :d]] `(~@things))
13:02clojurebot(:c :d)
13:02trptcolinjweiss: because you're trying to eval (:c :d), which is nil, and splicing that doesn't work
13:03trptcolinhmm, although `(~@nil) doesn't bomb, so i'm probably missing some piece
13:03jweiss_trptcolin: huh, i thought that evaling [:c :d] would yield a vector literal.
13:04trptcolinyeah my bad, missed the vectorness of it
13:05jweiss_trptcolin: this works
13:06jweiss_`[~@[:c :d]]
13:06jweiss_,`[~@[:c :d]]
13:06clojurebot[:c :d]
13:06jweiss_but trying to splice into a map literal doesn't
13:06trptcolinyup
13:06trptcolin,{[1 2]}
13:06clojurebotjava.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException: 1
13:07trptcolinok, so the splicing's a red herring? :)
13:07RaynesI would have guessed a purple trout.
13:07jweiss_trptcolin: it shouldn't be - since we're splicing it shouldn't have the square brackets around 1 2
13:08trptcolinoh yeah, weird
13:08trptcolinso does splicing just not work inside maps?
13:09jweiss_doesn't seem to.
13:09jweiss_,`{:a :b ~@[1 2] ~@[2 4]}
13:09clojurebot{1 2, 2 4, :a :b}
13:09trptcolinRaynes: maybe a green salmon
13:09jweiss_that is... weird
13:09jweiss_works if there are an even number of splices
13:09dnolenjweiss_: it has to do w/ how the reader deals with map literals. Use hash-map fn not a literal. It's been this way for a while. Don't think there's any interest in fixing that behavior.
13:10dnolenit's the same reason why weird syntax in (comment ...) can cause errors as well.
13:11jweiss_dnolen: well the comment thing i get, once i saw it's implemented as a macro, not in the reader
13:31Lajla,(print "I worship his shadow")
13:31clojurebotLajla: Pardon?
13:31Lajla=(
13:32LajlaForever alone.
13:36dbyrneDoes anyone have experience with the clj-sandbox library? I think I might have found a bug.
13:36dbyrnehttps://gist.github.com/911545
13:40BorkdudeCan anyone give me a clue on why "lein deps" is going wrong? http://pastie.org/1776027
14:06TimMcLajla: I don't think clojurebot watches much TV.
14:06TimMc,`{~@[:c :d]} ; why doesn't clojurebot throw an exception here?
14:06clojurebot1
14:07TimMc1 is the index that is out of bounds
14:07LajlaTimMc, ah you know it.
14:07TimMcLajla: No, I googled it. I don't watch TV either.
14:07LajlaAh
14:07LajlaNo one understands me.
14:13BorkdudeNobody?
14:17TimMcclojurebot: Do you understand Lajla?
14:17clojurebotTitim gan éirí ort.
14:17TimMcYeah, me neither.
14:17LajlaBorkdude, hmm
14:17Lajlano
14:17Lajlanobody
14:18BorkdudeI think lein downloads some conflicting libraries or smth
14:18Borkdudeif I remove the lib folder and type 'lein', it lists me the options
14:18Borkdudeif I do lein deps, it downloads the libs
14:18Borkdudeand again 'lein', I get this exception: http://pastie.org/1776027
14:19TimMcYeah, that does look like lib version conflict.
14:19TimMcPastie a listing of your lib folder.
14:22Borkdudehttp://pastie.org/1776146
14:22Borkdudeit worked on the other system I was just on
14:24TimMcI have to wonder if the Clojure 1.1 in your dev folder is interfering with your Clojure 1.2.
14:24TimMcHave you tried blowing away both lib folders, ./classes, and your ~/.m2 folder?
14:25Borkdudewait
14:25Borkdudenow I did: 'lein plugin install swank-clojure 1.3.0'
14:25Borkdudeand it all works
14:27BorkdudeI don't know what causes it
14:28Borkdudebut at least things work...
14:29currentBI'm a little shaky on my understanding of protocols, but is it possible to use them to protect arithmatic operators from nil values?
14:56DantasHello everyone !! Im thinking about develop a web application using clojure ?is there any framework , i heard about compojure? How handle the states from a crud ?
15:00boboDantas: have a look at compojure, hiccup,enlive and clojureQL for example
15:01boboclojureQL should make crud stuf pretty easy
15:02Dantasbobo: thanks a lot !! what is cojureQL ?
15:02bobofor sql
15:03Dantasim thinking use noSQL
15:03bobook, then dont look at it =)
15:03Dantasbut, will be on my list, thanks a lot
15:13dnolenfinally a sane way to log from lazy sequence computations, agents!
15:15thorwilis there a way to shorten/make-nicer something like (map fn1 (map fn2 (whatever)))?
15:15dnolenthorwil: comp
15:16dnolen(map (comp fn1 fn2) whatever)
15:17thorwilnice, thanks!
15:17Dantaswow ! nice !
16:14markomanjust watched a cool presentation of simplicity from clojure.blip.tv
16:15Dantasis the apply function like a reduce ?
16:17morphlingDantas: no, but some functions (like +) use reduce internally
16:18amalloymrBliss`: your advice to ejackson earlier re with-redefs seems wrong. there's nothing about (fn ...) that "ignores/destroys" bindings. the map function returns a lazy sequence immediately, and when it is forced those bindings are no longer in scope. for his example, i'd use doseq (all he wants is side effects)
16:19joshua__Can you guys give me the names of a few libraries with some of the "best" Clojure code?
16:30markomanjoshua__: maybe clojure contrib source contains some good code?
16:30joshua__markoman, thanks
16:30Rayneshttp://raynes.me/hfiles/contract.jpg
16:30thorwilDantas: re apply: http://stackoverflow.com/questions/1257028/why-should-i-use-apply-in-clojure
16:32Dantasthorwil: thanks
16:34pdk[16:10] <Dantas> is the apply function like a reduce ?
16:35pdk(apply myfn 1 2 [3 4 5]) = (myfn 1 2 3 4 5)
16:35pdk(reduce myfn [1 2 3 4]) = (myfn (myfn (myfn 1 2) 3) 4)
16:37Dantaspdk: awesome ! thanks a lot . so the apply will expand the list as arguments to the function
16:37pdkyeah
16:37pdkbasically if i want to compose some of the arguments to pass to a fn within one list
16:37pdkand then tack them on to the arguments list inline when i call that fn
16:38pdksorta like how languages like java/c++ give you varargs
16:38pdki.e. void main(String... args)
16:38Dantasyeah, perfect
16:38pdkthough working in the opposite direction
16:38pdkreduce works in pairs
16:38pdkit assumes the function you give it takes 2 arguments
16:38pdkit will call it with the first two items in the list as arguments
16:39pdkthen call it with the result of the first call and the third item
16:39pdkthen the result of the second call and the fourth item etc for the rest of the list
16:39Dantasthe reduce i understand .. the problem was that i create a too simple example using the + ! (reduce + '(1 2 3)) and (apply + '(1 2 3))
16:40pdkyeah using + isn't too illuminating since reducing and applying + are equivalent anyway
16:40Dantasyeah !
16:40pdkplus iirc + with more than two args gets compiled down to a reduction with a two-argument +
16:40amalloy&((juxt reduce apply) (partial list '+) [1 2 3])
16:40sexpbot⟹ [(+ (+ 1 2) 3) (+ 1 2 3)]
16:41pdkjuxt is effin magic
16:41pdk(doc juxt)
16:41clojurebot"([f] [f g] [f g h] [f g h & fs]); Alpha - name subject to change. Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to the args (left-to-right). ((juxt a b c) x) => [(a x) (b x) (c x)]"
16:41Dantaswow ! :D
16:42amalloythis is just like the example with +, but uses (list +) so you can visualize the computation it would make instead of it actually running
16:42pdkyeah that shows you better what the difference looks like compiled
16:42pdkcause you can still see the structure it's producing
16:42pdkdoing it with just + shows you only the end result which is the same in both cases
16:43amalloyi think i should take that code and paste it as a new answer to every question on stackoverflow about apply vs reduce
16:43Dantasyeah
16:43pdkthen you have to explain juxt and partial :p
16:44amalloypdk: feh. the example will be so awe-inspiring that they'll go look everything up
16:48markomanis there any general data validation library available for clojure? how about data sanitazion lib?
16:52markomanvalidation as comparing given string to some function like (is-number str), (is-length str len), (is-a-member str map) and so on?
16:52amalloymarkoman: sounds like the recently-released pretzel
16:53amalloy$google clojure pretzel predicate
16:53sexpbotFirst out of 35 results is: Announcement: pretzel - a predicate library + call for suggestions ...
16:53sexpbothttp://osdir.com/ml/clojure/2011-04/msg00196.html
16:53amalloywtf, osdir? google isn't first?
16:54pdkbot was tempted by delicious pretzels
16:54markomanfound github for it, thanks
16:58markomanlooks-like-email? funny
16:59amalloythe moment i hear that, i fear for my life
17:01david`man i wish i could afford to go to this clojure class in june
17:02amalloy$google clojure github pretzel looks-like-email
17:02sexpbotFirst out of 20 results is: Re: Announcement: pretzel - a predicate library + call for ...
17:02sexpbothttp://osdir.com/ml/clojure/2011-04/msg00259.html
17:02amalloysexpbot: i hate you
17:02amalloynow i have to open a browser myself
17:02Dantaslol
17:03amalloythat search on the-real-google works
17:04amalloylooks-like-email is never implemented right. Just Don't Do It
17:08markomani guess thats why it says looks like email, not is-email
17:08amalloyindeed
18:42jsnikerisSo, I'm using ring.adapter.jetty/run-jetty to start a server. It seems like if I change and re-evaluate my ring handler, I need to restart the server. Is there a better way to do this?
18:45jsnikerisAlso, I'm trying to write a restart-server procedure. The only way I can think of to implement this is to call (.stop *server), and then redefine *server* by calling run-jetty again. However I feel like I'm doing this the wrong way. Any pointers?
18:46amalloy$google ring reload wrap
18:46sexpbotFirst out of 17900 results is: Clojure Web Development with Ring
18:46sexpbothttp://mmcgrana.github.com/2010/03/clojure-web-development-ring.html
18:46amalloyfeh
18:47amalloyjsnikeris: there's a wrap-reload middleware or something like that
18:47jsnikerisahh thanks
18:47jsnikerisI'll check that out
18:48dnolenhmm why can't lein find this clojar? http://clojars.org/org.lpetit/net.cgrand.parsley
18:48dnolenis it because it's the way it's named?
18:52amalloydnolen: that seems weird
18:54amalloydnolen: it looks to me like one of that project's dependencies has a weird mvn repo
18:54amalloyCannot find layout implementation corresponding to: 'p2' for remote repository with id: 'ccw'. for project org.lpetit:net.cgrand.parsley
18:54amalloyor possibly the parsley pom.xml is malformed
19:56dnolenanybody here mess with paredit.clj for it's Clojure parser?
20:02amalloydnolen: a tiny bit
20:02dnolenamalloy: thoughts? opinions?
20:02amalloyi made it undesrstand []{} before that was added to clojure-mode
20:03amalloydnolen: about what?
20:03dnolenamalloy: any issues using the paredit.clj parser?
20:04amalloyi think i misunderstood your question? did you mean, have i used code from paredit for parsing clojure in non-paredit contexts?
20:08dnolenamalloy: yeah
20:08amalloythen no, i've never done that
21:19TimMcI would expect the Clojure compiler to expose its AST .
21:41tomojTimMc: is its AST not just the forms being compiled?
21:48livingstonis it not possible to have multiple call signatures for a function in defprotocol / defrecord ?
21:51livingstonI tried by putting multiple signatures on the same line e.g. (foo [x y] [x y z]) and then in the record (foo ([x y] ..) ([x y z] ...)) this croaks. if I give it two independent definitions (foo [x y]) and (foo [x y z]) it seems happier and compiles at least
22:06amalloylivingston: isn't that basically what i said last night? that the former doesn't work but the latter does?
22:07livingstonamalloy: probably. I was perhaps starting to fade at that point...
22:08amalloy(10:04:10 PM) amalloy: protocols don't support multiple arities in a single declaration. they're java-level methods
22:08amalloy(10:04:26 PM) amalloy: you would need (bar [x y]) (bar [x y z]) iirc
22:08livingstonit's weird that the protocol needs it this way (foo [x y] [x y z]) but the record needs two independent lines
22:10livingstonyep just confirmed that (defprotocol P (foo [x] [x y])) (defrecord R [] P (foo [x] ...) (foo [x y] ...)) works
22:11livingstonany variation on that doesn't eg defprotocol P (foo [x]) (foo [x y]) makes things mad.
22:37amalloyanyone know who "owns" the clojure translation of "casting SPELs in lisp"? i was just looking over it and there are some things that could use fixing
22:39livingstonoh, did that guy from last night start looking into that? (things change a lot in developing languages, I hope they tag it with the version it was based on, or last updated with)
22:49amalloylivingston: i don't know. but today i remembered it being mentioned so i went to look at it
22:50livingstonthere's been a version of that around since 1.1 at least. it would be easy for there to be something 'old' in it.
22:54amalloylivingston: for sure. the text indicates that they're using 1.1, but i didn't find anything especially "old", just generally subpar. eg some "sample output" contains an apostrophe that wasn't present in the input that created it
22:56livingstonamalloy: well, as long as it's documented and not too far off at least it's not a disservice. updating it would benefit the community though.
22:56amalloyno, of course, i don't want to badmouth it, just fix it
22:57livingstonoh I just meant it's existence wasn't going to screw anyone new up.
22:57amalloyit also uses (apply concat (map (fn [x] ...))) instead of (mapcat (fn [x] ...)) in a section where they're like "here's a function for fixing up the clojure-specific aspects of the output; explaining it is beyond the scope of this book". is mapcat new?
22:57livingston,(doc mapcat)
22:57clojurebot"([f & colls]); Returns the result of applying concat to the result of applying map to f and colls. Thus function f should return a collection."
22:58livingstonhow do you make it tell you when it showed up?
22:58amalloylivingston: usually i don't bother because a lot of functions lie
22:58amalloybut ##(meta #'mapcat)
22:58sexpbot⟹ {:ns #<Namespace clojure.core>, :name mapcat, :file "clojure/core.clj", :line 2117, :arglists ([f & colls]), :added "1.0", :doc "Returns the result of applying concat to the result of applying map\n to f and colls. Thus function f should return a collection."}
22:59livingstonit wouldn't surprise me that it's been around that long, it's a pretty core thing in a lisp.
22:59livingston,(meta #'mapcat)
22:59clojurebot{:ns #<Namespace clojure.core>, :name mapcat, :file "clojure/core.clj", :line 2117, :arglists ([f & colls]), :added "1.0", :doc "Returns the result of applying concat to the result of applying map\n to f and colls. Thus function f should return a collection."}
22:59livingstonjust curious.
23:00livingstonwhat's the difference between these two bots anyway?
23:00amalloylivingston: they were built from the ground up independently. there are a lot of differences
23:02livingstonamalloy: i recall a lisp channel having something like sexpbot, but maybe I'm confused, I wonder if they are related.
23:02livingstonwhy both building two, work together ;)
23:02amalloylivingston: lambdabot lives in #lisp, i think
23:02livingstonAH! that's the one
23:02amalloybut sexpbot is in a lot of channels, so you might have found him anyway
23:03livingstonamalloy: it's possible lambda bot is signaled with something like sexp or something that might have been the commonality
23:07amalloyanyway sexpbot was started by Raynes, and i joined in october or so. clojurebot is owned by hiredman
23:08livingstongood to know. I see hiredman talk to clojurebot a lot, I figured it's probably his.
23:12ssiderishello... does anyone know how to pass jvm flags from leiningen? I'm trying to debug with JSwat (see http://markmail.org/message/s42sxxv6a2zshwdy )
23:13ssideristhe leiningen sample.project.clj has this :jvm-opts ["-Xmx1g"]
23:13ssiderisbut it's unclear whether these are applied when I do "lein swank"
23:13amalloythey are
23:13livingstonthat looks like it - that's sen
23:13livingstonoop accidental enter
23:15ssiderisamalloy: well, it seems that JSwat can't connect to the jvm, that's why I thought they weren't
23:15ssiderisbut it must be some other problem then...
23:16amalloyssideris: i've used the jvm-opts setting to make the swank server accept incoming java-debugger connections, so it works
23:17livingstonhow are you setting jvm-opts?
23:18ssiderislivingston: :jvm-opts ["-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n"]
23:18amalloyor it's at least supposed to
23:18amalloyoh, good catch livingston
23:18livingstonthat's how you'd normally do things like that but in lein given you example was a vector
23:19livingstonI'm guessing it expects multiple string?
23:19amalloyi would assume so, yeah
23:19ssiderislet me try...
23:19amalloy["-Xdebug" "-Xrun..."]
23:19ssiderisyep! that's what it is!
23:19ssideristhanks a lot :-)
23:20livingstonI caught a bug in the swank mvn target this way...
23:23livingstonok it was my "mistake" in the first place for using extend instead of having defrecord refer to my protocols directly, but if I ever offer to fix that mistake again, just shoot me.