2015-10-25
| 12:20 | irctc | spent some time searching for answers to this question |
| 12:21 | irctc | why isn't it "not?" |
| 12:25 | irctc | also, why isn't it "boolean?" |
| 12:26 | irctc | maybe these are the basic building blocks of the language? |
| 12:33 | justin_smith | irctc: not? isn't checking the status of some thing |
| 12:34 | justin_smith | similarly, boolean? would imply you are asking whether it is boolean or not |
| 12:35 | irctc | ok. That makes sense. But the style guidance says name predicates with a ? |
| 12:35 | irctc | not does feel different though |
| 12:35 | justin_smith | boolean is not a predicate, nor is not |
| 12:35 | irctc | why |
| 12:35 | justin_smith | just because something returns true or false doesn't make it a predicate - a predicate asks some question about the input and answers true or false |
| 12:35 | irctc | I see |
| 12:36 | irctc | so false? is a predicate, but not is not |
| 12:36 | justin_smith | exactly |
| 12:38 | irctc | cool, thanks |
| 12:39 | irctc | I was thinking they're functionally equivalent, but you can't even say that |
| 12:39 | justin_smith | ,(false? nil) |
| 12:39 | irctc | b/c (false? nil) |
| 12:39 | clojurebot | false |
| 12:39 | irctc | right |
| 12:39 | irctc | ,(false? false) |
| 12:39 | clojurebot | true |
| 12:39 | justin_smith | ,((comp false? boolean) nil) |
| 12:39 | clojurebot | true |
| 12:39 | justin_smith | hah |
| 12:39 | irctc | cool |
| 12:44 | noncom|2 | does anybody know, can i do non-destructive batch-insert with mongo? |
| 12:44 | noncom|2 | i want to only insert what's missing... |
| 12:53 | justin_smith | noncom|2: is this related to upsert? |
| 13:21 | dnolen | https://github.com/omcljs/om/wiki/Applying-Property-Based-Testing-to-User-Interfaces |
| 13:43 | noncom|2 | justin_smith: well, idk.. there's upsert for single insert. for batch insert i haven't found upsert possibility |
| 13:45 | noncom|2 | or rather not for single insert, but for single update |
| 13:45 | noncom|2 | which might act as upsert |
| 13:45 | noncom|2 | but there's nothing like that for batcg |
| 13:45 | noncom|2 | *batch |
| 13:46 | noncom|2 | gonna ask on #mongodb |
| 15:02 | xeqi | is there a project that extends clojure.java.io's mutlimethods to nio2? |
| 16:30 | noncom | what was that function to get only the diverse elements of a sequence? |
| 16:31 | noncom | distinct |
| 16:57 | Frozenlock | Is there a way to get CIDER to print the functions in lisp form, instead of #object[...] ? |
| 16:58 | justin_smith | Frozenlock: functions do not carry their source info, though the var holding one might |
| 18:16 | hlolli | What would be a good way to filter random x many elements from collection that produces no duplicaties? |
| 18:21 | hlolli | nevermind, stackoverflow came to rescue (just googled badly) |
| 18:22 | justin_smith | (take n (distinct (shuffle coll))) right? |
| 18:24 | Seylerius | Weird. Lobos isn't coming in properly. |
| 18:24 | hlolli | I actually did that for a while, was trying to recurse it, maybe wrong approach. Solution I found here is good http://stackoverflow.com/questions/24553212/how-to-take-n-random-items-from-a-collection-in-clojure |
| 18:25 | hlolli | from user tnoda, has seed in it, very good to "freeze" the result, perfect for my application. |
| 18:26 | Seylerius | Keeps failing with ClassNotFoundException |
| 18:26 | Seylerius | WTF? |
| 18:26 | justin_smith | Seylerius: what driver are you using for clojure.java.jdbc? |
| 18:27 | Seylerius | org.postgresql.Driver |
| 18:27 | justin_smith | can you share a paste of the stacktrace? |
| 18:29 | Seylerius | justin_smith: (:use [lobos.core]) produces this: http://sprunge.us/fTAK |
| 18:31 | justin_smith | Seylerius: it's saying class not found for lobos.core itself - is that :use inside an ns form? |
| 18:31 | Seylerius | That one is in the repl |
| 18:32 | justin_smith | Seylerius: in the repl you should be doing (use 'lobos.core) |
| 18:32 | Seylerius | Unable to resolve symbol: use in this context |
| 18:32 | justin_smith | umm... (clojure.core/refer-clojure) will fix that, you are in a broken namespace |
| 18:34 | Seylerius | There we go. |