#clojure log - Sep 12 2013

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:17 callen: seangrove: akurilin is awesome. you should meet him, he's a fellow founder using Clojure :)

0:48 dnolen: bbloom: ping

0:48 ambrosebs: ping

0:48 bbloom: dnolen: 2 sec

0:48 ambrosebs: dnolen:

0:49 dnolen: ambrosebs: are you using :children with only keys not nodes?

0:49 callen: Pingfest 2013

0:49 dnolen: ambrosebs: I mean are you representing them that way?

0:50 ambrosebs: dnolen: atm yes

0:50 dnolen: ambrosebs: ok and I see Bronsa is too

0:50 ambrosebs: are there any problems w/ this approach it seems sound to me

0:50 ambrosebs: it seems to work

0:50 dnolen: ambrosebs: and you're using this for generic walking right?

0:50 ambrosebs: dnolen: tbh I haven't used it myself.

0:51 I just put it out there.

0:51 but potentially yes

0:51 Haven't heard any feedback yet. Wasn't aware Bronsa was using the same technique.

0:52 bbloom: dnolen: heh, i proposed this approach several times :-)

0:53 dnolen: ambrosebs: he keeps that information there, but it appears as elsewhere just use multimethods

0:53 bbloom: dnolen: the two issues are 1) interleaved children, such as in bindings

0:53 dnolen: ambrosebs: stills there's the benefit of someone wanting some way to do something simple and and have a way to traverse.

0:53 bbloom: yes I'm revisiting the notes

0:53 bbloom: dnolen: and 2) values that are sequences instead of just individual children

0:53 dnolen: bbloom: yep, evaluation order is a consideration

0:55 https://github.com/Bronsa/CinC/commit/8d1cc9a96bd9fdc5f10e602e63f79c7ae1f79dfe

0:56 bbloom: looks like Bronsa just added a :binding :op

0:56 bbloom: dnolen: which was also proposed :-)

0:56 dnolen: bbloom: yep I remember that too :)

0:57 bbloom: pretty soon cljs will catch up to my imagination from a year ago :-)

0:58 ambrosebs: g2g

0:58 Foxboron: Is there any blogpost/guide that shows how to use ClojureScript with nginx and the like?

0:58 Going to try out cljs soon to write a basic blog engine

0:59 dnolen: bbloom: been wanting flow more type information through the AST recently, your suggestionsand Bronsa/Ambrose implementations looks like the way to go.

1:00 callen: Foxboron: clojurescript is just the frontend, you need a backend in Clojure too

1:00 Foxboron: luminusweb.net

1:01 Foxboron: callen: what i wanted, awesome :)

1:03 dnolen: bbloom: besides binding, how the seq of forms not handled by :items?

1:03 how is

1:11 sdegutis: Tonight, on Bikeshedding Week...

1:11 phew, finally glad to have shed that bike..

1:13 bbloom: dnolen: https://github.com/edn-format/edn/issues/40

1:13 dnolen: since you're gonna stuff more stuff in to the AST...

1:14 dnolen: bbloom: heh, actually was thinking about moving stuff out

1:14 bbloom: out?

1:14 dnolen: bbloom: and adding extra stuff via the compiler

1:14 bbloom: dnolen: oh yeah. i wanted a MINIMAL ast for *essential data only*

1:14 dnolen: bbloom: there are many ad-hoc things in analyzer, would nice to move more CLJS specific stuff into compiler.clj

1:14 bbloom: but expando

1:15 dnolen: would be much nicer to split compiler.clj in to js/analysis.clj and js/codegen.clj :-)

1:15 dnolen: bbloom: heh sure, but moving things out of analyzer.clj, and adding passes to compiler.clj is a good start

1:16 bbloom: dnolen: oh, just wanted to make sure that you weren't sticking extra analysis in to the existing pass

1:16 but yeah, would be nice to have the absolute minimum ast & provide a schema for it

1:16 dnolen: bbloom: yep

1:17 bbloom: this is nice and short - http://docs.google.com/document/d/1DRN-tBIqhqVVyoHIDs7CMkduBFk-vqd_958ojeIBLHQ/edit

1:17 bbloom: thinking about making a :children keys version of it

1:17 bbloom: also - with passes, a way to emit human comprehensible version of the AST via a helper fn :)

1:17 i.e. dropping :env

1:17 bbloom: dnolen: even better: an unparser

1:18 dnolen: bbloom: yeah that too

1:18 bbloom: i have env dropping in a scratch file somewhere :-P

1:18 dnolen: bbloom: 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.

1:18 bbloom: glad you're finally excited about passes :-)

1:26 tufflax: I 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.

1:28 callen: tufflax: I use timbre and robert.hooke to do logging.

1:28 tufflax: robert.hooke so that logging is independent of the function logic.

1:28 tufflax: if you need SQL query logging, look at github.com/bitemyapp/blackwater

1:32 tufflax: callen: nice, robert.hooke certainly seems like a good idea

1:36 akurilin: callen, thx, apprec the bump in clojure street cred :)

1:36 bbloom: i had to write some javascript today. it was not fun

1:36 callen: tufflax: 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.

1:36 akurilin: callen, 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.

1:36 bbloom: literally 20 minutes of work, ruined my whole week :-P

1:36 callen: akurilin: lein prism

1:37 bbloom: ;_;

1:37 bbloom: I write Python and JS every week.

1:37 bbloom: callen: so then you're used to it

1:37 :-P

1:37 callen: I spent like 2 hours yesterday explaining jQuery.

1:37 my liver was rupturing the whole time.

1:37 bbloom: callen: please told me that you said "it's a monad!"

1:37 s/told/tell

1:37 callen: bbloom: list monad actually, but yes.

1:38 I mentioned it when explaining the collection passing bucket brigade pattern

1:38 was going for maximum shock-and-awe

1:38 seangrove: haha

1:39 Using communication to obscure meaning

1:39 callen: don't worry, my coworker knew what needed done to finish the feature they were workingon

1:39 I just used it as an excuse to teach some higher order patterns

1:40 akurilin: callen, awesome, let me try that.

1:40 callen: like how jQuery's API works, how binding to the DOM works, event bubbling, late vs. early binding, etc.

1:40 jQuery is my favorite way to demonstrate the advantages of late binding :P

1:40 seangrove: Yeah, it's a good idea if they already understand the usage of something to explain the bigger concepts in those terms

1:41 callen: well they didn't understand jQuery either

1:41 I explained the higher order patterns as I was explaining jQuery usage

1:41 like peeling an onion

1:41 it was a very high throughput pair programming session.

1:42 "here's you use this...and here's how you break this same thing...and here's the higher order reason it breaks..."

1:42 clj_newb_2345: so I just got android working ;;; yay ;;;

1:42 anyone doing android dev with clojure?

1:42 or are there actual problems with clojure on android?

1:43 rhg: Slow start

1:43 andyfingerhut: clj_new_2345: There aren't many people doing it. You can Google for past conversations in the Clojure Google group on Android.

1:43 clj_newb_2345: why is jvm fast, but clojure slow?

1:45 callen: it's not that simple

1:45 Clojure is designed for the trade-offs of things like services, not clients.

1:46 clj_newb_2345: so we have a good clojure -> javascript compiler, but no good clojure -> java compiler?

1:47 rhg: I dint say just slow I said slow start

1:47 It's plenty fast

1:49 andyfingerhut: Clojure 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.

1:50 callen: it's not "good" or "bad", just different design constraints.

1:50 a 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

1:50 just different trade-offs.

1:51 rhg: But cljnewb I do use it

1:51 See my github

1:51 ivan: it would be nice to have a library/protocol just for sending (clojure function, shared secret, shell environment) and streaming stdin/stdout/stderr

1:52 I would write a lot of command-line programs with that, I just haven't gotten around to doing that

1:52 callen: ivan: grench

1:52 bbloom: it's worth noting that clojure isn't inherently bad at startup time: it's a function of the way clojure/core.clj is bootstrapped

1:52 ivan: grenchman? does it do non-lein things?

1:52 bbloom: cljs, by contrast, is essentially static (now after much work)

1:52 rhg: Mhm

1:53 bbloom: during cljs bootup, no code runs. so if you don't use parts of core, it won't be in the javascript output!

1:53 rhg: Ya

1:53 bbloom: but b/c clojure on the jvm has a resident compiler, it compiles everything and keeps it warm and ready for future use

1:55 callen: for 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.

1:55 for the sorts of things I do anyway.

1:56 coventry`: ivan: grenchman is great, and close to what you described. It doesn't have the security features you asked about, though.

1:59 callen: grenchman uber alles?

1:59 technomancy: ^^

2:06 akurilin: For forks of existing clojure libraries that you want to add into leiningen, is there a less spammy method than to upload them to clojars?

2:06 s4muel: akurilin: lein install

2:08 akurilin: s4muel, great, I'll investigate that, thanks!

2:09 callen: akurilin: `ls ~/.m2/repository/`

2:09 akurilin: it's just stashing it there.

2:16 dissipate_: ;apply

2:21 how is this valid: (apply + '(1 2 3 4))

2:22 why does apply allow a quoted list?

2:22 callen: dissipate_: http://clojuredocs.org/clojure_core/clojure.core/apply

2:22 zRecursive: ,(apply + '(1 2 3 4))

2:22 clojurebot: 10

2:23 callen: dissipate_: a quoted list is seq'able.

2:23 same as a vector.

2:23 zRecursive: ,(reduce + '(1 2 3 4))

2:23 clojurebot: 10

2:24 dissipate_: callen, when would you ever use a quoted list instead of a vector?

2:24 in an eval?

2:25 callen: when you wanted to cons heads onto a collection, or to represent clojure code.

2:26 zRecursive: ,(reduce conj #{} (for [i (range 10) j (range 10)] [i j]))

2:26 clojurebot: #{[2 1] [3 2] [4 3] [5 4] [6 5] ...}

2:29 dissipate_: callen, i see, makes sense. thanks.

2:29 callen: I asked for a change to a frankly dirty PR

2:30 dude came back with a PR that passed tests, and 5x less code in 24 hours.

2:30 <3 Clojure programmers

2:31 dissipate_: callen, PR?

2:31 aka: pull request

2:32 akurilin: hah that's awesome

2:32 bbl

2:34 dissipate_: callen, should have been like that in the first place. :P

2:37 callen: dissipate_: I don't think I would ever criticize someone for trying to contribute to an OSS library.

2:37 0.01% of programmers even attempt to do so.

2:37 out of laziness or apathy.

2:38 dissipate_: callen, don't forget the fact that corporations use those libraries, making wild profits, while the developer gets a pat on the back

2:38 callen: What a strange thing to care about.

2:38 dissipate_: i happen to know because i work for such a corporation. we use all kinds of open source libraries, but don't pay anything.

2:39 callen: I make things so people can use them. I don't care if somebody is profiting or not.

2:39 I'd just like contributions back if/when possible

2:39 I 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.

2:39 dissipate_: callen, perhaps you don't, but just add that as another reason why developers don't spend their time on open source projects

2:39 wei_: how do I convert a long hex string into a number (BigInt)? (Long/parseLong "4590d31a9cf5eb30997501f82b1b8db051c01f7ea8a2c413343f2c1b9f5aa04e" 16) gives me a NumberFormatException

2:40 callen: dissipate_: I sincerely doubt that has anything to do with it.

2:40 people 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.

2:40 wei_: ,(Long/parseLong "4590d31a9cf5eb30997501f82b1b8db051c01f7ea8a2c413343f2c1b9f5aa04e" 16)

2:40 clojurebot: #<NumberFormatException java.lang.NumberFormatException: For input string: "4590d31a9cf5eb30997501f82b1b8db051c01f7ea8a2c413343f2c1b9f5aa04e">

2:40 callen: it'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.

2:41 dissipate_: you have a warped perspective. You should consider a more positive outlook.

2:41 dissipate_: callen, well, given a choice to develop closed source software for their own profit, or OSS for a corporation's profit...

2:41 callen: you can't sell libraries anymore, lol.

2:41 that's not how it works.

2:41 dissipate_: i'm not talking about libraries, i'm talking about web apps or mobile apps

2:42 callen: OSS usually isn't concerned with end-user products.

2:42 it's usually infrastructure, tools, and libraries for developers to build products with.

2:52 wei_: to answer my question above, (BigInteger. "4590d31a9cf5eb30997501f82b1b8db051c01f7ea8a2c413343f2c1b9f5aa04e" 16)

3:03 amalloy: wei_: not that it's what you want for parsing at runtime, wei_, but note that 16r4590d31a9cf5eb30997501f82b1b8db051c01f7ea8a2c413343f2c1b9f5aa04e works as a literal :P

3:04 wei_: cool. how does the reader know it's hex?

3:04 oh 16r

3:05 Apage43: callen, dissipate_ related note

3:05 I was working on a nifty doodad

3:05 started out open, was asked to close-source it, now it's not nearly as fun

3:05 callen: Apage43: for work?

3:05 Apage43: yeah

3:06 callen: well. that's regrettable

3:06 I don't see my company minding much as long as it's peripheral to our core product and service.

3:06 we're not a pure software company.

3:07 Apage43: the fun bit is our *core product* is open source. There are no closed source bits, whatsoever.

3:08 callen: Apage43: so...wait. Why did your utility/doodad matter then?

3:08 Apage43: do you work with ucb?

3:09 Apage43: Dunno what ucb would be. At any rate, the explanation I got was that the company wants to have some closed-source addons going forward

3:10 callen: ucb is a person :)

3:10 Apage43: and the thing that I made was apparently "too useful to give out for free"

3:10 ah

3:10 callen: Apage43: who do you work for?

3:10 Apage43: no :)

3:10 different couch company

3:10 couchbase

3:10 callen: Apage43: do you know why Katz got dumped?

3:12 Apage43: somewhat, yeah.

3:12 dissipate_: Apage43, asked by whom to close source it?

3:12 Apage43: I'm the last non-founder person, based in the US anyway, left from the CouchOne side.

3:13 still have some Couch OGs hanging out in europe.

3:14 callen: Apage43: why did the US people disperse?

3:14 Apage43: also what did you make that was useful?

3:14 Apage43: At any rate, this channel is logged, so :)

3:15 callen, 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

3:15 I built it as a tool for the support team

3:15 callen: seems useful and sounds apropos to couchbase.

3:16 seangrove: Apage43: Friends with Dale, he's still a believer

3:16 Apage43: Good to hear :)

3:16 seangrove: CouchDB is the main reason I'm averse to using Datomic now though

3:16 dissipate_: i've never used couchebase before. sounds a lot like mongodb

3:16 seangrove: Was a really bad experience

3:17 Apage43: Oh?

3:17 seangrove: This was 4 or 5 years ago though, I hear it's much better

3:17 callen: dissipate_: more soft real-time focused than MongoDB.

3:17 seangrove: 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.

3:17 Apage43: CouchDB and datomic are .. really really different.

3:17 callen: Indeed.

3:18 seangrove: Apage43: 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

3:18 http://sauceio.com/index.php/2012/05/goodbye-couchdb/

3:18 That's a diplomatic post on the issues we faced

3:18 Apage43: ah

3:18 I remember this post

3:19 dissipate_: there's so many players in the NoSQL space, some of them have got to die

3:19 callen: seangrove: well, I'll let you know Datomic goes. Feeling pretty confident about it. It's a LOT simpler than something like CouchDB.

3:20 seangrove: 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)

3:20 seangrove: callen: Yeah, your experiences are heartening

3:20 callen: I think I was angry the whole time I was working with CouchDB

3:20 I probably drank more too.

3:21 Apage43: most of the drinking I've done, I've done at work.

3:21 dissipate_: callen, well, if you want to use datomic, get out the pocketbook

3:21 Apage43: hell, most of the beer I've had was bought by Damien.

3:21 callen: dissipate_: lol, you mean the all of $3000 we had to pay for a perpetual license?

3:22 dissipate_: we spend more that on lunch one day of the week per week every month at our company.

3:22 dissipate_: callen, actually, Hickey was smart. he probably figured he already gave away too much for free with Clojure. time to cash in the chips.

3:22 Apage43: Then you can buy a Couchbase license for your underlying data store for your Datomic installation.

3:22 callen: if your database decisions have a cost impact of less than $3000, shut the company down and do something else.

3:23 Apage43: nice try.

3:23 dissipate_: callen, that's a big company. $3000 is a lot for a lean startup.

3:23 callen: $3000 is worth the time-savings if you know you'll need the functionality Datomic offers

3:23 Apage43: callen, probably should at least look like I'm trying if someone pulls up the log :)

3:23 callen: it costs the lean startup more to reimplement what Datomic does than to just spent the $3k

3:24 Apage43: defaulting to PostgreSQL for now, might use DynamoDB if writes require INFINITY (units of Amazon) scalability or something.

3:24 Apage43: friend of mine in TX is working at a startup (well they just got acquired so I guess not) that went with *DB2*

3:24 that really ate through a lot of their cash

3:24 callen: $3000 for a perpetual license isn't comparable to using Oracle or DB2 :P

3:24 dissipate_: 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'.

3:25 callen: but yes, that would be unwise. Particularly since it doesn't "win" you anything over PostgreSQL like Datomic does.

3:26 Apage43: Yeah, 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

3:26 callen: now the guy with the PR is responding to Alex's requests. Dude is a saint.

3:26 I need to send him beer over TCP/IP or something.

3:27 dissipate_: callen, bitcoin could buy him a beer in some bars

3:27 callen: Apage43: lo and behold, we need almost everything it does. event sourcing + EAV is *exactly* what we need.

3:27 Apage43: I think the sushi place near my apartment that was accepting bitcoin a couple months ago may have stopped

3:28 dissipate_: Apage43, was that in san francisco?

3:28 Apage43: Sunnyvale

3:28 dissipate_: 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.

3:29 Apage43: there was some sort of bitcoin convention nearby, so I think a lot of places experimented with taking it for a bit

3:29 callen: dissipate_: aw don't mess with the poor restaurant :(

3:29 dissipate_: i've already profited big time off bitcoin. everything from here on out is pure gravy for me, so i hope it catches on.

3:29 callen: Apage43: I'm kinda sad the Datomic Pro license doesn't let me publish benchmarks. I could make them look gooooood

3:30 dissipate_: callen, don't mess with them by giving them business? our meetup is looking for a place to meet and spend our coins.

3:31 even if no other customer used it, they would get our business, not to mention some publicity.

3:31 Apage43: the only thing I've ever spent bitcoins on is tacos.

3:31 not 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

3:31 *takes coins

3:32 dissipate_: Apage43, i was at lunch with some coworkers today. they were complaining about how splitting the bill is still such a PITA.

3:33 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

3:33 callen: I do that with square sometimes.

3:33 I 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

3:33 air milezzzzz

3:34 this works even better at 3 and 4 * restaurants.

3:34 Apage43: yeah, 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.

3:35 Eventually I'll run out of btc and just not eat tacos =P

3:35 I only ever got like, 2, in 2011 sometime

3:35 dissipate_: Apage43, you wait 10 minutes? he doesn't trust you?

3:36 Apage43, i bought a boatload last year, made a killing when the price went up to $220.

3:37 Apage43: I *am* the resident guy that writes exploit POCs when someone claims they made a thing more secure.

3:37 but no, he doesn't wait ten minutes to buy the tacos

3:39 If I screwed him over I really wouldn't have anything to spend them on.

3:40 dissipate_: i would hold on to 'em. if they become the world's currency, you might get rich. :P

3:40 Apage43: Maybe.

3:40 I remember Damien was pretty convinced that would happen for a while.

3:40 dissipate_: i've still got a significant stash.

3:42 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.

4:12 fredyr: oh now i wanna have tacos

4:12 and its only almost breakfast

4:15 callen: it's midnight and I want tacos. I think I'll read lesswrong and go to sleep instead. Night all :)

4:15 fredyr: :)

4:15 night

4:32 tangrammer: Hi folks!

4:33 Can someone help me with using macros in clojurescript?

4:33 i am trying to use https://github.com/michaelsbradleyjr/node-clojurescript

4:34 but my macro is always undefined when i try to use from node.js

4:34 thanks in advance!

4:40 ddellacosta: tangrammer: 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

4:41 tangrammer: ddellacosta: thanks for answering

4:41 ddellacosta: tangrammer: np

4:42 tangrammer: ddellacosta: I am intereseting in work with cljs but as a node lib

4:42 ddellacosta: tangrammer: I don't know anything about node.js, so can't help you with that, sorry.

4:43 tangrammer: ddellacosta: thanks again then

4:43 ddellacosta: tangrammer: np, good luck.

4:45 Apage43: tangrammer, one of the things you'll run into, I think, is that macros in CLJS are *only available at compile time*

4:48 tangrammer: Apage43: yes, my macro is in a file.clj and is in the same src source

4:48 someone here is using or has used https://github.com/michaelsbradleyjr/node-clojurescript

4:48 ?

4:50 ... or someone that is using clojurescript as a nodejs dependency/library?

4:52 sm0ke: Hello , 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?

4:53 Apage43: generics don't actually "exist" in compiled java bytecode

4:54 sm0ke: right

4:54 i have something like this in gen-class :methods [[printschema [] void] [serialize [Object] Object] [deserialize [Object] Object]]

4:54 clgv: tangrammer: 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

4:54 sm0ke: printschema is my own method

4:54 Apage43: right, so those types are right. I really never use gen-class though.

4:55 sm0ke: but i get No matching field found: serialize

4:55 Apage43: Typically if I'm implementing java interfaces it's through reify if possible

4:55 sm0ke: yea but my class has to have state

4:55 clgv: sm0ke: reify objects can have state via closures

4:56 sm0ke: ok thanks i look into it...but can we make gen class to work for this interface?

4:56 tangrammer: clgv: and what does it mean or how could i have that macro (already js-compilated) on other js environments/libs?

4:56 clgv: e.g. (let [state (atom {})] (reify ... (my-method [...] (manipulate state))))

4:56 sm0ke: not being a tool...but its just that i am a beginner

4:56 Apage43: (let [state (atom {})] (reify Thingy (setFoo [_ foo] (swap! state assoc :foo foo))))

4:57 clgv: tangrammer: afaik that means that you can use macros only in clojurescript code but not at javascript runtime from different javascript libs

4:57 sm0ke: Ok on question...boes byte[] qualifies to be Object?

4:57 Apage43: what clgv said

4:57 clgv: Apage43: :D you were more specifiy ;)

4:58 *specific

5:00 Apage43: sm0ke, yes

5:00 tangrammer: clgv: 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!....

5:01 Apage43: 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

5:01 Apage43: tangrammer, ah, what you might have been running into there

5:01 tangrammer: clgv: thanks!

5:01 Apage43: is that -'s in your ns name map to _'s on the file system

5:01 so (ns foo.bar-thing) would be foo/bar_thing.clj

5:02 clgv: tangrammer: ah ok. sounded differently ;)

5:02 tangrammer: Apage43: but with node-clojurescript compilator seems to fail, i know that cljs lets you use it but ...

5:04 sm0ke: When 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??

5:04 lazybot: sm0ke: Definitely not.

5:04 sm0ke: !!!

5:05 Apage43: the only place I ever use gen-class is for a main(), so I honestly have no Idea.

5:05 sm0ke: lazybot: ? any comments?

5:07 clgv: sm0ke: he is literally a bot ;)

5:07 sm0ke: usually using the default prefix "-" for existing methods should work

5:08 Apage43: &(println "hm")

5:08 lazybot: ⇒ hm nil

5:12 clgv: ,(println "Hello lazybot, nice to see you!")

5:12 clojurebot: Hello lazybot, nice to see you!\n

5:13 clgv: ,(println "lazybot, answer! ##(print \"sry, afk!\")")

5:13 clojurebot: lazybot, answer! ##(print "sry, afk!")\n

5:13 clgv: ah damn forgot the filter list ;)

5:13 Apage43: I think someone had the forethought to fix that

5:13 clgv: yeah. about a year ago or so

5:13 Apage43: lest an enterprising individual get them into a loop

5:13 clgv: I did write conversations like that before ;)

5:13 sm0ke: ,(repeat 1)

5:13 clojurebot: (1 1 1 1 1 ...)

5:14 Apage43: ,(doc *print-length*)

5:14 clojurebot: "; *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...

5:15 Apage43: ,*print-length*

5:15 clojurebot: 5

5:17 clgv: ,*print-level*

5:17 clojurebot: 10

5:21 Ringding: Hi, 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?

5:23 clgv: Ringding: exploiting commutative operations?

5:24 Ringding: clgv, doesn't sound very sexy ;)

5:24 I don't suspect there is a good name for it

5:24 clgv: clgv: 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

5:25 Ringding: Ok, but this can be used for merging

5:25 clgv: merging what?

5:25 Ringding: The state of two concurrent transactions

5:27 clgv: well, phrasing it like that `alter` would be merging too ;)

5:35 Ringding: alter can never see the state of two concurrent transactions, while commute can

5:38 clgv: Ringding: not really in that way.

5:38 Ringding: the difference is that `alter` fails and retries when the ref was altered concurrently, whereas `commute` does not

5:39 Ringding: Ok, made your point

5:56 dm3: hello

5:56 was wondering if anyone could shed some light on what's happening in http://stackoverflow.com/questions/16160633/clojure-tools-logging-evalreader-use

5:56 mercwithamouth: o_O

6:14 dm3: '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

6:40 clgv: dm3: you should add the complete stacktrace

6:40 dm3: and the version of tools.logging you use

6:51 dm3: clgv: 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

7:00 clgv: dm3: well my intuition there is - if all the other log calls work, that specific log call should not be different

7:01 wei_: 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?

7:06 hhenkel: Hi 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?

7:08 Okay, 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?

7:09 clgv: hhenkel: 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

7:27 hhenkel: clgv: okay thanks. I think I almost got it, only the actual data is missing...

7:27 https://www.refheap.com/18578 is what I'm doing...

7:28 I'm facing a "NullPointerException jolokia-client.core/eval2055 (NO_SOURCE_FILE:1)"

7:29 ucb: ,(doc slurp)

7:29 clojurebot: "([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."

7:30 ucb: does slurp work on a file-sew?

7:30 seq even

7:35 hhenkel: ucb: 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?

7:35 ucb: hhenkel: oh, no idea, I was just pondering :)

7:35 hhenkel: 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 :)

7:36 hhenkel: ucb: okay ;)

7:36 sheldonh: is 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

7:37 i meant (+ (inc 1) (dec 1)) (missing closing paren)

8:29 scottj: sheldonh: I think tools.trace might do that, but I haven't used it

8:30 clgv: sheldonh: lighttable had (still has?) such a mode

8:41 nenorbot: can 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

8:47 Hetu: better separate work and leisure

8:52 hhenkel: Anyone able to provide some help? https://www.refheap.com/18582

8:53 ro_st: what's the problem?

8:55 hhenkel: I want to read multiple files and the "config" gives me an error when I try to access it.

8:55 ro_st: where is config defined?

8:55 oh, duh.

8:55 so, config isn't a function

8:56 it's just a var containing the results of the doseq, which is nil because doseq doesn't return anything

8:56 (defn config [] (doseq …)) (config) will cause the doseq to run when you (config) rather than before

8:59 hhenkel: ro_st: hmm...not totaly sure if I get it right....so how would that work with let then?

8:59 ro_st: do you want the file stuff to happen when you call (config) ?

9:00 hhenkel: Nope, I want to read the files (containing config data) at the start of my program and work with the data later on.

9:01 ro_st: using doseq makes it that you can't get at the data this way

9:01 i'll share new code with you

9:03 hhenkel: ro_st: that's nice, thanks.

9:06 ro_st: https://www.refheap.com/18583

9:07 taranka: nenorbot, try to use lein in dependecies instead of manual download

9:08 http://www.myclojureadventure.com/2012/09/intro-to-clojurescript-getting-started.html - some exmplaes

9:09 ro_st: good luck hhenkel

9:40 zanes: I'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.

9:40 I must be missing something obvious.

9:41 ambrosebs: zanes: perhaps it's not a public field?

9:41 zanes: ambrosebs: Reflection says it's public.

9:42 ambrosebs: zanes: in a public class?

9:42 zanes: ambrosebs: Yep. Public and final.

9:42 ambrosebs: ok

9:42 ToxicFrog: Argument type mismatch? Can you paste the code?

9:43 zanes: ToxicFrog: 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.

9:44 https://gist.github.com/e937554d3c00758b9787

9:44 Imports: https://gist.github.com/4d04ac9af482d8b320e1

9:45 silasdavis: if I am using the for macro like (for [{:keys [foo] :as all} m] ...)

9:45 is it possible to supply the destructuring map as a variable/value

9:45 ambrosebs: zanes: which field is the issue?

9:46 freeze I guess?

9:46 zanes: ambrosebs: Last one.

9:46 getJsonSchema.

9:46 silasdavis: I see I can't do (def ds {:keys [foo] :as all}), but can I make something similar work by quoting appropriately?

9:46 ambrosebs: zanes: oh right, the error is just mistleading

9:47 zanes: Oh yeah? What's it trying to tell me?

9:47 Here's the output of reflect, by the way: https://gist.github.com/eb15bd0dacf3f2bd53e5

9:47 ambrosebs: zanes: sorry, I meant I was looking for a field lookup (judging by the error msg), but getJsonSchema should be method.

9:47 lpetit: Hello

9:48 zanes: Oh, got it.

9:48 lpetit: Anybody here having used the beta version of Counterclockwise with the auto shift feature ?

9:48 zanes: Damn. I was hoping you'd figured it out. Haha

9:48 ambrosebs: silasdavis: you need to use macros that use `for` and insert the destructuring in the right position.

9:48 lpetit: hello :)

9:49 zanes: It's weird; I can call the methods that don't take arguments without issue.

9:49 lpetit: ambrosebs: hello !

9:49 TEttinger: zanes, 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

9:49 silasdavis: ambrosebs, could you give an example?

9:49 ambrosebs: zanes: is the reflection happening at runtime?

9:49 TEttinger: err no https://github.com/fge/json-schema-validator/blob/master/src/main/java/com/github/fge/jsonschema/main/JsonSchemaFactory.java#L173

9:49 silasdavis: you mean I need to write a macro to do this?

9:50 ambrosebs: zanes: what does *warn-on-reflection* say?

9:50 zanes: TEttinger: 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

9:50 ambrosebs: silasdavis: Yes.

9:50 zanes: ambrosebs: A bunch of newlines and then nil…

9:51 TEttinger: zanes, I'm guessing that you have something that isn't a JsonNode

9:51 like null?

9:51 zanes: TEttinger: Sadly, no. It's a ObjectNode, which derives from JsonNode.

9:52 xeqi: zanes: http://jackson.codehaus.org/1.7.9/javadoc/org/codehaus/jackson/map/ObjectMapper.html looks like .readTree returns a org.codehaus.jackson.JsonNode

9:52 where the method expects a com.fasterxml.jackson.databind.JsonNode

9:52 zanes: xeqi: Aha!

9:53 That must be it. Thanks for the help, everyone.

9:53 TEttinger: haha that is a crazy error. glad you got it solved.

9:53 ambrosebs: ouch

9:56 zanes: 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.

9:57 zanes: ambrosebs: Good idea. I've been looking for an excuse to learn core.typed.

9:57 You worked on that, right?

9:57 ambrosebs: zanes: yes

9:57 zanes: During my brief stint in grad school I sat across from Sam.

9:57 ambrosebs: zanes: nice! :)

9:57 zanes: Great guy.

9:57 ambrosebs: zanes: at Northeastern?

9:57 zanes: Yep.

9:58 ambrosebs: zanes: I'm looking forward to meeting him, whenever that happens.

10:00 zanes: ambrosebs: If the Conj keeps being co-located with the Scheme & Functional Programming Workshop it'll happen eventually.

10:01 ambrosebs: zanes: yes. A goal of mine is also PhD at Indiana, hopefully he sticks around there.

10:01 zanes: ambrosebs: Specifically to work with Sam?

10:02 ambrosebs: zanes: Not specifically, by it makes it oh-so-much sweeter.

10:02 *but

10:02 Sam was the last reason for me to consider Northeastern, when he moved to Indiana the choice seemed obvious.

10:03 Well, obviously not the *last* reason :P

10:03 You know what I mean.

10:04 I also want to work with Dan Friedman and his logic programming crew.

10:04 That's been a dream for a few years.

10:14 TimMc: zanes: I think you were my TA for Fundies.

10:15 zanes: TimMc: Fun times!

10:15 TimMc: It was.

10:17 sheldonh: scottj: yeah, clojure.tools.trace isn't as fine-grained as i have in mind, but thanks. still useful for me to know about

10:17 clgv: cool, i'll check out lighttable then. thanks

10:29 borkdude: how can I ensure in datomic only one entity for a given point in time exists that has an attribute :myid/version

10:29 :mydb/version

10:34 TimMc: borkdude: Just keep writing to the same ID, yeah?

10:35 borkdude: TimMc yes, probably it's best to introduce a name attribute that is also unique

10:48 can I transact schema updates and data that is based on the schema (in that order) in one transaction in Datomic?

10:56 nenorbot: any idea why httpkit won't serve files under public/resources?

11:05 cmdrdats: flatten

11:06 is there something not great about flatten? I seem to remember discussions about it a while ago?

11:06 `cbp: ~flatten

11:06 clojurebot: flatten 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:06 cmdrdats: `cbp: excellent - exactly what i was looking for, thanks

11:20 saml: hola

11:20 `cbp: hi

11:29 saml: i'm gonna learn clojure

11:29 how much can i learn in one day?

11:31 hyPiRion: saml: 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:31 llasram: For JVM Clojure, I'd say Java/JVM familiarity will also have some impact

11:31 taranka: if u know some of lisp - as much as u can read pages.

11:33 hyPiRion: llasram: same goes for clojurescript and javascript I guess

11:34 llasram: nah. Totally orthogonal! </lying>

11:35 saml: i don't know lisp. i just registered for clojure tutorial on CUFP

11:37 hyPiRion: saml: Hmm. What languages do you know from before (if any)?

11:38 mdrogalis: saml: Just enjoy the learning, whatever pace comes to you. You'll have fun.

11:38 hyPiRion: (inc mdrogalis)

11:38 lazybot: ⇒ 1

11:39 mdrogalis: Ding.

11:40 saml: (dec mdrogalis )

11:40 lazybot: ⇒ -1

11:40 llasram: Well, apparently you already know *some* Clojure :-)

11:40 mdrogalis: Hah

11:42 dnolen: hrm 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:43 mdrogalis: dnolen: If it's serving no purpose, axe it.

11:44 dnolen: mdrogalis: heh well want to CLJS users input first :) I'm curious how it could be used, could always be missing something

11:44 napping: why would it be dead?

11:45 mdrogalis: dnolen: Ah, I thought you consclusively found that it was always getting eliminated. My bad.

11:45 dnolen: napping: 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:46 napping: the only code that does use it are REPLs, but of course REPLs don't really work with advanced compilation

11:46 so I can't see a good reason to export it.

11:46 ToBeReplaced: where are pre/post conditions stored on an object?

11:47 mdrogalis: ToBeReplaced: I think in its metadata?

11:48 ToBeReplaced: mdrogalis: it's not collected in meta

11:49 bja: are there any verbose or debug options to cljsbuild? suddenly it's complaining that dommy isn't on my classpath, but lein classpath disagrees

11:49 mdrogalis: ToBeReplaced: Hm..

11:49 llasram: ToBeReplaced, mdrogalis: in the metadata on the Var (vs on the function held by the Var)

11:50 mdrogalis: Yer.

11:50 ToBeReplaced: not there, at least not in nrepl?

11:51 llasram: (defn foo [x] {:pre (number? x)} x) (meta #'foo) (foo nil)

11:51 meta doesn't show any conditions, but call throws the assertion error

11:52 `cbp: ToBeReplaced: I think they are inserted at the top/bottom of the function as asserts

11:52 Bronsa: ToBeReplaced: (fn [] {:pre [false]} "") gets transformed to something like (fn* ([] (assert false) ""))

11:52 llasram: Yep, I was entirely wrong, for which I apologize

11:53 ToBeReplaced: `cbp: Bronsa: okay, thanks... makes sense

11:53 mdrogalis: Yeah, my bad.

11:54 ToBeReplaced: mdrogalis: llasram: meta seemed like a logical place :) though the asserts make sense too, and probably simplifies the code a ton

11:55 gfredericks: does a standard jetty-adapter ring setup not support gzip by default?

11:59 bja: does cljs support require's :refer?

11:59 tbaldridge: bja: yes

11:59 bja: but not :refer :all

12:00 bja: ok, thanks

12:01 ticking: does somebody know if the timbre logging lib is supposed to be thread safe?

12:03 `cbp: it'd be nice if nrepl could give you multimethod arg lists :P

12:04 I wonder if its possible. Dont know much about how nrepl works

12:04 * `cbp adds to todo-list

12:06 * ToxicFrog pokes core.typed with a stick

12:06 ToxicFrog: It seems like there should be a way to use metadata instead of (ann)

12:06 Or have it infer the type of defs from their initial value

12:06 bja: https://gist.github.com/ed4357f7b1c0399c8b78

12:07 gfredericks: ,(fn ^{:x [does this get eval'd?]} my-fn [])

12:07 clojurebot: #<sandbox$eval29$my_fn__30 sandbox$eval29$my_fn__30@fe47c>

12:07 bja: any idea how I'd get that with a :compiler {:externs []}?

12:11 `cbp: Can you attach metadata to a defrecord?

12:12 gfredericks: yep

12:13 `cbp: I'm not sure how, it says Expecting var, but MyRecord is mapped to class user.MyRecord

12:40 tufflax: I asked this earlier, but I might just ask again to get more input...

12:40 I 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:40 ogging calls in the rest of my code. :p

12:44 napping: why does gen-class need the superclass to exist?

12:45 mdrogalis: tufflax: That's why I wrote this. http://michaeldrogalis.tumblr.com/post/46560874730/beautiful-separation-of-concerns

12:45 ToxicFrog: Is it just me or core.typed kind of unwieldy?

12:45 tufflax: mdrogalis: i'll take a look

12:47 tbaldridge: ToxicFrog: I agree, I really wish it had a metadata like syntax or some way to integrate with defn better

12:49 arohner: tufflax: logging is good

12:49 tufflax: arohner: :)

12:49 arohner: tbaldridge: it does have metadata support, in recent releases

12:49 I still use (ann foo) (defn foo), because I like the indention better

12:50 (defn ^{:ann '[Any -> Any]} foo [x] x)

12:50 llasram: core.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:51 napping: So :methods can't be used to explicitly declare the type you expect inherited methods to have, darn

12:52 arohner: tufflax: 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:53 tbaldridge: (inc llasram) , I've thought of that several times

12:53 tufflax: arohner: I see. I think I'll be fine with wrapping for now. Thanks for the input!

12:53 gfredericks: arohner: 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:53 arohner: llasram: tbaldridge: it's really not that bad

12:53 nenorbot: is there some way to find the type of object in clojurescript?

12:54 tufflax: gfredericks: yeah I was thinking along the same lines

12:54 tbaldridge: nenorbot: use (type obj) ?

12:54 hyPiRion: llasram: I would guess it's easier to go the other way around. From typed to partially typed

12:55 nenorbot: thanks tbaldridge

12:56 gfredericks: tufflax: arohner: I've been noodling the idea of a comprehensive hooks-based logging lib

12:56 would give lots of options for logging args, return values, and exceptions

12:56 I'm curious if most logging can boil down to that sort of thing

12:57 arohner: for our app, we can't log everything, due to data volume, and noise

12:58 tufflax: gfredericks: couldn't that be done with robert.hooke and then a logging lib?

12:58 arohner: so if a fn takes a user and returns a user, we'd probably only log (:login user), rather than the entire user object

12:58 gfredericks: tufflax: I think some helpers would make it more declarative; especially if the logging lib were data-based rather than string-based

12:58 janiczek: I 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:59 gfredericks: arohner: that kind of thing would be part of the configurability

12:59 tufflax: yeah that's something I've beeng thinking about, logging data instead of text

12:59 gfredericks: tufflax: I built a tools.logging wrapper lib for logging data

12:59 it goes out through log4j as json into splunk

12:59 _great_ experience

12:59 janiczek: it seems to me that the two cases (1. intentional nil, 2. catched exception -> nil) get merged together ...

13:00 tufflax: couldn't one just use `prn` or something with clojure data?

13:00 gfredericks: tufflax: not if you want the log output to be pure data

13:00 i.e., not with the normal logging preamble

13:00 rasmusto: sounds too close to "pickling" to me

13:00 tufflax: gfredericks: ah

13:01 gfredericks: tufflax: since we have one json object per line in the log file, we can use jq for exploring/watching; it's extremely convenient

13:01 tail logfile | jq 'select (.type == "what-i-care-about") | [.some, .keys]'

13:01 tufflax: jq... gotta look it up :P

13:01 bja: anyone familiar with Google Closure Compiler freaking out at com.google.javascript.jscomp.CommandLineRunner.getDefaultExterns()?

13:01 tufflax: oh

13:01 jquery?

13:02 gfredericks: tufflax: no it's just a shell processor for json

13:02 tufflax: ok

13:02 gfredericks: http://stedolan.github.io/jq/

13:02 tufflax: I see

13:02 gfredericks: being 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:03 tufflax: gfredericks: yeah, certainly something to think about

13:03 thanks

13:03 bja: I 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:04 ToxicFrog: arohner: recent here being HEAD, or 025?

13:05 bja: but 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:05 arohner: ToxicFrog: core.typed metadata support? that was added in 0.1.24

13:05 bja: this also only seems to happen with cljsbuild, since running cljs.closure/build manually works without exception

13:06 arohner: https://github.com/clojure/core.typed/blob/master/CHANGELOG.md

13:09 ToxicFrog: arohner: Oh. Is this documented?

13:09 On the wiki/readme, I mean, not the changelog.

13:10 arohner: I don't recall

13:10 ambrosebs: arohner, ToxicFrog: Metadata kinda works, I wasn't too happy with the design.

13:10 Still in the back of my mind.

13:11 danielszmulewicz: Is the idiomatic way to do string interpolation in Clojure?

13:12 arohner: danlarkin: clojure.core.strint

13:12 danlarkin: :o :o

13:12 danielszmulewicz: "src/{{sanitized}}/foo.clj"

13:12 what are those double curly braces?

13:13 seancorfield: doesn't that originate from the mustache template library?

13:13 hyPiRion: danielszmulewicz: moustache-code

13:13 `cbp: danielszmulewicz: syntax for a template engine

13:13 danielszmulewicz: hyPiRion `cbp: gotcha. thanks.

13:13 seancorfield: it turns up in a lot of languages

13:13 hyPiRion: danielszmulewicz: https://github.com/technomancy/leiningen/blob/master/doc/TEMPLATES.md#templating-system

13:14 danielszmulewicz: seancorfield: thanks

13:14 nenorbot: I'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:14 seancorfield: Selmer is a new Clojure lib that implements Django-style templating, which also looks like that for variables.

13:14 ambrosebs: arohner, ToxicFrog: oh you were talking about :ann. Nvm :P

13:14 seancorfield: nenorbot: (.- x foo) i think?

13:18 nenorbot: seancorfield: thanks! it's (.-foo x)

13:18 for some reason i thought the syntax was the same for both functions and properties

13:18 ToBeReplaced: i'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:18 tbaldridge: nenorbot: it is in Clojure, not in ClojureScript

13:19 nenorbot: tbaldridge: probably why i thought that :)

13:19 hmm... is there any reason for the distinction?

13:19 arohner: ToBeReplaced: have you changed the macro definition at the repl?

13:19 if that's the case, you'll need to recompile all files that use the macro to get consistent behavior

13:20 dnolen: nenorbot: the JVM can distinguish between property and method invocation, there's no way to do this in JS

13:21 ToBeReplaced: arohner: no, fresh repl -- specifically, (macroexpand '(my-macro x)) expands in the repl, returns '(my-macro x) in lein test

13:25 dnolen: ClojureScript "Hello world" now 2 lines http://gist.github.com/swannodette/6540713

13:27 ToBeReplaced: dnolen: nice

13:29 dnolen: the next big pet peeve TODO - source maps, seangrove what state is your branch in?

13:33 gfredericks: dnolen: that random number string line is super fascinating. I'm curious if there's some utility to having it.

13:33 seangrove: dnolen: Working more or less

13:33 There are problems around the tooling that probably need to be working into cljsbuild

13:33 dnolen: seangrove: oh! really! were you able to fix the off by one error?

13:33 seangrove: dnolen: Yeah

13:33 Column location for lots of things worked

13:34 dnolen: gfredericks: yeah I looked around in Google Closure looks like something from the body of goog.string.getRandomString

13:34 ambrosebs: llasram: 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:34 dnolen: seangrove: that's awesome, can you construct a flattened patch and attach to source map ticket so I can review?

13:34 ambrosebs: llasram: the *amount* of annotations needed is a different issue, that's a tradeoff for bug-finding capability and error reporting.

13:36 gfredericks: ambrosebs: do you discuss somewhere why you didn't take the metadata approach to annotating?

13:36 seangrove: dnolen: I'll have to do it tomorrow, I'm going to JSConfEU and jet lagged pretty badly

13:36 dnolen: seangrove: no rush

13:36 gfredericks: ambrosebs: I'd accept "you don't know what on earth you're talking about" as a fair response

13:36 dnolen: seangrove: you speaking?

13:36 matthiasn: dnolen: sweet

13:36 seangrove: dnolen: No, just attending

13:36 ambrosebs: gfredericks: LOL

13:36 technomancy: gfredericks: I think that got added?

13:37 gfredericks: technomancy: like super recently?

13:37 technomancy: ish

13:37 seangrove: dnolen: Also, it seems the source files need to be manually copied to a web-accessible location to show up in the browser

13:37 ambrosebs: gfredericks: yes it's there. maybe a month ago?

13:37 gfredericks: I was just looking at core.typed a week or two ago

13:37 seangrove: Have you found a way to get chrome to work with a file:// url?

13:37 gfredericks: must've missed it

13:37 ambrosebs: gfredericks: it's not documented very well

13:37 gfredericks: thx; apparently I don't know what on earth I'm talking about

13:37 ambrosebs: gfredericks: I personally much prefer ann.

13:37 dnolen: seangrove: I doubt that's allowed but I consider that a non-issue :)

13:37 gfredericks: ambrosebs: am curious why

13:38 seangrove: dnolen: Heh, ok, it would be very nice though. The manual copying is bothersome. cljsbuild can be extended to handle it though

13:38 ambrosebs: gfredericks: just the way it looks.

13:38 dnolen: seangrove: 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:38 seangrove: no need for cljsbuild to handle it, we can respect the path in CLJS compiler

13:38 ambrosebs: gfredericks: I push the ann above the defn, and my brain likes it.

13:38 *put

13:39 metadata gets ugly if you have to use ^{} syntax

13:39 and it looks a little like haskell if you use ann :)

13:39 gfredericks: ambrosebs: okay, so for the syntax rather than the semantics

13:40 ambrosebs: gfredericks: there is no semantic difference.

13:40 technomancy: you could get your editor to toggle visibility of metadata

13:40 ambrosebs: gfredericks: it may be surprising, but I don't lookup the metadata on the var.

13:40 I look at the def via an AST.

13:41 Bronsa: technomancy: you can get your editor to toggle `ann` aswell :)

13:41 ambrosebs: unfortunately this doesn't quite work with Clojure AST's yet, but CLJS it works fine.

13:41 gfredericks: ambrosebs: so the ann clause doesn't do anything? just gets noticed when analyzing the code?

13:41 ambrosebs: gfredericks: yes.

13:41 seangrove: dnolen: 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" when examining the source

13:41 gfredericks: ambrosebs: interesting

13:42 technomancy: Bronsa: heh

13:42 ambrosebs: gfredericks: I'm anti side-effect with gathering annotations.

13:42 seangrove: That 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:42 ambrosebs: gfredericks: it's an explicit phase in the checker.

13:42 Bronsa: ambrosebs: we could try and see if it works better with CinC's analyzer one day

13:42 ambrosebs: Bronsa: please!

13:42 dnolen: seangrove: right, I remember - again it's a simple detail that I don't suspect will be difficult to sort out :)

13:42 gfredericks: ambrosebs: 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:43 seangrove: Fair enough

13:43 Bronsa: ambrosebs: I'll put that in my todo list

13:43 ambrosebs: gfredericks: what kind of variants?

13:43 gfredericks: ambrosebs: arbitrary assoc's and dissoc's, without having to explicitely declare every possible variant

13:44 e.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:45 ambrosebs: 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:46 ambrosebs: gfredericks: haha. I don't think it sounds particularly hard, I'd be interesting in hearing specifics.

13:46 gfredericks: the type system may just be missing one feature to enable it.

13:47 gfredericks: ambrosebs: it seemed hard to annotate this correctly: (fn [m] (assoc m :foo 12))

13:47 ambrosebs: 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:48 i.e., the only thing it knew about that second form was that it had a :foo in it; it had forgotten about :bar

13:49 ambrosebs: gfredericks: ok, core.typed handles that easily.

13:49 (cf (fn [a] (assoc a :foo 121)) ['{:bar Number} -> '{:bar Number, :foo Number}])

13:50 gfredericks: ambrosebs: but then the {:bar Number} is fixed, no? I can't call it with (m {:fazzle :dazzle}) anymore?

13:50 sdegutis: I very inefficiently made this work on Mac: (= [1] (.arrayWithObject: ^NSArray 1))

13:51 ambrosebs: (cf (assoc {:bar 'a} :bar 1)) => '{:bar (Value 1)}

13:51 is that what you mean?

13:51 sdegutis: And identity was a little weird. (= [1 2 3] '(1 2 3)) but (not= "foo" 'foo)

13:51 ambrosebs: you can "update" the :bar

13:52 tylere: How 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:52 callen: tylere: sounds like standard destructuring to me :)

13:52 gfredericks: ambrosebs: no, not necessarily for overriding values

13:53 tylere: callen: eh? I don't know that the keys will be if present, unless I'm missing something

13:53 seangrove: tylere: (defn f [x y & [z]] (let [z (or z {})] ...))

13:54 gfredericks: ambrosebs: 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:54 tylere: seangrove: agh, yea, that should do it!

13:54 seangrove: But you could do it in the fn declartion as well if you want it terser

13:54 callen: tylere: there are some Clojure koans out there for destructuring, if you go through some exercises, you'll become more fluid at doing that.

13:54 ambrosebs: gfredericks: ok. Yes, unsupported atm. But definitely not a fundamental limitation.

13:54 callen: tylere: could save you the trouble of doing the (or ...) in the let body if you so desired. whatever's clearer to your mind.

13:55 ambrosebs: gfredericks: core.typed should be able to handle things like ring middleware in theory.

13:56 gfredericks: so.. watch this space :)

13:56 gfredericks: ambrosebs: okay, glad to know I inferred correctly; this would just be some sort of parameterization over HMaps, no?

13:57 coventry`: tylere: There's also the possibility for multiple signatures: (defn f ([x y] (f x y {})) ([x y z] (main body)))

13:57 ambrosebs: gfredericks: Yes, with some special "update" type. (All [[m :< AnyHMap]] [m -> (Update m :foo Number)])

13:57 tylere: agh, neat didn't realize clojure could do that coventry`

13:58 ambrosebs: gfredericks: it's just a matter of writing Update. Should be straightforward.

13:58 gfredericks: ambrosebs: so something similar to Update would support dissoc?

13:58 ToBeReplaced: arohner: bug reported https://github.com/technomancy/leiningen/issues/1326

13:58 ambrosebs: gfredericks: yes.

14:00 callen: seangrove: awesome @ cljs source maps enhancement :)

14:00 gfredericks: ambrosebs: 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:00 ambrosebs: gfredericks: Update would just expand out into a HMap as you'd expect, once m is instantiated.

14:02 gfredericks: not sure.

14:02 gfredericks: trying to figure out the type of the first argument

14:02 gfredericks: ambrosebs: (defn remove-nil-keys [m] ...)

14:03 pulls out any key whose value is nil

14:03 probably doesn't do exactly that

14:03 need a contains? check I guess

14:03 no wait

14:03 it does do exactly that

14:03 ambrosebs: gfredericks: right. Probably too complex without some help with assertions.

14:04 gfredericks: ambrosebs: it is not out of the question that I will someday do a deep dive on all this

14:05 ambrosebs: gfredericks: :)

14:05 gfredericks: all very tempting isn't it

14:05 gfredericks: oh definitely

14:05 I feel like one of the biggest weaknesses of clojure-style programming is all the random HMaps flying around with undocumented key sets

14:06 ambrosebs: gfredericks: yes it's pretty awful.

14:06 gfredericks: if core.typed could someday make it easy to do that confidently, I think that'd be a huge win

14:06 dnolen: normanrichards: ping

14:06 normanrichards: hey

14:06 Bronsa: gfredericks: I agree

14:06 dnolen: normanrichards: 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:06 gfredericks: Bronsa: ambrosebs: but I think declared types on all functions that use HMaps would be a _lot_ of noise

14:07 arohner: gfredericks: it's really not. you def-alias the 5-10 types your app uses

14:07 ambrosebs: gfredericks: ok, I disagree.

14:07 gfredericks: very useful to me.

14:09 dnolen: normanrichards: 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:09 normanrichards: 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:10 normanrichards: dnolen in the middle of something, but I wasn't exactly sure if that would solve the problem.

14:10 ambrosebs: gfredericks: 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:11 dnolen: normanrichards: 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:11 ambrosebs: gfredericks: of course you could just do a pass after you've written it in untyped Clojure.

14:13 normanrichards: dnolen 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:14 ToxicFrog: Yeah, 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:14 ambrosebs: gfredericks: 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:14 ToxicFrog: How hard would it be to infer the type of a var from the initial (def) of it?

14:14 Bronsa: ambrosebs: on a side note, I really don't like the "-" in `def-alias` :(

14:16 ambrosebs: ToxicFrog: 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:16 ToxicFrog: I want to write a tool that generates a good guess for your defs.

14:17 ToxicFrog: then you can insert it in your program where you like.

14:17 ToxicFrog: and there's no added trickiness to handle for tooling.

14:18 ToxicFrog: also, just checking you know about the shorthands for some common types http://clojure.github.io/core.typed/#clojure.core.typed/Map

14:18 ToxicFrog: I totally didn't! That will make things nicer.

14:19 ambrosebs: ToxicFrog: please let me know if you want some common aliases in core.typed.

14:20 Bronsa: :(

14:20 bmabey: odd, I always thought atoms themselves (not the current values) could have metadata.. doesn't look like that is the case

14:20 ,(with-meta (atom 42) {:data-about-identity :blah})

14:20 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.Atom cannot be cast to clojure.lang.IObj>

14:20 ambrosebs: bmabey: I think atoms have mutable metadata.

14:21 ToxicFrog: ambrosebs: sure thing.

14:21 Thanks.

14:21 ambrosebs: ,(alter-meta! (atom 1) assoc :a 1)

14:21 clojurebot: {:a 1}

14:22 bmabey: ah, great to know, thanks ambrosebs!

14:22 ambrosebs: np

14:22 muhoo: i haven't used etags in emacs/clojure yet, is that the recommended way to jump to a function definition?

14:23 callen: muhoo: no, that's the old fashioned way.

14:23 muhoo: project is getting big and i'm getting annoyed manually jumping around.

14:23 callen: etags are for cranky bastards writing C.

14:23 arohner: muhoo: use nrepl

14:23 muhoo: i am using nrepl

14:23 callen: then use nrepl. :P

14:23 muhoo: i didn't see a function in the mode help to jump to to a function def

14:23 callen: muhoo: https://github.com/clojure-emacs/nrepl.el ctrl-f "definition"

14:23 ToxicFrog: Oh hey, I just ran into what you were discussing earlier with typing functions that update a map with new fields.

14:24 arohner: muhoo: my C-. is bound to nrepl-jump

14:24 ambrosebs: Bronsa: I'm not sure why I chose def-alias. Probably because I was porting Typed Racket :)

14:25 arohner: muhoo: sometimes I need to compile the file to make jumping work, but it mostly works great

14:25 ToxicFrog: Whoops. I have managed to confuse it with anonymous functions.

14:25 fn> with inline annotations, yes>?

14:26 ambrosebs: ToxicFrog: what are you asking? :)

14:26 muhoo: arohner: thanks!

14:28 ToxicFrog: ambrosebs: 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:28 ambrosebs: ToxicFrog: yes, arguments default to Any if unannotated.

14:29 ToxicFrog: (fn> [x :- XType, y :- YType] ..)

14:30 gfredericks: ambrosebs: so are map literals a shorthand for HMaps?

14:31 ambrosebs: gfredericks: '{:foo Any} is (HMap :mandatory {:foo Any})

14:33 sdegutis: (inc wei_)

14:33 lazybot: ⇒ 1

14:37 ToxicFrog: ambrosebs: Any is in clojure.core.typed, right? Because it can find t/Vec and t/Map but not t/Any.

14:37 ambrosebs: ToxicFrog: no, Any is just syntax like U and Fn

14:37 gfredericks: ambrosebs: yeah I suppose it's not too noisy on average

14:38 ambrosebs: :)

14:42 gfredericks: ambrosebs: brehaut I think said you didn't like haskell-style non-local inference?

14:43 ambrosebs: gfredericks: it's great in a language built around HM inference.

14:43 mdrogalis: Just discovered clojure.inspect. That can come in handy for sure...

14:43 ambrosebs: gfredericks: Clojure isn't :)

14:44 gfredericks: ambrosebs: is there an easy way to explain to a newb like myself in what sort of way it would not go well?

14:45 ambrosebs: gfredericks: we couldn't have nice things like unions and function intersections.

14:46 gfredericks: they're essential in modelling how Clojure works.

14:46 technomancy: nil is *everywhere* in clojure; you can't fight it =\

14:46 gfredericks: ambrosebs: okay I think I will probably not understand this in minutes :/ oh well

14:46 callen: ambrosebs: I didn't know there was an advantage to not having HM. Interesting.

14:46 ambrosebs: how does HM disallow type unions?

14:47 technomancy: embrace the chaos.

14:47 ambrosebs: callen: it's more that with local type inference we can make ad-hoc unions.

14:47 technomancy: callen: nihilist!

14:47 callen: technomancy: an accurate statement. Next?

14:47 ambrosebs: callen: in HM you need to make a common supertype or similar.

14:48 gfredericks: ambrosebs: maybe my issue is not knowing what is the essential difference between local and global

14:48 callen: also Oracle users seem to really like Korma, or seen differently, Oracle users contribute to Korma more often than other database users.

14:48 ambrosebs: ohhh, you have to reify an algebraic type?

14:48 coventry`: 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:48 ToxicFrog: ambrosebs: oh. That explains a lot.

14:49 coventry`: https://www.refheap.com/18593

14:49 ambrosebs: callen: I'm pretty sure. Otherwise the inference would really struggle.

14:50 callen: ambrosebs: that makes sense. (I'm trying to understand this as a past user of Haskell, OCaml and Scala, but not Typed Racket)

14:50 in fact, a compare/contrast document would be...revelatory.

14:50 jenkins, fetch me a scribe!

14:51 ambrosebs: callen: Typed Clojure really takes advantage of the flexibility local type inference gives you, so it's a trade off between annotations and accuracy.

14:51 callen: turns out Haskell finds a sweet spot, but it's really hard to extend just a little further.

14:53 callen: ambrosebs: 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:53 however, 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:54 maybe macros for annotations in Typed Clojure can ameliorate this?

14:54 ambrosebs: callen: fundamentally, macros in Scala and Clojure are going to have similar type signatures.

14:54 callen: ambrosebs: that's not my point or what I'm talking about.

14:55 ambrosebs: 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:55 Template Haskell and Scala macros are not remotely comparable to lisp macros.

14:55 don't let them make you think they checked off that tick box.

14:55 ToxicFrog: Huh.

14:56 core.typed has detected a bunch of misnamed namespaces that nonetheless somehow work.

14:56 ambrosebs: callen: yes, macros are great for hiding local annotations.

14:56 ToxicFrog: Also, is there a way to say "check this ns and everything under it"?

14:56 callen: ToxicFrog: errr...how'd they work?

14:56 ambrosebs: I don't even mean hiding the whole annotations, I mean sugaring higher order patterns like in Scalaz.

14:56 ambrosebs: have you looked at Fluokitten or Scalaz?

14:56 ambrosebs: callen: nope

14:57 ToxicFrog: callen: I have NO IDEA!

14:57 ambrosebs: callen: Scalaz, in awe for a few seconds :)

14:57 ToxicFrog: callen: But I had in one file a (:require bltool.data.foo), and in bltool/data/foo.clj, (ns bltool.source.foo) (defmethod ...)

14:57 callen: ambrosebs: 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:58 ambrosebs: Scalaz wasn't worth it, Fluokitten was. Fluokitten is why I was initially skeptical of a typed.clojure

14:58 because Fluokitten was ridiculously lightweight and pleasant to use compared with Scalaz.

14:58 ToxicFrog: Possibly 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:58 callen: these are relatively high-level and impractical concerns though, I think most Clojure users don't need to care.

14:58 appendonly: i'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:59 callen: appendonly: fireplace is the current standard choice.

14:59 ambrosebs: callen: Fluokitten is lightweight, but not as useful as Scalaz?

14:59 I've never heard of Fluokitten, shall look it up.

14:59 rasmusto: appendonly: I don't use a traditional interactive repl, just fireplace and it's quasi-repl (cqc)

14:59 ambrosebs: ohhh

14:59 Fluokitten.

14:59 yes.

14:59 :)

15:00 Totally need to type that library :)

15:00 callen: ambrosebs: Scalaz is more comprehensive, but Fluokitten still covers all the same bases and I prefer to Scalaz by far.

15:00 ambrosebs: well I'm talking about this so that you can stretch core.typed's legs.

15:00 I want to see how well the local inference works on something like Fluokitten.

15:00 because in Scalaz, Scala's local inference utterly failed.

15:00 and made it painful.

15:01 ambrosebs: callen: right. I had some success typing algo.monads.

15:01 callen: algo.monads...is a good start. the rabbit hole goes ever deeper thoguh.

15:01 though*

15:01 it is my *suspicion* that it's doable but might take sugar to make usable.

15:01 ambrosebs: callen: FWIW macros were very useful for annotating monad transformers and things.

15:01 callen: that's what I'm getting at exactly.

15:02 ambrosebs: callen: yep, there's nothing fundamentally different about Typed Clojure's and Scala's local type inference.

15:02 callen: Scala is slightly smarter in some ways, Typed Clojure others.

15:02 callen: ambrosebs: 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:02 stuck and*

15:02 ambrosebs: callen: ah.

15:02 callen: ouch

15:02 callen: Right. This is why I was so mad.

15:03 Scala is why some people end up going full-blown "HM or go home"

15:03 because they don't have real macros.

15:03 ambrosebs: callen: I briefly looked at Fluokitten before, it's well designed at least.

15:04 appendonly: callen, rasmusto: thx

15:04 callen: seems to be. I've only experimented with it.

15:05 ambrosebs: callen: yes. I think your hunch is on the right track about macros.

15:05 callen: ambrosebs: 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:06 ambrosebs: I'm basically well-wishing you and hoping this ends up being what I always wanted to begin with :)

15:06 ambrosebs: callen: :) Clojure is a lovely base to build a type system on thankfully.

15:07 appendonly: i'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:08 gfredericks: appendonly: what does "unix-y" mean aside from the stuff you just ruled out?

15:08 callen: appendonly: a persistent daemon/service could fit.

15:08 egghead: appendonly: just use raynes conch library and be done :3

15:08 appendonly: gfredericks: an example would be writing a daemon

15:09 callen: appendonly: write a spellchecking daemon.

15:09 appendonly: or take one of the items off my to-do list if you want to dive into the deep end.

15:10 egghead: appendonly: learn clojure by playing with pallet maybe

15:10 mdrogalis: Hey 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:10 callen: egghead: no. don't.

15:10 egghead: :)

15:11 callen: I don't use pallet but why not

15:11 callen: egghead: pallet has a lot going on with it. a very busy library.

15:11 egghead: yeah uhm, if you'd used pallet before you'd know why your suggestion isn't a good idea.

15:11 pallet is for people that 1. Know Clojure 2. Want to provision a server.

15:11 it's not a scripting library and it's going to scare new people.

15:12 coventry`: 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:12 egghead: how about using https://github.com/Engelberg/instaparse then to write a lil' parser

15:12 callen: coventry`: synthread

15:12 uvtc: appendonly, 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>. You can shell out using `clojure.java.shell/sh`.

15:13 mdrogalis: coventry`: tbaldrid_ or bbloom could probably do that. Heh.

15:13 callen: coventry`: core.async

15:13 coventry`: jQuery

15:13 coventry`: LINQ

15:13 tbaldridge: callen: I'd say core.async's go Macro perhaps

15:13 callen: coventry`: Parsec

15:13 coventry`: Instaparse

15:13 tbaldridge: callen: nothing else in core.async uses monads

15:13 appendonly: callen: please point me to your bug list :-)

15:13 callen: tbaldridge: IOC?

15:14 tbaldridge: but yes, I was thinking of your go macro.

15:14 bbloom: i'd argue that the interesting bit is explicit implicit monads

15:14 appendonly: uvtc: cheers. that's a good lead on how to do what i want

15:14 tbaldridge: callen: yeah, the IOC macro uses monads, but it the actual IOC code doesn't use monads.

15:14 hiredman: lein-exec is silly

15:14 bbloom: you use monads ALL THE TIME implicitly

15:14 mdrogalis: There he is D:

15:14 It's like Beetle Juice. I said his name too many times.

15:14 coventry`: bbloom: Yes, but I'm looking for examples where the monad abstraction buys you something in terms of expressiveness.

15:14 uvtc: hiredman, why?

15:15 appendonly: mdrogalis: thanks, although the ideal is to have programs that are composable on the commandline and run quickly (plus i use vim ;-) )

15:15 callen: coventry`: jQuery?

15:15 robink: If 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:15 * tbaldridge hates it when people say 'everything is a monad'

15:15 hiredman: uvtc: clojure has shebang support

15:15 callen: seriously, anything that chains operations against a collection is a faux list monad.

15:15 uvtc: hiredman, Sorry, don't know what you mean. Could you explain?

15:15 callen: hiredman: lein exec is so you can use dependencies.

15:15 bbloom: tbaldridge: yeah, it's the same logical gap as the turing tarpit

15:15 mdrogalis: appendonly: 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:16 uvtc: hiredman, bbloom : Yes, I really like that I can use 3rd-party libs with scripts using lein-exec.

15:16 robink: if-let sounds more efficient

15:16 tbaldridge: coventry`: 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:16 robink: Since there's a single keyword resolution call and the (useful) result is retained.

15:16 hiredman: uvtc: https://gist.github.com/hiredman/5033484

15:17 ,(doc find)

15:17 clojurebot: "([map key]); Returns the map entry for key, or nil if key not present."

15:18 robink: hiredman: 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:19 callen: My to-do list at the moment https://www.refheap.com/18598

15:20 If I don't pick anything off that list in the next 24-48 hours, I'll just start attacking Korma PRs and issues.

15:20 coventry`: tbaldridge: Thanks. Would that have been easier to express with a formal notation for monads like Haskell or presumably fluokitten provides?

15:20 mdrogalis: Dashboard for Datomic.. Nice.

15:21 callen: alexbaranosky: you did all the work :)

15:21 alexbaranosky: I'm just whipping the PR submitters :)

15:22 uvtc: hiredman, Oh, that's neat. Thanks. Will have to look closer, but it looks like lein-exec may be more convenient.

15:22 sdegutis: What's a good use-case for this? https://github.com/sdegutis/clojuredocs/wiki/clojure.core-transient

15:22 callen: and I need to finish this PR: https://github.com/korma/Korma/pull/178

15:23 robink: but what I'm thinking is: (if-let [value (mymap %1)] (construct-new-thing (keyword-to-string-map %1) value))

15:23 tbaldridge: coventry`: 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:23 robink: oops, missed a close-paren

15:24 bja: callen: reiddrapper/simple-check might be worth checking out for your QuickCheck item

15:24 coventry`: Thanks, tbaldridge. That clarifies things.

15:24 callen: bja: I know, that's why I de-prioritized it for now.

15:24 bja: thanks for the heads up :)

15:25 bbloom: coventry`: fluokitten reifies monads as a protocol: ie a dictionary of methods

15:25 coventry`: if you only need a particular monad in a particular context, or only with lexical extent, then macros are more common

15:25 bja: "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:26 bbloom: coventry`: 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:26 bmabey: sdegutis: 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:26 tbaldridge: sdegutis: see the source of "into"

15:26 bmabey: ,(source into)

15:26 clojurebot: Source not found\n

15:26 tbaldridge: ,(source into)

15:26 clojurebot: Source not found\n

15:26 tbaldridge: bleh

15:27 bmabey: haha

15:27 pjstadig: ~source into

15:27 callen: pjstadig speaks the language of the system.

15:27 bmabey: sdegutis: a lot of clojure's provided functions use transients under the hood so you don't need to use it yourself as much

15:27 coventry`: 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:28 sdegutis: bmabey: oh

15:28 callen: coventry`: monads are reified computation.

15:28 it's a way of abstracting processes, types, and patterns of computation into "things"

15:29 from there you can interact with higher level concepts and less with implementation details.

15:29 If 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:29 technomancy: the bot in #emacs babbles incomprehensibly when you ask it about monads

15:29 bbloom: coventry`: i don't particularly think that reifying monads is useful

15:29 callen: if you know monads, you'll know you're touching on the List monad.

15:29 tbaldridge: (inc bbloom)

15:29 lazybot: ⇒ 17

15:30 callen: now 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:30 bbloom: coventry`: i think that most monads are better of with taylor fit syntax rather than the generalized do notation

15:30 technomancy: ripe for markov chaining if you ask me

15:30 bbloom: coventry`: for example the 'clojure.core/for macro is the list macro

15:30 callen: oh come on. what I'm saying isn't crazy.

15:30 bbloom: er list monad

15:30 tupi: hello. in the following sample code http://paste.lisp.org/display/138930

15:31 I 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:31 bbloom: coventry`: 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:31 tupi: as a schemer, i was expecting (let [result (IJ/run imp "Analyze Parti...)] but that was just a dream :)

15:32 dnolen: tbaldridge: I guess we're closing in on a release?

15:32 tupi: anyone knows, has a hint for me?

15:32 dnolen: tbaldridge: I made the necessary changes to core.async in a local branch, nothing seems slower, if anything faster?

15:32 tbaldridge: dnolen: excellent. I plan on doing bugfixes tomorrow.

15:32 dnolen: tbaldridge: ring benchmark is ~130ms using 1878 + core.async changes.

15:33 tbaldridge: so keyword-identical? hit seems negligible

15:33 coventry`: 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:33 tbaldridge: dnolen: yeah, there's some build server stuff that needs work, that's what we're waiting on right now.

15:33 dnolen: tbaldridge: got it

15:33 tupi: I 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:33 bbloom: coventry`: yeah, it's like knowing the lambda calculus

15:33 callen: tupi: your problem seems specific to the Java code and how you're using it.

15:33 coventry`: bbloom: Gotcha.

15:34 callen: tupi: would you mind terribly using https://www.refheap.com/ for Clojure code? it's more readable.

15:36 tupi: do you have a stack trace or some sort of error?

15:38 tupi: callen: 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:39 it is of course an imagej [more then clojure] problem i guess

15:39 callen: "I don't use .com sites" - wat.

15:40 technomancy: did paste.lisp.org drop the ability to announce in IRC?

15:42 yipstar: my 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:43 dnolen: tbaldridge: 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:43 sdegutis: I'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:43 akurilin: callen, 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:43 dnolen: the fact that keywords can be optimized is pretty cool, thanks again seangrove

15:43 callen: sdegutis: sounds like a win/win for all involved.

15:43 akurilin: not directly, you make that part of your handler. the intent was to make it un-opinionated in that regard.

15:43 sdegutis: I wonder if this is true for everyone or just me.

15:44 callen: akurilin: 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:44 technomancy: yipstar: you're referring to how it's represented in the repl?

15:45 ,(format "%0.2f" 0.14424)

15:45 clojurebot: #<MissingFormatWidthException java.util.MissingFormatWidthException: 0.2f>

15:45 callen: akurilin: 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:45 technomancy: crap

15:45 anyway, there's a way to do that with format

15:45 akurilin: callen, I'm apparently going to be eating your dogfood a lot :)

15:45 callen: akurilin: at least you know I'll fix things.

15:46 tbaldridge: dnolen: agreed, there's not much more we can do

15:46 callen: getting lunch now, let me know if anything breaks. I should probably explain that the users' handlers are intended to do whatever they need.

15:47 yipstar: technomancy: i have a unit test testing = which is failing because of the precision

15:47 coventry`: ,(format "%.2f" 0.14424)

15:47 clojurebot: "0.14"

15:47 technomancy: oh gotcha; odd

15:47 yipstar: technomancy: but would in repl vs not matter?

15:47 technomancy: yipstar: the repl's representation is just a different problem vs clojure.test

15:48 yipstar: technomancy: k. so does with-precision 2 do what i'm intending in clojure.test?

15:48 technomancy: yipstar: it looks like with-precision is specifically about bigdecimal types

15:48 sdegutis: ,(last [])

15:48 clojurebot: nil

15:49 yipstar: technomancy: ah! is there a floating point type equiv?

15:49 technomancy: yipstar: I don't know of anything convenient =\

15:50 although

15:50 ,(let [x 1.123] (< 1.0 x 1.2))

15:50 clojurebot: true

15:50 yipstar: technomancy: is there a clojure.test equiv or assert_in_delta?

15:51 technomancy: the fact that < is variadic comes in handy =)

15:52 yipstar: technomancy: gotcha. i need an equal within delta. i doubt its idiomatic to be converting to strings in unit tests for equality?

15:53 technomancy: you could write a 3-4-line helper defn to do "is x within y of z" in terms of <

15:53 that'd be my recommendation

15:53 yipstar: gotcha, ty

15:53 thought there'd be something built in!

15:54 technomancy: eh; < works for most things

15:55 (defn within-delta [x y d] (< (- x d) y (+ x d))) there ya go =)

15:55 coventry`: (is (< (Math/abs (- val1 val2)) delta))

15:56 technomancy: oh, even better

15:56 yipstar: sweet, thanks!

15:58 TEttinger: although, technomancy's solution can work with BigIntegers and BigDecimals if you use +' and -'

15:59 ##(is (< (Math/abs (- 1/2 1/7)) 1/4))

15:59 lazybot: java.lang.RuntimeException: Unable to resolve symbol: is in this context

15:59 TEttinger: ##(< (Math/abs (- 1/2 1/7)) 1/4)

15:59 lazybot: java.lang.IllegalArgumentException: No matching method found: abs

16:00 coventry`: TEttinger: ##(class 1/2)

16:00 lazybot: ⇒ clojure.lang.Ratio

16:00 TEttinger: that too

16:01 coventry`: ##(< (Math/abs (- 0.5 0.141)) 0.25)

16:01 lazybot: ⇒ false

16:02 TEttinger: ##((fn [x y d] (< (- x d) y (+ x d))) 1/2 1/7 1/4)

16:02 lazybot: ⇒ false

16:03 coventry`: Oh, your point is that that's more general. That's true.

16:03 TEttinger: yeah, sorry that wasn't clear

16:03 there's also numeric tower

16:04 dnolen: all things considered this is pretty damn cool IMO http://gist.github.com/swannodette/6542719

16:06 akurilin: callen, 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:06 hiredman: tbaldridge: that was a very nice response on the opengl thread

16:07 TEttinger: isn't redis in-memory?

16:10 akurilin: brb

16:16 callen: akurilin: yes

16:18 tupi: further trying, given this http://rsbweb.nih.gov/ij/developer/api/ij/measure/ResultsTable.html

16:18 I modififed my sample code as is: http://paste.lisp.org/display/138930#1

16:18 akurilin: callen, ok perfect. Never played around with kv store servers before, so this could be pretty interesting.

16:19 tupi: but it complains saying malformed ... on this line: (let [results (.getResultsTable)]

16:20 xeqi: tupi: what are you trying to call .getResultsTable on?

16:21 tbaldridge: hiredman: thanks. I feel the guy's pain, I just don't know how it can be fixed.

16:21 tupi: xeqi: since the doc says no arg, i am not calling on anything

16:21 http://rsbweb.nih.gov/ij/developer/api/ij/measure/ResultsTable.html#getResultsTable()

16:23 it appears that when someone does (IJ/Run imp "Analyze Particles..." ...), the results are magically accessible through getResultsTable()

16:23 xeqi: tupi: ah, your calling a static method. Try (ResultsTable/getResultsTable)

16:23 tupi: trying

16:23 great!

16:24 all this is so misterious for me

16:24 tx

16:25 akurilin: Can you exclude from a (ns (:require :refer :all... )) ?

16:25 callen: akurilin: I'm considering making the blacklist/whitelist rules persist to redis as well, the problem is separating "code and data" for that.

16:25 akurilin: or is :refer-clojure for that?

16:26 nvm about refer-clojure

16:27 callen, 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:27 Need to rush a couple of things out atm.

16:27 callen: rumor has it technomancy wrote a serializable-fn library.

16:28 god help you if you fuck up though.

16:28 lol executing clojure functions from redis

16:29 sdegutis: Sweet, the bare basics of my Clojure-like language is done. https://github.com/sdegutis/Beowulf/blob/master/Tests/MyTests.mm

16:30 Mostly all that's left is a simple core lib.

16:30 TEttinger: sdegutis, why obj-c? I don't even know if obj-c runs on windows

16:30 callen: http://www.lambdassociates.org/blog/bipolar.htm

16:30 TEttinger: you could make it run on windows. gnu has a compiler for it.

16:31 sdegutis: TEttinger: Because I wanted a sane scripting language to embed into my Mac OS X window manager.

16:31 TEttinger: ahhhh.

16:31 applescript is one of those weird languages I take it

16:31 sdegutis: TEttinger: 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:31 TEttinger: yay

16:32 clojure is pretty amazing for short code

16:32 sdegutis: There's also Nu, which is a hybrid of Common Lisp and ObjC, but that's not really Clojure-ish either.

16:32 TEttinger: agreed

16:32 tupi: how do i make-array in clojure ?

16:32 sdegutis: tupi: []

16:32 ,[]

16:33 clojurebot: []

16:33 rasmusto: ,(vec 1 2 3)

16:33 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: core$vec>

16:33 rasmusto: ,(vector 1 2 3)

16:33 clojurebot: [1 2 3]

16:33 sdegutis: rasmusto: ##(vec (vector 1 2 3)) :D

16:33 lazybot: ⇒ [1 2 3]

16:34 rasmusto: sdegutis: I remember hearing that the shortened "vec" means its a multi-arity thing, and the long form "vector" is for a single coll

16:34 callen: oh good, my coworker stopped wearing goggles. I can stop wondering if I'm in a steampunk universe now.

16:34 rasmusto: sdegutis: I think that it applies to more functions too

16:34 sdegutis: rasmusto: vec is a coercive fn, vector is a constructor

16:34 tupi: an array of n elements, where i get n from imagej?

16:34 TEttinger: tupi, ah that

16:34 tupi: or a vectro of n elements

16:34 initialzed or not with a value

16:35 vector

16:35 sdegutis: tupi: ##(take 3 (repeatedly nil))

16:35 lazybot: java.lang.NullPointerException

16:35 sdegutis: tupi: ##(take 3 (repeat nil))

16:35 lazybot: ⇒ (nil nil nil)

16:35 tupi: ok

16:35 sdegutis: Probably not the best way though.

16:35 tupi: what is the best ?

16:36 TEttinger: there's also, this is more advanced, (make-array Double 10) . not idiomatic clojure, but sometimes needed to use java arrays

16:37 normal clojure doesn't use mutable arrays, instead preferring immutable persistent vectors

16:37 vectors work with more of the standard lib

16:40 tupi, 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:41 because if imagej has some java function that expects an array, you need to turn whatever type you're using into an array first

16:41 tupi: TEttinger: reading your comments ...

16:41 danielszmulewicz: i'm starting a ring app in the repl, how do I access the jetty log?

16:41 noonian: whats your vector victor?

16:42 TEttinger: we have clearance clarence

16:43 tupi, you don't need to pick one or the other permanently, you can convert between arrays and other types pretty easily

16:44 agr: Hi! 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:44 the :macro metadata isn't set in the var in the second case.

16:45 Even though the def form is equal

16:45 TEttinger: agr, I think def might not work outside the scope of the if

16:45 so it defines it within current scope

16:46 ,(vec (char-array 10 \a)) ;; tupi, easy to convert

16:46 clojurebot: [\a \a \a \a \a ...]

16:48 tupi: TEttinger: 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:48 new 2d array, fill it as needed: don't know how to do that in clojure...

16:49 mikerod: This may be a dumb question, or not specific enough, but can `first` be lazy?

16:49 (first (filter <blah>))

16:50 agr: TEttinger: 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:50 bbloom: mikerod: @(delay (first (filter <blah>))

16:51 TEttinger: tupi, ah

16:51 yeah that sounds like you should just call map

16:51 tupi: ok

16:52 TEttinger: map generates a lazy sequence of calling a function on every element of a collection

16:52 bbloom: since last night i was bitching about javascript, let's also bitch about JSON & XML….

16:52 JSON: No comments? Seriously? wtf?

16:52 callen: bbloom: let is also?

16:52 tupi: TEttinger: i am trying that indeed

16:53 bbloom: callen: let us not correct each other's trivial typos

16:53 mikerod: bbloom: 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:53 TEttinger: tupi, you might need amap if it's an actual array, but I can't say I've ever used amap

16:53 mikerod: At runtime, I looked at this thing returned, and I got back unresolved symbols

16:53 bbloom: XML: Everything. Seriously. WTF?

16:53 mikerod: I expected that

16:54 bbloom: it pains me, but XML > JSON for this use case… really wish i had EDN though...

16:54 clojurebot: Cool story bro.

16:54 callen: bbloom: with love: http://i.imgur.com/9Qu8ecp.gif

16:54 bbloom: I use JSON and enforce isoformat zulu time. and then pray. I don't like XML or JSON a ton.

16:54 mikerod: However, 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:55 callen: bbloom: comments are just conventions anyway. Why does it really need to be excluded from the document?

16:57 bbloom: callen: 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:01 TEttinger: tupi, 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:01 tupi: tx

17:04 Bronsa: is there a better way to merge 3 vectors than to call (into (into v1 v2) v3)?

17:04 rasmusto: Bronsa: concat?

17:04 Bronsa: rasmusto: I don't want to get a seq

17:05 mheld: hey y'all

17:05 rasmusto: Bronsa: ah, ok.

17:05 dnolen: Bronsa: don't think so

17:05 Bronsa: so the :children keys idea is working for you for generic walking in CinC?

17:05 Bronsa: makes me wonder why into isn't variadic

17:06 mheld: I'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:06 Bronsa: dnolen: definitely

17:06 dnolen: Bronsa: yeah I think I've wanted that before too.

17:06 Bronsa: excellent, been poking around CinC and chatted w/ Ambrose a bit, seems like a good way forward.

17:06 mheld: is there a way to make hiccup not use the literal 'status' value and instead use the key that I've destructured earlier?

17:06 dnolen: Bronsa: is the only new :op type you had to add was :binding?

17:07 Bronsa: dnolen: 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:07 turned out after some times that it was way easyer to have :children keys

17:07 dnolen: Bronsa: nice

17:07 mheld: fuck it (hash-map :class status)

17:07 Bronsa: dnolen: mmh, no, also :case-test; :case-then

17:08 ToxicFrog: Hmm. I wonder how hard it would be to port this project to clojure-clr.

17:08 Bronsa: maybe a couple more, I can't really tell by heart

17:08 dnolen: Bronsa: :case-test :case-then is that only for case*?

17:08 Bronsa: yes

17:08 ToxicFrog: ...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:09 Bronsa: dnolen: basically, every map that contains :k result-of-analyze needs to have :op

17:09 dnolen: Bronsa: hrm, I can't really thinking of anything else that would need new nodes?

17:09 ToxicFrog: So I'd have to find clr equivalents or write them myself.

17:09 Bronsa: dnolen: let me do a quick check

17:10 dnolen: yeah, look like :binding/:case-test/:case-then are the only nodes to which I have added :op

17:11 dnolen: Bronsa: ok excellent, been thinking about writing up a minimal AST based on what you have and what's present in CLJS

17:11 Bronsa: dnolen: oh, I also added a :quote node instead of using directly :const

17:11 dnolen: Bronsa: noted

17:12 Bronsa: dnolen: yes, I'd really like to standardize the AST between the implementations

17:13 dnolen: Bronsa: I'll writing something up based on jonasen's initial pass and people can give more feedback.

17:13 callen: bbloom: ouch.

17:13 dnolen: Bronsa: I'd like to tweak the CLJS analyzer so everything JS specific can be moved into the compiler

17:13 bbloom: callen: my thoughts exactly

17:13 Bronsa: I 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:14 dnolen: I can probably help after the GSoC is over -- my CinC analyzer is built in such a way that it's platform agnistic

17:14 noprompt: omfg, i was in the lobby the whole time thinking "did everyone die?"

17:15 Bronsa: e.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:15 hiredman: write some core.typed types for the ast

17:15 noprompt: dnolen: (defn keyword->event-type [k] (aget EventType (name k)))

17:16 Bronsa: hiredman: that's another thing in my todo-list :)

17:17 dnolen: noprompt: ?

17:17 noprompt: dnolen: https://github.com/swannodette/swannodette.github.com/blob/master/code/blog/src/blog/utils/reactive.cljs#L18

17:18 dnolen: noprompt: well you'd have to upcase, but yeah when I started it that way I wasn't sure about the naming convention.

17:18 noprompt: dnolen: oh yeah, good point.

17:19 dnolen: needless to say, i've been digging through your code.

17:19 the google closure libs are pretty awesome. i don't understand why people would complain about it the mailing list.

17:20 the 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:21 dnolen: noprompt: I think the issue is it's a mixed bag, but the low level cross browser stuff - rocking.

17:21 tbaldridge: noprompt: It's a mailing list, what else are people going to do?

17:21 noprompt: tbaldridge: i have no idea. i guess my expectations of people are to high.

17:21 dnolen: noprompt: 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:22 noprompt: jQuery is so much dead weight

17:22 noprompt: dnolen: totally.

17:23 dnolen: what's really awesome to me is that you really only pay for what you use.

17:23 dnolen: noprompt: yep

17:23 noprompt: dnolen: i haven't event touched any of the ui stuff.

17:24 dnolen: noprompt: now that stuff I wouldn't mess w/ unless you have a really good reason :)

17:24 noprompt: object oriented widgets tends to bloat because of inheritance (no surprise)

17:25 noprompt: dnolen: ah, ok.

17:25 dnolen: noprompt: look at this dependency list for ComboBox

17:25 http://docs.closure-library.googlecode.com/git/closure_goog_ui_combobox.js.source.html

17:25 an abomination

17:25 noprompt: dnolen: 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:26 dnolen: noprompt: 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:26 noprompt: dnolen: right. that's what i mean by "not having a good reason".

17:28 dnolen: have you experimented much with two-way data-binding and core.async?

17:29 dnolen: noprompt: I haven't still pondering that one

17:32 noprompt: dnolen: something i tried was an atom with an add-watch fn that updates the dom and an event channel updating the atom.

17:33 i'm not completely sure if that's the right starting point.

17:34 it gets tricky when you start to think of how you might pull of something like angular's ng-repeat

17:35 dnolen: noprompt: ng-repeat is for binding an array of data to a repeating view right?

17:36 noprompt: dnolen: 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:38 dnolen: noprompt: there are several things to consider here and it's important to avoid getting things mixed up

17:38 noprompt: one is how the app state is propagate to other places - this just about data - not views

17:38 noprompt: something datomic like with local "caches" seem promising to me.

17:39 noprompt: then you have templates - hopefully pure.

17:39 noprompt: 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:40 ideally this whole system could be defined w/ a handful of protocols, little bit of channel design

17:40 and everything else - templates, binding "layer" can be plugged based on whatever performance you need.

17:41 noprompt: interesting.

17:42 dnolen: ok. i'll definitely meditate on these concepts. that was the sort of response i was fishing for.

17:43 callen: MFW I realize I have to decide on type supremacy for multiple instance type inference and I can't reject inconsistent/contradictory examples

17:54 tupi: back to my newbee quiz: i'd like to collect the values of this expression:

17:55 (dotimes [i counter] (/ 1 (.getValue results "AR" i)))

17:55 in a vector for example

17:56 ivan: &(for [i (range 10)] (* i i))

17:56 lazybot: ⇒ (0 1 4 9 16 25 36 49 64 81)

17:57 tupi: ivan: tx

17:57 ivan: you can (vec ) it

17:57 tupi: ok

17:59 hiredman: ooh oracle jdk 7u40 has a hard float arm abi build

18:02 klokbaske: anyone up for some assistance with getting core.async going?

18:03 tupi: pi exists in clojure ?

18:03 klokbaske: tupi: Math/PI

18:03 seancorfield: ,Math/PI

18:03 clojurebot: 3.141592653589793

18:03 tupi: great, tx

18:04 seancorfield: klokbaske: what assistance do you need?

18:04 (i.e., where are you stuck right now?)

18:04 klokbaske: i'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:07 CompilerException java.lang.RuntimeException: Unable to resolve symbol: pprint in this context, compiling:(clojur\

18:07 e/core/async/impl/ioc_macros.clj:23)

18:07 if 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:08 tupi: due 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:09 klokbaske: seancorfield: does that tell you anything? :-)

18:10 seancorfield: klokbaske: that does right a bell actually... are you running a repl? lein repl?

18:11 klokbaske: yup, lein repl

18:11 noprompt: callen: did you see this http://spectacleapp.com/

18:11 klokbaske: seancorfield: yup, lein repl

18:13 seancorfield: klokbaske: hmm, i don't get it with core.async-0.1.0-20130827.050117-78.jar

18:13 i have a bare project with 0.1.0-SNAPSHOT as a dependency and it pulled in that version

18:14 with :repositories {"sonatype-oss-public" "https://oss.sonatype.org/content/groups/public/&quot;}


18:14 klokbaske: seancorfield: 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:15 seancorfield: 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:16 seancorfield: do you have other dependencies? maybe you have a version conflict?

18:17 do: lein deps :tree

18:17 see if that identifies what is pulling in clojure 1.3...

18:17 (although i'm on lein 2.3.2 so there might also be a difference there)

18:18 klokbaske: seancorfield: ah, overtone pulls 1.3. It's my only dependency, but I probably should have made a barebone project for testing :-)

18:18 seancorfield: i'll see if it makes a difference

18:19 `cbp: tupi: you can use aclone to clone an array but I'm not sure if that's what you want

18:21 klokbaske: seancorfield: 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:22 callen: noprompt: I use SizeUp.

18:22 noprompt: SizeUp is goooood

18:23 noprompt: callen: sizeup costs munny.

18:25 callen: o_o

18:26 noprompt: callen: it does look nice though. the partitions are kind of cool.

18:27 seancorfield: klokbaske: 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:27 technomancy: ~guards

18:27 clojurebot: SEIZE HIM!

18:27 tupi: can i ask the type of a value?

18:27 `cbp: tupi: (type ..)

18:27 tupi: need to know if some results are float or int

18:27 ok

18:28 ok, it returned this type: java.lang.Double but i need to convert to an integer

18:29 klokbaske: seancorfield: 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 `cbp: tupi: (int ..)

18:29 tupi: tx

18:30 coventry: noprompt, 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:32 noprompt: coventry: well don't that just beat all?

18:35 nenorbot: does anyone know a way to turn a json string to a clojurescript map?

18:35 technomancy: did stu finally give up on trying to allow json to be valid clojure?

18:36 brehaut: technomancy: wait, what‽

18:37 Bronsa: the keyword: syntax?

18:37 technomancy: yeah

18:37 Bronsa: that was a truly awful idea

18:37 technomancy: I think it finally died

18:37 Bronsa: technomancy: better keep quiet about it and hope nobody will ever remember it again

18:37 technomancy: haha

18:38 callen: which Stu was asking for that?

18:38 technomancy: I wonder if edn helped kill it

18:38 callen: the H one IIRC

18:38 Bronsa: my main complain about edn is that it doesn't have support for regexes :(

18:38 callen: technomancy: whoa. That's terrifying.

18:39 Bronsa: I understand the rationale but.. that limits the usefullness of edn for configuration files

18:41 sjl: Bronsa: use a tag? #yourproject/regex "foo.*"

18:41 Bronsa: sjl: yes, but we already have #"" for regexes

18:42 also sjl, #"" escapes differently than "", writing a regex tagged literal would mean have a string filled with "\\\"

18:42 sjl: yep

18:43 Bronsa: o

18:44 noprompt: it'd be awesome if these ns browsers supported cljs.

18:48 that ayler project is legit.

18:56 callen: ac-nrepl has some hella dubious performance characteristics.

18:58 Bronsa: I'm still using SLIME and happy with it.

18:59 callen: still want a debugger.

18:59 still need a debugger for that matter.

19:00 Bronsa: yeah, I've never been able to get ritz to work

19:00 callen: I've gotten to work, not enjoyed it anyway.

19:00 coventry: I 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:01 callen: yeah.

19:04 I'm using nrepl-ritz right now. It's sorta-not-really working.

19:04 it caught the exception but I can't get at any of the locals.

19:04 coventry: Oh, there's a way to turn off locals clearing. hugod describes it in his talk.

19:05 callen: oh I think it actually froze.

19:05 coventry: I know, diff problem.

19:05 ERROR: Unhandled REPL handler exception processing message {:id 74, :op frame-locals, :session 3f224f4b-d128-454b-a2e3-273984c1a3fa, :thread-id 5350, :frame-number 3}

19:06 lol, k

19:06 `cbp: is slingshot common use? Would it turn people away if a library used it?

19:07 coventry: ritz uses it, so I think you're safe.

19:08 callen: don't use Ritz as an exemplar :P

19:08 `cbp: slingshot is fine, just have a good reason for using it is all.

19:11 technomancy: `cbp: for catching or throwing?

19:13 callen: technomancy: easy with the innuendo man.

19:13 technomancy: use ex-info for throwing unless you have to support 1.3

19:13 which you don't

19:13 kernelsid: Hey 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:14 callen: I never got that to work, had to use exceptions.

19:14 jtoy: is it possible to run a single command with lein and exit?

19:15 kernelsid: yeah.. thats what I figured too

19:15 `cbp: technomancy: for throwing

19:15 technomancy: `cbp: yeah, don't use slingshot for that

19:15 jtoy: is that a trick question?

19:16 callen: that sounds like a koan.

19:17 "if a maven repo falls in the woods but nobody notices..."

19:17 `cbp: I 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:17 callen: yes

19:18 `cbp: ok :)

19:19 kernelsid: so 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:19 I 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:20 callen: what a delightful cascade of data that I am getting smacked in the face with.

19:20 okay you can stop scrolling now...

19:22 nDuff: kernelsid: whether you can inspect runtime state from nrepl depends on how your application is designed.

19:22 kernelsid: ...if you have a Var pointing to an atom or ref, well, that's certainly accessible.

19:24 kernelsid: nDuff: 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:39 * sdegutis sometimes wishes he didn't have a lifetime ban from #macdev :(

19:39 nightfly: how do you earn that?

19:40 * technomancy wants one too

19:40 technomancy: could go in and rant about the fact that this is freenode not proprietarynode

19:41 callen: technomancy: I don't think that would actually work tbqh

19:41 you'd have to do a better job than that.

19:41 technomancy: could go ask about why homebrew doesn't have any quality assurance

19:41 sdegutis: nightfly: being a teenager on IRC all those years ago is an easy way to get a permaban

19:42 xicubed: i made a cute terse little program but couldn't get the side effects working so only I know :>

19:42 sdegutis: technomancy: melpa has caused me way more pain than homebrew

19:42 technomancy: sdegutis: melpa is nuts

19:42 sdegutis: nightfly: it doesnt help that the channel is run by super cranky old men

19:42 technomancy: I don't understand why people use it

19:42 callen: technomancy: Raynes and I could talk your fucking ear off about homebrew.

19:42 sdegutis: technomancy: because its sooo easy!!

19:42 Raynes: YOUR EAR OFF.

19:43 technomancy: sdegutis: easier than marmalade?

19:43 sdegutis: technomancy: who knows. probably.

19:43 technomancy: has more stuff in it than marma

19:43 technomancy: junk stuff

19:43 sdegutis: technomancy: junk is subjective no?

19:44 callen: I'm imagining Melpa being like Bubbles from The Wire

19:44 technomancy: what kind of people are writing quality elisp and not bothering to M-x marmalade-upload?

19:44 sdegutis: technomancy: ive found very few ultrastable emacs plugins


19:44 sdegutis: paredit is probably the only one i use regularly that works well

19:44 technomancy: sdegutis: if you follow master, stuff breaks

19:44 sdegutis: electric-indent-mode hates me so bad.

19:45 technomancy: this isn't specific to elisp

19:45 sdegutis: ido-mode never works like i want it to.

19:45 technomancy: im talking about libs packaged with emacs

19:45 technomancy: theres a reasonable level of quality that i only find in some libs, whether from melpa or built-in or wherever.

19:45 s4muel: evil-mode works admirably but is a pain with some other minor modes. suppose that's expected. paredit, <3

19:46 sdegutis: some days i dream about going back to `ed`

19:46 technomancy: clojurebot: ed?

19:46 clojurebot: ed is the standard editor!

19:46 sdegutis: text editors are hard to get right. its understandable. nobody can do it well.

19:47 its an impossible task, so we just gotta take what we can get.

19:47 in other news, this story is a little creepy: http://blog.close.io/post/60948403716/why-engineers-scare-me-a-true-story

19:49 callen: it's not at all.

19:50 sdegutis: callen: oh.

19:50 guess i was mistaken.

19:50 technomancy: glad that's cleared up

19:52 riley526: callen: ("Bubbles Depo")

19:52 sdegutis: ,(foo [bar)

19:52 clojurebot: #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>

19:52 riley526: Just watched it again last night ;)

19:52 callen: riley526: :)

19:52 sdegutis: it's a standard doxing entry point. Pretty easy to do.

19:52 sdegutis: callen: no comprendo

20:10 I'm a bit scared to implement ##destructure

20:10 Aw clojurebot doesn't like that.

20:12 coventry: It's only 60 lines and 12 levels of indentation in core.clj. How hard can it be? :-)

20:14 sdegutis: https://github.com/sdegutis/clojuredocs/wiki/clojure.core-destructure#source

20:14 Man...

20:14 Aw man, it needs (loop).

20:15 hfaafb: are there any good clojure videos aside from rhickey's stuff?

20:16 or talks on functional languages

20:16 callen: hfaafb: stu has videos if you can handle the newspeak.

20:16 brehaut: hfaafb: heaps of strange loop and clojure conj videos are on the web

20:16 coventry: Do you mean in the same philosophical vein as his?

20:16 hfaafb: yeah precisely

20:17 hiredman: http://www.infoq.com/presentations/Decisions-Decisions

20:18 s4muel: http://www.infoq.com/presentations/Clojure-Large-scale-patterns-techniques

20:19 is not really a philosophical video, but probably one of the best out there in general imo

20:19 hfaafb: thanks everyone

20:35 coventry: What defs are in clojure.core before evaluation of core.clj takes place?

20:36 hiredman: there are a handful of vars, in-ns, some compiler flags

20:38 coventry: Thanks, hiredman. Looks like I can pull them out of RT.java.

20:57 mihneadb: hi, I'm having trouble finding the command line args in running a cljs app with node

20:57 I see the "8:(apply cljs.core/*main-cli-fn* (drop 2 (.-argv nodejs/process))) " line

20:57 but when I println my args in the main function it is nil

21:16 noprompt: mihneadb: why not use an option parser?

21:17 mihneadb: there's a good one compatible with both clj and cljs: https://github.com/guns/optparse-clj/

21:17 mihneadb: also try using console.log.

21:18 mihneadb: also i think you want to user set! instead of apply: m

21:18 mihneadb: https://github.com/noprompt/frak/blob/master/src/cljx/frak/cli.cljx#L55

21:28 coventry: Where does eval get the current filename from, when it sticks it in a var's metadata?

21:30 hfaafb: is there a function that returns the first element of a collection that passes a predicate?

21:31 and short circuits

21:32 coventry: (first (filter pred coll))

21:32 Looks like it gets it from *file*

21:33 Bronsa: /

21:36 brehaut: ,(some number? ["a" :b 3 4 :e])

21:36 clojurebot: true

21:36 brehaut: nope

21:36 that always catches me :/

21:54 clj_newb_2345: anyone know of a good deep learning tutorial in clojure?

21:54 gfredericks: brehaut: it's cuz of that dang (some #{x} ...) idiom

21:54 brehaut: gfredericks: aha

21:56 `cbp: there's an introduction to deep code walking macros by fogus

22:02 mihneadb: noprompt: sorry, I was AFK

22:03 noprompt: the app I was / am trying is https://www.refheap.com/18618

22:04 thanks for the opt parse link. I was just trying to do a simple thing (basically first time running cljs)

22:04 noprompt: mihneadb: try using (.log js/console args)

22:04 or rather (.log js/console (str args))

22:04 mihneadb: noprompt: ok, just a sec

22:05 noprompt: it is still blank

22:05 I m running with "node target/cljsbuild-main.js 123"

22:05 noprompt: mihneadb: does your cljsbuild target node?

22:05 mihneadb: noprompt: yes

22:05 :target :nodejs

22:06 the app is working, I can print out stuff just fine

22:06 just that args is nil

22:06 noprompt: mihneadb: are you compiling with :optimizations :advanced?

22:06 mihneadb: noprompt: yes

22:06 noprompt: mihneadb: are you using an exports file?

22:07 mihneadb: should I try some other opt?

22:07 noprompt: no

22:07 noprompt: mihneadb: that might be the problem.

22:07 mihneadb: see: https://github.com/noprompt/frak/blob/master/project.clj#L30

22:07 mihneadb: and https://github.com/noprompt/frak/blob/master/resources/externs/process.js

22:08 mihneadb: noprompt: thanks

22:08 if 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:08 noprompt: mihneadb: np. i had the same problem when building the cli tools for frak.

22:09 mihneadb: 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:10 mihneadb: ok, nice. Thanks

22:10 frak looks great, btw

22:10 did not know about it

22:11 noprompt: mihneadb: oh thanks. i have no idea what the hell i'm doing in that project. but hey, it works!

22:11 mihneadb: noprompt: so you have the same source code for both cljs and clj?

22:11 or is it something like a base that exposes an API and then you have two "clients" ?

22:12 noprompt: mihneadb: yeah, i used cljx.

22:13 mihneadb: cljx, wow

22:13 let's see

22:13 noprompt: mihneadb: here's the frak success story: https://github.com/guns/vim-clojure-static/commit/33a0fc9f187d3e7053eac581aa3cbdd84afe7408 (see at the bottom, very last file)

22:13 don't forget to scroll! :-P

22:14 mihneadb: haha I noticed that when reading the readme!

22:14 guns: You get the best effect when scrolling with the arrow keys

22:14 then it's comical

22:14 noprompt: mihneadb: fwiw i haven't tried using cljx for large projects. frak was a good fit though.

22:14 guns: haha, yeah!

22:15 mihneadb: haha nice trick on cljx's part for using whitespace instead of not used expressions

22:16 noprompt: guns: has anyone from the vi community seen that?

22:17 mihneadb: noprompt: btw I get this with optimizations whitespace https://www.refheap.com/18619

22:18 noprompt: guns: someone should tell braam to have it do what perl does when it sees a regex with a bunch of words joined w/ |.

22:18 mihneadb: yeah i think that's the common error. try :simple

22:18 mihneadb: btw what's the proper way of retriggering compilation when you change this?

22:19 if I just rerun cljsbuild auto it won't pick it up

22:19 guns: noprompt: 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:19 noprompt: mihneadb: change the source file or remove the compiled file.

22:20 mihneadb: noprompt: yeah I did that. I was hoping for some other non-intrusive way :)

22:20 noprompt: guns: what? why doesn't he like it?

22:20 mihneadb: ty

22:20 noprompt: I see the args with optimizations simple btw. thanks again

22:21 noprompt: guns: that syntax file is shinning example of what a syntax file *should* look like - clean.

22:21 guns: noprompt: 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:22 noprompt: 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:22 It's probably just me but reading stdin synchronously in Node.js is stupidly difficult

22:23 mihneadb: shouldn't I be able to call cljs.reader/read-string in cljs?

22:23 it works in clojurescript.net

22:24 noprompt: guns: yeah i think when i tried that i had to use xargs. if you figure it out send me a PR.

22:24 :)

22:25 mihneadb: yes.

22:25 mihneadb: noprompt: I get TypeError: Cannot read property 'read_string' of undefined

22:25 noprompt: mihneadb: make sure to require it though.

22:26 mihneadb: ah, whoops

22:26 noprompt: (:require [cljs.reader :refer [read-string]])

22:27 mihneadb: thanks

22:29 noprompt: guns: so this doesn't work -> http://nodejs.org/api/process.html#process_process_stdin

22:30 guns: noprompt: No, it does; I just wanted to do it synchronously so I didn't have to invert the logic for the Clojure API

22:30 I guess that's fighting the tide though

23:06 Foxboron: .23.125] has quit [Client Quit]

23:06 damn

23:06 https://en.wikipedia.org/wiki/Programmers'_Day

23:06 there

23:10 sdegutis: wat

23:10 zanes: If 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:13 sdegutis: Tomorrow is Programmer's Day? Woo!

23:13 Does that mean I get the day off?

23:13 Foxboron: sdegutis: well its 13th today here.

23:13 sdegutis: and i think it depends where you live :P

23:13 sdegutis: I live here.

23:15 zanes: Found it: http://stackoverflow.com/questions/16228318/how-to-get-the-class-generated-by-gen-class-in-clojure

Logging service provided by n01se.net