#clojure logs

2016-05-15

00:44idevare there pure java solutions for pdf -> list of glyphs and pdf -> list of pngs?
00:44idevI don't want to use external programs like ghostscript
00:44idevI want to use the jvm for security as well
00:45idevas an extra layer between a malicious pdf and my os
01:12MadRaven.....a..aaaaaaaaaaaaaaAAAAAAAAAAAHHHHHHH!
01:13MadRavenSorry, just fell from the sky.
01:13MadRavenDamn it, Hunter X Hunter, stop distracting me!
01:16MadRavenLol. I changed my "Message Send" sound to Heavy Weapons Guy saying "POOTIS"
01:16MadRavenPOOTIS
01:16MadRavenSITOOP
01:17MadRavenLol, so every time someone chats, on my end it says "POOTIS"
01:18MadRavenHeh. TF2. Funny stuff.
01:34xtreakI am a clojure newbie. I went through clojure for brave and true. Are there any idiomatic repos to study like flask, requests for python?
01:36shiranaihitoxtreak: the clojure core would be one good example, i suppose
01:36xtreakThanks. Its very complex I heard last time for a newbie. I am looking for beginner friendly repos.
01:37shiranaihitowell, 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
01:38shiranaihitoi'm not sure "beginner friendly idiomatic clojure code" exists :) but maybe we're thinking of that in different ways
01:40shiranaihito(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)
01:42xtreakI 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.
01:42shiranaihitoyeah
01:43xtreakSorry for being too verbose i too couldn't get u a clear picture.
01:43shiranaihitogood point :)
01:43shiranaihitoi'm like an intermediate clojure user myself
01:44shiranaihitoand at least for me, it was difficult to see what's going on in clojure code, especially when starting out
01:44xtreakPerhaps u could share the steps u did and it will help me
01:44shiranaihitoit still often is.. maybe that's just part of the package, or maybe i'm just not advanced enough yet
01:45shiranaihitowell, 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 :)
01:46shiranaihitoi don't know about "steps" though
01:46shiranaihitobtw, don't worry about macros yet :)
01:46xtreakAny repos u looked into for studying? Do u have some stuff u implemented in github or somewhere i can look into..
01:47shiranaihitoit seems the general consensus is that macros should only be used when you *really* need to, anyway
01:48elvis4526shiranaihito: I'm curious, which languages are you coming from ?
01:48shiranaihitoelvis4526: i started out with Java (EE) and web stuff (including JavaScript), then moved on to Python, and then moved on from Python to Clojure
01:50shiranaihitoxtreak: 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 :)
01:51shiranaihitoxtreak: oh, and you should probably watch Rich Hickey's videos, if you haven't already
01:51shiranaihitothat might help you get into the "right mindset" for producing idiomatic clojure code
01:51xtreakMacros 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
01:51shiranaihito(though yeah, that's vague and even i'm not sure what it might mean in practice :P)
01:51shiranaihitoxtreak: check out "Cursive Clojure" the IDE btw
01:52shiranaihitoyeah, Clojure is good :)
01:52xtreakI looked some of the videos of rich with simple made easy and some of his talks on intro to clojure videos for java programmers
01:52shiranaihitoit's a practical lisp, suitable for actually getting stuff done etc
01:52shiranaihitoyeah
01:53shiranaihitooh btw, maybe you can check out David Nolen's code, from Om Next etc
01:53shiranaihitoi haven't seen it, but it's bound to be idiomatic :)
01:53elvis4526That's interesting. I'm doing the opposite (to have more jobs opportunities) and I find the situation very frustrating.
01:53xtreakI looked into D too.. So a little confused over D or clojure as they are very much contrary and walter is also my inspiration..
01:55xtreakYes. 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.
01:55shiranaihitoelvis4526: my contract job is with Java, Ruby, JS, etc :)
01:55shiranaihitoi've just settled on clojure for my own stuff
01:55shiranaihitoxtreak yeah.. there's a shitload of stuff to learn about clojure :) but it's a pretty damn powerful toolset
01:56shiranaihitothe 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
01:57elvis4526Cool. 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.
01:57shiranaihitoit's good to know JS for sure
01:57shiranaihitoi don't like Ruby though.. and i can't even really use it
01:57shiranaihitoit's too magical etc
01:58shiranaihitoJava 1.8 is pretty good btw
01:58shiranaihitomuch less painful with anonymous functions etc
01:59xtreakYes. Streams, filters and maps are delicious :)
01:59shiranaihitothough i was never a "Java hater"
01:59shiranaihitoyeah :)
01:59elvis4526I remember I had this feeling about Ruby too. The situation is similar to most Clojure DSL I had to use.
01:59shiranaihitoelvis4526 yep
01:59elvis4526The magic is nice when it works, but macros are harder to debug when they broke. :(
02:00shiranaihitoi suppose Java still has the most job opportunities, if that's what you want
02:00xtreakI primarily work on Python but with this java 8 seems more functional than python..
02:00shiranaihitoyeah! :)
02:00shiranaihitothat's true
02:00shiranaihitoJava 1.8 basically surpassed Python in that way
02:01shiranaihitooh did you see this btw: https://medium.com/spritle-software/rails-5-activerecord-suppress-a-step-too-far-d7ec2e4ed027#.8mwc6zs83
02:01shiranaihitothat's kind of disturbing
02:01shiranaihitoi'm glad i never went with Ruby
02:02elvis4526shiranaihito: Yeah probably, but Javascript was the best compromise I could make between fun and still being a marketable skill.
02:02elvis4526If 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.
02:04shiranaihitoelvis4526: IDEA is the best IDE out there
02:05shiranaihitoit's very much worth using, and not only just for Java code, but everything else it gives you
02:05shiranaihitoand as for Rails.. i've seen a couple of people say it's basically developed for Basecamp
02:06shiranaihitoit's just surprising that DHH seems to want Basecamp to be a rickety mess of inter-dependent state :)
02:07shiranaihitobut yeah.. try IDEA.. :) Java (1.8) is a pretty damn solid foundation for serious software too, btw
02:07shiranaihitoif i had to choose between Python and Java, i'd go with Java.. easy choice
02:08elvis4526Yeah I remember trying WebStorm couple months ago... The JS and TS support was nice, felt a bit heavy only to do web dev.
02:10shiranaihitoelvis4526 their language-specific IDEs are a bit like plugins for IDEA.. it's not quite that simple, but relatively close
02:11shiranaihitofor example, they have a Python plugin for IDEA that provides pretty much the same functionality as PyCharm
02:11elvis4526i thought the plugins for idea were the same as the standalone versions
02:11shiranaihitoi'd say IDEA is the best choice because it gives you (just about) everything JetBrains has to offer
02:12shiranaihitoyeah, roughly the same, afaik
02:12shiranaihitobut with IDEA you can work with eeeeeeeverythiiinngg.. :P
02:12elvis4526You must find Clojure syntax to be super light if you're coming from a Java background. :-)
02:13shiranaihitoso 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 :)
02:14elvis4526They got a Scala plugin too.
02:14shiranaihitoyeah, Clojure's syntax is neat :) but i was never that bothered by Java's verbosity
02:14shiranaihitoyeah, that too.. and.. YAML! :) and JSON ofc, and and and.. everything :)
02:15shiranaihitobut basically IDEA will help you work with just about anything that's not Microsofty or "too esoteric" :)
02:16shiranaihitoand it's got really good support for the most common things and languages
02:16shiranaihitono fiddling with external tools.. just get shit done
02:18elvis4526Yeah - I think I'm too used to emacs to change anything in my dev environment. :-)
02:18elvis4526I like external tools - thats one of the thing I like in JS. How most of the tooling isn't coupled to an IDE.
02:20shiranaihitooh? :) i for one resent having to fiddle with more or less half-assed Node-based tools to get anything done with React etc
02:21shiranaihitoi don't see a problem with "tooling" (or maybe more like "functionality") being coupled to an IDE, especially when the IDE is IDEA :P
02:21shiranaihitothen you've just got pretty much the best support out there for everything you're working with
02:22shiranaihitoit's got lots of code-quality-improving suggestions too
02:22shiranaihitofor example, with JavaScript, it points out when you're probably using "this" wrong
02:23shiranaihitoand it points out when some if-statements can be simplified etc.. there's just so much stuff it does for you..
02:23elvis4526I think you can write tools that are both modular and well written.
02:23shiranaihitosure :p
02:23elvis4526This sounds a lot like a linter to me.
02:23shiranaihitoi'd imagine it's more than a linter
02:23shiranaihitoor maybe it's a "linter on steroids" or something :P
02:24elvis4526Yeah I don't think JSHint & co have this kind of feature.
02:24shiranaihitoeither way, the suggestions are often actually useful
02:24shiranaihito(IDEA has often been right about me using "this" wrong :P)
02:24shiranaihitosome of the suggestions are really detailed too
02:24shiranaihitoand come with a brief explanation of what's wrong etc
02:25shiranaihitobasically, using IDEA has made me write better code overall :)
02:27elvis4526I feel like a good type system will help you more to write good code then any IDE.
02:28elvis4526Working with clojure for an extended period of time made me hate dynamic languages.
02:28shiranaihitooh?
02:28shiranaihitocan you think of an example of the problems you experienced?
02:30elvis4526Null handling
02:31shiranaihitomoar detail plz :P
02:31shiranaihitoi think Clojure is pretty good with nulls.. lots of stuff just returns nil when given nil, and so there's no explosion
02:31ben_vulpesmap access returning nil
02:32ben_vulpescompile-time function arity checking
02:32ben_vulpesthe former added 2 hours to a mega refactor at the end of last week
02:33ben_vulpesspecifically on the merge of the refactor into a wip branch
02:33shiranaihitosounds interesting :) .. so what happened?
02:33ben_vulpesi fixed it?
02:33shiranaihito"because X we didn't realize thaT Y and so Z" .. ?
02:34shiranaihitoso maybe something like what were those 2 hours spent on, and why etc
02:35ben_vulpesan 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
02:37ben_vulpes,(let [{:keys [foo]} {:bar :baz}] foo)
02:37clojurebotnil
02:38ben_vulpesyou may see how that would silently fail at runtime in all sorts of hilarious ways, under all sorts of conditions.
02:38ben_vulpesthese were functions whose signatures i'd written, but not bodies yet
02:39ben_vulpessignatures mostly along the lines of [conn user notification-id response-id]
02:39ben_vulpesschema 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
02:40ben_vulpeswhich is the classic justification for not using a typed language, right?
02:40ben_vulpesplenty of tests for desired behavior though
02:40shiranaihitoso.. some functions took "foo" that was nil because there was no value for it in a map, and.. something bad happened?
02:41ben_vulpeswell, it's not bad until it goes to production
02:41ben_vulpesin my opinion
02:41ben_vulpesjust 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.
02:42shiranaihitohmm
02:42shiranaihitoi'm not saying there was no problem, but i still don't see what exactly it was
02:43ben_vulpesoh i just want the language to do more for me than it does.
02:43shiranaihitoso if you ask for the value for a key that's not in a map, you get nil..
02:43ben_vulpesi want an exception
02:43ben_vulpes"so write that getter yourself!"
02:43ben_vulpesyes yes
02:43shiranaihitoand 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?
02:43ben_vulpessure
02:44ben_vulpesthree more lines of code in each function, why not
02:44elvis4526shiranaihito: Some functions can throw a NullPointerException if you pass them nil. Like + for example.
02:44ben_vulpesshiranaihito: 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.
02:45shiranaihitobut.. when do you want an exception?
02:46elvis4526I don't want exceptions :(
02:46shiranaihitoelvis4526 ah, right.. well, i thought i was talking to Ben :)
02:46shiranaihitohe says he wants one :)
02:46ben_vulpesshiranaihito: during development
02:46ben_vulpeswhen i run my tests
02:47shiranaihitoben_vulpes: yeah, but under what kind of conditions? when you're (unknowingly) giving nil to something.. anything?
02:47ben_vulpessure i see what you're saying
02:47ben_vulpesand i refuse to answer directly
02:47jortiz71Schema looks nice.
02:47ben_vulpesmap access for nil values would be neat
02:47ben_vulpes,{:foo nil}
02:47clojurebot{:foo nil}
02:47ben_vulpes^^ that also feels weird to me
02:47shiranaihitoben_vulpes: i'm not aware of saying anything in particular with that :P i'm just trying to figure out the problem
02:47ben_vulpessuch however is life under a bdfl
02:48ben_vulpesshiranaihito: shit's floppy, man.
02:48ben_vulpesi want less floppiness.
02:48elvis4526Most of the time I ended up using the some-> macro which short-circuit the pipeline of functions if any of them returns nil
02:48ben_vulpesor the ability to impose rigidity.
02:48shiranaihitoso.. you want.. Haskell? :)
02:49ben_vulpesdude
02:49shiranaihitoelvis4526 yeah, some-> is handy
02:49ben_vulpesthe world is not a binary place
02:49shiranaihitoben_vulpes well, what do you refuse to answer directly (and perhaps.. why? :p)
02:49ben_vulpesjust because i want rigidity does not mean haskell is a viable solution
02:49ben_vulpesbecause the answer to your specific questions are pointless
02:50ben_vulpesi'm painting a larger picture
02:50shiranaihitoso 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?
02:50ben_vulpesit would be nice to be able to specify that a function should never take a nil
02:50shiranaihitothe point might be just to satisfy my curiosity, and to participate in the conversation :)
02:50ben_vulpes"p-preconditions!"
02:51ben_vulpesoh i am participating in the conversation.
02:51shiranaihitook.. and you'd like the compiler to figure out when some specific function would end up taking a nil?
02:51ben_vulpesthat'd be a nicety, certainly
02:52jortiz71How about using a language that has no nil?
02:52elvis4526shiranaihito: Yeah, I actually discovered it way too late... Ever tried Scala ? Options are so cool.
02:52ben_vulpesjortiz71: a) lisp b) jvm
02:52jortiz71ben_vulpes: Ah, ok. :)
02:52ben_vulpesmy candidates are?
02:53jortiz71ben_vulpes: A self-written language. :)
02:53ben_vulpesoh hey elm is actually a haskell thing
02:53ben_vulpesno way man
02:53jortiz71:D
02:53ben_vulpesthe world has too many programming languages already
02:53ben_vulpesand most of them implement the same stupid shit equally poorly at that
02:56shiranaihitoelvis4526 i haven't tried Scala yet
02:56Empperiwell, not really. It's a good thing there's a lot of languages
02:56Empperisurvival of the fittest, only the best will survive
02:56shiranaihitoEmpperi it would be even better with a handful of *really good* languages :)
02:57Empperibut 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
02:57jortiz71Are there any languages older than lisp still used by the way?
02:57shiranaihitothey wouldn't need to be pumped out *all* the time
02:57Empperiand only way to know if language is actually good is to develop one and keep improving it until you know it well enough
02:58Empperijortiz71: cobol comes into mind
02:58shiranaihitoit's a bit like desktop linux :) .. the results would be better with more concentrated efforts
02:58ben_vulpesjortiz71: fotran, narrowly
02:59ben_vulpesaccording to wikipedia at least
02:59Emppericobol and fortran are both used yeah and they are both older than lisp but only by year or two
03:00ben_vulpesshiranaihito: "year of the linux laptop!" (tm) (r)
03:00jortiz71Ah, right. Reminds me that my colleague wanted to switch to cobol because she read somewhere that it is a good fit for business applications.
03:01Empperihehe
03:01ben_vulpesjortiz71: ...when was this?
03:01jortiz71ben_vulpes: 2015.
03:01EmpperiI'm actually working on a project which consists of some cobol, didn't write it myself though
03:02jortiz71And we were talking about getting things to a modern codebase. They mainly use oracle sql with the c precompiler.
03:02Empperithat code was written into bank mainframe
03:02jortiz71well, noone got ever fired for choosing cobol, right? :P
03:03ben_vulpesdang
03:03ben_vulpeswhat kind of business environment, jortiz71 ?
03:04jortiz71ben_vulpes: publishing
03:04jortiz71Well, one month to go and I am out of there. :)
03:04ben_vulpesand on to?
03:05jortiz71A small company providing microsoft service and SAP hosting for medium businesses.
03:05shiranaihitojortiz71 sounds a bit scary :)
03:06jortiz71shiranaihito: What part? :D
03:06shiranaihitoMS and SAP :)
03:06jortiz71Well, I have to deal with Oracle SQL and ASP.NET MVC (C#) there. Not going to touch the sysadmin stuff.
03:07jortiz71Plus .. they have a pool in the data center
03:08ben_vulpeswhat
03:08jortiz71And sauna :)
03:08ben_vulpesis oracle/.net sysadminnery a nightmare?
03:08shiranaihitojortiz71 ok, that should be manageable :)
03:08jortiz71ben_vulpes: What to you mean?
03:09jortiz71shiranaihito: Yeah. :D I think there are no better options around here (not near a big city).
03:11ben_vulpesyou said you weren't going to touch the sysadmin stuff. is it particularly obnoxious for oracle/.net compared to, say, python/ruby/php/node?
03:12jortiz71ben_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.
05:23ashnuranyone has some good links to blockchain related learning materials?
07:17beakyhello
07:17beakysomeone called Alan Perlis always used to say "A language that doesn't affect the way you think about programming is not worth knowing."
07:17beakybut now i wonder how has clojure affected the way i think about programming
07:18beakyhow did clojure affect the way you guys program
07:18dysfunclojure was the language that finally sold me on immutable data
07:19beakysame here its just so easy to use in clojure its idiomatic
07:19beakywhereas even in haskell immutable data is a doozy
07:20dysfuna 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
07:20dysfunit's just a very nice bringing together of a lot of things i like
07:21beakynow if only i can finally master core.logic
07:21beakythen i can try to apply its principles
07:21beakyeverywhere else
07:22dysfunwell no, you can't, but it will twist how you think of programming and that's the value you get to take away
07:26ashnuryeah, and then your colleagues complain that they don't understand your javascript code :(
07:26ashnur(happened to me recently)
07:28beakyhaha
07:28beakyyes i no longer use explicit for loops... anywhere
07:37shiranaihitois there something like a typical use case for core.logic?
07:37shiranaihito(it's been quite a while since i looked at it)
07:38dysfunnot really. logic programs tend to be quite clear at the expense of performance
07:38dysfuni 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
07:38shiranaihitobut when would you reach for core.logic then?
07:39shiranaihitoif what's looking huge? :)
07:39dysfunthe code i'm writing to solve a problem
07:39dysfunfor 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
07:40dysfunwhereas if i was trying to write a query planner, i'd probably use core.logic because it's good at that sort of problem
07:40shiranaihitohm
07:40shiranaihitoif you don't mind, can you share some snippet of code from the SQL generation thingy? :)
07:40dysfunin general i associate constraint solving problems with core.logic
07:41dysfunhttps://github.com/irresponsible/postgrey.squirrel/blob/master/src/postgrey/squirrel/internal.clj # fill yer boots
07:41dysfunit's not finished
07:43dysfunhttps://github.com/irresponsible/postgrey.squirrel/blob/jjl/src/postgrey/squirrel/internal.clj # here's the core.match version
07:45shiranaihitohmhm :)
07:45shiranaihitointeresting
07:45shiranaihitokind of makes me wonder if i should have done something along those lines myself
07:46shiranaihitonow i've just got some reasonably simple SQL-string-mangling-from-maps etc
07:46dysfunassuming i stop playing with LFE and get back to doing some work, that will be production ready this month
07:47shiranaihito:)
07:47shiranaihitohow do you like LFE so far?
07:47dysfunit's...different
07:47shiranaihito:P
07:47shiranaihitoin a good way?
07:47dysfuni also remember that clojure's docs suck as much as theirs
07:48dysfunyes, i think in a good way
07:48dysfunthey do pattern matching pretty damn well
07:48dysfuncore.match is not even in the same league
07:49shiranaihitoi watched an introduction video by FLE's author
07:49dysfunas 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
07:49shiranaihitoit sounded interesting.. he was big on pattern matching
07:50shiranaihitolkjdskljd LFE's, even :P
07:50dysfunanything variable arity has to be a core form
07:50shiranaihitohm.. i seem to remember the guy saying LFE didn't have variable arity (-dispatch..?)
07:50dysfunyes, erlang doesn't support it
07:50dysfunyou use tuples instead
07:51shiranaihitoseems a bit problematic
07:51shiranaihitoto lack it
07:51dysfunso far as i can see the only major problem with it is that it means macros aren't quite as powerful
07:52shiranaihitooh, ok
07:52dysfunbut i haven't finished looking into it yet
07:52shiranaihitoso.. typically (instead of varargs) there's a tuple that gets pattern-matched right away?
07:53dysfunyes. something like (defun foo ((tuple a b) ...) ((tuple a b c) ...))
07:53shiranaihitohow do you think LFE's pattern matching compares to core.match? if that makes sense :)
07:53dysfunwhat i said a few minutes ago: core.match isn't even in the same league
07:53shiranaihitooh
07:54shiranaihitowell that's too bad
07:54shiranaihitooh, right.. i didn't read carefully enough
07:54shiranaihitowhat kind of difference(s) do you see between them? or what makes LFE's so much better?
07:55dysfun'better' is a bit subjective. i haven't gotten to the point i'm prepared to declare what i think of LFE yet
07:55dysfuncertainly 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
07:57shiranaihitobut if it's "in another league", that kind of implies it's "a lot better", right? :)
07:57dysfunlfe pattern matching is much better than core.match. that doesn't mean lfe is better than clojure
07:58shiranaihitoi'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 :)
07:58shiranaihitosure
07:59shiranaihitothere would be plenty of other factors when comparing the languages :)
07:59dysfunwell clojure has destructuring bind. the difference between this and pattern matching is that pattern matches can fail
08:01dysfunif 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.
08:01dysfunand it just falls back until it finds one that matches
08:01dysfunwhereas you can see the old code was just a mess and i hated it
08:04dysfunand erlang and clojure have very different views of the world regarding concurrency
08:24shiranaihitobut a destructuring bind doesn't lead to "choosing a result", right?
08:25dysfuncorrect, it is unconditional
08:25shiranaihitoso i guess that's a difference between it and pattern matching? :) (in addition to failing)
08:25dysfunpattern matching can consider multiple patterns, yes
08:26dysfunsometimes it works out shorter, sometimes it doesn't
08:26shiranaihitobut i still don't get what makes LFE's pattern matching so much better than Clojure's
08:26shiranaihito(in another league and all)
08:29dysfunit's quite capable of overloading based on the type (think records)
08:30dysfunit's actually a unification mechanism
08:31dysfunrather than a plain pattern match
08:31dysfunthough it works a little differently in lfe. i guess it's something you get a feel for when you use it
08:33dysfunyou know how when you put immutable data together with atoms and the stm and agents for state sync?
08:34dysfunerlang brings it all together with its error recovery instead
08:35shiranaihitohm.. well, i lack the domain knowledge to know what all that means, but it sounds good!
08:36dysfunit's just nice to try something new once in a while
08:40shiranaihitosure
09:14VenHi, 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?
09:24dysfunisn't paredit supposed to stop you from writing malformed code in the first place?
09:27Vendysfun: sure
09:27jonathanjhe's talking about for navigation
09:27jonathanjVen: i never really understood paredit's navigation
09:28Venjonathanj: do you just browse using arrows, etc?
09:28jonathanji use evil, which has the % motion from vim, which basically jumps between matching things
09:34fijrgHi! 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?
09:36jonathanjVen: have you looked at paxedit?
09:36dysfunfijrg: (-> a (->> b c)) will do the right thing
09:36Venjonathanj: I admit I've never heard of it :)
09:36Venjonathanj: (and I also use evil)
09:36dysfunit's the other way you have to worry about
09:36fijrgdysfun: thank you! Trying it out...
09:37jonathanjVen: it's a complementary thing to paredit
09:37jonathanjVen: it adds some more motions and actions
09:37Venaah, thanks
09:38fijrgdysfun: works like a charm. I looooveeeee this language!!!!!! Thanks for helping out mate :)
09:38dysfunyw :)
09:46Venjonathanj: alas, it doesn't seem to do what I'd like :/
09:52jonathanjVen: what are you trying to do?
10:18fijrg(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:19lumano, there's no such function. you have to write it yourself
10:19dysfunyou mean a hypothetical map-vals?
10:20fijrgdysfun: 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:20dysfunno, map-vals is one of the most requested things that isn't in core
10:21fijrgdysfun: 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:22dysfuni don't think i do
10:22fijrgor have a special value '* for wildcards - (update-in {:a 1} ['*] inc)
10:23dysfunupdate-in is a very specific tool. this falls well outside its scope
10:24dysfunone 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:25fijrgTrue - I just want my name in the core contributors list hehehe ;-) Thanks for the feedback on my thoughts
10:25dysfunthat isn't actually all that hard an ambition to fulfill
11:05pascience#grifon
11:05pascienceoops sorry
14:08rhg135hey guys, whats the best way to pipe data in to it?
14:11dysfun...?
14:11justin_smithyou know, it, pipe the data in, right?
14:12dysfunyeah, you know, into it
14:12rhg135my first naive attempt was `yaourt -Ss xxx | java ...`
14:12dysfunoh, you want to use clojure as a shell filter command
14:13rhg135it interpretted it as expressions...
14:13rhg135yes, exactly
14:13justin_smithrhg135: were you running clojure.main? because I have piped data to clojure, but explicitly running my own main
14:14rhg135indeed I was, justin_smith
14:17justin_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:17justin_smiththat will print "got foo"
14:20rhg135that's kinda verbose
14:20justin_smithrhg135: it's not what I recommend doing in your real code
14:21justin_smithit's just a proof of concept that works when copy/pasted into a shell
14:21justin_smitheg you probably want clojure.jar to be in an easy to type well known place
14:22rhg135I have it set as $CLJ
14:23amalloyalso i bet you could doseq over (line-seq *in*). but i'm not actually sure, i guess
14:24rhg135line-seq *in* throws
14:24justin_smithamalloy: oh yeah - that's much better, but I assumed he already had his "do something per line" code
14:25rhg135no, I didn't
14:25rhg135per every other
14:27justin_smithfor line oriented input, (take-while some? (repeatedly read-line)) works nice (but is still verbose)
14:29rhg135thats better than (do (require '[clojure.java.io :as io]) (line-seq (io/reader *in*)))
14:31justin_smithit's ugly, but clojure always loads clojure.java.io, so you can technically skip the require and spell out the full ns
14:31justin_smith(just checked in a naked vanilla repl)
14:31rhg135I thought it only loaded clojure.string
14:32amalloyyou shouldn't rely on it automatically loading anything
14:33justin_smithamalloy: excellent point
14:33justin_smithyou can see what really gets loaded with (all-ns) but that isn't guaranteed for future clojure releases
14:33rhg135cool
14:34amalloyjustin_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:35amalloy(and indeed it is different, having just checked)
14:35justin_smithyeah, clojure.repl and it's deps
16:20ben_vulpesdysfun: so i learn at this moment that elm is just haskell
16:20ben_vulpes(where this moment ~ 12 hours ago)
16:20ben_vulpes"just"
16:25rhg135elm is haskell's cousin
16:27ben_vulpeswhat is the actual formal relationship between the two?
16:27rhg135elm's creator likes haskell
16:29ben_vulpesit also needs a pile of haskell to work if i'm not hallucinating last night's fun installation saga
16:30rhg135ah right. elm's compiler is written in haskell
18:03patham9https://gist.github.com/patham9/27adf9b587e0f2e75cfec909c71f9c1d
18:04patham9what does [[_ el1 el2] conclusion] mean?
18:05patham9ah jjust the params oops
18:05patham9ok makes sense ^^
18:11justin_smith,((fn [[a b c]] c) [1 2 3])
18:11clojurebot3
19:24idevI'm on ubuntu 15.10 . What's the easiest way to install (1) latest clojure, (2) some jvm, and (3) apache pdfbox?
19:36will_smidev, 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:38idevI have ubuntu 15.04, java, lein installed. lein repl works.
19:38idevwhat is the easiest way to tell lein to auto download http://pdfbox.apache.org/ for me?
19:38Gh0stInTheShellidev: 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:39Gh0stInTheShellhttp://www.webupd8.org/2015/02/install-oracle-java-9-in-ubuntu-linux.html
19:39Gh0stInTheShellnot java 9
19:39idevGh0stInTheShell: I just instlled openjdk8
19:39Gh0stInTheShelluse the one for java 8 :)
19:39idevshould I install oracle java 9 instead ?
19:39Gh0stInTheShellidev: That should be fine
19:39Gh0stInTheShellidev: Absolutely not, sorry
19:39Gh0stInTheShell:)
19:40idevopenjdk sucks and I should use oracle java ?
19:40Gh0stInTheShellidev: no, use open jdk
19:40Gh0stInTheShellit's fine
19:40Gh0stInTheShell:)
19:41Gh0stInTheShellI would say some things about Oracle in general but it's not a political channel
19:41idev"Oracle is not my favorite tech company."
19:42Gh0stInTheShellI gave you that ppa because I work somewhere where we have to use oracle and I did it without thinking.
19:42Gh0stInTheShellidev++
19:42Gh0stInTheShell(inc idev)
19:43idevin my lein repl
19:43idevhow do I say "load pdfbox"
19:43idev(I just install libpdfbox-java on ubnutu)
19:44will_smDid you add it under dependencies in project.clj?
19:45idevno, this is after lein new right?
19:45idevokay, her eis my current project.clj
19:45idevhttps://gist.github.com/21f60c2d41ba815743b07e3bc0d85049
19:46idevwhat do I put in it and where?
19:47will_smconjing [org.apache.pdfbox/pdfbox "2.0.0"] to :dependencies should work
19:48idevit's pulling stuff
19:49idevappears to have succeeded
19:49idevthanks
19:49will_smSo... 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:50will_smsources: 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:01idevI'm inside a lein repl
20:01idevhow do I run "names;ace: pdf.core", function name "-main" ?
20:08will_smidev (pdf.core/-main)
20:13will_smidev, you can also add repl interaction to your text editor. Which editor are you using?
21:03justin_smithidev: you might also need to require the file (require 'pdf.core)
23:46ilevdWhy does posrgresql return binary data two times bigger?