#clojure logs

2013-11-29

00:00bitemyappjustin_smith: well let me know how it shakes out for you
00:00justin_smithsure
00:01justin_smithas far as I am concerned I am still learning, it could turn out this ends up being a failed experiment, it could be it solves a bunch of problems that I won't have to worry about any more
00:01justin_smithor more importantly, pre-empts what could be a disaster
00:04justin_smithand, if nothing else, it could replace my passwords.org.gpg with something I can look things up in using clojure
00:37bitemyappjustin_smith: onward and upward doesn't necessarily mean monotonically :)
00:38justin_smithrarely
00:38bitemyappjustin_smith: well, I think FP has mostly been a win so far over the course of its development
00:39bitemyappjustin_smith: but I think that's only partly because it was relatively virgin territory and the alternatives were *terrible*
00:39Raynesbitemyapp: You use a lot of big words.
00:39justin_smithit had some rough days when the hardware was scarce and expensive
00:39bitemyappRaynes: http://lichess.org/qoomapve lets rock.
00:39justin_smiththough yeah, I guess the alternatives were not so great
00:44bitemyappRaynes: might be the longest we've gone without a casualty.
00:46logic_proglet G be a directed acyclic graph, where some users are following other users. Are there better field names than "followers" and "following" ?
00:47justin_smithlogic_prog: acyclic? how do you ensure that?
00:48logic_progactually, you're right
00:48logic_progit's not necessairly acyclic
00:48logic_progit's a directed graph, some objects are "following" other objects
00:48logic_progI'm wondering if there is better field names than "listeners / listening-to" or "followers / following"
00:48justin_smithpublishers / subscribers
00:49justin_smithfollowers / following works
00:49justin_smithfrom / to
01:02yedianyone have some cljs utility fns they use a lot?
01:06bitemyappRaynes: little did you know, my king moonlights as an assassin.
01:07Raynesbitemyapp: Bawls!
01:07bitemyappLOL
01:07bitemyappI was wondering if that would catch you.
01:09Raynesbitemyapp: Bang.
01:09bitemyappRaynes: what a sack of bs.
01:09Raynesgg
01:09bitemyappRaynes: gg
01:09Raynesbitemyapp: You can turn off 'time control'.
01:09RaynesJust FYI. :P
01:09bitemyappRaynes: lskdfglnkdgklh
01:13yedihm, should i bother with a cljs specific dom library or just keep using google closure's/native js
01:29bitemyappyedi: use Domy
01:29bitemyappDommy*
01:35yedibitemyapp: have you looked into https://github.com/lynaghk/singult at all?
01:36bitemyappyedi: no but you should use Dommy if you don't have specific needs that singult addresses.
01:38arrdemdo we have a nice way to extend a record type?
01:39bitemyapparrdem: http://stackoverflow.com/questions/3589569/whats-the-rationale-behind-closed-records-in-clojure
01:39yedibitemyapp: k, i think i'll go with that... i've been avoiding hiccup like templates but it seems like theyre way more useful in cljs
01:39bitemyapparrdem: don't use records if you need flexibility.
01:39arrdembitemyapp: I'll take that as a no
01:39bitemyapparrdem: don't use protocols if you need flexibility.
01:40bitemyappyedi: I don't use hiccup-esque libraries outside of frontend/CLJS
01:48arrdemOH.
01:48arrdembitemyapp: did you get a commander on commander kill on Raynes?
01:49bitemyapparrdem: no, but I did pick off the last of his non-pawn pieces with my king.
01:49bitemyapparrdem: he won due to the timer, sigh, but I was going to win. I had a second queen, he had nothing.
01:49arrdemoh. literal chess. I was thinking planetary annihilation
01:57crispinhi there people!
01:57bitemyappcrispin: hi
01:57crispinIm wondering if comeone can help me with a clojure functional approach
01:57crispinI can do it procedurally with refs and such, but it feels dirty
01:58bitemyappcrispin: so don't do that. Do you have a book?
01:58crispinI do. I have a few books
01:58crispinchas emmericks one
01:58crispinand some others
01:58crispinits a question about approach
01:58crispinI have two BufferStreams
01:59bitemyappcrispin: stop asking to ask, and just put up a refheap.
01:59crispina BufferedOutputStream and a BufferedInputStream
01:59bitemyappcrispin: https://www.refheap.com/
01:59crispinwhats a refheap?
02:01crispinhttps://www.refheap.com/21344
02:01crispinthe final write/read line writes one chunk
02:01crispinof 1024 bytes
02:01bitemyappcrispin: https://github.com/dakrone/clj-http
02:01crispinwhats the best construct to pump over something like this until its exhausted
02:01crispinI looked at clj-http
02:02crispinand at http-kit
02:02crispinbut I need to track progress of download
02:02bitemyappcrispin: streaming
02:02crispina very large download
02:02crispinthats what Im doing
02:02bitemyappwelp.
02:03bitemyappcrispin: you could wrap it as lazy-seqs. *shrug*
02:03crispinah ok...
02:03crispinyeah. let me try attackng it that way
02:31dakronecrispin: wrap it in a FilteredInputStream and override the method you want
02:57amalloydakrone, crispin: if you use https://github.com/flatland/io/blob/develop/src/flatland/io/core/InputStream.java, you can reify InputStreamable rather than having to override something in a concrete class
03:22crispinis it ok to use clojure keywords as names? like 'count' and 'num'?
03:22crispin(let [count 1] (do...))
03:22crispinit works, but is it bad form?
03:23clgvcrispin: it is only a problem if you want to use the function in that scope
03:23clgvcrispin: btw. you can skuo the `do` within the `let`
03:23clgv*skip
03:24crispincool thanks
03:25clgvcrispin: I wouldnt do it if there are better alternatives, e.g. `n` instead of `count` ;)
03:26crispinbitemyapp dakrone: implemented it using recursion. https://www.refheap.com/21345
03:26crispinclgv: yeah, i just chenged them to byte-count and bytes-read
03:26crispinmore meaningful now
03:28clgvcrispin: if you are doing a lot swing gui you should check out seesaw
03:31crispinclgv: Im using it! Its very good!
03:31crispinsaving heaps of time
03:31crispinI have to use SwingUtilities/invokeLater because proxy cant call protected methods
03:32crispinthis is for a SwingWorker
03:33clgvcrispin: then you probably missed the `invoke-later` function ;)
03:33crispinOMG yes. missed that. changing...
03:34clgvor wait, probably macro and not function ;)
03:52bitemyappcrispin: http://clojuredocs.org/clojure_core/clojure.java.io/copy
04:25crispin_in seesaw, how do I exit an application prematurely
04:25crispin_(dispose! frame) closes the frame
04:25crispin_but the app stays running
04:33TEttingercrispin_: System/exit ?
04:33TEttingerhttp://docs.oracle.com/javase/6/docs/api/java/lang/System.html#exit(int)
04:34crispin_TEttinger: yep very nice. Thanks
04:36crispin_ok, another one. How do I find out (via Java Interop I suppose) what platform Im running on
04:36crispin_Unix vs Windows etc
04:37crispin_ok. cot it
04:37crispin_http://stackoverflow.com/questions/3282498/how-can-i-detect-a-unix-like-os-in-java
04:37crispin_a more clojure way? let me know...
04:43TEttingercrispin, I think interop is the clojure way for System stuff
04:58oriig#/join #julia
04:58oriigsorry
05:06sm0ke,```y
05:06clojurebot(clojure.core/seq (clojure.core/concat (clojure.core/list (quote quote)) (clojure.core/list (quote sandbox/y))))
05:06sm0kei do not understand that?
05:07sm0kehow is ##``y ; with one more quote turns to the above
05:07lazybot⇒ (quote clojure.core/y)
05:18broquaintBecause that's the unevaluated form?
05:19sm0kei mean shouldnt it be (quote (quote user/y)), like ##''`y
05:19lazybot⇒ (quote (quote clojure.core/y))
05:20sm0ke,''''''''''''y
05:20clojurebot(quote (quote (quote (quote (quote (quote (quote (quote (quote (quote #))))))))))
05:20sm0kelike thatif you want
05:20broquaintTo the source!
05:20sm0kehmm weird where did y go?
05:21sm0kehold back, i am going to try synta-quotes
05:22sm0ke,```````````y
05:22clojurebot#<StackOverflowError java.lang.StackOverflowError>
05:22sm0kehah!
05:22broquaintAt 6 ` I get a screen full of code :)
05:22sm0keyea pretty ugly
05:23sm0kei wonder if syntax-unqote is more than just full resolution of symbols
05:28broquaintI think this is where that happens - https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L816
05:30sm0kedoes that helps?
05:31sm0kei dont think i understand anything
05:32broquaintI know the feeling :)
05:32sm0keyou have shown me the ugly side of clojure
05:33sm0keits a shock site for people who dont know clojure source
05:33sm0keand wow, the indentation is shit
06:07philandstuffand the mix of crlfs and lfs
06:09d11wtqI wish you could use a regex as a predicate: (#"\d{4}-\d{2}-\d{2}" some-string)
06:10d11wtqLet Over Lambda makes a reader macro for Common Lisp to do that. Sort of.
06:12bitemyappthat is not a good idea.
06:23wei__not a fan of the clojars plugin some people are using to display the latest maven coords-- it displays an SVG which you can't copy/paste
06:24wei__ok, i can copy the text, but not before it opens a new link in my browser. defeats the purpose if you ask me
06:31bitemyappddellacosta: they added the HOFs not too long ago.
06:32ddellacostabitemyapp: I'm very pleased about the way core.async is shaping up. It's profoundly useful.
06:33bitemyappddellacosta: It's nice, I've been mostly thinking about the alternatives to channels lately.
06:33ddellacostabitemyapp: I'd be interested to hear what you come up with. I still have a ways to go to wrap my head around the implications of CSP.
06:34ddellacosta*in terms of wrapping
06:35bitemyappddellacosta: the implications are moderately far-reaching as long as you can actually trust it to work, which is only the case in go, haskell, clojure, and erlang.
06:35bitemyappddellacosta: when I say alternatives, I'm talking about things like Haskell's MVars, etc.
06:35ddellacostabitemyapp: btw, your help with Elm/FRP was instrumental in me understanding how this all fits together. Thanks again for that!
06:35ddellacostabitemyapp: ah, not familiar with MVars
06:35bitemyappddellacosta: glad I could be of use, did you see the wiki?
06:35ddellacosta!?
06:35clojurebotBOT FIGHT!!!!!111
06:36ddellacostabitemyapp: no, sorry!
06:36bitemyappMVars are an STM container type
06:36ddellacostabitemyapp: link?
06:36bitemyapphttp://clojurewiki.com/
06:36bitemyappddellacosta: I couldn't sleep last night, so I put it up (it's git-backed) and bootstrapped some content
06:37ddellacostahaha, nice
06:38ddellacostaI will add stuff to it as I think of it.
06:38bitemyappddellacosta: please do :)
06:38ddellacostabitemyapp: just registered
06:45bitemyappddellacosta: awesome
07:41jkjhola
07:41jkji've got some trouble wrapping my head around lamina
07:42jkji want to do sql inserts in a executor pool of several threads
07:43jkjand i have a lamina executor-channel that does just that. i just need to figure out how to register a permanent callback
09:35magnarsI'm using clojure.core.memoize/ttl - and I get a deprecation warning - likely coming from here: https://github.com/clojure/core.memoize/blob/master/src/main/clojure/clojure/core/memoize.clj#L327-L338 ... which says "Please use clojure.core.memoize/ttl instead." ... what am I not understanding here?
09:39magnarsoh wait, I'm using memoize/ttl, but I'm getting a deprecation warning for memoize/lu - that it is not constructed right. But then I'm not creating any lu cache.
10:31steeriohi
10:32steeriodoes anyone know the reason for this weird behaviour of if/resolve/def? http://pastie.org/8517153
10:33Bronsasteerio: you should not use def there.
10:33steerioi figured that much, but there's probably an explanation behind this
10:34Bronsasteerio: on the third expression zazaz gets internet at compiled time
10:34Bronsaresolve runs at run time
10:34steerioi see
10:34Bronsainterned*
10:34steerioso by the time resolve runs, it's been interned, yet unbound. the false branch never runs.
10:34Bronsawell, yes
10:34steerioi'm trying to make my own version of defonce that can define private vars (and won't destroy this metadata on existing vars)
10:35Bronsathis is to allow for things like (def foo (do something with #'foo))
10:35steeriothat makes sense
10:42xeqicemerick: do I remember correctly that your using emacs again?
10:59technomancyxeqi: he is!
11:06justin_smithtechnomancy: leiningen question. I have a plugin that finds some data to provide to the project, what is the right way to provide that data to the project? I guess I could put it in an atom in the plugin namespace, but is there a better option?
11:06justin_smithcan my project access it's own project.clj? that way I could put the data in there
11:08steeriojustin_smith: environ (https://github.com/weavejester/environ) might help you. your lein plugin could edit the env map and environ theoretically picks it up.
11:08steerioit all comes down to what happens first
11:08technomancyjustin_smith: maybe emit it into :compile-path so the project can read it from the classpath
11:08justin_smithah right, I could just straight up put the stuff into the env with System/setenv too
11:08technomancybest prior art here is probably configleaf
11:09steerioyour plugin editing it or lein-environ picking it up
11:09technomancythere is no setenv, but there are ways to do it
11:09steerioi believe the order in the :plugins vector is respected
11:09xeqitechnomancy, cemerick : was wondering which version of nrepl.el / cider, and if it worked well with piggieback. trying to get an report of things working before upgrading
11:10justin_smithahh, there is System/setProperty though
11:10justin_smiththat could suffice
11:10cemerickxeqi: I'm using emacs-live, which bundles old nrepl.el. Everything works as I'd expect FWIW, though I don't think anyone should be asking me for emacs advice.
11:13justin_smithtechnomancy: OK, if I can bundle configleaf into my plugin, that would totally do it, thanks
11:13xeqicemerick: ah, does M-tab cause your cpu to spike?
11:13cemerickxeqi: no idea what M-tab is? :-P
11:14justin_smithit prompts for completion
11:14cemerickah
11:14justin_smiththat happens sometimes for me after long runtimes
11:14cemerickemacs-live always pops completion automatically
11:14cemerickon every keystroke
11:14justin_smitheven worse, you would get cpu spikes from typing
11:14justin_smithif you had that bug
11:14xeqihmm, and that works in .cljs files?
11:14cemericksomething on my checklist to turn off
11:15cemerickxeqi: yes, though it returns *clojure* results; no tools support code completion in CLJS yet, due to everyone's reliance on eval for everything tool-related
11:16xeqi:/
11:16jcromart_so I'm giving event sourcing a shot in this new system, and I wanted someone to take a look at the core code for me
11:16jcromart_https://gist.github.com/jcromartie/4ece8fbd63ef7ada6923
11:17jcromart_I want it to be as generic as possible, so that I could change to, for instance, a SQL database or Datomic
11:17jcromart_that's not really a crucial requirement though
11:18jcromart_(change to another event store, not changing away from the event sourcing model)
11:19xeqicemerick: what kind of results were you expecting in cemerick/piggieback#19
11:19lazybotNamespaced keywords cannot be evaluated in CLJS over piggieback -- https://github.com/cemerick/piggieback/issues/19 is open
11:19jcromart_the data model state and the event store are tied together by the command! function, which is not really unsafe per se, so maybe that's badly named
11:19xeqiI've got changes to use tools.reader so I get sourcemaps all the way through, but get the same result
11:20xeqiI'm assuming I've got to do the right thing for reader/*alias-map* still
11:27cemerickxeqi: Without digging into it too much, it should probably use cljs.analyzer/forms-seq
12:40tangrammerHi folks, can anyone guide me (showign some sorted reading resources list ) in learning logic programming (core.logic)?
12:45rkneufeldseancorfield: making another round on the jdbc recipe since things have changed. How confident are you that the core namespaces will stay the same leading up to release?
12:48amalloytangrammer: the reasoned schemer
12:50jonasenBronsa: I'm trying to use your tools.analyze.jvm. Am I on the right track here: https://www.refheap.com/21355 ? I'm trying to analyze a file and return a sequence of ast-trees
12:50jonasenBronsa: is analyze-forms all I need or do I need to do something more complicated?
12:52Bronsajonasen: there are a couple of issues but it looks ok
12:52tangrammeramalloy: thanks, I'm just reading it but … i think i need an introductory text ..
12:53Bronsajonasen: one is that you cannot safely reuse the same empty-env for analyzing multiple forms
12:53jonasenBronsa: ok
12:53Bronsajonasen: that's a limitation due to the fact that namespaces can change at runtime
12:53tangrammeramalloy: i feel that I'm not understanding how to work with it
12:53jonasenso I'll create a new env for each call to analyze
12:54Bronsajonasen: yes, that should be ok
12:54Bronsajonasen: the other is, I'm not sure if evaluating the form *before* analyzing it will cause troubles or not
12:54tangrammeramalloy: and the worst thing is when i search for some fn in core.logic and i don't find it,
12:55jonasenBronsa: I'm looking at what Andy's done here https://github.com/jafingerhut/eastwood/blob/try-upgrade-to-tools.analyzer.jvm/src/eastwood/analyze_ns.clj and it seems kind of complicated so I'm just trying to cut it down to its minimum in order to understand it correctly
12:56tangrammeramalloy: example "split"
12:56jonasenBronsa: but the previous form might be a macro which is used in the following form?
12:56jonasenthat's why I call eval
12:58Bronsajonasen: sure, what I'm saying is that I would (let [ast (analyze form env)] form) ast) rather than (do (eval form) (analyze form env))
12:58Bronsaerr (let [ast (analyze form env)] (eval form) ast)
12:59jonasenBronsa: ok. You're right. That is better.
13:01Bronsajonasen: BTW if i were you, I'd add a big fat warning making people aware that eastwood evalauates the ns it's analyzing
13:03jonasenBronsa: yeah. It might fire the rockets
13:04justin_smithside effects in ns definitions are a bad idea anyway
13:04jonasenas long as there are only defs in the namespace it should be ok.
13:04jonasenand no (launch!)
13:05Bronsajustin_smith: it actually needs to eval the whole namespace, not only (ns ..)
13:06Bronsajonasen: well, (def foo (launch!)) would screw you just as well :)
13:07jonasenBronsa: true
13:07jonasenBronsa: but that's the only way to (correctly) use your analyzer? Or am I missing something?
13:08Bronsajonasen: analyze does eval under the hood too
13:09Bronsa(ambrosebs's analyze i mean)
13:09Bronsajonasen: you *could* analyze a clojure file without evaluating it but you don't get macroexpansion for macros/class validations etc
13:11jonasenBronsa: and you wouldn't know if some symbol foo is clojure.core/foo or my.namespace/foo?
13:11Bronsajonasen: you could tweak the macroexpander to do some magic statically recognizing defmacro/import/require et all if you really wanted though
13:11Bronsajonasen: basically, yeah
13:12jonasenAnd then there's not much more info there than when I just read the file and traverse the s-exprs.
13:12Bronsaright
13:13Bronsain the cljs case it's different, there's no runtime macros & runtime require, so file analysis is trivial
13:13zhbfvuvabar87r YOU MAY BE WATCHED
13:13zhbfvuvabar87rWARNING WARNING WARNING, WARNING
13:13zhbfvuvabar87rWARNING WARNING WARNING, WARNING WARNING
13:13zhbfvuvabar87r YOU MAYWATCHED
13:13zhbfvuvabar87rYOU MAY BE WATCHED
13:13Bronsabut for clojure code, you need it
13:13Bronsa(eval)
13:14jonasenwell, not trivial.. you still need to find and eval the macros.
13:14jonasenin cljs
13:14Bronsayeah, but those are clojure macros not cljs macros
13:15jonasenBronsa: but there is not much of a difference between compiling a file and running eval on each top level form. Right?
13:15Bronsait's just a matter of (loop [forms forms file-ast []] (if (next form) (recur (next form) (conj file-ast (analyze (first form)))) file-ast)
13:16Bronsajonasen: right
13:16tangrammeramalloy: i found this good resource "Relational programming in miniKanren: Techniques, applications, and implementations"
13:16jonasenso if your project is safe to compile it's safe to run eastwood over it... perhaps :)
13:17Bronsajonasen: yes
13:18amalloyBronsa: isn't that loop just (rest (reductions #(analyze %2) nil forms))?
13:18Bronsaamalloy: I wasn't trying to write good code, just the idea :)
13:19amalloygood code conveys ideas so much better :)
13:19justin_smithBronsa: sorry, I shouldn't have said ns definitions, I meant "at load time"
13:19jonasenBronsa: There should be a warning, but maybe not big and fat. :)
13:20Bronsaamalloy: I'm guilty of fogetting the existence of reductions every two days
13:20Bronsajonasen: fair enough
13:20jonasenit's no more dangerous than 'lein uberjar'
13:20justin_smithjonasen: indeed, (def foo (launch!)) would be bad there too :)
13:23justin_smithbitemyapp: http://www.smo.uhi.ac.uk/sengoidelc/donncha/maldacht/
13:51wei__how do you set the isolation level for a transaction in java.jdbc?
13:55VFeAnyone been having issues with Light-Table? I updated it and now it throws errors connecting to projects that had no issues before.
13:55yedi_if anyone is bored and wants to give advice/feedback on some clj/cljs core.async code, take a look at https://github.com/yedi/chatter
13:56yedi_it's one of my first projects and if anyone has suggestions for doing certain things better, lmk
13:59amalloyyedi_: https://github.com/yedi/chatter/blob/master/src-clj/chatter/chat.clj#L20-L21 is a multithreading problem; line 16 could pr-str once instead of doing it for every chatter
14:01yedi_amalloy: why is it a multithreading problem?
14:02amalloyyedi_: what if someone else swap!s the atom in between lines 20 and 21?
14:02xificurCI'd like to let a user input one character an read it in as a character, how can I do that the easiest way?
14:02justin_smithxificurC: do you want them to just type one letter, or do you want them to enter the clojure literal for a character?
14:03xificurCjustin_smith: just one letter or number
14:03yedi_amalloy: the log would just get sent to the client twice, (right now im stupidly sending the entire log and rendering it each time so it should still work)
14:03yedi_amalloy: i guess a better thing to do is to make l20-21 more transactional?
14:03xificurCjustin_smith: let's say from 1-26 and from A-z
14:04justin_smithxificurC: somewhat out of date, but this should be a start http://stackoverflow.com/questions/3225025/single-character-console-input-in-java-clojure
14:04amalloyyes, an easy replacement is (send-log (swap! log conj user-msg))
14:05yedi_sweet, thanks
14:05yedi_(inc amalloy)
14:05lazybot⇒ 79
14:05justin_smithxificurC: you don't need clojure contrib, you should use 1.5.1 version of clojure not 1.1.0, but the jline part should be the same
14:07xificurCjustin_smith: thanks
14:07justin_smithhttps://github.com/clojure-cookbook/clojure-cookbook/blob/master/local-io/console/read-unbuffered-keystroke/read-unbuffered-keystroke.asciidoc
14:07justin_smithmore info on that link
14:07dnolenxeqi: have you tried your patch with austin?
14:07justin_smithincluding the fact that it won't work with lein repl, you'll need lein trampoline repl instead
14:10xeqidnolen: the brepl source maps?
14:10dnolenxeqi: yes
14:11xeqiit is going to require changes in both austin and piggieback. I've got it all working locally, but was waiting till cljs changes finish before making PRs for them
14:11xeqibasically piggieback need tools.reader
14:11xeqiand austin needs to add :source-map true to its repl-env, and change the cljs-build call slightly to ignore that like the cljs browser repl does
14:12xeqiI can publish this all as forks if interested
14:23allsystemsaregoHi all, I'm trying to solve the seating arrangement problem with core.logic, but I get an unexpected ClassCastException, this is my REPL session: http://lpaste.net/96380 Help?
14:24`cbpI don't know about core.logic but == is used for number comparison
14:25`cbpmaybe you want = or some other core.logic stuff?
14:25allsystemsaregoin core.logic == means unification
14:25`cbpoh well I cant be of help then :P
14:29allsystemsaregomayne I'll try l/== then, instead of just ==
14:30allsystemsaregoyup, sure enough
14:30justin_smithallsystemsarego: you could also (:refer-clojure :exclude [==]) in your ns form
14:31justin_smithunless you really think you will need the other version of ==
14:31allsystemsaregojustin_smith, this being a repl session, does that advice still hold?
14:32justin_smithyou can still define an ns in a repl
14:32justin_smiththough it is less likely you need it :)
14:32allsystemsaregolet me copy/paste that in my repl
14:32justin_smithwell :refer-clojure goes in the ns form
14:33justin_smithbut you can use (refer-clojure ...)
14:33allsystemsaregooh ok
14:34alsois there a better way to accomplish this in clojurescript:
14:34also(js/goog.exportSymbol "cljs.core.enable_console_print_BANG_" enable-console-print!)
14:35justin_smithallsystemsarego: I am trying it in the repl, it is not doing what I expect
14:35justin_smithahh, the trick is to define a new namespace
14:36justin_smith(ns user2 (:refer-clojure :exclude [==])) ; this works
14:36justin_smithif you tried that with an existing ns, it silently fails to do what it should
14:38allsystemsaregojustin_smith, also, what if I want 2 operators, as in (refer-clojure :exclude [== !=])
14:38allsystemsaregothat fails
14:39justin_smithyou need a quote on the vector
14:39allsystemsaregook thanks
14:39justin_smithbut it needs to be called at the time of ns creation to really work anyway
14:39justin_smithso you should create a new ns (like I showed with user2 above)
14:39allsystemsaregobut the one you showed me initially works as I expected
14:40allsystemsaregobut I'll try with user2 as you said
14:40justin_smithwait, the (:refer-clojure ...) one?
14:40justin_smith,(:any-key 'anything)
14:41clojurebotnil
14:41justin_smiththat is just silently not doing its thing
15:09tangrammeramalloy: that's the path to clojure logic I'm searching for (clojure/core.logic ( friedman/reasoned-schemer (byrd/relational-programming-in-miniKanren)
15:09jcromart_ring-serve doesn't seem to actually work, when following the directions in https://github.com/mmcgrana/ring/wiki/Interactive-Development
15:09jcromart_I have always written my own stuff to set up a serve
15:10jcromart_server
15:10jcromart_but following these directions yields when requiring ring.util.serve ClassNotFoundException org.mortbay.log.Logger
15:10jcromart_err, yields that exception
15:12jcromart_https://gist.github.com/jcromartie/f95d94731ab0ca811a54
15:14jcromart_I even put [ring-serve "0.1.2"] in my regular old project.clj :dependencies, since I read somewhere that [:profiles :dev :dependencies] wouldn't do the trick
15:15justin_smithjcromart_: I just start nrepl from within ring
15:16justin_smithI luanch it in the handler init
15:16alsojcromart_ the directions have examples for leiningen 1 and 2
15:16also[:profiles :dev :dependencies] is for leiningen 1
15:17alsoerr, never mind that
15:18jcromart_justin_smith: huh, interesting
15:19tommoi'm kinda new to clojure, what is the typical dev pipeline, for example once i've written some code and started up a repl
15:19tommois there a way to 'hotswap' my changes into the existing repl or do i have to relaunch another?
15:19alsojcromart_: does lein classpath show jetty-util-6.1.25.jar?
15:19llasramtommo: In fact, the most common work flow depends on it :-)
15:20llasramtommo: When you recompile a namespace (usually via editor integration) all of your existing definitions are replaced and most "normal" use just picks up the new stuff automatically
15:20justin_smithtommo: you can (require 'some.ns :reload) to get any changes into the repl
15:20justin_smithor just evaluate new definitions
15:21jcromart_also: jetty-util-7.6.8.v20121106.jar
15:21tommocool, ty llasram and justin_smith
15:22jcromart_tommo: I like to send a buffer (file) to the REPL using CIDER in Emacs with the C-c C-k command
15:23tommonice to know jcromart, i'm using emacs too
15:24justin_smithjcromart_: I am not sure which it does, because I don't use that workflow, but send file and send buffer are not the same - send file would have it load what you last saved, send buffer would have it load the current state of the buffer even if you have not saved (even if the buffer is a buffer with no file)
15:24alsojcromart_: lein deps :tree shows me https://gist.github.com/also/1e9393f8cfab1bbf774e
15:25jcromart_" cider-load-current-buffer
15:25jcromart_that's what C-c C-k is
15:25jcromart_which does depend on saving the file, yes
15:26arrdem,(meta #_[1])
15:26clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core$meta>
15:27jcromart_also: and you can (require 'ring.util.serve) with that setup?
15:27arrdemwhat exactly does the #_ reader annotation do? looks like it's a single form comment...
15:28llasramarrdem: Essentially. Causes the reader to discard the next form
15:28justin_smitharrdem: yeah, completely eliminates the next object (balanced form) as if it were not present
15:28justin_smith,(+ #_(can't add this) 1 1)
15:28clojurebot2
15:28arrdemherm. okay, good to know. thanks!
15:28arrdemjustin_smith: har har
15:28alsojcromart_ yes. looks like you've got a newer/wrong version of org.mortbay.jetty/jetty-util from somewhere
15:29justin_smitharrdem: showing the thing it comments doesn't need to be valid, but it uses balancing rules to eliminate it
15:29justin_smith,(+ #_(can't #add this) 1 1) ; though it still does need to be readable
15:29clojurebot#<RuntimeException java.lang.RuntimeException: No reader function for tag add>
15:31jcromart_also: from requiring ring 1.2.1 it would appear
15:34alsoah, i only added ring-serve
15:35alsoi don't know if that dependency specifically is the problem, that's just the jar where the missing class was
15:52dnolenxeqi: ok cool, was just double checking, patch looks cool will give it a spin soon
16:01cYmenOkay, I'd like your thoughts on a common problem.
16:01cYmenAt least I assume it is common.
16:02cYmenWhen I have a function that takes whichever parameter I want and I realize that I would like to apply a transformation to the result, what should I do?
16:03cYmenThis happens to me when doing 4clojure problems all the time and just wrapping around more functions just feels odd.
16:03cYmenMaybe it's not common but a 4clojure thing. Your thoughts?
16:03cYmenhttps://www.refheap.com/0d19e5eb17acdd75e4a5840d5
16:04cYmenThis is the problem I just did before and after I realized I had forgotten to turn the result into a set.
16:04cYmenIs it just me or does this end up pretty cryptic considering how simple the idea is?
16:05jcromart_cYmen are you looking for ->
16:07cYmenI feel like saying no but I should probably just try and use that excessively to get a feel for it.
16:08justin_smithas-> is also great for that kind of thing
16:09Rhymor,(doc as->)
16:09clojurebot"([expr name & forms]); Binds name to expr, evaluates the first form in the lexical context of that binding, then binds name to that result, repeating for each successive form, returning the result of the last form."
16:10cYmenhm
16:10justin_smith,(as-> 1 ☕ (inc ☕) (* ☕ 3) [☕ ☕ ☕])
16:10clojurebot[6 6 6]
16:11justin_smithof course in real usage you wouldn't use ☕ as your placeholder
16:11cYmenI wouldn't? How do I show off my unicody prowess then?
16:11Rhymor:)
16:15cYmenGoogling for ->> really doesn't work to well.
16:15cYmen,(doc ->>)
16:15clojurebot"([x form] [x form & more]); Threads the expr through the forms. Inserts x as the last item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the last item in second form, etc."
16:16justin_smithcYmen: there is a search engine for that, symbolhound
16:16justin_smithtry searching ->> clojure on symbolhound
16:17cYmenjust finds a lot of stackoverflow
16:17cYmennot the docs, though
16:17`cbphello
16:24cYmenNote to self "wrong arguments (0)" maybe you have too many parentheses...
16:24amalloyjustin_smith: as-> was designed to read better inside of a -> context: (-> 1 (as-> x (inc x) (dec x)))
16:25amalloythere it reads like "okay, take the thing we're currently threading, call it x. then..."
16:25justin_smithamalloy: I find myself using it instead of -> if the positioning ever changes
16:26Raynesjustin_smith: Congrats, you invented let. :P
16:27justin_smithheh
16:28amalloy,(-> [1 2] (as-> [x y] [(inc y) (dec x)] [y x]))
16:28clojurebot[0 3]
16:29amalloylooks kinda like a shell game
16:29justin_smithindeed
16:30cYmenIt does?
16:34amalloycYmen: the x and the y are swapping places every step and you have to guess which ends up where, see
16:35amalloy(-> '[win lose lose] (as-> [a b c] [b a c] [c b a] [a c b] [b c a])) ;; where's the win?
16:35seangroveamalloy: Yeah, interesting.
16:36seangrove,(nth (-> '[win lose lose] (as-> [a b c] [b a c] [c b a] [a c b] [b c a])) 1)
16:36clojurebotwin
16:36seangroveboom.
16:36seangroveThe rebinding at each step is definitely interesting.
16:46allsystemsaregoHi, I'm attempting to solve a logic puzzle with core.logic and it goes into an endless loop, here are the details: http://lpaste.net/96384 The puzzle I'm trying to solve is here: http://www.brainbashers.com/showpuzzles.asp?puzzle=ZJLX
16:49dnolenxeqi: inline source map patch landed - THANK YOU for this, it's pretty sick! :)
16:53dnolensweet, sweet patch, http://github.com/clojure/clojurescript/commit/f02775ebe78ef787f128e37f164763ce492927e8
16:57bbloomcool
16:57seangrovexeqi: Yes, thank you, looking forward to seeing this in action
16:58seangroveTiny patch too, that's great
16:58bbloomallsystemsarego: try using core.logic.fd
16:58bbloomallsystemsarego: your non-relational projections might be a big part of the problem
16:58bbloomallsystemsarego: you'll get much better perf out of fd too
16:59seangrove$seen sritchie
16:59lazybotsritchie was last seen quitting 2 days and 23 hours ago.
16:59allsystemsaregobbloom, thanks for the hint, I'll learn about fd and try again
16:59Raynesseangrove: Ain't nothing but a quitter.
17:00mercwithamouthso...domina vs enfocus?
17:00seangrovemercwithamouth: Dommy?
17:00RaynesI wish I could quickly hack the bot to make it say "Raynes was last seen winning 5 seconds ago"
17:00amalloyyou mis-spelled whining, bro
17:00bbloomallsystemsarego: https://github.com/clojure/core.logic/wiki/Features#clpfd
17:00seangroveRaynes: With a 0.1 chance of "bi-winning"
17:00mercwithamouthseangrove: hmm really?
17:01seangrovemercwithamouth: Certainly my favorite, by far. Simple, fast, well made.
17:01seangroveThat said, enfocus' approach is obviously totally different, so if you're looking for a totally different philosophy, it's not a bad source of ideas
17:01egosumHi y'all, pinging from KY. Any great extended finite state machine libraries in Clojure?
17:02mercwithamouthwell i guess i'll have to play with both. starting with dommy, thanks
17:02bbloomegosum: state machines are pretty easy to make in clojure. what are you trying to do?
17:02egosumbbloom: i want an extended one that basically confirms to the UML spec
17:03egosumI've written a few libraries in other langs for them already, but it's always nice to see what people are doing
17:03egosumI haven't found one in Clojure that's very powerful (which is great! I want to make one :)
17:03bbloomegosum: do you have an example in another language you could share? i'm not sure what you could possibly be looking for
17:04egosumI haven't made my open source yet, but e.g. https://github.com/ifandelse/machina.js is a pretty good one
17:05bbloomegosum: you want core.async
17:06egosumbbloom: I don't understand how core.async solves the same problem? Could you explain?
17:07bbloomegosum: your "why would i use it" section discusses several use cases that you can address better with other mechanisms than explicitly coded state machines
17:07bbloomegosum: the first thing discussed is callbacks/deferred, which is *precisely* where core.async is dramatically superior
17:07bbloomthe common pattern is a "go loop"
17:08bbloom(go (loop [ ...] ...)) ; this is your state machine, where the loop variables are the state
17:08bbloomyou alt on inbound channels for your state transitions
17:09bbloomRE: persistence, you can simply respond to a message to serialize by prn-ing the loop control variables to a file and using them as the initial values when you deserialize
17:09bbloomyou can build very robust message bus systems too
17:10egosumSome of them, sure. That's not my library, to be clear. core.async, from my understanding, can't really be used model the same problems that an extended FSM can (though it uses a FSM internally). That also doesn't model an eFSM very well, nor is it representable as "data" as nicely.
17:10bbloombasically everything in that "why" section gets better & easier w/ first class channels and multiplexing
17:10egosumThat library may have been misleading. It's used for coordination, but eFSMs in general are not always just for that
17:11bbloomsure, there are LOTS of uses for state machines
17:11egosumI'm interested in FSMs as a way to describe logical processes. Along the lines of traditional UML FSMs.
17:11egosumcore.async doesn't seem as amenable for those use-cases
17:11CaptainLexHow can I get Clojure to recognize advanced Unicode characters like in strings?
17:12egosumUnless I'm missing something (and I haven't used with core.async much)
17:12bbloomthe question is: do you want to explicitly reify your states and transitions
17:12bbloomcore.async will derive states & transitions for you from straight-line code
17:12bbloomif you want to data-drive the compilation of a state machine, then yeah, it's not a good fit
17:13cYmenHow do I type a newline in the REPL instead of evaluating?
17:13egosumYeah, I'm very much interested in data-driven FSMs. I intend to graph them, display them live, etc.
17:15bbloomdnolen: http://www.scala-lang.org/news/2013/11/29/announcing-scala-js-v0.1.html
17:15dnolenbbloom: yep saw that
17:15bitemyappit produces some really messy output though.
17:15bitemyappFay is much cleaner.
17:15`cbpcYmen: whats your client?
17:15cYmenemacs
17:16bitemyappc-j?
17:16seangroveWe need more mutation in the dom. Not sure how we're getting by with the current status quo.
17:16`cbpC-j
17:16seangroveI'm almost able to get things to work sometimes by accident, clearly that shouldn't be possible.
17:16cYmenthanks :)
17:16dnolenbbloom: tried it on their example project w/ optimizations - OOMed after eatng up 600mb of RAM
17:16bitemyappseangrove: I had to do something involving mutation and recursion in Python the other day, I eventually gave up. lol.
17:17bitemyappdnolen: totes normal for Scala. Gotta bump that Xmx
17:17seangroveWow, very cool to see scala.js. Seems like they took the same closure approach.
17:18seangroveGood omens for js as a compile target!
17:18bbloomdnolen: yeah, i couldn't get anything but OOM a few months ago last we discussed
17:19dnolenseangrove: agreed
17:21cYmenoooh my first NullPointerException.
17:26allsystemsaregowhy do I get this http://lpaste.net/96387 when requiring clojure.core.logic.fd in the repl?
17:27bbloomallsystemsarego: (require '[clojure.core.logic.fd :as fd])
17:27justin_smithCaptainLex: can you give me an example it does not handle?
17:27allsystemsaregooh, thanks
17:29CaptainLexjustin_smith: Sure. In the REPL, (str "Hello! " " 2013") outputs "Hello! ?? 2013"
17:29justin_smithCaptainLex: in my usage, I have had no usage with unicode in strings, symbols, or keywords
17:30dnolenallsystemsarego: having seen some of your trouble might I suggest working through a thorough Clojure book/tutorial first? Your core.logic'ing will be a lot more fun productive if you do :)
17:30CaptainLexjustin_smith: 2013 is what happens when it gets put on my website
17:30justin_smithCaptainLex: your irc client does not send whatever unicode you are trying to send
17:30CaptainLexHahahaha oops
17:31CaptainLexIt's the copyright symbol
17:31allsystemsaregodnolen, point taken
17:31justin_smith,(str "Hello! ©" " 2013")
17:31clojurebot"Hello! � 2013"
17:31justin_smithyour terminal is likely messed up?
17:31seangrove,(str "Hello! " " © 2013")
17:31clojurebot"Hello! � 2013"
17:31seangroveYeah, works here just fine
17:31dnolenallsystemsarego: just a bit of advice, core.logic alone is challenging enough as it is
17:31CaptainLexHaha stupid KVIRC is not transmitting those for me
17:31justin_smith##(str "Hello! ©" " 2013")
17:31lazybot⇒ "Hello! © 2013"
17:32justin_smithlazybot has his unicode set up properly
17:32CaptainLexBut it's not just at the REPL
17:32justin_smithwhat OS?
17:32CaptainLexArch Linux. It also happens when it processes HTML strings through Ring requests
17:32justin_smithlike I said, I have had no issues with unicode in strings, symbols, or keywords in my code
17:33CaptainLexInteresting
17:34justin_smithare your content type headers matching the string format?
17:35justin_smithhttp://sprunge.us/aJfH <- from my repl
17:35CaptainLexjustin_smith: The processing all goes on in the backend. Huh. Interesting
17:36justin_smithif your content type headers you send to the client are wrong, it will often not display unicode properly
17:36justin_smithI don't know what the repl issue would be
17:37justin_smithis the terminal you run the repl in usually good about displaying this sort of thing?
17:38dnolenbbloom: bitemyapp: bumping memory allowed it to succeed - however it took 164 seconds to compile.
17:38bbloomdnolen: what did you compile with it?
17:38dnolenbbloom: sbt
17:38CaptainLexjustin_smith: Well, it can display it when I type it!
17:38seangrovednolen: The link mentioned it had support for incremental compilation, presumably it should be better after the first time.
17:38bbloom"with it", not "it with"
17:39bbloomoh, you just compiled the compiler?
17:39CaptainLexjustin_smith: echo handles it fine
17:39bbloomlike you didn't even run the compiler let?
17:39justin_smithhmm
17:39dnolenbbloom: no the example app they suggset trying
17:39bbloomoh ok
17:39justin_smithCaptainLex: maybe your jvm is buggy or misconfigured? java is usually pretty good about handling unicode properly
17:40justin_smithand clojure just piggybacks on java for all that stuff
17:40CaptainLexjustin_smith: That was my next thought. Arch has a tendency to require poking around sometimes, but I certainly haven't done anything to the default install
17:40justin_smithI have seen none of these issues on my ubuntu with openjdk or the sun jdk, fwiw
17:40justin_smithexcept when I sent the wrong content type header for a page
17:40dnolenbbloom: that said it does generate a reasonable amount of code for "hello world" that is their example app so they got their deps issues sorted out.
17:41bbloomdnolen: cool, but you can't draw that conclusion from hello world. try using a tree or something :-)
17:41CaptainLexjustin_smith: I'll just ignore it until I deploy to Heroku. If it's still a problem there, I'll file a bug report with the universe :P
17:41dnolenbbloom: heh, yeah :)
17:42justin_smithCaptainLex: lol. If you have the patience for it you could start up a free tier amazon ec2 instance, and verify everything works when you ssh in
17:43justin_smithhttp://instantserver.io/ <- took me about 4 minutes to get a clojure repl on instantserver last I tested it out
17:43justin_smithfree, no account needed, etc.
17:43justin_smithn/m, it is off line
17:44dnolenseangrove: I don't think incremental compilation helps advanced optimizations much - 138s for the second compile
17:44dnolenseangrove: it might also be particular bad on my machine, not sure if I have enough RAM to do this properly
17:45dnolenseangrove: the standard lib is 20mb, so the Closure Compiler has to churn through that
17:46dnolen20mb of generated JS
17:46justin_smithCaptainLex: what does (System/getProperty "file.encoding") return in your repl?
17:47justin_smithit should return "UTF-8"
17:47CaptainLexIt did :(
17:48justin_smithwell that rules out that issue
17:48seangrovednolen: How's that compare to cljs' stdlib?
17:48dnolenseangrove: 700k
17:48seangrovednolen: We need more MB's to catch up, it seems.
17:48seangroveElse how will anyone take cljs seriously?
17:49dnolenseangrove: :)
17:49justin_smithwhat happens when you do (spit "copied-file" (slurp "file-with-unicode")) do the files cmp as the same?
17:49seangroveBut yeah, it seems like the amount of code core.logic + core.async generate is enough to make gclosure struggle... 20MB of stdlib is pretty big.
17:52xeqidnolen: hurray 2 cljs patches in one day
17:52dnolenseangrove: that hasn't been my experience, cold compile of core.async, core.logic tests ~30s, recompiles <4secs
17:53dnolenseangrove: w/ advanced optimizations
17:53xeqiI'll see about submitting the ones needed for austin/piggieback to cemerick in the next couple days
17:53dnolenon my wimpy MacBook Air 4gb of RAM 1.7ghz
17:54dnolenxeqi: great work, CLJS easily has one of the best source map stories out there all of a sudden :)
17:55seangrovexeqi: Looking forward to that
17:56seangrovednolen: Didn't you send out a warning on the ml about using core.async and core.logic together in cljs due to possible compilation problems?
17:57dnolenseangrove: oh you mean core.async & core.match
17:58dnolenseangrove: yes putting complex core.match expressions in core.async is gnarly - core.async should maybe be enhanced to avoid transforming forms that have :not-transform metadata attached
17:58dnolen:no-transform
17:59seangrovednolen: What's the upper-limit on code size for safe compilation?
17:59seangrovePurely academic curiosity, we're nowhere near that.
17:59dnolenseangrove: I'm not aware of anything really
18:00bitemyappseangrove: make a javascript code generator and find out :P
18:00andyfBronsa: ping
18:00seangrovebitemyapp: That'll go under the category of pending side-projects labelled "neither useful nor particularly fun."
18:01bitemyappseangrove: ¯\_(ツ)_/¯
18:01Bronsaandyf: pong
18:02Bronsaandyf: I just saw your comment on TANAL-9, I'm going to check that out
18:02andyfBronsa: Man, you have been awesome at bug fixing. Thanks. I just wanted to let you know I added a comment to TANAL-9 with some additional info on the exception I am seeing.
18:02andyfCool. Thanks. I am probably at the point of not knowing how to set up the env arg to analyze correctly, but my problem could lie elsewhere.
18:03dnolentbaldridge: http://dev.clojure.org/jira/browse/ASYNC-40, something to think about - not sure how hard this would be
18:04tbaldridgednolen: then you could never to a >! or <! inside a match?
18:05dnolentbaldridge: updated the patch to clarify what I want to avoid
18:05dnolentbaldridge: (match [x y ...] ;; <-- async works here)
18:05andyfBronsa: Some good news -- my latest mods to Eastwood allow it to analyze 32 contrib libraries with no errors and no obviously incorrect warnings. There are 7 contrib libraries with errors that I don't know what to do about yet, but I am still investigating those.
18:05dnolentbaldridge: (match [x y] [1 2] ... async works here ...)
18:05danielsz`cemerick: Not AFK yet?
18:06dnolentbaldridge: but (match [x y] [1 2] ;; <-- async leave this alone! ...)
18:06cemerickdanielsz`: only here in spirit
18:06seangrovecemerick: We all appreciate your presence.
18:06danielsz`cemerick: haha.
18:07tbaldridgednolen: let me think about it. my not happen until I integrate tools.analyzer into core.async
18:07dnolentbaldridge: I don't expect that to work in the near term - but I think something like this important for other "serious" macros
18:07danielsz`cemerick: Was going to ask when or how austin will deal with the new sourcemap functionality... But I can't ask a spirit, can I?
18:08dnolentbaldridge: cool to hear you're going to integrate tools.analyzer - I assume will make reasoning about the Clojure code more displined
18:09cemerickdanielsz`: that's xeqi's ball to run. I'll keep an eye out, but no guarantees until mid-December.
18:09Bronsaandyf: ok now I can reproduce, I'll see if it's a tools.analyzer issue or if there's something wrong with your setup and let you know
18:09tbaldridgednolen: that's the plan, it'll take a re-write of about half of ioc_macros, but I plan on doing it sometime "soon"
18:09Bronsaandyf: in the meantime, thanks again for the help, you've been really helpful
18:09andyfBronsa: The sentiments are mutual :)
18:10danielsz`cemerick: Awesome. Austin + sourcemaps, that's going to be so cool.
18:11dnolentbaldridge: I'm assuming using analyzer will also make source maps more sane
18:13coredhi
18:14coredhttp://www.loper-os.org/?p=42 the comments in this have a flame war which let me thinking
18:14coredin a lot of stuffs, like is Clojure selling itself as modern LISP it's seems that to be LISP it should be LISP all the way down, is that correct?
18:14coventryHow's the starcraft clone coming along? Found any assistants?
18:14dnolencored: loper-os is good mostly for laughs
18:16coreddnolen: :-)
18:16coreddnolen: but is because he is telling the truth or what?
18:16dnolencored: there's hardly anything resembling rhyme, reason or computer science discussed therein - just emotional garbage
18:17coreddnolen: I see, he post a lot of links which back up what he is saying
18:18justin_smithcored: citations don't back up hyperbole and vitriol
18:18danielsz`You should regard loper-os as a character. He's fucking brilliant some of the time. Sometimes he doesn't make sense.
18:19danielsz`The Clojure rant is just the expression of an old Lisp smug weenie not wanting to open his mind to new perspectives. Happens all the time.
18:19coredwould like to take as much knowledge from him as I can, but every 6 words is bad things for Clojure
18:20coreddanielsz`: but if you are the one saying that, he can say the same a new Clojure smug weenie -> because he says that Clojure is not a real LISP
18:20danielsz`Forget about this rant. It doesn't make sense.
18:20dnolencored: if you get your opinions about Lisp from like loper-os, not much we can do for you
18:21dnolencored: best to go to the real sources, like LISP BOOKS, and come to your own conclusions
18:22xeqidanielsz`: I'll make some PRs for austin/piggieback this weekend, and will probably publish some forks until cemerick is back
18:22seangroveIt's pretty awesome to see tools.analyzer getting integrated into libraries, seems like an extremely powerful avenue
18:22andyfseangrove: Which libraries is it being integrated into?
18:23coreddnolen: I'm taking it slow, kinda new to the entire thing. But as I'm a follower of Michael Fogus I just found out that blog from him and start to read
18:23coreddnolen: I'm reading functional programming for object oriented programmers
18:23danielsz`xeqi: That is so awesome.
18:23xeqidanielsz`: have them all working locally
18:23tbaldridgecored: I'm much less concerned with if Clojure is a real Lisp, and more concerned with building cool things.
18:23Bronsaandyf: looks like a classloader issue ouch
18:23seangroveandyf: tbaldridge mentioning integrating it into core.async for example
18:23coreddnolen: it's seems that apart from learning about the language I have to make some room to learn about the community and the history behind it
18:23coredtbaldridge: good point
18:24tbaldridgecored: if some awesome feature of Clojure makes it "not a lisp" what to I care?
18:24coredtbaldridge: but what I was concerned about was that if that could make a limitation for it, I think that's what this loper-os guy is talking about
18:24dnolencored: Lisp has an amazing history, I love it. And the books, they are some amazing Lisp books nearly all of them applicable to Clojure in one for or another
18:24tbaldridgecored: for example, the fact that "pure lisps" don't have hash-map literals is a major flaw in lisp, not a feture
18:25justin_smithusing linked lists as if they were an associative data structure is an abomination
18:25andyfBronsa: Not sure I can be of any help there, at least not given my current state of knowledge on the subject.
18:25justin_smithnested linked lists at that
18:26coredoh
18:26coredI found something interesting
18:26coredhttp://abcl.org/
18:26coredisn't this the same idea as Clojure?
18:26danielsz`Nobody in his right mind disputes the fact that Clojure is a Lisp, as much as Lispiness goes.
18:26dnolencored: no, Common Lisp is a very different Lisp dialect
18:27justin_smithcored: no, it wants to actually be common lisp, and so doesn't integrate as nicely with its vm
18:27andyfcored: I know less about abcl than Clojure, but I believe abcl is an attempt to implement Common Lisp using Java as the implementation language. Clojure has significant differences from Common Lisp.
18:27danielsz`Clojure vs ABCL came up recently on the CL G+ group: https://plus.google.com/+DaveTenny/posts/5ekuTDTnTWj
18:32coredneat
18:32coredI have to read so much stuff, quite exciting
18:33seangrovecored: Also good to do stuff at some point.
18:34seangroveGreat way to explore for some of the qualitative aspects of languages and their ecosystems
18:34coredseangrove: I have to build a list of things to do
18:35danielsz` /nickname danielszmulewicz
18:35coredbtw, this catch my attention yesterday (def third (fn [list] (nth list 2))) and (def third (fn [list] (first (rest (rest list)))))
18:35coredthe author of the book ask to build that function mine wsa the first implementation but his solution was the second one
18:36justin_smithcored: (defn third [[_ _ three]] three)
18:36coredhe teached the nth function so I just use it, but it's catch my attention on why he did the solution the way he did it and not use a more clear way
18:36coredjustin_smith: eh?
18:36coredjustin_smith: don't know about that syntax
18:36cored:-(
18:36justin_smith,((df third [[_ _ three]] three) (range))
18:36clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: df in this context, compiling:(NO_SOURCE_PATH:0:0)>
18:36justin_smither
18:36justin_smith,((fn third [[_ _ three]] three) (range))
18:36clojurebot2
18:36seangrovehah
18:37justin_smithcored: destructuring, it matches the structure of the input collection
18:37seangrove,((fn third [[first-thing second-thing third-thing]] [third-thing first-thing second-thing]) (range))
18:37clojurebot[2 0 1]
18:37seangroveMaybe better without the range...
18:38seangrove,((fn third [[first-thing second-thing third-thing]] [third-thing first-thing second-thing]) [:a :b :c])
18:38clojurebot[:c :a :b]
18:38coventryWhat do people think of this use of atoms? Abomination, or just an ugly compromise? https://github.com/coventry/troncle/blob/master/src/troncle/macroshka.clj
18:38justin_smithseangrove: nicely illustrative, though the name third is no longer helpful :)
18:39seangroves/third/destructive power!
18:40justin_smithcored: destructuring can be don in fn (and thus defn) let, loop, doseq, for etc. and is often a good way to reduce verbosity / increase clarity of how you are using the input
18:40justin_smithcored: it can also destructure maps
18:40justin_smith,((fn [{x :a}] (* x x)) {:a 12})
18:40clojurebot144
18:47coredjustin_smith: I'm lost :-(
18:48coredjustin_smith: are you talking on the implementation in particular on why he did what he did in his solution ?
18:48seangrovecored: Don't worry about it, it's a cool feature but nothing you need to worry about
18:48justin_smithcored: the destructuring clause matches the structure of the input
18:48seangrovecored: He was just showing you a cool alternative approach to the implementation of 'third'
18:48coredseangrove: oh ok
18:48coredjustin_smith: got it
18:48coredthanks
18:49coredhave to study it
18:49justin_smithalso, I'd say nth is better in clojure than (first (first (rest x)))
18:49justin_smitherr first rest rest
18:49cored:-)
18:50justin_smithnot that it does something different, but it is clearer
18:50justin_smiththe compiler likely generates the same output from either
18:50coventryjustin_smith: No, it calls a java method.
18:50coventry~nth
18:51clojurebotTitim gan éirí ort.
18:52justin_smithcoventry: even on a list or lazyseq?
18:52seangroveWould be cool if clojurebot could link to the source of clojure/clojurescript functions
18:52coventryseangrove: There is a syntax for that, but I have forgotten it.
18:52justin_smith$source nth
18:52lazybotnth is http://is.gd/hLMyIH
18:53justin_smithin the repl there is (clojure.repl/source foo) also
18:53`cbp,(source nth)
18:53clojurebotSource not found\n
18:54justin_smithin your own repl, the bots don't do it
18:54coventryI suppose the hotspot compiler might end up with similar bytecode after a while.
18:54seangroveNice, now it just needs to know how to keep track of the latest definition and also syntax for the cljs implementation
18:55coventrySeriously, if anyone could take a look at that macroshka macro and tell me a better way to reconstruct the macroexpand-all from recursive macroexpansions, I would be grateful. It's ugly, but I haven't been able to think of a better way.
18:57justin_smithcoventry: I took a quick look, it was hard reading for me though that could be because my brain is momentarily on vacation for all I know. I'll let you know if I fail to find it comprehensible, or find it comprehensible enough to offer meaningful feedback.
18:57seangrovecoventry: it's all over my head as well
19:01coventryThanks for looking, justin_smith, seangrove. The idea is to use a macro which wraps itself around the evaluable components of any form it is passed, so that all macroexpansions are seen during evaluation, and the full macroexpansion can be reconstructed from them. But I couldn't think of a better way for the macro to communicate the macroexpansion components forward to the reconstruction phase without storing them in a tree of atoms.
19:02coventryBasically, it's trying to do the same thing as riddley.walk, but without touching compiler internals.
19:02justin_smithit seems like each branch could be replaced with the expanded version as the form returns - or does this mess up the order of evaluation or something?
19:06coventryHmm, if that worked, things in the leaves would be evaluated many times, in that case, but it would be a lot simpler. And it should all be side-effect-free anyway...
19:06coventryThanks, I'll think about it.
19:06justin_smithyou could use memoization to avoid the leaf re-evaluation, no?
19:07justin_smithor would that break things by preventing intended side effects
19:09coventryThe reason for this recursion is that a macro only gets expanded accurately in its evaluation context. So for each form, you have to make sure that the forms containing it are evaluated. E.g. (defmacro n [t] (println (macroexpand t) (-> 1 inc))) (let [-> (fn [& args] args)] (n (-> 1 inc)))
19:09justin_smithahh right
19:10coventryriddley.walk fixes this by faking the local bindings. I was trying to find a way to do it which cooperates with the compiler instead.
19:19justin_smithregarding the nth conversation above, yeah, nth is actually much faster on vectors (though it may be a toss up for something like getting the third item)
19:43d11wtqAs a TDD/BDD guy coming to clojure, I'm exploring my options for test frameworks. One thing that's important to me is the ability to nest tests, like in RSpec. Is midje basically the best thing out there in that regard? I've just read a blog about a project that moved from midje to clojure.test... are there any strong opinions around the two options out there?
19:48d11wtqOh, clojure.test does nesting too. (testing ...) looks nicer than (deftest ...). The tests just read better and feel more natural to write.
19:48yedi_+1 to d11wtq's question -- oh paralysis of choice
19:52coventryd11wtq: You might look at the logs for this channel. That post was discussed here in the last week or so.
19:52d11wtqcoventry: thanks. Is this channel on irclogger or something?
19:52coventryhttp://clojure-log.n01se.net/
19:53d11wtqcoventry: thanks!
19:54d11wtqLooks like http://clojure-log.n01se.net/date/2013-11-25.html
19:56d11wtqYeah, I agree with the "too much magic" thing. Given clojure.test offers the same nesting, I'll give it a shot.
20:01technomancyd11wtq: you can put calls to c.t./is in any old function
20:01technomancyso the regular tools you use to abstract functions work fine on tests too
20:01technomancyin fact, deftest just creates a function
20:02d11wtqYeah. Simpler is better. Although deftest feels too xUnit-style to me, which I don't like so much.
20:04technomancyyeah, a better way to do it would be (defn ^:test mytest [] ...)
20:04technomancytoo late for that, but the difference is very minor
20:10justin_smithd11wtq: the way I wrote the caribou database backend tests was basically to write a function that runs a db through the hoops, and call it with each database in turn
20:10justin_smiththat way I didn't need to duplicate code excessively, and I did not need to interleave the various backends
20:10justin_smiththe function of course contained various calls to test/is
20:14technomancythe one problem with an c.t/is called from multiple places is the line number becomes less helpful
20:14justin_smithtrue
20:14justin_smiththat's what the testing form is for
20:15technomancyI like to factor out a bunch of predicates and share logic there, keeping the is in the deftest
20:15technomancybut c.t/testing helps too
20:15justin_smithmy actual test is more like (deftest mysql-test (with-db mysql (testing "mysql and creation" (creation-test mysql)) ...))
20:16justin_smiththen all the test/is calls are in creation-test
20:16justin_smithbut I see the value of keeping is in the deftest too, but I opted not to
20:18technomancyI should hook up C-x ` into clojure.test; that would be bangin'
20:18justin_smithhmm, never mind. I misremember or it changed since then - I think patchwork refactored it
20:19justin_smithhttps://github.com/caribou/caribou-core/blob/master/test/caribou/test/model.clj#L907
20:25emaphis /banlist
20:28general-generalI've got a question. How do I alter a clojure.java.io/writer function to accept a url, I'm finding it hard to find an example.. I think I'm supposed to put as-url in there somewhere... not sure where.
20:28general-general?
20:28general-generalI forgot the question mark.
20:29justin_smithcall io/input-stream on the url
20:29justin_smithor are you trying to write to the url?
20:29general-generalYes, trying to write.
20:29justin_smithI think you'll do better to use clj-http.client for that kind of thing
20:30general-generalEssentially trying to do something like post a "like" for a comment on a forum.
20:30justin_smithyeah, with clj-http.client you can just specify the data for the body as a map
20:30general-generalShame, I was hoping I could do it using just 'the core'.
20:30justin_smithand you don't even need to mess with streams
20:30justin_smithyou could
20:30justin_smithit would just be more hassle than it is worth, in my experience
20:31general-generalOK.
20:31general-generalI wonder would the source of clj.http-client tell me.
20:31justin_smithunless you think using streams and sockets and io/copy is fun - in that case go for it, you are sure to learn a lot
20:31justin_smithbut it is not likely to get you the easiest, the most correct, or even the most performant result
20:31justin_smithit could
20:32general-generalThanks Justin.
20:35justin_smithgeneral-general: https://github.com/dakrone/clj-http/blob/master/src/clj_http/core.clj#L199 this looks like the meat of it in http.client
20:35justin_smithmostly using apache libs
20:35justin_smithfor clojure code, that is epic in size
21:33yedi_ugh this fixed header is so fucking huge, why do ppl do this: http://www.nearform.com/nodecrunch/how-node-js-has-revolutionized-the-mailonline#.Upk4JWRDtvZ
21:41yedi155k lines of java to 4k lines of clojure??? that has to be bullshit
21:43dsrx"lines of code" isn't the best metric of code complexity or even length
21:44Raynesyedi: Well, if it was crappy Java and good Clojure...
21:44RaynesBut I feel like they left something out.
21:44RaynesLike the 100k lines of mustache templates that they included in that count or something :P
21:44dsrxalso w/ judicious use of macros you can end up with insanely tight java->clojure replacement
21:44dsrxprobably
21:45Raynesyedi: More importantly, I bet they could replace those 4k lines of Clojure with 4 lines of J.
21:45Raynes:P
21:46bitemyappyedi: I don't think it's bullshit, I've seen some ridiculous Java codebases.
21:46bitemyappit's definitely an uncommon/extreme case, and there was probably a second system effect involved where they were able to cut away cruft, but it's still possible.
21:48coventryI think this micro-services architecture idea is interesting and slightly scary. (Dozens or hundreds of little servers, each just a few hundred LOC, all talking amongst themselves.) Anyone have experience with something like that?
21:49coventryIt's mentioned in the article just before the "Journey to Node" section.
21:49scottj"155k lines of Java rewritten in 4k lines of Java" 10 day ago 0 points
21:52coventryHmm "...about 4000 lines of Clojure (accompanied by a large number of Moustache templates shared by Node)." I wonder if that's where the java bloat was.
21:53bitemyappcoventry: I've worked on SOA and micro-SOA deployments.
21:53bitemyappcoventry: they're as much about formalizing inter-dependence into contracts/APIs as anything else. I like them because they make your services language-independent, enabling teams to use the tools they actually like.
21:55bitemyappSOA gives the use of things like Clojure a huge leg-up because then your components are reusable APIs instead of java libraries that have to be language native across a variety of services.
21:55bitemyappcan make scaling easier to pull off when there's an abstraction layer between provider and consumer too
21:56coventrybitemyapp: How many services? Were you releasing multiple versions of the same API simultaneously, as Fred George recommends? Were interactions between servers any harder to debug than systems with fewer, larger components?
21:57bitemyappcoventry: depends on which company, but in one case it was like 5-6 main services and a group of smaller ones. Multiple versions of the API simultaneously, yes.
21:57yediRaynes: i guess the joke is that J does fucking _everything_ ?
21:57Raynesyedi: The joke is that J is an extremely compressed language.
21:57bitemyappcoventry: harder to debug depends on how you think about it. If you do it amateur-hour style and have to manually pull in logs from multiple services, that sucks, but it's supposed to incentivize you to setup centralized logging, search, and analytics (as a service)
21:57Raynesyedi: You can write bitemyapp's personality in two lines of j.
21:58bitemyappcoventry: I found that I preferred searching and grouping log messages in a centralized interface to grepping (or just plain trying to find) log files on naive deployments
21:58coventrybitemyapp: Cool. What tools did you use to aggregate the logs?
21:58bitemyappcoventry: elasticsearch and a custom dashboard.
21:59bitemyappcoventry: servers creating log events emitted JSON that could be filtered by server name, service name, timestamps, etc.
21:59bitemyappthey emitted JSON to haproxy fronting the ES nodes.
22:00coventrybitemyapp: Thanks.
22:01bitemyappcoventry: part of the impetus towards this SOA-esque setup was to move away from the really *really* bad default target for most companies where you have a bunch of backend and frontend services independently mutating a MySQL/PostgreSQL database.
22:01yediahh i love this channel
22:01bitemyappcoventry: it's easier to debug SOA log messages than it is to play "whodunnit" with a global mutable data store.
22:03coventrybitemyapp: How does SOA mitigate the problems of having a centralized DB?
22:04bitemyappcoventry: independent data stores, single responsibility infrastructure, easier to know why/how something happened or cahnged.
22:04bitemyappcoventry: it's infrastructural decomplection.
22:05bitemyappI'm slowly getting my company to do the same thing with their various Python/MySQL/MongoDB/PostgreSQL things running around. Luckily they're a sharp bunch and knew to make things accessible via API rather than database mutation, so they're half-way there.
22:07coventrybitemyapp: Oh, "API rather than database mutation" makes it clear. Thanks.
22:07bitemyappcoventry: this is important because as you scale, you can start to enforce/provide guarantees at the API level, like, "this operation is idempotent...this operation is commutative" etc etc
22:07bitemyappthese constraints/guarantees are necessary for sanity, hygiene, and scaling.
22:08bitemyappunless you *enjoy* being in a systems-level tarpit >:)
22:09coventryYeah, sounds like a huge win.
22:09bitemyappcoventry: it can be, you still need to write good documentation so your coworkers don't get pissed.
22:11coventrybitemyapp: Right, well in the organizational structure George is talking about, I guess you make your service useable or it doesn't get used and you get voted off the island.
22:11bitemyappcoventry: yeah, which is appropriate.
22:11bitemyappcoventry: that's another reason I like SOA, technologies/infrastructure move forward on a more evolutionary and somewhat less legacy-oriented basis.
22:12francis_wolkeThere is a paper (co?)authored by Oleg Kiselyov on creating a miniKanren logic programming system in haskell that didn't work out as well as the implementation in scheme. I'm not sure of the name or where look. His site didn't help me out at all. Could someone give me a hint here? Right now I'm looking at his papers one by one. :/
22:13bitemyappfrancis_wolke: narrowing down Oleg papers is an NP hard problem.
22:13bitemyappOleg is the bane of Comp sci graduate students everywhere. "Oleg already did it."
22:14coventryOne link: http://scholar.google.com/scholar?q=author%3AOleg-Kiselyov+minikanren+haskell&amp;btnG=&amp;hl=en&amp;as_sdt=0%2C33
22:17gfredericks hunter3
22:19bitemyappgfredericks: hunter2
22:21gfredericksoh right that was it
22:47technomancyoleg uses eshell
23:01francis_wolketechnomancy: yay?
23:02beppuHow do you guys debug your clojure code?
23:02beppuTake something like this for example: https://gist.github.com/beppu/7715205
23:08`cbpyou can use something like http://clojurewiki.com/Tracing or printlns :)
23:08`cbpwith anonymous fns you can try giving them names as if you have an error in one of them it will tell you which one
23:11beppu`cbp During the ->>, how would I println an intermediate value?
23:11beppu(based on the gist I posted earlier)
23:12`cbpdefine a function that prints a value and then returns a value
23:12`cbpthen just plug it in
23:12beppuok
23:12xeqi&(->> :x (#(doto % println)))
23:12lazybot⇒ :x :x
23:12`cbpthat returns the same value
23:13`cbp*
23:13clojurebot* is just for when you are lazy and sloppy
23:13`cbpclojurebot: botsmack
23:13clojurebotclojurebot evades successfully!
23:13`cbp:(
23:13beppudoto is new to me
23:14coventryHey, bitemyapp, thanks for the mention of troncle on the wiki. :-)
23:14bepputhat's a cool idiom. thanks `cbp and xeqi .
23:14bitemyappcoventry: thanks for making useful things.
23:14`cbpits for java interop mostly thats a weird ass use of it
23:15bitemyappcoventry: you can return the favor by writing stuff on the wiki :)
23:16coventryI'll keep an eye out for places where I can contribute.
23:16xeqibeppu, `cbp : true, I think debug output like this is the only non interop object mutating code I use it for
23:16bitemyappcoventry: libraries needs letters below "D" ported over.
23:17bitemyappboring work but needs done.
23:17bitemyappakurilin: I can't wait for the new Alcest album.
23:18bitemyappGonna buy it so I can use the CD in my car.
23:18coventrybitemyapp: yeah, that calls for a script.
23:18bitemyappcoventry: Ordinarily I agree but I'm curating stuff that should be elided or added in the course of the transfer.
23:21bitemyappI'm not going to stop anybody that adds stuff back in, but when they do, I'll probably comment on it.
23:21bitemyappwhich is something I've already done.
23:21bitemyappI'd rather trend in the direction of more information rather than less.
23:22bitemyappbut the elisions are tended to spare me explaining that something is old or not very good.
23:22bitemyappnot that that's necessarily why somebody's library isn't in there yet.
23:37coventrybitemyapp: It's just a dumb transformation, but it might save you a little work: https://www.refheap.com/21363
23:38bitemyappcoventry: thank you very much
23:39coventryIt was easy: https://www.refheap.com/21364
23:46bitemyappcoventry: http://clojurewiki.com/Libraries ding a ling.
23:46bitemyappyou used Python? you're a terrible person :P
23:47coventryBeautifulSoup is the Right Tool for that job. :-)
23:47bitemyappcoventry: true, just found it amusing :)
23:48francis_wolkednolen: While working at the the cljs-repl the representation of the eval'd data structures gets printed - even when using `def'. When working with large amounts of data, this can cause slowdowns in the development experience (Emacs freezes). What is the intended end-game function of the cljs-repl? EG: is printing defs and the js representations of function defnitions desirable? What are the tradeoffs involved?