#clojure log - Mar 11 2013

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

0:36 hiredman: /win 15

0:41 akhudek: is there a summary of the changes going from jdbc 0.2.x -> 0.3.0 somehwere?

0:45 devn: technomancy: no, but im constantly growing :\

0:45 technomancy: 2013-03-11T04:47:00+00:00 heroku[web.1]: Process running mem=685M(133.9%)

0:46 technomancy: devn: is it ignoring JVM_OPTS?

0:46 Frozenlock: Hrphm... Any records of GoogleBot not playing nice with ring(jetty)?

0:46 devn: JAVA_OPTS: -Xmx384m -Xss512k -XX:+UseCompressedOops -javaagent:newrelic/newrelic.jar

0:46 technomancy: no JVM_OPTS set

0:46 Frozenlock: In the google webmaster tools, if I try 'fetch as google' it just fails miserably :(

0:46 technomancy: devn: that's weird; how did that happen?

0:47 devn: technomancy: i added newrelic according to the instructions on the heroku guide

0:47 technomancy: JVM_OPTS get set automatically for all new clojure apps

0:48 devn: technomancy: yeah, I unset it

0:48 :X

0:48 technomancy: the newrelic article mixes those two: It says JVM_OPTS in one place, and then gives you a command to set JAVA_OTPS

0:48 OPTS*

0:48 creese: what people using these days for db migrations?

0:49 devn: creese: people were talking about migratus earlier

0:49 technomancy: creese: defn =)

0:49 https://github.com/technomancy/syme/blob/master/src/syme/db.clj#L50

0:49 akhudek: creese: we use flyway

0:50 technomancy: migratus and ragtime are both decent. I don't like the approaches of lobos and drift.

0:50 devn: lobos is short for lobotomy

0:51 i keeed, it's fine, but i like migratus more personally

0:51 technomancy: im running like this "lein with-profile production ring server"

0:51 technomancy: Is there a way to trampoline that? Would that make anything better?

0:52 creese: cool

0:57 devn: technomancy: nevermind, that did it :)

0:57 creese: What is the status of korma now that CG has moved on? Is it still the preferred alternative to clojure.java.jdbc?

0:58 akhudek: I have come to appreciate java.jdbc more myself.

0:58 Though the api for 0.3.0 is still a mystery to me.

0:59 creese: I'm wondering if anyone has tried an interface like ring?

0:59 akhudek: I tried to write a simple aggregate in korma and after wrestling with it for 30min yet again, I just gave up and went to jdbc.

0:59 today

0:59 I think korma was supposed to be a simple interface. :-/

1:07 creese: migratus seems pretty good if you don't mind writing raw sql

1:11 akhudek: flywaydb also uses raw sql, it's pretty easy to use. Don't think migratus was around when I chose flyway.

1:11 in any event, raw sql is quite flexible

1:16 technomancy: creese: honeysql is an attempt at making a compilation target-ish thing for sql

1:16 I would recommend c.j.jdbc more except for the fact that putting SQL in strings where you don't get syntax highlighting makes it hard to catch certain types of mistakes

1:56 holo: hi

1:59 did anyone notice that when submiting a form with hiccup, keywords with dots get converted to strings? i'm not sure yet if hiccup is the one doing it though

2:08 tomoj: $latest com.datomic/datomic-free

2:08 lazybot: [com.datomic/datomic-free "0.8.3826"] -- https://clojars.org/com.datomic/datomic-free

2:08 tomoj: tyler__: ^

2:08 tyler__: tomoj: woah cool feature, thnx

2:08 tomoj: (inc Raynes)

2:08 lazybot: ⇒ 22

2:08 tyler__: $latest cheshire.core

2:08 lazybot: No project by this name exists on clojars.

2:09 tyler__: derp

2:09 $latest cheshire

2:09 lazybot: [cheshire "5.0.2"] -- https://clojars.org/cheshire

2:09 tyler__: :)

2:11 holo: (inc Raynes)

2:11 lazybot: ⇒ 23

2:12 tyler__: (-> Raynes inc)

2:12 meh

2:16 holo: did anyone also noticed that while destructuring maps, keywords with dots are not supported? i get java.lang.ClassFormatError: Illegal field name when trying that

2:17 amalloy: holo: nothing to do with destructuring, i suspect

2:17 &(let [x.y 1] x.y)

2:17 lazybot: java.lang.ClassFormatError: Illegal field name "x.y" in class sandbox50899$eval54439

2:18 holo: amalloy, yes, in let bindings

2:18 &(def x.y "foo")

2:18 lazybot: java.lang.SecurityException: You tripped the alarm! def is bad!

2:19 holo: hun? def is bad?

2:20 (def x.y "foo")

2:21 n_b: ,(def x.y "foo") to activate the other bot

2:21 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

2:21 n_b: Assumed that would happen

3:05 clj_idiot: All clojure functions are Runnable. With ".start" on a function, Clojure will create a new thread to execute the function. Is the thread auto destroyed when the function terminates?

3:16 alandipert: clj_idiot: function invocation doesn't necessarily create a thread

3:16 clj_idiot: (.start (Thread. my-fun)) does

3:17 I should have been clearer with what I meant.

3:17 my fault.

3:32 alandipert: clj_idiot: yeah i think in that case the thread dies when the function returns

5:10 clj_idiot: I know that Clojure has STM, Agents, and Atoms. Dumb question: is it possible to implement (non-infinite-looping) Semaphores interms of these 3?

5:57 lispy_: hey guys, I'm using clojure.string/replace to convert a linux path into a windows path, but its dying on the backslash, is there a tried and tested/recommended way to do this ? currently getting StringIndexOutOfBoundsException String index out of range: 1 when running (replace "/some/path/to/that" #"/" "\\") in repl

5:59 vijaykiran: lispy_: be lazy and use :http://commons.apache.org/proper/commons-io/javadocs/api-1.4/org/apache/commons/io/FilenameUtils.html :)

6:00 lispy_: thanks for the pointer

6:01 Ember-: I think that is a bug

6:01 it sure as hell should be able to do that replacement

6:03 Anderkent: it probably tries to interpret the \\ as a pattern instead of string?

6:03 Ember-: nope, that same bug occurs with java string

6:03 &(.replaceAll "/some/path/to/that" "/" "\\")

6:03 lazybot: java.lang.StringIndexOutOfBoundsException: String index out of range: 1

6:03 Ember-: and

6:03 &(.replaceAll "/some/path/to/that" "/" "\\\\")

6:03 lazybot: ⇒ "\\some\\path\\to\\that"

6:03 Ember-: very interesting :)

6:04 Anderkent: Note that backslashes () and dollar signs ($) in the replacement string may cause the results to be different than if it were being treated as a literal replacement string. Dollar signs may be treated as references to captured subsequences as described above, and backslashes are used to escape literal characters in the replacement string.

6:04 but curiously \\\\ doesnt do the right thing either

6:05 oh nvm it does

6:05 Ember-: yes, it does

6:05 clgv: Anderkent: you can always check with `println`

6:05 Anderkent: i was just confused by it being prnd instead of printed

6:05 yeah yeah

6:05 Ember-: but imho the first version should work

6:05 lispy_: sorry, confused… does : (.replaceAll "/some/path/to/that" "/" "\\\\") work ?

6:06 is the double char ok in the result ?

6:06 Anderkent: lispy_: yes

6:06 lispy_: oh cool

6:06 Anderkent: do print

6:06 lispy_: thanks

6:06 Anderkent: ,(println (.replaceAll "/some/path/to/that" "/" "\\\\")

6:06 lispy_: oh I see

6:06 Anderkent: oups

6:06 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

6:06 lispy_: cool

6:06 Ember-: &(.replaceAll "/some/path/to/that" "/" "\\\")

6:06 lazybot: java.lang.RuntimeException: EOF while reading string

6:06 Anderkent: :D

6:06 Ember-: and that comes from clojure.lang.Util.runtimeException (Util.java:219)

6:06 clgv: ,(println (.replaceAll "/some/path/to/that" "/" "\\\\"))

6:06 clojurebot: \some\path\to\that\n

6:06 Anderkent: ember you had 3 backslashes instead of 4

6:07 Ember-: yeah I know

6:07 was just trying

6:07 what happens in that case :)

6:07 clgv: but why would you do that anyway? java is totally fine with slashes in filenames afaik

6:07 Ember-: c:\\foo\\bar evaluates to c:\foo\bar

6:08 not pretty but works

6:08 Anderkent: ah, the backslash behaviour is so that you can do

6:09 ,(println (.replaceAll "/a/s/d/f" "/" "\\$1"))

6:09 clojurebot: $1a$1s$1d$1f\n

6:09 Anderkent: which otherwise tries to grab the 1st match group

6:10 efjboss: still, that behaviour is pretty damn terrible

6:12 clgv: Anderkent: that is not the entire explanation. another reason is the backslash is used for nonprintable characters like "\n" as well

6:13 or say "special characters"..

6:18 Anderkent: clgv: as in "\\n"? that seems to do the intuitive thing (i.e. print out \n literally). "\n" is of course the newline, no surprise there. Only reason you need to double escape the backslash is because the replacement string is not a literal string, but a pattern-like thing (i.e. it can reference groups)

6:18 clojurebot: Ik begrijp

7:51 clj_idiot: in clojure, can https://github.com/swannodette/delimc be used to simulate lightweight co-routines ?

9:25 nonuby: whats the easiest way of ([:a 1][:b 2][:c 3]) into a map { :a 1 :b 2 :c 3}

9:25 dan_thiffault: lein ?: If I'm reading eval-in-project correctly it spawns a separate process. Short of manually managing I/O (file, open net port, etc) is there way of returning state to the parent process?

9:26 clgv: nonuby: (into {} '([:a 1][:b 2][:c 3]))

9:26 ,(into {} '([:a 1][:b 2][:c 3]))

9:26 clojurebot: {:a 1, :b 2, :c 3}

9:27 bloop: I'm a little confused about how to get around how symbols are qualified in macros. It seems like too much of a pain. What is the best way to write (defmacro mac [exp] `(let [f (fn [n] (max 1 (- n external)))] ~exp)) where "external" is a captured lexical variable in the context where the macro is called and of course f and n are lexical variables the I want to define in the macro, and f being one that I want access to in the code t

9:30 clgv: bloop: do not use namecapturing. let the user provide the names in the macrocall

9:31 bloop: clgv: even for the one that does not escape the macro ("n")?

9:31 clgv: bloop: can you provide a concrete complete example?

9:32 bloop: clgv: the one I provided is actually exactly what I'm trying to write with the names changed.

9:32 bsteuber: bloop: no, for ones that don't escape the macro, use n#

9:32 bloop: also, I'm only using this in two places to save some typing for myself. It's not like, an interface.

9:32 bsteuber: for those that need to escape in a controlled way, use arguments as clgv said

9:33 clgv: bloop: I didnt understand the idea of "external" in that code

9:33 bsteuber: but if you really want to do ugly stuff

9:33 try ~'foo

9:33 bloop: exactly, I want ugly-ass CL-style macros :p

9:33 bsteuber: this will generate the exact symbol foo with all the traps you loce from the c preprocessor :)

9:33 love

9:33 clgv: bloop: e.g. (defmacro mac [external, f, exp] `(let [~f (fn [n#] (max 1 (- n# ~external)))] ~exp))

9:35 bloop: hm i think the solution here is to not use a macro

9:35 liek in scheme, making it hygienic costs mroe typing than i save by using it

9:35 clgv: bloop: most of the time the solution is to not use a macro ;)

9:36 bsteuber: yeah that's usually best - but in case you ever feel the need to do dirty things, use ~'my-captured-symbol

9:36 clgv: I do not think about creating a macro unless I spotted a pattern that can not be implemented via functions for at least 3 times ;)

9:37 xumingmingv: Does the lein plugin `native-deps` works with lein2?

9:38 https://groups.google.com/forum/#!topic/leiningen/dbQBuXWmpko

9:38 clgv: xumingmingv: leiningen has a list on the wiki with plugins that were confirmed to work with leiningen 2

9:42 xumingmingv: I recall that you do not need a plugin for native deps with lein2 anymore. you can research how overtone does it...

9:43 xumingmingv: clgv: thanks, I am trying to use this: https://github.com/pkamenarsky/atea

9:43 jcromartie: stuartsierra: hey, a while back you mentioned keeping global state out of top-level vars?

9:43 xumingmingv: which tells me to run `lein native-deps`

9:43 jcromartie: like, if I wanted to have a simple in-memory data model

9:44 stuartsierra: would bindings be a suitable alternative when handing off the refs from a HTTP (compojure) handler?

9:44 stuartsierra: I prefer passing all state as explicit arguments.

9:44 I will be talking about this at Clojure/West.

9:44 jcromartie: but where do you get it from in the first place? i.e. where does the long-term state "live"?

9:45 I will definitely be folling the conf

9:45 following*

9:45 clgv: jcromartie: I have it living in a deftype in one of my web applications

9:45 jcromartie: deftype? interesting

9:46 clgv: jcromartie: could be an atom with regular clojure data structures as well

9:46 jcromartie: well yeah, a ref/atom/agent/etc.

9:46 that's the obvious part

9:46 jtoy: what am I doing wrong with this regex? (re-find (re-pattern "\bcar\b" ) "car")

9:46 clgv: jcromartie: I pass it to the function when creating the routes for the webapp

9:47 jtoy: versus this: (re-find #"\bcar\b" "car")

9:47 stuartsierra: clgv, jcromartie: Yes, you can create an "instance" of your web app which closes over its state.

9:47 jtoy: shouldnt they be the samething?

9:47 jcromartie: :P

9:48 stuartsierra: that's what I was thinking… would it be easiest to achieve with bindings?

9:48 I think I get it

9:48 stuartsierra: I always recommend not to use bindings unless you really have thread-local semantics.

9:48 clgv: jtoy: (re-find (re-pattern "\\bcar\\b" ) "car")

9:49 jtoy: ah

9:49 thx

9:50 jcromartie: hm… yeah, I am going to have some concurrency… I'd love to see an example of this

9:51 clgv: do you have any example code out there?

9:51 I guess you wouldn't have any top-level routes either

9:51 clgv: jcromartie: no.

9:52 jcromartie: so like, (defn make-routes [foo bar] (routes (GET "/whatever" [] (do-stuff-with foo bar))))

9:52 clgv: jcromartie: yes, I create the routes within a function that is called from my main-function which also starts jetty

9:52 jcromartie: ah ha

9:52 that makes lots of sense

9:53 and do you give yourself a way to access that running context?

9:53 clgv: my deftype contains all the context I need

9:53 jcromartie: well I mean once you pass it to Jetty, can you access your state via a REPL

9:54 or your startup routine returns a structure with the Jetty server and the deftype with your state

9:54 ?

9:56 clgv: I just return the jetty instance but I could at the context data as well. I did not need it though

9:56 *add

9:59 stuartsierra: I usually have a top-level "system" object, def`d at the REPL, that contains anything I might need access to.

10:01 ambrosebs: stuartsierra: Any chance you could set up github+maven for tools.analyzer.jvm for me?

10:02 It's the last dep for core.typed.

10:02 stuartsierra: ambrosebs: Working right now, but I'll take a look when I have time. Probably after Clojure/West.

10:02 ambrosebs: Cool

10:02 stuartsierra: And I don't have access to GitHub … email clojure-dev for that.

10:02 jcromartie: stuartsierra: that makes sense

10:02 thanks for the tips guys

10:03 ambrosebs: Sure, yep emailed on Friday. Cheers

10:04 stuartsierra: Everyone's really busy getting ready for Clojure/West, so I'm afraid you can't expect much movement before then.

10:05 ambrosebs: ok

10:54 tyler__: woah in clojure docs it says "Tagged literals are Clojure's implementation of edn tagged elements."

10:54 did edn come before clojure?

10:55 hyPiRion: no

10:55 duck1123: edn never had a name at first. It was all just the clojure syntax.

10:56 tyler__: ah gotcha

10:56 how new is it? i just realized it was a thing last night when i was playing with datomic

10:57 duck1123: initial commit was 6 months ago

11:20 esmo: hi all, anyone mind explaining this? (clojure.string/replace "BrEaKs?" #"(?i)break" "work") returns "works?" on clj, "BrEaKs?" on cljs

11:20 bug in clojurescript's regex implementation, or me being dumb?

11:20 ljos: esmo: clj uses java regex, but cljs uses javascript regex.

11:21 esmo: i realize that, but i'd expect the results to be the same?

11:21 the cljs compiles to something like this: function Pg(){return clojure.sb.replace.c?clojure.sb.replace.c("BrEaKs?",/break/i,"work"):clojure.sb.replace.call(l,"BrEaKs?",/break/i,"work")}

11:23 dnolen: esmo: happy to take a patch that fixes the issue, I believe the problem is that it happens at the level of the reader.

11:26 TimMc: Wow, I didn't realize CLJS did regex translation.

11:26 leku: &(- 4419 1037)

11:26 lazybot: ⇒ 3382

11:27 esmo: yeah, looks a bit hairy, not sure if i want to start poking into it :) i'll just see if i can get it to work somehow first

11:36 mrb_bk: good morning #clojure

11:37 dnolen: cool details on the hangout! glad you could make it

11:39 dnolen: mrb_bk: was fun!

11:40 mrb_bk: dnolen: it's cool to see how much of a back and forth it is right now between mK and core.logic

11:42 dnolen: mrb_bk: yes! while the implementation details may be different - high level goals are more or less the same.

11:49 jcromartie: hey

11:50 ambrosebs: dnolen: I was thinking about the "forgot to wrap in an all block" minikanren issue. Perhaps a little static analysis could help pick up those bugs. I think a goal would very often only be one expression, so it might be useful to warn in other cases.

11:51 Some macroexpansions might get in the way though.

11:51 dnolen: ambrosebs: I'm assuming the analysis would need annotations about what functions are actually goals.

11:51 ambrosebs: Probably.

11:55 dnolen: ambrosebs: sounds interesting! our discussion yesterday did make me curious whether it would be easy or hard to reuse some of the core.typed infrastructure to do miniKanren/core.logic specific analyses

11:55 ambrosebs: It seems like core.typed is a good base to build on.

11:56 mrb_bk: that would be awesome

11:56 ambrosebs: I'm looking closer into Mercury.

11:56 mrb_bk: ambrosebs dnolen: the 'threading the failures through the macro' idea is also awesome

11:57 dnolen: ambrosebs: it's pretty interesting. I wish it didn't take a 2.66ghz i7 8 hours to compile to damn thing.

11:57 noidi: ambrosebs, is there a core.typed mailing list / google group?

11:57 mrb_bk: oh wow, mercury has a JVM backend? wild

11:58 ambrosebs: noidi: nope, just the clojure ml for now.

11:59 noidi: ambrosebs, I noticed that the type for clojure.core/seq is too restrictive. It doesn't allow Strings as input (they are not Seqable), although seq supports them.

11:59 ambrosebs: I've (kinda) fixed that in master.

12:00 noidi: ok, cool! how did you type it?

12:01 ambrosebs: Added an "unchecked-ancestors" field for Classes, and added (Seqable Character) as an ancestor for CharSequence and String :/

12:01 A hack I've been procrastinating on for about a year

12:01 Feels dirty.

12:01 noidi: yes, it does :)

12:02 ,(instance? clojure.lang.Seqable "foo")

12:02 clojurebot: false

12:02 ambrosebs: Yep it sucks.

12:03 Seqable doesn't really mean too much in Clojure JVM. There's about 5 corner cases.

12:04 TimMc: cemerick: Hey, did you decide to do something different with that timing-resistant string comparison in friend?

12:04 cemerick: TimMc: Refresh my memory :-)

12:05 technomancy: oh, is friend getting the codahale treatment? =)

12:05 noidi: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L480

12:05 there are all sorts of special cases in seqFrom, which IMHO seq's type should reflect

12:06 it'll be an ugly union type, but that's what seq's expecting :)

12:06 TimMc: cemerick: When Micha?el Stone did the walkthrough of friend at the Clojure meetup, he pointed out some code that was doing string comparison with data-independent timing. I can't find it now, so I'm wondering if you outsourced it.

12:06 cemerick: TimMc: oh, that; he was talking about ring in that case, not friend

12:06 technomancy: TimMc: related to http://codahale.com/a-lesson-in-timing-attacks/ ?

12:07 TimMc: cemerick: Ah! Right.

12:07 cemerick: TimMc: https://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/middleware/session/cookie.clj#L80

12:07 TimMc: technomancy: Yeah, I am happen to be in the market for a string comparator like that.

12:07 ambrosebs: noidi: yes, you're right.

12:07 noidi: but it still sucks :)

12:08 cemerick: TimMc: just make sure you don't use a fn that can return (reduced) ;-P

12:08 TimMc: I was thinking of just loop/recur over the strings and checking the XOR at the end, but maybe comparing hashes would be better.

12:09 I guess there's not much I can do to avoid leaking string length.

12:09 technomancy: can't you pad/truncate the unknown string to match the one submitted?

12:09 cemerick: TimMc: pad

12:10 TimMc: As long as the time to pad doesn't reveal too much. :-P

12:14 yedi: is there a service similar to pastebin that deletes the contents of the paste after a period of time?

12:14 TimMc: yedi: Yeah, use Refheap and set a lazybot timer to tell Raynes to delete the paste. :-P

12:15 noidi: yedi, pastebin.com has an expiration setting :P

12:16 yedi: oh derp

12:16 TimMc: nDuff will still yell at you, though

12:16 technomancy: http://paste.debian.net has an expiration setting and won't get nDuff yelling at you for ads

12:32 tyler__: do i have to worry about clojurewest selling out? i still haven't bought a ticket

12:32 TimMc: Hmm, how do I make RET behave like C-j with paredit? It worked fine in my Emacs 23...

12:38 ystael: TimMc: (add-hook 'clojure-mode-hook '(lambda () (local-set-key (kbd "RET") 'newline-and-indent)))

12:39 TimMc: ystael: Oh man, that is much better! Thank you.

12:39 chronno: TimMc,ystael: I have it bound to 'paredit-newline

12:40 chronno: seems to be a little different. From the docs:

12:40 TimMc: Yeah, that's what I ended up using.

12:40 chronno: Insert a newline and indent it.

12:40 This is like `newline-and-indent', but it not only indents the line

12:40 that the point is on but also the S-expression following the point,

12:40 if there is one.

12:40 rasmusto: I'm a paredit newbie (using paredit.vim) what's C-j do?

12:40 ystael: chronno: I actually specifically don't want that because occasionally I prefer indents different from what Emacs wants to do.

12:40 TimMc: rasmusto: *Basically* newline.

12:41 paredit switched how it handled RET vs. C-j in version 20.

12:41 chronno: ystael: oh, makes sense. I just use emacs indentation blindly :-)

12:41 rasmusto: TimMc: does it handle indenting differently or something?

12:42 ystael: chronno: It would probably make more sense for me to fix Emacs's indenter so I can do the same, but, y'know, tuits.

12:42 chronno: ystael: he

12:42 hiredman: TimMc: paredit did, or clojure-mode did?

12:42 piranha: alandipert: hm, are you online already? :)

12:44 hiredman: https://github.com/technomancy/clojure-mode/commit/c2077d48858a507d03cab4416038bd95b70e1464

12:44 TimMc: hiredman: http://mumble.net/~campbell/emacs/paredit.release

12:44 Search for "exchanges".

12:44 piranha: alandipert: just thought you might be interested what I did in the end with 'list of records': https://github.com/piranha/pairword/blob/master/src/pairwords/templates.cljs#L24 (here el is parent element and data is a cell)

12:45 zackzackzack: Is there a way to configure leiningen to run each file within test with it's own jvm?

12:46 hiredman: zackzackzack: https://github.com/joegallo/lein-test-bang-bang but it needs updating to lein2

12:47 technomancy: should be an easy fix

12:47 zackzackzack: Yeah, it's not a super complicated project from the looks of it.

12:48 What's the process for upgrading from lein1?

12:48 technomancy: zackzackzack: just shift over the refers that have moved. bultitude instead of leiningen.util.ns; leiningen.core.eval instead of leiningen.compile

12:49 zackzackzack: Thanks I'll see what I can do

13:01 mmitchell: anyone know if there is a convenient way to close the nREPL error buffer in emacs and have emacs go back to the main buffer?

13:04 The old swank error buffers would go away by pressing 0, I guess I'd like that back :)

13:04 technomancy: mmitchell: maybe q?

13:05 mmitchell: technomancy: ahh nope, that'd be perfect though

13:05 technomancy: hm; at one point that worked

13:06 mmitchell: oh hmm, "nrepl-popup-buffer-quit-function" might do the trick

13:16 `fogus: dnolen: Any recommendations for good information on finite domains?

13:17 dnolen: `fogus: Mozart/OZ tutorial http://doc.rz.ifi.lmu.de/programming/mozart/print/tutorial/FiniteDomainProgramming.pdf

13:20 `fogus: or Bratko 4th edition Prolog for AI

13:25 `fogus: dnolen: So is it safe to assume that fd is an official core.logic feature? Now and in the future?

13:26 dnolen: Thanks for the refs BTW.

13:27 dnolen: `fogus: the functionality yes. Probably can't make any promises beyond that - we might get polymorphic constraints.

13:28 `fogus: dnolen: What about the API? If it grows then that's cool, but will what's there stay stable?

13:29 dnolen: Do you know if earlier Bratko edition has DF?

13:29 bhenry: how would i decode/encode html form params in an old clojure app? my whitespace is suddenly going to the database as plus signs and i don't know what changed in the app.

13:29 dnolen: `fogus: well if constraints become polymorphic I'll probably keep around the fd/foo for backwards compat.

13:30 `fogus: I'm assuming it does since it's covered in 3rd ed, and 4th expands on the CLP stuff.

13:42 `fogus: dnolen: Thank you sir

13:49 jamiei: silly question: if a method destructures it's params like this (http://pastebin.com/2bA64Ycc), how can I pass in a hash of the params I want?

13:52 ambrosebs: jamiei: (apply make-conn (mapcat identity {...})) would probably work.

13:52 I think people have made functions to handle this, not sure where they live.

13:54 jamiei: ambrosebs: That's great, thank-you. I also thought there might be an existing method for this.

13:54 ambrosebs: np

13:54 zackzackzack: technomancy: https://github.com/joegallo/lein-test-bang-bang/pull/1

13:55 `fogus: jamiei: I've used variants of https://gist.github.com/fogus/5136209

13:56 technomancy: zackzackzack: nice

13:56 zackzackzack: you shouldn't include changing the group-id as part of the pull request though

13:56 rasmusto: I never know when to use [& {:keys [arg]}] or [{:keys [arg]}] when I'm only passing in keyworded stuff, any good arguments for either method?

13:56 technomancy: zackzackzack: also: mapcat instead of map+flatten

13:56 zackzackzack: I'll fix that right quite

13:59 rasmusto: ah, I guess partial application of kwargs would be a good argument for the former

14:01 zackzackzack: technomancy: Thanks! Hope this actually does what I hope it will.

14:02 jamiei: `fogus: interesting

14:10 TimMc: Looks like ring's secure-compare will break when given two 0-length strings.

14:44 jcromartie: is there really any reason not to use a ref when it doesn't need to coordinate with anything else?

14:44 I know I could use an atom right

14:44 Raynes: Atoms are cooler.

14:45 jcromartie: hah

14:45 but really

14:45 if my state doesn't need to coordinate with anything right now

14:45 it might as well be an atom right?

14:45 but if it *might* need to coordinate with something

14:47 Raynes: are you being serious?

14:47 Raynes: jcromartie: Not at all. I don't know the answer since I'm not nearly as thoughtful as you and have never cared one way or the other.

14:47 jcromartie: hah

14:48 maybe I should stop caring

14:48 it would save the channel a lot of overhead

14:49 pjstadig: jcromartie: less overhead. atoms use compare and swap, but refs use locks

14:55 jcromartie: https://gist.github.com/pjstadig/5136670

14:55 [standard microbenchmark disclaimer and such]

14:55 jcromartie: thanks, that's enlightening

14:56 tomoj: took me such a long time to notice :{min,max}-history

14:56 I never use refs :/

15:01 jcromartie: tomoj: atoms do it for you huh?

15:01 I see the need for refs when you need to synchronize two separate references

15:09 matthavener: seems to me that no refs indicates a really nice separation between parts in a design

15:09 so orthogonal there's nothing to synchronize between them

15:13 jcromartie: yes

15:18 why is compojure middleware flattening my JSON objects!?

15:18 * `fogus is a human clause-order optimizer

15:19 weavejester: jcromartie: Probably because you're returning a raw map rather than wrapping the JSON in a response.

15:19 jcromartie: weavejester: I should clarify, it's on the way in

15:19 json params

15:19 er, a JSON POST body

15:20 weavejester: jcromartie: What middleware are you using to parse it?

15:20 Compojure itself doesn't touch the parameters.

15:20 jcromartie: no, it's the handler/api that does it

15:22 weavejester: jcromartie: Possibly wrap-nested-params is doing it then

15:22 jcromartie: yeah

15:22 weavejester: jcromartie: But you don't need to use handler/api. Just apply the middleware you want manually.

15:22 jcromartie: but it would be nice to figure out how to accept both :|

15:23 but this whole API should be JSON anyway

15:23 weavejester: jcromartie: You wanted nested parameters (e.g. foo[bar]=baz) and JSON?

15:23 jcromartie: I don't see why both shouldn't be able to play together

15:23 weavejester: You could also put your JSON middleware on the inside

15:23 jcromartie: no, since the request body stream is already read

15:23 by wrap-params

15:24 weavejester: jcromartie: In which case, you have a bad content-type

15:24 jtoy: can someone recommend me a page to read about that discribes how to resolve issues created from macros that call macros, specifically I get an error: java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.lang.String

15:24 weavejester: jcromartie: wrap-params will only read the request if the content-type header is set to: application/x-www-form-urlencoded

15:24 jcromartie: hm

15:24 I see

15:25 weavejester: jcromartie: For a lot of applications, like curl, that tends to be the default content type unless you specify otherwise.

15:31 gfredericks: jtoy: could you share some code?

15:31 jtoy: macros don't normally "call" other macros; they emit code that contains macro calls

15:33 bloop: I'm using compojure for exlipse and trying to access the filesystem with clojure.java.io. I've set :resource-path "resources/" in project.clj and yet (io/resource "") returns the url for the "test" folder in the project rather than the "resources" folder. What gives?

15:36 jcromartie: huzzah

15:38 weavejester: bloop: The test folder is on the classpath as well. I'm surprised (io/resource "") returned anything, since that isn't really a resource.

15:41 alandipert: piranha: very cool

15:41 piranha: alandipert: it should track already created elements, of course, but that's a bit harder :))

15:45 bloop: weavejester: I'm still confused. I've got it now so that it can find files in test (is this desired just because it's in the classpath? I mean, it can't access files in src...) and also in /resources/, but the URL for files in /resources will say /bin/ instead...

15:46 weavejester: bloop: A resource, as Java understands it, is any file on the classpath.

15:47 bloop: If you're running using Leiningen, that will include the files in all the jars, the resources directory, the test directory, and the source directory.

15:47 jcromartie: this is feeling weird

15:47 weavejester: Probably some system directories as well

15:48 jcromartie: I want to parse JSON or else fail with a message

15:48 Raynes: technomancy: http://felixge.de/2013/03/11/the-pull-request-hack.html Someone discovered your project management style.

15:48 jcromartie: so I'm returning a vector of [succeess json-or-message]

15:48 bloop: weavejester: hm. ok. thanks

15:50 gfredericks: jcromartie: exceptions aren't appropriate?

15:51 jcromartie: gfredericks: that's the tricky part

15:52 Cinesino89: hello

15:52 ciao

15:52 weavejester: I'd have thought the JSON parser would except if it fails

15:52 Hello

15:52 jcromartie: it does

15:52 I want to pass the JSON result to a handler

15:52 but I don't want to mask any exceptions that happen in the handler

15:52 weavejester: Why would you need to mask exceptions

15:52 jcromartie: hold on

15:52 weavejester: ?

15:52 jcromartie: hold on

15:52 weavejester: I mean, they'd just bubble up.

15:53 Cinesino89: sorry guys

15:53 mirc but do not discharge more files?

15:53 jcromartie: here https://gist.github.com/jcromartie/8e68edf100684ddcadfd

15:54 this borrows from the other wrap-json-params

15:54 but uses clojure.data.json, and it provides a useful HTTP failure mode

15:55 Raynes: People who don't use cheshire are merely kidding themselves.

15:55 Cheshire is the One Right and True way.

15:56 weavejester: Hum, I don't like the way of catching the exception...

15:56 It would be better to catch as part of the middleware

15:57 I don't understand why you catch it, then return a value, then use an if statement to test for success

15:57 You're basically doing the same thing twice.

15:58 jcromartie: If the catch statement was in wrap-json-params instead, you'd have an easier time.

16:00 trptcolin: pretty sweet recruiter line: "[…] join an all-star Clojure team as they work solve the big-data problem."

16:01 i'll work solve the hell out of the big-data problem

16:01 bloop: Raynes: what do you like about cheshire?

16:05 Raynes: I guess i could just read the github page :p.

16:05 jcromartie: the big data problem is hard

16:07 gfredericks: so lein says that the :dev :provided :user and :base profiles are activated for each task. But presumably not for the build tasks like uberjar?

16:09 I'm trying to figure out the normalest way to have stuff on the classpath for dev that doesn't get deployed

16:11 jcromartie: how about this for JSON parsing middleware https://gist.github.com/jcromartie/8e68edf100684ddcadfd

16:13 jonasen: dnolen: ping

16:19 technomancy: Raynes: I stole it from Evan Phoenix (rubinius)

16:20 jcromartie: are any of the getprismatic.com guys here?

16:29 technomancy: gfredericks: that's right; default profiles are explicitly stripped out by jar/uberjar

16:29 gfredericks: default profiles? like all 4 of them?

16:29 just trying to make sure I know exactly what's going on

16:30 technomancy: yeah

16:31 gfredericks: What is :base intended to be used for?

16:32 technomancy: gfredericks: stuff like putting :dev-resources on the classpath

16:32 basically :dev but for stuff that ships with lein itself rather than being read out of project.clj

16:33 gfredericks: oh okay so it's defined in leiningen

16:33 technomancy: aye

16:33 solussd: could someone tell me what is going on here? : https://www.refheap.com/paste/54065bed3548d9c12c463ff1c

16:33 gfredericks: solussd: the whole outer form is compiled at ance

16:33 once*

16:33 before line 11 is run

16:34 technomancy: clojurebot: what is the gilardi scenario?

16:34 clojurebot: The Gilardi Scenario is where you can't compile a form because the form contains definitions needed to compile itself: http://technomancy.us/143

16:34 technomancy: solussd: ^

16:34 gfredericks: clojurebot: who is technomancy?

16:34 clojurebot: technomancy is to blame for all failures

16:34 solussd: gfredericks: neat. that's the distillation of a problem i'm having in a macro... glad i'm not going crazy. thanks

16:35 technomancy: clojurebot: I'll take obscure compiler gotchas for 200, Alex.

16:35 clojurebot: the scala compiler | is | <reply> see: http://harrah.github.com/browse/samples/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala.html#65760

16:35 gfredericks: technomancy: so long story short, the :dev profile is appropriate for local dev classpath stuff

16:35 technomancy: gfredericks: yeah, for stuff that you want everyone hacking on the project to have access to

16:50 tgoossens: I have some questions about clojure.org (the website). Who should I contact?

16:50 brehaut: tgoossens: tried the mailing list?

16:50 tgoossens: maybe not such a bad idea

16:50 technomancy: I think puredanger helps with it

16:52 jweiss: "Warning: protocol #'katello.rest/CRUD is overwriting function delete" not very helpful when it doesn't tell me which namespace this is happening in.

16:52 any way to find out?

16:52 gfredericks: katello.rest is not the appropriate namespace?

16:52 jweiss: gfredericks: i have (:refer-clojure :exclude (get read delete)) in that ns

16:53 technomancy: jweiss: did you add it recently?

16:53 jweiss: technomancy: no, this is a fresh repl

16:53 technomancy: oh, ok

16:53 gfredericks: ,clojure.core/delete

16:53 clojurebot: #<CompilerException java.lang.RuntimeException: No such var: clojure.core/delete, compiling:(NO_SOURCE_PATH:0:0)>

16:53 jweiss: oh i see now

16:54 silly me, i left a function in there called delete.

16:54 i assumed it was clojure.core that had the conflict

17:07 bendlas: alandipert: I'm playing with javelin and encountering some behavior where I'm not sure if it's bugs or I'm doing it wrong. Do you have a few minutes to look at it?

17:08 alandipert: bendlas: sure

17:10 bendlas: cool, so I have this (defn fetch [path] ...), which returns a cell that will be reset with the content of path, as soon as xhr is finished

17:11 first of all, it'd be great to be able to leave a cell uninitialized, until it's first reset!

17:11 since I couldn't find that possibility, I tried (cell (init-dom (fetch "/path")))

17:12 here init-dom is passed the cell itself

17:13 next try: (let [res (fetch "/path")] (cell (when res (init-dom res)))), here the when is ignored and init-dom is called with a nil

17:13 alandipert: my question is, how should it behave in those cases and can I help to make it happen?

17:14 alandipert: bendlas: what kind of data does fetch return?

17:15 bendlas: fetch returns a cell, which will be reset to a string

17:16 but everything I described, happens in the first update, when it is updated from uninitialized to nil

17:17 alandipert: bendlas: the javelin-y way would be to have a named (cell "") that is reset! by the fetch fn

17:18 bendlas: and on which formulas dealing in strings are built

17:19 bendlas: alandipert: ok, that answers the firsst question. What about (cell (when outer-cell (do-something outer-cell)))

17:20 in my test case, the when is ignored, such that do-something is called, even when the current value of outer-cell is nil

17:20 that's not supposed to happen, right?

17:21 alandipert: bendlas: right, that could be a bug. would you mind pasting code somewhere?

17:23 bendlas: alandipert: sure, hold on a second

17:26 alandipert: here is an excerpt from my actual code https://gist.github.com/bendlas/5137917

17:27 mye: Is there a clojureScript implementation of the 1.5 edn namespace or what is the equivalent?

17:28 eg. if I send something with #inst or #uuid can cljs read it?

17:29 technomancy: wait people actually use #uuid?

17:29 bendlas: mye: clojure.edn is a very recent addition, it hasn't been mirrored to cljs

17:30 but since cljs doesn't do read-eval, you should be able to safely use clojure.core/read

17:32 alandipert: bendlas: is the idea that when you call load-cache, you want overlay to automatically run?

17:33 bendlas: mye: sorry, its called cljs.reader/read in clojurescript

17:34 alandipert: the idea is, that load-cached fetches its content only once

17:35 the cell is mainly used to handly asynchronicity

17:36 alandipert: so the cell is used more like a promise in this case

17:37 (which is also the reason I'd like to have a zero-arity for cell)

17:38 mye: in case you missed it, due to your re-login: it's cljs.reader/{read,read-string} in clojurescript

17:39 alandipert: bendlas: i have to go, but i'll take another look at this later

17:40 bendlas: alandipert: OK, thanks! Take care!

17:54 yedi: i'm getting a 404 error when i post to cart/purchase: https://gist.github.com/yedi/5138157

17:55 can someone help me out with this? "making purchases' doesn't even get printed, so it doesn't seem it's even reaching (purchase)

17:56 abp: yedi: don't use vectors like that in the routes? only for binding parameters later on

17:57 yedi: what would be a better way? (i assumed this was the only way to define routes)

18:01 mye: bendlas, thanks! I'm trying to check if cljs support the tagged literals as well, eg. *data-readers* but emacs is misbehaving again :/

18:01 btw, any emacs+clojurescript users here with tips/code how to manage two repls and selectively send clojure(script) to them?

18:01 abp: yedi: you have route like (GET "/" .. that's right

18:02 iartarisi: mye: https://github.com/brentonashworth/one/wiki/Emacs

18:03 mye: iartarisi: I should've mentioned I'm trying to reuse nrepl.el for cljs with piggieback, got a bit of trouble still with setting the correct repl-buffer names

18:04 iartarisi: oh, no idea then

18:04 mye: I had a manual solution like the "one" before but reusing nrepl makes sense

18:05 yedi: abp: oh... thanks! i'll see if that helps me

18:07 iartarisi: Can someone have a look at this newb cljs code I'm writing? I feel like I'm doing something very bad with functions that all take the same 5 params. But I'd like to move the functions to a different file than the constants eventually. Should I use records or something else? https://github.com/mapleoin/goboard.js/blob/master/src/cljs/goboard.cljs

18:09 dnolen: iartarisi: for something like go which doesn't have demanding drawing you can probably go pretty high-level - use maps.

18:09 instead of 5 params

18:10 yedi: abp: no luck unfortunately, i changed it to this: https://gist.github.com/yedi/5138157

18:12 ughhhhhhh

18:12 was missing a trailing slash

18:13 this is bullshit, i quit programming

18:13 iartarisi: dnolen: I was asking about records after looking at http://clojure.org/data_structures#Data%20Structures-StructMaps . Do you think my use-case is not in the "Most uses ..." case?

18:15 dnolen: iartarisi: maps usually suffice, you can switch to records if you need the perf.

18:15 iartarisi: dnolen: ok, thanks!

18:24 yedi: i printed out a map and it looked like this: {:stripe-token tok_1RWsvwDFHog7kF, :state AL, :town , :zip-code , :saddy-line2 , :saddy-line1 , :last-name , :first-name }

18:25 how is that a valid map?

18:25 amalloy: yedi: don't use the print family of functions to inspect datastructures

18:25 yedi: oh

18:25 what's the conventional methodology

18:26 amalloy: pr would have shown you that the values are nil

18:27 gfredericks: ,(println {:foo nil, :bar nil})

18:27 clojurebot: {:foo nil, :bar nil}\n

18:28 yedi: amalloy: pr?

18:28 gfredericks: yedi: pr is a function

18:28 as are prn pr-str and prn-str

18:28 yedi: oh i see

18:28 gfredericks: all of them having the property he's referring to

18:28 amalloy: oh, maybe not nil, just the empty string. i forgot println shows nil as nil

18:29 gfredericks: ,(println {:foo "", :bar " "})

18:29 clojurebot: {:foo , :bar }\n

18:29 yedi: ah, that's what was happening

18:30 thanks for letting me know about prn

18:30 devn: route generation done backwards with core.logic?

18:47 yedi: is there a builtin fn for getting a subset of a map (based on it's keys)

18:48 on the keys you give the fn*

18:48 found it, select-keys

18:51 ivan: should the select-keys implementation be using transients?

18:52 gfredericks: certainly could

18:52 I don't know what the eagerness threshold is

19:10 ravster: hey all

19:28 yedi: does anyone know who @abengoa (github) is, and if he frequents #clojure?

19:28 Raynes: Never heard of him.

19:28 And I've heard of everyone.

19:33 yedi: Raynes: good point... maybe i shouldn't trust clj-stripe

19:33 technomancy: yeah, I don't use software where the author doesn't hang out on IRC

19:33 yedi: xD

19:33 Raynes: It's probably better.

19:34 Less time spent on IRC means more time spent at work which is probably why he wrote this which means he probably needs it at work and if he is getting paid to maintain it you've basically run out of reasons to not use it.

19:37 zakwilson: Yeah, I don't use software where the author always hangs out on IRC.

19:37 * zakwilson promptly stops using every useful Clojure library ever.

19:40 sshack: Is anyone here using lobos?

19:41 I'm getting a IllegalArgumentException with it and I'm wondering if it's a clojure 1.5 incompatibility, or what.

19:41 clj_idiot: so I have this really stupid idea, where in my gui system, I want evey gui element to be a _light weight thread_ rather than a state machine (i.e. think Rob Pike's NewSqueak system taken to the extreme). Is there anyway to get light weight threads in Clojure?

19:43 arohner_: yedi: FWIW, we wrote our own stripe wrappers

19:43 it's trivial to do

19:44 sshack: ahh. Found the problem getRoot disappeared from clojure 1.3

19:45 yedi: arohner_: i'm still learning clojure, so what may seem trivial to every other person isn't to me =/

19:59 Raynes: select * from testtb where x = now()::date;

19:59 Oh, turns out this isn't my psql window.

20:06 zakwilson: (0 rows)

20:07 tyler__: lawl

20:08 Raynes: zakwilson: 1 row, bro. Get shit right at least.

20:09 technomancy: Raynes: yeah but now() changed between when you typed it and when zakwilson received it

20:09 abp: Raynes: Still not your psql window. :P

20:09 Raynes: technomancy: Yeah, but it's still today so it still matches that one row.

20:10 abp: Cursing aided debugging would make sql kick datomic into garbage instantly. :)

20:10 technomancy: Raynes: not in UTC

20:10 =P

20:10 * zakwilson may not be a compliant SQL implementation.

20:11 pjstadig: the hazard of using emacs for everything is after a while all the buffers look the same

20:15 abp: (map #(first (find-parents [] %)) (seq abblog))

20:15 mhm sure..

20:17 zakwilson: lib-noir docs mention the public folder, but do not mention that it is hardcoded to be a folder named "public" in the app's working directory.

20:21 Raynes: zakwilson: If it shouldn't be hardcoded please do open an issue.

20:32 zakwilson: Raynes: I'm not sure it's unreasonable for it to be hardcoded, but the docs should probably say something about it.

20:49 ravster: I'm getting --> :body #<HttpInput org.eclipse.jetty.server.HttpInput@14d139ee> <-- as part of my request in ring. How do I expand that?

20:52 I'm sending information through a POST request

20:53 brehaut: ravster: its an java inputstream from memory; how you process that depends what it contains

20:54 ravster: I have the route wrapped in a wrap-json-body

20:54 brehaut: ravster: have you sent the correct content type header on the request?

20:55 ravster: https://github.com/ring-clojure/ring-json/blob/master/src/ring/middleware/json.clj#L5-L7

20:56 ravster: brehaut: oh, i didn't. :D thanks.

20:56 brehaut: ravster: no problem

21:16 chessguy: trying to get the clojure koans working, per http://clojurekoans.com/, but when i 'lein koan run', i get an error like this: ava.io.FileNotFoundException: Could not locate leiningen/core/main__init.class or leiningen/core/main.clj on classpath: (koan.clj:1)

21:17 i can't even find a 'koan.clj' file in the project

21:18 amalloy: did you upgrade to lein 2, as the page you linked asks?

21:21 chessguy: oh, huh. i just installed lein the other day, so i assumed it was the latest

21:21 but you're right, it's not

22:25 clj_idiot: in Java, is there a function to force a JFrame to full screen?

22:26 okay, so I see setSize and setLocation

22:27 howver, how do I get the max size of the screen?

22:32 Raynes: clj_idiot: Are you using seesaw?

22:32 clj_idiot: no

22:32 I'm using raw Java APIs

22:32 Raynes: Why so masochistic?

22:32 clj_idiot: it has a code hot reloading module I wrote a year ago

22:32 matches my mental work flow better

22:33 Raynes: Anyways, seesaw has a toggle-full-screen! function.

22:33 You can look at how he does that.

22:33 Seesaw works with raw swing objects, so you should be able to mostly just copy the relevant pieces of code.

22:52 JulioBarros: I need to use a clojure library that I updated but did not write. Is there a way to use my version from github until my pull request is accepted or the original is updated?

22:53 jeremyheiler: JulioBarros, You can release it under org.clojars.yourusername/clj-project

22:55 Basically you're just changing the group id.

22:56 JulioBarros: jeremyheiler: Ok. Thanks.

22:56 jeremyheiler: And clojars kindly sets up the group org.clojars.yourusername for you

23:21 nonuby: is there a shortcut to (first (filter pred col))

23:22 i guess 'some' fits the bill thinking about it, weird name though

23:33 technomancy: nonuby: it is weird. filter first is fine though

23:33 ohpauleez: ambrosebs: ping?

23:33 ambrosebs: ohpauleez: hey

23:34 ohpauleez: hey man, Does AnyFunction do what I think it does

23:34 some combination/intersection of Function and IFn?

23:35 I just switched to core.typed 0.1.7 and want to type the return as a Function (in this case, an anonymous function)

23:35 ambrosebs: is AnyFunction in 0.1.7?

23:35 ohpauleez: I don't think so

23:36 ambrosebs: But there is some weirdness and crustiness here from Typed Racket.

23:36 ohpauleez: ahhh

23:36 ambrosebs: Basically I don't even use IFn or any clojure.lang.Fn/Function/AFn

23:36 ohpauleez: You just use Any

23:36 (thats what I'm using now)

23:36 ambrosebs: I have a special type that internally is called FnIntersection

23:37 eg. [Any -> Any], (Fn [Any -> Any]) are FnIntersections

23:37 What should really happen is (IFn (Fn [Any -> Any])

23:37 )

23:38 I can't decide what the default should be.

23:38 ohpauleez: ahh, gotcha cool. You can ignore my tweet then

23:38 :)

23:38 ambrosebs: Should [Any -> Any] be an IFn, Function, AFn?

23:38 Not sure.

23:39 ohpauleez: Well I have a decorator (takes a function, returns a function), but I know nothing about the fn's args

23:39 so right now I'm just saying Any -> Any

23:39 ambrosebs: Ah, probably should be (All [a b ...] [b ... b -> a])

23:40 That doesn't lose any information on the function you're wrapping.

23:40 ohpauleez: ahhhh

23:40 thank you

23:40 that's what I'm looking for

23:40 It definitely explodes the typing rabbit hole

23:40 "Ok, now I need to type this… whooops, ok now I need to type this..."

23:41 ambrosebs: Yep, usually does :/

23:41 ohpauleez: is there a file in core.typed.typed with all the types in it?

23:41 ambrosebs: You might want to work off the master branch, there's some improvements to dotted functions there.

23:41 ohpauleez: cool

23:41 ambrosebs: clojure/core/typed/ann.clj

23:42 (I'll just change the version to be a snapshot)

23:42 ohpauleez: thanks a ton ambrosebs. I definitely appreciate all of this

23:42 ambrosebs: sweet, np

23:42 ohpauleez: It's been a part of my core.specs // sterling project since the short talk we had at Conj

23:43 so it'll be all over my ClojureWest talk

23:43 haha

23:44 ambrosebs: oh great!

23:51 brehaut: ohpauleez: i hit that typing rabbit hole too. finding reasonable boundaries for typed and untyped code looks like its going to be somthing that takes some practise

23:51 ohpauleez: brehaut: Are you going to ClojureWest

23:52 brehaut: ohpauleez: only if i win the lottery

23:52 ohpauleez: :(

23:52 brehaut: ohpauleez: wrong end of the earth

23:52 ohpauleez: Well, hopefully my talk will help out that rabbit hole a little bit

23:52 brehaut: ohpauleez: that'd be great

23:52 hopefully we'll see video and slides sooner rather than later

23:54 bbloom: ohpauleez: looking forward to your talk. we need more things in the gradual typing category :-)

23:55 ohpauleez: sometimes, i wish i could specify my asserts in first-order logic w/ set theory :-P

23:56 ohpauleez: bbloom: Your wish should be granted…. sort of

23:56 brehaut: ohpauleez: the summary of your talk is exactly the stuff im interested in atm

23:56 ohpauleez: tying together contracts, typed and generative testing seems super powerful

23:56 ohpauleez: brehaut: I think a lot of people are. I see it as a natural progression for a lot of people building serious systems in Clojure

23:56 technomancy: don't forget inference =)

23:57 ambrosebs: technomancy: would you be happy if you only had to annotate vars?

23:57 brehaut: technomancy: ive already forgotten. what ?

23:57 ambrosebs: did you get my lazybot mail?

23:57 technomancy: ambrosebs: it would help, but it would still be a hard sell

23:58 I found with mirah, having inference on locals only meant it discouraged breaking up functions when they got too big

23:58 bbloom: technomancy: hmm interesting point

Logging service provided by n01se.net