#clojure logs

2014-09-03

02:13mi6x3mhey clojure, what's the proper way to output the object's clojure representation?
02:13mi6x3mprintln?
02:13mi6x3mstr?
02:16beamsopr, prn or clojure.pprint/pprint ?
02:17mi6x3mbeamso: yes, that seems to be it :)
02:18TEttingermi6x3m, prn may have unexpected results on arrays or java objects, but you can customize how they pr too.
02:18TEttingerpr/prn both
02:19rpaulo]\
02:19beamsoi personally use println, but the docs for print say 'for human consumption'.
02:19mi6x3mbecause I am formatting source code manually
02:20mi6x3mis it a bad idea to put placeholder keywords like :nl-tab in the list
02:20mi6x3mto replace it later with "\n\t" ?
02:20rpaulooops, cat tried to type
02:20mi6x3mpprint just doesn't bring it
02:32mi6x3mjust out of interest. would someone consider this code sane: http://pastebin.com/ZTr6RyUS ?
02:32mi6x3mit builds the source code for a code example
02:32mi6x3mvery ugly though
03:43hhenkelHi all, I got a question regarding a piece of code that works fine for me but I'm not sure if it is the way to do it in clojure: https://www.refheap.com/89731
03:44hhenkelAny thoughts on that?
03:46hhenkelAdded another set of data as the first set did actually not match....
03:47mercwithamoutho_O
03:52mercwithamouthhmm this must be the slow hour
03:53mercwithamouthhhenkel: i'm rather new to clojure but it looks ok to me
03:54mercwithamouthwait...ehh
03:56hhenkelmercwithamouth: I might improve the matching part but so far it works for me. My question is more like...is that they way to solve such a problem in clojure.
04:02mercwithamouthhhenkel: seems clean enough
04:26amalloyhhenkel: i don't like that implementation very much. the repetition is tiresome, and calling count on a sequence when you don't need to know exactly how many items it has is a bad idea in general - stuff can be expensive to compute, or whatever. the changes i think are basically mandatory to make are https://www.refheap.com/89733
04:28amalloyas an optional change: normally i'm a big fan of for/when, but here what you're doing is simpler with sequence functions: (map :values (filter (comp #{(trim request)} trim) server-requests)) could replace most of the things you're let-binding
04:30amalloyie, something like https://www.refheap.com/89734
04:32amalloyanyway, i'm off to bed. hope that helps
04:38hhenkelamalloy_: Thanks!
04:40hhenkelamalloy_: From looking at your stuff I think I get slightly an idea about your thoughts. Thanks again!
04:50michaelr525Hi
04:51michaelr525What would be a good place to read about clojure? That's for my team lead at work..
04:51michaelr525Some easy to understand but technical introduction..
04:55yusupHi all
05:03maxthoursiemichaelr525: something like http://adambard.com/blog/ten-reasons-to-use-clojure/ ?
05:05michaelr525maxthoursie: I might use this.. hhmm but I'm not sure it's friendly enough.
05:06maxthoursieit might not be, just suggested it because it's quite recent
05:06michaelr525maxthoursie: not sure that someone who never saw clojure will understand. lot's of material in a short article..
05:06michaelr525maxthoursie: thanks..
05:06maxthoursiefew things beats hickeys talks when it comes to insperation
05:06maxthoursiesimple made easy is what brought me here once
05:10michaelr525maxthoursie: i'll check that
05:19lvhYeah, I'm a big fan of Rich's talks.
05:19lvh(Not just for myself, although I think I've watched simple made easy hafl a dozen times now, but also for convincing others :))
05:21emil0rmichaelr525: i would second simple made easy. very good material about a lot of the problems that plauge a lot of modern programming with good solutions proposed
05:32mi6x3mhello, can someone help me spot problems in this function http://pastebin.com/MbhhdB56. I posted it yesterday but then my net went away. it basically constructs a string of clojure code dynamically for a code example of a GUI component I am writing
05:32mi6x3meach example is a variable holding a function with some metadata
05:32mi6x3mI extract the source code of all dependant functions and print them out along with a header for the namespace
07:03clgvmi6x3m: if you want help, you have to state your problem more exactly: short description what the task is using input examples and describing the desired output and give the outputs for the input examples
07:04mi6x3mclgv: yes, preparing a larger example now :)
07:07clgvmi6x3m: oh no! please do not make it larger. provide a concise description with the mentioned examples instead
07:08clgvmi6x3m: minimal examples that characterize the problem sufficiently are the goal
07:08mi6x3mclgv: that was the intended meaning, breathe :)
07:08clgv:P
07:42hexaHi, I'm new in clojure and i'm looking for advice into a small function that takes a list and returns a number of elements in the list that are equal to the next one in the list see the current implementation at : http://pastebin.com/H3z04iBW .. I would like advice on how to make this more functional possibly ? All ideas for impovements are welcome (note also that the equal function will be any function in the future) ...
07:47schmirhexa: (defn filter-test [unfiltered-in count-in] (map first (filter (partial apply =) (partition count-in 1 unfiltered-in))))
07:50schmirhexa: well, not quite what you asked for...but it looks like partition is your friend...
07:50hexaschmir, sounds like a good thing to investigate I will try to understand it more :) thx!
07:54schmirhexa: look at partition-by
07:55hexaschmir, almost got it with partition now :)
07:55schmir,(partition-by identity '(1 1 2 2 3 4))
07:55clojurebot((1 1) (2 2) (3) (4))
07:56hexaschmir, (defn filter-testa [unfiltered-in count-in] (take count-in (map first (filter (partial apply =) (partition 2 1 unfiltered-in))))
07:57hexaschmir, then I guess I would have to filter for > 1 lists...
07:57clgvhexa: better write a custom partition function that groups together elements based on a 2-ary predicate
07:58schmirhexa: yes
08:00schmirclgv: why? the partition-by looks very nice to me.
08:00hexaclgv: I was going to say that partition by looks like that no?
08:01hexabut since I only want the elements that match , I tend to like the 1st approch better then the filter partition... unless there's a reason I should not use it..
08:01hexaer.. I mean the 1st partial apply...
08:02clgvschmir: he wants to use an arbitrary predicate as stated above
08:02hexaho yeah right...
08:02schmiryes, right...
08:03hexaclgv: is it possible to use an 2 arg pred with partition-by ?
08:03clgvdepending whether that shall be lazy or eager, you'll end up with an implementation using lazy-seq or loop-recur
08:03clgvhexa: no
08:05hexak
08:13hyPiRion,(defn partition-with [p coll] (let [seps (concat (map p coll (rest coll)) [true])] (->> (map list seps coll) (partition-by second) (map #(map second %)))))
08:13clojurebot#'sandbox/partition-with
08:13hyPiRion,(partition-with not= [1 1 2 2 3 3 4 5])
08:13clojurebot((1 1) (2 2) (3 3) (4) (5))
08:15hyPiRionthat's not correct though, just randomly matches my example. Gur.
08:16hexahehe :)
08:20clgvhyPiRion: but thats awfull complicated compared to a simple lazy-seq or loop-recur based implementation
08:20hyPiRionclgv: It's not working at all, so I don't see how that's relevant :p
08:24clgvhyPiRion: ah lol, I did not see the `not=` thought you use `=` ;)
08:25irctcppp
08:44mi6x3many way to make the edn reader recognize reader forms?
08:45clgvmi6x3m: the clojure reader does that
08:46mi6x3mclgv: I don't want any code execution though
08:47hyPiRionmi6x3m: then you're out of luck, because that's exactly what reader forms are
08:48clgvyeah, sounds like conflicting objectives
08:48mi6x3mhyPiRion: they're not syntactically substituted ?
08:48hyPiRionmi6x3m: no, see e.g. ##(java.util.Date.)
08:48clgvmi6x3m: they are associated with functions that a called on the data the annotate
08:48lazybot⇒ #inst "2014-09-03T12:48:13.356-00:00"
08:49hyPiRion^ you cannot convert that without code execution
08:49mi6x3mok i see, there's the issue :)
08:49mi6x3mi will look around for alternative solutions then
08:49clgv,(type (read-string "#inst \"2014-09-03T12:48:13.356-00:00\""))
08:49clojurebot#<SecurityException java.lang.SecurityException: denied>
08:49clgv&(type (read-string "#inst \"2014-09-03T12:48:13.356-00:00\""))
08:49lazybot⇒ java.util.Date
08:50hyPiRionmi6x3m: but, well, a basic edn reader supports tagged elements
08:51hyPiRionthings is, it is code evaluation, but you decide what tagged elements you support (and therefore what code could potentially execute)
08:51mi6x3mhyPiRion: perhaps I should elaborate on my objective instead
08:52mi6x3mI get the source of a function with clojure.repl/source-fn
08:52mi6x3mI edn read that
08:52mi6x3mand extract a list of all symbols found in the source
08:52mi6x3mthereby collecting the dependencies
08:53hyPiRionright
08:53hyPiRion,(require 'clojure.edn)
08:53clojurebotnil
08:53hyPiRion,(clojure.edn/read-string "#inst \"2014-09-03T12:51:19.404-00:00\"")
08:53clojurebot#<SecurityException java.lang.SecurityException: denied>
08:54hyPiRionoh clojurebot
08:54hyPiRion&(require 'clojure.edn)
08:54lazybotjava.io.FileNotFoundException: Could not locate clojure/edn__init.class or clojure/edn.clj on classpath:
08:54hyPiRionWell, that's working at least.
08:55mi6x3m,(require '[clojure.tools.reader.edn :as edn])
08:55clojurebot#<FileNotFoundException java.io.FileNotFoundException: Could not locate clojure/tools/reader/edn__init.class or clojure/tools/reader/edn.clj on classpath: >
08:56mi6x3mright
08:56mi6x3mit's a leiningen dependency
08:56hyPiRionjust do it in a repl :p
08:57hyPiRionI thought it was built into clojure core
09:10clgvhyPiRion: lazybot uses an older clojure version compared to clojurebot
09:10clgv&(clojure-version)
09:10lazybot⇒ "1.4.0"
09:10clgv,(clojure-version)
09:10clojurebot"1.7.0-master-SNAPSHOT"
09:22hyPiRionoh wow, I thought clojurebot used 1.5
09:22hyPiRionat least.
09:33schmiris there a special syntax to destructure an atom? i.e. I pass an atom to a function and like to destructure the deref'ed value in the functions argument list
09:36TimMcNope.
09:36schmirTimMc: ok. thanks!
09:40hyPiRionIt's possible though, but never do it
09:41hyPiRion,(defn foo [& {:keys [b a] :or {b @a}}] b)
09:41clojurebot#'sandbox/foo
09:41hyPiRion,(foo :a (atom 0))
09:41clojurebot0
09:41hyPiRionwhy am I teaching people this
09:41Kalinahi
09:44Kalinais some of you participating in clojurecup?
09:44TimMchyPiRion: That's so dirty. :-)
09:44ambrosebshyPiRion: WOW
09:45Kalinao.O
09:46hyPiRionTimMc: funny thing is, the ordering matters
09:46hyPiRion,(defn foo [& {:keys [a b] :or {b @a}}] b)
09:46clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: a in this context, compiling:(NO_SOURCE_PATH:0:0)>
09:46ambrosebsomg too early
09:47arrdemall of this wat and I'm not even at class yet.
09:48TimMchyPiRion: But can you destructure the contents of the atom?
09:50BronsahyPiRion: wtf
09:51TimMc,(macroexpand `(let [[& {:keys [b a] :or {b @a}}] [:a (atom 5)]] b))
09:51clojurebot(let* [vec__27 [:a (clojure.core/atom 5)] map__28 (clojure.core/nthnext vec__27 0) map__28 ...] sandbox/b)
09:51TimMc&(macroexpand `(let [[& {:keys [b a] :or {b @a}}] [:a (atom 5)]] b))
09:51lazybot⇒ (let* [vec__11859 [:a (clojure.core/atom 5)] map__11860 (clojure.core/nthnext vec__11859 0) map__11860 (if (clojure.core/seq? map__11860) (clojure.core/apply clojure.core/hash-map map__11860) map__11860) clojure.core/b (clojure.core/get map__11860 :clojure.core/b (cl... https://www.refheap.com/89747
09:51hyPiRionTimMc: yeah, :keys are applied in reverse
09:52TimMcI don't understand this binding: b (clojure.core/get map__3986 :user/b (clojure.core/deref user/a))
09:52TimMcAt that point, there isn't a binding for a.
09:53arrdemhum... why are a and b qualified to clojure.core tho..
09:53hyPiRionarrdem: backquote instead of normal quote
09:54arrdemhum... I need to play with backtick more.
09:59hyPiRionTimMc: oh yeah, it works!
09:59hyPiRion,(defn foo [& {:keys [[c b] a] :or {[c b] @a}}] [c b])
09:59clojurebot#'sandbox/foo
09:59hyPiRion,(foo :a (atom [:c :b]))
09:59clojurebot[:c :b]
09:59TimMcnice
10:00clgvyou can use non-symbols with the :keys list? O_o
10:00hyPiRionclgv: SHH
10:00hyPiRiondon't tell anyone
10:00clgvhyPiRion: that's a bug, right?
10:01hyPiRionclgv: I am very sure of that, yes
10:01clgv,(let [{:keys [{:keys [a b]} c]} [:c {:a 1 :b 2}]] [a b c])
10:01clojurebot[nil nil nil]
10:02clgv,(let [{:keys [c {:keys [a b]}]} [:c {:a 1 :b 2}]] [a b c])
10:02clojurebot[nil nil nil]
10:02clgvah forgot the :or^^
10:05lvhI'm reading core.async, and I was wondering why there's the difference between ! and !!
10:06lvhif single-bang only makes sense inside a go-block, why can't the go block translate the stuff in there?
10:06clgvhyPiRion: yeah, there should be a proper `symbol?` check in there
10:06hyPiRionclgv: Are you suggesting :[a b] isn't a proper keyword?
10:06lvhI guess because maybe then you could write blocking take, spelled with a single !, call it in a function, call that function from inside a go block, expect it to suspend the go block, and then be unhappy when it instead blocks your entire thread
10:06hyPiRion,(let [{:keys [[a b]] :or {[a b] [10 20]}} {(keyword (str '[a b])) [:a :b]}] [a b])
10:07clojurebot[:a :b]
10:07hyPiRionclgv: but yeah, it should be a proper check there
10:07clgv,:[a b]
10:07clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: :>
10:08clgvobviously ;)
10:10hyPiRionwhy is quote multi-arity?
10:10clgv,(doc quote)
10:10clojurebotTitim gan éirí ort.
10:10clgv&(doc quote)
10:10lazybot⇒ "Special: quote; Yields the unevaluated form."
10:10clgv$doc quote
10:10hyPiRion,(-> foo 'a)
10:10clojurebotfoo
10:10BronsahyPiRion: it's not by design
10:10clgv$source quote
10:11lazybotSource not found.
10:11clgv:P
10:11BronsahyPiRion: there should be a ticket to change that IIRC
10:11hyPiRionBronsa: I was about to ask about that
10:14TimMc,(quote a b c)
10:14clojurebota
10:15hyPiRionyeah, http://dev.clojure.org/jira/browse/CLJ-1282
10:17clgvguess that issue needs some voting then ;)
10:21visof,(doall (for [c (range 4)] [c]))
10:21clojurebot([0] [1] [2] [3])
10:21visof,(.toString (doall (for [c (range 4)] [c])))
10:21clojurebot"clojure.lang.LazySeq@1cab43"
10:21visofwhy?
10:21clojurebotwhy is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone
10:22TimMc&(contains? #{-1} (int -1))
10:22lazybot⇒ true
10:23TimMcHow long have we had reliable use of integers as indexes?
10:23TimMcor rather, as map and set keys
10:23clgvvisof: use `pr-str`
10:23clgv,[(.toString (range 10)) (pr-str (range 10))]
10:23clojurebot["clojure.lang.LazySeq@9ebadac6" "(0 1 2 3 4 ...)"]
10:25dnolen_TimMc: pretty sure since 1.3.X or shortly thereafter due to the numerics changes
10:25TimMcI think it was still a problem in 1.3.x.
10:25TimMcMaybe 1.4.0 brought in the hashing changes?
10:26clgvwasnt that 1.6?
10:26clgvyour int expr is converted to Long again before it is passed to `contains?`
10:27dnolen_TimMc: pretty sure it was right after people had some experience w/ the numerics changes so likely no later than 1.4.X
10:27clgv,(type (int -1))
10:27clojurebotjava.lang.Integer
10:27clgvdamn, wait
10:27clgv,(defn foo [x] (type x))
10:27clojurebot#'sandbox/foo
10:27clgv,(foo (int -1))
10:27clojurebotjava.lang.Integer
10:28clgvoh interesting
10:28Bronsaclgv: what were you expecting to get?
10:30SagiCZ11what would be your preffered way to store 2D points in clojure? Use actual Point2D class, use map {:x 5 :y 6} or use some other form of structure/record in clojure? I don't really need to associated behavior with it, just store it.
10:31TimMcOr even two-element vectors.
10:35hyPiRionTimMc: Was 1.3.x the contrib migration?
10:36hyPiRionIt was an issue until the contrib migration IIRC.
10:36BronsahyPiRion: yep
10:39TimMcI still have this aversion to using integers as keys even though it hasn't been a problem for a while.
10:43stuartsierraSagiCZ11: like anything else, it depends on how you're going to use them. Do you want to destructure them as sequential collections? Then use a vector. As (let [{:keys [x y]} point] …) ? Then use a map or a record.
10:44stuartsierraYou can always start with maps and switch to records later if it's a performance hotspot.
11:02arrdemSagiCZ11: what's the use case? it may well be that there are java geometry libs you could work with that give an advantage to using Point2d everywhere rather than a more "clojurey" structure.
11:07SagiCZ11what are records and what are their advantages over maps?
11:10ephemeronSagiCZ11: It seems unnecessary to store simple geometric tuples in maps. I would suggest to use vectors or arrays directly, particularly if you want to treat them as matrices.
11:10TimMcSagiCZ11: More performant if you know your keys in advance, but they make development less dynamic. Don't use them unless you need them.
11:14kqri'm thinking about trying clojure web dev out... what are my alternatives if I want a framework but I don't want to deal with writing authentication code myself because I suck at security?
11:27gfrederickspure : side-effective :: thought : deed
11:30SagiCZ11ephemeron: and if i use them as vectors, should i then access the x y components by first and last/second?
11:31arrdemSagiCZ11: I strongly recommend against using ordered vectors (aka untyped tuples), especially if you may want to add more data to your representation eventually. consequent implicit type issues literally killed a project of mine.
11:34llasramarrdem: The project was literally alive?
11:35arrdemllasram: it was ... a really fun piece of school work and then I changed data models T_T
11:35arrdempoint taken tho :P
11:36jeffterrellkqr: check out https://github.com/cemerick/friend
11:36jeffterrellI don't know of anything that will make all the decisions for you, but friend at least makes it easier.
11:36kqrjeffterrell, just found that, and it looks decent
11:59puredangeranother round of transducer mods from Rich … https://github.com/clojure/clojure/commit/7d84a9f6f35a503cddf98487b6544d18937c669e
12:01puredangerflat map is gone. added a new cat. mapcat is now a transducer: (comp (map f) cat) ;)
12:01mikerodIs there any particular reason that the Clojure compiler does not propagate type hints from generic type information? e.g. (doseq [x (.getMyXs ^MyClass obj)] (.doXMethod x))
12:01puredangerand the completing infrastructure has been lifted into public
12:01mikerodpuredanger: oh, this is interesting
12:01bbloompuredanger: i didn't look too closely... but isn't mapcat/1 already defined?
12:02bbloom(doc mapcat)
12:02clojurebot"([f & colls]); Returns the result of applying concat to the result of applying map to f and colls. Thus function f should return a collection."
12:02bbloomsoo is that a breaking change?
12:02mikerodYeah, I thought mapcat was not amendable to the transducer arities
12:02Bronsabbloom: no, (mapcat f) never had anymeaning
12:02puredangeryes, but not useful
12:02Bronsabbloom: http://dev.clojure.org/jira/browse/CLJ-1494
12:02Bronsapuredanger: ^ I guess that can be closed now
12:02puredangeryup :)
12:02bbloom,(apply mapcat #(vector % %) [1 2 3])
12:02clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
12:02bbloom,(apply mapcat #(vector % %) [[1 2] [3 4]])
12:02clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: sandbox/eval75/fn--76>
12:03bbloomblah
12:03bbloomhm i see
12:04bbloompuredanger: is there some elaboration of the "completing" idea somewhere?
12:04llasramGlad to know I'm not the only one caught by how `paredit-reindent-defun` (or just `fill-paragraph`?) acts w/in strings in clojure-mode: https://github.com/clojure/clojure/commit/7d84a9f6f35a503cddf98487b6544d18937c669e#diff-d951a5cd799ae841ffcc6b45598180dbR6497
12:04puredangercompleting takes a reducing function and adds the arities needed to make it transducer friendly
12:05bbloomhm ok
12:05puredangerin particular the "completing" arity (1 arg)
12:06Bronsapuredanger: why doesn't transduce automatically call completing anymore?
12:07puredangerthat cuts off cases where you actually want to do a closing action (like switching from transient to persistent)
12:07puredangerinto does this already, but example: (transduce xf (completing conj! persistent!) (transient []) (range 10))
12:08puredangerRich will be doing a talk on transducers at Strange Loop in a couple weeks and that will go on YouTube a few days after
12:10puredangerwe're heading towards a 1.7.0-alpha2 relatively soon but there are still more work in progress on a few other areas of transducers
12:10llasrampuredanger: Has Rich explained why these are going into core as new arities of existing lazy-sequence functions vs a new namespace?
12:10Bronsallasram: probably it's a "marketing" move
12:10puredangerRich believes these are fundamental and important and should be the base of core
12:10puredangerBronsa: not sure what that means
12:11mikerodpuredanger: There will be a talk? Now I'm sad I'm not goign to strange loop
12:11mikerodthankful for youtube
12:11mikerodSo does anyone have any insight on this:
12:11mikerodIs there any particular reason that the Clojure compiler does not propagate type hints from generic type information? e.g. (doseq [x (.getMyXs ^MyClass obj)] (.doXMethod x))
12:11Bronsapuredanger: having them in core makes it easier for people to use/discover as opposed to having them in a separate ns like reducers
12:12puredangerwe have not done it yet, but most of the existing sequences can be rewritten as (sequence (the-function …) coll)
12:12puredangerthere are some differences in evaluation but that will generally be a performance gain across the board. I'm not sure how far we'll go with that yet.
12:13puredangerBronsa: while reducers was/is considered "alpha", transducers is not going in with that caveat - we're committed to it as the direction
12:13mikerodI never realized reducers were alpha
12:14puredangerthey are (almost) the only thing still marked alpha
12:14mikerod,(doc clojure.core.reducers)
12:14clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.core.reducers>
12:15Bronsapuredanger: btw I ran into some weird behaviour with iteration + sequence/1 the other day, not sure if it's expected behaviour or not: http://sprunge.us/JYBI?clj
12:15puredangermikerod: do you mean "java generics" when you say generic type information?
12:15mikerodpuredanger: List<String>
12:15puredangergenerics are erased in the bytecode, so we don't know that
12:16mikerodThere are reflection libraries available that can find parameterized type information
12:16puredangerno interest in that, afaik
12:16mikerodUnless there is some stretch cases that is the issue - or I'm just wrong
12:16mikerodI figured it is just excessive and probably would just slow down compilation anyways if there were some reflection hacks to get the information
12:17tbaldridgemikerod: do .class files even contain such type information? I thought generics were purely a java compiler construct
12:17mikerodI just found the topic interesting and when we are doing Java interop stuff, people get confused when they have to type-hint again on the parameterized types
12:18puredangertbaldridge: they do not, although in some cases you can infer from bridge methods or use some weird constructs to make it recoverable
12:18mikerodtbaldridge: I've been reading around, it sounds like the Java compiler does include statically determined parameterized type information in the class files
12:18mikerodMaybe I'm wrong there. I guess I'd need to research that a bit more.
12:21puredangerBronsa: is identity a valid xf?
12:24Bronsapuredanger: dunno but that's not the point, you can replace it with (map inc) if you want, it was just to show that sequence/1 realized the first element while sequence/2 doesn't
12:31puredangerpuredanger: seems like it might be similar to the other ticket you had - as I understand it LazyTransformer is never going to be quite as lazy as lazy sequences as the machinery is push vs pull. the Stepper inside LazyTransformer is going to invoke the step fn earlier.
12:32mwfoglemanI have a list like this: (("test" "123") ("") ("bar"))
12:32tbaldridgeoh no....he's talking to himself now....
12:32mwfoglemanand am having trouble removing the lists that are empty, i.e. ("")
12:32mwfoglemanI would appreciate any pointers
12:32puredangertbaldridge: so lonely here in the basement :)
12:33ToxicFrogmwfogleman: but ("") isn't an empty list?
12:33mwfoglemanToxicFrog: yep
12:33mwfoglemani just partitioned a bigger list by the empty list
12:33ToxicFrogwhat
12:34hiredmanmwfogleman: ("") is not empty though, it is a list containing an empty string
12:34ToxicFrogYou said you wanted to remove empty lists, and then presented as an example a non-empty list
12:34ToxicFrogThis makes no sense
12:34mwfoglemanokay, i would like to remove any lists containing just an empty string.
12:34hiredman(remove #{'("")} foo)
12:35mwfoglemanoh boy
12:35mwfoglemanhiredman, thanks so much!
12:35mwfoglemani missed the #{} and the quoting
12:36Bronsapuredanger: I don't think it has anything to do with LazyTransformer, it looks like it's a limitation of how Iteration is implemented -- being Seqable as opposed to ISeq
12:36celwellDoes anyone here have experience with lein-bin, and specifically creating a Windows-compatible executable? I've got my uberjar working fine, but the executable that lein-bin produces is throwing this error in Windows "Program too big to fit in memory". I can't imagine an 8mb file is too big. My clojure code is only ~100 lines.
12:36ToxicFrogWait, there's a lein-bin?
12:36Bronsamaybe I'm wrong though
12:37celwellToxicFrog: https://github.com/Raynes/lein-bin
12:37ToxicFrogSweet
12:37ToxicFrogCan it cross-compile?
12:37celwellToxicFrog: "A Leiningen plugin for producing standalone console executables that work on OS X, Linux, and Windows."
12:38celwellI'm assuming that means a single file (I'm only getting one file)
12:38celwellI was wondering if the issue was that I needed to rename with .exe (but that didn't help)
12:38joegallocelwell: how much free disk space do you have?
12:38ToxicFrogcelwell: yeah, I'm not sure whether to read that as "produces one file that works everywhere" (which seems implausible since they use different executable formats), "produces three files, one for each OS", or "produces one file for the OS you are building on"
12:38arohnercelwell: there's also https://github.com/circleci/lein-jarbin, but that's explicitly not cross-OS compatible
12:39ToxicFrogOh, it looks like it emits a polyglot shell scripts
12:40ToxicFrog...which assumes that 'java' is in $PATH
12:40TimMcThe whole notion of cross-compilation baffles me because I would assume it to be the default.
12:40ToxicFrogSo no actual windows support, then
12:40clgvcelwell: that seems to create a file with certain preamble strings and the content of the jar file. how is that supposed to work?
12:40ToxicFrogclgv: the emitted file is both a valid Bourne shell script and a valid windows batch file
12:41TimMcJAR files keep their metadata at the tail of the file -- they're zip files.
12:41ToxicFrogWhen run, it invokes java and points it at the script file itself, which has the jar appended.
12:41clgvToxicFrog: ok. interesting
12:41ToxicFrogUnfortunately, this relies on 'java -jar foo.jar' actually working, so it won't work reliably on windows machines.
12:42clgvdidnt know you could have such scriptfile with embedded binaries
12:42ToxicFrogclgv: this is also how sharchives work.
12:43ToxicFrogsh/bash and cmd both read scripts line-by-line, which has some really unfortunate side effects if you edit the file while it's running, but means you can append arbitrary garbage to them and as long as they exit before reaching that point they'll work.,
12:43celwellToxicFrog: "java -jar foo.jar args" *is* working fine on my machine with the uberjar, but the lein bin script give that error.
12:44ToxicFrogcelwell: on your machine, yes. In my experience releasing clojure and scala programs on windows, you only have about a 50/50 chance of that working on any given windows machine, even if java is installed and double-clicking on jar files works.
12:44ToxicFrogSometimes it just doesn't get added to %PATH% for whatever reason.
12:44Bronsapuredanger: don't know if you caught it, but I updated the patch for CLJ-1224 as you asked :)
12:45ToxicFrogI would say "you can get around this by querying the registry to see where the jre is installed", but there's like four different possible places to look depending on what version of java the user installed, at least.
12:45ToxicFrogIt's kind of horrible.
12:45clgvcelwell: you are probably better off with something like "launch4j" - but no idea how to get that working with leiningen.
13:03clojure-newbhi guys, it seems it is not possible to use a case with ns referenced items… (case x mns/stsr1 ..) etc etc, is this correct ?
13:03clojure-newbit just seems to fall through to last clause
13:04ambrosebsclojure-newb: the left hand sides are literal symbols iirc
13:04ambrosebs'msn/str1 would trigger that case
13:04clojure-newbah, ok, I will have to use another mechanism to switch
13:04clojure-newbok I wlil try it
13:04clojure-newbthanks
13:05ambrosebsalso (case x (msn/stsr1) ..) should be identical behaviour
13:05clojure-newbthx
13:05ambrosebsif you need to dereferece a var on the left, use a macro that emits a case
13:09mpenetlvh: I am adding something pretty close to what you were describing yesterday to my lib, I didn't do a proper release it yet, but feedback is welcomed (it's in a branch)
14:04l1x_hi guys is there a way to get the fn name instead of this -> #<core$test_fn abc.core$test_fn@428640fa>
14:04l1x_the real name of my fn is test-fn
14:05joegallo,(println inc)
14:05clojurebot#<core$inc clojure.core$inc@cfec7c>\n
14:05joegallo,(println (meta #'inc))
14:05clojurebot{:ns #<Namespace clojure.core>, :name inc, :file clojure/core.clj, :column 1, :line 883, ...}\n
14:05joegallosee that name there?
14:06joegallootoh, this requires that you have a function in a var... and well, if you have the name of the var, then you don't need to figure out that name of the function, typically
14:07l1xwell i have a macro that does some stuff, and if i use ~name for the name of the function it returns the ugly version
14:08l1xthat is not really helpful, but i can expand it so I can use meta and combine it with a little deconstruction and voila
14:08l1xso thank you
14:10l1xwhat is the equivalent of #' in the macro syntax?
14:11aperiodicl1x: (var <symbol>)
14:12l1xamazing thanks!
14:16l1xhmm it works outside the macro but not in it
14:16aperiodicl1x: you're writing your macro wrong
14:16l1xno shit captain obvious!
14:16l1x:D
14:17l1xhttps://gist.github.com/l1x/79c9647b7a77efadd020
14:17aperiodichow are you using it?
14:20aperiodicalso, is this just to get experience with macros, or do you have plans to actually use this macro? it seems ill-motivated.
14:22amalloyl1x: #' works fine inside a macro
14:22amalloyyou're forgetting to call meta. vars aren't maps; they have metadata which is a map
14:25l1xamalloy: true! thank you
14:26danneu2anybody using https://github.com/magnars/prone? looks hot
14:28danneualso just upgraded cider for emacs from the old nrepl plugin. man, i was living in the dark ages compared to this
14:28amalloydanneu: that does look pretty cool
14:30seangrovednolen_: ping
14:30dnolen_seangrove: pong
14:30seangrovednolen_: Just checking if you've seen https://github.com/circleci/frontend
14:31seangroveI think it's now the largest open-source Om app, and it's actually used in production
14:31dnolen_seangrove: haven't seen it, that's cool!
14:32seangroveThey haven't blogged about it yet, but I'll tweet that they will to set a deadline ;)
14:32dnolen_seangrove: heh nice
14:35puredangerClojure/Conj talks here (on site soon): http://lanyrd.com/2014/clojure-conj/schedule/
14:37seangrovepuredanger: What, no video yet??
14:37lazybotseangrove: Uh, no. Why would you even ask?
14:37puredangerthanks, lazybot
14:37seangroveIt was a pretty good comeback
14:37arrdemahaha lazybot with the constructive comment
14:38seangrovepuredanger: I demand videos of the talk before they're even given. As a random person on the internet, I feel I am entitled to it.
14:38puredangerI'll add that to the list of things people on the internet feel entitled to
14:38puredanger;)
14:39puredangerafaik, we will be doing fast release to YouTube for the conj, like we did with clojure/west this year
14:39puredangerI'll be doing the same for Strange Loop too
14:40seangroveWow, that's fantastic. I was amazed at how quickly the clojure/west talks went up
14:40puredangerall it takes is paying people lots of money!
14:40seangroveAre you still able to recoup all the costs associated with recording when putting it on Youtube though?
14:41puredangerseangrove: no, it cost about $20k more
14:41puredangerfor strange loop that is (way more talks than clojure/conj)
14:42puredangerI do it for you, man
14:42seangroveWell, I certainly appreciate it :)
14:42amalloypuredanger is my hero
14:44Shayanjmtime to dust off this project again
14:44hyPiRionoh, you're doing that for strangeloop as well
14:45hyPiRionamazing
14:45arrdemShayanjm: wb
14:45Shayanjmthanks arrdem
14:45ShayanjmI tried reaching out to Google
14:45Shayanjmmultiple times
14:45puredangerwe will also have a live caption text feed from the main theater. not sure whether anyone will get use of that.
14:46Shayanjmbrick walls. No longer have a computational capacity bottleneck - now I have an API usage and money bottleneck lol
14:46amalloyholy smokes, puredanger
14:46arrdemShayanjm: haha solid
14:46aperiodicwow
14:47puredangerso you can watch Rich's talk live in text on Friday Sept 19th. that should be a fun time for the captioner.
14:47amalloywho's going to be transcribing? i can't imagine the set of people who can transcribe fast enough to keep up with a talk has much overlap with the set of people with enough clojure background to understand what words are being said
14:47hyPiRion(inc puredanger)
14:47lazybot⇒ 8
14:47puredangeramalloy: they take materials ahead of time to know vocal, etc
14:48puredangers/vocal/vocab/
14:48amalloy(inc puredanger)
14:48lazybot⇒ 9
14:48puredangerthey are pretty amazing actually. can do up to 300 words/minute
14:48Bronsa(inc puredanger)
14:48lazybot⇒ 10
14:48puredangerMAKE IT RAIN
14:48aperiodic(inc puredanger)
14:48lazybot⇒ 11
14:48arrdem(inc puredanger)
14:48lazybot⇒ 12
14:48puredangerI should say thanks to Two Sigma for sponsoring the feed! :)
14:49KneivaHow can I make jetty/ring listen to IPv6 addresses as well? This http://stackoverflow.com/a/7838876/1790621 hints that I might be able to do it by adding SocketConnector, but I don't have a clue how to achieve that with clojure. Is it possible through project.clj or some other way?
14:50johnwalker(inc puredanger)
14:50lazybot⇒ 13
14:55dbaschKneiva: how are you running Jetty? If it’s embedded, use the Java api: http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty
14:56borkdudeI've got an emacs-live question. When I upgrade to the newest version, which cider version should I have?
14:58amalloyi'm not sure anyone's ever gotten five karma in five minutes before
14:59puredangerthank you all :)
15:00Kneivadbasch: Umm, here is my project.clj https://www.refheap.com/89753
15:01dbaschKneiva: I assume you’re running lein ring server, which is not what you want to do in production
15:03Kneivadbasch: yeah, I'm running it with lein. But I don't think I'll be deploying this anywhere.
15:04johnwalkerborkdude: it should be 0.7.0
15:04johnwalkeradd to your profiles.clj [cider/cider-nrepl "0.7.0"]
15:04borkdudejohnwalker I thought so too. Even if I remove my entire clone and clone it over, it's still 0.6.0
15:04borkdudejohnwalker ok
15:05dbaschKneiva: see http://stackoverflow.com/questions/10289617/clojure-ring-jetty-i-am-using-lein-ring-server-how-do-i-configure-the-jetty
15:05johnwalkerwell, i assume thats the issue ;p
15:07Kneivadbasch: that might do the trick. I'll try that. thanks!
15:09borkdudejohnwalker hmm, when I add that, I get: Caused by: java.io.FileNotFoundException: Could not locate clojure/tools/namespace/find__init.class or clojure/tools/namespace/find.clj on classpath:
15:10johnwalkerdoes it look like {:user {:plugins [[cider/cider-nrepl "0.7.0"]]}} ?
15:11borkdudehttps://www.refheap.com/89754
15:11johnwalkerok, thats probably fine.
15:12johnwalkerare you on lein 2.4.3 ?
15:13borkdudeyeah, just upgraded
15:13johnwalkerdid you get this on lein 2.4.2 ?
15:14borkdudemy previous version was 2.3.4
15:14borkdudebut I also tried it on 2.4.3
15:14johnwalkerhmm
15:14TimMcpuredanger: I feel like I'd be less annoyed if videos were not made available at all, rather than late. I don't know why this is, though!
15:15TimMcIt's not particularly rational.
15:15johnwalkerok, well there's an issue with 2.4.3. try lein upgrade 2.4.2
15:15johnwalkerand that will solve a separate problem, but probably not this one
15:15borkdudek
15:15johnwalkerit's possible that there is interference somewhere
15:15johnwalkermove the cider-nrepl dependency to the beginning of your plugins vector
15:17borkdudejohnwalker that's it, the order of the plugins
15:17johnwalkergreat
15:18johnwalkeryes, this got me a while back too
15:18borkdudejohnwalker I'll just disable a bunch
15:18johnwalkeryou'll probably be fine with them present
15:18johnwalkerthe issue is that the first plugin that requires a certain dependency gets to pick its version
15:21borkdudejohnwalker when I connect from emacs to 'lein repl' it still says: CIDER 0.6.0snapshot (Clojure 1.6.0, nREPL 0.2.3)
15:21borkdudejohnwalker using the latest emacs-live
15:22johnwalkerhmm...i could have sworn they updated to 0.7.0
15:22johnwalkeri'll check, give me a second
15:23borkdudeI thought so too https://github.com/overtone/emacs-live/commit/01e2b4c7cc4216080cf942443075499b2c2bb96d
15:23danneuive made a lot of clojure websites where i write middleware that (binding [*current-user* (db/find-user-by-session-id _)] ...). what are yall doin for that sort of thing?
15:23danneui'm thinking of associng :current-user into the request on my next site
15:24johnwalkeryeah they're upgraded
15:24johnwalkerok, what happens when you do package-list-packages from emacs ?
15:24danneuim on CIDER 0.8.0alpha
15:25borkdudejohnwalker I checked that, it says cider isn't installed (via elpa)
15:25borkdudejohnwalker it just says "available"
15:26johnwalkerok, then there shouldn't be a problem there
15:26borkdudejohnwalker I also checked my elpa directory, no cider
15:27johnwalkeryou wouldn't happen to have a .emacs file, would you ?
15:28johnwalkerit might be interfering with init.el. but i think you would probably notice that
15:29borkdudenope, the only files starting with .emacs in my home dir are .emacs-live.el and .emacs.d (which points to emacs-live)
15:29borkdudeit also says Emacs live beta 24 when I start emacs
15:29johnwalkerok, when i cloned emacs live i also got CIDER 0.6.0snapshot
15:30borkdudemaybe it's something in cider, not printing the right version?
15:30borkdudecider-version
15:31johnwalkerwell, emacs live is using ac-nrepl instead of ac-cider
15:32johnwalkerso ...
15:32johnwalkerit might be a better idea to use emacs prelude
15:32johnwalkerit's basically the same thing minus the dancing text
15:33johnwalkerbut you haven't done anything wrong in setup
15:33johnwalkerso in summary, clone this https://github.com/bbatsov/prelude
15:34johnwalkerthen get the release version of cider https://github.com/clojure-emacs/cider/releases
15:34johnwalkerand everything should work
15:34borkdudethanks.
15:34borkdudeI'm not sure if I want to change my setup right now
15:34borkdudebut maybe later
15:35johnwalkeri understand. you're welcome
15:35borkdudeI think I'm using the "stable" packs which are old? https://github.com/overtone/emacs-live/tree/01e2b4c7cc4216080cf942443075499b2c2bb96d/packs/stable
15:38borkdudethat's it
15:39johnwalkerahh nice
15:45bridgethillyerUh, the Conj lineup looks Amazing
15:45technomancy^ for the record, this is why I've stopped recommending the starter kit and things like it
15:45technomancyrandom breakage happens with no way to debug
15:46borkdudetechnomancy emacs prelude is different from that?
15:47technomancyborkdude: they're all the same, emacs-live, prelude, starter-kit
15:47technomancyhttps://github.com/technomancy/emacs-starter-kit/blob/v3/README.markdown
15:47borkdudetechnomancy ok, no reason to switch then :)
15:47technomancywell, switch away from a one-size-fits all to creating your own config
15:48technomancyswitching from one starter kit to another doesn't solve much
15:53johnwalkertechnomancy: borkdude well, thats true. but prelude is maintained by bbatsov
15:54TimMcI've switched to mining things from technomancy's dotfiles.
15:54TimMcand versioning like whoa
16:01Jaoodtechnomancy: you starter-kit is very helpful to start ;)
16:02technomancyit's a crutch
16:02Jaoodis simple and easy enought to grok quickly and all documented in one page
16:03Jaoodfor beginners anyway
16:03tuftpuredanger: found a bad auto correct in description of "Persistent Data Structures for Special Occasions:" "... after all, the built-in sweet of persistent data structures ..." or maybe it's (sic)? ;)
16:03puredangerwhere?
16:04clojurebotwhere is log
16:04Jaoodtechnomancy: yeah, people should just copy paste from it what they like, not just insert the file and load it
16:04technomancyJaood: hm; you mean better-defaults? emacs-starter-kit is not documented at all.
16:04amalloyclojurebot: forget where |is| log
16:04clojurebotI forgot that where is log
16:05Jaoodtechnomancy: oh yeah, was referring to better-defaults
16:05tuftpuredanger: s/sweet/suite/ i assume
16:07amalloydevn: did you have any success setting up swank?
16:07puredangertuft: yes, will fix
16:07Jaoodtechnomancy: just saw you updated it recently :)
16:08tuftpuredanger: cheers! i'm super excited about the lineup
16:08technomancyJaood: yeah, this is like the anti-starter-kit =)=
16:09puredangertechnomancy: fwiw, the old actual starter-kit was exactly what I needed when I needed it. I was sorry to see it had gone the last time I looked
16:10technomancypuredanger: we get confused people in the #emacs channel all the time from it. sometimes it works the way it should, but when it doesn't, it's a mess.
16:10technomancy*from it and things like it
16:10puredangeryeah, I understand the reasoning
16:10arrdempulling apart emacs-live to get the bits I wanted was... interesting when I was getting started.
16:11puredangerI only touch my emacs config every 3 years or so
16:11technomancymost of it is spun off into individual packages that focus on doing only one thing well. for the rest, the parts that can be done cleanly live on in better-defaults.
16:11Sindywww.superonline.eu
16:17SagiCZ11how do i tell lazy/clojurebot to give me a link to this channels history please?
16:17mbriggshey guys, is there any way to have a timeout on a blocking read from a channel in core.async? ideally, would like to say "if read takes more then 30s, die with an exception"
16:17amalloyclojurebot: lazy-logs is http://logs.lazybot.org/
16:17clojurebotAck. Ack.
16:19SagiCZ11amalloy: im not sure thats what i wanted. ^^
16:19amalloyuhhh...yes it is? click through to #clojure and then to today's date
16:20SagiCZ11well.. i meant if there is a command for the bot to give me the link.. which i keep forgetting.. something like ",logs"
16:20amalloy~lazy-logs
16:20clojurebotlazy-logs is http://logs.lazybot.org/
16:20SagiCZ11yes thats it.. thank you amalloy
16:21amalloyi didn't make it just ~logs, because that's chouser's logging service. that appears defunct now though, so maybe i should
16:22dmitrygusevwhy is (= :a (symbol ":a")) -> false, but (= (symbol ":a") (symbol ":a")) -> true ?
16:22amalloybecause :a is a keyword
16:23dmitrygusevthanks
16:23dmitrygusevjust figured it out by passing to (type …), right after posting here as it usually happens
16:24puredangeryeah
16:24amalloyasking for help is the best way to figure things out youself
16:24puredangerheh, wrong window
16:24amalloybecause, if you put in the effort to actually ask a good question, you end up thinking more about it
16:24amalloy(and if you don't put in that effort i hate you)
16:24tbaldridgedmitrygusev: notice though that if you include the : you're probably not getting what you expect
16:25tbaldridge,(keyword ":foo")
16:25clojurebot::foo
16:25ToxicFrogmbriggs: you can probably do something with mix + timeout, but I don't think there's a first-order way to do it
16:25dmitrygusevtbaldridge: yep, thanks for mentioning that
16:25mbriggsToxicFrog: thanks
16:26tbaldridgembriggs: I've seen people try that combined with hard killing a thread, but who knows what that does to the JVM ;-)
16:28puredangertbaldridge: BAD THINGS :) like release all monitors.
16:32joobusis the JVM/Java/Clojure a memory hog? I notice lein repl is taking up ~700mb on my laptop.
16:33technomancyjoobus: that's two JVMs, but the answer is still yes.
16:33arrdemdefine "memory hog" when we live in an era of 120Gb ram dev machines..
16:33puredangerthe JVM will take all the memory you're willing to yield to it :)
16:33tbaldridgejoobus: rule #1: when complaining about memory usage, make sure you're not measuring spare memory the GC keeps sitting around
16:33tbaldridgei.e. don't measure via top...use a JVM profiler.
16:34joobusthanks for the answers :)
16:34technomancyjoobus: using UTF-16 for the internal string encoding means it's gonna slurp up a lot more memory for text-heavy workloads.
16:35joobusi'm new to JVM land. does this ever become a problem? i've been using python, c#, javascript mainly to this point in my career.
16:36technomancythe answer, as usual, is "it depends" =)
16:36hiredmanI've never seen it be a problem
16:37tbaldridgejoobus: I used to do a fair amount of C#. In my experience C# is much more eager to release memory to the OS that it may need again soon. The JVM tends to prefer keeping memory around, assuming if you've used 700MB in the past you'll probably use that much again soon.
16:37TimMcJust don't give it too much memory if GC pauses are a problem for you.
16:37tbaldridgejoobus: and by C# I mean the .NET runtime....
16:37joobusand by c# I mean mono :)
16:38hiredmanI've certainly done profiling etc of apps using too much memory and having to tune them and change how things are done to avoid using so much memory, but you do that anywhere
16:38tbaldridgejoobus: oh that's a completely different beast then
16:38joobusyes, it is a beast
16:38technomancymono and .net are designed for server side and client side usage
16:38tbaldridgejoobus: but the JVM GC is insanely advanced. Last I checked the mono GC had what...4-5 options? The Oracle JVM has about 200 just for GC tuning.
16:38hiredmanyou can just tell the jvm what max heap size it should use, and it won't use more
16:39dagda1_is there anyway I can use apply when the argument is not a vector or is that it should always be a vector
16:39TimMc&(apply + 1 2 (range 10))
16:39lazybot⇒ 48
16:39amalloytbaldridge: really, .net returns memory to the OS? i thought most runtimes don't really do that. like i know that (as you say) java doesn't, and most C malloc/free thingies don't...
16:39technomancyjoobus: it's hard to give a good answer without knowing what you're using it for
16:39technomancydifferent runtimes are good for different things
16:40tbaldridgeamalloy: IDK, back when I was doing .NET development, I would often see memory returned to the OS after about 30 sec.
16:40tbaldridgeamalloy: or you could force it at anytime via a full collection.
16:40joobustechnomancy: i know my question was general. i liked all the answers i've gotten. thank you guys.
16:40TimMcdagda1_: ^
16:40amalloywell, today i learned
16:41dagda1_TimMc: but it won't work without the range
16:41dagda1_TimMc: or do you man (apply + 1 2 '())
16:41TimMcdagda1_: Ah, you are asking a different question, then. (range 10) is not a vector, you see...
16:42dagda1_TimMc: Ok, I mean not a sequence
16:42TimMc*collection :-)
16:42TimMc~seqs and colls
16:42clojurebotseqs and colls is http://www.brainonfire.net/files/seqs-and-colls/main.html
16:42TimMcBut sure, you can do ##(apply + 1 2 [])
16:42lazybot⇒ 3
16:43hiredmanapply with the collection at the end is just a function call
16:43hiredman,(+ 1 2)
16:43clojurebot3
16:43hiredmanwithout
16:45mdeboardAny StrangeLoop attendees this year managed to sort out how to export the schedule?
16:50dagda1_TimMc: when I use reduce with apply, the return of the apply might be a collection or not (reduce #(apply %2 %1) [1 2 3 4] (reverse [zero? #(mod % 8) +])
16:50puredangermdeboard: there is a program at https://thestrangeloop.com/system/resources/BAhbBlsHOgZmIi4yMDE0LzA4LzMwLzIyXzIzXzM2Xzc1NF9TTDIwMTRQcm9ncmFtLnBkZg/SL2014Program.pdf
16:50puredangerthe obvious place to look
16:50mdeboardpuredanger: Oh hey, I tweeted at you a few ago, I guess that can be safely ignored
16:51puredangermdeboard: is that what you're looking for, or actual data?
16:51mdeboardpuredanger: Well last year there was a button to be able to export to iCal or Google Calendar
16:51mdeboardIt was awesome because my coworkers & friends & I could coordinate
16:51mdeboardLike I had a StrangeLoop 2013 calendar I shared with them
16:59SagiCZ11so arrdem earlier advised against using untyped tuples (vectors) as a 2D point representation, what could i use instead? i come from java so dynamic languages are scary
17:00TimMcdagda1_: nil is also a valid final arg to apply, by the way
17:00arrdemSagiCZ11: unless there's some benefit derived from using the Point2D class, just go with an {:x Num :y Num} map.
17:01arrdemyou can always trade up to a record if you need it, but going to a record from a vector or a class isn't so clean.
17:03SagiCZ11yup.. i was kinda inclined to using maps.. i just think they are little too wordy.. i mean its obvious that the first number is x and the second y, why state the obvious..
17:04arrdembecause that order is a convention not an absolute
17:04SagiCZ11maybe i could make a function
17:04SagiCZ11,(defn point [x y] {:x x :y y})
17:04arrdemwhat does the pair [1, 1] mean?
17:04clojurebot#'sandbox/point
17:04SagiCZ11,(point 4 5)
17:04clojurebot{:x 4, :y 5}
17:05arrdem^ right. my point. the _convention_ is [x y z? ...]
17:05amalloyarrdem: if i saw a pair and was told it's a coordinate, i'd assume [y x], not [x y]
17:05arrdemSagiCZ11: amalloy makes my point for me :P
17:05amalloy(oriented such that the top-left is [0 0]
17:05amalloy)
17:05SagiCZ11amalloy: what? seriously? what school did u go to?
17:06hiredmanamalloy: really?
17:06SagiCZ11it was always x,y,z,t
17:06arrdemSagiCZ11: if there's a symbolic meaning to a value, it should be a mapping from symbolic values to concrete values.
17:06ephemeronSagiCZ11, arrdem: vectors are not a good fit, but maps are very much unnecessary; however, this is only true depending on the purpose of the Point here.
17:06arrdemthe ordering [x y z? t?] is incidental not abstract.
17:06amalloySagiCZ11: obviously for like, graphing something, it would go [x y]. but for accessing a 2d array, you have rows and then columns, and (get-in m [y x]) gets you where you want
17:06aperiodicSagiCZ11: but the way coordinates are frequently represented (vector of vectors, row-major) it's more convenient to have the y coordinate first
17:07SagiCZ11amalloy: oh.. ok im talking about geometric points here
17:07SagiCZ11ephemeron: thats the conclusion to which i got too.. maps are too much, vectors are not enough, what to choose then?
17:07hiredmanah
17:07arrdemjust go with the map, I suspect you'll find it's not actually too much.
17:08ephemeronSagiCZ11: Au contraire! Vectors are also too much. You do not need variable length.
17:08arrdemephemeron: clj-tuple?
17:08amalloyephemeron: are you seriously about to recommend a deftype?
17:09hiredmanI was actually grappling with some of this over lunch, I have a graph in a derby database and I want to run page rank on it, but I didn't want to pour the graph in to a matrix first, so I was poking at writing a core.matrix implementation backed by tables in derby
17:09ephemeronamalloy: No, just an array.
17:09TimMcSagiCZ11: I think it's gross to use [y x], personally.
17:09amalloyephemeron: gross
17:09SagiCZ11TimMc: yup
17:09amalloyarrays are also too much. you do not need mutability
17:09TimMcamalloy: How about a Long and some bit-shifting?
17:10hiredmanif you wait a bit you'll be able to use of ztellman's specialized small size vectors
17:10amalloyTimMc: even your strawman is better than an array
17:10SagiCZ11btw guys, i am not trying to achieve light speeds here.. the optimization is not a factor, i just need the code to look somewhat ok
17:10TimMcImmutable, and it's probably even more traditional than [y x] pairs!
17:10arrdemTimMc: what makes you think that all interesting points can be encoded in 64 bits?
17:10hiredmanyou could just use clj-tuple now I guess
17:10ephemeronSagiCZ11: If performance is not a problem, vectors are fine,
17:10SagiCZ11(doc tuple)
17:10clojurebotexcusez-moi
17:10arrdem$google clj-tuple
17:10lazybot[ztellman/clj-tuple · GitHub] https://github.com/ztellman/clj-tuple
17:10TimMcarrdem: Ah, will you recommend a vector of Bignums? :-)
17:10ephemeronand as you can gleam from amalloy's reaction, more acceptable in Clojure-land.
17:10SagiCZ11ephemeron: better than maps?
17:11hiredmanobviously clojure needs a complex number type that people can abuse to represent points
17:11ephemeronSagiCZ11: You can use maps if you want, but they become bulky as soon as you want matrix-like operations.
17:11arrdemTimMc: I'm still standing firmly behind a Map Keyword Num.
17:11ephemeronIf you don't, just go with maps and enjoy the associativity.
17:11SagiCZ11ephemeron: not sure if would be sticking the points in matrix.. so map it is probably
17:12amalloyi'm with arrdem: unless it's totally clear from context what coordinate system you're using, a map is a good plan
17:12TimMcarrdem: Clearly I was actually recommending stuffing two floats into the long.
17:13arrdemlol @ 32 bit floats
17:13amalloy(inc TimMc)
17:13lazybot⇒ 66
17:13arrdemthat's cute get a real ISA.
17:13SagiCZ11my coordinate is weird in the sense that the y axis is pointing down.. swing Graphics2D
17:13SagiCZ11still referring to it as [x,y] though
17:13arrdem(inc amalloy) ;; he called it
17:13lazybot⇒ 164
17:13arrdem$karma technomancy
17:13lazybottechnomancy has karma 134.
17:14amalloySagiCZ11: if y is pointing down (ie, origin is top-left), [x y] is a really weird way to refer to it
17:14amalloylike, swing takes y x, doesn't it?
17:14SagiCZ11heck no
17:14SagiCZ11always x,y
17:14amalloyhuh, i guess it does
17:14arrdemTimMc: what if I wanted to do navigation to Alpha Centauri? 32 bits just won't cut it all the time man...
17:14hiredmanI think swing uses Diemenson objects
17:14amalloyi guess origin is bottom-left, for swing
17:15SagiCZ11Point2D.Double(double x, double y) 
17:15amalloyso x y is...fine? but really a map is more clear
17:15SagiCZ11k i will use the map
17:15SagiCZ11but use a simple function for creation
17:15amalloyit's been so long since i used swing
17:15SagiCZ11,(point 2 6)
17:15clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: point in this context, compiling:(NO_SOURCE_PATH:0:0)>
17:15SagiCZ11oh whats the timeout on user defined clojurebot symbols?
17:16amalloynot very long. like five minutes
17:16amalloyi don't really recommend def'ing anything
17:16SagiCZ11good to know
17:29amalloydoes clojure ever use unboxed booleans? i thought it did, but even stuff like (if true 1 2) compares against Boolean/FALSE
17:32mdeboardamalloy: What is an unboxed boolean? Google doesn't give any helpful (for me) results
17:32amalloymdeboard: the jvm primitive boolean, rather than a Boolean container object
17:32mdeboardAh I see
17:32Bronsaamalloy: (if (.foo bar) .. ..) should avoid boxing assuming the .foo method returns a unboxed boolean
17:33dbasch&(type false)
17:33lazybot⇒ java.lang.Boolean
17:35Bronsaamalloy: http://sprunge.us/DFME
17:35amalloyBronsa: ah, indeed. and even (if (or (.foo bar) (.foo baz)) ...) avoids boxing. but = returns a Boolean, so if you do any interesting logic clojure-side you can't get much done without boxing
17:36Bronsaamalloy: there are some intrinsics that should help
17:36Bronsaamalloy: http://sprunge.us/TOUO?java
17:36amalloyhm, so there are. i wonder what's wrong that this code isn't triggering those
17:39arrdempuredanger: ping
17:42mdeboardarrdem: Are you going to elixir meetup tonight by chance
17:42arrdemmdeboard: I wasn't aware of it. what time/when?
17:42mdeboard6p at uh
17:43mdeboardhttp://www.meetup.com/Austin-Elixir/events/199476082/?a=cr1_grp&amp;rv=cr1&amp;_af_eid=199476082&amp;_af=event
17:43mdeboardI have no idea where or what Mister Tramps is
17:43arrdemlol mr tramps
17:44mdeboardoh man that's kind of up there, relatively speaking
17:44mdeboardThey just changed time & locale yesterday, I hadn't looked them up
17:44arrdem:/
17:45arrdemthe supercomputer team is meeting... now and it's Warmachine night at Dragon's Lair so I doubt I'm gonna make it.
17:45mdeboardWarmachine night at the what's what
17:45arrdem$google dragon's lair austin tx
17:45lazybot[Austin, TX - Dragon's Lair Comics & Fantasy Austin] http://dlair.net/austin/
17:45danielcomptonarrdem: what does the supercomputer machine team train for?
17:45arrdem$google warmachine privateer press
17:45lazybot[WARMACHINE | Privateer Press] http://privateerpress.com/WARMACHINE
17:45mdeboardWarmachine to me is the guy who almost beat a porn star to death a few weeks ago
17:46mdeboardNot that there's any relevance to Clojure.
17:46arrdemyeah this is solidly -offtopic material
17:46Ceterizine|WorkUh
17:47arrdemdanielcompton: http://www.hpcwire.com/2013/11/25/sc13-student-cluster-competition-results/ that's us from last year.
17:48arrdemdanielcompton: we won in 2012 and there's more material from then too.
17:48danielcompton arrdem do you only build the machine or code for it too?
17:49danielcomptonarrdem: not that building a supercomputer isn't enough
17:49arrdemdanielcompton: we pick the parts, Dell ships em, we assemble and then we run for the most part existing scientific codes. only in the last year have we _had_ to write original code as part of the contest
18:06lavokadhi, when i modify for expample this (GET "/index.html" [] (layout/index-html)) in routes dir, I have to restart the server...
18:07lavokadmodifying files with in models dir, views etc, after recompiling, changes are reflected without restarting the ring server
18:07lavokadbut not routes
18:07lavokadcan anyone explain a bit what is happening
18:18aperiodiclavokad: are you wrapping your handler with ring's reload middleware?
18:21lavokadgosh, aperiodic I don't know I started playing yesterday with all this ring/compojure/hiccup stack
18:21lavokad:)
18:21lavokadcan I check it somehow>
18:21lavokad?
18:22dbaschlavokad: post some code e.g. a refheap / github link
18:56danneulavokad: require [ring.middleware.reload :refer [wrap-reload]] and then add wrap-reload to the middleware chain
19:06lavokaddanneu: ty!
19:09danneulavokad: i just started hacking together a website today https://github.com/danneu/bulletin that uses it
19:21aperiodicarrdem: why aren't the "see also" sections of grimoire hyperlinks??
19:21lazybotaperiodic: What are you, crazy? Of course not!
19:22cbp~python
19:22clojurebotpython is ugly
19:28tac_lol
19:28tac_~python
19:28clojurebotpython is "I think dropping filter() and map() is pretty uncontroversial…" — GvR
19:28tac_hehe
19:29tac_~java
19:29tac_aww :(
19:30tuft_woah, did he say that? heh
19:31tuftwow, he did http://www.artima.com/weblogs/viewpost.jsp?thread=98196
19:31tac_"I expect tons of disagreement in the feedback, all from ex-Lisp-or-Scheme folks. :-)"
19:31tac_You just wouldn't understand tuft....
19:34tuftah yes, accumulation loops are much more readable than reduce.
19:35aperiodictuft: you sound just like on of those "ex-Lisp-or-Scheme folks"
19:35tac_He's in too deep. He'll never understand what it's like to be a Practical Programmer ever again
19:36tufti guess that's what a benevolent dictatorship does to your brain
19:37joobusthe breaking changes from python 2.x to 3.x are what turned me off of python
19:37tufthaha, good point
19:38tac_Isn't that a good thing that you can put your foot down, man up, and admit at least a few of your mistakes?
19:38tac_Python 3 took courage
19:38tac_that few people have today
19:38TEttingerI'm a bit curious about Hy, since I've heard it described as Clojure-is-to-Java as Hy-is-to-Python
19:39tbaldridgeTEttinger: not exactly,
19:39tbaldridgeHy is way closer to python than Clojure is to java
19:39TEttingeroh ok
19:39tbaldridge"mutate all the things!!!!"
19:39tbaldridge:-)
19:39tufti can tolerate python perfectly fine -- write it for a living going on two years
19:40tbaldridgetac_: I think the push-back from the community shows that the things that were claim to be in need of fixing weren't so much...
19:40tac_I once believed strongly in immutability
19:40arrdemaperiodic: at present those are hand-written, the next release should help fix that but may be delayed
19:40tac_but one day, that all... changed.... (get it!??)
19:40arrdem$google clojure-grimoire var-link
19:40lazybot[var-link 0.1.0 - Clojars] https://clojars.org/org.clojure-grimoire/var-link
19:40joobusat work I use twisted which is/was a huge library for python, and py3 just broke it, so now one has to pick whic flavor of python to use, and if one wants to use twisted, one is knowingly picking a phasing-out variant.
19:40technomancytbaldridge: to me it indicates that people value working legacy code more than they value cleanliness
19:41tac_tbaldridge: It's the same as with any business, don't you think?
19:41arrdemaperiodic: it's one of those things in the Grimoire infrastructure that's designed badly around handling clojure.core documentation and isn't generally applicable.
19:41TEttingertechnomancy, yeah I'd think the working part could be emphasized :)
19:41tac_Once you get large enough, it becomes harder and harder to make any meaningful changes to the way you do things
19:42tac_Python just wanted to feel like a start up again. Like a young, cool language again.
19:42bounbinteresting. i didn't know about Hy
19:43aperiodicarrdem: ah, ok. I realize now that clojuredoc's all came from manual work as well
19:43tbaldridgewell that's the problem with breaking any sort of backwards compatibility, you break things. The more "things" you have the worse it will be.
19:43arrdemaperiodic: I mean.. I have a somewhat larger dataset now, issue is that I'm pulling references both from clojuredocs, thalia and my own additions.
19:43tbaldridgeFor that matter I now wish we could re-write lazy-seqs in terms of transducers...but that'd break enough stuff, I don't think it'd be worth it.
19:43arrdemaperiodic: actually kinda screwed ATM because I'm working on what amounts to a schema migration over a filesystem
19:44arrdembut whenever I manage to roll the next release those should be real links.
19:44tac_tbaldridge: Even though the community is still split, in the long-long run, I wouldn't be surprised if it turned out to be a good decision.
19:44Bronsatbaldridge: maybe for clojure 2.0 :)
19:44aperiodicarrdem: a schema migration on schema-less data?
19:44tbaldridgetac_: perhaps...but then there are other people who are calling for a fork instead
19:44tac_Major projects will accomodate and begin supporting python 3. Projects which don't will just die out slowly over time.
19:45tac_considering how similar the languages are, a fork seems even more frivolous than the change itself :)
19:46arrdemaperiodic: it's totally schema'd.
19:46arrdemhttp://grimoire.arrdem.com/API
19:47tbaldridgeBronsa: I seriously doubt Clojure 2.0 will break anything major (even if 2.0 were a thing, which it's not...)
19:47arrdemhttp://grimoire.arrdem.com/api <- real link
19:50tufthah, hy is neat. great lisp machine stylings on the "try it" web repl http://try-hy.appspot.com/
19:50Bronsatbaldridge: if it doesn't break anything major than it's going to be another clojure 1.x, not 2.0 -- but I was half joking
19:55ken77hi! i'm adding Friend with my Compojure app. i want my registration (ajax post to /register) to also log in the user. is there an easy way to log in from the server side, without a separate post to /login?
20:13celwellWhy do I sometimes see "clojure.core.reducers/map" in projects? Shouldn't it just be "map"? I thought "map" is part of core?
20:14hiredmanwhat you think of as just "map" is actually clojure.core/map, global names are namespaced in clojure
20:15celwellclojure.core/map would make sense to me but I said clojure.core.reducers/map
20:15hiredmanclojure.core.reducers/map is a different function named map in the namespace clojure.core.reducers
20:15TEttinger(doc clojure.core.reducers/map)
20:15clojurebotI don't understand.
20:16TEttinger,(doc clojure.core.reducers/map)
20:16clojurebotCool story bro.
20:16hiredmannamespaces are spaces for names, so while in a single namespace you can only have one map, each namespace can have a different definition of the name map
20:16TEttingerthat's a bit odd
20:16TEttingerwhy doesn't clojurebot get the doc for that?
20:16hiredman,(require 'clojure.core.reducers)
20:16clojurebot#<FileNotFoundException java.io.FileNotFoundException: Could not locate clojure/core/reducers__init.class or clojure/core/reducers.clj on classpath: >
20:16TEttinger,(doc core.reducers/map)
20:16clojurebotHuh?
20:16hiredmanor whatever
20:16hiredmanthe namespace isn't loaded and the sandbox won't let you load it
20:17TEttingerok
20:33xulferWhat's the best practice for desktop notifications these days ? (Think Growl, and so on). It seems like the whole TrayIcon displayMessage stuff doesn't work on some platforms these days.
20:35TEttingerxulfer, do you want cross-platform?
20:36xulferYes if possible.
20:42TEttingerthere's a list here, xulfer http://alternativeto.net/software/growl/
20:43TEttingerbut none are cross-desktop-platforms
20:43TEttingersnarl seems good for windows, even has gradle integration
20:44TEttingerthat said, these all need something installed by the user to work
20:44xulferhm seems strange
20:45xulferI'm surprised Java doesn't have something to just use the native notification stuff. Which I thought this displayMessage method integrated with but apparently not.
20:49xulferTEttinger: Thanks for the tip anyway. I guess I'll have to use the conditional lein stuff to support multiple platforms?
20:49TEttingerwell there was one for swing....
20:50TEttingerhttp://www.swingfx.ch/ GPL license may be rough
20:50xulferBlah. Yeah.
20:51xulferEven using growl on OS X seems a bit hawkish. Since it's used native notifications for some time now...
21:25bacon1989does anyone here have experience with clojurescript's :advanced compilation?
21:25sdegutisThanks in advance.
21:25bacon1989whenever I compile it, it doesn't create the ./out/ folder, as described
21:27bacon1989as in this comment https://github.com/clojure/clojurescript/wiki/Quick-Start#using-clojurescript-on-a-web-page, shouldn't it be generating a /out/goog, folder when I run lein cljsbuild once?
21:28hiredmancljsbuild is its own thing beyond what clojurescript's compiler does
21:28hiredmanI would checkout out the docs for cljsbuild
21:28bacon1989hiredman: I have, it says it creates itself automatically
21:29bacon1989that there should be a goog/ folder, with base.js in it
21:29tac_Is clojurescript sufficiently different from clojure to warrant a separate name?
21:29hiredmanyes
21:30hiredmanbacon1989: where do you see that? from what I have seen advanced compilation results in one file spit out to disk
21:31bacon1989hiredman: you need to include :output-dir, if i'm not mistaken
21:31hiredmanwhich is all I see in all the examples in the cljsbuild readme, they all show giving a single file as the output
21:31bacon1989hmm
21:32hiredmanbacon1989: https://github.com/emezeske/lein-cljsbuild/blob/master/sample.project.clj#L116 says that is temporary file storage, so my guess is the compiler deletes it when it is done
21:33bacon1989so, does that mean I need to go and grab google closure myself?
21:33bacon1989not that it's a big deal, I figured this would be automated though
21:34bacon1989considering it's using the same compiler to generate my code...
21:34bacon1989(or shrink it, i mean)
21:34hiredmanbacon1989: what do you mean by that?
21:35hiredmanbacon1989: advanced mode compilation does a whole ton of things including tree shaking, which removes any unused code
21:36bacon1989yeah, but i'm automaticaly referencing goog libraries within my code
21:36bacon1989goog clojure is already being used, and the example states that I need to require some extra scripts
21:36bacon1989like seen here https://github.com/google/closure-library.git
21:37bacon1989woops, here https://github.com/clojure/clojurescript/wiki/Quick-Start#using-clojurescript-on-a-web-page
21:37bacon1989in fact, the link above it is what I need
21:37bacon1989but somehow, my code is getting all of the google base.js files compiled into it, and :advanced separates that out
21:38hiredmanbacon1989: my understanding is the closure library is actually delivered in peices and clojurescript only uses some of it, which might explain why some component you are trying to use isn't available
21:39bacon1989no no, the setup requires that I use 'goog/base.js', which acts like a dispatch to grab any dependencies i'd use in my code
21:40hiredmanwhat are you trying to do and what isn't working?
21:40bacon1989I want to use :advanced compilation, what isn't working, is the auto-generation of goog/ within my output folder, which it claims it does automatically
21:41bacon1989i'm wondering if these claims are true, and if someone has an example? all of the examples i've seen don't seem to make any sense
21:41hiredmanbacon1989: the config file I linked you said that is for tmp files, so it is likely deleted when the compiler is done with it
21:42hiredmanbacon1989: why do you need a goog/ in your output folder?
21:42hiredmanadvanced mode compilation includes the code from any closure library you use in the single file it outputs
21:42bacon1989well, the impression I was given, is the advanced compilation separates the goog dependencies out into the google closure library, so I need to treat my library as a separate module
21:43bacon1989are you sure?
21:43hiredmanyes, the closure compile is a whole program optimizer
21:45bacon1989hiredman: i'm pretty sure that's for :simple compilation though
21:45hiredmanno
21:45hiredmanif anything simple is the mode that would give you multiple files
21:46bacon1989hiredman: simple works fine as a single file
21:46hiredmanadvanced inlines code and renames all the functions to have short names to compress the code size
21:46hiredmanbacon1989: sure, but it would also likely work as multiple files, but due to all the renaming advanced mode does it only makes sense as a single unit of code
21:47hiredmanafter advanced mode is done with it, it doesn't make sense as multiple modules
21:49bacon1989hiredman: it isn't 'multiple modules,' it's a single file that needs to be 'required' using goog/base.js
21:50bacon1989so goog holds the google closure library, and it 'requires' my library within it's ecosystem
21:50hiredmanbacon1989: oh, are you trying to build a redistributable library?
21:51bacon1989hiredman: not even, i'm just trying to reduce the size of my javascript file
21:51bacon1989but when you do advanced compilation, it's supposed to generate the ./goog folder with the google closure libraries
21:52hiredmanbacon1989: it isn't
21:52bacon1989hiredman: just look at this, please explain this https://github.com/swannodette/om#using-it
21:52bacon1989look at the <html <script tags
21:52bacon1989and see what it's doing with goog/base.js
21:53bacon1989and see how it's 'requiring' it?
21:53hiredmanso?
21:53clojurebotso is (add-to-list 'erc-keywords '("\\bso\\b" erc-default-face))
21:53hiredmanbacon1989: nothing in there mentions goog/
21:53bacon1989<script src="out/goog/base.js" type="text/javascript"></script>
21:53hiredman«This will generate a single file main.js. Your production markup should look something like this:»
21:53bacon1989<script type="text/javascript">goog.require("main.core");</script>
21:54bacon1989fucking look at it, it is using goog.require to 'require' the main.core namespace
21:54hiredmanbacon1989: yeah, with :optimizations :none
21:54hiredmanyou are looking at the developement setup
21:54bacon1989ugh
21:54bacon1989idk what i'm doing wrong then
21:55bacon1989when I compile and run my file, it says 'foo is not defined'
21:58bacon1989oh, here's a good question, does it not ^export when I choose advanced compilation?
22:03bacon1989I think I figured it out
22:04bacon1989since i'm not calling some of my functions (since it's a library), the advanced compilation is aggressively removing them from my library
22:09mynomotobacon1989: you need to ^export everything in the public api.
22:10bacon1989mynomoto: is this good enough? https://github.com/benzap/flyer.js/blob/master/src-cljs/flyer/wrapper.cljs
22:11bacon1989they don't appear to be showing up for some reason
22:13bacon1989I keep getting 'flyer is not defined' when I try and used the advanced build
22:13mynomotobacon1989: it's ^:export iirc
22:14mynomotobacon1989: Have you changed ^export to ^:export ?
22:14bacon1989mynomoto: omg, thank you so much
22:14maravillasit is a little awkward, but thankfully i've never had rsi issues with it, somehow
22:14maravillaswhoops
22:15bacon1989hiredman: thank you for dealing with my insanity
22:15bacon1989that did the trick, the library is now going to be like an order of magnitude smaller
22:15bacon1989fucking magical
22:16mynomotobacon1989: np
22:16bacon1989oh bummer, some things still aren't working, but i'm sure I can work them out
23:10joobuscan someone explain this, from here: https://github.com/viebel/clojure-koans/blob/master/src/koans/destructuring.clj
23:11joobusthis part: (fn[[a b] {:keys [street-address city state]}]
23:11joobusdoes the :keys map to the keywords declared above?
23:13arrdemyes. the :keys part will expand to the bindings {street-address :street-address, city :city, state :state}, which will capture those keywords to the "equally" named local symbols.
23:14joobusso :keys is a special kind of key? or could that be any keyword?
23:14joobuslike :something?
23:15arrdemit's not clear to me what you're saying. example?
23:16joobuswould this map the same way: {:something [street-address city state]}
23:16arrdemno. :keys is special.
23:16joobusok, thanks :)
23:16arrdemthe "normal" map destructuring format is {symbol-to-bind value-to-bind-from}
23:16arrdemthe exceptions are :or, :keys and :as.
23:17arrdemwhich may occur as map keys and have special behaviors.
23:17joobusok
23:17arrdemhttps://gist.github.com/john2x/e1dca953548bfdfb9844
23:18arrdemsee the "Maps" and "Shortcuts" headings