#clojure logs

2013-03-18

00:36ambrosebsjonasen: wow termito looks sweet!
00:36ambrosebsCan it handle global scope?
00:56jonasenambrosebs: what do you mean?
00:57ambrosebsjonasen: Do we have the usual issues with assuming + means clojure.core/+?
00:59jonasenambrosebs: defrules uses bblooms backtick so it doesn't ns expand symbols. But it could just as well use clojures syntax quote
01:00ambrosebsjonasen: You'd usually be running termito on fully macroexpanded/qualified forms though right? It would get pretty unpredictable otherwise.
01:00jonasenambrosebs: depends entirely on the use case.
01:01ambrosebsjonasen: ok. I don't understand why you wouldn't want a fully macroexpanded form.
01:02ambrosebsor when, rather.
01:02jonasenambrosebs: maybe your usecase is not transforming clojure code but e.g. hiccup data structures or something similar
01:02ambrosebsjonasen: ok, got it.
01:03jonasenambrosebs: think EDN and not Clojure :)
01:03ambrosebsso termito is general enough not to care :)
01:04ambrosebsMy immediate thought was to use jvm.tools.analyzer and use emit-form to convert an AST to a form to play with.
01:10tomojwhoa, I hadn't noticed emit-form
01:43muhoook, so wait. if i'm using a pooled data source, do i have to do this with-query-results and doall nonsense? can i have queries which return actual lazy sequences?
01:44muhoomy understanding is that the reason you have to doall is because by the time the with-connection + with-query-results returns, the connection might be closed. if it's a persistent connection though...
01:56ambrosebstomoj: hehe emit-form is pretty cool
02:13tomojI suppose tying the knot between an inner destructuring binding and its root bindings' expr is.. just not clojurey :(
02:13tomojs/s'/'s/
02:15ambrosebstomoj: is this to track where a particular destructuring originated from?
02:18tomoj(let [[_ & rest] (cons 1 (lazy-seq rest))] ...), in spirit
02:26muhooum, where is the edn reader? (require 'clojure.edn) fails, and this is on 1.5.1
02:26RaynesI thought tools.reader was the only edn reader
02:27RaynesApparently I'm dumb though, so disregard me.
02:28muhooaha, no. godddddaaaaaaaaammmmnnn dependency hell. somehow my explicit including clojure 1.5.1 got ignored; it's still 1.4.0 :-/
02:29muhoolein deps :tree to the rescue
02:34muhooRaynes: naw, it's joyful happy maven fun
02:34muhoosomehow [org.clojure/clojure "1.5.1"] means "just ignore this completely and use 1.4.0", and lein-pedantic has no problem with that either
02:35ambrosebstomoj: to rewrite it to (let [rest (lazy-seq rest)] ...)? The useless (rest (cons 1 (lazy-seq rest)) sounds like something that can be picked up from the macroexpansion.
02:36Raynesambrosebs: How are things?
02:36ambrosebsRaynes: delightful ;)
02:36ambrosebsRaynes: did you make it to Clojure West?
02:37Raynesambrosebs: No.
02:37RaynesI should change my nickname to Raynesnotatcljwest
02:37RaynesAt least 4 people have asked me on separate occasions today. :P
02:37muhooRaynes: i was just going to suggest that
02:37ambrosebsRaynes: sounds depressing :( hehe
02:38ambrosebsRaynes: it's because we love you
02:38muhooadding dependencies to a project.clj is kind of like building a house of cards
02:39muhooi never know which one will cause the whole thing to come crashing down
02:54tomojambrosebs: hmm
02:54tomojwhere's the 1 come from? :)
02:54tomojoh
02:54tomojI think I wrote it wrong
02:59amalloyRaynes: change it to Guest
02:59Raynesambrosebs: I think I fixed that btw.
02:59RaynesEr, amalloy.
03:00RaynesPretty sure Textual suddenly decided my name should be Guest.
03:08muhoowell... i learned me somethin new. if org.clojure/clojure is defined in profiles.clj, then no matter what is in project.clj, it gets overwritten
04:23tgoossensi find it sometimes difficult finding the right granularity for atoms
04:23tgoossensmaybe because i'm trying to think OO too much?
04:23tgoossensI have a simulator where different robots can be in
04:27tgoossensis an atom in an atom unacceptable?
04:28tgoossensprobably too complex
04:32drorbemet
04:32pyykkistgoossens: I'd start by putting the whole world in one atom
04:32tgoossensthat' s what i'm trying to do now
04:33tgoossensevery robot can receive a different command. asynchronously (so i guess agents might be useful here)
04:34pyykkistgoossens: have you seen http://vimeo.com/8672404
04:34tgoossensnope
04:35tgoossensbookmarked it :)
04:36tgoossenswill certainly watch it
04:36tgoossensmy current idea was
04:36tgoossensA robot must be assigned an action-id.
04:36tgoossensThis id will be mapped on a function (mutator) that will
04:36tgoossensmutate a robot (producing the next value) External users can change this mutator function, providing a way to give and change commands
04:38tgoossensits gonnna be difficult :p
04:38tgoossensi made such a system in java recently. But i'm trying to rethink it in clojure
04:41magnarsany way to tell midje that [1 2 3] and '(1 2 3) are not equal, since they certainly aren't interchangeable? Testing frameworks should not be lax in their equality checks.
05:02scottjmagnars: it probably uses =, which considers them equal
05:05magnarsscottj: which is bad on so many levels, especially for a language that prides itself for being simple
05:05noidimagnars, try (just '(1 2 3))
05:06magnarsnoidi: thanks, I'll give that a shot
05:06noidiI'm not sure, but I think it does exact matching
05:07noidisorry, it seems to do fuzzy matching as well :P
05:09magnarsyeah :P
05:11noidimagnars, there's also `exactly`
05:12noidiit seems to do a equality check using `=`, so it should forego _some_ magic behavior
05:12noidi,(= '(1 2 3) [1 2 3])
05:12clojurebottrue
05:13noidibut due to clojure's equality partitions, = is not enough...
05:15Chousukemagnars: you should probably explicitly test for vector-ness instead of strict equality.
05:30noidimagnars, checking the return type of a function is probably a better fit for core.typed or a design by contract
05:31noidie.g. (defn my-fn [] {:post [(vector? %)]} ...)
05:32noidior (ann my-fn [-> (Vector Long)])
06:33wjlroeDoes anyone know why on OS X I get an icon in my dock for clojure.main when I launch `lein ring server`?
06:37andrewmcveigh|wwjlroe: You've probably got some java GUI stuff somewhere in your dependencies. You can get rid of it with :jvm-opts ["-Djava.awt.headless=true"] in your project.clj
06:37andrewmcveigh|wor at least, that works for me.
06:37wjlroeandrewmcveigh|w: ah thanks
06:38andrewmcveigh|wwjlroe: no probs
06:40wjlroeandrewmcveigh|w: it was even simpler. `lein ring server-headless`. silly me, it was calling open on the url so it would open in my browser (must have involved some guy library as you said)
06:40wjlroegui - not guy
06:40wjlroedamn autocorrect
06:45winkah yeah, too slow :P was about to sugghest -headless
06:45andrewmcveigh|wwjlroe: Ah, yeah. Forgot about server-headless, don't really use that command.
09:07nonubyis there a shortcut for (first (sort-by fn col))
09:08joegalloi can't think of one offhand -- that seems pretty short already, though ;)
09:08clgvnonuby: it's not that long ;)
09:09clgvnonuby: something like `min` or `max` might fit if you sort numbers there
09:09nonubythey are maps, but yep it is, sometimes i need to think before i ask
09:09ayiai want to generate chars, is there any function like (range "a" "z")?
09:10pjstadignonuby: using a sorted-map may make it shorter (character wise) and maybe more performant
09:10nonubypjstadig, will take a look
09:19joegallo,(take 5 (map char (range (int \a) (int \z)))
09:19clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
09:19joegallo,(take 5 (map char (range (int \a) (int \z))))(
09:19clojurebot(\a \b \c \d \e)
09:20joegallowhich is clever enough, but not very short (and also doesn't work, considering what range does exactly)
09:21ucbnonuby: (def first-by (comp first sort-by))
09:21nonubynice
09:22nonubywhen use common functions and macros like that do you keep them in a namespace, in a project, or just duplicate where required. reminds me of the .net days of every company had Acme.Enterprise.Commons
09:25ucbnonuby: what do you mean? your own common operations or what?
09:26nonubyfunctions that are handy buy omitted by clojure.core like first-by, any? etc..
09:31tickinghey, is there a string protocol, I can't seem to find one and (sadly) have to implement a new string type
09:31joegalloticking: what's the problem you're trying to solve -- perhaps you've decided on a particular solution prematurely
09:32joegalloregarding your precise question, though, the answer is no, there isn't a string protocol. java strings are java strings.
09:32joegallo(and it's a final class, you can't extend it.)
09:33tickingjoegallo, I have to process OCR XML documents, the representation in those is (horrible) to store words and lines as lists of characters with separator elements, where each character is associated with a bouding box
09:34joegallookay, that sounds like a problem -- what thinking has led you down the path of trying to create a new string type?
09:34tickingI want to keep my core page, character and word processing functions as clean and generic as possible, thus working with regular strings
09:34augustlcan I put ref reads in a dosync in order to get a synchronized view of multiple refs?
09:35joegalloticking: i see
09:35tickingmost of the functions do stuff like, find word in dictionary and substitute characters
09:35llasramaugustl: That would in fact be the raison d'etre of refs
09:36joegalloticking: have you ruled out just turning your objects into a plain old java String or StringBuilder and banging on that?
09:37tickingjoegallo, so my thought was to, rather than dragging all that burden, through all my functions, thus complicating them, to implement a type that implements the string protocol (if there was one ^^) that takes care of handling all the bouding boxes and other meta info
09:38joegallogotcha. here's my quick advice -- that's cutting pretty hard against the grain of the jvm, you might want to reconsider that approach.
09:38tickingjoegallo yeah the problem is that I have to emit them into a document where everyhing is as preserved as possible after I'm done with them ^^
09:38joegalloah, gotcha
09:38tickingI'm all ears ^^
09:39joegallosadly, i don't have much constructive advice, just "uhhhh, that sounds like a bad idea" ;)
09:39pjstadigticking: there's not a string protocol, but there is a sequence abstraction
09:39pjstadigcan you not just process sequences?
09:39tickingpjstadig, I'm using regex for the matching of similar words ^^
09:40pjstadigticking: can the regexes be replaced with sequence functions like take, drop, take-while, etc.?
09:41augustlllasram: I see :)
09:41augustlit could have been that refs were for coordinated writes only, nice to know they're also good for coordinated reads
09:41tickingpjstadig, I'm not shure, I could try
09:42pjstadigaugustl: the STM is an MVCC transaction system, so it gives you a snapshot view of ref-world for both reads and writes
09:43tickingjoegallo, thanks nevertheless ^^
09:44tickingpjstadig, thanks I'll probably try that, seems to be one of those cases where one gets bitten by the java heritage
09:46augustlI guess I'm asking more about best practices than possibilities. For all I know, a dosync that only does reads is frowned upon :)
09:46pjstadigaugustl: i wouldn't frown upon it :)
09:46augustlin other words, snapshot view for reads is only "supposed" to be used for reading inside dosyncs where you also do writes
09:47pjstadigI think you would only need to dosync around refs for a consistent read if you are also modifying them in some way
09:47pjstadigif you just have some global things you want to read consistently and they never change, you could use vars or atoms or something
09:47augustlthey are constantly modified
09:48pjstadigso, yeah, you would need a dosync to read consistently
09:48augustlso sequential dereferencing would lead to a inconsistent view of the multiple refs
09:48pjstadigright
09:48augustlderef it is! :)
09:48pjstadigaugustl: this is a right use of dosync, and you have my blessing
09:49augustlanyone else doing some early morning hacking before Clojure West starts in 2 hours? :)
09:49augustlpjstadig: \o/
09:49pjstadig:( i wish i was there
09:49ejacksonpjstadig: you're not alone :(
09:49augustlthere are still tickets available I think :P
09:49pjstadigaugustl: haha
09:52augustlwhich blows my mind, the lineup is great. I wonder why they didn't sell out
09:52tickingpjstadig, looks like regex can handle CharSequences, I'll take a look at how that works out ^^
09:52augustlmany of my norwegian friends didn't go since it's such a long flight from europe, much longer than to the conj in november..
09:52pjstadigticking: oh interesting
09:52tickingpjstadig, or did you mean the clojure sequence abstraction?
09:53pjstadigticking: not that it would help you, but i wonder if one could get clojure's sequences to extend CharSequence, then you could theoretically do regexen against an arbitrary sequence of characters
09:53pjstadigperhaps even a lazy sequence
09:53pjstadighmm
09:54tickingpjstadig that would be beyond awesome
09:54pjstadigticking: if you wanted to be able to run a regex against your OCR sequence you might be able to deftype or defrecord something that extends CharSequence
09:54pjstadigbut that seems like a pretty big hammer
09:56tickingpjstadig that whole ocr format is a giant bug, a hammer seems like the apropriate tool ^^
09:56pjstadigcould be :)
09:59hyPiRionaugustl: yeah, it's a long way from Norway.
09:59hyPiRionBut it's mostly about the price, since we're talking about at least ~1k in travel expenses
10:02ejacksoni calculated more from the UK
10:02ejacksonone day
10:04hyPiRionIt's about 1k euro in plane tickets
10:04hyPiRionat least from here
10:06drorbemet(map list (partition-all 3 (range 9)))
10:06drorbemetHi, how do I lift the lists up, out of the enclosing list so I can call map list on those?
10:06drorbemet(((0 1 2)) ((3 4 5)) ((6 7 8)))
10:08hyPiRion,(mapcat list (partition-all 3 (range 9))) ; ?
10:08clojurebot((0 1 2) (3 4 5) (6 7 8))
10:09hyPiRionoh, you want to map each element in the newly partitioned lists
10:09drorbemetNot this (((0 1 2)) ((3 4 5)) ((6 7 8))) but like this ((0 1 2) (3 4 5) (6 7 8))
10:09drorbemetIt is called lifting as far as I remember but with that term I didn't find the corresponding function in the Clojure libs.
10:09matthavener(map first l) ?
10:09drorbemetflatten is to much though
10:10hyPiRion,(map (partial map list) (partition-all 3 (range 9)))
10:10clojurebot(((0) (1) (2)) ((3) (4) (5)) ((6) (7) (8)))
10:10hyPiRionI suspect.
10:10hyPiRion,(mapcat (partial map list) (partition-all 3 (range 9))) ; It has to be some of these
10:10clojurebot((0) (1) (2) (3) (4) ...)
10:10matthavener,(map first '(((0 1 2)) ((3 4 5)) ((6 7 8))))
10:10clojurebot((0 1 2) (3 4 5) (6 7 8))
10:11hyPiRionoh, drorbemet, that's mapcat
10:11drorbemethyPiRion: I want to zip the lists comming from partition-all
10:11drorbemetmapcat? ok I try it
10:11hyPiRion,(mapcat list (partition-all 3 (range 9))) ; <<- ?
10:11clojurebot((0 1 2) (3 4 5) (6 7 8))
10:12hyPiRionIs that what you want, or do you want to perform some function on 0, 3 and 6, etc?
10:12drorbemetAh, thanks mapcat does lifting ok, thanks :-)
10:13drorbemethyPiRion: yes, thanks
10:13Chousuke,(apply map + (partition 3 [1 2 3 4 5 6 7 8 9]))
10:13clojurebot(12 15 18)
10:14augustlare there any non-macro ways to invoke methods on java objects?
10:15Chousukenon-macro?
10:15hyPiRion,(clojure.walk/macroexpand-all '(.read System/in))
10:15clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.walk>
10:15hyPiRionhumf
10:15hyPiRion,(require '[clojure.walk :as walk])
10:15clojurebot#<SecurityException java.lang.SecurityException: denied>
10:16hyPiRionWhaa :(
10:16Chousukethe underlying special form is .
10:16Chousuke,'(.foo bar)
10:16clojurebot(.foo bar)
10:16Chousukeoh, right, that doesn't get expanded at read-time
10:19tickinguse vs require which one was supposed to superseed which again?
10:25alexnixonticking: require + refer > use
10:26tickingalexnixon, I cant seem to find the flag for importing all iwth require ^^
10:27alexnixonin ns form, (:require [foo.bar :refer :all])
10:27alexnixonbut it's generally preferred to explicitly refer what you need or alias the ns
10:31augustlthe problem is that I have a java object, a keyword for the method, and a vector for its arguments
10:31augustlso I need to apply the arguments etc
10:31Chousukeyou'll probably need reflection for that.
10:32augustlwhich is what the "." forms does under the hood I guess?
10:33Chousukeaugustl: if it doesn't have type hints, yes
10:33jcidahohey - Am looking for approaches for comparing HTML snippets - trying enlive with midge, although I still get issues with whitespace, carriage returns etc in the enlive data tree. Anyone tackled something similar?
10:34augustlChousuke: ah, good point.. I guess it's better that my API takes a function that can be called, that itself calls the interop, rather than passing data run-time, since there are compile time optimizations to be had..
10:35pjstadigticking: https://gist.github.com/pjstadig/5187587
10:38zerokarmaleftpjstadig: was naming your localhost "jane" inspired by OSC?
10:38pjstadigyeah
10:40zerokarmaleftthought so...hope that works out for your investment portfolio :D
10:40pjstadighehe
10:40pjstadighttps://github.com/pjstadig/clojure/commit/03093720d44068dddaf8fdda0ffd9504acc9faa8
10:42tyler__shouldn't it be :clojure/west not clojure/west? just sayin
10:42tyler__actually nevermind
10:42tyler__brain not up yet
10:43llasramtyler__: On this channel it's just ::west
10:43tyler__lol
10:43tyler__(inc llasram)
10:43lazybot⇒ 6
10:44tyler__ironically inc side effects
10:44tyler__affects?
10:44tyler__to affected something is to make it effected right?
10:44tyler__affect
10:45tickingpjstadig, pretty cool ^^
10:45tyler__is
10:45pjstadigtyler__: you are commended, sir http://paddynotpatty.com/
10:46tyler__(inc pjstadig)
10:46lazybot⇒ 4
10:49tyler__lol i love the st patty twitter bot
10:49tyler__(inc public/shaming)
10:49lazybot⇒ 1
10:51pjstadig(inc public/shaming)
10:51lazybot⇒ 2
12:28duncanmis there a separate channel for clojurescript?
12:29duncanmhmm, this channel looks more lively than the other one
12:30nDuffduncanm: It's an unusually slow morning, but things are indeed generally lively here.
12:30duncanmyeah
12:30duncanmi used to be more active here
12:30duncanmnDuff: do you use clojurescript?
12:31nDuffduncanm: I don't generally answer questions of that form -- often, "do you use X?" is "are you willing to answer an arbitrary question about X I haven't yet chosen to ask" in disguise.
12:32duncanmnDuff: well, if you don't use clojurescript at all, then all subsequent questions are moot
12:32nDuffduncanm: Only if you were talking only to me. There's just short of 600 people here.
12:32duncanmnDuff: i was wondering about the implementation of vars/bindings in clojuresript
12:32nDuffduncanm: ...so ask _the channel_ that question.
12:32zodiakalso a slow morning due to c/west I would think
12:33ambrosebsduncanm: Last I checked, vars don't exist in CLJS.
12:33zodiakvars don't exist in cljs ?!
12:34supersymlol@nduff
12:34duncanmambrosebs: i thought i read something in google groups from dnolen
12:34ambrosebsduncanm: the compiler has an internal hash map of some sort to keep track of them.
12:34duncanmbut i can't find the post now
12:34supersymthat is so true about the questions... now I realise I do that sometimes as well :D
12:34zodiakso, you can't do (def foo) ?
12:34ambrosebszodiak: you can, but there's no #' special form.
12:35ambrosebszodiak: there are no Vars with a capital :)
12:35zodiakoh. well, that's not quite such a loss then :)
12:35ambrosebszodiak: I want them.
12:36duncanmambrosebs: http://markmail.org/message/fouk2zgk3v32zqxn#query:+page:1+mid:fouk2zgk3v32zqxn+state:results
12:36duncanmambrosebs: maybe i'm misunderstanding dnolen
12:37ambrosebsduncanm: not sure, I'll check the compiler ;)
12:37duncanmambrosebs: i was writing some typescript in node.js, and i really wanted something like fluid-variables in scheme
12:38duncanmambrosebs: just for handling process.cwd()
12:38duncanmi realized the javascript people don't even have the terminology of 'fluid variables' or 'dynamic bindings' in the lisp-sense, so i thought the clojurescript people are the only ones who can answer my question
12:39duncanmambrosebs: you're the one working on typed clojure?
12:39ambrosebsduncanm: haha yes
12:39ambrosebsdon't worry, ask me whatever you like ;)
12:39nDuffduncanm: binding doesn't do a tremendous lot that you don't get with let in cljs -- it's just a try/finally block with set! calls
12:39duncanmambrosebs: that's really cool, i went to school at Northeastern, and i'm friends with SamTH
12:40nDuffduncanm: ...and a warning if things weren't declared ^:dynamic
12:40duncanmambrosebs: i was an undergrad when he worked on typed scheme
12:40nDuffduncanm: Since JavaScript isn't multithreaded, that's really all one needs.
12:40ambrosebsduncanm: wow that's great!
12:40nDuffs/binding/dynamic binding/
12:41duncanmnDuff: i'm using async.js (maybe this is not needed with clojurescript), but with multiple async calls, i was trying to find a way to handle cwd, or basically the current output port, things like that
12:41ambrosebsduncanm: Sam's been an invaluable source of help for over a year for me.
12:41ambrosebsI'm still pestering him with ideas :)
12:42duncanmnDuff: what about calls scheduled later?
12:44nDuffduncanm: Sounds like the same problem you'd have in Clojure (with the only difference that bound-fn* isn't implemented in cljs)
12:45tieTYTcan someone recommend a tutorial for me? i got it recommended yesterday but i'm at work now and can't find the link on google. It's more up to date than this one: http://java.ociweb.com/mark/clojure/article.html
12:45tieTYTthat one suggests using clj and people told me that's out of date
12:45tieTYTi think the tutorial may actually be from the clojure site. It seems like it's made from an atlassian wiki or something
12:46tieTYThas pages like "Getting Started" and it talks about all the different data structures. This ringing a bell?
12:46tyler__is there a channel for west?
12:46duncanmtieTYT: what are you trying to do with clojure?
12:47supersymwhats the problem with clj?
12:47tieTYTlearn it
12:47tieTYTsupersym: i was told that's an obsolete way to run clj files. now people use lein instead
12:47supersymyes you can
12:48supersymbut the repl is still handy.. I love lighttable a lot more for learning
12:48supersyminstarepl
12:48nDufftieTYT: If you're looking for a resource that covers modern tools (such as leiningen), http://www.clojurebook.com/ is pretty good -- but I don't know of anything free/online comparable.
12:48supersymbut I also have eclipse with leiningen plugin depends on what I want to do, focus on
12:48ambrosebstieTYT: try http://clojure-doc.org/articles/tutorials/getting_started.html
12:49tieTYTambrosebs: that's the one I was looking for! I can't find that one from google
12:50tieTYTsupersym: i don't know what any of those are
12:51supersymhttp://www.lighttable.com - but there is little documentation, pre-alpha software
12:51supersymauthor blog =
12:51tieTYTsupersym: I don't even know the fundumentals yet
12:52supersymhttp://www.chris-granger.com/2012/04/12/light-table---a-new-ide-concept
12:52ambrosebstieTYT: yes, that's an issue. It's the best site for beginners docs.
12:52tieTYTambrosebs: you think it's better than http://java.ociweb.com/mark/clojure/article.html ?
12:52supersymhaha ok sorry,...
12:53supersymbut its made from user-friendly perspective so not much to learn there but clojure
12:53ambrosebstieTYT: not sure. Just don't use anything on clojure.org.
12:53tieTYTsupersym: I gotta learn that first :P
12:53tieTYTambrosebs: ok
12:54tieTYTambrosebs: why's that?
12:54ambrosebstieTYT: it's rarely suitable for beginners.
12:54ambrosebsthere are much better resources out there
12:54ambrosebsclojure.org is great as a reference.
12:55supersymtieTYT: imma newb too in clojure, lt = "Light Table let's you see what functions are used inside of the one you're currently working on, not just by highlighting ones in your code, but by also showing you their code to the side"
12:55supersymso I find it useful to learn, the language actually
12:55supersymbut if you find it too daunting already ;) don't mind
13:05ciphergothis slingshot the recommended way to do exception handling in Clojure?
13:06nDuffciphergoth: it's very widely used
13:06ciphergothnDuff, sounds good :)
13:13ciphergothhmm, need to build this combination of map and reduce: http://hackage.haskell.org/packages/archive/base/latest/doc/html/Data-List.html#v:mapAccumL
13:22jcromartieI'd really like to just have clojure.tools.namespace.repl/refresh available all the time
14:11amalloyciphergoth: most people make do with just ordinary java exceptions. if you want to do something fancier, then yes, slingshot is the way to go
14:12ciphergothamalloy, thanks! It looks like creating my own exception hierarchy in Clojure could be a bit painful and not very Clojure-ish; slingshot could be nicer for that. But maybe not?
14:13Ember-hmm, ex-info and ex-data won't work?
14:13Ember-in my opinion those kinda deprecated most of slingshot
14:14cap10morganis there a good way to debug "Exception in thread "main" java.lang.Exception: No namespace foo" errors? I want to figure out what in the source file that defines things in that namespace is breaking it.
14:15amalloyEmber-: those provided better primitives; slingshot still adds a lot of functionality on top of them
14:15tyler__where are people going for lunch?
14:15Ember-or well, of course slingshot provides all kind of nice things yeah
14:16Ember-tyler__: you do realize that there's people all around the world in here? :)
14:17amalloyciphergoth: sure, that would be easier in slingshot. however, consider the fact that it's not easy already as a warning that it's not really the Clojure Way
14:17Ember-from all around
14:17Ember-own exception hierarchy in clojure sounds kinda dangerous
14:17Ember-or well, not dangerous
14:17Ember-just tedious :)
14:18nDuffcap10morgan: Can you provide a reproducer for that? Barring that, a full (chaining included) stack trace?
14:20cap10morgannDuff: sure, but it's a garden-variety kind of error. I have a file that implements the mail_batcher.t-core ns for midje tests, but when I try to run `lein midje` I get the no namespace error b/c something is wrong in the file, syntax-wise I guess.
14:21amalloycap10morgan: mail_batcher.t-core is not a namespace name that you can use
14:21nDuffcap10morgan: sounds like something typically related to not following the convention for mapping names between file and namespace names.
14:21nDuffcap10morgan: mail-
14:22nDufferr, mail-batcher.t-core as your ns, and mail_batcher/t_core.clj as your source, would make sense.
14:22cap10morganamalloy: huh, we have been using it. but I'll try making that change.
14:22amalloyit'd probably work if you never tried to require that file from another file
14:23cap10morganamalloy: that file was use'ing mail_batcher.core. fascinating.
14:24cap10morganchanging that *does* seem to have improved the stacktraces, though
14:26cap10morganyep, all good now. thanks all.
15:06whilohi
15:08whiloi am trying to build my clojurescript application with the openlayers-3 version, which uses the google closure compiler. https://github.com/openlayers/ol3
15:13whiloi have added :libs ["libs/ol.js"] to lein-cljsbuild compiler configurations as documented on http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html
15:13thm_prover_sorry if this is repeat (other client appears to have frozen)
15:14thm_prover_what is an actively maintained peg parser library for clojure? I'm currently looking at clj-peg, fnparser, ... but not sure what to go with
15:14whilothm_prover_: something like this: https://github.com/richard-lyman/amotoen/ ?
15:15nDuffthm_prover: I haven't found one that I was happy with. That said, my requirements included support for left recursion, so that's maybe a special case.
15:15thm_prover_whilo: I like this line from the documentation: "In other words: Amotoen is better than clj-peg. Amotoen is not AOT'd."
15:16whilothm_prover_: i am atm. struggeling with it :-) but i am very new to parsing. my first real parser with ast
15:17raekI thought people quit AOT compilinging their libs in 2010
15:17thm_prover_whilo: great, pearhps we can help each other out
15:17thm_prover_whilo: out of courisity, what are you parsing?
15:17whilohttps://github.com/RagingRanek/jekyll/blob/master/doc/syntax
15:19whilothe more i work on it, the more i like the simplicity of lisp "syntax" :-D
15:20whiloabout my clojurescript problem. i could require the namespace for a debug build with whitespace only and can construct some objects, but munging of ol.js breaks my code
15:22whilohas somebody clues of how to build an actual external closure compatible library with lein-cljsbuild and closure? on the other hand if i try to use ol-whitespace.js with my whitespace build, both include google closure libs and conflict
15:23tyler__followed instructions in https://github.com/dgrnbrg/spyscope but i can't access in my lein repl. is it a lein issue or a library issue?
15:25thm_prover_does cgrand hang out here? I just stumbled across parsley (and it's claim for incremental parsing) and woudl love to chat about how it works
15:30FrozenlockAny libraries to create invoices? (clj-pdf?)
15:31thm_prover_I use itext for producing pdfs
15:33Frozenlockthis? --> https://github.com/yogthos/iText
15:35TimMcWow, this midje test actually passes: (fact (/ 1 0) =not=> 17)
15:35TimMcDoes that seem insane to anyone else?
15:35hyPiRionwell, it is a fact that 1/0 is not 17.
15:36Frozenlockwhat is '=not=>'?
15:36TimMcYes, in a strict sense, it is true, and I see why it does it that way...
15:36TimMcFrozenlock: It's a midje-specific symbol.
15:36TimMc(fact (+ 1 1) => 2)
15:36Frozenlockah, ok.
15:37TimMcI had a test that was incorrectly passing because it was throwing an error.
15:37hyPiRionTimMc: I get why you're kind of surprised, considering most test frameworks throws errors when they crash
15:38TimMcSo it doesn't seem weird to you?
15:38hyPiRionTimMc: I don't know.
15:38hyPiRionI would probably do => testing instead of eliminations.
15:39meliponehello! How can I remove the nth element from a list?
15:41nDuffmelipone: That's not a particularly efficient thing to do, particularly if it's happening in a loop. What's your use case? Ideally, there might be a better approach.
15:41hyPiRionmelipone: hello! As nDuff commented, it's not particularly efficient. However, clever use of split-with should give you what you'd like.
15:42hyPiRion,(split-at 3 (range 10))
15:42clojurebot[(0 1 2) (3 4 5 6 7 ...)]
15:42hyPiRion,(let [[fst [_ & rst]] (split-at 3 (range 10))] (concat fst rst))
15:42clojurebot(0 1 2 4 5 ...)
15:42QStevendoes the guy behind webfui hang out here on occasion?
15:44jtoy_can someone redirect me to a better explanation of how to use ->> ? this page is not clear enough for me: http://clojuredocs.org/clojure_core/clojure.core/-%3E%3E
15:44jtoy_also is there a googleable name for that?
15:46xeqijtoy_: I call it thread-last
15:46xeqi(->> 1 (- 2) (- 7))
15:46xeqi&(->> 1 (- 2) (- 7))
15:46lazybot⇒ 6
15:46meliponeI was thinking of (take nth (drop n+1 ...) type of thing
15:47whilothm_prover_: the unfinished parse-tree of parseley seems to be a lot more informative than the Exception from amatoen
15:47whiloparsley
15:47thm_prover_whilo: ah, you've tried both
15:47whilonope, i have just learned about parsley as u posted it :-D
15:51jtoy_i see
15:53jtoy_hmm, why are these different though? (->> 1 (- 2) (- 7)) and (-> 1 (- 2) (- 7)) ? shoudlnt 2nd and last be the same here?
15:53xeqijtoy_: -> threads as the first argument
15:54xeqi(-> 1 (- 2) (- 7)) = (- (- 1 2) 7)
15:54jtoy_ah ok, i see
16:00jcromartieclojure.xml and it's friends are totally useless when it comes to unknown outside XML and namespaces
16:00jcromartieits
16:04muhooi remember someone, maybe it was cemerick, was working on coming up with a pattern to deal with function application that had to happen in a particular order, like middleware wrapping
16:04xeqimuhoo: I think that became part of nrepl's middleware
16:05xeqi* middleware declaration
16:05muhooxeqi: cool, do you remember which project it ended up being incorporated into (so's i can have a peek at the source)? was it nrepl, piggieback, or something else?
16:05cemerickmuhoo: yeah, don't look at it though; I can't use any useful dependencies in nREPL that would make such things way way easier
16:06muhoowhich dependencies?
16:06muhoobecause i'm bumping into this problem in a different domain, not nrepl, and i may be able to make use of other solutions, if they're out there.
16:07Glenjaminhi guys, i'm getting a weird issue with clj-http+compojure, if i pass the http response as a compojure route return value, I can see the XML response - but if i use :body on it, i get an empty string. Any ideas how to debug?
16:08muhoohell i'm not even sure what to google for :-/
16:09cap10morganis there a shorter way to write this: (reduce conj (map (fn [[key val]] {val key}) {:foo "bar" :baz "qux"})) ;; mapping from one map to a new, modified map being the aspect I'm interested in ??
16:09lazybotcap10morgan: What are you, crazy? Of course not!
16:10cemerickmuhoo: something like dependency-list works for a lot of simple cases: https://github.com/clojure/clojure-contrib/blob/master/modules/graph/src/main/clojure/clojure/contrib/graph.clj#L190
16:12borkdudecap10morgan
16:12borkdude,(let [m {:foo "bar" :baz "qux"}] (zipmap (vals m) (keys m)))
16:12clojurebot{"qux" :baz, "bar" :foo}
16:12xeqi&(clojure.set/map-invert {:foo "bar" :baz "qux"})
16:12lazybot⇒ {"qux" :baz, "bar" :foo}
16:13muhoocemerick: ok, thanks. makes sense, and now i can google for "topological sort" :-)
16:13borkdudexeqi why is that in clojure.set?
16:14xeqiborkdude: I'm going to guess legacy reasons?
16:14muhooOIC, it's bascally a dependency problem, like aether/maven solves. middleware A depends on middlware B etc., and the algorithm needs to sort them first before applying them
16:15borkdudexeqi funny...
16:17borkdude$find-fn {:a 1 :b 2} {1 :a 2 :b}
16:17borkdude$findfn 1 2
16:18lazybot[clojure.core/unchecked-inc-int clojure.core/unchecked-inc clojure.core/inc]
16:18borkdude$findfn {:a 1 :b 2} {1 :a 2 :b}
16:18cgagrename-keys feels weird being in clojure.set to me as well
16:18lazybot[clojure.set/map-invert]
16:18borkdudeyeah =)
16:18borkdudegood night folks
16:23tyler__man Stuart Sierra is such a good speaker
16:24muhootyler__: he was a theatre major, he said in one talk
16:24muhooare you guys liveIRC'ing cljwest?
16:28owengalenjonesthis is kindof a crappy question but Im completely flumuxed, I have wildly different behavior from lein -run vs. java -jar uberjar: http://d.pr/i/t69G not even sure what to look for... Ive ran lein clean, lein compile (no output from this) then lein uberjar to create the jar file
16:29llasramowengalenjones: well, `lein run` will include the `dev` profile
16:29llasramowengalenjones: What does your project.clj look like?
16:30owengalenjonesmy dev profile has lein-midje midje abd bultitude in it
16:31owengalenjonesproject.clj: http://d.pr/i/MX23
16:31llasramOk... So honestly I'm not entirely clear on how they're acting different. In your screenshot, the lines from the uberjar run look identical to the `lein run` output up until you type `wtf`
16:32llasramUh, also maybe: https://www.refheap.com/paste
16:32owengalenjonesthe request response json only occurs in the lein run
16:32abpwoohoo: http://pedestal.io/
16:32llasramabp: sparkly!
16:33llasramowengalenjones: Are you sure you aren't just seeing output buffer flushes occurring differently?
16:34owengalenjonesno because the lein run will connect and insert things into a mongo database, the uberjar isnt
16:35nbeloglazovHi. I'm trying to setup paredit. I have problems with curly braces. When I put close brace it finds closest non-curly brace ) or ] and jumps there.
16:35nbeloglazovSo [:hello {:a 1|}] => [:hello {:a 1}]| .Does anybody know how to fix it?
16:35nDuffnbeloglazov: Which version? I haven't seen that in rather a long time.
16:36nbeloglazov22 or 23 beta
16:36nbeloglazovOk. I'll take a look at the vesion in emacs-live
16:38llasramowengalenjones: My psychic powers are failing today. Only thing I can think of is to add more debug logging to figure out where the divergence occurs
16:40owengalenjonesllasram: well I was thinking, the wtf is a debugging statement (pretty confused at this point) that should be displaying, do uberjars do anything with stdout? does it only display stdout in the -main fn?
16:41llasramowengalenjones: Ah, I misinterpreted what happened there. At the very least, make sure you print a newline after your debugging logging (`println` vs `print`, if that's what you're using)
16:41llasramowengalenjones: Otherwise your output will be buffered until a newline
16:51owengalenjonesllasram: ok thats really weird, the the program requests data from an api and then later sends it to mongodb, but in an uberjar the send-to-mongo fn wasn't doing anything until I put a println fn in it
16:55drorbemetHi, I am currently running Win7 with Eclipse, Counterclockwise with one repl and midje.repl autotest in a PowerShell terminal.
16:55drorbemetI am a bit supprised about the memory consumption. Most of the time there are two java.exe and two javaw.exe processes running. Each of them taking from 400 up to 800 Megabyte of RAM. Are there some options to configure that?
16:56drorbemetCould one java process be shared by multiple repl instances?
16:56drorbemetWould the situation be different with Emacs?
16:57technomancydrorbemet: you can use Leiningen's "trampoline" higher-order task to allow one of the JVMs to exit and only leave the project JVM
16:57owengalenjonesllasram: the fix: https://www.refheap.com/paste/12698 any way thank you for putting me the on the right track...
16:58technomancyI don't know if you can do that with ccw though
16:58technomancyI recommend keeping a single (possibly trampolined) repl open but I don't know if the tooling around midje/ccw supports that very well
16:58tyler__anyone have an idea of why my dependency code isn't being use in my lein profile? https://www.refheap.com/paste/12699
16:58llasramowengalenjones: I... um. Well. I'm glad it's working for you
16:59tyler__used*
16:59drorbemetAh, trampoline does that, ok I look into that, thanks.
16:59drorbemetBesides trampoline, are there possibilities to optimize the JVM process itself regarding memory consumption?
17:00technomancydrorbemet: you can set :jvm-opts to include memory tuning in project.clj
17:00balintI'm having problems with type-hints
17:00technomancydrorbemet: having a ton of JVMs open is always going to be expensive though
17:00balintI have to this code: (let [explored? (fn [^long i] (aget ^booleans explored (dec i)))]
17:01balintI get ClassCastException [Ljava.lang.Boolean; cannot be cast to [Z when I run it though
17:01balintexplored is defined as a boolean java array
17:01hiredmanyou have an array of boxed Boolean objects, not primitive booleans
17:01balintexplored (make-array java.lang.Boolean V)
17:02balinthiredman
17:02balintsorry
17:02muhooso i have a stupid question about clojure and reentrancy and interop. if a clojure function is called from a java-driven callback interop thread, and i'm only managing clojure persistent data within it, it's reentrant and thread-safe, right?
17:03muhooi'm dealing with a java library that is an absolute zoo of locks and synchronized and crap, so i'm a bit spun around.
17:03drorbemettechnomancy: ok thanks, I am not complaining, but somehow I have to manage my 8Gigs RAM currently available ;-)
17:04technomancy8 gigs! luxury.
17:05balinthiredman: thank you, that indeed helped
17:05balintI converted the array definitions from (make-array ^java.lang.Boolean V) to (boolean-array V)
17:05llasramLast year I was too busy to upgrade Emacs. Now I'm too busy to install the 32GB of RAM just sitting on my desk...
17:05llasramOne day, one day
17:05balintso next question
17:05balintwhy does the following code:
17:05balintset-finished (fn [^long offset ^longs values]
17:05balint (doseq [idx (range (count values))]
17:05balint (aset ^longs finished (+ offset idx) (nth values idx))))
17:06balintgive me "call to aset can't be resolved." ?
17:06hiredmanwin 15
17:08muhoobalint: type "aset" in your repl and see if #<core$aset clojure.core$aset@191d528d> or similar comes back?
17:08balint#<core$aset clojure.core$aset@7f7ef0a7>
17:09muhoowell, at least your repl can resolve it.
17:09mpenetbalint: probably because finished is not an array
17:09brehautbalint: just btw, type hints are hints, not checks or coercions.
17:10brehautbalint: hints are only used to provide compile time optimisation / remove reflection / specific java method overloads to use
17:10balintthe original problem is that I have a huge graph and need to run an algorithm on it fast
17:11balintso I'm doing all this because I did not prevail with the functional (meaning: using persistent data structures) method
17:11balintby huge I mean ~800.000 vertices
17:11brehautdid *warn-on-reflection* tell you it was reflecting on those calls?
17:12balintand running the current version I saw in the profiler that ~60% of CPU time is spent in reflection.getMethods() (or sg similar)
17:12balintbrehaut: exactly
17:12nDuffbalint: if I define finished with (into-array Long [...]), that code compiles perfectly.
17:13balintmpenet: this is how I defined finished: (let [finished (long-array V) …])
17:13nDuff...same with (into-array Long/TYPE ...)
17:14balintnDuff: I want to allocate an array of a certain size that I know in advance
17:16nDuffbalint: *shrug*. Works for me.
17:16balintnDuff: the definition of the array works for me, too
17:16mpenetbalint: it's another of the args of aset then that could cause problems
17:17balintit's the "set-finished" code snippet (see above) that throws the reflection warning
17:17balintthis does not issue warnings:
17:18balintset-finished (fn [^long offset ^longs values]
17:18balint (doseq [idx (range (count values))]
17:18balint (aset ^longs finished (+ offset idx) 0)))
17:18balintI replaced (nth values idx) with 0 in the last line
17:19amalloybalint: why are you writing this function at all? just use System/arraycopy
17:20amalloyit takes all the args you need to do offset/slice copying
17:20balintamalloy: thank you
17:20balintmy java foo is very basic
17:20amalloy$javadoc System arraycopy
17:20lazybothttp://docs.oracle.com/javase/6/docs/api/java/lang/System.html#arraycopy(java.lang.Object,%20int,%20java.lang.Object,%20int,%20int)
17:20nDuff"java fu", btw
17:21balintnDuff: you're wright ;)
17:22amalloyor use java.util.Arrays/copyOfRange if you don't need to allocate the object yourself
17:33owengalenjonesllasram: ha, actually this was the culprit: http://stackoverflow.com/questions/12924870/leiningen-uberjar-different-results-from-lein-run
17:34balintamalloy: thank you, the first part of the algorithm just ran in 11 seconds
17:34balintbefore it would have taken ~20 hours :)
17:34balintthere is some speedup to be had in using java arrays, it seems
17:40FrozenlockIn the *nrepl* buffer, when I try to autocomplete a namespace that's required but not :as, I get a java.lang.ClassNotFoundException. IIRC, that wasn't the case in swank; is it normal in nrepl?
17:40FrozenlockFor example: (clojure.string/<TAB> *BOOOM!*
17:40xeqiFrozenlock: what version of nrepl.el?
17:40tgoossensI suppose that some of you try to put as much immutability in java as well.
17:40tgoossensI was wondering
17:40xeqiI remember that happening on an older version for me
17:40clojurebotversion ranges are nothing but trouble: http://nelsonmorris.net/2012/07/31/do-not-use-version-ranges-in-project-clj.html
17:40Frozenlock0.1.7-preview
17:41tgoossensif you are making immutable classes in java. Why not just make the (internal (final)) fields public?
17:41tgoossensi've always learned that making getters is a good practice
17:41tgoossensbut is it really necessary here?
17:43tgoossensbecause seriously, currently i can think of no reason why a public field would be bad in case of an immutable java class
17:44amalloytgoossens: indeed, when i define a java class that is really immutable, i don't write any getters
17:45amalloygetters are an OO idealism - in theory it would be nice if stored fields were indistinguishable from computed values (everything is just a message), but in practice no java code does that
17:46xeqitgoossens: because then you can't lazily compute the field?
17:46tgoossenshowever "the good practice" i learned makes me feel bad sometimes. What if the string representation you chose of lets say an "Address" would be better with an Address class
17:46tgoossensthen what?
17:46tgoossensmy current idea is
17:46tgoossensyou define a new immutable class
17:48xeqiFrozenlock: I'm on 0.1.7 for what its worth
17:48borkdudegetters/setters is one of the things that's hard to sell when I introduce first year students with java..
17:49Frozenlockxeqi: Hmm.. I'll try to update then. Thanks
17:50djpowelljava beans were basically an alternative to activex components, a convention for making ui components for an ide. at some point people got confused and decided it was the basis of good oo design
17:50tgoossensborkdude: i'm currently in discussion with someone about the topic :)
17:51djpowellhttp://www.javaworld.com/jw-09-1997/jw-09-beanbox.html
17:52borkdudetgoossens some frameworks make use of getters/setters, but that's more like "do it, because people expect you to"
17:53borkdudetgoossens C# has a somewhat more polished version of this called properties
17:53tgoossensproperties if i recall ?
17:55borkdudewhat is pedestal.io about? how does it relate to the existing clojure common webstack?
17:56tgoossensborkdude: what did you say on twitter about programming :p ? (and what did i respond!)
17:56borkdudetgoossens I'm not programming
17:56borkdude=)
17:57abpborkdude: It's neatly integrating stuff and solving major pain points.
17:58abpFunny thing is, I were working on a vector based routing dsv too, as well as other structural helpers.
18:05devnhyPiRion: Ever get a chance to look at http://dev.clojure.org/jira/browse/CLJ-1181 ?
18:06borkdudeabp I'm reading about the ring handler vs interceptors thing now
18:07hyPiRiondevn: oh, sorry
18:07hyPiRionI can do a peek at it now
18:08devnhyPiRion: no rush, just doing some "effective badgering"
18:09hyPiRionheh
18:11abpborkdude: I'm reading up on routing, need to go back to interceptors after that.
18:11borkdudeabp first thought: are reducers used in here somewhere? :P but probably not
18:49SegFaultAXDid irccloud just die?
18:50SegFaultAXtechnomancy: I use irssi + znc, personally.
18:52brainproxyhaving trouble pulling in deps for the pedestal samples.. anyone else experiencing the same?
19:05jonasacany vim users here, particularly foreplay.vim/fireplace.vim ?
19:05SegFaultAXjonasac: Yes.
19:06jonasacSegFaultAX: have you found a way to set up a quasi repl when you are not in a project, i.e the repl file is missing
19:09ivanheh http://bugs.sun.com/view_bug.do?bug_id=4909760
19:10tomojhmm.. interceptors
19:12hiredmancontinuations
19:12tomojbut with, uh.. reflection?
19:25tgoossensborkdude: i hope i didn't gave that other guy (in the discussion) nightmares
19:30yedioh snap clojurewest is today?
19:31brehautyes
19:40yediprobably will be a while before the vids come out though
19:41Frozenlock:(
19:41yedioh what, why have i not heard of lobos before
19:41brehautclojurewest is a bit snappier than the conj with vids
19:41yediwhy am i messing with stupid sql scripts
19:43abpbrehaut: Yeah but infoq delays them across the coming years. ;)
19:43tieTYTif this is a troll, it's not intentional, but: Between scala and clojure, which one is more functional?
19:43yedilol
19:43brehauthaha
19:43brehautwell scala is marketed as being an object function hybrid, and clojure is marketed as function
19:43brehautyou decide
19:44brehauthowever
19:44hiredmanI suggest going to ask in #scala
19:44technomancyhiredman: heh; that would be amusing
19:44brehautthe scala guys have some amazingly functional libraries.
19:44tieTYTok I shall
19:46brehautfrom #scala "sproingie:
19:46brehautmodern thinking in FP is heavily oriented toward types, which clojure doesn't do" :)
19:46Glenjamincan anyone tell me why this doesn't eval? (-> :a (fn [b] (do (prn b) b)))
19:46hiredmanmacroexpand it
19:46technomancybrehaut: I've always thought that was a weird conflation
19:47yeditechnomancy: where do you think the idea stems from?
19:47Glenjaminhiredman: oh right, i see
19:47technomancykind of like how people think dynamic types are for "scripting languages"
19:47Glenjaminis there a way to define functions inline for threading?
19:47Glenjaminaha
19:47Glenjamini need more parens
19:47technomancyyedi: because most FP research has been done by haskellers?
19:48yedithat's what i figured, but i wasn't sure if it was because FP researchers specifically chose haskell because of its strong typing you know?
19:48yedilike which direction the correlation goes
19:48pjstadigGlenjamin: i've been bit before by the fact that I think of -> as working with values at runtime, when, in fact, it is a macro
19:48technomancyit's a cultural thing mostly I think
19:49Glenjamini'm now having an issue with -> on a multimethod
19:50Glenjaminlemme see if i can isolate a testcase
19:52Glenjaminright
19:52Glenjaminhttps://gist.github.com/glenjamin/3a2fb21af6462a4ac6da
19:52Glenjamincan anyone explain to me why this isn't allowed?
19:52brehauttechnomancy: i agree. a bit odd
19:52brainproxytomoj: the description of the interceptor stuff makes me think of the state monad, but with a dsl for controlling transition between steps in the computation
19:57tieTYTdoes clojure have algebraic data types and pattern matching?
19:57Glenjaminthere's no pattern matching
19:57hyPiRiononly destructuring
19:57technomancypattern matching is in a library
19:58Glenjamini believe while you can sort-of do ADTs, the general idea is to just use built-in types?
19:58technomancysince there are macros it doesn't need to be in the core language
19:58tieTYTi see
19:58tieTYTi think i'm going to learn clojure instead of scala. It's more alien
19:58amalloyGlenjamin: that gist has no meaningful content in it. all the -> form there does is expand to (render (:body {body "some string body"})), which is equivalent to (render "some string body")
19:58tieTYTand I like the inventor and his lectures
19:58technomancypattern matching and FP is another weird conflation
19:58technomancythere's no reason you can't have pattern matches in imperative languages
19:58amalloywhether that works or not has nothing much to do with ->
19:59brehauttechnomancy: if one was a smartarse they would point to scala as example of that ;)
19:59technomancybrehaut: zing!
19:59lovemuffini think its weird that lein isn't bundled with clojure binary
19:59technomancywhat clojure binary?
20:00brainproxylovemuffin: clojure is just a library
20:00lovemuffini mean the release
20:00amalloylovemuffin: the clojure binary is bundled with lein, so to speak
20:00technomancyit is kind of silly that clojure links to .zip file downloads =\
20:00brainproxylovemuffin: think of lein as a handy way to work with jars coming from maven, clojars, etc.
20:00brehauttechnomancy: its the future
20:00Glenjaminamalloy: i've copied the definition of the required file in
20:00brainproxyincluding clojure itself
20:00Glenjamini appear to be falling foul of some sort of compile-time type checking :s
20:01brehaut(note: future only with a mayan style calander)
20:01lovemuffinwell as a new comer, it makes starting out more confusing, so i download clojure, no i need lein too apparently, what is lein? etc.
20:01technomancylovemuffin: clojure.org is really a bad place for newcomers
20:01technomancyunfortunately
20:01tomojbrainproxy: the state monadiness I see is maybe the manual dynamic binding conveyance?
20:01brainproxylovemuffin: you can get up and running with lein super fast
20:02brainproxylovemuffin: basically download the lein script, chmod +x, run it and it will bootstrap itself
20:02technomancymuch better to start from clojure-doc.org
20:02brainproxylovemuffin: at that point you can start playing w/ clojure immediately simply by running `lein repl`
20:02lovemuffini got that far now, i'm just more commenting as a new comer, in other languages, most of what you need comes with the release package to start trying it out
20:02Glenjaminfinding the "you're new, do this" guide was far harder than it should have been
20:03brainproxysure, that's fair criticism
20:03Glenjamingoogle throws up lots of outdated tutorials
20:03lovemuffinGlenjamin: yea, i mean i found it, but it took a few clicks
20:03technomancylovemuffin: unfortunately no one in here has the ability to fix clojure.org
20:03technomancyI think we all agree though
20:03brainproxylets take it over w/ a stampede of lambdas
20:03Glenjaminneeds more blogs and link backs to clojure-doc.org i guess
20:04hiredmanb/win 15
20:04brainproxytomoj: i saw it in the description of how interceptions are chained
20:04brainproxy*interceptors
20:07yediwhose behind clojure-doc.org
20:07tomojwhat's the state?
20:07yediwho's*
20:08Glenjaminaaah, "No single method" means "no method with arity 1"
20:08NeedMoreDesu(Thread. (fn[] (/ 0 0))) -- can I print stacktrace, given a thread?
20:09pjstadig(Thread. (fn [] (try (/ 0 0) (catch Exception e (print-it)))))
20:09yedihas anyone checked out pedestal's clojurescript methodology/philosophy? and if so what do you think?
20:09tomojI mean, if the state is the context, then we have `do _ <- interceptorA; _ <- interceptorB; ...`, i.e. `interceptorA >> interceptorB >> ...`?
20:10NeedMoreDesupjstadig: Can I do it from other thread, given thread object?
20:10hiredmanmore like some combination of state and continuation
20:10tomojstill, what's the state? :)
20:10pjstadig(.setUncaughtExceptionHandler t some-handler)
20:11pjstadigthere's also (Thread/setDefaultUncaughtExceptionHandler some-handler)
20:11hiredmantomoj: it sounds like the thing the docs call the `context`
20:11pjstadigNeedMoreDesu: http://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler)
20:11hiredmanwhich is some combination of other stuff and ring's request and response stuff it seems like
20:11tomojbut isn't that just the argument and return types of the continuations?
20:18tomojI was thinking maybe they looked like iteratees, and oleg says iteratees are state and cont monads
20:18blrIl0vemushr00ms
20:19blrsigh, wrong channel, sorry.
20:20tomojso hmm, the context has both the state and cont bits, depending on where you look inside it?
20:21tomoje.g. terminate is #(dissoc % :io.pedestal.service.impl.interceptor/queue)
20:22ravsterhey, does anyone out here have experience with geohash-36?
20:23amalloyblr: time to change all your passwords
20:24amalloy~anyone
20:24clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
20:25blramalloy: clearly I should have stayed in bed today.
20:26mroweblr: "wrong channel"? which one did you mean to put it in?? :-P
20:27blr#sshpassworddisclosure
20:30lovemuffinso im new to clojure, i want to build a supervisor/worker type app, how can i use threads for this? is it a good idea? with processes if a worker spawned crashes thats ok, it wont crash the entire app, main process
20:30ravsteramalloy_: just curious. no help required atm.
20:30NeedMoreDesupjstadig: http://www.everfall.com/paste/id.php?g8m0uog0kp1d what am I doing wrong?
20:30tyler__uh oh: Could not find artifact io.pedestal:pedestal.app:jar:0.1.0-SNAPSHOT in clojars (https://clojars.org/repo/)
20:32NeedMoreDesulovemuffin: I'm writing supervisor/process/server stuff now.
20:33lovemuffinbut i want to use threads instead of processes if possible, i just dont know if clojure provides a way to not crash the main process if a thread has some uncaught exception or whatever
20:34NeedMoreDesulovemuffin: Oh. Plenty of ways. Like me sitting and trying to GET an exception. (.start (Thread. (fn [] (/ 0 0))))
20:35brainproxytomoj: right, so maybe more like the state transformer on the cont monad
20:36NeedMoreDesulovemuffin: yet I had some problems with futures.
20:37NeedMoreDesuSo now I stick to promises.
20:38lovemuffinare try catch finally close to being free, or that is no real performance cost for using it too much in clojure/jvm ?
20:41jimkcaranyone want to help me with parsing some basic XML?
20:43devnanyone looking at pedestal?
20:44redingertyler__: In project.clj, change the dependency to be on io.pedestal/pedestal.app 0.1.0 (not the snapshot)
20:44Frozenlockdevn: I've seen the announcement, but nothing on the homepage convinved me it was superior to the existing alternatives.
20:44tyler__redinger: thn
20:45tyler__thnx*
20:46devnFrozenlock: I think they're doing a poor job of marketing it. I listened to the podcast and some of the ideas were interesting. Ultimately it seems like something that I might use for a client app, but something that maybe doesn't translate to simpler use cases. For instance, being able to do some decision-making in the middle of ring's middleware to say I want to take a different path to get to my end state, etc.
20:48devnFrozenlock: I'm probably going too far by saying that. I guess at the end of a long day at work I just want my "blog in 15 minutes" to absolve me of any guilt for not having read all the source.
20:49FrozenlockI think your marketing critique is fair. If I need to read the source to understand why I should use it, I think something's wrong.
20:49FrozenlockI'm too lazy for that.
20:49devnFrozenlock: There are a lot of reasons why it's cool, in fact. I made a bunch of notes, but I still just want to see a quick walkthrough of building an app.
20:49devnnot a finished example
20:49brainproxycurrently, I think I'm basically doing something similar by combining liberator with a "monad sandwich" (using jim duey's protocol monads)
20:49FrozenlockAlso the mention of datomic in the docs scared me. (not FOSS)
20:50brainproxybut my approach is very app-specific; if pedestal has made the approach general purpose, I may get on board
20:50Frozenlockdevn: In screencast please! :D
20:51devnFrozenlock: Yeah it was interesting that during the podcast interview with Tim Ewald there was a question about "Why build this?" and Tim said: Well, because most anything these days that wants to see adoption releases its source.
20:53devnNot verbatim of course. I'm using my own interpretation.
20:53blrdevn: is this intending to provide some kind of general purpose framework like rails? I thought that was antithetical to clojure philosophy
20:54xeqiblr: from outside of c/w and only seeing the docs on the website it describes itself as a framework
20:54devnblr: That's just hooey that old fuddy-duddies in the clojure community say a lot. Don't listen to that noise. The Clojure community is bigger than that now, I think.
20:55devnThat's not to say it's a good or bad idea or anything. I agree with a lot of the "why" behind that sentiment. But it's a generalization.
20:56joegalloBull5h!t
20:56joegallodammit
20:56devnlol
20:56joegallomore passwords #clojure tonight
20:57joegallolol
20:57brehautjoegallo: and yet, perfectly timed ;)
20:57devnbrehaut: boo!
20:57joegallooh well, i'm not changing it, it's a great password
20:57brehautapparently im and old fuddy-duddie
20:57brehautwho believes in the hooey
20:57devnbrehaut: there's enough dogmatism about libraries>frameworks that it's discouraging people from doing things they are interested in doing.
20:57devnI don't like that.
20:58blrjoegallo: you did that just to make me feel better didn't you.
20:58joegallonah, total coincidence, but it is hilarious
20:58tyler__heh loaded up chat example for pedestal and it was like "not found"
20:58brehautif people want to use rails, rails still exists.
20:58clojurebotmax people is 317
20:59devnbrehaut: it's not about rails vs *
21:00NeedMoreDesupjstadig: http://blog.jayfields.com/2011/01/clojure-using-java-inner-classes.html don't work for me.
21:01devnbrehaut: if people want to build a big honking framework in clojure I don't see why anyone should discourage them from doing it.
21:02brehautdevn: if people want a sprawl mass of mutable state in clojure, i dont see why anyone should discourage them from doing it
21:02brehautoh wait
21:02devnbrehaut: at least it has namespaces. there are tradeoffs.
21:02devnbrehaut: the overgeneralization is all im reacting to
21:03devni hear this over and over again: "but people in clojure don't like frameworks, right?"
21:03devnit makes this community out to be a bunch of picky eaters who can't enjoy anything for what it is
21:04nopromptbrehaut: i don't want to use rails
21:04hiredmandevn: that is ridiculous
21:04devnhiredman: i agree
21:04nopromptbrehaut: i maintain a few rails apps. it was cool at first but, yeah, i'll pass on it now.
21:04hiredmandevn: what you are saying is ridiculous
21:04brehautnoprompt: i certainly dont want to force you to use rails
21:05devnhiredman: oh i know, just throwing some snark on the fire
21:05nopromptbrehaut: hehe
21:05brehautdevn, im pretty sure all the non-picky eaters are over using PHP
21:06devnbash bash bash
21:06noprompti'm excited about pedestal though. haven't had a chance to run through the docs yet.
21:06nopromptlol php
21:06hiredmanpicky eating is what keeps you from having poison control on speed dial
21:07nopromptbrehaut: there are people in my town that will defend php to the death and burn you at the steak for talking bad about it.
21:07amalloylovemuffin: try and finally are free. throw and catch are pretty expensive and shouldn't be used for ordinary flow control
21:07nopromptfor some reason i can't get those people to show up to our local hacker meetup.
21:08brehautnoprompt: certainly. im not actually disparaging PHP per se there (though i do hate it), but its about the only language community which isnt picky about things
21:08tyler__hiredman: not eating poison is what keeps you from having posion control on speed dial
21:08thm_proverI need to use OpenGL from clojure due to performance reasons. Should I go with JOGL or LWGJL ?
21:08hiredmanamalloy: that is not strictly true, finally compiles down to a catch
21:09amalloyhiredman: for the "an exception happened" case, sure. but if no exception is thrown finally is free, isn't it?
21:09hiredmanso finally has what performance characteristics a catch has
21:09nopromptbrehaut: that's because they have no taste.
21:09hiredmanamalloy: "throw and catch are pretty expensive"
21:10weavejesterI think I need to try out Pedestal before I can form a good judgement, but there are a lot of things in there that seem… maybe like it's doing too much.
21:11xeqi(inc weavejester)
21:11lazybot⇒ 7
21:11nopromptone nice thing about frameworks though, is that i don't have to worry that the guy that takes over after i do will be up shit creek without a paddle.
21:11hiredmanyeah, I am interested in interceptors as an async middleware model, but I don't want a new routing dsl, or the SSE stuff
21:12noprompti have a few small apps that are hand rolled. they're documented, but i always worry it's gonna trip the next guy up.
21:13weavejesterI'm a little suspicious of HTTP async (long polling etc.) in general. It's a lot of extra work to support what is essentially a protocol hack, and made largely obsolete by websockets.
21:13devnnoprompt: I think that's where all of my rambling ultimately takes me w/r/t frameworks.
21:13devnSelling clojure work is made more difficult by a lack of consistency between projects.
21:14xeqiI've been directing new people towards http://www.luminusweb.net/ for the consistency reason
21:15nopromptdevn: selling clojure to other devs has been tough for me in general.
21:15nopromptthey just see lisp and shutdown
21:15nopromptrunning back to ruby or *shiver* python
21:15devnidk, to be clear I was not reacting to pedestal, just to the parrotted "libraries over frameworks" thing. i hear it over and over, and i don't think it's inspiring anyone.
21:16noprompti've tried both approaches. and my favor tends to using libraries.
21:16nopromptmaybe that's because i've been burned less in that department.
21:16nopromptrails has burned me so many times.
21:17nopromptonce i spent 11 hours trying to figure out a character encoding problem.
21:17brehautnoprompt: my thought is that interesting things are different. if its not different to other things, why bother doing it
21:17devnlet people build things and the ones that are "good" will get used. there doesn't need to be a set of requirements to building stuff in clojure. Stuart Halloway said "Clojure is a consenting adults language" a long time ago. I like the spirit of that.
21:17nopromptturns out the `raw` method in rails changes a strings encoding.
21:17devnbrehaut: because sometimes the same thing can be done way, way better.
21:18nopromptbrehaut: i can respect and agree with you there.
21:19nopromptbrehaut: it's like the old saying. if there's anything worth doing...
21:19brehautnoprompt: exactly
21:20nopromptspeaking of which vim-clojure-static will have over the top support for regular expression syntax highlighting soon :)
21:20nopromptspent about two weeks polishing it.
21:21nopromptout of curiosity does anyone know of a regex optimizer?
21:22xeqiweavejester: are there any plans for a hiccup2 w/ string escaping soon? Considering building a fork with some changes in https://github.com/ato/clojars-web/blob/master/src/clojars/web/safe_hiccup.clj, and would hate to find out it gets obsoleted in a month
21:22clojurebotfork is FORK IT, FORK IT NOW!
21:22xeqiclojurebot: spork it now!
21:22clojurebot<brehaut> sporks are half way between a spoon and a fork
21:22blrclojurebot is wise.
21:23brehautO_o
21:23nopromptie. given a some pattern, optomize it to reduce the number of backtracks, etc.
21:25nopromptguess i'm gonna have to roll up my sleeves :)
21:26weavejesterxeqi: Sorry, I just haven't had any time to work on Hiccup.
21:27amalloybrehaut: apparently you were talking about emacs for macosx at the time, telling someone it was a proper build rather than a fork
21:27brehautamalloy: huh.
21:27brehauti presume it was only slightly more coherent at the time
21:28xeqiweavejester: np, just don't want to step on any toes
21:28amalloybrehaut: http://logs.lazybot.org/irc.freenode.net/%23clojure/2011-10-11.txt
21:55tieTYT2what's the "n" stand for in defn?
21:55yedidef fn
21:56tieTYT2ah :)
21:56yedi(def (fn [] "a function")) -> (defn [] "a function")
21:56tieTYT2thanks
21:56yedinp
21:57yedilol i forgot the names... oh wells
21:57tieTYT2it's weird to me that clojure can do sequences of events in its functions (like a println). Seems imperative more than functional
21:58tieTYT2maybe that's using monads like haskell does?
21:58benmossits not a purely functional language
21:59tieTYT2(defn foo [x] [x (+ x 2) (* x 2)])
21:59tieTYT2nm
22:00tieTYT2well actually, when I typed "foo 3" into the repl instead of "(foo 3)" It returned 3. Why did it do that?
22:00yogthoscause you made 2 statements
22:01yogthosthey're unrelated
22:01yogthosyou said foo, then you said 3
22:01tieTYT2what did the first statement do?
22:01yogthosnothing
22:01yogthosyou just referred to the symbol foo
22:01yogthosand it returned it
22:01tieTYT2oh
22:01tieTYT2ok
22:01tieTYT2thanks
22:01yogthosshould've looked something like #<repl$foo processing.repl$foo@1b42008f>
22:02yogthosin general your code is written as a tree
22:02tieTYT2yep
22:02yogthosand whatever the last statement is in any function is what gets returned
22:03tieTYT2why's that a tree vs a list?
22:03yogthosbecause you can nest statements
22:03yogthos(defn foo [x y]
22:03yogthos (println x y)
22:03yogthos (* y
22:03yogthos (+ x y)))
22:04yogthosfor example foo has 2 nodes if you like println and *
22:04yogthos* has another node inside it that's +
22:04tieTYT2oh
22:05yogthosso when you read the function you know that the output of println is discarded since it's on the same level as (*
22:06tieTYT2why do i know that? Because the println comes first?
22:07tieTYT2related to this, the tutorial says, "If you want to make an expression that has some side-effects before it evaluates to a value, use do:" But doesn't foo make an expression w/ side effects without using a do?
22:07yogthosright, if you have multiple statements on the same level, the last one is what's returned
22:08yogthosthe reason you use do is for expressions which take exactly 3 values
22:08yogthosfor example consider the if statement
22:08yogthosit goes (if foo bar baz)
22:08tieTYT2ah "We say that let expressions and function bodies (and also loop expressions, which you'll read about later in Looping and Recursion) have an "implicit do": within them you can list expressions one after another, and they all get evaluated in order (presumably for the side-effects), but the last one is what determines the overall resulting value of the let expression."
22:09yogthosso if you wanted to print something you'd do (if foo (do (println "bar") bar) baz)
22:09yogthosright, so in let expressions, and function bodies you don't need a do
22:10tieTYT2oh i think i get it
22:10tieTYT2well sorta. I mean without the do, it would use the nil from the println?
22:10yogthosnot quite
22:11yogthosthe if example can only be done with a do
22:11yogthosbecause if expects 3 arguments
22:11yogthosprintln will always return nil, but if you put another statement after it, then that's what gets returned from the do block
22:12yogthosbut pretty much the only time you need to use do is if you want to cause side effects such as printing
22:12amalloyi just had a funny idea: (defmacro do [& body] `(peek [~@body]))
22:12yogthoshehe
22:14tieTYT2i'd like to test out this do, but lein repl doesn't have history when I press up. I'm using cygwin
22:15yogthosamalloy: so it keeps going until it hits the first function that returns something :)
22:16amalloyeh?
22:16yogthostieTYT2: light table is not bad for playing around with stuff http://www.lighttable.com/
22:16yogthostieTYT2: it's very interactive
22:16yogthosamalloy: your do macro
22:16thm_proveris there any way to use opengl with clojure on java 7? it appears lwjgl requires jawt, which java 7 no longer supports; thus, any other options?
22:17amalloyyogthos: your statement doesn't seem related to any part of my do macro
22:18yogthosamalloy: if you give it (do "x" "y") it will hit x and return it right, but if you do (do (println "foo") (prinlnt "bar") "x") then it will print foo, bar, and return x
22:18amalloyno, it behaves exactly like clojure's built-in do
22:19amalloyit certainly isn't doing anything like `(first (remove nil? [~@body]))
22:19yogthosamalloy: doesn't peek just grab the last thing off the vector?
22:20amalloyyes
22:20yogthosoh yeah ok makes sense :P
22:20amalloyand the last thing in the vector ["x" "y"] is y, not x :P
22:21yogthoslol brain fart, forgot the rest will just execute themselves once the macro expands
22:22nollidji'm working on a weekends-and-evenings web project to expand what i can use clojure for
22:23nollidjatm i'm trying to get a handle on rich webapp design with clojure
22:25nollidji was hoping that there would be something gwt-like that would let me do something like: define rich page content in hiccup (or another html generator) plus clojurescript, and define backend behavior in clojure, all in the same project
22:26yogthosnollidj: take a look at http://www.luminusweb.net/docs
22:26brainproxytieTYT2: that may be a cygwin issue, as `lein repl` on mac/linux offers history and some other niceties
22:26nollidjyogthos: thanks
22:26yogthosnollidj: no prob :)
22:33tieTYT2brainproxy: yeah
22:34tieTYT2also, if I type lein trampoline repl it errors saying: Exception in thread "main" clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: Unsupported character: \"0
22:35Frozenlockhttp://swannodette.github.com/2013/03/09/logic-programming-is-underrated/ "ruleo" "peopleo" "earliero". Am I the only one who doesn't like the 'o'? :(
22:38mrb_bkFrozenlock: I don't mind it.
22:38mrb_bkOnce I understood the difference between relational and non-relational functions, it helped to have a visual reminder of which one they were
22:40nollidjah, nice. luminus lets me compile cljs to javascript assets i can include as resources, basicalaly?
22:45tieTYT2found an answer to my repl history issue: http://stackoverflow.com/questions/15490555/how-can-i-get-the-lein-repl-history-to-work-in-cygwin/15490662#15490662
22:46technomancyFrozenlock: I wish it would just use namespaces like the rest of clojure
22:49yogthosnollidj: yeah pretty much
22:51yogthosnollidj: your cljs will get compiled to the public/js folder and then you just use it like any other js from the client side
22:51yogthosnollidj: I never got around to making anything fancy for making a browser repl though
22:53nollidjyogthos: i see. thanks for the pointer
22:53Frozenlocktechnomancy: obligated capslock... NO NAMESPACE? o_O
22:54yogthosnollidj: just let me know if you find anything odd/missing in it :)
22:54nollidjyogthos: will do
22:54yogthosnollidj: awesome :)
22:54nollidji had a bare-bones something going with ring+compojure, and i'll see what sort of sense i can make of how things are put together here
22:55yogthosnollidj: it's pretty much ring+compojure+lib-noir, so should look pretty familiar
22:57nollidji hadn't looked at lib-noir yet, but yeah, it's not doing anything unexpected yet
22:57nollidjthe last time i tried to get this project off the ground, noir was still the recommended thing to start with
22:59yogthosnollidj: bad news is noir got deprecated, good news is that most of the good stuff lives in lib-noir now, and I'm actively maintaining and adding to it with Raynes :)
23:01adu_o no
23:01adu_I loved noir
23:01nollidjyogthos: yes, i managed to catch up that much
23:01Frozenlockyogthos: I'm trying clj-pdf and I think :align in tables doesn't work. Am I too tired? Should I go to bed?
23:01adu_I was going to use it for production
23:01austinhThe only problem with the 'o' suffix in core.logic programs, in my opinion, is that lots of regular functions also end in 'o.' I don't think anyone has a problem with other mnemonics like '*' or '?'.
23:01nollidjthanks for all the hard work
23:01FrozenlockOther than that it's really nice ;-)
23:02yogthosadu_: not much changed, luminus works very similarly and batteries are included :)
23:02austinhI could see myself using a different convention, like '-o' or something completely different.
23:02adu_so what should I be using instead? joodoo?
23:02yogthosFrozenlock: it should... :) do you have a snippet handy?
23:02austinhThe 'o' in TRS is a superscript, in case anyone didn't know that already.
23:03Frozenlockaustinh: or just '-' I don't pronounce '-' in my head when I read it :p
23:03yogthosadu_: if you liked noir I recommend http://www.luminusweb.net/docs
23:03adu_yogthos: thanks :)
23:03Frozenlockyogthos: oh boy.. give me a minute.
23:03yogthosand for anybody who feels adventerous there's now http://pedestal.io/
23:04austinhPedestal sounds awesome.
23:04yogthosadu: also, I had a post on moving to compojure from noir http://yogthos.net/blog/33-Moving+to+Compojure
23:04yogthosadu: migth be handy
23:05yogthosPedestal looks neat for sure, curious where it'll go
23:05nollidjis there any general understanding of where clojurescript one is headed? it seemed like it had some momentum, but i don't get the feeling that it's approaching critical mass
23:06aduiirc, joodo and noir confused me alot because they both use hiccup, ring and compojure
23:06Frozenlockyogthos: https://www.refheap.com/paste/12707
23:07Frozenlock(same as your example, but with :align :right)
23:07aduare (hiccup, ring and compojure) now known as pedestal?
23:08yogthosadu: pedestal has its own stack it seems
23:08aduwut
23:08yogthosadu: it does play nice with ring though
23:08yogthosFrozenlock: ok let me see what's happening there :)
23:08Frozenlockyogthos: Ahhh my eyes! y u hate contrast?
23:08yogthosFrozenlock: hehe
23:09yogthosFrozenlock: what and where? :)
23:10FrozenlockMoving to compojure
23:10yogthosFrozenlock: ahh yeah theme's still work in progress :)
23:11FrozenlockLet's just say that the transition between solarized-dark and your blog was... brutal :p
23:11yogthosrofl
23:12yogthosFrozenlock: so with the table you just have to add width to it
23:13aduFrozenlock: http://eclipsecolorthemes.org/?view=theme&amp;id=1115 ?
23:13yogthosFrozenlock: by default it will expand to the width of the page
23:13yogthosFrozenlock: width is in percentage of page width so if you do :width 50 it'll take up half the page and if you have :align :right it'll be on the right
23:14yogthosFrozenlock: and yeah that would hurt :P
23:14Frozenlockadu: Yes, but for the awesomer emacs
23:14aduoic
23:14aduI use emacs
23:14adualot
23:14yogthosI'm just holding out for light table to get more stable now ;P
23:15adumy work bought me IntelliJ, but I still use Emacs
23:15Frozenlockyogthos: Ahhh! I thought I could align the 'text' to the right, not the table. My apologies.
23:16zakwilsonnrepl.el seems to be pretty bad at displaying function documentation in the minibuffer while editing source buffers. It shows up sometimes and not others, and it's slow.
23:16FrozenlockDoc in the minibuffer, or the arguments?
23:17aduyogthos: why is the delete button visible when I'm not even logged in to your blog?
23:17yogthosadu: probably a bug :)
23:18aduyogthos: and at the bottom it says "Commenting as Yogthos"
23:18Frozenlockadu: Why is the 'logout' button visible? :P
23:18aduFrozenlock: yes
23:18yogthosoh dears :P
23:18FrozenlockYup I also have "Commenting as Yogthos"
23:19aduyogthos: I think you need to work on your auth
23:19yogthoshaha I think it's my brilliatn content caching :P
23:19yogthoslol try actually comment
23:19yogthoscurious
23:19FrozenlockNow, where is the button "bank transfer"?
23:19yogthoshahaha
23:20austinhDoes anyone have any nrepl.el customizations in .emacs, beyond what is here?: https://github.com/kingtim/nrepl.el
23:20aduyogthos: oh content cache would explain it too
23:20yogthosthat's an interesting artifact of content caching ;)
23:21austinhSpecifically, I'd like to disable the highlighting of errors, and whatever causes *nrepl-error* to be removed from my buffer history.
23:21yogthosI guess I should really not cache stuff for the admin
23:22yogthosbut now you can see how the admin ui works :P
23:22aduheh
23:22aduwell, I tried submiting as you, and I can't
23:22zakwilsonFrozenlock: arg list
23:22aduso it must be caching
23:22yogthosyeah it is
23:22yogthoslol did get a bit of a scare though :P
23:22tieTYT2haskell has foldl and foldr, looks like clojure just has reduce. How do you do something like foldr? Reverse the list first?
23:24Frozenlockzakwilson: For me it only shows up in the *nrepl* buffer... need to tweek my .emacs I think.
23:26FrozenlockAdded (add-hook 'nrepl-interaction-mode-hook 'nrepl-turn-on-eldoc-mode) and now it's purrrrfect.
23:26devnpedestal is pretty cool
23:26austinhtieTYT2: There is some discussion here: https://groups.google.com/forum/?fromgroups=#!topic/clojure/MizwTxHwLE4
23:26Frozenlockdevn: I'm still waiting for a screencast :P
23:26devnFrozenlock: that's all well and good, but it's nice code, interesting ideas
23:26devnkind of a fun read
23:27yogthosI'd like to see more examples :)
23:27yogthosthe chat server is a bit busy
23:27devni think that's the consensus and i agree
23:27devnbut it's cool to read
23:27yogthosindeed
23:27yogthosthe routing is nifty
23:27tieTYT2hehe i'm reading that
23:27zakwilsonFrozenlock: yeah, that seems to make it work. I could swear it was working some of the time and not others before though, and it's still slower than Slime.
23:27devnoh im talking about the app_tools code right now
23:27tieTYT2i would think haskell would have the same issue
23:28tieTYT2why does this snippet use def and not defn: (def fewer-args (partial lots-of-args 10 20 30))
23:28tieTYT2that reminds me of haskells point free notation
23:29Frozenlockyogthos: Is there a way to align stuff to the right (or center) in clj-pdf tables?
23:29yogthosFrozenlock: text wise?
23:30Frozenlockyes
23:30yogthosFrozenlock: I think so, have to take a look
23:39yogthosFrozenlock: so yeah in tables things seem to get a bit funky unfortunately
23:41aduwho was asking for reduce-right?
23:41adutieTYT: https://www.refheap.com/paste/12708
23:41Frozenlockyogthos: aww, only bummer in what was otherwise a flawless experience ;-)
23:42tieTYT2adu: me
23:42yogthosFrozenlock: hehe yeah I figured out how to get around a lot of itext weirdness, but not this one :)
23:42tieTYT2adu: thanks, you also taught me how to define variable length functions
23:42tieTYT2i thought you do that with the [& rest]
23:42adutieTYT2: yeah, they're pretty nice
23:43tomojwe should be able to do much better than reverse in some cases :(
23:43aduscheme calls them case-lambda's
23:43tieTYT2i see
23:43tieTYT2afaict, haskell didn't have variable length functions
23:43yogthosFrozenlock: looks like might be an easy fix actually http://www.docjar.com/docs/api/com/lowagie/text/Cell.html
23:43tieTYT2nor overloading
23:43adunope
23:43adutieTYT2: actually it does have overloading
23:43tieTYT2how?
23:43clojurebotwith style and grace
23:44adutieTYT2: because haskell has pattern matching
23:44yogthosFrozenlock: the cell has an horizontal align property that I'm just not using, let me see if it does what it looks like it should :)
23:44tieTYT2how's that overloading?
23:44adutieTYT2: you could have (Either A B) as the declared type, then f (Left x) = implA, f (Right y) = implB
23:45tieTYT2yes but i don't consider that overloading
23:45adutieTYT2: oh ok, i do
23:45tieTYT2because you still have to pass in an Either
23:45tieTYT2if you could pass in a String, i'd consider that overloading
23:45adutieTYT2: that's what typeclasses are for
23:45tieTYT2yeah