#clojure log - Nov 28 2015

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

0:05 justin_smith: the version that is exactly like lambda x:x is (fn [x] x)

0:05 clojurebot: Roger.

0:05 justin_smith: dork

0:06 ~the version that is exactly like lambda x:x

0:06 clojurebot: You don't have to tell me twice.

0:06 justin_smith: ~the version that

0:06 clojurebot: the version that is exactly like lambda x:x is (fn [x] x)

0:06 justin_smith: numbskull

0:23 pontiki: n00b question - is (identity x) different from (fn [x] x) ?

0:25 justin_smith: pontiki: it's not an identical object, but it does the same thing

0:26 pontiki: is the x returned in each case the same x as sent in?

0:28 justin_smith: yes

0:28 ,(let [o (Object.)] (= o (identity o) ((fn [x] x) o))

0:28 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

0:28 justin_smith: ,(let [o (Object.)] (= o (identity o) ((fn [x] x) o)))

0:28 clojurebot: true

0:28 pontiki: good to know. background: in the bridge class, i wrote the latter form during an exercise, and the TA mentioned the identity function

0:29 justin_smith: yes, it's clever to come up with the identity function, it's a useful one, but clojure does have it built in

0:29 one more bit of info for the code above:

0:29 ,(= (Object.) (Object.))

0:29 clojurebot: false

0:29 pontiki: yes, that i get

0:30 justin_smith: no two objects are the same, so we know o, (identity o) and ((fn [x] x) o) all return the same object

0:30 ,(= identity (fn [x] x)) ; clojure doesn't have value identity for functions

0:30 clojurebot: false

1:12 akkad: clojure compiles to java byte code?

1:13 pondering if a static java bytecode analysis tool for security would be of any use for a clojure jar

1:15 justin_smith: akkad: I doubt the analysis would be useful - consider the fact that you can't run clojure without the compiler, and at runtime a clojure program could easily eg. load a string of data from a client, compile it, and run it

1:16 and if that can happen, the static analyzer can't tell you anything useful...

2:19 beaky: hello

2:21 i am beaky

2:21 oops wrong channel

3:08 Seraf: Hello everyone, I'm new to clojure, coming from a python world. This langage is very nice but I've some difficulties about manipulating datastructures. I'm trying to create an om component which will draw a menu by exploring a map. Here is my "code snippet", the result I want and the data structure I have : http://pastebin.com/f0MDaLHF does someone can help me please ?

3:09 If there's a way to avoid the double for and do this in a more elegant way, I take all advice :)

3:30 tomjack: Seraf: (for [[account playbooks] deployment playbook (:results playbooks)] ...) ?

3:31 hmm, well, that will not have an <li> for accounts with no playbooks

3:35 Seraf: tomjack, "deployment playbook" => where it come from ? my structure is in (:deployment app)

3:35 tomjack: sorry, I meant (:deployment app) for deployment

3:36 anyway, :results is a key in playbooks there, which is a map. so you are getting :results out of the wrong things

3:37 I think if you used map destructuring like (for [[account {:keys [results]}] (:deployment app)] ...) you'd be a bit closer

3:38 (or just use (:results playbooks))

3:40 it should be possible to avoid flatten. flatten is more useful when you don't know exactly how your data is nested. but your data's nesting is very known

3:42 Seraf: ok. Is there a problem to chain "for" ? I mean I need to iterate from accounts, then iterate from results. I tried what you gave me but it didn't handle my structure well.

3:47 tomjack: no problem. I guess you want (map :name (:results playbooks))

3:48 yeah, what I gave you was garbage :(

3:56 Seraf: thanks tomjack it worked :)

3:57 also, I have a problem with the key. when I display "account", it returns me : cycloidcycloid21537751054096 and I don't know where it come from as my key is only "cycloid"

4:00 tomjack: when you do (for [[account playbooks] (:deployment app)] ...), you are iterating over the key/value pairs in the :deployment map

4:01 not sure, but maybe what you're seeing is an artifact of the implementation of keywords in cljs

4:01 because account is then a keyword like :cycloid or :customer

4:02 you can convert a keyword to a string like (name :cycloid)

4:02 assuming you don't care about the keyword's namespace, or that it doesn't have a namespace

4:03 Seraf: ok, thanks for the help :)

4:12 rmrfchik: Hi

4:13 how can I pass java method as clojure function? like (my-func .getName)

4:13 ARM9: you'll need to wrap it in a fn

4:13 (my-func #(.getname %))

4:13 since java functions don't implement the interface clojure needs for higher order functions

4:15 rmrfchik: yep, came to the same

4:15 thanks

4:15 ARM9: I don't know if/how you can avoid reflection doing that

4:15 rmrfchik: wrap is ok

4:15 ARM9: which sucks

4:19 scottj_: ,((memfn floatValue) 1)

4:19 clojurebot: 1.0

4:25 ARM9: does memfn resolve all reflection?

4:25 or do I manually have to typehint all the things

8:00 rmrfchik: i want to log my lazy list like this: (log/info (format "files are: %s" (doall (map #(.getName %) flist))))

8:01 despite doall, i got 'files are: clojure.lang.LazySeq@13a11'

8:01 what i miss here?

8:07 beaky: hello

8:08 does clojrue have sum types

8:12 ane: no

8:12 typed clojure has them

8:24 rmrfchik: what about lazy map?

8:24 drives me crazy

8:32 TEttinger: rmrfchik: like a lazy hash-map?

8:32 without order does that even make sense?

8:37 rmrfchik: TEttinger: it does

8:37 just want to quick look to sequence

8:37 mapv did the trick, but wtf...

8:38 TEttinger: I thought you meant you wanted an equivalent to lazyseqs that was associative by key

8:40 rmrfchik: TEttinger: I want to (format "%s" (map inc [1 2 3]))

8:42 TEttinger: ah.

8:42 yeah mapv is good for that

8:42 (format "%s" (pr-str (map inc [1 2 3])))

8:42 ,(format "%s" (pr-str (map inc [1 2 3])))

8:43 clojurebot: "(2 3 4)"

8:46 rmrfchik: i wonder why format didn't look into seq

8:53 TEttinger: ,(format "%s" (range))

8:53 clojurebot: "(0 1 2 3 4 ...)"

8:53 TEttinger: it appears to here

8:53 ,(format "%s" (map inc [1 2 3]))

8:53 clojurebot: "clojure.lang.LazySeq@7c42"

8:54 TEttinger: hm

8:54 that's weird

8:54 ,(class (range))

8:54 clojurebot: clojure.lang.Iterate

8:54 TEttinger: ,(class (map inc [1 2 3]))

8:54 clojurebot: clojure.lang.LazySeq

8:54 TEttinger: ah

9:00 rmrfchik: TEttinger: so, any ideas?

9:00 TEttinger: pr-str is my best shot

9:01 keep in mind though

9:01 ,(format "%s" (pr-str (range)))

9:01 clojurebot: "(0 1 2 3 4 ...)"

9:01 TEttinger: oh print-length is set

9:02 if it isn't that might try to print an infinite strinh

9:05 beaky: hello

9:06 how do i do dijskstras algorihtm in clojure

9:15 TEttinger: beaky: do you care about the performance of the algorithm much? dijkstra called on large graphs with a straightforward implementation can be rather slow

9:15 beaky: ah

9:16 probably wont matter its just for rogueliek :D

9:16 TEttinger: there are less straightforward versions of dijkstra that are faster

9:17 (my personal recommendation is to use squidlib, which is in java and has dijkstra and A* implemented already. but the next release should be rather soon)

9:17 douglarek: I opend lein repl not in some clojure project, and cider-connect it in Emacs, but how can I switch repl namespace to some specific project

9:18 TEttinger: (I'm the primary committer to squidlib)

9:18 beaky: wow ill try squidlib then

9:18 how do i include it in lein

9:18 TEttinger: https://github.com/SquidPony/SquidLib

9:18 maven deps are similar hang on

9:19 [com.squidpony/squidlib-util "3.0.0-b1"]

9:22 beaky: https://github.com/SquidPony/SquidLib/blob/master/squidlib-util/src/main/java/squidpony/squidai/DijkstraMap.java wow im glad i dont have to implement all this myself now :D

9:22 this is perfect

9:23 btw how does lein know where to pull your lib

9:24 TEttinger: I put it on maven central. lein pulls from there and clojars

9:24 beaky: ah

9:24 TEttinger: maven central is a pain to get going properly

9:24 clojars is...better

9:25 beaky: is maven like the npm of clojure

9:25 TEttinger: maven is like one of the NPMs for java

9:25 and clojure can use it

9:25 beaky: ah

9:25 TEttinger: lein is a nice way to use maven without uh

9:25 badness

9:26 beaky: never used maven (or java much) im guess im glad i've got lein then :D

9:26 TEttinger: you have these horrid pom.xml files https://github.com/SquidPony/SquidLib/blob/master/pom.xml

9:27 tell me if you hit any stumbling blocks for that dijkstra in clojure

9:28 3.0.0 final should be fairly soon. api should be similar, i've added to dijkstramap but not removed and not changed anything

9:28 oh!

9:29 any Coord stuff you hit may be tricky. use (Coord/get 3 4) to get the point at x=3, y=4 . if there's a ... argument, it's really an array (this is true in java too)

9:29 beaky: ah

9:30 TEttinger: I'm trying to remember how to make a Coord array in clojure

9:32 (into-array [(Coord/get 1 2) (Coord/get 3 4)])

9:32 beaky: I love the coord thing going on even supports 3d type of roguelike worlds

9:32 TEttinger: not as well

9:32 beaky: (wonder how dijkstra works in 3d tho :D)

9:33 TEttinger: Coord is really really much better with 2D. it is immutable, which plays nice with clojure

9:33 beaky: ye my game stick with 2d type coords for now

9:33 TEttinger: limited to the range from -3 to 255 for x and y IIRC

9:33 (efficiently)

9:34 there's a way to make bigger Coord caches if needed, but dijkstra is dog-slow on 1000x1000 maps

9:37 beaky: I'm most curious about how the dungeon gen algos are consumable from clojure, since I'll be doing the same soon

9:37 squidgrid.mapping sort of package/ns

9:38 beaky: right will try out squidlib dungeon gen too (my crappy game still uses static maps haha)

9:38 TEttinger: https://github.com/SquidPony/SquidLib/blob/v3.0.0-b1/squidlib-util/src/main/java/squidpony/squidgrid/mapping/DungeonGenerator.java

9:39 the problem as I see it is that amap and other clojure builtins like dealing with 1d arrays

9:39 and all of these use 2d char arrays

9:39 luxbock: beaky: sticking to the standard Clojure data structures is usually a good idea

9:39 TEttinger: for dijkstra?

9:39 I have a version that sticks with them

9:40 luxbock: I have never actually used dijkstra for anything, so I was just making a more general point

9:43 TEttinger: http://ideone.com/YnhoF3 lines 97 to 140 are a (unoptimized) dijkstra map using immutable clojure data structures

9:43 you get better performance with transients on clojure data or by using arrays

9:45 thid used both http://ideone.com/27YYx3

9:47 beaky: sorry to recommend and run, but I have a plane back home to catch!

10:30 gfredericks: ,(reduce #(assoc %1 %2 %1) nil [:foo :bar :baz :bang :haloooo])

10:30 clojurebot: {:foo nil, :bar {:foo nil}, :baz {:foo nil, :bar {:foo nil}}, :bang {:foo nil, :bar {:foo nil}, :baz {:foo nil, :bar {:foo nil}}}, :haloooo {:foo nil, :bar {:foo nil}, :baz {:foo nil, :bar {:foo nil}}, :bang {:foo nil, :bar {:foo nil}, :baz {:foo nil, :bar {:foo nil}}}}}

10:30 gfredericks: that turned out more interesting than I expected

10:32 justin_smith: ,(reduce #(assoc %1 %2 %1) nil "abcde")

10:32 clojurebot: {\a nil, \b {\a nil}, \c {\a nil, \b {\a nil}}, \d {\a nil, \b {\a nil}, \c {\a nil, \b {\a nil}}}, \e {\a nil, \b {\a nil}, \c {\a nil, \b {\a nil}}, \d {\a nil, \b {\a nil}, \c {\a nil, \b {\a nil}}}}}

10:34 gfredericks: ,(reduce #(assoc %1 %2 %1) nil (range 5))

10:34 clojurebot: {0 nil, 1 {0 nil}, 2 {0 nil, 1 {0 nil}}, 3 {0 nil, 1 {0 nil}, 2 {0 nil, 1 {0 nil}}}, 4 {0 nil, 1 {0 nil}, 2 {0 nil, 1 {0 nil}}, 3 {0 nil, 1 {0 nil}, 2 {0 nil, 1 {0 nil}}}}}

10:34 gfredericks: it's a bit like the set-theoretic definition of an integer as the set of smaller integers

10:35 ,(defn set-int [n] (set (map set-int (range n))))

10:35 clojurebot: #'sandbox/set-int

10:35 gfredericks: ,(set-int 5)

10:35 clojurebot: #{#{#{} #{#{} #{#{}}} #{#{}}} #{} #{#{#{} #{#{} #{#{}}} #{#{}}} #{} #{#{} #{#{}}} #{#{}}} #{#{} #{#{}}} #{#{}}}

10:35 gfredericks: s/integer/natural number/

10:39 justin_smith: gfredericks: I always thought it would be a funny experiment to make Number act as IFn as in the peano numbers, so that (6 5) would return 30

10:39 while we're doing overloads that hide common errors anyway, why not one more

10:55 gfredericks: church numerals

10:58 justin_smith: gfredericks: in that case (6 f) would be the equivalent of (nth (iterate f f) 6) right?

10:59 or would that be (apply comp (repeat 6 f))

11:00 * gfredericks isn't even sure

11:00 gfredericks: it's been a while since I church numerals

11:04 you could make a pretty simple interactive lambda calculus thing by just doing a thin mapping from ascii strings to "lists" of church numerals, for some suitable lambda calc implementation of a list

11:05 justin_smith: looks like it is nth+iterate: http://briancarper.net/blog/479.html

11:07 justin_smith: gfredericks: oh, nth + iterate, except the initial arg is not f, it's more like #(nth (iterate f %) N)

11:09 gfredericks: yeah

11:25 Glenjamin: ,(get {'get 123, :a 1} :a)

11:25 clojurebot: 1

11:25 Glenjamin: ,('get {'get 123, :a 1} :a)

11:25 clojurebot: 123

11:25 Glenjamin: on the subject of possibly error-hiding IFn implementations

11:43 ,(let [get 'get] (get {a: 1} 2))

11:43 clojurebot: #<RuntimeException java.lang.RuntimeException: Invalid token: a:>

11:43 Glenjamin: ,(let [get 'get] (get {:a 1} 2))

11:43 clojurebot: 2

13:58 hlolli: How can I get just (list + 2 2) out of...

13:58 ,(eval `(let [a# 1 b# 2] (list + a# a#)))

13:58 clojurebot: (#object[clojure.core$_PLUS_ 0x1a145a4e "clojure.core$_PLUS_@1a145a4e"] 1 1)

13:59 hlolli: ,(eval `(let [a# 1 b# 2] '(list '+ ~a# ~a#)))

13:59 clojurebot: #error {\n :cause "Unable to resolve symbol: a# in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: a# in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6704]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: a# in this context"...

14:00 justin_smith: hlolli: eval doesn't use locals

14:00 nornagon: Is it just me or is there no transducer that produces a sliding-window over a collection a la (partition-all n 1 coll)?

14:01 ,(partition-all 2 1 [1 2 3 4])

14:01 clojurebot: ((1 2) (2 3) (3 4) (4))

14:01 hlolli: ok, Im having a problem that Im in a macro and want to return unevaluated list, but it keeps evaluating.

14:01 Of course I evaluate the macra since Im calling it.

14:02 justin_smith: hlolli: a macro should return the code it wants to be run - if you want to return the data unevaluated you should probably wrap the whole thing in quote

14:03 hlolli: ok, let me show you this macro.. wait

14:03 gfredericks: ,(defmacro put-this-code-in-a-list [& args] (list 'quote args))

14:03 justin_smith: should be as simple as (cons 'quote current-body-of-your-macro)

14:03 clojurebot: #'sandbox/put-this-code-in-a-list

14:03 gfredericks: ,(put-this-code-in-a-list foo (inc 41))

14:03 clojurebot: (foo (inc 41))

14:04 justin_smith: oh yeah, list quote, not cons quote, right

14:04 hlolli: https://www.refheap.com/112165

14:04 gfredericks: that macro is probably way too big

14:04 justin_smith: that macro is bad and you should feel bad

14:05 gfredericks: what is it that makes this need to be a macro?

14:05 hlolli: Well, I really need this to be a macro.

14:05 gfredericks: oh it's creating more macros

14:05 hlolli: I cant evaluate immeadiately.

14:05 gfredericks: but isn't it expanding to a bunch of defmacro calls? what's wrong with evaluating those immediately?

14:05 hlolli: It has to connect pieces togeather before a function inside this macro can be evaluated, works fine.

14:05 justin_smith: hlolli: as gfredericks was suggesting, if you changed that do to quote at the top, that would quote the whole damned thing

14:06 hlolli: Im a macro cowboy, sure :)

14:06 ok, I try that.

14:06 justin_smith: or wait, wrap the do in (list 'quote ...)

14:06 because you have more than one thing in that do blcok, my bad

14:07 hlolli: if you look at core.async, they have a very nice way of making larger macros - instead of putting all of it in one macro, they make constituent parts, using functions that return lists

14:07 hlolli: ok, so to be more percise. Everywhere this macro works fine except in :load part of it, the only place ev-conc-ref# wants to evaluate prematurely

14:07 justin_smith: it makes something like that much more intelligible

14:08 hlolli: ok, I'll look into that. Originally this was suppose to be a small macro that I just got crazy on.

14:09 justin_smith: my rule of thumb is that macros are for defining a syntax, and the semantics (the logic implemented) is not the macros job and should be defined using functions

14:09 and, if the syntax part gets complex, you can use functions that do list transforms to decompose it

14:10 hlolli: yes that could ease this a alot, doing the logic elsewhere.

14:14 but isn't it expanding to a bunch of defmacro calls? what's

14:14 wrong with evaluating those immediately? ....... goodpoint gfredericks

14:14 but one thing I was not able to debug was that by not having this as a macro (function) I was not able to define symbols outside on my namespace.

14:16 justin_smith: you can bind symbols to any namespace using intern

14:17 it will be a macro if it's a function and you add the metadata :macro true to the metadata of the symbol you bind

14:17 (and you need to insert two extra args at the beginning, that you will likely ignore)

14:17 clojurebot: I don't understand.

14:18 hlolli: ok, there's way too little info on interns on the clojure docs website

14:18 or anywhere, I do use interns but slightly and not for macros.

14:20 jsabeaudry_: When trying to setup datomic, I feel like a complete retard

14:20 justin_smith: hlolli: no, not ns-interns - that lists things

14:20 intern, that adds a binding

14:20 hlolli: yesyes, I mean that

14:21 it's just a (intern ns symbol body)

14:21 justin_smith: ,(intern 'clojure.core 'foo "FOO")

14:21 clojurebot: #'clojure.core/foo

14:21 justin_smith: hlolli: yeah, that's all it is

14:21 ,foo

14:21 clojurebot: "FOO"

14:21 justin_smith: ,'foo

14:21 clojurebot: foo

14:21 justin_smith: ,#'foo

14:21 clojurebot: #'clojure.core/foo

14:21 justin_smith: see, I just defined something in clojure.core, easy

14:21 hlolli: but how can you tell the body to be a macro

14:22 justin_smith: ,(intern 'clojure.coo ' ^:macro bar (fn [nil nil x] x))

14:22 clojurebot: #error {\n :cause "Unsupported binding form: "\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.Exception: Unsupported binding form: , compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6891]}\n {:type java.lang.Exception\n :message "Unsupported binding form: "\n :at [clojure.core$destructure$pb__4924 invoke "core.clj" 429...

14:22 justin_smith: ergh

14:22 one moment :)

14:22 hlolli: ok I see where you are going with this

14:24 justin_smith: ,(intern 'clojure.core ' ^:macro bar (fn [_ _ x] x))

14:24 clojurebot: #'clojure.core/bar

14:24 justin_smith: ,(refer-clojure)

14:24 clojurebot: nil

14:24 justin_smith: ,(bar 42)

14:24 clojurebot: 42

14:24 justin_smith: ,#'bar

14:24 clojurebot: #'clojure.core/bar

14:24 justin_smith: see, working macro

14:25 a stupid macro, but it's a macro

14:25 hlolli: ok ok

14:25 maybe this will do it

14:25 justin_smith: hlolli: that stuff is slightly weird, but I think it's simpler than macro generating macro generating macros

14:26 hlolli: yes, what I want is not really to solve this by solving it. As this is set up now, I only need to require one namespace and I can start to make music. Similar to overtone, I want to keep it that way.

14:54 Ok, I just found out that the reason it evaluated is because the dosync returns the last item in the list.... so I guess I stick to this uglieness here and be wiser next time.

15:07 n3wb: I have a beginner question. When you use packages from others, how do you usually go about getting to know the available namespaces and functions? I often find myself trying to reverse engineer whatever map + special keys I need to pass, thinking there must be a better way...

15:08 justin_smith: n3wb: I usually end up reading the source. But there is also the doc function for seeing doc strings, and ns-publics for seeing all the functions in an ns

15:09 Frozenlock: n3wb: the function doc and the readme.

15:10 Which makes me 'not liking' libraries without function docs.

15:14 jonathanj: can anyone recommend a logging library?

15:19 nornagon: i think clojurebot has something to say about java logging

15:53 codahale: jonathanj: clojure.tools.logging and then unilog to actually set things up

15:55 rhg135: ~logging

15:55 clojurebot: excusez-moi

15:55 rhg135: ~java

15:55 clojurebot: java is a mutable basket case

15:55 rhg135: Ok

16:17 jonathanj: codahale: what's the opinion of timbre?

16:17 (it seems really complicated, at first glance)

16:18 codahale: jonathanj: I’d generally recommend against using things that don’t play nicely with SLF4J

16:18 Adding yet another logging backend into the mix seems unwise

16:19 jonathanj: codahale: why is that?

16:19 codahale: recommending against those things, i mean

16:19 codahale: It’s rare to work on a JVM-hosted project and not have a dependency which requires an SLF4J backend

16:22 kenrestivo: aye, the joy of silent failures. :compnent-will-mount doesn't execute. wonder why? :)

16:24 splunk: FWIW we've been on timbre in prod for two years, no problems. We also have Datomic (and possibly others) using SLF4J but at least with a little bit of fiddling it has not conflicted.

16:26 Although that being said we don't do a ton of work like, unifying logging settings / levels / whatever across the systems. It all just goes to stdout/stderr and then gets picked up by external processes.

16:29 jonathanj: splunk: i don't plan on doing anything complicated either, but using timbre seems more complicated than tools.logging (at least reading the examples)

16:31 splunk: timbre should only be (ns foo (:require [taoensso.timbre :as t])) (t/info "hello world")

16:32 + the add in project.clj

16:32 so...should be reasonably cheap to try out and see what you like

16:44 eseg: hi, does anyone know of clojure programming projects I can join?

16:47 justin_smith: kenrestivo: yeah, I've found if I want to reliably know what went wrong in starting components, I need to wrap the start method in a try/catch

16:48 splunk: the problem is that timbre is not compatible with any logging done by any java lib you might use, so then you have a minimum of two logging systems to configure and use

16:48 it would be different if I could make the java libs use timbre, but you can't

16:58 codahale: tools.logging + unilog also has the virtue of making it very easy to have a single, JSON-formatted log stream

16:59 eseg: i guess i should ust come up with my own project to work on

16:59 just*

16:59 codahale: And then puppetlabs/structured-logging makes it easy to log structured data which plays nicely with said log stream

16:59 justin_smith: eseg: leiningen has many issues marked as being contributions that should be easy for a newcomer

19:59 gfredericks: https://github.com/gfredericks/schema-bijections/blob/master/test/com/gfredericks/schema_bijections_test.clj

20:57 justin_smith: gfredericks: what does it mean to biject a schema?

20:59 amalloy: dang, i drop in for just a few minutes and apparently into the middle of a grand existential debate about schemas

21:02 justin_smith: i would guess, given two compatible schemas, a way to convert from one to the other and back losslessly

21:51 blackdice: ever since I started growing a beard I've really liked programming a lot more for some reason

21:53 pontiki: ROFL

22:03 gfredericks: amalloy_: justin_smith: more or less yeah

22:04 though the idea in this case is to only have to write one schema, and other equivalent schemas get generated for you, along with conversion functions

22:05 justin_smith: gfredericks: so do you use prismatic/schema extensively at work?

22:06 gfredericks: lately yeah

22:06 justin_smith: I've become the annoying guy who won't shut up about how we would have a lot less of these problems if we had unit tests and used prismatic/schema at system boundaries

22:07 at work, that is

22:07 gfredericks: "these problems" ≟ the problems you have

22:07 * gfredericks is weirded out by his own question-mark usage

22:08 justin_smith: gfredericks: "these problems" being rare bugs that only happen occasionally at runtime, with no leads toward what makes them happen, any significant change to the implementation involving a long session of tracking down everything you just broke through trial and error, and fixing it

22:08 people having to spend 10 minutes running the app through its paces before they are sure their change is good

22:09 gfredericks: oh manually?

22:09 justin_smith: right, manually

22:09 point and click

22:10 gfredericks: ~that is not how george washington meant for us to test software

22:10 clojurebot: Roger.

22:10 justin_smith: haha

22:10 gfredericks: ~that

22:11 clojurebot: that is http://images2.fanpop.com/images/photos/3000000/Arrowed-teen-girl-squad-3099521-570-420.jpg

22:11 gfredericks: clojurebot: that?

22:12 clojurebot: that is highly unlikely

22:12 gfredericks: quite the lag

22:12 justin_smith: gfredericks: little known fact, the "arrows" in that illustration are the category theory kind, that comic is about monads

22:12 gfredericks: I'm trying to make a homestarrunner joke out of this but I don't know how

22:14 justin_smith: "something something strongbad functor something"

22:29 kenrestivo: is there a library function that does basically (apply disj (-> new-map keys set) (keys old-map))

22:40 justin_smith: kenrestivo: not quite - for some reason that vaguely reminds me of data.diff, but it looks at more than keys

22:49 kenrestivo: changed-keys, i named it. another item for the utilty library

23:45 virmundi: hello. Is the right place to discuss clojure/clojurescript related project design?

Logging service provided by n01se.net