#clojure logs

2013-08-25

00:01bjaI sorta think the correct thing to do is to implement an sldb-style debugger on top of fireplace
00:02bjabasically, expose the remaining middleware that fireplace doesn't handle automatically
00:16ToBeReplacedanyone know if there's a way to warn on cache misses with core.memoize/core.cache?
00:24amalloyToBeReplaced: implement the cache protocol by wrapping an existing cache and issuing a warning?
00:31ToBeReplacedamalloy: yep, cheers
01:33callenIf I wanted to monkeypatch a defn from another library (not my own), do I have any alternatives to alter-var-root?
01:33callenwith-redefs isn't acceptable.
01:43ToBeReplacedcallen: i don't know of other options, not that they don't exist
02:19kab3wmI'm having an issue trying to insert some rows containing int array (postgresql) types using clojure.jdbc. It complains about being unable to infer the SQL type. Here's a snippet of the code & schema if you care to look - http://pastebin.com/zGF5th8u
02:25ivankab3wm: total guess, try (int-array [1 2 3])
02:25callendevn: getclojure is broken again.
02:27SegFaultAXkab3wm: The error is pretty explicit about what you need to do. The driver doesn't what db type PersistentVector maps to.
02:28SegFaultAX(Arrays are an extension of the standard so it isn't surprising that this wasn't accounted for in Clojure's JDBC wrapper)
02:28SegFaultAXpg specific extension, that is.
02:35kab3wmSegFaultAX: Ok, I'm pretty sure I understand what you said, however being new to clojure I'm not clear on whether this is something I can work around with some other syntax, or if it's just not possible without changes to clojure.jdbc?
02:36SegFaultAXkab3wm: I don't know enough about the implementation of clojure.jdbc to know how to fix it in that context. But the error you're receiving is clear enough (it has nothing to do with Clojure per se)
02:40kab3wmSegFaultAX: Ok. I will keep playing.. maybe I can do (.setObject int-array) or something. Thank you for your help.
02:57akurilinIs it safe to assume that if I want to connect to a running ring application in an uberjar then I need to explicitly have it run a nrepl server?
02:57akurilinAs in, that's not turned on by default?
02:58SegFaultAXakurilin: Let's hope that it isn't turned on by default. ;)
02:59SegFaultAXakurilin: Check out cemerick's drawbridge. It's pretty neat.
03:01akurilinSegFaultAX, that's cool, thank you. Think I'll start with boring old ssh + local repl, but that's an interesting option once I have time to secure it properly
03:03SegFaultAXakurilin: There are certainly more robust solutions for running an nrepl server inside a production app. The novelty of drawbridge is that it's tunneled over HTTP.
03:06akurilinSegFaultAX, that's fair
03:06akurilinthank you
03:06akurilinbbl
06:44noncomdissipate: hi, r u here?
06:49instilledmuhoo: if you're setting up things from scratch maybe you want to give this a shot: https://github.com/instilled/clojure-bee
06:50instilledmuhoo: I do not claim that it works or that it is complete but it provides quite a few things for clojure development out of the box.
06:51instilledmuhoo: I use it with evil-mode as well
06:52instilledmiql: sorry that was intended for you
06:55noncomwhy on clojuredocs the latest clojure version is 1.3.0 and such things as (add-watch) are marked as "Alpha - subject to change" ?
06:56noncomwhat is the recommended source of reference for clojure, in spirit on clojuredocs but the most recent?
06:56noncoms/on clojuredocs/of clojuredocs
06:58glosolinoncom: Community driven docs, probably not updated that often
07:02andyfingerhutnoncom: I have read that the creators of that site (currently deployed version developed using Ruby on Rails) are planning to, or in the process of, rewriting the server in Clojure. I'm not sure how far that might be.
07:09noncomi see.. looks like them having hard times... long i didn't see changes...
07:10noncomhowever, i am looking at clojure atlas http://www.clojureatlas.com/ did anyone try it yet?
07:11noncomlooks like very interesting, i think i will reside to it..
07:13noncomoh, it is for clojure v 1.4.x yet...
07:13andyfingerhutnoncom: Clojure 1.4 and 1.5 are not terribly different.
07:14andyfingerhutEven most of the stuff on ClojureDocs.org site is still useful.
07:14noncomyeah, that is true, and that could make for a good reason to update it to 1.5 :)
07:15noncomthough, i understand what you mean :) i've been using clojuredocs for the whole while of my clojuric life and it was enough in 98% of the cases
07:15noncomand them are for 1.3.0
07:16andyfingerhutThey may update it some day, but it is difficult to predict if or when.
07:16noncomits like (agent) itself :D
07:40noncomis there a way to reset an agent, just like an atom?
07:40noncomi want to send something to the agent, without caring for its current sate
07:41noncomi.e. i do not want to make the function to consider the current agents status in its args
08:43jaleycan anyone tell what I'm doing wrong? does .. not work the same in CLJS? (.. event -toElement -innerText) doesn't seem to return what I expect?
08:46coventrynoncom: Does (send target-agent (constantly desired-new-val)) not DWYW?
08:48jaley(scratch that, yes it does, I'm just blind)
08:59noncomjaley: weehee! thanks!
09:00coventryI can see abstractly that clojure must forbid recur in a try/catch/finally because it's messing with the stack, but I'm having trouble imagining an explicit example where it's a problem. Anybody got one?
09:00jaleynoncom: did i do something? :s
09:01coventryI think he meant me, in which case, np.
09:01noncomomg sorry
09:01noncomsure, conventry, it was you! :)
09:01coventryDon't sweat it. :-)
09:04jtoyanyone know of a library that has time functions to do : " X days ago" ?
09:15noncomjtoy: ummm not sure what you mean.. clj-time i think has it
09:32glosolihello folk
09:32m4dm4nanybody here that know reverse engineering?
09:32OkasuHello boyo.
09:34noncomfor them are told being a drawman
09:45jtoynoncom :( oops, I just wrote one
09:45jtoyI mean change a timestamp to 4 days ago, 2 hours ago, 1 month ago,etc
09:46noncomjtoy: yep, afaik clj-time does that
10:00clj_newb_2345anyone here coding with emacs live?
10:00clj_newb_2345it seems ridiciously powerful, but also ridiciously undocumented
10:01glosoliI know Emacs, but what's Emacs Live
10:01noncomi tried enacs live, looks fine. it has its docs on its page no?
10:02noncomemacs live is that ide for overtone
10:02glosolinoncom: it's fully dcoumented
10:02glosolidocumented"
10:02glosolihttp://overtone.github.io/emacs-live/documentation.html
10:02kmicuclj_newb_2345: It's self documented, what's the problem?
10:02noncomyeah, i found it pretty-docced
10:02clj_newb_2345i'm also new top emacs
10:02noncoms/-/
10:02clj_newb_2345what is self documented?
10:02glosoliEmacs Live is something like some already configured for you, so you would not need to care about how it works ?
10:03kmicuYes.
10:03kmicuhttp://overtone.github.io/emacs-live/doc-shortcuts.html
10:04kmicu"If you’re new to Emacs, it’s worth taking the time to read the tutorial."
10:05kmicuclj_newb_2345: http://www.youtube.com/playlist?list=PLxj9UAX4Em-IiOfvF2Qs742LxEK4owSkr
10:05clj_newb_2345kmicu; nice, thanks
10:06kmicuIf you want fast start with clojure and emacs, then emacs-live is pretty well documented.
10:07glosolikmicu: Yeah it took me like week to do it on my own and I am still learning something every day
10:08clj_newb_2345http://overtone.github.io/emacs-live/doc-clojure-interactive-editing.html pressing "C-x C-z" froze my emacs. I'm running Emacs as a gui window, not inside of a terminal window
10:08clj_newb_2345hitting C-g doesn't cancel anything
10:09kmicuCtrl key + g always cancel anything :)
10:10glosoliclj_newb_2345: What makes you think it does not cancel anything ?
10:11noncomi have a clojure program that, according to the profiler, generates loads of char[] (over 60% of total generation), is that typical for clojure?
10:12clj_newb_2345glosoli noting is happening
10:12clj_newb_2345the bottom of my buffer continues to say "C-c C-z"
10:12clj_newb_2345it's as if the emcas session has hanged
10:13glosoliclj_newb_2345: Hm what kind of Emacs are you using and which platform ?
10:13clj_newb_2345ubuntu 13.04; emacs 24 + emacs live from emacs live github
10:13glosoliclj_newb_2345: how much CPU does it use while "hanged" ?
10:14clj_newb_2345actually
10:14clj_newb_2345C-x C-z is bound to "suspent frame"
10:14clj_newb_2345which is probably why it looks "suspended"
10:14glosoliyeah lol
10:14clj_newb_2345I'm an idiot
10:14clj_newb_2345sorry about that
10:15glosoliclj_newb_2345: For me it does not suspend , or probably it does, but also hides it in the tray lol
10:15clj_newb_2345what it he inverse of "suspend frame"?
10:16glosoliclj_newb_2345: for me it's just opening Emacs windows from it's application tray heh ,
10:17clj_newb_2345i'm running xmonad
10:17glosoligood luck then
10:18kmicuclj_newb_2345: I'm also running xmonad, simply switch to other window.
10:19clj_newb_2345actually, I just ent and and disabled suspend-frame
10:19clj_newb_2345and rebound \C-x\C-z to nil
10:20kmicuIf you do not use emacs in terminal it is a good way to go :)
10:22coventryEven in a terminal I find it's handy to use C-z as the screen/tmux binding, because with the default settings I hit C-z by accident way more than I mean to.
10:24clj_newb_2345https://github.com/clojure-emacs/nrepl.el <-- why are teh prefixes for evaluation so damn inconsistent? :-)
10:26kmicuLegacy reason.
10:27clj_newb_2345so basically a bunch of other progs took a bunch of bindings
10:27clj_newb_2345and peiople's fiiingers are used to those bindings
10:27clj_newb_2345thus forcing emacs live to take otehr bindins, whatever is free?
10:28kmicuemacs-live has the same bindings like nrepl.el
10:28kmicuYou can rebind them, it's not worth any discussion ;)
10:34clj_newb_2345whoa
10:35clj_newb_2345I can create separate emacs frames, and have them be in the same session, so they can take different parts of my xmonad setup
10:35clj_newb_2345this is insane
10:35kmicuframes or windows?
10:36kmicuAh, two frames in one window, with the same xmonad.hs
10:37kmicuyes, frames and buffers are independent
10:37kmicuYou can even C-M-[ and C-M-] to move content of other frame
10:38kmicuwithout leaving current frame
10:40kmicuYou can do whatever you want with emacs :)
10:52coventrykmicu: are those xmonad or emacs keybindings? C-M-[ becomes M-ESC for me, and C-M-] is undefined in my emacs.
10:55kmicu Yes.
10:56kmicuBinding is defined in emacs-live, but you should have scroll-other-window-down from window.el
10:56coventryOh, an emacs-live binding. Thanks.
10:57coventryHuh, I didn't know scroll-other-window-down worked across frames like that, because I always have at least two windows per frame. :-)
10:57kmicuhttps://github.com/overtone/emacs-live/blob/master/packs/live/bindings-pack/config/default-bindings.el#L158
11:01coventryWow, lots of cool stuff in there. Definitely going on the distractions list.
11:03kmicuYes, two windows per frame.
12:29seangrov`kmicu: What command is C-M-[ bound to for you, scroll-other-window-down?
12:36coventryseangrov`: It's in the github URL he sent.
12:37coventryWhat's a good tool for parsing a string of clojure code and keeping track of the position of its sexps in the original string?
12:49coventryLooks like tools.reader is the place to start.
13:16gfredericksis it weird that there aren't any visible clojure libs for complex numbers? is there any reason I shouldn't try to make one?
13:17bbloomgfredericks: numerics are hard? :-)
13:17gfredericksbbloom: no specifics in that vein?
13:18bbloomwell shit. my irc client crashed. wutcha say?
13:19gfredericksbbloom: "no specifics in that vein?"
13:19bbloomgfredericks: well, generic dispatch isn't free & jvm doen't have user-defined non-reference types, so perf is basically always terrible for numeric code that doesn't unroll everything to array hackery
13:20gfredericksbbloom: shouldn't have to be generic though
13:20bbloomyeah, you can write a complex math library that gives you the basics, but it's much harder to play nice w/ all the other number types
13:20gfredericksbbloom: are you suggesting a two-element array is faster than a deftype?
13:21bbloomno, i'm suggesting a large array of N*2 elements is faster than a deftype :-)
13:21bbloomor rather an array of deftypes
13:21bbloomnot to discourage you from building such a library. it would be useful to have
13:21gfredericksbbloom: I know genericity is hard, but I'd think special-purpose functions would be useful regardless
13:22bbloomgfredericks: i won't argue with that
13:22gfredericksI'm not sure if there is hairiness around exactness though
13:23TEttingerhttp://stackoverflow.com/questions/11824815/fast-complex-number-arithmetic-in-clojure someone's already trying some kind of complex number thing in clojure
13:23gfredericksTEttinger: oh I've done it before too; it's writing a well-designed library that I'm pondering
13:24gfrederickshttps://github.com/fredericksgary/qubits/blob/master/src/com/gfredericks/qubits/complex.clj
13:26TEttinger=ish is a great idea
13:27gfredericksTEttinger: that's how you know you're working with doubles :)
13:27dnolenbbloom: gfredericks: it seems like there are really good ideas about doing efficient symmetric multimethods on the JVM in the Fortress literature
13:28TEttingeris fortress still around?
13:28bbloomdnolen: fortress was on the jvm?
13:29dnolengfredericks: haven't had time to dig into it, but this looks cool "Implementing Fully Modular, Statically Typed, Symmetric Multimethod Dispatch"
13:29dnolenbbloom: yes
13:29dnolenTEttinger: no
13:29bbloomhuh. didn't realize that
13:30gfredericksdnolen: I think I might read this whole thing just to see what happens.
13:32TEttingerX10 is also on the JVM, is in the same niche, and has much more accessible syntax to Java programmers I would think. no unicode fanciness.
13:32dnolen"moreover, delegating dynamic dispatch on arguments other than the receiver object to the runtime allows greater opportunity for dynamic code optimization (an area that deserves further exploration)"
13:32dnolenhttps://blogs.oracle.com/projectfortress/entry/fortress_wrapping_up
13:35gfredericksat the moment I'm more interested in having anything at all, and I think I also want exact complex numbers
13:36glosolihmm how does one set to make nREPL Stack trace error appear in background buffer instead of popping out in any of the open buffers ?
13:38TEttingergfredericks, (sqrt -2)
13:38bbloomgfredericks: if you want exact math, you really have no other choice but to go symbolic
13:39TEttingerbbloom, so (sqrt -2) would eval to '(sqrt -2) ?
13:40TEttingerI can see that being handy
13:40bbloomTEttinger: or (complex (sqrt 2) 1)
13:40tomjack"go symbolic" = "don't eval" ?
13:41dnolenbbloom: ok I'm starting grok the ANF stuff, in your version how come you're passing around an explicit continuation parameter k like in Matt Might's Racket source?
13:41dnolenbbloom: I mean why are you *not* passing around k
13:41TEttingerclojure has continuations?
13:41bbloomtomjack: or just eval differently :-P
13:41bbloomdnolen: 1 sec, let me reboot my brain on the implementations
13:41dnolenbbloom: I see now that the let merging is not that important, ANF does the proper thing for what I want to fix
13:43bbloomdnolen: ok, now i recall this…. soooo
13:43gfredericksTEttinger: bbloom: I'm 96% sure I have a decent application of exact complex numbers that won't use any of the inexact functions
13:43bbloombasically, matt might's implementation is written in continuation passing style b/c that achieves a more complete normalization
13:44bbloomin my case, i only needed a few very specific places normalized & didn't need the more general approach
13:45bbloomactually, i'm not 100% convinced the continuation passing style helps for ANF, but it helps much more generally. it's a way you can achieve generic traversals
13:45gfredericksbbloom: ironically that application is an representation of algebraic numbers; so if that works then (sqrt -2) doesn't have to be symbolic :)
13:45gfredericks"an exact representation"*
13:47bbloomdnolen: you'll notice that they call "k" wherever i call "anf" for recursive cases
13:49dnolenbbloom: ok, so by not using continuation passing style I don't see how you can unnest lets the way Matt Might's code does.
13:49dnolencontinuation passing style allows you rewrite the code inside out
13:50bbloomdnolen: https://github.com/scala/scala/blob/master/src/continuations/plugin/scala/tools/selectivecps/SelectiveANFTransform.scala
13:51bbloomthat's the a scala ANF i was mimicking
13:54dnolenbbloom: ok, though I don't yet see how that addresses my point
13:55dnolenbbloom: or maybe you're saying you only did enough for CPS transform, not full normalization?
13:55bbloomdnolen: yeah, i didn't do a full/robust ANF, just enough for the next transformation i wanted to do: the selective CPS transform (which i never finished)
13:55gfredericksdnolen: I have already learned a thing from this paper
13:57SegFaultAXgfredericks: Which paper are you reading?
13:57gfredericksSegFaultAX: Implementing Fully Modular, Statically Typed,
13:57gfredericksSymmetric Multimethod Dispatch
13:57gfredericksadmittedly the thing I learned is about java :)
13:58SegFaultAXgfredericks: Have a link?
13:59gfredericksSegFaultAX: no I don't because google won't give me an unobfuscated link
13:59sinistersnarehttp://www.cs.ucla.edu/~todd/research/iandc.pdf this?
13:59bbloomdnolen: you'll see in my code that the anf-application function calls (map anf* args) in it
13:59bbloomdnolen: that's the recurisve/fixed-point step that emulates the continuations
13:59gfrederickssinistersnare: that looks pretty different
13:59sinistersnareoh sorry
13:59sinistersnare:p
14:00coventrybbloom, dnolen: where are you planning to use this?
14:00bbloomdnolen: see also "expansion passing style"
14:00dnolencoventry: ClojureScript
14:01bbloomcoventry: i was just experimenting about a year ago, but now we have reason to believe an ANF transform before generating javascript from the cljs compiler will yield better performance b/c of fewer function closures of the form (function() {})()
14:01dnolenbbloom: yeah I can see how your version works, one giant set of let bindings :)
14:01coventrybbloom, dnolen: thanks.
14:03bbloomdnolen: what you're not seeing here is that this ANF transform i wrote is about 100X simpler than it was before i force fed you a few cljs patches :-)
14:03dnolenbbloom: heh I remember
14:04bbloomdnolen: i'd like to, if at all possible, accomplish this transform w/o gensym
14:04bbloomdnolen: or at least w/ a repeatable symbol source, so that re-analysis & re-transform is stable
14:47fbernierWhat is the best way to have command line arguments persist across other namespaces in clojure ?
14:48hyPiRionfbernier: The simplest way is to pass the arguments to the functions. The easier way is to bind them to a dynamic var.
14:50fbernierhyPiRion: passing as arguments seems weird in my case ... I'd need an argument used in the "handler" and "converter" namespaces
14:50fbernierhttps://github.com/fbernier/taz-clj/tree/master/src/taz_clj
14:51fberniercommand line arguments
14:54gfredericksoh man; there's a weird kind of mutual dependency between clojure.core and the namespaces it uses
14:55callenI learned about a nifty way to handle "configuration" with protocols the other day via Cheshire's source code.
14:55gfrederickscallen: howzat?
14:56callengfredericks: well adding to the protocol is just extension, but for removal, you alter-var-root the protocol and filter out the removed impl.
14:56bbloomgfredericks: bootstrapping a core library is tricky/circular :-)
14:56callengfredericks: I was curious as to how they did it, because people complained about some use of global atoms (I also use closures sometimes) for configuration but didn't really proffer any alternatives.
14:57gfrederickscallen: configuration of libs or apps?
14:57callenso the subject is rattling around my brain. Just trying to find better ways.
14:57callengfredericks: gods, libs.
14:57callengfredericks: totally unnecessary in an app.
14:57callenI'm not a total philistine, give me a little credit.
14:58gfrederickscallen: I don't quite understand the issues yet; I'm trying to learn, not criticize
14:58callengfredericks: ah, gotcha. I thought you might know of something I didn't.
14:58callenbut that's basically the bag of tricks I've so far, atoms, closures, and alter-var-root'ing a damned protocol var.
14:58gfrederickscallen: so the main trouble is you want the library to be able to be used in multiple ways/configurations, no?
14:58callenand the latter only applies...if it's a protocol.
14:59callengfredericks: yeah but I have a nifty pattern for that in Bulwark. handles closed over config *and* global atom.
14:59callenneeds both, in fact.
14:59gfredericksI have this issue with cheshire because I want to be able to use it from another library, without affecting any global config
14:59callenyes, I know I could've destructured it. Fix it later. https://github.com/bitemyapp/bulwark/blob/master/src/bulwark/core.clj#L83-L85
15:01gfrederickscallen: okay I see what you mean; that style wouldn't easily apply to cheshire would it? unless you have parser-constructors etc.
15:01callengfredericks: I wasn't trying to address your problem, just talking about the generality. I could give some thought as to how to make global protocols modular thoguh.
15:01callenthough*
15:02callengfredericks: are you trying to use cheshire in two different ways or something? is having an extra protocol going to break something?
15:02gfrederickscallen: I want to use it from a logging lib
15:02gfredericksand I need to support custom types from there
15:02callenoh I see, without affecting a potential user.
15:02gfredericksexactly
15:03gfredericksI think I "solved" it by doing my own type conversion before calling cheshire
15:03gfrederickswhich required an ugly enumeration of all the types cheshire defaultly supports
15:03callenI'd say the concern is premature for now, given my druthers, but the most straightforward way to avoid affecting your user is to have specialized types.
15:03callen...right.
15:03callenthat being in mind, a "with-protocol" function might be in order.
15:04gfrederickswell the idea is to be able to log arbitrary data; so I don't control what types come in
15:04callengfredericks: you're writing your own logging lib?
15:04gfrederickscallen: I wrote a wrapper for tools.logging that uses data instead of strings
15:04callenI could think of a few uses for that.
15:04gfredericksyeah it's been super nice
15:04callenI am about to work on a logging micro-lib thing.
15:05gfredericksthe cool part is having a dynamic var *data* that has default data to be merged in
15:05callengfredericks: if I wanted to hook into jdbc and log the queries and time-to-execute of everything that hits the execute! fn, I'm looking at using alter-var-root to wrap it, aren't I?
15:05gfredericksso you can alter-var-root it with your git sha and env
15:05gfrederickscallen: sounds right
15:05callenokay, so I wasn't off the mark.
15:06gfrederickscallen: I think an AOP lib for adding logging to vars could be really nice, but haven't settled on a comprehensive design
15:06callengfredericks: I still haven't figured out precisely what sort of breakage scenario you're worried about, but I'll give some thought to a with-protocol sort of thing for Cheshire or in general.
15:06fbernierIn the "run-server" function call here, why is a reader-macro used? http://http-kit.org/server.html#routing
15:06smnirvenanybody out there have some experience using amazonica dynamodbv2?
15:06callengfredericks: most universal way would be to figure out a way to decorate the IFn behavior, no?
15:07dnolenbbloom: re: ANF gensym, do you mean the names that need to be introduced by ANF?
15:07gfrederickscallen: having trouble seeing what you mean by that
15:07callensmnirven: is this a Clojure question?
15:07bbloomdnolen: yeah. right now i just do something like (gensym "__anf")
15:07callengfredericks: Dreaming of evil, don't sweat it. The more useful thought is "with-protocol"
15:08gfrederickscallen: I don't understand that one either :P
15:08gfrederickscallen: temporary protocol extensions?
15:08callenshadow the protocol?
15:08callenyeah.
15:08callenfor the block of scope.
15:08dnolenbbloom: do you have any ideas how to avoid that?
15:08bbloomdnolen: but ideally, the names would be labeled consistently. i *think* that just numbering arguments 0,1,2 etc with some fixed strategy is sufficient. you'll get shadowing, but the next stage will unique-ify the names
15:08gfrederickscallen: that couldn't be thread-local though could it?
15:08dnolenbbloom: yes you're only worried about capture
15:09bbloomdnolen: i think b/c the names are only used once… and *immediately* you can just (for [i (range (count args))] (symbol (str "arg i)))
15:09dnolenbbloom: since our compilation unit is a function, I don't think this is a problem in practice.
15:09callengfredericks: my intent is for block locality.
15:09dnolenanf__0 and counting up compilation unit
15:09gfrederickscallen: i.e. you don't care if it's not thread-local?
15:09bbloomdnolen: yeah, so to avoid (unintentional) capture just use something like (str "anf$" i)
15:09dnolen"up per"
15:10callengfredericks: I try to avoid thread local stuff when I can, but I don't have any strong opinions there. Semantically the thread-ness shouldn't matter if it's block scoped only.
15:10gfrederickscallen: oh so it's a lexical thing?
15:10callenthat's the hope.
15:10gfrederickscallen: how is that different from merely let?
15:10bbloomdnolen: i don't think it even needs to be per compilation unit, since the names are always used right after they are declared. you can just do it per every ANF usage as long as any recursive ANF transforms happen in a nested let where the names will go out of scope
15:10callengfredericks: if let works for your problem, why didn't you do that?
15:10gfrederickscallen: this has nothing to do with the var holding the protocol?
15:10bbloom(let [arg0 (let [arg0 x] (f arg0))] (g arg0))
15:10callenit could if desired.
15:11gfrederickscallen: I don't think let works for my problem, I'm still trying to understand what you're proposing
15:11bbloomdnolen: gensym was just the quickest route to avoiding thinking about that :-) but gensym introduces non-determinism effects in to an otherwise pure compiler pass
15:12callengfredericks: I'm being a CL hippie again. I wouldn't sweat it for now. I have to run some errands anyway, I'll be back 'round.
15:12gfrederickscallen: I can't tell if you're talking about temporarily modifying an existing protocol, or generating a temporary protocol, or something else
15:12gfrederickscallen: have fun
15:12callengenerating a temporary protocol that is lexically scoped
15:30coventryHow can I arrange for a utility function to always be present in the namespace of a repl started with lein?
15:30dnolenbbloom: have you seen this http://research.microsoft.com/en-us/um/people/akenn/sml/CompilingWithContinuationsContinued.pdf?
15:31bbloomdnolen: yes, but i don't think it's worth the cost to us to go full CPS in out compiler since our output is javascript & not machine code
15:31dnolenbbloom: agreed was just curious
15:32bbloomdnolen: sure, there are plenty of cool optimizations enabled by full CPS compiler techniques, but step 1 is just getting the current passes disentangled
15:32coventry(I keep putting (println (apply str (repeatedly 72 (constantly "*")))) to separate the outputs from repeatedly recompiling the current buffer with C-c C-k. It would be nice to have this function in one place, or if there is a better workflow that would be good to know, too.)
15:32bbloomdnolen: also, there is good evidence that delimited continuations can be used to enable the cps-style optimizations to be accomplished in direct-style
15:33dnolenbbloom: interesting, references?
15:33dnolenbbloom: yeah, I think disentangling the compiler is going to have to be done piecemeal.
15:33bbloomdnolen: i can find at least 2 for you, one moment. it's pretty recent research & i'll give you a 10 second brain dump on how this would make sense
15:33bbloomdnolen: http://okmij.org/ftp/meta-programming/index.html#bti
15:34bbloomso basically that's a really simple demonstration of how binding-time analysis gets better in CPS
15:34bbloomdnolen: but oleg mentions Bondorf in the references, who's paper explains how to get that improvement by writing the *specializer* in CPS instead of the original program in CPS
15:34benkayi just renamed my nrepl.el buffer - how do I tell emacs that it should be looking for the renamed buffer instead of *nrepl-2*?
15:35dnolenbbloom: in the near term it seem desirable to have the ANF stuff be a library in ClojureScript which we load we load as a selective pass in the current compiler to isolate the amount of chances to the output we introduce - focus on if/let for now.
15:35bbloomdnolen: he also mentions lawall & danvy, who show how to use delimited continuations to write the specializer in direct style & still get the benefit
15:35dnolens/chances/changes
15:35bbloomdnolen: i have this theory that the Eff effects/handlers stuff is *directly* applicable to this. instead of explicitly passing a continuation, you install a handler & defer to it
15:36bbloomdnolen: then you still explicitly call "recuse with the current transformer on this thing" and the handler will take care of keeping that in direct style
15:36dnolenbbloom: that's likely, the number of citations to the original The Essence of Compiling With Continuations is quite large
15:36bbloomdnolen: yeah, it's seminal work
15:36dnolenbbloom: one of them is a Handler Effects paper w/ Plotkin on it.
15:38bbloomdnolen: yup. consider you have "operation" normalize and generic function "normalize-form". you can write a handler for normalize, whose signature is [x k] where normalize-form's signature is just [x]
15:38bbloomdnolen: so then inside a method of normalize-form, you can install a dynamic handler for normalize
15:39bbloomdnolen: so instead of having to pass the continuation all the time, you just store it in the stack :-)
15:41bbloomdnolen: among my many hobby interests, i'd really love to have a language w/ a runtime-extensible partial evaluator :-)
15:41dnolenbbloom: heh
15:41bbloomi think basically everything is a interpreter/compiler problem if you squint right!
15:44dnolenbbloom: have you seen the book "Partial Evaluation and Automatic Program Generation"?
15:45bbloomdnolen: no, it's on my list. have you read it?
15:46dnolenbbloom: only perused, I thought it was cool that it's comes w/ working Scheme code and mentions the techniques in relation to Prolog
15:46bbloomdnolen: yeah, ultimately you need a logic engine to do proper abstract interpretation
15:48dnolenbbloom: link to book http://www.itu.dk/~sestoft/pebook/jonesgomardsestoft-a4.pdf
15:48bbloomdnolen: i already got it, thanks tho :-)
15:49coventryLooks like the answer to my question is to do something like {:user {:repl-options {:init (load-file "/path/to/replrc.clj")}}} in ~/.lein/profiles.clj
15:52coventryGah, but ritz-nrepl ignores it.
15:59seangrov`dnolen: This looking closer to what you described? https://gist.github.com/sgrove/6335798
16:00seangrov`simple2.clj is the input file, repl.clj shows the command to compile simple.clj and the resulting *constants-table*, and analyzer.clj shows the implementation so far
16:04d0c0nnorHi, I'm going through the Pedestal tutorial and I've come across this construct (services/->MockServices (:app app)) .. can anybody tell me what it means ?
16:05d0c0nnorThis is MockServices:
16:05d0c0nnor(defrecord MockServices [app]
16:05d0c0nnor p/Activity
16:05d0c0nnor (start [this]
16:05d0c0nnor (receive-messages (:input app)))
16:05d0c0nnor (stop [this]))
16:07`cbp`d0c0nnor: read up on clojure records
16:08valyagolevdo you know what -> macro does?
16:09valyagolevnot sure why is it imported from services though, maybe that does something weird
16:11dissipatenoncom, did you ping me earlier?
16:11coventryvalyagolev, d0c0nnor: That is not the -> macro, that is defrecord syntax. http://tinyurl.com/mt58k7d
16:11valyagolevhmm thank you!
16:13d0c0nnorNice one, thanks!
16:14coventryI went through the first part of the tutorial in some detail a little while ago.
16:17mpenetIf there are some cassandra users interested in core.async, I just added support for it in mpenet/alia. Feedback welcome
16:29gfredericksI think I figured out a not-terrible solution to CLJ-1237
17:05TimMcgfredericks: Oh yes?
17:05TimMcCo-routines? :-D
17:05TimMcAnd yeah, that's a nasty bug.
17:05gfredericksTimMc: https://github.com/fredericksgary/clojure/commit/8248a04acd70286d9c43d03758d3327def8fae23
17:06gfredericksI guess it's somewhat of a trampoline
17:06gfredericksusing clojure.core/trampoline would have been gross though
17:07gfredericksoh snap I committed whitespace changes
17:12gfredericksTimMc: clojure.core/trampoline would be gross because then every impl would have to return its value wrapped
17:15seangrov`dnolen: Think I'm wrapping my head around everything: Here's the function and example output for the keywords constants table: https://gist.github.com/sgrove/6336233
17:16seangrov`Then there's some changes to be done to the Keyword deftype, and they should be able to be used independently from String
17:16dnolenseangrov`: looks like you're getting there, but I would avoid wrapping keywords in symbols, I don't think we need to preserve that bit from CLJ JVM
17:16dnolener wrapping keywords around symbols
17:16seangrov`dnolen: Ah, alright, was doing a relatively straight port
17:17seangrov`Presumably keywords need to have a name and namespace in their constructor - anything else?
17:19alsois there a standard way to generate a buildable pom.xml using leinengen?
17:19dnolenseangrov`: the original strings, the concatenated string and hashCode - more or less like Symbols
17:19gfredericksalso: `lein pom`?
17:19dnolenseangrov`: only keywords don't take metadata
17:21seangrov`What's the concatenated string, :ns/original-string ?
17:21alsogfredericks: i thought that pom was just for publishing? did
17:21alsodid that change in a recent version of leiningen?
17:22alsohttps://groups.google.com/forum/#!topic/clojure/oPWYZTmHC6U
17:22gfredericksalso: you might be right; I don't know about the distinction so I probably can't be helpful
17:25dnolenseangrov`: look at Symbol
17:25dnolenseangrov`: yes, but not leading :
17:25dnolens/not/no
17:27akurilinIs lein repl able to connect to drawbridge apps over https by default, or do I need a plugin of sorts for that?
17:38seangrov`Output for keywords constants-table: https://www.refheap.com/18017
17:38gfredericksTimMc: I attached a patch. I'm curious to see what rich thinks of it.
17:38seangrov`Woops, pasted the buffer, not the region
17:39gfredericksmostly because I don't have a good guess either eway
17:39seangrov`Proper compiled output for keywords constants-table: https://www.refheap.com/18019 and modified Keyword deftype (not tested yet): https://www.refheap.com/18018
17:43dnolenseangrov`: nice
18:18seangrov`dnolen: Any hints on how to get the table to be emitted after the clojurescript support and before the user-supplied code?
18:19dnolenseangrov`: not really, you're just going to have to splice that into the compilation process somehow
18:19seangrov`Yeah, looking through closure.clj for a clean place
18:22dnolenseangrov`: there are some things to consider in that it should probably be a real file that needs to change when any other files change
18:22dnolenseangrov`: to support incremental recompile
18:25seangrov`dnolen: Yeah, I'm outputting it to "out/constants_table.js", I think I'll hard-code it to depend on the "cljs.core" ns when cljs.analyzer/*real-keywords?* is true
18:26TimMcgfredericks: I wonder if there's a generalization of this strategy.
18:27dnolenseangrov`: we'll probably want to tweak how it's enabled, but don't worry about that yet, we can tweak details when you have a working patch
18:36weavejesterDoes anyone know of a library for generic data structure functions that aren't in clojure.core but might be commonly required anyway?
18:37weavejesterLike… (defn map-val [f m] (reduce-kv #(assoc %1 %2 (f %3)) {} m))
18:37weavejesterfor instance
18:39mpenetweavejester: flatland/useful
18:40weavejestermpenet: Oh, of course, I should have remembered that one.
18:43weavejesterHm, no invert-map. Should I submit a patch, I wonder? Or is useful too big...
18:44callenweavejester: Useful is probably a good place for it to live, I would think.
18:45weavejestercallen: Useful does a lot more stuff than I really want, though. I feel like a library just for missing data structures would be lighter and more focused. However, I recognise that in practise the size of the library probably doesn't matter...
18:57akurilinDoes leiningen expose a way to query what profiles are currently being used, or would I do that through a combination of :env + something like environ?
18:58akurilinMy use case is checking to see if I'm running lein test, in which case I do NOT want nrepl server to start.
19:11callenweavejester: well, I'm working on something for expanded set operations and joins on Seqs.
19:11callenpretty small library. not sure exactly what you're looking for?
19:11weavejestercallen: I'm not sure. I just find myself using a small set of functions a lot, all to do with data.
19:12weavejesterIt's a pity the name "sundry" is already taken for a clojure library :)
19:20XPheriorAm I remembering wrong, or are go blocks supposed to absorb work on calling other functions that use <! >!?
19:29XPheriorHm, yeah I think I just remembered wrong. I remember, perhaps dnolen or Rich, mentionining that it was one of the cons of go blocks.
19:42dnolenXPherior: not really a cons a design choice, shallow yield is a good tradeoff
19:45amalloyakurilin: shouldn't you just put the nrepl init in -main, which won't be called in tests?
19:57seangrov`dnolen: Ok, have real keywords working locally in the repl and the browser, will get the tests to pass now
19:57dnolenseangrov`: wow awesome
20:04SegFaultAXIs lib-noir mostly incompatible with http-kit and other event'd servers?
20:08callenSegFaultAX: only the bits that rely on thread locality.
20:09callenSegFaultAX: I rewrote neubite to be http-kit safe while retaining similar functionality, so that might be a place to look into.
20:12dnolenbbloom: http://twitter.com/cgrand/status/371780258074476544 lazy incremental hash codes
20:14SegFaultAXcallen: It seems several of the helpers do depend on thread locality. :( But ok, thanks. I'll take a look at neubite now.
20:14SegFaultAX(Pervasive use of dynamic vars seems to be a common-ish theme in web libs for Clojure)
20:18ddellacostaSegFaultAX: agree and share your (what I interpret as) general dislike of it, although I've mostly encountered it in noir/lib-noir
20:20callenThe default assumption is thread-per-request lifecycle. That's the reason for dynamic vars - they double as request context.
20:20callenI replaced it with a macro and a contract.
20:21callenaka "thou shalt always have the Ring request in scope"
20:22ddellacostacallen: yeah, I can't really fault that I guess. I just find that, even within the scope of the request cycle, mutability can be tough to manage.
20:22SegFaultAXBut that's not webscale.
20:22ddellacostahaha
20:23ddellacostaconversely, I find that I sidestep some problems simply by only working with the request as it passes through middleware/handlers, but I suppose it introduces other problems.
20:23SegFaultAXI don't really consider dynamic vars to be about mutability. At least not in the typical sense.
20:23callenddellacosta: "working with the request" is the aforementioned contract. Assuming, "we are using Ring" is fine.
20:24SegFaultAXIt's just thread-local shadowing (eg a top-level let that is only in scope for the current thread)
20:24ddellacostacallen: yeah, assuming we are using ring, I should have been clear.
20:24callenI can handle doing things either way, but I'd prefer more universal solutions in lib-noir, BUT, the current alternative I have places more constraints/demands on the user of the library.
20:24callenonly other alternative is to force http-kit et al to use thread affinity.
20:24SegFaultAXWhich sucks.
20:24callenand I already know Shen Feng doesn't care about pleb problems like that.
20:24callenso I enforce a contract instead.
20:25callenI'm quite happy with my solution, if I'm honest.
20:25callenbitemyapp.com is running on http-kit right now, thanks to rejiggering.
20:25ddellacostacallen: sorry, what does "thread affinity" mean?
20:26ddellacostaone google search later…this concept? http://en.wikipedia.org/wiki/Processor_affinity
20:26callenuhm, no.
20:26callenthread affinity
20:26callenddellacosta: "if you pause the work I'm doing so you can reassign the thread (asynchrony + thread pool), make certain you bring back the thread I had before"
20:26callenit makes things like a dynamic var work in the presence of thread pooling in an async framework.
20:26ddellacostaah, okay
20:27ddellacostathanks for the explanation.
20:27callenit's more work to implement for the authors of things like http-kit, but allows more flexible data management.
20:27callenno problem.
20:27callenif it makes you feel any better, Ruby and Python people deal with dopey versions of these problems (like thread locals) too.
20:27callenI say dopey, because these are first world problems comparatively and we have the tools to deal with it.
20:27callen(like macros, threads, etc)
20:28ddellacostaI dunno about Python, but when I was writing Ruby I tried to pretend like threads didn't exist
20:28callenSegFaultAX: I move to SF in 2 days.
20:28callenddellacosta: yeah, and it bites them anytime they want something better than Unicorn :P
20:29ddellacostayep. Heard the story has changed with 2.0, but dunno much about it. But I digress.
20:29SegFaultAXcallen: Awesome, where?
20:30callenSegFaultAX: dunno yet, trying to AirBNB a place right now.
20:30callenno luck yet. I may end up couchsurfing.
20:30SegFaultAXcallen: No shame in that. Did your roomie move already?
20:31callenddellacosta: the contract is simple, the data lifecycle management shifts from dynamic vars getting changed inside the threads to a bucket brigade made easy.
20:31callenSegFaultAX: he moved 3/4s like a week ago, but popped in today.
20:31callenddellacosta: contract is, "if you call this macro, you must have a Ring request var in scope named `request`"
20:32callenthe middleware assoc their respective data into the Ring request so that it reaches the handlers and macros.
20:32callenddellacosta: https://github.com/bitemyapp/neubite/blob/master/src/neubite/views/common.clj
20:32SegFaultAXcallen: https://github.com/bitemyapp/neubite/blob/master/src/neubite/routes/admin.clj#L100
20:32callencleans up the code such that it's only concerned with handling a request, no weird floaty per-request global state.
20:32SegFaultAXcallen: You could probably refactor that pretty easily.
20:32ddellacostacallen: thanks, I'll check it out. I need to think about different models of managing the request cycle more.
20:33callenSegFaultAX: that is a topic of conversation here. We've been discussing a macro.
20:33SegFaultAXcallen: Turn superuser-only into a middleware.
20:33callenI considered that. I wasn't certain I wanted to move auth away from route definitions.
20:33callenI really just wanted a macro to decorate groupings of routes with middleware.
20:34SegFaultAXcallen: Sure, but just have it decorate the entire context.
20:34callenYour suggestion for middleware is the more immediate way to handle it, but then you've still gotta be careful with ordering relative to the user-middleware.
20:34SegFaultAXMuch cleaner that way.
20:34callenSegFaultAX: that's the goal.
20:34callenhaven't written the macro yet.
20:34SegFaultAXDo you need a macro for that?
20:34callenI've pinged like 5 different fairly active Clojure web people
20:35SegFaultAXIt's just a redirect if they aren't authed.
20:35callennone of them could think of anything that did what I wanted...so...yes?
20:35callenSure but that doesn't change that I want a handler decorator separate from the global middleware.
20:37ddellacostacallen: I suspect I know what you'll say, but what about using friend? It has easy ways to decorate a context in the way you guys are discussing.
20:37callenddellacosta: I'd take a swan dive into Mount Doom or become a janitor first.
20:37ddellacostahahaha
20:37callenbut I'm happy to steal the useful bits.
20:37callenSegFaultAX: testing Clojure + Datomic for something at work. Pretty excited.
20:37bbloomdnolen: oh fuck yes.
20:38bbloomthat's awesome.
20:40SegFaultAXI'm jelly. I want to use Datomic + Clojure at work.
20:42SegFaultAXcallen: Anyway, couldn't you just do (defroutes admin-routes (superuser-only (context ...)))?
20:43muhooanyone using [clj-aws-s3 "0.3.7"] getting inexplicable "The request signature we calculated does not match the signature you provided. Check your key and signing method" errors?
20:43muhooi dunno wtf they're talking about signing method, but the keys are koshe
20:44muhooaugh, sadly weavejester appears gone now :-/
20:47callenSegFaultAX: good question, maybe.
20:48muhootrying to figure out if amazon changed something which may have broken it
20:48callenSegFaultAX: the wrapper isn't the only redundancy in the routes definition I want to eliminate. That's why I'm mumbling about a macro.
20:48muhooor, worse, some impossible-to-find library version conflict
20:48SegFaultAXcallen: Try it. Just change superuser-only to work like a normal middlware. Also, put a date on your copyright.
20:48SegFaultAXcallen: Sure, there are other nice refactorings you could do. But that's an easy one. :)
20:48callenSegFaultAX: sadly you're many thousands of words of exchanged conversation short of context for what I'm talking about :(
20:49callenSegFaultAX: true. I do want to clean up Neubite holistically though.
20:49callenand get some reusable code out of it.
20:49callenhrm. yes. year.
20:50SegFaultAX(I was going to open a PR but there isn't a license attached so I'll just tell you instead, haha)
20:50callenmuhoo: do you know of anywhere to get a shikibuton in SF other than Tokyo Futons?
20:51callenSegFaultAX: licensing with - "Distributed under the Eclipse Public License, the same as Clojure."
20:51callenI didn't expect anybody to use any code *from* Neubite, just learn from it.
20:51callenany code I extracted for my own purposes would just get spun off as a library.
20:53callenddellacosta: I prefer things like github.com/bitemyapp/bulwark/ to Friend, if you're wondering what the alternative is.
20:53callenfor basic user auth...just the user-middleware in neubite is descriptive enough.
20:53ddellacostacallen: but, bulwark is attacking a different problem, isn't it?
20:54ddellacostacallen: I mean, it wholly depends on what your goals are I suppose.
20:54ddellacostacallen: there is certainly a strong argument to be made for different authn/authz models for different apps
20:54ddellacostacallen: which can be handled in very different ways, using different libs
20:58callenddellacosta: you're right that it's not totally isomorphic, but it's a similar sort of problem.
20:59ddellacostacallen: don't get me wrong, I'm not disputing that it is appropriate for the task at hand, and friend could very much be overkill. I think I tend to use it all over the place because I'm familiar with it, more than anything.
21:01callenddellacosta: I still think Friend is an overreaction, like a immune system overreacting ala Lupus. An overreaction to having tangled with some obscene enterprise ERP ACL system.
21:01ddellacostahaha
21:01callenwhen I encounter somebody tangling with something like that, *THEN* I point them towards Friend
21:01callen99% of web apps? Just write an fn :(
21:01SegFaultAXI really really like warden. I think it's awesome. And I think friend is the closest port to Clojure I've seen of warden...
21:02callenFriend requires a vision quest and a stash of psychedelics to understand
21:02SegFaultAXBut the implementation is IMHO ugly and overly complex.
21:02callenand when you're done writing the code, you've forgotten it all again.
21:02ddellacostaSegFaultAX: yeah, exactly--for my part, I was coming from a love of the plug-and-play nature of devise, built off of warden (which may largely deserve the credit, actually)
21:02callenit merits a do-over with a more "progressive" interface that allows for varying degrees of involvement on the part of the user, depending on the problem being solved.
21:03SegFaultAXDevise is essentially just a collection of default strategies for warden.
21:03SegFaultAXWarden is all the rack middleware goodness.
21:03ddellacostaI mean, friend has some crufty parts, but I feel like it is the right direction, or it maps to what I want to do a lot of the time. So I'm interested in extending it and improving it.
21:03callenhrm. Jose Valim was involved in Warden. I need to talk to him about that.
21:03SegFaultAXcallen: #elixir
21:04callenSegFaultAX: #elixir-lang actually, and I'm already in there.
21:04ddellacostaon a related note, I've spent the last few weeks wrapping up Apache Shiro, and that has been an education
21:04callenSegFaultAX: I was advising him on template library design a couple days ago.
21:05callenspreading the gospel of Selmer/DTL. >:)
21:05SegFaultAXJinja is probably more canonical for that style of templating.
21:05SegFaultAXOr even django templates.
21:06callenSegFaultAX: Selmer's implementation very closely mimics that of the actual DTL.
21:06callennot intentionally. Convergent design.
21:06callensame preprocessed iterable -> runtime dispatch on nodes.
21:07callenI have to go buy quarters, bbs.
21:15muhoocallen: my futon purchases have been from a place on chavez at evans
21:16muhootho, best futon deals/selection are in berkeley
21:16muhooberkeley is ground zero of futons
21:18muhoofuton stores in berkeley are like starbucks in the downtown sf, three on every corner
21:23callenmuhoo: I'm talking shikibutons though, not western futons.
21:23callennot the furniture thingies.
21:25callenC
21:42muhoodunno man. japantown, or, i still think berkeley is yer best bet
21:42callenmuhoo: it's mostly that I don't trust the discretion of students in quality futons.
21:43muhoostudents from japan?
21:44muhoolemme tell you, the discretion of those students in indian food is tip top
21:44TEttingeris this the right place to ask Light Table questions? My seesaw/swing app is not playing nice with the instarepl
21:44callenI've had good Indian food in Berkeley.
21:44muhooindian food in berkeley is plentiful cheap and good
21:44callenI could live on Indian food forever ;_;
21:45TEttingercallen, isn't "Indian food" an incredibly broad category?
21:45callenTEttinger: yes, and I've enjoyed almost every single form of it I've tried.
21:45callenTEttinger: including South Indian food in Malaysia, North Indian here in the bay area, and everything in between.
21:45callenIndian food made old-style without tomatoes, Indian food made new-style with cream and tomatoes, anything.
21:46callenI love it all. O_O
21:46callenI can think of no other cuisine that I have so consistently enjoyed as Indian food.
21:46TEttingerI don't like curry, but naan is better than a lot of bread here. my experiences are limited though
21:46callenTEttinger: where are you?
21:46TEttingersouthern california
21:46TEttingersan gabriel valley area
21:46callenI don't know if I had any Indian food in LA or not.
21:46TEttingerthere's a pretty good amount
21:47callenI don't think so. Had some good Thai food though.
21:47TEttingeroh yes.
21:50TEttingerthe gas company gives notices in 5 or 6 languages, one of them vietnamese. thai and vietnamese food in the general area is nice. you can get korean bbq on taco trucks too. my brother had live octopus at a korean restaurant here; that's kinda a sign that the food is authentic when it is something very few "traditional american restaurants" would consider.
21:50callenTEttinger: easy enough to know how authentic the food is here - look around for natives.
21:50TEttinger(literally live, still moving as he ate it)
21:51callenare you sure it wasn't that salt activated post mortem thing?
21:51muhooTEttinger: persian food in glendale.... best i've had
21:51TEttingerno, actually, not sure
21:51TEttingermuhoo, oh yeah, I've had some killer baklava in glendale
21:51callenwhere it jiggles from the salts in the soy sauce.
21:51callenmuhoo: tehran-dale?
21:52SegFaultAXMultigrain cherios are delicious. Just sayin.
21:53TEttingerthere's one place my egyptian friend swears has the best baklava he's ever had, and it's in glendale IIRC
21:53callenTEttinger: there's a turkish place near where I live in MV that has good baklava.
21:53callenI don't know that I'd call it the best I've ever had though.
21:53muhoocallen: little armenia, really. mostly persian-armenians, who arrived after 1979
21:53TEttingertrying to remember MV
21:54callenmuhoo: oh that's interested. Left because they were armenian christians?
21:54calleninteresting*
21:54callenTEttinger: Mountain View
21:54TEttingeroh
21:54muhooi learned to curse in persian AND armenian when living there.
21:54SegFaultAXMy coworker is teaching me how to curse in Turkish!
21:55muhoosupposedly hungarian has the most curse words of any language, dunno where i picked up that factoid.
21:55TEttingerArmenia was the first officially christian nation, even before Rome became the Holy Roman Empire. the more you know...
21:56callenmuhoo: I'd curse a lot if I was Hungarian too.
21:57TEttingerSegFaultAX, turkish has some really weird letters. BİTKİLERİN İYİLİĞİ
21:57SegFaultAXYes indeed.
21:57muhoook well, we got our world history squared away. i gotta get back to clojure hacking now.
21:57TEttingersome turkish tea was very hard to google for because of that http://dogadan.com.tr/
21:58SegFaultAXI'm almost done with 4clojure...
21:59SegFaultAXJust 11 more to go.
22:00TEttingerthe last one: write code that will hack our database to erase any records of you completing 4Clojure problems
22:01callenTEttinger: I wouldn't worry about that, 4clojure is using MongoDB - Mongo will do the job of erasing the data for you.
22:01ddellacostacallen: I know where to get you some futons. ;-)
22:02TEttinger*not allowed: let, fn, map, apply, filter*
22:02callenddellacosta: that's just cheating man. but not out of the question.
22:02ddellacostaheh
22:04callenddellacosta: there's a sizeable and long-running Japanese community in the bay area, I refuse to believe I cannot acquire a proper shikibuton and kakebuton.
22:05ddellacostacallen: honestly I'm not too knowledgeable about it, but certainly a good way to do it is find someone that is part of the community and pick their brain.
22:06ddellacostacallen: it may be possible to get them shipped via rakuten too, dunno: http://search.rakuten.co.jp/search/mall/敷布団/-/
22:10ddellacostaSegFaultAX: that is awesome. I stopped after I hit the "medium" difficulty ones I think, but I've been meaning to get back on that horse.
22:12SegFaultAXddellacosta: I like puzzles.
22:13ddellacostaSegFaultAX: Have you gone back and re-written any of your previous answers at times? I have a lot of older answers that I think are much clunkier/longer than they need to be.
22:13SegFaultAXddellacosta: Rarely.
22:13SegFaultAXddellacosta: But all my answers are also publicly available.
22:15SegFaultAX150 is tricky.
22:16ToxicFrogThis function starts out (let [...] (binding [...] (let [...] ....
22:16ToxicFrogThere has got to be a better way to do this.
22:18ddellacostaToxicFrog: no way to bind outside of the first let, then merge the lets into one? …without knowing what you are doing, it's hard to say.
22:22clj_newb_2345what does datomic use for it's backend to actually store the data
22:22clj_newb_2345is it entirely self contained, relying on nothing but the JVM ?
22:23callenclj_newb_2345: Datomic has a pluggable storage backend. You should read the documentation, it answers your questions.
22:26ToxicFrogddellacosta: the first let destructures the return value of a function that returns a list; I need all of the values later but only need to bind one of them.
22:26ToxicFrogThen I bind it, then I let the result of calling a function that needs the binding, then I do things.
22:27ToxicFrogIn other news, I hate namespaces.
22:27seangrov`callen: I'd say go down to Santa Clara for Korean futons... expensive, but good
22:27seangrov`I'm sure somewhere in Japantown has them too though
22:28callenseangrov`: I'm in Mountain View right now, now is the time to get anything I need in SC. What's the difference re: korean futons?
22:28clj_newb_2345ToxicFrog: how would you improve namespaces ?
22:28seangrov`callen: Same idea, generally same quality, generally same price
22:29callenseangrov`: oh I see. I'll keep that in mind as an option, thank you.
22:29ddellacostaToxicFrog: dunno, again, would have to look at a refheap or something. But don't see what it has to do with namespaces being hateful
22:30callenAnybody that dislikes namespaces hasn't been bereft of them.
22:30ddellacostaI rather feel like namespaces are excellent in generally
22:30ddellacostageneral
22:30callenhalf of why I preferred Python to Ruby was namespacing.
22:30ToxicFrogclj_newb_2345: I'm not sure, because I don't feel like I yet understand the distinction between :require and :use, between ns and in-ns, :gen-class, load, how clojure finds the files that make up a namespace, and why it can't find the goddamn opts.clj file in this project.
22:30ToxicFrogddellacosta: nothing whatsoever, the hatefulness is separate.
22:31ToxicFrogcallen: in general, I agree. In clojure specifically, they seem overly complicated.
22:31callenToxicFrog: :use is kinda on the way out. it's isomorphic with :require :refer :all
22:31ddellacostaToxicFrog: use = (require :refer :all)
22:31ddellacostajinx
22:31ddellacostathis is a good article if you haven't read it yet: http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html
22:31callenToxicFrog: there's a talk that explains how namespacing and vars work in Clojure. you should probably watch it. the enlightenment will make you less hateful and appreciate it more.
22:32ddellacostasorry, that was for ToxicFrog
22:32callenToxicFrog: the only real lack of orthogonality in Clojure namespaces is :use vs. :require :refer :all, that's it.
22:32callennamespaces are objects, you can enter namespaces at will, them being created if they didn't already exist, you can choose to require/import some stuff if you need it as part of the (ns ...) form.
22:33callenimport is for Java, require is for Clojure. normal destructuring rules apply.
22:33ToxicFrogcallen: is there a transcript of it?
22:33callendoesn't seem like a lot to cope with. it's a lot simpler than the weird hybrid PYTHON_PATH, "is this a file? a library?" importing issues in languages like Python.
22:34callenall the classpath stuff that is usually endemic to Java-world is handled for you by dint of Leiningen.
22:34callenToxicFrog: not that I'm aware of. InfoQ shindig. http://www.infoq.com/presentations/Clojure-Namespaces-Vars-Symbols
22:35callenI hate audio/video content, if it's any consolation, but this was worth sitting through. Seriously.
22:35callenthat talk will clear up the entire matter for you, I think.
22:36callenonce you understand var interning, symbols, and how namespaces work I think you'll be considerably more zen about it all :)
22:37callenToxicFrog: also, I don't know if you've noticed, but ":as" means the same thing everywhere in Clojure AFAICT, including :require
22:40SegFaultAXIt's weird when your 4clojure solutions comes out super close to someone elses.
22:41callenshould write a feature for 4clojure detecting your "peers"
22:41futileand that's the end of that chapter
22:47SegFaultAXI'm so close to the top 100 I can taste it. :)
22:48ToxicFrogHmm. If I'm using dynamic binding does the original (def) need to be in scope to stuff using the binding further down the stack?
22:53ToxicFrogArgh why can't it see the var
22:54ddellacostais for lazy? I feel like I'm going crazy
22:54ddellacostaI made a rhyme
22:54cgagyeah it is
22:55ddellacostacgag: okay, thanks, that would explain this weird behavior
22:55ddellacostaah, there it is in the docs, go figure
22:56cgagi'v e been bitten by that before
22:57ToxicFrog"*opts* does not exist" YES IT DOES aaaaagh
22:57ddellacostayeah, dunno what I was thinking, I just spend ten minutes banging my head against the wall. "Why is nothing happening!?" D'oh
22:58ddellacostaToxicFrog: seriously, if you put some stuff in a refheap, I'll take a look. Just sayin'
22:59ToxicFrogddellacosta: at the moment it's kind of tricky, this is a 200 line project that I'm trying to split into several small files and there's bits all over the place.
22:59ddellacostaToxicFrog: gotcha. Well, the offer stands.
23:11ToxicFrogSorted out the problem
23:11ddellacostaToxicFrog: what was it?
23:11ToxicFrogThere was another file where I hadn't updated the :require and the error message was extremely confusing
23:12ToxicFrogLeading me to believe it was in a different file.
23:12ddellacostahmm. yah, that can happen.
23:17ToxicFrog(more hateful than namespaces: clojure's 100+ stack frame compiler errors)
23:42muhoohaha, that's not clojure, that's java, mostly
23:43muhooi remember those from android too. spew spew spew spew spew wtf was actually wrong here?