#clojure log - Sep 03 2014

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

2:13 mi6x3m: hey clojure, what's the proper way to output the object's clojure representation?

2:13 println?

2:13 str?

2:16 beamso: pr, prn or clojure.pprint/pprint ?

2:17 mi6x3m: beamso: yes, that seems to be it :)

2:18 TEttinger: mi6x3m, prn may have unexpected results on arrays or java objects, but you can customize how they pr too.

2:18 pr/prn both

2:19 rpaulo: ]\

2:19 beamso: i personally use println, but the docs for print say 'for human consumption'.

2:19 mi6x3m: because I am formatting source code manually

2:20 is it a bad idea to put placeholder keywords like :nl-tab in the list

2:20 to replace it later with "\n\t" ?

2:20 rpaulo: oops, cat tried to type

2:20 mi6x3m: pprint just doesn't bring it

2:32 just out of interest. would someone consider this code sane: http://pastebin.com/ZTr6RyUS ?

2:32 it builds the source code for a code example

2:32 very ugly though

3:43 hhenkel: Hi 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

3:44 Any thoughts on that?

3:46 Added another set of data as the first set did actually not match....

3:47 mercwithamouth: o_O

3:52 hmm this must be the slow hour

3:53 hhenkel: i'm rather new to clojure but it looks ok to me

3:54 wait...ehh

3:56 hhenkel: mercwithamouth: 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.

4:02 mercwithamouth: hhenkel: seems clean enough

4:26 amalloy: hhenkel: 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

4:28 as 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

4:30 ie, something like https://www.refheap.com/89734

4:32 anyway, i'm off to bed. hope that helps

4:38 hhenkel: amalloy_: Thanks!

4:40 amalloy_: From looking at your stuff I think I get slightly an idea about your thoughts. Thanks again!

4:50 michaelr525: Hi

4:51 What would be a good place to read about clojure? That's for my team lead at work..

4:51 Some easy to understand but technical introduction..

4:55 yusup: Hi all

5:03 maxthoursie: michaelr525: something like http://adambard.com/blog/ten-reasons-to-use-clojure/ ?

5:05 michaelr525: maxthoursie: I might use this.. hhmm but I'm not sure it's friendly enough.

5:06 maxthoursie: it might not be, just suggested it because it's quite recent

5:06 michaelr525: maxthoursie: not sure that someone who never saw clojure will understand. lot's of material in a short article..

5:06 maxthoursie: thanks..

5:06 maxthoursie: few things beats hickeys talks when it comes to insperation

5:06 simple made easy is what brought me here once

5:10 michaelr525: maxthoursie: i'll check that

5:19 lvh: Yeah, I'm a big fan of Rich's talks.

5:19 (Not just for myself, although I think I've watched simple made easy hafl a dozen times now, but also for convincing others :))

5:21 emil0r: michaelr525: 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

5:32 mi6x3m: hello, 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

5:32 each example is a variable holding a function with some metadata

5:32 I extract the source code of all dependant functions and print them out along with a header for the namespace

7:03 clgv: mi6x3m: 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

7:04 mi6x3m: clgv: yes, preparing a larger example now :)

7:07 clgv: mi6x3m: oh no! please do not make it larger. provide a concise description with the mentioned examples instead

7:08 mi6x3m: minimal examples that characterize the problem sufficiently are the goal

7:08 mi6x3m: clgv: that was the intended meaning, breathe :)

7:08 clgv: :P

7:42 hexa: Hi, 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) ...

7:47 schmir: hexa: (defn filter-test [unfiltered-in count-in] (map first (filter (partial apply =) (partition count-in 1 unfiltered-in))))

7:50 hexa: well, not quite what you asked for...but it looks like partition is your friend...

7:50 hexa: schmir, sounds like a good thing to investigate I will try to understand it more :) thx!

7:54 schmir: hexa: look at partition-by

7:55 hexa: schmir, almost got it with partition now :)

7:55 schmir: ,(partition-by identity '(1 1 2 2 3 4))

7:55 clojurebot: ((1 1) (2 2) (3) (4))

7:56 hexa: schmir, (defn filter-testa [unfiltered-in count-in] (take count-in (map first (filter (partial apply =) (partition 2 1 unfiltered-in))))

7:57 schmir, then I guess I would have to filter for > 1 lists...

7:57 clgv: hexa: better write a custom partition function that groups together elements based on a 2-ary predicate

7:58 schmir: hexa: yes

8:00 clgv: why? the partition-by looks very nice to me.

8:00 hexa: clgv: I was going to say that partition by looks like that no?

8:01 but 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..

8:01 er.. I mean the 1st partial apply...

8:02 clgv: schmir: he wants to use an arbitrary predicate as stated above

8:02 hexa: ho yeah right...

8:02 schmir: yes, right...

8:03 hexa: clgv: is it possible to use an 2 arg pred with partition-by ?

8:03 clgv: depending whether that shall be lazy or eager, you'll end up with an implementation using lazy-seq or loop-recur

8:03 hexa: no

8:05 hexa: k

8:13 hyPiRion: ,(defn partition-with [p coll] (let [seps (concat (map p coll (rest coll)) [true])] (->> (map list seps coll) (partition-by second) (map #(map second %)))))

8:13 clojurebot: #'sandbox/partition-with

8:13 hyPiRion: ,(partition-with not= [1 1 2 2 3 3 4 5])

8:13 clojurebot: ((1 1) (2 2) (3 3) (4) (5))

8:15 hyPiRion: that's not correct though, just randomly matches my example. Gur.

8:16 * hyPiRion grabs another coffee

8:16 hexa: hehe :)

8:20 clgv: hyPiRion: but thats awfull complicated compared to a simple lazy-seq or loop-recur based implementation

8:20 hyPiRion: clgv: It's not working at all, so I don't see how that's relevant :p

8:24 clgv: hyPiRion: ah lol, I did not see the `not=` thought you use `=` ;)

8:25 irctc: ppp

8:44 mi6x3m: any way to make the edn reader recognize reader forms?

8:45 clgv: mi6x3m: the clojure reader does that

8:46 mi6x3m: clgv: I don't want any code execution though

8:47 hyPiRion: mi6x3m: then you're out of luck, because that's exactly what reader forms are

8:48 clgv: yeah, sounds like conflicting objectives

8:48 mi6x3m: hyPiRion: they're not syntactically substituted ?

8:48 hyPiRion: mi6x3m: no, see e.g. ##(java.util.Date.)

8:48 clgv: mi6x3m: they are associated with functions that a called on the data the annotate

8:48 lazybot: ⇒ #inst "2014-09-03T12:48:13.356-00:00"

8:49 hyPiRion: ^ you cannot convert that without code execution

8:49 mi6x3m: ok i see, there's the issue :)

8:49 i will look around for alternative solutions then

8:49 clgv: ,(type (read-string "#inst \"2014-09-03T12:48:13.356-00:00\""))

8:49 clojurebot: #<SecurityException java.lang.SecurityException: denied>

8:49 clgv: &(type (read-string "#inst \"2014-09-03T12:48:13.356-00:00\""))

8:49 lazybot: ⇒ java.util.Date

8:50 hyPiRion: mi6x3m: but, well, a basic edn reader supports tagged elements

8:51 things is, it is code evaluation, but you decide what tagged elements you support (and therefore what code could potentially execute)

8:51 mi6x3m: hyPiRion: perhaps I should elaborate on my objective instead

8:52 I get the source of a function with clojure.repl/source-fn

8:52 I edn read that

8:52 and extract a list of all symbols found in the source

8:52 thereby collecting the dependencies

8:53 hyPiRion: right

8:53 ,(require 'clojure.edn)

8:53 clojurebot: nil

8:53 hyPiRion: ,(clojure.edn/read-string "#inst \"2014-09-03T12:51:19.404-00:00\"")

8:53 clojurebot: #<SecurityException java.lang.SecurityException: denied>

8:54 hyPiRion: oh clojurebot

8:54 &(require 'clojure.edn)

8:54 lazybot: java.io.FileNotFoundException: Could not locate clojure/edn__init.class or clojure/edn.clj on classpath:

8:54 hyPiRion: Well, that's working at least.

8:55 mi6x3m: ,(require '[clojure.tools.reader.edn :as edn])

8:55 clojurebot: #<FileNotFoundException java.io.FileNotFoundException: Could not locate clojure/tools/reader/edn__init.class or clojure/tools/reader/edn.clj on classpath: >

8:56 mi6x3m: right

8:56 it's a leiningen dependency

8:56 hyPiRion: just do it in a repl :p

8:57 I thought it was built into clojure core

9:10 clgv: hyPiRion: lazybot uses an older clojure version compared to clojurebot

9:10 &(clojure-version)

9:10 lazybot: ⇒ "1.4.0"

9:10 clgv: ,(clojure-version)

9:10 clojurebot: "1.7.0-master-SNAPSHOT"

9:22 hyPiRion: oh wow, I thought clojurebot used 1.5

9:22 at least.

9:33 schmir: is 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

9:36 TimMc: Nope.

9:36 schmir: TimMc: ok. thanks!

9:40 hyPiRion: It's possible though, but never do it

9:41 ,(defn foo [& {:keys [b a] :or {b @a}}] b)

9:41 clojurebot: #'sandbox/foo

9:41 hyPiRion: ,(foo :a (atom 0))

9:41 clojurebot: 0

9:41 hyPiRion: why am I teaching people this

9:41 Kalina: hi

9:44 is some of you participating in clojurecup?

9:44 TimMc: hyPiRion: That's so dirty. :-)

9:44 ambrosebs: hyPiRion: WOW

9:45 Kalina: o.O

9:46 hyPiRion: TimMc: funny thing is, the ordering matters

9:46 ,(defn foo [& {:keys [a b] :or {b @a}}] b)

9:46 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: a in this context, compiling:(NO_SOURCE_PATH:0:0)>

9:46 ambrosebs: omg too early

9:47 arrdem: all of this wat and I'm not even at class yet.

9:48 TimMc: hyPiRion: But can you destructure the contents of the atom?

9:49 * arrdem guesses so

9:50 Bronsa: hyPiRion: wtf

9:51 TimMc: ,(macroexpand `(let [[& {:keys [b a] :or {b @a}}] [:a (atom 5)]] b))

9:51 clojurebot: (let* [vec__27 [:a (clojure.core/atom 5)] map__28 (clojure.core/nthnext vec__27 0) map__28 ...] sandbox/b)

9:51 TimMc: &(macroexpand `(let [[& {:keys [b a] :or {b @a}}] [:a (atom 5)]] b))

9:51 lazybot: ⇒ (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

9:51 hyPiRion: TimMc: yeah, :keys are applied in reverse

9:52 TimMc: I don't understand this binding: b (clojure.core/get map__3986 :user/b (clojure.core/deref user/a))

9:52 At that point, there isn't a binding for a.

9:53 arrdem: hum... why are a and b qualified to clojure.core tho..

9:53 hyPiRion: arrdem: backquote instead of normal quote

9:54 arrdem: hum... I need to play with backtick more.

9:59 hyPiRion: TimMc: oh yeah, it works!

9:59 ,(defn foo [& {:keys [[c b] a] :or {[c b] @a}}] [c b])

9:59 clojurebot: #'sandbox/foo

9:59 hyPiRion: ,(foo :a (atom [:c :b]))

9:59 clojurebot: [:c :b]

9:59 TimMc: nice

10:00 clgv: you can use non-symbols with the :keys list? O_o

10:00 hyPiRion: clgv: SHH

10:00 don't tell anyone

10:00 clgv: hyPiRion: that's a bug, right?

10:01 hyPiRion: clgv: I am very sure of that, yes

10:01 clgv: ,(let [{:keys [{:keys [a b]} c]} [:c {:a 1 :b 2}]] [a b c])

10:01 clojurebot: [nil nil nil]

10:02 clgv: ,(let [{:keys [c {:keys [a b]}]} [:c {:a 1 :b 2}]] [a b c])

10:02 clojurebot: [nil nil nil]

10:02 clgv: ah forgot the :or^^

10:05 lvh: I'm reading core.async, and I was wondering why there's the difference between ! and !!

10:06 if single-bang only makes sense inside a go-block, why can't the go block translate the stuff in there?

10:06 clgv: hyPiRion: yeah, there should be a proper `symbol?` check in there

10:06 hyPiRion: clgv: Are you suggesting :[a b] isn't a proper keyword?

10:06 lvh: I 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:06 hyPiRion: ,(let [{:keys [[a b]] :or {[a b] [10 20]}} {(keyword (str '[a b])) [:a :b]}] [a b])

10:07 clojurebot: [:a :b]

10:07 hyPiRion: clgv: but yeah, it should be a proper check there

10:07 clgv: ,:[a b]

10:07 clojurebot: #<RuntimeException java.lang.RuntimeException: Invalid token: :>

10:08 clgv: obviously ;)

10:10 hyPiRion: why is quote multi-arity?

10:10 clgv: ,(doc quote)

10:10 clojurebot: Titim gan éirí ort.

10:10 clgv: &(doc quote)

10:10 lazybot: ⇒ "Special: quote; Yields the unevaluated form."

10:10 clgv: $doc quote

10:10 hyPiRion: ,(-> foo 'a)

10:10 clojurebot: foo

10:10 Bronsa: hyPiRion: it's not by design

10:10 clgv: $source quote

10:11 lazybot: Source not found.

10:11 clgv: :P

10:11 Bronsa: hyPiRion: there should be a ticket to change that IIRC

10:11 hyPiRion: Bronsa: I was about to ask about that

10:14 TimMc: ,(quote a b c)

10:14 clojurebot: a

10:15 hyPiRion: yeah, http://dev.clojure.org/jira/browse/CLJ-1282

10:17 clgv: guess that issue needs some voting then ;)

10:21 visof: ,(doall (for [c (range 4)] [c]))

10:21 clojurebot: ([0] [1] [2] [3])

10:21 visof: ,(.toString (doall (for [c (range 4)] [c])))

10:21 clojurebot: "clojure.lang.LazySeq@1cab43"

10:21 visof: why?

10:21 clojurebot: why is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone

10:22 TimMc: &(contains? #{-1} (int -1))

10:22 lazybot: ⇒ true

10:23 TimMc: How long have we had reliable use of integers as indexes?

10:23 or rather, as map and set keys

10:23 clgv: visof: use `pr-str`

10:23 ,[(.toString (range 10)) (pr-str (range 10))]

10:23 clojurebot: ["clojure.lang.LazySeq@9ebadac6" "(0 1 2 3 4 ...)"]

10:25 dnolen_: TimMc: pretty sure since 1.3.X or shortly thereafter due to the numerics changes

10:25 TimMc: I think it was still a problem in 1.3.x.

10:25 Maybe 1.4.0 brought in the hashing changes?

10:26 clgv: wasnt that 1.6?

10:26 your int expr is converted to Long again before it is passed to `contains?`

10:27 dnolen_: TimMc: pretty sure it was right after people had some experience w/ the numerics changes so likely no later than 1.4.X

10:27 clgv: ,(type (int -1))

10:27 clojurebot: java.lang.Integer

10:27 clgv: damn, wait

10:27 ,(defn foo [x] (type x))

10:27 clojurebot: #'sandbox/foo

10:27 clgv: ,(foo (int -1))

10:27 clojurebot: java.lang.Integer

10:28 clgv: oh interesting

10:28 Bronsa: clgv: what were you expecting to get?

10:30 SagiCZ11: what 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:31 TimMc: Or even two-element vectors.

10:35 hyPiRion: TimMc: Was 1.3.x the contrib migration?

10:36 It was an issue until the contrib migration IIRC.

10:36 Bronsa: hyPiRion: yep

10:39 TimMc: I still have this aversion to using integers as keys even though it hasn't been a problem for a while.

10:43 stuartsierra: SagiCZ11: 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:44 You can always start with maps and switch to records later if it's a performance hotspot.

11:02 arrdem: SagiCZ11: 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:07 SagiCZ11: what are records and what are their advantages over maps?

11:10 ephemeron: SagiCZ11: 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:10 TimMc: SagiCZ11: More performant if you know your keys in advance, but they make development less dynamic. Don't use them unless you need them.

11:14 kqr: i'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:27 gfredericks: pure : side-effective :: thought : deed

11:30 SagiCZ11: ephemeron: and if i use them as vectors, should i then access the x y components by first and last/second?

11:31 arrdem: SagiCZ11: 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:34 llasram: arrdem: The project was literally alive?

11:35 arrdem: llasram: it was ... a really fun piece of school work and then I changed data models T_T

11:35 point taken tho :P

11:36 jeffterrell: kqr: check out https://github.com/cemerick/friend

11:36 I don't know of anything that will make all the decisions for you, but friend at least makes it easier.

11:36 kqr: jeffterrell, just found that, and it looks decent

11:59 puredanger: another round of transducer mods from Rich … https://github.com/clojure/clojure/commit/7d84a9f6f35a503cddf98487b6544d18937c669e

12:01 flat map is gone. added a new cat. mapcat is now a transducer: (comp (map f) cat) ;)

12:01 mikerod: Is 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:01 puredanger: and the completing infrastructure has been lifted into public

12:01 mikerod: puredanger: oh, this is interesting

12:01 bbloom: puredanger: i didn't look too closely... but isn't mapcat/1 already defined?

12:02 (doc mapcat)

12:02 clojurebot: "([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:02 bbloom: soo is that a breaking change?

12:02 mikerod: Yeah, I thought mapcat was not amendable to the transducer arities

12:02 Bronsa: bbloom: no, (mapcat f) never had anymeaning

12:02 puredanger: yes, but not useful

12:02 Bronsa: bbloom: http://dev.clojure.org/jira/browse/CLJ-1494

12:02 puredanger: ^ I guess that can be closed now

12:02 puredanger: yup :)

12:02 bbloom: ,(apply mapcat #(vector % %) [1 2 3])

12:02 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>

12:02 bbloom: ,(apply mapcat #(vector % %) [[1 2] [3 4]])

12:02 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: sandbox/eval75/fn--76>

12:03 bbloom: blah

12:03 * bbloom reads ticket

12:03 bbloom: hm i see

12:04 puredanger: is there some elaboration of the "completing" idea somewhere?

12:04 llasram: Glad 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:04 puredanger: completing takes a reducing function and adds the arities needed to make it transducer friendly

12:05 bbloom: hm ok

12:05 puredanger: in particular the "completing" arity (1 arg)

12:06 Bronsa: puredanger: why doesn't transduce automatically call completing anymore?

12:07 puredanger: that cuts off cases where you actually want to do a closing action (like switching from transient to persistent)

12:07 into does this already, but example: (transduce xf (completing conj! persistent!) (transient []) (range 10))

12:08 Rich 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:10 we'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:10 llasram: puredanger: Has Rich explained why these are going into core as new arities of existing lazy-sequence functions vs a new namespace?

12:10 Bronsa: llasram: probably it's a "marketing" move

12:10 puredanger: Rich believes these are fundamental and important and should be the base of core

12:10 Bronsa: not sure what that means

12:11 mikerod: puredanger: There will be a talk? Now I'm sad I'm not goign to strange loop

12:11 thankful for youtube

12:11 So does anyone have any insight on this:

12:11 Is 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:11 Bronsa: puredanger: having them in core makes it easier for people to use/discover as opposed to having them in a separate ns like reducers

12:12 puredanger: we have not done it yet, but most of the existing sequences can be rewritten as (sequence (the-function …) coll)

12:12 there 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:13 Bronsa: while reducers was/is considered "alpha", transducers is not going in with that caveat - we're committed to it as the direction

12:13 mikerod: I never realized reducers were alpha

12:14 puredanger: they are (almost) the only thing still marked alpha

12:14 mikerod: ,(doc clojure.core.reducers)

12:14 clojurebot: #<ClassNotFoundException java.lang.ClassNotFoundException: clojure.core.reducers>

12:15 Bronsa: puredanger: 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:15 puredanger: mikerod: do you mean "java generics" when you say generic type information?

12:15 mikerod: puredanger: List<String>

12:15 puredanger: generics are erased in the bytecode, so we don't know that

12:16 mikerod: There are reflection libraries available that can find parameterized type information

12:16 puredanger: no interest in that, afaik

12:16 mikerod: Unless there is some stretch cases that is the issue - or I'm just wrong

12:16 I figured it is just excessive and probably would just slow down compilation anyways if there were some reflection hacks to get the information

12:17 tbaldridge: mikerod: do .class files even contain such type information? I thought generics were purely a java compiler construct

12:17 mikerod: I 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:18 puredanger: tbaldridge: they do not, although in some cases you can infer from bridge methods or use some weird constructs to make it recoverable

12:18 mikerod: tbaldridge: I've been reading around, it sounds like the Java compiler does include statically determined parameterized type information in the class files

12:18 Maybe I'm wrong there. I guess I'd need to research that a bit more.

12:21 puredanger: Bronsa: is identity a valid xf?

12:24 Bronsa: puredanger: 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:31 puredanger: puredanger: 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:32 mwfogleman: I have a list like this: (("test" "123") ("") ("bar"))

12:32 tbaldridge: oh no....he's talking to himself now....

12:32 mwfogleman: and am having trouble removing the lists that are empty, i.e. ("")

12:32 I would appreciate any pointers

12:32 puredanger: tbaldridge: so lonely here in the basement :)

12:33 ToxicFrog: mwfogleman: but ("") isn't an empty list?

12:33 mwfogleman: ToxicFrog: yep

12:33 i just partitioned a bigger list by the empty list

12:33 ToxicFrog: what

12:34 hiredman: mwfogleman: ("") is not empty though, it is a list containing an empty string

12:34 ToxicFrog: You said you wanted to remove empty lists, and then presented as an example a non-empty list

12:34 This makes no sense

12:34 mwfogleman: okay, i would like to remove any lists containing just an empty string.

12:34 hiredman: (remove #{'("")} foo)

12:35 mwfogleman: oh boy

12:35 hiredman, thanks so much!

12:35 i missed the #{} and the quoting

12:36 Bronsa: puredanger: 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:36 celwell: Does 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:36 ToxicFrog: Wait, there's a lein-bin?

12:36 Bronsa: maybe I'm wrong though

12:37 celwell: ToxicFrog: https://github.com/Raynes/lein-bin

12:37 ToxicFrog: Sweet

12:37 Can it cross-compile?

12:37 celwell: ToxicFrog: "A Leiningen plugin for producing standalone console executables that work on OS X, Linux, and Windows."

12:38 I'm assuming that means a single file (I'm only getting one file)

12:38 I was wondering if the issue was that I needed to rename with .exe (but that didn't help)

12:38 joegallo: celwell: how much free disk space do you have?

12:38 ToxicFrog: celwell: 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:38 arohner: celwell: there's also https://github.com/circleci/lein-jarbin, but that's explicitly not cross-OS compatible

12:39 ToxicFrog: Oh, it looks like it emits a polyglot shell scripts

12:40 ...which assumes that 'java' is in $PATH

12:40 TimMc: The whole notion of cross-compilation baffles me because I would assume it to be the default.

12:40 ToxicFrog: So no actual windows support, then

12:40 clgv: celwell: that seems to create a file with certain preamble strings and the content of the jar file. how is that supposed to work?

12:40 ToxicFrog: clgv: the emitted file is both a valid Bourne shell script and a valid windows batch file

12:41 TimMc: JAR files keep their metadata at the tail of the file -- they're zip files.

12:41 ToxicFrog: When run, it invokes java and points it at the script file itself, which has the jar appended.

12:41 clgv: ToxicFrog: ok. interesting

12:41 ToxicFrog: Unfortunately, this relies on 'java -jar foo.jar' actually working, so it won't work reliably on windows machines.

12:42 clgv: didnt know you could have such scriptfile with embedded binaries

12:42 ToxicFrog: clgv: this is also how sharchives work.

12:43 sh/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:43 celwell: ToxicFrog: "java -jar foo.jar args" *is* working fine on my machine with the uberjar, but the lein bin script give that error.

12:44 ToxicFrog: celwell: 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:44 Sometimes it just doesn't get added to %PATH% for whatever reason.

12:44 Bronsa: puredanger: don't know if you caught it, but I updated the patch for CLJ-1224 as you asked :)

12:45 ToxicFrog: I 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:45 It's kind of horrible.

12:45 clgv: celwell: you are probably better off with something like "launch4j" - but no idea how to get that working with leiningen.

13:03 clojure-newb: hi 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:03 it just seems to fall through to last clause

13:04 ambrosebs: clojure-newb: the left hand sides are literal symbols iirc

13:04 'msn/str1 would trigger that case

13:04 clojure-newb: ah, ok, I will have to use another mechanism to switch

13:04 ok I wlil try it

13:04 thanks

13:05 ambrosebs: also (case x (msn/stsr1) ..) should be identical behaviour

13:05 clojure-newb: thx

13:05 ambrosebs: if you need to dereferece a var on the left, use a macro that emits a case

13:09 mpenet: lvh: 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:04 l1x_: hi guys is there a way to get the fn name instead of this -> #<core$test_fn abc.core$test_fn@428640fa>

14:04 the real name of my fn is test-fn

14:05 joegallo: ,(println inc)

14:05 clojurebot: #<core$inc clojure.core$inc@cfec7c>\n

14:05 joegallo: ,(println (meta #'inc))

14:05 clojurebot: {:ns #<Namespace clojure.core>, :name inc, :file clojure/core.clj, :column 1, :line 883, ...}\n

14:05 joegallo: see that name there?

14:06 otoh, 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:07 l1x: well 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:08 that is not really helpful, but i can expand it so I can use meta and combine it with a little deconstruction and voila

14:08 so thank you

14:10 what is the equivalent of #' in the macro syntax?

14:11 aperiodic: l1x: (var <symbol>)

14:12 l1x: amazing thanks!

14:16 hmm it works outside the macro but not in it

14:16 aperiodic: l1x: you're writing your macro wrong

14:16 l1x: no shit captain obvious!

14:16 :D

14:17 https://gist.github.com/l1x/79c9647b7a77efadd020

14:17 aperiodic: how are you using it?

14:20 also, is this just to get experience with macros, or do you have plans to actually use this macro? it seems ill-motivated.

14:22 amalloy: l1x: #' works fine inside a macro

14:22 you're forgetting to call meta. vars aren't maps; they have metadata which is a map

14:25 l1x: amalloy: true! thank you

14:26 danneu2: anybody using https://github.com/magnars/prone? looks hot

14:28 danneu: also just upgraded cider for emacs from the old nrepl plugin. man, i was living in the dark ages compared to this

14:28 amalloy: danneu: that does look pretty cool

14:30 seangrove: dnolen_: ping

14:30 dnolen_: seangrove: pong

14:30 seangrove: dnolen_: Just checking if you've seen https://github.com/circleci/frontend

14:31 I think it's now the largest open-source Om app, and it's actually used in production

14:31 dnolen_: seangrove: haven't seen it, that's cool!

14:32 seangrove: They haven't blogged about it yet, but I'll tweet that they will to set a deadline ;)

14:32 dnolen_: seangrove: heh nice

14:35 puredanger: Clojure/Conj talks here (on site soon): http://lanyrd.com/2014/clojure-conj/schedule/

14:37 seangrove: puredanger: What, no video yet??

14:37 lazybot: seangrove: Uh, no. Why would you even ask?

14:37 puredanger: thanks, lazybot

14:37 seangrove: It was a pretty good comeback

14:37 arrdem: ahaha lazybot with the constructive comment

14:38 seangrove: puredanger: 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:38 puredanger: I'll add that to the list of things people on the internet feel entitled to

14:38 ;)

14:39 afaik, we will be doing fast release to YouTube for the conj, like we did with clojure/west this year

14:39 I'll be doing the same for Strange Loop too

14:40 seangrove: Wow, that's fantastic. I was amazed at how quickly the clojure/west talks went up

14:40 puredanger: all it takes is paying people lots of money!

14:40 seangrove: Are you still able to recoup all the costs associated with recording when putting it on Youtube though?

14:41 puredanger: seangrove: no, it cost about $20k more

14:41 for strange loop that is (way more talks than clojure/conj)

14:42 I do it for you, man

14:42 seangrove: Well, I certainly appreciate it :)

14:42 amalloy: puredanger is my hero

14:44 Shayanjm: time to dust off this project again

14:44 hyPiRion: oh, you're doing that for strangeloop as well

14:45 amazing

14:45 arrdem: Shayanjm: wb

14:45 Shayanjm: thanks arrdem

14:45 I tried reaching out to Google

14:45 multiple times

14:45 puredanger: we will also have a live caption text feed from the main theater. not sure whether anyone will get use of that.

14:46 Shayanjm: brick walls. No longer have a computational capacity bottleneck - now I have an API usage and money bottleneck lol

14:46 amalloy: holy smokes, puredanger

14:46 arrdem: Shayanjm: haha solid

14:46 aperiodic: wow

14:47 puredanger: so you can watch Rich's talk live in text on Friday Sept 19th. that should be a fun time for the captioner.

14:47 amalloy: who'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:47 hyPiRion: (inc puredanger)

14:47 lazybot: ⇒ 8

14:47 puredanger: amalloy: they take materials ahead of time to know vocal, etc

14:48 s/vocal/vocab/

14:48 amalloy: (inc puredanger)

14:48 lazybot: ⇒ 9

14:48 puredanger: they are pretty amazing actually. can do up to 300 words/minute

14:48 Bronsa: (inc puredanger)

14:48 lazybot: ⇒ 10

14:48 puredanger: MAKE IT RAIN

14:48 aperiodic: (inc puredanger)

14:48 lazybot: ⇒ 11

14:48 arrdem: (inc puredanger)

14:48 lazybot: ⇒ 12

14:48 puredanger: I should say thanks to Two Sigma for sponsoring the feed! :)

14:49 Kneiva: How 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:50 johnwalker: (inc puredanger)

14:50 lazybot: ⇒ 13

14:55 dbasch: Kneiva: how are you running Jetty? If it’s embedded, use the Java api: http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty

14:56 borkdude: I've got an emacs-live question. When I upgrade to the newest version, which cider version should I have?

14:58 amalloy: i'm not sure anyone's ever gotten five karma in five minutes before

14:59 puredanger: thank you all :)

15:00 Kneiva: dbasch: Umm, here is my project.clj https://www.refheap.com/89753

15:01 dbasch: Kneiva: I assume you’re running lein ring server, which is not what you want to do in production

15:03 Kneiva: dbasch: yeah, I'm running it with lein. But I don't think I'll be deploying this anywhere.

15:04 johnwalker: borkdude: it should be 0.7.0

15:04 add to your profiles.clj [cider/cider-nrepl "0.7.0"]

15:04 borkdude: johnwalker I thought so too. Even if I remove my entire clone and clone it over, it's still 0.6.0

15:04 johnwalker ok

15:05 dbasch: Kneiva: see http://stackoverflow.com/questions/10289617/clojure-ring-jetty-i-am-using-lein-ring-server-how-do-i-configure-the-jetty

15:05 johnwalker: well, i assume thats the issue ;p

15:07 Kneiva: dbasch: that might do the trick. I'll try that. thanks!

15:09 borkdude: johnwalker 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:10 johnwalker: does it look like {:user {:plugins [[cider/cider-nrepl "0.7.0"]]}} ?

15:11 borkdude: https://www.refheap.com/89754

15:11 johnwalker: ok, thats probably fine.

15:12 are you on lein 2.4.3 ?

15:13 borkdude: yeah, just upgraded

15:13 johnwalker: did you get this on lein 2.4.2 ?

15:14 borkdude: my previous version was 2.3.4

15:14 but I also tried it on 2.4.3

15:14 johnwalker: hmm

15:14 TimMc: puredanger: 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:15 It's not particularly rational.

15:15 johnwalker: ok, well there's an issue with 2.4.3. try lein upgrade 2.4.2

15:15 and that will solve a separate problem, but probably not this one

15:15 borkdude: k

15:15 johnwalker: it's possible that there is interference somewhere

15:15 move the cider-nrepl dependency to the beginning of your plugins vector

15:17 borkdude: johnwalker that's it, the order of the plugins

15:17 johnwalker: great

15:18 yes, this got me a while back too

15:18 borkdude: johnwalker I'll just disable a bunch

15:18 johnwalker: you'll probably be fine with them present

15:18 the issue is that the first plugin that requires a certain dependency gets to pick its version

15:21 borkdude: johnwalker when I connect from emacs to 'lein repl' it still says: CIDER 0.6.0snapshot (Clojure 1.6.0, nREPL 0.2.3)

15:21 johnwalker using the latest emacs-live

15:22 johnwalker: hmm...i could have sworn they updated to 0.7.0

15:22 i'll check, give me a second

15:23 borkdude: I thought so too https://github.com/overtone/emacs-live/commit/01e2b4c7cc4216080cf942443075499b2c2bb96d

15:23 danneu: ive 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:23 i'm thinking of associng :current-user into the request on my next site

15:24 johnwalker: yeah they're upgraded

15:24 ok, what happens when you do package-list-packages from emacs ?

15:24 danneu: im on CIDER 0.8.0alpha

15:25 borkdude: johnwalker I checked that, it says cider isn't installed (via elpa)

15:25 johnwalker it just says "available"

15:26 johnwalker: ok, then there shouldn't be a problem there

15:26 borkdude: johnwalker I also checked my elpa directory, no cider

15:27 johnwalker: you wouldn't happen to have a .emacs file, would you ?

15:28 it might be interfering with init.el. but i think you would probably notice that

15:29 borkdude: nope, the only files starting with .emacs in my home dir are .emacs-live.el and .emacs.d (which points to emacs-live)

15:29 it also says Emacs live beta 24 when I start emacs

15:29 johnwalker: ok, when i cloned emacs live i also got CIDER 0.6.0snapshot

15:30 borkdude: maybe it's something in cider, not printing the right version?

15:30 cider-version

15:31 johnwalker: well, emacs live is using ac-nrepl instead of ac-cider

15:32 so ...

15:32 it might be a better idea to use emacs prelude

15:32 it's basically the same thing minus the dancing text

15:33 but you haven't done anything wrong in setup

15:33 so in summary, clone this https://github.com/bbatsov/prelude

15:34 then get the release version of cider https://github.com/clojure-emacs/cider/releases

15:34 and everything should work

15:34 borkdude: thanks.

15:34 I'm not sure if I want to change my setup right now

15:34 but maybe later

15:35 johnwalker: i understand. you're welcome

15:35 borkdude: I think I'm using the "stable" packs which are old? https://github.com/overtone/emacs-live/tree/01e2b4c7cc4216080cf942443075499b2c2bb96d/packs/stable

15:38 that's it

15:39 johnwalker: ahh nice

15:45 bridgethillyer: Uh, the Conj lineup looks Amazing

15:45 technomancy: ^ for the record, this is why I've stopped recommending the starter kit and things like it

15:45 random breakage happens with no way to debug

15:46 borkdude: technomancy emacs prelude is different from that?

15:47 technomancy: borkdude: they're all the same, emacs-live, prelude, starter-kit

15:47 https://github.com/technomancy/emacs-starter-kit/blob/v3/README.markdown

15:47 borkdude: technomancy ok, no reason to switch then :)

15:47 technomancy: well, switch away from a one-size-fits all to creating your own config

15:48 switching from one starter kit to another doesn't solve much

15:53 johnwalker: technomancy: borkdude well, thats true. but prelude is maintained by bbatsov

15:54 TimMc: I've switched to mining things from technomancy's dotfiles.

15:54 and versioning like whoa

16:01 Jaood: technomancy: you starter-kit is very helpful to start ;)

16:02 technomancy: it's a crutch

16:02 Jaood: is simple and easy enought to grok quickly and all documented in one page

16:03 for beginners anyway

16:03 tuft: puredanger: 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:03 puredanger: where?

16:04 clojurebot: where is log

16:04 Jaood: technomancy: yeah, people should just copy paste from it what they like, not just insert the file and load it

16:04 technomancy: Jaood: hm; you mean better-defaults? emacs-starter-kit is not documented at all.

16:04 amalloy: clojurebot: forget where |is| log

16:04 clojurebot: I forgot that where is log

16:05 Jaood: technomancy: oh yeah, was referring to better-defaults

16:05 tuft: puredanger: s/sweet/suite/ i assume

16:07 amalloy: devn: did you have any success setting up swank?

16:07 puredanger: tuft: yes, will fix

16:07 Jaood: technomancy: just saw you updated it recently :)

16:08 tuft: puredanger: cheers! i'm super excited about the lineup

16:08 technomancy: Jaood: yeah, this is like the anti-starter-kit =)=

16:09 puredanger: technomancy: 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:10 technomancy: puredanger: 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:10 *from it and things like it

16:10 puredanger: yeah, I understand the reasoning

16:10 arrdem: pulling apart emacs-live to get the bits I wanted was... interesting when I was getting started.

16:11 puredanger: I only touch my emacs config every 3 years or so

16:11 technomancy: most 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:11 Sindy: www.superonline.eu

16:17 SagiCZ11: how do i tell lazy/clojurebot to give me a link to this channels history please?

16:17 mbriggs: hey 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:17 amalloy: clojurebot: lazy-logs is http://logs.lazybot.org/

16:17 clojurebot: Ack. Ack.

16:19 SagiCZ11: amalloy: im not sure thats what i wanted. ^^

16:19 amalloy: uhhh...yes it is? click through to #clojure and then to today's date

16:20 SagiCZ11: well.. i meant if there is a command for the bot to give me the link.. which i keep forgetting.. something like ",logs"

16:20 amalloy: ~lazy-logs

16:20 clojurebot: lazy-logs is http://logs.lazybot.org/

16:20 SagiCZ11: yes thats it.. thank you amalloy

16:21 amalloy: i didn't make it just ~logs, because that's chouser's logging service. that appears defunct now though, so maybe i should

16:22 dmitrygusev: why is (= :a (symbol ":a")) -> false, but (= (symbol ":a") (symbol ":a")) -> true ?

16:22 amalloy: because :a is a keyword

16:23 dmitrygusev: thanks

16:23 just figured it out by passing to (type …), right after posting here as it usually happens

16:24 puredanger: yeah

16:24 amalloy: asking for help is the best way to figure things out youself

16:24 puredanger: heh, wrong window

16:24 amalloy: because, if you put in the effort to actually ask a good question, you end up thinking more about it

16:24 (and if you don't put in that effort i hate you)

16:24 tbaldridge: dmitrygusev: notice though that if you include the : you're probably not getting what you expect

16:25 ,(keyword ":foo")

16:25 clojurebot: ::foo

16:25 ToxicFrog: mbriggs: you can probably do something with mix + timeout, but I don't think there's a first-order way to do it

16:25 dmitrygusev: tbaldridge: yep, thanks for mentioning that

16:25 mbriggs: ToxicFrog: thanks

16:26 tbaldridge: mbriggs: I've seen people try that combined with hard killing a thread, but who knows what that does to the JVM ;-)

16:28 puredanger: tbaldridge: BAD THINGS :) like release all monitors.

16:32 joobus: is the JVM/Java/Clojure a memory hog? I notice lein repl is taking up ~700mb on my laptop.

16:33 technomancy: joobus: that's two JVMs, but the answer is still yes.

16:33 arrdem: define "memory hog" when we live in an era of 120Gb ram dev machines..

16:33 puredanger: the JVM will take all the memory you're willing to yield to it :)

16:33 tbaldridge: joobus: rule #1: when complaining about memory usage, make sure you're not measuring spare memory the GC keeps sitting around

16:33 i.e. don't measure via top...use a JVM profiler.

16:34 joobus: thanks for the answers :)

16:34 technomancy: joobus: using UTF-16 for the internal string encoding means it's gonna slurp up a lot more memory for text-heavy workloads.

16:35 joobus: i'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:36 technomancy: the answer, as usual, is "it depends" =)

16:36 hiredman: I've never seen it be a problem

16:37 tbaldridge: joobus: 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:37 TimMc: Just don't give it too much memory if GC pauses are a problem for you.

16:37 tbaldridge: joobus: and by C# I mean the .NET runtime....

16:37 joobus: and by c# I mean mono :)

16:38 hiredman: I'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:38 tbaldridge: joobus: oh that's a completely different beast then

16:38 joobus: yes, it is a beast

16:38 technomancy: mono and .net are designed for server side and client side usage

16:38 tbaldridge: joobus: 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:38 hiredman: you can just tell the jvm what max heap size it should use, and it won't use more

16:39 dagda1_: is there anyway I can use apply when the argument is not a vector or is that it should always be a vector

16:39 TimMc: &(apply + 1 2 (range 10))

16:39 lazybot: ⇒ 48

16:39 amalloy: tbaldridge: 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:39 technomancy: joobus: it's hard to give a good answer without knowing what you're using it for

16:39 different runtimes are good for different things

16:40 tbaldridge: amalloy: IDK, back when I was doing .NET development, I would often see memory returned to the OS after about 30 sec.

16:40 amalloy: or you could force it at anytime via a full collection.

16:40 joobus: technomancy: i know my question was general. i liked all the answers i've gotten. thank you guys.

16:40 TimMc: dagda1_: ^

16:40 amalloy: well, today i learned

16:41 dagda1_: TimMc: but it won't work without the range

16:41 TimMc: or do you man (apply + 1 2 '())

16:41 TimMc: dagda1_: Ah, you are asking a different question, then. (range 10) is not a vector, you see...

16:42 dagda1_: TimMc: Ok, I mean not a sequence

16:42 TimMc: *collection :-)

16:42 ~seqs and colls

16:42 clojurebot: seqs and colls is http://www.brainonfire.net/files/seqs-and-colls/main.html

16:42 TimMc: But sure, you can do ##(apply + 1 2 [])

16:42 lazybot: ⇒ 3

16:43 hiredman: apply with the collection at the end is just a function call

16:43 ,(+ 1 2)

16:43 clojurebot: 3

16:43 hiredman: without

16:45 mdeboard: Any StrangeLoop attendees this year managed to sort out how to export the schedule?

16:50 dagda1_: 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:50 puredanger: mdeboard: there is a program at https://thestrangeloop.com/system/resources/BAhbBlsHOgZmIi4yMDE0LzA4LzMwLzIyXzIzXzM2Xzc1NF9TTDIwMTRQcm9ncmFtLnBkZg/SL2014Program.pdf

16:50 the obvious place to look

16:50 mdeboard: puredanger: Oh hey, I tweeted at you a few ago, I guess that can be safely ignored

16:51 puredanger: mdeboard: is that what you're looking for, or actual data?

16:51 mdeboard: puredanger: Well last year there was a button to be able to export to iCal or Google Calendar

16:51 It was awesome because my coworkers & friends & I could coordinate

16:51 Like I had a StrangeLoop 2013 calendar I shared with them

16:59 SagiCZ11: so 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:00 TimMc: dagda1_: nil is also a valid final arg to apply, by the way

17:00 arrdem: SagiCZ11: unless there's some benefit derived from using the Point2D class, just go with an {:x Num :y Num} map.

17:01 you 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:03 SagiCZ11: yup.. 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:04 arrdem: because that order is a convention not an absolute

17:04 SagiCZ11: maybe i could make a function

17:04 ,(defn point [x y] {:x x :y y})

17:04 arrdem: what does the pair [1, 1] mean?

17:04 clojurebot: #'sandbox/point

17:04 SagiCZ11: ,(point 4 5)

17:04 clojurebot: {:x 4, :y 5}

17:05 arrdem: ^ right. my point. the _convention_ is [x y z? ...]

17:05 amalloy: arrdem: if i saw a pair and was told it's a coordinate, i'd assume [y x], not [x y]

17:05 arrdem: SagiCZ11: amalloy makes my point for me :P

17:05 amalloy: (oriented such that the top-left is [0 0]

17:05 )

17:05 SagiCZ11: amalloy: what? seriously? what school did u go to?

17:06 hiredman: amalloy: really?

17:06 SagiCZ11: it was always x,y,z,t

17:06 arrdem: SagiCZ11: if there's a symbolic meaning to a value, it should be a mapping from symbolic values to concrete values.

17:06 ephemeron: SagiCZ11, 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:06 arrdem: the ordering [x y z? t?] is incidental not abstract.

17:06 amalloy: SagiCZ11: 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:06 aperiodic: SagiCZ11: but the way coordinates are frequently represented (vector of vectors, row-major) it's more convenient to have the y coordinate first

17:07 SagiCZ11: amalloy: oh.. ok im talking about geometric points here

17:07 ephemeron: thats the conclusion to which i got too.. maps are too much, vectors are not enough, what to choose then?

17:07 hiredman: ah

17:07 arrdem: just go with the map, I suspect you'll find it's not actually too much.

17:08 ephemeron: SagiCZ11: Au contraire! Vectors are also too much. You do not need variable length.

17:08 arrdem: ephemeron: clj-tuple?

17:08 amalloy: ephemeron: are you seriously about to recommend a deftype?

17:09 hiredman: I 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:09 ephemeron: amalloy: No, just an array.

17:09 TimMc: SagiCZ11: I think it's gross to use [y x], personally.

17:09 amalloy: ephemeron: gross

17:09 SagiCZ11: TimMc: yup

17:09 amalloy: arrays are also too much. you do not need mutability

17:09 TimMc: amalloy: How about a Long and some bit-shifting?

17:10 hiredman: if you wait a bit you'll be able to use of ztellman's specialized small size vectors

17:10 amalloy: TimMc: even your strawman is better than an array

17:10 SagiCZ11: btw 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:10 TimMc: Immutable, and it's probably even more traditional than [y x] pairs!

17:10 arrdem: TimMc: what makes you think that all interesting points can be encoded in 64 bits?

17:10 hiredman: you could just use clj-tuple now I guess

17:10 ephemeron: SagiCZ11: If performance is not a problem, vectors are fine,

17:10 SagiCZ11: (doc tuple)

17:10 clojurebot: excusez-moi

17:10 arrdem: $google clj-tuple

17:10 lazybot: [ztellman/clj-tuple · GitHub] https://github.com/ztellman/clj-tuple

17:10 TimMc: arrdem: Ah, will you recommend a vector of Bignums? :-)

17:10 ephemeron: and as you can gleam from amalloy's reaction, more acceptable in Clojure-land.

17:10 SagiCZ11: ephemeron: better than maps?

17:11 hiredman: obviously clojure needs a complex number type that people can abuse to represent points

17:11 ephemeron: SagiCZ11: You can use maps if you want, but they become bulky as soon as you want matrix-like operations.

17:11 arrdem: TimMc: I'm still standing firmly behind a Map Keyword Num.

17:11 ephemeron: If you don't, just go with maps and enjoy the associativity.

17:11 SagiCZ11: ephemeron: not sure if would be sticking the points in matrix.. so map it is probably

17:12 amalloy: i'm with arrdem: unless it's totally clear from context what coordinate system you're using, a map is a good plan

17:12 TimMc: arrdem: Clearly I was actually recommending stuffing two floats into the long.

17:13 arrdem: lol @ 32 bit floats

17:13 amalloy: (inc TimMc)

17:13 lazybot: ⇒ 66

17:13 arrdem: that's cute get a real ISA.

17:13 SagiCZ11: my coordinate is weird in the sense that the y axis is pointing down.. swing Graphics2D

17:13 still referring to it as [x,y] though

17:13 arrdem: (inc amalloy) ;; he called it

17:13 lazybot: ⇒ 164

17:13 arrdem: $karma technomancy

17:13 lazybot: technomancy has karma 134.

17:14 amalloy: SagiCZ11: if y is pointing down (ie, origin is top-left), [x y] is a really weird way to refer to it

17:14 like, swing takes y x, doesn't it?

17:14 SagiCZ11: heck no

17:14 always x,y

17:14 amalloy: huh, i guess it does

17:14 arrdem: TimMc: what if I wanted to do navigation to Alpha Centauri? 32 bits just won't cut it all the time man...

17:14 hiredman: I think swing uses Diemenson objects

17:14 amalloy: i guess origin is bottom-left, for swing

17:15 SagiCZ11: Point2D.Double(double x, double y) 

17:15 amalloy: so x y is...fine? but really a map is more clear

17:15 SagiCZ11: k i will use the map

17:15 but use a simple function for creation

17:15 amalloy: it's been so long since i used swing

17:15 SagiCZ11: ,(point 2 6)

17:15 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: point in this context, compiling:(NO_SOURCE_PATH:0:0)>

17:15 SagiCZ11: oh whats the timeout on user defined clojurebot symbols?

17:16 amalloy: not very long. like five minutes

17:16 i don't really recommend def'ing anything

17:16 SagiCZ11: good to know

17:29 amalloy: does clojure ever use unboxed booleans? i thought it did, but even stuff like (if true 1 2) compares against Boolean/FALSE

17:32 mdeboard: amalloy: What is an unboxed boolean? Google doesn't give any helpful (for me) results

17:32 amalloy: mdeboard: the jvm primitive boolean, rather than a Boolean container object

17:32 mdeboard: Ah I see

17:32 Bronsa: amalloy: (if (.foo bar) .. ..) should avoid boxing assuming the .foo method returns a unboxed boolean

17:33 dbasch: &(type false)

17:33 lazybot: ⇒ java.lang.Boolean

17:35 Bronsa: amalloy: http://sprunge.us/DFME

17:35 amalloy: Bronsa: 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:36 Bronsa: amalloy: there are some intrinsics that should help

17:36 amalloy: http://sprunge.us/TOUO?java

17:36 amalloy: hm, so there are. i wonder what's wrong that this code isn't triggering those

17:39 arrdem: puredanger: ping

17:42 mdeboard: arrdem: Are you going to elixir meetup tonight by chance

17:42 arrdem: mdeboard: I wasn't aware of it. what time/when?

17:42 mdeboard: 6p at uh

17:43 * arrdem googles

17:43 mdeboard: http://www.meetup.com/Austin-Elixir/events/199476082/?a=cr1_grp&rv=cr1&_af_eid=199476082&_af=event

17:43 I have no idea where or what Mister Tramps is

17:43 arrdem: lol mr tramps

17:44 mdeboard: oh man that's kind of up there, relatively speaking

17:44 They just changed time & locale yesterday, I hadn't looked them up

17:44 arrdem: :/

17:45 the supercomputer team is meeting... now and it's Warmachine night at Dragon's Lair so I doubt I'm gonna make it.

17:45 mdeboard: Warmachine night at the what's what

17:45 arrdem: $google dragon's lair austin tx

17:45 lazybot: [Austin, TX - Dragon's Lair Comics & Fantasy Austin] http://dlair.net/austin/

17:45 danielcompton: arrdem: what does the supercomputer machine team train for?

17:45 arrdem: $google warmachine privateer press

17:45 lazybot: [WARMACHINE | Privateer Press] http://privateerpress.com/WARMACHINE

17:45 mdeboard: Warmachine to me is the guy who almost beat a porn star to death a few weeks ago

17:46 Not that there's any relevance to Clojure.

17:46 arrdem: yeah this is solidly -offtopic material

17:46 Ceterizine|Work: Uh

17:47 arrdem: danielcompton: http://www.hpcwire.com/2013/11/25/sc13-student-cluster-competition-results/ that's us from last year.

17:48 danielcompton: we won in 2012 and there's more material from then too.

17:48 danielcompton: arrdem do you only build the machine or code for it too?

17:49 arrdem: not that building a supercomputer isn't enough

17:49 arrdem: danielcompton: 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

17:49 * arrdem bbl

18:06 lavokad: hi, when i modify for expample this (GET "/index.html" [] (layout/index-html)) in routes dir, I have to restart the server...

18:07 modifying files with in models dir, views etc, after recompiling, changes are reflected without restarting the ring server

18:07 but not routes

18:07 can anyone explain a bit what is happening

18:18 aperiodic: lavokad: are you wrapping your handler with ring's reload middleware?

18:21 lavokad: gosh, aperiodic I don't know I started playing yesterday with all this ring/compojure/hiccup stack

18:21 :)

18:21 can I check it somehow>

18:21 ?

18:22 dbasch: lavokad: post some code e.g. a refheap / github link

18:56 danneu: lavokad: require [ring.middleware.reload :refer [wrap-reload]] and then add wrap-reload to the middleware chain

19:06 lavokad: danneu: ty!

19:09 danneu: lavokad: i just started hacking together a website today https://github.com/danneu/bulletin that uses it

19:21 aperiodic: arrdem: why aren't the "see also" sections of grimoire hyperlinks??

19:21 lazybot: aperiodic: What are you, crazy? Of course not!

19:22 cbp: ~python

19:22 clojurebot: python is ugly

19:28 tac_: lol

19:28 ~python

19:28 clojurebot: python is "I think dropping filter() and map() is pretty uncontroversial…" — GvR

19:28 tac_: hehe

19:29 ~java

19:29 aww :(

19:30 tuft_: woah, did he say that? heh

19:31 tuft: wow, he did http://www.artima.com/weblogs/viewpost.jsp?thread=98196

19:31 tac_: "I expect tons of disagreement in the feedback, all from ex-Lisp-or-Scheme folks. :-)"

19:31 You just wouldn't understand tuft....

19:34 tuft: ah yes, accumulation loops are much more readable than reduce.

19:35 aperiodic: tuft: you sound just like on of those "ex-Lisp-or-Scheme folks"

19:35 tac_: He's in too deep. He'll never understand what it's like to be a Practical Programmer ever again

19:36 tuft: i guess that's what a benevolent dictatorship does to your brain

19:36 * tac_ looks at the poster of Rich Hickey that tuft keeps on the wall of his bedroom.

19:37 joobus: the breaking changes from python 2.x to 3.x are what turned me off of python

19:37 tuft: haha, good point

19:38 tac_: 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:38 Python 3 took courage

19:38 that few people have today

19:38 TEttinger: I'm a bit curious about Hy, since I've heard it described as Clojure-is-to-Java as Hy-is-to-Python

19:39 tbaldridge: TEttinger: not exactly,

19:39 Hy is way closer to python than Clojure is to java

19:39 TEttinger: oh ok

19:39 tbaldridge: "mutate all the things!!!!"

19:39 :-)

19:39 tuft: i can tolerate python perfectly fine -- write it for a living going on two years

19:40 tbaldridge: tac_: 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:40 tac_: I once believed strongly in immutability

19:40 arrdem: aperiodic: at present those are hand-written, the next release should help fix that but may be delayed

19:40 tac_: but one day, that all... changed.... (get it!??)

19:40 arrdem: $google clojure-grimoire var-link

19:40 lazybot: [var-link 0.1.0 - Clojars] https://clojars.org/org.clojure-grimoire/var-link

19:40 joobus: at 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:40 technomancy: tbaldridge: to me it indicates that people value working legacy code more than they value cleanliness

19:41 tac_: tbaldridge: It's the same as with any business, don't you think?

19:41 arrdem: aperiodic: 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:41 TEttinger: technomancy, yeah I'd think the working part could be emphasized :)

19:41 tac_: Once you get large enough, it becomes harder and harder to make any meaningful changes to the way you do things

19:42 Python just wanted to feel like a start up again. Like a young, cool language again.

19:42 bounb: interesting. i didn't know about Hy

19:43 aperiodic: arrdem: ah, ok. I realize now that clojuredoc's all came from manual work as well

19:43 tbaldridge: well 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:43 arrdem: aperiodic: 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:43 tbaldridge: For 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:43 arrdem: aperiodic: actually kinda screwed ATM because I'm working on what amounts to a schema migration over a filesystem

19:44 but whenever I manage to roll the next release those should be real links.

19:44 tac_: 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:44 Bronsa: tbaldridge: maybe for clojure 2.0 :)

19:44 aperiodic: arrdem: a schema migration on schema-less data?

19:44 tbaldridge: tac_: perhaps...but then there are other people who are calling for a fork instead

19:44 tac_: Major projects will accomodate and begin supporting python 3. Projects which don't will just die out slowly over time.

19:45 considering how similar the languages are, a fork seems even more frivolous than the change itself :)

19:46 arrdem: aperiodic: it's totally schema'd.

19:46 http://grimoire.arrdem.com/API

19:47 tbaldridge: Bronsa: I seriously doubt Clojure 2.0 will break anything major (even if 2.0 were a thing, which it's not...)

19:47 arrdem: http://grimoire.arrdem.com/api <- real link

19:50 tuft: hah, hy is neat. great lisp machine stylings on the "try it" web repl http://try-hy.appspot.com/

19:50 Bronsa: tbaldridge: 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:55 ken77: hi! 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:13 celwell: Why do I sometimes see "clojure.core.reducers/map" in projects? Shouldn't it just be "map"? I thought "map" is part of core?

20:14 hiredman: what you think of as just "map" is actually clojure.core/map, global names are namespaced in clojure

20:15 celwell: clojure.core/map would make sense to me but I said clojure.core.reducers/map

20:15 hiredman: clojure.core.reducers/map is a different function named map in the namespace clojure.core.reducers

20:15 TEttinger: (doc clojure.core.reducers/map)

20:15 clojurebot: I don't understand.

20:16 TEttinger: ,(doc clojure.core.reducers/map)

20:16 clojurebot: Cool story bro.

20:16 hiredman: namespaces 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:16 TEttinger: that's a bit odd

20:16 why doesn't clojurebot get the doc for that?

20:16 hiredman: ,(require 'clojure.core.reducers)

20:16 clojurebot: #<FileNotFoundException java.io.FileNotFoundException: Could not locate clojure/core/reducers__init.class or clojure/core/reducers.clj on classpath: >

20:16 TEttinger: ,(doc core.reducers/map)

20:16 clojurebot: Huh?

20:16 hiredman: or whatever

20:16 the namespace isn't loaded and the sandbox won't let you load it

20:17 TEttinger: ok

20:33 xulfer: What'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:35 TEttinger: xulfer, do you want cross-platform?

20:36 xulfer: Yes if possible.

20:42 TEttinger: there's a list here, xulfer http://alternativeto.net/software/growl/

20:43 but none are cross-desktop-platforms

20:43 snarl seems good for windows, even has gradle integration

20:44 that said, these all need something installed by the user to work

20:44 xulfer: hm seems strange

20:45 I'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:49 TEttinger: Thanks for the tip anyway. I guess I'll have to use the conditional lein stuff to support multiple platforms?

20:49 TEttinger: well there was one for swing....

20:50 http://www.swingfx.ch/ GPL license may be rough

20:50 xulfer: Blah. Yeah.

20:51 Even using growl on OS X seems a bit hawkish. Since it's used native notifications for some time now...

21:25 bacon1989: does anyone here have experience with clojurescript's :advanced compilation?

21:25 sdegutis: Thanks in advance.

21:25 bacon1989: whenever I compile it, it doesn't create the ./out/ folder, as described

21:27 as 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:28 hiredman: cljsbuild is its own thing beyond what clojurescript's compiler does

21:28 I would checkout out the docs for cljsbuild

21:28 bacon1989: hiredman: I have, it says it creates itself automatically

21:29 that there should be a goog/ folder, with base.js in it

21:29 tac_: Is clojurescript sufficiently different from clojure to warrant a separate name?

21:29 hiredman: yes

21:30 bacon1989: where do you see that? from what I have seen advanced compilation results in one file spit out to disk

21:31 bacon1989: hiredman: you need to include :output-dir, if i'm not mistaken

21:31 hiredman: which is all I see in all the examples in the cljsbuild readme, they all show giving a single file as the output

21:31 bacon1989: hmm

21:32 hiredman: bacon1989: 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:33 bacon1989: so, does that mean I need to go and grab google closure myself?

21:33 not that it's a big deal, I figured this would be automated though

21:34 considering it's using the same compiler to generate my code...

21:34 (or shrink it, i mean)

21:34 hiredman: bacon1989: what do you mean by that?

21:35 bacon1989: advanced mode compilation does a whole ton of things including tree shaking, which removes any unused code

21:36 bacon1989: yeah, but i'm automaticaly referencing goog libraries within my code

21:36 goog clojure is already being used, and the example states that I need to require some extra scripts

21:36 like seen here https://github.com/google/closure-library.git

21:37 woops, here https://github.com/clojure/clojurescript/wiki/Quick-Start#using-clojurescript-on-a-web-page

21:37 in fact, the link above it is what I need

21:37 but somehow, my code is getting all of the google base.js files compiled into it, and :advanced separates that out

21:38 hiredman: bacon1989: 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:39 bacon1989: no 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:40 hiredman: what are you trying to do and what isn't working?

21:40 bacon1989: I 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:41 i'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:41 hiredman: bacon1989: 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:42 bacon1989: why do you need a goog/ in your output folder?

21:42 advanced mode compilation includes the code from any closure library you use in the single file it outputs

21:42 bacon1989: well, 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:43 are you sure?

21:43 hiredman: yes, the closure compile is a whole program optimizer

21:45 bacon1989: hiredman: i'm pretty sure that's for :simple compilation though

21:45 hiredman: no

21:45 if anything simple is the mode that would give you multiple files

21:46 bacon1989: hiredman: simple works fine as a single file

21:46 hiredman: advanced inlines code and renames all the functions to have short names to compress the code size

21:46 bacon1989: 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:47 after advanced mode is done with it, it doesn't make sense as multiple modules

21:49 bacon1989: hiredman: it isn't 'multiple modules,' it's a single file that needs to be 'required' using goog/base.js

21:50 so goog holds the google closure library, and it 'requires' my library within it's ecosystem

21:50 hiredman: bacon1989: oh, are you trying to build a redistributable library?

21:51 bacon1989: hiredman: not even, i'm just trying to reduce the size of my javascript file

21:51 but when you do advanced compilation, it's supposed to generate the ./goog folder with the google closure libraries

21:52 hiredman: bacon1989: it isn't

21:52 bacon1989: hiredman: just look at this, please explain this https://github.com/swannodette/om#using-it

21:52 look at the <html <script tags

21:52 and see what it's doing with goog/base.js

21:53 and see how it's 'requiring' it?

21:53 hiredman: so?

21:53 clojurebot: so is (add-to-list 'erc-keywords '("\\bso\\b" erc-default-face))

21:53 hiredman: bacon1989: nothing in there mentions goog/

21:53 bacon1989: <script src="out/goog/base.js" type="text/javascript"></script>

21:53 hiredman: «This will generate a single file main.js. Your production markup should look something like this:»

21:53 bacon1989: <script type="text/javascript">goog.require("main.core");</script>

21:54 fucking look at it, it is using goog.require to 'require' the main.core namespace

21:54 hiredman: bacon1989: yeah, with :optimizations :none

21:54 you are looking at the developement setup

21:54 bacon1989: ugh

21:54 idk what i'm doing wrong then

21:55 when I compile and run my file, it says 'foo is not defined'

21:58 oh, here's a good question, does it not ^export when I choose advanced compilation?

22:03 I think I figured it out

22:04 since i'm not calling some of my functions (since it's a library), the advanced compilation is aggressively removing them from my library

22:09 mynomoto: bacon1989: you need to ^export everything in the public api.

22:10 bacon1989: mynomoto: is this good enough? https://github.com/benzap/flyer.js/blob/master/src-cljs/flyer/wrapper.cljs

22:11 they don't appear to be showing up for some reason

22:13 I keep getting 'flyer is not defined' when I try and used the advanced build

22:13 mynomoto: bacon1989: it's ^:export iirc

22:14 bacon1989: Have you changed ^export to ^:export ?

22:14 bacon1989: mynomoto: omg, thank you so much

22:14 maravillas: it is a little awkward, but thankfully i've never had rsi issues with it, somehow

22:14 whoops

22:15 bacon1989: hiredman: thank you for dealing with my insanity

22:15 that did the trick, the library is now going to be like an order of magnitude smaller

22:15 fucking magical

22:16 mynomoto: bacon1989: np

22:16 bacon1989: oh bummer, some things still aren't working, but i'm sure I can work them out

23:10 joobus: can someone explain this, from here: https://github.com/viebel/clojure-koans/blob/master/src/koans/destructuring.clj

23:11 this part: (fn[[a b] {:keys [street-address city state]}]

23:11 does the :keys map to the keywords declared above?

23:13 arrdem: yes. 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:14 joobus: so :keys is a special kind of key? or could that be any keyword?

23:14 like :something?

23:15 arrdem: it's not clear to me what you're saying. example?

23:16 joobus: would this map the same way: {:something [street-address city state]}

23:16 arrdem: no. :keys is special.

23:16 joobus: ok, thanks :)

23:16 arrdem: the "normal" map destructuring format is {symbol-to-bind value-to-bind-from}

23:16 the exceptions are :or, :keys and :as.

23:17 which may occur as map keys and have special behaviors.

23:17 joobus: ok

23:17 arrdem: https://gist.github.com/john2x/e1dca953548bfdfb9844

23:18 see the "Maps" and "Shortcuts" headings

Logging service provided by n01se.net