#clojure log - May 15 2016

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

0:44 idev: are there pure java solutions for pdf -> list of glyphs and pdf -> list of pngs?

0:44 I don't want to use external programs like ghostscript

0:44 I want to use the jvm for security as well

0:45 as an extra layer between a malicious pdf and my os

1:12 MadRaven: .....a..aaaaaaaaaaaaaaAAAAAAAAAAAHHHHHHH!

1:13 Sorry, just fell from the sky.

1:13 Damn it, Hunter X Hunter, stop distracting me!

1:16 Lol. I changed my "Message Send" sound to Heavy Weapons Guy saying "POOTIS"



1:17 Lol, so every time someone chats, on my end it says "POOTIS"

1:18 Heh. TF2. Funny stuff.

1:34 xtreak: I am a clojure newbie. I went through clojure for brave and true. Are there any idiomatic repos to study like flask, requests for python?

1:36 shiranaihito: xtreak: the clojure core would be one good example, i suppose

1:36 xtreak: Thanks. Its very complex I heard last time for a newbie. I am looking for beginner friendly repos.

1:37 shiranaihito: well, at least the clojure core is idiomatic :) i'd say the learning curve for clojure is kind of steep, but i believe it's a very good choice for a language overall

1:38 i'm not sure "beginner friendly idiomatic clojure code" exists :) but maybe we're thinking of that in different ways

1:40 (like, if clojure code tends to feel quite inscrutable to a beginner, but it's just the way it is even when it's idiomatic)

1:42 xtreak: I would like to learn idioms but when the code contains a lot of deep walking macros and stuff it will be little confusing. Its more like code that is interesting and simple and not daunting.

1:42 shiranaihito: yeah

1:43 xtreak: Sorry for being too verbose i too couldn't get u a clear picture.

1:43 shiranaihito: good point :)

1:43 i'm like an intermediate clojure user myself

1:44 and at least for me, it was difficult to see what's going on in clojure code, especially when starting out

1:44 xtreak: Perhaps u could share the steps u did and it will help me

1:44 shiranaihito: it still often is.. maybe that's just part of the package, or maybe i'm just not advanced enough yet

1:45 well, i just kept trucking along, trying to figure out how to use stuff :) and at some point i realized i was writing clojure in an acceptable way :)

1:46 i don't know about "steps" though

1:46 btw, don't worry about macros yet :)

1:46 xtreak: Any repos u looked into for studying? Do u have some stuff u implemented in github or somewhere i can look into..

1:47 shiranaihito: it seems the general consensus is that macros should only be used when you *really* need to, anyway

1:48 elvis4526: shiranaihito: I'm curious, which languages are you coming from ?

1:48 shiranaihito: elvis4526: i started out with Java (EE) and web stuff (including JavaScript), then moved on to Python, and then moved on from Python to Clojure

1:50 xtreak: i'm afraid i don't know where you should look for inspiration.. but let's say.. at least *parts* of the clojure core should serve as a good example of idiomatic clojure code :) there's bound to be some code that's not doing anything *too* fancy :)

1:51 xtreak: oh, and you should probably watch Rich Hickey's videos, if you haven't already

1:51 that might help you get into the "right mindset" for producing idiomatic clojure code

1:51 xtreak: Macros seemed interesting to me. I am an emacs beginner who started using it due to fuss abt lisp :) I looked into a half of sicp.. I thought clojure will be gud

1:51 shiranaihito: (though yeah, that's vague and even i'm not sure what it might mean in practice :P)

1:51 xtreak: check out "Cursive Clojure" the IDE btw

1:52 yeah, Clojure is good :)

1:52 xtreak: I looked some of the videos of rich with simple made easy and some of his talks on intro to clojure videos for java programmers

1:52 shiranaihito: it's a practical lisp, suitable for actually getting stuff done etc

1:52 yeah

1:53 oh btw, maybe you can check out David Nolen's code, from Om Next etc

1:53 i haven't seen it, but it's bound to be idiomatic :)

1:53 elvis4526: That's interesting. I'm doing the opposite (to have more jobs opportunities) and I find the situation very frustrating.

1:53 xtreak: I looked into D too.. So a little confused over D or clojure as they are very much contrary and walter is also my inspiration..

1:55 Yes. I looked into core.logic tutorial by nolen which was mind bending and introduced me to prolog. Seems sicp has a last chapter on logic programming. Yet to look into that.

1:55 shiranaihito: elvis4526: my contract job is with Java, Ruby, JS, etc :)

1:55 i've just settled on clojure for my own stuff

1:55 xtreak yeah.. there's a shitload of stuff to learn about clojure :) but it's a pretty damn powerful toolset

1:56 the main problem with clojure is the baggage it inherited from java.. all those pointless apache commons libs from 1999 or whatever being dragged around, in all projects all over the world.. it's madness

1:57 elvis4526: Cool. That's why I started to brush up my JS skills - way bigger market for jobs compared to Clojure. Did a bit of Ruby too a long time ago and I never really did any Java.

1:57 shiranaihito: it's good to know JS for sure

1:57 i don't like Ruby though.. and i can't even really use it

1:57 it's too magical etc

1:58 Java 1.8 is pretty good btw

1:58 much less painful with anonymous functions etc

1:59 xtreak: Yes. Streams, filters and maps are delicious :)

1:59 shiranaihito: though i was never a "Java hater"

1:59 yeah :)

1:59 elvis4526: I remember I had this feeling about Ruby too. The situation is similar to most Clojure DSL I had to use.

1:59 shiranaihito: elvis4526 yep

1:59 elvis4526: The magic is nice when it works, but macros are harder to debug when they broke. :(

2:00 shiranaihito: i suppose Java still has the most job opportunities, if that's what you want

2:00 xtreak: I primarily work on Python but with this java 8 seems more functional than python..

2:00 shiranaihito: yeah! :)

2:00 that's true

2:00 Java 1.8 basically surpassed Python in that way

2:01 oh did you see this btw: https://medium.com/spritle-software/rails-5-activerecord-suppress-a-step-too-far-d7ec2e4ed027#.8mwc6zs83

2:01 that's kind of disturbing

2:01 i'm glad i never went with Ruby

2:02 elvis4526: shiranaihito: Yeah probably, but Javascript was the best compromise I could make between fun and still being a marketable skill.

2:02 If you wouldn't need Eclipse or Intellij to have a great dev experience with Java, I would probably have tried Java 1.8 for some projects.

2:04 shiranaihito: elvis4526: IDEA is the best IDE out there

2:05 it's very much worth using, and not only just for Java code, but everything else it gives you

2:05 and as for Rails.. i've seen a couple of people say it's basically developed for Basecamp

2:06 it's just surprising that DHH seems to want Basecamp to be a rickety mess of inter-dependent state :)

2:07 but yeah.. try IDEA.. :) Java (1.8) is a pretty damn solid foundation for serious software too, btw

2:07 if i had to choose between Python and Java, i'd go with Java.. easy choice

2:08 elvis4526: Yeah I remember trying WebStorm couple months ago... The JS and TS support was nice, felt a bit heavy only to do web dev.

2:10 shiranaihito: elvis4526 their language-specific IDEs are a bit like plugins for IDEA.. it's not quite that simple, but relatively close

2:11 for example, they have a Python plugin for IDEA that provides pretty much the same functionality as PyCharm

2:11 elvis4526: i thought the plugins for idea were the same as the standalone versions

2:11 shiranaihito: i'd say IDEA is the best choice because it gives you (just about) everything JetBrains has to offer

2:12 yeah, roughly the same, afaik

2:12 but with IDEA you can work with eeeeeeeverythiiinngg.. :P

2:12 elvis4526: You must find Clojure syntax to be super light if you're coming from a Java background. :-)

2:13 shiranaihito: so like.. Java, Python, Ruby, SASS, CSS, JS, HTML, Spring config files, Hibernate config files, Clojure (through Cursive), SQL, and lots of other stuff i can't think of :)

2:14 elvis4526: They got a Scala plugin too.

2:14 shiranaihito: yeah, Clojure's syntax is neat :) but i was never that bothered by Java's verbosity

2:14 yeah, that too.. and.. YAML! :) and JSON ofc, and and and.. everything :)

2:15 but basically IDEA will help you work with just about anything that's not Microsofty or "too esoteric" :)

2:16 and it's got really good support for the most common things and languages

2:16 no fiddling with external tools.. just get shit done

2:18 elvis4526: Yeah - I think I'm too used to emacs to change anything in my dev environment. :-)

2:18 I like external tools - thats one of the thing I like in JS. How most of the tooling isn't coupled to an IDE.

2:20 shiranaihito: oh? :) i for one resent having to fiddle with more or less half-assed Node-based tools to get anything done with React etc

2:21 i don't see a problem with "tooling" (or maybe more like "functionality") being coupled to an IDE, especially when the IDE is IDEA :P

2:21 then you've just got pretty much the best support out there for everything you're working with

2:22 it's got lots of code-quality-improving suggestions too

2:22 for example, with JavaScript, it points out when you're probably using "this" wrong

2:23 and it points out when some if-statements can be simplified etc.. there's just so much stuff it does for you..

2:23 elvis4526: I think you can write tools that are both modular and well written.

2:23 shiranaihito: sure :p

2:23 elvis4526: This sounds a lot like a linter to me.

2:23 shiranaihito: i'd imagine it's more than a linter

2:23 or maybe it's a "linter on steroids" or something :P

2:24 elvis4526: Yeah I don't think JSHint & co have this kind of feature.

2:24 shiranaihito: either way, the suggestions are often actually useful

2:24 (IDEA has often been right about me using "this" wrong :P)

2:24 some of the suggestions are really detailed too

2:24 and come with a brief explanation of what's wrong etc

2:25 basically, using IDEA has made me write better code overall :)

2:27 elvis4526: I feel like a good type system will help you more to write good code then any IDE.

2:28 Working with clojure for an extended period of time made me hate dynamic languages.

2:28 shiranaihito: oh?

2:28 can you think of an example of the problems you experienced?

2:30 elvis4526: Null handling

2:31 shiranaihito: moar detail plz :P

2:31 i think Clojure is pretty good with nulls.. lots of stuff just returns nil when given nil, and so there's no explosion

2:31 ben_vulpes: map access returning nil

2:32 compile-time function arity checking

2:32 the former added 2 hours to a mega refactor at the end of last week

2:33 specifically on the merge of the refactor into a wip branch

2:33 shiranaihito: sounds interesting :) .. so what happened?

2:33 ben_vulpes: i fixed it?

2:33 shiranaihito: "because X we didn't realize thaT Y and so Z" .. ?

2:34 so maybe something like what were those 2 hours spent on, and why etc

2:35 ben_vulpes: an entire tree-shaped data structure had its keywords swapped out for a new data structure design (rewrote a large swath of domain model in datomic, so all the entity keys changed, naturally), and several wip view functions i'd not written tests for before embarking on the refactor happily passed nils down into their calleees

2:37 ,(let [{:keys [foo]} {:bar :baz}] foo)

2:37 clojurebot: nil

2:38 ben_vulpes: you may see how that would silently fail at runtime in all sorts of hilarious ways, under all sorts of conditions.

2:38 these were functions whose signatures i'd written, but not bodies yet

2:39 signatures mostly along the lines of [conn user notification-id response-id]

2:39 schema could theoretically help here, but i've not put the time into making schema definitions for my datomic entities because in part the codebase is in such flux right now

2:40 which is the classic justification for not using a typed language, right?

2:40 plenty of tests for desired behavior though

2:40 shiranaihito: so.. some functions took "foo" that was nil because there was no value for it in a map, and.. something bad happened?

2:41 ben_vulpes: well, it's not bad until it goes to production

2:41 in my opinion

2:41 just a boatload of bookkeeping that i think the compiler and friends should handle for me, because i'm lazy and have a small working memory.

2:42 shiranaihito: hmm

2:42 i'm not saying there was no problem, but i still don't see what exactly it was

2:43 ben_vulpes: oh i just want the language to do more for me than it does.

2:43 shiranaihito: so if you ask for the value for a key that's not in a map, you get nil..

2:43 ben_vulpes: i want an exception

2:43 "so write that getter yourself!"

2:43 yes yes

2:43 shiranaihito: and then if you pass nil on to some funcs that need something else.. then.. they don't do what you'd expect? :) but the funcs could check that they have something, or something?

2:43 ben_vulpes: sure

2:44 three more lines of code in each function, why not

2:44 elvis4526: shiranaihito: Some functions can throw a NullPointerException if you pass them nil. Like + for example.

2:44 ben_vulpes: shiranaihito: it's a symptom of a class of things i don't think i should have to deal with myself. but like i said, i'm lazy and have a small working memory.

2:45 shiranaihito: but.. when do you want an exception?

2:46 elvis4526: I don't want exceptions :(

2:46 shiranaihito: elvis4526 ah, right.. well, i thought i was talking to Ben :)

2:46 he says he wants one :)

2:46 ben_vulpes: shiranaihito: during development

2:46 when i run my tests

2:47 shiranaihito: ben_vulpes: yeah, but under what kind of conditions? when you're (unknowingly) giving nil to something.. anything?

2:47 ben_vulpes: sure i see what you're saying

2:47 and i refuse to answer directly

2:47 jortiz71: Schema looks nice.

2:47 ben_vulpes: map access for nil values would be neat

2:47 ,{:foo nil}

2:47 clojurebot: {:foo nil}

2:47 ben_vulpes: ^^ that also feels weird to me

2:47 shiranaihito: ben_vulpes: i'm not aware of saying anything in particular with that :P i'm just trying to figure out the problem

2:47 ben_vulpes: such however is life under a bdfl

2:48 shiranaihito: shit's floppy, man.

2:48 i want less floppiness.

2:48 elvis4526: Most of the time I ended up using the some-> macro which short-circuit the pipeline of functions if any of them returns nil

2:48 ben_vulpes: or the ability to impose rigidity.

2:48 shiranaihito: so.. you want.. Haskell? :)

2:49 ben_vulpes: dude

2:49 shiranaihito: elvis4526 yeah, some-> is handy

2:49 ben_vulpes: the world is not a binary place

2:49 shiranaihito: ben_vulpes well, what do you refuse to answer directly (and perhaps.. why? :p)

2:49 ben_vulpes: just because i want rigidity does not mean haskell is a viable solution

2:49 because the answer to your specific questions are pointless

2:50 i'm painting a larger picture

2:50 shiranaihito: so far i'm under the impression that you want an explosion when something you don't want to receive a nil *does* receive a nil?

2:50 ben_vulpes: it would be nice to be able to specify that a function should never take a nil

2:50 shiranaihito: the point might be just to satisfy my curiosity, and to participate in the conversation :)

2:50 ben_vulpes: "p-preconditions!"

2:51 oh i am participating in the conversation.

2:51 shiranaihito: ok.. and you'd like the compiler to figure out when some specific function would end up taking a nil?

2:51 ben_vulpes: that'd be a nicety, certainly

2:52 jortiz71: How about using a language that has no nil?

2:52 elvis4526: shiranaihito: Yeah, I actually discovered it way too late... Ever tried Scala ? Options are so cool.

2:52 ben_vulpes: jortiz71: a) lisp b) jvm

2:52 jortiz71: ben_vulpes: Ah, ok. :)

2:52 ben_vulpes: my candidates are?

2:53 jortiz71: ben_vulpes: A self-written language. :)

2:53 ben_vulpes: oh hey elm is actually a haskell thing

2:53 no way man

2:53 jortiz71: :D

2:53 ben_vulpes: the world has too many programming languages already

2:53 and most of them implement the same stupid shit equally poorly at that

2:56 shiranaihito: elvis4526 i haven't tried Scala yet

2:56 Empperi: well, not really. It's a good thing there's a lot of languages

2:56 survival of the fittest, only the best will survive

2:56 shiranaihito: Empperi it would be even better with a handful of *really good* languages :)

2:57 Empperi: but if none were created all the time then we wouldn't get the really good new languages but we would still be stuck at assembler

2:57 jortiz71: Are there any languages older than lisp still used by the way?

2:57 shiranaihito: they wouldn't need to be pumped out *all* the time

2:57 Empperi: and only way to know if language is actually good is to develop one and keep improving it until you know it well enough

2:58 jortiz71: cobol comes into mind

2:58 shiranaihito: it's a bit like desktop linux :) .. the results would be better with more concentrated efforts

2:58 ben_vulpes: jortiz71: fotran, narrowly

2:59 according to wikipedia at least

2:59 Empperi: cobol and fortran are both used yeah and they are both older than lisp but only by year or two

3:00 ben_vulpes: shiranaihito: "year of the linux laptop!" (tm) (r)

3:00 jortiz71: Ah, right. Reminds me that my colleague wanted to switch to cobol because she read somewhere that it is a good fit for business applications.

3:01 Empperi: hehe

3:01 ben_vulpes: jortiz71: ...when was this?

3:01 jortiz71: ben_vulpes: 2015.

3:01 Empperi: I'm actually working on a project which consists of some cobol, didn't write it myself though

3:02 jortiz71: And we were talking about getting things to a modern codebase. They mainly use oracle sql with the c precompiler.

3:02 Empperi: that code was written into bank mainframe

3:02 jortiz71: well, noone got ever fired for choosing cobol, right? :P

3:03 ben_vulpes: dang

3:03 what kind of business environment, jortiz71 ?

3:04 jortiz71: ben_vulpes: publishing

3:04 Well, one month to go and I am out of there. :)

3:04 ben_vulpes: and on to?

3:05 jortiz71: A small company providing microsoft service and SAP hosting for medium businesses.

3:05 shiranaihito: jortiz71 sounds a bit scary :)

3:06 jortiz71: shiranaihito: What part? :D

3:06 shiranaihito: MS and SAP :)

3:06 jortiz71: Well, I have to deal with Oracle SQL and ASP.NET MVC (C#) there. Not going to touch the sysadmin stuff.

3:07 Plus .. they have a pool in the data center

3:08 ben_vulpes: what

3:08 jortiz71: And sauna :)

3:08 ben_vulpes: is oracle/.net sysadminnery a nightmare?

3:08 shiranaihito: jortiz71 ok, that should be manageable :)

3:08 jortiz71: ben_vulpes: What to you mean?

3:09 shiranaihito: Yeah. :D I think there are no better options around here (not near a big city).

3:11 ben_vulpes: you said you weren't going to touch the sysadmin stuff. is it particularly obnoxious for oracle/.net compared to, say, python/ruby/php/node?

3:12 jortiz71: ben_vulpes: Oh, no, not at all. I am running the stuff at home and prefer it over the ones you mentioned. I was refering to the MS and SAP hosting stuff.

5:23 ashnur: anyone has some good links to blockchain related learning materials?

7:17 beaky: hello

7:17 someone called Alan Perlis always used to say "A language that doesn't affect the way you think about programming is not worth knowing."

7:17 but now i wonder how has clojure affected the way i think about programming

7:18 how did clojure affect the way you guys program

7:18 dysfun: clojure was the language that finally sold me on immutable data

7:19 beaky: same here its just so easy to use in clojure its idiomatic

7:19 whereas even in haskell immutable data is a doozy

7:20 dysfun: a lot of what clojure brings to the party i already had experience with. i've done a lot of functional programming, so i didn't get so much of a brainshift learning clojure as most

7:20 it's just a very nice bringing together of a lot of things i like

7:21 beaky: now if only i can finally master core.logic

7:21 then i can try to apply its principles

7:21 everywhere else

7:22 dysfun: well no, you can't, but it will twist how you think of programming and that's the value you get to take away

7:26 ashnur: yeah, and then your colleagues complain that they don't understand your javascript code :(

7:26 (happened to me recently)

7:28 beaky: haha

7:28 yes i no longer use explicit for loops... anywhere

7:29 * dysfun still programs a lot of C and C++, has to

7:37 shiranaihito: is there something like a typical use case for core.logic?

7:37 (it's been quite a while since i looked at it)

7:38 dysfun: not really. logic programs tend to be quite clear at the expense of performance

7:38 i tend to start out doing things the manual way and then if it's starting to look huge, think about how core.match or core.logic could help

7:38 shiranaihito: but when would you reach for core.logic then?

7:39 if what's looking huge? :)

7:39 dysfun: the code i'm writing to solve a problem

7:39 for example the other day i was doing sql generation from clojure data structures. the code got very large and repetitive so i tried rewriting it in core.match and it got a lot more readable

7:40 whereas if i was trying to write a query planner, i'd probably use core.logic because it's good at that sort of problem

7:40 shiranaihito: hm

7:40 if you don't mind, can you share some snippet of code from the SQL generation thingy? :)

7:40 dysfun: in general i associate constraint solving problems with core.logic

7:41 https://github.com/irresponsible/postgrey.squirrel/blob/master/src/postgrey/squirrel/internal.clj # fill yer boots

7:41 it's not finished

7:43 https://github.com/irresponsible/postgrey.squirrel/blob/jjl/src/postgrey/squirrel/internal.clj # here's the core.match version

7:45 shiranaihito: hmhm :)

7:45 interesting

7:45 kind of makes me wonder if i should have done something along those lines myself

7:46 now i've just got some reasonably simple SQL-string-mangling-from-maps etc

7:46 dysfun: assuming i stop playing with LFE and get back to doing some work, that will be production ready this month

7:47 shiranaihito: :)

7:47 how do you like LFE so far?

7:47 dysfun: it's...different

7:47 shiranaihito: :P

7:47 in a good way?

7:47 dysfun: i also remember that clojure's docs suck as much as theirs

7:48 yes, i think in a good way

7:48 they do pattern matching pretty damn well

7:48 core.match is not even in the same league

7:49 shiranaihito: i watched an introduction video by FLE's author

7:49 dysfun: as lisps go, i think it's comparably clean to clojure. there are a few oddities to get used to like they do not support variable arity functions

7:49 shiranaihito: it sounded interesting.. he was big on pattern matching

7:50 lkjdskljd LFE's, even :P

7:50 dysfun: anything variable arity has to be a core form

7:50 shiranaihito: hm.. i seem to remember the guy saying LFE didn't have variable arity (-dispatch..?)

7:50 dysfun: yes, erlang doesn't support it

7:50 you use tuples instead

7:51 shiranaihito: seems a bit problematic

7:51 to lack it

7:51 dysfun: so far as i can see the only major problem with it is that it means macros aren't quite as powerful

7:52 shiranaihito: oh, ok

7:52 dysfun: but i haven't finished looking into it yet

7:52 shiranaihito: so.. typically (instead of varargs) there's a tuple that gets pattern-matched right away?

7:53 dysfun: yes. something like (defun foo ((tuple a b) ...) ((tuple a b c) ...))

7:53 shiranaihito: how do you think LFE's pattern matching compares to core.match? if that makes sense :)

7:53 dysfun: what i said a few minutes ago: core.match isn't even in the same league

7:53 shiranaihito: oh

7:54 well that's too bad

7:54 oh, right.. i didn't read carefully enough

7:54 what kind of difference(s) do you see between them? or what makes LFE's so much better?

7:55 dysfun: 'better' is a bit subjective. i haven't gotten to the point i'm prepared to declare what i think of LFE yet

7:55 certainly i'm liking what i see so far, but i've made enormous investment in clojure and it's not going to leave my life any time soon

7:57 shiranaihito: but if it's "in another league", that kind of implies it's "a lot better", right? :)

7:57 dysfun: lfe pattern matching is much better than core.match. that doesn't mean lfe is better than clojure

7:58 shiranaihito: i'm open to the idea of LFE's pattern matching being a lot better than Clojure's.. just curious about what might make it so.. i'm largely clueless about pattern matching in general anyway :)

7:58 sure

7:59 there would be plenty of other factors when comparing the languages :)

7:59 dysfun: well clojure has destructuring bind. the difference between this and pattern matching is that pattern matches can fail

8:01 if you see the core.match usage in postgrey.squirrel, you'll see how i just provide clauses even though some things are in vectors and others aren't etc.

8:01 and it just falls back until it finds one that matches

8:01 whereas you can see the old code was just a mess and i hated it

8:04 and erlang and clojure have very different views of the world regarding concurrency

8:24 shiranaihito: but a destructuring bind doesn't lead to "choosing a result", right?

8:25 dysfun: correct, it is unconditional

8:25 shiranaihito: so i guess that's a difference between it and pattern matching? :) (in addition to failing)

8:25 dysfun: pattern matching can consider multiple patterns, yes

8:26 sometimes it works out shorter, sometimes it doesn't

8:26 shiranaihito: but i still don't get what makes LFE's pattern matching so much better than Clojure's

8:26 (in another league and all)

8:29 dysfun: it's quite capable of overloading based on the type (think records)

8:30 it's actually a unification mechanism

8:31 rather than a plain pattern match

8:31 though it works a little differently in lfe. i guess it's something you get a feel for when you use it

8:33 you know how when you put immutable data together with atoms and the stm and agents for state sync?

8:34 erlang brings it all together with its error recovery instead

8:35 shiranaihito: hm.. well, i lack the domain knowledge to know what all that means, but it sounds good!

8:36 dysfun: it's just nice to try something new once in a while

8:40 shiranaihito: sure

9:14 Ven: Hi, looking for some help with paredit. if I have [(]a b c) (cursor is "[" and "]"), and I paredit-forward, I get to (a b c[)]. But now, paredit-forward won't move to the next line, it just stays here. Any idea?

9:24 dysfun: isn't paredit supposed to stop you from writing malformed code in the first place?

9:27 Ven: dysfun: sure

9:27 jonathanj: he's talking about for navigation

9:27 Ven: i never really understood paredit's navigation

9:28 Ven: jonathanj: do you just browse using arrows, etc?

9:28 jonathanj: i use evil, which has the % motion from vim, which basically jumps between matching things

9:34 fijrg: Hi! I have a question re: threading macros. I call -> and all is fine and dandy. One function in there returns a collection, that I want to filter. I want to mix in a ->> just for that call to (filter #(re-matches ...) ,). Is there some way to do that nicely, or should I create a lambda only to wrap the filter in, so that it can take the collection in the first argument?

9:36 jonathanj: Ven: have you looked at paxedit?

9:36 dysfun: fijrg: (-> a (->> b c)) will do the right thing

9:36 Ven: jonathanj: I admit I've never heard of it :)

9:36 jonathanj: (and I also use evil)

9:36 dysfun: it's the other way you have to worry about

9:36 fijrg: dysfun: thank you! Trying it out...

9:37 jonathanj: Ven: it's a complementary thing to paredit

9:37 Ven: it adds some more motions and actions

9:37 Ven: aah, thanks

9:38 fijrg: dysfun: works like a charm. I looooveeeee this language!!!!!! Thanks for helping out mate :)

9:38 dysfun: yw :)

9:46 Ven: jonathanj: alas, it doesn't seem to do what I'd like :/

9:52 jonathanj: Ven: what are you trying to do?

10:18 fijrg: (update-in {:a 1 :b 2} [:a] inc) works as expected. Is there any function that does the same, but for every value? if (update-in {:a 1 :b 2} [] inc) ;; => {:a 2 :b 3} it would be exactly what I'm looking for - but that throws NullPointerExceptions

10:19 luma: no, there's no such function. you have to write it yourself

10:19 dysfun: you mean a hypothetical map-vals?

10:20 fijrg: dysfun: exactly. Watching Nathan Marz talk on Specter (https://youtu.be/VTCy_DkAJGk?list=PLZdCLR02grLq4e8-1P2JNHBKUOLFTX3kb) and thought update-in should do just what his map-vals does

10:20 dysfun: no, map-vals is one of the most requested things that isn't in core

10:21 fijrg: dysfun: Do you agree it would not be crazy to have (update-in {:a 1} [] inc) be replacing map-vals? either that or it should return nil

10:22 dysfun: i don't think i do

10:22 fijrg: or have a special value '* for wildcards - (update-in {:a 1} ['*] inc)

10:23 dysfun: update-in is a very specific tool. this falls well outside its scope

10:24 one of the beautiful things about a lisp is that you can just write your own and it's no different from if it were in core

10:25 fijrg: True - I just want my name in the core contributors list hehehe ;-) Thanks for the feedback on my thoughts

10:25 dysfun: that isn't actually all that hard an ambition to fulfill

11:05 pascience: #grifon

11:05 oops sorry

14:08 rhg135: hey guys, whats the best way to pipe data in to it?

14:11 dysfun: ...?

14:11 justin_smith: you know, it, pipe the data in, right?

14:12 dysfun: yeah, you know, into it

14:12 rhg135: my first naive attempt was `yaourt -Ss xxx | java ...`

14:12 dysfun: oh, you want to use clojure as a shell filter command

14:13 rhg135: it interpretted it as expressions...

14:13 yes, exactly

14:13 justin_smith: rhg135: were you running clojure.main? because I have piped data to clojure, but explicitly running my own main

14:14 rhg135: indeed I was, justin_smith

14:17 justin_smith: echo 'foo' | java -cp ~/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar clojure.main -e '(loop [d (read-line)] (when d (println "got" d) (recur (read-line))))'

14:17 that will print "got foo"

14:20 rhg135: that's kinda verbose

14:20 justin_smith: rhg135: it's not what I recommend doing in your real code

14:21 it's just a proof of concept that works when copy/pasted into a shell

14:21 eg you probably want clojure.jar to be in an easy to type well known place

14:22 rhg135: I have it set as $CLJ

14:23 amalloy: also i bet you could doseq over (line-seq *in*). but i'm not actually sure, i guess

14:24 rhg135: line-seq *in* throws

14:24 justin_smith: amalloy: oh yeah - that's much better, but I assumed he already had his "do something per line" code

14:25 rhg135: no, I didn't

14:25 per every other

14:27 justin_smith: for line oriented input, (take-while some? (repeatedly read-line)) works nice (but is still verbose)

14:29 rhg135: thats better than (do (require '[clojure.java.io :as io]) (line-seq (io/reader *in*)))

14:31 justin_smith: it's ugly, but clojure always loads clojure.java.io, so you can technically skip the require and spell out the full ns

14:31 (just checked in a naked vanilla repl)

14:31 rhg135: I thought it only loaded clojure.string

14:32 amalloy: you shouldn't rely on it automatically loading anything

14:33 justin_smith: amalloy: excellent point

14:33 you can see what really gets loaded with (all-ns) but that isn't guaranteed for future clojure releases

14:33 rhg135: cool

14:34 amalloy: justin_smith: you can't relaly trust the repl anyway. what gets loaded when you start a repl may not be the same as when you run a program, or use -e expr

14:35 (and indeed it is different, having just checked)

14:35 justin_smith: yeah, clojure.repl and it's deps

16:20 ben_vulpes: dysfun: so i learn at this moment that elm is just haskell

16:20 (where this moment ~ 12 hours ago)

16:20 "just"

16:25 rhg135: elm is haskell's cousin

16:27 ben_vulpes: what is the actual formal relationship between the two?

16:27 rhg135: elm's creator likes haskell

16:29 ben_vulpes: it also needs a pile of haskell to work if i'm not hallucinating last night's fun installation saga

16:30 rhg135: ah right. elm's compiler is written in haskell

18:03 patham9: https://gist.github.com/patham9/27adf9b587e0f2e75cfec909c71f9c1d

18:04 what does [[_ el1 el2] conclusion] mean?

18:05 ah jjust the params oops

18:05 ok makes sense ^^

18:11 justin_smith: ,((fn [[a b c]] c) [1 2 3])

18:11 clojurebot: 3

19:24 idev: I'm on ubuntu 15.10 . What's the easiest way to install (1) latest clojure, (2) some jvm, and (3) apache pdfbox?

19:36 will_sm: idev, I don't have/use Ubuntu, but you can install leiningen or boot real easily if they aren't in your package manager. They should work just fine as long as you have a JVM

19:38 idev: I have ubuntu 15.04, java, lein installed. lein repl works.

19:38 what is the easiest way to tell lein to auto download http://pdfbox.apache.org/ for me?

19:38 Gh0stInTheShell: idev: You can install the jdk from ppa to simplify things, I have five versions of java installed on ubuntu to support android builds, and I switch between them with update-java-alternatives on the command line.

19:39 http://www.webupd8.org/2015/02/install-oracle-java-9-in-ubuntu-linux.html

19:39 not java 9

19:39 idev: Gh0stInTheShell: I just instlled openjdk8

19:39 Gh0stInTheShell: use the one for java 8 :)

19:39 idev: should I install oracle java 9 instead ?

19:39 Gh0stInTheShell: idev: That should be fine

19:39 idev: Absolutely not, sorry

19:39 :)

19:40 idev: openjdk sucks and I should use oracle java ?

19:40 Gh0stInTheShell: idev: no, use open jdk

19:40 it's fine

19:40 :)

19:41 I would say some things about Oracle in general but it's not a political channel

19:41 idev: "Oracle is not my favorite tech company."

19:42 Gh0stInTheShell: I gave you that ppa because I work somewhere where we have to use oracle and I did it without thinking.

19:42 idev++

19:42 (inc idev)

19:43 * Gh0stInTheShell looks around. "Where am I?"

19:43 idev: in my lein repl

19:43 how do I say "load pdfbox"

19:43 (I just install libpdfbox-java on ubnutu)

19:44 will_sm: Did you add it under dependencies in project.clj?

19:45 idev: no, this is after lein new right?

19:45 okay, her eis my current project.clj

19:45 https://gist.github.com/21f60c2d41ba815743b07e3bc0d85049

19:46 what do I put in it and where?

19:47 will_sm: conjing [org.apache.pdfbox/pdfbox "2.0.0"] to :dependencies should work

19:48 idev: it's pulling stuff

19:49 appears to have succeeded

19:49 thanks

19:49 will_sm: So... I don't know the terminology or do any java, but that package has something to do with maven and to use a dependency the form is groupId/artifactId "version"

19:50 sources: http://stackoverflow.com/questions/11429506/how-to-use-library-in-maven-repo-for-clojure-project https://pdfbox.apache.org/2.0/getting-started.html

20:01 idev: I'm inside a lein repl

20:01 how do I run "names;ace: pdf.core", function name "-main" ?

20:08 will_sm: idev (pdf.core/-main)

20:13 idev, you can also add repl interaction to your text editor. Which editor are you using?

21:03 justin_smith: idev: you might also need to require the file (require 'pdf.core)

23:46 ilevd: Why does posrgresql return binary data two times bigger?

Logging service provided by n01se.net