2012-10-06
| 00:02 | aperiodic | arrdem: what, gg=G no good? |
| 00:07 | Sgeo | How often is let with mutable over lambda done in Clojure? |
| 00:30 | Sgeo | Is there a way to suggest changes to Clojuredoc? |
| 00:31 | Sgeo | Pretty much to hunt down all uses of #{} where there should be a note about it vs. contains? |
| 00:42 | Sgeo | Is it supposed to be interesting that it's easy to nest ->> inside -> but not the other way around? |
| 01:08 | duck1123 | is anyone here using lolg to do their cljs logging, and if so, have you noticed the newline after every message? |
| 01:09 | duck1123 | although I'm thinking it might be straight up goog.debug.Console that's doing it |
| 01:19 | arrdem | aperiodic: never seen that one before... |
| 01:19 | aperiodic | arrdem: what, =? it's pretty handy |
| 01:20 | arrdem | can you explain that? |
| 01:20 | arrdem | I've never seen it |
| 01:21 | arrdem | and it has sudenly selected everything |
| 01:21 | arrdem | 0.o |
| 01:21 | aperiodic | that doesn't seem right |
| 01:21 | aperiodic | gg moves you to top of file |
| 01:21 | aperiodic | = is the formatting command |
| 01:22 | aperiodic | G moves you to the bottom |
| 01:22 | arrdem | k... according to SO = only fixes indentation |
| 01:22 | arrdem | ah |
| 01:22 | aperiodic | oh, i thought that's what you meant |
| 01:22 | arrdem | I haz idea |
| 01:25 | arrdem | bingo |
| 01:25 | arrdem | hanfway there, thanks! |
| 01:25 | aperiodic | sure thing |
| 01:26 | arrdem | crap.. |
| 01:26 | arrdem | Imma just eval and pprint this crap |
| 01:49 | Sgeo | I have it. |
| 01:49 | Sgeo | I know what my ideal syntax for using monads looks like, and how it works. |
| 01:54 | Sgeo | It would probably be best to use jimduey's protocol monads |
| 01:58 | Sgeo | And relies on delimc |
| 02:55 | Roxxi | Hey, I got a riddle for anyone who's still awake... https://www.refheap.com/paste/5569 |
| 02:55 | Roxxi | I've spent 2 hours suffering at the hands of this... |
| 02:59 | ivan | Roxxi: you must use the return value from assoc! |
| 02:59 | ivan | Roxxi: you can't just bang on the transient like that |
| 03:00 | Roxxi | Oh? |
| 03:00 | Roxxi | crap. |
| 03:00 | Roxxi | lol |
| 03:00 | Roxxi | I thought that was the whole point? |
| 03:02 | ivan | http://clojure.org/transients see two paragraphs before Example |
| 03:03 | Roxxi | I'm abusive, what can I say? |
| 03:03 | Roxxi | Thank you *so* much ivan. |
| 03:04 | ivan | I did not believe it when I read it in Clojure Programming. that ! is very confusing. |
| 03:05 | Roxxi | Heh. For whatever reason, that didn't stick with me either. I just thought it was the same as calling mutative methods. |
| 03:08 | Roxxi | Soooo what's a good syntatic element to use to iterate through a sequence, but so that I can use the return value each time... reduce? |
| 03:33 | brainproxy | having little luck getting clojure.pprint/write to enforce a right margin |
| 03:34 | brainproxy | what I want is for "submaps" of the map to get likewise pretty-printed |
| 03:34 | brainproxy | maybe right-margin isn't what I'm looking for ... |
| 06:37 | john2x | is it possible to use a function with arity 2 with `map`, but pass a "fixed" argument for the second parameter? |
| 06:41 | john2x | ah `repeat` does the trick for the second parameter.. |
| 07:04 | _ulises | john2x: alternatively you could use an anonymous fn and fix the parameter yourself in there? |
| 07:21 | jaju | Hello nice folks! |
| 07:21 | jaju | I need some help with my IDE setup - emacs, nrepl, lein. |
| 08:51 | casion | does anyone know of any places that discuss clojure.core.reducers? I need a bit of a boost in understanding their usefulness and application |
| 09:00 | fredyr | casion: have you looked at the screencast about the library? |
| 09:00 | fredyr | or presentation really |
| 09:00 | casion | fredyr: no, I have't found that yet |
| 09:00 | casion | or didn't notice it :) |
| 09:00 | fredyr | hang on, i'll see if i can find the link |
| 09:01 | fredyr | oh here it is |
| 09:01 | fredyr | http://www.infoq.com/presentations/Clojure-Reducers |
| 09:01 | casion | awesome, thank you |
| 09:02 | fredyr | yw |
| 09:12 | wingy | if i want to put a new element in a sequence should i use conj or cons? |
| 09:12 | wingy | they both give the same results |
| 09:12 | wingy | (conj old-sequence 4) |
| 09:12 | wingy | (cons 4 old-sequence) |
| 09:16 | TimMc | wingy: It depends on which abstraction you are using: Sequence or polymorphic collections. |
| 09:19 | TimMc | If you know it's a sequence, use cons. If you want conj's behavior for a known collection type, use conj. If you have a collection of known or unknown type but definitely just want a sequence back with the new element on the front, use cons. |
| 09:23 | wingy | so it depends on what i want back as well |
| 09:23 | wingy | makes sense |
| 09:45 | antoineB | hello |
| 09:46 | gfredericks | ~hello |
| 09:46 | clojurebot | BUENOS DING DONG DIDDLY DIOS, fRaUline gfredericks |
| 09:47 | antoineB | bonjour |
| 09:47 | antoineB | i would like to know how to do "window.test = 12;" in clojure script? |
| 09:48 | antoineB | (. set! (js/window test) 12) doesn't work |
| 09:51 | wingy | wouldn't the ability to call (.equals-ignore-case str1 str2) instead of (.equalsIgnoreCase str1 str2) be sweeter? |
| 09:52 | gfredericks | antoineB: (set! (.-test js/window) 12) |
| 09:52 | gfredericks | wingy: there'd be a bit of translation ambiguity there, no? |
| 09:53 | wingy | yeah |
| 09:53 | antoineB | gfredericks: where did you find the doc? |
| 09:54 | gfredericks | antoineB: oh I'm just familiar with cljs |
| 09:54 | gfredericks | antoineB: http://himera.herokuapp.com/index.html has it on the front page |
| 09:55 | casion | why is it .-property? |
| 09:55 | antoineB | ok thanks |
| 09:55 | casion | I've never touched cljs, just curious |
| 09:56 | gfredericks | casion: have to distinguish from (.property foo) which calls property as a function |
| 09:56 | gfredericks | (.property foo) => foo.property() |
| 09:56 | casion | ahh, I see |
| 09:56 | gfredericks | (.-property foo) => foo.property |
| 09:57 | antoineB | it doesn't use the clojure syntax |
| 09:57 | gfredericks | clojure doesn't have a syntax for that |
| 09:57 | gfredericks | or maybe they added the .-foo stuff recently |
| 09:57 | gfredericks | I'm not certain whether the JVM has such cases |
| 09:57 | antoineB | (. set! (js/window test) 12) |
| 09:57 | antoineB | it is the clojure syntax |
| 09:59 | casion | java uses getters/setters |
| 09:59 | casion | so variable access is a method call (usually) |
| 09:59 | antoineB | oh i make a mistake the syntax is : (set! (. instance property) value) |
| 10:00 | antoineB | getters/setters is a convention not a "have to" |
| 10:01 | casion | that's why I said 'usually' |
| 10:03 | gfredericks | is "foo.bar() = 12" a legal thing to do in JS? |
| 10:03 | gfredericks | I can't imagine what it would mean |
| 10:03 | antoineB | no |
| 10:04 | gfredericks | oh well we still need a syntax for accessing properties |
| 10:04 | gfredericks | in clj do we just use (. instance property)? |
| 10:06 | antoineB | (.-property instance) |
| 10:08 | gfredericks | well that matches cljs |
| 10:08 | casion | I've never seen .-property in clj? |
| 10:10 | casion | http://clojure.org/java_interop#set |
| 10:11 | casion | I sure hope that's correct, since the code I'm working on now does it that way and it appears to work ;) |
| 10:16 | wingy | how do i get the current timestamp for clj? |
| 10:16 | wingy | so i can save it in datomic |
| 10:19 | casion | ,(.toString (java.util.Date.) |
| 10:19 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading> |
| 10:19 | casion | meh, that should work |
| 10:20 | casion | ,(.toString (java.util.Date.)) |
| 10:20 | clojurebot | "Sat Oct 06 14:13:20 UTC 2012" |
| 10:23 | wingy | ,(java.util.Date.) |
| 10:23 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ExceptionInInitializerError> |
| 10:24 | wingy | casion: in the repl it returns Sat Oct 06 16:16:49 CEST 2012|| |
| 10:24 | wingy | how can i return the timestamp for the db? |
| 10:24 | casion | iirc date always returns utc |
| 10:25 | wingy | so the repl is converting it to human friendly output? |
| 10:25 | clojurebot | clojure.repl in swank is not useful for two reasons: 0) everything it provides has an enhanced version in slime and 1) having to re-refer it every time you changed namespaces would be annoying |
| 10:42 | wingy | casion: http://joda-time.sourceforge.net/index.html seems nice |
| 10:44 | wingy | and https://github.com/seancorfield/clj-time |
| 11:01 | antoineB | ,(for [[x y] '(1 2 3 4 5 6) (+ x y)) |
| 11:01 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )> |
| 11:01 | antoineB | ,(for [[x y] '(1 2 3 4 5 6)] (+ x y)) |
| 11:01 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException: nth not supported on this type: Long> |
| 11:03 | gfredericks | antoineB: you're destructuring a number |
| 11:03 | gfredericks | ,(let [[x y] 1] x) |
| 11:03 | clojurebot | #<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: Long> |
| 11:03 | antoineB | yes just understand it |
| 11:04 | antoineB | i can use partial for what i want |
| 11:04 | antoineB | other idea? |
| 11:04 | antoineB | i mean partition not partial |
| 11:04 | gfredericks | antoineB: I couldn't tell what you were actually trying to do |
| 11:05 | antoineB | have x = 1 and y = 2 for the first loop, x = 3 y = 4 for the second etc... |
| 11:05 | antoineB | (for [[x y] '(1 2 3 4 5 6) (+ x y)) |
| 11:05 | gfredericks | ah; yeah partition 2 would work fine |
| 11:07 | Sgeo | partition? |
| 11:07 | clojurebot | partition is probably not what you want; see partition-all. |
| 11:07 | dlitvak | clojurebot: you dont know that! |
| 11:07 | clojurebot | No entiendo |
| 11:07 | dlitvak | :P |
| 11:08 | gfredericks | clojurebot: partition |might| be what you want. But also there is partition-all. |
| 11:08 | clojurebot | Ack. Ack. |
| 11:08 | antoineB | i assume to be even |
| 11:08 | gfredericks | then you are good |
| 11:09 | gfredericks | partition-all doesn't make sense in a lot of contexts |
| 11:09 | sexpGirl | I've got a quick question regarding my "workflow" if I want to use Emacs / nrepl / nrepl.el and also do some unit testing. I'd like to have both a nrepl.el Emacs buffer opened and be able to run unit tests. How should I do it? Should I run some terminal next to my Emacs and launch the tests from there? If so, which command should I use to run the tests? |
| 11:09 | dlitvak | sexpGirl: lein test |
| 11:10 | dlitvak | sexpGirl: considering that you started your project using leiningen |
| 11:10 | sexpGirl | dlitvak: so when running the tests I'd have two JVMs running? One for the REPL and one for the test? |
| 11:10 | sexpGirl | dlitvak: yup, yup, Leiningen ; ) |
| 11:10 | dlitvak | sexpGirl: you can also run the tests from the repl |
| 11:10 | dlitvak | but im a bit unsure on how that was done |
| 11:11 | sexpGirl | dlitvak: ok, I'll go read about "lein test" and then try that |
| 11:31 | technomancy | sexpGirl: `lein test` isn't good for a interactive workflow; it's just a sanity check |
| 11:31 | technomancy | you should use clojure.test/run-tests from the repl during development |
| 11:31 | antoineB | do you often have name clash in clojure? (eg: (defn abc [name] (name :test)) |
| 11:31 | antoineB | ) |
| 11:31 | technomancy | spinning up a new lein just to see if your change broke something is way too slow |
| 11:32 | gfredericks | antoineB: you mean accidentally shadowing clojure.core/name? It happens to me sometimes yes. |
| 11:33 | antoineB | yes |
| 11:33 | technomancy | antoineB: it basically only happens with name |
| 11:33 | antoineB | is there some technics to avoid it? (now i just rename the args) |
| 11:34 | technomancy | type inference =) |
| 11:35 | antoineB | there is no type inference in clojure |
| 11:35 | antoineB | (and maybe more in clojurescript) |
| 11:35 | technomancy | well there is, it's just not done yet |
| 11:36 | antoineB | what? |
| 11:36 | clojurebot | what is bla |
| 11:36 | technomancy | clojurebot: google typed clojure |
| 11:36 | clojurebot | First, out of 13700 results is: |
| 11:36 | clojurebot | frenchy64/typed-clojure · GitHub |
| 11:36 | clojurebot | https://github.com/frenchy64/typed-clojure |
| 11:36 | dnolen | antoineB: I'm not sure that it's true that Clojure doesn't do a little bit of type inference here and there. |
| 11:37 | dnolen | antoineB: CLJS definitely has some where it needs it |
| 11:37 | technomancy | clojurebot: forget what |is| bla |
| 11:37 | clojurebot | I forgot that what is bla |
| 11:40 | technomancy | antoineB: anyway the real answer is you just learn what the error message for that problem looks like so that when it occasionally happens you can spot it pretty much instantly |
| 11:40 | antoineB | technomancy: i write it in the "stuff to check when error" |
| 11:41 | technomancy | in practice it happens fairly rarely |
| 11:41 | antoineB | about frenchy64 i don't understand what it could be used for |
| 11:45 | chouser | I had the same kind of problem in python the other day, but didn't recognize the error message. Took several minutes to find it. |
| 12:14 | antoineB | is there a convention for mutable method? maybe "!" |
| 12:15 | akhudek | antoineB: that's right, ending in "!" is the convention |
| 12:16 | akhudek | http://dev.clojure.org/display/design/Library+Coding+Standards |
| 12:22 | mindbender1 | emezeske: is there a way of programmatically telling cljsbuild to check if there any modified files and compile if any |
| 12:24 | antoineB | mindbender1: i remmember seeing that |
| 12:25 | akhudek | cljsbuild auto |
| 12:25 | akhudek | or wait, I suppose you don't mean the command line |
| 12:25 | mindbender1 | antoineB: I need to make that call from within my code. |
| 12:25 | mindbender1 | yes |
| 12:25 | akhudek | take a look at the cljsbuild plugin source |
| 12:26 | mindbender1 | I'm there trying to figure it out |
| 12:26 | akhudek | line 128 |
| 12:26 | akhudek | https://github.com/emezeske/lein-cljsbuild/blob/master/plugin/src/leiningen/cljsbuild.clj |
| 12:27 | akhudek | It's private though :-/ |
| 12:27 | akhudek | but you can probably call cljsbuild |
| 12:27 | clojurebot | I don't understand. |
| 12:28 | akhudek | and just specify auto as a subtask |
| 12:28 | mindbender1 | akhudek: I'll try that and see what I get get. Thanks for the link |
| 12:29 | akhudek | (leiningen.cljsbuild/cljsbuild project "auto") |
| 12:29 | mindbender1 | akhudek: maybe for project I only pass relevant info in a map |
| 12:30 | akhudek | at minimum it needs the build options, but probably other things too |
| 12:31 | mindbender1 | yeah |
| 12:36 | mindbender1 | akhudek: (leiningen.core.project/init-project (leiningen.core.project/read)) can get me the full project |
| 12:37 | akhudek | nice! |
| 13:34 | adrian_ | any tips for abstracting over mutable datastructures? like implementing DOM uis? |
| 13:35 | adrian_ | need to rearrange dom trees in response to events |
| 13:35 | adrian_ | maybe just suck it up and define lots of ! functions? |
| 13:35 | akhudek | adrian_: maybe check out enfocus? |
| 13:38 | adrian_ | hmm I was avoiding it because I didn't like the idea of using css selectors to find dom nodes I'd generated |
| 13:40 | casion | adrian_: I'm doing something similar in clj and I'm using enlive. I'm not famliar with enfocus but if it's comparable then it's rather simple to do |
| 13:42 | casion | I did end up writing 'a few' functions to wrap common selectors, but it's resulted in very easy to read code |
| 13:42 | adrian_ | yeah I think enfocus is based on enlive |
| 13:42 | Frozenlo` | You can also check domina (enfocus is built on top) |
| 13:43 | adrian_ | using domina |
| 13:43 | adrian_ | this might be more what I'm after: |
| 13:43 | adrian_ | http://www.haskell.org/haskellwiki/Functional_Reactive_Programming |
| 13:48 | akhudek | adrian_: There was a lot of discussion about that on the dev list not to long ago, but I'm not aware of any commonly accepted solution yet. There are a few libraries trying to implement bits of reactive programming though. e.g. https://github.com/ohpauleez/shoreleave pub/sub |
| 13:49 | akhudek | also http://dev.clojure.org/display/design/Reactive+Programming |
| 13:50 | adrian_ | cool, thanks |
| 13:57 | lynaghk | ping: dnolen |
| 13:58 | lynaghk | b |
| 13:58 | dnolen | lynaghk: pong |
| 13:59 | lynaghk | dnolen: So I've run into another situtation where I want to do fancy map matching |
| 13:59 | lynaghk | beyond my super hackery of core.match as an event bus. |
| 14:00 | lynaghk | Basically, I want to do nested map matching and then rewriting using a set of rules. |
| 14:01 | lynaghk | Something like, "if an associative object has these (potentially nested) field/value pairs", I want to grab these bits into logic vars and splat them out over here. |
| 14:01 | lynaghk | I took a look at the unification stuff in core.logic, but it was too strict: e.g., {:a ?x} wouldn't "match" with {:a 2 :b 4} |
| 14:02 | dnolen | lynaghk: yeah still pondering how to support that in core.logic, likely a new map like data type that isn't so strict about unification. |
| 14:03 | lynaghk | Anyway, my question is whether 1) loosening this up is fairly straightforward and 2) if you think rules like that would be maintainable in the large |
| 14:03 | lynaghk | ah. Yeah, I'm hoping to do a very general kind of matching that includes record types and fields within the records. |
| 14:04 | dnolen | lynaghk: it is pretty straightforward - make a new type that unifies with maps, handle both (== u v) && (== v u) - the unification on this type doesn't care that the count doesn't match, just that the keys presents in the new type are prsent in the map. |
| 14:04 | dnolen | lynaghk: there's actually a ticket for this in JIRA |
| 14:05 | lynaghk | dnolen: here's a bit more context about what I'm actually trying to do: https://gist.github.com/971172f891a8de633203 |
| 14:06 | lynaghk | dnolen: ah, cool. I'll look into that, thanks. |
| 14:08 | dnolen | lynaghk: this sounds very interesting. |
| 14:09 | dnolen | lynaghk: I'd happily take a patch for the ticket - http://dev.clojure.org/jira/browse/LOGIC-49 |
| 14:09 | lynaghk | dnolen: I think it'd be a lot of fun, yeah. The biggest problem I'm grappling with now is explicit (which I like as a programmer) vs. smart implicit (which is what users will want...until it turns into Clippy) |
| 14:09 | dnolen | lynaghk: http://github.com/clojure/core.logic/blob/master/src/main/clojure/clojure/core/logic.clj#L1502 |
| 14:10 | dnolen | lynaghk: map unification is quite simple - it should be easy to see how it should be changed to do what you want for this new type. |
| 14:10 | clojurebot | c'est bon! |
| 14:10 | lynaghk | We should be able to extend to anything that is associative, no? |
| 14:10 | dnolen | lynaghk: you need a new type say SubMap (horrible name) |
| 14:11 | dnolen | lynaghk: I think you should stick with maps, because vectors are associative too. |
| 14:11 | dnolen | IUnifyWithSubMap |
| 14:11 | lynaghk | dnolen: why not try and get vectors in on the fun? |
| 14:12 | dnolen | lynaghk: I need to think about it some more - but I guess it should be ok |
| 14:13 | dnolen | lynaghk: I would be concerned with protocol resolution ambiguities - but I think since we have a concrete type SubMap or some such - you'll probably be ok. |
| 14:13 | lynaghk | dnolen: yeah, definitely. I'm still very new at all this logic programming---I'm at the "boy, it'd be nice if everything was declarative and pattern-matchy" but haven't actually done serious work with that mindset so I dunno about hidden issues. |
| 14:14 | dnolen | lynaghk: one thing that's a bit weird is that is the type of the reified value. |
| 14:15 | dnolen | lynaghk: so it's might be a bit strange that a map like thing unifies with a vector and you get a map like thing out of unification - not a sequential thing. |
| 14:15 | dnolen | lynaghk: kind hard to say if that would be problem in practice w/o tring it out. |
| 14:17 | lynaghk | dnolen: yeah, I'll start kicking it around if I'm convinced that rules-rewriting is a sane thing to do in the first place = ) |
| 14:18 | dnolen | lynaghk: my gut instinct is that it should only work with maps. |
| 14:18 | dnolen | lynaghk: you can easily try it out locally by extending to vector |
| 14:18 | dnolen | lynaghk: if you don't run into trouble we could consider loosening the behavior. |
| 14:19 | lynaghk | The use case I'm thinking of for my pattern matching is to make a rule that matches, e.g., a scale that starts at 0 (i.e., a record with one field that is a vector whose first element is 0) |
| 14:19 | dnolen | lynaghk: the rules rewriting sounds kinda awesome to me :) |
| 14:19 | puchacz | hi, has anybody put clojure inside postgres process using http://pgfoundry.org/projects/pljava/ ? |
| 14:19 | lynaghk | dnolen: until there are 200 and you don't know what is being invoked to change your spec... |
| 14:20 | dnolen | lynaghk: yes, I think I see what you're going for. But if you want to try for a patch, got for the map behavior and loosen it locally to vector in your project. |
| 14:21 | dnolen | lynaghk: after some time if it seems OK to you I'd be open to considering it further. |
| 14:22 | lynaghk | dnolen: okay, rad. I'll keep you posted. |
| 14:22 | lynaghk | gotta run, thanks for the pointers |
| 14:23 | dnolen | lynaghk: np |
| 14:45 | Jacob_Goodson | Hey everyone |
| 14:46 | Jacob_Goodson | I need some help with understanding macros |
| 14:46 | Jacob_Goodson | => (defmacro wrapper [x] `'[(~x :seq)]) #'user/wrapper => (for [x [1 2 3]] (wrapper x)) ([(x :seq)] [(x :seq)] [(x :seq)]) |
| 14:47 | Jacob_Goodson | hmm |
| 14:47 | Jacob_Goodson | terrible format |
| 14:47 | Jacob_Goodson | Can someone help me? |
| 14:48 | dnolen | seems like you want - (defmacro wrapper [x] `[(list ~x :seq)]) |
| 14:50 | Jacob_Goodson | I just want to be able to put code in between other code, the seq is there to test if it works |
| 14:50 | Jacob_Goodson | ill try what you gave me |
| 14:50 | Jacob_Goodson | thank you |
| 14:50 | dnolen | ,'[(x :seq)] |
| 14:50 | clojurebot | [(x :seq)] |
| 14:51 | dnolen | Jacob_Goodson: you're macro is quoting the following expression, so that's what you're going to get |
| 14:51 | dnolen | ,(let [x 1] '[(x :seq)]) |
| 14:51 | clojurebot | [(x :seq)] |
| 14:51 | dnolen | ,(let [x 1] [(x :seq)]) |
| 14:51 | clojurebot | #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn> |
| 14:51 | dnolen | ,(let [x 1] [(list x :seq)]) |
| 14:51 | clojurebot | [(1 :seq)] |
| 14:53 | Jacob_Goodson | thank you very much for your help(all who helped) |
| 14:53 | Jacob_Goodson | why does list work? |
| 14:54 | dnolen | Jacob_Goodson: quoting an expression will produce a list with symbols unevaluated. So it does *two* things. |
| 14:55 | dnolen | by just using list, symbols will be evaluted to their values. |
| 14:55 | Jacob_Goodson | hmm |
| 14:55 | Jacob_Goodson | I thought list just returned a list lol |
| 14:56 | Jacob_Goodson | seems very useful in a macro |
| 14:57 | Jacob_Goodson | dnolen thank you once again |
| 15:01 | dnolen | Jacob_Goodson: a list does just return a list |
| 15:01 | dnolen | Jacob_Goodson: but you were writing '(... stuff ...) which also returns a list |
| 15:02 | dnolen | (= '(1 2) (list 1 2)) |
| 15:02 | dnolen | ,(= '(1 2) (list 1 2)) |
| 15:02 | clojurebot | true |
| 15:02 | dnolen | ,(let [x 2] (= '(1 x) (list 1 x))) |
| 15:02 | clojurebot | false |
| 15:02 | Jacob_Goodson | so it jsut forces evaluation of a symbol? |
| 15:02 | Jacob_Goodson | when used the way we did? |
| 15:03 | dnolen | Jacob_Goodson: it's quoting that prevents evaluation of a symbol. |
| 15:05 | dnolen | ,'[x 1] |
| 15:05 | clojurebot | [x 1] |
| 15:05 | dnolen | ,'{x 1} |
| 15:05 | clojurebot | {x 1} |
| 15:08 | dgrnbrg | dnolen: I just made a breakthrough with core.logic tracing |
| 15:08 | dgrnbrg | I have successfully traced zebrao |
| 15:08 | dnolen | dgrnbrg: whoa! |
| 15:09 | dnolen | dgrnbrg: like you produced the search tree for it? |
| 15:09 | dgrnbrg | yeah |
| 15:09 | dgrnbrg | I made a few changes to handle recursion and unification |
| 15:09 | dnolen | dgrnbrg: insane :) |
| 15:10 | dnolen | dgrnbrg: that's really awesome - would love to see that work get folded in! |
| 15:10 | dgrnbrg | I thread the seen set through all the goals, so that you don't need to retrace an already-seen goal (although the mplus thunks still are a problem) |
| 15:10 | jamii | Well this is weird - https://gist.github.com/3845808 |
| 15:10 | dgrnbrg | want to see the output of zebrao? |
| 15:10 | dnolen | dgrnbrg: hells yeah! |
| 15:10 | dgrnbrg | I'd love to know if there's something i could do differently to recover more/better info |
| 15:11 | dnolen | dgrnbrg: btw, I'm up for grabbing a drink & chat on Monday, sorry for the slow reply. |
| 15:11 | dgrnbrg | no problem--sounds great :) |
| 15:12 | dgrnbrg | https://gist.github.com/3845814 |
| 15:12 | dgrnbrg | I made a new type of exp called a :nofollow |
| 15:12 | dgrnbrg | that's things like project, unify, etc |
| 15:12 | dgrnbrg | things that you don't want to call into |
| 15:13 | dgrnbrg | dnolen: would you like the zebrao code alongside, or do you know it well by now ;) |
| 15:14 | dnolen | dgrnbrg: that makes sense. sure! |
| 15:14 | dgrnbrg | You see, the one thing that i'm still overtracing is the mplus's streams |
| 15:16 | dgrnbrg | do you have any idea for how I could give the mplus's continuation thunk a new "seen" set? |
| 15:16 | jamii | Ok, turns out I'm not crazy - https://gist.github.com/3845808 |
| 15:17 | dgrnbrg | since currently each branch has no idea about the other branches, since I think that their substitutions are fixed to be identical when the conde splits their clauses |
| 15:18 | dnolen | dgrnbrg: ah yes ... I'm assuming you're using something based on my approach where seen is an atom or something? |
| 15:18 | dgrnbrg | actually, it's all purely functional |
| 15:19 | dgrnbrg | seen is an mvalue |
| 15:19 | dgrnbrg | so in bind I descend to the next goal while carrying along the seen set |
| 15:19 | dgrnbrg | that's why you have [:goal :seen] after the first time you see a goal in every bindchain |
| 15:20 | dgrnbrg | but you don't have that for the mpluses |
| 15:20 | dnolen | dgrnbrg: nice, so at mplus can't you just go through them independently? |
| 15:20 | dgrnbrg | so i'm looking at the implementation of conde |
| 15:21 | dgrnbrg | which does (mplus* ~@(bind-conde-clauses a clauses)) |
| 15:21 | dgrnbrg | which is going to look like (mplus* (bind* a clauses1) (bind* a clauses2) (bind* a clauses3)) |
| 15:22 | dgrnbrg | hang on, i've got to disable spelling correction on my mac |
| 15:22 | dgrnbrg | this is killing me to type |
| 15:24 | dnolen | dgrnbrg: ah right ... |
| 15:24 | dnolen | dgrnbrg: so this is something you've written from scratch yourself then? |
| 15:24 | dgrnbrg | right, so the issue is that the implementation of mplus in the TraceSubstitutions monad is (mplus [this f] (if (seen (class f) (tracer (conj _tree [mplus :seen] seen)) (let [new-subst (unwrap (f))] (merge-substs this new-subst)) |
| 15:24 | dgrnbrg | it's heavily based on the code you wrote in the "interp" branch of core.logic |
| 15:25 | dgrnbrg | but i had to change some things to play nicely with unification and mplus |
| 15:25 | dgrnbrg | to trace fewer paths, since the code you wrote enumerated all paths and could hit stackoverflow in certain cases, depending on the use of mplus |
| 15:26 | dgrnbrg | the reason that happened is that it didn't carry the "seen" set to the subtree, only to the parent |
| 15:26 | dgrnbrg | but you can explore both directions |
| 15:26 | dgrnbrg | when i did that, I realized that I had to change where I added the :conde to the search tree, since it messed up the tree rendering code |
| 15:26 | dgrnbrg | so I moved the detection of mplus branches into the mplus method |
| 15:26 | dnolen | dgrnbrg: ah right ... to be honest I'm a bit confused at how interp.clj works - I did that very quickly as a proof of concept :) |
| 15:27 | dgrnbrg | give me 20 minutes to annotate my code and push it to github |
| 15:27 | dnolen | dgrnbrg: excellent. |
| 15:31 | doomlord | is 'lighttable' any good |
| 15:31 | dnolen | doomlord: it's pretty sweet for playing around with Clojure |
| 15:31 | doomlord | parts of it look like visual studios' "code definition window" on steroids |
| 15:32 | dnolen | doomlord: there's a lot of work that needs to be done before it's good dev environment. it's promising that the team uses it to build it. |
| 15:32 | doomlord | ah "dogfood" |
| 15:32 | dnolen | doomlord: even in it's current form it's a pretty impressive ClojureScript app. |
| 15:41 | dgrnbrg | dnolen: here's my shot at documenting what I did: https://github.com/dgrnbrg/core.logic/blob/dgrnbrg-interp/src/main/clojure/clojure/core/logic/interp.clj |
| 15:41 | dgrnbrg | there's a bit of code in core.clj too, but that's just some interfaces with tracing metadata |
| 15:42 | dgrnbrg | it also has a lot of desugared core.logic :) |
| 15:43 | dgrnbrg | you can see in the results that it traces the mpluses in parallel, so you get duplicate tracing of goals that appear in multiple branches of the same mplus |
| 15:44 | dgrnbrg | it'd be reasonable to clean that up when replanning for parallelization, but it'd be even cooler if that cleanup step could be skipped |
| 15:44 | dgrnbrg | it's possible that the automatic interleaving precludes that, though, since the substitutions are currently closed over, and it's be a huge refactoring to change that |
| 15:44 | dgrnbrg | I suppose also the tracing could be done with an atom, which would also solve things |
| 15:46 | jamii | This makes me so happy: |
| 15:46 | jamii | (deftest self-describing |
| 15:46 | jamii | (= pattern-ast (vec (parse pattern-syntax))) |
| 15:46 | jamii | (= seq-pattern-ast (vec (parse seq-pattern-syntax)))) |
| 15:49 | dnolen | dgrnbrg: great! I'll take a closer look and try this out later. digging a bit nto constraint refactoring at the moment. |
| 15:49 | dgrnbrg | dnolen: cool, good luck! I'm going to be thinking about what a planner would look like to integrate this w/ jim duey's fj branch |
| 15:50 | dgrnbrg | and fixing some other projects of mine up :) |
| 15:50 | dnolen | dgrnbrg: Will said some interesting things about Ciao's approach. |
| 15:51 | dgrnbrg | is there a record of that anywhere I could check out? |
| 15:51 | dnolen | dgrnbrg: in Ciao they use complexity annotations - perhaps that + the trace information is enough to infer a good plan? |
| 15:51 | dgrnbrg | I was thinking that i'd just add a simple "parallel-scoring" mechanism to the substitution monad |
| 15:52 | dgrnbrg | some simple heuristic like unification costs 1 and everything else is free might be sufficient |
| 15:52 | dgrnbrg | and fork after you hit cost 20, reseting the cost back to 0 post-fork |
| 15:53 | dgrnbrg | with a system for better annotations to further improve the results? |
| 15:53 | dgrnbrg | that seems easy to implement, and potentially very effective |
| 15:53 | wingy | is there a way to make this more DRY (if (get options :back-path) (get options :back-path) "/") |
| 15:54 | dnolen | dgrnbrg: yes I think a simple heuristic approach would be good just collect some basic results. and then perhaps see where annotations might help where that doesn't work. |
| 15:54 | dnolen | dgrnbrg: I don't have a specific Ciao paper handy ... and I don't see anythign obvious on their site, they've published a lot |
| 15:55 | dgrnbrg | do you have any interesting and expensive core.logic programs (> 500ms) that I could look at? And that just use the basics? |
| 15:55 | dnolen | dgrnbrg: Will cites this one in his dissertation - http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.53.7913 |
| 15:56 | dnolen | dgrnbrg: zebra is actually a pretty good one to try this one I think. |
| 15:56 | dgrnbrg | dnolen: that only takes 15ms on my machine :( |
| 15:56 | dgrnbrg | it'll only be meaningful to parallelize something that takes 500ms+ |
| 15:56 | dnolen | dgrnbrg: it maybe tough to beat the optimal ordering, but reorder the goals, it can be as slow as 500ms. |
| 15:57 | dnolen | dgrnbrg: on your machine I think it'll be slower than that. |
| 15:57 | dnolen | ~550ms on a 4 core i7 if you have a bad ordering if I remember correctly. |
| 15:57 | clojurebot | swank.core/break is simple debugging breakpoints with swank-clojure: http://hugoduncan.org/post/2010/swank_clojure_gets_a_break_with_the_local_environment.xhtml |
| 15:58 | dnolen | dgrnbrg: I'm also keen to see if this work can be applied to the constraint stuff ... parrallel sudoku would be fun. |
| 15:58 | jamii | I'm trying (and failing) to use the new record reader syntax - https://gist.github.com/3845928 |
| 15:58 | dgrnbrg | dnolen: I reversed the goals, and it's doing terrible |
| 15:58 | dnolen | dgrnbrg: great! ;) |
| 15:59 | dgrnbrg | actually, it's too terrible |
| 15:59 | dgrnbrg | it's been several seconds |
| 15:59 | jamii | I have clojure 1.4.0 in my project.clj. Is there any way to double-check that I'm using the right version from inside 'lein repl'? |
| 15:59 | dnolen | dgrnbrg: I think if you just put membero goals before firsto nexto righto, you should be good. |
| 16:00 | doomlord | does clojure do type infering in its compiler ? .. does the greater use of immutability makes this easier than other lisps |
| 16:01 | dnolen | doomlord: I think most of the type inference in the compiler is around interop - CLJS does some to avoid checking for Clojure's idea of truthy values instead of JS's |
| 16:01 | dgrnbrg | dnolen: it is staying fast :( |
| 16:01 | dgrnbrg | why couldn't you write worse code? |
| 16:02 | dgrnbrg | i think the unification in the front is too intelligent |
| 16:03 | dgrnbrg | if i put the bare unification after 4 memberos, i get 70ms/run, but if i put it after the 5th membero, it seems to take a very, very long time |
| 16:03 | dgrnbrg | possibly diverged |
| 16:05 | dnolen | dgrnbrg: maybe but the search is pretty huge if you don't do it right. |
| 16:11 | dnolen | dgrnbrg: you're using run* right? |
| 16:11 | dgrnbrg | dnolen: i am trying run1 |
| 16:11 | dgrnbrg | is that breaking it? |
| 16:11 | dgrnbrg | it still hasnt finished running |
| 16:11 | dgrnbrg | and somehow it's using 700% cpu |
| 16:12 | dgrnbrg | wtf…i think my machine's going to overheat (if i dissappear, you'll know why) |
| 16:12 | dnolen | dgrnbrg: haha, the perils of zebra |
| 16:12 | AimHere | 700% CPU? Have they invented virtual processor time to go with virtual memory? |
| 16:13 | dgrnbrg | it's a convention for multicore systems :) 700% cpu means it's using 7 cores fully |
| 16:13 | antares_ | AimHere: 700% = 7 cores 100% utilized |
| 16:13 | AimHere | You guys know how to make technology seem far less miraculous than it should |
| 16:15 | ivan | oh how boring it is to not be really confused |
| 16:15 | dnolen | jamii: hmm I'm not sure why that doesn't work ... the record literal syntax |
| 16:16 | dgrnbrg | well, this ordering sucks |
| 16:17 | dgrnbrg | i'm going to try something else that's a bit faster |
| 16:17 | dnolen | dgrnbrg: http://gist.github.com/3845966, ~500ms for this order on my machine using run* |
| 16:17 | dnolen | dgrnbrg: in this case we do want run*, we want proof there is only one answer |
| 16:17 | dnolen | run 1 doesn't give us that. |
| 16:20 | dgrnbrg | dnolen: awesome--that's giving me around 500ms |
| 16:20 | jamii | dnolen: It works in files, perhaps the lein2 repl is just doing something wrong |
| 16:21 | jamii | dnolen: possibly breaking things into seperate forms by {} () [] which breaks on #user.Foo{} |
| 16:21 | jamii | dnolen: yep - https://gist.github.com/3845982 |
| 16:21 | jamii | Will file a bug for that |
| 16:22 | dnolen | jamii: ah yeah I was trying with lein repl myself. |
| 16:27 | jamii | https://github.com/technomancy/leiningen/issues/806 |
| 16:33 | dgrnbrg | dnolen: which part of town would you like monday? i work around soho |
| 16:57 | qerub | (read-string "`[1]") ; => (clojure.core/apply clojure.core/vector (clojure.core/seq (clojure.core/concat (clojure.core/list 1)))) |
| 16:57 | qerub | Isn't that a really strange result? |
| 17:01 | devn | hello all |
| 17:01 | ivan | qerub: I think it has to do that in case you decide to unquote or splice-unquote something |
| 17:02 | ivan | there was a ClojureWest talk on macros |
| 17:02 | devn | qerub: which part of it do you think is strange |
| 17:10 | qerub | ivan: ok, thanks. I'll take a look at that talk. |
| 17:10 | qerub | devn: Partly that it returns vector+seq+concat+list instead of just vector, but mainly that the syntax-quote is handled as early as read-time. |
| 17:10 | qerub | devn: Compare with Scheme: (first (read (open-input-string "`[1]"))) => 'quasiquote |
| 17:11 | qerub | At first I found it strange that the symbols had been namespace-bound, but then I realized it does that to avoid unexpected variable captures in macros. |
| 17:12 | qerub | Is there a article on the design decisions of Clojure's macro system somewhere? |
| 17:14 | qerub | ivan: This one? http://www.infoq.com/presentations/Clojure-Macros |
| 17:14 | ivan | yep |
| 17:14 | ivan | though it might lack the design decisions you're looking for |
| 17:15 | qerub | Looks interesting anyway. |
| 17:18 | antoineB | something i never be sure, is macro done at compilation, i mean alway done at compilation? |
| 17:18 | devn | damn qerub left |
| 17:18 | antoineB | i expect a "no" answer |
| 17:18 | devn | er: "damn, qerub left." |
| 17:18 | qerub | devn: ? |
| 17:19 | devn | oh sorry, my autocomplete wasn't working for you for some reason |
| 17:19 | devn | qerub: quasiquote in clojure has been discussed in the past on the list IIRC |
| 17:19 | chouser | antoineB: understanding that compilation can happen during runtime, the answer is "yes" -- macros are normally only expanded during compilation |
| 17:19 | devn | qerub: https://groups.google.com/forum/?fromgroups#!topic/clojure/bQxffjeQkFU |
| 17:20 | devn | that might be of some value to you |
| 17:21 | qerub | devn: Thank you! |
| 17:21 | antoineB | chouser: when i say compilation, i mean "c" like compilation |
| 17:21 | devn | qerub: it's not a whole story, but maybe it will give you some more to work from |
| 17:23 | antoineB | chouser: so in fact view macro as function that don't evalute param and evaluate return is the good way |
| 17:24 | chouser | Hm, I think that'll trip you up at some point. |
| 17:24 | holo | hi |
| 17:24 | chouser | it's a function that's run at compile time and its return value is spliced into the code being compiled. |
| 17:24 | antoineB | so it takes param rearrange them, and "compile" the result |
| 17:24 | devn | qerub: just dug this up as well: |
| 17:25 | devn | qerub: https://github.com/hiredman/syntax-quote |
| 17:25 | devn | qerub: referenced from: http://blog.8thlight.com/colin-jones/2012/05/22/quoting-without-confusion.html |
| 17:25 | qerub | devn: Sweet! I'm trying to get a grasp of the different tradeoffs when designing macro systems and my focus is currently on Clojure's, all pointers appreciated. |
| 17:25 | devn | you've drank the koolaid? err i mean! read Let Over Lambda? ;) |
| 17:26 | devn | s/drank/drunk |
| 17:28 | qerub | Macro koolaid…? Sure, I've had my share. I haven't actually read all of LOL yet. Thanks for the reminder to continue. |
| 17:29 | devn | heh, im just kidding. it's an interesting book, but the author just *loves* macros and takes every opportunity to tell you they're the most wonderful thing in the world |
| 17:30 | devn | there's a bit more nuanced discussion of them in Clojure I think, see: http://blip.tv/clojure/michael-fogus-the-macronomicon-5970233 (which is a response/continuation of: http://blip.tv/clojure/christophe-grand-not-dsl-macros-4540700) |
| 17:30 | devn | qerub: ^ |
| 17:30 | qerub | Powerful abstractions are always cool. :) |
| 17:30 | holo | is this path correct for bash in heroku to find lein? "PATH=.lein/bin:/usr/local/bin:/usr/bin:/bin". my app is crashing because bash cannot find lein. don't remember doing anything stupid. probably i did it anyway |
| 17:31 | devn | holo: you're talking about on deploy? |
| 17:31 | holo | devn, yes "heroku logs" show it |
| 17:32 | devn | holo: ive actually never needed to tell heroku where lein is because it just knows, but ive been doing most of my work on EC2 as of late. what are you trying to do with lein? |
| 17:33 | qerub | devn: I had missed fogus' response. Thanks for the links. |
| 17:33 | devn | holo: also, what stack? |
| 17:34 | devn | qerub: not a problem! since you're interested in the nitty gritty, doing some careful hunting on the mailing list is a great idea, but also, there's this! |
| 17:34 | devn | http://www.google.com/cse?cx=partner-pub-1237864095616304%3Ae7qm3gycp2b&ie=UTF-8&q=quasiquote&sa=Go&siteurl=clojure-log.n01se.net%2F&ref=www.google.com%2Fsearch%3Fq%3Dclojure%2Birc%26oq%3Dclojure%2Birc%26sugexp%3Dchrome%2Cmod%3D7%26sourceid%3Dchrome%26ie%3DUTF-8&ss=1000j186994j10#gsc.tab=0&gsc.q=quasiquote&gsc.page=1 |
| 17:34 | antoineB | is there an interest in using immutability in clojurescript? |
| 17:34 | holo | devn, cedar |
| 17:34 | devn | what does your project.clj look like? |
| 17:35 | devn | qerub: yeesh, that url is hideous... http://bit.ly/QTrSiu |
| 17:35 | holo | devn, min-lein-version "2.0.0" |
| 17:35 | holo | devn, want full file? |
| 17:35 | devn | holo: hm, that's the main question i had actually, but yeah, if you dont mind gisting it |
| 17:35 | qerub | devn: :) |
| 17:35 | devn | or refheaping it |
| 17:35 | holo | sure |
| 17:37 | holo | devn, https://gist.github.com/3846200 |
| 17:41 | holo | devn, oh zeus.. i had PATH: PATH=... in my heroku config |
| 17:41 | devn | :) |
| 17:41 | holo | devn, fixing it sorted it out of course. i'm sorry to make you waste time |
| 17:42 | devn | i was going to say: PATH=./lein/bin:... should be sufficient |
| 17:42 | devn | holo: it's not trouble. happy to help |
| 17:42 | devn | s/not/no |
| 17:42 | holo | devn, i appreciate your help. thanks |
| 17:42 | devn | np |
| 17:43 | devn | holo: have you seen https://github.com/heroku/heroku-buildpack-clojure ? |
| 17:46 | devn | holo: it sounds like you got it figured out, but my experience is that with heroku there's inevitably some vooodoo required at some point, and since technomancy is at heroku and has been doing clojure for a long while, that repo is probably a good resource |
| 17:46 | antares_ | devn: hey. If I remember correctly you were part of the documentation debate a few weeks ago, right? |
| 17:47 | antares_ | but we have LOGS!! |
| 17:47 | devn | i barely remember what happened yesterday, so forgive me, but i'm drawing a blank. it's entirely possible i popped in for a second |
| 17:47 | devn | antares_: sounds like you want to talk about something: hit me |
| 17:48 | antares_ | devn: just wanted to say that we are done with plumbing for http://clojure-doc.org and now just need to migrating existing tutorials and other content, and write new one |
| 17:48 | dnolen | dgrnbrg: hey I'll be close to the Times. |
| 17:48 | dgrnbrg | dnolen: i don't know where that is :/ |
| 17:49 | devn | antares_: i think i have something that may be of interest to you |
| 17:49 | jamii | Woot - https://github.com/jamii/strucjure |
| 17:50 | jamii | And under 400 LOC |
| 17:50 | holo | devn, am in not i'm using that buildpack by default? at this point i cannot complain about heroku. it's really a great platform service. but the hard times are still to come |
| 17:50 | jamii | Admittedly one of those lines is 3k characters |
| 17:50 | dnolen | dgrnbrg: times square |
| 17:51 | antares_ | devn: yeah? well, do tell |
| 17:51 | devn | antares_: now you lit a fire under me. are you going to be around for a few minutes? |
| 17:51 | antares_ | devn: you have 20 in-depth guides about everything Clojure hidden in a private git repo? |
| 17:51 | dgrnbrg | dnolen: is that where the name comes from? |
| 17:51 | devn | antares_: actually, sort of... |
| 17:51 | antares_ | devn: sure |
| 17:52 | holo | devn, s/am in not i'm/am i not |
| 17:55 | devn | holo: i think the build pack stuff is new-ish, but im not sure, either way it cant hurt to know about that if you get into slightly more non-standard territory |
| 17:57 | devn | antares_: erm, almost there, i keep blowing the heap for some reason? :X |
| 17:58 | devn | oh, nevermind, found it, was testing query performance |
| 18:00 | holo | devn, that's cool. thanks |
| 18:00 | devn | antares_: https://bc7p.showoff.io/ |
| 18:01 | devn | this is an old idea that im redoing because i did it all wrong the first time, and it's still wrong at the moment, but anyway, type "let" into the input text box and search |
| 18:01 | devn | antares_: you there? (this url is only good for 5min) |
| 18:02 | antares_ | devn: looks like hoogle or hayoo? pretty cool |
| 18:02 | antares_ | devn: yes, I am playing with it |
| 18:02 | devn | it needs work. it's using postgres right now, but i think it should be primarily a faceted solr search |
| 18:03 | antares_ | devn: gee. You are old school :) |
| 18:04 | antares_ | devn: seriously though, I think that faceted search can work but if you go with it, ES is much nicer to work with. |
| 18:05 | adiabatic | I'd like to be able to copy and paste the (= …) lines in 4clojure into something that either emacs+nREPL or 'lein test' can handle. I'm trying the latter way, and I'm doing (deftest a-test (map is [(= …) (= …)])) in core_test.clj. Thing is, when I run `lein test`, it errors out with a RuntimeException: Can't take value of a macro. Should I look into dosomething functions/macros/special forms to get what |
| 18:05 | adiabatic | I want? |
| 18:05 | devn | people keep telling me that, but one thing that i get for free with solr is ive already built a couple of solr-backed rails sites which use an already built search discovery tool that does a lot of work i dont want to do |
| 18:06 | devn | like accreting constraints, bookmarks, etc. |
| 18:06 | zackmmms | Hey, are reader macros still off limits in clojure? |
| 18:06 | devn | zackmmms: yes |
| 18:06 | ordnungswidrig | adiabatic: "is" is a macro thus cannot be applied to a value with map |
| 18:06 | adiabatic | ordnungswidrig: I figured that's what the error message was saying |
| 18:07 | ordnungswidrig | however: (map #(is [(= ..) (=…)]) …) or like that should do |
| 18:07 | ordnungswidrig | adiabatic: or you are looking for "are" |
| 18:07 | devn | antares_: anyway, i want to put this out there as sort of a card catalogue of simple examples, and provide an API so you could augment your examples or something |
| 18:07 | antares_ | devn: you are scaring me. Rails? There is http://clojureelasticsearch.info ;) |
| 18:07 | antares_ | devn: but it's pretty cool. I think it may be less useful in a dynamically typed language but all such experiments lead in the right direction. |
| 18:08 | aperiodic | ordnungswidrig: careful, you'll need to realize the sequence that the map produces at some point |
| 18:08 | devn | antares_: well, it gets more interesting, all of the stuff you're seeing there has been run through clojail. what im not currently doing is any kind of analysis, but i could be. |
| 18:08 | adiabatic | ordnungswidrig: I probably am! |
| 18:09 | ordnungswidrig | adiabatic: then dorun is more likely what you want |
| 18:09 | clojurebot | Roger. |
| 18:09 | zackmmms | dven: So even with an extensible reader, there is no way I could write `{parameters}` and have it be valid clojure code |
| 18:10 | antares_ | devn: what kind of, for example? |
| 18:10 | devn | antares_: actually, datomic could be really interesting too, people have built the cons cell on top of datomic. there are some holes still though, like the fact that id want to use a different analyzer than the one datomic provides |
| 18:12 | devn | antares_: like when i safely read the sexp and capture it's output and/or value, it creates a map, right? {:input "(+ 1 1)", :out nil, :value "2"} |
| 18:12 | devn | but it could also flatten it and get all of the symbols used and pop those into :symbols #{+ and or} |
| 18:12 | antares_ | interesting |
| 18:14 | devn | i mean it's not magic or anything, but since you're already reading the damn thing, you may as well use that opportunity to play around with it. hell, you could try to automatically rewrite the expression using kibit or clojure-refactoring to alternatively provide a thread-first and thread-last version of the same expression |
| 18:16 | devn | antares_: anyway, i guess i'd like to know if you see any value in tying what im building together with what you're working on, sort of a value add for clojure-doc? |
| 18:17 | antares_ | devn: yes and no. Let me explain. |
| 18:17 | antares_ | devn: we want clojure-doc.org to be more than just a collection of tutorials and guides. And we want to cover more than just the language (stuff like how JVM ecosystem works or what Leiningen is is equally important). |
| 18:17 | antares_ | but we won't cover the API reference part, for example |
| 18:18 | antares_ | because there are already resources that do that reasonably well |
| 18:18 | antares_ | clojuredocs.org will be adapted for 1.4 and ported to be 100% clojure over time |
| 18:18 | antares_ | as for this thing, once it works well, I think we can dedicate an article to it and certainly link to it |
| 18:19 | antares_ | maybe even give you a subdomain, why not |
| 18:19 | antares_ | but clojure-doc.org is primarily a content site |
| 18:19 | antares_ | devn: does that answer your question? |
| 18:28 | wingy | how do i get the request body/querystring in compojure? |
| 18:30 | aperiodic | wingy: https://github.com/weavejester/compojure/wiki/Destructuring-Syntax |
| 18:31 | dnolen | dgrnbrg: gotta run here, but I'm happy to meet somewhere halfway. |
| 18:31 | dgrnbrg | dnolen: sounds good-- sync over email? |
| 18:32 | dnolen | dgrnbrg: yes, talk soon. |
| 18:33 | wingy | aperiodic: thx |
| 18:40 | azkesz | hi guys, what is the order in which the bindings are executed inside the let form ? and is that guaranteed? |
| 18:40 | antares_ | azkesz: anecdotal evidence suggests top-to-bottom and yes, I believe it is always the same |
| 18:41 | antares_ | ,(let [a 1 b (inc a)] b) |
| 18:41 | Frozenlock | azkesz: 'let' in clojure is like 'let*' in lisp. |
| 18:41 | clojurebot | 2 |
| 18:41 | azkesz | i don't know lisp though :) |
| 18:41 | Frozenlock | :P |
| 18:41 | antares_ | Frozenlock: there is even let* in clojure.core |
| 18:41 | aperiodic | ,(let [a 1 _ (prn a) a 2 _ (prn a)] a) |
| 18:41 | clojurebot | 1 |
| 18:41 | clojurebot | 2 |
| 18:41 | clojurebot | 2 |
| 18:41 | eggsby | azkesz: that just means 'let sequential', so each one happens after the prior |
| 18:41 | azkesz | ,(let [b (inc a) a 1] b) |
| 18:41 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: a in this context, compiling:(NO_SOURCE_PATH:0)> |
| 18:42 | azkesz | understood guys, thanks so much |
| 18:42 | Frozenlock | antares_: What does it do? |
| 18:42 | azkesz | after all the bindings are inside a vector right? [] |
| 18:42 | antares_ | Frozenlock: that's a helper for clojure.core/let |
| 18:43 | antares_ | Frozenlock: my point is that there probably has been some inspiration from Common Lisp and such |
| 18:43 | antares_ | azkesz: right but that may or may not be the reason |
| 18:43 | chouser | let is actually a macro. let* is the special operator. I think its like let without destructuring |
| 18:43 | antares_ | azkesz: you just want that kind of guarantee for conveience |
| 18:43 | antares_ | *convenience |
| 18:46 | azkesz | true but if it were a set... any ordering would be lost i figure, but even as vector the order could've been from last to first, I guess I only meant it's vector instead of set so the order at least is not lost if it's indeed ever to be used |
| 18:47 | azkesz | well I noticed this code which seems to require that let keep the order else it would've been flawed |
| 18:48 | Sgeo | Oh, reset! as in the thing for atoms |
| 18:48 | wingy | https://github.com/weavejester/valip seems not very active |
| 18:48 | wingy | https://github.com/michaelklishin/validateur is better choice? |
| 18:48 | wingy | need to validate form inputs |
| 18:49 | azkesz | judging by the author, probably :) |
| 18:50 | antares_ | wingy: valip is definitely not bad. validateur in 1.x has some limitations we can't overcome in a compatible way but if you don't need i18n, it will do what you need. |
| 18:51 | antares_ | wingy: also, validateur is pretty trivial to extend with custom validators. They are just Clojure functions. Not sure about valip. |
| 18:51 | wingy | antares_: ill look into both |
| 18:52 | antares_ | Sgeo: reset! basically set the new value for an atom, completely ignoring the current one |
| 18:52 | Sgeo | antares_, I was getting confused because of the use of reset in delimc, for something totally different |
| 18:54 | antares_ | Sgeo: delimc? |
| 18:54 | Sgeo | https://github.com/swannodette/delimc |
| 18:54 | Sgeo | Delimited continuations for Clojure |
| 18:54 | adiabatic | fiddlesticks. Looked up the interface for split-at to do 4clojure #49 and they gave away the answer. |
| 18:55 | antares_ | Sgeo: sounds too hardcore for my brain |
| 18:55 | Sgeo | antares_, it is a little for me, but there's a clear connection between these and monads which I think will make monads easier to use |
| 18:56 | Sgeo | I think what I want to write will look something like: |
| 18:57 | Sgeo | (reset [(+ (bind-cont [1 2 3]) (bind-cont [4 5 6]))] |
| 18:58 | Sgeo | Which should be the same as (for [a [1 2 3] b [4 5 6]] (+ a b)) |
| 18:58 | Sgeo | Well, same conceptually |
| 18:58 | Sgeo | Although different return types I guess |
| 18:59 | Sgeo | The concept is simple: A function that binds a monadic value to the continuation |
| 18:59 | azkesz | ,(for [a [1 2 3] b [4 5 6]] (+ a b)) |
| 18:59 | clojurebot | (5 6 7 6 7 ...) |
| 19:00 | Sgeo | Hmm, maybe reset-return... |
| 19:00 | Sgeo | Would get rid of that [] |
| 19:01 | Sgeo | Basically, I want to put dnolen and jimduey in a particle collider and collide them. |
| 19:06 | wingy | http://clojurewerkz.org/articles/about.html |
| 19:06 | wingy | looks like a good project |
| 19:07 | antares_ | wingy: thank you |
| 19:08 | wingy | antares_: who are you? |
| 19:08 | wingy | Michael or Alex? |
| 19:08 | adiabatic | Lambda in a gear-looking thingy. Though it was Half-Life related, at first… |
| 19:08 | antares_ | wingy: Michael |
| 19:09 | wingy | antares_: are you using those projects in your company? |
| 19:09 | wingy | you got a lot of dbs covered |
| 19:10 | antares_ | wingy: I use some, Alex uses some. We originally did not use Riak but later replaced mongodb with it. |
| 19:10 | antares_ | besides Romulan, no clojurewerkz project is purely experimental |
| 19:10 | wingy | antares_: just curious .. how was it better than mongo? |
| 19:10 | antares_ | that's why we have the docs |
| 19:11 | wingy | yeah good that you are focusing on the doc quality |
| 19:11 | antares_ | wingy: it can handle very high write volumes with predictable latencies. As the load increases, you just add nodes. |
| 19:11 | wingy | seems like a missing feature in clj land |
| 19:11 | casion | antagon: how do you create your docs? |
| 19:11 | antares_ | also, it is ridiculously easy to operate |
| 19:11 | casion | err, wrong tab complete |
| 19:11 | casion | antares_: how do you create your docs |
| 19:11 | antares_ | casion: github.com/clojurewerkz/docslate. Doc repos are under github.com/clojurewerkz |
| 19:12 | wingy | antares_: you are using neo4j as well? its a nice lib |
| 19:12 | wingy | db i mean |
| 19:12 | antares_ | wingy: we do, although I believe there is now a better option in the graph DB space |
| 19:12 | wingy | antares_: which one? |
| 19:12 | antares_ | but neo4j is the most mature, that's true |
| 19:12 | antares_ | titan |
| 19:12 | antares_ | https://github.com/thinkaurelius/titan |
| 19:13 | devn | antares_: speaking of subdomains, you sure you dont want a subdomain under getclojure.org? :) |
| 19:14 | antares_ | devn: as soon as I am sure I get clojure :) |
| 19:14 | casion | antares_: you don't genreate stubs from the code? |
| 19:14 | antares_ | devn: what is getclojure.org? |
| 19:14 | casion | generate* |
| 19:14 | devn | antares_: and yeah, that answers my question -- im just trying to think of how we can roll clojure-doc, clojuredocs, and something like im building all into one tight package |
| 19:14 | devn | antares_: the future home of what i showed you earlier |
| 19:14 | antares_ | casion: API references are generated, see http://clojurerabbitmq.info nav bar, for example. |
| 19:14 | wingy | antares_: i used to use neo4j before datomic .. why do you think titan is better than neo4j? |
| 19:14 | Sgeo | devn, what did you show antares_ |
| 19:14 | Apage43 | antares_: I looked at titan.. but it seems to be a kind of naive implementation.. I expect it will never be as fast as neo4j |
| 19:15 | antares_ | Apage43: are you serious? |
| 19:15 | antares_ | Apage43: well, have you used neo4j for real? |
| 19:15 | devn | Sgeo: https://m61j.showoff.io/ |
| 19:15 | Apage43 | i've used neither at scale |
| 19:15 | Apage43 | just played with them |
| 19:15 | devn | Sgeo: type "let" into input -- it's undergoing a rewrite right now |
| 19:15 | Apage43 | so i am coming from nowhere |
| 19:15 | antares_ | neo4j is nice but 1. It's not a speed daemon and because it is transactional, it probably never will be. 2. It has no backups or HA in the OSS edition. The latter is why I will probably never used it again. |
| 19:16 | antares_ | titan with cassandra and hbase has replication and distribution built-in |
| 19:16 | casion | this is apparently over my head |
| 19:16 | wingy | yeah https://groups.google.com/forum/#!msg/aureliusgraphs/vkQkzjN8fo0/Sz_pLjWr7tcJ |
| 19:16 | antares_ | Apage43: and Titan developers test it on data sets like full orkut dump |
| 19:16 | antares_ | billions of relationships |
| 19:16 | Apage43 | It's just the "distribution" part where I feel like it gets to be a hard problem. |
| 19:16 | antares_ | it certainly has reasonable performance even with huge volumes |
| 19:17 | antares_ | Apage43: they outsource the problem to hbase and cassandra |
| 19:17 | antares_ | which, in my opinion, solved it pretty well |
| 19:17 | antares_ | this is the most interesting part, you get transactions thanks to titan even on top of eventually consistent data stores |
| 19:17 | antares_ | that is pretty remarkable and gives you a lot of good from both sides |
| 19:18 | antares_ | Apage43: neo4j distribution is pretty complex, especially the id generation and syncing part with concurrent transactions :) |
| 19:18 | antares_ | Apage43: so, it's fair to be skeptical about titan because it is young, but neo4j is far from perfect, especially on the ops side |
| 19:19 | Apage43 | ah, well, I figured neo4j solved distribution by not having it =P |
| 19:19 | antares_ | Apage43: the library :) there is REST server on top of it now :) |
| 19:19 | antares_ | Apage43: titan can use berkeley DB Java edition to work basically like neo4j embedded |
| 19:19 | antares_ | Apage43: also, keep in mind that neo4j is GPL and titan is apache 2.0 |
| 19:19 | antares_ | oceans of difference |
| 19:19 | wingy | i thought about neo4j or datomic but settled with datomic since it is closer to clojure and also it has time travel built in :) |
| 19:20 | wingy | antares_: do you have thoughts on datomic? |
| 19:20 | antares_ | wingy: haven't used it. I think its value proposition is significant but I don't have any short term need in it. And they definitely don't need a Clojure client from us :) |
| 19:20 | Apage43 | Oh yeah, the only thing I'd really like neo4j better than other things for is raw perf, which it can only do because it can't scale out |
| 19:21 | Apage43 | so if you really do have billions of things it's probably hard to use it anyway. |
| 19:21 | wingy | Apage43: my friend said that sicne Neo4j can't scale out to multiple machines he wont use it |
| 19:21 | antares_ | wingy: if you like clojurewerkz and the docs, feel free to spread the word on twitter or clojure ML. Not to stroke our egos, to raise the awareness of now much a difference solid documentation makes. |
| 19:22 | wingy | what happens when your machine's capacity runs out with Neo4j? then you are screwed? |
| 19:22 | lpvb | Why is ClojureCLR not gaining any interest? |
| 19:22 | Apage43 | wingy: right. Titan does that. and it does the silliest thing that will work, which is it just shoves the graph nodes in a distributed k-v store like cassandra or HBase |
| 19:22 | antares_ | wingy: with Neo4J Server, you are not. But it's not about capacity, it's the backups and HA parts in the Community Edition that are problematic. |
| 19:22 | Urthwhyte | F# and entrenched interests probably? |
| 19:22 | casion | antares_: is there any intent on documenting how you document things? |
| 19:22 | wingy | antares_: unfortunately im not very popular in Twitter :) .. I will be one day though I hope :) |
| 19:22 | antares_ | casion: hm, there honestly isn't much to it. We can write a blog post. |
| 19:22 | wingy | but i usually spread words in irc channels and google groups |
| 19:23 | devn | lpvb: lots of reasons, some historical, some related to number of people actively working on it, F#, and probably more |
| 19:23 | antares_ | casion: the toolchain is very straightforward, it uses Jekyll and gists (or Pygments, in which case you will need to install it), everything is in a git repo and written in Markdown. |
| 19:23 | casion | antares_: straightforward if I knew what any of those things were :| |
| 19:23 | devn | casion: google :) |
| 19:23 | wingy | Apage43: like Datomic .. it is using other dbs as storage |
| 19:23 | antares_ | wingy: you can instantly become popular on the clojure ML :) |
| 19:24 | wingy | pretty clever .. like dbs are using fs |
| 19:24 | holo | Raynes, your conch version number doc disagrees between github and clojars |
| 19:24 | casion | devn: if I have to research it, I would say it's not exactly straightfoward :) |
| 19:24 | wingy | they are one level on top of those dbs |
| 19:24 | antares_ | wingy: just post something saying that docs make a huge difference and it should be a top short term priority for Clojure/core and such. |
| 19:24 | casion | not necessarily complicated, but not straightfoward |
| 19:24 | antares_ | wingy: of course, if you don't want to, no problem with that :) |
| 19:24 | devn | casion: seriously, if you googled them you could grok the whole thing by definition |
| 19:25 | antares_ | holo: submit a PR? Raynes is pretty ace at merging other people's work |
| 19:25 | Apage43 | wingy: yeah, datomic can do a lot more clever stuff around caching though |
| 19:25 | wingy | antares_: whats clojure ML? |
| 19:25 | devn | markdown: turns plaintext to HTML, jekyll: static site generator, gists: gist.github.com (a pastebin), pygments: syntax highlighting |
| 19:25 | antares_ | casion: ok. I think we will write a blog post next weekend. I have something pretty cool to work on and announce next week. |
| 19:25 | antares_ | wingy: Clojure mailing list, the google group |
| 19:26 | antares_ | wingy: https://groups.google.com/group/clojure |
| 19:26 | holo | antares_ it's just a small doc mistake, is it really necessary? ._.' |
| 19:26 | devn | antares_: so are you going to build a static site generator for clojure-doc? |
| 19:26 | casion | devn: that was far more useful than the last 15 minutes of googling I've done |
| 19:27 | devn | casion: instead of google i should have maybe said github |
| 19:27 | antares_ | holo: of course, people will be using an outdated version otherwise |
| 19:27 | devn | quicker to skim the readmes of those projects |
| 19:27 | antares_ | devn: we have it already |
| 19:27 | casion | devn: it's pretty well to assume I've lived in a cave for the last 15 years |
| 19:27 | devn | antares_: where's the repo? |
| 19:27 | antares_ | devn: we use jekyll with a template repo all clojurewerkz.org projects use |
| 19:27 | devn | antares_: oh, right, but you said earlier it will be 100% clojure? no? |
| 19:27 | antares_ | devn: https://github.com/clojuredocs/cds |
| 19:27 | antares_ | devn: clojuredocs.org will be |
| 19:28 | antares_ | the API reference site |
| 19:28 | antares_ | not CDS |
| 19:28 | devn | not clojurewerkz or clojure-doc? |
| 19:28 | devn | antares_: the domain is a bit confusing given there's already a clojuredocs |
| 19:28 | antares_ | devn: clojure-doc (CDS, clojure doc site). clojurewerkz.org is not affiliated with CDS> |
| 19:28 | antares_ | devn: yeah but we don't have control over clojuredocs.ogr |
| 19:28 | antares_ | and there is no way to quickly split it into two parts |
| 19:28 | devn | is zkim MIA? |
| 19:29 | wingy | antares_: again, really love your initiative with the umbrella project .. when i get money ill poor somewhat in clj community making libs great |
| 19:29 | antares_ | devn: we could not reach him so far. I hope someone in SF will help me with that soon. |
| 19:29 | wingy | pour |
| 19:29 | antares_ | devn: the main reason is that we simply don't want to wait and potentially destabilize clojuredocs.org |
| 19:29 | antares_ | but we need to publish our progress somewhere |
| 19:30 | antares_ | we are now at a point where all there is left to do is to write, edit, publish, rinse, repeat |
| 19:30 | wingy | good doc .. good defacto libs .. simple and easy to create more projects |
| 19:30 | devn | weird, zkim's last commit is a month ago and his twitter moved from napple to _zkim, which doesnt exist |
| 19:30 | antares_ | with a few people involved. We will also have guidelines in place for other folks who want to contribute. |
| 19:30 | antares_ | Like a list of low-hanging fruits, document structure, etc |
| 19:31 | devn | antares_: im already on board, buddy |
| 19:31 | devn | just give me a list of crap to do |
| 19:31 | antares_ | devn: as far as I know zkim does not currently use Clojure at his company. But I am sure we will reach him somehow. |
| 19:32 | antares_ | devn: we have a list of initial guides that need to be written. I can show it to you right now. |
| 19:32 | devn | hit me |
| 19:33 | wingy | antares_: you could almost start a company around those projects |
| 19:33 | antares_ | wingy: probably not :) at least, no short term interest |
| 19:34 | wingy | im sure there are demands on high quality libs/support |
| 19:34 | wingy | no? |
| 19:34 | clojurebot | no is tufflax: there was a question somewhere in there, the answer |
| 19:34 | lpvb | I'm getting tired of vim not having great language integration. Does emacs have clojure autocompletion and jump to declarations? |
| 19:34 | technomancy | not enough to support a company |
| 19:34 | wingy | are you sure? libs are really valuable to other companies |
| 19:35 | wingy | in that case the clj market is not very high |
| 19:35 | technomancy | correct |
| 19:35 | devn | man, the CA discussion is happening again on the clojure ML |
| 19:35 | wingy | technomancy: its that bad huh |
| 19:36 | wingy | i wonder why though .. clj is way cool |
| 19:36 | casion | lpvb: yes |
| 19:36 | wingy | perhaps datomic can boost it up and make marketing for it |
| 19:36 | devn | i work for a consulting company and we have people who are asking us for clojure specifically |
| 19:36 | antares_ | wingy: there are enough companies using Clojure but not enough yet to build a complete company around just libraries :) |
| 19:36 | wingy | are you sure? |
| 19:36 | wingy | i mean libs are everything :) |
| 19:36 | antares_ | wingy: the same is true for even pretty popular languages. So companies like Typesafe do all kinds of things. |
| 19:37 | antares_ | wingy: nope. Working products are everything. |
| 19:37 | devn | im curious how well chas has done on clojure atlas |
| 19:37 | antares_ | but it takes more than libs to get there |
| 19:37 | devn | clojure atlas should probably get some love somewhere |
| 19:37 | devn | i know it's for pay, but it's really useful |
| 19:37 | antares_ | devn: are you getting my PMs? |
| 19:37 | ivan | it does not cost $200 to send a letter from Russia |
| 19:37 | devn | antares_: yeah, sorry, just saw them |
| 19:37 | antares_ | ivan: yes it does |
| 19:37 | antares_ | ivan: via fedex |
| 19:38 | antares_ | and if you use Russian postal services, we all know how reliable it is |
| 19:38 | ivan | normal postal mail is reliable enough in my experience, and you can always send two |
| 19:39 | ivan | maybe your local post office really hates you? |
| 19:39 | casion | my experience with most russian postal has been very good |
| 19:39 | wingy | "you want your devs to build products or libs" |
| 19:39 | antares_ | ivan: yeah it just takes 4 months |
| 19:40 | antares_ | ivan: so if I want to contribute a small doc improvement, I will have to wait for 4 months. that's ridiculous. |
| 19:41 | antares_ | wingy: you are partially right, there is value in good libs. But to have a successful company behind a language you will have to do way more than just develop libraries. Which is fine, I just don't think it's the goal for clojurewerkz right now. |
| 19:41 | wingy | yepp .. just saw something really valuable in your project |
| 19:42 | wingy | quality :) |
| 19:42 | wingy | i personally would love to pay you for maintaining stuff |
| 19:42 | wingy | if i want that .. a lot of people want .. i can't be alone |
| 19:42 | wingy | thats like the golden rule .. one person wants something means big market |
| 19:43 | wingy | or lets rephrase .. one person wants to pay for your thing means big market |
| 19:43 | antares_ | wingy: maybe we will set up a donations site but I believe it will be better if both myself and Alex keep working on clojurewerkz.org as part of working on something else :) |
| 19:43 | antares_ | and gain more contributors (Neocons, Monger and Welle already have several) |
| 19:43 | wingy | yepp .. was just sharing my thoughts :) |
| 19:44 | akhudek | is there a clojurescript + compojure lein new template somewhere? |
| 19:46 | wingy | akhudek: start setting up compojure first .. then clojurescript with lein-cljsbuild .. its dead simple |
| 19:46 | wingy | you dont need no template |
| 19:46 | akhudek | I was just being lazy, I already have projects using the combo. ;-) |
| 19:46 | wingy | ah |
| 20:14 | adiabatic | I can use the value of (type "blah") as a map key, right? |
| 20:14 | danlarkin | why not try it |
| 20:15 | danlarkin | ,{(type "blah") 42} |
| 20:15 | clojurebot | {java.lang.String 42} |
| 20:15 | adiabatic | good, that means I'm not going off in the wrong direction |
| 20:15 | adiabatic | thanks! |
| 20:16 | adiabatic | ,(= (type "blah") (type "blaaaaad")) |
| 20:16 | clojurebot | true |
| 20:16 | adiabatic | ,(== (type "blah") (type "blaaaaad")) |
| 20:16 | clojurebot | #<ClassCastException java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.Number> |
| 20:22 | Sgeo | I am contemplating a function that I want to call bind-cont |
| 20:22 | Sgeo | But, considering that it would likely get used frequently, is bc a good name? |
| 20:22 | Sgeo | or BC? |
| 20:23 | adiabatic | You can always make a shorter alias later, right? |
| 20:29 | zoldar | antares_: I will do the pull request but one question, because I'm a bit of a noob when it comes to git workflow - how to get my fork's master in sync with original repo? :) |
| 20:29 | antares_ | zoldar: if you don't have a fork? |
| 20:30 | antares_ | zoldar: in that case, just fork it. If you already have a fork, it should be as simple as pulling from Neocons master and pushing to your repo. |
| 20:30 | zoldar | antares_: no no, I already have a fork, I just wonder if this is something done from gui, or is it just explicit pull on git level |
| 20:30 | zoldar | okat |
| 20:30 | zoldar | okay* |
| 20:30 | antares_ | zoldar: git pull git://github.com/michaelklishin/neocons.git master should get you there |
| 20:31 | Sgeo | $mail dnolen I need to be able to write an fn that only makes sense in the context of a reset, but is not itself in a reset |
| 20:31 | lazybot | Message saved. |
| 20:31 | Sgeo | Hmm, then again, maybe (reset (defn blah)) would work sufficeintly well |
| 20:41 | holo | did anyone notice that when running scripts using "foreman run <command> <args>", if <args> contains a single flag -x/--xxx, the number of arguments printed by echo $# will be 0? |
| 20:43 | holo | wish is really bad.. |
| 20:43 | holo | *which |
| 20:47 | technomancy | holo: for doing clojure dev on heroku, you really only need foreman to check the syntax of your procfile |
| 20:47 | technomancy | it's really not necessary for running your app in dev |
| 20:48 | technomancy | foreman is not that useful with leiningen since lein has good alias support |
| 20:52 | holo | technomancy, i need foreman to read .env |
| 20:53 | Sgeo | Ok, this seems way way way way way too easy |
| 20:54 | Sgeo | And it doesn't work |
| 20:56 | Sgeo | It may be delimc brokenness |
| 20:57 | Sgeo | As in a "doesn't know how to use Clojure" way, not a "Some weird concept has gone wonky" way |
| 20:58 | Sgeo | https://github.com/swannodette/delimc/blob/master/src/delimc/core.clj#L131 |
| 20:58 | Sgeo | Can someone explain to me the purpose of that ~'make-funcallable? |
| 20:58 | Sgeo | Would make-funcallable not work there for some reason? |
| 20:59 | Sgeo | Could ~'make-funcallable cause issues when it comes to namespacing? |
| 20:59 | holo | technomancy, what do you mean with "good alias support"? |
| 20:59 | clojurebot | technomancy: you're right I should explain the reason. The reason is I would like to be able to call aether with an extra parameter for introducing my own :transfer-listener. |
| 21:00 | holo | hun? |
| 21:00 | clojurebot | i think chunking is to blame |
| 21:00 | Sgeo | Yep, that construct is used elsewhere and causes issues |
| 21:00 | Sgeo | I think I understand why it would be used though |
| 21:01 | holo | clojurebot is not really a bot? |
| 21:01 | zoldar | antares_: done, hope I haven't screwed anything up |
| 21:01 | aperiodic | oh man, clojurebot just passed the turing test! |
| 21:01 | aperiodic | ~botsnack |
| 21:02 | clojurebot | botsnack is scoobysnack |
| 21:02 | aperiodic | clojurebot: forget botsnack is scoobysnack |
| 21:02 | clojurebot | 'Sea, mhuise. |
| 21:02 | Sgeo | ~botsnack |
| 21:02 | clojurebot | Thanks! Can I have chocolate next time |
| 21:03 | antares_ | zoldar: pretty sure you haven't :) testing it locally… |
| 21:04 | doctordaebak_ | dropping by to let everyone know about a hardware project that some in the clojure community might be quite interested in |
| 21:05 | doctordaebak_ | kickstarter to create a 16-core computer for $99 |
| 21:05 | doctordaebak_ | http://www.kickstarter.com/projects/adapteva/parallella-a-supercomputer-for-everyone |
| 21:06 | doctordaebak_ | hoping those here who want to see it funded, will also pass the word on to any who are interested in multithreaded and parallel applications |
| 21:07 | antares_ | zoldar: merged. One minor thing: please move the test to relationships_test. I will release a snapshot either way, of course. |
| 21:08 | zoldar | antares_: at first I intended to do so, and even started adding a test for nodes but then I've spotted the test in cypher_test and followed the pattern |
| 21:08 | antares_ | zoldar: the idea is that we will move more and more stuff to use cypher internally but tests are organized by features, regardless of the implementation |
| 21:08 | Sgeo | I want to slap dnolen |
| 21:08 | antares_ | zoldar: yeah, that's for direct use of Cypher |
| 21:10 | zoldar | antares_: ok, I will keep it in my mind |
| 21:12 | Sgeo | While developing with the aid of the REPL, how much of a risk is there of removing a function but still accidentally relying on it, and not noticing because the function is still defined in the REPL? |
| 21:12 | antares_ | zoldar: thank you for contributing! The most exciting part of working on OSS is seeing other people find your projects useful enough to get involved :) |
| 21:12 | antares_ | Sgeo: it is more common to hit an old protocol implementation. It is not very common, though. |
| 21:13 | antares_ | but you can hit various issues with hot code reloading, it is a very hard problem. I don't think anybody but Erlang solved it even distantly well. |
| 21:18 | technomancy | holo: just run export $(cat .env) first |
| 21:18 | technomancy | holo: or use environ |
| 21:19 | Sgeo | Just verifying: I'm allowed to say that dnolen made a mistake, right? |
| 21:19 | technomancy | it's not required to put things in .env; it's just a convention |
| 21:20 | technomancy | not a particularly good one on the JVM given that the environment is immutable without restarting |
| 21:22 | technomancy | Sgeo: it isn't that uncommon to accidentally depend upon a function that isn't there anymore unfortunately |
| 21:23 | Sgeo | clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: Can't specify more than 20 params, compiling:(c:\Users\Sgeo\DEV\Clojure\delimonads\src\delimonads\core.clj:5) |
| 21:23 | technomancy | holo: by good alias support I mean the fact that you can add an alias for a complete command, like :aliases {"go" ["run" "-m" "my.launcher" "--fast"]} |
| 21:29 | antares_ | Sgeo: JVM methods cannot take more than 20 params |
| 21:30 | Sgeo | I have no idea how I'm giving anything more than 20 params |
| 21:32 | zoldar | &((def n [:a :b :c]) (def r [22 33]) (butlast (interleave n (conj r nil)))) |
| 21:32 | lazybot | java.lang.SecurityException: You tripped the alarm! def is bad! |
| 21:33 | zoldar | &(let [n [:a :b :c]) r [22 33]] (butlast (interleave n (conj r nil)))) |
| 21:33 | lazybot | java.lang.RuntimeException: Unmatched delimiter: ) |
| 21:34 | Sgeo | antares_, I don't see what in the code could cause that :/ |
| 21:34 | antares_ | Sgeo: is the source up somewhere? |
| 21:34 | zoldar | &(let [n [:a :b :c] r [22 33]] (butlast (interleave n (conj r nil)))) |
| 21:35 | lazybot | ⇒ (:a 22 :b 33 :c) |
| 21:35 | zoldar | right... is there some more elegant/succint way to do that? |
| 21:35 | Sgeo | https://gist.github.com/3846768 |
| 21:36 | Sgeo | Oh hey my docstring's wrong |
| 21:37 | gfredericks | ,(doc interleave) |
| 21:37 | clojurebot | "([c1 c2] [c1 c2 & colls]); Returns a lazy seq of the first item in each coll, then the second etc." |
| 21:38 | Sgeo | At any rate, I know how to fix delimc's problem with namespacing |
| 21:39 | gfredericks | &((fn f [xs ys] (when (seq xs) (lazy-seq (cons (first xs) (f ys (rest xs)))))) [:a :b :c] [22 33]) |
| 21:39 | lazybot | ⇒ (:a 22 :b 33 :c) |
| 21:40 | Sgeo | Tell me if I'm wrong, but if you :use a namespace, can you still use the vars within that namespace in a fully qualified way? |
| 21:40 | gfredericks | I think you can use anything fully qualified, and are responsible for it being loaded |
| 21:41 | gfredericks | so if you :use it then you've satisfied the being-loaded part |
| 21:41 | Sgeo | Thanks |
| 21:41 | Sgeo | So I just need to make every special form-ish thing defined by delimc be fully-qualified |
| 21:42 | Sgeo | I should probably do that for everything not just delimc.core |
| 21:43 | Sgeo | How do I restart or at least close the REPL in nREPL.el? |
| 21:44 | zoldar | gfredericks: doesn't (seq ...) actually realize its' argument (provided it's a lazyseq) - that would in part defeat the purpose of using lazy-seq.. ? |
| 21:46 | gfredericks | zoldar: just the first element |
| 21:46 | gfredericks | zoldar: I don't believe it defeats the purpose of lazy-seq |
| 21:51 | zoldar | Sgeo: Sgeo there's nrepl-restart and nrepl-quit in upcoming 0.1.5 version, but I suppose you would have to fetch it directly from github |
| 21:51 | zoldar | gfredericks: I suppose that I'm mixing something up, nevermind... |
| 21:51 | gfredericks | it's tricksy |
| 21:55 | holo | technomancy, nice. can lein also parse env files in format ENV=value? |
| 21:56 | Sgeo | The more I think about it, the more I prefer how Common Lisp handles symbols over Clojure |
| 21:56 | Sgeo | At least, to the extent I understand the different |
| 21:56 | Sgeo | difference |
| 21:57 | gfredericks | how does common lisp handle symbols? |
| 21:59 | rbarraud | Very nicely ;-) |
| 21:59 | rbarraud | PCL FTW |
| 22:01 | Sgeo | As far as I understand, the namespace is always part of the symbol, when a symbol is read in by the reader, the namespace is known |
| 22:02 | gfredericks | does that mean that the reader expands 'conj to 'clojure.core/conj or that the programmer types in 'clojure.core/conj? |
| 22:03 | Sgeo | The former |
| 22:03 | Sgeo | ,*ns* |
| 22:03 | clojurebot | #<Namespace sandbox> |
| 22:03 | Sgeo | ,(= 'sandbox/foo 'foo) |
| 22:03 | clojurebot | false |
| 22:03 | Sgeo | In Common Lisp, the equivalent would be true, iirc` |
| 22:06 | Sgeo | * (intern "FOOBAR") |
| 22:06 | Sgeo | FOOBAR |
| 22:06 | Sgeo | :INTERNAL |
| 22:06 | Sgeo | * (eq 'cl-user::foobar 'foobar) |
| 22:06 | Sgeo | T |
| 22:07 | gfredericks | so that makes the qualification behavior in ` unnecessary? |
| 22:07 | Sgeo | If I understand everything correctly, yes |
| 22:08 | gfredericks | are there other advantages? |
| 22:08 | holo | technomancy, forget my question. just noticed the envs are already in a format compatible with bash. thanks for the tips. i'm going to move this to lein |
| 22:09 | Sgeo | gfredericks, for starters, dnolen's library would be working |
| 22:09 | Sgeo | >.> |
| 22:09 | gfredericks | which lib? |
| 22:09 | Sgeo | delimc |
| 22:18 | rbarraud | 20params sounds pathological to /me |
| 22:19 | casion | &(let [n [:a :b :c] r [22 33]] (replace r (take 5 (interleave n (range 3))))) |
| 22:19 | lazybot | ⇒ (:a 22 :b 33 :c) |
| 22:19 | Sgeo | rbarraud, well, I for one am not doing it deliberately |
| 22:20 | casion | if you throw counts for n and n+r, it would work with arbitrary sized seqs |
| 22:20 | Sgeo | Can Clojure fns accept more than 20 parameters? |
| 22:20 | amalloy | of course |
| 22:20 | casion | and it's faster than the aforementioned solutions |
| 22:20 | Sgeo | Ok, good |
| 22:21 | Sgeo | Because apply means that people seem to write fns that take arbitrary amount of parameters (e.g. concat) and with apply it actually becomes reasonable to feed in a lot of parameters for various possibly useful reasons |
| 22:21 | octagon | casion: what does the ampersand do there in front of the expression? |
| 22:21 | Sgeo | octagon, tells lazybot to do it |
| 22:21 | Sgeo | and , is for clojurebot |
| 22:21 | octagon | Sgeo: oh ok |
| 22:22 | gfredericks | and $ is for lazybot. And ~ is for clojurebot. And ## is for lazybot. And ... |
| 22:22 | casion | zoldar: ping if you didn't see the code I posted above |
| 22:23 | zoldar | casion: seen it, thanks |
| 22:24 | octagon | it's interesting that ((fn (vector 'x) (inc x)) 1) gives an error |
| 22:24 | gfredericks | fn is not a function |
| 22:24 | octagon | seems like that should not happen, but i can see why it fails |
| 22:24 | octagon | yes |
| 22:24 | octagon | but still |
| 22:25 | casion | &((fn [x] (vector 'x) (inc x)) 1) |
| 22:25 | lazybot | ⇒ 2 |
| 22:25 | gfredericks | in that case you'd have to quote the x in a vector as well |
| 22:25 | casion | seems to work fine |
| 22:25 | gfredericks | casion: he means using (vector 'x) instead of [x] as the arg list |
| 22:25 | casion | ohh |
| 22:26 | Sgeo | octagon, you might like Tcl |
| 22:26 | octagon | the point is that you can't feed in a list of forms |
| 22:27 | octagon | you need to use the reader syntax for vector |
| 22:27 | octagon | i don't see fn* exposed in my repl |
| 22:27 | gfredericks | fn* is a special form |
| 22:27 | gfredericks | ,((fn* [x] x) :hehe) |
| 22:27 | clojurebot | :hehe |
| 22:28 | gfredericks | you can use it, you just can't reference it |
| 22:28 | octagon | ,((fn (vector 'x) x) 1) |
| 22:28 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol> |
| 22:28 | octagon | ,((fn* (vector 'x) x) 1) |
| 22:28 | clojurebot | #<CompilerException java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to clojure.lang.IPersistentVector, compiling:(NO_SOURCE_PATH:0)> |
| 22:29 | octagon | one of the cool things about lisps is that you can normally convert a list of things into an expression that can be evaluated |
| 22:29 | octagon | i don't see a way to do that here |
| 22:30 | gfredericks | macros and eval |
| 22:30 | octagon | unsatisfying |
| 22:30 | lancepantz | anyone know how to get an nio.ByteBuffer from a BufferedInputStream? |
| 22:30 | octagon | you'd have to use the macro to give you the reader syntax [x] |
| 22:31 | gfredericks | ,(eval (list 'fn (vector 'x) (list '+ 15 'x))) |
| 22:31 | clojurebot | #<Exception java.lang.Exception: SANBOX DENIED> |
| 22:31 | gfredericks | octagon: I'm not sure what you mean by that |
| 22:31 | Sgeo | octagon, check out Tcl, it works exactly how you want in this regard |
| 22:32 | Sgeo | (but probably not in many other regards, in particular, not very functional, no quasiquoting, stringiness, and mutable things require names) |
| 22:32 | octagon | Sgeo: tcl really? i wasn't that into it in 1999 |
| 22:32 | Sgeo | But the point is that there are no special forms in Tcl. |
| 22:33 | Sgeo | If something's expecting a block of code, or of some syntax, you can dynamically create it |
| 22:34 | octagon | Sgeo: well you don't need to resort to tcl for that |
| 22:34 | octagon | Sgeo: most lisps work that way |
| 22:34 | Sgeo | erm, not really? At least, not in a way that doing it is generally supported/accepted/idiomatic in the community |
| 22:35 | octagon | why is the argument list a vector and not a list, like in scheme, for instance |
| 22:35 | gfredericks | clojure uses vectors in a few different syntactic places because it gives a bit more visual variety to the code |
| 22:35 | gfredericks | easier to read |
| 22:36 | octagon | gfredericks: that's not a reason |
| 22:36 | gfredericks | oh darn |
| 22:36 | Sgeo | Common Lisp, Clojure, and Scheme have macros, which accept literal code, but no clean way to generate code to pass in to a macro, without using the (unidiomatic in those Lisps but idiomatic in Tcl) eval |
| 22:36 | gfredericks | I'll have to work on that. |
| 22:36 | octagon | that's something you add to your emacs |
| 22:36 | octagon | there must be a technical reason |
| 22:37 | casion | I've seen it explained elsewhere that it's the reason gfredericks stated |
| 22:38 | casion | for that matter, it was an IRC log with rhickey speaking |
| 22:38 | gfredericks | octagon: I appreciate that the code has decent readability without having to lean on a particular text editor |
| 22:39 | octagon | well i'm surprised, then. i kind of thought that kind of syntax semicolon vs newline stuff was debunked |
| 22:39 | casion | debunked? |
| 22:39 | scottj | octagon: another reason that Rich has mentioned is that he doesn't like that lists are overloaded and used for both function calls and grouping. He prefers those be separate. |
| 22:40 | octagon | scottj: how so? |
| 22:40 | Sgeo | Well, Lisps tend to need correct newlines and indentation to be readable :/ |
| 22:40 | Sgeo | (let [a 1 b 2] ...) the [a 1 b 2] is not a function call or a macro usage |
| 22:41 | Sgeo | ,(doc vec) |
| 22:41 | octagon | Sgeo: okay, now that is an actual reason |
| 22:41 | Sgeo | ,(doc vector) |
| 22:41 | clojurebot | "([coll]); Creates a new vector containing the contents of coll." |
| 22:41 | clojurebot | "([] [a] [a b] [a b c] [a b c d] ...); Creates a new vector containing the args." |
| 22:41 | gfredericks | list forms tend to accentuate the first element |
| 22:41 | octagon | Sgeo: so without the vector you'd need nested lists |
| 22:42 | octagon | as in scheme |
| 22:42 | gfredericks | I think all syntactic vectors in clojure could just as well be lists |
| 22:42 | Sgeo | Not a matter of nested lists, just a matter of stylistically preferring vectors over lists in circumstances where the first element isn't especially important |
| 22:42 | octagon | gfredericks: ugh, that's silly. in racket you can use [] in place of () if you like how that looks better |
| 22:43 | scottj | octagon: rich talks about this in his simple made easy talks btw |
| 22:43 | octagon | gfredericks: racket treats all [] as parens for that reason, so you can make it more "readable" |
| 22:45 | gfredericks | that makes the code across the community less cohesive |
| 22:45 | octagon | Sgeo: i can see the usefulness of using a vector instead of a list for the reason you mentioned; that it isn't an expression that will be evaluated |
| 22:46 | octagon | Sgeo: but being able to express a program as a list of things is so fundamental and useful |
| 22:46 | Sgeo | I should note that as far as I know it's a stylistic thing. Relying on it in a code-walker is probably a bad idea |
| 22:47 | gfredericks | octagon: what is an example of something concrete that you can't easily do in clojure because of this? |
| 22:47 | Sgeo | How is (let [a 1 b 2] (+ a b)) not a list of a symbol, vector, and list? |
| 22:47 | Sgeo | Hence, a list of things? |
| 22:47 | octagon | gfredericks: well i have this thing, it's data that is listlike |
| 22:48 | octagon | gfredericks: and i wrote some stuff in clj that takes these lists and defines the underlying symbols that appear in this data |
| 22:48 | octagon | gfredericks: the idea is that you evaluate the data in this special environment, and it produces a result |
| 22:49 | octagon | gfredericks: this works because any data that is listlike can be evaled, and as long as the symbols that appear in the list data exist in the environemtn, it can be evaluated |
| 22:50 | octagon | that seems like a pretty awesome property |
| 22:50 | octagon | but the fact that you must introduce vectors to the list structure is unfortunate for my application |
| 22:50 | Sgeo | I assume you're macroexpanding-all? |
| 22:50 | Sgeo | n/m, I don't get it |
| 22:51 | casion | I thought he asked what your application was were this was an issue? |
| 22:51 | octagon | well the project is here:https://github.com/micha/hlisp-starter |
| 22:51 | octagon | it reads the DOM body of the html page and evaluates it as a cljs program |
| 22:52 | gfredericks | yeah I'm having a hard time figuring out what the blocker is. You can (eval (list 'let (vec (apply concat name-value-map)) my-code)) |
| 22:52 | gfredericks | that doesn't apply to cljs though |
| 22:53 | octagon | what i can't do is <defn><vector><x/></vector><x/></defn> |
| 22:53 | octagon | rather <defn><vector><quote><x/></quote><x/></defn> |
| 22:54 | gfredericks | oh I see; so you're working (for some reason) in a domain where you only have one type of sequence |
| 22:54 | octagon | no, i could introduce syntax for vectors, of course |
| 22:54 | octagon | which i will do |
| 22:55 | octagon | but i was just curious about why this non-uniformity was adopted, and i got some good references, so thanks for that |
| 22:56 | Sgeo | I still don't like the existence of namespace-unqualified symbols |
| 22:57 | Sgeo | (require [some-ns :as some-alias]) (= 'some-ns/foo 'some-alias/foo) should be true imo |
| 22:58 | Sgeo | In the Common Lisp version, I had to intern the symbol. Now, I think I see why |
| 22:58 | Sgeo | Hmm |
| 22:58 | Sgeo | ,(= #'ns #'ns) |
| 22:58 | clojurebot | true |
| 22:58 | Sgeo | Hmm! |
| 22:58 | gfredericks | ? |
| 22:59 | Sgeo | I know how to fix delimc. |
| 22:59 | Sgeo | Resolve the symbols, should resolve to a var, right? |
| 22:59 | Sgeo | ,(resolve 'ns) |
| 22:59 | clojurebot | #'clojure.core/ns |
| 22:59 | gfredericks | yep |
| 22:59 | Sgeo | These vars are in fact exactly what I want when I speak of Common Lisp symbols. |
| 23:00 | gfredericks | that sounds like an important realization :) |
| 23:00 | Sgeo | This needs to be mentioned somewhere |
| 23:01 | gfredericks | there was a talk at clojure/west entitled "namespaces, symbols, vars, oh my!" I think |
| 23:01 | gfredericks | surely a video o the interwebs by now |
| 23:01 | Sgeo | I hate videos. Any transcripts? |
| 23:01 | gfredericks | ha; no idea |
| 23:01 | gfredericks | but you probably understand most of it b ynow |
| 23:11 | gfredericks | I say that but just remembered I haven't actually seen the talk myself |
| 23:13 | Sgeo | gfredericks, watching now |
| 23:14 | gfredericks | Sgeo: let me know how it is :) |
| 23:17 | Sgeo | gfredericks, the slides are somewhat unreadable, as in, not high enough resolution |
| 23:29 | gfredericks | drat. |