#clojure log - Aug 25 2013

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:01 bja: I sorta think the correct thing to do is to implement an sldb-style debugger on top of fireplace

0:02 basically, expose the remaining middleware that fireplace doesn't handle automatically

0:16 ToBeReplaced: anyone know if there's a way to warn on cache misses with core.memoize/core.cache?

0:24 amalloy: ToBeReplaced: implement the cache protocol by wrapping an existing cache and issuing a warning?

0:31 ToBeReplaced: amalloy: yep, cheers

1:33 callen: If I wanted to monkeypatch a defn from another library (not my own), do I have any alternatives to alter-var-root?

1:33 with-redefs isn't acceptable.

1:43 ToBeReplaced: callen: i don't know of other options, not that they don't exist

2:19 kab3wm: I'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

2:25 ivan: kab3wm: total guess, try (int-array [1 2 3])

2:25 callen: devn: getclojure is broken again.

2:27 SegFaultAX: kab3wm: The error is pretty explicit about what you need to do. The driver doesn't what db type PersistentVector maps to.

2:28 (Arrays are an extension of the standard so it isn't surprising that this wasn't accounted for in Clojure's JDBC wrapper)

2:28 pg specific extension, that is.

2:35 kab3wm: SegFaultAX: 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?

2:36 SegFaultAX: kab3wm: 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)

2:40 kab3wm: SegFaultAX: Ok. I will keep playing.. maybe I can do (.setObject int-array) or something. Thank you for your help.

2:57 akurilin: Is 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?

2:57 As in, that's not turned on by default?

2:58 SegFaultAX: akurilin: Let's hope that it isn't turned on by default. ;)

2:59 akurilin: Check out cemerick's drawbridge. It's pretty neat.

3:01 akurilin: SegFaultAX, 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

3:03 SegFaultAX: akurilin: 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.

3:06 akurilin: SegFaultAX, that's fair

3:06 thank you

3:06 bbl

6:44 noncom: dissipate: hi, r u here?

6:49 instilled: muhoo: if you're setting up things from scratch maybe you want to give this a shot: https://github.com/instilled/clojure-bee

6:50 muhoo: 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.

6:51 muhoo: I use it with evil-mode as well

6:52 miql: sorry that was intended for you

6:55 noncom: why on clojuredocs the latest clojure version is 1.3.0 and such things as (add-watch) are marked as "Alpha - subject to change" ?

6:56 what is the recommended source of reference for clojure, in spirit on clojuredocs but the most recent?

6:56 s/on clojuredocs/of clojuredocs

6:58 glosoli: noncom: Community driven docs, probably not updated that often

7:02 andyfingerhut: noncom: 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.

7:09 noncom: i see.. looks like them having hard times... long i didn't see changes...

7:10 however, i am looking at clojure atlas http://www.clojureatlas.com/ did anyone try it yet?

7:11 looks like very interesting, i think i will reside to it..

7:13 oh, it is for clojure v 1.4.x yet...

7:13 andyfingerhut: noncom: Clojure 1.4 and 1.5 are not terribly different.

7:14 Even most of the stuff on ClojureDocs.org site is still useful.

7:14 noncom: yeah, that is true, and that could make for a good reason to update it to 1.5 :)

7:15 though, 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

7:15 and them are for 1.3.0

7:16 andyfingerhut: They may update it some day, but it is difficult to predict if or when.

7:16 noncom: its like (agent) itself :D

7:40 is there a way to reset an agent, just like an atom?

7:40 i want to send something to the agent, without caring for its current sate

7:41 i.e. i do not want to make the function to consider the current agents status in its args

8:43 jaley: can 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?

8:46 coventry: noncom: Does (send target-agent (constantly desired-new-val)) not DWYW?

8:48 jaley: (scratch that, yes it does, I'm just blind)

8:59 noncom: jaley: weehee! thanks!

9:00 coventry: I 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?

9:00 jaley: noncom: did i do something? :s

9:01 coventry: I think he meant me, in which case, np.

9:01 noncom: omg sorry

9:01 sure, conventry, it was you! :)

9:01 coventry: Don't sweat it. :-)

9:04 jtoy: anyone know of a library that has time functions to do : " X days ago" ?

9:15 noncom: jtoy: ummm not sure what you mean.. clj-time i think has it

9:31 * m4dm4n hello Folks

9:32 glosoli: hello folk

9:32 m4dm4n: anybody here that know reverse engineering?

9:32 Okasu: Hello boyo.

9:34 noncom: for them are told being a drawman

9:45 jtoy: noncom :( oops, I just wrote one

9:45 I mean change a timestamp to 4 days ago, 2 hours ago, 1 month ago,etc

9:46 noncom: jtoy: yep, afaik clj-time does that

10:00 clj_newb_2345: anyone here coding with emacs live?

10:00 it seems ridiciously powerful, but also ridiciously undocumented

10:01 glosoli: I know Emacs, but what's Emacs Live

10:01 noncom: i tried enacs live, looks fine. it has its docs on its page no?

10:02 emacs live is that ide for overtone

10:02 glosoli: noncom: it's fully dcoumented

10:02 documented"

10:02 http://overtone.github.io/emacs-live/documentation.html

10:02 kmicu: clj_newb_2345: It's self documented, what's the problem?

10:02 noncom: yeah, i found it pretty-docced

10:02 clj_newb_2345: i'm also new top emacs

10:02 noncom: s/-/

10:02 clj_newb_2345: what is self documented?

10:02 glosoli: Emacs Live is something like some already configured for you, so you would not need to care about how it works ?

10:03 kmicu: Yes.

10:03 http://overtone.github.io/emacs-live/doc-shortcuts.html

10:04 "If you’re new to Emacs, it’s worth taking the time to read the tutorial."

10:05 clj_newb_2345: http://www.youtube.com/playlist?list=PLxj9UAX4Em-IiOfvF2Qs742LxEK4owSkr

10:05 clj_newb_2345: kmicu; nice, thanks

10:06 * glosoli would still recommend configuring it on your own

10:06 kmicu: If you want fast start with clojure and emacs, then emacs-live is pretty well documented.

10:07 glosoli: kmicu: Yeah it took me like week to do it on my own and I am still learning something every day

10:08 clj_newb_2345: http://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:08 hitting C-g doesn't cancel anything

10:09 kmicu: Ctrl key + g always cancel anything :)

10:10 glosoli: clj_newb_2345: What makes you think it does not cancel anything ?

10:11 * kmicu thinks that http://overtone.github.io/emacs-live/doc-clojure.html is pretty obvious.

10:11 noncom: i have a clojure program that, according to the profiler, generates loads of char[] (over 60% of total generation), is that typical for clojure?

10:12 clj_newb_2345: glosoli noting is happening

10:12 the bottom of my buffer continues to say "C-c C-z"

10:12 it's as if the emcas session has hanged

10:13 glosoli: clj_newb_2345: Hm what kind of Emacs are you using and which platform ?

10:13 clj_newb_2345: ubuntu 13.04; emacs 24 + emacs live from emacs live github

10:13 glosoli: clj_newb_2345: how much CPU does it use while "hanged" ?

10:14 clj_newb_2345: actually

10:14 C-x C-z is bound to "suspent frame"

10:14 which is probably why it looks "suspended"

10:14 glosoli: yeah lol

10:14 clj_newb_2345: I'm an idiot

10:14 sorry about that

10:15 glosoli: clj_newb_2345: For me it does not suspend , or probably it does, but also hides it in the tray lol

10:15 clj_newb_2345: what it he inverse of "suspend frame"?

10:16 glosoli: clj_newb_2345: for me it's just opening Emacs windows from it's application tray heh ,

10:17 clj_newb_2345: i'm running xmonad

10:17 glosoli: good luck then

10:18 kmicu: clj_newb_2345: I'm also running xmonad, simply switch to other window.

10:19 clj_newb_2345: actually, I just ent and and disabled suspend-frame

10:19 and rebound \C-x\C-z to nil

10:20 kmicu: If you do not use emacs in terminal it is a good way to go :)

10:22 coventry: Even 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:24 clj_newb_2345: https://github.com/clojure-emacs/nrepl.el <-- why are teh prefixes for evaluation so damn inconsistent? :-)

10:26 kmicu: Legacy reason.

10:27 clj_newb_2345: so basically a bunch of other progs took a bunch of bindings

10:27 and peiople's fiiingers are used to those bindings

10:27 thus forcing emacs live to take otehr bindins, whatever is free?

10:28 kmicu: emacs-live has the same bindings like nrepl.el

10:28 You can rebind them, it's not worth any discussion ;)

10:34 clj_newb_2345: whoa

10:35 I can create separate emacs frames, and have them be in the same session, so they can take different parts of my xmonad setup

10:35 this is insane

10:35 kmicu: frames or windows?

10:36 Ah, two frames in one window, with the same xmonad.hs

10:37 yes, frames and buffers are independent

10:37 You can even C-M-[ and C-M-] to move content of other frame

10:38 without leaving current frame

10:40 You can do whatever you want with emacs :)

10:52 coventry: kmicu: are those xmonad or emacs keybindings? C-M-[ becomes M-ESC for me, and C-M-] is undefined in my emacs.

10:55 kmicu: Yes.

10:56 Binding is defined in emacs-live, but you should have scroll-other-window-down from window.el

10:56 coventry: Oh, an emacs-live binding. Thanks.

10:57 Huh, I didn't know scroll-other-window-down worked across frames like that, because I always have at least two windows per frame. :-)

10:57 kmicu: https://github.com/overtone/emacs-live/blob/master/packs/live/bindings-pack/config/default-bindings.el#L158

11:01 coventry: Wow, lots of cool stuff in there. Definitely going on the distractions list.

11:03 kmicu: Yes, two windows per frame.

11:04 * kmicu once again switched emacs's nomenclature.

12:29 seangrov`: kmicu: What command is C-M-[ bound to for you, scroll-other-window-down?

12:36 coventry: seangrov`: It's in the github URL he sent.

12:37 What'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:49 Looks like tools.reader is the place to start.

13:16 gfredericks: is 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:17 bbloom: gfredericks: numerics are hard? :-)

13:17 gfredericks: bbloom: no specifics in that vein?

13:18 bbloom: well shit. my irc client crashed. wutcha say?

13:19 gfredericks: bbloom: "no specifics in that vein?"

13:19 bbloom: gfredericks: 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:20 gfredericks: bbloom: shouldn't have to be generic though

13:20 bbloom: yeah, 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:20 gfredericks: bbloom: are you suggesting a two-element array is faster than a deftype?

13:21 bbloom: no, i'm suggesting a large array of N*2 elements is faster than a deftype :-)

13:21 or rather an array of deftypes

13:21 not to discourage you from building such a library. it would be useful to have

13:21 gfredericks: bbloom: I know genericity is hard, but I'd think special-purpose functions would be useful regardless

13:22 bbloom: gfredericks: i won't argue with that

13:22 gfredericks: I'm not sure if there is hairiness around exactness though

13:23 TEttinger: http://stackoverflow.com/questions/11824815/fast-complex-number-arithmetic-in-clojure someone's already trying some kind of complex number thing in clojure

13:23 gfredericks: TEttinger: oh I've done it before too; it's writing a well-designed library that I'm pondering

13:24 https://github.com/fredericksgary/qubits/blob/master/src/com/gfredericks/qubits/complex.clj

13:26 TEttinger: =ish is a great idea

13:27 gfredericks: TEttinger: that's how you know you're working with doubles :)

13:27 dnolen: bbloom: gfredericks: it seems like there are really good ideas about doing efficient symmetric multimethods on the JVM in the Fortress literature

13:28 * bbloom scratches head

13:28 TEttinger: is fortress still around?

13:28 bbloom: dnolen: fortress was on the jvm?

13:29 dnolen: gfredericks: haven't had time to dig into it, but this looks cool "Implementing Fully Modular, Statically Typed, Symmetric Multimethod Dispatch"

13:29 bbloom: yes

13:29 TEttinger: no

13:29 bbloom: huh. didn't realize that

13:30 gfredericks: dnolen: I think I might read this whole thing just to see what happens.

13:32 TEttinger: X10 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:32 dnolen: "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:32 https://blogs.oracle.com/projectfortress/entry/fortress_wrapping_up

13:35 gfredericks: at the moment I'm more interested in having anything at all, and I think I also want exact complex numbers

13:36 glosoli: hmm 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:38 TEttinger: gfredericks, (sqrt -2)

13:38 bbloom: gfredericks: if you want exact math, you really have no other choice but to go symbolic

13:39 TEttinger: bbloom, so (sqrt -2) would eval to '(sqrt -2) ?

13:40 I can see that being handy

13:40 bbloom: TEttinger: or (complex (sqrt 2) 1)

13:40 tomjack: "go symbolic" = "don't eval" ?

13:41 dnolen: bbloom: 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:41 bbloom: I mean why are you *not* passing around k

13:41 TEttinger: clojure has continuations?

13:41 bbloom: tomjack: or just eval differently :-P

13:41 dnolen: 1 sec, let me reboot my brain on the implementations

13:41 dnolen: bbloom: I see now that the let merging is not that important, ANF does the proper thing for what I want to fix

13:43 bbloom: dnolen: ok, now i recall this…. soooo

13:43 gfredericks: TEttinger: bbloom: I'm 96% sure I have a decent application of exact complex numbers that won't use any of the inexact functions

13:43 bbloom: basically, matt might's implementation is written in continuation passing style b/c that achieves a more complete normalization

13:44 in my case, i only needed a few very specific places normalized & didn't need the more general approach

13:45 actually, 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:45 gfredericks: bbloom: ironically that application is an representation of algebraic numbers; so if that works then (sqrt -2) doesn't have to be symbolic :)

13:45 "an exact representation"*

13:47 bbloom: dnolen: you'll notice that they call "k" wherever i call "anf" for recursive cases

13:49 dnolen: bbloom: 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:49 continuation passing style allows you rewrite the code inside out

13:50 bbloom: dnolen: https://github.com/scala/scala/blob/master/src/continuations/plugin/scala/tools/selectivecps/SelectiveANFTransform.scala

13:51 that's the a scala ANF i was mimicking

13:54 dnolen: bbloom: ok, though I don't yet see how that addresses my point

13:55 bbloom: or maybe you're saying you only did enough for CPS transform, not full normalization?

13:55 bbloom: dnolen: 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:55 gfredericks: dnolen: I have already learned a thing from this paper

13:57 SegFaultAX: gfredericks: Which paper are you reading?

13:57 gfredericks: SegFaultAX: Implementing Fully Modular, Statically Typed,

13:57 Symmetric Multimethod Dispatch

13:57 admittedly the thing I learned is about java :)

13:58 SegFaultAX: gfredericks: Have a link?

13:58 * gfredericks googles

13:59 gfredericks: SegFaultAX: no I don't because google won't give me an unobfuscated link

13:59 sinistersnare: http://www.cs.ucla.edu/~todd/research/iandc.pdf this?

13:59 bbloom: dnolen: you'll see in my code that the anf-application function calls (map anf* args) in it

13:59 dnolen: that's the recurisve/fixed-point step that emulates the continuations

13:59 gfredericks: sinistersnare: that looks pretty different

13:59 sinistersnare: oh sorry

13:59 :p

14:00 coventry: bbloom, dnolen: where are you planning to use this?

14:00 bbloom: dnolen: see also "expansion passing style"

14:00 dnolen: coventry: ClojureScript

14:01 bbloom: coventry: 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:01 dnolen: bbloom: yeah I can see how your version works, one giant set of let bindings :)

14:01 coventry: bbloom, dnolen: thanks.

14:03 bbloom: dnolen: 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:03 dnolen: bbloom: heh I remember

14:04 bbloom: dnolen: i'd like to, if at all possible, accomplish this transform w/o gensym

14:04 dnolen: or at least w/ a repeatable symbol source, so that re-analysis & re-transform is stable

14:47 fbernier: What is the best way to have command line arguments persist across other namespaces in clojure ?

14:48 hyPiRion: fbernier: The simplest way is to pass the arguments to the functions. The easier way is to bind them to a dynamic var.

14:50 fbernier: hyPiRion: passing as arguments seems weird in my case ... I'd need an argument used in the "handler" and "converter" namespaces

14:50 https://github.com/fbernier/taz-clj/tree/master/src/taz_clj

14:51 command line arguments

14:54 gfredericks: oh man; there's a weird kind of mutual dependency between clojure.core and the namespaces it uses

14:54 * gfredericks is reading clojure.core.protocols

14:55 callen: I learned about a nifty way to handle "configuration" with protocols the other day via Cheshire's source code.

14:55 gfredericks: callen: howzat?

14:56 callen: gfredericks: well adding to the protocol is just extension, but for removal, you alter-var-root the protocol and filter out the removed impl.

14:56 bbloom: gfredericks: bootstrapping a core library is tricky/circular :-)

14:56 callen: gfredericks: 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:57 gfredericks: callen: configuration of libs or apps?

14:57 callen: so the subject is rattling around my brain. Just trying to find better ways.

14:57 gfredericks: gods, libs.

14:57 gfredericks: totally unnecessary in an app.

14:57 I'm not a total philistine, give me a little credit.

14:58 gfredericks: callen: I don't quite understand the issues yet; I'm trying to learn, not criticize

14:58 callen: gfredericks: ah, gotcha. I thought you might know of something I didn't.

14:58 but that's basically the bag of tricks I've so far, atoms, closures, and alter-var-root'ing a damned protocol var.

14:58 gfredericks: callen: so the main trouble is you want the library to be able to be used in multiple ways/configurations, no?

14:58 callen: and the latter only applies...if it's a protocol.

14:59 gfredericks: yeah but I have a nifty pattern for that in Bulwark. handles closed over config *and* global atom.

14:59 needs both, in fact.

14:59 gfredericks: I have this issue with cheshire because I want to be able to use it from another library, without affecting any global config

14:59 callen: yes, I know I could've destructured it. Fix it later. https://github.com/bitemyapp/bulwark/blob/master/src/bulwark/core.clj#L83-L85

15:01 gfredericks: callen: okay I see what you mean; that style wouldn't easily apply to cheshire would it? unless you have parser-constructors etc.

15:01 callen: gfredericks: 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:01 though*

15:02 gfredericks: are you trying to use cheshire in two different ways or something? is having an extra protocol going to break something?

15:02 gfredericks: callen: I want to use it from a logging lib

15:02 and I need to support custom types from there

15:02 callen: oh I see, without affecting a potential user.

15:02 gfredericks: exactly

15:03 I think I "solved" it by doing my own type conversion before calling cheshire

15:03 which required an ugly enumeration of all the types cheshire defaultly supports

15:03 callen: I'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:03 ...right.

15:03 that being in mind, a "with-protocol" function might be in order.

15:04 gfredericks: well the idea is to be able to log arbitrary data; so I don't control what types come in

15:04 callen: gfredericks: you're writing your own logging lib?

15:04 gfredericks: callen: I wrote a wrapper for tools.logging that uses data instead of strings

15:04 callen: I could think of a few uses for that.

15:04 gfredericks: yeah it's been super nice

15:04 callen: I am about to work on a logging micro-lib thing.

15:05 gfredericks: the cool part is having a dynamic var *data* that has default data to be merged in

15:05 callen: gfredericks: 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:05 gfredericks: so you can alter-var-root it with your git sha and env

15:05 callen: sounds right

15:05 callen: okay, so I wasn't off the mark.

15:06 gfredericks: callen: I think an AOP lib for adding logging to vars could be really nice, but haven't settled on a comprehensive design

15:06 callen: gfredericks: 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:06 fbernier: In the "run-server" function call here, why is a reader-macro used? http://http-kit.org/server.html#routing

15:06 smnirven: anybody out there have some experience using amazonica dynamodbv2?

15:06 callen: gfredericks: most universal way would be to figure out a way to decorate the IFn behavior, no?

15:07 dnolen: bbloom: re: ANF gensym, do you mean the names that need to be introduced by ANF?

15:07 gfredericks: callen: having trouble seeing what you mean by that

15:07 callen: smnirven: is this a Clojure question?

15:07 bbloom: dnolen: yeah. right now i just do something like (gensym "__anf")

15:07 callen: gfredericks: Dreaming of evil, don't sweat it. The more useful thought is "with-protocol"

15:08 gfredericks: callen: I don't understand that one either :P

15:08 callen: temporary protocol extensions?

15:08 callen: shadow the protocol?

15:08 yeah.

15:08 for the block of scope.

15:08 dnolen: bbloom: do you have any ideas how to avoid that?

15:08 bbloom: dnolen: 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:08 gfredericks: callen: that couldn't be thread-local though could it?

15:08 dnolen: bbloom: yes you're only worried about capture

15:09 bbloom: dnolen: 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:09 dnolen: bbloom: since our compilation unit is a function, I don't think this is a problem in practice.

15:09 callen: gfredericks: my intent is for block locality.

15:09 dnolen: anf__0 and counting up compilation unit

15:09 gfredericks: callen: i.e. you don't care if it's not thread-local?

15:09 bbloom: dnolen: yeah, so to avoid (unintentional) capture just use something like (str "anf$" i)

15:09 dnolen: "up per"

15:10 callen: gfredericks: 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:10 gfredericks: callen: oh so it's a lexical thing?

15:10 callen: that's the hope.

15:10 gfredericks: callen: how is that different from merely let?

15:10 bbloom: dnolen: 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:10 callen: gfredericks: if let works for your problem, why didn't you do that?

15:10 gfredericks: callen: this has nothing to do with the var holding the protocol?

15:10 bbloom: (let [arg0 (let [arg0 x] (f arg0))] (g arg0))

15:10 callen: it could if desired.

15:11 gfredericks: callen: I don't think let works for my problem, I'm still trying to understand what you're proposing

15:11 bbloom: dnolen: 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:12 callen: gfredericks: 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:12 gfredericks: callen: I can't tell if you're talking about temporarily modifying an existing protocol, or generating a temporary protocol, or something else

15:12 callen: have fun

15:12 callen: generating a temporary protocol that is lexically scoped

15:30 coventry: How can I arrange for a utility function to always be present in the namespace of a repl started with lein?

15:30 dnolen: bbloom: have you seen this http://research.microsoft.com/en-us/um/people/akenn/sml/CompilingWithContinuationsContinued.pdf?

15:31 bbloom: dnolen: 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:31 dnolen: bbloom: agreed was just curious

15:32 bbloom: dnolen: sure, there are plenty of cool optimizations enabled by full CPS compiler techniques, but step 1 is just getting the current passes disentangled

15:32 coventry: (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:32 bbloom: dnolen: also, there is good evidence that delimited continuations can be used to enable the cps-style optimizations to be accomplished in direct-style

15:33 dnolen: bbloom: interesting, references?

15:33 bbloom: yeah, I think disentangling the compiler is going to have to be done piecemeal.

15:33 bbloom: dnolen: 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:33 dnolen: http://okmij.org/ftp/meta-programming/index.html#bti

15:34 so basically that's a really simple demonstration of how binding-time analysis gets better in CPS

15:34 dnolen: 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:34 benkay: i 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:35 dnolen: bbloom: 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:35 bbloom: dnolen: he also mentions lawall & danvy, who show how to use delimited continuations to write the specializer in direct style & still get the benefit

15:35 dnolen: s/chances/changes

15:35 bbloom: dnolen: 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:36 dnolen: 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:36 dnolen: bbloom: that's likely, the number of citations to the original The Essence of Compiling With Continuations is quite large

15:36 bbloom: dnolen: yeah, it's seminal work

15:36 dnolen: bbloom: one of them is a Handler Effects paper w/ Plotkin on it.

15:38 bbloom: dnolen: 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:38 dnolen: so then inside a method of normalize-form, you can install a dynamic handler for normalize

15:39 dnolen: so instead of having to pass the continuation all the time, you just store it in the stack :-)

15:41 dnolen: among my many hobby interests, i'd really love to have a language w/ a runtime-extensible partial evaluator :-)

15:41 dnolen: bbloom: heh

15:41 bbloom: i think basically everything is a interpreter/compiler problem if you squint right!

15:44 dnolen: bbloom: have you seen the book "Partial Evaluation and Automatic Program Generation"?

15:45 bbloom: dnolen: no, it's on my list. have you read it?

15:46 dnolen: bbloom: only perused, I thought it was cool that it's comes w/ working Scheme code and mentions the techniques in relation to Prolog

15:46 bbloom: dnolen: yeah, ultimately you need a logic engine to do proper abstract interpretation

15:48 dnolen: bbloom: link to book http://www.itu.dk/~sestoft/pebook/jonesgomardsestoft-a4.pdf

15:48 bbloom: dnolen: i already got it, thanks tho :-)

15:49 coventry: Looks 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:52 Gah, but ritz-nrepl ignores it.

15:59 seangrov`: dnolen: This looking closer to what you described? https://gist.github.com/sgrove/6335798

16:00 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:04 d0c0nnor: Hi, 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:05 This is MockServices:

16:05 (defrecord MockServices [app]

16:05 p/Activity

16:05 (start [this]

16:05 (receive-messages (:input app)))

16:05 (stop [this]))

16:07 `cbp`: d0c0nnor: read up on clojure records

16:08 valyagolev: do you know what -> macro does?

16:09 not sure why is it imported from services though, maybe that does something weird

16:11 dissipate: noncom, did you ping me earlier?

16:11 coventry: valyagolev, d0c0nnor: That is not the -> macro, that is defrecord syntax. http://tinyurl.com/mt58k7d

16:11 valyagolev: hmm thank you!

16:13 d0c0nnor: Nice one, thanks!

16:14 coventry: I went through the first part of the tutorial in some detail a little while ago.

16:17 mpenet: If there are some cassandra users interested in core.async, I just added support for it in mpenet/alia. Feedback welcome

16:29 gfredericks: I think I figured out a not-terrible solution to CLJ-1237

17:05 TimMc: gfredericks: Oh yes?

17:05 Co-routines? :-D

17:05 And yeah, that's a nasty bug.

17:05 gfredericks: TimMc: https://github.com/fredericksgary/clojure/commit/8248a04acd70286d9c43d03758d3327def8fae23

17:06 I guess it's somewhat of a trampoline

17:06 using clojure.core/trampoline would have been gross though

17:07 oh snap I committed whitespace changes

17:12 TimMc: clojure.core/trampoline would be gross because then every impl would have to return its value wrapped

17:15 seangrov`: 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:16 Then there's some changes to be done to the Keyword deftype, and they should be able to be used independently from String

17:16 dnolen: seangrov`: 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:16 er wrapping keywords around symbols

17:16 seangrov`: dnolen: Ah, alright, was doing a relatively straight port

17:17 Presumably keywords need to have a name and namespace in their constructor - anything else?

17:19 also: is there a standard way to generate a buildable pom.xml using leinengen?

17:19 dnolen: seangrov`: the original strings, the concatenated string and hashCode - more or less like Symbols

17:19 gfredericks: also: `lein pom`?

17:19 dnolen: seangrov`: only keywords don't take metadata

17:21 seangrov`: What's the concatenated string, :ns/original-string ?

17:21 also: gfredericks: i thought that pom was just for publishing? did

17:21 did that change in a recent version of leiningen?

17:22 https://groups.google.com/forum/#!topic/clojure/oPWYZTmHC6U

17:22 gfredericks: also: you might be right; I don't know about the distinction so I probably can't be helpful

17:25 dnolen: seangrov`: look at Symbol

17:25 seangrov`: yes, but not leading :

17:25 s/not/no

17:27 akurilin: Is lein repl able to connect to drawbridge apps over https by default, or do I need a plugin of sorts for that?

17:38 seangrov`: Output for keywords constants-table: https://www.refheap.com/18017

17:38 gfredericks: TimMc: I attached a patch. I'm curious to see what rich thinks of it.

17:38 seangrov`: Woops, pasted the buffer, not the region

17:39 gfredericks: mostly because I don't have a good guess either eway

17:39 seangrov`: 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:43 dnolen: seangrov`: nice

18:18 seangrov`: dnolen: Any hints on how to get the table to be emitted after the clojurescript support and before the user-supplied code?

18:19 dnolen: seangrov`: not really, you're just going to have to splice that into the compilation process somehow

18:19 seangrov`: Yeah, looking through closure.clj for a clean place

18:22 dnolen: seangrov`: 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:22 seangrov`: to support incremental recompile

18:25 seangrov`: 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:26 TimMc: gfredericks: I wonder if there's a generalization of this strategy.

18:27 dnolen: seangrov`: 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:36 weavejester: Does anyone know of a library for generic data structure functions that aren't in clojure.core but might be commonly required anyway?

18:37 Like… (defn map-val [f m] (reduce-kv #(assoc %1 %2 (f %3)) {} m))

18:37 for instance

18:39 mpenet: weavejester: flatland/useful

18:40 weavejester: mpenet: Oh, of course, I should have remembered that one.

18:43 Hm, no invert-map. Should I submit a patch, I wonder? Or is useful too big...

18:44 callen: weavejester: Useful is probably a good place for it to live, I would think.

18:45 weavejester: callen: 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:57 akurilin: Does 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:58 My use case is checking to see if I'm running lein test, in which case I do NOT want nrepl server to start.

19:11 callen: weavejester: well, I'm working on something for expanded set operations and joins on Seqs.

19:11 pretty small library. not sure exactly what you're looking for?

19:11 weavejester: callen: I'm not sure. I just find myself using a small set of functions a lot, all to do with data.

19:12 It's a pity the name "sundry" is already taken for a clojure library :)

19:20 XPherior: Am I remembering wrong, or are go blocks supposed to absorb work on calling other functions that use <! >!?

19:29 Hm, 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:42 dnolen: XPherior: not really a cons a design choice, shallow yield is a good tradeoff

19:45 amalloy: akurilin: shouldn't you just put the nrepl init in -main, which won't be called in tests?

19:57 seangrov`: dnolen: Ok, have real keywords working locally in the repl and the browser, will get the tests to pass now

19:57 dnolen: seangrov`: wow awesome

20:04 SegFaultAX: Is lib-noir mostly incompatible with http-kit and other event'd servers?

20:08 callen: SegFaultAX: only the bits that rely on thread locality.

20:09 SegFaultAX: I rewrote neubite to be http-kit safe while retaining similar functionality, so that might be a place to look into.

20:12 dnolen: bbloom: http://twitter.com/cgrand/status/371780258074476544 lazy incremental hash codes

20:14 SegFaultAX: callen: It seems several of the helpers do depend on thread locality. :( But ok, thanks. I'll take a look at neubite now.

20:14 (Pervasive use of dynamic vars seems to be a common-ish theme in web libs for Clojure)

20:18 ddellacosta: SegFaultAX: agree and share your (what I interpret as) general dislike of it, although I've mostly encountered it in noir/lib-noir

20:20 callen: The default assumption is thread-per-request lifecycle. That's the reason for dynamic vars - they double as request context.

20:20 I replaced it with a macro and a contract.

20:21 aka "thou shalt always have the Ring request in scope"

20:22 ddellacosta: callen: 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:22 SegFaultAX: But that's not webscale.

20:22 * SegFaultAX ducks

20:22 ddellacosta: haha

20:23 conversely, 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:23 SegFaultAX: I don't really consider dynamic vars to be about mutability. At least not in the typical sense.

20:23 callen: ddellacosta: "working with the request" is the aforementioned contract. Assuming, "we are using Ring" is fine.

20:24 SegFaultAX: It's just thread-local shadowing (eg a top-level let that is only in scope for the current thread)

20:24 ddellacosta: callen: yeah, assuming we are using ring, I should have been clear.

20:24 callen: I 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:24 only other alternative is to force http-kit et al to use thread affinity.

20:24 SegFaultAX: Which sucks.

20:24 callen: and I already know Shen Feng doesn't care about pleb problems like that.

20:24 so I enforce a contract instead.

20:25 I'm quite happy with my solution, if I'm honest.

20:25 bitemyapp.com is running on http-kit right now, thanks to rejiggering.

20:25 ddellacosta: callen: sorry, what does "thread affinity" mean?

20:26 one google search later…this concept? http://en.wikipedia.org/wiki/Processor_affinity

20:26 callen: uhm, no.

20:26 thread affinity

20:26 ddellacosta: "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:26 it makes things like a dynamic var work in the presence of thread pooling in an async framework.

20:26 ddellacosta: ah, okay

20:27 thanks for the explanation.

20:27 callen: it's more work to implement for the authors of things like http-kit, but allows more flexible data management.

20:27 no problem.

20:27 if it makes you feel any better, Ruby and Python people deal with dopey versions of these problems (like thread locals) too.

20:27 I say dopey, because these are first world problems comparatively and we have the tools to deal with it.

20:27 (like macros, threads, etc)

20:28 ddellacosta: I dunno about Python, but when I was writing Ruby I tried to pretend like threads didn't exist

20:28 callen: SegFaultAX: I move to SF in 2 days.

20:28 ddellacosta: yeah, and it bites them anytime they want something better than Unicorn :P

20:29 ddellacosta: yep. Heard the story has changed with 2.0, but dunno much about it. But I digress.

20:29 SegFaultAX: callen: Awesome, where?

20:30 callen: SegFaultAX: dunno yet, trying to AirBNB a place right now.

20:30 no luck yet. I may end up couchsurfing.

20:30 SegFaultAX: callen: No shame in that. Did your roomie move already?

20:31 callen: ddellacosta: the contract is simple, the data lifecycle management shifts from dynamic vars getting changed inside the threads to a bucket brigade made easy.

20:31 SegFaultAX: he moved 3/4s like a week ago, but popped in today.

20:31 ddellacosta: contract is, "if you call this macro, you must have a Ring request var in scope named `request`"

20:32 the middleware assoc their respective data into the Ring request so that it reaches the handlers and macros.

20:32 ddellacosta: https://github.com/bitemyapp/neubite/blob/master/src/neubite/views/common.clj

20:32 SegFaultAX: callen: https://github.com/bitemyapp/neubite/blob/master/src/neubite/routes/admin.clj#L100

20:32 callen: cleans up the code such that it's only concerned with handling a request, no weird floaty per-request global state.

20:32 SegFaultAX: callen: You could probably refactor that pretty easily.

20:32 ddellacosta: callen: thanks, I'll check it out. I need to think about different models of managing the request cycle more.

20:33 callen: SegFaultAX: that is a topic of conversation here. We've been discussing a macro.

20:33 SegFaultAX: callen: Turn superuser-only into a middleware.

20:33 callen: I considered that. I wasn't certain I wanted to move auth away from route definitions.

20:33 I really just wanted a macro to decorate groupings of routes with middleware.

20:34 SegFaultAX: callen: Sure, but just have it decorate the entire context.

20:34 callen: Your 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:34 SegFaultAX: Much cleaner that way.

20:34 callen: SegFaultAX: that's the goal.

20:34 haven't written the macro yet.

20:34 SegFaultAX: Do you need a macro for that?

20:34 callen: I've pinged like 5 different fairly active Clojure web people

20:35 SegFaultAX: It's just a redirect if they aren't authed.

20:35 callen: none of them could think of anything that did what I wanted...so...yes?

20:35 Sure but that doesn't change that I want a handler decorator separate from the global middleware.

20:37 ddellacosta: callen: 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:37 * ddellacosta stands back

20:37 callen: ddellacosta: I'd take a swan dive into Mount Doom or become a janitor first.

20:37 ddellacosta: hahaha

20:37 callen: but I'm happy to steal the useful bits.

20:37 SegFaultAX: testing Clojure + Datomic for something at work. Pretty excited.

20:37 bbloom: dnolen: oh fuck yes.

20:38 that's awesome.

20:40 SegFaultAX: I'm jelly. I want to use Datomic + Clojure at work.

20:42 callen: Anyway, couldn't you just do (defroutes admin-routes (superuser-only (context ...)))?

20:43 muhoo: anyone 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:43 i dunno wtf they're talking about signing method, but the keys are koshe

20:44 augh, sadly weavejester appears gone now :-/

20:47 callen: SegFaultAX: good question, maybe.

20:48 muhoo: trying to figure out if amazon changed something which may have broken it

20:48 callen: SegFaultAX: 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:48 muhoo: or, worse, some impossible-to-find library version conflict

20:48 SegFaultAX: callen: Try it. Just change superuser-only to work like a normal middlware. Also, put a date on your copyright.

20:48 callen: Sure, there are other nice refactorings you could do. But that's an easy one. :)

20:48 callen: SegFaultAX: sadly you're many thousands of words of exchanged conversation short of context for what I'm talking about :(

20:49 SegFaultAX: true. I do want to clean up Neubite holistically though.

20:49 and get some reusable code out of it.

20:49 hrm. yes. year.

20:50 SegFaultAX: (I was going to open a PR but there isn't a license attached so I'll just tell you instead, haha)

20:50 callen: muhoo: do you know of anywhere to get a shikibuton in SF other than Tokyo Futons?

20:51 SegFaultAX: licensing with - "Distributed under the Eclipse Public License, the same as Clojure."

20:51 I didn't expect anybody to use any code *from* Neubite, just learn from it.

20:51 any code I extracted for my own purposes would just get spun off as a library.

20:53 ddellacosta: I prefer things like github.com/bitemyapp/bulwark/ to Friend, if you're wondering what the alternative is.

20:53 for basic user auth...just the user-middleware in neubite is descriptive enough.

20:53 ddellacosta: callen: but, bulwark is attacking a different problem, isn't it?

20:54 callen: I mean, it wholly depends on what your goals are I suppose.

20:54 callen: there is certainly a strong argument to be made for different authn/authz models for different apps

20:54 callen: which can be handled in very different ways, using different libs

20:58 callen: ddellacosta: you're right that it's not totally isomorphic, but it's a similar sort of problem.

20:59 ddellacosta: callen: 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:01 callen: ddellacosta: 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:01 ddellacosta: haha

21:01 callen: when I encounter somebody tangling with something like that, *THEN* I point them towards Friend

21:01 99% of web apps? Just write an fn :(

21:01 SegFaultAX: I 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:02 callen: Friend requires a vision quest and a stash of psychedelics to understand

21:02 SegFaultAX: But the implementation is IMHO ugly and overly complex.

21:02 callen: and when you're done writing the code, you've forgotten it all again.

21:02 ddellacosta: SegFaultAX: 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:02 callen: it 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:03 SegFaultAX: Devise is essentially just a collection of default strategies for warden.

21:03 Warden is all the rack middleware goodness.

21:03 ddellacosta: I 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:03 callen: hrm. Jose Valim was involved in Warden. I need to talk to him about that.

21:03 SegFaultAX: callen: #elixir

21:04 callen: SegFaultAX: #elixir-lang actually, and I'm already in there.

21:04 ddellacosta: on a related note, I've spent the last few weeks wrapping up Apache Shiro, and that has been an education

21:04 callen: SegFaultAX: I was advising him on template library design a couple days ago.

21:05 spreading the gospel of Selmer/DTL. >:)

21:05 SegFaultAX: Jinja is probably more canonical for that style of templating.

21:05 Or even django templates.

21:06 callen: SegFaultAX: Selmer's implementation very closely mimics that of the actual DTL.

21:06 not intentionally. Convergent design.

21:06 same preprocessed iterable -> runtime dispatch on nodes.

21:07 I have to go buy quarters, bbs.

21:15 muhoo: callen: my futon purchases have been from a place on chavez at evans

21:16 tho, best futon deals/selection are in berkeley

21:16 berkeley is ground zero of futons

21:18 futon stores in berkeley are like starbucks in the downtown sf, three on every corner

21:23 callen: muhoo: I'm talking shikibutons though, not western futons.

21:23 not the furniture thingies.

21:25 C

21:42 muhoo: dunno man. japantown, or, i still think berkeley is yer best bet

21:42 callen: muhoo: it's mostly that I don't trust the discretion of students in quality futons.

21:43 muhoo: students from japan?

21:44 lemme tell you, the discretion of those students in indian food is tip top

21:44 TEttinger: is this the right place to ask Light Table questions? My seesaw/swing app is not playing nice with the instarepl

21:44 callen: I've had good Indian food in Berkeley.

21:44 muhoo: indian food in berkeley is plentiful cheap and good

21:44 callen: I could live on Indian food forever ;_;

21:45 TEttinger: callen, isn't "Indian food" an incredibly broad category?

21:45 callen: TEttinger: yes, and I've enjoyed almost every single form of it I've tried.

21:45 TEttinger: including South Indian food in Malaysia, North Indian here in the bay area, and everything in between.

21:45 Indian food made old-style without tomatoes, Indian food made new-style with cream and tomatoes, anything.

21:46 I love it all. O_O

21:46 I can think of no other cuisine that I have so consistently enjoyed as Indian food.

21:46 TEttinger: I don't like curry, but naan is better than a lot of bread here. my experiences are limited though

21:46 callen: TEttinger: where are you?

21:46 TEttinger: southern california

21:46 san gabriel valley area

21:46 callen: I don't know if I had any Indian food in LA or not.

21:46 TEttinger: there's a pretty good amount

21:47 callen: I don't think so. Had some good Thai food though.

21:47 TEttinger: oh yes.

21:50 the 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:50 callen: TEttinger: easy enough to know how authentic the food is here - look around for natives.

21:50 TEttinger: (literally live, still moving as he ate it)

21:51 callen: are you sure it wasn't that salt activated post mortem thing?

21:51 muhoo: TEttinger: persian food in glendale.... best i've had

21:51 TEttinger: no, actually, not sure

21:51 muhoo, oh yeah, I've had some killer baklava in glendale

21:51 callen: where it jiggles from the salts in the soy sauce.

21:51 muhoo: tehran-dale?

21:52 SegFaultAX: Multigrain cherios are delicious. Just sayin.

21:53 TEttinger: there's one place my egyptian friend swears has the best baklava he's ever had, and it's in glendale IIRC

21:53 callen: TEttinger: there's a turkish place near where I live in MV that has good baklava.

21:53 I don't know that I'd call it the best I've ever had though.

21:53 muhoo: callen: little armenia, really. mostly persian-armenians, who arrived after 1979

21:53 TEttinger: trying to remember MV

21:54 callen: muhoo: oh that's interested. Left because they were armenian christians?

21:54 interesting*

21:54 TEttinger: Mountain View

21:54 TEttinger: oh

21:54 muhoo: i learned to curse in persian AND armenian when living there.

21:54 SegFaultAX: My coworker is teaching me how to curse in Turkish!

21:55 muhoo: supposedly hungarian has the most curse words of any language, dunno where i picked up that factoid.

21:55 TEttinger: Armenia was the first officially christian nation, even before Rome became the Holy Roman Empire. the more you know...

21:56 callen: muhoo: I'd curse a lot if I was Hungarian too.

21:57 TEttinger: SegFaultAX, turkish has some really weird letters. BİTKİLERİN İYİLİĞİ

21:57 SegFaultAX: Yes indeed.

21:57 muhoo: ok well, we got our world history squared away. i gotta get back to clojure hacking now.

21:57 TEttinger: some turkish tea was very hard to google for because of that http://dogadan.com.tr/

21:58 SegFaultAX: I'm almost done with 4clojure...

21:59 Just 11 more to go.

22:00 TEttinger: the last one: write code that will hack our database to erase any records of you completing 4Clojure problems

22:01 callen: TEttinger: I wouldn't worry about that, 4clojure is using MongoDB - Mongo will do the job of erasing the data for you.

22:01 ddellacosta: callen: I know where to get you some futons. ;-)

22:02 TEttinger: *not allowed: let, fn, map, apply, filter*

22:02 callen: ddellacosta: that's just cheating man. but not out of the question.

22:02 ddellacosta: heh

22:04 callen: ddellacosta: 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:05 ddellacosta: callen: 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:06 callen: it may be possible to get them shipped via rakuten too, dunno: http://search.rakuten.co.jp/search/mall/敷布団/-/

22:10 SegFaultAX: 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:12 SegFaultAX: ddellacosta: I like puzzles.

22:13 ddellacosta: SegFaultAX: 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:13 SegFaultAX: ddellacosta: Rarely.

22:13 ddellacosta: But all my answers are also publicly available.

22:15 150 is tricky.

22:16 ToxicFrog: This function starts out (let [...] (binding [...] (let [...] ....

22:16 There has got to be a better way to do this.

22:18 ddellacosta: ToxicFrog: 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:22 clj_newb_2345: what does datomic use for it's backend to actually store the data

22:22 is it entirely self contained, relying on nothing but the JVM ?

22:23 callen: clj_newb_2345: Datomic has a pluggable storage backend. You should read the documentation, it answers your questions.

22:26 ToxicFrog: ddellacosta: 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:26 Then I bind it, then I let the result of calling a function that needs the binding, then I do things.

22:27 In other news, I hate namespaces.

22:27 seangrov`: callen: I'd say go down to Santa Clara for Korean futons... expensive, but good

22:27 I'm sure somewhere in Japantown has them too though

22:28 callen: seangrov`: 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:28 clj_newb_2345: ToxicFrog: how would you improve namespaces ?

22:28 seangrov`: callen: Same idea, generally same quality, generally same price

22:29 callen: seangrov`: oh I see. I'll keep that in mind as an option, thank you.

22:29 ddellacosta: ToxicFrog: 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:30 callen: Anybody that dislikes namespaces hasn't been bereft of them.

22:30 ddellacosta: I rather feel like namespaces are excellent in generally

22:30 general

22:30 callen: half of why I preferred Python to Ruby was namespacing.

22:30 * ddellacosta agrees with callen

22:30 ToxicFrog: clj_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:30 ddellacosta: nothing whatsoever, the hatefulness is separate.

22:31 callen: in general, I agree. In clojure specifically, they seem overly complicated.

22:31 callen: ToxicFrog: :use is kinda on the way out. it's isomorphic with :require :refer :all

22:31 ddellacosta: ToxicFrog: use = (require :refer :all)

22:31 jinx

22:31 this 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:31 callen: ToxicFrog: 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:32 ddellacosta: sorry, that was for ToxicFrog

22:32 callen: ToxicFrog: the only real lack of orthogonality in Clojure namespaces is :use vs. :require :refer :all, that's it.

22:32 namespaces 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:33 import is for Java, require is for Clojure. normal destructuring rules apply.

22:33 ToxicFrog: callen: is there a transcript of it?

22:33 callen: doesn'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:34 all the classpath stuff that is usually endemic to Java-world is handled for you by dint of Leiningen.

22:34 ToxicFrog: not that I'm aware of. InfoQ shindig. http://www.infoq.com/presentations/Clojure-Namespaces-Vars-Symbols

22:35 I hate audio/video content, if it's any consolation, but this was worth sitting through. Seriously.

22:35 that talk will clear up the entire matter for you, I think.

22:35 * ToxicFrog makes a note to watch it tomorrow

22:36 callen: once you understand var interning, symbols, and how namespaces work I think you'll be considerably more zen about it all :)

22:37 ToxicFrog: also, I don't know if you've noticed, but ":as" means the same thing everywhere in Clojure AFAICT, including :require

22:40 SegFaultAX: It's weird when your 4clojure solutions comes out super close to someone elses.

22:41 callen: should write a feature for 4clojure detecting your "peers"

22:41 futile: and that's the end of that chapter

22:47 SegFaultAX: I'm so close to the top 100 I can taste it. :)

22:48 ToxicFrog: Hmm. 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:53 Argh why can't it see the var

22:54 ddellacosta: is for lazy? I feel like I'm going crazy

22:54 I made a rhyme

22:54 cgag: yeah it is

22:54 * ddellacosta considers a new career as a poet, or maybe just getting some lunch

22:55 ddellacosta: cgag: okay, thanks, that would explain this weird behavior

22:55 ah, there it is in the docs, go figure

22:56 cgag: i'v e been bitten by that before

22:57 ToxicFrog: "*opts* does not exist" YES IT DOES aaaaagh

22:57 ddellacosta: yeah, dunno what I was thinking, I just spend ten minutes banging my head against the wall. "Why is nothing happening!?" D'oh

22:58 ToxicFrog: seriously, if you put some stuff in a refheap, I'll take a look. Just sayin'

22:59 ToxicFrog: ddellacosta: 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:59 ddellacosta: ToxicFrog: gotcha. Well, the offer stands.

23:11 ToxicFrog: Sorted out the problem

23:11 ddellacosta: ToxicFrog: what was it?

23:11 ToxicFrog: There was another file where I hadn't updated the :require and the error message was extremely confusing

23:12 Leading me to believe it was in a different file.

23:12 ddellacosta: hmm. yah, that can happen.

23:17 ToxicFrog: (more hateful than namespaces: clojure's 100+ stack frame compiler errors)

23:42 muhoo: haha, that's not clojure, that's java, mostly

23:43 i remember those from android too. spew spew spew spew spew wtf was actually wrong here?

Logging service provided by n01se.net