#clojure log - Jun 22 2017

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

4:03 Kristjan55555: Hello! Hot 33 year old male from viljandi, estonia searching for husband, send me your cunt pictures first! Tel 37253902210 email: kristjan55555@mail.ee. I am waiting.....

4:11 bjorngi: Sorry, Kristjan55555. I don't have any pictures of you :/

4:11 Kristjan55555: Hello! Hot 33 year old male from viljandi, estonia searching for husband, send me your cunt pictures first! Tel 37253902210 email: kristjan55555@mail.ee. I am waiting.....

4:12 dysfun: yeah, stop saying that

4:15 bjorngi: Seems to be a bit condradicting too. "Hot male looking for husband, send me your cunt pictures".

4:15 I should get in the spam business. How hard can it be to improve on that sector.

4:16 dysfun: yeah, merely being able to speak correct english might well be a competitive advantage...

4:18 metellus: doing something other than spamming irc channels would probably help too

4:19 dysfun: yeah. the costs of irc distribution might be minimal, but i expect a message like that will get zero useful responses

4:24 TEttinger: I wonder if that service to sign people up for cat facts is still around

4:26 https://www.theverge.com/2014/7/28/5945917/an-ancient-reddit-prank-about-cat-facts-is-now-a-real-product

4:29 ragepandemic: i'd love me an estonian husband, such an articulate man

4:29 why I'd love nothing more than to send you pictures of my cunt

4:30 dysfun: send him pictures of your ass and call it your mancunt

4:31 tell him you're excited at the thought of being his husband

4:36 ragepandemic: do people actually fall for spam like that though? i mean, it must work right?

4:36 dysfun: it used to, i dunno any more

4:40 TEttinger: of course. https://github.com/vadimdemedes/cat-facts

4:40 https://github.com/vadimdemedes/cat-facts

4:40 oh crap, scrolled up

5:03 lxsameer: hey guys, is adding a custom key to meta data of a (def) wrong ?

5:08 dysfun: no

5:10 lxsameer: dysfun: hmme i did something like (def ^{:doc "sadasd" :somekey {:nestedkey "sadasd :another "AsdaSD}} ...)

5:10 dysfun: and meta returns nil

5:11 dysfun: the meta is attached to the *var*, not the value

5:11 (meta #'foo)

5:22 lxsameer: dysfun: ow, thanks didn't know that

5:28 dysfun: well, you can put things like integers in vars, and those are java classes which don't support metadata

5:29 so there's not much choice in the matter really

5:50 zipper: How can I achieve the results of `(conj [{:q 1}] {:p 0})` without wrapping the first map in a vector?

5:51 I thought (into [] map1 map2) but that turns them all into vectors

5:51 and so does `vec`

5:52 dysfun: vector

5:52 ,(vector {} {} {})

5:52 clojurebot: [{} {} {}]

5:53 zipper: Nice

7:10 phillord: Anyone know of a way to check if a var is interned or not?

7:14 dysfun: you can attempt to look it up

7:14 Carr0t: resolve?

7:14 ,(resolve 'foo)

7:14 dysfun: which is one way of looking it up

7:14 clojurebot: nil

7:16 Carr0t: I can't do defs with clojurebot can I?

7:16 ragepandemic: i think so

7:16 ,(def a 1)

7:16 clojurebot: #error {\n :cause "SANBOX DENIED"\n :via\n [{:type java.lang.Exception\n :message "SANBOX DENIED"\n :at [clojure.core$eval31$fn__32$fn__45 invoke "NO_SOURCE_FILE" -1]}]\n :trace\n [[clojure.core$eval31$fn__32$fn__45 invoke "NO_SOURCE_FILE" -1]\n [clojure.core$eval31$fn__32 invoke "NO_SOURCE_FILE" 0]\n [clojure.core$eval31 invokeStatic "NO_SOURCE_FILE" 0]\n [clojure.core$eval31 invoke "NO_SO...

7:16 phillord: ns-resolve works over the symbol, though, not the var

7:16 dysfun: no, they got banned ages ago

7:16 ragepandemic: oh no, I swear it used to work though

7:16 dysfun: yes, but the symbol names the var

7:16 oh, i see what you mean

7:16 Carr0t: I don't

7:16 dysfun: they're all interned, no?

7:16 phillord: but if you have the var then you are stuck

7:17 dysfun: Carr0t: i'm working on the basis that it's "given a var object, has it been interned?"

7:17 Carr0t: Oh I see

7:17 phillord: dysfun: no, they aren't. You can do `with-local-vars` or (which is my concern), you can use nsmap to unintern them afterwards

7:17 dysfun: but i thought all vars were interned

7:17 oh, that

7:19 phillord: Best I came up with is....https://pastebin.com/vc9km9pW

7:19 i.e. using ns-resolve and meta on the var

7:19 dysfun: i was about to suggest that approach

7:22 phillord: seems to work but is ugly. Ah well

7:22 dysfun: the other option is to read those values out of the var itself

7:22 i predict that with-local-vars will never have a namespace name

7:31 phillord: dysfun: the var doesn't know its own namespace afaict

7:31 dysfun: sure it does

7:31 phillord: where?

7:31 clojurebot: where is your source code

7:31 dysfun: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Var.java#L172

7:31 you have to give it them to even construct it

7:32 phillord: yes, that's not accessible from Clojure space

7:33 other than "toString" -- more over, it's private and immutable, therefore it doesn't change when you do ns-unmap

7:33 dysfun: they're public properties

7:33 https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Var.java#L89

7:34 phillord: so they are

7:34 apologies

7:34 still, immutable though

7:34 dysfun: well that's a good idea. you don't want a var's name and namespace falling out of sync with the interns table

7:35 phillord: dysfun: they can -- ns-unmap

7:36 dysfun: that isn't an operation you should be doing much of

7:37 phillord: still you are correct -- (.sym (var x))

7:37 returns the symbol x.

8:57 Rovanion: Is there a difference between property based and generative testing?

8:58 Every person seems to have their own definition of what X testing is by the way.

10:15 noncom: guys, how do I deploy a Gradle project to clojars?

10:15 even a project without a clojure support?

10:18 tcrawley: noncom: I've never deployed with gradle, but https://github.com/miguno/avro-gradle-plugin/blob/master/build.gradle#L27 may be a good example

10:22 noncom: tcrawley: does look good! trying it now

10:24 faraco: hello

10:24 Rovanion: Yello

10:36 noncom: tcrawley: hmm.. can't fully wrap my head around it.. I've copied the relevant part from that file and do "gradle publish", the build seems to succeed (shows green in Idea), but nothing is uploaded...

10:37 tcrawley: I have no idea how gradle works, sorry :)

10:43 noncom: noncom: sadly so, gradle seems to be a very promoted, but an utterly underdocumented platform

11:22 faraco: Do anyone ever built android apps with clojure in here?

13:06 amalloy: ,(meta #'inc)

13:06 clojurebot: {:arglists ([x]), :doc "Returns a number one greater than num. Does not auto-promote\n longs, will throw on overflow. See also: inc'", :inline #object[clojure.core$inc__inliner__6550 0x4ec51526 "clojure.core$inc__inliner__6550@4ec51526"], :added "1.2", :line 914, ...}

13:06 amalloy: ,(:ns (meta #'inc))

13:06 clojurebot: #object[clojure.lang.Namespace 0x382ba76e "clojure.core"]

13:06 amalloy: phillord, dysfun: ^

13:07 phillord: amalloy: yes, that's how I've been doing it

13:07 amalloy: oh, scrolling further back i see you guys already got that far

13:13 phillord: amalloy: thanks anyway! It feels clunky but it works.

13:57 lukaszx0: what's the ruby on rails equivalent for clojure?

13:58 dysfun: there isn't one

13:59 clojure favours composing libraries. there is a framework for doing this called luminus

13:59 technomancy: the true clojure way is to rant about how rails is bad

13:59 Para`: Isn't that basically the (not (rails-way)) in general?

13:59 dysfun: nuh-uh technomancy, you should be too busy telling people that OO programming is going to destroy the world

14:00 Para`: Rails has one big thing that they got right.

14:00 Which is that they came up with consistent coding rules for Ruby.

14:00 Everything else people think they got right is a side effect.

14:00 dysfun: (actually, having spent much of the last two days wrapping java in clojure, i might even agree)

14:01 Para`: There's so much terrible Java out there it hurts my emotional balance.

14:01 OOP is treated like violence.

14:02 As in if it doesn't work, use more.

14:02 There was even on Hacker News a few days ago a comparison post between Java and Clojure and the writer proudly explaimed how Clojure is simpler because the Java equivalent was 500-or-something lines longer.

14:02 Well, the Java version used a gazillion shitty patterns.

14:02 Like factories just to create a single object.

14:05 justin_smith: clearly modern java code should be using the 3d-printer-pattern

14:05 for one offs

14:06 dysfun: pah, 3d printers! don't you use hand tools?

14:06 justin_smith: ArtisinalLocallySourcedDatabaseConnectionAtilier

14:07 dysfun: FactoryBuilderFactoryBuilder

14:09 anyway, the correct answer was "yes i use hand tools, a keyboard"

14:09 technomancy: FactoryParodyComplaintBuilder

14:09 dysfun: only counts if you built your keyboard by hand

14:10 dysfun: technomancy: error: must be a subclass of Grumpy

14:10 how are your keyboard adventures coming along?

14:10 i saw keyboardio was finishing their first run this week

14:11 technomancy: dysfun: it's going well; I have been making very minor improvements and teaching my kids to solder for lego money

14:12 hoping to have some time this summer to prototype out some more substantial features

14:12 I am somewhat tempted to do a major yak shave and port the case design over to https://www.mattkeeter.com/projects/ao/

14:12 but it uses boost, so it won't compile, and that's probably for the best

14:13 (what kind of person is smart enough to use guile but also daft enough to use boost; I don't even)

14:13 dysfun: i like boost

Logging service provided by n01se.net