2016-03-15
| 00:08 | mmercer | i was banned in #haskell but not in here. if that doesn't prove that clojure is superior I don't know what does |
| 00:19 | ben_vulpes | patience is next to godliness or what was it |
| 00:23 | tolstoy | Should it be possible to (using component) do something like (merge (system/map :some thing) {:other thing} {:still-other thing})? |
| 00:26 | tolstoy | Hm. Seems to return a SystemMap, so that's a yes, I guess. |
| 01:19 | pmbauer_ | somebody please ban mmercer; those comments are inappropriate, sexist, unprofessional and do not represent the Clojure community |
| 01:20 | tolstoy | Doesn't seem to be an op. |
| 01:20 | rhg135 | I'd hope not |
| 01:21 | rhg135 | I think they just don't idle as op |
| 01:23 | tolstoy | Plus it's late. I wonder how they'd get notified? |
| 01:24 | rhg135 | PushX? |
| 01:25 | tolstoy | I think puredanger is one. amolloy another? |
| 01:25 | tolstoy | Or, amalloy. |
| 01:26 | rhg135 | Yeah |
| 01:26 | rhg135 | I don't think amalloy sleeps anyway |
| 01:44 | whunix | Hi, what's a good tutorial for beginners? |
| 01:44 | whunix | I am going to read about Racket HTDP book and then move on to Clojure from that |
| 01:44 | whunix | what book would be appropriate to read after that? |
| 01:45 | whunix | in terms of Clojure |
| 01:45 | faxmodem | whunix: clojure from the ground up |
| 01:45 | faxmodem | its online from aphyr |
| 01:45 | tolstoy | Just listened to a podcast with the author of: http://www.braveclojure.com. He said he approached it as he learned it being a Ruby programmer. |
| 01:45 | faxmodem | then maybe clojure for the brave and true |
| 01:46 | whunix | faxmodem, where's the book? Can't find it :( |
| 01:47 | tolstoy | https://aphyr.com/posts/301-clojure-from-the-ground-up-welcome |
| 01:48 | whunix | tolstoy, is that all? |
| 01:48 | tolstoy | There's a link at the bottom to the next chapter. |
| 01:49 | tolstoy | Summary: https://aphyr.com/tags/Clojure-from-the-ground-up |
| 01:51 | whunix | isn't it better to just jump into Braveclojure? |
| 01:52 | tolstoy | Sure. I think it depends on your familiarity with functional programming, or Lisp, etc, etc, or your general programming experience. Might start with one of the books. Clojure Programming, or what have you. |
| 02:49 | irctc | In http-kit I want to defer the answer of http request, like return a future or something, what is the idiomatic way to do that? |
| 03:04 | Empperi | so you mean when using http-kit client and you make a request and want to get the response via defer? |
| 03:04 | Empperi | it's built in http-kit client http://www.http-kit.org/client.html#sync |
| 03:05 | Empperi | if you are talking about having http-kit as a server and calling it from browser with clojurescript then the short answer is "you don't" |
| 03:05 | Empperi | the long answer is "use core.async" although that too won't be synchronous |
| 03:05 | clojurebot | Ik begrijp |
| 03:06 | Empperi | but close at least |
| 03:06 | Empperi | and wtf clojurebot |
| 03:06 | Empperi | you messing with me? lol |
| 03:24 | amalloy | ~the long answer |
| 03:24 | clojurebot | the long answer is "use core.async" although that too won't be synchronous |
| 03:28 | Empperi | lol |
| 03:34 | opqdonut | :D |
| 05:15 | CStorm | so anyone have a read/video for me who are looking to get insight in different database options? |
| 05:15 | CStorm | reading "mongodb sucks" is getting old, so trying to get a more insight in alternatives. |
| 05:16 | CStorm | or atleast to why mongodb sucks ;) |
| 05:21 | Empperi | mongodb doesn't have relations in any way and it doesn't have transactions and it doesn't have any support for schemas |
| 05:21 | Empperi | that enough for you why mongodb sucks? :) |
| 05:21 | prohobo | mongodb sucks |
| 05:21 | Empperi | but in truth mongodb doesn't suck |
| 05:22 | Empperi | but it sucks as a general purpose database |
| 05:22 | prohobo | its webscale |
| 05:22 | Empperi | for specific use case scenarios mongo is awesome |
| 05:23 | CStorm | what db should i read up on as a general purpose database? |
| 05:23 | CStorm | specific for clojure |
| 05:23 | prohobo | CStorm: postgres prolly |
| 05:23 | ridcully_ | CStorm: postgres |
| 05:23 | CStorm | haha |
| 05:23 | CStorm | :D |
| 05:23 | prohobo | :| |
| 05:23 | CStorm | goodie, thanks guys. |
| 05:24 | Empperi | yeah, postgres is a great choice for a lot of stuff |
| 05:24 | CStorm | being at ios and osx for 6-7 years and shifting to clojure has it ups and downs :) |
| 05:24 | CStorm | one of them being a mess to figure out the whole db mess. |
| 05:25 | Empperi | you've never used databases? |
| 05:25 | Empperi | you're up for a rough ride my friend :) |
| 05:25 | CStorm | used coredata for ios |
| 05:25 | CStorm | but else no |
| 05:26 | CStorm | might be rough but looking forward to it :) |
| 05:26 | CStorm | gotta start somewere right |
| 05:26 | prohobo | whats so rough about using dbs |
| 05:27 | Empperi | well for starters, you have learn a new language: SQL |
| 05:27 | Empperi | and to understand how relational databases work |
| 05:28 | Empperi | also there's transactions and transaction isolation levels |
| 05:28 | Empperi | there is a reason why there are people whose sole purpose is to do stuff with relational databases :) |
| 05:28 | Empperi | same thing goes for other types of databases |
| 05:29 | Empperi | not that it won't be a truly enlightening journey to learn all that stuff but it's going to be a rough ride and there's tons of new stuff to learn |
| 05:30 | CStorm | well what kinda programmer would i be if i just would say "ugh im already behind the wagon i dont wanna learn it" |
| 05:30 | CStorm | im looking forward to it, no matter how "rough" it will be :) |
| 05:31 | i-blis | CStorm: if you're looking for a good read on DBs, give "seven databases in seven weeks" a shot; it gives a nice overview on what you get with the different paradigms out there |
| 05:31 | CStorm | thank you i-blis, will look that up right away |
| 05:32 | Empperi | CStorm: indeed, that's the right attitude :) |
| 05:35 | prohobo | not a CS major? |
| 05:36 | ridcully_ | knowing SQL and what comes with it is IMHO a valuabe skill for a developer. but maybe i am just old |
| 05:37 | ridcully_ | also starting with it on most OS is just a `sqlite3` call away |
| 05:49 | CStorm | I bought the book now i-blis– looking forward to it. |
| 05:53 | i-blis | CStorm: hope you will enjoy it as I did (despite being a long time SQL user, I enjoyed even the chapter on PostgreSQL) |
| 05:57 | hyPiRion | I think sqlite3 is easier to get started with, but Postgres is really good once you've managed to get it up and running. That isn't always as straightforward as one would like though. |
| 06:13 | Empperi | ridcully_: no, you are not just old. You are correct |
| 06:14 | Empperi | that's especially true with Clojure and other languages with powerful set operations |
| 06:15 | prohobo | but you are also old |
| 06:18 | Empperi | it's all relative :) |
| 06:18 | Empperi | 34 years old |
| 06:18 | Empperi | I personally think I'm still young and in the beginning of my career |
| 06:21 | hyPiRion | Yeah, 34 is not much. |
| 07:14 | keksi_ | I have a problem modifying my data so I can handle it. I want to modify the structure from the from.clj to to.clj kind of data: https://gist.github.com/Keksike/77477abf2bfcbd5754ee , what should I do? |
| 07:14 | keksi_ | I dont think cheshire had a proper function for this one |
| 07:17 | faxmodem | I'm playing with overtone/at-at |
| 07:18 | faxmodem | when I'm running a function using (at/every 10000 #(myfunc a b c)) it doesn't behave the same as if run as (myfunc a b c) |
| 07:18 | ridcully_ | keksi_: pass true as second argument to parse-string. then you get keywords |
| 07:19 | keksi_ | ridcully_: I tried that too, but it got rid of the [ & ] |
| 07:19 | faxmodem | e.g. the side effects of myfunc are not observed when running it inside an every block |
| 07:20 | keksi_ | ridcully_: (and it put it in parantheses instead) |
| 07:21 | ridcully_ | yes. its a list then instead of a vector. |
| 07:22 | keksi_ | how do I convert it to a vector? |
| 07:23 | ridcully_ | ,(vector '({:a :b}{:c :d})) |
| 07:23 | clojurebot | [({:a :b} {:c :d})] |
| 07:24 | ridcully_ | DOH |
| 07:24 | ridcully_ | s/vector/vec/ |
| 07:24 | keksi_ | wow, thanks :) |
| 07:25 | faxmodem | or into |
| 07:25 | keksi_ | which is preferred? |
| 07:25 | faxmodem | good question :) |
| 07:25 | faxmodem | in terms of readability I'd vote for vec |
| 07:26 | ridcully_ | in terms of me remembering vector and vec i vote into ;) |
| 07:27 | faxmodem | :-D |
| 08:18 | kungi | Is there a difference between (vec) and (into []) |
| 08:31 | hyPiRion | kungi: not semantically |
| 08:32 | hyPiRion | But vec is likely more performant. |
| 08:33 | MJB47 | iirc it isnt |
| 08:33 | MJB47 | but i might be remembering wrong |
| 08:34 | MJB47 | it was tested by someone here a few weeks back |
| 08:37 | Empperi | kinda surprised if vec isn't faster |
| 08:37 | Empperi | it uses PersistentVector.create() under the hood |
| 08:37 | Empperi | while into uses transducers and conj |
| 08:44 | MJB47 | http://insideclojure.org/images/20150107/numbers.png |
| 08:44 | MJB47 | from http://insideclojure.org/2015/01/07/vec-perf/ |
| 10:22 | digiorgi | Hi, i'm trying to use clojure with maven, to get a good integration with other ides clojure + java. But when i'm starting CIDER on emacs, connecting from maven i get errors. |
| 10:22 | digiorgi | WARNING: The following required nREPL ops are not supported: |
| 10:22 | digiorgi | apropos classpath complete eldoc format-code format-edn info inspect-pop inspect-push inspect-refresh macroexpand ns-list ns-vars ns-path refresh resource stacktrace toggle-trace-var toggle-trace-ns undef |
| 10:22 | digiorgi | Please, install (or update) cider-nrepl 0.12.0-SNAPSHOT and restart CIDER |
| 10:22 | digiorgi | but i have installed the required version |
| 10:33 | justin_smith | is the cider-nrepl middleware properly loaded? I thought that it wouldn't work without lein. |
| 10:34 | justin_smith | well I guess boot maybe uses it too somehow? anyway, you'll need to do something to make it run properly in maven, it won't be automatic. |
| 10:52 | X-warrior | how would you guys represent your own tree structure? a map of maps? |
| 10:52 | justin_smith | that or a deftype |
| 10:54 | X-warrior | I was doing an exercise for an interview and represented the tree as a deftype. Today I received their answer saying that my code is too much OO and they wanted more functional programming |
| 10:54 | justin_smith | interesting - did you use mutable fields? |
| 10:55 | X-warrior | justin_smith: yes I did |
| 10:55 | justin_smith | aha, yeah, I might use deftype, but I would not use mutable fields unless absolutely neccessary |
| 10:56 | X-warrior | well, you have 1 node with one child... you add a new node, how can you add it without using mutable fields? |
| 10:57 | justin_smith | the same way you do with any other immutable data type - you have an operation that returns a new instance containing the new node |
| 10:57 | X-warrior | I guess my problem was that I created some deftype methods to add new node/retrieve specific node and others |
| 10:57 | justin_smith | eg (cons 1 ()) returns '(1) but () is not altered |
| 10:58 | justin_smith | X-warrior: you can still have methods to insert and retrieve - it's just a different style when working with immutable data |
| 10:59 | justin_smith | where of course insert returns a new tree (that can implicitly share structure with the original, since they are immutable, depending on implementation), and the retrieval would work the same as before |
| 11:04 | X-warrior | justin_smith: do you mind to take a look at the code to point some improvements that I could do, so it became more functional instead of OO ? |
| 11:04 | X-warrior | besides the mutable fields |
| 11:05 | X-warrior | now that I already failed at the test and spent so much time doing it, I would like to get better at this |
| 11:06 | justin_smith | X-warrior: I can take a look later, but really the mutable fields thing is what will make the biggest difference (I say without even seeing the code) |
| 11:07 | Glenjamin | what was the exercise brief? |
| 11:09 | X-warrior | Glenjamin: I had to do a reward system where a customer wins points for invitee from invitee on a 0.5^k |
| 11:10 | X-warrior | so direct invitee will give me 1 points, 0.5, 0.25... |
| 11:11 | ystael | you had to implement a pyramid scheme kickback mechanic as an interview question? o_O |
| 11:11 | justin_smith | just watch, they'll use his code to implement uber but for amway |
| 11:11 | X-warrior | ystael: well, it wasn't an interview question... it was one part of the hiring process |
| 11:12 | Glenjamin | hrm, my instinct is to record the parent of each customer with something like {:parent <parent-id>} |
| 11:12 | Glenjamin | and then when adding a new customer, traverse the graph and add points |
| 11:12 | X-warrior | https://bitbucket.org/matheusbrat/clojure/overview |
| 11:13 | Glenjamin | i guess something like {<id> { :parent <id>, :points n, :id <id> }, ...} |
| 11:13 | justin_smith | X-warrior: one issue with using a deftype with mutable fields, is that one assumes you will be using this structure in a webapp or some other process that handles concurrent clients, and mutable fields don't tend to handle concurrent update very well. This is kind of why we use immutable data structures with containers like atoms / agents / refs |
| 11:14 | justin_smith | otherwise you end up needing to mess with locking and such |
| 11:14 | X-warrior | Glenjamin: that seems as a nice approach |
| 11:16 | X-warrior | justin_smith: got it |
| 11:27 | ilevd | Hi, clojurebot |
| 11:27 | ilevd | ,(print "Hi!") |
| 11:28 | clojurebot | Hi! |
| 11:39 | ilevd | Ask, please |
| 11:41 | cortexman_ | what's the deal with paredit not allowing you to insert the parens that will fix the mismatch? |
| 11:42 | ilevd | I don't know |
| 11:43 | MJB47 | speaking of paredit |
| 11:44 | MJB47 | (f| (f2 v)) -> (f2 v) |
| 11:44 | MJB47 | whats the command called? |
| 11:44 | MJB47 | | being point |
| 11:44 | luma | raise |
| 11:44 | MJB47 | ty |
| 11:56 | justin_smith | cortexman_: I've found paredit handles missing ) that you insert by hand nicely, but not other kinds of closing delimiters, which makes me think it's a bug |
| 11:56 | justin_smith | cortexman_: the easiest thing is to turn off paredit, fix the matching, then turn it back on again. |
| 11:57 | justin_smith | cortexman_: but you can also use commands like kill and yank without being affected by paredit, so that's another approach |
| 11:57 | cortexman_ | got some good tips from #lisp. i.e., to fix ((( ))) to ((( ])), stick the cursor in the space in the middle, M-z ) C-q ] M-z is zap-to-char and C-q is quoted-insert |
| 11:58 | justin_smith | ahh, nice |
| 11:58 | justin_smith | so yeah, zap-to-char and quoted-insert must also be outside paredit, like kill-region and yank are |
| 11:58 | cortexman_ | yeah |
| 11:59 | cortexman_ | i think it's fewer keystrokes this way, maybe. |
| 11:59 | justin_smith | also in evil mode, r is not effected by paredit, so you can insert spaces and use r to change each one to the right kind of delimiter |
| 11:59 | cortexman_ | i have been thinking about switching to evil mode, but have not taken the dive |
| 12:00 | justin_smith | I switched, and I liked it so much that I eventually started using vim |
| 12:00 | justin_smith | haha |
| 12:00 | cortexman_ | lol. |
| 12:00 | cortexman_ | this is a good reason to use emacs: https://github.com/RallySoftware/rally-emacs |
| 12:01 | justin_smith | in terms of being able to extend it to make apps, emacs is at least as good as the browser (though not nearly as pervasively deployed) |
| 12:05 | justin_smith | wooh, this guy used my webapp to help write this article! http://www.vox.com/2016/3/15/11225128/donald-trump-gullible-internet |
| 12:05 | justin_smith | (webapp is full stack clojure/cljs) |
| 12:06 | justin_smith | direct link to the part that came from our app http://www.getlittlebird.com/blog/data-62-of-the-people-donald-trump-rted-this-week-follow-multiple-white-supremacist-accounts |
| 12:27 | TimMc | Fun! |
| 12:31 | justin_smith | As compared to what my prior work has been used for, it's definitely gratifying to see the product of my sweat used that way. |
| 12:32 | TimMc | To the extent to which I can get excited about anything with "social media" in the title, this is neat. :-P |
| 12:32 | justin_smith | heh, it's a fun app to work on |
| 12:33 | TimMc | (my social media strategy is the LeechBlock browser add-on) |
| 12:59 | sfz- | XD |
| 13:43 | tolstoy | I use Control-Q (quote) and Control-W (delete) to repair par-edit stuff. |
| 14:09 | ben_vulpes | does anyone know where the datomic provisioning clojure lives, if it's even available to the public? |
| 14:13 | amalloy | isn't life a lot easier if you just don't break paredit stuff? how does everyone end up with so many unbalanced expressions? |
| 14:17 | TimMc | amalloy: It sometimes happens. I have no idea how. |
| 14:17 | TimMc | Paredit does have at least one bug around comments, though. |
| 14:36 | sdegutis | Welcome. |
| 14:51 | sdegutis | Welcome to #clojure. |
| 14:53 | TimMc | anything is possible at #clojure |
| 14:53 | TimMc | the only limit is yourself |
| 14:55 | rcg | ,(/ 1 0) |
| 14:55 | clojurebot | #error {\n :cause "Divide by zero"\n :via\n [{:type java.lang.ArithmeticException\n :message "Divide by zero"\n :at [clojure.lang.Numbers divide "Numbers.java" 158]}]\n :trace\n [[clojure.lang.Numbers divide "Numbers.java" 158]\n [clojure.lang.Numbers divide "Numbers.java" 3808]\n [sandbox$eval25 invokeStatic "NO_SOURCE_FILE" 0]\n [sandbox$eval25 invoke "NO_SOURCE_FILE" -1]\n [clojure.lang... |
| 14:55 | rcg | or the laws of mathematics... |
| 14:55 | rcg | scnr |
| 14:56 | sdegutis | You can do /anything/ at #clojure. |
| 14:57 | TimMc | rcg: http://zombo.com/ |
| 14:57 | sdegutis | Anything at all. |
| 14:58 | sdegutis | This is #clojure, and welcome, to you, who have come to #clojure! |
| 14:59 | sdegutis | The infinite is possible at #clojure. The unattainable is unknown at #clojure. |
| 14:59 | tolstoy | paredit rarely breaks for me, but sometimes I inadvertently cut/paste something wrong from a non-Emacs buffer. |
| 14:59 | sdegutis | Oh man. This site takes me back. |
| 14:59 | sdegutis | tolstoy: that's what undo-tree is for |
| 14:59 | tolstoy | Missing Plug-in? |
| 14:59 | sdegutis | because Emacs without undo-tree is literally just pure unadulterated insanity. |
| 15:00 | rcg | TimMc, sorry, due to lack of plugins, i cannot watch that, even got my linux box from the shelf to check. but according to the wikipedia article it sounds quite entertaining :) |
| 15:02 | mavbozo | you can get "anything" from infinity at #clojure |
| 15:02 | mavbozo | ,(get Double/POSITIVE_INFINITY get "anything") |
| 15:02 | clojurebot | "anything" |
| 15:06 | sdegutis | mavbozo: bravissimo |
| 15:07 | sdegutis | TIL you can intensify Italian words like "bravo" by adding "issim" after the final consonant |
| 15:07 | sdegutis | Also pianissimo means "very quiet" |
| 15:07 | sdegutis | er, very soft |
| 15:17 | mavbozo | sdegutis: grazie infinite! |
| 15:22 | sdegutis | Today my job is to normalize internal data using a sequence of regex-based migrations. |
| 15:23 | sdegutis | What can go wrong? |
| 15:23 | ystael | sdegutis: where are you located, roughly? i want to know whether i need to get a car and start driving |
| 15:23 | sdegutis | :D |
| 15:37 | X-warrior | justin_smith: I changed my solution to use a map as proposed. Did you have time to take a look on the previous version? |
| 15:59 | mavbozo | ,(:a.b.c/foo {:a.b.c/foo :bar}) |
| 15:59 | clojurebot | :bar |
| 16:00 | mavbozo | is it okay to have keyword which has '.' in its namespace part? |
| 16:01 | mavbozo | but this http://clojure.org/reference/reader#_literals says keywords cannot contain '.' |
| 16:02 | hiredman | it is refering to the name part |
| 16:03 | hiredman | keywords and symbols have name and namespace parts |
| 16:05 | hiredman | the set of allowed characters for symbols and namespaces on th reader page don't match the characters the reader actually accepts, and are just for symbols and keywords created via the reader |
| 16:06 | mavbozo | got it. thanks hiredman |
| 16:10 | hiredman | ,:foo.bar |
| 16:10 | clojurebot | :foo.bar |
| 16:10 | hiredman | ,*clojure-version* |
| 16:10 | clojurebot | {:major 1, :minor 8, :incremental 0, :qualifier nil} |
| 16:34 | TimMc | ,(keyword ":") |
| 16:34 | clojurebot | :: |
| 16:46 | sdegutis | Does something like distinct-by make sense? |
| 16:47 | sdegutis | So that (distinct-by first [0 :a] [0 :b] [1 :c]) would -- oh wait |
| 16:47 | sdegutis | Hmm. Guess I need to transform my data. |
| 17:29 | sdegutis | Bye. |
| 17:38 | sdegutis | What's an agreeable way to tell if any item in a collection satisfies a given predicate? |
| 17:38 | sdegutis | Something like (any? coll f) |
| 17:39 | cfleming | sdegutis: (some f coll) |
| 17:39 | sdegutis | Hmm, strange name. |
| 17:39 | sdegutis | Thanks Colin. |
| 17:39 | sdegutis | I had a feeling that was the function, but it seemed like maybe I was going insane. |
| 17:39 | justin_smith | ,(some nil? [false nil true]) |
| 17:40 | clojurebot | true |
| 17:40 | sdegutis | Thanks Justin. |
| 17:40 | justin_smith | heh, just reminding myself how it behaved |
| 17:41 | sdegutis | Hmm. Interesting. |
| 17:42 | sdegutis | Our data is just so... actually, no, there aren't words to describe it. |
| 17:48 | sdegutis | cfleming: so how's your IDE going? |
| 17:49 | cfleming | sdegutis: It's going really well. |
| 17:49 | cfleming | Lots of free non-commercial licences gone out, but lots of people paying for it too. |
| 17:50 | cfleming | So it's definitely looking sustainable at this point, assuming a reasonable number of people renew and some growth in the community. |
| 17:50 | sdegutis | cfleming: So has it become a full time gig now? |
| 17:50 | cfleming | Yeah, it has been for a while now. |
| 17:50 | sdegutis | Sweet. |
| 17:50 | sdegutis | I like your icons of companies who use it on your home page. That's a clever idea. |
| 17:51 | cfleming | I'm just getting back to development in the last couple of weeks after the support spike after releasing. |
| 17:51 | sdegutis | Yikes, that sounds like it was really boring. |
| 17:51 | cfleming | Thanks! I think a lot of companies do that for their products. Lots of companies don't allow use of their logo, sadly. |
| 17:52 | cfleming | Yeah, that and licensing, EULAs, payment systems, etc etc - I haven't done much real work since October/November. |
| 17:54 | ben_vulpes | 'real work' heh |
| 17:54 | cfleming | Yeah, none of the rest feels like real work, it's all necessary though. |
| 18:09 | cortexman | i'm trying to figure out how to link my cljs buffer with my ClojureScript REPL in emacs |
| 18:13 | cortexman | supposedly it's C-c M-J (capital J) but it doesn't seem to hook up correctly |
| 18:15 | sdegutis | cfleming: I hear ya, I'm only recently getting back into being really productive. |
| 18:23 | rhg135 | productivity is a lie |
| 19:19 | Kamuela | rhg135: lol |
| 20:02 | sdegutis | So I guess ->> can't see on the inside of #() special forms. |
| 20:02 | sdegutis | ,((->> [1 2 3] (map inc) #(apply +))) |
| 20:03 | clojurebot | #error {\n :cause "Wrong number of args (1) passed to: core/apply"\n :via\n [{:type clojure.lang.ArityException\n :message "Wrong number of args (1) passed to: core/apply"\n :at [clojure.lang.AFn throwArity "AFn.java" 429]}]\n :trace\n [[clojure.lang.AFn throwArity "AFn.java" 429]\n [clojure.lang.RestFn invoke "RestFn.java" 412]\n [sandbox$eval25$fn__26 invoke "NO_SOURCE_FILE" 0]\n [sandbox... |
| 20:04 | sdegutis | Ever notice that? |
| 20:07 | justin_smith | ,(macroexpand '((->> [1 2 3] (map inc) #(apply +)))) |
| 20:07 | clojurebot | ((->> [1 2 3] (map inc) (fn* [] (apply +)))) |
| 20:09 | justin_smith | ,(macroexpand '(->> [1 2 3] (map inc) #(apply +))) ; sdegutis - this makes it pretty clear what happens |
| 20:09 | clojurebot | (fn* [] (apply +) (map inc [1 2 3])) |
| 20:25 | rhg135 | ,'#() |
| 20:25 | clojurebot | (fn* [] ()) |
| 20:29 | TimMc | ,(-> foo #(inc 5) ()) |
| 20:29 | clojurebot | #error {\n :cause "Can't call nil, form: (nil (fn* foo [] (inc 5)))"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.IllegalArgumentException: Can't call nil, form: (nil (fn* foo [] (inc 5))), compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6875]}\n {:type java.lang.IllegalArgumentException\n :message "Can't call nil, fo... |
| 20:29 | TimMc | mmm, right |
| 20:29 | TimMc | also, interesting |
| 20:30 | TimMc | ,(macroexpand-1 '(-> 4 ())) |
| 20:30 | clojurebot | (nil 4) |
| 20:33 | rhg135 | What? |
| 20:33 | clojurebot | What is sampling a random integers betwen 2, 12 s..t. P(X = i) = (7-|i-7|)/36 |
| 20:34 | rhg135 | Right? |
| 20:39 | justin_smith | what a card |
| 20:41 | rhg135 | I know. clojurebot is so funny and smart and cool |
| 20:42 | justin_smith | I just wish clojurebot would stop stealing my girl. |
| 20:43 | TimMc | rhg135: The macro sees a list and does (cons (first list-form) (cons inserted-form (rest list-form))) or something |
| 20:43 | TimMc | which is (cons nil (cons 4 ())) in this case |
| 20:43 | rhg135 | Ah |
| 20:44 | rhg135 | justin_smith: who is your girl? |
| 20:44 | TimMc | https://github.com/clojure/clojure/blob/clojure-1.7.0/src/clj/clojure/core.clj#L1564 yep, except it's using unquote-splicing |
| 20:45 | justin_smith | rhg135: sadly "my girl" is a rhetorical phrase used for comical effect |
| 20:47 | rhg135 | Ah, those love triangles |
| 23:48 | sdegutis | Hi. |
| 23:48 | sdegutis | I forgot why I opened IRC, but here I am. |