#clojure logs

2014-01-20

00:00ryantmegghead, okay, it seems like either you need to choose a different :root at runtime or package the jar with a different resources directory
00:01ryantmegghead, I'm not sure how to do the latter, but it seems like it would be preferable
00:02eggheadhm could probably use lein profiles for that
00:02ryantmegghead, it looks like you can set :resource-path in :profiles
00:02ryantmhttps://github.com/technomancy/leiningen/blob/master/sample.project.clj
00:03eggheadya, thats a good idea, thanks ryantm
00:03ryantmegghead, you're welcome
00:21tpopegtrak: haven't attempted that yet, no
00:31eraserhdIs it idiomatic to define a protocol for use internal to a package when using deftype? E.g. accessors for fields?
00:32amalloyno. just define a function; there's no need to physically attach it to the object as a method
00:32eraserhdamalloy: Then how do I access fields?
00:32amalloy(.foo obj)
00:33eraserhdamalloy: Oh. That's not in the deftype docs... (unless I missed it)
00:33amalloyit's just how you access a field of any object
00:34amalloyhttp://clojure.org/java_interop
00:35dj_ryanis there a way to do circularly dependent java/clojure code?
00:35dj_ryanor is it limited to one way only?
00:39saj_Hi, I have a question about 'require'
00:41ryantmsaj_, ask it
00:42saj_regarding the :refer option, from reading the documentation something like (ns blah.core (:require [compojure.core :refer [defroutes])) should bring defroutes into the blah.core ns
00:42saj_but that's not what's happening for me when I try it out; it says it can't resolve defroutes
00:44logic_progwhen should I use async/thread instead of using async/go ?
00:45saj_I've read about 'require' being able to replace 'use' using the :refer option, but the options seem to be ignored as far as I can tell
00:47ryantmsaj_, what version of clojure are you using?
00:48saj_oh :/ 1.3.0
00:48saj_let me try updating that to the current version first...
00:50ryantmYour example works for me in Clojure 1.5.1
00:51ddellacostawhat does :scope do in leiningen dependencies? For example, in Om: https://github.com/swannodette/om/blob/master/project.clj#L12-L13
00:56saj_ryantm: thanks, that was the problem
00:58ryantmddellacosta, I think it's a dependency that is only necessary for the :provided profile
00:58ryantmsaj_, you're welcome
00:59ddellacostaryantm: is "provided" an implicit default then? I guess I was confused as I was looking for a "provided" profile per the leiningen sample project (https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L46)
01:01ddellacostaah, I see that it is... https://github.com/technomancy/leiningen/blob/stable/doc/PROFILES.md
01:01ddellacostaokay, my bad--thanks ryantm !
01:02ryantmdocstring for default-profiles in project.clj "Profiles get merged into the project map. The :dev, :provided, and :user profiles are active by default."
01:05ryantmhttps://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/project.clj#L405
01:05quizdrfrom the standpoint of lazyness and resource use, are these two fibonacci definitions more or less the same: (def head-fibo (lazy-cat [0N 1N] (map + head-fibo (rest head-fibo)))) and (defn fibo [] (map first (iterate (fn [[a b]] [b (+ a b)]) [0N 1N])))
01:09quizdractually i guess the first one is head-retaining, the second one isn't since it's a function
02:07danneuWhat's the simplest way to 'schedule an event' in clojure, like cooking a cache every 30 seconds?
02:11noidiI don't know if Quartzite the simplest, but it isn't too hard to use http://clojurequartz.info/
02:12ddellacostadanneu: also take a look at the timeout function in core.async, could be a relatively lightweight way to do you want: http://hueypetersen.com/posts/2013/07/10/code-read-of-core-async-timeouts/
02:13danneuddellacosta: that was actually the simplest idea i could think of. just spawn some go-loops with (<! (timeout x))
02:14ddellacostadanneu: yeah, I haven't done a lot of that sort of thing myself, but it strikes that it is probably the simplest and (recently) most idiomatic way to do it in Clojure.
02:14ddellacostastrikes *me
02:29dsrxis there a way to destructure properties on javascripts objects in cljs?
02:39TheBusbyWill core.async let you do the following? (def out-chan (async/map identity [in-chan])) ?
02:39TheBusbyI'm having issues where it only works sometimes, but other times if "out-chan" is defined without anything in "in-chan" then it doesn't wait for input
02:42ddellacostadsrx: as far as I know you have to convert to a cljs data structure first, using js->clj
02:45quizdrwould it be appropriate to say that def is like common lisp's defparameter while defonce is like defvar?
02:48dsrxddellacosta: aight, thanks
02:49ddellacostaquizdr: my impression of defparameter is that it is more like an atom
02:49ddellacostaquizdr: or perhaps like def w/dynamic set
02:50quizdrok, you are right about the dynamic part, i was thinking more in terms of what happens when you def a var that already exists. scoping would be another matter, you are right.
02:50ddellacostaquizdr: defvar seems more like a direct analog to def. As far as defonce, I don't know enough about common lisp to know if there is an appropriate analog. defonce seems to exist in order to handle idiosyncrasies with out namespaces get loaded in clojure.
02:52ddellacostaquizdr: yeah, sorry I don't know enough common lisp to say much more--that was just based on my quick lookup of how those two work in CL.
02:52quizdrno problem. in CL both defvar and defparameter are dynamic
02:55quizdranyone in here use a stand-up desk, so you aren't always sitting down?
02:58ucbquizdr: I do
02:58TEttingerI'm sitting on my right foot now.
02:59quizdri fashioned something together with a chare and a small ikea table
02:59quizdrworks but not so stable
03:23logic_progdnolen: ping
03:23logic_progdnolen: for your next blog post, can you consider writing it about erorr ahndling in clojure?
03:24logic_progdnolen: i find that as I write larger and more complicated distributed systems, > 50% of my code is daeling with error handling / exceptions
03:24logic_progdnolen: I'd love to read a well thought piece on error handling in clojure, i.e. patterns built on top of slingshot try+/throw+
03:34fredyrlogic_prog: would you mind expand a bit on what you run into?
03:36bitemyapplogic_prog: not sure why you'd ask somebody that does mostly front-end and CLJS about error handing and distributed systems.
03:36logic_progbitemyapp: do you blog?
03:36logic_progbitemyapp: point at who I should bother instead
03:36bitemyapplogic_prog: It's not the end-all be-all, but I rather like this for making logic and error-handling independent: https://github.com/michaeldrogalis/dire/
03:36logic_progwhere is Rich
03:37marcopolo`lol
03:37logic_progdamn, it's erlang inspired
03:37logic_progI'm interested
03:37bitemyappthere's some material to be stolen from Erlang on this subject.
03:37logic_progfredyr: basically, I'm reading Joe Armstrong's programming erlang
03:37bitemyapplogic_prog: there are some monadic error handling approaches you could learn about from Haskell too.
03:37logic_progfredyr: and writing a distributed web app in clojure/cljs
03:37bitemyapplogic_prog: "distributed"?
03:37fredyrlogic_prog: right, i was actually going to recommend armstrongs thesis
03:37bitemyapplogic_prog: distributed how? Generally you're talking stateless clients and a database.
03:38logic_progfredyr: and I'm thinking ot myself, damn, I have async/go for processes, now I wish I have erlang-like error handling
03:38logic_progbitemyapp: i'm basically rolling my own meteor/firebase in clojure
03:38logic_progwell, clojure + cljs
03:38bitemyappstill not what's colloquially understood to be a distributed system.
03:38bitemyappit's a mechanism for factoring out CRUD.
03:39logic_progwell, riak + key / value store is involved
03:39logic_progand i'm using multiple machines
03:39logic_progif multiple machines is not distributed, what is?
03:39marcopolo`the firebase part sounds pretty distributed
03:40bitemyappjust because you're using a replicated database doesn't mean you're really confronting anything about distributed systems
03:40bitemyappyou're writing a client, an API server, and another client.
03:40bitemyappthat's all firebase is.
03:41logic_progno no, I'm writing this layer
03:41logic_progwhich amkes real time web apps trivial to write
03:41bitemyappthat's like saying because I can change my car's oil and top the fluids, I'm a Formula One pit mechanic.
03:41logic_progthere's multiple clients, + a clojure server
03:41bitemyapplogic_prog: it's not real-time.
03:41logic_progriak is not, my stuff is
03:41logic_progover websockets
03:41marcopolo`I guess the distributed part is in the database
03:41bitemyapplogic_prog: no, it's not.
03:41bitemyapplogic_prog: you're misusing words.
03:42logic_progbitemyapp: I'm writing a single page web app, supporting rela time chat + rela time blackboard
03:42bitemyapplogic_prog: real-time means bounded latency, extreme limits, maximum reliability.
03:42bitemyapplogic_prog: if you're using a programming language with garbage collection, it's NOT real-time
03:42logic_progI consider IRC to be real time
03:42bitemyapplogic_prog: I think you mean streaming API via websockets, not real-time.
03:42fredyrlogic_prog: www.erlang.org/download/armstrong_thesis_2003.pdf
03:42bitemyapplogic_prog: that's not what real-time means and I'm finding it really difficult to talk to you right now.
03:42AeroNotix"Real-time" has become far too an overloaded term
03:42bitemyapplogic_prog: IRC is also a streaming protocol over a socket.
03:42logic_progbitemyapp: by your definition, anything over the internet is not real time
03:43logic_progbitemyapp: since you can't guarantee latency
03:43bitemyappAeroNotix: it's actually really fucking simple.
03:43AeroNotixbitemyapp: I get what it means, originally.
03:43fredyrlogic_prog: the architecture parts is really good, and iirc programming erland doesn't focus on those parts
03:43bitemyapplogic_prog: not really no, real-time is a property of a system. A design goal.
03:43marcopolo`bitemyapp: "'When I use a word,' Humpty Dumpty said, in rather a scornful tone, 'it means just what I choose it to mean — neither more nor less.'"
03:43marcopolo`-Through the Looking Glass
03:43AeroNotixAt $DAYJOB I program Erlang, wouldn't mind answering any questions.
03:44logic_progAeroNotix: is erlang rela time? erlang has a gc
03:44AeroNotixthis library here leaves a bit to be desired, it looks like it just parameterizes try/catch
03:44AeroNotixlogic_prog: I never, ever said Erlang was real time..
03:44bitemyapplogic_prog: erlang's GC is designed around soft real-time constraints, the JVM's is not.
03:44bitemyapplogic_prog: and it's still, AT BEST, soft real-time.
03:44AeroNotixthough, Erlang has a pretty interesting design for its garbage collector.
03:45AeroNotixEach scheduler has its own GC, which means you can't block the other schedulers when GCing
03:45logic_progbitemyapp: upon further research
03:45logic_progbitemyapp: it looks like you are right
03:45bitemyappNo fucking shit.
03:45bitemyappYou can't really do GC in a real-time system. Hell, you can't even really use vanilla malloc due to heap fragmentation. You're generally talking statically allocated memory.
03:45logic_progbitemyapp: thanks for clarifying the definition of relatime (not sarcastic; apparently I was wrong)
03:46AeroNotixbitemyapp: No need to be like this.
03:46logic_progno no, I like people who can't tolerate incorrectness
03:46bitemyapplogic_prog: it's fine, I just get tired of hearing startup bullshit repeated back to me
03:46logic_progI don't want some "yeah, it's sorta almost correct" person writing my airplane software
03:46AeroNotixlogic_prog: why are you always writing relatime?
03:46logic_progor nuclear plant / power grid software
03:46AeroNotixrelatime is a thing for filesystems
03:46bitemyapplogic_prog: I live in the bay area and I have people describe things like websockets as "real-time" to me all the time when I grew up learning from programmers that worked on actual real-time and embedded systems. The trivialization of serious, difficult engineering work is a pet peeve in the extreme for me.
03:47logic_progAeroNotix: because I should have been saying stremaing instead
03:47AeroNotixlogic_prog: rela vs real
03:47bitemyappand the popularization of streaming socket-based protocols is a good thing. They make certain modalities/applications more efficient.
03:47logic_progAeroNotix: latency in my keyboard
03:47bitemyappbut they're not real-time.
03:47fredyrnon real time keyboard
03:47fredyr:)
03:47logic_progbitemyapp: we hold a mutual disregard for people who believe CSS + Javascript = computer science
03:47AeroNotixbitemyapp: unfortunately, real-time has also this meaning
03:48logic_progbitemyapp: do you intend to do a startup someday?
03:48logic_progbitemyapp: how much would it cost to hire you away from your current job?
03:49TEttingerlogic_prog, if you have to ask, you're not worthy *lifts nose in the air*
03:50AeroNotixYeah, also if you lead a proposition with a money offer, I get suspicious
03:50AeroNotixback to that 'Erlang supervisors for Clojure'
03:51AeroNotixit just look like it parameterizes try/catch blocks and allows you to add new catch expressions at runtime.
03:51bitemyapplogic_prog: I gave up a substantial chunk of income to take my current job, so it's hard to compete on that level unless it's "retire in 3-4 years" money.
03:51AeroNotixDoesn't really look like a supervision tree
03:51AeroNotixA supervisor fundamentally needs to be able to arbitrarily kill any other Pid in the system
03:52bitemyapplogic_prog: I earn a salary typical for senior engineers at startups in SF.
03:52AeroNotixbitemyapp: out of curiosity, what is that?
03:52AeroNotixI'm in PL
03:52AeroNotixBut I get paid very well for PL
03:52marcopolo`PL?
03:52bitemyappPortland?
03:52AeroNotixpoland
03:52logic_progjunior enginer is $100K
03:52bitemyappoh, well nevermind then.
03:52logic_progtop junior is $200k / year
03:52ddellacostawat
03:52logic_progsenior engineer should be up around 300-400k / year
03:53TEttingerwaaaaaat
03:53bitemyapper, no.
03:53ddellacostawhere do I sign up
03:53AeroNotixaccording to the googles I get $68k
03:53ddellacostaI'll be junior
03:54bitemyapphttp://www.indeed.com/salary?q1=Senior+Software+Engineer&amp;l1=San+Francisco
03:54AeroNotixbut considering that minimum wage is $6k, I'm pretty happy.
03:54AeroNotixalso, AeroNotix has potato now
03:54fredyrprogrammer fantasy league
03:55fredyr:s
03:55bitemyappddellacosta: yeah but a house is $1,300,000 and rent for a two bedroom is $3k/mo
03:55bitemyappAeroNotix: lol latvia
03:55sm0keguys
03:55AeroNotixbitemyapp: I'm not Polish fwiw.
03:55ddellacostabitemyapp: yah, Tokyo's not bad, I can't complain.
03:55AeroNotixI just moved here because I'm an idiot.
03:55sm0kehow do i defined a static final field in gen-class?
03:55bitemyappAeroNotix: yeah why did you do that?
03:55AeroNotixbitemyapp: I have a Polish wife
03:56marcopolo`sm0ke: I thought that was default?
03:56bitemyappAeroNotix: yeah why did you do that?
03:56bitemyapphaha, jk jk :)
03:56ddellacostaAeroNotix: that's absolutely insane, I would never move anywhere for a foreign wife
03:56AeroNotixddellacosta: are you 12?
03:56ddellacostaAeroNotix: sorry, bad joke. I live in Japan married to a Japanese woman. ;-)
03:56ddellacostaAeroNotix: not funny without context.
03:56sm0kemarcopolo`: just final i guess
03:57AeroNotixddellacosta: ohhh ok
03:57sm0kemarcopolo`: static final?
03:57logic_proghttp://michaeldrogalis.tumblr.com/post/46560874730/beautiful-separation-of-concerns <-- this is pretty nifty
03:58ddellacostalogic_prog: just saw that the other day. I don't end up using exceptions that much in Clojure though, haven't had a big use for dire yet. Maybe I'm doing something wrong.
03:58sm0keso is it possible to have serialVersionUID in gen-class generated class?
03:58logic_progddellacosta: your computer is afraid of you and never dare do anything wrong
03:58logic_progunfortunately, my computer is rebellious
03:58ddellacostalogic_prog: you know, you gotta show it who's boss
03:58TEttingersm0ke, sure isn't it just a def?
03:58marcopolo`logic_prog: need more monads
03:59sm0keTEttinger: what do you mean?
03:59ddellacostalogic_prog: dire does look nice though, superior to standard try/catch stuff
03:59TEttingerwould (def serialVersionUID 1) work?
04:00sm0kei need a TEttinger no i need a static variable by that name
04:00sm0kelol
04:00sm0keTEttinger no i need a static variable by that name
04:00TEttingerah ok
04:01TEttingerI think there's some good doc for this somewhere
04:01sm0kei could find anything relevant
04:01sm0kecouldnt*
04:01sm0keugh
04:01marcopolo`"By default Vars are static"
04:01marcopolo`http://clojure.org/vars
04:02TEttingerBy adding metadata – via #^{:static true} – to a method declaration you can also define static methods.
04:02marcopolo`you can add ^:const and that might make them final? There isn't much documentation on that
04:02TEttingeror in recent clojure, ^:static might work?
04:02sm0kei dont get it..where do i add these meta?
04:02TEttingeron the method or var def
04:02marcopolo`(def :^const foo 42)
04:03marcopolo`bitemyapp: what times are we allowed to talk about haskell again?
04:04ddellacostaha
04:04sm0kemarcopolo`: yyou mean like by (def :^const myclass-foo 42) if prefix is "myclass-"
04:04TEttingersm0ke: http://stackoverflow.com/a/3809010
04:04bitemyappmarcopolo`: the bosses aren't awake, go for it.
04:04TEttingerthere's some examples there of ^:static
04:04sm0kewould that work?
04:04SparkySparkyBoomis there a clojure wrapper for postgresql
04:05marcopolo`SparkySparkyBoom: korma and yesql are both nice
04:05marcopolo`sm0ke: yeah I think so, I've never had much luck with gen-class though
04:06sm0kewow this is hard
04:06marcopolo`do you need gen-class, proxy wouldn't work?
04:06SparkySparkyBoommarcopolo`, ty for the suggestion. i tried searching on google, but i just found a bunch of tutorials on how to setup jdbc
04:07marcopolo`haha no problem
04:07logic_proggiven an exception object
04:07logic_progis there a simple way of getting all the *.clj lines of the stack trace?
04:07logic_progit's sorta retarded to see all these *.java lines in the stack trace
04:07marcopolo`you could filter the lines based of a regex for starters?
04:08marcopolo`but it is on of the hot topics in the community of why stack traces show everything
04:08TEttinger"I'm getting a stacktrace in my stacktrace reader!"
04:08marcopolo`one of*
04:09logic_proglol
04:09sm0kedoesnt work that way
04:09sm0kewhat bullcrap!
04:10TEttingersm0ke, yeah gen-class isn't easy
04:10TEttingeris your code available?
04:10ddellacostaSparkySparkyBoom: alternatively, clojure.java.jdbc + HoneySQL is a nice combo.
04:11sm0keTEttinger: just take any gen-class i guess, nothing special
04:11sm0kei just need a static variable there
04:11SparkySparkyBoomddellacosta, honeysql looks promising
04:13ddellacostaSparkySparkyBoom: I find the combination of clojure.java.jdbc + HoneySQL to be nice as HoneySQL merely generates SQL, and clojure.java.jdbc. gives you execution of prepared statements--I find it to be a nice separation of concerns.
04:14SparkySparkyBoomddellacosta, i see what you mean
04:16eggheadwut in the, why is my cljs app making 'SELECT' http requests to my app :|
04:16sm0keseems impossible, http://stackoverflow.com/questions/15062179/how-to-generate-a-serializable-java-class-in-clojure-by-gen-class
04:16sm0keno answer since 1 year
04:30TEttingersm0ke, hm? I'll take a look, but I just accessed a static variable from gen-classs
04:31machriderdoes 'lein run' imply 'lein compile'? (it seems not to, as my gen-class call doesn't work unless i manually 'lein compile' first)
04:31TEttinger(def ^:static truf true) ; in one file
04:31TEttingermachrider, check :aot in project.clj
04:32TEttingerthen (myClass/truf) in another file that imported the first gen-class (myClass here), and it evals to true
04:32machriderTEttinger: i tried adding :aot [mynamespace.core] to no avail
04:32TEttingerlein run should imply compilation. not sure if something's off
04:33TEttingerwhat's your leiningen version?
04:33machrider1.7.1 (linux mint's package)
04:33machrideri should probably install lein 2...
04:34TEttingeryeah, that could be it
04:40daGrevishi! i can't seem to understand the difference of mod and rem functons
04:41TEttinger,[(mod -5 6) (rem -5 6)]
04:41clojurebot[1 -5]
04:41daGrevisohh, it has the difference with negative number
04:42TEttingeralso rem is ever so slightly faster since it doesn't involve an internal conditional
04:42TEttingerbut I can't be sure
04:42daGreviswell if i say in my head -10 / 3, my heads tells me it's -1
04:42daGrevisnot 2.
04:43pyrtsadaGrevis: Depends on your definition of the modulo operation. IMO, the result 2 is more useful. http://en.wikipedia.org/wiki/Modulo_operation
04:43TEttingereach has different uses. if you only use non-negative numbers, rem is slightly better (also plays nice with primitive math I think)
04:44pyrtsa,(quot -10 3)
04:44clojurebot-3
04:44pyrtsa^ With that definition of quot, -1 makes sense though.
04:45pyrtsaYet, an integer division like (div -10 3) => -4 is often pretty useful.
04:45pyrtsa(I.e. round towards negative infinity.)
04:47gws,[(mod -10 3) (mod 10 -3)]
04:47clojurebot[2 -2]
04:53asmalaI'm working on porting hiccup to cljs and I'd like to write a test (using cemerick.cljs.test) that would need to compare two instances of goog.Uri. It appears that (= (goog.Uri "/") (goog.Uri "/
04:53asmala…")) returns false
04:56asmalaI'm assuming this is because "=" is trying to compare them via (identity?) rather than logical equivalence
04:58gwsthat's an ellipsis in the second inner form
04:58asmalashort of implementing IEquiv on goog.Uri, is there an elegant way of getting sane behavior for a goog.Uri comparison?
04:58asmalaaye, that's me hitting return at the wrong point in a sentence ;-)
05:00ddellacostaasmala: just curious, is there a reason you aren't just using hiccups? (https://github.com/teropa/hiccups)
05:03asmaladdellacosta: indeed, for practical reasons that (or crate, sablono, dommy, etc.) would suffice. I'm hoping a smaller hiccup core would allow target independent base libraries to be written, with target specific compilers. See https://github.com/weavejester/hiccup/issues/75#issuecomment-31899718
05:03ddellacostaasmala: ah, gotcha--thanks!
05:04asmalafor reference, I solved the issue by implementing IEquiv for goog.Uri.
05:05ddellacostaasmala: it would be great to have that kind of solution for hiccup. We were trying to convert tinsel to something that generated string vs. dom nodes (https://github.com/ddellacosta/tinsel) but your proposed solution would be superior as a general approach.
05:06logic_prog' = quote, what does ` = ? what is the actual function name that ` maps to?
05:06logic_progs/funciton/macro
05:07AeroNotixlogic_prog: syntax quote
05:07logic_prog"syntax quote" is not a valid function name
05:07logic_progor a valid macro name
05:07asmaladdellacosta: that's neat. I'm hoping that an extraction of the common bits of hiccup would make projects like tinsel easier. I've seen way too many essentially identical implementations of defelem, link-to, etc.
05:08logic_progboth syntax-quote and syntaxquote seem to be nil
05:08AeroNotixlogic_prog: there's no equaivalent, but that's what it's called.
05:08ddellacostaasmala: absolutely agree. Very interested in where you go with it.
05:08logic_progI can do (quote a) instead of 'a ... what is the equiv of `a ?
05:08AeroNotixlogic_prog: don
05:08AeroNotixdon't think there is one
05:08logic_progwhat?
05:08logic_proghow is that possible?
05:08AeroNotixI said: I DON'T THINK THERE IS ONE
05:08logic_prog(defmacro try+ [& body] (quasiquote (slingshot.slingshot/try+ ~@body)))
05:09logic_proghow can I write amacro that will take 2 arguments, and alias one amcro as anothe rmacro ?
05:09AeroNotixyou just call the macro in the body
05:09AeroNotixif I understand what you're trying to do
05:09AeroNotixyou just want to refer to slingshot.slingshot/try+ as just try+?
05:10AeroNotixwhy don't you use the normal :require statements to do this?
05:10AeroNotixlogic_prog: ^
05:11logic_progI want to have a file macros.all
05:11logic_progwhich lists all the macros I use
05:11logic_progI don't think :requre :refer is transitive
05:11logic_progthen I wnat to do (:use [macros.all])
05:11logic_progand import all my macros
05:11logic_progI realize there is a question here os "n00b, you have too many macros"
05:12logic_progbut I do have like ~10 commonly used macros
05:12AeroNotixno, it's "noob, learn to not make people hate you by importing symbols like that"
05:12AeroNotixNamespaces are A Good Thing
05:13logic_proggood decisions come from wisdom
05:13logic_progwisdom comes from being a n00b
05:13logic_progi need to shoort myself in the foot to learn not so thoot myself in the knee
05:13AeroNotix:require :refer in one namespace does not put the :referred items into the namespace, that's correct. I'd not want it any other way.
05:13alewwhat if the ns using that macro doesn't have slingshot included
05:13AeroNotixalew: this
05:14AeroNotixIf you syntax quote something like that, it'll just replace try+ with the slingshot call. Which you would then need to have in the namespace where you use try+
05:14AeroNotixunless you don't syntax quote the slingshot one, and let it expand
05:14alewat that point you might as well just require refer the fn
05:15AeroNotixExactamundo
05:15logic_progno, I have a main.cljx
05:15alewyou could be hacky and unquote the slingshot.slingshot/try+
05:15logic_progwhich includes all dependencies
05:15logic_progso the slingshot.slingshot is guaranteed to be already loaded
05:15logic_progeven if it's not :required
05:16logic_progthen, sinc eit's loaded, cljore will have access to it :-)
05:16AeroNotixUgh, I'm out.
05:16logic_progif namespace foo.bar is (1) loaded and (2) not required from stupid.cljx, stupid.cljx stil has acess to foo.bar
05:16alew"loaded"?
05:17logic_progyes,
05:17logic_prog(ns main (:require [foo.bar] [stupid]))
05:17logic_progthus, foo.bar is loaded because main required it
05:17ddellacostatrying to wrap my head around the use-cases for set-state! and transact!/update! in Om--seems like transact! is used for updating the data which you are representing in the DOM itself?
05:17AeroNotixlogic_prog: it's available in main
05:17ddellacosta(same for update! ?)
05:17logic_progit's available everywhere
05:17alewNo
05:18ddellacostabut not really understanding when you would use set-state!
05:18alewit's only available in that ns
05:18AeroNotixexactly
05:18AeroNotixOtherwise, madness?
05:18xificurCI am trying to use clojure-csv to parse only the first 10 lines of a csv file. The function parse-csv from the library is already lazy and says "Be careful to ensure that if you read lazily from a file or some other resource that it remains open when the sequence is consumed". Now how do I do that? If I do a with-open and try take 10 I get an error that the stream was closed :(
05:18logic_progno, the full name is available everywhere
05:18fredyrddellacosta: set-state is when you want to use the react components state
05:19fredyrddellacosta: same as .setState
05:19ddellacostafredyr: I think I even get that, I guess I just don't even get *why* you would want to do that--isn't Om replacing that mechanism with the cursor more or less?
05:20fredyrddellacosta: yeah, i think youre right
05:20fredyrddellacosta: but you might wanna reuse others vanilla js components
05:20fredyrddellacosta: or otherwise
05:20ddellacostafredyr: I see, and that would let you do that?
05:20alewxificurC: use doall to immediately evaluate take
05:21fredyrddellacosta: yes i believe so
05:21xificurCalew: will that not evaluate the whole file?
05:21ddellacostafredyr: alright, thanks, that is helpful and puts me in the right direction. I'll keep reading through the code.
05:21alew(doall (take 10 file))
05:22alewthat will give you the lines immediately
05:22xificurCalew: thanks. I thought doall would automatically force to evaluate the whole seq
05:22fredyrddellacosta: np, i still have trying re-use of js components with om on my todo
05:22fredyrddellacosta: i been wanting to try something like https://github.com/petehunt/react-touch-lib/blob/master/src/primitives/AnimatableContainer.js
05:23alewxificurC: only if you call it on the whole seq :P
05:23fredyrddellacosta: being able to reuse component libraries without modification is a sweet spot, would be great if om could support it nicely
05:23ddellacostafredyr: interesting, this would let you perform arbitrary transformations on SVG elements inside?
05:23ddellacostafredyr: yah
05:25xificurCalew: so (doall (take 11 file)) will only take and create the first 11 but (take 11 (doall file)) would first create everything and then take the first 11
05:26logic_progwoe is the world
05:26logic_prog(defmacro def-macro-alias [nm1 nm2] (let [gs (gensym)] (list 'defmacro nm1 (vector '& gs) (list concat (list 'quote nm2) gs))))
05:26logic_progmy evil macro has been written
05:26logic_progteehee, a macro that calls defmacro
05:27asmalawhy does java.net.URLEncoder encode space as "+" and not "%20"?
05:31alewxificurC: yes
05:32alewasmala: I think it's an optimization
05:33asmalaalew: A standard one? Just gets a bit tricky with goog.string/urlEncode using "%20"
05:33alewasmala: http://stackoverflow.com/questions/1634271/url-encoding-the-space-character-or-20
05:36asmalaalew: thanks, that was helpful. I'll stick to the + as it's also what the clj implementation (of hiccup) is using
05:56fredyrddellacosta: are you just looking into om, or poking around writing something?
05:58ddellacostafredyr: we are thinking of using it in our front-end, so I'm just learning as much as I can about how it works. We stumbled on a similar architecture independently, in terms of the way we update our application state and render--minus the virtual DOM and intelligent checks on updating--that was the missing piece.
05:58fredyrddellacosta: ah, sounds cool
05:59fredyrddellacosta: and might be a good fit then also
05:59ddellacostafredyr: yeah, exactly. I basically had a half-assed version of it implemented already when I started hearing dnolen talking about it on twitter and IRC.
05:59AeroNotixI'm looking at this https://github.com/michaeldrogalis/dire/
06:00AeroNotixand I really cannot see what's different about it, it just looks like it's maintaining a list of handlers for functions
06:00AeroNotixwhen they raise Exceptions
06:00AeroNotixalmost like a parameterized (catch) block
06:00AeroNotix*Nothing* like Erlang supervisors at all
06:01AeroNotixEven the 'restarts' (self-correcting) is gimmicky
06:02bitemyappAeroNotix: Lisp-style continue/restart wasn't a good idea anyway
06:02AeroNotixbitemyapp: ehhh, for real applications? Nope. For REPL-based programming, yep!
06:03ddellacostaAeroNotix: I think the point is that it separates out exception-handling stuff from the function logic. In that sense I think it promotes a nice separation of concerns. Granted, I don't have a huge problem with exceptions as it is now, so...
06:03AeroNotixbitemyapp: It's an interesting system, just for the novelty of it.
06:03AeroNotixddellacosta: It's a bit strong calling it "Erlang style"
06:03AeroNotixddellacosta: but why on Earth would you want that separated in such a way? I don't get it.
06:04AeroNotixWith Erlang, it's a little bit different, you have true Agents which need to be monitored.
06:04ddellacostaddellacosta: I don't know enough about Erlang to comment; but it seems like the only place he's talking about it being Erlang style is here: https://github.com/michaeldrogalis/dire/#usage-erlang-style-with-supervise
06:04AeroNotixExactly
06:04ddellacostawhoops, meant that to be YOUR handle
06:04AeroNotixHe fundamentally does not understand supervisors
06:05AeroNotixIt
06:05AeroNotixIt's more than just catching exceptions
06:05ddellacostaAeroNotix: as far as why you want it separated, I can see the argument--it makes it nice for composing functions without worrying about exceptions.
06:05ddellacostaAeroNotix: and it makes the exceptions feel more like constraints
06:05AeroNotixddellacosta: but then when your program *is* screwing up, what method do you employ to discover where and when exceptions are being handled?
06:06AeroNotixand god forbid, RESTARTING stuff
06:06AeroNotixthere's not even a mention about side-effects in this read me
06:06ddellacostaAeroNotix: well, presumably this doesn't change the fact that an exception is thrown. I mean, I don't think there is anyone here that is claiming that using it = getting erlang in Clojure.
06:06bitemyappAeroNotix: oh yeah, I could agree with that.
06:07AeroNotixddellacosta: The thing is, I *want* Erlang-style supervision trees in Clojure.
06:07clgvAeroNotix: http://docs.caudate.me/ribol/ is nice concerning continue on error
06:07bitemyappAeroNotix: I think part of the problem with CL is that production was just seen as a REPL without a human at the helm 100% of the time.
06:07AeroNotixbitemyapp: :)
06:08AeroNotixis there anything that is truly like Supervision trees in Clojure?
06:08bitemyappAeroNotix: Grumpy old CL'er. Anyway, no. I'd like them too.
06:08bitemyappAeroNotix: but in actuality, what I want is supervision trees in Haskell.
06:08AeroNotixbitemyapp: Same difference :) Supervision trees are an excellent method of error handling
06:08bitemyappAeroNotix: been fucking around with green threads in Haskell, it'd be easier to implement there than in core.async/JVM threads.
06:09bitemyappuhhhhh...under a particular programming model they are
06:09ddellacostaI was going to say, seems like you could put something together w/core.async, but don't know enough about what is required on top of that.
06:09bitemyappI'd hesitate to recommend supervision trees to somebody who wasn't operating in the Erlang mindset.
06:09bitemyappddellacosta: it wouldn't be as nice as reified green threads like Haskell.
06:09AeroNotixsure, Erlang's whole thing makes it a joy to use. With other languages with different concurrency guarantees it takes a bit more diligence
06:09bitemyappAeroNotix: Haskell is pretty damn close.
06:09ddellacostabitemyapp: yah? I gotta read up on that.
06:10AeroNotixddellacosta: Learn You Some Erlang
06:10bitemyappAeroNotix: languages like Java, Clojure, etc would be fiddlier.
06:10AeroNotixddellacosta: free online book
06:10ddellacostaAeroNotix: man, I got so much to learn first...*sigh*
06:10AeroNotixbitemyapp: Then I need to look into the concurrency with Haskell then :)
06:10bitemyappas a bonus, channels are already a thing in Haskell.
06:10ddellacostaAeroNotix: I just started getting into Haskell, because of that bastard bitemyapp
06:10bitemyappso that plus "real" green threads == Erlang-a-go-go.
06:10AeroNotixbitemyapp: library or runtime?
06:10bitemyappjust don't be an asshole and stuff Data.Dynamic objects into channels.
06:10bitemyapppeople will find you, and they *will* kill you.
06:10AeroNotixhaha
06:10ddellacostaheh
06:11bitemyappAeroNotix: the green threads or the channels?
06:11AeroNotixbitemyapp: well, both
06:11bitemyappAeroNotix: well it's all Control.Concurrent, which is part of base.
06:11AeroNotixok
06:12bitemyappAeroNotix: as you might imagine, base is fairly fundamental but technically a library. Even the prelude is optional in Haskell.
06:12bitemyappI guess the "catch" is that lower level stuff like base is implemented in terms of GHC primitives.
06:12bitemyappbut those same primitives are available to you as a user anyway...so it's distinctly unmagical.
06:13AeroNotixbitemyapp: Cool. I read most of LYAH, but I found it a bit... meh. It didn't really show me anything I didn't already know about functional programming. Some monads I saw use of, functor etc. But I just couldn't *see* the real-world stuff
06:13AeroNotixI've got Real World Haskell on my list
06:13bitemyappAeroNotix: http://hackage.haskell.org/package/base-4.6.0.1/docs/Control-Concurrent-Chan.html
06:13AeroNotixbitemyapp: is there a bounded version?
06:14AeroNotixyes, there is
06:15bitemyappAeroNotix: worth noting the "safe haskell" notation in the top right corner.
06:15bitemyappAeroNotix: http://www.haskell.org/ghc/docs/7.6.3/html/users_guide/safe-haskell.html
06:16AeroNotixinteresting!
06:16bitemyappAeroNotix: Also: http://hackage.haskell.org/package/stm-chans-3.0.0/docs/Control-Concurrent-STM-TBChan.html
06:16bitemyappAeroNotix: if it floats your boat, pretend Haskell is a big fat dialyzer for functional code with better error messages and higher-level understanding of the code.
06:17bitemyappAeroNotix: that sweet, sweet hackage (haddock-generated) documentation is like 1/3 of what I like about using Haskell.
06:17bitemyappCan just read the types.
06:17AeroNotixbitemyapp: yeah, dialyzer leaves a LOT to be desired. It sometimes doesn't catch incredibly obvious cases, but then will spit out a ridiculous error because of something minor.
06:18AeroNotixIt's a mess. Erlang really is a ghetto sometimes. I mean that.
06:18AeroNotixBut the core concepts of the language seem hard to find in other plaes.
06:19bitemyappAeroNotix: it's easier to start static and reclaim dynamicity after the fact with the occasional escape hatch than to go in the other direction.
06:19AeroNotixbitemyapp: quite true
06:19bitemyappand I really hesitate to even frame it in terms of "dynamicity" when really that doesn't mean a lot.
06:20AeroNotixtype unsafe, really
06:20bitemyappreally what's meant is "carelessness with sum/product types"
06:20bitemyappRight.
06:20AeroNotixbitemyapp: could you compare core.match to Erlang's pattern matching?
06:20bitemyappI get that people want to just sorta blindly sift through JSON and the like, but there are type-safe ways to do so that aren't tedious.
06:21ddellacostaalright you crazy cats, I'm going to take a break and exercise. bitemyapp get some sleep.
06:21ddellacosta;-)
06:23bitemyappAeroNotix: core.match is "okay" but not really a full citizen of the language in a way that makes it nice.
06:23bitemyappAeroNotix: you're always going to have another layer of arguments, destructuring, and the word "match" inside of your functions if you want to use it prolifically. A macro can clean this up, but ugh.
06:23AeroNotixbitemyapp: looking just through the docs and not using it, it just seems to have Erlang's `case' expressions, right?
06:24bitemyappthe extensibility is cool though.
06:24bitemyappAeroNotix: basically, yeah.
06:24bitemyappAeroNotix: and it is essentially using interface-based APIs into "types" of data structures. seq'ish, vector'ish, map'ish.
06:25AeroNotixI like that it has (or A B) patterns, sorely missing in Erlang
06:26bitemyappAeroNotix: Haskell has pattern-matching and guards, but a big plus here that doesn't "hit" you immediately is that the laziness means you get macro-esque behavior by default in Haskell functions.
06:26bitemyappAeroNotix: so composable predicates that don't eval their arguments are the default capability.
06:26bitemyappso about 80-90% of what you ever needed macros for goes "poof"
06:27bitemyappthe other 10-20% falls into applicatives or free monads, depending on whom you ask.
06:27ucbbitemyapp: http://www.theguardian.com/music/musicblog/2014/jan/14/mogwai-rave-tapes-album-stream
06:27bitemyappthere are more sophisticated ways still to do such things, such as actual macros, but meh.
06:27ucbbitemyapp: also, I missed your last musics because backlog and limechat
06:27AeroNotixhuh, mogwai, clojure, fp. Am I home?
06:27ucbAeroNotix: \o/
06:27AeroNotix:)
06:27bitemyappI like the scottish, mogwai, clojure, fp, and haskell.
06:27bitemyappfeels right to me.
06:27bitemyappucb: danke. let me track it down.
06:28bitemyappucb:
06:28bitemyapper.
06:28bitemyappdammit
06:28AeroNotixSoma.fm has a good radio station I like to listen to, similar stuff. Groovesalad and Spacestation
06:28bitemyappucb: http://www.youtube.com/watch?v=jTW1VsqiNV4
06:28ucbta much
06:28ucbalso hai
06:29bitemyappucb: hi!
06:29ucbI trust all is well with you, etc.
06:30bitemyappoh yes. much learning very fun wow
06:30bitemyappucb: been watching this news about scottish independence with a lot of excitement.
06:30ucbinteresting
06:31ucbwhat excites you about this?
06:31bitemyappucb: have some ancestry there but mostly a general republican (political science term) sympathy.
06:32AeroNotixWhere are some other good Clojure communities? I tried to use G+ but it's... meh
06:33bitemyappAeroNotix: Twitter, here, reddit, hacker news (sorta), the mailing list
06:33AeroNotixbitemyapp: cool, cheers
06:34ucbbitemyapp: oh, I see.
06:34bitemyappucb: I found out about it because some CS scholars I follow are sympathetic and equally excited.
06:35bitemyappucb: what's the sentiment where you are?
06:35ucbbitemyapp: excited about the fact that there'll be a referendum? that it might happen?
06:35ucbbitemyapp: it's divided between the yays and the mehs and the tehnoes!
06:36ucbbitemyapp: just like everything else really. I think the real division is between yes and no.
06:36ucbbut I'm not following it that closely. Mainly because politics.
06:37bitemyappucb: I'm not sure it's political-as-such for me, just interesting.
06:37ucbbitemyapp: indeed it is. And the implications are pretty big if you ask me. It's just that I find the debate sort of void of content.
06:38carkbitemyapp: there was this talk from peter seibel about restarts and conditions, I think he makes a good case for these
06:38ucbbitemyapp: it mostly revolves around "oh, but if we were independent we could hate the English while being rich" and "if you were independent you would not be able to keep the pound, get international credit, nor be a part of the EU"
06:38carki'm a bit late to the party =P
06:38bitemyappcark: I'm familiar with it and every other argument on the subject
06:38bitemyappcark: I was...utterly immersed in CL culture for a long time.
06:38bitemyappI'm increasingly skeptical of it except for debugging in a REPL.
06:39bitemyappI don't think making reliance on implicit state "easier" is a good thing at all.
06:39bitemyappucb: is there really any doubt about scotland being able to get into the EU after the fact?
06:39carkwell, CL is statefull
06:39bitemyappucb: particularly if they believe they have money?
06:39bitemyappcark: so is Clojure and Haskell and everything else.
06:39bitemyappcark: the question is how principled and disciplined you are about managing that state.
06:40ucbbitemyapp: I haven't a clue. Many political editors/analysts say that it'd be a tough negotiation. Which I believe it would be. It'd probably end favourably, but still.
06:40carkbitemyapp: clojure and haskell want to be as little of that as possible
06:40carkbitemyapp: CL has no shame about it
06:40bitemyappucb: tough negotiation? after the eastern european nations got in?
06:40ucbbitemyapp: do you really believe that if Scotland was to be independent it'd get to keep all the oil money while keeping just a fraction of national debt?
06:40ucbbitemyapp: well, it's all in the details really.
06:40bitemyappcark: that's not an entirely accurate characterization about Clojure *or* Haskell.
06:41ucbbitemyapp: for instance: would Scotland adopt the Euro?
06:41bitemyappcark: it's about having a variety of options and using the right defaults at the right time.
06:41bitemyappucb: I would dearly love to know the SNP answer to currency.
06:41logic_prog_is there a way, in clojure, when dealing with java interop, to say: "if there is a field called .data", then do (.-data obj), else do "nil" ?
06:41logic_prog_i.e. the behavior of ":data" (get me the value if the key exists, otherwise nil)
06:41bitemyappucb: but adopting the Euro would've been my guess.
06:41carkbitemyapp: hey we're both sold on that... but i would argue that different stuff works with diifferent languages
06:41logic_prog_but instead, I want to do this to a java field : ... if the field exists, get me the value, otherwise give me null
06:41ucbbitemyapp: same here. But they rarely (if ever) talk about this. They talk about money in magical terms: "money"
06:41bitemyappmutable closures gag.
06:42bitemyappucb: scotland should bring ducats back.
06:42ucbheh
06:42bitemyappor the heads of slain english, as a currency.
06:42bitemyappthe mint will be pike-wielding headhunters.
06:42ucbin any case, the issue is far trickier than the media portraits it if you ask me.
06:43AeroNotixlogic_prog_: create a getter
06:43bitemyappoh sure.
06:43xificurCanyone using seesaw? I am trying to do something rather simple, I have a textbox and I'd like to fix its size
06:43bitemyappucb: well it's an issue affecting populations of ~5mm and ~50mm people
06:43AeroNotixlogic_prog_: or again, a macro
06:43bitemyappucb: meanwhile, I live in a state of ~50mm people in a country of ~300mm :)
06:44ucbbitemyapp: I'm not saying it's a minor issue, though I shiver at the thought that people will go and vote on an issue based on very shallow information.
06:44bitemyappucb: have you been following how people vote typically?
06:44gwsas they have been doing since time immemorial
06:44bitemyappucb: it generally boils down to what they think will lead to them having more money or who they hate the most.
06:44ucbbitemyapp: I have not, but I suspect it's rather rudimentary.
06:44ucbheh - no surprises there.
06:44bitemyappworse, it's rarely rational.
06:44bitemyapplet alone informed & rational.
06:45ucbso the English should say they want an independent Scotland then.
06:45ucbwhich many actually do as they see Scotland as a leech/poor neighbour
06:45bitemyappI've heard that before
06:45bitemyappI wonder how the north sea oil shakes out money-wise, though?
06:47ucbit's difficult to say
06:47ucboil is refined down South afaik
06:47bitemyappucb: actually, I just looked it up.
06:47ucbok, enlighten me
06:49bitemyappucb: well I'm having a hard time pinning it down to exact, year-by-year figures (they're just telling me peaks and troughs)
06:49bitemyappucb: but basically, the north sea oil output for the UK's (scotland's?) share is roughly equivalent to Norway's.
06:50bitemyappucb: given that norway has a similar population to scotland, the economic impact could be extrapolated.
06:50xificurCis it possible that I am getting `Lisp nesting exceeds max-list-eval-depth` even though the parens are ok? Sometimes it seems my emacs bugs out after a change in some file but when I simply restart it it works fine
06:50bitemyappall very rough numbers though.
06:51ucbbitemyapp: fair enough; I don't doubt that the oil money distributed amongst a smaller population would be a good thing to do/have.
06:51ucbbitemyapp: but again, details. Another issue: army? yes, no, size?
06:51bitemyappucb: well it could mean, long-term, a state managed fund for the wealth like norway's.
06:51bitemyappwhich would be, uh, really good.
06:52ucbbitemyapp: I mean, it's mostly paperwork (maybe not all of it) that has already been taken care of by the fact that Scotland is part of the UK. And I'm not saying this is a showstopper, but rather that these things aren't being debated.
06:52ucbbitemyapp: absolutely. Assuming they don't piss it away on tenents.
06:53bitemyappalright alright, bedtime for me.
06:53bitemyappGoodnight all. Dream happy functional dreams. Sugar-plums and supervisor trees.
06:53ucbheh - night bitemyapp
06:56sm0ke89% of clojure bugs are unassigned
06:56sm0keis clojure being developed anymore?
06:58AeroNotixsm0ke: link to tracker?
06:58AeroNotixI'll assign then all to you
06:59sm0kehaw haw haw
06:59AeroNotixsm0ke: as with all open sores project, they have open sores.
07:00sm0keAeroNotix: are you a core dev?
07:00AeroNotixsm0ke: nope
07:00AeroNotixbut I could be
07:00AeroNotixSo can you
07:00AeroNotixthe power is YOURS
07:00sm0keooh
07:00sm0keinspiring
07:01AeroNotixhttps://code.google.com/p/clojure/issues/list
07:01sm0kelol
07:01AeroNotixsort by priority, implement the Low ones, get acquanted.
07:01sm0kei think clojure uses JIRA
07:01AeroNotixI saw that, but it needed a login
07:02gwshttp://dev.clojure.org/jira/browse/CLJ
07:03AeroNotixgws: how do I jira
07:04gwsclick agile tab, feel raw power
07:05AeroNotixam I being kanbanned
07:54danoyoungI'm trying to understand why I get different results from example 3 from the dose examples @ clojuredocs: http://clojuredocs.org/clojure_core/clojure.core/doseq
07:54danoyoungwhen I cut and paste into the repo, I get 4 6 nil
07:55danoyounganyone have ideas on why? I'm just learning clojure and am walking thru the examples....
08:05fredyrdanoyoung: i get 4 6 as well
08:05shokydanoyoung: it's because (map list {:1 1 :2 2} {:3 3 :4 4})
08:05danoyounghmm..typo on the site i guess??
08:05lazybotdanoyoung: Uh, no. Why would you even ask?
08:05shokydanoyoung: er, that's returning a differnet order than in their example
08:06shokyso (* b d) is getting a different result
08:06danoyoungyea, the results on the site are 3 8 nill
08:06shokyrun: (map list {:1 1 :2 2} {:3 3 :4 4})
08:06shokyand see you'll get a different order than they do
08:06danoyoungi'm just learning clojure, so trying to understand why I get different results.
08:06edbond,(map list {:1 1 :2 2} {:3 3 :4 4})
08:06clojurebot(([:1 1] [:4 4]) ([:2 2] [:3 3]))
08:06shokyi'm explaining just that..
08:06danoyoungok, that makes sense….
08:08danoyoungso the order in (map list {:1 1 :2 2} {:3 3 :4 4}) doesn't matter ???
08:08lazybotdanoyoung: How could that be wrong?
08:09shokythe order in a map {} doesn't matter
08:09edbondand order of * doesn't matter too
08:09edbond,(*)
08:09clojurebot1
08:09shokyso instead of matching :1 1 with :3 :3 as in their example, :1 1 is getting matched with :4 4
08:09danoyoungif I take the example from the site and cut and paste into the repo: (doseq [[[a b] [c d]] (map list {:1 1 :2 2} {:3 3 :4 4})] (prn (* b d))) I get 4 6 nil vs 3 8 nil
08:09shokystop repeating that
08:10edbonddanoyoung, example is incorrect
08:10danoyoungok, just trying to make sure I understand….
08:10shokyexample is correct..
08:10AeroNotix,(class (byte-array))
08:10clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core/byte-array>
08:10AeroNotix,(class (byte-array 10))
08:10clojurebot[B
08:10AeroNotixThat^ is dogshit
08:10shokyit's just that the order of the items in the hashmap is different
08:10AeroNotix[B? What on Earth is that
08:10AeroNotixlooks like I didn't null terminate something
08:11tbaldridge, (class (into-array Object [42]))
08:11clojurebot[Ljava.lang.Object;
08:11tbaldridgeAeroNotix: no, it's just the way the JVM creates class names for objects
08:12AeroNotixtbaldridge: It's extremely unhelpful/unreadable
08:15edbondAeroNotix, http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#getName()
08:17AeroNotixedbond: Dayyummm, poor choice
08:18shokydanoyoung: (map list a b) where a and b are maps, takes "first" key-value-pair from each map and puts them together in a list. then same for the "second" kv-pair. in their example, the "first" pairs turned out to be [:1 1] and [:3 3] while when we ran it now, it chose [:1 1] and [:4 4] as "first" pairs instead
08:19shoky,{:3 3 :4 4}
08:19clojurebot{:4 4, :3 3}
08:19shokysee how the order changed for us ^ while when they ran it, the order turned out to be {:3 3, :4 4}
08:20danoyoungshoky, thanx…
08:21danoyoungmakes sense now...
08:23edbond,(map list {:1 1 :2 2} {:3 3 :4 4})
08:23clojurebot(([:1 1] [:4 4]) ([:2 2] [:3 3]))
08:23edbond&(map list {:1 1 :2 2} {:3 3 :4 4})
08:23lazybot⇒ (([:1 1] [:4 4]) ([:2 2] [:3 3]))
08:34socksyIs there a good option for running core.async over distributed systems? Or is the answer basically "don't"?
08:35tbaldridgethe semantics of CSP don't really work with distributed systems. But that's okay since you have things like RabbitMQ, Kafka, or ZeroMQ. Pick one and interface it with core.async.
08:35mdrogalissocksy: Use it at the edges of the individual components in the distributed system
08:35quizdrsocksy not sure it applies but there is a demo of Rich Hickey using overtone, a Clojure music library that has a server/client config, and he uses core.async with the connections of the synths
08:36tbaldridgequizdr: that's not distributed though
08:39socksyyeah, that would presumably be on the same computer. I was thinking something like the alt! macro would be pretty neat over multiple systems (as in, send off something, take fastest response)
08:39socksyI probably don't know what I'm talking about though :)
08:40socksyany recommendations from a clojure side for wrappings around a message queue/messaging system? I've done some zmq stuff in other languages but ideally would want something stable and idiomatic in clojure
08:41mdrogalissocksy: I've been thoroughly enjoying using HornetQ.
08:43daGrevishi! can I somehow write down a really long number on multiple lines?
08:43daGreviswith str i can use str fn
08:46AeroNotixdaGrevis: why do you have such constants?
08:46daGrevisAeroNotix, https://projecteuler.net/problem=8
08:47mdrogalisnope.jpg
08:47mdrogalisdaGrevis: Store it in a file.
08:47daGrevisone solution would be to use str with strings and then parse out the number using regex
08:47daGrevismdrogalis, imo it's an overhead
08:48edbonddaGrevis, use (str "<line1>" "<line2>" ....)
08:48pyrtsa((comp bigint str) 123 456 789)
08:48daGrevisedbond, ye, but I need int
08:48pyrtsa,((comp bigint str) 123 456 789)
08:48clojurebot123456789N
08:49daGrevis pyrtsa cool!
08:49AeroNotixdaGrevis: oh yeah, I did this
08:49edbonddaGrevis, not really, you want to split string and then convert to int
08:49AeroNotixdaGrevis: I just read it from file.
08:49mdrogalisdaGrevis: It's Euler, just put up with it for 5 minutes. :P
08:49edbondbtw I read from file too )
08:49pyrtsa,((comp bigint str) -123 456 789) ;; crazy enough!
08:49clojurebot-123456789N
08:49AeroNotixyou're just reading and parsing once, I guarantee that the rest of the program is slower
08:49AeroNotix100%
08:50daGrevisAeroNotix, true that
08:50daGreviscomp wont work :(
08:50daGrevisone of strings starts with 0
08:52pyrtsa,((comp bigint #(java.math.BigInteger. % 10) str) 0123 456 789) ;; crazy enough!
08:52clojurebot83456789N
08:52pyrtsaDamn.
08:53AeroNotixjust reada
08:53AeroNotixJust. Read. From. File. Damn!
08:53pyrtsaAh, the above works with string arguments of course.
08:53pyrtsaAeroNotix: Yes, that's better.
08:53pyrtsaMuch better.
08:54pyrtsa,((comp bigint #(java.math.BigInteger. % 10) str) "0123" "456" "789") ;; Anyway
08:54clojurebot123456789N
08:54daGrevishttp://vpaste.net/DdYIn
08:55pyrtsadaGrevis: PROTIP: for that Euler exercise, you don't have to parse the whole number as a BigInteger.
08:55pyrtsaTreat the input as separate digits instead.
08:56daGrevispyrtsa, ohh. i should read desc of task 1st :D
08:57daGrevisimo a macro could be a solution too
08:59quizdrdaGrevis has you seen the 4clojure exercises also?
09:00daGrevisquizdr, nop. i've done clojure-koans and 1st 7th euler problems only
09:02quizdrhow are they koans? haven't looked at those yet
09:04edbonddaGrevis, I think str, partition, reduce and max should be enough
09:05daGrevisquizdr, they are awesome! rly helped me a lot https://github.com/daGrevis/clojure-koans
09:05daGrevisedbond, to solve the task or to solve “syntax problem“?
09:06daGrevisquizdr, https://github.com/daGrevis/clojure-koans/tree/master/src/koans
09:06edbonddaGrevis, to solve the problem, there is no limit how you should read it. Parse it in .clj and focus on solution :)
09:08cgrandckirkendall: hi
09:08ckirkendallhello
09:09quizdrwell now if i look at your solutions daGrevis then it will spoil the fun :)
09:10ckirkendallcgrand:have a few questions on you thoughts about how I should approach kioo and the compile. I also am interested in how you see enliven browser based templates working.
09:12cgrandckirkendall: the story I want for enliven templates is that the same template can be used statically or dynamically (or anywhere in between)
09:12daGrevisquizdr, true ;P i recommend this as well. helped me when I was stuck http://clojurescreencasts.com/
09:13locksdaGrevis: oh, never came across this before :o
09:14cgrandspecifically you specify where each part of the model lives (server only, server push, local storage, sync etc.) and this will control where in the static-dynamic spectrum the template emits its stuff
09:14quizdrdaGrevis 4clojure is cool because you can see others' solutions after you figure out yours and see just how versatile and creative the possiblities are to solving a simple (or not so simple) problem
09:15cgrandckirkendall: btw I already applied two of your commits
09:17ckirkendallcgrand: I saw on the commits. So lets make sure I understand. You want enliven to be able to chose where the plan, pre-rende and render take place. So so all could exist on the client side or in some hybrid when you either pre-render on server or full server push..
09:18cgrandckirkendall: sort of, yes
09:19cgrandckirkendall: pre rendering is always done server-side
09:19cgrandstatic pre-rendering: emits chunks of HTML
09:20ckirkendallcgrand: Ok that makes a bit more sense the way I was thinking about it.
09:20cgranddynamic pre-rendering: emits JS (via CLJS) code
09:21cgrandthe JS (CLJS) is going to depend of the model lifecycle, not of the actual data so it will be computed only at template definition
09:21ckirkendallcgrand: It looks like that won't be too hard given how you have the pre-render setup.
09:21cgrandwhat's your goal with kioo?
09:23ckirkendallcgrand: simiar but the target is slightly diffrent. I need to keep the tree intact and output react node structure. With a normal client side template you can use a similar stategy to what you have and output a flatten structure.
09:24quizdrhas anyone read the OReilly ClojureScript book? Worth it? comparable resources?
09:24coventryHmm, the storm issues list (https://github.com/nathanmarz/storm/issues) seems to have disappeared. No issues link on https://github.com/nathanmarz/storm/ either.
09:24ckirkendallcgrand: I also need to change how things are emitted based on what structure I am emmiting.
09:24cgrandckirkendall: how so?
09:24ddellacostacoventry: looks like it's moved to apache, no? https://issues.apache.org/jira/browse/STORM
09:25ckirkendallcgrand: certain things like the style attributes need to be turned into a js-map where other attributes are just strings.
09:25ckirkendallcgrand: and even functions
09:26coventryddellacosta: Yes, but the issues list was still there just a few days ago. Bit of a pain, as I have notes linking into recipes in the issues. You're right, though, I can probably find them imported on jira.
09:26ddellacostacoventry: ah, gotcha. Yeah, I can see how that would be a bit of a pain...
09:27cgrandckirkendall: do you have some sample (or pseudo) target code?
09:27ckirkendallcgrand: I was even planning on modifying the parser to pre spit out styles into a map to make it easier to manage for kioo.
09:28cgrandckirkendall: re-parsing styles, I'm considering phloc-css to parse them
09:32mdrogalisThis is kind of a wacky request, but has anyone ever done Java runtime code generation? Actual source code, not byte code.
09:35ckirkendallcgrand: ploc-css? Are you talking about style nodes like <style>...<style> or are you talking about style attributes?
09:35vijaykiranmdrogalis: as in UML to Java :) ?
09:35cgrandckirkendall: both
09:37ckirkendallcgrand: I am all for that. It eliminates the need for special segments to manage styles.
09:38mdrogalisvijaykiran: Unfortunately PHP to Java. lol
09:39vijaykiranmdrogalis: oh, crap.
09:39vijaykiranmdrogalis: I vaguely remember some project doing that
09:39ckirkendallcgrand: its easy to see how the style attribute would turn into a map, but what would the structure for style block turn into.
09:39mdrogalisvijaykiran: Yeah. Fortunately it's a small subset of PHP. But it's still a pain.
09:40stuartsierramdrogalis: Not sure, but maybe http://janino.net/ is relevant
09:40mdrogalisstuartsierra: Thanks - yep that's actually the target of translation.
09:41mdrogalisI think I'm going to end up writing a parser to generate Janino source blocks. Bleh.
09:41stuartsierraANTLR may also be useful.
09:42mdrogalisstuartsierra: Yeah, I think that'll be a good route to go.
09:42mdrogalisThanks :)
09:42stuartsierrayou're welcome
09:42vijaykiranmdrogalis: how much code are you talking about - may be automating it isn't worth it - as in http://xkcd.com/1319/ :)
09:43mdrogalisvijaykiran: Appropriate. :P Yeah, it's quite a bit, even though the individual blocks to be translated are small.
09:44mdrogalisOh, that's today's. Nice.
09:44vijaykiranyup :)
09:46ckirkendallcgrand: I think using goog.string.StringBuffer we could port almost everything over to the client size fairly easily. We would have to use cljx and modify the emitters to product a sequence of strings, and quoted function calls that are returned by a macro. Then we can just reduce across the sequence and pass the data in.
09:47ckirkendallcgrand: The flatten structure produced by inline-emmit would work well.
09:48cgrandckirkendall: sorry I was on the phone
09:49cgrandckirkendall: re: styles, I haven't thought enough about the model but something (for <style> themselves) as a map of selectors to styles-map; and you would find the same styles-map in style attributes.
09:52ckirkendallcgrand: for kioo I think I may emit something like (let [data-sym data] ...) and then pass the data-sym down the tree and any time I need to output of an action output `(path/fetch-in data-sym)
09:52ckirkendallcgrand: does that sound reasonable.
09:53cgrandckirkendall: I'm not sure I understand when you speak about switching to a StringBuilder client side: this would mean that you bash HTML as string on the client before converting it into (V)DOM
09:54ckirkendallcgrand: It is the fastest way to do it. Setting inner html is much faster than building up dom nodes.
09:54ckirkendallcgrand: Now for kioo I can't do that. I have to output the nodes.
09:55cgrandit's still faster? I thought things have changed (especially if you used document fragment and cloned them)
09:55cgrandckirkendall: and which form will have the nodes then?
09:56ckirkendallcgrand: It depends on the browser but for chrom I still think its faster.
09:56ckirkendallcgrand: I did some testing awhile back when doing enfocus.
09:56mtrimpemdrogalis: You could also just target IntelliJ's AST. I've heard it's quite extensible and should be able to handle what you're intending to throw at it.
09:56mdrogalismtrimpe: That's an interesting idea.
09:57mdrogalisI'll check it out.
09:58mtrimpemdrogalis: I'm still hoping someone will do what cgrand did for Clojure with his 'Not so homoiconic' talk (http://confreaks.com/videos/2068-euroclojure2012-not-so-homoiconic) and apply it to IntelliJ's AST.
09:58ckirkendallcgrand: If we determin otherwise it would follow the exact same model as kioo.
09:59mtrimpemdrogalis: The we could finally use Clojure to take a chainsaw to legacy Java codebases :)
09:59ckirkendallcgrand: I will have to look but I know the makers of Dommy did a lot of performance testing around this.
09:59mdrogalismtrimpe: Will have a watch :)
09:59cgrandmtrimpe: *sigh* buried in my TODO list
10:00ckirkendallcgrand: http://andrew.hedges.name/experiments/innerhtml/
10:00ckirkendallcgrand: it seems to confirm what I saw in my testing.
10:00mtrimpemdrogalis: It's about carrying formatting around when you're programmatically rewriting clojure code. So not *that* relevant for your task but still very interesting nonetheless ...
10:00cgrandckirkendall: you would have to measure exactly what you need. With enliven constraints you have enough information to emit plain direct indexed DOM access to the elements you need to modify
10:01mdrogalisAh, yeah. Been there. :/ mtrimpe
10:02ckirkendallcgrand: So we would only be taking the hit for the clone. That makes sense.
10:05cgrandckirkendall: ok so you can reuse enliven plans and roll your own emitters
10:05cgrandI'll be happy to assist in if you figure out some refactoring to perform o as to reuse the current emitters for static HTML
10:06cgrandckirkendall: beside that, no troubles figuring out what's going on in Enliven?
10:07ckirkendallcgrand: took me a bit realize what you were doing with inline-emit but most of it make sense.
10:09ckirkendallcgrand: using the plan to the make the changes would be a significant change the flow of enlive. Right now you use the plan to do pre-rendering. In this case we would just emit the original content and use the plan at call time?
10:10ckirkendallcgrand: or some hybrid approach?
10:11cgrandckirkendall: in the browser? no I would transform the plan in CLJS code, no more "plan" data structure
10:11ckirkendallcgrand: be right back
10:16cgrandckirkendall: https://gist.github.com/cgrand/8521651
10:34AeroNotixWhat's the equivalent of bit expressions in clojure?
10:34AeroNotixsuch as -117 & 0xFF?
10:34mdrogalis,(doc bit-and)
10:34clojurebot"([x y] [x y & more]); Bitwise and"
10:35AeroNotixmdrogalis: boom, cheers
10:35mdrogalis^^
10:37ckirkendallcgrand: Ok that gist is made me a bit confused. For dynamic do we don't know the direct traversal because the structure of live dom can change. In cases like that I would use querySelector for traversal like enfocus.
10:38ckirkendallcgrand: For static templates we can use a fragment and do direct traversal but I can't see how we could ever do that for the live dom.
10:42cgrandckirkendall: I assume enliven owns the DOM (or a subtree of it) so I can keep a record of where are the elements I need to update.
10:44ckirkendallcgrand: I completely agree in a model like Om and kioo. Infact that is the bases for how react works.
10:46cgrandckirkendall: one design goal for Enliven was "no tree-walking past definition time"
10:46cgrandand querySelector somehow qualifies as (optimized) tree walking
10:47mmitchel_Can someone recommend one of these http client libs? http-kit OR neotyk/http-async ?
10:47mmitchel_i've used the neotyk lib, but liking the fact that http-kit has no dependencies other than clojure
10:48ckirkendallcgrand: What you are describing is similar to something I want to kioo and possilby a formal clojure version of react. I am having a hard time seeing it on top of the live dom vs something like reacts virtual dom wear component definition is self contained.
10:50cgrandckirkendall: an aspect that I didn't mention is event handlers
10:50cgrand"event handlers" are transformations
10:50ckirkendallcgrand: Either way we can certainly build it but people would have to be very careful about the types of dom changes even made by a transform as its mutable strucuter would make the call only possible once.
10:51juxovecis there any possibility to get a source of a given namespace? (the way we use source for functions)
10:51ckirkendallcgrand: it really sounds like youa re descrbing a clojure version of react.
10:51cgrandckirkendall: I don't want user to touch a DOM, be it virtual or immutable
10:52ckirkendallcgrand: It something that when i first saw enliven I thought could be created.
10:53cgrandin "event handlers" you get access to a piece of the model (the one scoped by the path)
10:53ckirkendallcgrand: I still think all transforms operate on fragments that replace the live dom and never directly on the live dom. This make sure the input is alway consistant for traversal.
10:55cgrandso the handler returns a modified version of the piece of the model which is put back in the model and transforms which depend on it are triggered for rendering
10:55ckirkendallcgrand: have you looked at om?
10:56cgranda bit, I need to investigate how much I can use it and/or react
10:57ckirkendallcgrand: The idea of om is exactly what you describe. Basically you get a cursor into the model and can change that and all items transforms dependend on it are updated.
10:57cgrand(I laid out the design for enliven last spring)
10:58cgrandckirkendall: yes I saw dnolen mentioned lenses and Enliven segments/paths are lenses too
10:58cgrandbut I haven't had time to look at the invalidation logic
10:59ckirkendallcgrand: You see the whole dom structure as a series of nested templates.
10:59ckirkendallcgrand: where the model is passed down the chain?
11:00AeroNotixI'm having trouble implementing this in Clojure: https://gist.github.com/AeroNotix/47314dfb31e3fded1d87
11:00AeroNotixany pointers?
11:01cgrandckirkendall: nesting only occurs for iteration
11:02stuartsierrajuxovec: not directly, but you can munge a namespace name into a file name and read it as a resource from the classpath.
11:03AeroNotixhttps://gist.github.com/AeroNotix/47314dfb31e3fded1d87 I got this so far
11:03ckirkendallcgrand: Here is how I understand what are suggesting. A template owns a piece of the tree (dom or otherwise) the template is rendered based on the model. Only changes in the model can change how the template is rendered. Optimization can be done to only update the items where the model changes.
11:04juxovecstuartsierra: but can I do this for code outside my project (for exapmle clojure.core)?
11:04ckirkendallcgrand: the underlying imput for the transform is fixed at definition time and all changes are dictated by the changes in the model.
11:04cgrandckirkendall: yes and yes
11:04ckirkendallcgrand: this allows for the optimization of traversal and modification.
11:05cgrandyes again
11:06stuartsierrajuxovec: Yes, if the source files are on the classpath, which they normally are. clojure.core is a special case because it is split among several files.
11:06ckirkendallcgrand: this is exactly what react, om and kioo goals are. With a few exceptions that make this a bit cooler. One we can use the plan and point free style to optimize the performance of this to be better than reacts.
11:07cgrandbasically it compels down to an optimized react tailored for your template
11:07`cbpAeroNotix: sorry yo no hablo erlang. What are you trying to do and what is the problem?
11:08ckirkendallcgrand: The second being that because we have a plan known at compile time we can eliminat the need for the virtual dom and diffs.
11:08juxovecstuartsierra: so it is enough to search over classpath for paths where ab.cd.ef-gh is replaced to ab/cd/ef_gh.clj? great thx
11:08cgrandckirkendall: diff shifts from the dom to the model
11:08ckirkendallcgrand: yes
11:08stuartsierrajuxovec: yes. clojure.java.io/resource can find the files on the classpath
11:08cgrandckirkendall: and you still have to take care of not losing the user focus/selection etc.
11:09ckirkendallcgrand: this is where the event structure comes in.
11:09AeroNotix`cbp: We have a single sign on service which returns a cryptographically secure cookie, I need to decrypt that.
11:09cgrandckirkendall: but because of the hierarchical nature of paths, most of the time (outside of loops) the diff will only be a comparison with the previous value
11:10ckirkendallcgrand: and like om because its a persistant data structure it can be an identity check at any layer of the path.
11:10cgrandindeed
11:11dnolencgrand: form focus/selection this one thing that React handles pretty well, form elements are one of the only cases you ever have to "touch" the DOM.
11:11dnolencgrand: ckirkendall: one thing is that this sounds like you have to put more in the model? This something I tried in Om but abandoned, you often what to keep a component's local state separate from the application state.
11:13ckirkendallcgrand: dnolen: This is something I really like about om. It keeps component internal state out of application state.
11:14dnolencgrand: still this sounds very interesting :) definitely curious about Om w/ a different renderer.
11:16cgranddnolen, ckirkendall: what is the problem with the component state being namespaces inside (or alongside) the application model
11:17cgrand?
11:17dnolencgrand: I am very interested in snapshotting, serialization - it just makes those more work you have to do separation yourself.
11:17ckirkendallcgrand: its more for usability of reusable components for me. I can build a component that stores local state for activities and only exposes some events for changes to application state.
11:19dnolencgrand: the real long term goal for Om is time management of application state, if you want to do a data diff between two app states you'll get a lot of transient state in your diffs
11:19dnolenif you put all state into the model, even transient stuff (mouse dragging, modals, etc)
11:19AeroNotixI'm having trouble implementing this in Clojure: https://gist.github.com/AeroNotix/47314dfb31e3fded1d87 Any pointers?
11:20cgranddnolen: can't a lens remove the non-essential state?
11:21dnolencgrand: but then it's a policy the user has to manage no?
11:23ckirkendalldnolan: are you thinking about a datomic style of query for application state?
11:24dnolenckirkendall: querying the timeline is definitely a goal yes
11:24cgranddnolen: given a path (lens) into the model another lens can be generated that will return a pair [application -satte ui-state] without the user having to do anything about it. He just gets an additional arg to his handler
11:25AeroNotixgreat, and the Erlang crypto code is a NIF
11:25cgranddnolen: and the hander has to return a pair too
11:25dnolencgrand: that works, so users could specify if their modifying app state or ui state
11:27potterhello
11:27potter!list
11:27cgranddnolen: I've been somehow convinced that local state is poison ;-)
11:27dnolencgrand: but does this mean you need to have [app-state ui-state] at the root?
11:27dnolencgrand: haha, the illusion of it is still useful
11:28cgranddnolen: yes but then snapshotting only the application-state is not a problem anymore, is it?
11:29dnolencgrand: if some component doesn't need local state but another one does, can they both live in the same render tree
11:29dnolencgrand: or does the user need to juggle?
11:30coventrymdrogalis: Clojurejava sounds like an idea whose time has come.
11:30cgranddnolen: I think they can if it's baked in the event system to make the split app/ui as proposed above
11:30mdrogaliscoventry: Eh?
11:31cgranddnolen: obviously if it's an opt-in feature you'll get clashes
11:32dnolencgrand: yeah, ok, so in Om by having real local state we get modularity
11:32dnolencgrand: still if Enliven worked that way it would be pretty exciting to have it as an alternate backend to Om :)
11:32coventrymdrogalis: Compiling clojure to java to use javac to generate java bytecode.
11:33coventryWhat your question about generating java brought to mind for me.
11:33coventryShould have added a smiley. Not serious.
11:33cgranddnolen: the dynamic emitter is not there yet :-) I need time :-(
11:33mdrogaliscoventry: I need to end up with actual Java source code as a string. D:
11:33mdrogaliscoventry: I'm having a rough start to this week. ;)
11:34cgranddnolen: but I hope all the constraints will yield good perfs (as they do in the static case)
11:34ckirkendallcgrand: Can you put a gist together on the event setup. I still trying to wrap my head around it.
11:40ckirkendallcgrand: I going to try to build the template structure for kioo so that the rendering is completely based on enliven. Currently it outputs react nodes but it doesn't have too. I can then use a react wrapper to expose it to om and other.
11:43the-kennydnolen: Have you had a look at the Chrome extension to inspect React applications? It's quite nice, but currently not *that* easy to use as all Om components have the name 'Unknown' and the state isn't easy to read (as the Clojure data structures aren't easy to inspect)
11:43ckirkendallcgrand: I am going to concentrate on the rules for outputting the traversal and modification separate from the dom input.
11:45cgrandckirkendall: not precise enough but still https://gist.github.com/cgrand/8523669
11:46cgrandanyway everything is in flux and superficial API is not my problem at the moement
11:46cgrandckirkendall: I have to run
11:46AeroNotixI'm having trouble implementing this in Clojure: https://gist.github.com/AeroNotix/47314dfb31e3fded1d87 Any pointers?
11:50ckirkendallcgrand: thanks for chatting
12:17mrhankyis it possible to shorten this binding? (binding [ns/a a ns/b b ns/c c ns/d d ns/e e ...] ... ) ?
12:19sandbagsif ns is always "ns" i guess you could write yourself a macro to explode [a b c d …] into [ns/a a ns/b b …]
12:20dnolenthe-kenny: yup, React need a patch to make it work
12:21dnolenthe-kenny: not difficult to do
12:23eraserhdSo, I have a case where I'd like mutation only to guarantee amortized time of a data structure.
12:23eraserhdIts contents do not change in case of this mutation.
12:24eraserhdSo I want something like an atom inside the data structure, but I don't care if the update gets lost (I mean, I don't want to retry the transaction).
12:24the-kennydnolen: Nice :) I think it would be a helpful addition
12:24the-kennydnolen: Other than that: Thank you *so* much for Om. You removed so much pain from web-application development (for me)
12:24eraserhdCan I just use deftype's mutable field? Do I need to do something else to make an atomic swap?
12:30grzmI'm getting started with core.async in Clojurescript and trying to straight-line some serial callbacks
12:30grzmI've taken an shot using a gist from dnolen: https://gist.github.com/grzm/8524580
12:31bbloomeraserhd: you should study java's synchronized, volatile, etc & understand them before attempting to do mutable fields that are concurrency safe in clojure
12:31grzmI'm having issues getting the value out of the go block, basically untangling the go/try/let
12:32grzmHow should I be approaching it?
12:33eraserhdbbloom: Oh, right. Thanks. :)
12:33edbondgrzm, using channels! (<! (let [out (chan)] (go <do-something> and (>! out <result>))))
12:34bbloomgrzm: wrap the let in a go and then use <! for each binding expression
12:34grzmedbond: don't <! and >! have to be in go blocks well?
12:35bbloomgrzm: at the "edges" (ie where you interop with callbacks or the top-level) you can use the asynchronous put! and take! functions
12:35edbondgrzm, yes, should be used in go block
12:36grzmbbloom, edbond : thanks. let me give that a shot
12:36bbloomgrzm: not that put! and take! are functions, not macros or special syntax in a go block. you can use them normally
12:37edbondI think take! is not usable in clojurescript, don't have much node exp though
12:37edbondalso *!! (blocking variants) is not accesible in js, right?
12:37bbloomedbond: take! and put! are the primitives that everything is built on internally. they are necessary on any js host to interop with callbacks
12:38bbloomedbond: the !! functions aren't variants in blocking, they are variants in threading. the single ! functions are blocking too, but they utilize "parking" instead of real threading primitives
12:39bbloomthe put! and take! functions are non-blocking & utilize a global queue
12:39edbondbbloom, yes you are correct, take! is valid too. I think of take! put! as <! !> wrapped in go macro
12:40bbloomedbond: it's the other way around :-) if you ever find yourself writing (go (<! c)) or (go (>! c x)) you could write take! or put! instead respectively
12:40bbloomedbond: however, you should avoid asynchronous sends like that b/c are unbounded
12:41edbondyes, that's what I meant.
12:42edbondavoid because they introduce a new go block?
12:43bbloomedbond: no b/c there is no backpressure
12:43bbloomedbond: if you have a bounded buffer and it's full, you block
12:43bbloomedbond: if you have an unbounded buffer, it can't be full
12:43bbloomso senders can overwhelm a receiver
12:43bbloomyou need to enforce the correct work balance manually
12:44bbloomthis is true of all event systems, but traditional callbacks are so damn bad at everything that you haven't got the spare brain cycles to think about anything as interesting as back pressure :-)
12:46edbondbbloom, thank you for explanation :)
13:20ro_stdnolen: what's the right way to have om/react write an unescaped script tag? doing youtube api things
13:20luxbockhow do I rename a file in Clojure? I have a java.io.File called fff, so what I tried to do was (.renameTo fff (clojure.java.io/file "new-name.ext")) but this returns false and the file name doesn't change
13:20dnolenro_st: that's a react question, don't know.
13:21ro_stdnolen: thank you
13:24luxbockhmm I must be doing something wrong since (.renameTo (file "old") (file "new")) is how rename is implemented in the fs library
13:25ro_stdnolen: what do you suggest my approach be when i encounter things like core.async go blocks not firing or takes from channels not receiving when i put something on them?
13:25technomancyerror conditions that are communicated by return values. in the 21st century. =(
13:25ro_stran into several such issues over the weekend
13:25ro_stall in cljs
13:26dissipatedoes anyone know if it is worth it to create a Docker image for a basic Datomic install?
13:26dnolenro_st: in CLJS in general?
13:26dnolenro_st: just sounds like bugs in the code you're writing.
13:26ro_styes. right now when i encounter such an issue, i'm at a loss about how to proceed with debugging
13:27dissipatei want to write a Docker file to create a Docker image for Datomic, with a separate container for the file volume
13:27dnolenro_st: it's take a bit of work to identify core.async problems if you haven't been doing it a while.
13:27ro_stwe had a channel that received no problem except when writing to it from inside a dom handler. things of that nature
13:27dnolenro_st: still it could be easier, I'm hopefully that simple-check could help w/ async testing
13:27dnolenro_st: automatic detection of dead locks, and checking that invariants are satisfied
13:28dnoleneven if async
13:28dnolens/hopeful/hopefully
13:28dnolenro_st: in the meantime it just takes some practice
13:28dissipatednolen: deadlocks, wtf?
13:28dnolendissipate: that's the tradeoff w/ CSP, deadlock
13:29dissipatednolen: i thought they were trying to explicitly avoid deadlocks. :(
13:29dnolendissipate: but it something plagues many async message oriented abstractions
13:29dissipatednolen: that sucks. :(
13:29dnolendissipate: no it's reality
13:29dnolennothing to do w/ sucking or not sucking
13:30dnolendissipate: distributed system have to face the same problems
13:30dissipatednolen: correct me if i am wrong but i thought the whole idea of STM was to avoid locking
13:30dnolendissipate: we're talking about CSP, not STM
13:30ro_stSTM != CSP
13:30dissipatednolen: ah, i see.
13:31dissipatednolen: sounds like Golang
13:31dnolendissipate: or Erlang, similar abstractions
13:31dnolendissipate: or any serious async system
13:31dissipatednolen: what is the advantage of CSP over STM?
13:32dnolendissipate: they don't really address similar problems
13:32technomancywhat is the advantage of toothpaste over gears?
13:32TimMctechnomancy: I am going to quote you on that.
13:33technomancySTM is a way to coordinate changes to specific pieces of data
13:33edbondro_st, take a look at the end of Markdown http://facebook.github.io/react/docs/tutorial.html#adding-markdown
13:33technomancyTimMc: the canonical one is "How is $X better than hadoop" IIRC
13:33dnolendissipate: in CSP you have decoupled components w/ local state trying to communicate with each other. With STM you have multiple threads of control trying to interact sensibly with shared state.
13:33TimMcOh, it was supposed to be silly. I hadn't read backlog, so I thought those were the names of related Clojure libraries. :-P
13:33edbondthere is some dangerouslySetInnerHTML thing in reactjs, may help
13:33edbondro_st, ^
13:33ro_stthanks edbond!
13:34dnolendissipate: I'm sure there's some deep theoretical statement that says they are effectively equivalent, but the interface presented means you model solutions to your problems very differently.
13:35dissipatednolen: sounds like systems programming vs. application programming
13:35technomancyTimMc: http://www.slideshare.net/gigaom/structure-data-presentationsheehywhy-you-should-not
13:35sandbagstoothpaste won't rip the enamel off your teeth?
13:35dnolendissipate: probably not a bad way to think about it.
13:35hlshipdnolen: Where/when is a good time/place for discussion of Om?
13:35hlshipHave some Q's and ideas
13:36dnolenhlship: probably best in #clojurescript
13:36dissipatednolen: i have actually been thinking about this a lot lately. Hickey actually had a talk about systems programming where he outlined the problem of different systems having their own state and having to coordinate between them. seems rather unsolved to me.
13:37dnolendissipate: I think core.async is his and others take on this problem.
13:38dissipatednolen: but how do you use that if you have a Twitter feed, a Facebook timeline and a dozen other external systems with their own state?
13:38TimMcsandbags: Not with that attitude.
13:38dnolendissipate: CSP is a coordination language
13:39sandbagsTimMc: I guess it does depend how rigorously you apply the gears
13:41dissipatednolen: hmm. suppose you feed all the data from each system into a Datomic database and then query as needed.
13:41ro_stdnolen: do any of the lifecycle methods fire after rendering?
13:42dnolenro_st: IDidUpdate, IDidMount I think
13:43ro_stthank you
13:43ro_stiDidUpdate sound like a suitable place to call out to YouTube api after writing a video to the page?
13:43clojurebotI don't understand.
13:47dnolenro_st: IDidMount is probably better, happens *once*
13:48dissipatednolen: have you seen this? http://www.youtube.com/watch?v=ROor6_NGIWU (The language of the system)
13:48dnolendissipate: yep
13:48ro_sti need it to happen every time i alter the video src url. looks like mount for the first time, and update for subsequent times
13:48dnolendissipate: that's pre core.async though
13:49dissipatednolen: how does core.async solve the problem?
13:49dnolendissipate: which solves some of those problems in the small, in the large different story.
13:49dnolendissipate: you have similar problems at different levels of scale
13:49dissipatednolen: what's the ultimate solution?
13:49dnolendissipate: everyone using Erlang?
13:50bbloomdnolen: gah no. erlang doesn't solve most of the problems discussed in language of the system lol
13:50dnolenbbloom: heh I wouldn't go so far as to say most
13:50bbloomdnolen: it punts by requiring homogeneous system components, which is a totally valid approach inside a single org
13:50dissipatednolen: don't see how that helps. Twitter could be written in Erlang, it's still going to have its own state.
13:51dnolendissipate: I don't really see a solution, beyond use a language and abstractions that can deal w/ heterogeneity.
13:54dissipatednolen: if all of your systems generate a constant feed, one solution is to have them all write to a Datomic database, which produces a consistent database value at any point in time. correct?
13:54tbaldridgedissipate: or use something like kafka which is like Datomic-as-a-conveyor-belt.
13:55ivanluxbock: "The return value should always be checked to make sure that the rename operation was successful." http://docs.oracle.com/javase/7/docs/api/java/io/File.html
13:55ivanluxbock: if some library doesn't do this, it's broken
13:56dissipatetbaldridge: i see. thanks.
13:56ivanluxbock: the destination directory might not exist, you might be lacking permission, Windows might have a lock on it, etc
13:56tbaldridgedissipate: that's hwo LinkedIn does it for example.
13:56dissipatetbaldridge: they use Kafka?
13:57dissipatetbaldridge: have you heard of Raft? http://highscalability.com/blog/2013/8/7/raft-in-search-of-an-understandable-consensus-algorithm.html
13:58klrr_hello
13:58egosumGood afternoon all
13:58egosumLiberator seems pretty great to me. I can't find anything too bad about using it…anyone know any gotchas or reasons to be wary of using it?
13:58tbaldridgedissipate: just recently, yes
13:58dissipatewow, didn't know they created Cogniect. interesting.
13:58dissipateCognitect
13:59dissipatetbaldridge: do you think it is worth it to create a Docker image for a basic Datomic installation?
13:59tbaldridgewho created Cognitect?
14:00ro_stdissipate: Cognitect created Datomic. Cognitect is a company
14:00andyfThinkRelevance and Rich Hickey created Cognitect
14:01dissipatero_st: it seems they created the company after Datomic came out. no?
14:01dissipateandyf: do they have Clojure jobs?
14:01ro_stif they don't, no one does :-)
14:01bbloomro_st: they were called Metadata Partner's at some point :-)
14:01andyfdissipate: Check their web site. maybe.
14:01bbloomer no apostrophe
14:01stuartsierraFull explanation of the Cognitect / Relevance / Datomic thing in this podcast http://thinkrelevance.com/blog/2013/09/16/cognitect-podcast-episode-040
14:02ro_stbbloom: yup
14:02TimMcro_st: I think dissipate means "openings".
14:02tbaldridgedissipate: we're almost always looking for contractors : http://www.cognitect.com/jobs
14:02dissipateandyf: didn't see jobs on cognitect's site. but relevance does have a jobs page.
14:02ro_stwhat tbaldridge said
14:03andyfstuartsierra: You would not be surprised to learn that deftest's in a namespace can be executed in pretty much arbitrary order relative to each other?
14:03stuartsierraandyf: yes that is expected
14:03dissipatetbaldridge: ah, i didn't see that sidebar. cool, thanks.
14:03dissipatetbaldridge: remote contractors as well?
14:03andyfstuartsierra: So if some tests in Clojure happen to pass because of the order they are executed, it would be better to change them not to depend on the order they are currently executed?
14:04egosumAny opinions on Liberator? Seeking opinions
14:04bitemyappandyf: god yes.
14:04tbaldridgedissipate: yeah, we have people in almost every US timezone
14:04bitemyappandyf: tests that require a particular order to pass are a failure.
14:04dissipatetbaldridge: why does Relevance still have its own site?
14:05andyfbitemyapp: Doesn't mean that it is easy to determine that they depend upon the order. Just found some by accident today.
14:05seangroveandyf: That's always a bad idea
14:05tbaldridgedissipate: because changing an existing client's contract is super hard? :-P
14:05technomancyI wonder how hard it would be to implement order randomization as a test fixtures
14:05technomancytoo many As there
14:05bitemyapptechnomancy: that would be eggscellent.
14:05technomancyit would probably be pretty cringe-worthy of an implementation
14:05bitemyappit should be non-optional.
14:06andyftechnomancy: Not hard, I think, if you are willing to write your own slightly-modified version of test-all-vars in clojure.test
14:06bitemyappsymbol shufflin' err'day I'm shufflin'
14:06technomancyandyf: I think it would be technically possible without modifying clojure.test, but ... cringe-worthy =)
14:07dissipatetbaldridge: unfortunately, i am currently not versed in your technology stack. but it's good to know there are opportunities for Clojure developers to work remote!
14:07technomancyyou just need a function that does nothing the first (dec n) times it's called and then shuffles everything on the nth call
14:09dissipatetechnomancy: how robust is the shuffler? if the PRNG doesn't produce at least n! permutations, you are hosed.
14:10andyftechnomancy: However you do it, it would be good to have a way to repeat a previously failing order so that one could verify whether they have fixed their tests.
14:10technomancyandyf: definitely
14:12TimMcPrint the PRNG seed.
14:12dissipatehow robust is the built in 'shuffle' function in Clojure?
14:12dissipateif it is as bad as Python's 'shuffle', that's not good
14:12andyfI think it was updated to be a Fisher-Yates shuffle in a recent Clojure release, but check the source.
14:13bitemyappTimMc: for the love of god yes.
14:13ivan(source shuffle) says it calls java.util.Collections/shuffle
14:13mdrogalisdissipate: What's up with Python's shuffle?
14:13dissipateandyf: Fisher-Yates is fine, it's the PRNG used to generate the permutation.
14:14dissipateandyf: if the PRNG wraps around before n! not all permutations will be generated. not good if you are shuffling a deck of cards.
14:14dissipatemdrogalis: it does not produce all possible permutations of a list for any large 'n'
14:14technomancydissipate: that hardly qualifies as "hosed"
14:14bitemyappOpenJDK shuffle is basically fisher-yates. I have no idea re: Oracle
14:15andyfdissipate: So you are recommending a PRNG with enough bits of internal state to enable it to have a period like 2^1024 or something?
14:15technomancyyou don't have to test anything remotely close to every single permutation to find problems with order-dependent tests
14:15dissipateNote that for even rather small len(x), the total number of permutations of x is larger than the period of most random number generators; this implies that most permutations of a long sequence can never be generated.
14:15dissipatehttp://docs.python.org/2/library/random.html
14:15stuartsierrahttp://docs.oracle.com/javase/7/docs/api/java/util/Collections.html#shuffle(java.util.List)
14:15dissipateandyf: more than that, a period greater than n!
14:16ivanthat's not as bad as it sounds unless you can predict which shuffled sequences the PRNG will never generate
14:16bitemyappgf3: <3
14:16TimMcdissipate: You want to boil the ocean to find out if there's an order-dependency?
14:17technomancywhat the hell happened to java.jdbc
14:17bitemyappgf3: thanks for bringing that to my attention, it led to the discovery of gems like: "mattpodwysocki: LOL! Man tries Haskell, realizes he’s not smart enough and gives up to pursue simple things like distributed systems. http://t.co/pdG35zz3E4&quot;
14:17dissipateTimMc: well, for that use case it's fine. what if i want to use 'shuffle' for an online casino?
14:17bitemyapptechnomancy: it's an open source simulation of a flailing startup
14:17TimMcOK, different use-case.
14:17bitemyapptechnomancy: `fix pivot`
14:17bitemyapptechnomancy: problem is, pivoting is divergent and does not have a convergent fixed point :(
14:18dissipateivan: it's pretty bad. imagine i want to write the back-end for an online casino. it's not good if i have to worry about 'shuffle' leaving out a massive number of permutations of a deck of cards.
14:18ivanhttps://stackoverflow.com/questions/3062741/maximal-length-of-list-to-shuffle-with-python-random-shuffle
14:19ivanI guess you want a better RNG anyway if you have a casino
14:20bitemyappivan: you mean /dev/urandom?
14:22andyfTIcket and patch for the particular issue I found in Clojure's tests: http://dev.clojure.org/jira/browse/CLJ-1328 Doesn't address the randomization of order that technomancy suggests for finding other such cases that may exist.
14:23dissipateivan: you probably want it for a lot of situations, including scientific simulations. i just don't understand why a robust 'shuffle' is not built directly into these languages. i shouldn't even have to worry about it.
14:23stuartsierraandyf: thank you
14:24technomancydissipate: more randomness requires more entropy, which is in short supply in many virtualized environments. defaulting to a basic shuffle which doesn't consume much entropy makes a lot of sense.
14:24stuartsierraGood randomness is expensive.
14:26dissipatetechnomancy: you are right, that is the ultimate source of the problem, lack of available entropy at the hardware and OS level, especially in a VM. is anyone even working on fixing that?
14:26ivanIntel has an RNG instruction now
14:27dissipateivan: NSA approved? :D
14:27carkdissipate: nsa mandated
14:27ivanyes, how else would NSA analysts win all their online poker tables
14:35bitemyappMorgawr: some people don't understand that games are subject to prototyping too.
14:47edbonddnolen, is it overkill to apply core.logic to solve euler224? https://projecteuler.net/problem=224
14:47noonianis there something like keywordize-keys from clojure.walk in cljs?
14:49ToBeReplacednoonian: do you need the walk behavior?
14:50noonianno, just replace string keys with keywords
14:50holohi
14:51ToBeReplaced,(reduce-kv (fn [m k v] (assoc m (keyword k) v)) {} {"foo" "bar"})
14:51clojurebot{:foo "bar"}
14:51holois there a way to specify namespaces with wildcards to AOT compile? like :aot [app.*] (this does not work of course) . :all doesn't apply to my case
14:52noonian,(doc reduce-kv)
14:52clojurebot"([f init coll]); Reduces an associative collection. f should be a function of 3 arguments. Returns the result of applying f to init, the first key and the first value in coll, then applying f to that result and the 2nd key and value, etc. If coll contains no entries, returns init and f is not called. Note that reduce-kv is supported on vectors, where the keys will be the ordinals."
14:52`cbp(zipmap (map keyword (keys map)) (vals map))
14:52noonianthanks guys, so i guess there isn't anything built in
14:52technomancyholo: I think you can use regexes
14:53dnolenedbond: hmm, can't say but it would be fun to try.
14:53ToBeReplacededbond: looks like a great use case for core.logic
14:53holotechnomancy, hey how are you? ok, i'll try. thanks
14:53edbondha-ha, there are too much variants
14:53holo(inc technomancy)
14:53lazybot⇒ 92
14:53edbondI would probably start with fd
14:57ToBeReplaced`cbp: i don't like that solution because i believe the consistency of ordering of (keys m) and (vals m) is an implementation detail, not part of the contract (am i wrong?)
14:59Morgawrbitemyapp: some people can't understand the fun in prototyping and experimenting :P
14:59`cbpToBeReplaced: seq, keys and vals walk maps in the same order
15:00kschraderis Immutant the way to go when deploying a Clojure webapp?
15:01kschraderor do people do some sort of Jetty/Nginx dance?
15:02ToBeReplaced`cbp: they do, but is that a promise of the language? that's all i was getting at
15:03holokschrader, i did a jetty dance when deploying with uberjar. now i'm trying to uberwar
15:05`cbpToBeReplaced: It doesn't seem to be documented anywhere but I wouldn't worry too much about it
15:09nDuffToBeReplaced: Hmm. It'd be interesting to submit a doc patch upstream to make that explicitly contractual.
15:09nDuffToBeReplaced: ...as I understand it to be something that's presently followed without fail within the core library.
15:12jcrossley3kschrader: if you only need web bits, immutant is overkill. it starts to make sense when you have multiple apps and some of them require messaging, jobs, or caching.
15:17kschraderjcrossley3: does it make deployment fairly brainless though?
15:18kschraderI'm going to need jobs soon, so that probably makes my decision fairly easy
15:19jcrossley3kschrader: you're going to need some sort of init script and everything that goes along with that, either for immutant or your jetty-embedded app. so you need that much brain anyway. :)
15:23jcrossley3kschrader: hosting is another factor. it's simpler to get a jetty-embedded app on say, heroku, than immutant. really depends on what you need and who's gonna support it.
15:23kschraderjcrossley3: yeah, that's not hard, I'm wondering about what it takes to continuously deploy changes
15:24kschraderI'm going to start on Digital Ocean and eventually probably move to Amazon
15:24kschraderand use Ansible for ops
15:24jcrossley3kschrader: it's essentially just a matter of rsync/scp'ing an archive.
15:25kschraderjcrossley3: got it, that's what I was hoping for
15:25jcrossley3kschrader: feel free to pester us in #immutant if you run into anything weird or confusing. we'll try to help. :)
15:41AeroNotixgrr, trying to write a macro to generate functions. Can't seem to get this quote/unquote business right
15:43egosumAeroNotix: you can do it!
15:43bitemyappkristof: http://dl.dropboxusercontent.com/u/7810909/docs/applicative-errors-scala/applicative-errors-scala/html/index.html
15:43AeroNotixegosum: indeed, f it
15:47kristofbitemyapp: disjoin union = sum type
15:48kristofbitemyapp: I thought monads were sufficient to model errors
15:48kristofbitemyapp: Anyway, reading :P
15:49grzmanyone know of an issue requiring cljs.nodejs and "ReferenceError: Can't find variable: require" when using clojurescript.test ?
15:49bitemyappkristof: Responses indexed by your messages: 1. http://i.imgur.com/uakbfh6.gif 2. http://i.imgur.com/SxprH.gif 3. http://i.imgur.com/W6sM7Ku.gif
15:50grzmI don't even need to use node/require in the app: just (:require [cljs.node :as node]) in the namespace
15:53bitemyappkristof: Haskellers generally operate on the least-power principle. Monads are overkill for some forms of error handling.
15:53bitemyappkristof: the idea is to learn how to grow up *and* down in abstractions.
15:54bitemyappand get the "right-sized" approach to your problems.
15:55kristofbitemyapp: I'm a little confused by the type signature of an applicative functor.
15:56kristofOh! I understand it now
15:56bitemyappkristof: ^a ^k
15:57kristofIt just means "take a context of things, and a context of functions which operate on those things, and return the new context of things
15:57arrdembitemyapp: so it turns out that RethinkDB is entirely the wrong datastore for what I'm trying to achieve :/
15:57bitemyapparrdem: confess your sins. I am interested.
15:58arrdembitemyapp: I asked over in #rethinkdb, explained my datastore architecture and hardware limitations and the answer was "yeah we're an in-memory db, sorry".
15:58arrdembitemyapp: this is what I get for trying to host everything off my old High School laptop :P
15:59bitemyapparrdem: so is Datomic, lol.
15:59arrdembitemyapp: yeah. the answer is that I either do some contracting work and get a real server or I just use an SQL I suspect.
15:59bitemyapparrdem: PostgreSQL is the practical choice here.
16:00arrdemin either case cloutjure is off the table for another week or two because I need to get back to school work..
16:00arrdembitemyapp: yeah that's basically where I was leaning.
16:01arrdembitemyapp: the intended architecture is that the DB is really just a linear buffer of all timestamped messages and that I do analysis with sequential scans...
16:05bitemyapparrdem: I look forward to hearing how fast it is with PostgreSQL.
16:10kristofbitemyapp: cool presentation :)
16:11bitemyappkristof: Tony Morris is a good person to keep an eye on.
16:11bitemyappgrumpy, but very good.
16:13kristofbitemyapp: but error handling in Haskell seems to be done with monads, I.e. Control.Monad.Error
16:13marcopolo`is there a way to search lein templates?
16:14bitemyappkristof: uh, that's one way.
16:14technomancymarcopolo`: https://clojars.org/search?q=lein-template
16:14bitemyappkristof: there's actually a lot of ways, some being as simple as Either.
16:14technomancyhm; that's not right
16:14bitemyappApplicatives are basically just a way to "combine" Either values.
16:15bitemyappand have intelligent error handling.
16:15technomancymarcopolo`: https://clojars.org/search?q=artifact-id:lein-template
16:15marcopolo`technomancy: great, thanks! I didn't know about that feature
16:15bitemyappkristof: the applicatives themselves, because they lend themselves to a tree/dependency-graph representation of your inputs, mean you get a declarative and safe way to handle reducing down to final answers while comprehensively handling errors.
16:16bitemyappkristof: but the bonus is: you don't need monads if you'd like to model your errors that way.
16:16kristofbitemyapp: So you can just use regular error and data
16:16technomancyno problem
16:16kristofbitemyapp: and that way, if you want to use that data somewhere else, it doesn't have to know about monads
16:17bitemyappkristof: hum, even the use of monads doesn't preclude taking data out of the monadic context
16:17kristofwell, you have to bind it
16:17bitemyappkristof: it's just that you'd have a sum-type to express the non-deterministic possibilies, then case them out to extract the "everything worked" and "at least one thing failed" cases.
16:17kristofok, that makes sense
16:17bitemyappkristof: not necessarily. it depends on what the monad is implemented against.
16:18bitemyappkristof: Maybe is an example here.
16:18bitemyappit's just a sum type. So is Either.
16:18kristofok.
16:18bitemyappEither can be used to express left StringError right OkayValue
16:18bitemyappafter monadically sequencing operations, you can split the sum type and rip it out if you want.
16:18kristofwith a case
16:18bitemyappyeah.
16:19bitemyappfromJust makes some people kinda angry though :)
16:19bitemyappbecause if you use it without a pattern match / case, it'll create an exception.
16:19bitemyapperror, technically.
16:19bitemyappI should be more specific, sorry. not "exception", error.
16:19kristofOk, this makes sense
16:20kristofIs there a categorical dual to applicatives? Reversing the arrows in the type signature makes it look like... just another applicative.
16:21bitemyappkristof: (f a -> f b) -> f (a -> b)
16:21bitemyappf a -> a
16:22bitemyappkristof: if you imagine what catamorphic folding a tree looks like vs. an anamorphic unfold, this could have a similar mental picture.
16:22bitemyappkristof: but that's really just one way to construct a dual of an applicative, you could also make a contravariant.
16:23bitemyappkristof: the problem with broadly asking, "what's the dual of this?" is you have to know which aspect of the thing you're trying to find the "co" of.
16:23kristofbitemyapp: I was talking about <*> :: f a -> (f a -> f b) -> f b
16:23bitemyappkristof: do you want the dual of the covariance? of the monoid'ishness?
16:23kristofbitemyapp: I'm not sure. :)
16:23bitemyappsee?
16:23bitemyappit's a good question.
16:23kristofIt is.
16:23bitemyappit's just not yet well-formed because you don't know what you want.
16:24bitemyappif you were solving a more specific problem with Applicatives, and you wanted to do something, the answer would be easier to attain and more useful to boot.
16:24kristofAh, that's true. I guess I was looking for a general pattern, but this question is too general to begin with.
16:24mmitchellI'm working with a java lib, that when printed, clojure calls "key" on something it thinks is a map-entry. I get an exception: "java.lang.ClassCastException: org.apache.solr.common.SolrInputField cannot be cast to java.util.Map$Entry at clojure.core$key.invoke (core.clj:1482)" -- is there a way to add "key" support to the SolrInputField?
16:25mmitchellbtw... if I don't print the result, the code works just fine
16:25bitemyappkristof: it's important to remember that theorems in the category of Hask are universally more specific than those involving category theory in general. the implication is that you're going to need to also have a more specific noun or verb informing your inquiry.
16:25kristofbitemyapp: Oh, I was reading about free monads because of our discussion with bloom the other night and I'm slightly confused about how join is supposed to behave on a free monad.
16:25bitemyappkristof: that having been said, the intuitions and patterns from category theory are still interesting.
16:26dobry-denHow come (spit (str (io/resource "cache") "/42.html") "Hello") doesn't work from inside an uberjar?
16:27llasramUm. Because you'd be asking it to write to something inside of your JAR?
16:27bitemyappkristof: I'm going to answer this by providing what I think is a good introduction: https://www.fpcomplete.com/user/dolio/many-roads-to-free-monads but I can tell you how I've seen them used colloquially in Haskell.
16:27technomancydobry-den: how exactly would you expect that to work?
16:27bitemyappkristof: especially by Tekmo.
16:28kristofbitemyapp: That was the article that I was reading. It's a bit long so I've been having trouble getting through all of it but I'll grok it all eventually.
16:28bitemyappkristof: let me find one lower on the ladder of abstraction then.
16:29bitemyappkristof: no reason to suffer.
16:29bitemyappkristof: First read the description: http://hackage.haskell.org/package/free
16:29bitemyappkristof: the description matches how I've seen them used.
16:29dobry-dentechnomancy: when run from `lein ring server`, it creates resources/cache/42.html. from within an uberjar, i get a nondescript 500 error.
16:29bitemyappkristof: pause to reflect on what macros in Lisp are like.
16:29dobry-denllasram: oh, so it actually *shouldn't* work
16:29technomancydobry-den: how would you expect it to work in an uberjar?
16:29bitemyappkristof: what are you doing? you're manipulating a tree-like structure before it has taken on a specific meaning.
16:30llasramdobry-den: Yes :-)
16:30dobry-dentechnomancy: yeah, i see. an uberjar is a zip file. of course
16:30holodobry-den, spitting outside uberjar works though. it seems it's read-only fs
16:30bitemyappkristof: the final, transformed tree-value then gets handed off to some sort of interpreter/compiler.
16:30bitemyappkristof: this is an example (one among many) of how Haskellers do EDSLs and macro'ish things without template haskell.
16:31dobry-denIs it good enough to just (spit "/users/absolute/path/42.html" "Hello") from within an uberjar, then?
16:31kristofbitemyapp: So what's the underlying natural transformation that macros are equivalent to?
16:31holoanyone knows some dirty trick to refer assets that are outside the uberjar?
16:31kristofbitemyapp: If ASTs are our free monad.
16:32AeroNotixCan I expand a macro even if it would raise an exception?
16:32bitemyappkristof: applicatives are kinda like lists, and you can encode trees within nested lists.
16:32kristofAeroNotix: Wouldn't you just get the exception?
16:32holodobry-den, i can do it here
16:32bitemyappkristof: so S-exprs are kinda like applicatives in that respect, but the "feeling" of it is closer to free monads.
16:33kristofbitemyapp: Gotcha. Interesting to think about, though; what kind of magnificent meta programming can you do when you're able to describe code more descriptively than "lists"?
16:33bitemyappkristof: what's it equivalent to? runFree or runFreeT I'd imagine.
16:33technomancydobry-den: doesn't really have anything to do with an uberjar
16:34bitemyappkristof: well the thing that'll really smash the proverbial brain-egg against the idea-skillet is when you realize you can use *ANY* types, denotation, semantics, or values you want.
16:34bitemyappand it'll all be type-safe to boot, insanely enough.
16:35bitemyappunless your interpreter is evil.
16:35arkhin core.async, is there a way to count the number of items available to be taken from, say, (chan 10) ?
16:35kristofbitemyapp: http://tratt.net/laurie/research/pubs/papers/berger_tratt__program_logics_for_homogeneous_meta_programming.pdf
16:36kristofLaurence has a lot of papers on PyPy and JIT compiler generation, so I was surprised that he had delved into this topic
16:36kristofThe PyPy project is, in itself, a lot of metaprogramming though and he's complained about python being a poor metaprogramming language so I guess it isn't *too* surprising
16:37bitemyappkristof: I guess the only caveat to using free monads as a DSL is that they're a runtime mechanism so unless you do a codensity transformation for performance you might produce slower code than something more naturally flat in nature.
16:37kristofbitemyapp: that is true
16:38bitemyappkristof: nothing really stops you shoving it to compile-time though.
16:38bitemyappkristof: it's just that people like having the power at runtime.
16:38kristofbitemyapp: Anyway, it's a good idea for any language to have the entire language available for compile-time programming
16:38tbaldridgearkh: no, because that would introduce a race condition, that number could change the moment after you read it.
16:39bitemyappkristof: interesting paper, but other than the lifting of functions it seemed mostly like a typed Lisp macro derivative.
16:39arkhtbaldridge: ok - thank you
16:39bitemyappkristof: right, I agree, and that's why TH is a thing.
16:39bitemyappI just think for most purposes laziness and EDSLs go further.
16:39tbaldridgekristof: I agree, meta programming should be required in almost every language.
16:40tbaldridgekristof: and then there's this: http://h3.gd/ctrace/
16:40kristofbitemyapp: But Template Haskell is one of the ugliest things to read
16:40tbaldridge"ctrace is a compile-time raytracer written in the D Programming Language." - one of the best things I've read
16:40bitemyappkristof: it's a bit ghetto because of how rarely people rely on it.
16:40bitemyappkristof: considering how much sorcery people like Tekmo engage in, that should say something.
16:41AeroNotixsome help? https://gist.github.com/AeroNotix/f218770087e322a1c78c I want to generate functions which otherwise I'd have to write out manually
16:41bitemyappI don't think there's anything wrong with a compile-time access to the language semantics, but I'd prefer the type system be constrained to something total and decidable.
16:41kristofbitemyapp: Anyway, that paper was an operational semantics for meta-programming so I wouldn't just call it "just a typed lisp macro derivative" :P
16:42bitemyappkristof: I stay out of that field.
16:42bitemyappkristof: outside of my ken.
16:42bitemyappor sub-field if you like, either way, you get my meaning.
16:42kristoftbaldridge: "I'm just a pervert and I love raping the D compiler." Tactless choice of words but still funny
16:43tbaldridgekristof: is that on that page? ick...I didn't see that. I find such language offensive...
16:43llasramYeah.....
16:43bitemyappkristof: given that anybody that uses D is probably in Alexandrescu's school of thought, it seems within character.
16:43kristoftbaldridge: I don't find it offensive as much as I'm worried it'll trigger someone.
16:44bitemyappDitto.
16:44kristofBut maybe that's a form of being offended.
16:44bitemyappI don't see it as being offended because I'm not.
16:44bitemyappI'd just prefer people not unduly suffer.
16:44kristof^
16:44bitemyappbut if I let myself suffer because of what he said, then that would add to the suffering, so I'm not going to suffer because I was worried about another person's suffering.
16:45llasramSo close, yet so far
16:45AeroNotixany pointers?
16:45tbaldridgeNone the less, I apologize to the room for that. I'll try to be more careful in the future.
16:45llasram(inc tbaldridge)
16:45lazybot⇒ 4
16:45AeroNotix(inc lazybot )
16:45lazybot⇒ 1
16:46bitemyapplazybot's back? about fucking time.
16:46bitemyapp(inc Raynes)
16:46lazybot⇒ 41
16:46bitemyapp$karma bitemyapp
16:46lazybotbitemyapp has karma 15.
16:46bitemyappwell that has to change.
16:46liflashhi everybody, i'm working on my first project with clojure (a web app) and experimented a bit with server and client side coding. suddenly I get a compile exception the clojure.tools.reader/Reader-types cannot be found. It's a dependency from ring.middleware which itself is a dependency of noir, which I use. The package is definitely in my repository. Any ideas what's causing the error?
16:46kristofAeroNotix: I only glanced at it but are you sure using "bindings" that way without gensyms is alright?
16:46llasrambitemyapp: Trying to remember -- were you attempting to get the most negative karma?
16:47dobry-denWell imagine that. All of the performance issues of my app have been solved by running `lein ring server` in production mode (LEIN_NO_DEV=true)
16:47Raynesbitemyapp: I don't have any way of knowing when it goes down unless I try to use it or someone informs me.
16:47bitemyappRaynes: I wasn't going to perturb your bubble.
16:47bitemyappRaynes: can I get free karma for not bothering you?
16:48AeroNotixkristof: it puts the value of bindings in the form
16:48Raynes(dec bitemyapp)
16:48lazybot⇒ 14
16:48Raynesjk ily
16:48Raynes(inc bitemyapp)
16:48lazybot⇒ 15
16:48technomancydobry-den: LEIN_NO_DEV is only used by lein 1.x
16:48bitemyappRaynes: <3
16:48technomancyusing `lein ring server` in production is not a good idea
16:48bitemyappRaynes: I am debugging Python code. My spleen ruptured an hour ago.
16:49technomancyyou should either use an uberjar or if you can't do that for some reason, use `lein with-profile production trampoline ring server`
16:49bitemyappget the winchester, put me down. I'm done. stick a fork in it.
16:49AeroNotixbitemyapp: Where are you from?
16:50dobry-dentechnomancy: really? lein-ring github suggests LEIN_NO_DEV and it really did just dramatically change the performance of my app in a reproducible way.
16:50Raynestechnomancy: I did the same thing because I would like to protest.
16:50dobry-dentechnomancy: i agree about uberjar though. honestly it's because of my dumb `spit` issue.
16:51technomancydobry-den: it will make a difference if you're using lein 1.x
16:51kristofbitemyapp: Last question of the day before I stop bugging you: anything worth looking at in Eff?
16:51Raynestechnomancy: I don't think you still have very good reasons for condemning lein ring, but sure, LEIN_NO_DEV is a README leftover.
16:51Bronsaliflash: you have a typo somewhere. the correct namespace should be clojure.tools.reader.reader-types
16:51mmitchellWhat protocol defines "key" for MapEntries?
16:51technomancyunless lein-ring is doing something very grep-resistant like (System/getenv (str "LEIN_" "NO_DEV")) =)
16:51Raynes"i don't think you still"
16:51dobry-dentechnomancy: lein 2.3.4.
16:52Raynes"I still don't think"
16:52dobry-deni'll read the source and look
16:52bitemyappkristof: extensible effects you mean?
16:53technomancydobry-den: I think it would be more beneficial to understand what the actual problem you're having with spit is rather than changing everything up to work around it
16:53Raynestechnomancy: I hope it's doin' that.
16:53kristofbitemyapp: effects and handlers
16:53eggheadanyone used purnam for cljs midje?
16:54dobry-dentechnomancy: right, i understand them now (duh, can't spit into a zip (uberjar)). so in the meantime i was just running with lein-ring on the server until i figured it out.
16:54bitemyappkristof: oh you mean Bauer/Pretnar paper. I'm not familiar with that work, only extensible-effects in Haskell.
16:54bitemyappkristof: roughly it's an alternative to monad transformers, I don't know how they compare beyond the difference in implementation.
16:54bitemyappit's definitely a different way to model the problem.
16:55bitemyappkristof: they both stem from algebras of monads, AFAIK.
16:55technomancydobry-den: so it sounds like what you're actually doing is making your resources/ directory perform double duty as a scratch-pad as well as a resources/ dir
16:55arrdembitemyapp: tempting as it may be you won't get the winchester until you either break an ankle or start pushing untyped code in here.
16:56bitemyapparrdem: I could push some uni-typed Haskell if that works.
16:56liflashBronsa: it came out of my head. the message should be correct, since it is loaded within ring.middleware
16:57dobry-dentechnomancy: i was using resources/cache as a place to cache markdown->html rendering. it just seemed tidy. but of course on the server i'll have to spit into another location.
16:59liflashBronsa: My problem is, I don't think this error is really the problem since it worked before and checking out the same template works fine. I must have broken something somewhere else, but am not sure where to start. The stacktrace only complains about the missing resource when initializing the source files for compilation
16:59dobry-denafter skimming lein-ring 0.8.10 (latest) on leiningen 2.3.4, i can't figure out why LEIN_NO_DEV=true dramatically changed everything though. and there's no way it's a fluke.
16:59Bronsaliflash: without the actual error it's hard to tell
17:00kristofbitemyapp: One of the claims in the paper is that effects are more composable (or more easily composable) than monads. Also, as far as I know, monad transformers and their relationship to monads aren't actually very well understood yet.
17:00bitemyappkristof: I don't personally know how strong their argument for that is.
17:00bitemyappkristof: the composability argument, that is. If you find this interesting, look at extensible-effects on Hackage for something immediately usable.
17:01kristofbitemyapp: will do!
17:02kristofbitemyapp: The thing is, though, I'm not sure extensible effects are orthogonal to monad transformers. It seems like there's an underlying abstraction that applies to both, and one or the other needs to go away. ...But I wouldn't know. As you said earlier, "Why not both?"
17:02bitemyappkristof: well yeah, I wouldn't describe them as orthogonal either. I think they're parallel approaches to roughly the same problems.
17:02bitemyappkristof: one might have better usability or composability than the other, but transformers were the more "obvious" answer originally I think.
17:03bitemyappkristof: considering how far you can go with relatively simple combinators like Parsec, these seems like #PostSingularityProblems rather than #FirstWorldProblems
17:03bitemyappthese seem*
17:03bitemyappbut I'm sure I'll eat those words in ~5 years.
17:07liflashBronsa: I just tried to 'create' the error by starting the repl and suddenly it works again..... but something else doesn't work... sorry for bothering, will have to look into it
17:07liflashBronsa: thanks :)
17:12liflashBronsa: ok, got 'working' again (the compiled files of a working branch were still available).... which part of the stacktrace do you need?
17:12Bronsaliflash: how about all of it? :)
17:13liflashBronsa: hehe, ok, here it comes
17:13liflashBronsa: Exception in thread "main" java.lang.NoClassDefFoundError: clojure/tools/reader/reader_types/Reader
17:13liflash at clojure.tools.reader.edn__init.load(Unknown Source)
17:13liflash at clojure.tools.reader.edn__init.<clinit>(Unknown Source)
17:13liflash at java.lang.Class.forName0(Native Method)
17:13liflash at java.lang.Class.forName(Class.java:270)
17:13liflash at clojure.lang.RT.loadClassForName(RT.java:2098)
17:13liflash at clojure.lang.RT.load(RT.java:430)
17:13liflash at clojure.lang.RT.load(RT.java:411)
17:13liflash at clojure.core$load$fn__5018.invoke(core.clj:5530)
17:13liflash at clojure.core$load.doInvoke(core.clj:5529)
17:13arrdemliflash: MOTHER OF GOD USE A PASTEBIN
17:13liflash at clojure.lang.RestFn.invoke(RestFn.java:408)
17:13liflash at clojure.core$load_one.invoke(core.clj:5336)
17:13liflash at clojure.core$load_lib$fn__4967.invoke(core.clj:5375)
17:13liflash at clojure.core$load_lib.doInvoke(core.clj:5374)
17:13liflash at clojure.lang.RestFn.applyTo(RestFn.java:142)
17:13liflash at clojure.core$apply.invoke(core.clj:619)
17:13liflash at clojure.core$load_libs.doInvoke(core.clj:5413)
17:14liflash at clojure.lang.RestFn.applyTo(RestFn.java:137)
17:14kristofguy's first time in IRC
17:14liflash at clojure.core$apply.invoke(core.clj:619)
17:14kristofsomeone kick him :P
17:14liflash at clojure.core$require.doInvoke(core.clj:5496)
17:14liflash at clojure.lang.RestFn.invoke(RestFn.java:421)
17:14liflash at ring.middleware.cookies$loading__4910__auto__.invoke(cookies.clj:1)
17:14rasmusto~doInvoke
17:14clojurebotGabh mo leithscéal?
17:14arrdemhttp://static2.wikia.nocookie.net/__cb20130417063927/epicrapbattlesofhistory/images/f/f4/Picard-facepalm.jpg
17:14liflash at ring.middleware.cookies__init.load(Unknown Source)
17:14liflash at ring.middleware.cookies__init.<clinit>(Unknown Source)
17:14liflash at java.lang.Class.forName0(Native Method)
17:14liflash at java.lang.Class.forName(Class.java:270)
17:14liflash at clojure.lang.RT.loadClassForName(RT.java:2098)
17:14arrdemtechnomancy: danke
17:14liflash at clojure.lang.RT.load(RT.java:430)
17:14kmicuWHY!
17:14liflash at clojure.lang.RT.load(RT.java:411)
17:14liflash at clojure.core$load$fn__5018.invoke(core.clj:5530)
17:14liflash at clojure.core$load.doInvoke(core.clj:5529)
17:14liflash at clojure.lang.RestFn.invoke(RestFn.java:408)
17:14liflash at clojure.core$load_one.invoke(core.clj:5336)
17:14liflash at clojure.core$load_lib$fn__4967.invoke(core.clj:5375)
17:14liflash at clojure.core$load_lib.doInvoke(core.clj:5374)
17:15scgilardijust when we got to load-lib
17:15kristofmaybe he was testing a bot
17:15arrdemokay. so the votekick bot is totally gonna have a "is pasting stacktrace" module...
17:15justin_smith(inc arrdem)
17:15lazybot⇒ 13
17:15rasmustoor just a search for ^I
17:16Bronsaoh god.
17:16bitemyapp(inc arrdem)
17:16lazybot⇒ 14
17:16bitemyapparrdem: yeah, I endorse this.
17:16kristofbitemyapp: I suppose the latter, then, might disappear in the future if algebraic effects become more popular. But the point of monads were to model computation-on-the-side style effects anyway, so if that's the case, then what's the point of a monad? :)
17:17arrdem(inc technomancy) ;; active ops > active bots
17:17lazybot⇒ 93
17:17arrdemgood lord
17:17arrdemthis is why I don't feel bad about having lazybot karma be a parameter to the votekick score... it correlates so well with activity here!
17:17bitemyappkristof: eff is still part of monads AFAIK
17:18hyPiRionSomething has to be tone.
17:18hyPiRionWe need to get better stacktraces, otherwise the IRC community will be destroyed and shattered.
17:19kristofbitemyapp: monads are more general than algebraic effects
17:19arrdemhyPiRion: I agree that better stack traces would be awesome, but I fail to see the link to the death of #clojure
17:19Bronsamaybe having clojurebot yell "IN A PASTEBIN" everytime "stacktrace" is mentioned.
17:19hyPiRionarrdem: sarcasm :(
17:19kristofbitemyapp: I think eff's point is that reducing the generality yields a structure that is more amenable to composition
17:19liflashok, sorry again, but you really don't have to kick me immediatly
17:19arrdemhyPiRion: internet, intent and microexpressions :/
17:20Bronsaliflash: anyway, are you by any chance using cljsbuild?
17:20liflashit's really my first time on irc
17:20AeroNotixliflash: we really did, now you know
17:20liflashBronsa: yes
17:20rasmustoliflash: refheap for pasting :>
17:20technomancyliflash: your client was streaming the lines out at a trickle
17:20bitemyappkristof: yeah I could see that. Also see: http://eb.host.cs.st-andrews.ac.uk/drafts/effects.pdf
17:20technomancyso it was interrupting ongoing conversations
17:20bitemyappkristof: this is probably partly responsible for the surge of interest in Idris.
17:20technomancyotherwise I wouldn't have kicked
17:20AeroNotixliflash: also, get a better client. The good ones say "ARE YOU SURE YOU WANT TO BE AN IDIOT" before doing stuff like that
17:21liflashAeroNotix: I use ERC ;)
17:21arrdemliflash: weird... it should have warned you...
17:21technomancyliflash: hang on; there is a thing you can do
17:21AeroNotixliflash: like I said, get a better client.
17:21kristofbitemyapp: Huh? I thought Idris's claim to fame was dependent types
17:21AeroNotixWeechat, Irssi etc
17:21bitemyappAeroNotix: lol, you're about to get driven out of town.
17:21technomancy(setq erc-flood-protect nil)
17:21kristofbitemyapp: But yeah, this paper seems more relevant to this discussion than the Eff paper
17:21arrdemAeroNotix: dude. bashing ERC in here? good luck...
17:21bitemyappkristof: yeah but it's one of the algebraic effects petri dishes.
17:21arrdemliflash: see technomancy's last
17:22AeroNotixarrdem: Compared to weechat+znc? Puh-lease
17:22kristofbitemyapp: cool stuff :)
17:22arrdemAeroNotix: I run ERC+IRSSI. come at me brah
17:22bitemyappkristof: you're right that dependent types is the raison d'etre, but Agda already had that.
17:22technomancyliflash: will disable the trickle behaviour so at least it'll all come out in one fell swoop and freenode's own protections will kick in
17:22bitemyappkristof: Idris is more designed for programming than Agda or Coq.
17:22liflashtechnomancy: thx
17:23liflashtechnomancy: but shouldn't I set the flood-protect to t?
17:23technomancyalso I think there's a setting to warn you right when you press enter in 24.4, but that hasn't been released yet
17:23technomancyliflash: in this case flood-protect means "trickle the lines out slowly so that it won't trigger freenode's anti-flood mechanism" which is unambiguously bad
17:23justin_smithliflash: flood-protect makes the output come out slow, so you don't get auto-booted for spammy output
17:23AeroNotixtechnomancy: surely it's got a lot of hooks that you could write this yourself?
17:24AeroNotixtechnomancy: (add-to-list 'erc-pre-send-hooks .... )
17:24ivanI like flood protection because I don't flood by accident
17:24AeroNotixor w/e
17:24justin_smithliflash: so it is more like "flood-enable" since it bypasses the automatic protection
17:24xuserso thinking of jumping to emacs with evil, what packages do I need for a basic clojure enviroment besides cider?
17:24technomancyAeroNotix: yes, it's included now in 24.4
17:24AeroNotixcool
17:24technomancybut not many are running 24.4 yet
17:24kristofbitemyapp: Well, Idris is Turing Complete. :)
17:24arrdemyay now UTCS will be 16 emacs releases behind....
17:24technomancythe new setting is erc-accidental-paste-threshold-seconds
17:24AeroNotixhuh, 24.3 here, Archlinux too. Damn thing.
17:24technomancyif you're on an emacs build new enough to have that, even better
17:24kristofbitemyapp: I'm going to put down this Eff paper, all the examples are unwieldy and no matter how cool the underlying theory is, no one would ever want to program this way.
17:25hyPiRionis 24.4 out already? I thought snapshot was 24.3.50.1, at least a week ago when I built it
17:25Bronsaliflash: https://github.com/cemerick/austin/issues/23
17:25technomancyhyPiRion: I think it's in feature freeze
17:25arrdemtechnomancy: that sounds right... there was a post yesterday about the comming new features.
17:26hyPiRiontechnomancy: ah
17:26hyPiRionhrm.
17:26liflashBronsa: thanks, looking into it....
17:28kristofbitemyapp: You should send some of Tekmo's more interesting experiments my way
17:28kristofIf it's not too much trouble.
17:29bitemyappkristof: (touching on effects): http://hal.archives-ouvertes.fr/docs/00/44/58/73/PDF/dualV1.pdf
17:29bitemyapp(and duals)
17:30socksyI feel like I do in #idris, and I haven't got a clue what's going on in anything anyone's talking about
17:30liflashBronsa: do you know that issue from your own experience? austin is already in my dev profile...
17:31bitemyappkristof: tekmo: http://www.haskellforall.com/2012/06/you-could-have-invented-free-monads.html
17:31bitemyappkristof: but also: http://ttic.uchicago.edu/~dreyer/course/papers/wadler.pdf
17:31bitemyappkristof: intuition for free monads is closely tied to understanding free theorems.
17:31bitemyapptekmo mentions this in his article about fusion and pipes.
17:32Bronsaliflash: no, I only heard about that since I'm the tools.reader author.
17:33liflashBronsa: ;) ok
17:34bitemyappkristof: one of my dream projects is making a "mapper" for community contributed of dependency trees for white papers
17:35bitemyappkristof: so that if you were looking at a blog post or paper for "free monads" you'd see upvotes for "theorems for free"
17:51dsrxMonads for nothin' and type checks for free
17:51liflashBronsa: I had to move the aot to the production profile too, if anyone is asking again ;)
17:51liflashBronsa: thanks a lot!
17:51dsrxs/ and/;/
17:58bitemyapp(inc dsrx)
17:58lazybot⇒ 1
17:58bitemyappsocksy: I kinda brought #haskell and #idris here.
17:58benkayI'd like to use with-redefs in a midje with-state-changes (before :facts) block instead of wrapping my facts in it, but I think that I'm going about this incorrectly. Thoughts?
18:00socksybitemyapp: you might enjoy #idris. It's active, but not as busy as #haskell
18:00benkay(my goal is to replace my datomic db uri with the in-memory test db for integration tests)
18:00bitemyappsocksy: just joined because you reminded me it existed.
18:00socksy:D
18:01bitemyappbenkay: you're making at least two, possibly three mistakes.
18:01bitemyappbenkay: 1. using midje 2. wanting to use with-redefs
18:01benkaysave me from myself oh sage
18:01benkaywhat's wrong with midje?
18:01bitemyappbenkay: proper configuration.
18:01arrdembenkay: loooooolz
18:02arrdemclojurebot: forget bitemyapp |is| it ammuses me to mock other people gods
18:02bitemyappbenkay: https://github.com/bitemyapp/berossus/blob/master/src/berossus/rocks/your/data/config.clj
18:02bitemyapparrdem: you misspelled it and don't do that.
18:02arrdemdamnit.
18:02rasmustoarrdem: dammnit*
18:02bitemyappbenkay: ignore the larger scope of "services" for now, focus on how environ and the config namespace are being used.
18:02arrdembitemyapp: hey. "save me from myself oh sage" is pretty good too.
18:02bitemyappbenkay: https://github.com/bitemyapp/berossus/blob/master/test/berossus/api_test.clj
18:03bitemyapparrdem: a noun can have multiple facts.
18:03bitemyapphalf the reason I wanted to open source berossus was so I could use it as example code.
18:03dnolenOm tutorial in progress here - http://github.com/swannodette/om/wiki/Tutorial, will be adding more to it over the coming weeks but probably enough already to have quite a bit of fun and explore.
18:04dsrxegghead: i thought about it a little and it might be cool to re-implement a karma-like (the test runner) thing in clojure using austin
18:04tbaldridgeBronsa: do you know if anyone is working on SSA passes for tools.analyzer? If not I'm going to be starting on that this week. No reason to keep this stuff specific to core.async
18:04locksdnolen: nice :D
18:04dsrxdnolen: nice!
18:04benkaythanks bitemyapp.
18:04eggheaddsrx: that would be cool
18:04locksdnolen: how familiar with Reactjs does one need to be?
18:05dsrxegghead: better lein integration, you could drop into a repl when tests fail, no node.js dependency
18:05rasmustodnolen: cool beans
18:05bitemyapplocks: I can't see it hurting.
18:05eggheaddsrx: just ran my first travis CI build with karma + firefox testing my cljs :)
18:05dsrxneato
18:05dsrxsame project you were working on before?
18:05dnolenlocks: by the time the tutorial is done hopefully not at all
18:05eggheadya dsrx
18:05eggheadit is now fully CI-ified
18:06eggheadexcept my project.clj is almost 100 lines long :)
18:06dnolenlocks: though it's still worth understanding React as it's the underpinning.
18:06hyPiRionegghead: at least it's not a POM =)
18:07locksdnolen: sure, kinda like understanding the JVM for clojure
18:16liflashbitemyapp: you said it's a mistake using midje. what's wrong with it?
18:16Bronsatbaldridge: not that I know of.
18:17bitemyappliflash: I'm done nailing the 95 theses to the doors on that one.
18:17tbaldridgeBronsa: kk, just wanted to make sure I'm not duplicating work.
18:20AeroNotixcan I not alias java class names?
18:21bitemyappliflash: it'd be easier to just search IRC logs and/or the mailing list.
18:21liflashbitemyapp: ok... just setting up my first tool chain for clojure and don't want to waste time with the wrong ones
18:22bitemyappliflash: just use clojure.test
18:22justin_smithAeroNotix: you can kind of do it with a reader macro (see #inst)
18:22liflashbitemyapp: will do :)
18:22justin_smith,(java.util.Date.)
18:22clojurebot#inst "2014-01-20T23:20:03.856-00:00"
18:23nopromptdnolen: i ended up just going with a regular callback w/ that example i shared yesterday.
18:23AeroNotixjustin_smith: hmm
18:23nopromptdnolen: the only other alternative i could come up with was to pull the channel out in to a def but i don't really like that. having a regular callback isn't that big of a deal though.
18:24dnolenno that om.core/root is idempotent live coding with Om ROCKS
18:24justin_smithAeroNotix: sadly last I checked clojurebot does not let you create them, or I would demonstrate that
18:24dnolens/no/now
18:25dnolennoprompt: 0.2.3 has some new functionality, you can have shared data across the entire render tree
18:25AeroNotixjustin_smith: no worries, just wouldn't mind aliasing this to a shorter name: https://gist.github.com/AeroNotix/397846a0955b48b86e04
18:25AeroNotixTransactionType
18:25dnolennoprompt: so you can establish channels that everyone shares (not sure if this is relevant for what you were doing)
18:25dnolennoprompt: and since om.core/root is idempotent not a problem for redef
18:25nopromptdnolen: sweet! we'll definitely update this week.
18:26justin_smithAeroNotix: you could likely pull something off with a tricky macro...
18:26AeroNotixjustin_smith: meh, not worth it
18:26justin_smiththough maybe not because I think classes are pulled in at the reader-macro level, not regular macros
18:26nopromptdnolen: this little app we're working on, om's been *very* impressive. it's really easy to move parts around, etc.
18:26justin_smithwhich means eval, which means kind of ick
18:27nopromptdnolen: lots of moving parts. routing, views, etc.
18:28dnolennoprompt: exciting :)
18:28nopromptdnolen: we've been using the REPL a lot w/ it too. it's been great.
18:28dnolennoprompt: excellent, the latest changes should make it a lot nicer too
18:28nopromptdnolen: i did run across something though around tests that might be worth sharing on the mailing list.
18:29dnolennoprompt: please do
18:29dnolennoprompt: at some point I'll establish an Om specific list, but we're not quite there yet
18:29teslanicknoprompt: You should write up your experience. I want to push for a clojure/om app where I work, and having people relate their experience helps make that case.
18:29locks^
18:30bitemyappI just realized what I'm going to have to do to this lexer
18:30bitemyappand it is positively hateful.
18:30nopromptdnolen: it's pretty easy to figure out but it might trip up someone new. when running tests one might encounter 'TypeError: 'undefined' is not a function (evaluating 'RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/)')'
18:30bitemyappactually wait a second, the wizard of regex is here.
18:30bitemyappnoprompt: regex lexer for arbitrary depth quoted strings that drops a single layer of quoting.
18:31bitemyappI'm currently contemplating a post-match fold and would very much like to avoid it.
18:31nopromptdnolen: it's fairly easy, you just patch Function.prototype.bind in your extra_test_commands.js, but, like i said, it could trip someone up for a good half hour.
18:32nopromptbitemyapp: that sounds like a bed of roses. :)
18:32bitemyappnoprompt: I'm asking if the regex is possible.
18:32bitemyappI guess not.
18:32bitemyappnoprompt: don't sweat it.
18:32bitemyappnoprompt: edn is a cruel bitch.
18:33nopromptdnolen: i'm not sure what the company's status is on a tech blog but i definitely would like to write about the experience.
18:33bitemyappdoubly so with bad parsers.
18:33arrdembitemyapp: yeah that's gonna be a parser problem because it's fundimentally based on counting escapes..
18:33nopromptbitemyapp: hmm... yeah you probably don't want a regex for that.
18:34arrdemcounting -> CFG -/>regex
18:34bitemyappnoprompt: right.
18:34bitemyappnoprompt: I'm trying to decide whether I want the quote-level folding in the lex or parser stage.
18:35bitemyappprobably parser.
18:35bitemyappnoprompt: if it helps at all, I'm programming with boxing gloves on my hands. lex/yacc parser generator for *Python code* of all things.
18:35bitemyappNot my technological choices.
18:36nopromptdnolen: i'm going to extract some short tutorials from the app we've been working on. ie. table sorting, filtering (with highlighting), pagination, etc.
18:36nopromptbitemyapp: LOL!
18:36bitemyappnoprompt: I'm about to have kittens man.
18:40bitemyappthe whole thing is based on mutation of the AST.
18:41AeroNotixouch
18:41dnolennoprompt: cool, not sure I follow on the Regex thing?
18:41dnolennoprompt: what's the context?
18:42bitemyappnoprompt: whatever happens, don't let dnolen unignore me. This has been delightful.
18:42bitemyappI've had wonderful conversations lately due to the non-interference.
18:43nopromptdnolen: so when i run tests w/ cemerick.cljs.test and phantomjs, phantom will complain loudly about that bit of code. i'm guessing it's in react.js somewhere.
18:43dnolennoprompt: oh huh, wacky
18:43bitemyappoh, thought it was a reference to our regex convo.
18:43bitemyappjust as well.
18:43nopromptdnolen: tl;dr i guess phantomjs 1.9.3 doesn't have Function.prototype.bind
18:43nopromptso you gotta use a polyfill.
18:45bitemyappnoprompt: https://github.com/ariya/phantomjs/issues/10522
18:45bitemyappMilestone: Release 2.0
18:45irefhi guys
18:45bitemyappiref: hi girl
18:46arrdemiref: hello fellow AI
18:46nopromptbitemyapp: yeah. kind of a bummer. but easy enough to patch.
18:47bitemyappnoprompt: I gave up on phantomjs after the relentless onslaught of segfaults.
18:48bitemyappI used it 1.6->1.9 I believe.
18:48bitemyappmy sanity is more valuable than the milkshakes it's offering.
18:48bitemyappI have to reserve some sanity for dealing WITH THESE INFERNAL FUCKING PARSERS anyway.
18:49nopromptbitemyapp: you sir are *the* unhappiest programmer i know. lol. which is a good sign in my book.
18:50bitemyapp"good sign"
18:50nopromptbitemyapp: unhappy programmers generally have a reason. i approach happy programmers with caution.
18:50bitemyappnoprompt: your evaluation of good/bad appears to be scope blind to the survival rates of the authors of the libraries I use.
18:50noprompthaha.
18:51nopromptbitemyapp: a happy clojure/haskell programmer is generally a good sign; a happy javascript programmer, well, that's questionable.
18:52dobry-denIs the main drawback of using datomic-free that the transactor runs on the same server as the webserver peer?
18:52bitemyapp(inc noprompt)
18:52lazybot⇒ 4
18:52bitemyappdobry-den: I can think of others, including a fairly huge one with the label "H2" on it.
18:53irefcould you take a look at this gist https://gist.github.com/iref/8531602. I am trying to render content for every article with mustache and save it to file. Problem is that render-resource returns only first character instead of string so BufferedWriter crashes. And i have no idea why.
18:53bitemyappyou know who you should be suspicious of? People happy with H2. Those people are fucking perverts.
18:53dobry-denbitemyapp: what kind of issues can i expect as i'm running a quickly growing forum on top of h2?
18:53nopromptbitemyapp: i think last week we ditched H2. guess there were some issues w/ it.
18:53`cbpi use h2 in production
18:53`cbpmwahahahahah
18:53noprompti've never used it though.
18:53bitemyapp`cbp: you goddamn madman
18:53bitemyappnoprompt: "some issues"
18:54bitemyappunderstatement of the century.
18:54bitemyappit's 2014 and you've already won.
18:55`cbpalthough the h2 part could honestly be replaced with an edn file or something
18:55justin_smithiref: each of the bindings in doseq is iterated over
18:55ivando you have links to critical h2 bugs?
18:56justin_smithyou probably want to bind rendered-article in a let, inside the doseq
18:56teslanickWe use h2 to write fast integration tests against a similar-family SQL db. It seems pretty good at that.
18:56bitemyapp`cbp: that probably would've been better if you serialized writes.
18:56justin_smithiref: iterating over a string (which is what render-resource returns) gives you a sequence of chars
18:56AeroNotixlein cloverage just hangs when I run it
18:56AeroNotixit's screwing with my makefiles
18:56bitemyappivan: h2 is the King of heisenbugs.
18:56dobry-deni've started trying to set up datomic-starter + postgres on another server, but i'm reluctant about yet more moving parts. h2
18:57irefjustin_smith: thanks. I didn't know that about doseq
18:57bitemyappdobry-den: I use datomic-free in testing, happily.
18:57AeroNotixI kind of don't like cloverage (no output options) so any recommendations welcome
18:57bitemyappdobry-den: It'll probably work for you, just don't use it in production.
18:57dobry-denbitemyapp: oh, it's a forum in production
18:57nopromptfor the record, programming w/ a retina display is just great.
18:58nopromptthe full glory of anti-aliased monospaced type is like icecream for the coder eyes.
18:58dobry-deni guess i'll underestand your aversion towards h2 as the forum expands.
18:58bitemyappnoprompt: that's pretty similar to how I felt about it.
18:58bitemyappdobry-den: maybe? maybe it works for you anyway.
18:59dobry-denbitemyapp: can you mention a few issues you had with it?
19:01bitemyappdobry-den: I'm pretty sure hating H2 is a club larger than the freemasons at this point.
19:01dobry-denand how haskell wouldve solved those issues?
19:01bitemyappdobry-den: I'm not going to be the human bazooka for every issue in this IRC channel.
19:02technomancyiirc clojurebot uses h2
19:02bitemyappstrictly speaking, I don't even hate H2 or the functionality it purports to provide, it's just slippery, often annoying to work with, and has transient errors.
19:02hiredmannope
19:02dobry-denah
19:02hiredmanpostgres
19:02bitemyapplol.
19:03Redhasafnhiredman, do you hate me too?
19:03hiredmanit used derby at one point
19:03technomancysee I like derby because it makes me think of hats
19:03technomancyh2 makes me think of hydrogen and the Hindenberg
19:03hiredmanRedhasafn: if you have to ask
19:03arrdemRedhasafn: hello again chord
19:04dsrxderby makes me think of hitting a home run
19:04hiredmanh2 is apparently really fast, in single threaded mode that throws exceptions when multiple threads try to use it
19:04RedhasafnEveryone hates me
19:04Redhasafnincluding AimHere
19:05hiredmanI'm a derby man
19:06dobry-denso far though, datomic is a wizard abstraction over lucene + db implementation for me. hopefully it also lets me fake it til i make it when i get it set up with postgres
19:07bitemyapp"wizard abstraction"
19:08dobry-deni have a certain hubris about my stack these days. i feel like my users respect me that much more when i put 'Powered by Clojure and Datomic' in the footer
19:08dobry-denand when they read my stacktraces
19:09bitemyappdobry-den: definitely cooler than `Warning: mysql_connect(): Too many connections in /var/www/database/mysql/common.php on line 10`
19:09bitemyappdobry-den: can't wait to construct a Datomic query (indirectly) that OOMs your box running the peer.
19:12jstewwhy can I do (map-indexed (fn [i e] [i e]) [1 2 3]), but not (map-indexed #([%1 %2]) [1 2 3])?
19:13jstewAccording to the docs, #() is syntactic sugar for (fn []..)?
19:13Bronsajstew: #([%]) is (fn [a] ([a])) not (fn [a] [a])
19:13dobry-denIf Datomic never supports ordered results, is there any other way to optimize (->> (:post/_topic topic) (sort-by :post/created <))?
19:13dsrxjstew: what Bronsa said
19:13dsrxtoo slow :(
19:14dsrxjstew: you could do #(vec %1 %2) probably?
19:14clojurebotCool story bro.
19:14dsrxwhat the
19:15jstewAh, makes sense.
19:15arrdemdsrx: clojurebot will respond to -? messages with some probability... it's an inference engine rule.
19:15dsrxarrdem: ah, i see
19:16dsrx> (map-indexed #(vector %1 %2) [1 2 3])
19:16dsrx, (map-indexed #(vector %1 %2) [1 2 3])
19:16clojurebot([0 1] [1 2] [2 3])
19:17TEttinger,(map-indexed vector [1 2 3])
19:17clojurebot([0 1] [1 2] [2 3])
19:17dsrxyeah, there we go
19:18jstewIf I understand correctly, the extra () makes the reader try to evaluate the []?
19:18dobry-den,(map vector (iterate inc 0) [1 2 3])
19:18clojurebot([0 1] [1 2] [2 3])
19:18TEttingerthat too
19:19jstewI'm still stumbling my way through clojure, trying to practice with code jam.
19:19akurilinAnybody here tried yesql?
19:20akurilinTrying to figure out how to pass :row-fn and :identifiers into one of the vars generated by (defquery)
19:20bitemyappakurilin: honeysql didn't pan out?
19:20bitemyappalso I liked the slams on Korma in yesql's documentation.
19:20akurilinbitemyapp: never tried it, is it analogous?
19:20TEttingerjstew, I struggled a bit with #() at first too. it's often easy enough just to do (fn [[k v]] (+ k v)) or something, which doesn't work with #() syntax
19:20bitemyappakurilin: it might come more naturally. Give it a whirl.
19:21bitemyappI think at this point I am the Ron Swanson of Korma.
19:21technomancyyesql sounds like it needs some editor support to jump directly to the relevant SQL files
19:21teslanickWhat does being the Ron Swanson of Korma mean?
19:21technomancyapart from that navigation sounding really tedious to do by hand I like the sound of it
19:21dobry-denthere are a lot of cases where i prefer (fn [...] ...) over #(...)
19:21bitemyapptechnomancy: you know, if only there was a tool for integrating a DSL directly into a language
19:22bitemyapptechnomancy: maybe by structuring it as a tree or list of lists and allowing data-driven transformations...
19:22dobry-denwhen #(...) has nested forms, it quickly becomes painful to read
19:22bitemyapptechnomancy: NAHHHH. I'm fuckin' crazy.
19:22dobry-denlike when you finally get to %1 and %2 and you don't remember what they are.
19:23technomancybitemyapp: well granted I'm totally out of touch with databases these days, but I like just writing SQL
19:23bitemyapptechnomancy: so do I
19:23bitemyapptechnomancy: that's why I use Korma rather than an "ORM"
19:24technomancycool
19:25jstewI'm figuring out that clojure makes me write better code by forcing me to keep my functions small
19:27jstew[1 2]
19:28bitemyapptechnomancy: I think part of it may have to do with where your needs are on complexity vs. composition.
19:28akurilinAm I the only who doesn't like SQL DSLs for large queries? I struggle enough reading raw sql, seems like that's adding an extra transformation to it.
19:29bitemyappakurilin: well that's just it, isn't it?
19:29bitemyappakurilin: do you need more leverage with programmatically composing components of queries or with parameterizing one fat query?
19:30bitemyappakurilin: I believe Korma accommodates both but apparently raw-sql makes people upset. or something. I don't know.
19:30bitemyappyou can't compose yesql function-y thingiejobbers
19:30bitemyappexcept for uh...partial application. That's about it. it's a string blob interpolator.
19:30bitemyappif that suits your needs, awesome!
19:30bitemyappbut know your needs.
19:33akurilinI might not be exploiting the composability aspect of it too much tbh, I might need to pay more attention to that.
19:33bitemyappakurilin: don't try to discover schlep, just know where your schlep is.
19:34bitemyappThat was a common mistake in CL. Discovering and then yak-shaving schlep for the hell of it.
19:37alewddl and sql just seem like terrible ideas in retrospect
19:38bitemyappNothing really works compatibly across multiple implementations without the introduction of Pharaonic magnitudes of labor.
19:40alewbitemyapp: I appreciate your vocabulary
19:40bitemyappalew: I appreciate your appreciation.
19:40TEttingera synonym for "slavetacular"?
19:40bitemyapp(inc TEttinger)
19:40lazybot⇒ 12
19:40arrdem(inc TEttinger)
19:40lazybot⇒ 13
19:40bitemyappTEttinger: ERP-esque?
19:41bitemyappTEttinger: I prefer Pharaonic because it hits less-close-to-home for most people.
19:41TEttingerheh fair enough
19:41bitemyappbut slavetacular is jocular and fun :)
19:41TEttingerstonehengian is also fitting I think
19:41TEttinger"how did they move those rocks dude"
19:41bitemyappTEttinger: but we don't actually know how it was built or what labor was involved.
19:42TEttingerso it fits your last statement!
19:42bitemyappTEttinger: I would hesitate to ascribe large centralization of labor to a society for whom we have little evidence of such organization.
19:42bitemyappTEttinger: also, I use Pharaonic because they didn't actually use slaves that much to build the pyramids.
19:43TEttinger"Nothing really works compatibly across multiple implementations without the introduction of mysterious but probably very large magnitudes of labor"
19:43bitemyappit was centered around a state-sponsored core of craftsmen IIRC
19:43bitemyappTEttinger: I meant large, centralized, organized.
19:43turbofailalso, "aliens"
19:43TEttingeroh
19:43TEttingeralso aliens
19:43arrdemTEttinger: ANSI standards can help, but probably fall under the aliens category..
19:44TEttinger(inc arrdem)
19:44lazybot⇒ 15
19:44technomancyso... I have an issue saying that URL-based DB specs no longer work in clojure.java.jdbc 0.3.x
19:44turbofailthe ancient alien guy's hair is pharaonic on its own
19:45technomancybut I am unable to reproduce... has anyone heard of people having trouble with this?
19:47TEttingertechnomancy, link to the issue?
19:47technomancyTEttinger: internal support tracker; sorry
19:47TEttingerah
19:47technomancy"Particularly, you can no longer simply use `DATABASE_URL`, and parsing it out into a db-spec map (like at the top of https://github.com/clojure/java.jdbc#example-usage) is non-trivial."
19:48bitemyappakurilin: alternative to honeysql: https://github.com/r0man/sqlingvo
19:48technomancyanyway, this actually works for me https://github.com/technomancy/shouter/blob/master/src/shouter/models/shout.clj
19:49technomancyso I'm wondering if there are any specific scenarios I'm not thinking of where it might still be broken
19:49akurilinbitemyapp: awesome. So many options!
19:53TEttingertechnomancy: https://github.com/clojure/java.jdbc/blob/master/src/main/clojure/clojure/java/jdbc.clj#L140 is non-trivial? Am I correct about what this does?
19:54bitemyappchare: I can't unmute you.
19:54bitemyappchare: do you really think these people would give me ops? Don't be a clown.
19:54turbofaillol
19:54bitemyappchare: the fact that you're screaming at me in privchat demonstrates why you'll never be unmuted.
19:54bitemyappchare: all-caps and everything.
19:54technomancyTEttinger: according to this guy, those functions don't work like they should, but yeah that's the part in question
19:54bitemyappchare: get a handle on yourself Neo.
19:56bitemyappchare: that you're calling me a "FUCKING BACKSTABBER" also demonstrates why we're not "friends"
19:56bitemyappchare: are you going to calm down?
19:57quizdra couple days ago chare pm'd me to say "i've learned my lesson and can be unmuted now." oh how lessons are so easily forgotten.
19:57bbloombitemyapp: if you insist on communicating with him, please do it in private chat
19:57arrdembitemyapp: bbloom has a point, it's not like anyone else here is talking to him or cares.
19:57bitemyappbbloom: he's ignored now.
19:58bitemyappbbloom: btw <3
19:58bbloombitemyapp: you're lucky my irc client forgets my ignore settings
19:59turbofailon the issue of SQL dsls, i've found the ability to manipulate queries as data to be pretty darn useful
19:59turbofailalso, being able to use paredit to edit your queries is great for interactive use
19:59bitemyappbbloom: why is that?
19:59technomancy(add-hook 'sql-mode-hook 'paredit-mode) ; =)
20:00technomancy^ I have not done this
20:00bbloombitemyapp: b/c i've /ignore-d you 3 or 4 times now
20:00turbofailtechnomancy: yeah, but that doesn't help you skip around different clauses of your query
20:00bitemyappbbloom: I don't feel lucky, but <3 anyway.
20:00turbofailof which there can be a lot
20:00technomancyturbofail: yeah, it's a pale approximation of paredit's true power
20:00amalloyhaha, same here, bbloom. what terrible irc client do you use?
20:00technomancymore like "yay strings don't break"
20:00arrdemso show of hands, who here actually uses paredit?
20:00bbloomamalloy: Textual
20:01bbloomi think it remembers ignores if i put them in the settings, but if i just issue the command it doesn't save them
20:01quizdrparedit is quite nice for the basic stuff, i have yet to make use of the more complex commands aardem
20:01technomancyarrdem: everyone?
20:01technomancyhopefully
20:01arrdemI don't....
20:01TEttingeramalloy, ouch you use Purple as IRC? I'm so sorry
20:01justin_smithanother paredit user here
20:01amalloypidgin
20:02bbloomamalloy: i kinda like it tho, it's like a temporary ban, so i use it more often than i would otherwise
20:02TEttingeryep, the intenal chat stuff is called purple, and that's your ctcp version
20:02amalloyi know
20:02llasramarrdem: Well get with the program!
20:02arrdemllasram: once I figure out why llvm is ignoring my modules we'll see
20:02technomancyclojurebot: paredit?
20:02clojurebotparedit is not for everyone, but what you need to understand ís how to become the kind of person that paredit ís for.
20:02amalloyi generally have to /ignore the same people at the start of every day, so that #clojure isn't full of discussions about dota2 and trollbaiting
20:03bitemyappI've liked Erlang's structural editing better.
20:03justin_smiththe key to paredit is that kill-region and quoted insert still work, once you have that down, it is only a convenience
20:03justin_smithunless you use some broken-ass paredit in a non-emacs editor
20:04arrdemtechnomancy: lemme guess... you wrote that.
20:04quizdris it a glaring weakness that i only use slurp and barf with paredit and nothing else?
20:04technomancyarrdem: bots... they are labour-saving devices
20:04gtrakquizdr: try M-s
20:04RickInAtlanta quizdr: probably, that is what I do too
20:04turbofailkind of. paredit raise and splice are both pretty useful
20:04arrdemtechnomancy: and I take exactly zero issue with this!
20:04turbofailand transpose
20:04technomancyquizdr: even without any specific paredit commands it's valuable on its own
20:04TEttinger,(map int "understand ís")
20:04clojurebot(117 110 100 101 114 ...)
20:05TEttingergah
20:05technomancyjust the fact that it keeps edits from messing the buffer up
20:05turbofaili use paredit-raise all the time
20:05TEttingerwell what I'm confused is why the i is an í
20:05technomancyTEttinger: whoa
20:06arrdemTEttinger: did you insert-char by accident or something?
20:06amalloyquizdr: M-( is one i use all the time
20:06justin_smithTEttinger: int value of 237
20:06technomancyTEttinger: I guess the answer is that clojurebot is a simulation of an unstable personality and does all kinds of crazy things just to mess with you
20:06amalloyand like...M-r, plus i mapped in convolute-sexp for occasional use
20:06TEttingerarrdem, no, I was intentionally trying to figure out why the i has an acute
20:06arrdemI should invert my number row so that 9 and 0 are ( and ) by default...
20:06arrdem~inventory
20:07amalloyarrdem: i've had it that way for two or three years. big win imo
20:07arrdemamalloy: kk. I'm just realizing how rarely I do numeric input compared to inserting special symbols. programming ftw.
20:07arrdemit'd also help me write more swearjure..
20:07TEttingerhahaha
20:07quizdrI've seen the M-( shorcut on cheat sheets but it does nothing on mine unless I 'm not using it correctly
20:08turbofaildo it next to an existing expression
20:08quizdrgtrak M-s is nice, thanks for the tip. i'll use that one.
20:09RickInAtlantadoes Light Table have paredit?
20:09gtrakthat's splice
20:09quizdrso M-( is basically the same as adding a new parenthesis and slurping the expression to teh right? I suppose this saves me one keystroke
20:09turbofailyeah
20:10amalloywell, several keystrokes really, because (-then-slurp often leaves you with a SPC you need to remove as well
20:11quizdramalloy what is SPC?
20:11quizdrsorry don't know all the lingo
20:11clojurebotExcuse me?
20:11turbofailit doesn't leave a space in the most recent paredit version
20:11amalloy\space
20:11quizdroh
20:11quizdra couple of you mentioned paredit-raise, how is that?
20:12amalloypretty handy
20:12amalloyM-r
20:12gtrakwe need a cheatsheets sorted by popularity.
20:13quizdrso my naive interpration of raise is that it is splicing the affected symbol while deleting all the others in the sexpr, is that right?
20:13turbofailyeah, basically it replaces the parent s-expression with the one at point
20:14quizdri can see that being useful
20:15technomancythe coolest one is paredit-convolute-sexp
20:15turbofaili still haven't figured that one out
20:15technomancyI honestly can't describe what it does in actual words
20:15technomancyand I don't use it very often
20:15locksLOL
20:16technomancybut when I do it feels really cool
20:16TEttingertechnomancy is making hand gestures trying to figure out how to explain it
20:16RickInAtlantawhat is the keybinding for that one?
20:16quizdrthat's pretty funny actually
20:16technomancyTEttinger: and sound effects
20:16TEttinger(inc technomancy)
20:16lazybot⇒ 94
20:16technomancyRickInAtlanta: I don't think it's bound by default; I just M-x it because it's rare
20:17amalloyi bound it to M-LEFT
20:17gtraklol M-x is rare?
20:17gtrakmaybe for technomancy
20:17amalloyjust cause like...it feels like i'm doing stuff to the left of point, and it's not common enough to deserve a spot on the home row
20:17justin_smithM-x is needed for rare commands, that being rare, are not bound to keys
20:17technomancyit's basically "turn this thing inside out by taking the following sexp and embedding the surrounding sexp inside it"
20:18technomancyterrible explanation because it is fundamentally ineffable
20:18amalloy(map inc (map dec |xs)) ===convolute==> (map dec (map inc xs))
20:18justin_smith"it's like a popple, but it's your code"
20:18locksoh
20:18RickInAtlantawow
20:19gtrakah, technomancy I first interpreted your sentence as replacing binding convolute-sexp to M-x. My further comments can make sense either way.
20:19technomancygtrak: heh; sure
20:21bitemyappRaynes: you're doing Python these days and should be able to appreciate this: ''.join(map(''.join, edn_parse.fold_thing(1, '|', "blah|||woot")[0]))
20:21bitemyappRaynes: it's hiding a 20 line closure >:)
20:22technomancy"but it's pythonic!"
20:22bitemyapptechnomancy: I'm using it because it's fast.
20:22bitemyappin this case.
20:22bitemyapptrying to do harm reduction on the already extant insanity in this parser.
20:23technomancybitemyapp: oh no not the fact that you're using it
20:23technomancyit's idiomatic python supposedly
20:23RickInAtlantaI got an email from a recruiter today that said "I have a 12 month perl contract that you would be perfect for"
20:23arrdemRickInAtlanta: I'm so sorry
20:23RickInAtlantaI am trying to remember what I did to upset him
20:23bitemyapptechnomancy: I don't try very hard to write idiomatic Python because their idioms are silly and unprincipled.
20:23technomancyit's just hilarious how people defend it as something that actually makes sense and deserves to be idiomatic
20:25bbloomi always chuckle when i see a string multiplied by a number :-P
20:25bbloomfeels kinda APL-ish
20:26arrdem,(* "a" 4)
20:26clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number>
20:26locks‘’.join is idiomatic python? what’s the explanation
20:26arrdembbloom: not here obviously...
20:26bitemyapplocks: lets not and say we did.
20:26technomancylocks: because guido said so
20:26bitemyapp^^
20:26arrdempython: because guido said so
20:27locksphp: fuck it, we’ll do it live
20:27bitemyappI'm always really happy I use desktop-mode when I accidentally take an axe to my emacs.
20:27tos9locks: mostly that it's a place to put it that requires implementing it only once.
20:28bitemyappIt's always a bad sign when I have code I want to show coworkers in person just so I can see their horrified expressions.
20:28quizdr bbloom forgive me but what does APL mean?
20:28TEttingerit's a very terse programming language
20:28bitemyappquizdr: "A Programming Language"
20:28TEttingerwith its own character set
20:29bbloomquizdr: http://www.youtube.com/watch?v=DmT80OseAGs
20:29locksAPL is one of the most glorious programming languages ever
20:29TEttingerlike in clojure you have range, which is 5 characters, plus a space between it and its args, and parens. in APL you have an iota character from greek, and next to it a number.
20:30locksI saw the core.matrix presentation yesterday, he mentions APL
20:30bbloomlocks: APL is the original core.matrix ;-)
20:30TEttingeryou very rarely need whitespace in APL, so people use it rarely, and it leads to legendary feats of hard-to-read code
20:30bitemyapplocks: like carving runes into one's grimoire, as I always say.
20:31arrdembitemyapp: carving... paper.
20:31bitemyappTEttinger: to be fair, it bears a faint resemblance to the aggressively pipe-y Python I write.
20:31TEttingerthere's also the left and right args
20:31bitemyapparrdem: I can demonstrate sometime if you want.
20:32arrdembitemyapp: just because it's physically possible doesn't mean it was the appropriate verb...
20:32turbofailthe nice part about APL is that your code is already greekified for when you put it in a paper
20:32locksI actually want to try J, see if I can make sense of anything
20:32bitemyapparrdem: I'm dreaming of soldering irons, smoke, and fearful coworkers.
20:33bitemyapparrdem: you could say...I have a dream.
20:34locksturbofail: that gives me an idea…
20:34arrdembitemyapp: I tried that once... loooong time ago. I think I managed to ruin that soldering iron quite thoroughly.
20:34bitemyapptime to end my work day triumphant, now that I have wrought horrors in the process of making a test pass.
20:35bitemyappalso lol @ test that relies on deterministically ordered results in HAMTs. Just lol.
20:36bitemyappnot even my coworker's fault, pretty sure that came with the library.
20:39koreth_Has anyone had experience trying to train "average" Java programmers to write Clojure? I'm consulting on a project where the Java code is a mess and parts of it would be dramatically cleaner in Clojure, but then I stop and think, "The team who created this mess would have to maintain it, and they are barely competent in Java, let alone a new language none of them has ever seen."
20:39bitemyappkoreth_: yeah.
20:40bitemyappkoreth_: they weren't amazing at Java, but they knew a bit of Python.
20:40bitemyappkoreth_: went well, they write good Clojure now, although some of it is idiomatically naive, the fundamentals are definitely there.
20:40koreth_Thanks. That's encouraging!
20:40turbofailat the very least they'll have fewer thread-unsafe bits
20:40bitemyappit was fairly hands off on my part, I pointed them in the right direction and swooped in for code reviews periodically.
20:40technomancykoreth_: keep in mind that programming against immutable data structures is fundamentally less mental overhead
20:41bitemyappkoreth_: the code reviews were the teachable moments.
20:41technomancythe difficulties arise more from unfamiliarity than inherent difficulty
20:41bitemyappkoreth_: what technomancy said. I use FP because I'm dumb.
20:41bitemyappkoreth_: smart people zip along in C++, nary a care in the world.
20:41arrdemtechnomancy: or more, until you get the hang of it...
20:41bitemyappkoreth_: there is an initial ramp, but the blocker there is time and well-directed effort, not raw intellect.
20:42technomancyarrdem: well yeah if you want to mess around just for kicks you can certainly take it to another level =)
20:42technomancyclojurebot: juxt?
20:42clojurebotjuxt is a little hard to grok but it's the best thing ever
20:42koreth_The irony is that most of the Java code that needs work is actually used to build up big immutable trees of maps. (Well, technically mutable but they never mutate it after it's built.)
20:42koreth_Thanks, this gives me the encouragement I needed!
20:42bbloomobligatory: <3 juxt
20:42bitemyapptechnomancy: I will say that while it's a lot more general, sequence is harder to understand than juxt.
20:42arrdemeew. yeah. perfect application of Clojure.
20:42bitemyappkoreth_: .copy() lol
20:50bitemyapp`sequence [[1], [2], [3]] => [1, 2, 3]` ; `sequence [Just 1, Just 2, Just 3] => Just [1, 2, 3]` `sequence [succ, pred, (*3)] 4 => [5, 3, 12]`
21:09koreth_The Java code base I'm looking at uses Spring for dependency injection. If I want to port some of the existing Java code to Clojure, it'll have to play nice with the rest of the application, which means accepting injected dependencies. What would be the closest thing to an idiomatic approach? Atoms are the obvious one.
21:10koreth_Or am I just thinking about it completely wrong (likely)?
21:10technomancyI haven't used dependency injection, but from what I understand you usually just take a function as an argument for that kind of thing
21:11jeremyheilerkoreth_: if you need objects from the applicationcontext, i'd think giving clojure access to that object woudl be easier
21:12marcopolo`Why shouldn't you use go blocks to run IO intensive code?
21:12marcopolo`I remember tbaldridge saying something about that
21:14bbloommarcopolo`: b/c your IO will block other go blocks b/c they are essentially cooperatively multithreaded. you can use core.async/thread blocks with the <!! and >!! operators for real threads that can actually execute simultaneously
21:16marcopolo`bbloom: Ah, and that's because we can't change how the JVM treats blocking for IO?
21:16bbloommarcopolo`: i guess you can think of it that way.... the point is that blocking IO calls are just that: blocking. where as <! and >! are semantically blocking, but implemented as "parking"
21:16bbloom<!! and >!! are *actually blocking*
21:17bbloombut they only block their thread, not all other parking pseudothreads that are sharing that real thread
21:17marcopolo`gotcha, thanks
21:18marcopolo`so if there was a hypothetical IO operation that used events, a go block would be fine, because it isn't really blocking, just listening for events?
21:18marcopolo`in other words, Clojurescript wouldn't have the same issues, right?
21:19bbloomum, i'm not sure if i can answer your question yes or no, so i'll just say something that should make it clearer
21:20bbloomall IO in javascript requires callbacks. you can use put! and take! to convert callbacks in to channel operations and then use the go macro for IO stuff. there is no thread macro in cljs
21:20bbloomif you had callback-based IO on the JVM (and there is stuff like that, NIO, etc) then you can do the same thing
21:21bbloomit may be illustrative to think about what happens if you just write a loop that is slow
21:21bbloomin javascript, it will block all other stuff
21:22bbloomwith core.async, a slow loop will... block *a* thread, but there is usually a pool of threads (approximately one per core or something like that)
21:22arrdembitemyapp: gimme something to build in Rust...
21:22bbloomif you use thread and <!! and >!! on the JVM instead of go and <! and >! then your slow loop will only block the one thread that you created
21:22bbloommarcopolo`: clear now?
21:24marcopolo`Yes thank you. However does callback-based IO allow you to do more IO in go blocks since it wouldn't be blocking the same way?
21:25bbloommarcopolo`: potentially, but you'd need to use take! and put! and glue it together with callbacks at the "edges"
21:25marcopolo`I understand you would still get bogged down by the computation part of it
21:25justin_smitha go block is a pseudo-thread that creates callbacks
21:25justin_smith*is made out of callbacks
21:25justin_smiththey are invisible to your code though
21:25justin_smithsaid pseudo thread also runs in a thread on the jvm though
21:26marcopolo`okay I think I understand that limitation
21:26marcopolo`thanks bbloom and justin_smith
21:26marcopolo`(inc bbloom)
21:26lazybot⇒ 22
21:26marcopolo`(icn justin_smith)
21:26marcopolo`(inc justin_smith)
21:26lazybot⇒ 26
21:34quizdris that lazybot interpreting clojure without an escape string prepended?
21:34arrdemquizdr: no
21:34bbloomquizdr: special cased karma system
21:34marcopolo`for certain phrases it knows
21:34bbloom$karma quizdr
21:34lazybotquizdr has karma 0.
21:35bbloom(inc quizdr) ; just cus you asked
21:35lazybot⇒ 1
21:35bbloom$karma quizdr
21:35lazybotquizdr has karma 1.
21:35quizdrinteresting
21:35quizdrwell, for answering that one
21:35quizdr(inc bbloom)
21:35lazybot⇒ 23
21:36bitemyapparrdem: hum
21:36arrdembitemyapp: actually never mind I have one
21:37bitemyappkoreth_: don't use atoms.
21:37bitemyapparrdem: what?
21:38koreth_bitemyapp: What's the better approach, given that the code will be called from a Java container?
21:39sajUsing korma, how do I perform a join on an entity that has a "has-many" relationship with itself?
21:39bitemyappkoreth_: function as an argument or a protocol.
21:40sritchieddellacosta: hey, did you see the friend post?
21:40sritchiecurious to hear your take on if I made it too confusing
21:41sajI get an "ambigious column name" error because it's using the same table name to refer to the select and the join row
21:41ddellacostasritchie: I read about halfway through, sorry I haven't finished it yet! Let me finish it up right now
21:42sritchiehaha, it's so freaking long
21:42ddellacostasritchie: I think it probably was too confusing though, to be completely honest. Part of the problem is that friend is somewhat confusing, and more to the point, oauth2 is confusing
21:42sritchieyeah, I didn't even touch oauth
21:42ddellacostasritchie: yeah, I mean, you covered a little bit of the flow out of necessity I guess
21:42sritchieoh, yeah, that one mention
21:42ddellacostasritchie: it gave me a lot of food for thought though, re: authn/authz in clojure web apps
21:43sritchieddellacosta: there's got to be a better way to structure it all
21:43ddellacostasritchie: I meant to write a response to your mailing list post, sorry I have not been engaged
21:43sritchieno worries
21:43sritchieddellacosta: I had originally tried to implement a friend-like thing as a Liberator resource
21:43ddellacostasritchie: yeah. I've also built an authorization system wrapping apache shiro and that gave me some things to ponder--it was problematic in its own way (mostly: very java)
21:43sritchiebut the redirect handling was pretty tough without a watching middleware
21:44ddellacostasritchie: I think friend is the right direction, but maybe it needs a bit more refining of the way it is structured.
21:44sritchieyup
21:44koreth_bitemyapp: I am no doubt being dim but I don't see how that could work. I have to provide a setter that takes a Java service object as an argument, and the setter will be called once at app startup. How will functions as arguments get that value to the Clojure code that needs it later on?
21:44ddellacostasritchie: well, let me read through it fully and write something substantial. I'm definitely super interested in the discussion and helping push friend and/or whatever the community wants to work on forward
21:45sritchieawesome
21:45sritchieyeah, I appreciate it
21:46ddellacostasritchie: yeah, same here--it's great all the work you've done getting this going and trying to build something real-world. That's the only way to know what the issues are with these systems, shake them out, and build something better.
21:46ddellacostasritchie: so, kudos and thanks on that.
21:46sritchieyeah, to you too
21:47sritchieI should put together something for that other oauth2 stuff so we can try and sync up
21:47ddellacostasritchie: okay, sounds good.
22:08luxbockthere's a library that I would like to use, but it's not on Clojars/Maven
22:08luxbockmainly this one: https://github.com/levand/prolin
22:08luxbockcan I just submit it there on my own or what should I do?
22:13nopromptluxbock: you could clone it and do a `lein install`, bug the author to release it on clojars, or, finally, clone it change the project name to luxbock/prolin, push that to clojars and be on your merry way. ;-)
22:13bitemyappkoreth_: you need to learn more FP I think.
22:13luxbockalright
22:13bitemyappkoreth_: and figure out some ways to cross the Clojure/Java bridge
22:13nopromptluxbock: i've had cognac.
22:14bitemyappkoreth_: this is not a subject I can efficiently summarize in an IRC channel.
22:14luxbockhaha, thanks for the disclaimer
22:14bitemyappkoreth_: when you feel comfortable with a solution that doesn't involve global mutable state and think your coworkers could understand it, then you'll probably have a plausible approach for porting the Java app.
22:14koreth_bitemyapp: That's what I'm trying to do. Where should I look for more discussion of this? I spent a fair while searching before coming here to ask about it.
22:14bitemyappkoreth_: as it is, you're better off stepping back at a coarser grained level
22:14bitemyappkoreth_: and parting out the application at the systems level (a subject Hickey has talked about)
22:15bitemyappkoreth_: and letting Clojure do what it does best, on its own terms.
22:15bitemyappkoreth_: a naively implemented frankenstein doesn't make you (or Clojure) look good.
22:15bitemyappkoreth_: look into SOA to see what I mean by 'coarser grained'
22:15bitemyappit'll save you reimplementing everything at once.
22:16noprompti'm gonna write a syntax highlighter in pure clojure. wish me luck.
22:17nopromptbitemyapp: when you purchase the "top shelf shit" you can do anything.
22:17arrdemnoprompt: m0ar power to ya...
22:17bitemyappnoprompt: truth.
22:17bitemyappnoprompt: yak that shit up.
22:18nopromptarrdem: what's the elipsis suggest? fear? doubt? BORDEM?
22:18koreth_So basically, step 1 in migrating to Clojure: completely rearchitect the app. That's disappointing though I do take your point and you are most likely exactly right.
22:18arrdemnoprompt: doubt in ultimate success.. concern based on relative task complexity for a drinking project...
22:18luxbockafter 'lein install', how do I find out what to include in my project.clj to include that library as a dependency?
22:19bitemyappkoreth_: monolithic applications are an anti-pattern. Monolithic Spring applications doubly so.
22:19arrdemnoprompt: whatever offends you more :P
22:19luxbockI tried looking at the pom.xml that was generated but I couldn't make much sense of it
22:19bitemyappkoreth_: the monolith and the Spring are bigger problems than it being in Java.
22:19bitemyappkoreth_: systemic problems are more dangerous than linguistic ones.
22:19bitemyappkoreth_: doesn't mean your SOA-ization can't involve Clojure, it sure can, but you have to decomplect and componentize before that makes sense.
22:19nopromptarrdem: well it's not like i'm totally smashed. plus i have some experience wrt this sort of thing.
22:20bitemyappkoreth_: I have patterns/approaches for things like DI and IoC in Clojure, but it's...man...not right now.
22:20bitemyappkoreth_: you're better off drinking deeper from the FP pool of knowledge than you are going through the pain I did to model that sort of stuff.
22:20arrdemnoprompt: I'll be interested to see what you come up with, and I hope that it's generally extensible to arbitrary tag higlighting.
22:20koreth_Sure, I don't expect anyone to write a book in an IRC discussion.
22:20nopromptarrdem: "this sort of thing" can be read either as cognac or lexing.
22:21nopromptarrdem: which ever makes you laugh.
22:21arrdemnoprompt: I hate parsing/lexing with a firey passion, which is unfortunate because I like languages and compilers.
22:21nopromptarrdem: bro. it's gotta be extensible.
22:21koreth_Thanks, bitemyapp -- you are no doubt steering me clear of a bunch of pain.
22:22arrdemkoreth_: the advice is definitely good once you get over the delivery.
22:22nopromptarrdem: the lexing/parsing part is the most fun!
22:23arrdemnoprompt: ..... no. just no.
22:23bitemyapparrdem: he's always like that. always enthused about those kinds of problems.
22:23bitemyapparrdem: I keep telling him he needs to try Parsec, but I'm starting to hesitate because I think he'd end up writing a compiler just so he could use it more.
22:23nopromptarrdem: actually syntax highlighting is kind of sad because most of the time people use a plain old lexer to do it. i mean it works but it would be much better to use a real "hardcore" parse.
22:24arrdembitemyapp: I've used parsec-likes so that I could get on with writing a compiler and escaping parser garbage...
22:24bitemyappnoprompt: my bullshit fold-in-parser worked btw.
22:24bbloombitemyapp: parsec is a damn good parser combinator library, but i generally dislike combinator libraries that don't reify a real data structure for the parser or parse tree
22:24bitemyapparrdem: I haven't seen any that attain the true sorcery of the original, but it's halfway there and nice to have.
22:25bbloomor rather more generally for any combinator library: the data structure for the composed program
22:25bitemyappI know this pains you, but the functions are the data.
22:25bbloomif it doesn't instance show, it doesn't count :-P
22:25arrdemnoprompt: sure sure. TBH I think that there are a lot of really fun things left to be done with editing programs by ASTs. which is sad because one of my professors wrote his own structural editor back in the 1980s and it went nowhere..
22:26bitemyappbbloom: I've seen tree-aware show for free monads.
22:26arrdemnoprompt: in-editor semantic analysis and highlighting based on the AST for instance.
22:26arrdemnoprompt: AST based drag and drop code motion including comments...
22:26arrdemnoprompt: all kinds of cool stuff. all eventually possible in LT!
22:26nopromptarrdem: that's what the world needs.
22:26bbloombitemyapp: let me know when the haskell people drag combinator libraries all the way back to lisp & i'll happily give it a try
22:27bitemyappbbloom: well, liskell. but I know what you mean. I'd like that too, it's just not as important to me as not chasing errors.
22:27nopromptarrdem: seriously. structural editing makes coding much more pleasurable.
22:27arrdembitemyapp: I just won an argument with a C programmer by bashing on the C pointer system. what do I win.
22:27brehauthaha
22:27brehautnot needing to write C ?
22:27arrdembrehaut: if Rust takes off I hope so...
22:28arrdem(dec so)
22:28bitemyapparrdem: wait what who?
22:28lazybot⇒ -1
22:28arrdem(dec also)
22:28lazybot⇒ 0
22:28bbloombitemyapp: instaparse is a nice compromise. the combinators return maps of production names to combiners
22:28turbofailarrdem: a pointer, mounted as a hunting trophy
22:28arrdembbloom: instaparse is the shit
22:28bbloom(dec so) ; too, i hate the highlighting when i use common words
22:28lazybot⇒ -2
22:28bitemyappbbloom: it's reasonable and nice to use, but attoparsec/parsec present a supremely practical production/prototype pair.
22:28bitemyapp(dec so)
22:28lazybot⇒ -3
22:29noprompt`lein new blood` ... (defproject blood :description "A syntax highlighter written in blood" ... welp that's a start.
22:30noprompt:(
22:30nopromptok i should probably cook my lamb chops now.
22:30brehautah
22:30brehauterr sorry
22:30nopromptbbloom, bitemyapp is there anything close to Parsec for clojure?
22:30arrdemnoprompt: instaparse
22:31arrdem$google instaparse
22:31lazybot[Engelberg/instaparse · GitHub] https://github.com/Engelberg/instaparse
22:31arrdemnoprompt: not blazing fast but really really easy to work with.
22:31nopromptarrdem: true. good to know it's not fast. i wrote a CSS parser with it and the resulting parser was slow as mud.
22:32nopromptarrdem: i wasn't sure if it was instaparse or if i just wrote a bad grammar.
22:32arrdemnoprompt: some of it is the grammar... some of it is the toolkit
22:32bitemyapparrdem: programming via type errors is going well so far in Rust-land.
22:32bitemyapparrdem: I'm fiddling with a benchmark.
22:32arrdembitemyapp: I'm still browsing r/guns and thinking about food... the coffee crash isn't kind.
22:33nopromptbitemyapp: what instrument is the benchmark playing?
22:33bitemyapparrdem: that's why I drink tea.
22:33arrdem(inc noprompt)
22:33lazybot⇒ 5
22:33bitemyappnoprompt: Golang channels vs. Rust tasks. FIGHT
22:33arrdemnoprompt: what are you doing that you only have 5 karma. I'm at 15 already and you totally do more awesome stuff.
22:33bitemyapparrdem: he writes libraries and doesn't use IRC much ;)
22:34arrdembitemyapp: legitimate.
22:34nopromptarrdem: that and i don't say anything worth a damn in here.
22:34arrdembitemyapp: http://i.imgur.com/fkrcD9R.jpg why would you ever...
22:34arrdembitemyapp: mosin in an aluminum frame
22:35bitemyapparrdem: fuck 'em with a rake.
22:35bitemyappthat poor mosin :(
22:39seangrovearrdem: He's doing better than me. It can always get worse...
22:40arrdemand this is why we wanted Cloutjure to have github/clojars as input sources...
22:40justin_smithI think karma is kind of silly, but really the easiest way to get it is to crack a good joke or solve a bug in some code from someone that doesn't know clojure yet
22:41justin_smithit's easy, half the time it's just that they are using map as if it was eager
22:41bitemyapparrdem: man I am getting thoroughly reamed by the compiler.
22:41nopromptugh. if i see one more mashup of "clojure" and another word i'm gonna see one more mashup of "clojure" and another word.
22:41bitemyapparrdem: like poorly dribbling a soccer-ball and then getting waterboarded in a puddle of mud by the soccer coach.
22:41justin_smiththat sounds terrible
22:41justin_smith(fits both previous statements actually)
22:42bitemyappjustin_smith: Rust.
22:42bitemyappI am doing stupid, error-causing things and it is stopping me.
22:42justin_smithhah
22:43nopromptseriously. jump on wikipedia. name your library after a planet or a japanese demon or something. something that's not "cloduhr" or "duhrjure" or whatever.
22:44bitemyappnoprompt: I do similar things!
22:44bitemyappnoprompt: my latest name I picked was "yama"
22:44nopromptwhen people do that, i don't wanna use their shit.
22:44RickInAtlantaI was creating a project called "filer" unitl I saw that leiningen restricted project names, so I had to see what would happen if I called it filejure
22:44bitemyapphighly recommend: http://thesaurus.com/
22:44bitemyappRickInAtlanta: are you in alabama?
22:44seangroveI name worker machines from things like that, last one was samjoko
22:45eraserhdIs there a way to compare for identity in clojure (e.g. == in Java)?
22:45bitemyappnobody answers
22:45RickInAtlantabitemyapp: I reccmend maps.google.com
22:45bitemyappI got this
22:45bitemyapperaserhd: okay.
22:45bitemyapperaserhd: we can do this.
22:45eraserhdbitemyapp: ?
22:45nopromptseangrove: see there. that's a bad ass name.
22:45bitemyapperaserhd: you are very close already.
22:46bitemyapperaserhd: take what you just said and combine it with a word
22:46bitemyapperaserhd: guess!
22:46seangroveWell, could use a little bit of a hint...
22:46nopromptganymede. that's a killer name! why hasn't someone named a library that?
22:46seangrove"Are these two things ... ?"
22:46bitemyapperaserhd: guess the obvious thing!
22:46eraserhdsame?
22:46seangroveAnother word for same
22:46TEttingerhas a q in it
22:46bitemyapperaserhd: you already used the right word
22:47bitemyappTEttinger: dammit silence
22:47TEttingersquid?
22:47bitemyapperaserhd: just combine it with...
22:47justin_smithTEttinger - there is one without a q in it that does that
22:47justin_smithI feel like this is a game show
22:48eraserhd,(apropos "q")
22:48clojurebot(chunked-seq? sequential? doseq sequence rseq ...)
22:48bitemyapperaserhd: http://www.youtube.com/watch?v=HuABhumm6fY
22:48bitemyapperaserhd: dude, TEttinger was fucking with you. there's no q
22:48bitemyapperaserhd: you already said the word once.
22:48bitemyapperaserhd: guess the MOST OBVIOUS possible thing!
22:48TEttingeroh I meant equals
22:48eraserhdoh, identical?
22:48bitemyapp,(identical? {} {})
22:48clojurebottrue
22:49eraserhd,(identical 'a 'a)
22:49clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: identical in this context, compiling:(NO_SOURCE_PATH:0:0)>
22:49TEttingerone way of doing it?
22:49eraserhd,(identical? 'a 'a)
22:49clojurebotfalse
22:49TEttingerhttp://clojure.org/cheatsheet see if you already mentioned the function
22:49eraserhdSweet.
22:50bitemyapp,(.equals 'a 'a)
22:50clojurebottrue
22:50seangroveEquality is an intriguingly philosophical questions
22:50TEttingerbitemyapp, I see a q
22:50seangroveGrammar, less so
22:50bitemyappTEttinger: different semantics yo.
22:50eraserhdYou know, the word "identical" to me implies two different objects.
22:50seangroveHrm...
22:51eraserhd:)
22:51ToBeReplacederaserhd: why's that? i thought most languages shared the identical-means-same-object convention
22:52seangroveMaybe instead of (identical? ...) it should be (occupies-the-same-place-and-time? )
22:52ToBeReplacedor (same-object?)
22:53nopromptwhat about (are-these-two-fucking-things-the-same? )
22:53seangroveTurtles all the way down...
22:53seangroveWe need symbolic grounding!
22:53TEttingerjeez, I was wrong here. I thought the == part of the question was asking about = in clojure :|
22:54bitemyappTEttinger: wheeeeee
22:54bitemyapp,[(System/identityHashCode {}) (System/identityHashCode {})]
22:54clojurebot[20331287 20331287]
22:55eraserhdToBeReplaced: Well, to my ear "comparing for identity" is slightly different meaning from "identical".
22:55eraserhdsame-object? would be the clearest thing to me.
22:55bitemyapp,(let [a {}] [(System/identityHashCode (assoc a :a 1)) (System/identityHashCode (assoc a :a 1))])
22:55clojurebot[29197670 25242632]
22:56noprompteraserhd: to make it really clear you could use screaming dash case (SAME-OBJECT??? )
22:56eraserhdTEttinger: I have discovered that splay trees are difficult in an immutable language.
22:56eraserhdBUT I have figured out how to do it.
22:56TEttingereraserhd, that's interesting
22:56eraserhdThough I'm afraid I'm too tired to finish it this evening.
22:57bitemyapp,(let [a {} b {}] [(identical? (assoc a :a 1) (assoc a :a 1)) (identical? a b)])
22:57clojurebot[false true]
22:57TEttingerI would have thought the opposite since Okasaki's book was about pure data structures
22:58eraserhdOkasaki's book doesn't mention splay trees, though.
22:58TEttingerwhaaaat I thought... hm I should find it
22:59eraserhdI didn't actually have the book, I looked through the TOC on amazon.
22:59eraserhdSo I might stand to be corrected. That would be cool.
23:00bitemyappdo I need to say it?
23:00bitemyappit's between 0200 and 0500, I'm doing it.
23:00bitemyapperaserhd: http://hackage.haskell.org/package/TreeStructures-0.0.2/docs/Data-Tree-Splay.html
23:00eraserhdHahaha. I just typed "(cdr (cdr" into my clojure.
23:01bitemyapperaserhd: https://gist.github.com/m2ym/4232390 http://comonadology.blogspot.com/2013/02/splay-tree-access-is-coalgebraic.html
23:02arrdemlolz
23:02Bronsabitemyapp: (let [a [1] b [1]] (identical? a b)) returns true when compiled with tools.emitter.jvm. similar "optimization" used for the expr you were testing.
23:03Bronsaeraserhd: dude, nnext.
23:04arrdemBronsa: or ffirst...
23:04bitemyappBronsa: we need a ffffffffffirst
23:04eraserhdHeh. I was trying to avoid the zipper. That does make it lots easier, though.
23:05arrdembitemyapp: I remember reading a Racket extension that added arbitrary C[AD]R support...
23:05nopromptbitemyapp: (reach-in-there-and-grab-the-first-item-in-the-first-most-deeply-nested-list xs)
23:05bitemyapparrdem: Racket users are my favorite crazy people.
23:05TEttingereraserhd: ! just found something https://github.com/cpdomina/SplayTree
23:05bitemyappnoprompt: well we kinda have that.
23:05arrdembitemyapp: ... the implication of this is that you consider Haskellers and Pythonistas more stable. I find this disturbing.
23:06nopromptbitemyapp: and there should be a note that says "TODO: Figure out what the fuck I'm doing"
23:06Bronsaoh god
23:06Bronsathere's a nfirst
23:06BronsaI never knew
23:06bitemyapp,(def l [[[[[[[[[[1]]]]]]]]]])
23:06clojurebot#'sandbox/l
23:06amalloyPurely Functional Data Structures goes into splay heaps
23:06bitemyapp,(let [[[[[[[[[[[x]]]]]]]]]] l] (println x))
23:06clojurebot1\n
23:06arrdemamalloy: that's on my shelf... I need to finish reading it sometime.
23:06bitemyappffffffffffirst. QED.
23:07Bronsabeautiful.
23:07bitemyapps/[/f/g
23:07amalloywhich, as i understand it, is just using a splay tree as a heap implementation. so yes, it does go over splay trees
23:08amalloynfirst. wow
23:08bitemyapparrdem: Python users aren't my favorite though. Haskell users are merely sorcerers and wizards of various sorts.
23:08BronsaI need to find a place to use nfirst ASAP
23:08bitemyapp,(nfirst [[:a :e] [[:d :c]] [[:b]]])
23:08clojurebot(:e)
23:08arrdembitemyapp: ... what is this sorcery
23:09arrdem,(doc nfirst)
23:09clojurebot"([x]); Same as (next (first x))"
23:09Cr8this is nifty
23:09amalloyBronsa: i bet it'll be even harder to find a use for than cdar
23:09bitemyappamalloy: well when you have destructuring...
23:09seangroveCr8: Yeup, we're really enjoying it
23:10seangroveHas some sharp edges though
23:10arrdemamalloy: that's easy.... that's just (second).
23:10amalloyno it isn't
23:10amalloythat would be cadr
23:10amalloycdar is nfirst
23:10Cr8seangrove: what've you run into. I'm about an hour in, got my data model and some update helpers defined, doing live repl testing and that's nifty
23:11arrdemright because you chase the pointer in the value cell.
23:11arrdemdamn
23:11Cr8but now I'm going to be actually adding the interaction
23:11RickInAtlantaseangrove: Cr8: are you planning on blogging about your Om projects? I would love to read about them
23:12bitemyappRickInAtlanta: not much luck, can't find Atlanta in Alabama. Are you sure?
23:12seangroveCr8: Be sure to centralize your mutations/transformations or things can become difficult to track down
23:12bitemyappRickInAtlanta: almost same number of "a"s though, can't be far.
23:12Cr8heh, I'd like to blog about mine but what I'm putting together is a simulation of scenarious in which my company's software will explode horribly, to make a point
23:12Cr8*scenarios
23:12seangroveRickInAtlanta: Next month's SF ClojureScript meetup will be about Om, and we should have some good talks
23:13RickInAtlantaCr8: in that case, don't blog, take a video!
23:13bitemyappseangrove: next month's?
23:13seangroveProbably won't have the budget to record the talks, but might make good fodder for blogging
23:13Cr8that is actually the plan
23:13bitemyappseangrove: is this month's still happening?
23:13seangrovebitemyapp: Yeah, definitely
23:13seangroveJust planning things out
23:13RickInAtlantaseangrove: in SF there is a ClojureScript meetup, in addition to a Clojure one?
23:13bitemyappseangrove: can't hurt.
23:13bitemyappRickInAtlanta: there is now, wasn't before.
23:13seangroveRickInAtlanta: There are quite a few. Clojure Dojo, early/late Clojure meetups, and now a ClojureScript one
23:13RickInAtlantaWow, awesome
23:14seangrovePrismatic's Clojure Community Night too
23:14seangroveWhich bitemyapp gave a good talk about an as-yet unfinished project :)
23:14Cr8are these all under the same meetup group or should i be looking somewhere
23:14RickInAtlantawe have a monthly clojure meetup in atlanta. hoping to do a code dojo seeon
23:15RickInAtlantasoon
23:15bitemyappCr8: diff groups.
23:15seangrovebitemyapp: I just mention it because I'm upset about some metric stuff today
23:15seangrove"Oh, I wonder how that's being used. Oh, well, let me implement metrics and wait a day or two..."
23:16arrdemthat's what I was gonna build... a tagged numerics library.
23:16bitemyappseangrove: the stuff I'm learning with Fay for the presentation ties into it, if that's any comfort.
23:16bitemyapparrdem: ಠ_ಠ
23:17arrdembitemyapp: you keep using that face, and it still doesn't render in ERC.
23:17seangroveRenders in my erc
23:17seangroveಠ_ಠ
23:17noonianthe owl
23:18Cr8doesn't like my urxvt
23:18bitemyappCr8: so much for the u in urxvt :(
23:19arrdemyeah inicode in general is pretty suck under Arch...
23:19Cr8i think I just don't have a font w/ those chars, or my current font doesn't? dunno
23:19Cr8all my terminals and editors on my Arch box and my Mac are in PragmataPro
23:19arrdemCr8: that's the primary cause of all this stuff...
23:26Cr8well shucks
23:26Cr8installed some fonts, now it works in chrome, still not urxvt
23:29Cr8okay, enough shaving that yak, back to cljs
23:34quizdrallow for me please to provide for you here some confirmation that, upon my return from lunch, i noticed gracing upon my screen, in little ol ERC, a most beautiful pair of lovely owl eyes
23:34nopromptddellacosta: om is so awesome.
23:34seangroveddellacosta: Come out for a week, it won't kill you, despite what bitemyapp might have told you ;)
23:34ddellacostanoprompt: yeah, went through and did a test proto-implementation of a section of current codebase in Om yesterday...really impressed
23:35ddellacostaseangrove: well, I'm angling to get there for Clojure/West, so you may see me soon. ;-)
23:35seangroveCome out twice
23:35seangroveBring the wife
23:35ddellacostaseangrove: haha, don't have that kind of money right now, but we'll see, we'll see...
23:35seangroveOnce she experiences winter like this, she'll never want to go back to Japan ;)
23:35ddellacostaah, haha
23:36ddellacostaseangrove: I think she would definitely be psyched to be in the bay area, most definitely. We are talking about moving to North America soon, just depends on job stuff.
23:37bitemyappddellacosta: oh definitely visit the bay area, just do so before deciding to move here.
23:37nopromptddellacosta: we've been working with it for the past week or so on something serious at work and it's been so much.
23:37bitemyappseangrove: he's already married, he's fine for being in the bay area.
23:37bitemyapp ;)
23:37ddellacostabitemyapp: haha, is that the main problem? ;-)
23:37bitemyappddellacosta: main implies I can sift through the list in a reasonable amount of time.
23:38ddellacostanoprompt: yeah...I think it's just a matter of time before we add Om into our app in a serious way. We already are using a poor-man's version of it which I came up with independently, but which is really weak compared to Om. I just have to figure out some more details first and find the right place/way to introduce it.
23:39ddellacostabitemyapp: I definitely intend on visiting before any decisions are made...don't get me wrong.
23:40bitemyappddellacosta: I'm considering making a decision to move before visiting, myself.
23:40bitemyappso I can leave sooner.
23:41ddellacostabitemyapp: you mean move *away*?
23:41bitemyappddellacosta: yeah, gtfo of dodge.
23:41arrdemdoge....
23:41bitemyapparrdem: I nearly spat on my monitor damn you.
23:41seangroveMy doge coings doubled in value over the last week
23:41ddellacostabitemyapp wants to gtfo of doge so he can have a doge
23:41bitemyapp(inc ddellacosta)
23:41lazybot⇒ 2
23:42arrdemddellacosta: yeah it's kinda silly...
23:42ddellacostaheh
23:42arrdemddellacosta: price is falling a little bit as #dogesled is fading but that spike..
23:42ddellacostaseangrove: you really have dogecoin?
23:42deadghosthttps://www.refheap.com/26038
23:42ddellacostaarrdem: I don't have any. I'm wholly out of the loop on this whole digital currency thing.
23:42arrdemddellacosta: you don't?
23:42deadghostsession/clear! doesn't seem to want to clear for me
23:42ddellacostaarrdem: nope. :-(
23:42arrdemseangrove: high five!
23:43deadghostfigure I'm derping on something
23:43seangroveddellacosta: Yeah, went out to dinner and refused to let the guy pay, so he transferred some dogecoin to me
23:43xuserarrdem: what's your hash rate?
23:43seangroveI also got bitcoin the same way :P
23:43ddellacostaseangrove: oh man, that is so perfect
23:43arrdemxuser: my gaming rig only has two nvidia cards, so best I can do is about 350KH/s
23:43ddellacostawelcome to northern california
23:43ddellacostadeadghost: what is the problem?
23:44arrdemxuser: I was playing with getting some more heavy duty mining gear for a while but the ecconomics don't make sense.
23:44deadghostsession isn't getting cleared
23:44seangroveddellacosta: I'm not super excited about people being able to give me access to money against my will. Makes paying for dinner/drinks cleanly way more difficult
23:44ddellacostaseangrove: does some obligation come with receiving it? Not trying to be snarky, seriously don't know
23:44ddellacostaseangrove: oh, from a business/expense kind of perspective?
23:44bitemyappddellacosta: seangrove is a wonderful person but very hard to pay for anything with him.
23:44arrdemddellacosta: only the social one of you can't refuse to let someone pay for their drinks...
23:45seangroveddellacosta: No, just my habit of paying for things
23:45xuserarrdem: depends on if you believe the coin value will do a big increase on the future
23:45ddellacostaseangrove: ah, I see...
23:45bitemyappvery hard.
23:45seangrovearrdem: Yeup
23:45arrdemxuser: I don't have two grand of faith in doge. litecoin maybe, but probably not.
23:45bitemyappddellacosta: I think you need to plot ahead of time in order to pay for anything.
23:45ddellacostaseangrove: well...you could do it the Japanese way and be gracious by letter others pay so that they can assert their position above you. If you really want to get complicated. ;-)
23:46seangroveddellacosta: Sure sure, flows with the culture ;)
23:46xuserarrdem: yeah, I think litecoin has a chance
23:46ddellacostabitemyapp: ha, good to know next time I try to buy him a drink.
23:46arrdemxuser: which is interesting because transitively dogecoin has a chance.
23:46arrdemxuser: BTC is just prohibitively expensive and hard to mine. people aren't really getting in at this point.
23:47arrdemxuser: because doge is such a joke I feel like it could in fact stand a reasonable chance because it feels more accessible.
23:47arrdemmy 2D worth.
23:47quizdrtime is probably better spent learning how to trade bitcoin than in mining it.
23:47arrdemcurrently near about 0.0000014 btc...
23:47ddellacostadeadghost: not sure what is up, but are you sure your log-out fn is getting called? app seems to be right...
23:47arrdem,(* 0.0000014 2 965.00)
23:47clojurebot0.002702
23:48arrdemdang. should a done 10D, then I woulda been right!
23:48arrdem20 because math.
23:49arrdem,(* 969.86 0.0192)
23:49clojurebot18.621312
23:49arrdemwtf I have ~$20 in doge.
23:49quizdryou can pay for drinks at bars here in singapore with bitcoin
23:50arrdemthe real money in all of these things is automated trading because they are so volitile at the moment...
23:51arrdemseangrove: up to 210 satoshi/doge!
23:51arrdemwhere will the bubble burst...
23:51deadghostddellacosta, yep definitely getting called
23:54deadghostI've been staring at it for a while, so I'm sure it's probably something stupid
23:55ddellacostadeadghost: I gotta be honest, I'm stumped--I have an app with pretty similar structure here, using noir.session as well, and the signout happens almost identically to what you have laid out. The one difference is that we are not explicitly setting the memory-store, but I'm not sure what difference that would make
23:55ddellacostadeadghost: how do you know it's not cleared out, btw.?
23:56deadghostchromium dev tools
23:56deadghostand FF cookies manager+
23:57deadghostwell I guess I should have it display something to be triply sure
23:58ddellacostadeadghost: ..the cookie won't necessarily get wiped just because you've cleared the session. You still have a session, it's just empty. I would confirm by dumping something out of the session variables themselves.
23:59xuserarrdem: hard to know really