#clojure logs

2013-09-12

00:17callenseangrove: akurilin is awesome. you should meet him, he's a fellow founder using Clojure :)
00:48dnolenbbloom: ping
00:48dnolenambrosebs: ping
00:48bbloomdnolen: 2 sec
00:48ambrosebsdnolen:
00:49dnolenambrosebs: are you using :children with only keys not nodes?
00:49callenPingfest 2013
00:49dnolenambrosebs: I mean are you representing them that way?
00:50ambrosebsdnolen: atm yes
00:50dnolenambrosebs: ok and I see Bronsa is too
00:50dnolenambrosebs: are there any problems w/ this approach it seems sound to me
00:50ambrosebsit seems to work
00:50dnolenambrosebs: and you're using this for generic walking right?
00:50ambrosebsdnolen: tbh I haven't used it myself.
00:51ambrosebsI just put it out there.
00:51ambrosebsbut potentially yes
00:51ambrosebsHaven't heard any feedback yet. Wasn't aware Bronsa was using the same technique.
00:52bbloomdnolen: heh, i proposed this approach several times :-)
00:53dnolenambrosebs: he keeps that information there, but it appears as elsewhere just use multimethods
00:53bbloomdnolen: the two issues are 1) interleaved children, such as in bindings
00:53dnolenambrosebs: stills there's the benefit of someone wanting some way to do something simple and and have a way to traverse.
00:53dnolenbbloom: yes I'm revisiting the notes
00:53bbloomdnolen: and 2) values that are sequences instead of just individual children
00:53dnolenbbloom: yep, evaluation order is a consideration
00:55dnolenhttps://github.com/Bronsa/CinC/commit/8d1cc9a96bd9fdc5f10e602e63f79c7ae1f79dfe
00:56dnolenbbloom: looks like Bronsa just added a :binding :op
00:56bbloomdnolen: which was also proposed :-)
00:56dnolenbbloom: yep I remember that too :)
00:57bbloompretty soon cljs will catch up to my imagination from a year ago :-)
00:58ambrosebsg2g
00:58FoxboronIs there any blogpost/guide that shows how to use ClojureScript with nginx and the like?
00:58FoxboronGoing to try out cljs soon to write a basic blog engine
00:59dnolenbbloom: been wanting flow more type information through the AST recently, your suggestionsand Bronsa/Ambrose implementations looks like the way to go.
01:00callenFoxboron: clojurescript is just the frontend, you need a backend in Clojure too
01:00callenFoxboron: luminusweb.net
01:01Foxboroncallen: what i wanted, awesome :)
01:03dnolenbbloom: besides binding, how the seq of forms not handled by :items?
01:03dnolenhow is
01:11sdegutisTonight, on Bikeshedding Week...
01:11sdegutisphew, finally glad to have shed that bike..
01:13bbloomdnolen: https://github.com/edn-format/edn/issues/40
01:13bbloomdnolen: since you're gonna stuff more stuff in to the AST...
01:14dnolenbbloom: heh, actually was thinking about moving stuff out
01:14bbloomout?
01:14dnolenbbloom: and adding extra stuff via the compiler
01:14bbloomdnolen: oh yeah. i wanted a MINIMAL ast for *essential data only*
01:14dnolenbbloom: there are many ad-hoc things in analyzer, would nice to move more CLJS specific stuff into compiler.clj
01:14bbloombut expando
01:15bbloomdnolen: would be much nicer to split compiler.clj in to js/analysis.clj and js/codegen.clj :-)
01:15dnolenbbloom: heh sure, but moving things out of analyzer.clj, and adding passes to compiler.clj is a good start
01:16bbloomdnolen: oh, just wanted to make sure that you weren't sticking extra analysis in to the existing pass
01:16bbloombut yeah, would be nice to have the absolute minimum ast & provide a schema for it
01:16dnolenbbloom: yep
01:17dnolenbbloom: this is nice and short - http://docs.google.com/document/d/1DRN-tBIqhqVVyoHIDs7CMkduBFk-vqd_958ojeIBLHQ/edit
01:17dnolenbbloom: thinking about making a :children keys version of it
01:17dnolenbbloom: also - with passes, a way to emit human comprehensible version of the AST via a helper fn :)
01:17dnoleni.e. dropping :env
01:17bbloomdnolen: even better: an unparser
01:18dnolenbbloom: yeah that too
01:18bbloomi have env dropping in a scratch file somewhere :-P
01:18dnolenbbloom: anyways, thanks for the refresher, all this stuff should looked into before thinking about ANF, so will probably start here. Expect more pings from me.
01:18bbloomglad you're finally excited about passes :-)
01:26tufflaxI have not used logging much before, but I'm thinking about starting to use it more for an application I'm working on. But before I do, I wanted to ask you guys what you think about logging. I find that if I have a bug, I add a bunch of printlns but then remove them again afterwards. That seems stupid. Do you guys use logging? I'm not super excited about adding all those logging calls.
01:28callentufflax: I use timbre and robert.hooke to do logging.
01:28callentufflax: robert.hooke so that logging is independent of the function logic.
01:28callentufflax: if you need SQL query logging, look at github.com/bitemyapp/blackwater
01:32tufflaxcallen: nice, robert.hooke certainly seems like a good idea
01:36akurilincallen, thx, apprec the bump in clojure street cred :)
01:36bbloomi had to write some javascript today. it was not fun
01:36callentufflax: super handy. Dire is like a more advanced concept of robert.hooke for handling things like exceptions. robert.hooke is fine for decorating fns for logging though.
01:36akurilincallen, btw, what is the auto testing library you were telling me about earlier? I can't get lein-autotest to work, not sure if it's deprecated.
01:36bbloomliterally 20 minutes of work, ruined my whole week :-P
01:36callenakurilin: lein prism
01:37callenbbloom: ;_;
01:37callenbbloom: I write Python and JS every week.
01:37bbloomcallen: so then you're used to it
01:37bbloom:-P
01:37callenI spent like 2 hours yesterday explaining jQuery.
01:37callenmy liver was rupturing the whole time.
01:37bbloomcallen: please told me that you said "it's a monad!"
01:37bblooms/told/tell
01:37callenbbloom: list monad actually, but yes.
01:38callenI mentioned it when explaining the collection passing bucket brigade pattern
01:38callenwas going for maximum shock-and-awe
01:38seangrovehaha
01:39seangroveUsing communication to obscure meaning
01:39callendon't worry, my coworker knew what needed done to finish the feature they were workingon
01:39callenI just used it as an excuse to teach some higher order patterns
01:40akurilincallen, awesome, let me try that.
01:40callenlike how jQuery's API works, how binding to the DOM works, event bubbling, late vs. early binding, etc.
01:40callenjQuery is my favorite way to demonstrate the advantages of late binding :P
01:40seangroveYeah, it's a good idea if they already understand the usage of something to explain the bigger concepts in those terms
01:41callenwell they didn't understand jQuery either
01:41callenI explained the higher order patterns as I was explaining jQuery usage
01:41callenlike peeling an onion
01:41callenit was a very high throughput pair programming session.
01:42callen"here's you use this...and here's how you break this same thing...and here's the higher order reason it breaks..."
01:42clj_newb_2345so I just got android working ;;; yay ;;;
01:42clj_newb_2345anyone doing android dev with clojure?
01:42clj_newb_2345or are there actual problems with clojure on android?
01:43rhgSlow start
01:43andyfingerhutclj_new_2345: There aren't many people doing it. You can Google for past conversations in the Clojure Google group on Android.
01:43clj_newb_2345why is jvm fast, but clojure slow?
01:45callenit's not that simple
01:45callenClojure is designed for the trade-offs of things like services, not clients.
01:46clj_newb_2345so we have a good clojure -> javascript compiler, but no good clojure -> java compiler?
01:47rhgI dint say just slow I said slow start
01:47rhgIt's plenty fast
01:49andyfingerhutClojure on the JVM definitely isn't optimized for short running programs. I've benchmarked "Hello world" on one machine at about 200 msec for Java and ~1 sec for Clojure.
01:50callenit's not "good" or "bad", just different design constraints.
01:50callena server written in node.js and clojurescript would have worse latency and throughput than one in Clojure and the JVM, but a script written in clojurescript + node.js would start faster
01:50callenjust different trade-offs.
01:51rhgBut cljnewb I do use it
01:51rhgSee my github
01:51ivanit would be nice to have a library/protocol just for sending (clojure function, shared secret, shell environment) and streaming stdin/stdout/stderr
01:52ivanI would write a lot of command-line programs with that, I just haven't gotten around to doing that
01:52callenivan: grench
01:52bbloomit's worth noting that clojure isn't inherently bad at startup time: it's a function of the way clojure/core.clj is bootstrapped
01:52ivangrenchman? does it do non-lein things?
01:52bbloomcljs, by contrast, is essentially static (now after much work)
01:52rhgMhm
01:53bbloomduring cljs bootup, no code runs. so if you don't use parts of core, it won't be in the javascript output!
01:53rhgYa
01:53bbloombut b/c clojure on the jvm has a resident compiler, it compiles everything and keeps it warm and ready for future use
01:55callenfor the record, coming from Python, Clojure is a massive concurrency and speed upgrade. That it happens to be so on top of just being a better language is just gravy on top.
01:55callenfor the sorts of things I do anyway.
01:56coventry`ivan: grenchman is great, and close to what you described. It doesn't have the security features you asked about, though.
01:59callengrenchman uber alles?
01:59callentechnomancy: ^^
02:06akurilinFor forks of existing clojure libraries that you want to add into leiningen, is there a less spammy method than to upload them to clojars?
02:06s4muelakurilin: lein install
02:08akurilins4muel, great, I'll investigate that, thanks!
02:09callenakurilin: `ls ~/.m2/repository/`
02:09callenakurilin: it's just stashing it there.
02:16dissipate_;apply
02:21dissipate_how is this valid: (apply + '(1 2 3 4))
02:22dissipate_why does apply allow a quoted list?
02:22callendissipate_: http://clojuredocs.org/clojure_core/clojure.core/apply
02:22zRecursive,(apply + '(1 2 3 4))
02:22clojurebot10
02:23callendissipate_: a quoted list is seq'able.
02:23callensame as a vector.
02:23zRecursive,(reduce + '(1 2 3 4))
02:23clojurebot10
02:24dissipate_callen, when would you ever use a quoted list instead of a vector?
02:24dissipate_in an eval?
02:25callenwhen you wanted to cons heads onto a collection, or to represent clojure code.
02:26zRecursive,(reduce conj #{} (for [i (range 10) j (range 10)] [i j]))
02:26clojurebot#{[2 1] [3 2] [4 3] [5 4] [6 5] ...}
02:29dissipate_callen, i see, makes sense. thanks.
02:29callenI asked for a change to a frankly dirty PR
02:30callendude came back with a PR that passed tests, and 5x less code in 24 hours.
02:30callen<3 Clojure programmers
02:31dissipate_callen, PR?
02:31akapull request
02:32akurilinhah that's awesome
02:32akurilinbbl
02:34dissipate_callen, should have been like that in the first place. :P
02:37callendissipate_: I don't think I would ever criticize someone for trying to contribute to an OSS library.
02:37callen0.01% of programmers even attempt to do so.
02:37callenout of laziness or apathy.
02:38dissipate_callen, don't forget the fact that corporations use those libraries, making wild profits, while the developer gets a pat on the back
02:38callenWhat a strange thing to care about.
02:38dissipate_i happen to know because i work for such a corporation. we use all kinds of open source libraries, but don't pay anything.
02:39callenI make things so people can use them. I don't care if somebody is profiting or not.
02:39callenI'd just like contributions back if/when possible
02:39callenI explicitly want to allow the use of open source libraries in the course of profit-seeking activity so I can use my stuff at work.
02:39dissipate_callen, perhaps you don't, but just add that as another reason why developers don't spend their time on open source projects
02:39wei_how do I convert a long hex string into a number (BigInt)? (Long/parseLong "4590d31a9cf5eb30997501f82b1b8db051c01f7ea8a2c413343f2c1b9f5aa04e" 16) gives me a NumberFormatException
02:40callendissipate_: I sincerely doubt that has anything to do with it.
02:40callenpeople who would otherwise be motivated to work on OSS aren't going to be stopped by corporations profiting from the use of them, that's ridiculous.
02:40wei_,(Long/parseLong "4590d31a9cf5eb30997501f82b1b8db051c01f7ea8a2c413343f2c1b9f5aa04e" 16)
02:40clojurebot#<NumberFormatException java.lang.NumberFormatException: For input string: "4590d31a9cf5eb30997501f82b1b8db051c01f7ea8a2c413343f2c1b9f5aa04e">
02:40callenit'd be the opposite since if you're an expert in something many companies use, then you have an opportunity to leverage your knowledge as a consultant.
02:41callendissipate_: you have a warped perspective. You should consider a more positive outlook.
02:41dissipate_callen, well, given a choice to develop closed source software for their own profit, or OSS for a corporation's profit...
02:41callenyou can't sell libraries anymore, lol.
02:41callenthat's not how it works.
02:41dissipate_i'm not talking about libraries, i'm talking about web apps or mobile apps
02:42callenOSS usually isn't concerned with end-user products.
02:42callenit's usually infrastructure, tools, and libraries for developers to build products with.
02:52wei_to answer my question above, (BigInteger. "4590d31a9cf5eb30997501f82b1b8db051c01f7ea8a2c413343f2c1b9f5aa04e" 16)
03:03amalloywei_: not that it's what you want for parsing at runtime, wei_, but note that 16r4590d31a9cf5eb30997501f82b1b8db051c01f7ea8a2c413343f2c1b9f5aa04e works as a literal :P
03:04wei_cool. how does the reader know it's hex?
03:04wei_oh 16r
03:05Apage43callen, dissipate_ related note
03:05Apage43I was working on a nifty doodad
03:05Apage43started out open, was asked to close-source it, now it's not nearly as fun
03:05callenApage43: for work?
03:05Apage43yeah
03:06callenwell. that's regrettable
03:06callenI don't see my company minding much as long as it's peripheral to our core product and service.
03:06callenwe're not a pure software company.
03:07Apage43the fun bit is our *core product* is open source. There are no closed source bits, whatsoever.
03:08callenApage43: so...wait. Why did your utility/doodad matter then?
03:08callenApage43: do you work with ucb?
03:09Apage43Dunno what ucb would be. At any rate, the explanation I got was that the company wants to have some closed-source addons going forward
03:10callenucb is a person :)
03:10Apage43and the thing that I made was apparently "too useful to give out for free"
03:10Apage43ah
03:10callenApage43: who do you work for?
03:10Apage43no :)
03:10Apage43different couch company
03:10Apage43couchbase
03:10callenApage43: do you know why Katz got dumped?
03:12Apage43somewhat, yeah.
03:12dissipate_Apage43, asked by whom to close source it?
03:12Apage43I'm the last non-founder person, based in the US anyway, left from the CouchOne side.
03:13Apage43still have some Couch OGs hanging out in europe.
03:14callenApage43: why did the US people disperse?
03:14callenApage43: also what did you make that was useful?
03:14Apage43At any rate, this channel is logged, so :)
03:15Apage43callen, an app that collected time-series metrics from our post-mortem log dumps and let you look at em and do some light math/processing to them
03:15Apage43I built it as a tool for the support team
03:15callenseems useful and sounds apropos to couchbase.
03:16seangroveApage43: Friends with Dale, he's still a believer
03:16Apage43Good to hear :)
03:16seangroveCouchDB is the main reason I'm averse to using Datomic now though
03:16dissipate_i've never used couchebase before. sounds a lot like mongodb
03:16seangroveWas a really bad experience
03:17Apage43Oh?
03:17seangroveThis was 4 or 5 years ago though, I hear it's much better
03:17callendissipate_: more soft real-time focused than MongoDB.
03:17callenseangrove: I had to work with one of the larger CouchDB clusters back in the day. hated it. I'm much less leery of Datomic, given the right use-case.
03:17Apage43CouchDB and datomic are .. really really different.
03:17callenIndeed.
03:18seangroveApage43: I agree, but having used an alpha-level db in production for years, and having paid a lot of money to consultants, I'm averse to betting too much on esoteric db tech
03:18seangrovehttp://sauceio.com/index.php/2012/05/goodbye-couchdb/
03:18seangroveThat's a diplomatic post on the issues we faced
03:18Apage43ah
03:18Apage43I remember this post
03:19dissipate_there's so many players in the NoSQL space, some of them have got to die
03:19callenseangrove: well, I'll let you know Datomic goes. Feeling pretty confident about it. It's a LOT simpler than something like CouchDB.
03:20callenseangrove: even though it's closed source, it's very easy for me to see how Datomic is built and fits together, there are not many moving parts like Couch or something of comparable complexity (Cassandra)
03:20seangrovecallen: Yeah, your experiences are heartening
03:20callenI think I was angry the whole time I was working with CouchDB
03:20callenI probably drank more too.
03:21Apage43most of the drinking I've done, I've done at work.
03:21dissipate_callen, well, if you want to use datomic, get out the pocketbook
03:21Apage43hell, most of the beer I've had was bought by Damien.
03:21callendissipate_: lol, you mean the all of $3000 we had to pay for a perpetual license?
03:22callendissipate_: we spend more that on lunch one day of the week per week every month at our company.
03:22dissipate_callen, actually, Hickey was smart. he probably figured he already gave away too much for free with Clojure. time to cash in the chips.
03:22Apage43Then you can buy a Couchbase license for your underlying data store for your Datomic installation.
03:22callenif your database decisions have a cost impact of less than $3000, shut the company down and do something else.
03:23callenApage43: nice try.
03:23dissipate_callen, that's a big company. $3000 is a lot for a lean startup.
03:23callen$3000 is worth the time-savings if you know you'll need the functionality Datomic offers
03:23Apage43callen, probably should at least look like I'm trying if someone pulls up the log :)
03:23callenit costs the lean startup more to reimplement what Datomic does than to just spent the $3k
03:24callenApage43: defaulting to PostgreSQL for now, might use DynamoDB if writes require INFINITY (units of Amazon) scalability or something.
03:24Apage43friend of mine in TX is working at a startup (well they just got acquired so I guess not) that went with *DB2*
03:24Apage43that really ate through a lot of their cash
03:24callen$3000 for a perpetual license isn't comparable to using Oracle or DB2 :P
03:24dissipate_callen, probably true. the vast majority of lean startups are not doing clean code practices, which costs them dearly down the road when they have to completely rewrite their 'prototype'.
03:25callenbut yes, that would be unwise. Particularly since it doesn't "win" you anything over PostgreSQL like Datomic does.
03:26Apage43Yeah, if you're actually using much of the functionality it provides, that's a *lot* less than the cost of paying someone to build it
03:26callennow the guy with the PR is responding to Alex's requests. Dude is a saint.
03:26callenI need to send him beer over TCP/IP or something.
03:27dissipate_callen, bitcoin could buy him a beer in some bars
03:27callenApage43: lo and behold, we need almost everything it does. event sourcing + EAV is *exactly* what we need.
03:27Apage43I think the sushi place near my apartment that was accepting bitcoin a couple months ago may have stopped
03:28dissipate_Apage43, was that in san francisco?
03:28Apage43Sunnyvale
03:28dissipate_Apage43, i'm going to a sushi place at the end of the month as part of a bitcoin meetup. we are going to try to get the owner to accept it.
03:29Apage43there was some sort of bitcoin convention nearby, so I think a lot of places experimented with taking it for a bit
03:29callendissipate_: aw don't mess with the poor restaurant :(
03:29dissipate_i've already profited big time off bitcoin. everything from here on out is pure gravy for me, so i hope it catches on.
03:29callenApage43: I'm kinda sad the Datomic Pro license doesn't let me publish benchmarks. I could make them look gooooood
03:30dissipate_callen, don't mess with them by giving them business? our meetup is looking for a place to meet and spend our coins.
03:31dissipate_even if no other customer used it, they would get our business, not to mention some publicity.
03:31Apage43the only thing I've ever spent bitcoins on is tacos.
03:31Apage43not at a place that takes tacos mind, I just have a coworker that offers to get me tacos for bitcoins when I forget my cash at the nearby taco truck
03:31Apage43*takes coins
03:32dissipate_Apage43, i was at lunch with some coworkers today. they were complaining about how splitting the bill is still such a PITA.
03:33dissipate_Apage43, i suggested that if they had bitcoin wallets, only 1 person would have to pay the bill and everyone else would just send them some BTC. no cash needed. :D
03:33callenI do that with square sometimes.
03:33callenI have all the other people at the table charge their amount on my square account, then I run the entire table balance through my credit card
03:33callenair milezzzzz
03:34callenthis works even better at 3 and 4 * restaurants.
03:34Apage43yeah, that's how it plays out at the truck. Usually along the line of: I get out my phone, remember I forgot to install the app I use for that, install it, recover my wallet, scan a QR code off his app, and punch a button, then wait ~10min to know that it worked.
03:35Apage43Eventually I'll run out of btc and just not eat tacos =P
03:35Apage43I only ever got like, 2, in 2011 sometime
03:35dissipate_Apage43, you wait 10 minutes? he doesn't trust you?
03:36dissipate_Apage43, i bought a boatload last year, made a killing when the price went up to $220.
03:37Apage43I *am* the resident guy that writes exploit POCs when someone claims they made a thing more secure.
03:37Apage43but no, he doesn't wait ten minutes to buy the tacos
03:39Apage43If I screwed him over I really wouldn't have anything to spend them on.
03:40dissipate_i would hold on to 'em. if they become the world's currency, you might get rich. :P
03:40Apage43Maybe.
03:40Apage43I remember Damien was pretty convinced that would happen for a while.
03:40dissipate_i've still got a significant stash.
03:42dissipate_well, there's a lot of work to be done to make it happen, but a lot of hackers are hard at work to build up infrastructure. i'm in for the long haul myself. spending them online is pretty awesome, no other checkout experience like it.
04:12fredyroh now i wanna have tacos
04:12fredyrand its only almost breakfast
04:15callenit's midnight and I want tacos. I think I'll read lesswrong and go to sleep instead. Night all :)
04:15fredyr:)
04:15fredyrnight
04:32tangrammerHi folks!
04:33tangrammerCan someone help me with using macros in clojurescript?
04:33tangrammeri am trying to use https://github.com/michaelsbradleyjr/node-clojurescript
04:34tangrammerbut my macro is always undefined when i try to use from node.js
04:34tangrammerthanks in advance!
04:40ddellacostatangrammer: you'll have to be more specific, especially if you're referencing an out-of-date project. Also, have you read this? https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure#lisp
04:41tangrammerddellacosta: thanks for answering
04:41ddellacostatangrammer: np
04:42tangrammerddellacosta: I am intereseting in work with cljs but as a node lib
04:42ddellacostatangrammer: I don't know anything about node.js, so can't help you with that, sorry.
04:43tangrammerddellacosta: thanks again then
04:43ddellacostatangrammer: np, good luck.
04:45Apage43tangrammer, one of the things you'll run into, I think, is that macros in CLJS are *only available at compile time*
04:48tangrammerApage43: yes, my macro is in a file.clj and is in the same src source
04:48tangrammersomeone here is using or has used https://github.com/michaelsbradleyjr/node-clojurescript
04:48tangrammer?
04:50tangrammer... or someone that is using clojurescript as a nodejs dependency/library?
04:52sm0keHello , i am having hard time how to implement a interface with generic T with methods public T deserialize(byte[] serialized); public byte[] serialize(T object); using clojure genclass?
04:53Apage43generics don't actually "exist" in compiled java bytecode
04:54sm0keright
04:54sm0kei have something like this in gen-class :methods [[printschema [] void] [serialize [Object] Object] [deserialize [Object] Object]]
04:54clgvtangrammer: the consequence of what Apage43 said is that when macros are only available at compile time you are not able to use them from an "outside" javascript
04:54sm0keprintschema is my own method
04:54Apage43right, so those types are right. I really never use gen-class though.
04:55sm0kebut i get No matching field found: serialize
04:55Apage43Typically if I'm implementing java interfaces it's through reify if possible
04:55sm0keyea but my class has to have state
04:55clgvsm0ke: reify objects can have state via closures
04:56sm0keok thanks i look into it...but can we make gen class to work for this interface?
04:56tangrammerclgv: and what does it mean or how could i have that macro (already js-compilated) on other js environments/libs?
04:56clgve.g. (let [state (atom {})] (reify ... (my-method [...] (manipulate state))))
04:56sm0kenot being a tool...but its just that i am a beginner
04:56Apage43(let [state (atom {})] (reify Thingy (setFoo [_ foo] (swap! state assoc :foo foo))))
04:57clgvtangrammer: afaik that means that you can use macros only in clojurescript code but not at javascript runtime from different javascript libs
04:57sm0keOk on question...boes byte[] qualifies to be Object?
04:57Apage43what clgv said
04:57clgvApage43: :D you were more specifiy ;)
04:58clgv*specific
05:00Apage43sm0ke, yes
05:00tangrammerclgv: I didn't use the macro clj in javascript directly but when my cljs tried to use it seems to be undefined.... it works now! the problem was that the namespace have a "-" inside ideate.my-macro ... i have changed to ideate.mymacro and now works!....
05:01tangrammerApage43: it works now! the problem was that the namespace have a "-" inside ideate.my-macro ... i have changed to ideate.mymacro and now works!.... Thanks
05:01Apage43tangrammer, ah, what you might have been running into there
05:01tangrammerclgv: thanks!
05:01Apage43is that -'s in your ns name map to _'s on the file system
05:01Apage43so (ns foo.bar-thing) would be foo/bar_thing.clj
05:02clgvtangrammer: ah ok. sounded differently ;)
05:02tangrammerApage43: but with node-clojurescript compilator seems to fail, i know that cljs lets you use it but ...
05:04sm0keWhen implementing or extending an interface do i need to put every method i implement or extends in :methods or just the custom ones which the super class/ interface doesnt define??
05:04lazybotsm0ke: Definitely not.
05:04sm0ke!!!
05:05Apage43the only place I ever use gen-class is for a main(), so I honestly have no Idea.
05:05sm0kelazybot: ? any comments?
05:07clgvsm0ke: he is literally a bot ;)
05:07clgvsm0ke: usually using the default prefix "-" for existing methods should work
05:08Apage43&(println "hm")
05:08lazybot⇒ hm nil
05:12clgv,(println "Hello lazybot, nice to see you!")
05:12clojurebotHello lazybot, nice to see you!\n
05:13clgv,(println "lazybot, answer! ##(print \"sry, afk!\")")
05:13clojurebotlazybot, answer! ##(print "sry, afk!")\n
05:13clgvah damn forgot the filter list ;)
05:13Apage43I think someone had the forethought to fix that
05:13clgvyeah. about a year ago or so
05:13Apage43lest an enterprising individual get them into a loop
05:13clgvI did write conversations like that before ;)
05:13sm0ke,(repeat 1)
05:13clojurebot(1 1 1 1 1 ...)
05:14Apage43,(doc *print-length*)
05:14clojurebot"; *print-length* controls how many items of each collection the printer will print. If it is bound to logical false, there is no limit. Otherwise, it must be bound to an integer indicating the maximum number of items of each collection to print. If a collection contains more items, the printer will print items up to the limit followed by '...' to represent the remaining items. The root binding is...
05:15Apage43,*print-length*
05:15clojurebot5
05:17clgv,*print-level*
05:17clojurebot10
05:21RingdingHi, can anyone tell me if there is a name for the idiom that Clojure uses with STM and the commute function -- that is, free-running transactions whose results get merged in the end?
05:23clgvRingding: exploiting commutative operations?
05:24Ringdingclgv, doesn't sound very sexy ;)
05:24RingdingI don't suspect there is a good name for it
05:24clgvclgv: it has nothing to do with "merging in the end". with `commute` you just tell the STM that you do not care if the value of the ref changed and just apply the operation to the new value
05:25RingdingOk, but this can be used for merging
05:25clgvmerging what?
05:25RingdingThe state of two concurrent transactions
05:27clgvwell, phrasing it like that `alter` would be merging too ;)
05:35Ringdingalter can never see the state of two concurrent transactions, while commute can
05:38clgvRingding: not really in that way.
05:38clgvRingding: the difference is that `alter` fails and retries when the ref was altered concurrently, whereas `commute` does not
05:39RingdingOk, made your point
05:56dm3hello
05:56dm3was wondering if anyone could shed some light on what's happening in http://stackoverflow.com/questions/16160633/clojure-tools-logging-evalreader-use
05:56mercwithamoutho_O
06:14dm3'EvalReader not allowed when *read-eval* is false.' in the constructor of a class representing a `defn` which contains a `try` form with a `clojure.tools.logging/{log}` macro within
06:40clgvdm3: you should add the complete stacktrace
06:40clgvdm3: and the version of tools.logging you use
06:51dm3clgv: that's actually not my question on SO, but I've posted the stacktrace and version as an answer there (too long for a comment) as I have exactly the same problem
07:00clgvdm3: well my intuition there is - if all the other log calls work, that specific log call should not be different
07:01wei_I'm using leiningen's :java-source-paths and it's compiling the java source every time. is there a way for lein to tell if it hasn't changed?
07:06hhenkelHi all, how would I read all files in a folder? I guess I would use (file-seq (clojure.java.io/file "/path/to/files))? But what is missing up front, doseq and slurp at the back?
07:08hhenkelOkay, seems I it works kind of. Is there the possibility to only have files matching a string or check if it is a file or a folder?
07:09clgvhhenkel: you probably need to use the api of java.io.File there which is the class of the object you get by clojure.java.io/file
07:27hhenkelclgv: okay thanks. I think I almost got it, only the actual data is missing...
07:27hhenkelhttps://www.refheap.com/18578 is what I'm doing...
07:28hhenkelI'm facing a "NullPointerException jolokia-client.core/eval2055 (NO_SOURCE_FILE:1)"
07:29ucb,(doc slurp)
07:29clojurebot"([f & opts]); Opens a reader on f and reads all its contents, returning a string. See clojure.java.io/reader for a complete list of supported arguments."
07:30ucbdoes slurp work on a file-sew?
07:30ucbseq even
07:35hhenkelucb: in my code I use file after file so that in my understanding slurp is used with on file after the other. You don't agree?
07:35ucbhhenkel: oh, no idea, I was just pondering :)
07:35ucbhhenkel: I haven't looked at your code in that much detail and I also don't know what you're trying to do nor what the problem is. I was basically just butting in :)
07:36hhenkelucb: okay ;)
07:36sheldonhis there a repl toy that displays incremental evaluation of the expressions i enter, the way they demonstrate the cut'n'paste power of referential transparency in the SICP videos? so if i entered (+ (inc 1) (dec 1) it would display on multiple lines: (+ (inc 1) 0) ... (+ 2 0) ... 2
07:37sheldonhi meant (+ (inc 1) (dec 1)) (missing closing paren)
08:29scottjsheldonh: I think tools.trace might do that, but I haven't used it
08:30clgvsheldonh: lighttable had (still has?) such a mode
08:41nenorbotcan anyone help me with clojurescript please? cljsbuild keeps complaining that it can't find domina in classpath, even though i've added it to my project.clj
08:47Hetubetter separate work and leisure
08:52hhenkelAnyone able to provide some help? https://www.refheap.com/18582
08:53ro_stwhat's the problem?
08:55hhenkelI want to read multiple files and the "config" gives me an error when I try to access it.
08:55ro_stwhere is config defined?
08:55ro_stoh, duh.
08:55ro_stso, config isn't a function
08:56ro_stit's just a var containing the results of the doseq, which is nil because doseq doesn't return anything
08:56ro_st(defn config [] (doseq …)) (config) will cause the doseq to run when you (config) rather than before
08:59hhenkelro_st: hmm...not totaly sure if I get it right....so how would that work with let then?
08:59ro_stdo you want the file stuff to happen when you call (config) ?
09:00hhenkelNope, I want to read the files (containing config data) at the start of my program and work with the data later on.
09:01ro_stusing doseq makes it that you can't get at the data this way
09:01ro_sti'll share new code with you
09:03hhenkelro_st: that's nice, thanks.
09:06ro_sthttps://www.refheap.com/18583
09:07tarankanenorbot, try to use lein in dependecies instead of manual download
09:08tarankahttp://www.myclojureadventure.com/2012/09/intro-to-clojurescript-getting-started.html - some exmplaes
09:09ro_stgood luck hhenkel
09:40zanesI'm having some trouble calling a method on an instance of a Java object I've created. I keep getting "IllegalArgumentException No matching field found…". I even verified that the method exists on the instance with reflect.
09:40zanesI must be missing something obvious.
09:41ambrosebszanes: perhaps it's not a public field?
09:41zanesambrosebs: Reflection says it's public.
09:42ambrosebszanes: in a public class?
09:42zanesambrosebs: Yep. Public and final.
09:42ambrosebsok
09:42ToxicFrogArgument type mismatch? Can you paste the code?
09:43zanesToxicFrog: I thought it might be some kind of type issue, so I tried to cast the argument to the desired type but no success. I'll paste the code. Just a moment.
09:44zaneshttps://gist.github.com/e937554d3c00758b9787
09:44zanesImports: https://gist.github.com/4d04ac9af482d8b320e1
09:45silasdavisif I am using the for macro like (for [{:keys [foo] :as all} m] ...)
09:45silasdavisis it possible to supply the destructuring map as a variable/value
09:45ambrosebszanes: which field is the issue?
09:46ambrosebsfreeze I guess?
09:46zanesambrosebs: Last one.
09:46zanesgetJsonSchema.
09:46silasdavisI see I can't do (def ds {:keys [foo] :as all}), but can I make something similar work by quoting appropriately?
09:46ambrosebszanes: oh right, the error is just mistleading
09:47zanesOh yeah? What's it trying to tell me?
09:47zanesHere's the output of reflect, by the way: https://gist.github.com/eb15bd0dacf3f2bd53e5
09:47ambrosebszanes: sorry, I meant I was looking for a field lookup (judging by the error msg), but getJsonSchema should be method.
09:47lpetitHello
09:48zanesOh, got it.
09:48lpetitAnybody here having used the beta version of Counterclockwise with the auto shift feature ?
09:48zanesDamn. I was hoping you'd figured it out. Haha
09:48ambrosebssilasdavis: you need to use macros that use `for` and insert the destructuring in the right position.
09:48ambrosebslpetit: hello :)
09:49zanesIt's weird; I can call the methods that don't take arguments without issue.
09:49lpetitambrosebs: hello !
09:49TEttingerzanes, the code is here right? https://github.com/fge/json-schema-validator/blob/master/src/main/java/com/github/fge/jsonschema/main/JsonSchemaFactory.java#L193
09:49silasdavisambrosebs, could you give an example?
09:49ambrosebszanes: is the reflection happening at runtime?
09:49TEttingererr no https://github.com/fge/json-schema-validator/blob/master/src/main/java/com/github/fge/jsonschema/main/JsonSchemaFactory.java#L173
09:49silasdavisyou mean I need to write a macro to do this?
09:50ambrosebszanes: what does *warn-on-reflection* say?
09:50zanesTEttinger: I'm trying to call this overload: https://github.com/fge/json-schema-validator/blob/master/src/main/java/com/github/fge/jsonschema/main/JsonSchemaFactory.java#L173...L178
09:50ambrosebssilasdavis: Yes.
09:50zanesambrosebs: A bunch of newlines and then nil…
09:51TEttingerzanes, I'm guessing that you have something that isn't a JsonNode
09:51TEttingerlike null?
09:51zanesTEttinger: Sadly, no. It's a ObjectNode, which derives from JsonNode.
09:52xeqizanes: http://jackson.codehaus.org/1.7.9/javadoc/org/codehaus/jackson/map/ObjectMapper.html looks like .readTree returns a org.codehaus.jackson.JsonNode
09:52xeqiwhere the method expects a com.fasterxml.jackson.databind.JsonNode
09:52zanesxeqi: Aha!
09:53zanesThat must be it. Thanks for the help, everyone.
09:53TEttingerhaha that is a crazy error. glad you got it solved.
09:53ambrosebsouch
09:56ambrosebszanes: if such insane errors are frequent with this library, you could try out the methods at the REPL with core.typed and interpret the type error.
09:57zanesambrosebs: Good idea. I've been looking for an excuse to learn core.typed.
09:57zanesYou worked on that, right?
09:57ambrosebszanes: yes
09:57zanesDuring my brief stint in grad school I sat across from Sam.
09:57ambrosebszanes: nice! :)
09:57zanesGreat guy.
09:57ambrosebszanes: at Northeastern?
09:57zanesYep.
09:58ambrosebszanes: I'm looking forward to meeting him, whenever that happens.
10:00zanesambrosebs: If the Conj keeps being co-located with the Scheme & Functional Programming Workshop it'll happen eventually.
10:01ambrosebszanes: yes. A goal of mine is also PhD at Indiana, hopefully he sticks around there.
10:01zanesambrosebs: Specifically to work with Sam?
10:02ambrosebszanes: Not specifically, by it makes it oh-so-much sweeter.
10:02ambrosebs*but
10:02ambrosebsSam was the last reason for me to consider Northeastern, when he moved to Indiana the choice seemed obvious.
10:03ambrosebsWell, obviously not the *last* reason :P
10:03ambrosebsYou know what I mean.
10:04ambrosebsI also want to work with Dan Friedman and his logic programming crew.
10:04ambrosebsThat's been a dream for a few years.
10:14TimMczanes: I think you were my TA for Fundies.
10:15zanesTimMc: Fun times!
10:15TimMcIt was.
10:17sheldonhscottj: yeah, clojure.tools.trace isn't as fine-grained as i have in mind, but thanks. still useful for me to know about
10:17sheldonhclgv: cool, i'll check out lighttable then. thanks
10:29borkdudehow can I ensure in datomic only one entity for a given point in time exists that has an attribute :myid/version
10:29borkdude:mydb/version
10:34TimMcborkdude: Just keep writing to the same ID, yeah?
10:35borkdudeTimMc yes, probably it's best to introduce a name attribute that is also unique
10:48borkdudecan I transact schema updates and data that is based on the schema (in that order) in one transaction in Datomic?
10:56nenorbotany idea why httpkit won't serve files under public/resources?
11:05cmdrdatsflatten
11:06cmdrdatsis there something not great about flatten? I seem to remember discussions about it a while ago?
11:06`cbp~flatten
11:06clojurebotflatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.
11:06cmdrdats`cbp: excellent - exactly what i was looking for, thanks
11:20samlhola
11:20`cbphi
11:29samli'm gonna learn clojure
11:29samlhow much can i learn in one day?
11:31hyPiRionsaml: depends heavily on your background. Do you know lisps? Do you know any other functional programming language? If not, it will be hard to be able to do anything productive within a single day.
11:31llasramFor JVM Clojure, I'd say Java/JVM familiarity will also have some impact
11:31tarankaif u know some of lisp - as much as u can read pages.
11:33hyPiRionllasram: same goes for clojurescript and javascript I guess
11:34llasramnah. Totally orthogonal! </lying>
11:35samli don't know lisp. i just registered for clojure tutorial on CUFP
11:37hyPiRionsaml: Hmm. What languages do you know from before (if any)?
11:38mdrogalissaml: Just enjoy the learning, whatever pace comes to you. You'll have fun.
11:38hyPiRion(inc mdrogalis)
11:38lazybot⇒ 1
11:39mdrogalisDing.
11:40saml(dec mdrogalis )
11:40lazybot⇒ -1
11:40llasramWell, apparently you already know *some* Clojure :-)
11:40mdrogalisHah
11:42dnolenhrm I can't really see why set-print-fn! is exported in CLJS, doesn't seem particularly useful under advanced compilation due to dead code elimination. What do other people think?
11:43mdrogalisdnolen: If it's serving no purpose, axe it.
11:44dnolenmdrogalis: heh well want to CLJS users input first :) I'm curious how it could be used, could always be missing something
11:44nappingwhy would it be dead?
11:45mdrogalisdnolen: Ah, I thought you consclusively found that it was always getting eliminated. My bad.
11:45dnolennapping: you can always set-print-fn! from your own code of course, but exporting it, it means you want other people to be able to use it after advanced compilation
11:46dnolennapping: the only code that does use it are REPLs, but of course REPLs don't really work with advanced compilation
11:46dnolenso I can't see a good reason to export it.
11:46ToBeReplacedwhere are pre/post conditions stored on an object?
11:47mdrogalisToBeReplaced: I think in its metadata?
11:48ToBeReplacedmdrogalis: it's not collected in meta
11:49bjaare there any verbose or debug options to cljsbuild? suddenly it's complaining that dommy isn't on my classpath, but lein classpath disagrees
11:49mdrogalisToBeReplaced: Hm..
11:49llasramToBeReplaced, mdrogalis: in the metadata on the Var (vs on the function held by the Var)
11:50mdrogalisYer.
11:50ToBeReplacednot there, at least not in nrepl?
11:51ToBeReplacedllasram: (defn foo [x] {:pre (number? x)} x) (meta #'foo) (foo nil)
11:51ToBeReplacedmeta doesn't show any conditions, but call throws the assertion error
11:52`cbpToBeReplaced: I think they are inserted at the top/bottom of the function as asserts
11:52BronsaToBeReplaced: (fn [] {:pre [false]} "") gets transformed to something like (fn* ([] (assert false) ""))
11:52llasramYep, I was entirely wrong, for which I apologize
11:53ToBeReplaced`cbp: Bronsa: okay, thanks... makes sense
11:53mdrogalisYeah, my bad.
11:54ToBeReplacedmdrogalis: llasram: meta seemed like a logical place :) though the asserts make sense too, and probably simplifies the code a ton
11:55gfredericksdoes a standard jetty-adapter ring setup not support gzip by default?
11:59bjadoes cljs support require's :refer?
11:59tbaldridgebja: yes
11:59tbaldridgebja: but not :refer :all
12:00bjaok, thanks
12:01tickingdoes somebody know if the timbre logging lib is supposed to be thread safe?
12:03`cbpit'd be nice if nrepl could give you multimethod arg lists :P
12:04`cbpI wonder if its possible. Dont know much about how nrepl works
12:06ToxicFrogIt seems like there should be a way to use metadata instead of (ann)
12:06ToxicFrogOr have it infer the type of defs from their initial value
12:06bjahttps://gist.github.com/ed4357f7b1c0399c8b78
12:07gfredericks,(fn ^{:x [does this get eval'd?]} my-fn [])
12:07clojurebot#<sandbox$eval29$my_fn__30 sandbox$eval29$my_fn__30@fe47c>
12:07bjaany idea how I'd get that with a :compiler {:externs []}?
12:11`cbpCan you attach metadata to a defrecord?
12:12gfredericksyep
12:13`cbpI'm not sure how, it says Expecting var, but MyRecord is mapped to class user.MyRecord
12:40tufflaxI asked this earlier, but I might just ask again to get more input...
12:40tufflaxI have not used logging much before, but I'm thinking about starting to use it more for an application I'm working on. But before I do, I wanted to ask you guys what you think about logging. I find that if I have a bug, I add a bunch of printlns but then remove them again afterwards. That seems stupid. Do you guys use logging? Using robert.hooke together with logging seems nice, I don't wanna add l
12:40tufflaxogging calls in the rest of my code. :p
12:44nappingwhy does gen-class need the superclass to exist?
12:45mdrogalistufflax: That's why I wrote this. http://michaeldrogalis.tumblr.com/post/46560874730/beautiful-separation-of-concerns
12:45ToxicFrogIs it just me or core.typed kind of unwieldy?
12:45tufflaxmdrogalis: i'll take a look
12:47tbaldridgeToxicFrog: I agree, I really wish it had a metadata like syntax or some way to integrate with defn better
12:49arohnertufflax: logging is good
12:49tufflaxarohner: :)
12:49arohnertbaldridge: it does have metadata support, in recent releases
12:49arohnerI still use (ann foo) (defn foo), because I like the indention better
12:50arohner(defn ^{:ann '[Any -> Any]} foo [x] x)
12:50llasramcore.typed is great work, and I plan to use it, but kind of this: http://this-plt-life.tumblr.com/post/44373483122/when-somebody-tries-to-add-a-type-system-to-an-existing
12:51nappingSo :methods can't be used to explicitly declare the type you expect inherited methods to have, darn
12:52arohnertufflax: but seriously, I use tools.logging, and we log everywhere. For the important stuff, we tend to need to log inside functions; wrapping doesn't give granular enough information
12:53tbaldridge (inc llasram) , I've thought of that several times
12:53tufflaxarohner: I see. I think I'll be fine with wrapping for now. Thanks for the input!
12:53gfredericksarohner: tufflax: I think an interesting rule of thumb that I haven't tried is that if you want to log in the middle of a function then you ought to refactor it
12:53arohnerllasram: tbaldridge: it's really not that bad
12:53nenorbotis there some way to find the type of object in clojurescript?
12:54tufflaxgfredericks: yeah I was thinking along the same lines
12:54tbaldridgenenorbot: use (type obj) ?
12:54hyPiRionllasram: I would guess it's easier to go the other way around. From typed to partially typed
12:55nenorbotthanks tbaldridge
12:56gfrederickstufflax: arohner: I've been noodling the idea of a comprehensive hooks-based logging lib
12:56gfrederickswould give lots of options for logging args, return values, and exceptions
12:56gfredericksI'm curious if most logging can boil down to that sort of thing
12:57arohnerfor our app, we can't log everything, due to data volume, and noise
12:58tufflaxgfredericks: couldn't that be done with robert.hooke and then a logging lib?
12:58arohnerso if a fn takes a user and returns a user, we'd probably only log (:login user), rather than the entire user object
12:58gfrederickstufflax: I think some helpers would make it more declarative; especially if the logging lib were data-based rather than string-based
12:58janiczekI wonder - is it possible to return nil value intentionally in core.async (thread)-ed call? https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L361
12:59gfredericksarohner: that kind of thing would be part of the configurability
12:59tufflaxyeah that's something I've beeng thinking about, logging data instead of text
12:59gfrederickstufflax: I built a tools.logging wrapper lib for logging data
12:59gfredericksit goes out through log4j as json into splunk
12:59gfredericks_great_ experience
12:59janiczekit seems to me that the two cases (1. intentional nil, 2. catched exception -> nil) get merged together ...
13:00tufflaxcouldn't one just use `prn` or something with clojure data?
13:00gfrederickstufflax: not if you want the log output to be pure data
13:00gfredericksi.e., not with the normal logging preamble
13:00rasmustosounds too close to "pickling" to me
13:00tufflaxgfredericks: ah
13:01gfrederickstufflax: since we have one json object per line in the log file, we can use jq for exploring/watching; it's extremely convenient
13:01gfrederickstail logfile | jq 'select (.type == "what-i-care-about") | [.some, .keys]'
13:01tufflaxjq... gotta look it up :P
13:01bjaanyone familiar with Google Closure Compiler freaking out at com.google.javascript.jscomp.CommandLineRunner.getDefaultExterns()?
13:01tufflaxoh
13:01tufflaxjquery?
13:02gfrederickstufflax: no it's just a shell processor for json
13:02tufflaxok
13:02gfrederickshttp://stedolan.github.io/jq/
13:02tufflaxI see
13:02gfredericksbeing able to pick out keys like that when watching logs makes it cheap to throw lots of data into the logs just in case
13:03tufflaxgfredericks: yeah, certainly something to think about
13:03tufflaxthanks
13:03bjaI found out a workaround involving passing a compiler option of :use-only-custom-externs true so that it avoids invoking getDefaultExterns during cljs.closure/load-externs
13:04ToxicFrogarohner: recent here being HEAD, or 025?
13:05bjabut I haven't actually solved for why getDefaultExterns started throwing java.lang.NoSuchMethodError: com.google.common.io.ByteStreams.limit(Ljava/io/InputStream;J)Ljava/io/InputStream
13:05arohnerToxicFrog: core.typed metadata support? that was added in 0.1.24
13:05bjathis also only seems to happen with cljsbuild, since running cljs.closure/build manually works without exception
13:06arohnerhttps://github.com/clojure/core.typed/blob/master/CHANGELOG.md
13:09ToxicFrogarohner: Oh. Is this documented?
13:09ToxicFrogOn the wiki/readme, I mean, not the changelog.
13:10arohnerI don't recall
13:10ambrosebsarohner, ToxicFrog: Metadata kinda works, I wasn't too happy with the design.
13:10ambrosebsStill in the back of my mind.
13:11danielszmulewiczIs the idiomatic way to do string interpolation in Clojure?
13:12arohnerdanlarkin: clojure.core.strint
13:12danlarkin:o :o
13:12danielszmulewicz"src/{{sanitized}}/foo.clj"
13:12danielszmulewiczwhat are those double curly braces?
13:13seancorfielddoesn't that originate from the mustache template library?
13:13hyPiRiondanielszmulewicz: moustache-code
13:13`cbpdanielszmulewicz: syntax for a template engine
13:13danielszmulewiczhyPiRion `cbp: gotcha. thanks.
13:13seancorfieldit turns up in a lot of languages
13:13hyPiRiondanielszmulewicz: https://github.com/technomancy/leiningen/blob/master/doc/TEMPLATES.md#templating-system
13:14danielszmulewiczseancorfield: thanks
13:14nenorbotI'm trying to access a property of a javascript object through clojurescript, using the function notation (ie, (.foo x)) but I am getting an error that "x.foo is not a function"... any ideas?
13:14seancorfieldSelmer is a new Clojure lib that implements Django-style templating, which also looks like that for variables.
13:14ambrosebsarohner, ToxicFrog: oh you were talking about :ann. Nvm :P
13:14seancorfieldnenorbot: (.- x foo) i think?
13:18nenorbotseancorfield: thanks! it's (.-foo x)
13:18nenorbotfor some reason i thought the syntax was the same for both functions and properties
13:18ToBeReplacedi'm having weird behavior with macroexpand in a clojure.test is thrown? form... i get different values when using it in the repl vs in lein test... any guesses?
13:18tbaldridgenenorbot: it is in Clojure, not in ClojureScript
13:19nenorbottbaldridge: probably why i thought that :)
13:19nenorbothmm... is there any reason for the distinction?
13:19arohnerToBeReplaced: have you changed the macro definition at the repl?
13:19arohnerif that's the case, you'll need to recompile all files that use the macro to get consistent behavior
13:20dnolennenorbot: the JVM can distinguish between property and method invocation, there's no way to do this in JS
13:21ToBeReplacedarohner: no, fresh repl -- specifically, (macroexpand '(my-macro x)) expands in the repl, returns '(my-macro x) in lein test
13:25dnolenClojureScript "Hello world" now 2 lines http://gist.github.com/swannodette/6540713
13:27ToBeReplaceddnolen: nice
13:29dnolenthe next big pet peeve TODO - source maps, seangrove what state is your branch in?
13:33gfredericksdnolen: that random number string line is super fascinating. I'm curious if there's some utility to having it.
13:33seangrovednolen: Working more or less
13:33seangroveThere are problems around the tooling that probably need to be working into cljsbuild
13:33dnolenseangrove: oh! really! were you able to fix the off by one error?
13:33seangrovednolen: Yeah
13:33seangroveColumn location for lots of things worked
13:34dnolengfredericks: yeah I looked around in Google Closure looks like something from the body of goog.string.getRandomString
13:34ambrosebsllasram: luckily Clojure is quite accommodating to a type system because it's (Clojure) so well designed! I'd be surprised if you still thought of fish bashing after trying it, IMO it models nicely how real programs are designed.
13:34dnolenseangrove: that's awesome, can you construct a flattened patch and attach to source map ticket so I can review?
13:34ambrosebsllasram: the *amount* of annotations needed is a different issue, that's a tradeoff for bug-finding capability and error reporting.
13:36gfredericksambrosebs: do you discuss somewhere why you didn't take the metadata approach to annotating?
13:36seangrovednolen: I'll have to do it tomorrow, I'm going to JSConfEU and jet lagged pretty badly
13:36dnolenseangrove: no rush
13:36gfredericksambrosebs: I'd accept "you don't know what on earth you're talking about" as a fair response
13:36dnolenseangrove: you speaking?
13:36matthiasndnolen: sweet
13:36seangrovednolen: No, just attending
13:36ambrosebsgfredericks: LOL
13:36technomancygfredericks: I think that got added?
13:37gfrederickstechnomancy: like super recently?
13:37technomancyish
13:37seangrovednolen: Also, it seems the source files need to be manually copied to a web-accessible location to show up in the browser
13:37ambrosebsgfredericks: yes it's there. maybe a month ago?
13:37gfredericksI was just looking at core.typed a week or two ago
13:37seangroveHave you found a way to get chrome to work with a file:// url?
13:37gfredericksmust've missed it
13:37ambrosebsgfredericks: it's not documented very well
13:37gfredericksthx; apparently I don't know what on earth I'm talking about
13:37ambrosebsgfredericks: I personally much prefer ann.
13:37dnolenseangrove: I doubt that's allowed but I consider that a non-issue :)
13:37gfredericksambrosebs: am curious why
13:38seangrovednolen: Heh, ok, it would be very nice though. The manual copying is bothersome. cljsbuild can be extended to handle it though
13:38ambrosebsgfredericks: just the way it looks.
13:38dnolenseangrove: I just want to know that it works, we can tweak the patch so it goes into whatever location people want as specified by a compiler option
13:38dnolenseangrove: no need for cljsbuild to handle it, we can respect the path in CLJS compiler
13:38ambrosebsgfredericks: I push the ann above the defn, and my brain likes it.
13:38ambrosebs*put
13:39ambrosebsmetadata gets ugly if you have to use ^{} syntax
13:39ambrosebsand it looks a little like haskell if you use ann :)
13:39gfredericksambrosebs: okay, so for the syntax rather than the semantics
13:40ambrosebsgfredericks: there is no semantic difference.
13:40technomancyyou could get your editor to toggle visibility of metadata
13:40ambrosebsgfredericks: it may be surprising, but I don't lookup the metadata on the var.
13:40ambrosebsI look at the def via an AST.
13:41Bronsatechnomancy: you can get your editor to toggle `ann` aswell :)
13:41ambrosebsunfortunately this doesn't quite work with Clojure AST's yet, but CLJS it works fine.
13:41gfredericksambrosebs: so the ann clause doesn't do anything? just gets noticed when analyzing the code?
13:41ambrosebsgfredericks: yes.
13:41seangrovednolen: But when the source map is generated, it'll have entries like "/src/hello/foo/bar.cljs" - chrome will then try to load "http://localhost:3000/src/hello/foo/bar/cljs&quot; when examining the source
13:41gfredericksambrosebs: interesting
13:42technomancyBronsa: heh
13:42ambrosebsgfredericks: I'm anti side-effect with gathering annotations.
13:42seangroveThat won't be there unless there's a file in "resources/public/src/hello/foo/bar.cljs", so you pretty much end up copying src to resources/public/src
13:42ambrosebsgfredericks: it's an explicit phase in the checker.
13:42Bronsaambrosebs: we could try and see if it works better with CinC's analyzer one day
13:42ambrosebsBronsa: please!
13:42dnolenseangrove: right, I remember - again it's a simple detail that I don't suspect will be difficult to sort out :)
13:42gfredericksambrosebs: I was looking at core.typed mostly because I wanted to be able to have one type declaration of a really large HMap, and have variants of it throughout the system that get inferred; after playing for a few hours I decided this wasn't possible
13:43seangroveFair enough
13:43Bronsaambrosebs: I'll put that in my todo list
13:43ambrosebsgfredericks: what kind of variants?
13:43gfredericksambrosebs: arbitrary assoc's and dissoc's, without having to explicitely declare every possible variant
13:44gfrederickse.g., if I have a service that reads a large json object from an external service, then does a bunch of transformations on it and serves that modified version
13:45gfredericksambrosebs: I talked to brehaut about this and he pointed out that type systems are super hard and I had no idea what I was talking about
13:46ambrosebsgfredericks: haha. I don't think it sounds particularly hard, I'd be interesting in hearing specifics.
13:46ambrosebsgfredericks: the type system may just be missing one feature to enable it.
13:47gfredericksambrosebs: it seemed hard to annotate this correctly: (fn [m] (assoc m :foo 12))
13:47gfredericksambrosebs: I could annotate it with an HMap that included :foo, but not in such a way that it would infer the correct output of (m {:bar "a string"})
13:48gfredericksi.e., the only thing it knew about that second form was that it had a :foo in it; it had forgotten about :bar
13:49ambrosebsgfredericks: ok, core.typed handles that easily.
13:49ambrosebs(cf (fn [a] (assoc a :foo 121)) ['{:bar Number} -> '{:bar Number, :foo Number}])
13:50gfredericksambrosebs: but then the {:bar Number} is fixed, no? I can't call it with (m {:fazzle :dazzle}) anymore?
13:50sdegutisI very inefficiently made this work on Mac: (= [1] (.arrayWithObject: ^NSArray 1))
13:51ambrosebs(cf (assoc {:bar 'a} :bar 1)) => '{:bar (Value 1)}
13:51ambrosebsis that what you mean?
13:51sdegutisAnd identity was a little weird. (= [1 2 3] '(1 2 3)) but (not= "foo" 'foo)
13:51ambrosebsyou can "update" the :bar
13:52tylereHow can I have a function that takes, say, two required arguments and then an optional 3rd argument that must evaluate to an empty map if missing
13:52callentylere: sounds like standard destructuring to me :)
13:52gfredericksambrosebs: no, not necessarily for overriding values
13:53tylerecallen: eh? I don't know that the keys will be if present, unless I'm missing something
13:53seangrovetylere: (defn f [x y & [z]] (let [z (or z {})] ...))
13:54gfredericksambrosebs: I want (defn add-foo [m] (assoc m :foo 12)) to type check for any input HMap; so (cf (add-foo {:bar 12})) would give '{:foo Number, :bar Number} while (cf (add-foo {})) gives '{:foo Number}
13:54tylereseangrove: agh, yea, that should do it!
13:54seangroveBut you could do it in the fn declartion as well if you want it terser
13:54callentylere: there are some Clojure koans out there for destructuring, if you go through some exercises, you'll become more fluid at doing that.
13:54ambrosebsgfredericks: ok. Yes, unsupported atm. But definitely not a fundamental limitation.
13:54callentylere: could save you the trouble of doing the (or ...) in the let body if you so desired. whatever's clearer to your mind.
13:55ambrosebsgfredericks: core.typed should be able to handle things like ring middleware in theory.
13:56ambrosebsgfredericks: so.. watch this space :)
13:56gfredericksambrosebs: okay, glad to know I inferred correctly; this would just be some sort of parameterization over HMaps, no?
13:57coventry`tylere: There's also the possibility for multiple signatures: (defn f ([x y] (f x y {})) ([x y z] (main body)))
13:57ambrosebsgfredericks: Yes, with some special "update" type. (All [[m :< AnyHMap]] [m -> (Update m :foo Number)])
13:57tylereagh, neat didn't realize clojure could do that coventry`
13:58ambrosebsgfredericks: it's just a matter of writing Update. Should be straightforward.
13:58gfredericksambrosebs: so something similar to Update would support dissoc?
13:58ToBeReplacedarohner: bug reported https://github.com/technomancy/leiningen/issues/1326
13:58ambrosebsgfredericks: yes.
14:00callenseangrove: awesome @ cljs source maps enhancement :)
14:00gfredericksambrosebs: cool; I'm curious if we'd eventually be able to type check complex things like (reduce #(cond-> %1 (nil? (get %1 %2)) (dissoc %2)) m (keys m))
14:00ambrosebsgfredericks: Update would just expand out into a HMap as you'd expect, once m is instantiated.
14:02ambrosebsgfredericks: not sure.
14:02ambrosebsgfredericks: trying to figure out the type of the first argument
14:02gfredericksambrosebs: (defn remove-nil-keys [m] ...)
14:03gfrederickspulls out any key whose value is nil
14:03gfredericksprobably doesn't do exactly that
14:03gfredericksneed a contains? check I guess
14:03gfredericksno wait
14:03gfredericksit does do exactly that
14:03ambrosebsgfredericks: right. Probably too complex without some help with assertions.
14:04gfredericksambrosebs: it is not out of the question that I will someday do a deep dive on all this
14:05ambrosebsgfredericks: :)
14:05ambrosebsgfredericks: all very tempting isn't it
14:05gfredericksoh definitely
14:05gfredericksI feel like one of the biggest weaknesses of clojure-style programming is all the random HMaps flying around with undocumented key sets
14:06ambrosebsgfredericks: yes it's pretty awful.
14:06gfredericksif core.typed could someday make it easy to do that confidently, I think that'd be a huge win
14:06dnolennormanrichards: ping
14:06normanrichardshey
14:06Bronsagfredericks: I agree
14:06dnolennormanrichards: been busy with other stuff recently, but one thing I would like to help push forward if you're interested in getting pldb into core.logic
14:06gfredericksBronsa: ambrosebs: but I think declared types on all functions that use HMaps would be a _lot_ of noise
14:07arohnergfredericks: it's really not. you def-alias the 5-10 types your app uses
14:07ambrosebsgfredericks: ok, I disagree.
14:07ambrosebsgfredericks: very useful to me.
14:09dnolennormanrichards: as I was saying before is there any reason we can't do this via the lower level -run macro which can take arbitrary options?
14:09dnolennormanrichards: I was talking about this before on the ML and didn't respond, but on line 1191 of logic.clj you can see we merge opts into the meta of the substitution
14:10normanrichardsdnolen in the middle of something, but I wasn't exactly sure if that would solve the problem.
14:10ambrosebsgfredericks: as for the local annotations needed, it's annoying while your writing, but it helps me read code. Just use short aliases and the flow of types is obvious.
14:11dnolennormanrichards: sure, I'm pretty sure it can though, it's more or less how confining to tabling to individual runs works, and it seems to work well.
14:11ambrosebsgfredericks: of course you could just do a pass after you've written it in untyped Clojure.
14:13normanrichardsdnolen let me take a look one more time. I remember having a reason I didn't think that would work right, but it's escaping me now
14:14ToxicFrogYeah, I'm currently experimenting with typifing a working program written in untyped clojure, and I'm ending up with things like (typed/ann help (clojure.lang.IPersistentMap String String))
14:14ambrosebsgfredericks: this is what typed namespaces usually look like. A few aliases and short annotations https://github.com/frenchy64/core.typed-example/blob/master/src/fire/simulate.clj
14:14ToxicFrogHow hard would it be to infer the type of a var from the initial (def) of it?
14:14Bronsaambrosebs: on a side note, I really don't like the "-" in `def-alias` :(
14:16ambrosebsToxicFrog: It would be easy. But it's not clear if it's a little too clever for things like IDE support and def's being used before they're def'ed.
14:16ambrosebsToxicFrog: I want to write a tool that generates a good guess for your defs.
14:17ambrosebsToxicFrog: then you can insert it in your program where you like.
14:17ambrosebsToxicFrog: and there's no added trickiness to handle for tooling.
14:18ambrosebsToxicFrog: also, just checking you know about the shorthands for some common types http://clojure.github.io/core.typed/#clojure.core.typed/Map
14:18ToxicFrogI totally didn't! That will make things nicer.
14:19ambrosebsToxicFrog: please let me know if you want some common aliases in core.typed.
14:20ambrosebsBronsa: :(
14:20bmabeyodd, I always thought atoms themselves (not the current values) could have metadata.. doesn't look like that is the case
14:20bmabey,(with-meta (atom 42) {:data-about-identity :blah})
14:20clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Atom cannot be cast to clojure.lang.IObj>
14:20ambrosebsbmabey: I think atoms have mutable metadata.
14:21ToxicFrogambrosebs: sure thing.
14:21ToxicFrogThanks.
14:21ambrosebs,(alter-meta! (atom 1) assoc :a 1)
14:21clojurebot{:a 1}
14:22bmabeyah, great to know, thanks ambrosebs!
14:22ambrosebsnp
14:22muhooi haven't used etags in emacs/clojure yet, is that the recommended way to jump to a function definition?
14:23callenmuhoo: no, that's the old fashioned way.
14:23muhooproject is getting big and i'm getting annoyed manually jumping around.
14:23callenetags are for cranky bastards writing C.
14:23arohnermuhoo: use nrepl
14:23muhooi am using nrepl
14:23callenthen use nrepl. :P
14:23muhooi didn't see a function in the mode help to jump to to a function def
14:23callenmuhoo: https://github.com/clojure-emacs/nrepl.el ctrl-f "definition"
14:23ToxicFrogOh hey, I just ran into what you were discussing earlier with typing functions that update a map with new fields.
14:24arohnermuhoo: my C-. is bound to nrepl-jump
14:24ambrosebsBronsa: I'm not sure why I chose def-alias. Probably because I was porting Typed Racket :)
14:25arohnermuhoo: sometimes I need to compile the file to make jumping work, but it mostly works great
14:25ToxicFrogWhoops. I have managed to confuse it with anonymous functions.
14:25ToxicFrogfn> with inline annotations, yes>?
14:26ambrosebsToxicFrog: what are you asking? :)
14:26muhooarohner: thanks!
14:28ToxicFrogambrosebs: if it can't resolve types in an anonymous function, I should replace (fn [x y] ...) with (fn> [x y :- XType YType] ...) - or whatever the syntax is for multiple arguments, the documentation doesn't seem to be clear on this point.
14:28ambrosebsToxicFrog: yes, arguments default to Any if unannotated.
14:29ambrosebsToxicFrog: (fn> [x :- XType, y :- YType] ..)
14:30gfredericksambrosebs: so are map literals a shorthand for HMaps?
14:31ambrosebsgfredericks: '{:foo Any} is (HMap :mandatory {:foo Any})
14:33sdegutis(inc wei_)
14:33lazybot⇒ 1
14:37ToxicFrogambrosebs: Any is in clojure.core.typed, right? Because it can find t/Vec and t/Map but not t/Any.
14:37ambrosebsToxicFrog: no, Any is just syntax like U and Fn
14:37gfredericksambrosebs: yeah I suppose it's not too noisy on average
14:38ambrosebs:)
14:42gfredericksambrosebs: brehaut I think said you didn't like haskell-style non-local inference?
14:43ambrosebsgfredericks: it's great in a language built around HM inference.
14:43mdrogalisJust discovered clojure.inspect. That can come in handy for sure...
14:43ambrosebsgfredericks: Clojure isn't :)
14:44gfredericksambrosebs: is there an easy way to explain to a newb like myself in what sort of way it would not go well?
14:45ambrosebsgfredericks: we couldn't have nice things like unions and function intersections.
14:46ambrosebsgfredericks: they're essential in modelling how Clojure works.
14:46technomancynil is *everywhere* in clojure; you can't fight it =\
14:46gfredericksambrosebs: okay I think I will probably not understand this in minutes :/ oh well
14:46callenambrosebs: I didn't know there was an advantage to not having HM. Interesting.
14:46callenambrosebs: how does HM disallow type unions?
14:47callentechnomancy: embrace the chaos.
14:47ambrosebscallen: it's more that with local type inference we can make ad-hoc unions.
14:47technomancycallen: nihilist!
14:47callentechnomancy: an accurate statement. Next?
14:47ambrosebscallen: in HM you need to make a common supertype or similar.
14:48gfredericksambrosebs: maybe my issue is not knowing what is the essential difference between local and global
14:48callenalso Oracle users seem to really like Korma, or seen differently, Oracle users contribute to Korma more often than other database users.
14:48callenambrosebs: ohhh, you have to reify an algebraic type?
14:48coventry`This is interesting. Only happens in emacs's nrepl buffer (C-c M-j), not in "lein repl". (ns foo), hit return, then (defmacro tst "(ns bar)" []), hit return again. Return result is #'user/tst (not #'foo/tst) and repl is in the 'user ns. Also doesn't happen if you do "(ns foo) (defmacro tst "(ns bar)" [])" all on a single line.
14:48ToxicFrogambrosebs: oh. That explains a lot.
14:49coventry`https://www.refheap.com/18593
14:49ambrosebscallen: I'm pretty sure. Otherwise the inference would really struggle.
14:50callenambrosebs: that makes sense. (I'm trying to understand this as a past user of Haskell, OCaml and Scala, but not Typed Racket)
14:50callenin fact, a compare/contrast document would be...revelatory.
14:50callenjenkins, fetch me a scribe!
14:51ambrosebscallen: Typed Clojure really takes advantage of the flexibility local type inference gives you, so it's a trade off between annotations and accuracy.
14:51ambrosebscallen: turns out Haskell finds a sweet spot, but it's really hard to extend just a little further.
14:53callenambrosebs: technomancy really loves the "lightweight" feeling of HM'd langs like OCaml. I understand the appeal but I'd rather have a type system I fight less.
14:53callenhowever, the "lightness" is what makes it so nice to use monads and monad transformers in Haskell, whereas in Scala it's a bloody horror.
14:54callenmaybe macros for annotations in Typed Clojure can ameliorate this?
14:54ambrosebscallen: fundamentally, macros in Scala and Clojure are going to have similar type signatures.
14:54callenambrosebs: that's not my point or what I'm talking about.
14:55callenambrosebs: I'm saying the nice-to-use macros in Clojure are more viable for cleaning up type system explicit-ness than what you could in Scala or Haskell.
14:55callenTemplate Haskell and Scala macros are not remotely comparable to lisp macros.
14:55callendon't let them make you think they checked off that tick box.
14:55ToxicFrogHuh.
14:56ToxicFrogcore.typed has detected a bunch of misnamed namespaces that nonetheless somehow work.
14:56ambrosebscallen: yes, macros are great for hiding local annotations.
14:56ToxicFrogAlso, is there a way to say "check this ns and everything under it"?
14:56callenToxicFrog: errr...how'd they work?
14:56callenambrosebs: I don't even mean hiding the whole annotations, I mean sugaring higher order patterns like in Scalaz.
14:56callenambrosebs: have you looked at Fluokitten or Scalaz?
14:56ambrosebscallen: nope
14:57ToxicFrogcallen: I have NO IDEA!
14:57ambrosebscallen: Scalaz, in awe for a few seconds :)
14:57ToxicFrogcallen: But I had in one file a (:require bltool.data.foo), and in bltool/data/foo.clj, (ns bltool.source.foo) (defmethod ...)
14:57callenambrosebs: I used Scalaz and Fluokitten as a kind of immune system reaction to giving up Haskell. Wanted to see if I could "keep" what I had before.
14:58callenambrosebs: Scalaz wasn't worth it, Fluokitten was. Fluokitten is why I was initially skeptical of a typed.clojure
14:58callenbecause Fluokitten was ridiculously lightweight and pleasant to use compared with Scalaz.
14:58ToxicFrogPossibly the fact that the only things it contains that are referred to from outside are actually defmethods on a multimethod declared in the correct ns?
14:58callenthese are relatively high-level and impractical concerns though, I think most Clojure users don't need to care.
14:58appendonlyi've found some vim clojure repl libraries, but i'm having trouble settling on the best one. i like conqueterm, currently. does anyone here prefer something else?
14:59callenappendonly: fireplace is the current standard choice.
14:59ambrosebscallen: Fluokitten is lightweight, but not as useful as Scalaz?
14:59ambrosebsI've never heard of Fluokitten, shall look it up.
14:59rasmustoappendonly: I don't use a traditional interactive repl, just fireplace and it's quasi-repl (cqc)
14:59ambrosebsohhh
14:59ambrosebsFluokitten.
14:59ambrosebsyes.
14:59ambrosebs:)
15:00ambrosebsTotally need to type that library :)
15:00callenambrosebs: Scalaz is more comprehensive, but Fluokitten still covers all the same bases and I prefer to Scalaz by far.
15:00callenambrosebs: well I'm talking about this so that you can stretch core.typed's legs.
15:00callenI want to see how well the local inference works on something like Fluokitten.
15:00callenbecause in Scalaz, Scala's local inference utterly failed.
15:00callenand made it painful.
15:01ambrosebscallen: right. I had some success typing algo.monads.
15:01callenalgo.monads...is a good start. the rabbit hole goes ever deeper thoguh.
15:01callenthough*
15:01callenit is my *suspicion* that it's doable but might take sugar to make usable.
15:01ambrosebscallen: FWIW macros were very useful for annotating monad transformers and things.
15:01callenthat's what I'm getting at exactly.
15:02ambrosebscallen: yep, there's nothing fundamentally different about Typed Clojure's and Scala's local type inference.
15:02ambrosebscallen: Scala is slightly smarter in some ways, Typed Clojure others.
15:02callenambrosebs: you can't really sugar things like those annotations in Scala. you're just stuck you end up having to make weird trade-offs between library design, semantics, and painful type sigs.
15:02callenstuck and*
15:02ambrosebscallen: ah.
15:02ambrosebscallen: ouch
15:02callenRight. This is why I was so mad.
15:03callenScala is why some people end up going full-blown "HM or go home"
15:03callenbecause they don't have real macros.
15:03ambrosebscallen: I briefly looked at Fluokitten before, it's well designed at least.
15:04appendonlycallen, rasmusto: thx
15:04callenseems to be. I've only experimented with it.
15:05ambrosebscallen: yes. I think your hunch is on the right track about macros.
15:05callenambrosebs: in a hypothetical universe, I prefer a system like Typed.Clojure's, but got burnt in the past by similar type systems not supported by a better language.
15:06callenambrosebs: I'm basically well-wishing you and hoping this ends up being what I always wanted to begin with :)
15:06ambrosebscallen: :) Clojure is a lovely base to build a type system on thankfully.
15:07appendonlyi'm new to the JVM. i typically learn a language by implmenting simple clones of shell utilities (cat, echo, xargs, grep). since clojure does take a bit to start up, i think that's not my best option to learn the language. what would be the most unix-y way i could learn clojure?
15:08gfredericksappendonly: what does "unix-y" mean aside from the stuff you just ruled out?
15:08callenappendonly: a persistent daemon/service could fit.
15:08eggheadappendonly: just use raynes conch library and be done :3
15:08appendonlygfredericks: an example would be writing a daemon
15:09callenappendonly: write a spellchecking daemon.
15:09callenappendonly: or take one of the items off my to-do list if you want to dive into the deep end.
15:10eggheadappendonly: learn clojure by playing with pallet maybe
15:10mdrogalisHey appendonly. I'd actually start by learning how to use Emacs and nrepl to totally avoid the start up time. Then you can proceed learning in the way you're most comfortable.
15:10callenegghead: no. don't.
15:10egghead:)
15:11eggheadcallen: I don't use pallet but why not
15:11callenegghead: pallet has a lot going on with it. a very busy library.
15:11callenegghead: yeah uhm, if you'd used pallet before you'd know why your suggestion isn't a good idea.
15:11callenpallet is for people that 1. Know Clojure 2. Want to provision a server.
15:11callenit's not a scripting library and it's going to scare new people.
15:12coventry`I asked this on #haskell earlier, but since there's fluokitten could someone point me at an example of a computation which is awkward to express without monads?
15:12eggheadhow about using https://github.com/Engelberg/instaparse then to write a lil' parser
15:12callencoventry`: synthread
15:12uvtcappendonly, startup is not *too* bad. I'd suggest using lein-exec to make scripts in Clojure. Maybe have a peek at <http://www.unexpected-vortices.com/clojure/brief-beginners-guide/standalone-scripts.html&gt;. You can shell out using `clojure.java.shell/sh`.
15:13mdrogaliscoventry`: tbaldrid_ or bbloom could probably do that. Heh.
15:13callencoventry`: core.async
15:13callencoventry`: jQuery
15:13callencoventry`: LINQ
15:13tbaldridgecallen: I'd say core.async's go Macro perhaps
15:13callencoventry`: Parsec
15:13callencoventry`: Instaparse
15:13tbaldridgecallen: nothing else in core.async uses monads
15:13appendonlycallen: please point me to your bug list :-)
15:13callentbaldridge: IOC?
15:14callentbaldridge: but yes, I was thinking of your go macro.
15:14bbloomi'd argue that the interesting bit is explicit implicit monads
15:14appendonlyuvtc: cheers. that's a good lead on how to do what i want
15:14tbaldridgecallen: yeah, the IOC macro uses monads, but it the actual IOC code doesn't use monads.
15:14hiredmanlein-exec is silly
15:14bbloomyou use monads ALL THE TIME implicitly
15:14mdrogalisThere he is D:
15:14mdrogalisIt's like Beetle Juice. I said his name too many times.
15:14coventry`bbloom: Yes, but I'm looking for examples where the monad abstraction buys you something in terms of expressiveness.
15:14uvtchiredman, why?
15:15appendonlymdrogalis: thanks, although the ideal is to have programs that are composable on the commandline and run quickly (plus i use vim ;-) )
15:15callencoventry`: jQuery?
15:15robinkIf I want to test for the presence of a keyword in a hashmap (in the predicate of an if, for example) and then act on its value, is there a "has keyword" function that just returns a bool and doesn't bother looking up the keyword, or should I use if-let?
15:15hiredmanuvtc: clojure has shebang support
15:15callenseriously, anything that chains operations against a collection is a faux list monad.
15:15uvtchiredman, Sorry, don't know what you mean. Could you explain?
15:15callenhiredman: lein exec is so you can use dependencies.
15:15bbloomtbaldridge: yeah, it's the same logical gap as the turing tarpit
15:15mdrogalisappendonly: There's nrepl support for Vim. Honestly, you're going to be way better off learning to work interactively as soon as you can.
15:16uvtchiredman, bbloom : Yes, I really like that I can use 3rd-party libs with scripts using lein-exec.
15:16robinkif-let sounds more efficient
15:16tbaldridgecoventry`: this code uses the state monad to manage what is being built, as well as the IDs of the last thing inserted. Code like this is hard to express without mutation or monands https://github.com/clojure/core.async/blob/master/src/main/clojure/cljs/core/async/impl/ioc_macros.clj#L380
15:16robinkSince there's a single keyword resolution call and the (useful) result is retained.
15:16hiredmanuvtc: https://gist.github.com/hiredman/5033484
15:17hiredman,(doc find)
15:17clojurebot"([map key]); Returns the map entry for key, or nil if key not present."
15:18robinkhiredman: Thanks, but the keyword will be bound up in a for or as an argument to a function passed to map, so I'll have it handy. find does sound useful, though.
15:19callenMy to-do list at the moment https://www.refheap.com/18598
15:20callenIf I don't pick anything off that list in the next 24-48 hours, I'll just start attacking Korma PRs and issues.
15:20coventry`tbaldridge: Thanks. Would that have been easier to express with a formal notation for monads like Haskell or presumably fluokitten provides?
15:20mdrogalisDashboard for Datomic.. Nice.
15:21callenalexbaranosky: you did all the work :)
15:21callenalexbaranosky: I'm just whipping the PR submitters :)
15:22uvtchiredman, Oh, that's neat. Thanks. Will have to look closer, but it looks like lein-exec may be more convenient.
15:22sdegutisWhat's a good use-case for this? https://github.com/sdegutis/clojuredocs/wiki/clojure.core-transient
15:22callenand I need to finish this PR: https://github.com/korma/Korma/pull/178
15:23robinkbut what I'm thinking is: (if-let [value (mymap %1)] (construct-new-thing (keyword-to-string-map %1) value))
15:23tbaldridgecoventry`: I've wondered that as well. I'm not sure. Some of the core.async stuff cheats for performance or just general readability. For instance, the bind macro (gen-plan) uses lets and not monadic binding. So I'm pretty sure it breaks some monad laws. But to be honest I don't care :-P
15:23robinkoops, missed a close-paren
15:24bjacallen: reiddrapper/simple-check might be worth checking out for your QuickCheck item
15:24coventry`Thanks, tbaldridge. That clarifies things.
15:24callenbja: I know, that's why I de-prioritized it for now.
15:24callenbja: thanks for the heads up :)
15:25bbloomcoventry`: fluokitten reifies monads as a protocol: ie a dictionary of methods
15:25bbloomcoventry`: if you only need a particular monad in a particular context, or only with lexical extent, then macros are more common
15:25bja"fluokitten reifies monads as a protocol: ie a dictionary of methods" - I'm pretty sure it's a bad thing that this makes sense to me
15:26bbloomcoventry`: for example the threading macros are basically a monad, but it's a very specific syntax & only work in an extent delimited by the form
15:26bmabeysdegutis: transients are good when you are building up a large data-structure in a single function. a function can mutate a transient locally to avoid the extra GC cost but then convert it to a persistent datastructure before returning it
15:26tbaldridgesdegutis: see the source of "into"
15:26bmabey,(source into)
15:26clojurebotSource not found\n
15:26tbaldridge,(source into)
15:26clojurebotSource not found\n
15:26tbaldridgebleh
15:27bmabeyhaha
15:27pjstadig~source into
15:27callenpjstadig speaks the language of the system.
15:27bmabeysdegutis: a lot of clojure's provided functions use transients under the hood so you don't need to use it yourself as much
15:27coventry`bbloom: I'd really benefit from an example where the abstraction buys you something in terms of clarity of expression and thought, though. In #haskell, I was told to look at usage of mapM, for instance, which I have put on the queue.
15:28sdegutisbmabey: oh
15:28callencoventry`: monads are reified computation.
15:28callenit's a way of abstracting processes, types, and patterns of computation into "things"
15:29callenfrom there you can interact with higher level concepts and less with implementation details.
15:29callenIf you know you're going to be writing a bunch of functions in terms of Seqable collections, and that they're usually going to chain from one to the next until returning the final result
15:29technomancythe bot in #emacs babbles incomprehensibly when you ask it about monads
15:29bbloomcoventry`: i don't particularly think that reifying monads is useful
15:29callenif you know monads, you'll know you're touching on the List monad.
15:29tbaldridge(inc bbloom)
15:29lazybot⇒ 17
15:30callennow you've identified the pattern you're following and you can be more thought and abstracted in the implementation than you might otherwise be.
15:30bbloomcoventry`: i think that most monads are better of with taylor fit syntax rather than the generalized do notation
15:30technomancyripe for markov chaining if you ask me
15:30bbloomcoventry`: for example the 'clojure.core/for macro is the list macro
15:30callenoh come on. what I'm saying isn't crazy.
15:30bbloomer list monad
15:30tupihello. in the following sample code http://paste.lisp.org/display/138930
15:31tupiI need to get access to the results of (IJ/run imp "Analyze Particles...", ...) but so far I could not find a solution to my problem
15:31bbloomcoventry`: reifying the list monad would let you do things like automatically flatten a tree of sequences or whatever across a crossection of your program. but writing a flatten function is a 5 second task & the result is much easier to understand
15:31tupias a schemer, i was expecting (let [result (IJ/run imp "Analyze Parti...)] but that was just a dream :)
15:32dnolentbaldridge: I guess we're closing in on a release?
15:32tupianyone knows, has a hint for me?
15:32dnolentbaldridge: I made the necessary changes to core.async in a local branch, nothing seems slower, if anything faster?
15:32tbaldridgednolen: excellent. I plan on doing bugfixes tomorrow.
15:32dnolentbaldridge: ring benchmark is ~130ms using 1878 + core.async changes.
15:33dnolentbaldridge: so keyword-identical? hit seems negligible
15:33coventry`bbloom: Thanks, the impression I'm getting is that they're good to know as patterns of computation, but not so useful as an explicit means for expressing a particular computation in a program.
15:33tbaldridgednolen: yeah, there's some build server stuff that needs work, that's what we're waiting on right now.
15:33dnolentbaldridge: got it
15:33tupiI also tried to find how to do it in java, so i could 'translate' to clojure, but no success: i just can't find an example of such code
15:33bbloomcoventry`: yeah, it's like knowing the lambda calculus
15:33callentupi: your problem seems specific to the Java code and how you're using it.
15:33coventry`bbloom: Gotcha.
15:34callentupi: would you mind terribly using https://www.refheap.com/ for Clojure code? it's more readable.
15:36callentupi: do you have a stack trace or some sort of error?
15:38tupicallen: i don't use .com sites, in general, and lisppaste is quite good for any scheme like code, IMO. There is no error in the code I posted. I just don't know [yet] how the underlying java code that implements "Analyse Particles..." stores its results and how to get access to it using clojure.
15:39tupiit is of course an imagej [more then clojure] problem i guess
15:39callen"I don't use .com sites" - wat.
15:40technomancydid paste.lisp.org drop the ability to announce in IRC?
15:42yipstarmy apoligies for a super noob question... i'm trying to take the result of a simple floating point arithmetic operation and then get a result with only 2 decimal points of precision. i've tried with-precision 2 but it doesn't seem to be doing what i want. any pointers?
15:43dnolentbaldridge: k confirmed there's just no performance difference, I think if core.async is going to get any faster improvements will have to come from CLJS compiler I think.
15:43sdegutisI've noticed there's a strong inverse correlation between how much I'm working on something cool and how often I'm on IRC.
15:43akurilincallen, does bulwark currently support isolating a certain set of routes for throttling? I couldn't see that in the source, but I could have easily missed it.
15:43dnolenthe fact that keywords can be optimized is pretty cool, thanks again seangrove
15:43callensdegutis: sounds like a win/win for all involved.
15:43callenakurilin: not directly, you make that part of your handler. the intent was to make it un-opinionated in that regard.
15:43sdegutisI wonder if this is true for everyone or just me.
15:44callenakurilin: the handler you pass to bulwark receives the request, you process and match the path yourself. if some util functions fall out of this that are useful (perhaps relevant to Compojure or Bulwark), let me know and I'll find a home for them.
15:44technomancyyipstar: you're referring to how it's represented in the repl?
15:45technomancy,(format "%0.2f" 0.14424)
15:45clojurebot#<MissingFormatWidthException java.util.MissingFormatWidthException: 0.2f>
15:45callenakurilin: also, if anybody other than myself shakes out Bulwark (I'm the only user AFAIK), I will bump the version and announce it on the mailing list (I waited for somebody else to use it first)
15:45technomancycrap
15:45technomancyanyway, there's a way to do that with format
15:45akurilincallen, I'm apparently going to be eating your dogfood a lot :)
15:45callenakurilin: at least you know I'll fix things.
15:46tbaldridgednolen: agreed, there's not much more we can do
15:46callengetting lunch now, let me know if anything breaks. I should probably explain that the users' handlers are intended to do whatever they need.
15:47yipstartechnomancy: i have a unit test testing = which is failing because of the precision
15:47coventry`,(format "%.2f" 0.14424)
15:47clojurebot"0.14"
15:47technomancyoh gotcha; odd
15:47yipstartechnomancy: but would in repl vs not matter?
15:47technomancyyipstar: the repl's representation is just a different problem vs clojure.test
15:48yipstartechnomancy: k. so does with-precision 2 do what i'm intending in clojure.test?
15:48technomancyyipstar: it looks like with-precision is specifically about bigdecimal types
15:48sdegutis,(last [])
15:48clojurebotnil
15:49yipstartechnomancy: ah! is there a floating point type equiv?
15:49technomancyyipstar: I don't know of anything convenient =\
15:50technomancyalthough
15:50technomancy,(let [x 1.123] (< 1.0 x 1.2))
15:50clojurebottrue
15:50yipstartechnomancy: is there a clojure.test equiv or assert_in_delta?
15:51technomancythe fact that < is variadic comes in handy =)
15:52yipstartechnomancy: gotcha. i need an equal within delta. i doubt its idiomatic to be converting to strings in unit tests for equality?
15:53technomancyyou could write a 3-4-line helper defn to do "is x within y of z" in terms of <
15:53technomancythat'd be my recommendation
15:53yipstargotcha, ty
15:53yipstarthought there'd be something built in!
15:54technomancyeh; < works for most things
15:55technomancy(defn within-delta [x y d] (< (- x d) y (+ x d))) there ya go =)
15:55coventry`(is (< (Math/abs (- val1 val2)) delta))
15:56technomancyoh, even better
15:56yipstarsweet, thanks!
15:58TEttingeralthough, technomancy's solution can work with BigIntegers and BigDecimals if you use +' and -'
15:59TEttinger##(is (< (Math/abs (- 1/2 1/7)) 1/4))
15:59lazybotjava.lang.RuntimeException: Unable to resolve symbol: is in this context
15:59TEttinger##(< (Math/abs (- 1/2 1/7)) 1/4)
15:59lazybotjava.lang.IllegalArgumentException: No matching method found: abs
16:00coventry`TEttinger: ##(class 1/2)
16:00lazybot⇒ clojure.lang.Ratio
16:00TEttingerthat too
16:01coventry`##(< (Math/abs (- 0.5 0.141)) 0.25)
16:01lazybot⇒ false
16:02TEttinger##((fn [x y d] (< (- x d) y (+ x d))) 1/2 1/7 1/4)
16:02lazybot⇒ false
16:03coventry`Oh, your point is that that's more general. That's true.
16:03TEttingeryeah, sorry that wasn't clear
16:03TEttingerthere's also numeric tower
16:04dnolenall things considered this is pretty damn cool IMO http://gist.github.com/swannodette/6542719
16:06akurilincallen, are you defaulting to redis (as opposed to in-memory atom) to allow for sharing of the IP list across multiple web apps on different boxes?
16:06hiredmantbaldridge: that was a very nice response on the opengl thread
16:07TEttingerisn't redis in-memory?
16:10akurilinbrb
16:16callenakurilin: yes
16:18tupifurther trying, given this http://rsbweb.nih.gov/ij/developer/api/ij/measure/ResultsTable.html
16:18tupiI modififed my sample code as is: http://paste.lisp.org/display/138930#1
16:18akurilincallen, ok perfect. Never played around with kv store servers before, so this could be pretty interesting.
16:19tupibut it complains saying malformed ... on this line: (let [results (.getResultsTable)]
16:20xeqitupi: what are you trying to call .getResultsTable on?
16:21tbaldridgehiredman: thanks. I feel the guy's pain, I just don't know how it can be fixed.
16:21tupixeqi: since the doc says no arg, i am not calling on anything
16:21tupihttp://rsbweb.nih.gov/ij/developer/api/ij/measure/ResultsTable.html#getResultsTable()
16:23tupiit appears that when someone does (IJ/Run imp "Analyze Particles..." ...), the results are magically accessible through getResultsTable()
16:23xeqitupi: ah, your calling a static method. Try (ResultsTable/getResultsTable)
16:23tupitrying
16:23tupigreat!
16:24tupiall this is so misterious for me
16:24tupitx
16:25akurilinCan you exclude from a (ns (:require :refer :all... )) ?
16:25callenakurilin: I'm considering making the blacklist/whitelist rules persist to redis as well, the problem is separating "code and data" for that.
16:25akurilinor is :refer-clojure for that?
16:26akurilinnvm about refer-clojure
16:27akurilincallen, for sure. I haven't looked too deeply into it yet, will try to get to the library at some point in the nearby week.
16:27akurilinNeed to rush a couple of things out atm.
16:27callenrumor has it technomancy wrote a serializable-fn library.
16:28callengod help you if you fuck up though.
16:28callenlol executing clojure functions from redis
16:29sdegutisSweet, the bare basics of my Clojure-like language is done. https://github.com/sdegutis/Beowulf/blob/master/Tests/MyTests.mm
16:30sdegutisMostly all that's left is a simple core lib.
16:30TEttingersdegutis, why obj-c? I don't even know if obj-c runs on windows
16:30callenhttp://www.lambdassociates.org/blog/bipolar.htm
16:30callenTEttinger: you could make it run on windows. gnu has a compiler for it.
16:31sdegutisTEttinger: Because I wanted a sane scripting language to embed into my Mac OS X window manager.
16:31TEttingerahhhh.
16:31TEttingerapplescript is one of those weird languages I take it
16:31sdegutisTEttinger: I had embedded JS and Ruby before, and was looking into Lua, but none of those are nearly as fun to write scripts in as Clojure is.
16:31TEttingeryay
16:32TEttingerclojure is pretty amazing for short code
16:32sdegutisThere's also Nu, which is a hybrid of Common Lisp and ObjC, but that's not really Clojure-ish either.
16:32sdegutisTEttinger: agreed
16:32tupihow do i make-array in clojure ?
16:32sdegutistupi: []
16:32sdegutis,[]
16:33clojurebot[]
16:33rasmusto,(vec 1 2 3)
16:33clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: core$vec>
16:33rasmusto,(vector 1 2 3)
16:33clojurebot[1 2 3]
16:33sdegutisrasmusto: ##(vec (vector 1 2 3)) :D
16:33lazybot⇒ [1 2 3]
16:34rasmustosdegutis: I remember hearing that the shortened "vec" means its a multi-arity thing, and the long form "vector" is for a single coll
16:34callenoh good, my coworker stopped wearing goggles. I can stop wondering if I'm in a steampunk universe now.
16:34rasmustosdegutis: I think that it applies to more functions too
16:34sdegutisrasmusto: vec is a coercive fn, vector is a constructor
16:34tupian array of n elements, where i get n from imagej?
16:34TEttingertupi, ah that
16:34tupior a vectro of n elements
16:34tupiinitialzed or not with a value
16:35tupivector
16:35sdegutistupi: ##(take 3 (repeatedly nil))
16:35lazybotjava.lang.NullPointerException
16:35sdegutistupi: ##(take 3 (repeat nil))
16:35lazybot⇒ (nil nil nil)
16:35tupiok
16:35sdegutisProbably not the best way though.
16:35tupiwhat is the best ?
16:36TEttingerthere's also, this is more advanced, (make-array Double 10) . not idiomatic clojure, but sometimes needed to use java arrays
16:37TEttingernormal clojure doesn't use mutable arrays, instead preferring immutable persistent vectors
16:37TEttingervectors work with more of the standard lib
16:40TEttingertupi, the question is, do you actually need an array (like if your imagej library expects some integer array to be passed as an argument), or can you use vectors and all the nice clojure things that expect vectors
16:41TEttingerbecause if imagej has some java function that expects an array, you need to turn whatever type you're using into an array first
16:41tupiTEttinger: reading your comments ...
16:41danielszmulewiczi'm starting a ring app in the repl, how do I access the jetty log?
16:41noonianwhats your vector victor?
16:42TEttingerwe have clearance clarence
16:43TEttingertupi, you don't need to pick one or the other permanently, you can convert between arrays and other types pretty easily
16:44agrHi! Why does (def ^:macro my-defn #'defn) define a macro named 'my-defn' but (if true (def ^:macro my-defn #'defn)) doesn't? It seems that
16:44agrthe :macro metadata isn't set in the var in the second case.
16:45agrEven though the def form is equal
16:45TEttingeragr, I think def might not work outside the scope of the if
16:45TEttingerso it defines it within current scope
16:46TEttinger,(vec (char-array 10 \a)) ;; tupi, easy to convert
16:46clojurebot[\a \a \a \a \a ...]
16:48tupiTEttinger: for example, this (ResultsTable/getResultsTable) gives me an array of measures that I did ask...] one of these is AR [aspect ratio], in one of the column of (ResultsTable/getResultsTable). but i need to invert this calculating 1/AR [for all elements of course and build a 'new' column, actually a new table with all the results that were ok directly fom imagej [java] and the one i need to calculate. so in scheme i would make a
16:48tupinew 2d array, fill it as needed: don't know how to do that in clojure...
16:49mikerodThis may be a dumb question, or not specific enough, but can `first` be lazy?
16:49mikerod(first (filter <blah>))
16:50agrTEttinger: hmm, but even inside the "if" the :macro metadata doesn't seem to be set and I can't use my-defn as a macro
16:50bbloommikerod: @(delay (first (filter <blah>))
16:51TEttingertupi, ah
16:51TEttingeryeah that sounds like you should just call map
16:51tupiok
16:52TEttingermap generates a lazy sequence of calling a function on every element of a collection
16:52bbloomsince last night i was bitching about javascript, let's also bitch about JSON & XML….
16:52bbloomJSON: No comments? Seriously? wtf?
16:52callenbbloom: let is also?
16:52tupiTEttinger: i am trying that indeed
16:53bbloomcallen: let us not correct each other's trivial typos
16:53mikerodbbloom: Ok, I can see that. What spiked my interest on this is: I originally had some code doing something at macroexpansion-time like (first (filterv pred <list-with-symbols>))
16:53TEttingertupi, you might need amap if it's an actual array, but I can't say I've ever used amap
16:53mikerodAt runtime, I looked at this thing returned, and I got back unresolved symbols
16:53bbloomXML: Everything. Seriously. WTF?
16:53mikerodI expected that
16:54bbloomit pains me, but XML > JSON for this use case… really wish i had EDN though...
16:54clojurebotCool story bro.
16:54callenbbloom: with love: http://i.imgur.com/9Qu8ecp.gif
16:54callenbbloom: I use JSON and enforce isoformat zulu time. and then pray. I don't like XML or JSON a ton.
16:54mikerodHowever, when I switched to (first (filter pred <list-with-symbols>)) ; now lazy . The symbols were being resolved later at runtime when I got ahold of the result
16:55callenbbloom: comments are just conventions anyway. Why does it really need to be excluded from the document?
16:57bbloomcallen: this project has non-trivial amounts of configuration that is currently in javascript init scripts w/ TONS of comments for values that are not-obvious. the comments are plentiful and highly useful, but the requirement is that we accept/parse/execute untrusted data. also several keys are already XML for external data sets that we don't control the schema of. just using XML all around is, regrettably, the best move
17:01TEttingertupi, http://clojuredocs.org/clojure_core/clojure.core/amap the examples may be handy. idx and ret are just names to use in the function that's declared at the end
17:01tupitx
17:04Bronsais there a better way to merge 3 vectors than to call (into (into v1 v2) v3)?
17:04rasmustoBronsa: concat?
17:04Bronsarasmusto: I don't want to get a seq
17:05mheldhey y'all
17:05rasmustoBronsa: ah, ok.
17:05dnolenBronsa: don't think so
17:05dnolenBronsa: so the :children keys idea is working for you for generic walking in CinC?
17:05Bronsamakes me wonder why into isn't variadic
17:06mheldI'm using hiccup to generate html and I've got a struct with a 'status' key -- [:div.left.box{:class status}] is what I'm using to create the div but hiccup is taking that status to be literally 'status' instead of 'ok' or 'bad'
17:06Bronsadnolen: definitely
17:06dnolenBronsa: yeah I think I've wanted that before too.
17:06dnolenBronsa: excellent, been poking around CinC and chatted w/ Ambrose a bit, seems like a good way forward.
17:06mheldis there a way to make hiccup not use the literal 'status' value and instead use the key that I've destructured earlier?
17:06dnolenBronsa: is the only new :op type you had to add was :binding?
17:07Bronsadnolen: in the early days I was using a "smart" walk that did not require :children keys but could understand which nodes to walk and which not to
17:07Bronsaturned out after some times that it was way easyer to have :children keys
17:07dnolenBronsa: nice
17:07mheldfuck it (hash-map :class status)
17:07Bronsadnolen: mmh, no, also :case-test; :case-then
17:08ToxicFrogHmm. I wonder how hard it would be to port this project to clojure-clr.
17:08Bronsamaybe a couple more, I can't really tell by heart
17:08dnolenBronsa: :case-test :case-then is that only for case*?
17:08Bronsayes
17:08ToxicFrog...actually, it would be a colossal pain in the ass, wouldn't it? Because all of these library dependencies are jars for use with clojure-jvm.
17:09Bronsadnolen: basically, every map that contains :k result-of-analyze needs to have :op
17:09dnolenBronsa: hrm, I can't really thinking of anything else that would need new nodes?
17:09ToxicFrogSo I'd have to find clr equivalents or write them myself.
17:09Bronsadnolen: let me do a quick check
17:10Bronsadnolen: yeah, look like :binding/:case-test/:case-then are the only nodes to which I have added :op
17:11dnolenBronsa: ok excellent, been thinking about writing up a minimal AST based on what you have and what's present in CLJS
17:11Bronsadnolen: oh, I also added a :quote node instead of using directly :const
17:11dnolenBronsa: noted
17:12Bronsadnolen: yes, I'd really like to standardize the AST between the implementations
17:13dnolenBronsa: I'll writing something up based on jonasen's initial pass and people can give more feedback.
17:13callenbbloom: ouch.
17:13dnolenBronsa: I'd like to tweak the CLJS analyzer so everything JS specific can be moved into the compiler
17:13bbloomcallen: my thoughts exactly
17:13BronsaI did some other changes to the nodes like making the names more consistent/having some platform-indipendent host-interop nodes: #{:host-call :host-field :hostinterop}
17:14Bronsadnolen: I can probably help after the GSoC is over -- my CinC analyzer is built in such a way that it's platform agnistic
17:14nopromptomfg, i was in the lobby the whole time thinking "did everyone die?"
17:15Bronsae.g I have cinc.analyzer that's generic and cinc.analyzer.jvm that adds special forms that are only of the JVM/implements a "smarter" macroexpander
17:15hiredmanwrite some core.typed types for the ast
17:15nopromptdnolen: (defn keyword->event-type [k] (aget EventType (name k)))
17:16Bronsahiredman: that's another thing in my todo-list :)
17:17dnolennoprompt: ?
17:17nopromptdnolen: https://github.com/swannodette/swannodette.github.com/blob/master/code/blog/src/blog/utils/reactive.cljs#L18
17:18dnolennoprompt: well you'd have to upcase, but yeah when I started it that way I wasn't sure about the naming convention.
17:18nopromptdnolen: oh yeah, good point.
17:19nopromptdnolen: needless to say, i've been digging through your code.
17:19nopromptthe google closure libs are pretty awesome. i don't understand why people would complain about it the mailing list.
17:20nopromptthe amount of work that's already been done for you that you don't have to depend on from someone else. it's, it's just great.
17:21dnolennoprompt: I think the issue is it's a mixed bag, but the low level cross browser stuff - rocking.
17:21tbaldridgenoprompt: It's a mailing list, what else are people going to do?
17:21noprompttbaldridge: i have no idea. i guess my expectations of people are to high.
17:21dnolennoprompt: just as dependable as jQuery IME, I was shocked that I could my first core.async blog post to work in IE6 with little trouble.
17:22dnolennoprompt: jQuery is so much dead weight
17:22nopromptdnolen: totally.
17:23nopromptdnolen: what's really awesome to me is that you really only pay for what you use.
17:23dnolennoprompt: yep
17:23nopromptdnolen: i haven't event touched any of the ui stuff.
17:24dnolennoprompt: now that stuff I wouldn't mess w/ unless you have a really good reason :)
17:24dnolennoprompt: object oriented widgets tends to bloat because of inheritance (no surprise)
17:25nopromptdnolen: ah, ok.
17:25dnolennoprompt: look at this dependency list for ComboBox
17:25dnolenhttp://docs.closure-library.googlecode.com/git/closure_goog_ui_combobox.js.source.html
17:25dnolenan abomination
17:25nopromptdnolen: so far i haven't had a good reason to actually browse the code, but now that i'm starting to look at it i'm curious.
17:26dnolennoprompt: I think you could really rethinking widgets and their composition w/ core.async - I think my autocompleter combobox is a good sketch of how you might do that.
17:26nopromptdnolen: right. that's what i mean by "not having a good reason".
17:28nopromptdnolen: have you experimented much with two-way data-binding and core.async?
17:29dnolennoprompt: I haven't still pondering that one
17:32nopromptdnolen: something i tried was an atom with an add-watch fn that updates the dom and an event channel updating the atom.
17:33noprompti'm not completely sure if that's the right starting point.
17:34nopromptit gets tricky when you start to think of how you might pull of something like angular's ng-repeat
17:35dnolennoprompt: ng-repeat is for binding an array of data to a repeating view right?
17:36nopromptdnolen: right. the trick there seems like you would need to have something in middle linking elements in the dom with elements in a collection.
17:38dnolennoprompt: there are several things to consider here and it's important to avoid getting things mixed up
17:38dnolennoprompt: one is how the app state is propagate to other places - this just about data - not views
17:38dnolennoprompt: something datomic like with local "caches" seem promising to me.
17:39dnolennoprompt: then you have templates - hopefully pure.
17:39dnolennoprompt: then I think you need some which establishes the binding over the template, allowing things to be bound and allow changes to be propagated back into the global app state.
17:40dnolenideally this whole system could be defined w/ a handful of protocols, little bit of channel design
17:40dnolenand everything else - templates, binding "layer" can be plugged based on whatever performance you need.
17:41nopromptinteresting.
17:42nopromptdnolen: ok. i'll definitely meditate on these concepts. that was the sort of response i was fishing for.
17:43callenMFW I realize I have to decide on type supremacy for multiple instance type inference and I can't reject inconsistent/contradictory examples
17:54tupiback to my newbee quiz: i'd like to collect the values of this expression:
17:55tupi(dotimes [i counter] (/ 1 (.getValue results "AR" i)))
17:55tupiin a vector for example
17:56ivan&(for [i (range 10)] (* i i))
17:56lazybot⇒ (0 1 4 9 16 25 36 49 64 81)
17:57tupiivan: tx
17:57ivanyou can (vec ) it
17:57tupiok
17:59hiredmanooh oracle jdk 7u40 has a hard float arm abi build
18:02klokbaskeanyone up for some assistance with getting core.async going?
18:03tupipi exists in clojure ?
18:03klokbasketupi: Math/PI
18:03seancorfield,Math/PI
18:03clojurebot3.141592653589793
18:03tupigreat, tx
18:04seancorfieldklokbaske: what assistance do you need?
18:04seancorfield(i.e., where are you stuck right now?)
18:04klokbaskei'm trying to get it to compile :-) i've tried as a dependency and as source (via checkouts), but it fails with two different errors
18:07klokbaskeCompilerException java.lang.RuntimeException: Unable to resolve symbol: pprint in this context, compiling:(clojur\
18:07klokbaskee/core/async/impl/ioc_macros.clj:23)
18:07klokbaskeif I do a dependency in my project.clj, org.clojure/core.async "0.1.0-SNAPSHOT", and (use 'clojure.core.async), it fails with the above
18:08tupidue to imagej/java way of doing things, i realize that i will need to copy the (ResultsTable/getResultsTable) which appears to be a java array [my knowledge of java is close to nil]. how do i do that? maybe there is a java method i can call rather then rewrite some in clojure ... ?
18:09klokbaskeseancorfield: does that tell you anything? :-)
18:10seancorfieldklokbaske: that does right a bell actually... are you running a repl? lein repl?
18:11klokbaskeyup, lein repl
18:11nopromptcallen: did you see this http://spectacleapp.com/
18:11klokbaskeseancorfield: yup, lein repl
18:13seancorfieldklokbaske: hmm, i don't get it with core.async-0.1.0-20130827.050117-78.jar
18:13seancorfieldi have a bare project with 0.1.0-SNAPSHOT as a dependency and it pulled in that version
18:14seancorfieldwith :repositories {"sonatype-oss-public" "https://oss.sonatype.org/content/groups/public/&quot;}
18:14seancorfield
18:14klokbaskeseancorfield: it's the same i'm using ... maybe it's my lein? it's Leiningen 2.1.3 on Java 1.6.0_51 Java HotSpot(TM) 64-Bit Server VM
18:15klokbaskeseancorfield: also, lein repl seems to start clojure 1.3, which also seems a bit odd to me. My project.clj refers v1.5.1
18:16seancorfielddo you have other dependencies? maybe you have a version conflict?
18:17seancorfielddo: lein deps :tree
18:17seancorfieldsee if that identifies what is pulling in clojure 1.3...
18:17seancorfield(although i'm on lein 2.3.2 so there might also be a difference there)
18:18klokbaskeseancorfield: ah, overtone pulls 1.3. It's my only dependency, but I probably should have made a barebone project for testing :-)
18:18klokbaskeseancorfield: i'll see if it makes a difference
18:19`cbptupi: you can use aclone to clone an array but I'm not sure if that's what you want
18:21klokbaskeseancorfield: that did the trick! thanks a bunch! Didn't know about :tree. Seems I can use :exclusions to get overtone running with 1.5.1
18:22callennoprompt: I use SizeUp.
18:22callennoprompt: SizeUp is goooood
18:23nopromptcallen: sizeup costs munny.
18:25calleno_o
18:26nopromptcallen: it does look nice though. the partitions are kind of cool.
18:27seancorfieldklokbaske: glad you got that working... if overtone is pulling in 1.3, i suspect it has a version range in one of its dependencies which is a Bad Thing(tm)
18:27technomancy~guards
18:27clojurebotSEIZE HIM!
18:27tupican i ask the type of a value?
18:27`cbptupi: (type ..)
18:27tupineed to know if some results are float or int
18:27tupiok
18:28tupiok, it returned this type: java.lang.Double but i need to convert to an integer
18:29klokbaskeseancorfield: ah ok. still has some learning to do regarding dependency management (yay). sam aaron says it's fixed in the dev branch, so they've got it covered :-)
18:29`cbptupi: (int ..)
18:29tupitx
18:30coventrynoprompt, callen: If you like being able to "quickly resize and position your windows with keyboard shortcuts", you should try sawfish. It's configurable in scheme. :-)
18:32nopromptcoventry: well don't that just beat all?
18:35nenorbotdoes anyone know a way to turn a json string to a clojurescript map?
18:35technomancydid stu finally give up on trying to allow json to be valid clojure?
18:36brehauttechnomancy: wait, what‽
18:37Bronsathe keyword: syntax?
18:37technomancyyeah
18:37Bronsathat was a truly awful idea
18:37technomancyI think it finally died
18:37Bronsatechnomancy: better keep quiet about it and hope nobody will ever remember it again
18:37technomancyhaha
18:38callenwhich Stu was asking for that?
18:38technomancyI wonder if edn helped kill it
18:38technomancycallen: the H one IIRC
18:38Bronsamy main complain about edn is that it doesn't have support for regexes :(
18:38callentechnomancy: whoa. That's terrifying.
18:39BronsaI understand the rationale but.. that limits the usefullness of edn for configuration files
18:41sjlBronsa: use a tag? #yourproject/regex "foo.*"
18:41Bronsasjl: yes, but we already have #"" for regexes
18:42Bronsaalso sjl, #"" escapes differently than "", writing a regex tagged literal would mean have a string filled with "\\\"
18:42sjlyep
18:43Bronsao
18:44nopromptit'd be awesome if these ns browsers supported cljs.
18:48nopromptthat ayler project is legit.
18:56callenac-nrepl has some hella dubious performance characteristics.
18:58BronsaI'm still using SLIME and happy with it.
18:59callenstill want a debugger.
18:59callenstill need a debugger for that matter.
19:00Bronsayeah, I've never been able to get ritz to work
19:00callenI've gotten to work, not enjoyed it anyway.
19:00coventryI got it to work, sort of, but you need break-on-exception turned on for it to hit your breakpoints, and that made it almost unuseable for me.
19:01callenyeah.
19:04callenI'm using nrepl-ritz right now. It's sorta-not-really working.
19:04callenit caught the exception but I can't get at any of the locals.
19:04coventryOh, there's a way to turn off locals clearing. hugod describes it in his talk.
19:05callenoh I think it actually froze.
19:05callencoventry: I know, diff problem.
19:05callenERROR: Unhandled REPL handler exception processing message {:id 74, :op frame-locals, :session 3f224f4b-d128-454b-a2e3-273984c1a3fa, :thread-id 5350, :frame-number 3}
19:06callenlol, k
19:06`cbpis slingshot common use? Would it turn people away if a library used it?
19:07coventryritz uses it, so I think you're safe.
19:08callendon't use Ritz as an exemplar :P
19:08callen`cbp: slingshot is fine, just have a good reason for using it is all.
19:11technomancy`cbp: for catching or throwing?
19:13callentechnomancy: easy with the innuendo man.
19:13technomancyuse ex-info for throwing unless you have to support 1.3
19:13technomancywhich you don't
19:13kernelsidHey guys - do you know if breakpoint support in ritz-nrepl is working or not.. the doc here https://github.com/pallet/ritz/tree/develop/nrepl suggests it not but the post here https://groups.google.com/forum/#!topic/clojure/Qh3qF5DJKho says it maybe working in the dev branch
19:14callenI never got that to work, had to use exceptions.
19:14jtoyis it possible to run a single command with lein and exit?
19:15kernelsidyeah.. thats what I figured too
19:15`cbptechnomancy: for throwing
19:15technomancy`cbp: yeah, don't use slingshot for that
19:15technomancyjtoy: is that a trick question?
19:16callenthat sounds like a koan.
19:17callen"if a maven repo falls in the woods but nobody notices..."
19:17`cbpI had a function that would validate the fields of a record and throw a map of fields -> errors. But I guess I should skip the throwing altogether?
19:17callenyes
19:18`cbpok :)
19:19kernelsidso I have a java+clojure code that runs remotely. What would be the best way to debug the code? I found a way to drop the execution into a repl (http://stackoverflow.com/a/2356923) which is pretty cool but the clojure/repl is pretty basic and moreover you cannot connect to the repl via emacs to execute more code
19:19kernelsidI don't its possible to drop into a nrepl server similarly . It's possible to run a nrepl server in your application but you can't inspect run time values with that. Am I right?
19:20callenwhat a delightful cascade of data that I am getting smacked in the face with.
19:20callenokay you can stop scrolling now...
19:22nDuffkernelsid: whether you can inspect runtime state from nrepl depends on how your application is designed.
19:22nDuffkernelsid: ...if you have a Var pointing to an atom or ref, well, that's certainly accessible.
19:24kernelsidnDuff: I get your point..it seems like there maybe some changes that need to be done in the code to get this method to work but I just wanted to be sure that I am not missing something in the picture and that there isn't a better way to approach this..
19:39nightflyhow do you earn that?
19:40technomancycould go in and rant about the fact that this is freenode not proprietarynode
19:41callentechnomancy: I don't think that would actually work tbqh
19:41callenyou'd have to do a better job than that.
19:41technomancycould go ask about why homebrew doesn't have any quality assurance
19:41sdegutisnightfly: being a teenager on IRC all those years ago is an easy way to get a permaban
19:42xicubedi made a cute terse little program but couldn't get the side effects working so only I know :>
19:42sdegutistechnomancy: melpa has caused me way more pain than homebrew
19:42technomancysdegutis: melpa is nuts
19:42sdegutisnightfly: it doesnt help that the channel is run by super cranky old men
19:42technomancyI don't understand why people use it
19:42callentechnomancy: Raynes and I could talk your fucking ear off about homebrew.
19:42sdegutistechnomancy: because its sooo easy!!
19:42RaynesYOUR EAR OFF.
19:43technomancysdegutis: easier than marmalade?
19:43sdegutistechnomancy: who knows. probably.
19:43sdegutistechnomancy: has more stuff in it than marma
19:43technomancyjunk stuff
19:43sdegutistechnomancy: junk is subjective no?
19:44callenI'm imagining Melpa being like Bubbles from The Wire
19:44technomancywhat kind of people are writing quality elisp and not bothering to M-x marmalade-upload?
19:44sdegutistechnomancy: ive found very few ultrastable emacs plugins
19:44callen"WE GOTS ONLY THE BEST (SOFT) WARES AT BUBBLES STORE!"
19:44sdegutisparedit is probably the only one i use regularly that works well
19:44technomancysdegutis: if you follow master, stuff breaks
19:44sdegutiselectric-indent-mode hates me so bad.
19:45technomancythis isn't specific to elisp
19:45sdegutisido-mode never works like i want it to.
19:45sdegutistechnomancy: im talking about libs packaged with emacs
19:45sdegutistechnomancy: theres a reasonable level of quality that i only find in some libs, whether from melpa or built-in or wherever.
19:45s4muelevil-mode works admirably but is a pain with some other minor modes. suppose that's expected. paredit, <3
19:46sdegutissome days i dream about going back to `ed`
19:46technomancyclojurebot: ed?
19:46clojureboted is the standard editor!
19:46sdegutistext editors are hard to get right. its understandable. nobody can do it well.
19:47sdegutisits an impossible task, so we just gotta take what we can get.
19:47sdegutisin other news, this story is a little creepy: http://blog.close.io/post/60948403716/why-engineers-scare-me-a-true-story
19:49callenit's not at all.
19:50sdegutiscallen: oh.
19:50sdegutisguess i was mistaken.
19:50technomancyglad that's cleared up
19:52riley526callen: ("Bubbles Depo")
19:52sdegutis,(foo [bar)
19:52clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>
19:52riley526Just watched it again last night ;)
19:52callenriley526: :)
19:52callensdegutis: it's a standard doxing entry point. Pretty easy to do.
19:52sdegutiscallen: no comprendo
20:10sdegutisI'm a bit scared to implement ##destructure
20:10sdegutisAw clojurebot doesn't like that.
20:12coventryIt's only 60 lines and 12 levels of indentation in core.clj. How hard can it be? :-)
20:14sdegutishttps://github.com/sdegutis/clojuredocs/wiki/clojure.core-destructure#source
20:14sdegutisMan...
20:14sdegutisAw man, it needs (loop).
20:15hfaafbare there any good clojure videos aside from rhickey's stuff?
20:16hfaafbor talks on functional languages
20:16callenhfaafb: stu has videos if you can handle the newspeak.
20:16brehauthfaafb: heaps of strange loop and clojure conj videos are on the web
20:16coventryDo you mean in the same philosophical vein as his?
20:16hfaafbyeah precisely
20:17hiredmanhttp://www.infoq.com/presentations/Decisions-Decisions
20:18s4muelhttp://www.infoq.com/presentations/Clojure-Large-scale-patterns-techniques
20:19s4muelis not really a philosophical video, but probably one of the best out there in general imo
20:19hfaafbthanks everyone
20:35coventryWhat defs are in clojure.core before evaluation of core.clj takes place?
20:36hiredmanthere are a handful of vars, in-ns, some compiler flags
20:38coventryThanks, hiredman. Looks like I can pull them out of RT.java.
20:57mihneadbhi, I'm having trouble finding the command line args in running a cljs app with node
20:57mihneadbI see the "8:(apply cljs.core/*main-cli-fn* (drop 2 (.-argv nodejs/process))) " line
20:57mihneadbbut when I println my args in the main function it is nil
21:16nopromptmihneadb: why not use an option parser?
21:17nopromptmihneadb: there's a good one compatible with both clj and cljs: https://github.com/guns/optparse-clj/
21:17nopromptmihneadb: also try using console.log.
21:18nopromptmihneadb: also i think you want to user set! instead of apply: m
21:18nopromptmihneadb: https://github.com/noprompt/frak/blob/master/src/cljx/frak/cli.cljx#L55
21:28coventryWhere does eval get the current filename from, when it sticks it in a var's metadata?
21:30hfaafbis there a function that returns the first element of a collection that passes a predicate?
21:31hfaafband short circuits
21:32coventry(first (filter pred coll))
21:32coventryLooks like it gets it from *file*
21:33Bronsa/
21:36brehaut,(some number? ["a" :b 3 4 :e])
21:36clojurebottrue
21:36brehautnope
21:36brehautthat always catches me :/
21:54clj_newb_2345anyone know of a good deep learning tutorial in clojure?
21:54gfredericksbrehaut: it's cuz of that dang (some #{x} ...) idiom
21:54brehautgfredericks: aha
21:56`cbpthere's an introduction to deep code walking macros by fogus
22:02mihneadbnoprompt: sorry, I was AFK
22:03mihneadbnoprompt: the app I was / am trying is https://www.refheap.com/18618
22:04mihneadbthanks for the opt parse link. I was just trying to do a simple thing (basically first time running cljs)
22:04nopromptmihneadb: try using (.log js/console args)
22:04nopromptor rather (.log js/console (str args))
22:04mihneadbnoprompt: ok, just a sec
22:05mihneadbnoprompt: it is still blank
22:05mihneadbI m running with "node target/cljsbuild-main.js 123"
22:05nopromptmihneadb: does your cljsbuild target node?
22:05mihneadbnoprompt: yes
22:05mihneadb:target :nodejs
22:06mihneadbthe app is working, I can print out stuff just fine
22:06mihneadbjust that args is nil
22:06nopromptmihneadb: are you compiling with :optimizations :advanced?
22:06mihneadbnoprompt: yes
22:06nopromptmihneadb: are you using an exports file?
22:07mihneadbshould I try some other opt?
22:07mihneadbnoprompt: no
22:07nopromptmihneadb: that might be the problem.
22:07nopromptmihneadb: see: https://github.com/noprompt/frak/blob/master/project.clj#L30
22:07nopromptmihneadb: and https://github.com/noprompt/frak/blob/master/resources/externs/process.js
22:08mihneadbnoprompt: thanks
22:08mihneadbif I switched to a different optimizations option would it work? (I don't know the opts, I was just following a sample found online)
22:08nopromptmihneadb: np. i had the same problem when building the cli tools for frak.
22:09nopromptmihneadb: you might try that. i think you may want to use :simple or :whitespace during dev. i forget which but one of them has problems when targeting nodejs.
22:10mihneadbok, nice. Thanks
22:10mihneadbfrak looks great, btw
22:10mihneadbdid not know about it
22:11nopromptmihneadb: oh thanks. i have no idea what the hell i'm doing in that project. but hey, it works!
22:11mihneadbnoprompt: so you have the same source code for both cljs and clj?
22:11mihneadbor is it something like a base that exposes an API and then you have two "clients" ?
22:12nopromptmihneadb: yeah, i used cljx.
22:13mihneadbcljx, wow
22:13mihneadblet's see
22:13nopromptmihneadb: here's the frak success story: https://github.com/guns/vim-clojure-static/commit/33a0fc9f187d3e7053eac581aa3cbdd84afe7408 (see at the bottom, very last file)
22:13nopromptdon't forget to scroll! :-P
22:14mihneadbhaha I noticed that when reading the readme!
22:14gunsYou get the best effect when scrolling with the arrow keys
22:14gunsthen it's comical
22:14nopromptmihneadb: fwiw i haven't tried using cljx for large projects. frak was a good fit though.
22:14nopromptguns: haha, yeah!
22:15mihneadbhaha nice trick on cljx's part for using whitespace instead of not used expressions
22:16nopromptguns: has anyone from the vi community seen that?
22:17mihneadbnoprompt: btw I get this with optimizations whitespace https://www.refheap.com/18619
22:18nopromptguns: someone should tell braam to have it do what perl does when it sees a regex with a bunch of words joined w/ |.
22:18nopromptmihneadb: yeah i think that's the common error. try :simple
22:18mihneadbbtw what's the proper way of retriggering compilation when you change this?
22:19mihneadbif I just rerun cljsbuild auto it won't pick it up
22:19gunsnoprompt: Unfortunately, the improvements to the syntax file are invisible to the common man; as for Bram, he really doesn't like vim-clojure-static much at all
22:19nopromptmihneadb: change the source file or remove the compiled file.
22:20mihneadbnoprompt: yeah I did that. I was hoping for some other non-intrusive way :)
22:20nopromptguns: what? why doesn't he like it?
22:20mihneadbty
22:20mihneadbnoprompt: I see the args with optimizations simple btw. thanks again
22:21nopromptguns: that syntax file is shinning example of what a syntax file *should* look like - clean.
22:21gunsnoprompt: eh, he doesn't like the iskeyword mangling and the use of `syntax keyword`; he's not a Lisper, so I am forced to say "just trust me"
22:22gunsnoprompt: You know, I tried to add stdin input support to frak a while ago (to make it a standard Unix filter), but I failed to get it working in Node.js.
22:22gunsIt's probably just me but reading stdin synchronously in Node.js is stupidly difficult
22:23mihneadbshouldn't I be able to call cljs.reader/read-string in cljs?
22:23mihneadbit works in clojurescript.net
22:24nopromptguns: yeah i think when i tried that i had to use xargs. if you figure it out send me a PR.
22:24noprompt:)
22:25nopromptmihneadb: yes.
22:25mihneadbnoprompt: I get TypeError: Cannot read property 'read_string' of undefined
22:25nopromptmihneadb: make sure to require it though.
22:26mihneadbah, whoops
22:26noprompt(:require [cljs.reader :refer [read-string]])
22:27mihneadbthanks
22:29nopromptguns: so this doesn't work -> http://nodejs.org/api/process.html#process_process_stdin
22:30gunsnoprompt: No, it does; I just wanted to do it synchronously so I didn't have to invert the logic for the Clojure API
22:30gunsI guess that's fighting the tide though
23:06Foxboron.23.125] has quit [Client Quit]
23:06Foxborondamn
23:06Foxboronhttps://en.wikipedia.org/wiki/Programmers'_Day
23:06Foxboronthere
23:10sdegutiswat
23:10zanesIf I'm generating a class with :hen-class what's the correct way to get a handle on the generated class from within the file in question?
23:13sdegutisTomorrow is Programmer's Day? Woo!
23:13sdegutisDoes that mean I get the day off?
23:13Foxboronsdegutis: well its 13th today here.
23:13Foxboronsdegutis: and i think it depends where you live :P
23:13sdegutisI live here.
23:15zanesFound it: http://stackoverflow.com/questions/16228318/how-to-get-the-class-generated-by-gen-class-in-clojure