#clojure logs

2016-01-04

04:58jonathanjcan i `map` a transducer?
04:59jonathanji have a transducer for filtering out foos (filter foo?), but now i have a nested structure, a list of lists, i'd like to filter out foos from each inner list
04:59jonathanjwithout permanently flattening the structure
05:09hyPiRionjonathanj: (map #(filter foo? %))?
05:10jonathanjyeah, i guess so but that means i have to have a transducer for foo and just a plain predicate, i was hoping to just compose a bunch of transducers
05:10jonathanji *think* `eduction` does what i want, but the documentation is so thin i can't really be sure
05:12hyPiRionyou can probably do it if you generate the nested structure with transducers
05:12jonathanj,(sequence (map (partial eduction (filter odd?))) [[0 1] [2 3 4] [5 6 7]])
05:12clojurebot((1) (3) (5 7))
05:13hyPiRionthat's effectively the same as this:
05:13hyPiRion(sequence (map #(filter odd? %)) [[0 1] [2 3 4] [5 6 7]])
05:13jonathanjfor that simple example, what about if i want to layer more transducers?
05:14jonathanji guess it should be the same regardless
05:14jonathanjthe thing is that in my code i have a transducer instead of (filter odd? xs)
05:14jonathanjso it's more like (partial eduction foos)
05:15hyPiRionOh, then eduction is probably fine
05:15jonathanjso i can reuse my transducer elsewhere
05:20jonathanjmmm
05:23jonathanjmmm, except in reality my collection is a list of maps with a key i wish to filter
05:25jonathanjspecifically, it's a list of maps containing information about pages in a PDF and the key i want to filter is the X-Objects contained by that page, it's not super obvious how i manipulate the data for that key in every map and retain the original structure
05:32hyPiRionCould you give an example on how it's laid out?
05:34jonathanj[{:page <Page object from Java library> :x-objects [{:x-object <X-Object from Java library> :length 42 ...} ...]} ...]
05:34jonathanjwhat i'm trying to do is keep only certain types of x-objects (i want to remove objects that are not images)
05:35jonathanji'm trying a different approach now though, i'm providing a way for the function that generates the structure to include only the relevant information
05:35jonathanjinstead of trying to strip it out later
05:35jonathanjbut i would still be interested to see the solution
05:36jonathanji think what i want is something that behaves like a lens but it's really not clear to me how i make that happen with transducers
05:36jonathanji.e. writing code to "reach in" and transform something while retaining the original structure of all the parent layers seems like a faraway dream to me
05:37jonathanji think i remember reading about some library designed to make this a lot easier but i forget its name
05:37hyPiRion(map (fn [x] (update x :x-objects #(filter my-filter %))) my-data) ?
05:38hyPiRionor (update-in x [:x-objects] ...) if you're using an old Clojure version
05:39jonathanji think specter is what i was thinking of
05:41jonathanjhyPiRion: i was trying to make use of transducers to avoid creating intermediate structures of data i have no use for
05:41jonathanj(mostly as an exercise in transducers)
05:42hyPiRionAh
05:42jonathanji think at this point i have a transducer hammer and everything looks like a transducer nail though
05:43jonathanjso thanks for knocking some sense into me
05:44hyPiRionWell, it's possible I guess, but I don't think it would not be pretty. And I'd assume it's not a performance issue, it's surprisingly rare that actually is an issue.
05:44hyPiRionI did some work on recursive transducers (http://hypirion.com/musings/recursive-transducers) and let me say it can get messy quickly
05:44jonathanjis there a way to find the index of something in a vector given a pred?
05:44jonathanjhyPiRion: yes, it does seem to get messy very quickly
05:46hyPiRion(defn indices [pred coll] (keep-indexed #(if (pred %2) %1) coll))
05:48TEttinger(reduce #(if (pred %2) (reduced (inc %1)) (inc %1)) 0 coll)
05:48jonathanjwhat is a sorted map?
05:49jonathanjis it sorted upon every assoc/update?
05:49TEttinger,(let [pred #{4} coll (range)](reduce #(if (pred %2) (reduced %1) (inc %1)) 0 coll))
05:49clojurebot4
05:50TEttinger,(let [pred #{4} coll (range 0 10 2)](reduce #(if (pred %2) (reduced %1) (inc %1)) 0 coll))
05:50clojurebot2
05:50jonathanj`reduced` is kind of an amazing thing
05:50TEttingeryep
05:50TEttingerhyPiRion's is shorter though, probably clearer
05:51TEttingermine gets the first, his gets all
05:51TEttingerdifferent uses
05:51jonathanjare there restrictions on what one can use as a key in a map in clojure?
05:51jonathanjcan i use a java object as a key?
05:52poweredreduced is the break of other languages
05:52poweredbut only for reduce
05:52jonathanjkind of
05:52jonathanjyou can't break a reduce in Python, for example
05:54jonathanjthinking about it, i almost never use break in Python since i tend to use the higher level constructs
05:55jonathanjexcept that in Clojure you can :while (for) but in Python you can't break a listcomp
05:56rivarunnothing you can't write in a listcomp if you really want to, but no sugar for it
05:58jonathanjsure, but suddenly what is a concise form has to turn into a wordy function (that you never really wanted in the first place) just so you can exit early
05:59jonathanjit just suddenly struck me as mildly amusing, i'd never really thought about it before
07:53princesowhat is the magic behind this '{& fn catch try finally try} in the macro doc. Im just WOT¿? https://github.com/clojure/clojure/blob/61bc3523eebaade6a1d856f74330169eb26211ea/src/clj/clojure/repl.clj#L120
07:54princeso({& fn catch try finally try} name)
07:57Bronsaprinceso: it's making (doc catch) (doc finally) use the same docstring as try
07:57Bronsaand (doc &) use the docstring for fn
08:01princesoBronsa thx. where to find more docs about? i dont get it. Is it some shortcut?
08:02MJB47its just a hash-map
08:02MJB47which act as functions
08:02Bronsa,('{& fn} '&)
08:02clojurebotfn
08:05princesoMJB47 Bronsa, ah yes, thx. Im sorry im learning at brute force XD
09:37jsabeaudryWhat happens if I call mult on the same channel twice?
09:47engblomIf I want to merge two vectors so [1 2 3 4] and [a b c d] becomes [[a 1] [b 2] [c 3] [d 4]], what options do I have beside (for..)? Is there a ready function/macro for that?
09:47opqdonut,(map vector [1 2 3 4] [:a :b :c :d])
09:47clojurebot([1 :a] [2 :b] [3 :c] [4 :d])
09:48visofhi guys
09:48engblomopqdonut: Thanks! That surely makes the code shorter than my (for...) alternative
09:51visofi'm in situation which i have large csv file with first field sorted number, and i want to query the file by the first field, my approach is to split the files to smaller files and check if the provided number in which file then query the smaller file, is there a better approach than this to solve this problem?, note: i don't want to use in-memory design for the full file, i want memory efficient solution
09:51visofcan anybody suggest anything?
09:51mavbozohappy new year!
09:52visofmavbozo: today is 1/04
09:52domgettervisof: the best solution is probably to shove it in a relational database, but you want to avoid that, no?
09:54engblomvisof: I do a lot of similar things in my work.... but there I really think bash scripts are the best tools.
10:03visofengblom: i want to make this funcionality inside my code
10:03visofdomgetter: yeah i want to avoid it
10:30jsabeaudrySanity check: wrapping a reset! in a dosync is pointless, right?
10:31ridcully_reset! is for atoms, dosync is for refs
10:33jsabeaudryridcully_, thanks, I'm cleaning some old code and this made no sense to me
10:37nathanicet
11:15matthavenervisof: run through the file once and create a lookup table of 'first field' to 'file offset and length', and then mmap the file
12:20kungiIs there a maximum function size in clojure?
12:20kungiWhen I try to evaluate a function I get the funky error: Unknown constant tag 80 in class file
12:20Bronsa`there's a hard limit on how much bytecode can be emitted, imposed by the jvm
12:21Bronsa`kungi: can you nopaste that function?
12:21kungiBronsa`: yes
12:22kungihttp://p.nnev.de/8084
12:22Bronsa`you're probably exceding the max size for the jvm constant pool
12:22Bronsa`don't embed huge strings in code
12:23kungiBronsa`: Ok.
12:23Bronsa`save them in a file and read that file
12:24kungiBronsa`: To my defense I have to say: It's not my code :-). Some guy tries to evaluate how far he can adapt my code through my "templates".
12:49engblomWhen looking at this file: http://pastebin.com/J9eCWA3y , what do you think is the best way to check that the first line ends with "YES"? And what would be the best way to get the number from t=number at the end of the second line?
12:50engblomWould you use (subs ...)?
12:51engblomIf I would use subs, I would need to catch StringIndexOutOfBoundsException... Because the line length might vary.
12:52Bronsa`engblom: a regex?
12:55engblomBronsa`: How would you use regex to get out only 20750 from "4c 01 55 00 7f ff 0c 10 be t=20750"? The value might vary.
12:57Bronsa`engblom: wouldn't #".*t=(.*)" do?
12:59devth,(re-find #"\d+$" "4c 01 55 00 7f ff 0c 10 be t=20750")
12:59clojurebot"20750"
12:59devthif the value is always numeric
12:59devthint to be specific
13:01engblomThanks!
13:08justin_smithjonathanj: regarding what you can use as keys - you *can* use anything as a key in a hash-map, but using a mutable object as a key, then mutating it, will have fun consequences that your code probably isn't ready for
13:09devthso...i never got in the habit of using transducers. read all about them a few years ago. are they making anyone else's life better?
13:09devth*1.5 yrs or whatever it was
13:10devthsame with reducers
13:13justin_smithdevth: they are a performance tweak that helps a bit, and for those people creating things like core.async that have new data sources they are an awesome feature
13:13devthmakes sense. more appropriate for certain lib authors..
13:14devthone thing that almost made me reach for reducers the other day was wanting to perform a map and a filter at the same time.
13:14devthwhich you are essentially doing if you compose reducers, right?
13:15justin_smithdevth: reducers and transducers are not the same thing
13:15justin_smithyou compose transducers
13:16devthyes i know they are not the same thing :P
13:16justin_smithOK, reducers are not a thing you can compose
13:16devthok, got mixed up while reading http://ianrumford.github.io/blog/2013/08/25/some-trivial-examples-of-using-clojure-reducers/ i guess
13:44engblomI tried to take use of the -> macro, but failed. Could someone please tell me what I am doing wrong in http://pastebin.com/Xy8KC5AB
13:47engblomWith that code I am trying to list all files having a filename beginning with "28"
13:47engblomIt is doing what it should do until line 8 where it fails
13:47ridcully_map and filter want the seq last
13:48engblomWhen I had them nested, without -> it worked
13:48featheredtoastprobably better to use the ->> macro
13:48featheredtoastif you're going that route
13:49justin_smith(-> "/some/path" File. .listFiles seq (->> (map #(.getName %)) (filter #(= "28" (subs % 0 2)))))
13:49justin_smithor just use ->> all throughout I guess
13:49justin_smithalso, that last check might be better as #(.startsWith % "28")
13:53engblomActually, all the files I want are looking like this: 28-something. For example 28-04146d8243ff. I would want the 04146d8243ff part of all those files.
13:53justin_smithengblom: right, I was saying use that as the filter
13:53justin_smithinstead of subs etc.
13:54justin_smith,(filter #(.startsWith % "28") ["28hi" "no" "a" "28done"])
13:54clojurebot("28hi" "28done")
13:54engblomThanks
13:54justin_smithengblom: also, with your existing filter lambda, you would get an error with a one character file name
13:55justin_smith(not that this is likely, but just so you know)
13:57engblomOk, now it is outputting a list looking like this: ("28-04146d54e7ff" "28-04146d8243ff")
13:57engblomHow would you remove the "28-" part from each, knowing that in worst case the list is empty?
13:58justin_smith,(clojure.string/replace "28-foo" "28-" "")
13:58clojurebot"foo"
13:59justin_smithor, if it is guaratneed that all start with 28- #(subs % 3)
13:59engblomjustin_smith: So another map?
13:59justin_smithengblom: right
13:59ridcully_if you filter for 28- you can savely remove it. if you have concerns about a `28-` file leaving you with an empty name, you can either use a regexp to filter or just use that file
13:59justin_smith,(subs "28-foo" 3)
13:59clojurebot"foo"
13:59engblomjustin_smith: It is pretty much sure all begins with 28 as we already filtered out only those
13:59justin_smithright, right
14:01engblomThanks!
14:02justin_smithyou could replace the two maps with one keep (keep #(when (.startsWith % "28-") (subs % 3)))
14:03justin_smiththe when returns nil for non-matches, and those are removed by keep
14:26engblomI have a list (key1 key2 key3) and a function f. Now I would want to create a map {key1 (f key1) key2 (f key2) key3 (f key3)}. The value is always what you get when you run f on the key. Is there a ready function for that, or do I need to create one myself?
14:27justin_smith(zipmap key-list (map f key-list))
14:27justin_smithor (into {} (map (juxt identity f) key-list))
14:28justin_smithor (into {} (map (juxt identity f)) key-list)
14:28justin_smithI like the last one best
14:32engblomThanks!
14:43engblomNow I have a pretty useful GPIO library for Raspberry Pi: https://github.com/engblom/gpio
14:43justin_smithcool
14:43justin_smithengblom: glad you didn't give up when that other one didn't work out
14:44engblomI know I am not experienced with Clojure, so if anyone got interrest to improve on it, feel free to do so. I might learn something from that too :)
14:55kungiengblom: how does defn ^:private differ from defn-?
14:59souterrainengblom: I'm learning clojure, and now I'll have to dust off the RPi as well. Thanks. :)
15:06noncom|2did anyone had a chance to install a fresh emacs with prelude recently?
15:19engblomkungi: It is the same as far as I understand.
15:20engblomsouterrain: Yes, please do that! I am happy for as much testing as possible of this library.
15:21engblomsouterrain: I think this library should make GPIO programming very simple. It will work as normal unprivileged user.
15:22engblomsouterrain: I have tested it with the Jessie version of Raspbian, which added the gpio user group.
15:23noncom|2recently i installed a freshnew emacs and with prelude and it hangs on loading
15:23noncom|2it eats 1 core of CPU and all RAM it can get, doing nothing on the stage where prelude should draw its packages
15:23noncom|2...
15:23noncom|2what do i do?
15:24justin_smithnoncom|2: have you tried the -debug-init flag?
15:24justin_smithnoncom|2: another option is to start "emacs -q" (load no user init), then run each line of your .emacs one at a time in the ielm console
15:25justin_smiththen you can see which one hangs (and see verbose output as each step runs)
15:26justin_smithnoncom|2: or, instead of ielm, you can just open your .emacs and use C-M-x to run each line of your .emacs one at a time
15:26noncom|2justin_smith: just tried the -debug-init flag.. does not change anything.. emacs starts in its bare configuration, tries contacting melpa on behalf of prelude and hangs..
15:27noncom|2i don't actually ahve any customization in init.el at all, it all comes from prelude
15:27noncom|2its a fresh one
15:27noncom|2would that mean that prelude installation is broken now?
15:27noncom|2i can try to run it an instruction-by-instruction..
15:27justin_smithnoncom|2: until melpa is available, sounds like it...
15:27justin_smithnoncom|2: yeah, my suggestion would end up leading ot debugging what broke about prelude
15:28justin_smithbut it sounds like you already know connecting ot melpa is the part that is broken
15:28sdegutisAre all Clojure libraries, and Clojure itself, and third party libraries, known to work well with Java JDK 8?
15:28noncom|2justin_smith: well, at least, its the last text that remains in the status line when it hangs
15:28kwladykacfleming i heard you can say something about add rum macros like rum/defc rum/defcs and < to curisve in intellij? I want make show parameters, jump to source, refactoring etc. work for https://github.com/tonsky/rum
15:28engblomsdegutis: I have not had any problem at least, but that does not neccessary mean much as I have only used a fraction.
15:29justin_smithsdegutis: I would hesitate to make any assertion about "all third party libraries". There are definitely at least some third party libs that will break with jdk 8, I'm sure of it. How many? hopefully very few.
15:29justin_smithsdegutis: I've had no problems using jdk8 for a large project with many deps
15:30sdegutisjustin_smith: so then do most people use JDK 1.7 rather?
15:30justin_smithsdegutis: why would jdk8 be more likely to break something than 7 would? clojure says it will work with 6+
15:30justin_smithin my experience it works great with 6,7, or 8
15:31sdegutisCool.
15:31justin_smithI'm just saying, third party libs break in weird ways, and there are a lot of them. But the good ones work with 8, in my experience so far.
15:31engblomThe library I just wrote will not work with jdk1.6...
15:31sdegutisI upgraded to JDK 1.8 a few weeks ago and my server stopped sending emails (it seemed that it no longer could send them) via AWS JDK SES.
15:31engblom1.7 added the WatchService
15:32justin_smithsdegutis: is aws using 1.8?
15:32justin_smithsdegutis: the one gotcha I can think of is if you were using javac locally with 1.8 and targetting the wrong version
15:33sdegutishmm
15:33justin_smithor a random 1.8 bug that you found, I guess?
15:33sdegutismaybe
15:34sdegutislooking into it today (first day back at work)
15:38noncom|2there is (defvar prelude-dir (file-name-directory load-file-name) "comment") at the very beginning, C-x C-e it gives "Wrong type argument: stringp, nil" and everywhere further, prelude-dir == nil. is this okay or does it look like a problem?
15:39noncom|2this being nil ruins all other dir inits furhter down..
15:39noncom|2but idk if it's the same with the real work, as with C-x C-e
15:40justin_smiththat expression should return the directory the file is in, but if loading line by line it might not
15:40justin_smithyou might need to do an explicit set with M-x :
15:40justin_smithyou can also use M-x : (or an IELM repl buffer) to check the value of prelude-dir, make sure it is set, etc.
15:44noncom|2justin_smith: umm it's still always nil.. even if i do : http://joxi.ru/1A5b5BZFKzkEVr and C-x C-e it separately
15:44noncom|2there, at the next line where it should be used, it is nil..
15:45noncom|2eh.. i guess finding what's the problem with emacs will be a real quest
15:45justin_smithnoncom|2: defvar is like defonce
15:45noncom|2ah
15:45justin_smithyou need to use setq instead to explicitly set the var
15:45justin_smith(only while debugging, of course)
15:45justin_smithwelcome to the magical world of elisp!
15:45noncom|2oh, that really worked!
15:45noncom|2ehehe))
15:48noncom|2justin_smith: yes, found the line, err: http://joxi.ru/KAgKZaYugNe3kA
15:48justin_smithnoncom|2: and that is just like clojure require, it looks for the prelude-packages.el file, and the error will be somewhere in there
15:49noncom|2yeah
16:08spiedenanyone using devcards with reagent? can't find versions of both that work together
16:08jonathanjjustin_smith: cool, i have no intention of mutating it
16:11noncom|2justin_smith: heh: http://joxi.ru/BA0d9E6uBvwXnA
16:13noncom|2i don't know what could be wrong with it
16:14noncom|2simply the package download hangs
16:14noncom|2but not just hangs - it wastes a lot of cpu and memory..
16:14noncom|2and it never happened before. afaik there were no changes to emacs and prelude since it worked the last time
16:14noncom|2:/
16:14justin_smithnoncom|2: is that host available?
16:16noncom|2justin_smith: this one: https://melpa.org/packages/ yes, looks like it is online
16:17noncom|2anyway, what a terrible error must be to cause this type of hang..
16:20noncom|2damn this is a blocker... i'll have to reside to some sublime text..
17:18pilnehrm.. is the reason it is so easy to call frege functions from clojure because frege compiles first to java source and then lets javac compile it down to java bytecode?
17:19hiredmanclojure interop with other jvm langauges is via the jvm
17:19hiredmanthe jvm provides types and an object model
17:41pilneyeah, but when i mentioned calling scala from clojure, i was told it can be difficult due to the way scala handles things, frege seems to compile down to "plain" java, which is what i assume makes it easy to call it?
17:45TEttingerpilne: from what I understand, frege does seem to compile down to some approximation of ordinary java.
17:45hiredmanmy understanding is frege's runtime is more, maybe 'reified' is the right word, so the semantics sort of match the generated code, where scala's compiler is more sophisticated
17:45TEttingerthis is hello world http://lpaste.net/148367
17:45TEttinger(compiled to java)
17:46TEttingerthere's no defined frege fns there, so I'm not sure how they are callable (I could ask my friend who made it to compile a defn example)
17:46hiredmana more sophisticaed compiler, through transforms and optimizations what have you, can result in code that has the semantics of the input language, but looks way different
17:48pilneinteresting
17:50pilnethis is the kinda shit that really interests me and gets my brain churning... i need a way to hack on things productively on my phone so i can burn downtime at work productively to gain more time hacking code >.< lol
20:01souterrainengblom: which JRE are you using on RPi? Just curious whether there are performance issues, or if there is a better one to choose on a small system like that.
20:19justin_smithsouterrain: I've had good luck with the vm that comes with raspian (sun jdk 8)
20:38TEttingerI'm curious if Avian can run Clojure now with something less than the heavyweight OpenJDK class library
20:50justin_smithTEttinger: even if it was possible, it would also require people not use non-avian stuff via interop, right?
20:50TEttingermmm
20:54souterrainjustin_smith: ok, thanks. I'll stick with what raspian comes with then.
21:29mikerodare Java type hints safe to leave in cljs code?
21:29mikerodmeaning does the compiler allow it
21:29mikerodor do you need to reader-conditional it out etc
21:30mikerodfor some reason I haven't been able to find a definite answer to this - I'm just not sure what is the "best practice" there
21:39banjiewenI'm running in to a strange issue with static methods in a gen-class and return type casts: https://gist.github.com/banjiewen/cc0a03e16e5880ed60bd
21:39banjiewenIn short, "ClassCastException rat.fish.RatFish cannot be cast to rat.fish.RatFish" doesn't make much sense to me.
21:39banjiewenGuessing I'm lacking some sort of interop understanding
21:41banjiewenAny suggestions would be greatly appreciated.
21:45mikerod@banjiewen I think I don't see enough info here to try to diagnose the issue
21:46mikerodor I don't understand all the tricky details about gen-class
21:46mikerodit sort of sounds to me like you have multiple instances of the same class from conflicting class loaders
21:46banjiewenmikerod: RatFish is a pretty straightforward `defrecord` in ns rat.fish
21:47mikerodperhaps you have an AOT-compile-loaded RatFish in the AppClassLoader and then you have a 2nd version of this RatFish from a Clojure DynamicClassLoader due to the :require
21:47mikerodI can't immediately think of any related Jiras or anything to this and I cannot see how you could be doing something wrong here really
21:50banjiewenThanks for taking a look, anyway.
21:51justin_smithbanjiewen: this happens because of reloaded code
21:51banjiewenThere's no way to stick a static method on a defrecord'd class, is there?
21:51justin_smithbanjiewen: the old object is not an instance of the new definition
21:51justin_smithbanjiewen: yes, there is
21:51justin_smithoh wait, not statics
21:51justin_smithn/m
21:52banjiewenjustin_smith: I'll try with a clean environment to see
21:52justin_smithbanjiewen: you might need to run lein clean before starting a new repl
21:52banjiewenkk
22:03mikerodbanjiewen: I'd like to see the series of steps you take
22:03mikerodto build the project and then run your repl
22:04mikerodit does seem like you're managing to get Clojure's DynamicClassLoader to load up a RatFish class instance after your AOT-compiled code has already loaded a RatFish class instance with another loader - probably your system dependent "AppClassLoader"
22:04mikerodor "jvm dependent" I guess
22:05banjiewenmikerod: Looks like justin_smith was right about the environment - too much cruft lying around. `lein clean` followed by some fixup on my project.clj cleared up the issue.
22:05banjiewenThanks both.
22:05mikerodhaha good
22:05mikerodthat makes it simple then
22:06justin_smithalias wat lein clean
22:06justin_smithheh
22:06mikerodAOT-compiled code is often a quick way to get in scenarios where you see MyClass cannot be cast to MyClass
23:05jeayeHow could I make this work: (update-in {:foo {:bar [1 2 3 4 5 6]}} [:foo :bar] remove even?)
23:05justin_smith,(update-in {:foo {:bar [1 2 3 4 5 6]}} [:foo :bar] (partial remove even?))
23:05clojurebot{:foo {:bar (1 3 5)}}
23:06jeaye,(update-in {:foo {:bar [1 2 3 4 5 6]}} [:foo :bar] #(remove even? %))
23:06clojurebot{:foo {:bar (1 3 5)}}
23:06jeayejustin_smith: Ah, beat me to it.
23:06jeayeThanks.
23:07justin_smithnp - you almost had the answer already, clearly
23:07justin_smithjeaye: also, if you have flip (update-in m (flip remove) even?)
23:07jeaye,(doc flip)
23:07clojurebotI don't understand.
23:07justin_smitherr, forgot the kvec but I think you get the idea
23:08jeayeWhere does flip live?
23:08justin_smithjeaye: flip is a function available in a few util libs that returns a new function taking the same number of args, in the opposite order
23:08jeayeAh. I don't have it.
23:08justin_smithI think there is a version of flip in flatland/useful and also in prismatic/plumbing
23:08justin_smithalso it is an easy function to write
23:09justin_smith,(defn flip [f] (fn [& args] (apply f (reverse args))))
23:09clojurebot#'sandbox/flip
23:09jeayeNo problem. I'll leave it as-is for now.
23:09justin_smith,(update-in {:foo {:bar [1 2 3 4 5 6]}} [:foo :bar] (flip remove) even?)
23:09clojurebot{:foo {:bar (1 3 5)}}