#clojure logs

2012-04-20

00:07brweber2__does anyone have any idea why (iterator-seq (.iterator x)) would be calling (.next x) ?
00:07brweber2__is that it caching the first 32 values?
00:13amalloyi expect .iterator is implemented in terms of .seq
00:16yoklovdnolen: awesome
00:16yoklovthey work very well
00:20ibdknoxanyone work in finance?
00:21ibdknoxI got an email from someone and I was curious if they were a well known organization
00:23SlavikGWhat's the .symbol syntax again?
00:27tmciverSlavikG: you mean Java interop? (.someMethod someJavaObject)
00:28eggsbyI always forget the difference between member method and static method... tmciver the version there is member, right?
00:28SlavikGAh
00:29SlavikGSo it's someJavaObject.someMethod?
00:29eggsbywhere (. (Date.) getTime) is an example of using a static?
00:29amalloythat's not static either
00:29SlavikGSo like ehh (.reverse "Foo") would be "Foo".reverse() in java basically?
00:29eggsby:O
00:29amalloythat's just (.getTime (Date.))
00:30muhooi finally figured out why i can relate to the clojurebook.com more than joy of clojure. clojurebook uses ruby often as point of familiarity/contrast.
00:30eggsbyI've been using 'clojure in action'.
00:30eggsbyI'm starting a course on codelesson.com next week hosted by the author
00:30muhoonot quite "cloojure for ruby webdevs", but close enough for me to get it.
00:31yoklovSlavikG: yeah
00:31eggsbyamalloy: so they are just different notations, is there a difference in clojure syntax between calling a static method and an instance method?
00:31yoklovyou can access fields with (.-field obj) in 1.4 now too
00:31eggsbyoh wow yoklov, that's neat
00:32amalloyeggsby: the same syntax works: ##(.parseDouble Double "11")
00:32lazybotjava.lang.IllegalArgumentException: No matching method found: parseDouble for class java.lang.Class
00:32eggsbycool
00:32amalloywell, maybe not, i guess? ##(macroexpand '(Double/parseDouble "11"))
00:32lazybot⇒ (. Double parseDouble "11")
00:33amalloyapparently the shorthand is different but the longhand is the same
00:34eggsbymacroexpand, I'd never seen that before
00:34eggsbyhow neat
00:35muhoowait, isn't field access (.field obj) in 1.3?
00:35amalloythat still works
00:35eggsbySo what are the implications of the new extensible reader?
00:35muhoowhy the extra - now?
00:37dnolenmuhoo: in ClojureScript (which targets JS), it's impossible to differentiate field access from method calls, thus -.
00:38dnoleneggsby: JSON-like convenience + XML-like extensibility
00:38amalloydnolen: not actually impossible, obviously. we could have chosen to do something like (. obj (foo)), right? the .-foo syntax was, afaik, chosen because authors expected (.foo obj) to be a method rather than a property
00:39amalloywhich i guess is how things were before
00:40dnolenamalloy: yes
00:41muhoothanks for explaining
00:48dnolenmmarczyk: ping
01:04wkmanirecrap
01:04wkmanireMy fridge was set to be too cold.
01:04wkmanire:(
01:04wkmanireFroze all the beer.
01:04ben_mBeer ice!
01:04wkmanirebeer solid.
01:06wkmanire(map defrost (:beers fridge))
01:07ben_mpmap
01:07ben_mSo it's faster.
01:07technomancypmap if you have multiple consumers
01:07ben_mMultiple defrosters?
01:07wkmanireYou guys wanna come over?
01:08wkmaniretechnomancy: Did you write clojure-mode from scratch or did you modify another LISP major mode?
01:15amalloywkmanire: neither. he took over from jchoi
01:16wkmanireamalloy: Oh, I thought he was the author.
01:16amalloyif you want to know about its beginnings, i'd look at the git log
01:16wkmanireWell yeah.
01:23devnlol, https://skitch.com/thinkslate/8wtam/mixtent-clojure-cemerick-vs-rhickey
01:26wkmaniredevn: Is that for real?
01:26wkmanire:D
01:30lynaghkibdknox, you around?
01:30ibdknoxlynaghk: hey
01:30lynaghkI've been using Waltz and thinking about different approaches to integrate it more tightly with, um, state. Atoms, for the most part.
01:30ibdknoxI thought about them having properties
01:31lynaghkeach state?
01:31ibdknox"properties"
01:31ibdknoxno on the machine
01:31ibdknoxwhat's the example?
01:31lynaghkI'm using the states roughly to correspond with UI screens
01:32lynaghkso, say, the user is in the :dashboard state, which shows a screen with some multiselect widgets
01:32lynaghkThe state of those widgets is held in atoms---I'm thinknig of different ways to try and persist that stuff
01:33ibdknoxso far that's what I've been doing
01:33lynaghkso, perhaps, adding serialize/deserialize functions for each state.
01:34ibdknoxlynaghk: I'd have to see it
01:34lynaghk(I need to persist the entire application state in the URL)
01:34ibdknoxah
01:34ibdknoxI see
01:34ibdknoxok
01:35ibdknoxdidn't realize that part
01:35eggsbylynaghk: have you seen http://hashify.me ?
01:36lynaghkadding serialization fns to the state machine is the most general solution I can think of---I'm also considering making mutable state an explict part of the machine itself---you'd pass each state a reference to the atoms you're using and it'd handle (de)serialization automagically.
01:37lynaghkeggsby: nope, I hadn't. I'll be doing something similar---using prn to save all of the Clojure data structures and base64 encoding, probably.
01:37ibdknoxlynaghk: seems like you could do something in combination with my transition on hash stuff
01:38lynaghkibdknox: then I'd need to represent *all* of the state using state machine states, no?
01:40ibdknoxI don't think you necessarily have to, that it would need access to all of it
01:40lynaghkI've been reading around trying to figure out how people structure this stuff. It feels sort of backhanded to use a "state machine" and then juggle some extra hoops to handle additional state =)
01:40ibdknox-that +but
01:40ibdknoxlynaghk: yeah, I haven't thought about trying to represent all state in the url
01:40ibdknoxnever really had a need to
01:41ibdknoxso not something I've given a lot of hammock time to :)
01:41lynaghkibdknox: me neither, until last week. I can think of some ways to do it, but I'm trying to come up with a nice, general method.
01:41ibdknoxI did think that realistically you needed to be able to adorn the machine with properties
01:42ibdknoxeven my metrics thing would need it for something simple like dependent metrics
01:42lynaghkibdknox: I'm not sure what you mean; global machine properties, or properties that individual states have?
01:42ibdknoxI was thinking global state.
01:43ibdknoxin your case it seems like there'd be one machine controlling the transitions between views
01:43ibdknoxand one for each view if it needs it
01:44lynaghkibdknox: yeah. Right now everything is on one machine, with individual screen behavior mediated by watchers (e.g., watch dropdown selection, when it changes fetch new data and update chart)
01:45ibdknoxI think it might be better to break them apart, but that's just based on what I'm envisioning in my head
01:45lynaghkibdknox: sub-machines would be cleaner though, especially to move between loading/error states
01:45ibdknoxmanaging all of it in one will get msesy
01:46lynaghkibdknox: any thoughts on a hierarchical state machine? I could use what's in Waltz now to build additional machines for different views, but there might be some advantage to integrating them all
01:46lynaghkSome sweet debugging, at the very least.
01:47ibdknoxso I think you could do that with the properties thing I was talking about
01:47ibdknoxthe big machine would have the sub ones as properties
01:47ibdknoxbut I haven't really thought through that either
01:47lynaghk(:current-sub-statemachine sm)?
01:47ibdknoxbasically
01:48ibdknoxthen the states would manage that themselves
01:48ibdknoxit strikes me as potentially being very clean, but still integrated, but I obviously haven't tried it yet :D
01:48ibdknoxso I could be spewing nonsense
01:48lynaghkWell, I need to bite the bullet and do something.
01:49lynaghkThat said, I'm pretty sure this won't be the last CLJS project I do, so I'll get some chances to try out different approaches in the future =)
01:49ibdknoxyeah, I'm going to be figuring out a bunch myself for light table
01:49ibdknoxlol
01:50lynaghkA friend of mine pointed out that I'm hit with a double punch---my work is for clients (so it needs to get done), but I also open source a ton of it (so it needs to be clean).
01:51lynaghkibdknox: yeah, props on the light table. Must have been a surprising change of direction for you from the other project
01:52ibdknoxdefinitely unexpected
01:52ibdknoxlol
01:53lynaghkso I take it you'll be having a GSoC intern do most of the work, while you test out different hammocks in the South Pacific?
01:53ibdknoxthat's the plan ;)
01:53lynaghk= P
01:53devngah
01:53devnwe need to fix clojars
01:55lynaghkibdknox: alright, I'm out. Thanks for the tips.
01:55ibdknoxlynaghk: anytime! ttyl
01:57devnibdknox: howdy
02:15devnanyone around this evening?
02:15RaynesI am.
02:15RaynesOn LA time.
02:15devnhey man!
02:15RaynesSuuuup
02:15devnyou're in LA now?!
02:15RaynesUntil day after tomorrow. I've been here since last Friday.
02:15RaynesI'm moving out here in like a month and a half.
02:15Raynes:p
02:16devnI was trying to figure out how to send you a damned hard drive in the middle of Nowhere, TN
02:16eggsbycool, I'm from LA :)
02:16devnand all of a sudden you're fighting traffic in LA
02:16devnthe world is strange my friend
02:16eggsby~socal clojure meetup~
02:17devn:)
02:17Rayneseggsby: o/
02:17devnare those smell lines?
02:17devnor?
02:17eggsby\o
02:17devnRaynes: are you leaving geni?
02:17RaynesNo, I'm joining Geni.
02:17RaynesI'm coming out here to work full time.
02:17devnoh, i thought you worked with them already
02:17devnwere you remoting?
02:18devn(this doesn't need to be public btw)
02:18devn(sorry)
02:18amalloyeggsby: there's already an LA meetup, usually in century city
02:18Raynesdevn: Totally cool with public.
02:18eggsbyamalloy: I gotta get in the loop
02:18RaynesAnd yeah, I was remoting part time for a year.
02:18devngotcha
02:19devnwell, congrats. i actually have a few friends and relatives in LA. I will probably be there early Aug.
02:19devnI'll bug you then!
02:19Raynesdevn: Sounds great! :D
02:20devnim still angry you're not going to euroclojure
02:20devn(where i'm going to bomb a co-presented talk)
02:20RaynesI wish I could man.
02:21devnim freaking out a bit. im annoyed at how calm you were during your talk at the conjh
02:21RaynesBut they're paying so much for me to fly back and forth over the next couple of months (not to mention relocation fees)… And I certainly can't afford it myself.
02:21Raynes:P
02:21devnconj*
02:21Raynesdevn: Oh God no, I was scared to death.
02:21devni have a co-presenter, but im still not entirely sure what the game plan is
02:21devnand...it's the closing talk
02:21devnof...the entire conference
02:22Raynesdevn: I was deep, deep inside my head when I started the talk. I put myself in a place where I didn't care whether or not I did a good job and just started talking.
02:22RaynesOnce people express joy, you're fine.
02:22devnRaynes: *nod* it's just tought to know what the person im presenting with will be like
02:22devntough*
02:23devni have a sense of it based on talks of his ive watched, and ive shared a google doc with him with experiences and so on
02:23devnbut i want to have people leave this talk feeling like they're goddamn alan kay on a mission
02:23devnlet's fucking *do this*
02:24devnbut i dont know if im affable enough to pull that off
02:24devnnor am i sure that is something the crowd will generally respond to
02:24devnin other words, im overthinking it.
02:24devn;)
02:24Raynes:p
02:24RaynesThat's one thing I think I didn't do.
02:25RaynesI didn't think about much in my talk. I just wrote what was on my mind.
02:25devnRaynes: i think that's totally reasonable. i rather enjoyed your talk. you're fun to listen to
02:25devni guess the idea of being the last talk just freaks me out a bit
02:26devni feel like it needs to be a solid book end
02:26seancorfieldwhat's your talk about devn
02:26devnand im trying to figure out what that is
02:26devnseancorfield: it's a "soft talk" about community, building clojure communities, what we do right, what we need to improve, etc.
02:26seancorfield(and i'm still up because i'm in the SF Bay Area and i'm a bit of a night owl - esp. when the wife's away)
02:26devnaka, no category theory
02:27seancorfieldsoft talks can be good too - we shouldn't have hard tech stuff all the time
02:27RaynesThe last talk is bad because it means you have to anticipate it and it might make it difficult to enjoy the conference.
02:27devnit's a lay up in some respects
02:27devnbut it's deadly serious in others
02:28devnim very serious about this stuff, so that makes it easy, but whether or not this is something the audience generally gives a shit about is another matter
02:28seancorfieldThe Bay Area now has three Clojure meetups a month. Two full-on user groups and a dojo group.
02:28devn^-fucking winning
02:29devni took neal ford's advice and started lurking around schools
02:29devni went to a presentation this evening by a student on ruby on rails and repped my clojure meetup group
02:29seancorfieldThat could be misinterpreted :)
02:29Raynesdevn: Taken out of context, that could....
02:29devn:)
02:29RaynesBahahahaha
02:29Raynesseancorfield: o/
02:29devnseancorfield: he already made that joke!
02:30Raynesdevn: You're now on the twitters.
02:31devnwtf is twitter?
02:31devnOH: [23:22:02] <devn> i took neal ford's advice and started lurking around schools
02:31devnlol, you sonofabitch
02:32devnpardon my portugese
02:32RaynesHaha
02:32devnno but seriously. this sounds terrible and in some ways totally weird
02:33devnbut i think we need a "clojure street team"
02:33devnpeople who take up the cause of being the creepy language evangelist
02:33devnin all of the right places
02:33devnhahaha, Raynes -- @rbxbx
02:34RaynesYeah, heh
02:35devnseancorfield: how often do you attend the aforementioned user groups?
02:36seancorfieldI run the SF one, so every month for that. I was supposed to go to the MV one tonight but with the wife away, it's hard to get all the chores done and still get across the bay by 6pm so I skipped it.
02:36seancorfieldI'm hoping to get to the next dojo on the 24th
02:37devnseancorfield: wanna come hang out in madison for a long weekend sometime?
02:37devnsummer is nice here FWIW
02:37seancorfieldLOL... only if there was a cat show there my wife was judging!
02:38Raynesseancorfield: Lance said he'd take me to SF at some point after I move out here. Could I see your kitties?
02:38devnim just...
02:38devnim going to abstain...
02:38RaynesHe has cats!
02:38seancorfieldShe was out in WI a month or so back actually, but we're under a deadline at work so it's hard to get more time off...
02:38RaynesI like cats!
02:38devn...
02:38devnjust...
02:38RaynesI want to see his cats. Is that so bad? :(
02:39devni dont know...
02:39seancorfieldRaynes: we live in the East Bay, about 35 miles from SF... But, yeah, you'd be welcome to come see the cat house :)
02:39devnseancorfield: threaten to quit!
02:39devn;)
02:39seancorfieldSee our kitties here: http://bangles.com
02:39devndude you own the bangles domain
02:40seancorfieldMy wife's name is Bangle. She's owned it for years and years.
02:40devnhaha that's awesome
02:40seancorfieldBut, yeah, we get a steady stream of requests to buy it.
02:40devni remember going to buy devin.com
02:40devnand this bastard, devin carraway
02:40devnive followed him his entire damned life
02:40seancorfieldTurned down $20k for it last year.
02:40devnsilently waiting for him to go broke and fail to pay his reg fee
02:40devnso i could buy that goddamn domain
02:40devnbut no dice
02:41seancorfieldLOL... I own corfield.org but haven't managed to get corfield.com yet :)
02:41RaynesI just… I'm just Raynes.
02:41devni have some rot13 domains
02:41RaynesI'd just change my name to Raynes before I'd pay for the "anthony" domain.
02:41devnqriva.com => devin.com, pbqr.org => code.org
02:42seancorfieldmost of the domains i own are cat-related: sites i maintain for friends in the cat fancy...
02:42Raynesmraow
02:42devnrot13 domains are the rotten food scraps of a generation of interneters
02:43devnseancorfield: i was on the cover of cat fancy
02:43devnthe picture: it was all seductive-like
02:44seancorfieldheh, which issue - i bet we have a copy
02:47seancorfieldwow, our clojure-powered email / matching profile process has sent out 100,000 emails in the last 24 hours... my tweaks to its concurrentness must have worked :)
02:52devnseancorfield: what are you using to achieve that?
02:53seancorfieldit's just a bunch of clojure code that scans a MySQL DB (clojure.java.jdbc), runs searches (custom code against Discovery by Transparensee), generates HTML emails (Enlive) and sends them (wrapper around javax.mail)
02:54seancorfieldand right now we're just using pmap in a couple of places for parallelizing
02:54seancorfieldnothing fancy
02:54devnreally? pmap?
02:54devnI see that being used in so many wrong scenarios
02:55devnconstructing an email seems like it might not be the right fit?
02:55devni guess it depends largely on chunking
02:56seancorfieldthe per-item process calls out to another server for the search as well as running some compute-intensive filtering as well as generating the email
02:56seancorfieldso pmap works pretty well
02:56devngotcha
02:56devnpmap was this magical thing to me when i first got to clojure
02:56devnand i realized pretty quickly i had to use my head before using it
02:56seancorfieldwe could certainly streamline it a bit... right now we're only hitting 50-75% CPU utilitization on a 16 core box
02:57devnthe power can sometimes be too much, even for us... ;)
02:57devnseancorfield: that's really cool
02:58devnseancorfield: i may be starting a project where i have access to some /serious/ machines
02:58devn80 core machines, SSDs, clustered
02:58seancorfieldnice
02:59seancorfieldwe just have five 16 core, 16GB dell servers in a data center on the east coast
02:59devnim excited to drop clojure on it and see what happens
02:59seancorfieldwell, for this new platform
02:59seancorfieldwe have tons of windows servers too but those are all going away :)
02:59devnseancorfield: that's not small. :)
03:01devnseancorfield: either way, i may bug you at some point about perf stuff. it sounds like you're doing this in practice
03:02devnthis project is heavy on agent-based modeling
03:03seancorfieldso far we have about a million members on the new platform - with another two and a half million members being migrated over in the next few weeks
03:03seancorfieldthen we'll really be able to see how far we can tweak things :)
03:04seancorfieldthen we can start to think about migrating from mysql to mongodb for a few more things
03:05seancorfieldbut it's all just basic stuff... persistence, json/xml transformation, web service interactions, some html email generation
03:06devnseancorfield: cool, that's a big user base
03:06devnseancorfield: are you guys doing perf testing?
03:08seancorfieldhaven't needed to do much so far
03:08devnhttp://www.youtube.com/watch?v=G5NdmOCe0Z4&amp;feature=related
03:08seancorfieldbizarre
03:09devn:D
03:09devnkeep it weird.
03:09devnkeep it clojure.
03:09seancorfieldwe know there are some hotspots in the application and we're rewriting bits of the code as necessary to speed things up... but that's mostly rewriting from CFML to Clojure :)
03:10seancorfieldand we have a smart DBA who reviews and tweaks a lot of SQL so we don't bog down on that side of the house
03:24muhoowhat's the differenced between into and merge when adding stuff to maps?
03:25muhoohmm, ok nevermind, into only takes 2 args, merge is multi-arity
03:30SlavikGWhat's the reasoning again that you can just use (vec 4) for lookup in a random vector and hash and what not etc butn ot with lists?
03:30amalloyvectors can do it fast
03:31SlavikGThat's it?
03:31SlavikGJust to notgive the ilussion of performance?
03:31amalloyas far as i know
03:32SlavikGAt least give me somthing like (list true) is the first element and (list false) the tail or something. ==
03:32SlavikGI want something, it's cool
03:32amalloyokay, i'll let you in on a secret
03:32amalloy(list x), for all x, is an exception
03:32amalloy!!!
03:32SlavikGYeah, so that I don't want
03:33SlavikGGimme something with it.
03:33amalloybeggars can't be choosers
03:33SlavikGLooks cooler.
03:33muhoowrite it
03:34amalloyokay, how about: ##(:gimme-the-magic (list 1 2 3 4 5) 15)
03:34lazybot⇒ 15
03:34muhoohahaha
03:34SlavikGShouldn't that throw an exeption or something because a list doesn't have symbolic keys?
03:35muhoo&(:foo :bar :baz)
03:35lazybot⇒ :baz
03:35SlavikGOr keywordic keys
03:35SlavikGtechnically
03:35SlavikGOh wow
03:35SlavikGI'm not sure if I agree with that
03:35SlavikG&(:I :worship :his :shadow)
03:35lazybotjava.lang.IllegalArgumentException: Wrong number of args passed to keyword: :I
03:35SlavikGWell
03:35SlavikGthat's a start
03:36muhooo GAWD not with the lexx references again
03:36muhoosomeone put one up a few weeks ago, and i was singing the goddamned "brunnen g" song for a fricking week. BAD.
03:36SlavikGThat was most likely I.
03:36SlavikGI always use 'I worship his shadow' if I need four symbols
03:37SlavikGI also constantly change my nickname.
03:37amalloyLlajla, you always use that no matter how many symbols you need
03:37SlavikGWell, I use it when I need four or the number doesn't matter
03:37SlavikGIf I need 3 I can't let it work
03:37SlavikGwith five, maybe I can use 'I wroship his divine shadow'
03:38muhoo&(:as :you :command :stan)
03:38lazybotjava.lang.IllegalArgumentException: Wrong number of args passed to keyword: :as
03:38muhooah, as means something
03:39amalloyno it doesn't
03:39muhooit thought i was destructuring
03:39muhoo&(:foo :bar :baz)
03:39lazybot⇒ :baz
03:39SlavikG&(:the {:giga "Shadow"})
03:39lazybot⇒ nil
03:39muhoo&(:as :foo :bar :baz)
03:39lazybotjava.lang.IllegalArgumentException: Wrong number of args passed to keyword: :as
03:39amalloymuhoo: you're passing the wrong number of args
03:39SlavikGwants 2 or 3
03:39muhooi see
03:39amalloy&(:waffle :walkie :talkie :brigade)
03:39lazybotjava.lang.IllegalArgumentException: Wrong number of args passed to keyword: :waffle
03:40muhoo&(:as :foo)
03:40lazybot⇒ nil
03:40muhoo!
03:40muhoo&(:as :foo :bar)
03:40lazybot⇒ :bar
03:40muhoo&(:as :foo :bar :baz)
03:40lazybotjava.lang.IllegalArgumentException: Wrong number of args passed to keyword: :as
03:40muhoo&(:as :foo :bar :baz :huh)
03:40lazybotjava.lang.IllegalArgumentException: Wrong number of args passed to keyword: :as
03:40muhoointeresting
03:40SlavikGI disagree though
03:40SlavikGit should barf because the second argument is not a record or structmap or dict or whatever
03:41muhooi guess i don't really understand what it's doing there then
03:42muhoowhy (:foo :bar :baz) evaluates to :baz, but (:foo :bar :baz :quux) is an error?
03:42amalloy&(:foo {:x 1} :not-there)
03:42lazybot⇒ :not-there
03:43amalloy&(:foo {:x 1 :foo 2} :not-there)
03:43lazybot⇒ 2
03:43SlavikGmuhoo, what it does is (:foo bar x) tries to look up foo in bar, if it's not there returns x as sentinal
03:43SlavikGwhen x is not supplied, it returns nil
03:43SlavikGBut basically it doesn't barf when bar is not a record or dict or structmap or set or whatever can look that up
03:43SlavikGwhich is kind of weird
03:44SlavikG&(get :x :x}
03:44lazybotjava.lang.RuntimeException: Unmatched delimiter: }
03:44SlavikG&(get :x :x)
03:44lazybot⇒ nil
03:44muhooah, sentinel, got it
03:45SlavikG&(get 3 5)
03:45lazybot⇒ nil
03:45SlavikGYea ehhh
03:45SlavikGI'm not sure about not throwing an error there
03:45SlavikGBut then again
03:45SlavikG##(symbol? (symbol "I worship his shadow"))
03:45lazybot⇒ true
03:46SlavikGI'm not too sure about that either
03:46muhoo&(get 3 5 8)
03:46lazybot⇒ 8
03:46muhoook, makes sense now
03:49SlavikGmuhoo, no it doesn't
03:49SlavikGit should raise an exception
03:49muhoo*sigh*
03:50SlavikGWhat, it should
03:50SlavikGlooking up a number inside another number makes no sense
03:53muhooi dunno then, report it as a bug in jira, i guess.
03:54muhooi'd be curious what you hear back on that.
03:59bohlWhich is the most popular sql / persistence library?
04:00vijaykiranhibernate
04:01vijaykiransqlkorma has been working fine for me though.
04:04GeraldMacDuichmuhoo, clojure has no bugs because it doesn't have a formal specification
04:04GeraldMacDuichEverything the implementation does is a feature.
04:05GeraldMacDuichI just think this feature is particularly ill thought out or just sloppy oversight, latter case being rare as one assumes that however you twist or turn it, it still investigates the type of the haystack and just defaults to 'not found' for any non collection
05:12fliebelI wonder how hard this really is? https://www.coursera.org/course/compilers I mean, doing a simple forth/lisp compiler isn't all that hard, but maybe they do something more involved?
05:15clgvfliebel: I think these courses cover attributes of formal language as well and introduce parser, lexer, .. based on that.
05:16clgvfliebel: the course at my university did it like that
05:16fliebelclgv: attributes of what? So it *is* hard?
05:18clgvfliebel: depends on your background. if you study computer science at a university, it is a course like others. likely more theoretical of course
05:21devnanything worth learning is probably "hard"
05:27jaenParsing a language on it's own isn't that hard, but if they cover stuff like register allocation or optimizations then it could be somewhat worthwile course
05:27jaenEven if you end up using LLVM in the future or somesuch
05:30mmarczykfliebel: transforming the program into static single assignment form / continuation passing style, register allocation (graph colouring and all that), noticing various optimization opportunities etc.
05:30mmarczykfliebel: plenty of stuff to talk about :-)
06:16KilleroidHi, can anyone point me in the direction of where I can report a bug?
06:18clgvKilleroid: a bug in what? clojure or one of the many libs?
06:19KilleroidI think clojure.string
06:19Killeroidrunning (str 08) or (str 09) gives me an error
06:19Killeroid(str 01) to (str 07) dont give any erros
06:19Killeroid*errors
06:20KilleroidAlso (str 010) returns "8"
06:21clgvthats not in clojure.string but in clojure.core/str and it's no bug since you use an octal representation of your number indicated by the leading zero
06:21clgv&010
06:21lazybot⇒ 8
06:21clgv&0109
06:21lazybotjava.lang.NumberFormatException: Invalid number: 0109
06:22clgv&[010 8r10 9r8]
06:22lazybot⇒ [8 8 8]
06:22clgvthat is the same notation as in java
06:22KilleroidBah, completely forgot about about the base-8 num system
06:23KilleroidThanks for clearing this up for me!1
06:24clgvthe error message could be more specific though
06:25KilleroidYeah, it could
07:49the-kennyCan someone recommend me a ClojureScript library for canvas manipulation?
08:27mmarczykoh noes, Gmail's old look is gone :-(
08:28Borkdudemmarczyk: I still have the old one but my wife has only got the new one and can't revert anymore
08:28Borkdudemmarczyk: it's so ugly
08:30mmarczykBorkdude: I don't mind the aesthetics that much -- although I hardly consider them an improvement -- but I think its inferior functionally :-(
08:30mmarczykthere might be an improvement or two, but mostly it seems like a step back...
08:30mmarczyk(a minor improvement or two)
08:31Borkdudemmarczyk: like what?
08:31mmarczykBorkdude: actually there's just one thing that I can see -- separate scrolling for labels list
08:31mmarczykbut the conversation view... ouch :-(
08:32mmarczykat least the avatars are no longer ginormous like they were in the earlier versions of the new look
08:32mmarczyk(still don't know wtf I'd want to see them at all)
08:33mmarczykwell, gotta dash -- got my lunch ready -- it's gonna feel solemn now, the goodbye-to-old-Gmail lunch
08:34BorkdudeI wonder why google is doing this while I see nothing but complaints about this design
08:36Borkdudemaybe it is like the windows vista of designs, making the next thing look better
08:40kralwhat the hell is a finger tree?
08:46kralI'm talking about this: https://github.com/clojure/data.finger-tree
08:46kraloh, ok, found the answer... http://www.soi.city.ac.uk/~ross/papers/FingerTree.html
09:01jondot_hi all, any mime-type detection in ring
09:05jondot_ah. ringfinger
09:14gkoIs it possible for clojure-mode (from package.el) to coexist with official SLIME ?
09:20joegalloif you've got a chance to review pull requests, there's some good ones, eng-2345 in particular is intended for -stable.
09:20joegalloha, wrong channel. ignore me.
09:29mdeboardConsider yourself ignored
09:29mdeboardFOREVER
09:29RickInGAharsh
09:31mdeboardI'm always harsh on Monday mornings, sorry
09:31RickInGAwow, the weekend is over already? that went fast
09:41mdeboarddamn light table 3/8 of the way to the goal
09:41mdeboardwru PR campaign
09:50clgvmdeboard: he needs another video ;)
09:50mdeboardcelebrity endorsement*
10:37wkmanireGood morning!
10:37edwGood morning.
10:47samaaron`Good afternoon!
10:53mmarczykdnolen: ping
10:56timvisherhey kids
10:56timvishercan anyone explain to me how I would mock the definition of a function for my tests?
10:56timvisheri thought it would be as simple as a (binding ... form but that doesn't work because i can't bind a non-dynamic function
10:57timvisheri don't really understand the implications of making the function definition dynamic either
10:58S11001001,(doc with-redefs)
10:58S11001001timvisher
10:59timvisherwhere's the bot? ;)
10:59S11001001&(doc with-redefs)
10:59lazybotjava.lang.SecurityException: You tripped the alarm! with-redefs is bad!
10:59S11001001ugh
10:59S11001001whatever, you get it
10:59timvisherlol
10:59timvisheryes i do
10:59timvisherawesome
11:00S11001001though you ought to look at tools.mock if rplevy ever got around to releasing it
11:00ibdknoxhiredman1: clojurebot is dead?
11:00ibdknoxoh no's!
11:00S11001001which is a test-friendly wrapper for with-redefs
11:00ibdknoxhe was our only link to the guards...
11:00timvishersweet
11:00wkmanireS11001001: Wow, nice reference. I might even end up usnig that today.
11:00wkmanire:)
11:00dnolenmmarczyk: pong
11:01wkmanireusing*
11:01mmarczykdnolen: thanks for merging PHM! :-)
11:01mmarczykdnolen: also, for asking around for perf tests
11:01dnolenmmarczyk: np, exciting stuff!
11:02dnolenmmarczyk: yeah, sounds like people using small maps - no difference, people using large ones big difference.
11:02mmarczykdnolen: I'll get around to the transients tests sometime soon -- I'm closing in on the PersistentTreeMap impl, so I guess I'll wrap that up first
11:02dnolenmmarczyk: k
11:02mmarczykdnolen: ohhh, sounds perfect then :-)
11:06S11001001timvisher: especially when mocking out purely impure functions, it's test-relevant to assert that they get called with the right arguments the right number of times, rather than just turning them into (constantly nil) or whatever
11:07timvisherS11001001: definitely. In this instance i'm trying to mock out an api that hits the network so i'm more interested in turning the call into a constant, but for more traditional mocking uses i see what you're saying
11:07wkmanireI sure wish I had two monitors. I'm tired of working on a laptop.
11:08S11001001timvisher: I actually mean cases like yours
11:10timvisherhmm. ok. except that the functions i'm calling are pure
11:10timvisherthere's no side effects, i just don't want to hit the network
11:10S11001001ok
11:20BorkdudeIs there a way to create a REPL without "load file in REPL" in Eclipse?
11:58jaju&(println "hello"_
11:58lazybotjava.lang.RuntimeException: EOF while reading, starting at line 1
11:58clgvBorkdude: there is "Run as". but you probably mean without having a source file?
12:01Borkdudeclgv: yes, just a REPL to mess round, with having the possibility to insert code over multipline lines, before evaluating
12:01zerokarmalefttechnomancy: why is :java-source-paths no longer included in get-classpath?
12:02clgvBorkdude: I know the idea. I want to be able to integrate it in my standalone application ;)
12:02Borkdudeclgv: I use lein repl a lot, but when I need more than one line it gets more difficult to use
12:02clgvBorkdude: but afaik you need some file.
12:04clgvBorkdude: you could create an issue on the CCW tracker
12:04clgvor ping cemerick ;)
12:05Borkdudeclgv: what is your standalone app?
12:06clgvBorkdude: an experiment environment for an optimization algorithm.
12:06Borkdudecemerick: I ordered the Clojure Programming book, can't wait to get it in the mail
12:08clgvBorkdude: nice trick to get his attention ;)
12:09Borkdudeclgv: hehe, but I meant it
12:09Borkdudeclgv: even
12:09clgvI thought so ;)
12:11BorkdudeI think clojure.java.io is a really good illustration of the use of protocls
12:11Borkdudeprotocols
12:17dnoleninteresting seems like Clojure interest on GitHub has skyrocketed in the past couple of days - https://github.com/clojure/clojure/graphs/traffic
12:18ibdknoxLight Table?
12:18ibdknoxwhat else happened really recently?
12:18timvisherhas to be
12:19Licenserhas someone wrote a clojure visit bot?
12:19timvisheri didn't see any big interest because of 1.4
12:19dnolenibdknox: that's what I was thinking - though you don't link to it directly in your posts, or KickStarter.
12:19Borkdudemaybe because I'm giving a clojure course, but that's only 30 people ;)
12:19dnolenLicenser: no, the watch list has increased dramatically as well - we're about to be the 4th most popular Java project on Github :P
12:19TimMcheh
12:19Licensera watch bot too?
12:19Licensersneaky people
12:20Licenser^^
12:20TimMcibdknox: you mean watjure, of course
12:20Licenseralso I want light table!
12:20jappinenits cause clojure is da bomb!
12:20ibdknoxTimMc: hahaha
12:22wkmanireI have some functions that save and load addresses to a text file. They all take the file-name as their first argument. I want to write a function that uses partial to "configure" all of these functions at once with a file-name provided by the user.
12:22wkmanireIs this a normal thing to do?
12:25jodarowow, cool github graph
12:25timvishercan anyone point me to reading as to why the use of `use` is increasingly being deprecated?
12:26ibdknoxtimvisher: technomancy led the fight :)
12:27technomancytimvisher: it's redundant, complicated, and has bad defaults
12:27ibdknoxuse and require confuse the crap out of new people
12:28mmarczykit's only redundant with :require :refer, and that's assuming there's an :all option (not sure?)
12:28technomancyyeah, there's a :refer :all option to :require
12:28mmarczykoh, cool
12:28technomancythough it should only be used for tests
12:28timvisheryes, that's actually the option that lead to my confusion
12:28technomancyor live-coding
12:29noidiwkmanire, you could replace the parameter with a dynamic var (e.g. *address-file*), and then call the functions with that var bound to the correct filename
12:29timvisheri agree with everything you said, but since I can now just refer all, the new solution seems to present the same problems
12:29wkmaniretechnomancy: So I should not use :use with ns?
12:29timvisheralbeit with more work required
12:29timvisherit's not a bad change, but i was just trying to understand if there were technical things that i didn't get about use
12:29wkmanirenoidi: Is that generally the way this sort of thing is handled?
12:30zerokarmalefttechnomancy: nvm wrt :java-source-paths, took the leap to preview lein2
12:30technomancytimvisher: the difference is you have to ask for everything with :refer, whereas with :use you'd get the bad behaviour by default
12:30technomancywhich I guess is what you said
12:31TimMc~use
12:31technomancywkmanire: if you know your code will never be run on pre-1.4 Clojure, then yes; best to avoid :use. but it's going to be a while before we can rely upon that
12:31TimMcBah, deadbot
12:31mmarczykgiven :all for tests, I guess I'm getting onto the ":use / :require unification" bandwagon
12:31noidiwkmanire, I think so, but you can of course wait for a second opinion :)
12:31solussd'mapv' is not lazy, correct?
12:32TimMcright
12:32wkmanirenoidi, technomancy: Ok. Thanks.
12:32TimMc&(doc mapv)
12:32lazybotjava.lang.RuntimeException: Unable to resolve var: mapv in this context
12:32TimMc&(use 'clojure.repl)
12:32lazybot⇒ nil
12:32TimMc&(doc mapv)
12:32lazybot⇒ nil
12:32noidiwkmanire, for example, the print and println functions use
12:32TimMcbah
12:32noidiwkmanire, for example, the print and println functions use *out* so you don't have to pass the output stream argument to them
12:33wkmanirenoidi: And this is a very similar effort. That makes sense.
12:33dnolencemerick: congrats by the way on the book, perusing it now, looks amazing!
12:34wkmanirednolen: I'm enjoying it so far. Once you get to chapter two its rapid fire library functions and explanations.
12:34wkmanire:)
12:34wkmanireGreat stuff.
12:34wkmanirelunch time.
12:36timvisheris `(into #{} ...` the simplest way to compare 2 non-map seqs for order-agnostic equality?
12:36timvisherthought that has obvious problems if you want to be aware of duplicates
12:36timvishermaybe sort ?
12:36gfredericksyeah sort is probably the best you can do
12:37timvishercool cool
12:37technomancy(set my-coll) is simpler than (into #{} my-coll) fwiw
12:37mmarczykhttps://github.com/michalmarczyk/clojurescript/tree/persistent-tree-map
12:37gfredericks(def unordered= (comp (partial apply =) (partial map sort) list))
12:37gfrederickstimvisher: I guess frequencies would also do it
12:38mmarczykthe above in case there's any interest in helping to test :-)
12:38gfredericks,(apply = (map frequencies [[2 48 3 4 5 53 2] [2 3 5 53 4 2 48]]))
12:38gfredericks&(apply = (map frequencies [[2 48 3 4 5 53 2] [2 3 5 53 4 2 48]]))
12:38lazybot⇒ true
12:38timvishergfredericks: not a bad option either
12:39gfredericks&(apply = (map frequencies [[2 48 3 4 5 53 2] [2 3 5 53 4 48]]))
12:39lazybot⇒ false
12:39dnolenmmarczyk: excellent! it's refreshing to see all that Java get converted into Clojure :)
12:39mmarczykdnolen: indeed :-)
12:39mmarczykdnolen: creating the ticket & posting to clojure-dev now
12:40pooya72Hi Everybody!
12:40dnolenmmarczyk: it's also a big win for all future Clojure implementations.
12:40mmarczykdnolen: I certainly hope so
12:43mmarczykhttp://dev.clojure.org/jira/browse/CLJS-187
12:45mmarczykthis automatically means we've got PersistentTreeSet with a tiny bit of code which I'll add after testing the map impl a little bit more
12:45devndnolen: are you planning on mentoring the pluggable backend for cljs?
12:47RoxxiHey, dnolen, what book were you an wkmanire refering to?
12:48mmarczykRoxxi: http://www.clojurebook.com/
12:48RoxxiAh, thanks!
12:50dnolenmmarczyk: excellent
12:51mmarczykdnolen: :-)
12:51RoxxiHas anyone ordered a programming book to use on their kindle? (Seeing as I now have a choice to make...) Is it easy enough to "flip through" when you want to look things up?
12:52technomancyRoxxi: it's not very good for reference, but generally you get a PDF along with the kindle version
12:52RoxxiOh really? I didn't know that. Thanks :)
12:56RoxxiWhen you're loading the repl and it complains of some sort of syntax error, is there an easy way to ask it to reprocess the file?
12:57RoxxiThough, I suppose I should be more specific- when using the repl with lein
12:57technomancyyou can add a :reload argument to your require call
13:01gozalaHi folks I'm trying to understand following lines of code
13:01gozalahttps://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L3519-3529
13:01gozalacould someone give me a hand ?
13:01wkmanireDamn, juxt looks scary.
13:02TimMcwkmanire: You will come to love it.
13:02TimMcwkmanire: (def separate (juxt filter remove))
13:03TimMc&((juxt filter remove) odd? (range 15))
13:03lazybot⇒ [(1 3 5 7 9 11 13) (0 2 4 6 8 10 12 14)]
13:03wkmanireTimMc: Oh wow.
13:03wkmanireI needed that example.
13:03wkmanireThat is pretty cool.
13:03eggsbyhmm
13:03eggsby&((juxt :a :b) {:a 1 :b 2 :c 3 :d 4})
13:03lazybot⇒ [1 2]
13:04TimMc(map {:a 1 :b 2 :c 3 :d 4} [:a :b])
13:04TimMc&(map {:a 1 :b 2 :c 3 :d 4} [:a :b])
13:04lazybot⇒ (1 2)
13:04wkmanireI was just thinking that.
13:05TimMcJust so you know... juxt is not lazy
13:05TimMc...but that usually doesn't matter either way.
13:05gozaladnolen: do you have time to help me with https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L3987-3993
13:05wkmanireYou know, it'd be neat if instead of a simple evaluator, lazybot made a namespace for each user that joins the channel and leaves your stuff in there for some specified period of time.
13:06wkmanireAnd it should let you call functions from other users' namespaces but not define stuff in them.
13:06wkmanire:)
13:06wkmanirethat could be cool.
13:07wkmanireIRCREPL &c
13:12TimMcI think I've seen a Scheme bot do that.
13:12TimMcMaybe rudybot?
13:13wkmanireTimMc: I'm thinking maybe it might not be a good idea. Might get too much flooding in the channel...
13:13wkmanireUnless you could pm the bot your entries.
13:15njdirksyntax ?: destructure compojure route : keys remote-addr + params email (TIA)
13:16njdirk[email] works, and {keys [remote-addr scheme] works, but not seeing how to to both
13:17S11001001destructuring language is recursive on all binding positions
13:17S11001001learn the non-shortcut syntax for picking out keyed values and you'll have your answer
13:20noidinjdirk, try something like {[email] :params}
13:21mmarczykgozala: what's the problem?
13:21technomancyhttps://github.com/mruby/mruby <- interesting that ruby is working on the same decouple-the-compiler-from-runtime approach as clojurescript
13:21gozalammarczyk: I'm trying to figure out what's the state is there ?
13:22fliebelDid seq-utils go anywhere in new contrib?
13:22gozalaI kind of understand that this is destructuring [{:keys [done] :as curr-state}] of argumnts
13:22mmarczykgozala: apparently {:done true/false, :value some-value}
13:22gozalahmm so is :keys and :as are something special ?
13:22wkmanireIs there a way I can reset my REPL?
13:22gozalammarczyk: ^
13:23wkmanireLike nuke everything in it without restarting it?
13:23noidigozala, yes
13:23gozalanoidi: anyone can point out where I can read about them ?
13:23noidimap destructuring works like let binding: names on the left and values on the right
13:23noidi{name :value}
13:24S11001001wkmanire: the global state of the clojure environment can't be rewound
13:24noidigozala, http://clojure.org/special_forms#Special%20Forms--(let%20[bindings*%20]%20exprs*)
13:24wkmanireS11001001: :/ ok
13:24technomancywkmanire: you could remove all namespaces that aren't part of Clojure itself though
13:24technomancybut there are no tools to do this for you
13:25mmarczykgozala: see the section on special forms on clojure.org
13:25mmarczykgozala: the description of let
13:25S11001001and it's not entirely reliable; e.g. if you installed new entries in the global-hierarchy
13:25gozalanoidi: so :keys will be vecrot of key names ?
13:25mmarczykgozala: the destructuring language is documented there
13:26wkmanireNo big deal. I'll just make a new namespace and work outa that.
13:26mmarczykgozala: {:keys [foo bar]} m, in particular, is shorthand for {foo :foo :bar bar} m
13:26mmarczykgozala: oops, {foo :foo bar :bar} m
13:26gozalammarczyk: awesome thanks!
13:27mmarczykgozala: and :as provides a binding for the whole map in addition to the bindings for the stuff destructured out of it
13:27mmarczykgozala: np
13:29njdirkmaybe my confusion is the sourcing of the values -- its clear to me that :params is provided by wrap-params, is :keys the result of ring?
13:29njdirk{remote-addr :remote-addr email :email} seems like the non-shorthand, but generates lotta nil love
13:31njdirkin my particular use case, I'm pulling a single value from each sourced dict -- based on both coming back nil, its clear that some secret sauce isn't dumping both into a single dict for my enjoyment
13:32mmarczyknjdirk: you could replace the whole map with a symbol and (prn ...) it on the next line -- then you'd know what's going on
13:32jondot_so, after 2-3 months of doing clojure, i got to the point when i'm absolutely in need to debug things, any idea how to do that? (im using vim for editing)
13:33wkmanirejondot_: As in setting breakpoints and stepping through the execution?
13:33jondot_wkmanire: and peeking around variables, yes
13:33wkmanirejondot_: I want to know how to do that too.
13:33mmarczyknjdirk: NB. you need to add wrap-keyword-params explicitly (or use compojure.handler/{api,site}, say) to have the map keys keyified
13:33jondot_well im assuming emacs supports it pretty well, but thats not my editor
13:34technomancyyou can use the debug-repl without emacs
13:34technomancyit doesn't give you stepping, but it's basically a way of injecting a breakpoint
13:34jondot_technomancy: i'll check that out
13:34technomancyyou have access to all locals
13:34jondot_technomancy: but the concensus is doing that via emacs correct?
13:35jondot_or is there some kind of eclipse/intellij thing?
13:35technomancyjondot_: if you need stepping I think that requires emacs or counterclockwise
13:35technomancyin my experience actually needing stepping is rare though
13:35technomancy(but when you need it, you really need it)
13:35technomancyI don't know if this is the most up-to-date, but it's a starting point: https://github.com/GeorgeJahad/debug-repl
13:36jondot_technomancy: yea i know, just trying to debug some concurrency trouble, and not having that much time on my hands right now
13:36technomancyoh, apparently CDT can be used without emacs? http://georgejahad.com/clojure/cdt.html
13:36technomancyworth a try
13:37wkmanirebookmarked and bookmarked.
13:37wkmanireThanks technomancy
13:37jondot_yup, thanks
13:38fliebelmind bending. http://clj-me.blogspot.com/2009/01/recursive-seqs.html
13:38technomancysure
13:48scriptordoes anyone have any links handy on the benefits of making almost all seq-handling functions (filter, map, concat) lazy?
13:49scriptorI know how it's beneficial for very long ones, but I want to get a better idea on the benefits for shorter ones
13:52wkmanirehttps://refheap.com/paste Would it be possible to replace the repeated use of nth in my paste with a destructuring expression?
13:52ibdknoxwkmanire: wrong link
13:53wkmanireyep
13:53wkmanirehttps://refheap.com/paste/2256
13:53wkmanireibdknox: ^ sorry about that
13:53robinkraftHow would you round all of the values in a vector? I've tried (map Math/round [5.9 1.1]) but I get this exception: "Unable to find static field: round in class java.lang.MathUnable to find static field: round in class java.lang.Math"
13:54ibdknoxrobinkraft: (map #(Math/round %) [...])
13:54scriptorsplit returns a vector, right?
13:54ibdknoxjust name them
13:54robinkraftibdknox: interesting, will give that a shot
13:54fliebel&(do (declare cdr) (binding [cdr (lazy-seq (cons 1 cdr))] (identical? cdr (rest cdr))))
13:54lazybotjava.lang.SecurityException: You tripped the alarm! pop-thread-bindings is bad!
13:54ibdknoxinstead of (let [fields ...
13:55ibdknox(let [[name address1 address2 ...] ...
13:55wkmanire&(split "head" #"")
13:55lazybotjava.lang.RuntimeException: Unable to resolve symbol: split in this context
13:55robinkraftibdknox: Ha! Thanks
13:55robinkraftit works like a charm
13:56ibdknoxwkmanire: even better would be to just use something like zipmap
13:56wkmanire&(doc zipmap)
13:56lazybot⇒ ------------------------- clojure.core/zipmap ([keys vals]) Returns a map with the keys mapped to the corresponding vals. nil
13:57ibdknox(zipmap [:name :addres1 :address2] (string/split my-str #","))
13:57wkmanireI want an array-map so that the order is maintained.
13:57ibdknox?
13:57ibdknoxprobably shouldn't be using a map if order matters
13:57wkmanire:)
13:58wkmanireI'm trying to represent an address in a way that its components are easily accessable
13:58wkmanirewhile also being able to write it to a simple CSV formatted file
13:58wkmanireand then read it back in.
13:58scriptoryou could use a function that converts it into a CSV-friendly form
13:58ibdknoxso represent it as a map and on write just print out the fields in order
13:58RickInGAcemerick: someone just tweeted about this. http://oreillynet.com/pub/e/2273 adding to my calendar now
13:59wkmanireibdknox: https://refheap.com/paste/2257
13:59ibdknoxin my zipmap case I would I have the fields in a var (def address-fields [..])
13:59wkmanireThese functions all work but I just read that nth is a code smell.
13:59wkmanireI'm also seeing that array-maps are a code smell?
13:59scriptorsince split returns a vector, I don't think you need nth in the first place
13:59ibdknoxyou shouldn't usually specify the type of map
14:00ibdknoxthat's asking for disaster later on if something modifies it and doesn't return that exact map type
14:00wkmanireibdknox: I was thinking about that. It really shouldn't matter so long as it contains the fields required by the file format.
14:00wkmanireANd the functions that read and write them should be responsible for order.
14:00wkmanireSO I'll refactor this a bit.
14:01wkmanireibdknox: Thanks for the advice, I'll repaste the modified edition in a few.
14:02mmarczykwkmanire: https://github.com/flatland/ordered
14:02fdaoudibdknox: for Light Table, is there any difference in the different wordings of "early beta access" and different "Estimated Delivery" dates, or is it all the same?
14:03ibdknoxall the same
14:03njdirk+LT, best $50bones ever spent!
14:03wkmaniremmarczyk: Neat. I don't think that should be used here according to ibdknox but good to know there is an lib for ordered associative types.
14:04fdaoudibdknox: good, thanks for confirming. I know it's out of your control, what kickstarter lets you edit.
14:04ibdknoxyeah, I'm very annoyed by that
14:04RickInGAas much as I want LT for Clojure, I just cant get over what a difference it will make for JS
14:04fdaoudas well you should be.
14:04mmarczykwkmanire: that's probably true, but no harm in knowing about that lib just in case :-)
14:05wkmaniremmarczyk: Yes, exactly
14:05wkmaniremmarczyk: There are so many core library functions and such, I'm starting to get a little overwhelmed.
14:05fdaoudyou should have a light color scheme for Light Table and the current darker scheme called Night Table
14:05wkmanireI'm just going to have to make sure I do a little clojure every day and eventually it will all soak in.
14:06ibdknoxwkmanire: don't worry about trying to remember them, just try to learn how to find them :)
14:06ibdknoxfdaoud: lol
14:06ibdknoxfdaoud: themes will just be CSS :)
14:06ibdknoxso they should be nice and simple
14:06wkmanireibdknox: apropos and doc are my best friends.
14:07fdaoudibdknox: sounds excellent. wish you great success with this project!
14:07ibdknoxthanks!
14:07wkmanireibdknox: I saw this morning that you are well on your way to getting funded.
14:07wkmanireI'm also really excited about the shadowrun game
14:07wkmanire:)
14:07ibdknoxhaha
14:07wkmanireI've been wanting that game made for at least 8 years now.
14:08wkmanireI played a lot of 2nd Edition with my buddies up in Washington.
14:09jajuQuestion about creating maps - When is a PersistentArrayMap created - and when is a PersistentHashMap created?
14:10fliebeljaju: Over 8 items, i think you get a hashmap
14:10amalloyjaju: i think if you care about the difference other than as a matter of curiosity your program is broken
14:11jajufliebel: That's what I understood too (not sure of the number 8) - but even the smallest map I create is a PHM
14:11amalloy&(map (juxt count class) (reduce conj {} (map vec (partition 2 (range 20)))))
14:11lazybot⇒ ([2 clojure.lang.MapEntry] [2 clojure.lang.MapEntry] [2 clojure.lang.MapEntry] [2 clojure.lang.MapEntry] [2 clojure.lang.MapEntry] [2 clojure.lang.MapEntry] [2 clojure.lang.MapEntry] [2 clojure.lang.MapEntry] [2 clojure.lang.MapEntry] [2 clojure.lang.MapEntry])
14:11amalloy&(map (juxt count class) (reductions conj {} (map vec (partition 2 (range 20)))))
14:11lazybot⇒ ([0 clojure.lang.PersistentArrayMap] [1 clojure.lang.PersistentArrayMap] [2 clojure.lang.PersistentArrayMap] [3 clojure.lang.PersistentArrayMap] [4 clojure.lang.PersistentArrayMap] [5 clojure.lang.PersistentArrayMap] [6 clojure.lang.PersistentArrayMap] [7 clojure.la... https://refheap.com/paste/2258
14:12jajuamalloy: Yes - curiosity.
14:12mmarczykjaju: how do you go about creating it?
14:12jajuAlright - I use the literal syntax {...}
14:12ben_m&(doc juxt)
14:12lazybot⇒ ------------------------- clojure.core/juxt ([f] [f g] [f g h] [f g h & fs]) Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of apply... https://refheap.com/paste/2259
14:12jajuwhich gives me the hashed version
14:12mmarczykjaju: and you're on the JVM Clojure?
14:13jajuyes
14:13mmarczyk&(class {})
14:13lazybot⇒ clojure.lang.PersistentArrayMap
14:13mmarczyk^- not so for you? which version of Clojure?
14:13jajuInteresting. I'm on 1.4.0
14:13jaju&(class {:a :A :b B})
14:13lazybotjava.lang.RuntimeException: Unable to resolve symbol: B in this context
14:14jaju&(class {:a :A :b :B})
14:14lazybot⇒ clojure.lang.PersistentArrayMap
14:14mmarczyksame here, and I definitely get array maps for small literals
14:14jajustrange. I get that as a PHM in my REPL.
14:14jajuLet me check again!
14:15mmarczykoh, automatic refheap paste -- neat :-)
14:15jajuok - here's what I am doing. (def m {:a :A :b :B})
14:15jajunow - (class m) says hash-map
14:15mmarczykwow
14:15jajubut (class {:a :A :b :B}) is array-map
14:16jaju<aside> yes, that refheap paste is neat!
14:16mmarczykit's been the same in 1.3.0, but not 1.2.1
14:17jajuThe (def m {}) thing gives me a hash-map. Is it the def doing something differently?
14:17jajuthis is getting stranger
14:18jaju(def m {}) -> (class m) is array-map [note: empty map]
14:18mindbender1is it possible to customize the behavior of the compile fn in clojure
14:18jajuone key-val pair, and the class is now a hash-map.
14:19RickInGAI saw taht the cljs compiler has a :target option, which you can set to node.js what does the target do? include differen libraries?
14:20mindbender1gen-class is generating class files that override public final classes which I don't think is correct behavior and java complains when I try to instantiate the generated class
14:21mindbender1*public final methods
14:22RickInGAnm, found it
14:23jaju(repeating - to have it all in one place) - I'm using clojure 1.4.0. (class {}) => PersistentArrayMap. (def m {}) (class m) => PersistentArrayMap. (def m {:a :A}) (class m) => PersistentHashMap. Can someone help in understanding this?
14:23gfredericksjaju: there are different underlying implementations for clojure maps
14:24jaju&(do (def m {:a :A}) (class m))
14:24lazybotjava.lang.SecurityException: You tripped the alarm! def is bad!
14:24gfredericksdoes this make a difference to you or are you just curious?
14:25jajuI'm curious. I know there are different underlying implementations. In fact, all I'm doing is looking at all the underlying Java code and playing at the REPL to understand the internals better.
14:25gfredericksI don't know the details of why you'd get a hashmap for a singleton map
14:25gfredericksI'm sure that all empty maps though are identical
14:26gfredericksso they're pointing to some constant declared in one of the classes
14:26gfredericks&(identical? {} {})
14:26lazybot⇒ true
14:26technomancyit's bizarre that whether a map is stored in a var or not affects the underlying class
14:26gfredericksoh is that what's going on
14:26technomancyI thought the size of the map was the only factor that was considered
14:26gfredericks&(map type [{} {:a 'b}])
14:26lazybot⇒ (clojure.lang.PersistentArrayMap clojure.lang.PersistentArrayMap)
14:26gfredericksoh you're right
14:27technomancynot that it matters in any way; it's just really weird
14:27jajuNot really. (def m {}) (class m) -> array-map
14:27gfredericks&(identical? {} (dissoc {:a 'b} :a))
14:27lazybot⇒ false
14:29jajuactually, I need an insertion-ordered map. So, I started exploring the Java code to see what exists and if I could add another impl.
14:30jajuWhen I ran into this observation.
14:30wkmanireibdknox: (defn parse-address [line] (zipmap [:name :address1 :address2 :city :state :zip] (split line #",")))
14:30wkmanire
14:30wkmanireibdknox: Awesome advice. That is about a 1000% better.
14:31ibdknoxif you move the fields into a def you can use those for your ordering later too :)
14:31gfredericksjaju: I assume you've also found the ordered map?
14:31mmarczykjaju: https://github.com/flatland/ordered for that, as discussed previously, with the caveats discussioned previously
14:31gfredericksoh wait insertion-ordered
14:31gfredericksI fell for that again
14:31gfredericksI think flatland has a lib for that
14:31gfredericksjaju: https://github.com/flatland/ordered
14:32ibdknoxlol
14:32mmarczykjaju: see http://clojure-log.n01se.net/ for the log if you've just joined
14:32mmarczykgfredericks: just linked to that :-P
14:32gfredericksBAH
14:32jajugfredericks, mmarczyk: I'll check those links. Thanks!
14:32mmarczyknp
14:32ibdknoxmmarczyk: gfredericks: just found this, might be of interest https://github.com/flatland/ordered
14:32ibdknox;)
14:32gfredericks:P
14:32mmarczykibdknox: oh great, lemme see
14:32mmarczyk:-P
14:32mmarczykgfredericks: not at all, it's good to reinforce some points ;-P
14:33cemerickRickInGA: cool, didn't know they were promoting it already :-)
14:33wkmanireibdknox: https://refheap.com/paste/2260
14:33RickInGAcemerick: don't know if they are promoting it, I saw a tweet from someone who signed up for it.
14:34RickInGAso they had to hear about it somehow, I suppose :)
14:34ibdknoxRickInGA: promoting what?
14:34wkmanireMan, I'm having so much fun with this. I don't want to go back to VB.Net land for the rest of the day. :(
14:34cemerickdnolen: Thanks :-) I hope you enjoy it!
14:34mmarczykjaju: I'm trying to git bisect the array map thing, but git is refusing to cooperate atm :-(
14:34cemerickibdknox: http://oreillynet.com/pub/e/2273
14:35ibdknoxOMG CEMERICK IS COMING TO SF!!!
14:35ibdknox:D
14:35ibdknoxhow long you going to be in town?
14:35RickInGAI would relink to it on my feed, but I just liked LT, and I want to spread out my propagandizing
14:35cemerickibdknox: heh, no, I'm still in MA; doing it remotely
14:35ibdknoxaw
14:36cemerickI don't know when I'll be back on the west coast
14:36Raynescemerick: I want you close to me.
14:36RaynesSo close.
14:36technomancycemerick: looks cool. is that interactive or broadcast?
14:36ibdknoxlol
14:36cemericktechnomancy: Interactive. Should be Q&A and such too.
14:36technomancynice
14:36ibdknoxooo
14:36ibdknoxso I can heckle
14:37jajummarczyk: Oh, I definitely wasn't expecting such instantaneous action! :D Thanks, and maybe, something that I'd also want to fix myself to learn more if this really is an issue!
14:37RickInGAif we are still using clojure then. I am reading all about how clojure sequences suck on twitter. Oh, and someone linked an article yesterday from 2009 about Clojure being a bad lisp.
14:37RickInGAI think I am going to go back to FoxPro
14:38ibdknoxRickInGA: I would. Fox had it right.
14:38technomancythey should have gotten Fox Mulder for celebrity endorsement
14:38technomancymissed opportunity
14:38mmarczykjaju: no worries, not having much success with the bisect anyway
14:39ibdknoxtechnomancy: I thought MSFT bought fox software before that show existed
14:39wkmanireIs there a way to refer to the args of a function as a collection?
14:39wkmanireSimilar to javascript's arguments variable.
14:39ibdknoxMy mom worked for Fox :)
14:39technomancyno kidding
14:39gfredericks(fn [[a b & cs :as arguments]] ...)
14:39technomancyI thought they kept the name though
14:39gfrederickswait no
14:39gfredericks(fn [& [a b & cs :as arguments]] ...)
14:39ibdknoxyeah, turned it into Fox Pro and gutted the engine to put into SQL
14:40RickInGAibdknox is it true that the query optimizer was called "Rushmore" because a bunch of people from the company liked the movie North By North West?
14:40gfrederickswkmanire: ^ that should work, but I think it precludes your function having fixed arity
14:40ibdknoxthe technology was called rushmore
14:40wkmaniregfredericks: I see. not quite what I was looking for.
14:40jajummarczyk: Is it worthy of being reported as a bug? (It's not a bug in the real sense of the word - but definitely does not follow the intended behavior as well - right?)
14:40ibdknoxRickInGA: lol I never asked. I could ask my mother and see if she remembers
14:40wkmanireI'll just retype the args. he he he, no need for me to get clever with it.
14:40fdaoudcemerick: amazon canada delayed your book for the Nth time so I gave up, canceled my order, and got the ebook direct from o'reilly.
14:40technomancyit's funny that "SQL Server" is actually a trademarkable name
14:40wkmaniretechnomancy: Agreed.
14:41cemerickfdaoud: Weird.
14:41jajummarczyk: Reporting a bug technically allows me to try and fix it and an opportunity to submit code! :)
14:41mmarczykjaju: I'd say so, as minor priority defect, I guess
14:41wkmaniretechnomancy: Especially considering that M$ SQL Server doesn't actually serve SQL.
14:41mmarczykjaju: reason enough to me :-)
14:41technomancywkmanire: heh; never thought of it that way
14:41jajummarczyk: Cool - Thanks! :)
14:41mmarczyk:-)
14:42cemerickibdknox: I'll let the organizer know to mute your feed. ;-)
14:42cemerickoh, I guess it'll be text-based anyway, right
14:42ibdknoxdamn
14:42ibdknoxfoiled again
14:43jweissi'm looking at trying to make a clojure library java compatible (not originally designed to be java compatible). Looks like my functions that take maps are in trouble because I can't substitute java.util.Map. For isntance, keyword lookups only work in IPersistentMap. is there a reason for this? is there a way around it?
14:43wkmanireAlright folks. Time to go earn money :( I hope I'll have time to get back to this today.
14:44gfredericksjweiss: would the Maps coming in have keyword-keys anyhow?
14:44technomancygfredericks: clojure.walk/keywordize-keys might work on j.u.Map
14:44fdaoud10 AM pacific time? I thought nobody on the west coast got up before noon.
14:44gfrederickstechnomancy: and if it did you'd get a clojure map back maybe? solving both problems?
14:45jweissgfredericks: hm, doesn't destructuring sort of depend on kw's
14:45gfredericksyou mean {:keys [...]}?
14:45noidijweiss, maybe you could use records instead of maps in your app, and make the records implement an interface that the java API could use?
14:45technomancygfredericks: actually no, this is crazy
14:45jweissgfredericks: yeah {:keys [...]}
14:45fdaoudivan: pm ?
14:45technomancygfredericks: (clojure.walk/keywordize-keys (doto (java.util.HashMap.) (.put "hello" 12))) ; -> #<HashMap {hello=12}>
14:45technomancyit's a no-op
14:45ivanfdaoud: hah
14:46gfredericksjweiss: :strs works too
14:46gfredericksfor string keys
14:46technomancythat's crazy
14:46jweissgfredericks: ok so if i used a Map with string keys, i could still destructure it?
14:46fdaoudcemerick: do you know if these things are recorded and reposted?
14:46gfredericksjweiss: I believe so
14:47cemerickfdaoud: I believe so, yes. I'll be recording too, just in case.
14:47mmarczyk&(let [{:keys [foo]} (doto (java.util.HashMap.) (.put :foo 1))] foo)
14:47lazybot⇒ 1
14:47fdaoudcemerick: cool, thanks.
14:47mmarczyk&( :foo (doto (java.util.HashMap.) (.put :foo 1)))
14:47lazybot⇒ 1
14:48mmarczyk&(get (doto (java.util.HashMap.) (.put :foo 1)) :foo)
14:48lazybot⇒ 1
14:48mmarczykjweiss: apparently everything works in 1.4
15:04metajackIs there some reason that for would mess with dynamic bindings? If i do (binding [x y] (some-fn)) then the binding is there. if i put somefun inside a for, it disappears.
15:06zamaterianmetajack, returns a lazy-seq
15:07metajackoh duh
15:07metajackthat explains a lot about the last 30 minutes ;)
15:08achinIs there a function/macro already defined that'll create a map from a list of values and associate each value to a keyword created from the value's name? e.g. (foo a b c) => {:a a, :b b, :c c}
15:08timvisherhow do you defend yourself from the old definition of a renamed function allowing your tests to pass in a running slime session?
15:10technomancytimvisher: you run tests with a fresh JVM before you push
15:10timvisherlol
15:10timvisherok, what i was doing already. :)
15:10amalloytimvisher: also i think if you use ritz, its swank/slime thingy clears old vars when you recompile
15:10timvisheri usually just re-run jack in every once and awhile to be sure
15:10technomancyamalloy: actually that's in swank 1.5.0-SNAPSHOT too
15:11timvisherhaven't heard of ritz
15:11timvishertechnomancy: are you saying that the behavior i'm looking for exists in a later swank?
15:12noidiachin, maybe this could help http://permalink.gmane.org/gmane.comp.java.clojure.user/20310
15:12technomancytimvisher: yeah, when you do C-c C-l rather than C-c C-k
15:12technomancyit forces a reload-all too
15:12timvisherinteresting
15:13timvisheris that public yet?
15:13njdirkthx 2all for assist
15:13technomancysure
15:14timvisherhmm, C-c C-l = slime-load-file?
15:14timvisherthere's no bot that yells at me for infix?
15:14technomancyja
15:14timvisherah, awesome
15:16timvishertechnomancy: that's fantastic. no idea that load-file forced a full reload. thank you!
15:16technomancythe secrets of swank
15:16timvisheryeah, that whole infinite spiral learning curve thingamaijg ;)
15:17mmarczyktechnomancy: incidentally -- is it usual and expected that swank silences pretty much all exceptions ("; Evaluation aborted" & next prompt)?
15:18mmarczykwell, maybe not all... some. no idea what's the rule. I've only recently started to feel moderately bothered.
15:18technomancymmarczyk: that usually points to a bug in clj-stacktrace
15:18technomancybut I haven't seen it since clj-stacktrace 0.2.4 was released
15:18mmarczyk(also, I'm using multiple versions -- anything post 1.3 refuses to work with my custom setup for M-x slime and I'm too lazy to investigate)
15:18mmarczyktechnomancy: oh good, thanks -- I'll check that
15:22patchworkWith lein2, where are class files put?
15:22patchworkThey don't seem to be anywhere in the project dir
15:23gfredericksShould clj-http be setting :query-string to "" (rather than nil) if :query-params is an empty map?
15:24gfredericksit kind of screws up clj-http-fake
15:32dakronegfredericks: setting :query-string to "" isn't harmful from the perspective of an actual request, it seems like something that should be fixed in clj-http-fake
15:33gfredericksdakrone: that sounds totally reasonable; I've already forked it so I can do that too
15:37jsabeaudry,java.util.Arrays/fill
15:38jsabeaudryIs that the proper way to write it?
15:39gfredericksjsabeaudry: well it doesn't mean anything unless it's being used at the front of a list, I believe
15:39gfredericks&java.util.Arrays/fill
15:39lazybotjava.lang.RuntimeException: Unable to find static field: fill in class java.util.Arrays
15:41jsabeaudrygfredericks, ah yes, i was getting a no matching method but thats because my parameters were not right, thanks
15:41gfredericksyeah that's usually the issue :/
15:45dabdi'm trying (MessageFormat/format "{0,number,percent}" 0.125) but i get java.lang.Double cannot be cast to [Ljava.lang.Object;
15:45dabdthe documentation shows format arg should be on Object how can i invoke this method from clojure?
15:46dabdMessageFormat comes from java.text namespace
15:47joegallodabd -- you need to put that Double into an array of Object.
15:48dabdjoegallo: this works (MessageFormat/format "{0,number,percent}" (to-array [0.125]))
15:48joegallookay, excellent.
15:48dabdbut i get 12% it looses the decimal points
15:49joxerBronsa
15:49joegalloi think that's a java question at the point then :)
15:49joegallos/the/that/
15:50dabdjoegallo: true thx!
15:50joegallowhich is not to be snide -- just that i don't happen to know. :)
15:51gozalaanyone can help me with https://gist.github.com/2431249#comments
15:53gozalaProbably I miss something obvious, but I don't know what
15:55mmarczykgozala: you don't have to use IMeta to get at the state -- (.-state deferred)
15:56gozalammarczyk: ok so type arguments are just stored as own properties ?
15:56mmarczykgozala: you'll want to (reset! state {:done true :value value}) or (swap! state assoc :done true :value value) in -realize
15:56mmarczykgozala: yes
15:57charles_rAnyone know how to do color themes in emacs?
15:57gozalammarczyk: thanks
15:57mmarczykgozala: (swap! state @state {:done true :value value}) changes the of state to be the result of applying the old value to the map {:done true :value value}
15:58mmarczykgozala: the old value will be {:done false} -- a map -- a map, when applied as a function to an argument, looks the argument up in itself
15:58mmarczykgozala: as a key, that is: ({:foo 1} :foo) => 1
15:59gozalammarczyk: I see
15:59mmarczykgozala: here it doesn't find {:done true :value value} to be a key in itself, so it returns the default: nil
15:59gozalabut why the hell it ends up with
15:59gozala{:done true, :value undefined }
16:02mmarczykgozala: ah, sorry, got mixed up a bit
16:02tuxitevening all
16:02tuxitwhat do people use for editing clojure code ?
16:02mmarczykgozala: what will happen is that the original state -- {:done false} -- will get applied to two arguments
16:03tuxitis there an eclipse plugin or an emacs mode
16:03mmarczykgozala: the original state of {:done false} and {:done true :value value}
16:03ivanthere's an Eclipse plugin and an Emacs mode and an IntelliJ plugin
16:03charles_rtuxit: I'm using swank/emacs
16:03charles_rhttps://github.com/technomancy/swank-clojure
16:04tuxitoooh thx enough choice then
16:04mmarczykgozala: so actually one would expect it to swap in {:done true :value value}, cause the second argument is the not-found default
16:04mmarczykgozala: so basically it should work
16:05gozalammarczyk: either way I was clearly misuseing swap
16:05mmarczykgozala: I'll give it a closer look (you should still probably switch to reset! or swap! as given above)
16:05gozalayeah I'll do that
16:05ja_hello
16:05gozalaI sat swap was taking previos value next value
16:05gozalai thought*
16:06gozalammarczyk: may I ask you one more thing
16:06mmarczykgozala: it's not compare and swap :-)
16:06gozalaI'm trying to implement promises for cljs
16:06mmarczyksure
16:07mmarczykgozala: actually this sort of atom manipulation works for me in Rhino -- what environment are you executing this in?
16:07gozalain rhino as well
16:07gozalastrange
16:07gozalait works if I do just swap on atom
16:07gozalabut it does not when called as method -realize
16:08mmarczykgot it
16:08gozalaso I thought maybe somehow value was not captured
16:08gozalaby if-not expression
16:09gozalammarczyk: I get same issue with reset as well
16:10mmarczykto me it complains that there's no -realize method defined for this object type
16:10mmarczykcool
16:10mmarczyklet's see if there's a trivial fix for that
16:11gozalammarczyk: probably we run diff version of cljs
16:11mmarczykgozala: oh that's for sure
16:11gozalacause exact code from gist works for me
16:12mmarczykgozala: I'm actually running this in a branch where I'm working on some other code
16:12mmarczykgozala: can't see how it'd break things, but...
16:12mmarczykgozala: which version are you using?
16:12gozalaI was using latest from master
16:12gozalawhich may not be latest now
16:12gozalalet me pull in lasest and retry
16:12mmarczykcould you check the sha?
16:12mmarczykoh, ok
16:13gozalaI'm on afd21fb147f88789bfe20a98a36ab55d475c65ac
16:13gottfriedhow to compute ack(4,2) in clojure
16:14gozalanow I'm on latest
16:14gozala27e0bc8f2e27d599690cbe1444530af66cb676c9
16:15gozalammarczyk: ok now I get same error as you do
16:21mfexhi all, any suggestions on what to do when emacs ends up in the debugger for the slime repl when loading some xml?
16:23gozalammarczyk: is there something wrong with the code
16:23gozalawhy would not it implement IDeferred
16:24mmarczykgozala: I must say I've no idea
16:25gozala:)
16:26mmarczykgozala: I'll try to find out, though if this takes more than a couple of minutes, I'll have to postpone it until a bit later -- in which case I'll comment on the Gist if I have relevant info
16:26gozalammarczyk: thanks a lot
16:27mmarczyknot at all
16:27mmarczykthis is really weird
16:28dnolengozala: promises don't make much sense in CLJS IMO
16:28dnolengozala: at least not the ones in Clojure on the JVM
16:28gozaladnolen: why not ?
16:28gozaladnolen: no I'm doing ones like in js
16:29dnolengozala: k, yes that's different.
16:29gozaladnolen: I prototyped my idea in js first
16:30gozalahttps://github.com/Gozala/eventual/blob/master/core.js
16:30gozalaand now I'm trying to port it to cljs
16:30pjstadig~suddenly
16:30clojurebotCLABANGO!
16:31gozalaidea is that you can make operations on eventual values same way as on regular values with a difference that they produce promise for those values rather than actual values
16:32gozaladnolen: This basically what I'd like to get https://github.com/Gozala/eventual/blob/master/tests/test-all.js#L69-88
16:32technomancyclojurebot: we missed you! ♥
16:32clojurebotIt's greek to me.
16:32gozalaif it's a bad idea I'd be better off knowing it now :)
16:32technomancyoops, I forgot robots do not understand emotions
16:33hiredman~clojurebot
16:33clojurebotclojurebot is a multimap
16:33hiredman~clojurebot
16:33clojurebotclojurebot is not very good at indicating the difference between a return value and an exception
16:33dnolengozala: so you're overloading valueOf to allow your promises to flow through?
16:34gozaladnolen: sort of that yeah
16:34gozalaIn js you cant really do by overriding valueOf
16:35gozalaas you have operations like + - etc
16:35dnolengozala: yeah - so what happens with console.log(promise + 1 + 2) ?
16:35gozala[ object Object ]12 :)
16:35gozalayou have to wrap your functions
16:35gozalahttps://github.com/Gozala/eventual/blob/master/tests/test-all.js#L16
16:36gozaladnolen: for example
16:36gozalasum = eventual(function(a, b) { return a + b })
16:36gozalaconsole.log = eventual(console.log)
16:36gozalaconsole.log(sum(promise, 2))
16:36gozala-> 3
16:37mmarczykgozala: oh man
16:37gozalaif deliver(promise, 1)
16:37mmarczykgozala: (defprotocol IDeferred (-realize [this value]))
16:37mmarczykgozala: note the this
16:37mmarczykgozala: apparently I'm getting tired
16:37gozalammarczyk: oops !
16:38gozalammarczyk: I'm sorry I thought this was implied
16:38mmarczykgozala: nope
16:38mmarczykgozala: no worries though, should have payed attention :-)
16:39mmarczykwait, did I say "payed"
16:39mmarczykdefinitely getting tired.
16:40gozaladnolen: so it's kind of reactor pattern
16:40gozalabut I figured in cljs you could take it much further
16:40gozalaas you could implement most of the standard stuff useing protocols
16:40gozalaso that
16:41gozala(+ promiseFor1 promiseFor5) -> promiseFor6
16:41dnolengozala: interesting - I tried something similar years ago in JS
16:41gozaladnolen: I think it may have value on node.cljs
16:41Raynesmmarczyk: I'll take 5 attentions. PAY ME
16:42dnolengozala: I felt (at least my attempt) it was only slightly better than callbacks.
16:42dnolengozala: how are you going to handle errors?
16:42gozaladnolen: I think you might want to take a look at
16:42gozalahttp://jeditoolkit.com/2012/04/26/code-logic-not-mechanics.html#post
16:42gozalaI write why this is much better than callbacks
16:43gozaladnolen: erros propagate through the promise chain
16:43gozalaso for example if promise a was rejected
16:43mmarczykRaynes: man, I'm paying, like, all the time -- you want more!? -- talk about extortion
16:43gozalaall the computations of it will be rejected with the same error
16:44dnolengozala: errors flowing through stink - what about provenance?
16:44dnolengozala: think Infinity and NaN - that's why they suck
16:45gozaladnolen: not sure I follow
16:45gfredericksgozala: makes it hard to figure out where the error started?
16:45dnolengozala: how can you determine the exact location where the error was generated.
16:45gozaladnolen: well you handle errors where it makes sense and is relevant
16:46gfrederickshandling them is different from determining where they started while debugging
16:46gozalaalso you can use same stack traces as you would with callbacks
16:46gozalano better no worse
16:46dnolengozala: again think about Infinity and NaN errors in JS - why allow poisonous values at all?
16:46gozalaif you need to include more info you could rewrap promises to include more data
16:46gozalawith errors
16:46dnolengozala: again the system I built was nearly identical to yours - poisonous errors are no fun.
16:47gozalaI'm not sure what are the problems with NaN and Infinity
16:48dnolengozala: you don't know who created them, you only see the results
16:48gozaladnolen: that's in fact ocaps
16:48dnolengozala: ocaps?
16:48gozalawell allows you to build object capability model around that
16:49gozaladnolen: all these concepts are from E language
16:49gozalathey are not my brain child
16:50dnolengozala: are you saying you don't see a problem with NaN or Infinty behavior in JS?
16:51gozaladnolen: I see many problems in JS but not sure how that relates to promises
16:51gfredericksgozala: the stack trace with NaN/etc doesn't take effect until the perverse number conflicts with something somewhere
16:51gfredericksso it tells you when the number became a problem but not where it came from
16:52dnolengozala: if a promise becomes an error and I forgot to check for it, how do I find who created it in your system?
16:52gozaladnolen: let's take a step back for the moment
16:52gozalaidea is that if you write sum(a, b) you want to get a + b
16:53gozalaif one of those values are eventual
16:53gozalayou mean something like this
16:53gozalain js
16:53gozalasum (a, b, function( c) { …. } )
16:54gozalawhat this system does is that it returs you c
16:54gozalaon which you can set up a listener
16:54gozalainstead of passing it directly
16:54gozalaif sum throws exception than that's error listener is called with that exception
16:55gozalanow this allows you to sum(c, x) without doing it in callback
16:55TimMcgozala: What if I do (+ a b) where a is an integer and b is eventual? Then a gets to decide, and BOOM.
16:55mmarczykcondition systems are the bee's knees
16:55TimMchmm
16:55gozalaif one of the arguments is eventual
16:56gozalayou get back eventual for the operation that will be performed eventually
16:56gozalaif one of the eventuals boomed
16:56gozalathan error will propagate to your resulting computation
16:56gozalasame way as exceptions propagate
16:57gozalathis solves just an expression problem nothing else
16:57TimMcMaybe I misunderstand what you are proposing. If + is a protocol, it pdispatches on first arg...
16:57TimMcOr would you replace +, etc.
16:57RickInGArealizing that a good subtitle for my blog would be 'the blind leading the blind' I thought I should see if anyone was willing to fact check my hello world cljs post before I posted it. http://dl.dropbox.com/u/54389223/post.html
16:58gozalaTimMc: that's something I have to learn about I guess
16:58gozalaIn js I just wrap functions
16:58dnolengozala: yes but there still a problem with locating the error right? you get the bad operation - but the not location where the operations where composed right?
16:58gozalaso instead of using sum you would use eventual(sum)
16:59TimMcI see.
16:59gozaladnolen: if operation threw exception than you get a stack
16:59gozalaif operation did not threw exception than probably function is broken
17:00gozalaif function can't handle value it should reject it
17:00gozaladnolen: How would a callback be any different here
17:01gozalaif you do sum(Nan, 3, callback)
17:01technomancyRickInGA: you should never have to run "lein deps" by hand
17:01gozalayou'll get same broken value in callback
17:02dnolengozala: what I mean is this
17:02RickInGAtechnomancy: really? I had no idea
17:03dnolenf(e, 1) -> e', f(e', 2) -> e''
17:03technomancyRickInGA: it's been that way for ages, but habits are hard to break
17:03dnolensay all that composes, since e isn't resolved yet.
17:03gozalaok
17:04dnolenthen when e resolves and fails, does the call stack make any sense?
17:04gozalayou mean e''
17:04dnolenno e'' can't resolve w/o e
17:04gozalaif e is rejected if e'' makes sense
17:05dnolengozala: if nothing blocks and eventuals always produce eventuals - e'' depends on the resolution of e' and e' on e
17:05gozalaso rejector of `e` rejects it with an error
17:05gozalait's the one deciding what the error is like
17:06gozaladnolen: exactly
17:06dnolengozala: yes, but when I see the error will it make sense? is it easy to decipher that it was e that failed?
17:06dnolenand not e', and not e''
17:06RickInGAtechnomancy: what do you use? lein search?
17:07gozaladnolen: It all depends on error I guess
17:07technomancyRickInGA: what do I use for which?
17:07gozalaif youre asking if more stack traces are adde on the way
17:07RickInGAfor pulling in dependencies.
17:07gozalathey don't but it's easy to add
17:07technomancyRickInGA: I don't understand
17:07dnolengozala: in anycase, I'm just saying I tried this. I didn't like it. But I'm curious where you go w/ it.
17:07RickInGAyou said that I should not call lein deps
17:08gozaladnolen: have you used Q or dojo deferreds ?
17:08gfredericksRickInGA: I imagine the other commands call it
17:08dnolengozala: no I wrote my own thing similar to yours where fns were decorated to produce eventuals if they received them.
17:08gfredericksRickInGA: so you don't have to call in deps explicitly
17:09gozaladnolen: Also I wrote streams on top of this
17:09gozalawhere element is a promise that resolves to head, tail
17:09technomancyif you want to build a jar, call lein jar; if you want a repl, call lein repl
17:09gozalatail being another promise
17:10gozaladnolen: anyway I'll write about this once I'll get it somewhere
17:10gozaladnolen: Also errors in async code is just panful because event queue cuts the stack traces
17:11gozalameaning that your example would have same issues if you were doing it with callbacks
17:11gozalait's just you would be forced to do error handling on each step
17:12dnolengozala: I'm more curious these days about approaching this problem w/ good CPS transforms
17:12dnolengozala: that's interesting about streams, have you looked at RxJS?
17:13RickInGAtechnomancy: the instructions on the lein-cljsbuild readme say to add :plugins lein-cljsbuild "0.1.8" to project.clj , then lein deps to install the plugin, then configure the build options, and use lein cljsbuild once (or auto) to compile… should I install cljsbuild with lein plugin-install lein-cljsbuild instead?
17:13technomancyRickInGA: no, if your project can't build without lein-cljsbuild then it must be in the :plugins declaration in project.clj
17:14RickInGAtechnomancy: so I add it to plugins, then will lein cljsbuild once install the plugin for me?
17:14technomancyyeah
17:14RickInGAtechnomancy cool, I will try that
17:14technomancyI mean, if it doesn't then it's a bug in Leiningen
17:16technomancyif anyone's looking for a learning hack project, I have a great one
17:16technomancyit's a proxy that turns github issues into a git repository full of static files
17:16technomancyprobably yaml or something
17:17technomancywould let you work with issues as conveniently as github wikis
17:18RickInGAtechnomancy: thanks for information… lein cljsbuild once pulled in the plugins just like you said it would
17:18technomancycool
17:18RickInGAI will update that in my instructions
17:22gozaladnolen: do you have a link I can just find https://github.com/Reactive-Extensions/rxjs-node
17:23gozalabut it's not very informative
17:23gozaladnolen: my streams are very similar to lamina
17:23gozalahttps://github.com/Gozala/streamer/wiki/stream
17:24dnolengozala: http://codebetter.com/matthewpodwysocki/, lot of content, I met him at JSConf, nice guy, working on porting Rx from C# (?) to JS
17:24gozaladnolen: and they have clojure seek like API
17:24gozalahttps://github.com/Gozala/streamer/blob/experimental/promise/core.js#L480
17:25gozalaBTW in long term I actually want to implement seek or ISeeq API for eventual streams
17:25gozaladon't remember actual protocol name
17:25gozaladnolen: also regarding error handling I forgot to mention that it has recovery scheme
17:26gozalap2 = p1.then(map, recover)
17:26gozalaso you could handle errors as you need and recover from them
17:26gozalaor add more info and propagate if you need to
17:26dnolengozala: interesting stuff. you should definitely look into Rx, there was some talk at some point in making lamina more Rx like and stuartsierra's cljque
17:27dnolenwork was interesting along those liens
17:27gozaladnolen: I'll take look, thanks for pointers
17:32gozaladnolen: BTW microsoft also went with promises for Windows8 js APIs
17:32gozalahttp://msdn.microsoft.com/en-us/library/windows/apps/hh700330.aspx
17:46neotykdnolen: if you could take a look at http://dev.clojure.org/jira/browse/CLJS-35 , I've updated a patch in it
17:46SimmonsHi Newbie question but could someone point me to an explanaition of what #' does in the following example (run-jetty #'app {:port 8080}). I know it is something to do with var but I don't quite understand it. Many thanks
17:48dnolenneotyk: thanks! will give it a shot in a bit.
17:48technomancySimmons: it passes the var app to run-jetty rather than the function itself
17:48technomancySimmons: which means it will pick up changes when it's recompiled
17:50Simmonstechnomancy: So is it a little bit like a pointer in C (maybe a very bad analogy)?
17:50technomancyit's an additional layer of indirection
17:52Simmonstechnomancy: Thank you for your help. I don't suppose you have any idea whre I might find a more detailed explanaition of this feature?
17:54technomancymark volkmann's introduction probably covers it
17:55Simmonstechnomany - many thanks.
17:55neotykdnolen: thanks!
17:57muhoois anyone deploying clojure/noir apps on appengine?
17:57muhooi.e. is that even worth trying, and are there any gotchas involved?
17:57emezeskemuhoo: I am working on such an app, but I haven't deployed to the real appengine yet (I've just used local testing)
17:58emezeskemuhoo: It's very worth trying; appengine-magic is pretty sweet
17:58muhooemezeske: are you using lein jetty for your local testing, or are you wrapping a war in google's appengine sdk to run it locally?
17:59emezeskemuhoo: Look at appengine-magic, it takes care of all that
17:59muhoook
17:59emezeskeIt's just a clj wrapper on top of the Java API, which some convenience built in.
18:00muhoothis? looks very cool indeed, thanks: https://github.com/gcv/appengine-magic
18:00emezeskeThat would be it
18:01dnolenneotyk: small bug - can you rm -rf closure if it exists? otherwise you get SVN errors.
18:02neotykdnolen: it should update, oh wait, you had it bootstrapped before?
18:02dnolenneotyk: yep
18:02dnolenneotyk: most folks will have.
18:03neotykdnolen: I will cleanup before checking out
18:03dnolenneotyk: thx, once that's sorted I'll happily apply and push to master.
18:04dnolenneotyk: please add a new patch to JIRA.
18:04neotykdnolen: will ping you once it is there
18:23squeaky_plHello. I hate you. You ruined my world. I always believed Python is the most elegant language out there. Now I need to rewrite everything in Clojure :-)
18:24bhenryibdknox: can you immediately see what's wrong here? i've been fighting for far too long. https://gist.github.com/a9bed362b99ccbac398c
18:24bhenryi have other remotes that work, but this one is being a jerk
18:25ibdknoxbhenry: asynchrony
18:25ibdknoxcan't get away from the callbacks I'm afraid
18:26bhenryaha.
18:27ibdknoxbhenry: so what I do is I usually treat remotes as functions that are actually on the client and use letrem
18:27ibdknoxso in your case instead of having a get-user
18:28ibdknoxI would just call (user) whenever I need it
18:28ibdknox(letrem [me (user)] (js/alert (:username me)))
18:30bhenryawesome. thanks
18:39austinhI am really enjoying "Clojure Programming." It's quickly answering a lot of the questions I had after the Volkmann tutorial.
18:40austinhI'm very happy that I could buy a downloadable PDF.
18:43Licenserwhat is the way to go of cljs browser development until we get Light Table?
18:44xeqiI've heard good things about lein-cljsbuild
18:45Licenserxeqi it does reply stuff?
18:45xeqihttps://github.com/emezeske/lein-cljsbuild/blob/0.1.8/doc/REPL.md
18:45xeqilike that?
18:46xeqiI've not used it, just see it mentioned positively alot
18:47ibdknoxlein-cljsbuild or noir-cljs
18:47ibdknoxcljs-template will get you up and running quickly
18:48Licenserwhile I like noir it is not my thing now, my backend is not clojure but erlang
18:49Licenseribdknox you made some kind of ui stiff for cljs right?
18:49ibdknoxwhat kind of UI?
18:49ibdknoxmonet = canvas
18:49ibdknoxcrate = hiccup for cljs
18:49Licenseribdknox thanks :)
18:50mmarczykmonet for canvas
18:50mmarczykI love your library names
18:51yoklov^
18:54yoklovmonet's pretty nice, but its more than i really need/want for most stuff, and it doesnt really help the path api is still somewhat awkward with it (in general the path api requires lots of repetetive code)
18:56yoklovi think theres a spot open for a cljs canvas library that generates lots of that awkward canvas code for you
18:58ibdknoxyoklov: I would be more than happy to take some changes/additions/happiness to monet to fit those needs too :)
18:58@rhickeydnolen: ping
18:58dnolenrhickey: hullo
18:58@rhickeyphmap looks very cool, one quick question
18:58@rhickeyI saw this ObjMap DEPRECATED
18:59neotykdnolen: cljs-35 updated
18:59@rhickeybut ObjMap is a pretty important optimization
18:59@rhickeythe entire design of symbols and keywords is there to support it
18:59dnolenrhickey: we could keep it, though it seemed hard to find a scenario where it's any faster than PHM
19:00dnolenrhickey: are you concerned about size here?
19:00@rhickeyno, it is an Object, and its keys are object keys, subject to tons of optimizations
19:01@rhickeyso if you are testing assoc perf you are missingthe point
19:01gozaladnolen: I looked into rx it's very similar to what I'v being doing with streamer and would like to port to cljs
19:01@rhickeylookups should be much, much faster
19:01@rhickeyesp given literal maps
19:02Licenseribdknox cljs-template seems not to work correctly, lein2-preview3 seems not to find
19:02kennethhey, how do you merge two sequences (lazily)
19:02mmarczykrhickey: http://jsperf.com/cljs-persistent-hash-map-access
19:02kennethlike merge, but for seq
19:02gfrederickskenneth: concat?
19:03ibdknoxLicenser: I think you still need to download it
19:03Licenserah because the readme said it does not need it
19:03mmarczykrhickey: admittedly there may be something the matter with my testing methodology
19:03dnolenrhickey: we benched access times, but perhaps we should try more cases.
19:03ibdknoxLicenser: took that as a pull request and haven't switched to lein2 yet
19:03Licenserah :)
19:03dnolenrhickey: ibdknox also tried on a project with many smalls maps and he didn't see much diff in perf.
19:04dnolenrhickey: that said I understand your reservations.
19:04dnolenrhickey: should we keep ObjMap for maps of a certain size?
19:04mmarczykrhickey: I also have a working patch whereby ObjMaps get created for small maps w/ string keys and switch at some threshold
19:05@rhickeyYour use cases may be too dynamic to see the differences, but e.g. v8 will actually compile classes on the fly for objects with constant key sets, tyielding offset (no lookup) field access - how could you possibly beat that?
19:05mmarczykrhickey: plus a patch with a TransientObjMap w/ the obvious semantics (and a conceptual problem -- should it switch to transient hash map at some size?)
19:05Licenserhttps://refheap.com/paste/2272 <- this is what happens, it seems a bit odd
19:05@rhickeyyes, the idea was always ObjMaps for small sizes
19:05@rhickeyreplacing HashMap with phmp is fine
19:06@rhickeymmarczyk: right, that's was the plan
19:06@rhickeymm re: threshold
19:06mmarczykrhickey: sure
19:06mmarczykrhickey: I'll prepare a patch against current master then? 16 as threshold?
19:07mmarczykrhickey: then we can do some more elaborate perf testing.
19:07amalloykenneth: https://github.com/flatland/useful/blob/develop/src/useful/seq.clj#L218
19:07@rhickeyit's really hard to read the test source but the results are literally unbelievable
19:07@rhickeylike, I don't believe them
19:07dnolenrhickey: yes, V8 is prety good.
19:08mmarczykrhickey: I have to say that was my reaction
19:08@rhickeyin safari here
19:08mmarczykrhickey: as noted in my original comment on the ticket -- crazy results
19:08dnolenrhickey: I saw one of the V8 engineers talk at JSConf, I think also think V8 is a bit finicky
19:09mmarczykrhickey: the functions called in the tests literally just wrap whatever they're named after
19:09dnolenrhickey: there scenarious where V8 will not produce an optimized type behind the scenes, so perhaps our tests are dynamic enough where V8 ObjMap magic doesn't kick in.
19:09@rhickeywe need to make sure objmap is doing what it is supposed to, but we shouldn't walk away from the objective that objmaps are same speed as object access, one of the most highly optimized aspects of JS
19:09@rhickeydnolen: I suspect that
19:09gozalaemezeske: for some reason I get different cljs version when running lein trampoline cljsbuild repl-rhino
19:10mmarczykrhickey: dnolen: actually, should we have an access test for very small maps on jsperf?
19:10mmarczyk4-6-8 entries
19:10gozalafrom when I just run cljs-repl from scripts
19:10@rhickeymmarczyk: esp literals like {:a 1 :b 2}
19:10mmarczykrhickey: right
19:10gozalaIs there any way I could set it up so to use one from $CLOJURESCRIPT_HOME ?
19:10emezeskegozala: lein-cljsbuild uses only tagged versions of clojurescript, the latest is 0.0-1011 I think
19:11emezeskegozala: It doesn't just grab the HEAD, as that can be unstable
19:11gozalaemezeske: I see, but is there way to tell it to use a diff one instead ?
19:11gozalaemezeske: like one from $CLOJURESCRIPT_HOME
19:12mmarczykrhickey: (defn obj-map-from-literal [k1 v1 k2 v2 k3 v3 k4 v4] {k1 v1 k2 v2 k3 v3 k4 v4}) for use in tests...
19:12@rhickeydnolen: mmarczyk: ok guys, well good work! please keep this issue in mind - don't throw out objmap just yet
19:12dnolenrhickey: definitely I actually had pretty big reservations about that myself. Thanks for pushing us to dig deeper :)
19:12@rhickeymmarczyk: taking keys as args is not like literals
19:12emezeskegozala: https://github.com/emezeske/lein-cljsbuild/issues/58#issuecomment-5013471
19:12@rhickey[v1 v2 v3] {:k1 v1 :k2 v2 :k3 v3}
19:13mmarczykrhickey: ohhh, gotcha
19:13gozalaemezeske: thanks!
19:13emezeskegozala: NP. I need to add that to the official docs one of these days...
19:13mmarczykrhickey: I'll post a new set of jsperf links on a separate ticket then -- "re-precating ObjMap", say
19:13@rhickeyha
19:14@rhickeygotta run there, thanks again for the great cljs work
19:14mmarczykthanks!
19:14RaynesGoodnight your highness. <3
19:15RaynesMissed him by 4 seconds.
19:15RaynesReflexes need sharpening.
19:20dnolenneotyk: checking now
19:23dnolenneotyk: works!
19:23yoklovemezeske: have you ever run into situations where cljsbuild will just say "Compiling ClojureScript." and then exit without doing anything else? lein cljsbuild clean seems to fix it.
19:24emezeskeyoklov: It will do that if e.g. the output file is newer than all the input files
19:25yoklovhm, I think its probably because of weirdness from version control then
19:25gozalaemezeske: I have tried https://github.com/emezeske/lein-cljsbuild/issues/58#issuecomment-5013471
19:25gozalabut it does not seems to work for me
19:25yoklovgozala: try using lein-checkouts, and also adding "checkouts/clojurescript/src/cljs" to the extra-classpath-dirs vector
19:26emezeskeHe shouldn't have to use lein-checkouts
19:26emezeskegozala: What version of leiningen?
19:26yoklovhm, I had been wondering if I had to…
19:26gozalahttps://github.com/emezeske/lein-cljsbuild/issues/58#issuecomment-5255126
19:27dnolenneotyk: done! thx!
19:27yoklovgozala
19:27yoklovadd "checkouts/clojurescript/src/cljs" to extra classpath dirs
19:27yoklovthat is what that error means
19:27yoklovits using your the same .cljs as before, just a new compiler, however the compiler is emitting code that uses, in this case, PersistentHashMaps
19:28gozalayoklov: I do have it
19:29gozalaemezeske: lein is 1.7.0 lein-cljsbuild "0.1.8"
19:29emezeskeAh, I think yoklov is right
19:29yoklovoh, hm. maybe try 'lein deps, clean'? I don't really know, this is usually what I try
19:30emezeskeMy example only includes "checkouts/clojurescript/src/cljs" to the classpath
19:30emezeskeMaybe "checkouts/clojurescript/src/clj" is also required?
19:30yoklovboth are i think
19:31yoklovor at least, I don't think i've really gotten it to work right with just one
19:31emezeskegozala: Maybe try :extra-classpath-dirs ["checkouts/clojurescript/src/cljs" "checkouts/clojurescript/src/clj"] ?
19:31emezeskeyoklov: Makes sense. Probably when I tested it with just one, it *happened* to be compatible
19:31gozalaemezeske: wait you actually have clj in example instead of cljs
19:31gozalaI'll try both
19:32yoklovemezeske, yeah, thats why i dont _think_ i've really gotten it to work right with just one.
19:32yoklovit will compile but now that theres an incompatibility, it doesn't work right
19:32gozalaemezeske: yoklov: I thin you meant cljs but wrote clj
19:32gozalawith just cljs it works
19:32yoklovgozala, you want both
19:33emezeskeYou really should include both
19:33gozalaok
19:33emezeskeI will update the issue
19:33yoklov:extra-classpath-dirs ["checkouts/clojurescript/src/cljs" "checkouts/clojurescript/src/clj"]
19:34gozalayoklov: emezeske thanks!
19:34emezeskegozala: Yeah, thanks for noticing the problem!
19:34emezeskegozala: Saves me from dealing with it next time :)
19:34yoklovgozala: no problem!
19:35emezeskeyoklov: Nice fix, btw .
19:35yoklovemzeske: dnolen is the one who suggested it to me, haha
19:35dnolenyoklov: emezeske: gozala: you def need both
19:36dnolenotherwise a you have a newer compiler but old core.cljs
19:36emezeskednolen: Yeah, I think when I tested it with just one, it was right after 0.0-1011 was released, so one or the other may not have yet been modified
19:36emezeskednolen: And I just got lucky (unlucky?)
19:37dnolenemezeske: unlucky because PHMs landed in the compiler
19:37dnolenbut if you have a old core.cljs, it's missing
19:37emezeskeMakes sense
19:37emezeskeBTW, that is strictly awesome
19:37dnolenemezeske: yes, it's awesome levels far beyond JS :)
19:37mmarczyk:-)
19:38emezeskeI've finally gotten to the point with cljs where I'm more effective than with regular js
19:38emezeskeI realized that yesterday, and it's a pretty sweet feeling
19:39gozala emezeske dnolen maybe you guys should write how to get that effective
19:40gozalaI'm having hard time with repl
19:40dnolengozala: well it's easier if you've done a lot of Clojure (and I've done a lot of JS too)
19:40dnolengozala: specific problems?
19:40gozalaI loose connection every now and then
19:40gozalaor repl just get's stack and I have to refresh
19:41emezeskegozala: For me it was a rather slow process, but as dnolen says it helps if you know clojure & js already :)
19:41dnolengozala: yeah, no one's looked closely but if errors occur the REPL breaks.
19:41gozaladnolen: not to say that I have to learn emacs instead of using my vim
19:41dnolengozala: it's less brittle now, but I don't think we've found all the edge cases.
19:41dnolenpatches welcome!
19:41gozaladnolen: emezeske: I have played with clojure
19:41yoklov mmarzyk: I've been meaning to mention, I tried out your TransientHashMaps and I think they have a bug. (get (assoc! t :foo 0) :foo) returns undefined as of when i tried
19:41gozalabut nothing serious
19:42mmarczykyoklov: that's right, it's fixed in the latest patch
19:42gozaladnolen: also ideally I'd love to use it with node
19:42mmarczykyoklov: on the ticket
19:42yoklovmmarczyk, awesome
19:42mmarczykyoklov: thanks a bunch for testing, btw!
19:42emezeskegozala: Personally I think that source maps (for good debugging/stacktraces in browsers) will be the biggest step towards usability
19:42dnolengozala: that would be nice, again, someone needs to work on that.
19:42gozalabut as far as I understand there is no repl for it or is it ?
19:42dnolengozala: I created one and drewr is working in it I think (?)
19:42yoklovmmarczyk, heh, I couldn't resist :p.
19:43mmarczykyoklov: :-)
19:43dnolendefinitely ready to take a good Node.js REPL if someone writes one.
19:43gozaladnolen: Once I'll get enough knowledge I'll try to do it
19:43gozalaunless someone will do it earlier
19:43mmarczykdnolen: I'm totally on it once we wrap up the current batch of things, Rhino is starting to drive me crazy
19:43yoklovsource maps would be amazing.
19:43dnolengozala: no better time to dig in then now - the CLJS compiler is awesome.
19:43dnolenyoklov: we should probably just start - we have line info.
19:44yoklovdnolen: what sort of output is required for that?
19:44gozaladnolen: BTW is there any chance that dependency on rhino will go away ?
19:45gozalafor cljs I mean
19:45mmarczykgozala: there is no dependency
19:45mmarczykgozala: except for the Rhino REPL
19:45dnolenyoklov: just the creating v3 sourcemap JSON
19:45gozalammarczyk: I mean to run repl compile I need rhino
19:45gozalawhich is pretty slow
19:46dnolengozala: repl doesn't require Rhino, copmile doesn't either.
19:46gozalawhat does require it then ?
19:46mmarczykgozala: well, the Rhino REPL does, naturally
19:46mmarczykgozala: nothing else
19:46dnolengozala: there are 2 repls, browser and Rhino. compile doesn't evolve a js engine at all.
19:47dnoleninvolve
19:47gozaladnolen: ok but you still need jvm and clojure to compile
19:47mmarczykgozala: nothing to do with Rhino
19:47gozalaI guess what I meant is I'd like to move to all node based cljs
19:47dnolengozala: sure, that's probably not going to change anytime soon.
19:48mmarczykoh, I see
19:48dnolengozala: it woudn't be any faster.
19:48gozalawell for startup it will
19:48gozalastarting jvm takes a while
19:48dnolengozala: but analysis and compilation wouldn't be any faster.
19:48gozalain fact lein would benefit much from being node based as well I think
19:48mmarczykgozala: you only need to do that once per work session though
19:49hiredman:(
19:49mmarczykgozala: well, Lein uses Maven stuff
19:49hiredmangozala: not unless you want to rewrite all the maven dependency stuff
19:49yoklovgozala: at the very least, the closure compiler will probably never be node based
19:49gozalaok I'll shut up!
19:49gozalawill try to learn more and hopefully get node-repl
19:49dnolengozala: haha, bootstraping would be interesting no doubt.
19:49yoklovhaha, i mean, cljs-in-cljs would be awesome, but its… hard
19:50gozalaI think what I mean is after using node
19:50gozalahaving all these layers makes it hard to switch
19:50dnolengozala: but it's a bit of work - not the least because we rely on GClosure to do some fancy optimizations that none of the other minifiers do as far as I know.
19:51gozaladnolen: sure no doubt on that but if I could get deoptimized version
19:51mmarczykgozala: you can pretty much treat lein-cljsbuild as a black box though
19:51dnolengozala: it's true that the optimization pass is probably less relevant for node.js ...
19:51gozalait's good enough for dev and then you can optimize before doployment
19:51mmarczykgozala: start up the jvm once and forget about the layering
19:52dnolengozala: in anycase, this just something someone needs to work on, no one is against it :)
19:52yoklovmmarczyk: honestly i wish that were true
19:52gozalathanks everyone for insights ;)
19:52yoklovGClosure crashes all the time for me :)
19:52yoklov*:(
19:53dnolenyoklov: that's weird.
19:53yoklovruns out of heap
19:53hiredmanuh, give it more?
19:53yokloviirc I can't because its not an option in lein-cljsbuild yet
19:53GeraldMacDuichmmarczyk, I am the greatest programmer safe only for the microsfot chief software architect
19:53mmarczykyoklov: really? well, tbh, I never use auto personally, but I've used cljs.closure/build from a long-running REPL -- never experienced a crash
19:53hiredmanyoklov: have you tried profiling gclosure?
19:54yoklovhiredman: no, usually more interested in just restarting
19:54mmarczykI mean, never use auto where it would actually matter... always want a Clojure REPL then anyway
19:54yoklovmmarczyk: yeah, judging by the stacktraces its during the parse portion of auto.
19:55dnolenmmarczyk: auto is actually pretty nice
19:55hiredmanare you sure?
19:55dnolenmmarczyk: I sometimes run auto + repl
19:55hiredmanI've been staring at jvisualvm graphs for the past week, they are rather pretty
19:55mmarczykdnolen: oh? I'll give it a shot then
19:56yoklovyeah, I run auto and repl also, but I use auto more than the repl because I'm an interactive development noob :p.
19:56mmarczykyoklov: well, whether I end up using this much, this should be fixed
19:56dnolenyoklov: yeah it's pretty weird - but pretty awesome once you figure out a workflow.
19:56mmarczykyoklov: I'll see if it crashes on me too
19:57yoklovmmarczyk, I think I'm the only one who has had it happen, there's a ticket open in lein-cljsbuild though to allow increasing the heap size
19:58yoklovdnolen: yeah, I've been trying to use it more. at the very least, it's been helpful for finding errors in clojurescript when the compiler just barfs
19:58mmarczykyoklov: ah, that's easy then -- gclosure gets lost playing with your demos and forgets actually to compile
19:58dnolenyoklov: I'm assuming you've read about GOAL & GOOL?
19:58yoklovdnolen: I have not
19:59yoklovOh, yeah I have
20:01yoklovThere was actually a guy in #racket a while back who worked for the same company, but I guess they had switched to using scheme for the AI.
20:01dnolenyoklov: supposedly they've got some Racket in the Uncharted series
20:02yoklovdnolen: Haha, yeah, it's awesome that there's actually people using lisp for game development professionally. I was fairly shocked when I heard about it.
20:02gozaladnolen: If someone could write up some pointers what needs to be done for node-repl
20:02gozalaI'd be happy to give it a try
20:02gozalaat the moment I'm pretty lost
20:04yoklovI should have another cljs game up by the end of the weekend by the way. Ludum Dare 23 starts in one hour (and runs for the next 48), haha
20:04ibdknoxyoklov: good luck
20:05yoklovibdknox: thanks!
20:05dnolenyoklov: awesome! I realize that I'd seen one of your old posts on the Racket ML about a past one.
20:05dnolenyoklov: good luck!
20:05mmarczykyoklov: good luck, can't wait to see it!
20:06yoklovdnolen: Haha, yup, that one was… pretty bad to be honest, but it was a lot of fun to make
20:06yoklovdnolen, mmarczyk: thanks!
20:07gozaladnolen: BTW I have hard time figuring out some things about protocols
20:07gozalafor example I can see that they take some args
20:07gozalahttps://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L215-218
20:07gozalaand if one of them is function how can I find out
20:07gozalawhat should this function be called with
20:08dnolengozala: ?
20:08dnolengozala: defprotocol is just a declaration
20:08gozalaAt the moment I'm trying to find examples that implement protocol
20:08hiredmanhigher order doc strings
20:08gozalabut that not always works
20:08hiredmanmost likely atoms
20:08gozaladnolen: let me give you example
20:08gozalaso I define Deferred type
20:08hiredmanthe function you want is add-watch
20:09gozalaand I figured I can implement IPending
20:09gozalanow I need to register listeners
20:09gozalaso I'm considering implementation of IWatchable
20:09gozalabut than it's not clear
20:09gozalawhat does -add-watch does with a key or f
20:10dnolengozala: it adds a watcher, how it's done is not important. the contract is that the f will be called on changes.
20:11gozalahiredman: yeah in this case I can lookup add-watch
20:11gozalabut it would be great if protocols had some details as well so I don't have to search for a function that uses it
20:13gozaladnolen: but I guess there is some expectation how registered `f` is called
20:13gozalawhat are the arguments for it I mean
20:14mmarczykgozala: it's possible to specify a docstring for the protocol as well as docstrings for any or all of the methods
20:16dnolengozala: yeah, would happily take a doc patch.
20:17gozaladnolen: sure I need to figure out first ;)
20:17gozalaPlease don't take it as complains
20:17dnolengozala: of course
20:17gozalajust a feedback from someone who's trying to get involved
20:18dnolengozala: feedback appreciated!
20:18netrealmIf I have a vector [:A :B :C], is there a way to do process it two elements at a time? e.g., call a function with two parameters, :A and :B the first time, and :B and :C the next time?
20:19mmarczyk&(doc partition)
20:19lazybot⇒ ------------------------- clojure.core/partition ([n coll] [n step coll] [n step pad coll]) Returns a lazy sequence of lists of n items each, at offsets step apart. If step is not supplied, defaults to n, i.e. the partitions do not overlap. If a pad collection... https://refheap.com/paste/2273
20:19mmarczyksee also partition-all
20:19gfredericks&(partition 2 1 [:A :B :C])
20:19lazybot⇒ ((:A :B) (:B :C))
20:19netrealmAha! Thank you!
20:21kennethis there a better way to do
20:21kenneth(apply concat some-sequence)
20:22gfrederickskenneth: well that's pretty short
20:22gfredericksyou could (mapcat identity some-sequence) just for variety
20:22kennethisn't there a cost to calling a function with potentially infinity arguments?
20:22gfredericksnot that I know of
20:23kennethokay, just wanted to check if that was kosher
20:23gfrederickshappens all the time
20:23gfredericksit's all done lazily
20:24dnolenyoklov: hey are you on Twitter?
20:24yoklovdnolen: i have an account but I'm terrible at using it
20:24dnolenyoklov: what's your username?
20:25yoklovhttps://twitter.com/#!/thomcc_
20:25yoklovhaha
20:25dnolenyoklov: I've been hyping your CLJS game experiments would like to give proper attribution :)
20:26yoklovhaha, sounds great! that definitely gives me more motivation to use it :)
20:28dnolenyoklov: https://twitter.com/swannodette/status/193494380445827072
20:28yoklovhaha, awesome!
20:34mmarczykdnolen: yoklov: just discovered a bug in HashCollisionNode, will post a patch in a moment
20:34konr,(contains? [0 2] 1)
20:35konrI can't believe THAT was the bug, hah
20:35dnolenmmarczyk: cool, I'm out but I'll take a look tomorrow.
20:35mmarczykdnolen: ok, thanks
20:37charles_rI have slime working in emacs. When I execute a block it only shows in this tiny space in the status area. Is there any way to send this to a regular emacs buffer?
20:37mmarczykit's just a typo really... I need to check if it's even in the patch which went into master
20:39mmarczykah, it is. well, patch forthcoming
20:46mmarczykhttp://dev.clojure.org/jira/browse/CLJS-188 for anyone who needs PHM to work
20:47mmarczykw/ hash collisions, anyway
20:49hiredmanclojurebot: ping?
20:49clojurebotPONG!
20:50offby1N00b: what's like "printf", except it goes to stderr instead of stdout?
20:50yoklovmmarczyk, you put nil instead of not-found? what is not-founds default, nil anyway?
20:51mmarczykyoklov: the method which doesn't take a not-found returns nil, yes
20:51yoklovokay, I won't worry about it then.
20:52mmarczykyoklov: it actually causes weird breakage in the presence of hash collisions
20:52yoklovoh
20:52yoklovhm
20:53mmarczyklike wrong answers from contains?
20:53yoklovI see.
20:55yoklovalright seems worth applying
20:56yoklovnot worth not doing and then wondering about it whenever I get an error
20:56offby1Answering my own question: (:use [clojure.pprint :only (write)]) (defn eprintf [& args] (write (apply format args) :stream *err*))
20:56mmarczykyoklov: right
20:56offby1Criticisms solicited :)
20:56S11001001cl-format is way cooler, and takes a stream arg
20:57yoklovoffby1, I think you could do (binding [*out* *err*] (printf whatever))
20:57hiredman^-
20:57offby1yoklov: probably :) Thanks.
20:59yoklovoffby1: np, was going to say something but forgot
21:04mmarczykyoklov: just a heads-up -- apparently there's something the matter with hash collision handling in transients too... working on it now
21:04yoklovmmarczyk, thats okay, those aren't in cljs head are they?
21:05mmarczykyoklov: nope
21:05yoklovokay
21:09yoklovalright, game on. theme for ludum dare is 'Tiny World'
21:10mdeboardI've got a string like "(country:(\"United States\") AND city_slug:(baltimore) AND state_slug:(maryland) AND title_slug:(database\\\-administrator\\\-oracle))" andI want to strip those escape characters out. I tried (cs/strip s "\\" "") but still throws the same error.
21:13mdeboard(solr escaping stuff :( )
21:13mdeboardextra-super escaping
21:15S11001001mdeboard: won't unescaping before parsing leave the result grammatically ambiguous?
21:16offby1Return of the n00b -- http://ix.io/2kw this simple program attempts to print a word to stderr, but the word doesn't appear. What am I doing wrong?
21:16mdeboardS11001001: How so?
21:17hiredmanoffby1: are you sure you're looking in the right place for stderr output?
21:18mdeboardMaybe I'm inventing a problem.
21:18S11001001mdeboard: blahthing:(alpha\) AND injection:(beta)
21:18mdeboardI'm parsing logs, not passing data to Solr
21:18mdeboardI should've mentioned that I reckon.
21:19S11001001I don't know what solr is
21:20S11001001but regardless, it's easier, not to mention uniquely possible, to parse before unescaping
21:20mdeboardPlease do tell
21:20offby1hiredman: sorta ... I'm expecting it to appear in emacs' *compilation* buffer. That's where the stderr of other (non-clojure) commands goes
21:20offby1hiredman: anyway if I just run that command (in the comment) at the shell, I don't see "eprintf" but I do see "printf".
21:20mdeboardS11001001: Because this barfs https://gist.github.com/6b815ddecb4dcdfed66a
21:21S11001001mdeboard: (?!<\\)
21:22mdeboardIs that an emoticon
21:22mdeboardjk
21:22S11001001anyway, e.g.: you're parsing a key-value series where values are delimited by parens and arrows. You intend the result "alpha) AND injection:(beta". You can parse blahthing:(alpha\) AND injection:(beta) correctly. You can't parse blahthing:(alpha) AND injection:(beta) correctly.
21:23mdeboardparens and arrows?
21:23S11001001er, not sure how arrows slipped in
21:23mdeboardI'm not trying to parse multiple parameter values simultaneously
21:23S11001001s/arrows/special chars escaped by backslashes/
21:23mdeboarde.g. https://gist.github.com/6b815ddecb4dcdfed66a
21:23S11001001weird typo
21:23S11001001right, but even so, you can't do it by unescaping and then matching, because the result will be ambiguous
21:24S11001001your regex needs to know when to skip over an escaped terminator
21:24S11001001and ?!< is the best tool for that
21:25mdeboardWell, I can't even print the string because of the 'Unsupported escape character \-' error message.
21:25muhoowow i'm spoiled. after doing some clojure for a while, i had to go back to doing some python coding, and finding it comically verbose and unnecessarily complex.
21:25muhoo*python*, ffs. i used to love python. now, meh.
21:26mdeboardSwitch back and forth a few times, your zealotry will be leavened a bit
21:26mdeboardthey both have great features.
21:27muhooi find the repl in ipython nicer than clojure, true.
21:27mdeboardah there we go (cs/replace (re-pattern s) #"\\" "")
21:27muhoobut i wrote some quick clojure functinos to make clojure repl more like python
21:28mdeboardWell, there's just no comparing lein repl to ipython, ipython is far and away best in its class for repls
21:28muhootrue that.
21:28S11001001muhoo: http://www.catb.org/jargon/html/F/functino.html
21:28mdeboardha
21:28muhoofunctino is a little function in italian
21:29muhoopiccolo functiono, quanta e' bella
21:29muhoobello
21:29mdeboardSPAGHETTI RIGATONI
21:29mdeboardAlso, S11001001 you don't know what Solr is?
21:29mdeboardhuh
21:29S11001001nope
21:30muhoobut i was speaking of the code, not the tooling/repl. of course a language that's over 10 years old will have better tooling.
21:30muhoowow, 20 years old!
21:31mdeboardI mean, I definitely know what you mean, I have implemented a few lisp features for specific problems
21:31seancorfieldi'm not experienced with python - what's so good about its repl?
21:31muhoowhat's the best way to describe it. fluidity? maybe?
21:31mdeboardseancorfield: Well, the built-in interpreter is pretty vanilla, but iPython is extremely full-featured.
21:31S11001001comparing ipython to lein repl isn't quite fair
21:31seancorfield(python has been on my list of languages to learn for years but never reached the top due to pressures of work)
21:31mdeboardAgreed
21:31mdeboardw/ S11001001
21:32muhoono, like i said, lein is very new. great, but new.
21:32seancorfieldcan any of you give some specifics?
21:32mdeboardA better comparison would be slime repl
21:32S11001001I am going to quote what I literally wrote before your message popped up mdeboard: "a better comparison would be slime repl"
21:32mdeboardseancorfield: Sure. http://ipython.org/ipython-doc/dev/interactive/htmlnotebook.html which has some of the features that ibdknox is aiming for with Light Table
21:32muhoohmm, maybe i should get around to using slime then. i've been putting it off.
21:33mdeboardTo be honest I haven't even begun to touch ipython's features. There are a *lot*, and it's extremely customizable.
21:34S11001001I may try it out sometime if I feel like setting up the emacs integration
21:34seancorfield'k i can see how that's more like slime / swank... with bells on too...
21:34mdeboardI am also a big fan of iPython integration with pdb https://github.com/gotcha/ipdb
21:34seancorfieldi guess since i'm in emacs all the time with a slime repl, i tend to think of the repl as being pretty good :)
21:34mdeboardstep-through debugging with tab completion, syntax highlighting, etc., etc.
21:35mdeboardYeah I'm in emacs full-time too for sure
21:35seancorfieldmdeboard: well, cdt has that for clojure, right?
21:35mdeboardthere's a way to get ipython running in emacs but alt-tab is faster than learning how to set that up
21:35seancorfield(step debugging)
21:35mdeboardhell I dunno, I only write clojure on weekends (for now)
21:35mdeboardIf you say it does I believe you :P
21:36seancorfield:) cdt's not bad at all, esp. with clojure 1.4.0's disable-locals-clearing compiler setting :)
21:36S11001001at least slime has step debugging for some CLs, know nothing about clojure stepping
21:37seancorfieldcdt was rolled into swank-clojure as of 1.4.0 i believe
21:37seancorfieldi don't use it a huge amount but it's been very helpful to track down certain bugs over the last few months
21:38mdeboard(i)pdb is a critical part of my development process
21:38mdeboardI'm gonna look into ipdb as soon as I figure out how to make this string not throw up.
21:38mdeboards/ipdb/cdt
21:39seancorfieldwhen we took clojure 1.4.0 to production this week, we also added the ability to start/stop a swank server in various long-running processes... so we can slime-connect into a production instance to examine data and run functions in a "real world" environment
21:39mdeboardOh wow
21:39mdeboardholy crap that's awesome.
21:39lstollthat's sweet
21:39mdeboarddo want.
21:40seancorfieldwas very helpful today - we did a data migration a while back (as part of our move from our legacy platform to our new system) and we created a number of duplicate records - a bug in the migration that hadn't shown up in any tests (of course!)
21:41seancorfieldso i was able to run some clojure functions to identity the problematic records and eliminate them, and provide business with the data they needed to decide what to do about the issue, all from inside emacs
21:42mdeboardThat's great.
21:42amalloyseancorfield: is there any particular reason to start/stop the swank servers, rather than just have them on all the time?
21:42mdeboardDammit. Is #"string" not just a macro for (re-pattern "string")
21:43seancorfieldamalloy: a little nervousness about leaving a process listening on a port, even tho' it's all inside the DMZ and only accessible via VPN
21:43S11001001we don't want to eat pattern compilation every time
21:43emezeske&(class #"string")
21:43lazybot⇒ java.util.regex.Pattern
21:43emezeske&(class (re-pattern "string"))
21:43lazybot⇒ java.util.regex.Pattern
21:43mdeboardThat's great but I get different behaviors.
21:43amalloymdeboard: escaping
21:43S11001001and we want #"a\(" not to get weirded out about the \
21:44S11001001ever written a bunch of regexes in emacs lisp?
21:44amalloy&#"a\("
21:44muhoostill, i doubt russian haxx0rs would know what do do with a clojure repl if they managed to gain access to it
21:44lazybot⇒ #"a\("
21:44amalloy&(re-pattern "a\\(")
21:44lazybot⇒ #"a\("
21:44amalloymuhoo: i nominate this for Worst Security Policy
21:44mdeboarde.g. https://gist.github.com/07ce84a751a6814ce02e
21:45amalloymdeboard: escaping
21:45mdeboardamalloy: peppercorn
21:45muhooamalloy: security through s-expressions? yeah, doesn't seem very solid
21:45mdeboardamalloy: Do you have more specific guidance ?
21:46amalloymdeboard: your \\\ isn't the same in those two
21:46mdeboardHow not?
21:46amalloy#"\\\-" matches the literal string "\-"
21:46amalloy"\\\-" is an illegal string escape
21:47seancorfieldamalloy: like i say, i wouldn't want to leave a slime repl open all the time, just in case... which is why we didn't do it until swank-clojure 1.4.2, which added stop-server :)
21:47mdeboardRIght, that's the error I"m trying to overcome
21:47amalloy&"\\\-"
21:47lazybotjava.lang.RuntimeException: Unsupported escape character: \-
21:47S11001001&(str #"\\\-")
21:47lazybot⇒ "\\\\\\-"
21:47mdeboard&(str (re-pattern "\\\-"))
21:47lazybotjava.lang.RuntimeException: Unsupported escape character: \-
21:47mdeboardWhich is why I"m boondoggled.
21:48amalloymdeboard: you aren't calling re-pattern with "\\\-", because as you can see "\\\-" isn't a legal value - it doesn't exist
21:48seancorfield&(str (re-pattern "\\\\-"))
21:48lazybot⇒ "\\\\-"
21:48amalloyS11001001 has helpfully demonstrated that if you want re-pattern to result in #"\\\-", you need to give it "\\\\\\-"
21:48mdeboardSure, but how do I deal with parsing loglines that come in with "\\\-" in them then?
21:49mdeboardI am surprised that #"string" and (re-pattern "string) behave differently for some inputs.
21:49mdeboard(re-pattern "string") rather
21:49S11001001mdeboard: are you testing your function by copy-pasting bits with \s in them?
21:49S11001001into clojure literal strings?
21:50amalloythe whole point of #"string" is to avoid having to escape all this crap twice
21:50amalloyi suppose S11001001 might argue that performance is the main point; i dunno
21:50S11001001no, I care about the escaping more too
21:50S11001001but I do have the habit of splitting re.compiles off in python
21:51mdeboardIt probably goes without saying that I'm confused.
21:51mdeboardAbout this difference in behavior between #"string" and (re-pattern "string") since I was under the impression #"string" was a macro for (re-patterN)
21:51amalloyit is not
21:52emezeskeS11001001: You know python caches like the last 100 expression compiles?
21:52S11001001no I did not
21:52S11001001even so, "last"?
21:52emezeskeWell, the cache only holds 100 (I think) entries
21:52emezeskeSo, 100 different regular expressions
21:53amalloypython uses pcre, right? afaik i know pcre does that caching
21:53emezeskeI don't know about that, but last time I looked at the regex source (in Python) it just stuck stuff in a dictionary
21:53emezeskeThat was for 2.x, though, not 3.x
21:54amalloyalthough, what the hell, why are you calling clojure.string/replace with a regex as its first argument? it wants a string, not a regex
21:54gfredericksamalloy: ooh, regex editing!
21:55mdeboardBecause I can't do anything with the damn string because it's got the "\-" character in it, because it's coming from Solr logs, where "-" is a special character and must be escaped.
21:55S11001001mdeboard: so are you, indeed, putting "...\-..." into a literal clojure string to test the function?
21:55mdeboardYes, I'm copy-pasting aline from the log.
21:56S11001001right, that won't work
21:56mdeboardWhy's that
21:56S11001001because the string with the two characters backslash and hyphen is written like this in clojure: "\\-"
21:56S11001001&(count "\\-")
21:56lazybot⇒ 2
21:56S11001001&(first "\\-")
21:56lazybot⇒ \\
21:56S11001001heh
21:56mdeboardYes, I get that, I understand why it's failing
21:56S11001001&(second "\\-")
21:56lazybot⇒ \-
21:56mdeboardI understand the regex
21:56S11001001so you *can't* just copy-paste
21:56S11001001nothing to do with regular expressions
21:57mdeboardI understand the reason for the failure, really
21:58amalloyif you don't understand why pasting into a repl from a log file is a problem, i'm not sure you do. try getting the repl to *read* from the log file; you'll get out the string you wanted, escaped just enough times
21:59mdeboardYeah it gets parsed by cascalog beautifully, but it just dawned on me I'm sitting here escaping double quotes but then scratching my head like an idiot over escaping anything else.
22:00mdeboardliterally was just typing escape characters in front of double quotes grumbling about the \- thing.
22:02mdeboardThanks. It takes me awhile sometimes, I'm special.
22:40technomancyoffby1: I think slime might be doing some shenanigans with *out* that don't apply to *err*
22:42technomancythe whole project-in-a-subprocess thing combined with the JVM's crappy process API requires some annoying workarounds; `lein trampoline repl` and `lein trampoline run` let you work around them
23:01charles_r(doc +) gives "[Thrown class java.lang.RuntimeException]
23:01clojurebot"([] [x] [x y] [x y & more]); Returns the sum of nums. (+) returns 0. Does not auto-promote longs, will throw on overflow. See also: +'"
23:01charles_rI'm using slime in emacs.
23:02S11001001charles_r: clojurebot disagrees with you
23:02charles_rheh
23:02charles_rI disagree with me too. Something isn't right with my config
23:02xeqi(use clojure.repl)
23:03charles_rno quote?
23:03xeqiit needs a quote
23:04charles_rthanks, I thought I had tried that
23:14miniyukiHi, does anybody know if lazy-cat is not supported on ClojureScript?
23:15S11001001lazy-cat is no longer cool
23:15miniyukiwhat should I use then?
23:15S11001001and is anyway equivalent to (concat (lazy-seq x) (lazy-seq y) ...)
23:15S11001001that is literally what it expands to now, iirc
23:16miniyukithanks a lot
23:16S11001001only room for 1 cat in clojure.core
23:16S110010012 cats
23:17brehautim pretty sure you should generalise to N cats at this point
23:17S11001001nope, no infinite cats
23:17S11001001just the ≈2
23:23brehautoh right
23:36mindbender1please I need a little help with my gen-class problems