#clojure log - Nov 08 2013

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

0:01 amalloy: thanks! yeah, i'm taking a look. lots of options to consider at the moment, but at first glance it looks interesting

0:05 bitemyapp: what a fun meetup.

0:06 arohner: hey if you can get amalloy to move to the Yay! that'd be a win for the Clojure community here :)

0:06 arohner: Yay?

0:06 bitemyapp: arohner: you live in the Yay! Area.

0:06 s/Yay!/Bay/g

0:06 arohner: ah.

0:06 kind of. I also 'commute' from Austin

0:06 bitemyapp: I was showing people the ugly guts of some code I'd worked on recently.

0:06 arohner: really? I didn't know that.

0:07 arohner: amalloy: where do you live?

0:07 bitemyapp: arohner: how do you like Austin?

0:07 arohner: it's great

0:07 bitemyapp: I've been considering Austin as a post-SF option.

0:07 amalloy: arohner: LA, but i grew up in the bay area

0:07 arohner: it's cleaner, quiter, nicer and cheaper than SF. The only thing SF has is a better startup community

0:07 bitemyapp: I don't need the startup community per se, just office space and internet.

0:08 I do like being able to see my fellow Clojurians though.

0:09 arohner: meh. the clojurians are more concentrated at cons than they are locally. even in SF

0:10 bitemyapp: I wish I could go to the conj this year.

0:10 maybe I'll make to /West

0:10 make it to*

0:11 arohner: Has /West's location been announced yet?

0:11 jtoy: how can I "undeclare" something?

0:11 bitemyapp: jtoy: what are you doing that needs that?

0:12 amalloy: yeah, that is super-suspcious, jtoy

0:12 jtoy: i use declare foo in one ns and then later use defn foo but get an errore that foo is already declared

0:12 i know circular dependency is bad, and i will move it later, sometimes hyou need it though

0:12 bitemyapp: good lord. fix your :require to use namespaces.

0:13 (:require [my.namespace.rocks :as muh-namespace])

0:13 muh-namespace/WOOHOO

0:13 (defn WOOHOO)

0:13 jtoy: also better nomenclature is called for.

0:13 jtoy: i want to override the old foo though

0:13 bitemyapp: jtoy: stop. no. don't.

0:13 you're writing code like a meth-addled Ruby user. stop.

0:14 jtoy: briefly: http://i.imgur.com/TGUbao2.jpg

0:14 indigo: bitemyapp: gem install hairball?

0:14 bitemyapp: indigo: precisely.

0:15 indigo: I like the Haskell community's way of handling this. anything prefixed with "acme-*" is a Bad Idea (TM)

0:15 so if you use an acme library, you deserve what you get.

0:15 jtoy: if its completely bad, clojure wouldnt have added declare

0:15 indigo: http://hackage.haskell.org/package/acme-php perfect

0:15 bitemyapp: jtoy: forward declarations don't do what you think.

0:16 amalloy: jtoy: for one namespace to put things into another namespace is evil

0:16 indigo: Oh ew

0:16 jtoy: maybe clojure shouldnt have allowed it then?

0:16 amalloy: also, clojure is turing-complete, so it allows you to do all sorts of evil things

0:17 bitemyapp: jtoy: you are seriously misapprehending what Clojure provides out of necessity as somehow meaning your cockamamie design anti-pattern is encouraged.

0:17 jtoy: stop. no. don't. Learn how to write Clojure properly. please.

0:17 jtoy: found it: (ns-unmap ns sym)

0:17 bitemyapp: god fucking

0:17 * bitemyapp gives up

0:17 jtoy: bitemyapp: good

0:17 indigo: bitemyapp: Maybe it's chord ;P

0:17 bitemyapp: jtoy: I'm hoping cosmic rays corrupt your code.

0:17 indigo: jtoy: Are you writing a Starcraft clone

0:17 bitemyapp: that just enough bits are flipped that CRC can't save you.

0:18 amalloy: indigo: different guy

0:18 bitemyapp: indigo: I think jtoy actually predates that guy.

0:18 indigo: Ah

0:18 Hehehe

0:18 bitemyapp: which explains why he's been able to figure out how to smash namespaces whereas I think chord was still at, "HOW DO I VECTOR"

0:19 jtoy: whatever, i write tons of production clojure code

0:19 epichero: I don't

0:19 bitemyapp: jtoy: a lot of really dumb people write tons of production PHP too, doesn't make it a good idea.

0:19 jtoy: hacking is all about using things in ways the system wasnt intended to

0:20 bitemyapp: jtoy: slogans won't save you

0:51 scizo: Does anyone know if this is to be expected with core.async: (clojure.core.async/timeout 100) => ClassCastException java.lang.Double cannot be cast to java.lang.Long java.lang.Long.compareTo (Long.java:50)

0:51 ??

0:51 lazybot: scizo: Uh, no. Why would you even ask?

1:13 firesofmay: Hi, Is there a way to push a jar on clojars which is 31mb? Its giving me an error saying file too large and limit is 19.5mb. Any idea?

1:21 amalloy: firesofmay: putting a 30mb jar on clojars is bonkers

1:22 you don't include all the dependencies, just your own code

1:24 firesofmay: amalloy it's a java project that I need to write clojure wrapper for: https://github.com/navaneeth/calabash-ios-java

1:25 amalloy any idea on how I can get it to include in my clojure project?

1:28 amalloy I just looked into the jar, he is including all the gems inside of it since he is using jruby to interop with ruby calabash library.

1:28 amalloy hence the size is so big. :-/

1:29 amalloy: just because their project is badly organized doesn't mean yours has to be. find a version of it on maven, or publish it to clojars yourself, and then depend on it

1:30 firesofmay: amalloy He doesn't have it on maven. And that's what I was trying to do, push their project to clojars.

1:32 amalloy: i don't know how to help you with a jar packaged in this way

1:36 firesofmay: amalloy cool thanks.

2:23 SegFaultAX: Off-topic: I've heard more about grails in the last 2 - 4 weeks than I have... basically ever.

2:24 justin_smith: people still use groovy, wow

2:26 SegFaultAX: justin_smith: Seems to be trending up a bit lately as well.

2:27 devn: muhoo: oh man!

2:28 wouldn't it be cool to have karma linked to dollars

2:28 justin_smith: sad trolls, broke, living under bridges

2:29 devn: justin_smith: wha?

2:29 justin_smith: if karma was linked to dollars

2:29 devn: oh, haha

2:29 lpvb: can I have two keys to the same value in a map

2:29 devn: the sad thing is that people would initially tip them

2:29 because that's how trolls work

2:30 lpvb: to the same value? yes.

2:30 justin_smith: lpvb: no, the new value kicks out the old one

2:30 err

2:30 don't mind me, I'm wrong

2:30 lpvb: devn: how do I do that

2:30 muhoo: justin_smith: it's the new economy man.

2:31 devn: lpvb: {:a 1 :b 1}

2:31 lpvb: are you asking if it's possible to have: {:a 1 :a 2}?

2:32 muhoo: ,(assoc {:a 1 :b 2} :a 42)

2:32 clojurebot: {:a 42, :b 2}

2:32 lpvb: um. more like {:a (SomeObject.) :b (SomeObject.)}

2:32 except they refer to the same object

2:32 devn: so why are you concerned about that?

2:32 justin_smith: (let [x (Object.)] {:a x :b x})

2:32 ,(let [x (Object.)] {:a x :b x})

2:32 clojurebot: {:a #<Object java.lang.Object@1eb6bba>, :b #<Object java.lang.Object@1eb6bba>}

2:33 justin_smith: notice they have the same identity

2:33 devn: lpvb: what are you trying to accomplish?

2:33 lpvb: just curious

2:34 seems like a layer of indirection to have a binding to x just to get it to bind to :a and :b

2:35 could I use a macro to create my own syntax

2:35 muhoo: lol @ circleci "You don't? I'd never have guessed from the way you disabled JavaScript! You're probably so far from our target racket we can't even see you from our run-down San Francisco offices."

2:35 lpvb: like {[:a :b] (Object.)}

2:35 justin_smith: ,((fn [x] (assoc x :b (:a x))) {:a (Object.)})

2:35 clojurebot: {:b #<Object java.lang.Object@1ce28a>, :a #<Object java.lang.Object@1ce28a>}

2:36 justin_smith: no need for a macro

2:36 a function suffices

2:37 lpvb: that would not be a macro, it would be a fork of the reader

2:37 macros obey certain rules about calling position etc.

2:37 and even reader macros need the #<something> notation

2:37 so you would need a brand new reader

2:40 ,(get {[:a,:b] :value} [:a :b])

2:40 clojurebot: :value

2:40 justin_smith: [:a :b] is already a legal key

2:40 lpvb: well not necessarily {}, instead (defmacro multi-key-map [key-matrix vals] ...)

2:40 justin_smith: like I said, no need for a macro

2:40 I did it with a function above, if you notice

2:41 don't do a macro when a function suffices

2:41 devn: or do, and then refactor it

2:41 or not

2:41 justin_smith: heh

2:41 devn: sometimes a macro is fine

2:42 use your judgement

2:42 justin_smith: what I'm saying is a macro is hard to develop

2:42 if you have a working function, and wish you had a new syntax, make a macro

2:42 devn: so are protocols and types

2:42 there are no rules for when to write macros

2:42 justin_smith: if you want a functionality, then make a function first, make a macro after that

2:42 devn: just do what you think is right

2:42 justin_smith: OK, it's my opinion

2:42 devn: exactly

2:43 justin_smith: I've butted my head against too many libraries that were annoying to use because they exposed macros for things but not functions

2:43 macros don't compose very nicely

2:43 devn: like which ones?

2:43 justin_smith: compojure

2:43 korma

2:43 devn: why didn't those work for you?

2:43 you needed them to compose why?

2:44 defroutes was too much to handle?

2:44 justin_smith: like I said, macros compose poorly

2:44 not difficult to handle

2:44 difficult to compose with

2:44 devn: you are complaining about how something you don't actually need to be composable, isn't composable

2:44 justin_smith: we wanted routes to be defined in a db

2:44 integrating that with a macro, means oh, now I need to write a macro

2:44 I do need it to be composible, because I need to extend it

2:45 devn: so look at the body of the macro and decompose it

2:45 problem solved

2:45 justin_smith: yeah, I could just copy and paste instead of using libraries, sure

2:46 devn: im not sure i understand

2:46 justin_smith: I have a db with a page model

2:46 I want the frontend guy to be able to use the CMS to define the route he needs

2:46 because he knows 0 clojure, but he knows the page that needs to exist

2:47 now, if I am using compojure, in order to define a route based on data fro mthe db, I need to write a macro, since defroute is a macro

2:47 honza: does anyone have any ideas about how many client connections a ring-based compojure app can handle?

2:48 justin_smith: similar to how in order to have the first arg to def be coming from a variable, you need to write a macro

2:48 devn: justin_smith: the 90% case isn't you

2:48 justin_smith: right

2:48 devn: that's life

2:48 all the functions you need to build up what defroutes does are there

2:48 it's not a huge macro

2:48 it's a convenience macro

2:48 so what?

2:48 justin_smith: OK

2:49 devn: it's 2 lines, literally

2:50 justin_smith: I'll never say "don't ever use macros", and I hope you don't think that is what I meant

2:51 but personally I often find them annoying

2:51 devn: nah, im just on a one man crusade to try and give macros some press that isn't all doom and gloom all the time

2:51 muhoo: justin_smith: i call it macro infection.

2:51 bitemyapp: muhoo: what? @ circleci

2:51 justin_smith: composability uber alles and all that.

2:51 muhoo: if you're dealing with somethign that's a macro, you need to write a macro to deal with it

2:51 devn: heh

2:52 muhoo: then you need to write macros to deal with that, ad infinitum

2:52 devn: muhoo: im sorry, but dude, think about every other language feature

2:52 if you use transients a lot, you call persistent a lot!

2:52 it's not a surprise

2:52 i don't see why people harp on that and not other aspects

2:52 muhoo: true, there are a few other areas where this happens.

2:52 devn: you uses a protocol! no you have to implement it!

2:53 used*

2:53 now*

2:53 justin_smith: devn: the libraries I try to use don't pass me transients - if they did I would be complaining

2:53 muhoo: bitemyapp: if you visit circleci with noscript on, it gives you a snarky little diatribe and a recruiting pitch :-)

2:53 devn: justin_smith: i hear what you're saying, it just, IMO is a personal, stylistic choice

2:53 justin_smith: if I couldn't use the libraries I want without implementing a big pile of protocols, I would complain about that too

2:53 devn: justin_smith: then dont use them

2:53 muhoo: basically "if you are the kind of person who uses noscript, you'll probably love this product"

2:54 devn: meanwhile, everyone else uses compojure

2:54 muhoo: clever

2:54 justin_smith: devn: its just that there are a lot of gratuitous macros out there

2:54 devn: justin_smith: i hear you man, i really do

2:54 muhoo: btw, IIRC, there are ways to define routes in compojure without the defroutes macro

2:54 been a while tho

2:54 devn: but either write it better or quit complaining

2:54 justin_smith: I am sure there are

2:55 devn: you can't deny that everything is there in compojure. fork it and turn those macros into fns

2:55 muhoo: in terms of composing routes, so far pedestal looks the most flexible. but i don't quite understand it yet

2:55 devn: have a look. i'm pretty sure you can do it without forking

2:55 devn: or that.

2:56 bitemyapp: muhoo: that's pretty funny

2:56 justin_smith: devn: since a coworker of mine wrote this, can I keep complaining now? https://github.com/caribou/polaris

2:56 bitemyapp: muhoo: I thought you were adding the "run-down San Francisco offices" part, that you weren't just makes it bette.r

2:56 muhoo: bitemyapp: yeah, smart dev marketing

2:56 * devn stabs

2:56 justin_smith: its a routing lib that doesn't use macros

2:56 muhoo: soma, fwiw, is not "run down"

2:56 devn: thank jesus

2:56 no more macros

2:56 now i can sleep at night

2:57 muhoo: 25 years ago soma was "run down".

2:57 devn: now it just smells like pee

2:58 muhoo: wait until the rains come. most of SF smells like pee until the rains clean off the streets. couple weeks from now it'll smell nice

2:58 bummer about cities in mediterranean climate: no rain from spring until winter.

2:58 devn: seattle manages to have a big city without a bum pee smell

2:58 impressive stuff

2:59 muhoo: seattle last i was there was pretty rainy most of the year. or maybe i was thinking of portland

2:59 justin_smith: seattle has frequent rain, reinforcing muhoo's point

2:59 both

2:59 bitemyapp: muhoo: I'm conflicted. I work for a fantastic company but I'm practically crawling up the walls to get out of SF.

2:59 muhoo: live in Ingleside, work in SOMA.

2:59 muhoo: K/T

2:59 devn: im thinking about heading out to SF

2:59 err...i /am/ heading out to SF

3:00 just taking my time about it

3:00 leases :(

3:01 muhoo: bitemyapp: i think you'd enjoy nyc or boston

3:02 devn: have lots of money before you come here tho.

3:06 justin_smith: also, http://www.booleanknot.com/blog/2012/09/18/routing-in-compojure.html fyi

3:07 devn: man, i wish clojure.core didn't have macros in it. it really spoils the whole language.

3:08 justin_smith: muhoo: I do know how to use compojure

3:08 devn: okay, sorry, sorry -- i will quit bringing up macros now

3:08 muhoo: justin_smith: someone was talkign about using compojure without defroutes macro, i thought it was you, sorry

3:08 justin_smith: I was

3:08 bitemyapp: muhoo: I lived in NYC before SF, left quite intentionally.

3:09 muhoo: I think I want nature near at hand.

3:09 muhoo: I miss bonfires.

3:09 justin_smith: the code isn't compojure until you get to defroutes, it is vanilla clojure up to that point

3:09 bitemyapp: the main problem with compojure, incidentally, is the macros.

3:09 wrt composability.

3:09 I need a generic purely functional router and compojure's macros fuck me over.

3:10 justin_smith: bitemyapp: did you see my link to polaris above?

3:10 I don't know if it is what you need, but we did put some thought into it

3:10 devn: bitemyapp: heh, you too?

3:11 muhoo: well, pedestal, once i can find energy/time to read all its docs and play with it, looks pretty awesome.

3:12 devn: why don't people complain about (defn) in clojure?

3:12 justin_smith: muhoo: if I could sell my frontend guys on clojure, pedastal seems like it could be cool

3:12 devn: we do complain about people using it as anything but a top level form

3:12 it isn't meant to compose

3:12 muhoo: i was goign to just use the routing and not mess with teh cljs stuff

3:12 it looks pretty modular if i was reading the docs right

3:15 devn: justin_smith: how about when-not, cond, lazy-seq, if-not, and, or, if-let, when-let, binding, with-bindings, io!, dotimes, doseq, with-open, forb

3:15 for*

3:15 the list goes on

3:16 do you use or? *gasp* -- does it compose!?

3:16 muhoo: ~gentlemen

3:16 justin_smith: do I need to say a fifth time that I use macros and I am not saying they shouldn't exist?

3:16 clojurebot: You can't fight in here. This is the war room.

3:17 devn: im just dying, gentles.

3:17 im sick of hearing people bitch about macros all the time

3:17 it's negative crap

3:18 abaranosky: bitemyapp: hey dude, have you seen Frege? What are your thoughts on it?

3:18 devn: abaranosky: hey dude

3:19 abaranosky: devn: hey!

3:19 devn: how goes it?

3:19 abaranosky: good :)

3:19 devn: what have you been hacking on lately?

3:20 bitemyapp: abaranosky: I've watched it for a few years, not used it yet. I was thinking of recommending it to KirinDave.

3:20 abaranosky: because his company is using Clojure, but only for the JVM. A number of engineers there are Haskellers.

3:20 devn: oh man, i wanna meet KirinDave

3:20 abaranosky: devn: mostly work, but also I have some side stuff both public and private

3:20 bitemyapp: devn: he's a nice person, easy to talk to.

3:20 devn: yeah, he's a midwestern gent

3:20 we've chatted on the interwebs here and there

3:21 abaranosky: most recent stuff publicly was updating my print-foo library to support a code walking print-debugging macro

3:21 bitemyapp: devn: I'm from the midwest, maybe that's why I got along with him? :)

3:21 devn: i think there's something to it

3:21 abaranosky: cool -- i didnt meant to put you on the spot

3:21 i am 99% work mode at the moment

3:21 abaranosky: bitemyapp: I love Clojure, but Haskell on the JVM could tip myself in favor of it as the Clojure-Java interop is an important part of why I like Clojure so much

3:22 * ucb wibbles

3:22 devn: ive been working on some cool stuff, but very busy reading and applying

3:22 bitemyapp: my output spiked recently, but after I release Simonides and do some misc work such as on Revise, I'll go dark again so I can moonlight on something business related.

3:22 ucb: hi!

3:22 abaranosky: devn: I don't mind :)

3:22 bitemyapp: abaranosky: for my part, I've used Haskell and Clojure concurrently, with the bias being on the Clojure side...but I'm losing my patience with not having a type-checking "assistant".

3:22 devn: bitemyapp: bipolar disorder is what that's called

3:23 OMG I'm Productiiiiiiiiiiivvvvvvvvveeeeeeeeeeeeeeeeeeeeeeee

3:23 abaranosky: bitemyapp: I'll play around with Frege and see what I can see there

3:23 bitemyapp: abaranosky: cool. Hopefully I'll get a chance to poke around too. I'm a little *_* of the unicode comp, but we'll see.

3:23 ucb: bitemyapp: !

3:23 bitemyapp: devn: well when I say going dark, it's so I can work on something *else*, not so I can stop working.

3:24 it's just something private as opposed to open-source-able.

3:24 abaranosky: yeah, I've got some top-secret ninja-level code project I've been working on for months now.

3:24 devn: bitemyapp: i have a similar thing at the moment, 3 of them actually :\

3:25 2 startups and a lib

3:25 abaranosky: seems like we should all just team up on our uber-private stuff :P

3:25 devn: let's make an org

3:25 abaranosky: hehe

3:25 bitemyapp: abaranosky: how interesting is adwords campaign optimization to you? :P

3:25 abaranosky: www.closedsource.org

3:25 devn: bahaha

3:25 bitemyapp: www.no-cooties-allowed.lel

3:25 devn: COSS

3:26 abaranosky: bitemyapp: honestly... its moot. Literally all my time is taken up right now.

3:26 devn: Costly Open Source Software

3:26 justin_smith: abaranosky: parked

3:26 abaranosky: parked?

3:26 wasat mean?

3:26 devn: he's referring to the domain name

3:26 abaranosky: ha

3:26 justin_smith: has a default placeholder page on it

3:26 bitemyapp: ...why would frege expect me to have a binary named "java7" on my path?

3:27 abaranosky: bitemyapp: do you use Emacs for Haskell stuff? Should I etup haskell-mode or is there a more preferred way to work with Haskell?

3:27 devn: abaranosky: with the lights off

3:27 bitemyapp: abaranosky: I use Emacs for Haskell stuff, yes. haskell-mode + scion were the standard way last I heard.

3:27 devn: in Yi

3:27 bitemyapp: some people use EclipseFP supposedly.

3:27 devn: Is Yi still around?

3:28 bitemyapp: devn: nah, leksah.

3:28 devn: ah

3:28 abaranosky: on another note, I was recommended to checkout Amethyst on OSX, and am enjoying it

3:28 devn: what's that?

3:28 abaranosky: it's an XMonad clone for OSX

3:28 devn: oh dude, i have something you want

3:28 unless you have it

3:28 do you have ShadowKiller?

3:29 it gets rid of those drop shadows between windows

3:29 abaranosky: devn: just heard of it yesterday

3:29 devn: makes it flat

3:29 abaranosky: I tried installing it, but nothing seemed to happen so I gave up :\

3:29 I'll try again

3:29 devn: abaranosky: where'd you find it?

3:29 their page where they used to host it is dead

3:29 justin_smith: that they chose the name shadowkiller over peterpan tells you something about the developers

3:29 abaranosky: same dude who recommended Amethyst over Twitter

3:30 devn: gotcha

3:30 bitemyapp: abaranosky: what? puffnfresh?

3:30 abaranosky: lemme see, I forgot :(

3:30 bitemyapp: $99 it's PuffnFresh

3:30 devn: so i have a ticket to the conj

3:30 i have a flight

3:30 and i have nowhere to stay

3:30 not sure how that's going to work out

3:30 but we'll see

3:31 abaranosky: @malfario - pay up

3:31 bitemyapp: abaranosky: damn.

3:31 abaranosky: devn: nice... 6 of us from Staples Innovation Lab (formerly Runa) will be there too

3:31 bitemyapp: abaranosky: you need to follow puffnfresh. Can I offer dinner in lieu of $99? :P

3:32 abaranosky: :)

3:32 bitemyapp: already follow puffnfresh

3:34 bitemyapp: abaranosky: you should probably start with the Language doc, here: https://github.com/Frege/frege/releases

3:34 http://www.frege-lang.org/doc/frege/Prelude.html

3:35 abaranosky: I'm going to just alias *.fr files to haskell-mode for now.

3:35 I can't do anything about that damn unicode.

3:35 abaranosky: I'm going to try to do *anything* with Frege first :)

3:36 I know some Haskell but haven't really done much with it in a couple years

3:36 bitemyapp: the primary point of interest for Frege for Haskellers is that it has the type hierarchy done right.

3:36 abaranosky: bitemyapp: is there a good link to "get started"?

3:36 bitemyapp: Ostensibly: https://github.com/Frege/frege/wiki/Getting-Started

3:36 abaranosky: bitemyapp: you mean they fixed some of the cruft in the heirarchy?

3:36 bitemyapp: I don't think anything is "good" right now. Dragons yonder and all that.

3:37 abaranosky: which fixes are there?

3:37 bitemyapp: abaranosky: da.

3:37 abaranosky: I might like a Clojure-Frege combo, with Clojure for parts that I don't mind breaking a little more often

3:37 rofl

3:38 bitemyapp: abaranosky: http://www.haskell.org/haskellwiki/Functor-Applicative-Monad_Proposal

3:38 anything related to this, Frege has supposedly fixed all in one go.

3:38 abaranosky: how'd the interop?

3:38 how's *

3:39 bitemyapp: It seems to take a similar attitude to Clojure, where it leverages the interop aggressively and makes it seamless but still has its own "thing" going on.

3:39 abaranosky: cannot complain about that approach in theory

3:39 bitemyapp: the main caveat I would submit with regards to Frege is that I have *no* idea how you can make purity and laziness efficient on the JVM

3:40 I'm sure it's possible, but I'm not aware of any "strategies" like what Clojure does that would work in Frege.

3:40 for example, you cannot do without TCO for obvious reasons.

3:40 so your functions have to be abstracted, so far as I'm aware anyway.

3:41 and possibly that means the JIT won't know how to inline things as nicely?

3:41 this is conjecture though.

3:41 abaranosky: bitemyapp: yep all good questions

3:41 bitemyapp: abaranosky: fuck it, I'm starting #frege

3:41 abaranosky: let's do this

3:44 TEttinger: clojure isn't exactly blazing-fast a lot of the time either. I think the success of languages like clojure and ruby (even pre-JIT ruby) shows that a usable, easy-to-reason-about language can do well even if it isn't C-doing-pointer-arithmetic fast.

3:45 although most clojure code I see IS a lot better written than the little ruby I have seen

3:47 abaranosky: Ruby!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

3:48 nightfly: ruby...

3:50 abaranosky: I'm not the biggest ruby fan, I guess

3:51 TEttinger: it was my first language, I wrote just a little bit of it

3:51 ddellacosta: bitemyapp: can you tell me more what you meant by "you cannot do without TCO for obvious reasons. so your functions have to be abstracted...?" I'm curious.

3:52 TEttinger: I really prefer clojure to just about everything else these days

3:53 bitemyapp: ddellacosta: Clojure is fast partly because it generates the vanilla JVM bytecode for the invocation of static methods.

3:53 justin_smith: ddellacosta: I think that means that idiomatic Haskell style programming uses recursion extensively, and since the jvm cannot do actuallo TCO, in order to not break the stack you need to implement TCO, which means your functions cannot be normal JVM callable objects, you need a layer that does that transform

3:53 ddellacosta: Ruby is nicer for scripting. Came back to it recently after writing Clojure for more than a year, when writing a git hook, and found my Clojure experience had really changed how I used Ruby--and made it a lot nicer

3:53 bitemyapp: ddellacosta: the trade-off is that the JVM static methods are "stackful" and cannot be TCO'd.

3:54 ddellacosta: bitemyapp, justin_smith: gotcha...found this too while I was at it: http://stackoverflow.com/questions/19462314/why-cant-tail-calls-be-optimized-in-jvm-based-lisps

3:54 bitemyapp: ddellacosta: you cannot TCO your "functions" unless they are not stackful invokestatic JVM methods. Which means you might not be benefiting from the JVM as much as you'd like.

3:54 abaranosky: ddellacosta: "Ruby: The Good Parts" :)

3:55 ddellacosta: bitemyapp, justin_smith: thanks, those comments were all helpful. :-)

3:55 abaranosky: yeah, there are nice parts to it! It does have some Lisp-y and Smalltalk-y elements, after all.

3:55 bitemyapp: justin_smith: to say that Haskell users use recursion extensively is an understatement :)

3:55 justin_smith: true

4:01 Sonderblade: bitemyapp: i think i use recursion less in haskell than other languages, in most circumstances you can use some smart code combinator instead of recursion imho

4:03 epichero: Gee, a programmer using recursion..

4:09 lpvb: how do I define my own types and match against them? say I want a slightly different vector type only different in name and I want a (myvector?) function

4:09 so I can differentiate between normal vectors and myvector

4:10 abaranosky: `instance?`

4:10 justin_smith: lpvb: generally with the jvm you are working in terms of classes rather than types, defrecord is a handy way to handle it

4:10 lpvb: ?

4:10 justin_smith: http://clojuredocs.org/clojure_core/clojure.core/defrecord

4:12 lpvb: the link I just pasted shows how to use defrecord and instance? together

4:12 also if you really want to switch behavior based on type, there is defmulti

4:13 but I find things easier if I avoid all of these featuers and stick to vanilla datatypes and functions

4:13 abaranosky: no need to make a defrecord for a vector type

4:13 justin_smith: usually at least

4:13 abaranosky: defrecords model map-like things

4:13 justin_smith: yeah

4:13 abaranosky: better to use deftype

4:13 lpvb: justin_smith: thanks

4:14 justin_smith: abaranosky: ok, cool. I had never really found a use for deftype, but I guess that is the usecase

4:15 abaranosky: justin_smith: it'd be especially egregious to make a vector type be map-like

4:15 justin_smith: abaranosky: I just imagined the vector would be one field in it

4:15 even with deftype the vector is a field hiding in it, no?

4:16 abaranosky: yeah that's true

4:17 but you get other kinds of equality semantics built into defrecords that you probably don't want

4:17 justin_smith: OK

4:18 as in structural equality?

4:19 abaranosky: Not sure, I don't often need to use either enough to be expert at the idiocincracies of each

4:19 justin_smith: as a preference, I generally would prefer structural equality and keyword based access of all my fields - and my understanding is that that is what differentiates defrecord from deftype

4:20 plus default constructors from a map

4:20 agreed, I usually don't need either, and actually avoid them if I don't need them

4:22 really, the pedantic way to make your own vector subclass would likely be to use gen-class with :extends, but that makes iterative development difficult

4:23 lpvb: sounds like there's not a perfect way to do what I want o.o

4:24 ddellacosta: what is the "official" use of bang in regards to side-effect-having functions? In clojurescript, for example, I've been using ! to signify a function that will actually manipulate the DOM. Would this be appropriate? I remember reading someone suggesting that, with regard to the meaning of "!," there are side-effects, and then there are side-effects...

4:24 justin_smith: making new types and dispatching on them is not a normal way to do things in most clojure code I have seen; a lot of us seem to prefer using generic and very general datastructures - fewer types and more functions on them

4:24 bitemyapp: ddellacosta: strictly speaking, it has to do with STM.

4:24 swap! for example.

4:25 justin_smith: bitemyapp: atoms are STM? I thought they were not.

4:25 ddellacosta: bitemyapp: swap! or reset! make a lot of sense to me; I'm just not sure how to transfer that to a general concept. Seems like I'm doing something similar when I'm setting a class in the DOM, for example

4:26 bitemyapp: ddellacosta: I use a more liberal interpretation and use bangs as an impure warning.

4:26 justin_smith: ddellacosta: notice that aset is not aset!

4:26 bitemyapp: justin_smith: I thought so too but I'm riffing off something tbaldridge said about bang meaning STM-unsafe or something.

4:26 lpvb: justin_smith: so you're saying I should dispatch on keywords perhaps? [:contains-data 1 2 3] [:contains-different-data 1 (Object.) 3] ?

4:26 ddellacosta: bitemyapp: yah, I have been doing the same. Just wanted to get a sense of what the consensus is, if any such thing exists in Clojure-land

4:26 justin_smith: sorry, what do you mean? re: aset/aset!

4:27 justin_smith: ddellacosta: aset destructively alters a jvm array

4:27 there is no aset!

4:27 ddellacosta: justin_smith: ah, I see what you're saying: even something w/o a ! can be impure

4:27 justin_smith: bitemyapp: http://clojure.org/concurrent_programming this lists atoms and STM as separate things

4:27 bitemyapp: justin_smith: I didn't say I disagree

4:27 ddellacosta: justin_smith: that's exactly why I'm asking, actually--what are the actual (implied) semantics of "!" ?

4:28 bitemyapp: I said the atom functions were marked with bang because they were STM unsafe according to tbaldridge, not because atoms are STM.

4:28 justin_smith: bitemyapp: and I wasn't intending to argue, just citing a source

4:28 bitemyapp: you don't need STM to make atomic changes to a single thingy.

4:28 ddellacosta: why would we *not* use it with aset--because we know that is java interop, or something? Confusing

4:29 lpvb: what about core.match or core.typed?

4:29 bitemyapp: I can't believe I'm quoting this

4:29 justin_smith: I think ! is for things otherwise pure? that is why I thought of aset, because arrays like the dom are never pure

4:29 bitemyapp: "The names of functions/macros that are not safe in STM transactions should end with an exclamation mark. (i.e. reset!)"

4:29 justin_smith: I could be wrong

4:29 bitemyapp: please don't make me do that again.

4:29 ddellacosta: haha, didn't mean to get you guys going...

4:30 bitemyapp: ddellacosta: no no, I'm just whining about having to quote batsov's guide as an explanation of the bang.

4:30 justin_smith: bitemyapp: quoting what? I am interested

4:30 ddellacosta: but, this is exactly the problem with "!" I guess. It's not clear. Hrm.

4:30 justin_smith: ddellacosta: not getting going, its something I am as curious about as you are

4:30 ddellacosta: justin_smith: yeah, I was kinda joking. ;-)

4:30 bitemyapp: ddellacosta: it's clear to me. the official meaning is, "don't use in a transaction"

4:30 ddellacosta: bitemyapp: yeah, I guess your point is that it is limited--but you also said that you use it for functions that are impure, generally, no?

4:31 lpvb: ddellacosta: that's not going to work, I don't want to check my whole vector to see if the data is of one type to deal with or another type to deal with differently

4:31 bitemyapp: ddellacosta: yes, because I wouldn't want those functions used in STM either, even if it's not strictly impossible.

4:31 ddellacosta: bitemyapp: I do as well. So it seems like informal usage is separate from "official" (such as it is) usage

4:31 hmm, okay

4:31 bitemyapp: 'ish

4:32 ddellacosta: you're a smart guy, I'm sure you'll do what makes sense for your code.

4:32 ddellacosta: bitemyapp: haha, thanks for your confidence in me. :-)

4:32 justin_smith: lpvb: maybe more like {:context "foo" :contents [1 2 3]} {:context "bar" :contents [\a \b \c]}

4:33 but if types are really what you want, deftype and defstruct are not too difficult to use

4:33 ddellacosta: bitemyapp: but seriously, I'm really just curious if anything exists like a consensus about how to use it. That helps, thanks.

4:33 lpvb: justin_smith: can I just attach meta data to a vector instead?

4:34 justin_smith: ,(with-meta [1 2 3] {:context "a"})

4:34 clojurebot: [1 2 3]

4:34 justin_smith: maybe

4:34 I don't know how well metadata is preserved by various functions

4:34 you would probably need to do a lot of bookkeeping to keep reattaching it

4:35 wheras with a defstruct / deftype it keeps the class that identifies it

4:35 ddellacosta: yeah, metadata seems like it wouldn't necessarily be very reliable. You'd end up re-making your own type system, poorly

4:36 justin_smith: lpvb: on another level, if the reason you want to differentiate these vectors is what they have in them, you can sometimes do the dispatching on the part of the code that touches the contents

4:37 and in practice, for me at least, I know what types I am dealing with, or what union of types, because I know where they came from

4:38 worst case I need to do a postwalk conjing #(class %) into an atom of a set

4:38 and see what all was in there

4:38 then make sure I cover those classes

4:39 but I don't know your design, so there could of course be other concerns

4:43 I'm calling it a night, seeya

5:19 smiler: I'm having some trouble with clojurescript and source maps (I think). The cljs-references have the wrong path generated. It ends up being something like "http://localhost:8080/home/smiler/src/myproject/target/thebuild-id/myproject/myfile.cljs" and the webserver will ofcourse generate a 404 for that file.

5:19 It should strip "/home/smiler/src/myproject/" away from that path.

5:53 WWWest: Hi all

5:53 does anyone have a good link on proper/clean error handling in clojurescript?

5:55 For example, I remember reading something about exceptions not being caught if they happen in a lazy seq. So... how do you deal with this? What about clean up functions?

6:29 clgv: WWWest: I expect that this behavior of exception in lazyseq realisation is the same as in clojure

6:29 WWWest: but to be able to give you a hint you need to be more specific

7:02 Jarda: hmm

7:02 how can I use clojure.walk in clojurescript?

7:02 now I get [14:02:31.721] TypeError: clojure.walk is undefined @ http://localhost:3000/js/app.js:40045

7:09 oh, I can't use with full path

7:09 need to refer them in require

8:07 bruceadams: ?

8:36 TimMc: `cbp: Hmm, what's up?

8:40 `cbp: TimMc: I though you were gonna ask me something yesterday

8:49 TimMc: Oh, I don't remember that.

8:49 To the logs!

8:50 Right! You were looking for projects.

8:51 `cbp: TimMc: yeah!

8:52 TimMc: unfortunately i have to go again! hah

8:52 I'll be back in about 1 hour =p

9:07 cemerick: dnolen: any idea how to convince GClosure to not inline exported scalars used in function bodies?

9:14 noncom|2: if, using core.async, i create a (go (loop-recur)) block inside a call to a method of a proxied Java object, enabling the communication of the proxied object via the publicated channel with the rest of the program, creating a (sub) there, what will happen to the sub and the involved channel upon the proxied object being GCed ?

10:07 `cbp: TimMc: hi, sorry about that. Were you gonna tell me something?

10:26 TimMc: `cbp: Oh, just curious what sorts of projects you're interested in. Large, small? Collaborations, contributions to existing large projects, or new projects? Libraries, or apps?

10:26 dobry-den: WWWest: maybe you can collect some ideas from http://swannodette.github.io/2013/08/31/asynchronous-error-handling/

10:27 TimMc: And of course there's always the Swearjure compiler, if you want to do some purely algorithmic useless programming. :-P

10:28 `cbp: TimMc: heh, anything is good really. As long as I learn something and preferably be productive at the same time

10:29 nDuff: noncom|2: I'm not sure I follow the scenario -- how are you proposing to have an object GC'd that you can still reference, without explicit use of weak references?

10:30 TimMc: Oh, well, then not Swearjure.

10:30 I mean you'll learn something about compilers (and Clojure) for sure, but the end result is just a toy for scaring people.

10:30 `cbp: it does sound really fun though

10:31 noncom|2: nDuff: well, the object has a method `initialize` which i override with proxy and install the core.async communications to talk with the objects insides. so you are saying that in that case the object won't be GC'd since it is referenced by core.async.. but it is not, it is only that inside the method there is a (go (loop-recur)) thing which influences the objects aggregated properties..

10:32 TimMc: https://github.com/timmc/swearjure/blob/master/src/org/timmc/swearjure.clj is the start of it. I probably have more locally. It needs some more designing to make pre-swearjure functions first-class (you need to do a transform on the args to call them properly).

10:32 But if you want to do something useful, you should probably try to contribute work to an existing email client to make it easy for peopel to use encryption. :-P

10:32 noncom|2: then i just lose any references to the object from my program, but the go-loop-recur still functions inside the objects method... ?

10:35 nDuff: noncom|2: Can you provide a SSCCE?

10:38 dobry-den: `cbp: If you're interested in Bitcoin, I've been implementing it in Clojure

10:40 indigo: dobry-den: Ooh, that's cool

10:41 wedr: indeed

10:42 `cbp: unfortunately ive never been involved with anything related to bitcoin before :P

10:43 dobry-den: same

10:43 noncom|2: nDuff: i hope i have properly shown what i am trying to do here: https://www.refheap.com/20602

10:43 core.async is still ne for me so i might be mistaken somewhere

10:43 s/ne/new

10:44 updated the refheap to make the actual call for the init

10:45 oops, and corrected the reset state form to be valid

10:45 sorry

10:51 dobry-den: though i'm ready for someone to write the O'Reilly book on Datomic.

10:52 but instead of an animal on the cover, just hickey's hair

10:52 nDuff: noncom|2: Runnable code would be a substantial improvement; the obfuscation you're doing there obscures some important details.

10:56 noncom|2: nDuff: ok, i will, but some time later, can't do it right now, gotta a task to do..

10:56 thanks!

10:56 i will write you when i see you

10:57 rkneufeld: Alex Robbins, are you here sir?

11:13 danielszmulewicz: dobry-den: +1 (Hickey's hair on O'reilly cover)

11:18 dobry-den: Tangela

11:22 jtoy: can i store hiccup code in a file to render?

11:24 joegallo: jtoy: as opposed to?

11:24 dobry-den: jtoy: yeah, you can read clojure datastructures from a file

11:24 joegallo: :)

11:24 dobry-den: but i dont see the point

11:26 being able to evaluate your template code with the ease in which you can evaluate (+ 1 1) is baller

11:26 within the same file, i mean

11:38 devn: anyone know if this is documented anywhere?

11:38 ,(class (merge {:c 3 :d 5} (array-map :q 33 :r 99)))

11:38 clojurebot: clojure.lang.PersistentArrayMap

11:38 devn: ,(class (merge (array-map :q 33 :r 99) {:c 3 :d 5}))

11:38 clojurebot: clojure.lang.PersistentArrayMap

11:39 llasram: devn: What's the confusion?

11:39 devn: I guess I didn't really know what to expect in this case. Can anyone explain why persistentarraymap wins in both cases?

11:39 llasram: ,(class {:c 3 :d 5})

11:39 clojurebot: clojure.lang.PersistentArrayMap

11:39 devn: err whoops

11:39 haha

11:40 BobSchack: devn for small hashmaps < 4 I think clojure uses array maps

11:40 devn: so i guess im concerned about whether or not i lose order guarantees

11:40 BobSchack: ahhhh

11:40 so I need a bigger sample to see the real behavior here

11:41 danielszmulewicz: b

11:41 BobSchack: dven http://clojure.org/data_structures#Data Structures-ArrayMaps

11:41 justin_smith: ,(class (zipmap (range 3) (range)))

11:41 imok20: hey everyone! I'm struggling with the best way to get something like this (https://gist.github.com/ihodes/7373834) to work. I'd like to define a bunch of functions from a (rather long) list of lists—not quite sure how to do this with the way clojure resolves defs (i mean, the obvious solution is just writing out the defs for each/having some elisp write it out for each, but that's no fun)

11:41 clojurebot: clojure.lang.PersistentArrayMap

11:41 justin_smith: ,(class (zipmap (range 30) (range)))

11:41 clojurebot: clojure.lang.PersistentHashMap

11:42 devn: ah man, bummer

11:42 im gonna lose order guarantees when i assoc

11:43 * devn puts on the song "If it don't fit don't force it" by Parliament

11:43 justin_smith: imok20: why not put them all in one data structure and look them up, instead of making a top level definition for each one?

11:44 BobSchack: devn you could you use php arrays :) They maintain order

11:44 devn: bahahaha

11:44 imok20: justin_smith: that could work, but i'm not a fan of the UX for that. i'm thinking that might be the reasonable thing to do though

11:45 devn: imok20: so you expect what to come out the other side?

11:46 justin_smith: imok20: what about instead of defining respond-100 respond-101 ... you define respond, which takes a number and returns the response for that number ((respond 100) ...)

11:46 devn: you just want to intern a bunch of vars?

11:46 BobSchack: devn https://github.com/flatland/ordered

11:46 devn: ,(intern *ns* 'foo "bar")

11:46 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

11:47 devn: #'my.ns/foo

11:47 foo => "bar"

11:47 but i think justin_smith is giving you good advice, FWIW

11:47 imok20: justin_smith: I have the same picky objection haha. i guess there's just no way to do it in a way that provides the UX i want without writing out all the defs at the top level.

11:48 devn: i want e.g. respond-100, respond-101, … respond-404, …

11:48 defined in the ns

11:48 Wild_Cat`: imok20: how about (respond 100)?

11:48 justin_smith: Wild_Cat`: that was my suggestion he just rejected

11:49 devn: i don't understand what's wrong with that

11:49 Wild_Cat`: justin_smith: whoops, my bad. I need more coffee.

11:49 devn: seems like a pretty reasonable "UX"

11:49 it's damn near the same thing

11:49 and it's simpler

11:49 imok20: devn: it's fine, just not what i'd like. i think i'll probably go with the earlier suggestion of a map -> fn lookup

11:49 Wild_Cat`: well, I can see how you'd lose tab-completion in the REPL, but OTOH if respond is a map and not a function, it's "better"

11:49 (because now you can print it out)

11:50 imok20: i wanted to make sure i wasn't missing something obvious, haven't written much clojure for 3 years…

11:50 thanks for the help!

11:50 Wild_Cat`: ,(let [respond {100 "Continue" 200 "OK"}] (respond 100))

11:50 clojurebot: "Continue"

11:51 imok20: Wild_Cat: that's not what the fn i've posited does

11:51 that would be a fine solution for doing that, but not what i'm doing unfortunately

11:51 silasdavis: um does clojure use multiple cores some of it's library functions by default?

11:51 multiple threads

11:51 I should say

11:52 because I'm seeing 600% cpu usage on what I thought was a single-threaded application written in clojure

11:52 justin_smith: silasdavis: it should use more than one core if you have them, unless you prevent the jvm from using more than one core

11:52 silasdavis: I'm just wondering where the other threads are coming from

11:52 justin_smith: silasdavis: what kind of app?

11:52 dobry-den: Does anybody else use 'hello' instead of \"hello\" in docstrings?

11:53 devn: imok20: (defmacro defresponse [[code msg]] `(def ~(symbol (str "respond-" code)) ~msg))

11:53 (defresponse [100 "hello there"])

11:53 justin_smith: silasdavis: some things are implicitly threaded, ie. ring makes a new thread for each request

11:53 devn: the macro police will sound the sirens, but don't pay any attention -- if you want to do that, that's a way to do it

11:53 dobry-den: i think i'm going to start using those pretty unicode quotation marks in docstrings

11:53 imok20: devn: right, but i can't map that across a list of codes/messages and have them all defined at compilation time

11:54 can i?

11:54 wouldn't that be the same issue of being unable to resolve the symbol if i mapped that as in https://gist.github.com/ihodes/7373834

11:54 justin_smith: imok20: not with a map, but with a top level doseq you could, maybe

11:54 devn: imok20: try it :)

11:55 justin_smith: but anything but defs at the top level is asking for trouble

11:55 imok20: my impression was only do was treated specially at the top level

11:55 i'll give it a whirl

11:55 justin_smith: why do you say that?

11:55 justin_smith: because then loading the ns has side effects

11:56 it isn't always a problem of course

11:56 but it can be a source of trouble

11:56 imok20: justin_smith: but well-defined side-effects isomorphic to having just defined those fns by hand, right?

11:57 justin_smith: frankly I am not 100% certain a doseq is guaranteed to be fully run at ns load time in a clean way - but if all it does is def some vars it could be OK - I really don't know

11:57 silasdavis: justin_smith, but things like map, update-in and so on are not right?

11:57 justin_smith: I do know I have gotten weird bugs by trying to do things other than def at the top level

11:57 devn: imok20: give it a whirl! :)

11:58 silasdavis: are the persistent data structure constructors multi-threaded?

11:59 dnolen: ClojureScript 0.0-2024 going out, fixes a regression around source maps

11:59 justin_smith: I wouldn't put it past the optimizer to realize two forms in your function body do not rely on one another in any way and can thus be done in parallel - but I don't know that clojure actually does that

12:04 devn: dnolen: awesome.

12:08 seangrove: technomancy spreading his propaganda... "there's no reason lein shouldn't have a debugger built-in"

12:09 All part of his plan to ultimately have the clojure language subsumed into the lein project, and have all copyright assigned to him

12:09 devn: heh

12:10 justin_smith: we are working on a standalone debugger, with a browser based UI, that would connect to and debug other clojure projects from the outside

12:10 seangrove: justin_smith: As long as there's an explicit API so other frontends can be built, that seems brilliant

12:11 justin_smith: we are using the same dt-thread interface that jvisualvm etc. use

12:11 devn: imok20: (doseq [[code msg] http-status-codes] (intern *ns* (symbol (str "respond-" code)) msg))

12:11 justin_smith: I can see about keeping the json api generic

12:12 but it is already built on top of a very generic api

12:12 just one that doesn't have friendly enough clojure tooling yet (imo)

12:13 imok20: devn: okay, will try. doseqing over the forms with the macro did not work, i don't think?, I got "nth not supported on this type: Symbol", though the macro itself does work. will try this now

12:15 nice, using doseq instead of map works. so do is treated specially at the top level too, i guess? nice

12:15 thanks :)

12:15 justin_smith: map does nothing if nothing uses its output

12:15 devn: imok20: y/w

12:15 justin_smith: so a map at the top level does nothing

12:15 imok20: justin_smith: not at compile-time

12:16 (i guess?)

12:16 so yeah, i guess it'd be a total no-op no matter what since it's lazy, too

12:16 justin_smith: that's what I am saying: the only reason map evaluates anything at the top level of the repl is the implicit print

12:16 if you prevent that you see the same behavior

12:17 ,(do (map println (range 10)) nil)

12:17 clojurebot: nil

12:17 justin_smith: ,(map println (range 10))

12:17 clojurebot: (0\n1\n2\n3\n4\n5\n6\n7\n8\n9\nnil nil nil nil nil ...)

12:18 imok20: yeah, which i totally should've caught. living getting back into clojure, though. developing and setting things up is SO much easier now

12:18 (and if anyone is curious, the final working solution is: https://gist.github.com/7374418)

12:20 devn: imok20: welcome back

12:20 imok20: (well, i added a ! to the end of my def-form)

12:20 den: thanks :)

12:20 devn *

12:21 justin_smith: one gotcha with something that clever is that usually in order to check out a definition in some ns, you would expect to find a form declaring that defintion in the ns - so now someone needs to dig a bit deeper to find out how something was defined ("someone" here including editors and things like `source` or `doc` that are used in the repl or by the editor to provide tooling)

12:23 imok20: justin_smith: true, definitely. and there will be a nice big comment there to help with greping for it. i just can't be bothered to write out a correct defn for each fn; even the status codes and text were all grabbed and formatted by javascript from a w3 web page :) i'm all about the lazy.

12:26 justin_smith: imok20: but I don't grep to find definitions, I use the source command in the repl

12:26 and so does my editor

12:27 similar issues for the ability of stack traces to list a line number

12:27 or even function names I think

12:28 * seangrove boggles at Datomic Pro Starter Edition

12:28 seangrove: bitemyapp: Seems like DaaS could be done now pretty nicely

12:29 Might be a fun (few) weekend hack sometime if you're up for it

12:29 totos: Hello is there something wrong with my-reverse ? (defn my-reverse [x] (if (nil? (rest x)) (first x) (cons (my-reverse (rest x)) (first x)))) '(1 2 3 4 )

12:30 rasmusto: totos: check out rest vs next

12:31 totos: rasmusto: oh thanks

12:31 rasmusto: totos: alternatively, you could replace nil? with empty?

12:32 totos: rasmusto: nice , thanks again :)

12:39 muhoo: what libraries, if any, are people using for fsm's in clojure?

12:39 justin_smith: also, a destruction like [h & t :as x] avoids the multiple first / rest calls

12:39 *destructuring

12:41 totos: justin_smith: i always forget that in clojure

12:44 noncom|2: what was the best way to filter [nil nil] pair ot [whatever nil] pairs from a {} ?

12:45 justin_smith: ,(into {} (remove (comp nil? second) {:a 0 :b nil :c 1 :d nil}))

12:45 clojurebot: {:a 0, :c 1}

12:45 justin_smith: maybe?

12:46 jtoy: can I use hiccup templates in files and render those?

12:46 justin_smith: noncom|2: or did you want ,(into {} (filter (comp nil? second) {:a 0 :b nil :c 1 :d nil}))

12:47 jtoy: i dont see it being used like that

12:47 technomancy: jtoy: hiccup templates are functions, and functions can go in files

12:47 justin_smith: ,(into {} (filter (comp nil? second) {:a 0 :b nil :c 1 :d nil}))

12:47 clojurebot: {:b nil, :d nil}

12:47 noncom|2: wow, the first one !

12:48 also, afaik a {} only allows for a single key of nil, how do i remove it from a {} if i have say {nil nil :a 1 :b 2} ?

12:48 justin_smith: noncom|2: my code was just checking the values, not keys

12:49 you could make a version that also checks for the key being nil

12:49 noncom|2: yes, that is task 1, but checking for keys is task 2 - so i have 2 tasks.. one is solved :)

12:49 justin_smith: ,(dissoc (into {} (remove (comp nil? second) {nil :blarg :a 0 :b nil :c 1 :d nil})) nil)

12:49 clojurebot: {:a 0, :c 1}

12:49 justin_smith: that's what dissoc is for :)

12:50 but at that point you probably want to refactor and not do a one liner

12:50 noncom|2: right. i just wasn't using (comp) uch in my expertise... so that's a good start for it, thanks!

12:50 s/uch/much

12:50 jtoy: technomancy: do i need to do anything special to read in the files or just use eval?

12:50 technomancy: jtoy: require is the best way

12:51 justin_smith: noncom|2: yeah, my main usage of comp is to do deeper inspection of a structure for a predicate

12:51 technomancy: you can use load-file if for some reason you don't want the file to have a proper namespace, but there are basically no good reasons to do this

12:51 muhoo: ~fsm

12:51 clojurebot: Titim gan éirí ort.

12:52 justin_smith: muhoo: core.async go blocks generate an fsm behind the scenes

12:52 imok20: justin_smith: I guess adding metadata while interning it might help some of those?

12:52 justin_smith: dunno if that helps you at all or not

12:52 imok20: yeah, it absolutely would

12:52 imok20: just makes the solution a little more complex

12:53 imok20: justin_smith: any suggestions as to what is important metadata?

12:53 muhoo: justin_smith: interesting idea. not sure it'd help for this tho

12:53 justin_smith: imok20: you can look at what defn generates

12:53 muhoo: i've got a crazy complex login process that has to be managed, with lots of possible states and transitions, and i'd like to keep it relatively organized and maintainable

12:54 justin_smith: imok20: (source defn) will help with that :)

12:54 imok20: justin_smith: touché

12:55 justin_smith: imok20: it uses a local called m to build up the metadata in a let form

12:55 so you could look at what goes in m

13:00 * muhoo sings "eve of destructuring"

13:00 justin_smith: lol

13:01 cark: i'm trying to test the sourcemap thing but it looks like lein can't find clojurescript 2024 yet, how long usually until a version shows up on maven ?

13:01 devn: cark: http://build.clojure.org/

13:02 it looks like it should be out there?

13:02 cark: couldn't find it on search.maven.org

13:02 seangrove: cark: Yeah, not listed on http://search.maven.org/#browse%7C-334501002

13:02 devn: dnolen: might have a better idea

13:02 Bronsa: yeah it takes a while for a release to hit maven

13:02 devn: i have limited experience with maven releases

13:03 cark: in the meantime you could always just grab the source and built it yourself

13:03 cark: devn : just like me =)

13:03 devn: build*

13:03 it's pretty straightforward

13:03 cark: yep, just asking here in case it's only a matter of minutes

13:03 devn: *nod*

13:03 dnolen: cark: probably will show in maven central later in the day - ./script/build if you want to install it locally

13:03 devn: is bootstrap still needed dnolen?

13:04 cark: dnolen: ah nice i'll try that

13:04 thanks !

13:04 dnolen: devn: no

13:04 devn: dnolen: oh. cool. so can that guy get rm'd?

13:04 dnolen: devn: well not for installing it locally anyway, for dev boostrap still needed

13:05 devn: oh, that's what i meant -- sorry

13:05 dnolen: what needs work in cljs these days?

13:05 dnolen: devn: lots of stuff, you can see in JIRA :)

13:06 devn: :) i'll take a peek

13:06 seangrove: Interesting recruiter email just showed up: https://gist.github.com/sgrove/7b40265b91948d8f26be

13:07 dnolen: Are you in their database? Seems they have a few with more than 5 years of cljs experience :P

13:07 devn: seangrove: i have a hunch on who sent that :)

13:07 seangrove: devn: I don't like to shame though, so I just redacted it ;)

13:08 dnolen: heh

13:08 devn: seangrove: interesting post btw on the clojure mailing list

13:08 apple looking for a clojure contract-to-hire

13:08 i wonder why

13:08 technomancy: itunes drm =(

13:08 muhoo: yep

13:08 devn: sad

13:09 seangrove: devn: hrm, didn't see that one at all. Interesting stuff.

13:09 devn: oh, i got you confused

13:09 * technomancy goes back in time and adds a "do no evil" clause to leiningen

13:09 bitemyapp: seangrove: yes, but I'm still not going to do it. :P

13:09 devn: i was thinking of seancorfield

13:09 my bad

13:09 muhoo: the strong correlation between lucrative and evil is not a new phenomenon, though it remains just as sad.

13:11 devn: how do you guys know it's DRM?

13:11 muhoo: says someone who just realized the bluecoat webproxies on his mobile isp's network can be used to do an MITM attack and sniff ssl traffic

13:12 devn: i know they mentioned itunes, but i guess i dont remember seeing anything about DRM, but i only skimmed it

13:12 muhoo: and probably are, in fact, being used for that

13:12 bitemyapp: o_O

13:12 technomancy: devn: I haven't actually used itunes, but I'm assuming that's plumbed all the way through the server-side components

13:14 TimMc: muhoo: THat's the flip side of compressors, yes.

13:14 devn: oh, sweet -- datomic pro starter

13:14 awesome news.

13:15 time to deploy to heroku with pg

13:15 bitemyapp: devn: yeah that's what seangrove was talking about.

13:16 muhoo: devn: i was just going to say that

13:16 devn: im excited to play with pro on heroku

13:16 muhoo: but datomic is so resource heavy, both the transactor and the peer, i dunno how it'll work on heroku

13:16 devn: *shrug* -- it'll be a fun experiment, but yeah you may well be right

13:16 some tweaking is probably in order to the default settings

13:16 muhoo: i've had to use 8GB VPS'es for both

13:17 then again, why use pg, dynamodb seems pretty cheap

13:17 bitemyapp: you could run it on Heroku.

13:17 just require tweaking the JVM opts.

13:18 muhoo: the transactor though?

13:18 hmm, could run the transactor on a vps, the backend on dynamo, and various front-ends with peers on heroku

13:18 limit of 2 peers though.

13:20 bitemyapp: if you're good at writing reasonably efficient Clojure code, 2 peers can serve a lot of people.

13:20 muhoo: we've got one peer running a data warehouse, for example.

13:29 Raynes: Wikipedia is down. I just became a janitor.

13:29 http://xkcd.com/903/

13:30 muhoo: a friend coined the word "googlectual" --> someone who appears smart but is just really fast with the searches

13:34 TimMc: help what is a janitor

13:35 bitemyapp: muhoo: welcome to how I answer 90% of the questions on IRC

13:36 DidYouTryGoogle: bitemyapp: Do you want this name?

13:37 bitemyapp: TimMc: only half.

13:38 muhoo: $google google

13:38 lazybot: [Google] http://www.google.com/

13:38 seangrove: TimMc: Shapeshifter!

13:38 bitemyapp: TimMc: I want that nick to swoop in in an automated fashion whenever somebody asks a Google'able question.

13:38 muhoo: $google just fucking google it

13:38 lazybot: [Just Fucking Google It] http://justfuckinggoogleit.com/

13:38 TimMc: Sounds like you want an AI.

13:39 seangrove: bitemyapp: Why not add a lazybot command, `$google <handle>` that'll respond with a link containing a google query for whatever the handle last said?

13:39 muhoo: seangrove: the #debian bot has something like that

13:39 bitemyapp: seangrove: that's a good idea.

13:39 seangrove: muhoo: Damn those debians, always one step ahead.

13:39 muhoo: you can msg factoids to people to dismiss them efficiently

13:39 bitemyapp: Efficient Dismissal sounds like a metaphor for forced suicide.

13:40 Fall on your sword, sir.

13:40 muhoo: #debian was quite a bar brawl at one time

13:40 TimMc: The best bot I've ever seen was fajita in #apache.

13:40 yogthos: I guess feudal Japan had efficient dismissal all figured out then :P

13:40 TimMc: It was amazing watching people come in and ask a question, get answered by fajita, thank the bot, and leave.

13:41 seangrove: Wow, that's pretty cool

13:42 muhoo: works great for projects with lots of peopel asking very repetitive n00b questions

13:42 bitemyapp: muhoo: I miss those days.

13:42 TimMc: *nod* I don't know if it would work as well for a programming language channel.

13:42 muhoo: bitemyapp: feudal japan?

13:42 bitemyapp: muhoo: hahahaha, the IRC bar brawls.

13:42 justin_smith: ~lazy

13:42 clojurebot: lazy is hard

13:44 stuartsierra: While we're on the subject of bots, some automatic links to http://dev.clojure.org/display/doc/FAQ might be useful. #bash does this to great effect.

13:45 muhoo: one of the nicer bots i've seen was the one in #openwrt, which would post new forum posts or issues and issue-update statuses

13:45 bitemyapp: stuartsierra: that could use expanded, haha.

13:45 muhoo: so bugs got attention lightning fast, and got closed quickly too

13:46 TimMc: muhoo: Wouldn't help too much here; only a couple of people actually have the power to address bugs.

13:47 Oh, might help on the contribs, I guess.

13:47 muhoo: TimMc: yeah, maybe in #leiningen

13:48 technomancy: yeah, issue opening announcements would be cool in #leiningen

13:48 TimMc: lazybot, get on it

13:48 technomancy: lazybot has a few github integration features; couldn't be too difficult

13:49 muhoo: it pulls in tentacles, right?

13:49 technomancy: undoubtedly

13:49 logic_prog: are there any DSLS in clojure for writing code in NativeClient or ASM.js ?

13:49 justin_smith: natural language processing that decits that 1) something was expected to happen that did not happen and 2) the person was using map

13:49 *detects

13:50 muhoo: a laziness alarm

13:52 hmm, this is making me curious to see what kibit is like these days

13:54 TimMc: justin_smith: println + map or for without dorun or doall

13:54 Follow refheap and gist links too.

13:55 justin_smith: well once it is checking out code it doesn't need NLP, it can just slurp it up as edn or something

13:56 muhoo: huh, kibit hates (->> ...)

13:56 justin_smith: make a markov chain bot, and feed it all the best libraries, then just let it generate new code

13:56 TimMc: Isn't that how you code? That's what I do.

13:57 justin_smith: bonus, the code that doesn't compile you just use as the body of spam emails

13:57 no bit wasted

13:57 mtp: sounds like a plan to me

13:58 bitemyapp: we use printouts of the non-compiling code to bury the houses of recruiters and trap them inside

13:58 then the bonfire starts

13:58 seangrove: bitemyapp: Might help some people on hn if you post some snippets about your ops experience with datomic

13:59 muhoo: (:require [million-monkeys "0.1.0"])

13:59 seangrove: Seems quite a few people are interested

13:59 TimMc: huh, is the one in clojure automancy> undoubted quickly a couple on few gist new could best links

13:59 technomancy: kibit would be a cool nrepl-discover op if it didn't have bad opinions about when

13:59 TimMc: ^ based on the last page of IRC

14:00 seangrove: technomancy: Please ban jaiiii for spam...

14:00 justin_smith: technomancy: what does kibit think of when?

14:00 technomancy: seangrove: huh?

14:00 seangrove: technomancy: Just getting private spam msgs :P

14:00 technomancy: justin_smith: it thinks single-branch ifs are wrong and should be when instead

14:01 muhoo: kibit bitchd at me for (if (do and suggested when, FYI

14:01 justin_smith: that's true!

14:01 that is exactly what when is for

14:01 bitemyapp: seangrove: I commented.

14:01 seangrove: if people ask me questions, I'll answer them.

14:01 technomancy: justin_smith: http://p.hagelb.org/lies.gif

14:01 muhoo: yeah, but when i wrote the code, i intended there to be an else :-P

14:01 justin_smith: OK, then what is when for?

14:01 TimMc: "laziness bugs got attentacles"

14:02 muhoo: ,(doc when)

14:02 clojurebot: "([test & body]); Evaluates test. If logical true, evaluates body in an implicit do."

14:02 technomancy: justin_smith: side-effecting conditionals

14:02 justin_smith: ???

14:02 lazybot: justin_smith: Yes, 100% for sure.

14:02 justin_smith: the mind boggles

14:02 llasram: Even lazybot agrees

14:02 technomancy: lazybot: botsnack

14:02 lazybot: technomancy: Thanks! Om nom nom!!

14:02 technomancy: justin_smith: so you think it's a design bug that if is variadic?

14:02 justin_smith: no

14:02 but I think one branch if is better as when

14:03 it's more explicit

14:03 technomancy: it's definitely more explicit

14:03 bitemyapp: seangrove: I don't actually know what aspect of ops with Datomic was unpleasant for you.

14:03 technomancy: it tells the reader: side effects here; watch out. implicit do.

14:03 bitemyapp: to my mind, the migration story is considerably more painful and that's why I'm working on that toolkit.

14:04 muhoo: so far the only thing kibit complained about other than the single-armed if, is pos? instead of (< 0). i consider that a win.

14:04 TimMc: technomancy: So you disagree with using the output of a when as a return value?

14:04 bitemyapp: seangrove: also datomic pro starter isn't redistributable, so DAAS is still a no-go.

14:04 muhoo: that's pretty good.

14:05 technomancy: muhoo: wait it complained about pos?

14:05 TimMc: yes

14:05 bitemyapp: kibit needs a fix sounds like?

14:05 muhoo: it complained about (< 0), suggested pos?

14:05 seangrove: bitemyapp: That's not distribution though, is it?

14:05 bitemyapp: ohhhh

14:05 technomancy: muhoo: oh, ok

14:05 bitemyapp: seangrove: it's a bit of a dodge to claim otherwise.

14:05 seangrove: I already have a number of people that hate me, I don't want to add Rich Hickey to that list.

14:05 TimMc: technomancy: You'd prefer (if foo (+ foo 5) nil) then?

14:05 seangrove: bitemyapp: Well, gpl vs agpl I suppose

14:06 technomancy: TimMc: no, that's silly. nil is unnecessary

14:06 justin_smith: technomancy: the way I have always used when is to distinguish "action or nothing" from "action or alternative" - I have never connected it to side-effecting

14:06 TimMc: Harrumph.

14:06 justin_smith: but I can totally see how it could be seen that way

14:06 technomancy: justin_smith: that's a common mistake

14:07 you don't need a whole new top-level macro to distinguish something as trivial as 1 vs 2 branches when you already have if

14:07 muhoo: [(pos? ?foo)] looks weird tho in a query

14:07 TimMc: We should have a 3-armed if.

14:07 justin_smith: I don't like single armed ifs because I waste precious seconds trying to verify there really isn't a second condition

14:07 technomancy: even elispers (who are notoriously sloppy about imperative code) use when for side-effects

14:07 bitemyapp: TimMc: k-armed bandit.

14:07 TimMc: (if foo (println "true") (println "false") (println "I reject the boolean binary system"))

14:08 muhoo: TimMc: (defn vishnu [& arms]...)

14:08 technomancy: anyway, I'm not going to use kibit till it fixes that

14:08 justin_smith: TimMc: clearly the last would be if foo = FileNotFound

14:08 TimMc: :-)

14:11 bitemyapp: muhoo: kibit just cleaned up my code a fair bit.

14:11 muhoo: it complained about Halloway's code too, hahahaha

14:11 muhoo: ooh, it also caught a (when (not ..)) . nice little lint, that is.

14:12 my yak is completely bald now

14:12 justin_smith: yaks grow new hair very fast

14:12 and don't think you can't shave a bald yak

14:13 muhoo: (defproject yak-nair "0.1.0" ..)

14:13 patchwork: technomancy: Is there overhead in the implicit do for 'when?

14:13 Why should it be avoided?

14:13 technomancy: patchwork: it's all about communicating intent

14:14 muhoo: my god you gys are still OCD'ing the when

14:14 patchwork: muhoo: I brought it up again

14:14 justin_smith: INTENT IS VERY IMPORTANT MUHOO

14:14 technomancy: muhoo: I'm just bitter because I want a linter that doesn't give me bad advice

14:14 muhoo: patchwork: naughty

14:14 we could go on about juxt for a while

14:14 ~juxt

14:14 stuartsierra1: "implicit do" has no overhead, for what it's worth.

14:14 clojurebot: juxt is the bestest option though if it doesn't weird you out

14:15 technomancy: juxt is completely uncontroversial in its splendour

14:15 bitemyapp: seangrove: nobody's asked any questions :P

14:15 justin_smith: juxt for president

14:15 stuartsierra1: (WTF is up with my router dropping connections?)

14:15 technomancy: juxt has a plan for the economy

14:15 justin_smith: juxt for industry

14:15 juxt for the dead

14:15 technomancy: (well, it has N plans, and it's going to apply them all)

14:15 muhoo: juxt for the hell of it!

14:15 * muhoo ducks

14:16 stuartsierra1: With liberty and juxt for all.

14:16 muhoo: juxt for shits and giggles

14:16 yazirian: when is not simple. when complects branching and do!

14:16 mattmoss: juxt do it?

14:16 cark: dnolen : looks like there's some kind of regression with clojurescript 2024

14:16 technomancy: yazirian: cond for secretary of state!

14:16 bitemyapp: cark: https://github.com/cark/data.lenses == you?

14:16 cark: dnolen : compiler loops when compiling an alts! form from core.async

14:17 bitemyapp: yes

14:17 yazirian: technomancy: need more wood behind fewer ->'s

14:17 bitemyapp: cark: much love <3

14:17 cark: bitemyapp: didn't know anyone was using it =) glad to have 1 (one) user !

14:17 llasram: clojurebot: juxt is completely uncontroversial in its splendour

14:17 clojurebot: Ack. Ack.

14:17 bitemyapp: ~juxt

14:17 clojurebot: juxt is usually the right answer

14:18 cark: dnolen: i have a minimal example https://gist.github.com/anonymous/7376057

14:18 bitemyapp: clojurebot: juxt in Haskell is sequence, and is equally magical.

14:18 clojurebot: 'Sea, mhuise.

14:19 justin_smith: hmm, what about using and instead of a when that is not about side effects

14:20 technomancy: justin_smith: using or/and for side-effecty things is super sketchy

14:20 for exactly the same reason in the other direction

14:20 justin_smith: no when it ISN'T about side effects

14:21 when for the side effect thigs, and for the non-side-effect

14:21 technomancy: sure, I mean the choice to use or/and means it's about return value; it's gross to do otherwise

14:21 Apage43: If I use or for side effects is usually (or thing-i-wanted (log "THING BROKE SRY"))

14:21 llasram: Some of these statements have a "when's on first" vibe going on

14:21 justin_smith: OK, just trying to be sure I have a more clear idiom for what I used to use "when" for

14:21 llasram: definitely

14:22 dnolen: cark: looking into it

14:22 technomancy: llasram: "c.c/when" helps

14:22 cark: dnolen: thanks !

14:23 stuartsierra1: `when` is (if condition (do body)) 'nuff said

14:23 bitemyapp: guys. Doesn't merit this much omphalophilia.

14:23 patchwork: RIP when-for-single-armed-ifs : (

14:23 llasram: When Wen went "when," "when"'s "do" didn't do what When wanted his "do" to do

14:23 technomancy: buffalo?

14:24 llasram: A much more versatile word

14:24 TimMc: navel-gazing, I think

14:24 devn: ^

14:24 technomancy: bitemyapp: I'm allowed to; it says so on my twitter profile =P

14:24 devn: "Mommy, how do I be perfect all the time?"

14:24 patchwork: Better than omphalophobia, so much unnecessary suffering

14:25 TimMc: Relatedly, how do folks handle the situation of logging conditions that are checked in an if or when? Here's something moderately gross: https://gist.github.com/timmc/7376199

14:25 It's annoying to split stuff out into a containing let.

14:26 bitemyapp: TimMc: bindings + AOP

14:26 if you want maximum evil.

14:27 Which I optimize for.

14:27 devn: heh

14:27 technomancy: TimMc: doto+prn \m/

14:27 justin_smith: not to be confused with doto pr0n

14:28 stuartsierra1: TimMc: `spy` ?

14:28 TimMc: Not for debugging, for production logging.

14:28 "I took this branch because..."

14:29 bitemyapp: TimMc: just need a if-logged

14:29 an if-logged*

14:29 llasram: Which parses apart boolean expressions in the conditional?

14:29 bitemyapp: TimMc: so that instead of the check macro, you pass three forms at the top

14:29 gfredericks: are there any good examples of libs using metadata for not-compiler-stuff?

14:30 technomancy: gfredericks: nrepl-discover!

14:30 bitemyapp: expr, true-log-message, false-log-message

14:30 then true-branch, false-branch.

14:30 technomancy: gfredericks: robert-hooke too

14:30 gfredericks: technomancy: let me back up; metadata on values, not vars/other-references

14:30 technomancy: gfredericks: leiningen test selectors

14:30 oh =(

14:30 llasram: gfredericks: I use metadata in abracad to annotate data structures with additional Avro-specific information

14:30 technomancy: who does that

14:30 TimMc: bitemyapp: In this case there are multiple reason for false.

14:30 technomancy: gfredericks: lein profile merges

14:30 gfredericks: technomancy: I did it in this haystack lib

14:30 technomancy: oh nice

14:31 TimMc: Oh, maybe this is a case for 3-armed if. :-P

14:31 bitemyapp: llasram: you have the most serious-sounding last name I have ever heard.

14:31 llasram: haha

14:31 bitemyapp: TimMc: oh, okay.

14:31 llasram: bitemyapp: Yeah, it may be a bit much. My wife and I are considering alternatives :-)

14:31 gfredericks: wat what is it? lasram?

14:31 laser-arm?

14:31 TimMc: Bockrath-Vandegrift

14:31 gfredericks: LL Cool. Asram?

14:31 llasram: gfredericks: Since marriage+hyphenation, yeah

14:32 technomancy: Vandebrock sounds cool

14:32 bitemyapp: llasram: oh, one of those is your wife's name?

14:32 gfredericks: llasram: marriage+hyphenation is maybe the worst last name I've heard all day

14:32 llasram: haha

14:32 bitemyapp: Yah

14:32 hlship: I spend my life a hotels, etc., explaining that "Lewis" is not my middle name, it's the first word in my last name.

14:33 TimMc: llasram: Alternatives for a baby name?

14:33 justin_smith: you'd think that now that now that we can have spaces in file / directory names this would extend simply to surnames

14:34 hlship: I remember an agument w.r.t. name validation with a client years ago. Said spaces were not allow; I grabbed my friend, Todd Van Hoosier, from the next cube as a counterpoint.

14:34 TimMc: Or just a name change for yourselves?

14:34 llasram: TimMc: Alternatives for something else to change our last name to. We were lazy and never made the name-change legal, so there's still time to decide to do something else

14:35 But yeah, Vanderbock, or Bockvand are in the running

14:35 technomancy: http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/ <3

14:35 bitemyapp: hlship: this is why when I make a form for names, it's a single unvalidated string field.

14:35 just... Name:

14:35 llasram: I liked the one about the people with the last name "Test"

14:35 bitemyapp: that's it. I'm not going to try to structure it because it's fucking impossible.

14:36 justin_smith: validation for anything humans attach significance to outside software is just silly

14:36 *structural validation

14:36 TimMc: bitemyapp: "How should your name be displayed on our site? ___ How should we address you? ___"

14:36 justin_smith: you can of course check that two things are equal, whatever

14:36 technomancy: "What do you mean we can't name our son after the empty string? it's our favourite data structure!"

14:36 bitemyapp: TimMc: username and name, right thur.

14:36 justin_smith: lol

14:36 TimMc: Depends on the site, but yeah.

14:37 bitemyapp: technomancy: you see an empty string, Perl users see endless POSSIBILITIES

14:37 TimMc: technomancy: Naing my firstborn U+FEFF

14:37 *Naming

14:37 bitemyapp: "" can mean anything you want to! Postmodern programming!

14:37 justin_smith: brb changing my name to #<Object java.lang.Object@243d81d5>

14:37

14:37 technomancy: bitemyapp: byte-order-mark hagelberg

14:37 hlship: bitmyapp: #37 is one of the primary reasons behind the Obamacare debacle, I suspect. The user facing web site is inconsiquential compared to the work to integrate all the dozens of differents systems and organizations involved.

14:37 bitemyapp: technomancy: I wonder how many times I've been reamed by an errant BOM

14:37 TimMc: You got BOMed.

14:37 dnolen: cark: oh, what cljsbuild are you using?

14:38 hlship: man, my typing is awful today

14:39 TimMc: bitemyapp: Did NLP for a year or so; BOM everywhere. :-/

14:39 cark: dnolen: it's 0.3.3 ...

14:39 jjido: TimMc: had an issue recently with a file starting with FEFF and containing FFFE

14:39 cark: dnolen: man i would hate to be bothering you for such silly problem

14:39 gfredericks: I have a babby in my lap right now; should I rename him before it's too much trouble?

14:39 dnolen: cark: yeah you definitely got to be on 1.0.0-alpha2, but there might still be problem, but please switch and try yourself as well

14:39 technomancy: gfredericks: at least perused the unicode multilingual plane before you do anything rash

14:39 TimMc: gfredericks: May I recommend something from the third listing from http://birdandmoon.com/naturenames.html ? :-D

14:39 llasram: gfredericks: Just rename the baby to one of the BOMs

14:39 technomancy: *peruse

14:40 cark: dnolen: i'll come back to you in a moment

14:40 justin_smith: gfredericks: I always say the future is ungooglable names - pick a name that is so search engine optimized that nobody will be able to find anything relevant in a search engine

14:40 bitemyapp: gfredericks: how's programming with a baby in your lap?

14:40 justin_smith: think ipad, brittany spears nude, download, local teens, that kind of thing

14:40 gfredericks: what is a BOM

14:40 bitemyapp: gfredericks: better or worse than programming with a cat?

14:40 gfredericks: byte order mark

14:40 dnolen: cark: k I can confirm it's an issue even w/ latest cljsbuild

14:40 gfredericks: justin_smith: okay so maybe PRISM?

14:41 justin_smith: http://en.wikipedia.org/wiki/Byte_order_mark

14:41 gfredericks: yeah, that is a good baby name

14:41 TimMc: justin_smith: Gender-ambiguous names are good too. That confuses gender-aware name-matchers.

14:41 technomancy: one weird trick fredericks

14:41 justin_smith: right

14:41 llasram: TimMc: My firstborn will now be named Hellbender, regardless of gender

14:41 TimMc: snrk

14:41 gfredericks: ooh what about naming with typos

14:41 justin_smith: free ipad smith

14:41 TimMc: Jhon Smith

14:41 gfredericks: I suppose that's hard to distinguish from stupid novelty spelings

14:42 bitemyapp: llasram: brilliant. I work with somebody named Alaric.

14:42 justin_smith: you could go with a meme that is guaranteed to be unkown and obscure in the future, but still full of irrelevant search results

14:42 shibe

14:42 cark: dnolen : indeed same problem with cljsbuild 1.0.0-alpha2, still works in 2014 and not in 2024

14:42 TimMc: A good first name would be "The", pronounced "tay".

14:42 bitemyapp: memes were a thing even in 1960: http://upload.wikimedia.org/wikipedia/commons/9/95/MAD-alfie-1960.jpg

14:43 gfredericks: TimMc: that has all the best attributes of names

14:45 dnolen: cark: I gotta run for a bit, it's very strange and I'm not sure it's not an issue w/ core.async, will probably need tbaldridge's help on this one

14:45 cark: dnolen: ok, thanks for your help

14:45 yazirian: It's pronounced as-WEE-pay!!

14:47 hlship: llasram: My friends were going to name their son "Rhys Danger Newman" but chickened out and now regret it (their parents discouraged them from "Danger is his middle name").

14:47 cark: dnolen: there is definitively something strange with require-macro and core.async, when i :refer alts! i get a warning, i have to refer alt! instead ...

14:48 bitemyapp: hlship: brilliant. What a lost opportunity.

14:48 dnolen: cark: alts! is not a macro

14:48 quile: hlship: I actually know someone who did give their child the middle name "Danger"

14:48 cark: dnolen: ah that would be why =)

14:48 technomancy: I have a friend who changed his last name to Danger

14:49 he actually uses Clojure

14:49 quile: ha

14:49 dnolen: cark: and you must require it from core.async same for <! >!

14:49 gfredericks: technomancy: I choose to assume you're talking about Tim Dysinger and will now change how I refer to him

14:49 technomancy: gfredericks: not gonna stop you

14:50 gfredericks: Middlename Lastname Firstname

14:50 trying to figure out the best name to instigate "Who's on first"-like conversations

14:50 dnolen: cark: core.async definitely needs to be updated for 2024 anyhow, it relies on some details that have changes around ns aliases and other things

14:51 cark: so you'll have to wait anyhow

14:51 cark: dnolen: righht, i fixed minimal example, and still does not work. No problem about waiting, was only giving a test run to latest clojurescript

14:51 patchwork: gfredericks: Just name him when

14:53 jemendja: hello

14:54 TimMc: gfredericks: Mymiddlename ...

14:55 gfredericks: "What's ___ ___"

14:55 dnolen: cemerick: hrm, did you handle the require-macros alias case in your patch?

14:55 gfredericks: maybe "What's Your Name"

14:56 then when somebody asks you the question you can decide whether to respond with "Yes?" or "Yes it is."

14:56 cemerick: dnolen: AFAIK, yes. I believe there was either a test case for that, or I added one. Been using :require-macros :as with good results since?

14:56 dnolen: cemerick: seems busted for me if I alias and do ::m/foo

14:58 cemerick: dnolen: oh, for keyword resolution. Hrm, I might be able to believe that. This is in a REPL, or in general?

14:58 dnolen: cemerick: doesn't work in a source file

14:58 TimMc: gfredericks: My First Name Has Three Words

14:58 cemerick: dnolen: file a ticket, assign it to me, I look into it this weekend

15:00 TimMc: "What's your name?" "My First Name Has Three Words" "Well, what are they?" "My First Name" "Yes, that's what I'm asking..."

15:00 dnolen: cemerick: done

15:02 cemerick: dnolen: thanks; I have something else for your consideration

15:03 dnolen: right now, ^:export on a definition of a scalar (e.g. `(def ^:export some-value 42)`) doesn't really work; GClosure advanced inlines the value in functions that reference the def, so any external set!'s on that property are effectively no-ops. I have a working patch.

15:04 This seems like a worthwhile fix/enhancement, but I know you have certain optimization objectives that it _might_ conflict with...

15:05 dnolen: cemerick: seems to that is GClosure bug

15:05 seems to me

15:05 cemerick: dnolen: I thought it was too, but ^:export currently isn't doing a couple of things it should be. Hashed it out on SO with a GClosure contrib.

15:06 My patch currently only makes changes to how non-defn symbols are exported, but we may want to apply the same thing to those as well.

15:07 e.g., the same problem would occur with a fn that returns an exported fn; the former will always return the same fn, even if the latter's property is set!'d

15:07 dnolen: cemerick: seems like a fine enhancement, we're not going to ^:export anything in core.cljs anyhow

15:07 cemerick: dnolen: OK, I'll put up a draft patch, add tests once you OK the general approach

15:26 Raynes: ibdknox: ping

15:28 danielszmulewicz: technomancy: ping

15:31 jjido: what is GClosure?

15:32 Raynes: Google Closure

15:32 $google google closure

15:32 lazybot: [Closure Tools — Google Developers] https://developers.google.com/closure/

15:35 jjido: is it Javascript?

15:37 mikerod: from the REPL can you get a defrecord/deftype/defprotocol to be written to a .class file?

15:37 - so that you could view it

15:39 gfredericks: Raynes: did you just tell some clojure code to search google for something called "google closure"?

15:45 danielszmulewicz: `lein uberjar`complains about not finding a dependency only present in the dev profile. I thought `lein uberjar`was excluding dev profile. What gives?

15:51 cmiles74: I wonder if the issue is that it's compiling, which requires the dependencies from the "dev" profile.

15:53 xeqi: danielszmulewicz: so its complaining about not finding a dependency you don't expect to be there?

15:54 danielszmulewicz: xeqi: Yes, I don't expect `lein uberjar`to complain about a development time dependency.

15:54 xeqi: I must be doing something stupid, though.

15:55 xeqi: I'm always confused with lein profiles

15:56 xeqi: Could not locate clojure/tools/namespace/repl__init.class or clojure/tools/namespace/repl.clj on classpath

15:56 cmiles74: danielszmulewicz: perhaps you accidentally referenced a development time dependency in your code somewhere. Thus at compile time it's reaching out for those functions.

15:57 danielszmulewicz: xeqi: Yes, might be. I'll check again.

15:59 cmiles74: Oops, sorry. Should have replied to you.

16:00 cmiles74: danielszmulewicz: :-P

16:00 danielszmulewicz: cmiles74: No. Definitely no reference whatsoever. However, `lein clean` fixed the problem.

16:00 `cbp: bitemyapp: bja never contacted you again? If not and you're busy that's ok. I'll take a stab at it this weekend. Move all the connection stuff inside the agent and some error handling for that right?

16:00 danielszmulewicz: That is not good.

16:00 justin_smith: danielszmulewicz: I have been seeing more and more of those

16:01 to the point that I make a ritual of lein clean now

16:01 danielszmulewicz: justin_smith: Sad.

16:01 justin_smith: yeah

16:02 technomancy: danielszmulewicz: that's why I added profile-level isolation to lein

16:03 so dev-time AOT can't affect deploys

16:03 danielszmulewicz: technomancy: That's excellent news. So I should upgrade to what?

16:03 technomancy: unfortunately it was too invasive for a point-release, so it defaults to being off, but you can (and should) enable it with :target-path "target/%s" in your user profile

16:05 danielszmulewicz: OK then. And it's available in Leiningen 2?

16:05 technomancy: yeah

16:07 danielszmulewicz: technomancy: :target-path "target/%s" Is this slash percent s? What is the meaning?

16:08 technomancy: danielszmulewicz: :target-path gets the current profile set spliced in with format

16:08 so when the uberjar profile is active, the target-path will be different from your regular dev target-path

16:08 that way it's impossible to have dev-time classes affect uberjars

16:09 danielszmulewicz: OK, and to confirm: that goes to system-wide user profile (~/.lein/profiles.clj), yes?

16:10 technomancy: right, unless you want to make extra sure everyone on the project is also isolating their own hacking too

16:11 danielszmulewicz: then you would put it in project.clj?

16:12 in that second case, I mean

16:12 technomancy: yeah

16:14 danielszmulewicz: technomancy: thanks a lot. I feel bad for complaining, you're so helpful. Leiningen feels sometimes like black magic.

16:15 technomancy: any time AOT is involved, things get yucky

16:15 danielszmulewicz: technomancy: I suppose.

16:15 technomancy: tough nut to crack.

16:16 technomancy: I actually included that profile isolation change in a release, but it broke existing workflows that hard-coded target-path =(

16:16 so it had to be rolled back

16:18 llasram: *guilty*

16:18 What do you recommend for not hard-coding the target path?

16:18 technomancy: llasram: look in the project map if possible

16:18 llasram: Hmm

16:19 Unfortunately the part of the meta-build which needs to find the uberjar is written in Ruby

16:20 But -- `lein pprint` maybe?

16:20 technomancy: yeah, that would work

16:21 I think the output of uberjar also includes the path written to?

16:21 yeah, best to use that

16:22 llasram: It does, but that's problematic for me, actually

16:23 Oh, but maybe has the same problems as running `lein pprint`

16:24 Yep

16:25 I'm building .debs using `fpm` under `fakeroot`. But I can't run `lein` under `fakeroot`. In my meta-build, the uberjar and the .deb building steps are separate `rake` tasks which actually end up running in separate processes

16:26 I guess I can stash the path from `lein uberjar` or `lein pprint` in an environment variable or something

16:33 bitemyapp: Any suggestions for how I could clean up this mess of a let body and cond? https://www.refheap.com/20613

16:33 I'm not really happy with that.

16:34 je: I have a project containing both clj and cljs using newest cljs version (0.0-2014). My project depends on a lib, depending on clj-http, depending tools.reader 0.7.7. This makes cljsbuild fail with "Unable to resolve var: reader/*alias-map* in this context" even though the cljs part doesn't use this lib.

16:34 I can come around this issue by patching clj-http 0.7.8-SNAPSHOT with tools.reader 0.7.10 and but it in my local maven repo, but is there a better other way?

16:35 dakrone: je: tools.reader is an optional dep for clj-http, you can exclude it

16:35 technomancy: boy, sure would be cool if you could read safely without an external dependency

16:35 =\

16:36 rrc: is there any more elegant way to handle this reduction which requires threding the accumulator? I really want to comp the two fns, but they take two args while returning only the accum http://git.io/zdO_OA

16:37 dakrone: technomancy: it certainly would, wouldn't it...

16:37 :P

16:38 :)

16:38 justin_smith: bitemyapp: that may or may not be clearer if you named the (and ...) values that cond is checking in the let

16:39 depends if those and conditions actually describe things with reasonable names I guess

16:39 rlb: If I want to autogenerate a bunch of sexps but don't want any symbol qualification, is there any better approach than just liberal use of ~'foo?

16:41 llasram: rlb: Auto-gensyms via e.g. foo# aren't an option?

16:41 justin_smith: (and many? map? (not coll?)) = map-into-many; (and many (not map?) coll?) = sequential-into-many

16:41 etc.

16:42 rlb: llasram: I want to generate, say (let [foo ...] (case ...)) for output to a file, with no namespace qualifications.

16:42 i.e. I don't want cloljure.core/let, etc.

16:42 clojure.core/let

16:43 llasram: I think bbloom's backtick will let you do what you want: https://github.com/brandonbloom/backtick

16:43 rlb: but I'd also prefer not to have to have (~'let [...] (~'case ...

16:43 llasram: ok, thanks -- I'll take a look.

16:45 TimMc: bitemyapp: core.match on [many? map? coll? one?] with values like [true true false _] :-P

16:45 bitemyapp: justin_smith: sorta.

16:46 TimMc: it really does beg pattern matching doesn't it?

16:46 TimMc: Almost.

16:46 je: dakrone: thanks it worked, I didn't know of :exclusions ... now I do :D

16:46 bitemyapp: I think it's a pretty clear case where pattern matching would be a boon.

16:46 TimMc: Or heck, maybe it does.

16:47 bitemyapp: the first (and many? map? (not coll?)) would turn into (given: [many? map? coll? one?]) - [true true false _]

16:47 TimMc: My suggestion started off as somethign awful where you would assign either a prime or 1 to each conditional and multiply them together, then dispatch on the product.

16:47 llasram: ...

16:47 bitemyapp: [true false true _] [false false _ true] [false true _ false]

16:47 TimMc: ...but not all conditions were used in each clause, so it actually evolved into something useful-ish.

16:47 justin_smith: TimMc: assign powers of two and dispatch on the sum

16:47 bitemyapp: jesus christ lol

16:47 dakrone: je: cool :)

16:48 TimMc: justin_smith: That's no better, right?

16:48 justin_smith: heh, at least with that one you can bit mask if you don't care about one of the conditions

16:48 TimMc: Oh wait, it would actually work...

16:49 bitemyapp: I'm using core.match, not the loony bitmasking solution :P

16:49 justin_smith: classic old school C programming

16:49 bitemyapp: but clever!

16:49 TimMc: Just give coll? and one? the same prime, since many? is always true for one and false for the other.

16:49 llasram: bitmasks are the best

16:49 * justin_smith wishes he wore a bitmask for halloween

16:49 danielszmulewicz: In my project, I have a java source file that I compile with `lein compile`and when I run my app with `lein run` or at the repl all is fine. Now I'm trying to do `lein uberjar` and it gives a java.lang.ClassNotFoundException when compiling the clj source file that references the java classes. How can I solve this?

16:50 TimMc: :-D :-D :-D

16:50 justin_smith: "I'm code from the '80s"

16:50 deech: Hi all, I'm using core.match and I'm having an issue where code that compiles (and loads) fine when I do `lein repl ...` fails to compile with a `lein compile`.

16:50 llasram: danielszmulewicz: Probably not the problem, but FYI Java compiles via the `lein javac` task, not `lein compile`

16:51 deech: Could this be core.match related or should I look elsewhere?

16:51 danielszmulewicz: OK, thanks. Will try this too.

16:51 llasram: danielszmulewicz: Which version of Leiningen?

16:51 danielszmulewicz: llasram: 2.3.2

16:52 llasram: Are you explicitly setting :prep-tasks ?

16:52 TimMc: justin_smith: I think this would work: https://www.refheap.com/20615

16:52 You do have to do masking, still.

16:52 danielszmulewicz: llasram: No. I should, right?

16:53 TimMc: ...in which case there's no purpose in using 5 for both coll? and one?, but whatever.

16:53 llasram: danielszmulewicz: Not unless you have something special. But if you were, and hadn't included `javac`, then you might get the error you're seeing

16:53 bitemyapp: wasn't there a Clojure library that randomly fucked with your code to verify test coverage?

16:53 danielszmulewicz: I'll try this :prep-tasks ["compile" "javac"]

16:54 bitemyapp: does anybody remember the name of that library?

16:54 TimMc: There's heckle in Ruby...

16:54 llasram: danielszmulewicz: I would actually counter-suggest that :-)

16:54 TimMc: That might get you closer in a search.

16:54 bbloom: rlb: the "template" macro (or template-fn function) in backtick is exactly what you want

16:54 llasram: danielszmulewicz: Do try `lein with-profile +uberjar pprint` and check :prep-tasks

16:55 bitemyapp: sadly "heckle Ruby clojure" didn't get me very far.

16:55 TimMc: bitemyapp: Alo, I feel there's an opportunity in your previous question to use a Karnaugh map macro.

16:55 bbloom: dnolen: in theory, clojurescript macros could use backtick to resolve symbols against the namespaces var ... i might implement that

16:56 * bitemyapp grins

16:57 TimMc: bitemyapp: Previous #clojure discussion: http://clojure-log.n01se.net/date/2012-01-29.html#11:02

16:57 dnolen: bbloom: hm, backtick is pretty small, wouldn't want to add a dependency but if you wanted to just get that code in ClojureScript sure

16:57 bbloom: dnolen: oh i wasn't proposing adding a dependency

16:57 bitemyapp: TimMc: I asked because I just did that (sabotaged the code to test the code breaks)

16:57 bbloom: dnolen: and the reader technically already does this

16:57 TimMc: ...and that points further back in the logs...

16:58 bbloom: in theory, i could tweak tools.reader & expose it the same was as backtick

16:58 dnolen: bbloom: yeah was gonna say, perhaps we can get this into tools.reader

16:58 danielszmulewicz: llasram: Why counter-recommend? Your initial hint did the trick. I Included :prep-task in the uberjar profile and now it works. The java source file was compiled before the clj source files, and I got my standalone jar wich launches fine. Kudos to you.

16:58 TimMc: Apparently abedra is the person to heckle to get a clojur eheckle tool.

16:59 llasram: danielszmulewicz: Oh, because the defaults should work just fine. Since they aren't, something else is going on. If you're happy where you are, I'll leave you to it though :-)

17:01 TimMc: ("Saboteur" or similar was the right keyword.)

17:03 `cbp: ^ You should write a Clojure version of Ruby's Heckle, a sabotage-based code coverage tool. Algorithmic, teaches you about Clojure, useful to others.

17:04 There's your project.

17:04 `cbp: hi TimMc ok

17:05 TimMc: clojurebot: A good project is a heckle clone for clojure (sabotage-based test-testing tool)

17:05 clojurebot: You don't have to tell me twice.

17:06 TimMc: I'm going to start storing project ideas in clojurebot.

17:06 `cbp: clojurebot: what is a good project?

17:06 clojurebot: No entiendo

17:08 danielszmulewicz: llasram: You are probably correct. But again, I hardly understand how to drive leiningen in a scenario with both java and clojure source files.

17:10 llasram: danielszmulewicz: It should mostly Just Work (tm). You need to set :java-source-paths, but that should be it

17:10 (well, and :source-paths, if you want java and clojure as subdirs under `src`, but you get the idea)

17:11 TimMc: clojurebot: a good project?

17:11 clojurebot: Huh?

17:11 TimMc: clojurebot: a good project

17:11 clojurebot: Gabh mo leithscéal?

17:11 TimMc: :-(

17:11 `cbp: nice

17:11 swarthy: danielszmulewicz: I just did that for the first time yesterday, use a java lib in clojure. https://github.com/technomancy/leiningen/blob/stable/doc/MIXED_PROJECTS.md helped me get it

17:11 TimMc: clojurebot: A good project

17:11 clojurebot: A good project is a heckle clone for clojure (sabotage-based test-testing tool)

17:11 TimMc: Aww, don't tell me it's case-sensitive...

17:13 danielszmulewicz: llasram: yes, java-source-paths was set. It's fixed now. And I don't know what the problem was. Yuck feeling.

17:13 swarthy: Thanks, that's what I should have read in the first place.

17:14 swarthy: danielszmulewicz: np, its not as complicated as it seems at first. Getting the directories right is the hard part, then it's easy.

17:15 danielszmulewicz: swarthy: Anything else besides keeping the directories separate, and properly referenced inj :java-source-paths and :source-paths?

17:16 seangrove: bbloom: Quite a bit of patience you showed on the hn thread

17:16 bbloom: seangrove: which one?

17:16 seangrove: bbloom: Any chance you'll end up the new Cognitect dev relations?

17:16 bbloom: heh, unlikely

17:16 seangrove: bbloom: Datomic Starter Pro

17:17 bbloom: i just want more people to build systems w/ rich's ideas in them :-)

17:18 seangrove: bbloom: Ah, sorry, dev. evangelist, obviously ;)

17:19 bbloom: if anybody wants to write me a check for schooling fools on the internet, i'll happily cash it

17:19 justin_smith: danielszmulewicz: your IRC client sends occasional control characters

17:20 seangrove: Well, thought it was nice of your to explain things the way you did

17:20 justin_smith: like  and  (they show up as ^\ and ^H in my client)

17:20 danielszmulewicz: justin_smith: Oh, really? I'm using Colloquy. What are you using?

17:20 justin_smith: erc / emacs

17:20 TimMc: I see it in irssi.

17:20 danielszmulewicz: justin_smith: Maybe I should too.

17:20 justin_smith: I saw: "justin_smith: Oh, really? I'm using Colloquy. What are you using?"

17:20 err, maybe you don't see the control char when I send it either

17:21 danielszmulewicz: justin_smith: No, I don't see it.

17:21 justin_smith: I saw: "justin_smith: Oh, really? I'm usi^\ng Colloquy. What are you using?"

17:21 just odd, I don't know

17:21 danielszmulewicz: Now I see.

17:21 justin_smith: I replaced the control char with the way emacs displays it, but as ascii

17:21 danielszmulewicz: Is it only me?

17:21 justin_smith: yup

17:22 danielszmulewicz: wow

17:22 llasram: Well, and justin_smith

17:22 justin_smith: when I do it intentionally :)

17:22 llasram: Yes :-)

17:22 danielszmulewicz: llasram: :-)

17:22 TimMc: Hmm, what's the correspondence between the displayed ^H and the actual code?

17:22 danielszmulewicz: so ERC is the recommended irc mode for Emacs, are there contenders I should examine?

17:23 seangrove: danielszmulewicz: irssi, of course

17:23 mtp: rcirc, circe

17:23 TimMc: Oh right, ^H is ASCII 0x08...

17:24 danielszmulewicz: I can't believe it's a level playing field. Surely there must be some understanding of which is the superior one? (snark)

17:24 justin_smith: TimMc: emacs says (when I investigate it) " character: C-h (displayed as C-h) (codepoint 8, #o10, #x8)"

17:24 good old m-x describe-char

17:25 seangrove: justin_smith: Also like M-x what-face

17:25 danielszmulewicz: Who recommended circe? Last update is 8 years ago.

17:25 seangrove: Different purpose, but found it pretty useful recently for fixing unreadable text that I've put up with for the past four years

17:26 TimMc: https://en.wikipedia.org/wiki/Caret_notation

17:26 `cbp: Well that wouldve definitely come in handy back when i was modding color themes

17:26 justin_smith: seangrove: describe-face?

17:27 seangrove: justin_smith: Also good, but ultimately I just use it with M-x customize-face

17:27 I suppose describe-face has a link right there though, nice.

17:28 TimMc: ^\ is apparently Field Separator

17:29 llasram: argh, JVM's lack of unsigned integers

17:34 TimMc: They're called chars. :-P

17:35 llasram: haha

17:35 Unfortunately not applicable to my immediate situation

17:35 TimMc: unsigned shorts

17:36 bbloom: aren't JVM chars 16 bits?

17:36 llasram: Oh man. I hope someone got K&R to put their signatures on a pair of short pants. Then that person could wear around their K&R signed shorts

17:37 dnolen: cark: figured out what was going on cutting a new CLJS release that will work with core.async now

17:38 TimMc: bbloom: Yes?

17:38 bbloom: er dir, you said short, not byte

17:38 ignore me

17:38 TimMc: Actually, I can't remember if you can do match on chars in Java.

17:39 justin_smith: ,(+ \a \b) ; will be an error

17:39 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.Number>

17:40 TimMc: Looks like if you try to do math on chars, the Java compiler upcasts them implicitly to int.

17:41 deech`: Hi all, using core.match I'm having an issue where my project fails to

17:41 build (with an IndexOutOfBounds Exception) on the first compile but

17:41 compiles and works on the second.

17:41

17:41 deech: Crap.

17:41 deech`: Sorry.

17:41 TimMc: ...but you can totally do ++ on a char

17:42 https://www.refheap.com/20617

17:42 Morgawr: mmm

17:42 ,(every? false? '())

17:42 clojurebot: true

17:42 Morgawr: ,(every? true? '())

17:42 clojurebot: true

17:42 Morgawr: is this a bug or intended or...?

17:43 TimMc: Intended.

17:43 Morgawr: what's the rationale behind this?

17:43 deech: Let me try again. I'm having an issue where some core.match code fails to compile with an IndexOutOfBounds Exception on the first pass but passes on the second and works fine. Has anyone seen this before?

17:43 TimMc: Morgawr: Can you find a value for which the predicate fails?

17:43 deech: Apologies for the noise before.

17:43 justin_smith: ,(every? even? []) ; Morgawr

17:43 clojurebot: true

17:44 Morgawr: TimMc: by docs "Returns true if (pred x) is logical true for every x in coll, else false." 'pred' is not true for every x because there is no x, I'd say it's ambiguous wording (I get what you're saying though)

17:44 justin_smith: Morgawr: it is the base case of a recursive function, when handed an empty sequence

17:44 Morgawr: justin_smith: that makes sense

17:44 how would I elegantly handle the case where the sequence might be empty?

17:44 TimMc: Morgawr: The predicate is "vacuously satisfied". "For every" is misleading.

17:44 Morgawr: TimMc: true

17:45 I just spent 2 hours trying to understand why my code was failing and this was the reason, very frustrating D:

17:45 justin_smith: (and x (every? pred? x))

17:45 (and (seq x) (every? pred? x))

17:45 that is the semantics you want I think

17:45 Morgawr: justin_smith: alright, thanks

17:46 TimMc: Morgawr: In first-order logic, "For all X, Y is true" is equivalent to "There does not exist an X such that Y is false"

17:46 Morgawr: TimMc: I hear ya

17:47 I mean, I understand what you're saying and it makes perfect sense

17:47 just that the docs should probably mention this, it can be frustrating

17:48 hfaafb: http://i.imgur.com/782Kl7u.png

17:49 justin_smith: ,(= Double/NaN Double/NaN)

17:49 clojurebot: false

17:49 TimMc: Morgawr: Base-cases, they're tricky.

17:49 Morgawr: TimMc: yup

17:52 justin_smith: ,(= Double/NaN)

17:52 clojurebot: true

17:52 justin_smith: another weird base case

17:52 (since it is the value that is not = to itself)

17:53 TimMc: I don't know if I'd call that a base case.

17:53 justin_smith: (= x) for any x is true

17:53 because it is a base case

17:53 ,(= Double/NaN Double/NaN)

17:53 clojurebot: false

17:53 justin_smith: ,(= Double/NaN)

17:53 clojurebot: true

17:53 TimMc: Oh, missed the unary execution.

17:55 justin_smith: since = is always true for one arg, as the base case of the recursion

17:55 TimMc: I'm annoyed that (=) is an error.

17:55 *That* should be the base case.

17:55 OscarZ: hi guys.. how u guys think Clojure is gaining up popularity ?

17:55 its a bit hard to judge

17:56 TimMc: E_BAD_PARSE

17:56 Are you asking if you think it is, or how it is? :-)

17:57 I keep hearing about it getting used in different places, and the channel has been growing, so those are evidence for growth.

17:57 OscarZ: maybe you have a good understanding of it as some of you have been on this channel for years.. i guess the activity on this channel is some kind of indicator

17:58 muhoo: wait for the clojure survey results to come in?

17:58 http://cemerick.com/2013/11/05/2013-state-of-clojure-clojurescript-survey/

17:58 TimMc: 673 nicks now; I think it was at 300-400 a couple years ago.

17:59 OscarZ: muhoo: thats exactly what i asked for :)

18:00 TimMc: I think thats good :)

18:00 Morgawr: clojure #1

18:01 OscarZ: would be interesting to hear from you guys of the good and bad things about Clojure.. whatever it was that you switched from

18:01 Morgawr: I switched from C haha, pretty big jump

18:01 OscarZ: most probably coming from Java, C#, python I'd imagine

18:01 maybe Ruby

18:02 TimMc: OscarZ: You should search for past years' surveys.

18:02 OscarZ: Morgawr: hehe i guess so

18:04 TimMc: I will surely check those out.. you dont have any personal experiences you'd like to share?

18:06 TimMc: Not in particular?

18:07 OscarZ: Thats ok.. reading up on the surveys.. interesting stuff..

18:08 bitemyapp: seangrove: there, questions are being answered.

18:09 OscarZ: the only thing I don't like about Clojure is that the type system doesn't do much to help you out. The other 99% I'm happy with.

18:10 dnolen: ClojureScript 0.0-2030 going out, mostly to address core.async issues

18:11 tbaldridge: bitemyapp: are you really complaining that a dynamic language doesn't provide type safety?

18:12 justin_smith: gfredericks: fnu lnu http://mobile.nytimes.com/2013/07/15/nyregion/unidentified-defendants-have-bedeviled-courts-for-decades.html

18:13 "At any given time there can be hundreds of Fnu Lnus in the court system."

18:13 seangrove: tbaldridge: Just sounded like he was mentioning a piece he misses

18:13 bitemyapp: Nice answer by the way, liked it a lot.

18:13 lpvb: on https://github.com/daveray/seesaw

18:14 it says replace version with the tag below

18:14 I don't see a version number

18:14 OscarZ: bitemyapp: what kind of problem is it usually in practice? is it that there isnt as nice code completion features in IDE or just that its easy to use objects of the wrong type?

18:14 justin_smith: lpvb: the version number is in project.clj

18:14 which is on the top level of the project

18:15 bitemyapp: tbaldridge: the world is not enough.

18:15 OscarZ: 80-90% of the errors I run into and have to spend time resolving could be caught by a proper type system.

18:15 OscarZ: that's true of most languages though.

18:15 lpvb: justin_smith: "1.4.5-SNAPSHOT"

18:16 do i use the whole string

18:16 justin_smith: lpvb: yeah

18:16 also, you can search clojars.org to see various versions available

18:17 https://clojars.org/seesaw

18:17 OscarZ: im not that familiar with language design.. but couldnt you have kind of optional type system.. you could enforce types on some functions?

18:17 tbaldridge: OscarZ: may I welcome you to #clojure, here you will meet bitemyapp a converted Haskell programmer who still pines the loss of his old love.

18:17 justin_smith: lpvb: that shows "1.4.4" being the most recent actually, that could be the newest actually built nad deployed

18:17 lpvb: justin_smith: clojars is where the dependencies come from?

18:17 technomancy: OscarZ: yes, you can. people are working on it, but it's still a work in progress.

18:18 justin_smith: lpvb: it is a repository that lein uses by default to find deps, yeah

18:18 but you can use others

18:18 OscarZ: tbaldridge: hehe.. im a long time Haskell lurker as well

18:18 from the other side of the static/dynamic language spectrum

18:18 technomancy: OscarZ: you can't have it as nice as HM on the JVM though

18:18 lpvb: how about that apache one that maven uses?

18:18 tbaldridge: OscarZ: and just to provided the opposite view. I've found that having to think about my program twice is quite annoying. Once to think about how to code it, once more to get it to fit a type system.

18:18 lpvb: does leiningen use that too

18:18 bitemyapp: OscarZ: I use Clojure and Haskell concurrently. It should be noted that I use Clojure, not Haskell, at work.

18:19 OscarZ: and that I find Clojure very productive. So the truth is more subtle than tbaldridge likes to paint it.

18:19 lpvb: clojure is my python as Haskell is to C++

18:19 bitemyapp: I end up thinking about my Clojure code at a type level anyway. "Twice" is meaningless. I just want to know what makes sense, what works, what doesn't, and reduce my TTS and TTF

18:19 OscarZ: thats an interesting combination

18:19 tbaldridge: bitemyapp: hey, someone has to add hyperbole to this channel, might as well be me.

18:20 bitemyapp: TTS: time-to-solution - TTF: time-to-fix

18:20 Morgawr: mmm.. I have a set like #{:a :b :c} and a map like {:a function :b function :c function :d function} (etc etc), I want to take all the elements in the first set and apply them to a variable x iteratively (like ->) based on their function in the map

18:20 bitemyapp: a compiler that can say something useful about your code and prevent whole classes of errors can improve both of those numbers.

18:21 Morgawr: so in that case it would be (-> x ((:a map)) ((:b map)) ((:c map)) )

18:21 how do I do this elegantly?

18:21 justin_smith: Morgawr: (map (apply juxt (vals (select-keys function-map key-set))) args)

18:22 bitemyapp: GOD DAMMIT

18:22 tbaldridge: (inc justin_smith)

18:22 lazybot: ⇒ 10

18:22 bitemyapp: justin_smith: I nearly had it.

18:22 tbaldridge: for use of juxt

18:22 Morgawr: (inc justin_smith)

18:22 lazybot: ⇒ 11

18:22 Morgawr: that's pretty damn great

18:22 OscarZ: if you write a function in clojure.. i guess you almost always have a good understanding of what the input should be... why not some kind of "ad hoc" validation patterns that the compiler could catch ?

18:22 Morgawr: thanks

18:22 bitemyapp: justin_smith: is map what he wants? not reduce?

18:22 justin_smith: hmm

18:22 bitemyapp: OscarZ: well that kinda happens. There's core.typed and there are runtime schema validators.

18:22 Morgawr: yeah probably reduce

18:22 justin_smith: depends what he meant by iteratively

18:22 Morgawr: they build on top of each other

18:22 like ->

18:23 bitemyapp: I was writing the reduce version, and you took the wind out of my sails :(

18:23 Morgawr: but yeah, just with that idea you gave me good points to work on, thanks

18:23 justin_smith: OK, I was close

18:23 technomancy: OscarZ: you can, but it's nicer when computers can do grunt work for you

18:23 bitemyapp: technomancy: you might almost think that was the point of computers...

18:24 rasmusto: computers deserve a break sometimes

18:25 tbaldridge: OscarZ: if I write a function, and I know what it should be given, why should I have to fit it into the validation pattern of the compiler. Now if I want to change the function, I have to change the validation pattern as well.

18:26 bitemyapp: tbaldridge: have you written code in an ML or Haskell?

18:26 benkay: ,ping

18:26 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ping in this context, compiling:(NO_SOURCE_PATH:0:0)>

18:26 tbaldridge: bitemyapp: yes

18:26 bitemyapp: tbaldridge: you're painting this picture of whips and chains that just doesn't happen.

18:26 S11001001: ugh

18:26 benkay: i'll take it

18:27 tbaldridge: bitemyapp: I would be interested in a Haskell/ML variant with a sexpr syntax. That's actually one of the worst turnoffs of those languages for me.

18:29 bbloom: tbaldridge: have you tried Shen? It's kinda in the Haskell/ML family of semantics

18:29 http://shenlanguage.org/

18:30 imok20: does anyone do simple, (cheap?) hosted datomic?

18:30 bitemyapp: tbaldridge: I'd be down for that too.

18:31 benkay: DaaS

18:32 jcrossley3: if i have a multi-arity function defined in a protocol, is it possible to define one arity in one map, and a different arity in another map, and then merge them somehow to pass to extend?

18:32 OscarZ: in those Clojure surveys theres exactly the same question I was after "What have been the biggest wins for you in using Clojure?"

18:32 interesting stuff

18:32 tbaldridge: imok20: you should probably read the Datomic Terms-of-Service (http://www.datomic.com/datomic-pro-edition-eula.html)

18:33 OscarZ: I think they should also add "minimalism, simplicity, reduction of cognitive load on irrelevant shit" as an option

18:34 imok20: tbaldridge: it looks as though it would allow for it, less the "cheap" request

18:34 benkay: all web-hosted EULAs should be hashed and have a link to previous versions.

18:34 Morgawr: justin_smith: ended up using (reduce #(%2 %1) state (vals (select-keys func-map func-keys)))

18:34 tbaldridge: imok20: read the Restrictions section, subsection (c) and (d)

18:36 imok20: tbaldridge: sub subsection (n) in the same subsection seems to indicate otherwise (given the definition for OEM in the Definitions section)

18:36 tbaldridge: imok20: the free version does quite a bit, and can be included in OSS projects. And then new Pro Starter version released today is free, and has many of the Pro features while still being free.

18:36 Ah yes, you can contact Cognitect and get a OEM license.

18:37 imok20: tbaldridge: certainly, but I'd just love someone to host datomic similar to how MongoHQ hosts MongoDB or Heroku hosts postgres

18:37 tbaldridge: Wow, that previous comment was poorly constructed on my part.

18:37 imok20: just makes things much easier. i'd like to not have to manage an EC2 instance of my own

18:37 tbaldridge: yes, that would be nice.

18:37 imok20: but no one does, i suppose? :(

18:38 tbaldridge: imok20: currently, no

18:38 technomancy: imok20: very risky to build a with that level of vendor lock-in

18:38 imok20: someone here: do this, i'll be y our first customer

18:38 technomancy: build a business

18:39 benkay: because we really need more MongoHQ-type organizations.

18:39 this tradeoff between convenience and quality is rarely actually examined

18:40 imok20: benkay: maybe so. however, i love to write application code and not manage servers; i don't have the time or interest in managing a db server myself, and when building a small product and testing it out, trying to raise some revenue, etc, having a hosted version is a wonderful thing.

18:42 justin_smith: Morgawr: nice

18:43 benkay: imok20: look into Orchestrate.

18:43 Morgawr: justin_smith: thanks for using juxt though, I learned about a great function today

18:44 my problem is that I keep forgetting about this stuff, I should write these down

18:44 OscarZ: whats the web development framework focus on clojure ? are there any clearly popular ones atm ? I noticed there is a framework called Pedestal by Rich Hickey & the guys ?

18:44 I did some experimenting on Ring a while back

18:45 Morgawr: OscarZ: pedestal looked interesting, it seems to be an aggregator of good clojure libraries/middleware for web dev, though I never tried any (not a web dev myself)

18:45 justin_smith: many people don't like "frameworks", there are a bunch of different libraries that people combine

18:45 ring, compojure

18:46 muhoo: benkay: immutable licenses?

18:46 imok20: benkay: That looks pretty interesting; I'd love to learn more about it. Signed up to their list. Do you know anything more about them?

18:46 OscarZ: There I first realized the beauty of Clojure... after wrapping up a simple CRUD application I was looking at the code and thinking... "is it all really there?" :D

18:47 Morgawr: ok .. I should probably check that out

18:47 justin_smith: OscarZ: http://www.luminusweb.net/ luminus combines a nice set of deps

18:47 OscarZ: I also used Datomic database in my testing which was cool too

18:47 muhoo: OscarZ: so far i've had that experience with three languages: scheme, python, and clojure. fun to have a 50-line program that is easy to understand and works.

18:47 like "whoa, really, is that all? that's it?" fun.

18:48 OscarZ: justin_smith: oh yeah, that sounds familiar too

18:49 Datomic with its Datalog query language was quite amazing too... messy SQL joins could be expressed much more elegantly...

18:50 not sure if it has some limitations that I dont understand

18:52 but these guys are onto something.. they have a programming language, a database (kinda) and a web framework, all built on functional programming concepts

18:52 maybe its the platform of the future :)

18:52 muhoo: THE FUTURE

18:53 OscarZ: anyway, have fun playing around with the stuff. looking at it and forming judgements on it is not as much fun as actually using it

18:55 OscarZ: muhoo: well.. i wasnt making judgements, just thinking aloud.. they are all cool and exciting technologies

18:56 just that I know from experience how much momentum the old shitty technologies can have :(

18:59 patchwork: Okay, clojurescript dom manipulation showdown: domina vs dommy vs enfocus vs singult

18:59 ! I can't believe there are already four contenders

18:59 Although is that because cljs is still new and a clear winner has not yet emerged?

19:00 Anyway, anyone have thoughts on which is best so far?

19:00 Leaning towards enfocus...

19:01 seangrove: patchwork: dommy, without a doubt

19:01 Enlive has its charm though, it's just a very different style

19:01 bitemyapp: (don't use enlive)

19:03 akurilin: bitemyapp, Should I not use korma's support for a naming strategy since that functionality is now deprecated in jdbc 0.3 ?

19:03 patchwork: jdbc naming strategy is deprecated?}

19:04 What do you do instead?

19:04 akurilin: https://github.com/clojure/java.jdbc/blob/3d3c402f65eb9db1fca055f1a0fe3d6db0889215/src/main/clojure/clojure/java/jdbc.clj#L1115

19:04 patchwork, I generally pass transformer functions into query/execute!

19:04 but now that I'm doing a hybrid with korma, was hoping to get away with that

19:05 in Korma right now you can have a bunch of translators when declaring a table, but I was hoping to get away with that at the DB declaration level

19:05 bitemyapp: I don't have any strong opinions here.

19:06 patchwork: So it is being deprecated without some kind of replacement functionality??

19:06 lazybot: patchwork: What are you, crazy? Of course not!

19:06 patchwork: lazybot: I wish you actually knew what you were talking about

19:09 prismatic blog is doooooooooooooooown

19:16 dnolen: huh with paredit and lispindent SublimeText 2 ain't so bad for basic Clojure coding.

19:20 muhoo: patchwork: i've played with dommy and domina and prefer dommy

19:21 patchwork: muhoo: I was trying to read about it but the site is down : (

19:22 This project already has domina involved for some reason, but I need to do some templating and domina doesn't have that

19:22 Is it too mad to have domina and dommy on the same page?

19:22 Seems excessive

19:23 And on the other hand, singult looks pretty cool: https://github.com/lynaghk/singult

19:30 akurilin: I guess I was mixing things up a bit. The DB-level naming strategy is just for key names, whereas table-level transform lets you change result set contents.

19:30 in addition to key names

19:31 patchwork: akurilin: RIght. I use the naming strategy quite a bit

19:31 I am sad to hear it is deprecated

19:31 akurilin: patchwork, yeah I'm completely obsessive over the whole underscore to dash translation thing.

19:32 so it's quite convenient for me

19:32 patchwork: akurilin: For awhile we had underscores for key names and dashes for everything else. It was maddening

19:32 the naming strategy was a godsend

19:33 bitemyapp: akurilin: I don't mess with any of the names or transform anything.

19:33 patchwork: bitemyapp: So you freely mix underscores and dashes?

19:34 bitemyapp: patchwork: using the word "freely" there makes an implication that isn't accurate.

19:34 More like, "carefully"

19:34 specifically, there's a distinction between what came from the database and what's internal.

19:34 patchwork: bitemyapp: Right. So you accept the mental load. Are you the only one working on the project?

19:34 bitemyapp: of course...it would be easier to track such things and keep them straight if one had a useful type system...

19:35 patchwork: I found I was able to keep track of it all, but when anyone else had to use it they suffered

19:35 It caused suffering

19:35 and Angst

19:36 seangrove: patchwork: Why are you explosing datgbase details to the rest of your code?

19:36 patchwork: seangrove: Not database details, but the maps that came back from queries were used in other places

19:37 Access to those keys used a different convention than every other name in the system

19:37 bitemyapp: patchwork: I'm not the only person.

19:37 patchwork: seangrove: At some point data from the db has to be used somewhere in code

19:38 seangrove: patchwork: I don't think we have any sql/db access outside of a few namespaces that provide the interface to get data for the rest of the system. So called "models", but not quite as much.

19:38 patchwork: seangrove: So at some point you translate those keys into some other structure?

19:38 seangrove: patchwork: Yes, external to those namespaces

19:39 bitemyapp: It's good to see I represent a non-trivial fraction of the support load for Cognitect.

19:39 devn`: So, I don't have a place to stay for the conj yet.

19:40 Not sure what I'm gonna do now. You may see me sleeping in the hotel lobby.

19:40 patchwork: seangrove: So you just translate them later rather than use the jdbc to translate them for you, in a way (without really knowing the details of what you are working on)

19:40 noonian: can i assume that (keys m) and (vals m) will always return keys and vals in the same order for a given map m? i.e. (zipmap (keys m) (vals m)) will always = m?

19:40 patchwork: noonian: No

19:40 noonian: lame :p

19:40 patchwork: thanks

19:40 bitemyapp: noonian: hey

19:41 patchwork: In practice they usually do, but clojure maps are semantically unordered

19:41 bitemyapp: noonian: don't rely on ordering in any form in unordered maps.

19:41 noonian: bitemyapp: yo

19:41 bitemyapp: noonian: k? k.

19:41 justin_smith: patchwork: but isn't the same map always deterministic?

19:41 noonian: thats what I thought

19:41 justin_smith: it's only deterministic when you add or remove a value, no?

19:41 patchwork: justin_smith: It is like undefined behavior in C

19:41 bitemyapp: wouldn't seq'ing over the map keep the keys and vals together?

19:41 patchwork: The implementation could change at any time

19:42 noonian: i think the question is really will (seq m) always give the same order for the same m

19:42 patchwork: and then if you were relying on that behavior your code would be broken

19:43 justin_smith: patchwork: so at some point there may exist a clojure version where (zipmap (keys m) (vals m)) is not equal to m

19:43 but afaik order is stable until you add or remove values

19:43 patchwork: justin_smith: Right… for now

19:43 devn`: If anyone 'round these parts wants to offset some of the hotel cost or is generous enough to share a room: I'm going to be out late most nights. If that sounds like something you could put up with, let me know.

19:43 patchwork: But semantically, it is undefined

19:44 So it is not something any self-respecting code should depend on

19:44 noonian: so zipmap is not for dealing with existing maps, but only for creating maps from seqs where you can count on the order

19:44 justin_smith: noonian: I think so

19:45 noonian: (defn keys-and-vals [m] (let [pairs (seq m), ks (map first pairs), vals (map second pairs)] [ks vals]))

19:46 justin_smith: also, if you want the keys and the vals you are likely better off doing something like (reduce (fn [[ks vs] [k v]] [(conj ks k) (conj vs v)]) [[][]] mp)

19:46 noonian: then zipmap with that lol

19:46 devn`: So, I realize there's no order guarantee for maps, but in a two element map, for all the tests I've messed with, I'm not getting any ordering issues.

19:46 justin_smith: my version only walks the seq once :)

19:46 devn`: Is it reasonable to expect the order won't be weird for 2 element maps?

19:46 noonian: devn`: yeah, but the map implementation will change depending on how large it is i believe

19:46 arraymap and treemap iirc

19:47 patchwork: devn`: Don't make any assumptions about order in maps

19:47 because at some point in the future your code will break and people will die

19:47 devn`: noonian: *nod* -- i have a huge list of maps that someone else wrote to a file. I could search and replace { -> [ and } -> ], but I was just curious if for 2 element maps I could get away with it, assuming the keys and values are all the same.

19:48 metellus: you probably could, but it would be a coincidence

19:49 * devn` generates 500000 maps of 2 elements with the same keys, and random right hand side values and does an (every? #(= :expected-key (ffirst %)) tons-of-maps)

19:49 noonian: devn`: well, if you care about the order of the key value pairs in the map i wouldn't, i don't care about order, just that for a given index in keys and vals they would belong to the same key value pair

19:50 but if it works it works :P

19:50 devn`: yeah, i care about order -- i should just quit beating this issue to death

19:50 patchwork: devn`: It may work now, but not in a month

19:50 devn`: im navel gazing

19:50 metellus: if you care about order why not use a sorted-map

19:50 noonian: if it works for you today and you trust it enough, i would do that then re-serialize it as a sequence :P

19:51 devn`: i just like working with maps before converting it back to CSV. but in any event, someone already posted a link to a flatland project which provides maps with order guarantees

19:51 so uhh, ill use that

19:51 metellus: because the headers won't match

19:52 unless i write them out by hand to match the sorted-map just before coercing maps bac to vecs

19:52 anyway, don't mind me, just trying to fit a square peg into a round hole

19:52 metellus: ah

19:52 devn`: because i really dislike treating csv rows like vectors

19:53 i like to zipmap and operate, and then coerce back to proper rows that clojure.data.csv expects

19:53 dnolen: super newbie friendly post on ClojureScript http://swannodette.github.io/2013/11/07/clojurescript-101/ using mies

19:53 feedback welcome

19:53 devn`: dnolen: I loved your last post

19:53 I didn't know about mies

19:53 dnolen: devn`: just trying to make it easier for people who just want to try it without going through config hell

19:54 devn`: dnolen: a couple of my coworkers have been tinkering simply because of your last post

19:54 dnolen: devn`: that's great to hear!

19:55 bitemyapp: devn`: you don't like destructuring vectors?

19:55 devn`: weirdo :)

19:55 dnolen: is there a "mies" for piggieback/austin?

19:55 devn`: bitemyapp: there are a TON of columns

19:55 bitemyapp: devn`: sad-face. Gotcha.

19:56 devn`: bitemyapp: this is basically just me doing ETL in clojure

19:56 dnolen: bitemyapp: haven't tried piggieback/austin yet, but there probably should be - Lein templates are really cool

19:56 devn`: so it's nice to dissoc, assoc, etc. to combine with another giant CSV

19:56 but that messes up order

19:57 dnolen: feel free to give my post some HN love

19:57 bitemyapp: dnolen: a lot of the pain people have with cljs centers around trying to get the interactive workflow working reliably in piggieback/austin.

19:57 dnolen: upboated :)

19:57 devn`: dnolen: one note. even if you don't have mies you can just run the command, right?

19:57 dnolen: bitemyapp: sure but that's for someone else to solve - I got enough tutorials to write of my own.

19:57 devn`: that is correct

19:57 devn`: The way you write "you can follow along if..." makes it sound like it's a prerequisite

19:58 I think it's good to explain what it is though

19:58 dnolen: devn`: good point removed

19:58 devn`: err you don't say "if" you say "by"

19:58 i like that you explain what it is though, because otherwise im like: "why does lein mies work?"

19:59 justin_smith: devn`:

19:59 ,(->> rand repeatedly (partition 4) (take 20) (map (juxt identity #(apply hash-map %))) (map #(map (comp flatten seq) %)) (map #(apply = %)) set)

19:59 clojurebot: #{true false}

19:59 justin_smith: sometimes it works, sometimes not

19:59 for two element maps

19:59 devn`: justin_smith: i've moved on. I'm just lamenting facts of life.

19:59 justin_smith: ok, I was actually surprised to see evidence that even with two elements the ordering would sometimes change

20:00 devn`: yeah, it was a little surprising to me as well -- i don't recall seeing those things switch order on the REPL ever

20:00 noonian: thanks dnolen, i'm hoping to dive into core.async shortly in cljs

20:00 bitemyapp: justin_smith: Science. I like it.

20:01 patchwork: justin_smith: For your next experiment, dereference an uninitialized pointer in C

20:01 justin_smith: sure thing

20:01 result: #{crash, nothing, wtf}

20:02 patchwork: I love undefined behavior

20:02 doctorinserenity: Are there reasonable ways to print edn with tagged types or should I just not bother with that for now?

20:03 justin_smith: doctorinserenity: doesn't every edn input unambiguously result in a single type?

20:04 that is to say, when would the reader find any type ambiguity in edn input?

20:04 doctorinserenity: justin_smith: edn input works fine, I'm asking about outputting it

20:05 justin_smith: the point being the read will be deterministic, so why tag the output?

20:05 or do you mean tagging in the function producing the output?

20:07 dnolen: noonian: nows a good time things are getting solid

20:07 doctorinserenity: say you want to send some edn to an API using tagged types for convenience

20:08 justin_smith: an edn reader will always get the same types from the same edn

20:08 no tagging needed - so you want tagging in the input function that uses the edn, not the edn itself

20:09 doctorinserenity: justin_smith: not sure what you're getting at

20:09 justin_smith: type tags help functions not dispatch at runtime

20:10 nothing in the edn file itself will prevent the edn reader from dispatching at runtime

20:10 because it generates multiple types by definition

20:11 *help methods not dispatch at runtime

20:13 bitemyapp: Just released the first public version of my Datomic migration toolkit: https://github.com/bitemyapp/brambling

20:13 justin_smith: doctorinserenity: also, more to the point, edn has no facility for metadata https://github.com/edn-format/edn

20:14 doctorinserenity: by tags I mean user defined types

20:14 not metadata

20:14 justin_smith: oh shit, sorry

20:15 doctorinserenity: it seems like a nice idea and easy to use as long as you're reading edn

20:15 but a mess when producing it

20:16 bitemyapp: https://news.ycombinator.com/newest I too, have something that I would like upboats for :)

20:16 justin_smith: doctorinserenity: java.util.Date prints out a readable edn tag

20:17 doctorinserenity: justin_smith: I know

20:17 justin_smith: so there is likely a way to specify a to-string that is edn readable

20:18 akurilin: Ah, you can't with-redef defn- functions huh?

20:19 justin_smith: doctorinserenity: another lead is that pr-str results in the readable forms of things, while str does not

20:20 doctorinserenity: and for that, you want to extend the print-dup multi-method for your type

20:20 I had to do some digging for that one

20:25 doctorinserenity: justin_smith: thanks!

20:25 justin_smith: np, sorry I misunderstood at first

20:37 ToxicFrog: What in the entire hell is this

20:37 If I run my program with 'lein run', it works fine

20:38 If I 'lein uberjar' and then run the jar, the output is truncated

20:38 ...but only if I have it output to stdout

20:39 If I explicitly (.close *out*) it's fine.

20:41 Raynes: gfredericks: Yes, I did.

20:45 xeqi: ToxicFrog: makes me think you are using a library that doesn't (flush) out when you expect it to

20:46 ToxicFrog: xeqi: the surprise is that OS doesn't flush on exit()

20:46 lpvb: seesaw is much easier than my implentation of swing abstraction. I should avoid reinventing the wheel

20:47 earle: hi

20:53 lpvb: I need to have an integer scale factor for my gui, so I need a mutable variable to hold the scale factor, how do I do that in clojure?

20:55 justin_smith: lpvb: you can use an atom and swap! or reset! to update it

20:55 ea-: why not just make a function to determine scale?

20:55 or set! an atom

20:56 justin_smith: ea-: you may be thinking of reset!, set! does not working atoms

20:56 *work on

20:58 ea-: yeah reset!

20:58 justin_smith: I like how talking about atoms makes us seem so excited

21:03 akurilin: Is there any way I can profile a clojure.test run to see which exact call the system is hanging on?

21:04 As in, something I'm calling is intermittently taking forever.

21:04 amalloy: akurilin: if it's hanging, you can use jstack

21:04 justin_smith: akurilin: you could connect with jdb or cdt to see where it is in the stack

21:05 amalloy: cool, I did not know about jstack

21:05 akurilin: To be accurate, it's something that occasionally takes an extra 10 seconds to run as opposed to 0. I originally thought it was wrap-session running out of entropy, but I'm not so sure now.

21:05 Hence I'm thinking profiling rather than an actual debugger, unless I can break at the right time

21:06 justin_smith: yeah, that does sound like a job for proper profiling

21:06 jvisualvm is a simple way to do that

21:07 akurilin: justin_smith, I'll look into that, thanks.

21:07 justin_smith: akurilin: the trick with jvisualvm is you may need the process to be open but not running so you can connect and profile a few runs - so your best bet would likely be to run the tests from the repl (start repl; connect and turn on profiling; run tests from the repl a few times)

21:08 akurilin: justin_smith, got it, makes sense.

21:21 Is Korma's prepare a reasonable place to convert joda to sql.time?

21:31 gfredericks: akurilin: you might be able to avoid converting altogether

21:31 if korma has a protocol or something

21:32 akurilin: gfredericks, something along the lines of cheshire's custom serialization?

21:33 gfredericks: yeah

21:34 I've done that with korma before but A) I think it took patching and B) that was a long long time ago

21:41 bja: in cljs am I allowed to have a namespace with only the ns definition and a defmethod?

21:41 trying to figure out why my defmethod doesn't exist in the output js

21:46 it seems that unless I actually refer to the namespace with just a defmethod in it, it isn't picked up by the cljs compiler

21:46 has anyone else encountered this behavior?

21:49 amalloy: bja: you have to require the namespace at some point, or the code won't be loaded at all. in that case there will be no method defined, of course

21:54 bja: amalloy: thank you. that makes complete sense when I consider it that way.

21:54 muhoo: is there any special magick required to get source maps in cljs with austin/nrepl stacktraces?

22:07 seangrove: muhoo: You mean inside of nrepl.el, or in the browser?

22:15 irctc: hello,

22:16 I have a one page webapp written in cljs

22:16 and im having performance problems

22:16 any advice?

22:16 bottleneck is data structiure manipulations for vectors, maps, sets

22:16 structure*

22:17 ea-: url?

22:17 clojurebot: something

22:17 irctc: only running locally at the moment

22:18 I'm looking for general

22:18 clojurescript perf advice

22:20 seangrove: irctc: Profile, possibly drop down to using native Javascript objects

22:20 Probably don't need to do that, but with such a vague problem, really can't help much

22:20 irctc: I've identified the actual problem in my case

22:20 i'm adding data to a large map

22:21 I'm looking into using transients

22:21 or just dropping into js

22:21 dee5: Hello, how do I represent the space character?

22:21 irctc: but any general pointers would be nice before i get started

22:21 on the server i would just stick on type hints and call it a day

22:22 dee5: nevermind (:

22:23 seangrove: irctc: Not sure at all, but sounds like it'd be vary useful for the rest of us if you documented your experience

22:27 irctc: Also, are you testing performance with advanced compilation?

22:53 akurilin: bitemyapp, I think you were saying something about defn- the other day.

22:54 bitemyapp, is it possible to still override a function in a different namespace if it's defined with defn-?

22:54 Shiro-Ichida: So, I'm new to Clojure. I installed lein and made a new project. I can run the main with lein run but if I do lein repl it gives me an exception, java.net.ConnectException: Connection timed out: connect

22:55 akurilin: More specifically, I'd love to override default-fk-name to be able to support the users -> user_id FK scenario

22:55 jared314: Shiro-Ichida: what OS?

22:55 Shiro-Ichida: I looked online and apparently you can increase the timeout, so I tried that, but it didn't seem to do anything.

22:55 Windows, installer.

23:20 dobry-den: I had to yakshave so far back to implement some elliptic curve math that i was watching a 7th grade classroom youtube vid on slope-intercept form

23:21 scary

23:54 gtuckerkellogg: trying out cider, but it seems not to work :(

23:54 muhoo: seangrove: in nrepl.el

23:55 akurilin: you could do alter-var-root stuf, i think, but it sounds sketchy and monkey-patchy to me

23:56 seangrove: gtuckerkellogg: Yeah, it's not ready. I don't know what the idea with the change was, but Cider is rough around the edges. If you're not already very comfortable with nrepl.el, I wouldn't recommend the switch.

23:56 gtuckerkellogg: i was comfortable with nrepl

23:56 but cider -- which i'm enthusiastic about -- gives me a REPL buffer but no prompt, in the simplest demo context

23:58 my inferior-lisp-buffer is nil

23:58 bitemyapp: akurilin: it's possible to override private vars. Don't.

23:59 akurilin: bitemyapp, so my option is to fork it?

Logging service provided by n01se.net