#clojure logs

2014-07-17

01:31tuftdo you guys use :pre and :post?
01:31arrdemall the time
01:32tuftok thanks =)
01:33arrdemIf you have environmental conditions, like dynamic variables that need to be bound, atoms that need to have values and arguments with explicit types :pre is awesome. I don't tend to use :post as much because typically I'd just be typechecking a return value, which is trivial.
01:34arrdemhttps://github.com/clojure/tools.emitter.jvm/commit/32b1d01abd259fe4053389e98915aac0a763bb07
01:34tuftthis particular use case is just testing two numeric parameters
03:03kenrestivois there some way using the chronicle (flatland) library to get it to use the local time zone?
03:03kenrestivoit uses joda time. it doesn't seem to take parameters to tell it what time zone to use.... could it require poking at some global singleton in the underlying java library?
03:05kenrestivoah never mind found it. yes it does, apparently http://joda-time.sourceforge.net/apidocs/org/joda/time/DateTimeZone.html#setDefault%28org.joda.time.DateTimeZone%29
03:23_ericif I have a (loop) that doesn't have a (recur) in one branch, will it continue to loop or will it drop out?
03:23amalloytry it and see, _eric
03:34luxbockdoes there exist an API documentation for all the functions of cljs.core that are not part of clojure.core?
03:34luxbockI'm trying to find if there's a predicate function for telling js-objects apart from Clojure maps
03:37Glenjamini'm fairly sure objects don't pass map?
03:38luxbockis there a way to test for something being a js-object specifically though?
03:39Glenjamineverything is a js object
03:39Bronsa`luxbock: there's a object? predicate
03:40Glenjaminorly
03:40Glenjamini wish one of the bots had a cljs repl handy
03:41luxbockBronsa: ah yeah perfect
03:42augustlhttps://github.com/krukow/clj-ds - 0.0.4, still at Clojure 1.5.1 - is anyone actively maintaining a stand-alone version of Clojure's data structures? :)
03:44GlenjaminBronsa: is that fairly new? both himera and cljsfiddle are erroring saying there's no object?
03:47BronsaGlenjamin: no idea.
03:49BronsaGlenjamin: https://github.com/clojure/clojurescript/commit/a8797e4c6b9395c061170aa75da41414290fedf9
03:51Glenjamincheers
03:51Glenjamini guess thats a reasonable implementation
03:52chamomilehi - new to clojure and trying to make a simple static site generator, i don't know the specifics for serving valid http, what clojure libs can i learn from?
03:53Glenjaminhttps://github.com/mmcgrana/ring/blob/master/SPEC might be worth a look
03:59chamomilethanks Glenjamin,
03:59augustlchamomile: you could look at a static stite generator :) https://github.com/magnars/stasis
04:02Glenjamin(object? #js {}) ;=> #<false>
04:02chamomileaugustl: thanks, i find clojure confusing sometimes when i'm trying to do something i've never done before
04:02chamomilethis will help
04:07BronsaGlenjamin: that returns true on my repl
04:14GlenjaminI think I need a better repl
04:14augustlrepl-ace it with a better one
04:15GlenjaminIs there a good "run this and get a cli repl" for cljs?
04:26razum2umhow can I iterate over java object which implements Iterable ?
04:28BronsaGlenjamin: I use script/repljs from the cljs repo
04:28razum2umoh. found it - iterator-seq, sorry
04:37hhenkelHi all, I'm wondering if there is a better / more elegant way to achieve this: https://www.refheap.com/88274
04:38hhenkelThe idea is to merge data depending on if it is allready within a datastructure or not.
04:39TEttingerhhenkel, this came up not long ago
04:40hhenkelTEttinger: okay, any reference where I could find something about it?
04:40TEttingerwell your problem uh... doesn't seem like it makes sense yet to me
04:40TEttingernot sure if it's the same
04:41TEttingerI wrote a snippet to handle extracting stuff out of nested maps
04:42hhenkelTEttinger: The idea / problem I'm trying to solve is that I got some configuration from config files and other parts that get evaluated dynamicaly.
04:42hhenkelTEttinger: The configuration parts are from the same "type", therefore I want them to merge them in a datastructure to process them.
04:43TEttingerhm, http://clojure-log.n01se.net/ is out of date
04:43TEttingerok, but there are some problems with your pseudocode
04:44hhenkelI updated it, as I saw the list definition was wrong
04:44TEttingerwell => (merge a {:bla (merge (:bla a) {:1 (concat ((:bla a) :1) (:1 b))})})
04:44TEttinger(:bla a) -- what is a?
04:45TEttingerit's in the lists
04:45hhenkelAh, okay sorry it is not clearly named.
04:45hhenkela is in this case the def a.
04:45hhenkelI'll update the names, one sec
04:47hhenkelTEttinger: Okay, things should be clearer now
05:19hhenkelTEttinger: So any idea?
05:19TEttingersorry haven't checked yet, was debugging my own stuff
05:21hhenkelokay
05:21TEttingerthis seems like it would be very hard to do in a general way
05:21TEttingerthe :1 being under :bla and not under :bla could be problematic
05:22hhenkelTEttinger: That is not much of an issue. I'll check if the key is allready available in an if and depending on the outcome I execute one or the other.
05:23hhenkelI'm more interested to find out if there is a better / smarter way to do the merging.
05:23TEttingerI'm going to fall asleep soon, so smarter is not in my domain right now :)
05:25hhenkelTEttinger: okay, no problem.
05:25hyPiRionhhenkel: let me have a look
05:25hhenkelhyPiRion: https://www.refheap.com/88274
05:26hyPiRionthanks
05:31hyPiRionhhenkel: I suppose you want the option to have the config maps add in new keys over time?
05:31hyPiRionEh, that was poorly worded. If you add in new keys for new functionality, you shouldn't have to manually handle merging of those, I meant.
05:32hhenkelhyPiRion: Yes exactely. Current situation is that I got static config via files. I now implemented something to do automatic lookup resulting in more config items (as they are of the same type as the static ones).
05:36hhenkelhyPiRion: I'm afk for the next 30 min, lunch...
05:36hyPiRionhhenkel: alright
05:38hyPiRionhhenkel: well, here's what I came up with just now. https://www.refheap.com/88275 -- it's sort of a stripped down version of how Lein does the profile merging
06:23hhenkelhyPiRion: Oh, that looks promising. I'll try out that.
06:36hhenkelhyPiRion: That works like a charm! Are you involved in lein or why did you get the idea to be inspired by it?
07:01luxbockis importing types supported in ClojureSciprt? I'd like to use them for Schema-validation
07:02luxbockbut I'm getting warnings when I try to do it like how I'd do it in regular Clojure
07:03luxbockah, found it: "ClojureScript types and records should be brought in with :use or :require :refer, not :imported"
07:04hyPiRionhhenkel: sorry, went out for lunch as well. Yeah, I'm one of the "regulars" on Lein
07:05noidiI wonder if there's anyone who prefers that `some` returns the value of the predicate and not the item matching the predicate
07:06noidiI keep reaching for `some` only to realize that I need `(first (filter ...))` to do what I want
07:10razum2umI have a strange cast issue with calling a method accepting a generic: https://gist.github.com/razum2um/432181a0689e5c447b09 any ideas how it happens?
07:10hyPiRionnoidi: yeah, I think it has actually been discussed whether or not to include a ffilter function in core, but don't quote me on that
07:15Glenjaminso, what's the deal with clojure-in-clojure for cljs - is there somewhere i can help contribute?
07:50rurumate&(clojure.set/union #{1} [2])
07:50lazybot⇒ #{1 2}
07:50rurumate&(clojure.set/union #{1} [2 3])
07:50lazybot⇒ [2 3 1]
07:51nobodyzzzbut why? =(
07:54nobodyzzzoh it does (reduce conj longer_seq shorter_seq)
08:02instilledhi! how can i represent an empty character in clojure? something like \empty
08:02instilled?
08:03rurumatedo you mean \space?
08:03rurumateyou can represent any char by its unicode sequence ofc
08:03instillednope. i would like to replace \space with \empty (\u0000).
08:04rurumateyou want to remove spaces?
08:04instilledexactly.
08:04rurumateso "this has spaces" would become "thishasspaces"?
08:04instilledyup!
08:04rurumateok, that's different. how would you do it in java?
08:05instilled' ' -> ''
08:05rurumatedoesn't look java to me
08:06noidi,(clojure.string/replace "foo bar baz" \space \u0000)
08:06clojurebot"foo
08:06instilledwell, then i go with regexps… i thought there was maybe a way to do it without regexp (or filter).
08:06rurumateyou can use a stringbuilder ofc
08:06rurumateregexp are extremely slow, avoid them in perf critical code
08:06rurumate&(.indexOf "myString" (int \space))
08:06lazybot⇒ -1
08:07rurumateyou can check if it has the character first. .indexOf is very fast
08:07instilledrurumate: i'll do that then. cheers a lot!
08:08nobodyzzz(clojure.string/string "foo bar baz")
08:08nobodyzzz,(clojure.string/trim "foo bar baz")
08:08clojurebot"foo bar baz"
08:08instilled`(.replace "ab c" " " "")
08:08instilled,(.replace "ab c" " " "")
08:08clojurebot"abc"
08:08nobodyzzz,(clojure.string/trim "foo bar baz" " " "")
08:08clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: string/trim>
08:09nobodyzzz,(clojure.string/replace "foo bar baz" " " "")
08:09clojurebot"foobarbaz"
08:10rurumatewait, I think I got something for you
08:11rurumateinstilled: https://www.refheap.com/88278
08:12rurumateyou can call (space-first) in a loop and build the string in a stringbuilder
08:14instilledrurumate: that looks nice :) I'll keep it simple for now with (.replace "some string" " " ""). that does work well.
08:14rurumatesomething like this (untested): (loop [sb (StringBuilder) s "this has spaces"] (if-let [token (space-first s) (do (.append sb token) (recur (space-rest s)) (.toString db))
08:15rurumateor move the sb to a surrounding let
08:15rurumateone moment..
08:19rurumateinstilled: https://www.refheap.com/88279
08:20rurumatetry (remove-spaces "this has spaces") -> "thishasspaces"
08:20ElroyJetsonI've got CIDER and leiningen installed. I would appreciate some help on getting my feet wet from here as I have described here - http://www.reddit.com/r/emacs/comments/2ay4z0/clojure_baby_steps/
08:21instilledrurumate: cheers!
08:23pyrtsarurumate: FYI, your code runs 2x slower than (clojure.core/replace lorem " " "") on a "Lorem ipsum ..." string of 446 characters (68 spaces).
08:24rurumatereally? how did you test it?
08:25rurumateoh it's clojure.core replace w/o rexexp. I didn't know that existed.
08:25rurumatein that case instilled you should probable use clojure.core/replace
08:25hyPiRionuh, replace takes a map and a collection
08:26hyPiRion,(replace {\a \b \c \d} "acca")
08:26clojurebot(\b \d \d \b)
08:26hyPiRionnot entirely what you want
08:26rurumate&(clojure.core/replace "a b c" " " "")
08:26lazybotclojure.lang.ArityException: Wrong number of args (3) passed to: core$replace
08:26rurumateumm
08:26instilledrurumate: yeah. i'll go with that!
08:27hyPiRionmaybe you just meant .replace
08:27instilled,(replace "abc def" " " "")
08:27clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: core/replace>
08:27instilled,(.replace "abc def" " " "")
08:27clojurebot"abcdef"
08:27rurumateso java.lang.String.replace is the way to go apparently
08:27instilleddoes exactly that.
08:36pyrtsarurumate: I tested it by wrapping inside (time (dotimes [_ 100000] ...)), resulting in ~2300 ms (yours) vs. ~1100 ms (clojure.string).
08:37rurumateok, thanks for testing. I hope it's still faster than a regexp.
08:38pyrtsa(time (dotimes [_ 100000] (str/replace lorem " " ""))) ;;=> "Elapsed time: 1032.865 msecs"
08:38pyrtsa(time (dotimes [_ 100000] (str/replace lorem #" " ""))) ;;=> "Elapsed time: 1187.55 msecs"
08:38pyrtsa(time (dotimes [_ 100000] (str/replace lorem #" +" ""))) ;;=> "Elapsed time: 1585.51 msecs"
08:38pyrtsaCertainly depends on the regular expression, but still no.
08:39mpenetwell regex is faster for me too
08:39mpenet (clojure.string/replace "foo bar baz" #"\s+" "") vs " "
08:40mpenetin that case at least (microbenchmarks ftw)
08:40pyrtsaMicrobenchmarks indeed. :)
08:41mpenetwithout the + in the regex it is a bit faster too
09:11boxed,(= (eval 'str) str)
09:11clojurebottrue
09:11boxed,(= (type (eval 'str)) (type str))
09:11clojurebottrue
09:11boxed,(var str)
09:11clojurebot#'clojure.core/str
09:11boxed,(var (eval 'str))
09:11clojurebot#<CompilerException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol, compiling:(NO_SOURCE_PATH:0:0)>
09:12boxedwtf? can someone explain that to me?
09:12pyrtsavar is a special form.
09:13stuartsierra1,(eval 'str)
09:13clojurebot#<core$str clojure.core$str@1be9101>
09:14stuartsierra1,(var str)
09:14clojurebot#'clojure.core/str
09:14stuartsierra1,(resolve 'str)
09:14clojurebot#'clojure.core/str
09:14pyrtsaThe var special form treats its argument like a macro does. That's why "(eval 'str)" looks like a PersistentList to it, a list containing the symbol "eval" and the quoted str.
09:15pyrtsaAnd the argument must be a Symbol, so thus the error.
09:25hhenkelI'm trying to cast a LazySeq into an array but I keep getting an error: java.lang.IllegalArgumentException: array element type mismatch
09:26hhenkelI got "(into-array String attributes)" with attributes as LazySeq.
09:26hhenkelHow must I cast this?
09:28zoldarhhenkel: are you sure that all elements in your lazyseq are strings?
09:30hhenkelzoldar: I would say so: https://www.refheap.com/88280
09:36hhenkelIs there a way to debug on which element the code is failing?
09:36hhenkelzoldar: ^^
09:37hhenkelI tried to use only one attribute and the code is allready failing.
09:38mpenettry to trace the `type` of your attribute
09:39hhenkelmpenet: I just did that, it gives me "TRACE attributes: java.lang.String" with (trace "attributes" (type (first (:attributes request))))
09:40mpenethhenkel: maybe gist your code
09:40mpenet,(into-array String (map identity ["a"]))
09:40clojurebot#<String[] [Ljava.lang.String;@a5d82a>
09:40mpenetshould work
09:40mpenet(type (map identity ["a"]))
09:40mpenet,(type (map identity ["a"]))
09:40clojurebotclojure.lang.LazySeq
09:49hhenkelmpenet: For what is identity in your example?
09:49hhenkelIt does not work for me
09:50hhenkelmpenet: I'm checking if I could provide some small example.
09:53hhenkelmpenet: https://www.refheap.com/88283
09:56hhenkelmpenet: Okay, I gues I found the error. I moved the trace to the function that recieves the values and there I see that only the first value is handed over, not the complete seq.
09:57mpenethhenkel: identity is just one way to make a lazyseq out of ["a"]
10:06stevenfxHey
10:07stevenfxIs anyone having any problems with deps problem with clojure 1.6 not being avaliable
10:07stevenfx?
10:10stevenfxI keep getting https://www.refheap.com/88284
10:11stevenfxmight just be my network
10:24stevenfxok I must be living under a rock because today is the first day I see the new clojars.org design :)
10:24stevenfxlooks amazing
12:06ptcekIs it right that prismatic fnk / defnk does not support input schemas?
12:34andyf_hiredman: Ping
12:38hiredmanandyf_: hello
12:38hiredmanI mean
12:38hiredmanandyf_: pong
12:39andyf_In the github issue for Eastwood about selective disabling of warnings, you mention marker macros, "but those have issues"
12:40andyf_I wanted to find out what issues you meant, since I was considering using a marker macro for this purpose
12:41hiredmanyou couldn't only have a dev dependency on eastwood then
12:42andyf_Meaning you need to require the namespace defining the macro, yes?
12:42hiredmanright
12:42hiredmanwhich could be a distinct "slim" depdency or something
12:43andyf_What if that were in a tiny project doing almost nothing but defining that macro?
12:44technomancythis sounds like a textbook example for why metadata is useful?
12:44andyf_technomancy: I'm considering that, but you cannot put it on everything
12:45ambroseb_andyf_: org.clojure/core.typed.rt is basically that for core.typed
12:45andyf_A macro can wrap any expression
12:45MrJones98mikerod: thanks for the help yesterday - turned out to be a bunch of issues jumbled together. the primary problem was interaction in the repl and reloading namespaces
12:45technomancyandyf_: what's an example of a valid source form that would generate a warning but not be IObj or IMeta?
12:45Bronsaa macro can be a no-op only for functions tohough, if you have (macro1 (macro2 ..)) macro2 will not be invisible to macro1
12:45xk05civilian airliner shot down over eastern ukraine
12:46Bronsatechnomancy: a keyword
12:46Bronsatechnomancy: eastwood has a misspelled-keyword linter
12:46technomancyhuh
12:46technomancy^:eastwood/ignore (identity :not-a-typo) =)
12:46mikerodMrJones98: no problem. I'm glad you got it sorted out. I know there can certainly be issues when matching on types, when those types are being dynamically reloaded into the runtime.
12:47technomancyBronsa: can't you just move the metadata up to the form containing the keyword though?
12:47Bronsatechnomancy: that might work, yes
12:47andyf_technomancy: A marker macro can leave compiled byte code unmodified, I believe
12:47Bronsatechnomancy: actually no
12:47Bronsatechnomancy: it has the same issues as using a macro
12:48Bronsatechnomancy: e.g. if your keyword is an argument to a macro that expects a keyword literal
12:48technomancyI see
12:48MrJones98mikerod: yeah - you provided the sanity check that it wasn’t a misuse of the library but something possibly more insidious
12:48technomancyBronsa: actually no, I don't
12:48technomancyjust attach the metadata to the macro call
12:48technomancyand the linter shouldn't descend into it, right?
12:48andyf_Bronsa: I'm not expecting people will want to disable keyword warnings that way, necessarily, but I wouldn't want to disallow it
12:48technomancy(forget the identity bit)
12:49Bronsaandyf_: I think at this point having evaluated all the possibile solutions metadata seems like the best one. we can use a gloabal table of keywords to ignore
12:49Bronsatechnomancy: ^{:eastwood/ignore-keywords #{:foo}} (macro ... :foo ..) ?
12:50technomancyright
12:50technomancyor just ^:eastwood/ignore-keywords if you are lazy and sacrifice granularity
12:50andyf_Bronsa: Do you have any concerns about a marker macro other than the need to require its definition?
12:50Bronsaandyf_: yes. it wont work in some cases
12:50Bronsa18:43:34 <Bronsa> a macro can be a no-op only for functions tohough, if you have (macro1 (macro2 ..)) macro2 will not be invisible to macro1
12:50Bronsa
12:50Bronsaandyf_: ^
12:51Bronsaandyf_: silly example, (for [x (range) (eastwood-ignore :when) (even? x)] x)
12:51Bronsathat won't work
12:52andyf_Sorry if I am being dense here, but if macro2 is defined to expand only to its 1 arg , what can go wrong there?
12:53technomancyandyf_: just saw the eastwood ticket about re-using JVMs; are you aware of :eval-in :nrepl?
12:53andyf_Ok, but that example doesn't work equally for metadata, either
12:53Bronsaandyf_: (defmacro x [y] (if (= :y y) 1 2)) (x :y) (x (do :y)) will produce different results
12:55Bronsaandyf_: correct, there's no way to wrap a form in an "invisible" way, if the form is used inside a macro call it will always be problematic
12:55Bronsaandyf_: what technomancy suggested might be the best solution -- attaching the :ignore metadata on a previous form
12:56andyf_Back in a few mins
12:57ben-ohi. any advice on how to print lazy seqs? I have a clojure.lang.LazySeq and i'm trying to force eval and print to file. but the file only prints the lazy seq object id.
12:58ben-oi've tried doall, map prn
13:07nkozaben-o: (prn my-lazy-seq) should work
13:09ben-onkoza: thanks but that doesn't seem to work
13:09nkozaben-o: can you create a gist with your code?
13:11johnwalkerwhen you use xml->, is there any way to assert that all predicates are true?
13:12johnwalkeri'd like to get an error if an element isn't found
13:15ben-onkoza: https://gist.github.com/BenjyO238/6aae961f81bf565cbc8a
13:15ben-othanks
13:18GoodBobKHi, possibly stupid question. I'm looking at https://github.com/swannodette/om/blob/master/src/om/core.cljs, line 566-568:
13:18GoodBobK (cond
13:18GoodBobK (nil? m)
13:18GoodBobK (let [shared (or (:shared m) (get-shared *parent*))
13:18GoodBobKWhat's the point of (:shared m) when in this branch m is nil?
13:21nkozaben-o: you need to use pr-str instead of prn
13:22nkozaben-o: prn prints the lazy-seq to standard ouput and returns nil, then spit is taking that nil value
13:22nkozaben-o: pr-str prints the lazy-seq to an string and returns that string, use it.
13:23andyf_Sorry to drop out on folks when you were helping me out there. Work intrudes. Will read the discussion and bring it up again later if I have more questions. Thanks!
13:24ben-onkoza: thanks! works now. appreciate your help.
13:25mi6x3mhey guys, what is the most convenient way to get a list of all symbols used by a function?
13:25mi6x3mright now I use (filter symbol? (flatten (read (source-fn
13:25nkozaGoodBobK: seems there is no point, you should blame on that line to notify dnolen about it
13:26mi6x3malso, is there an elegant way to strip the namespace in a qualified symbol?
13:26GoodBobKnkoza: thanks
13:27nkozami6x3m: I only found (-> 'ns/sym name symbol)
13:27tvanhensIn datalog, if I have a set of names-to-check, and a set of names-in-db, how would I query for all names-to-check which are not already contained in names-in-db?
13:28mi6x3mnkoza: ah! it seems name ignores the ns qualifier
13:28mi6x3mthanks
14:03rurumatecan anyone give an example of what reduced and reduced? are doing?
14:03rurumate&(reduced 1)
14:03lazybotjava.lang.RuntimeException: Unable to resolve symbol: reduced in this context
14:03rurumateok that's fail
14:04ambrosebs,reduced
14:04clojurebot#<core$reduced clojure.core$reduced@3002b9>
14:04ambrosebsa Reduced is a special wrapper value that terminates a reduce early
14:05boxedhow do I make clojure drop into a repl when the process throws an uncaught exception?
14:05razum2umdoes anybody knows why it happens: https://gist.github.com/razum2um/432181a0689e5c447b09 ?
14:05rurumatebut why can lazybot not resolve it?
14:05technomancyboxed: I think ritz does that
14:05rurumateand what is it good for? example?
14:07ambrosebs&*clojure-version*
14:07lazybot⇒ {:major 1, :minor 4, :incremental 0, :qualifier nil}
14:07technomancyhuh, is reduced a special form?
14:07ambrosebs,*clojure-version*
14:07clojurebot{:major 1, :minor 6, :incremental 0, :qualifier nil}
14:07ambrosebsI mean it's treated specially in reduce
14:07boxedtechnomancy: hmm.. the docs on that seems… lacking. Referring to a presentation from a conj the first thing makes the baby jesus cry
14:08ambrosebsoh and it was introduced in 1.5.1
14:08technomancyboxed: yeah, it's unfortunate
14:08ambrosebsor 1.5.0
14:13Bronsatechnomancy: reduces is just a regular function
14:15Bronsatechnomancy: it wraps the value in a clojure.lang.Reduced, when reduce is handled a c.l.Reduced as its accum it short circuits
14:15technomancyyeah, I didn't expect lazybot to have such an old version
14:18mikerodI didn't realize that binding conveyance worked for lazyseq's produced in the scope of dynamically bound vars.
14:18mikerodhas this been the case for long in clj?
14:18mikerodI also, don't think I fully understand how this works. I wasn't wanting to dig around to understand it. I have observed that something like `with-redefs-fn` doesn't play nice with laziness.
14:19tbaldridgelaziness and dynamic bindings of any kind is just wrong
14:20mikerodtbaldridge: hmm
14:20mikerodtbaldridge: it apparently works to some degree
14:20mikerodI think the problem with statements like that is that things sometimes end up being lazy when you dont' expect, just due to the "lazy when it can be" behavior in clj.
14:21tbaldridgedynamic bindings say "do this within this timeframe", laziness says "do this later". Hilarity ensues
14:21tbaldridgeright so the default should be, avoid binding an with-redefs
14:21tbaldridge*and
14:21mikerodIn reality, the issue is that dynamic bindings are just nasty. If you write a fn and it has lazy behavior, but uses some fn deeper down the stack that references a dynamic var, you'd have to just know about that and be defensive/force eagerness.
14:22trptcolinor use bound-fn*
14:22mikerodtbaldridge: yes, avoidance...
14:22mikerodtrptcolin: I was unaware of bound-fn, pretty cool
14:23mikerodmy main point is, it looks like dynamic bindings were working with a lazy seq
14:23mikerodI didn't think it did. Now I'm curious how/why/and is it reliable.
14:23mikerodNot that I really intend to utilize it.
14:23tbaldridgethey do, sometimes...
14:24mikerodtbaldridge: so this is one of those things that are hit-or-miss and hard to identify the scenarios where it fails?
14:24tbaldridgeno, it makes perfect sense if you know about things like chunked-seqs
14:24mikerodI have observed that with-redefs just fails on some pretty simple cases. I'm thinking it doesn't work at all, but perhaps that is also a flawed assumption. Then again with-redefs is not really a "main" code sort of construct to use.
14:25mikerodtbaldridge: I know about them to some degree.
14:25mikerodI guess not enough though, since I don't see the lines clearly drawn at the moment. :)
14:25tbaldridgeI personally think that if you're using dynamic vars, or with-redefs, you should really try to restructure your code, there's just no reason to use those.
14:26mikerodtbaldridge: with-redefs - I agree should be reserved for trying to mock in tests and only if that's the "best you can do".
14:26mikeroddynamic vars, are more often used.
14:26tbaldridgedon't even use it for mocks, use protocols are pass your components into your functions
14:26mikerodI'm not a big fan. I see why people start using them to avoid the "pass this argument to everyone" issue.
14:27mikerodtbaldridge: Well, unfortunately we cannot always be in control of every fn we interact with to fix them all. :P
14:27mikerodI agree with the design principle of not using them though.
14:27tbaldridgeAt this point I've been using clojure professionally for about 2 years, and have never used with-redefs and have only used dynamic vars once or twice in production code.
14:29augustlis there a set operation for "replace existing" instead of "don't add if exists"?
14:29mikerodI've been using it professionally for about 2 now too. I have had to deal with essentially 1 dynamic var, that is prevalent though. I've used with-redefs to mock away some nasty Java interop stuff and to mock something involved with the dynamic var.
14:29augustlset as in sets, not "set/update" :)
14:31augustlseems disjoin does just that
14:32augustleh no, disjoin just removes it
14:32amalloyaugustl: what would it mean to replace an item in a set with another object just like it?
14:33augustlyeah I suppose my set usage is a bit weird.. The hash code for the items i add to the set isn't for the complete value, so the idea is to replace the old value with the updated value, and find it in the set based on the hash code..
14:33augustlsuppose I shouldn't use sets
14:33clojurebotExcuse me?
14:34augustla PersistentTreeMap probably makes more sense (I need sorting), that I can just assoc into
14:35amalloyyeah, that's a map
14:35amalloynot a set
14:37augustlin hindsight that makes so much sense that I'm embarrassed :) Implementing an object with hashCode instead of just using a map with keys instead of hashCode.. :)
14:41kenrestivoi'm using https://github.com/flatland/chronicle , and having fits trying to figure out how to make it be time zone aware, i.e. for hours
14:41Farehi
14:42Farehow do I access a data file in a clojure jar and/or make sure it's included in the jar?
14:42kenrestivoit produces times that are in UTC. so if you tell it {:hour [0]}, it produces 7am (here, PST8PDT)
14:42Fareat compile and/or at runtime
14:43trptcolintime zone awareness is a myth. like dry land.
14:43mi6x3mFare: I doubt at run time you know that you are running from a jar :)
14:43technomancyFare: check out the resources/ dir and clojure.java.io/resource
14:43kenrestivoamalloy: and i suspect you might know a little something about this
14:44amalloyjust give it a different start time than t/now, and it adds in increments. for example, iirc t/local-now is a thing
14:44kenrestivoamalloy: perfect, thanks
14:46amalloykenrestivo: if that works, please put it in the readme for me
14:47Faretechnomancy, wonderful!
14:47Fare(inc technomancy)
14:47lazybot⇒ 121
14:47kenrestivoamalloy: will do. it does using l/local-now. now i have to patch moments to make it use l/local-now instead of t/now
14:49kenrestivoRaynes: if you're interested in such a patch, that is
14:51amalloylocal-now is probably a better default, but it would be better to take that kind of thing as a config option. (let [scheduler (moments/scheduler t/local-now)] (schedule-every scheduler executor 1000 #(println 'hi))) would be a nice thing to be able to write
14:52amalloyor perhaps that scheduler contains an executor as well, whatever
14:57kenrestivoit contains a ScheduledThreadPoolExecutor, which is even more special
14:59amalloy_kenrestivo: well, i was suggesting you define a new "scheduler" thing, which contains t/now or t/local-now. then you can fold the executor into that as well, so you don't even have to pass any more arguments
15:00celwellI have a map with an arbitrary number of levels of nesting, and I'm trying to get all of the submaps that contain a specific value for a specific key ":xtype". Been trying to use postwalk, but the furthest I can get is to println each of the desired submaps. I just need to get them into a list at this point, but I'm stuck. Any thoughts?
15:05justin_smithcelwell: perhaps tree-seq
15:05justin_smithotherwise, you could conj onto an atom with a vector or hash-map in it, but tree-seq is likely simpler
15:06justin_smithpostwalk is helpful to make a variation on a tree, but to extract subtrees, tree-seq is likely the right thing
15:07celwelljustin_smith: if i conj onto an atom, isn't that considered a less 'clojure' way of doing it?
15:07celwelljustin_smith: I'll check out tree-seq though
15:07PigDudehow do i test if a value implements some protocol?
15:09trptcolinsatisfies?
15:11justin_smithcelwell: indeed, but sometimes doing an algorithm in terms of a well scoped mutation (won't leak out and change behaviour outside that let block or in other threads) is much simpler than forcing it to be immutable
15:19augustlanyone happen to know why Clojure's data structures aren't in a separate lib, cljs style (mori)?
15:19stuartsierramori came *after* ClojureScript.
15:20bbloomi think he's asking about the jvm structures
15:20bbloomaugustl: you don't need them packaged up nicely on the jvm
15:20stuartsierraI know people use them from Jav.
15:20stuartsierra*Java
15:20augustlbbloom: true, but the current version of PersistentHashMap requires the runtime to be initialized
15:20augustland who knows what might happen in the future, etc
15:21stuartsierraSomeone's probably ported them already.
15:21augustlthere's https://github.com/krukow/clj-ds but it doesn't seem to be actively maintained
15:22bbloomaugustl: do you need them to be CLOJURE'S or just you want persistent array mapped tries?
15:22bbloomhttp://pcollections.org/ maybe?
15:23bbloomsee also: http://stackoverflow.com/questions/20834721/what-libraries-provide-persistent-data-structures/20834722
15:23augustlwell I want something that's actively maintained and tuned and awesome :) And the ones in Clojure are actively maintained. Seems like clj-dns and pcollections doesn't have all that many users
15:24augustlI've chosen clj-ds, that works for me. Mostly just curious why JVM Clojure hasn't split it like cljs has :)
15:24bbloomaugustl: how actively do they really need to be maintained? i mean, the only major change to the clojure ones were hashing fixes
15:24augustland perhaps that's just a couple of patches/contributions away
15:25bbloombut i mean, they are "done" in many senses
15:25augustldoes pcollections have transients?
15:25augustlit's not mentioned anywhere as far as I can tell
15:25bbloomno idea, found that at random
15:25bbloom*shrug*
15:26augustlthe real question is why aren't all JVM devs using a persistent data structure lib ;)
15:27stuartsierraI think Guava has some.
15:27bbloomlast i checked, guava only had "unmodifiable" not persistent
15:27augustlah, I thought guava only had COW and unmodifiable
15:27stuartsierraah, ok
15:28bbloomapparently persistent collections are in the "idea graveyard" http://code.google.com/p/guava-libraries/wiki/IdeaGraveyard#Persistent_mutable_collections/mutation_methods_on_immutable_col
15:29bbloom*shrug*
15:29augustlI suppose it's pretty common for people that like persistent data structures to just use Clojure
15:29bbloomi don't even remember what like was like before persistent data structures
15:29bblooms/like/life/
15:29augustlbbloom: copy all the things, or get ConcurrentModificationException
15:30bbloomor just solve smaller problems :-P
15:31augustlhaha
15:35Deshengdoes Kmett have a site where he gives possible use cases for category-extras or a blog about his arrival at each one, or anything like that?
15:44TimMcDesheng: You might have better results asking in #haskell...
15:44Deshengoh dang sorry
15:44TimMc:-P
15:44Deshengthe tabs are right next to each other in my client lol
15:45TimMcAre you in the Boston area?
15:45TimMcI just happened to hear the name "Kmett" from a coworker who was at the local Haskell meetup last night, otherwise I wouldn't've had a clue.
15:46Deshengif you loosely enough define Boston area maybe
15:46DeshengI'm in Maine
15:49mikerodOh no! haskell talk can't be allowed here :P
15:49mikerodOh, I had no idea that cljs broke out the persistent data structures into a standalone
15:51bbloommikerod: it doesn't really. dnolen_ just packaged up a nice js api called mori by wrapping core
15:54mikerodbbloom: oh, tricky
16:09sritchiednolen_: hey david, QQ about om component state organization -
16:10dnolen_sritchie: hopefully I can answer it :)
16:10sritchie:) dnolen_: I’ve got a component that needs state from two separate locations in my cursor -
16:10sritchieI can paste the state schema in a sec
16:11sritchieso instead of (om/build-all event-row (-> state :static :events))
16:11sritchiethat component also needs (-> state :static :pricing)
16:11dnolen_sritchie: so just compose those two things into a map
16:12dnolen_(om/build event-row {:events ... :pricing})
16:12sritchieso (om/build-all event-row (map (fn [event] {:pricing (-> state :static :pricing), :event event}) (-> state :static :events))
16:13sritchiednolen_: oh, just use “build” and give it a single map
16:13dnolen_sritchie: either should work
16:13dnolen_I would probably do it w/ a map though
16:13sritchiethen have that component internally use “build-all” for its event rows, now that it has the “static” pricing alongside
16:13sritchie?
16:14dnolen_oh sorry I didn't see you were doing a build all
16:14dnolen_yes that work
16:14dnolen_s
16:15sritchieokay, trying that out
16:15sritchiethanks!
16:15sritchiewell, actually… this is still a little confusing
16:15sritchielet me type up a gist example, one sec
16:16sritchieI’m rendering a row for each event that a race organizer is offering, and each event has its own list of genders, age groups and boat types; so that fits the build-all model well
16:16sritchiebut every one of those rows has to have access to a single instance of pricing
16:17sritchiednolen_: I find myself worrying in advance about mapping across cursors and screwing with Om’s ability to do diffs
16:17dnolen_sritchie: you shouldn't run into problems
16:17dnolen_Om just used = now
16:17dnolen_uses
16:18sritchieokay
16:18dnolen_sritchie: if you have something that's slow let me know but I doubt it :)
16:18sritchieokay, I’ll go for it and see what happens
16:18sritchieyeah, this view in particular is just never going to suffer
16:18sritchie:)
16:18sritchieonce I go back and redo that timing app example with its millisecond-level updates, maybe I’ll hit something, but not now
16:42sandbagsanyone used and recommend any of the twitter streaming libs?
16:43sandbagstwitter-streaming-client looks the most maintained but i'm not sure i like its interface very much
16:44sandbagsi wish clojars could sort libs by, e.g., last release date
16:49bbloom,let [t (transient [:x :y :z])] (persistent! t) (persistent! t)) ; huh? why? is there any harm in calling persistent on a transient that is already in use persistently?
16:50clojurebot#<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/let, compiling:(NO_SOURCE_PATH:0:0)>
16:50bbloom,(let [t (transient [:x :y :z])] (persistent! t) (persistent! t)) ; huh? why? is there any harm in calling persistent on a transient that is already in use persistently?
16:50clojurebot#<IllegalAccessError java.lang.IllegalAccessError: Transient used after persistent! call>
16:50amalloybbloom: yes
16:50bbloomamalloy: what's the problem?
16:51bbloomseems like the arrays are never modified once the edit root is null
16:51amalloywell. i guess maybe not? i suppose it might be fine to call persistent! twice; it's other calls that'd be no good
16:51bbloomall further modifications to the collections do an array clone first
16:51bbloomwell of course actual modifications can't be done after persistent!
16:52amalloybbloom: it might be the case that if there are two different persistent pointers to the same transient collection, you lose the amortized performance guarantees because they repeat the same work
16:53bbloomamalloy: i'm not sure i follow
16:53amalloywell like, when you take a transient and make it persistent, there's some cleanup work left to be done, right?
16:54amalloyand it's amortized o(1) because it gets done on-demand as you traverse and/or "modify" the persistent collection
16:54bbloomamalloy: a tad. persistent vector trims the tail array w/ a copy
16:55amalloyso i was imagining that if there are two persistent pointers owning that same underlying transient, you might wind up repeating that cleanup work; persistent! might refuse to let that happen in order to preserve its performanec guarantees
16:57bbloomi'm not so sure about the perf issue, but i could see how it would be seen as a bug to call persistent! twice... in my case, i actually have two different transient objects that share an edit root
16:57bbloom(i'm doing something crazy)
16:58bbloomso my problem is that i want to atomically clear the edit root, but still call persistent! on each of the independent transient objects to create the persistent wrappers
16:58bteuber(no need for that remark, you're in #clojure so noone would expect anything but :D )
16:59amalloybbloom: you have two transients sharing an edit root? i don't know enough about transients to know what that means, let alone how you make it happen
16:59bbloomensureEditable checks that edit thread == current thread, but i think for persistent, the check really should be edit thread == current thread OR edit thread == null
16:59bbloomamalloy: internally, persistent vector's nodes all have a single atomic reference containing the thread that may edit them
17:00bbloomamalloy: i'm doing a custom structure that has something similar, but it just so happens that the internal nodes are themselves useable as transients standalone
17:04bbloomok, that's what i'm doing... normal check is (not= owner (Thread/currentThread) but for persistent! i'm checking (and owner (not= owner (Thread/currentThread)))
17:10gfredericksso leiningen profiles support using a vector of maps & keywords instead of a simple map
17:10gfrederickswhere the keywords are names of other profiles
17:10gfrederickswhich is cool and useful
17:11gfredericks... but
17:12gfredericks:profiles {:a [{...} :b] :b {...}}
17:12gfredericks^ this warns about :b being not found
17:12gfrederickswhile :profiles {:b {...} :a [{...} :b]}
17:12gfredericksis okay
17:12gfredericksi.e., the map ordering seems to be sensitive
17:12technomancygfredericks: https://github.com/technomancy/leiningen/issues/1424
17:12gfrederickshey hey hey
17:13technomancywe should add a warning though
17:13technomancyeven if we can't drop support yet
17:13gfredericksoh I see so I'm Doing It Wrong
17:13technomancyyeah, but it's not obvious or documented
17:13gfredericksso I should do :profiles {:a' {...} :b {...} :a [:a' :b]}
17:14technomancyyeah
17:15technomancyexcept use a proper unicode prime mark; geez
17:15technomancyya slacker
17:15gfredericksO_O
17:15Frozenlo`Are browsers preloading urls? I've got a route in my ring app printing to console when its visited and it prints BEFORE I press enter in my browser. :-/
17:15amalloyFrozenlo`: chrome often does
17:16Frozenlo`amalloy: So I'm not mad then. Thanks.
17:17justin_smithFrozenlo`: what is the path? is it a wildcard? with wildcards I found myself serving favicon.ico requests as if they were dynamically generated pages (until I made a middleware to steal all */favicon.ico)
17:17FrozenlockNot, it's a normal path... "/some-path"
17:18justin_smithlike I would have a article/:id0/comments/:id1 which would get requests with :id1 being favicon.ico
17:18justin_smithOh, OK
17:18amalloyjustin_smith: that seems weird. isn't favicon.ico only requested at /?
17:19arrdemamalloy: you can "suggest" an alternate favicon location. Grimoire and my blog do this.
17:19arrdembut by default yeah it's /favicon.ico
17:21gfrederickstechnomancy: hey hey hey thanks man
17:21gfredericks(inc technomancy)
17:21lazybot⇒ 122
17:22technomancyno problem
17:25sdegutisWhat's Clojure's biggest strength that sets it apart from other languages?
17:26mthvedtparens
17:26sdegutisI'm trying to figure out if the only reason I used Clojure to write this web app was because of the honeymoon effect from when I first learned it, coinciding with my realization that Rails causes pain.
17:26jonathanjdynamic typing, every compile is a type-lotto
17:26justin_smithamalloy: yeah it is weird, but we definitely got it at arbitrary paths
17:27TEttingersdegutis, probably the seq abstraction and how easy concurrency is
17:27sdegutisTEttinger: the seq abstraction in what sense?
17:27TEttingerbeing able to deal with complex nested data easily is really handy
17:27sdegutisOh, so the core functions that operate on lazy sequences.
17:27TEttingerat least for the stuff I use clojure for
17:27TEttingersorta
17:28sdegutisYeah I wrote briefly about something like that here: http://sdegutis.github.io/2013/10/22/clojure-for-web-apps-p1/
17:28TEttingerany coll in clojure can be treated as a seq, so it makes it really nice to convert around
17:28justin_smithamalloy: ahh, looks like it was an old chrome bug http://stackoverflow.com/questions/1003350/why-is-chrome-searching-for-my-favicon-ico-when-i-serve-up-a-file-from-asp-net-m
17:31verma,(for [x (range 4) y (range 3)] [x y])
17:31clojurebot([0 0] [0 1] [0 2] [1 0] [1 1] ...)
17:32sdegutisI used to like the whole DSL abstraction that macros allow, but I often find myself looking up the source for something like "defroutes" or "defstylesheet" to see what it's actually doing.
17:36numbertenwhat does the period mean in https://github.com/jonase/kibit/blob/master/src/kibit/rules/arithmetic.clj ?
17:37cbpnumberten: that depends on what defrules does
17:37numbertenah it's a macro, reading now
17:37numbertenthanks
17:37amalloynumberten: it's the old dotted-pair notation for sequences
17:38jdkealyif i had an entity which had an attribute of type string with cardinality many, how do i delete one of the items in the list? updating the entity with a new list does not retract the old ones, and there's no ID associated with the string to retract
17:38amalloy(a b c . d) is a sequence of at least three args, the first three of which are named a/c/b, and the remaining args are named d
17:38numbertenamalloy: ah thanks
17:38numbertencan d be '()?
17:38amalloylike ##(let [[a b c & d] (range 10)] [a b c d])
17:38lazybot⇒ [0 1 2 (3 4 5 6 7 8 9)]
17:39amalloyprobably
17:39bbloomamalloy: heh, maybe dnolen_ should deprecate that in favor of &
17:39numbertenalright thanks
17:39cbpwell TIL
17:39amalloybbloom: this is kibit, not core.match
17:39bbloomamalloy: https://github.com/jonase/kibit/blob/master/src/kibit/rules/util.clj
17:39amalloyoh, but it's using core.logic
17:39bbloomcompile.rule delegates entirely to core.logic
17:42augustlany libs around to turn an xml file into a persistent data structure, ideally without having to read the whole file into memory first (streaming, om nom)
17:43augustl?
17:43bbloomaugustl: what would it mean for persistent data structure to be streaming?
17:44augustlnot the data structure, just the actual parsing of the xml file
17:44augustlunder the hood
17:44bbloompresumably data.xml does that
17:44augustlnot super important I guess, all I really want is to have the xml as a persistent data structure in-memory
17:44bbloomhttps://github.com/clojure/data.xml
17:45augustlnice, tnx
17:45arohneraugustl: and yes, you can make data.xml stream lazily
17:46arohnerobviously only useful if you have an array-like structure
17:46justin_smithaugustl: maybe xml-seq?
17:47augustljustin_smith: looking that up, tnx
18:00sritchiednolen_: BOOM, google places autocomplete component working :)
18:03sritchiednolen_: the beginning of a bootstrap forms component: https://gist.github.com/sritchie/9014c14c15d72c8b6458
18:03sritchieworks great over here. next is a table, and then the scrolling component we talked about months ago
18:08bbloomwhat do i do if i have a deftype with an :unsynchronized-mutable and want to create a private helper function that operates on it?
18:08bbloommutables are private
18:09bbloomso i can't just make a free function w/ a type hint...
18:09dnolen_sritchie: nice!
18:10bbloomi know that cljs core has a few "private" methods, by just defining them against Object & relying on the lack of validation
18:11bbloomexample: https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L5045
18:12bbloomseems like on the JVM my best option is just a private protocol
18:14dnolen_bbloom: or a implement a definterface + helper function that calls it, I think.
18:15bbloomdnolen_: bummer. i'm doing (defprotocol Private ...) right before the deftype & repeating myself like a god damn C programmer
18:16dnolen_bbloom: well you're doing something low level, not supposed to be fun.
18:17bbloomdnolen_: yeah, but it's also kinda weird b/c if somebody were to use this class from java, they'd have public methods thanks to the interface
18:17bbloomseems like for interop sake, it would be nice to actually define a private method
18:19seangrove"not supposed to be fun" - interesting thought
18:22bbloomseems like nothing i do is ever supposed to be fun :-p
18:22bbloom"you're programming, it's supposed to be pain and suffering without explaination"
18:24amalloywould an explanation really make it better? "this is no fun because your program is objectively bad"
18:24amalloyi wouldn't want to hear that
18:33ephemeronI am writing a wrapper around a rather OOP-ish library which makes extensive use of mutable fields, with much of its API focussed on getting/setting those fields.
18:34ephemeronIs it generally considered idiomatic to wrap these methods with functions that return the affected object, e.g. for ease of chaining,
18:35ephemeronor is it better to let the wrapper functions return nil, be side-effecting only, and let the wrapper user do the chaining if he needs, e.g. with doto?
18:37ephemeron(Wrapper/library are actually cljs/js, but I venture that the question is general enough not to be off-topic.)
18:38dnolen_ephemeron: probably would bother wrapping overly side-effecting libs, but guess it just depends on what you are trying to accomplish
18:38dnolen_s/would/wouldn't
18:42ephemerondnolen_: Thanks for answering. For now, the wrapper is rather thin, which validates your preference; it is mostly a way to avoid littering namespaces with verbose interop.
18:45arrdemephemeron: one thing you could do is basically create a do monad wrapper, so your "API" really just accumulates instructions, and then you have some force! or execute! instruction which actually interprets the command sequence against mutable objects you never expose to users. You could also achieve the same thing with chained partial applications. Another alternative is to just create object clones and side-effect the clones for global side-effects or what
18:54ephemeronarrdem: I suspect that, in my case, object clones would either be contrived or simply unviable, but your first suggestion is interesting; I will likely consider it in the longer run. Danke schön.
19:38Jaood,(every? symbol? ())
19:38clojurebottrue
19:39Jaood,(symbol? ())
19:39clojurebotfalse
19:39Glenjamin,(every? false? [])
19:39clojurebottrue
19:39Glenjamin,(every? false? [1])
19:39clojurebotfalse
19:40Glenjaminevery appears to return true with an empty collection, i guess that makes sense
19:40arrdemclearly we need a logical indeterminate value...
19:40Glenjamin,(doc every?)
19:40clojurebot"([pred coll]); Returns true if (pred x) is logical true for every x in coll, else false."
19:42JaoodGlenjamin: I guess an empty list is still an empty list of symbols
19:48celwellI'm having trouble finding sufficient docs for clojure.java.jdbc. I'm trying to create a table with an :id column that is primary key and auto increment. I have this, but how can I extend it to make the id column be AUTO_INCREMENT? [:id "varchar(255)" "primary key"]. (to clarify, I'm using the "create-table" function.)
19:49amalloycelwell: c.j.jdbc does not contain a lot of schema modification features. i'd just create the tables in a psql shell or something
19:50celwellamalloy: I have to create the tables programatically so I was hoping there was an option for auto increment as there is for primary key. Mayb I should peruse so java jdbc docs. ill see...
19:51amalloyjust jdbc/execute! for anything more complicated than a SELECT
19:51amalloythe fancy features for trying to work with anything more clojurey than a giant string sql statement are pretty limited
19:53celwellamalloy: ok good point, i guess ill have just create the sql string myself, sigh
19:53elbenI have an infinite lazyseq (it consumes from a kafka queue). I can iterate using (doseq [msg stream] …), but what’s the best way of “breaking out” after some condition is met (e.g. have consumed N messages)?
19:54elbenhowever, I don’t want to realized N messages right away using (take n stream)
19:55hiredmantake is lazy
19:56hiredmanbut anway, I think seqs for modeling consumtion from queues is tempting, but ultimately not good
19:57hiredmanmost queues provide some way to ack/nack messages which seqs don't provide, you may want to timeout pulling a message, seqs don't provide a way to do it
19:57hiredmanetc
19:58elbenunderstandable. i’m using the kafka scala consumer, which is an Iterator interface, hence why I’m using a seq.
19:59elbeni suppose it throws an exception on timeouts etc
20:32gfrederickshaha wow okay woohoo so
20:32gfrederickstwo projects on the same machine use the same library; when I `lein repl` in either one the pom.properties for the library shows identical versions
20:33gfredericksyet one has a function missing (a function new in this particular version)
20:33gfrederickscan't wait to find out what on earth
20:34amalloygfredericks: how is lein repl related to pom.propertise? actually i don't even know what pom.properties is
20:34hiredmancheck lein classpath
20:34hiredmanalso stop aot compiling
20:34hiredmanetc
20:34amalloytechnomancy: getting those same spam PMs from kitimini
20:34gfredericksamalloy: it gets packaged with the jar, good for sanity checking what version of a lib you're actually using
20:35gfredericksI should mention that results from CI are consistent
20:36gfrederickswhich rules out pretty much every possible explanation I think
20:36gfredericksexcept goblins
20:36hiredmancheck lein classpath
20:36gfrederickson it
20:37hiredmanOoooh
20:37gfredericksyep lein classpath did it
20:37hiredmanor you could be depending on some other library that transitively aot compiles that was built against an old version, but built after the new version of the library was released
20:37gfredericksit's lamer than that
20:37gfredericksI had forked it
20:37hiredman(true story, I've seen it happen)
20:38gfredericksso one of my projects had two versions of it
20:38gfredericksdue to different group names
20:38hiredmanand becuase the timestamps on the aot classfiles are newer the "old" code is prefered
20:38amalloyhiredman: that sounds like an artists rendition of hell
20:39hiredmanthere was a lot of thrashing around before we figured that out
20:45technomancyI've debugged that in a support ticket
20:45technomancyit ain't pretty
20:47arrdemso what on earth does Clojure do AOT for a variadic -main..
20:48gfredericksarrdem: I think there's a shim method
20:48gfrederickssince .main needs to take an array anyhow
20:49arrdemgfredericks: yeah that's what I'm thinking. you eat an array and then apply the var that's named -main
20:49gfrederickspublic static void main(String[] args){ // as you all have dutifully memorized
20:49gfredericksarrdem: I've seen it in the stacktrace
20:49gfredericksthere's a .main and a ._main
20:49gfredericksI guess it's a gen-class feature?
20:50arrdemprobably.
20:50gfredericksthe ._main is just a regular var class
20:50gfrederickser...function class
20:52arrdemokay so the "-main" var has to "exist", because you could potentially recur through it.. so yeah you emit the main var as a "var" (which is a lie for me but whatever) and then you emit the-ns.class with a -main that shims into the "var"... okay doable.
20:53amalloyarrdem: because you could recur through it? how is that relevant. it exists because you're allowed to call it
20:53arrdemamalloy: that's what I meant, recur as a call rather than clojure's loop jump.
20:54amalloybut that doesn't have to be recursive. i can just call (-main) anytime, anywhere
20:55gfrederickswhen pizza's on a bagel you can call (-main) anytime
20:58hellofunkI'm trying to find docs about the max size available for a core.async channel buffer. Doesn't appear to be mentioned anywhere.
20:59gfrederickswhy would there be a max size?
20:59hellofunki don't know, just figured there would be; you suggest there isn't?
21:00gfredericksI can't think of a reason for one
21:00hiredmanhellofunk: do you want a max size buffer for some reason?
21:01hellofunkhiredman not for a specific reason, I just didn't know if something like 10,000 is a reasonable number or not. I'm having a problem in cljs where my reads aren't happening as fast as my puts, leading to the error about exceeding 1024 pending puts. So I'm thinking a bufferred channel may be necessary to provide some slack.
21:01hiredmanbecause I think doing that will mean fighting core.async since it explcitly requires a max size so channels can back pressure
21:02arrdemgfredericks: yep. https://www.refheap.com/88314
21:03arrdemcan I do this without RT.seq..
21:04amalloywhy would you want to, arrdem?
21:06arrdemamalloy: I'm trying to compile a standalone hello world as a test program. If I can escape RT altogether (and I almost have) I would prefer to, both for complexity's sake and to escape the startup time of loading Clojure "proper".
21:06amalloybut you'll just be calling into a var that needs clojure proper anyway, right?
21:07arrdemno...
21:07arrdemthe whole point of my project is to throw out everything I can, especially vars.
21:08arrdemthis test program compiles to zero vars. Note that Oxcart does not claim to be able to interop with Clojure.
21:08amalloyokay cool, well i guess i have no idea what you're up to. good luck
21:08arrdem:P thanks
21:09arrdemurgh. AFn uses RT. this can't be done.
23:42hellofunkDoes anyone know if the limit of 1024 pending puts applies to all types of channels, therefore if you have a buffered channel with say 1000 size, then you could put 2400 on that channel before exceeding this limit?
23:42hellofunksorry I meant 2024