#clojure logs

2014-12-11

00:07owi@ambrosebs hi, do you know if there's any work being done on http://dev.clojure.org/jira/browse/CTYP-167 ?
00:09owi@ambrosebs I really like core.typed but this might be kind of a deal breaker for our project. Not sure how often it's gonna pop up
00:30justin_smithrritoch: your editor doesn't hint arg names?
00:31justin_smithmunderwo: just a style thing - for let bindings you don't use for anything, the canonical binding is _
00:32justin_smith(you use temp)
00:32rritochjustin_smith: I'm using counterclockwise and I've never seen any type hints
00:34munderwoahh thanks justin_smith
00:43nicferrierjustin_smith: only on unix tho and I want to have this work on windows too. don't ask.
00:43justin_smithouch
00:44nicferrieryeah.
00:44nicferriernow I gotta go to work. and it's raining.
00:44justin_smithwow. good luck
00:52rritochIs anyone aware of a clojure library for manipulating version numbers in a standard way? Such as converting a version string into a comparable version object?
01:04puredangeryou mean Maven coordinate type stuff?
01:06puredangerthe pomegranate lib (https://github.com/cemerick/pomegranate) wraps the underlying Aether stuff used by Maven. There is stuff in both related to this. if you don't care about Maven eccentricities it's probably far uglier than what you want
01:25rritochIn leiningen is there any way to load a dependency from a specific repository, or to exclude certain repositories?
01:27puredanger"lein sample" is pretty useful for seeing what lein supports
01:27puredangerI do not believe you can be that specific with deps
01:27puredangerI do think that the repos are checked in order however
01:28puredangera lot of people run enterprise repos like Nexus that proxy external repos and they have some facilities for this kind of thing too
01:28rritochpuredanger thanks. I don't explicitly include clojars in my repositories, so maybe that is the issue, I just need to change the order they're checked.
01:28puredangerclojars is implicit from lein
01:29puredangerthere is probably some way to exclude it though
01:29rritochpuredanger: Yes, but I need clojars checked first
01:29puredangerah, then yes I would think including it first in the repos list would help
01:31puredangeryeah, use ^:replace before the repositories vector to remove clojars, then re-include it as first repo
01:35FrozenlockRing wrap-frame-options overrides my header :-(
01:40rritochpuredanger: Wow, the actual solution was much simpler, I just needed to use the correct name for the artifact. I forgot the clj- prefix so when it got to the private repositories which must be configured wrong, it was throwing errors.
01:41rritochpuredanger: My fault for trying to work on 5 hours sleep
01:42rritochpuredanger: Either way, thanks for the help. Those tips will likely come in handy in the future.
02:01kenrestivowhat exactly causes cancellaton exceptions? i'm having trouble tracking down where they are comingfrom.. the stacktrace isn't terribly helpful
02:28rritochIs there any way to make a lazy sequence from a java method that ends on null? I'm looking through clojure.core and the closest to what I'm looking for is the iterate function, but as far as I can tell iterate wouldn't ever end.
02:28SagiCZ1rritoch: there is a function called lazy-seq which lets you state how to fetch the element you want.. if you add a condition to it, you may achieve the result you want
02:28SagiCZ1(doc lazy-seq)
02:28clojurebot"([& body]); Takes a body of expressions that returns an ISeq or nil, and yields a Seqable object that will invoke the body only the first time seq is called, and will cache the result and return it on all subsequent seq calls. See also - realized?"
02:32noidi(doc take-while)
02:32clojurebot"([pred] [pred coll]); Returns a lazy sequence of successive items from coll while (pred item) returns true. pred must be free of side-effects. Returns a transducer when no collection is provided."
02:37rritochnoidi: Thanks, I think that is what I need. So I should be able to (take-while identity (iterate (partial #(.getNextEntry %1 %2) zip-input-stream)) so if the file I need isn't there it will stop on nil, otherwise (using filter) I can grab the file I nead without parsing the entire zipfile.
02:39rritochnoidi: err, that %2 isn't needed
02:39SagiCZ1dont forget to close the zip input stream
02:39SagiCZ1and the entry as well
02:41rritochSagiCZ1: Won't they automatically close when I (System/exit 0) ?
02:41rritochSagiCZ1: This isn't a long running app. I'm just going to grab the file and run.
02:42SagiCZ1rritoch: yeah they would close with the jvm, definitely
02:42rritochSagiCZ1: Ok thanks, either way you have a good point that I can't use this in long running apps since after I get past the filter I won't be able to close the entries.
02:44SagiCZ1yup.. i am actually trying to solve a similar issue.. lazy reading from zipped files and i havnt find a solution for closing them.. you can leave them open, but its good to know about it
02:46rritochSagiCZ1: It may be a bit ugly, but one idea I can think of would be passing in an atom to cache every one that is read for future closing.
02:47SagiCZ1yeah.. that should be possible.. i may resort to that if i cant find a nice solution
02:51rritochSagiCZ1: Anyhow iterate still isn't the right function, I need to use take-while and repeatedly, but at least I have a solution
03:41tsdhSince I've installed JDK8, I get these warnings when running "lein test" in my project. warning: Supported source version 'RELEASE_6' from annotation processor 'org.sonatype.guice.bean.scanners.index.SisuIndexAPT6' less than -source '1.8'
03:41tsdhIs there a way to get rid of those? (Well, other than to switch to an older JDK of course)
03:48yotsovfrom 27th until when do we take care of gomboc?
03:48yotsovoh sorry, wrong window :)
05:09si14what's the most idiomatic/fast/concise way to form a Clojure vector with some values that can be missing? Like [:a :b (when (pred foo) :c) :d] , but without nils inside
05:11clgvsi14: that's not possible. if there is no meaningful value you set, the vector must at least have an entry at the position, e.g. nil or some custom :unset
05:11clgvsi14: or do you mean the vector can be shorter when the value is missing?
05:12clgv,(cond-> [:a :b] (odd? 2) (conj :c) true (conj :d))
05:12clojurebot[:a :b :d]
05:12clgv,(cond-> [:a :b] (even? 2) (conj :c) true (conj :d))
05:12clojurebot[:a :b :c :d]
05:13si14clgv: yep, it's not possible with syntax that I've wrote there. Of course it can be something with flatten or (-> filter vec), but I was wondering if there is a better way
05:14clgvsi14: see the examples above
05:15si14cond-> and true _smth_ makes it less obvious IMO than more straightforward (let [foo [:a :b] foo (if (odd? 2) (conj foo :c) c) ...] foo)
05:19whodidthishow do i {:a 1 :b 2 :c 3} => '([:a 1] [:b 2] [:c 3]) without messing up the order
05:20si14whodidthis: it's not possible, order is not defined in hashmap
05:20mearnsh,(seq (into (sorted-map) {:a 1 :b 2 :c 3}))
05:20clojurebot([:a 1] [:b 2] [:c 3])
05:20whodidthisok, thanks
05:20si14whodidthis: of course, except if it's a sorted-map
05:21si14mearnsh: you are implying that keys are sorted. it can be true only in the example above and not in their real code
05:23mearnshtrue
05:28rritochsi14: If you want to stick with the vector syntax you can use map filter and partition like ##(mapv first (filterv second (partition 2 [:a true :b true :c false])))
05:28lazybot⇒ [:a :b]
05:28rritochsi14: of course eaach of those true/false statements can be replaced with your actual test
05:29rritochsi14: Using the new transducers it is probably possible to reduce this to a single function, though I haven't tried.
05:29si14rritoch: thanks!
05:31rritochsi14: I'm going to toy with transducers in repl because this seems to be an ideal case for one
05:32rritochsi14: But I'm not sure since partition isn't really a reducer
05:33si14rritoch: yes, it seems so. However, I didn't think about mapv/filterv, it seems nice even like this — it bugged me a bit to perform vector -> seq -> seq -> vector for such a simple task
05:33rritochSo far it's not looking good... (partition 2) doesn't produce a transducer
05:47rritochsi14: Ok using transducers you can make a function as follows...
05:48rritochOne sec, problem with copy/paste
05:48rritoch,((fn [v] (into [] (comp (filter second) (map first)) (partition 2 v))) [:a true :b true :c false])
05:49clojurebot[:a :b]
05:50rritochsi14: Instead of using this as an anonymous function you can assign it as a function using def and you have a reusable, clean, transducer that is very clean to use.
05:50si14rritoch: thank you :)
05:53H4nsis there an idiomatic way to force the loading of a certain clojure file when a jar is loaded, without putting the namespace into the dependency tree of the main class?
05:54H4nswe're building an uberjar with lots of unrelated functionality packed together, and we thought we could use some top-level function to register ourselves with the command line driver. but as the main function does not depend on the implementations for each command explicitly, the command implementations are never loaded.
05:54H4nswe thought about using the class loader to search for certain classes, but before going that route, maybe there is a way to annotate a namespace so that it is always loaded?
05:57tsdhsi14: Wrt. to your vector question, you could also use splicing:
05:57tsdh,`[:a :b ~@(when (odd? 3) [:c])]
05:57clojurebot[:a :b :c]
05:59rritochH4ns: Are the clojure files that you plan on loading included in the jar?
06:00H4nsrritoch: yes
06:01rritochH4ns: You could try load, I don't believe that links any dependency
06:02H4nsrritoch: but that'd require that i more or less know the full class name, right?
06:02si14tsdh: it's possible only if that predicate is known in compile time, isn't it?
06:03rritochhttps://clojuredocs.org/clojure.core/load
06:04rritochH4ns: You need to know the path to the file you want to load
06:05H4nsrritoch: okay, that seems like a good approach, thanks!
06:14clgvsi14: "true" was just a compromise to keep it short. in most cases cond-> is preferrable over equivalent imperative lets
06:16clgvH4ns: you can normally require them as well
06:26rritochIs there any way to get partition 2 into a transducable function composition so it partititions the collection before applying the other functions?
06:31clgvrritoch: is there no implementation in 1.7-alpha? I think partition was mentioned in some clojure/conj 2014 transducers talk
06:32rritochclgv: The version I'm using is based on alpha-4 and partition doesn't return a transducer
06:32rritoch,(type (partition 2))
06:32clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core/partition>
06:32rritochsame here
06:33clgvhuh
06:34rritochclgv: Hmm, I see partition-by and partition-all, maybe they'll do it
06:34clgvrritoch: does it have a different name? since merging the transducer version with the original partition wont work due to the existing arities
06:35clgvrritoch: yeah they are mentioned on http://clojure.org/transducers
06:36clgvrritoch: but the weird thing is that (partition-all 2 1) wont work
06:36clgv,(transduce (partition-all 2 1) (range 5))
06:36clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core/transduce>
06:36clgv,(transduce ((partition-all 2 1) (range 5)))
06:36clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to clojure.lang.IFn>
06:37rritochYay, partition all works :)
06:37clgvalso with 2 ints?
06:37rritoch,((fn [v] (into [] (comp (partition-all 2) (filter second) (map first)) v)) [:a true :b true :c false])
06:37clojurebot[:a :b]
06:38rritochHmm, it should
06:38rritoch,((fn [v] (into [] (comp (partition-all 2 1) (filter second) (map first)) v)) [:a true :b true :c false])
06:38clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to clojure.lang.IFn>
06:38rritochGuess not
06:38clgvwow. that's a fail...
06:38rritochI'll check alpha 4
06:39rritochIt doesn't work in alpha 4 either
06:39clgvThat's one reason to not combine lazy and transducer versions
06:40clgvit'll be a mess :/
06:44clgvbut I guess that decision is carved in stone already
06:45rritochclgv: Well they should alter the docs, I checked the source code and there's no code at all to create a transducer for any ararity > 1
06:48clgvrritoch: I think transducers are in fact not an addition but a breaking change. so why not produce a 2.0 with transducers in clojure.core and lazy stuff for convenience in clojure.core.lazy - maybe some other held back breaking changes (improvements/fixes) could be introduced as well
06:50tsdhsi14: No. You can use syntax-quote also to compute stuff at runtime. It's just a syntactic sugar for a complex list/vector/map construction form.
06:52clgvtsdh: I'd still prefer cond-> in that case
07:00tsdhclgv: Matter of preference, I guess. I thing the syntax-quote version might be a bit more clear in cases the vector looks like [m o o m o m o m m o] where m means mandatory and o optional. For the m-cases, you always need a "true <whatever>" clause where you just have <whatever> in the syntax-quoted form.p
07:00clgvtsdh: but it adds a lot of complexity
07:00clgvtsdh: this also very context dependent
07:01tsdhclgv: Complexity in which respect?
07:01Barley_is there any good way to make a macro that functions like defn (and calls defn) but adds some functionality to the functions is makes (like transforms the return value)
07:02Barley_since defn can have such a different number of arguments
07:02tsdhBarley_: Check out tools.macro
07:03tsdhBarley_: Espectially tools.macro/name-with-attributes
07:03clgvBarley_: tools.macro as tsdh said, or checkout how the defn implementation parses the arguments
07:04tsdhBarley_: Yep, basically you'd end up with a let that rebinds "more" a gazillion times. ;-)
07:04Barley_yeah, i looked at defn and it was pretty heavy on the argument handling stuff
07:05Barley_it's easy enough to make a defn macro that just takes the name, args and body
07:05Barley_but add docs and preconditions...
07:05Barley_boom
07:06tsdhBarley_: With tools.macro/name-with-attributes you take only [name & more] and that splices out the attr-map, the docstring, etc. for you.
07:06Barley_sounds good
07:06Barley_i'll have a look
07:07Barley_thanks
07:45trisshey all. I'm trying to get a soundfile in to my clojurescript app
07:46trissI'm using ajax.core's GET to request the file
07:46trissthe responce type set for XMLHTTPRequest would be an arraybuffer
07:47trisshow to i set this responce type for GET?
09:08dnolen_cfleming: is macroexpansion in a cider release yet?
09:08dnolen_cfleming: er cursive release I meant of course
09:10si14clgv: thanks, I'll think about it more.
09:11si14tsdh: yes, it's exactly what I was looking for. Thank you!
09:46trissis there a difference in how clojurescript and clojure handle atoms?
09:47justin_smithI doubt you would see many retries in clojurescript, if any
09:47trissI keep seeing an error like this: No protocol method ITransientAssociative.-assoc! defined for type cljs.core/Atom: [object Object]
09:48justin_smithtriss: assoc! is for transients, not atoms
09:48clgvtriss: you apply assoc! on a an atom and not on the value of the atom
09:48trissso i have my atom:
09:48justin_smithclgv: assoc! is not for atoms
09:49justin_smith,(assoc! (transient {}) :a 0)
09:49clojurebot#<TransientArrayMap clojure.lang.PersistentArrayMap$TransientArrayMap@4490c9>
09:49justin_smith,(assoc! (atom {}) :a 0)
09:49clgvjustin_smith: correct, I didnt claim that. I just explained the reason for the error message
09:49clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Atom cannot be cast to clojure.lang.ITransientAssociative>
09:49dnolen_triss: for atoms the operations are swap! or reset!
09:49justin_smithclgv: OK, as long as we are on the right page here
09:49trissah thanks dnolen
09:50justin_smithclgv: "apply assoc! on an atom" makes no sense
09:50trissgot things going now!
09:50dnolen_,(swap! (atom 1) inc)
09:50clojurebot2
09:50trisscheers guys
09:52clgvjustin_smith: sorry I didnt mark the clojure functions. the only clojure function in that statement was `assoc!`. everything else is english words to describe how the posted error happens
09:52justin_smithOK
09:53justin_smithclgv: I see my misunderstanding I read "you apply" as an imperative, rather than descriptive. Text is hard.
09:55clgvjustin_smith: :P
10:11tmarshIs there a good tutorial for getting a browser connected repl for cursive anywhere?
10:29mikerodCider emacs sort of question - is there a way to change the default spacing in forms from 1 space to 2 spaces. I'm not sure how to work this exactly, but basically if I have a new macro or something that doesn't get automatically matched to something hard-wired in clojure-mode indentation rules it tends to start the next line at 1 space instead of 2.
10:29mikerodHowever, a `do` block starts at 2 spaces. I'd think that'd be the default, but apparently it isn't
10:30mikerodSo a macro that is intended to be written like a `do` block often is: (my-macro-name\newline<forms>)
10:30justin_smithmikerod: there is a file that defines the styles, and defines the forms that get the custom styles
10:30mikerodjustin_smith: I have messed with those extensions
10:30mikerodit looks like I have to set each macro manually
10:31mikerodto behave like `do` to get my 2 spacs
10:31mikerodthat isn't necessarily ideal
10:31mikerodespecially when it isn't able to understand an aliased symbol vs a referred vs a fully-qualified
10:31justin_smithperhaps you could write an elisp function that detects "do-macros" and does the update when you open the source file?
10:31mikerodI actually think it is odd that the default "block" style indentation doesn't align with a `do` block. I'm wondering if this is falling back to some lisp-mode rules
10:32justin_smithNot sure on that account. Could be.
10:32mikerodjustin_smith: I could try that. I was hoping for a solution that's like "just set this var to 2" haha
10:33mikerodI'll keep digging. I have been reading through it slowly. I'm no elisp expert, but picking up.
10:34justin_smithmikerod: you could use a special comment or metadata literal that is easy for the elisp to find, maybe
10:34justin_smithor just make a comment on the top line with the elisp code to load, that's a feature that already exists
10:35justin_smithbut it would only help if you loaded the file defining those macros, of course
10:36stuartsierraElisp: (define-clojure-indent (my-custom-macro 'defun))
10:36mikerodjustin_smith: hmm yeah I think I see what you are saying
10:36mikerodstuartsierra: yes, I have figured out to do explicit settings like that
10:36stuartsierraThere's a global setting too but I forget its name.
10:36mikerodstuartsierra: it didn't seem to understand alias vs qualified vs unqualified was one issue. also I wanted a different "default" when it didn't know what to do because I had not implicitly defined it yet
10:37mikerodclojure-defun-style-default-indent looked promising
10:37mikerodit actually kind of worked, but then it stopped using some of the other good indentation rules that were defined for other forms :P
10:37mikerodthat's probably why it is nil by default
10:39justin_smithmikerod: have you tried changing the value of lisp-indent-offset
10:39justin_smiththat seems to be the top level default
10:39justin_smithor a quick glance leads me to believe that at least
10:42mikerodjustin_smith: just tried it. it actually did do what I wanted within an unknown symbol. however, it was destructive to the other rules that clojure-mode is using so don't think it'll be the magic to solve the issue for me.
10:42EvanR,(type #"")
10:42clojurebotjava.util.regex.Pattern
10:42justin_smithmikerod: you could redefine the preset ones from clojure-mode.el
10:44ordnungswidrigis there a plugin for leiningen to graph the (conflicting) dependency versions?
10:44ordnungswidrigI only found plugins to graph the ns dependencies
10:44mikerodjustin_smith: yeah, I think I'll just keep diggin in clojure-mode to see if I can isolate the 1 space calculation
10:48EvanRis there a way to change the "magic" of the regex patterns, so for example period is really a period unless you put a backslash period, in which case its any (non-newline) char
10:51winkwait..what?
10:52ordnungswidrigEvanR: java.util.regex.Pattern/quote
10:54EvanR,(re-matches (java.util.regex.Pattern/quote #"ab.d") "abcd")
10:54clojurebot#<ClassCastException java.lang.ClassCastException: java.util.regex.Pattern cannot be cast to java.lang.String>
10:54EvanR,(re-matches (java.util.regex.Pattern/quote "ab.d") "abcd")
10:54clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.util.regex.Pattern>
10:54EvanR,(re-matches (re-pattern (java.util.regex.Pattern/quote "ab.d")) "abcd")
10:54clojurebotnil
10:54justin_smithEvanR: you are so close!
10:55EvanR,(re-matches (re-pattern (java.util.regex.Pattern/quote "ab\\.d")) "abcd")
10:55clojurebotnil
10:55justin_smithhttps://clojuredocs.org/clojure.core/re-pattern <- see also the advanced usages here for specifying other options inside a regex
11:00ordnungswidrig,(re-matches (re-pattern (java.util.regex.Pattern/quote "ab.d")) "ab.d")
11:00clojurebot"ab.d"
11:01EvanRyes but "ab\\.d" wont match "abcd"
11:01EvanRlike the vim "no magic" option
11:02EvanRbasically, if i was reduced to providing users with a regex option, it seems like it would be easier for them to use a no magic regex and have to use \ to use special features
11:02ordnungswidrigEvanR: (quite "ab\\.d") would match "ab\\.d"
11:03EvanRyeah i got that
11:03EvanRrather than quoting i was referring to reversing the magic
11:03ordnungswidrigEvanR: well, java's regex work like most of the regex implementations worked since the beginning of time
11:03crash_epDifferent regex flavors. Clojure uses Java's flavor, and Java's flavor doesn't have a "Vim-compatible" mode.
11:04EvanRim not sure thats true, but after realizing that clojure is dependent on whatever underlying hosts regex do, nevermind
11:04crash_epordnungswidrig: that statement betrays your youth! :)
11:04ordnungswidrigwell, you can implement a preprocessor the escapes and un-escaped what's necessary
11:04ordnungswidrigcrash_ep: :-P
11:04crash_epordnungswidrig: Java's flavor is very modern compared to POSIX and other older regex flavors.
11:04EvanRi might be crazy but not that crazy
11:05ordnungswidrigcrash_ep: but I never heard of a flavor that matches * and . literally by default
11:05justin_smithEvanR: counter-evidence: you opted to mess around with regex
11:05ordnungswidrigcrash_ep: I'm not talking about all the other details and fancy stuff like negative look-ahead assertions (if java has that at all)
11:06EvanRtrue my specific use case doesnt even involve anything but a direct string match
11:06justin_smithevanr why not use the string match and skip the regex then?
11:06ordnungswidrigjustgreg: +1
11:07EvanRjustin_smith: i was preempting a project-managerial request to allow regex too
11:07justgregordnungswidrig, huh?
11:07justin_smith,(.indexOf "hello world" "world")
11:07clojurebot6
11:07ordnungswidrigjustgreg: opps, this was meat to go to justin_smith
11:08justgregno worries. I don't have opinions to +1 on clojure. :p
11:08justin_smithEvanR: compromise: allow regex or vanilla matching, with the ability to select which is wanted? that's easier than changing regex parsing rules
11:08crash_epEvanR: scope creep
11:09EvanRin my project, my position right now could be described as twenty miles deep in scope creep
11:09FriedBobOnly 20?
11:09EvanRmore than zero means something
11:10EvanRbut yeah forget regex
11:22Rhainuroh man, I am so stuck right now
11:23Rhainurcan someone help me figure out how to integrate cemerick/friend into a Luminus app?
11:23Rhainurthe documentation seems kinda...weird
11:26schmirRhainur: I've a working integration with an ldap server
11:27schmirusing basic auth
11:37Psy-Qi'm writing a small HTML crawler and it should be able to move to the next page and parse that for n links, e.g. i give it a depth of 10, it should stop trying to get to the next page after 10 recursions and return the hash of what it's found. how would i go about doing that? i have a parser for one single page in place: https://github.com/psy-q/vinylla/blob/master/crawler/app/src/app/core.clj
11:39ordnungswidrigPsy-Q: you want to limit the depth of the search?
11:41Psy-Qordnungswidrig: i'd be happy if i just knew how to check for the presence of a next page link and then recursively parse that next page (even infinitely) as a start
11:41Psy-Qi know the CSS of the next page link, that part is fine. but i don't know how i would manage that state (which page i'm on, whether it's been parsed already, what the next page link is, whether to follow it...)
11:43ordnungswidrigPsy-Q: as you're already using enlive, in your case you'd need to check for a link with id "test_NextPageTop"
11:43crash_epfrequently you pass that state into a function, along with the data you want to parse, and then in the function you look at the state and decide whether or not to recur
11:44ordnungswidrigPsy-Q: and, btw., please follow the restrictions in robots.txt
11:44Psy-Qcrash_ep: so it would be fine to pass something like {:current 1, :maximum 10} and recur until current == maximum?
11:45ordnungswidrigPsy-Q: I would pass in the remaining depth and bail out on zero
11:46crash_epPsy-Q: Right, and each time you recur, you adjust the value of :current
11:46Psy-Qordnungswidrig: ah yes, no need to track two vars
11:46ordnungswidrigPsy-Q: and maybe use core.async to queue the request and have a worker pool fetching from that queue
11:47Psy-Qordnungswidrig: the whole /shop is helpfully not blocked in robots.txt, thank you though
11:47ordnungswidrig:)
11:47Psy-Qordnungswidrig: yeah, i will have to learn about all that. the implementation i had in another language just sequentially did everything, but both my brain and that language don't do threads easily. so i never bothered.
11:48Psy-Qit will be so much fun to marshal all that stuff back into a relational database
11:49Psy-Qmaking sure to update only those records that need it. whee.
11:50ordnungswidrigPsy-Q: well, simply use the relation database as a backend for datomic :-P
11:51mgaarehas datomic gotten better at storing long strings?
11:52Psy-Qordnungswidrig: i'd prefer something that just helps me stuff things into postgresql with me not having to worry about details :(
11:52Psy-Qbut i guess that doesn't exist. the fewer magic components, the better, but the more i need a brain (which is hard to find)
11:53ordnungswidrigwhat about korma?
11:53Psy-Qi looked at that briefly (and some other helpers and libraries) but i've yet to try them
11:54Psy-Qit could be just fine. also because maybe i'll build a little service around it that spits out json
11:54Psy-Qi could use korma both ways
11:54mgaarePsy-Q: I've had good luck with honeysql as well
11:55Psy-Qmgaare: thanks
11:55Psy-Qwill try both i guess, i have the luxury to be doing something very small and specific, so i can do three implementations :)
11:57EvanRserialize the entire thing and put it in one postgres blob ;)
11:59mgaareone simple way, store the html as a string, store the hash of the string, and compare against the hash to see if you need to update the record
12:03bjaserialize the whole thing and write it to /dev/null for maximal performance!
12:12tickingIs there a proper way to `pr` a clojure record and read it as a cljs record and vice versa, without explicitly setting a reader name. The cljs records seem to be namespaceless and afaik it is bad style to have namespaceless reader tags.
12:12justin_smithbja: mongodb might sue you for a patent violation if you do that
12:13mdrogalisjustin_smith: lol
12:24arrdemanyone tried using object.copy to duplicate a multimethod?
12:24arrdemwondering if this is an evil way to share most of a multimethod or a Good Idea.
12:28EvanRcan i get a sequence of letters rather than numbers
12:28EvanR,(range "a" "z")
12:28clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number>
12:29EvanR,(char-range \a \z)
12:29clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: char-range in this context, compiling:(NO_SOURCE_PATH:0:0)>
12:29ordnungswidrigEvanR: ,(map char (range (int \a) (int \z)))
12:30ordnungswidrig,(map char (range (int \a) (int \z)))
12:30clojurebot(\a \b \c \d \e ...)
12:30EvanRcan i easily go past 26 letters?
12:30ordnungswidrigEvanR: hm?
12:30ordnungswidriginto the latin1 charset?
12:30EvanR"y" "z" "aa" "ab" or something
12:33ordnungswidrigEvanR: you can with BigDecimal and a radix greater than 10, I think
12:33EvanRheh
12:33ordnungswidrigEvanR: or clojure.math.combinatorics and some string mapping maybe
12:34EvanRill just make it crash if it tries to go past 26 for now
12:34TimMc"for now"
12:48arrdembeing able to generate utf8 glyphs with a char range would be .... interesting
12:48arrdemI'm pretty sure test.check's character generators will do utf8
12:48arrdemyou could look and see how those work..
12:49EvanRthis is completely decorative, so it really needs to look right, rather than be any sequence of different strings or chars
12:50EvanRso im writing a function to convert a number into base 26 with the alphabet a to z
12:50EvanRfun
12:53EvanRas for unicode chars... id expect this to work #(char 210)
12:53EvanR,(char 210)
12:53clojurebot
12:56EvanRoh how do i get a backwards sequence
12:56EvanR,(range 8 1)
12:56clojurebot()
12:56EvanRreverse?
12:57justin_smith&(range 8 1 -1)
12:57lazybot⇒ (8 7 6 5 4 3 2)
12:58EvanRhmm &(reverse (range 0 8))
12:58EvanR,(reverse (range 0 8))
12:58clojurebot(7 6 5 4 3 ...)
12:58EvanRlazybot is better
13:13sdegutisBe there any way to derive the executing function's var and/or name?
13:16srobinsonsdegutis: I don't suppose you've tried dotrace? I think you have to call it higher up the stack
13:16sdegutisI haven't.
13:17sdegutisThis link suggests throwing an exception and getting the name from that: https://groups.google.com/forum/#!topic/clojure/ORRhWgYd2Dk
13:17srobinsonsdegutis: I found it on StackOverflow http://stackoverflow.com/questions/2352020/debugging-in-clojure
13:18sdegutissrobinson: My gratitude.
14:06EvanRwell im glad i made it go past 26 since on my first test run i went to 28
14:09justin_smith&(print (char 9731))
14:09lazybot⇒ ☃nil
14:09sdegutis,(char 9731)
14:09clojurebot\☃
14:09EvanRexcel should switch row numbering immediately
14:10sdegutis☃/*\☃
14:10EvanRcolumns rather
14:10EvanRif youll direct your attention to column snowman
14:14amalloysdegutis: of course at any given time there are many functions which are "currently executing".
14:14sdegutisamalloy: I need the deepest one in the stack
14:14amalloyokay, and if it doesn't have a name?
14:14sdegutisOr rather the caller of the function which gives me this string/var.
14:14sdegutisamalloy: then nil
14:14justin_smiththat's easy: the one that tells you the name of the executing function!
14:15amalloysdegutis: what i'm getting at is that there's no way to tell apart anonymous functions from named functions, if all you have is a stacktrace
14:15amalloywell, maybe not "no way". you can always look at their names and guess
14:15amalloyer, their classnames
14:15sdegutisThanks.
14:18cflemingdnolen_: No sorry, I parked that - it won't be in the next drop but I'll try to get it in the one after. Still not sure how the UI should work.
14:20seangrovecemerick: Just to be sure, I'm not actually expecting you to fix my car
14:20seangrovecemerick: I'll be alright with just the backrub
14:20seangroveJust wanted to be clear, I don't want to come across as entitled
14:20cflemingtmarsh: Here's a message from a Cursive user about how he did it: https://www.refheap.com/94762
14:21tmarshcfleming: thanks!
14:21cflemingtmarsh: No worries, all credit goes to Wilker for that one
14:21dnolen_cfleming: ah k, well definitely a must have for me, working on core.match nearly impossible w/o. Granted not everybody else is dealing w/ macros like core.match.
14:22cflemingdnolen_: Yeah, I understand. How important is correctly supporting &env to you?
14:23cflemingdnolen_: That makes it trickier but not impossible, just needs more thought.
14:23dnolen_cfleming: I would count that as a "nice to have"
14:23cflemingdnolen_: Ok I'll try for a dumb one first and add that later.
14:24cflemingdnolen_: You also need selective expansion of subforms, right? Do you need full expand or expand-1 for those, or ideally both?
14:24dnolen_cfleming: that's also another "nice to have"
14:25cflemingdnolen_: Ok, most important is full expand?
14:25dnolen_Just pretty printed source is all I really need to not go crazy
14:25cflemingdnolen_: Ok got it.
14:25Bronsadnolen_: btw the core.match AOT issue is definitely CLJ-979 -- the current patch doesn't address that case but I'm working on it
14:26dnolen_Bronsa: k cool
14:27cemerickseangrove: I promise, you'd appreciate the car repair more :-P
14:27seangrovecemerick: Heh, hope no one's getting to you too badly
14:28cemerickseangrove: Nah. I was pretty shocked by the first (the one I screenshotted). Been more amused than anything else by those that followed.
14:29cemerickI suppose it's possible I was getting trolled, in which case my recent tweets are sweet victory for them :-P
14:41TimMccemerick: yikes
14:42Bronsadnolen_: yup, bug fixed
14:43Bronsadnolen_: http://dev.clojure.org/jira/secure/attachment/13602/CLJ-979.patch here's the patch if you want to try it out
14:44puredangerBronsa: I did get the ok to work on that btw, just have been clearing other stuff first
14:44puredangerthe ok to clean it up enough for consideration I should say
14:44Bronsapuredanger: nice, I just updated the patch -- it now fixes a longstanding AOT bug for core.match
14:44puredangercool
14:49Bronsapuredanger: I believe my last patch for CLJ-979 solves most of the issues around bad interaction between JIT and AOT, CLJ-1457 OTOH is somewhat related to the transitive compilation stuff
14:49BronsaIOW CLJ-979 should in theory solve all the classloader issues
14:50cemerickTimMc: ?
14:50puredangerBronsa: that's all I ask
14:52TimMccemerick: Just looking over the tweets in question.
14:52Bronsapuredanger: let me know if you have any issues whenver you get to work on it, I'd really like to see this one in 1.7. I'm growing tired of AOT issues :P
14:52puredangerfor sure
14:58Bronsapuredanger: nice work on CLJ-1515 btw. have you found out why the new chunked range is slower than the current clj version?
14:59puredangerthere is no simple slower/faster if you look at those numbers
15:00puredangerI have a newfound appreciation for like the third time for how fast chunking can be :)
15:01puredangerthe Java object version has a bit more overhead than the clojure version. the 1515 version is faster for reduce and optimizes the all-long case which makes up for the overhead
15:03Bronsapuredanger: ah, trivial suggestion: s/AbstractRange/ARange to be consistent w/ the current clojure naming?
15:03puredangerI think in general what's in the patch makes most of the common cases faster. In some smaller ranges, the overhead dominates but in those cases the times are fast enough to be unlikely to be important.
15:04puredangernon-long cases are rare and are still not much worse without chunking
15:04Bronsacool
15:04puredangerI found adding chunking to the non-long version made it noticeably slower
15:04puredangerso yeah, the original 20 lines of Clojure code was pretty great :)
15:05puredangerre naming, might be a good idea
15:05puredangerGhadi already found a bug in it so I've got do more changes anyway
15:05Bronsapuredanger: that's not fair, it's 20 lines of clojure + ~250 of java for LazySeq
15:05puredangertrue. but now it's like +600 more lines of Java :)
15:06puredangers/20 LOC Clojure/600 LOC Java/ = :(
15:06puredangerprobably a fair chance Rich looks at the whole thing and tells me to go home :)
15:06Bronsaright. having protocols available earlier in the bootstrap process would help immensely
16:07andyfEastwood is gradually getting quieter. Next: audio renditions of warnings in quiet gravelly voice.
16:10TimMc:-D
16:11TimMcVoiced by Tom Waits, please. Thank you.
16:12TEttingerhttp://youtu.be/jlKUa5X2H1w?t=3m32s
16:12andyf"So the question you've got to ask yourself is: did you call that macro with 5 arguments or 6? In all the confusion, I lost track myself."
16:12TEttingerhaha we thought of the same thing
16:13TEttingeror you're a very fast typist and listened to that clip very quickly
16:16ucbTEttinger: truckfighers? \o/
16:16ucbtruckfighter*
16:16ucbssssss
16:25Frozenlockugh... when I uberjar my compojure project, the home address "/" returns an empty response. Does this ring any bells?
16:26Frozenlock(it works when using 'lein run')
16:26justin_smithFrozenlock: are you accessing any templates using file operations where you should be using resource operations?
16:28Frozenlockjustin_smith: No, the home page is all in a .clj file with hiccup formatting.
17:40PaulTSNeed help with lein deploy clojars
17:40PaulTSI'm trying to deloy a jar directly.
17:41PaulTSI'm stuck at signing the jar and pom for promotion.
17:42PaulTSIf I sign each (pom and jar) with gnupg (publick key is in my profile) I get an error.
17:43PaulTSEx: is sign with: 'gpg --sign pom.xml'
17:44PaulTSI get pom.xml.gpg.
17:44PaulTSCan't upload this without error even if I change the name of the file to remove the .gpg.
17:45PaulTSUsing the following command: lein deploy clojars cawala/i2p 0.9.17-4 i2p.jar pom.xml
17:47justin_smiththe pom.xml.gpg should just be a signature, that would upload separately from the pom.xml
17:50PaulTSHmm, doesn't appear to be, by the command above, but I can probably create a detached signature.
17:51justin_smithPaulTS: I could be wrong. I thought it was a question of building a detached sig. #leiningen may be a better place to get the info on this.
17:51PaulTSThanks, I'll give that list a shot.
18:22ed-gHello everyone. I'm looking for a way to set an HTTP header value in all Ring responses. Is there an available middleware for this or should I build my own using ring.util.response or the like?
18:24amalloyed-g: isn't it just (defn add-header [handler header value] (fn [req] (assoc-in (handler req) [:headers header] value)))?
18:24amalloythere's probably an existing middleware, but honestly it's so simple i wouldn't even bother looking for one
18:31EvanRcan you destructure lists in function parameters
18:33amalloy~tias
18:33clojurebottias is try it and see
18:34EvanRunsupported binding form
18:34ed-gamalloy: thanks!
18:35justin_smith,((fn [[a b c]] c) (range)) ; EvanR
18:35AimHereEvanR, Doesn't work for me, but if you treat it as a vector, it'll happily accept a list
18:35clojurebot2
18:35amalloyEvanR: what did you try? paraphrased error messages with no source or stacktrace are not useful
18:35EvanR(let [(a b) '(1 2)] b)
18:35EvanRalright, converting to vector
18:35justin_smithyeah (a b) is not a destructuring syntax
18:36arrdemhuh. totally could be tho.
18:36justin_smitharrdem: why would it be useful?
18:37justin_smithI mean it's not like [a b] constructs a vector form the input or anything
18:37amalloyarrdem: it's nice that () is an available syntax for alternate meanings
18:37EvanRwell in many ways the regular lists are useless simply because no one cares about them, so theres no way to conveniently use them
18:37EvanRits like, just dont use lists in the message
18:37justin_smithEvanR: the [a b] destructuring syntax does not mean "expect a vector"
18:37arrdem(with-irony (dec lists))
18:37EvanRoh
18:38justin_smithit means "destructure a sequence"
18:38EvanRso it should fail on a map &(let [[a b c] {:a 1 :b 2 :c 3}] b)
18:39justin_smithright
18:39arrdemjustin_smith: really? there isn't an implicit (seq) in there that could make it work?
18:39amalloyarrdem: no
18:39justin_smiththe syntax for mid-message lazybot usage is ##(let [[a b c] {:a 1 :b 2 :c 3}] b)
18:39lazybotjava.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap
18:40justin_smith&((fn [[a]] a) "abc")
18:40lazybot⇒ \a
18:45charlespwdDoes anyone has experience setting up ssl on a ring app? I'm confused.
18:45amalloy~anyone
18:45clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
18:45justin_smithbetter to set up ssl on nginx, and use that as a reverse proxy
18:46justin_smithnginx has security features none of the java/clojure servers have
18:46weavejesterYep, I just use nginx
18:46charlespwdThanks. I'll look into it.
18:46weavejesterPutting a HTTP server behind nginx and letting it handle the SSL is a common pattern in most languages nowadays.
18:46charlespwdamalloy: Gotcha. Sorry for vague question.
18:47amalloycharlespwd: turns out i was wrong, in a way: folks were enthusiastic enough to answer anyway
18:48justin_smithamalloy: unlike most "anyone" queries, the solution to his problem was implicit in the question
18:48charlespwdweavejester: < just starting out. Great to know.
18:49marrrkI would like to use kioo with chestnut, but just adding [kioo "0.4.1-SNAPSHOT"] to the dependencies in project.clj seems not to be enough. What am I doing wrong?
18:50justin_smithmarrrk: that should suffice to add kioo to the classpath so that you can require the namespace and use its functions. But you do have to do the latter still.
18:51marrrkdo I have to first "get it" somehow?
18:52justin_smithmarrrk: the project.clj makes sure it is present
18:52justin_smithnext step is to require the namespaces that kioo provides
18:52justin_smiththen call the functions it makes available
18:52justin_smithsee "Quicstart tutorial" on the kioo github page. https://github.com/ckirkendall/kioo#quickstart-tutorial
18:56marrrkOkay, I broke something independent of that
19:00PaulTS&("hi)
19:00lazybotjava.lang.RuntimeException: EOF while reading string
19:00justin_smithPaulTS: fairly new to clojure?
19:01PaulTSnot really
19:01marrrkGreat, it works, thanks
19:01PaulTSnew to irc
19:01PaulTS&("hi")
19:01lazybotjava.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn
19:01PaulTS&(println "hi")
19:02lazybot⇒ hi nil
19:02justin_smithPaulTS: OK, that was a remarkable density of bugs for such a small program, is why I asked
19:02PaulTShehe
19:41Frozenlockweavejester: I recently added ring-defaults to my compojure apps, and now my homepage returns an empty response in the uberjarred app. Any ideas what might be causing this?
19:43weavejesterFrozenlock: Without knowing more about your app I couldn't say.
19:44Frozenlockokay, I'll continue digging.
20:18Frozenlockweavejester: I think I found it... looks very much like this https://github.com/noir-clojure/lib-noir/issues/107
20:20weavejesterFrozenlock: It could be the content-type if you're not setting it, though I'm not sure whether that would return a blank page.
20:53weavejesterFrozenlock: Which version of Ring/Compojure are you using, out of interest?
20:53Frozenlock[ring "1.3.2"] [compojure "1.3.1"]
20:54weavejesterFrozenlock: Do you have anything in your deps that would load an older ring-core?
20:54weavejesterFrozenlock: lein deps :tree to be sure
20:55dnolen_BOOM, https://github.com/clojure/core.match/commit/fabf2552bc46d7d73646c98459c5d7fe5ed2fd15
20:56weavejesterdnolen_: Oh, that's interesting
20:57Frozenlockweavejester: Some plugins and Friend seems to be using 1.2
20:57weavejesterdnolen_: I've been using core.match more recently, and really quite liking it
20:58weavejesterFrozenlock: Do they override the version from Ring?
20:58weavejesterFrozenlock: If you add an explicit dependency to [ring/ring-core "1.3.2"], does that fix the problem?
20:58weavejesterFrozenlock: I'm thinking you might be running into a bug in wrap-resource.
20:59dnolen_weavejester: glad to hear it!
20:59weavejesterdnolen_: Incidentally, what's the status on a core.match equivalent to multimethods? :)
21:00weavejesterdnolen_: I seem to remember the possibility was considered a while ago.
21:01dnolen_weavejester: heh not sure when I'll have time for that, just focusing on finishing touches to 0.3.0 and then I'll be busy with cjls.test and cljs.pprint
21:02weavejesterdnolen_: Does cljs.test pull in anything from cemerick's library?
21:02dnolen_weavejester: does not - he decided to copy over some things I don't agree w/ like dynamic binding
21:03dnolen_which is gnarly for async tests
21:03dnolen_plus cljs.test is built on stuff anyone can hook into for their own testing framework
21:03weavejesterdnolen_: clojure.test is pretty ancient and gnarly with regards to dynamic binding etc.
21:03dnolen_yes
21:04dnolen_clojure.test & clojure.pprint are extremely useful - but eye sores too.
21:04weavejesterdnolen_: I agree
21:05weavejesterdnolen_: Out of interest, how hard would it be to adapt core.match with multimethod like behavior? Couldn't you just store the match forms in an atom, and recompile them with eval every time a new method is added or removed?
21:06dnolen_weavejester: that's right something like that, however you have to deal w/ ordering issues
21:06Frozenlockweavejester: well dang, I think it works... I explicitly added ring-core and updated lein-ring. I will check which one was causing the problem.
21:06dnolen_weavejester: probably solvable just haven't had time or incentive to look myself
21:06dnolen_gotta run, feedback welcome on core.match :<< usage
21:06weavejesterdnolen_: Bye
21:07weavejesterFrozenlock: I think you had an older version of ring-core, and that had a bug where directories in uberjars weren't correctly recognised.
21:10FrozenlockLooks like it, recompiling with only the ring-core specified still works.
21:21Frozenlockweavejester: thank you very much. Updated the issue on github, hopefully this will also help others.
21:35uris77_Anyone having issues fetching the closure compiler from clojars.org? I'm getting this error:
21:35uris77_Could not transfer artifact com.google.javascript:closure-compiler:jar:v20140625 from/to central (https://repo1.maven.org/maven2/): GET request of: com/google/javascript/closure-compiler/v20140625/closure-compiler-v20140625.jar from central failed
22:26jayp498Hi all, was wondering if someone could help me in writing a small macro "add-params-to-fun". Here is a small Gist that explains what I have and what I want: https://gist.github.com/jayp/ece9035fea0aa2d31926
22:26jayp498Any help would be greatly appreciated ;-)
22:31sm0kejayp498: what are you trying to do here?
22:31sm0kecant you use apply instead?
22:32jayp498I have a function that takes a lot of parameters, I want to create another function that tags some additional parameters.
22:32sm0kejayp498: you can use (partial...) ?
22:33sm0ke,((partial + 1 2 3) 4 5 6)
22:33clojurebot21
22:34sm0kejayp498: the problem is (+ 5 6) is not a function while #(+ %1 %2) is
22:34jayp498i did that, but was a bit ugly: (let [foo (partial + 1 2 3) bar (foo 4 5 6)] ((foo)))
22:34sm0ke,(defmacro ap [f & a] `(~f ~@a))
22:34clojurebot#'sandbox/ap
22:35sm0ke,(ap #(+ %1 %2) 1 2)
22:35clojurebot3
22:35sm0kebut then again this will fail for
22:35sm0ke,(ap (+ 1 2) 3 4)
22:35clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
22:35sm0keyou see the problem here?
22:36jayp498hmm
22:36jayp498In by foo bar example, I want to execute foo and bar in the let body. bar is basically an addition to foo. The thing is that foo is also parameterized
22:37jayp498Hmm, I may have to simplify my approach, if what I am intending to do is not so straight forward
22:37sm0ke,(let [foo (partial + 1 2 3) bar (foo 4 5 6)] bar)
22:37clojurebot21
22:37sm0kei dont see the problem here
22:38sm0ke,(let [foo (partial + 1 2 3) bar (foo 4 5 6)] [bar (foo)])
22:38clojurebot[21 6]
22:38sm0keok so you want to get rid of the parens around foo?
22:38jayp498sm0ke: I gave a simpler example, but foo is more like #(baz "hello" "world" %1)
22:39mgaarejayp498: this satisfies what you put in the gist at least:
22:39mgaare(defmacro add-params-to-func [f & params] (list (first (drop-last f)) (concat (last f) params)))
22:40jayp498mgaare: thanks. let me play around.
22:40sm0kei am not very sure about this, its not like you would be doig ((((((((fooo))))))))
22:41sm0keits always going to be a function call (fooo)
22:41jayp498give me a couple minutes. I can update the gist with my actual use. Maybe you can just give me pointer on how to simplify.
22:42mgaareok
22:51mgaareCan someone help me with an aleph/gloss/manifold problem? I seem to be having a stupid - http://pastebin.com/LuVnFcga
22:53jayp498smoke mgaare: I updated the gist. the function send-email is simplified in the gist, but in real use has a lot more params. Basically I am writing test code with small variations in optional parameters.
22:54jayp498oops, I meant sm0ke
22:59sm0kejayp498: there is no currying in clojure, so i still think partials is the most elegant way to solve this
23:00jayp498ok
23:00mgaarejayp498: can you put an example usage of that macro? I'm not sure exactly what
23:00mgaareyou're going for
23:00sm0kemgaare: he just want to chain functions with extra arguments
23:00jayp498btw, mgaare the macro def you provided has a small mistake
23:00sm0keon each step
23:01jayp498i can live with partials
23:01sm0kejayp498: https://clojuredocs.org/clojure.core/letfn
23:01jayp498just wanted to do some macro magic
23:01jayp498haha
23:02sm0kejayp498: letfn will make it more succinct i guess
23:03mgaarejayp498: what was wrong with my macro? :D
23:03mgaareoh I se
23:04justin_smithI think you wanted cons in the place of list
23:04justin_smithnd in place of concat too actually
23:06mgaareit was the first that was screwing it up
23:06jayp498yeah
23:06jayp498but you know what
23:06jayp498even then it's messed up
23:07mgaarethis works, although it' sugly
23:07mgaare(defmacro add-params-to-func [f & params] (concat (drop-last f) (list (concat (last f) params))))
23:07justin_smithwhat is f?
23:07jayp498#(+ %1 %2)
23:07jayp498,(defmacro add-params-to-func [f & params] (list (drop-last f) (concat (last f) params)))
23:07clojurebot#'sandbox/add-params-to-func
23:08mgaaresome function where you want to add some things to the last form
23:08justin_smithyeah, (concat (last f) params) won't fly then
23:08jayp498,(macroexpand '(add-params-to-func #(%1 %2) 7 8 9))
23:08clojurebot((fn* [p1__52# p2__53#]) (p1__52# p2__53# 7 8 9))
23:09jayp498,(add-params-to-func #(%1 %2) 7 8 9)
23:09clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: p1__78# in this context, compiling:(NO_SOURCE_PATH:0:0)>
23:09jayp498I am getting the same thing
23:09jayp498It seems the variable p1__xy# is lost by the time it executes
23:09mgaarehrm, was working at the repl for me
23:09justin_smithlook at the expansion
23:09justin_smiththe fn has an empty body
23:10jayp498the expansion looks good. no?
23:10justin_smiththen it's local bindings are in a list after it
23:10justin_smithno, it does not
23:10jayp498,'#(+ %1 %2 3 4 5)
23:10clojurebot(fn* [p1__105# p2__106#] (+ p1__105# p2__106# 3 4 ...))
23:10justin_smith((fn [a b]) (a b))
23:10mgaareoh, that's the old one
23:10justin_smithabove I added white space to show the problem more clearly
23:11mgaare,(defmacro add-params-to-func2 [f & params] (concat (drop-last f) (list (concat (last f) params))))
23:11clojurebot#'sandbox/add-params-to-func2
23:11mgaare,(macroexpand '(add-params-to-func2 #(+ %1 +2) 3 4 5))
23:11clojurebot(fn* [p1__158#] (+ p1__158# 2 3 4 ...))
23:12jayp498thanks justin_smith
23:13justin_smith,(macroexpand '(add-params-to-func2 #(identity) 1))
23:13clojurebot(fn* [] (identity 1))
23:13mgaaredoesn't work with more than 1 form though
23:13jayp498I am going to stick with partial for now
23:13jayp498It's something I can grasp
23:13mgaare(macroexpand '(add-params-to-func2 #(let [more "forms"] (+ %1 %2)) 3 4))
23:13mgaare,(macroexpand '(add-params-to-func2 #(let [more "forms"] (+ %1 %2)) 3 4))
23:13clojurebot(fn* [p1__207# p2__208#] (let [more "forms"] (+ p1__207# p2__208#) 3 4))
23:14justin_smithwell, it did add things to the let body
23:14mgaareobvious product of 2 minutes and minimal thought :D
23:15jayp498mgaare thanks for your help
23:15mgaarejayp498: yw, good luck