2012-08-18
| 01:29 | rbxbx | Quiet tonight. |
| 01:31 | xeqi | weekends usually are compared to workdays (US) |
| 01:39 | gtuckerkellogg | Any sugestions on making this more idiomatic? http://pastebin.com/jk6jPqcv |
| 01:43 | Cr8 | hm, I think this is working: https://www.refheap.com/paste/4457 |
| 01:44 | rbxbx | xeqi fair enough, guess people have to have some sort of social lives. |
| 01:44 | uvtc | What would be the intent behind creating a function that looks like: `(defn foo [x & [ys]] ...)`? |
| 01:46 | rbxbx | you mean the destructuring portion? |
| 01:46 | uvtc | Yes. |
| 01:46 | Cr8 | uvtc: that function expects either one or two params |
| 01:48 | uvtc | Cr8: Oh, I see. You not only want it to work with 1, 2, or more args, but you *also* want to indicate via the signature that if you pass more, they'll be ignored. |
| 01:49 | Cr8 | actually I believe passing more would be an error |
| 01:50 | uvtc | Er... |
| 01:50 | Cr8 | ,(letfn [(foo [x & [y]] [x y])] [(foo 1) (foo 1 2)]) |
| 01:50 | clojurebot | [[1 nil] [1 2]] |
| 01:50 | Cr8 | ,(letfn [(foo [x & [y]] [x y])] [(foo 1) (foo 1 2) (foo 1 2 3)]) |
| 01:50 | clojurebot | [[1 nil] [1 2] [1 2]] |
| 01:50 | Cr8 | nope, I'm wrong |
| 01:50 | uvtc | Right. They just get ignored. |
| 01:51 | uvtc | But the destructuring indicates to the reader that extra args get dropped. |
| 01:51 | uvtc | Thanks, Cr8. :) |
| 01:52 | Cr8 | well the & just indicates to bind the next thing to the list of "the rest of the stuff", so it's just destructuring -that- list |
| 01:52 | Cr8 | you could do |
| 01:53 | Cr8 | ,(letfn [(foo [x & [{:keys [a]}]] [x y])] [(foo 1) (foo 1 {:a 2})]) |
| 01:53 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: y in this context, compiling:(NO_SOURCE_PATH:0)> |
| 01:53 | Cr8 | ,(letfn [(foo [x & [{:keys [a]}]] [x a])] [(foo 1) (foo 1 {:a 2})]) |
| 01:53 | clojurebot | [[1 nil] [1 2]] |
| 01:53 | Cr8 | right, that |
| 01:55 | Cr8 | and that all works in any destructuring of a sequence, not just arg lists |
| 01:56 | Cr8 | ,(let [l '(1 2 3)] (let [[a & [b]] l] [a b])) |
| 01:56 | clojurebot | [1 2] |
| 01:57 | uvtc | Cr8: I see what your letfn example does. It says, "whatever extra args get passed, pack them up into a seq, then take that first item of the seq and treat it like it's a hash-map, taking out the val for :a and assigning it to a." |
| 01:58 | amalloy | (defn foo [x & [y]] ...) is just a grossly lazy way to write (defn foo ([x] ...) ([x y] ...)) |
| 01:59 | uvtc | Cr8: right, your most recent example just does the same as above. Got it. |
| 01:59 | uvtc | Cr8: thanks. |
| 02:00 | uvtc | amalloy: I'm not sure what you mean. Do you mean that --- inside of `(defn foo [x & [y]] ...)` you then can expect logic that checks how many args were passed? |
| 02:00 | uvtc | s/you then/--- you then/ |
| 02:00 | Cr8 | you can provite different arities in a defn. |
| 02:01 | uvtc | Cr8: Right. I know that. :) |
| 02:02 | uvtc | Cr8: So, given amalloy's example, I'm not sure where the laziness is (real laziness, not lazy-seq laziness :) ). |
| 02:03 | uvtc | The function I was looking at is: |
| 02:03 | uvtc | https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/params.clj#L33 |
| 02:03 | amalloy | uvtc: basically. sometimes nil is the reasonable default for y, and you can elide the check, but often you see functions that wind up doing the check |
| 02:06 | uvtc | Ok. `y` is set to nil if you don't pass in a value for it. |
| 02:06 | uvtc | Thanks, amalloy. |
| 02:11 | amalloy | uvtc: i haven't looked closely, but i'd be surprised if [x & [y]] were used anywhere in the clojure source at all. it's *much* slower than a two-arg function |
| 02:12 | amalloy | er, two-arity |
| 02:14 | uvtc | amalloy: Oh, interesting. Thanks. |
| 02:15 | aperiodic | i hear that destructuring has overhead, but are there any good links on exactly how much i should expect? |
| 02:17 | amalloy | aperiodic: in real life? none. i'm just exaggerating because clojure.core is tuned aggressively for performance |
| 02:17 | aperiodic | sweet |
| 02:33 | rbarraud | KiwiPing? |
| 02:33 | rbarraud | KiwiAucklandWaikatoPing? |
| 02:34 | rbarraud | Eatingp |
| 06:41 | firesofmay | Hi, How do I save the output of my clojure.test to a variable? |
| 06:46 | jjcomer | @firesofmay Try using the with-out-str macro. This should bind *out* to a string |
| 06:47 | firesofmay | jjcomer, is this correct? : |
| 06:48 | firesofmay | (def msg (with-out-str |
| 06:48 | firesofmay | (run-tests))) |
| 06:48 | firesofmay | jjcomer, as I am getting "" inside msg variable. |
| 06:50 | borkdude | ,(count (with-out-str (print "foo"))) |
| 06:50 | clojurebot | 3 |
| 06:50 | jjcomer | @firesofmay That is how you should call it. |
| 06:53 | firesofmay | jjcomer, borkdude that works fine for print statements. but for run-tests it does not work. |
| 06:53 | firesofmay | maybe because the result is a clojure.lang.PersistentArrayMap? |
| 06:58 | nbeloglazov | &(doc with-err-str) |
| 06:58 | lazybot | java.lang.RuntimeException: Unable to resolve var: with-err-str in this context |
| 07:03 | borkdude | hmm spacebar doesn't work in light table |
| 07:04 | borkdude | could be because I'm in demo mode now |
| 07:05 | borkdude | hmm, it wants me to type (+ 4 5) in the scratch editor, but I can't |
| 07:05 | jjcomer | @firesofmay This worked: (let [s (java.io.StringWriter.)] (binding [*test-out* s] (with-test-out (run-tests))) (str s)) |
| 07:07 | firesofmay | jjcomer thanks that worked :) |
| 07:08 | borkdude | ibdknox just for the record, I couldn't type a space in demo mode of the table |
| 07:08 | borkdude | ibdknox it worked when demo mode was over |
| 07:08 | jjcomer | @firesofmay np |
| 08:01 | azkesz | Hi, is it possible to destructure only the last element ? |
| 08:04 | foodoo | azkesz: good question. But if you only need the last component of a collection, why not just use (last)? Destructuring is usually used when you need to extract several different parts from a collection. |
| 08:04 | gfredericks | azkesz: the answer is no :) |
| 08:05 | azkesz | ok good point, I'm merely wondering how that would be possible |
| 08:05 | gfredericks | reversing it first could do it |
| 08:05 | gfredericks | or if you know how many elements there are you could destructure the whole thing |
| 08:06 | azkesz | something like this doable? (defn y [[ ... last-2 last-1 last ]] (println "the last 3: " last-2 last-1 last)) |
| 08:06 | azkesz | assuming I don't know the size of the passed vector |
| 08:07 | azkesz | but i do want to use destructuring=) |
| 08:07 | azkesz | gfredericks, I mean, I don't know where I would do the reversing |
| 08:07 | gfredericks | destructuring is built on the seq interface, which only supports first/rest |
| 08:07 | gfredericks | (defn y [arg] (let [[last] (reverse arg)] ...)) |
| 08:08 | gfredericks | or simply (defn y [arg] (let [last-el (last arg)] ...)) |
| 08:08 | gfredericks | which is more efficient |
| 08:09 | azkesz | would it be more complicated for getting the last 3? |
| 08:09 | azkesz | I imagine having to call rest 2 times? |
| 08:10 | azkesz | or can the (reverse args) be used as the input vector for a destructuring? and get the first 3? |
| 08:12 | azkesz | ,(let [rev (reverse (range 4))] (let [last last-1 last-2 & _] (println "last 3: " last-2 last-1 last)) |
| 08:12 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading> |
| 08:13 | gfredericks | (defn y [arg] (let [[last last-2 last-3] (reverse arg)] ...)) |
| 08:13 | azkesz | that's quite nice |
| 08:16 | jml | is there a standard/recommended command-line argument parsing library? |
| 08:16 | azkesz | ,((fn [arg] (let [[last last-1 last-2] (reverse arg)] (println "last 3: " last-2 last-1 last))) (range 10) ) |
| 08:16 | clojurebot | last 3: 7 8 9 |
| 08:17 | azkesz | gfredericks, thank you |
| 08:17 | Bronsa | jml: https://github.com/clojure/tools.cli |
| 08:17 | jml | Bronsa: thanks. |
| 08:17 | Bronsa | np |
| 08:18 | azkesz | how can I find out what methods ISeq supports? |
| 08:21 | azkesz | found here: http://clojure.org/sequences |
| 08:39 | jml | I wish I could hug clojure. |
| 08:47 | Iceland_jack | jml: (you can) |
| 09:03 | hyPiRion | Wouldn't it be more efficient to just do this? |
| 09:03 | hyPiRion | (let [[last-2 last-1 last] (take-last 3 (range 100))] [last-2 last-1 last]) |
| 09:03 | hyPiRion | ,(let [[last-2 last-1 last] (take-last 3 (range 100))] [last-2 last-1 last]) |
| 09:03 | clojurebot | [97 98 99] |
| 09:04 | hyPiRion | And if you know it's a vector, then this is constant time: |
| 09:05 | hyPiRion | ,(let [v (vec (range 100)) n (count v) {last-2 (- n 3) last-1 (- n 2) last (- n 1)} v] [last-2 last-1 last]) |
| 09:05 | clojurebot | [97 98 99] |
| 09:15 | jml | Do I have to add something to my :dependencies in project.clj to use things from clojure.contrib? |
| 09:21 | jml | how do I check if x is a substring of y? |
| 09:25 | jml | (.contains x y) seems to wor |
| 09:25 | jml | work, rather. |
| 09:25 | Bronsa | that's the way to go |
| 09:55 | jml | hmm. paredit-mode isn't automatically closing braces the way it does parens and brackets |
| 09:57 | llasram | jml: In clojure-mode file buffers, or in the SLIME REPL buffer, or somewhere else entirely? |
| 09:57 | jml | llasram: clojure-mode buffers. |
| 09:58 | llasram | jml: Hmm, that is odd. |
| 09:59 | jml | maybe I have the wrong version of paredit, or there's a customize setting I'm missing |
| 10:00 | llasram | Just clarify, which is the character you mean by "brace"? |
| 10:01 | jml | { |
| 10:02 | llasram | Yeah, some other people have had problems with that in the past. Is it in fact bound to paredit-open-curly ? |
| 10:02 | jml | no, apparently not. |
| 10:02 | jml | just to self-insert |
| 10:04 | llasram | Ok. And try `describe-syntax` in a Clojure buffer, and check on the syntax of { and }. The should be open and close respectively |
| 10:05 | jml | { (} which means: open, matches } |
| 10:05 | jml | } ){ which means: close, matches { |
| 10:05 | jml | looks sane to me. |
| 10:06 | devn | http://bit.ly/NaYJNx |
| 10:07 | devn | jml: i can help you out with that. |
| 10:08 | jml | devn: cool. how? |
| 10:09 | devn | jml: try: (define-key slime-repl-mode-map (kbd "{") 'paredit-open-curly) |
| 10:09 | devn | as well as (define-key slime-repl-mode-map (kbd "}") 'paredit-close-curly) |
| 10:09 | devn | i think that ought to do it |
| 10:10 | llasram | Except that jml's problem is with clojure-mode, not with the slime repl :-) |
| 10:10 | devn | d'oh |
| 10:10 | jml | right. I can manually bind the keys. |
| 10:10 | jml | I guess I'm vaguely interested in knowing why they aren't working out-of-the-box. |
| 10:10 | llasram | jml: Ah! |
| 10:11 | llasram | So those keys aren't bound by paredit itself |
| 10:11 | llasram | clojure-mode has a hook to add them when paredit-mode is already loaded |
| 10:12 | llasram | Assuming you don't just have an ancient/busted version of clojure-mode |
| 10:12 | llasram | Just re-`clojue-mode`ing your buffer should fix it |
| 10:13 | jml | llasram: didn't seem to work. it's possible I do have an old version. clojure things seem to move more rapidly than its Ubuntu packaging |
| 10:13 | jml | s/its/their/ |
| 10:14 | llasram | Oh yeah! |
| 10:14 | jml | (when (>= paredit-version 21) |
| 10:14 | jml | my paredit is 20 |
| 10:14 | llasram | Ahh, well there you go |
| 10:15 | llasram | marmalade to the rescue then :-) |
| 10:15 | llasram | Or... what's the newer cool one that builds new emacs packages straight from github repos? |
| 10:16 | jml | llasram: not sure. |
| 10:16 | jml | llasram: thanks for the help though |
| 10:16 | llasram | np! |
| 10:17 | llasram | Ah, MELPA: http://melpa.milkbox.net/ |
| 10:28 | davidd` | hey, what's the relationship between ClojureScript and ClojureScript One? |
| 10:29 | davidd` | it looks like ClojureScript One is an example/tutorial app? |
| 10:29 | djpowell | clojurescriptone is basically somewhere between an example of how to get started with clojurescript, and a set of reusable frameworks |
| 10:30 | davidd` | oh cool thx djpowell |
| 10:31 | djpowell | it has some good ideas. if you'd prefer to start with a clean slate though, it is worth checking out lein-cljsbuild |
| 10:40 | jml | is there a sensible flymake configuration for clojure? |
| 10:40 | llasram | jml: Like for auto-running tests? |
| 10:41 | jml | llasram: I'm thinking more of something like pyflakes that does a quick static check for double definitions, using names that aren't defined, etc. |
| 10:43 | llasram | Hmm. I'm not sure -- I don't think it fits with the typical workflow. I think most people have a running REPL session that they're constantly sending code to as they write it. |
| 10:45 | llasram | I haven't used it yet, but there is lazytest, which kicks of a process which monitors your sources and re-runs your tests whenever they change |
| 10:45 | llasram | But I'm not sure of the best way to glue a persistent process into something like flymake... |
| 10:46 | jml | hmm, thanks |
| 10:46 | jml | it's mostly just to catch things like misspellings, or requiring modules that aren't being used. |
| 10:52 | casion | jml: I've yet to encounter those things when working in clojure |
| 10:52 | casion | lisps seem to make those concerns a non-issue due to the workflow |
| 10:52 | jml | I just misspelled 'frequencies' as 'frequency' |
| 10:53 | llasram | Sure, but didn't you then send that change to the REPL as soon as you'd typed it? |
| 10:53 | casion | if you're using the repl often, you'd catch that right away |
| 10:53 | jml | llasram: I ran the tests which caught it |
| 10:54 | llasram | Are you using an Emacs-connected REPL? If not I highly suggest it |
| 10:56 | jml | llasram: I am. I'm sure I'm not using it to anywhere near its full potential. |
| 10:57 | jml | mostly just swapping into it and typing / copy/pasting stuff like I would to a Python repl on the command line |
| 10:58 | llasram | If you're using SLIME or nrepl.el, try hitting C-c C-k every time you finish typing a reasonably complete thought |
| 10:58 | jml | llasram: heh, ok. thanks. |
| 10:58 | jml | btw, would appreciate a quick glance over https://github.com/jml/anagrm/blob/master/src/anagrm/core.clj and https://github.com/jml/anagrm/blob/master/test/anagrm/core_test.clj to verify I'm not doing anything catastrophically silly. |
| 10:59 | llasram | That's been the biggest workflow change for me :-) But it makes a surprisingly large difference, having the current state of your program always available to poke at as change it |
| 11:00 | llasram | jml: Trivial, but `anagram?` has the parameters and docstring in the wrong order. It took me a while + religiously putting params on a new line after the function name to get that right... |
| 11:01 | jml | llasram: oh, good one, thanks. |
| 11:02 | jml | also, I think I can make the (use ...) call a directive in ns |
| 11:02 | llasram | Yep, was just about to type that :-) |
| 11:02 | jml | data trumps code |
| 11:03 | ebaxt | anyone know how to write this css selector in enlive? head > script:last-of-type? Only thing I get working is [[:head] [last-of-type :script]] but it seems a bit verbose... |
| 11:03 | jml | much like making an omelette trumps sitting here & going hungry. |
| 11:03 | jml | bbiab. |
| 11:03 | llasram | Also, would suggest switching to Clojure 1.4, wherein :use is unofficially deprecated, and you can just do :require with a :refer option. Reduces the number of slightly-different things going on |
| 11:25 | Frozenlock | cljs: trying to load jayq from the repl (load-namespace 'jayq.core). Then I try to get the body: ($ :body), but I get this error: "Error evaluating:" ($ :body) :as "test.crypt.$.call(null,\"\\uFDD0'body\");\n" |
| 11:25 | Frozenlock | #<TypeError: Cannot call method 'call' of undefined> |
| 11:25 | Frozenlock | Did I failed in loading the library? |
| 11:33 | jml | llasram: good idea. I don't really see any benefit in sticking with the Ubuntu-packaged stuff. |
| 11:33 | acagle_ | I'm using ERC Version 5.3 with GNU Emacs 24.1.1 (x86_64-apple-darwin11.4.0, multi-tty) of 2012-08-07. |
| 11:38 | jml | can I download the API & reference docs for offline use? |
| 11:42 | llasram | jml: Beyond the docstrings you can get to with `slime-describe-symbol`? |
| 11:42 | jml | llasram: well, I want something I can browse & search. |
| 11:43 | llasram | Well, you could build the docos yourself from the source, using the same process used to build the on-line version. I just try to always be online, so haven't done it myself :-) |
| 11:43 | jml | hmm, ok. |
| 11:44 | jml | I might hold off on that one for a bit |
| 11:49 | jml | oh, slime has an apropos search. neat. |
| 12:00 | jml | I gather a lot of time is spent firing up the JVM when running a command-line app |
| 12:01 | llasram | Unfortunately. It does make it somewhat more annoying to write command-line applications in Clojure |
| 12:03 | jml | yeah |
| 12:03 | jml | Python's no rock star when it comes to startup time either |
| 12:04 | jml | hmm. I guess I should try to do something webby now. |
| 12:06 | jml | noir certainly has a pretty looking web page |
| 12:07 | Frozenlock | jml: I agree, ibdknox sure has some kind of 'design' fiber in him. |
| 12:09 | ludston | It's a pity light table is so slow now. |
| 12:09 | ludston | Hopefully it will get quicker soon |
| 12:09 | ibdknox | ludston: slow now? |
| 12:09 | ludston | Oh hi! Huge fan! |
| 12:09 | Frozenlock | lol |
| 12:10 | ludston | Noticable delay when typing |
| 12:10 | ibdknox | really? |
| 12:10 | ludston | Yeah |
| 12:10 | ibdknox | typing where? |
| 12:10 | ibdknox | what kind of machine? |
| 12:10 | ludston | Chromium in linux, 8gb ram i7, KDE |
| 12:10 | ludston | Running on openjdk |
| 12:10 | ibdknox | and typing anywhere is slow? |
| 12:10 | ludston | Yeah |
| 12:11 | ludston | Like |
| 12:11 | ludston | 0.1 seconds delay |
| 12:11 | ibdknox | woah |
| 12:11 | ibdknox | hm |
| 12:11 | ludston | Just enough to be jarring |
| 12:11 | ibdknox | it's not delayed on osx, windows, or ubuntu :( |
| 12:12 | ibdknox | though I haven't tried chromium directly |
| 12:12 | ludston | It could be more chromium than anything else |
| 12:12 | ludston | Dunno how much more optimized chrome is |
| 12:12 | ibdknox | I'll take a look |
| 12:12 | ludston | Awesome! |
| 12:13 | ibdknox | typing certainly should not be slow |
| 12:34 | ludston | ibdknox: It gets slower when you have multiple tabs with javascript running on them |
| 12:34 | ludston | Specifically stuff like google's instasearch |
| 12:35 | ludston | But then killing those tabs speeds it up |
| 12:39 | Frozenlock | Weird... in cljs, (ns dom.test (:require [jayq.core])) doesn't seem to load the library the same way `use' would. I can't call the library's function directly. |
| 12:40 | Frozenlock | (ns dom.test (:require [jayq.core :as j])) works as expected: (j/$ :body) is valid. |
| 12:41 | Frozenlock | But really, I would like to load a library and then have all the functions available. Is this possible? |
| 12:41 | jml | I've got something that's working with 'lein test' but failing to compile with slime. It's after switching from requiring string and using it as clojure.string/lower-case to ':require clojure.string :refer (lower-case)' and updating the call sites to say just 'lower-case' |
| 12:41 | jml | error: java.lang.RuntimeException: Unable to resolve symbol: lower-case in this context, compiling:(/home/jml/src/clojure/anagrm/src/anagrm/core.clj:17) |
| 12:47 | llasram | jml: (ns ... (:require [clojure.string :refer [lower-case]])) ? |
| 12:48 | llasram | (Using lists instead of vectors should be fin e -- mostly just making sure everything was appropriately wrapped) |
| 12:49 | llasram | You can always: (remove-ns 'namespace.symbol) |
| 12:49 | llasram | then re-SLIME-compile |
| 12:49 | llasram | That will force the namespace to be created afresh, if anything has gotten too confused |
| 12:50 | llasram | (but will leave dangling referencess to the old namespace if any others have `require`d it) |
| 12:50 | jml | llasram: same behaviour with vector rather than list. |
| 12:50 | jml | llasram: mucking around w/ remove-ns now. |
| 12:51 | jml | llasram: https://github.com/jml/anagrm/blob/master/src/anagrm/core.clj has the code, fwiw |
| 12:51 | llasram | Oh, and if it wasn't clear, `namespace.symbol` is the namespace you're defining, not importing from. I actually usually just do: (remove-ns (ns-name *ns*)) |
| 12:54 | jml | llasram: aahh, that helps (although I've seized this opportunity to restart emacs to get the new paredit I installed.) |
| 12:59 | ibdknox | Frozenlock: you have to do (:use [blah :only [cool]] CLJS doesn't allow anything else |
| 13:01 | llasram | I should restart emacs one of these days... |
| 13:01 | casion | llasram: lol, I know what you mean |
| 13:01 | llasram | Yep, May 29th :-) |
| 13:01 | casion | feb 11 here |
| 13:01 | llasram | Nice |
| 13:01 | casion | uptime since december |
| 13:01 | casion | wow |
| 13:02 | casion | I've restarted my slime emacs instance |
| 13:02 | casion | but my C environment is pretty old lol |
| 13:06 | Frozenlock | ibdknox: shame I have to enumerate them... but thanks for the answer! |
| 13:07 | zilti | I'm trying to use clojure-jack-in with emacs-24 on Windows 7. But I always get an error message that the command \"\"java\"\" is mistyped or could not be found. I'm using the most recent version of leiningen. |
| 13:07 | mdeboard | Does anyone have any resources for giving a "Why Clojure?" talk? I'm giving one at my local Scala & Lambda Lounge meetups and I'd like to not reinvent all the wheels |
| 13:08 | casion | ibdknox: is there a roadmap for light table? |
| 13:08 | Frozenlock | zilti: in the command prompt, if you type "java -version", do you have something? |
| 13:08 | mdeboard | That is, a talk to people who are already sold on the benefits of FP |
| 13:08 | ibdknox | casion: there are about 10 right now :) |
| 13:09 | zilti | Frozenlock: Yes, I'm using Version 1.7.0_05 |
| 13:09 | casion | ibdknox: well… that's not very helpful lol |
| 13:09 | ibdknox | casion: there are some key things happening in the next couple weeks that will determine which one we execute on |
| 13:09 | zilti | 64bit, might that be the problem? |
| 13:09 | casion | ibdknox: alright, well good luck. Very cool work you're doing |
| 13:11 | mdeboard | casion: I'm tinkering with LT atm, are you connecting to another project? |
| 13:11 | casion | mdeboard: not atm |
| 13:11 | Frozenlock | I don't think so... I was using it too. You can check http://frozenlock.org/2012/03/06/clojure-on-windows-7/, it's the notes I've taken when I installed it on my win7 machine. Note that it was for lein1, so I really don't know if it's accurate anymore. |
| 13:11 | mdeboard | Trying to sort out how that works exactly |
| 13:11 | casion | mdeboard: I couldnt figure it out, I've been trying the liverepl all day |
| 13:12 | zilti | Frozenlock: thanks, I'll have a look |
| 13:12 | mdeboard | casion: Are you getting a java runtime error by chance |
| 13:12 | casion | mdeboard: with connecting? |
| 13:12 | mdeboard | Wlel, I connect fine |
| 13:13 | mdeboard | oh |
| 13:13 | mdeboard | oh god |
| 13:13 | mdeboard | ibdknox: I'''''' |
| 13:13 | mdeboard | ibdknox: This is awesome. |
| 13:13 | casion | oh no, he's having a stroke |
| 13:13 | mdeboard | casion: I think I got it sorted :P |
| 13:13 | casion | what was it? |
| 13:13 | zilti | Well, it's not anything new for me there. |
| 13:14 | mdeboard | casion: I restarted and went right to table, instead of going to irepl then connecting |
| 13:14 | Frozenlock | Is there autocompletion and docs with LT? |
| 13:14 | casion | mdeboard: oh!? does that make it work? |
| 13:14 | ibdknox | Frozenlock: still coming |
| 13:14 | mdeboard | It did here |
| 13:14 | casion | I've always gone straight to the repl |
| 13:14 | casion | maybe that's my problem too |
| 13:14 | mdeboard | it's pretty awesome, wow |
| 13:14 | Frozenlock | ibdknox: Well it's nice that it's planned :) |
| 13:14 | ibdknox | there appears to be some very weird bug that prevents the nsbrowser from loading the nss only some of the time on first connect |
| 13:15 | ibdknox | a couple people have run into that |
| 13:15 | ibdknox | refreshing should resolve it |
| 13:16 | firesofmay | Hi, What library is recommended for http connection and receiving response in clojure? |
| 13:16 | zilti | Hm I really suspect it could be because Java is 64-bit and emacs is 32-bit. |
| 13:17 | Frozenlock | firesofmay: I use clj-http |
| 13:17 | firesofmay | Frozenlock, thanks checking. |
| 13:17 | xeqi | firesofmay: https://clojars.org/clj-http |
| 13:18 | firesofmay | thanks xeqi! |
| 13:18 | casion | mdeboard: ooh it does work then |
| 13:18 | mdeboard | ibdknox: I've been doing some work with packaged chrome apps at work, I assume that's the eventual plan here? |
| 13:19 | mdeboard | s/I assume that's/Is that |
| 13:19 | ibdknox | mdeboard: standalone app with embedded webkit is the long term goal |
| 13:19 | mdeboard | ahhh |
| 13:19 | mdeboard | I like a lot. |
| 13:19 | casion | ok, this is way cooler than I thought |
| 13:19 | mdeboard | casion: lol, my exact reaction |
| 13:20 | mdeboard | Now, where's my T-shirt |
| 13:20 | mdeboard | :P |
| 13:20 | casion | I can't remember the last time, if ever, that I opened an IDE and thought 'oooooOOOooOOoo this could be more useful than doing this in emacs' |
| 13:20 | mdeboard | Yeah eventually for sure |
| 13:20 | bosie | whats a good resource for learning about stm? |
| 13:21 | zilti | casion: lighttable looks extremely promising |
| 13:21 | mdeboard | bosie: The wikipedia article is good |
| 13:21 | Spaceghostc2c | casion: True story yes. |
| 13:21 | Frozenlock | C'mon, nothing's better than Emacs |
| 13:21 | mdeboard | The road to replacing emacs is a long one for me though. |
| 13:21 | casion | It just needs something identical to paredit, and I'll be very happy |
| 13:22 | bosie | mdeboard: what are you replacing it with? |
| 13:22 | casion | whoa whoa, no one said replacing emacs |
| 13:22 | mdeboard | bosie: Nothing yet. |
| 13:22 | casion | let's not go insane here |
| 13:22 | Frozenlock | let's use notepad :p |
| 13:22 | mdeboard | Frozenlock: Consider it done |
| 13:23 | mdeboard | Now if someone would just invent a browser-based version of Notepad with live code evaluation, we'd be set. |
| 13:23 | casion | os x supports most emacs nav commands, so this is pretty useful already |
| 13:23 | casion | besides the obvious omissions |
| 13:23 | foodoo | mdeboard: live code evaluation in general or just JS? |
| 13:23 | Frozenlock | I have coworkers doing code in notepad. (I'm not a programmer and I don't work in a code-related field, but still, it's sad to see) |
| 13:23 | mdeboard | foodoo: I was kidding, the joke being that Light Table is browser-based with live code-evaluation |
| 13:24 | mdeboard | Frozenlock: Why are you in here if you're not a programmer |
| 13:24 | Frozenlock | Because I'm awesome ? |
| 13:24 | Frozenlock | :p |
| 13:24 | foodoo | mdeboard: Depends on the definition of a programmer. I am not a professional programmer. It's mostly a hobby |
| 13:24 | Frozenlock | I like to program. Perhaps one day I'll know enough to be one |
| 13:24 | mdeboard | I don't subscribe to the notion that "programmer" is a protected title. Farmers farm, programmers program, QED |
| 13:24 | casion | I'm in #c++ and I don't know a single god damned thing about C++ |
| 13:25 | casion | so I empathize |
| 13:25 | mdeboard | casion: No one does |
| 13:25 | casion | touché |
| 13:25 | foodoo | casion: You know that it's a programming language. |
| 13:25 | mdeboard | If you program, you're a programmer. It's a tautology |
| 13:25 | mdeboard | but some people still need to be convinced |
| 13:25 | Frozenlock | Ok I mispoke, I'm not a professional programmer. |
| 13:25 | foodoo | mdeboard: convinced of what? |
| 13:26 | mdeboard | foodoo, Frozenlock: Some programmers get very protective/defensive of new or hobbyist programmers calling themselves programmers |
| 13:26 | bosie | mdeboard: know of anything more clojure relrated? |
| 13:26 | bosie | mdeboard: still talking about stm ;) |
| 13:26 | casion | mdeboard: that's the dumbest thing I've ever heard |
| 13:26 | mdeboard | bosie: So, you're not looking for technical details but Clojure-specific implementation? |
| 13:26 | casion | I've not encountered that, but if it is common then I need to get my ski-mask and ice pick ready |
| 13:27 | bosie | mdeboard: well, the wiki covers the technical details rather nicely i must say |
| 13:27 | foodoo | bosie: what don't you understand? The general concept? Or something specifc? |
| 13:27 | bosie | foodoo: how its built on top of java/jvm |
| 13:27 | foodoo | bosie: with locking |
| 13:28 | mdeboard | bosie: You should read about Clojure's data structures for managing state. Agents, refs, etc |
| 13:28 | bosie | mdeboard: k, haven't read up on those. will do, thanks. |
| 13:28 | mdeboard | bosie: If you're evaluating Clojure for use, you should pick up a copy of Clojure Programming |
| 13:28 | bosie | mdeboard: i am not evaluating |
| 13:28 | bosie | mdeboard: i am going to use it |
| 13:29 | casion | I personally like Programming Clojure better, but either is great |
| 13:29 | mdeboard | casion: Those two & Joy of Clojure are all good but Clojure Programming was the first that I was able to read (almost) cover-to-cover |
| 13:30 | bosie | mdeboard: i bought both actually, started reading CP and i find it quite approachable. more so than PC |
| 13:30 | bosie | granted, i am only 70 pages in |
| 13:30 | casion | mdeboard: it was the exact opposite for me. Clojure Programming assumes you've used another dynamic language |
| 13:30 | casion | and I haven't |
| 13:30 | mdeboard | casion: Yeah, very true |
| 13:30 | casion | so it was very confusing for me |
| 13:30 | mdeboard | huh |
| 13:30 | foodoo | I recommend that you check out various videos on http://blip.tv/clojure because Clojure follows a specific philosophy |
| 13:30 | mdeboard | Interesting |
| 13:31 | bosie | cainus: hm. i haven't noticed |
| 13:31 | Frozenlock | cljs - Is there a way to print in the repl the content of #<[object Object]>? |
| 13:31 | foodoo | And understanding this philosophy really helps |
| 13:31 | casion | Progamming Clojure expained things in a more general sense without constantly saying 'Here, just look at this python code' |
| 13:31 | mdeboard | and of course watch Simple Made Easy http://www.infoq.com/presentations/Simple-Made-Easy/ |
| 13:31 | holo | hi |
| 13:31 | mdeboard | for great encapsulation of Clojure philosophy :) |
| 13:31 | foodoo | Simple Made Easy is definitely a must-watch |
| 13:31 | mdeboard | casion: Didn't think of that, but you're right. I definitely live in a dynamic language echo chamber :P |
| 13:31 | casion | mdeboard: I've spent most of my programming life doing embedded C and asm |
| 13:32 | mdeboard | I'll keep that in mind when doing my talk at IndyScala |
| 13:32 | bosie | mdeboard, foodoo bookmaraked, thanks |
| 13:32 | casion | clojure has been a total mindfuck for me lol |
| 13:32 | bosie | foodoo: specific philosphy? |
| 13:32 | casion | never used a functional or dynamic language |
| 13:32 | casion | or lisp |
| 13:32 | casion | and most everything assumes experiecne in one of those 3 things |
| 13:32 | mdeboard | casion: How long have you been pergermming? |
| 13:32 | bosie | casion: damn, from asm to clojure.... |
| 13:32 | bosie | ;) |
| 13:33 | Frozenlock | casion: ever used a repl while coding? |
| 13:33 | foodoo | bosie: keeping things as simple as it makes sense (incidental vs. accidental complexity), function programming, abstractions, .... |
| 13:33 | casion | mdeboard: hmm, 14 years doing 'professional' stuff |
| 13:33 | casion | longer as a hobbyist |
| 13:33 | foodoo | function -> functional |
| 13:33 | mdeboard | casion: wow |
| 13:33 | atsidi | what irks me is the way everything written just assumes you were a java developer first. |
| 13:33 | clojurebot | Ik begrijp |
| 13:33 | bosie | Frozenlock: i would be surprised if asm has a repl |
| 13:33 | casion | mdeboard: I get in trouble here just asking the wrong questions as it is |
| 13:33 | foodoo | bosie: In MS DOS you could get into the debugger and type in assembly language statements to execute |
| 13:33 | casion | half the shit I think I'm trying to figure out isn't even applicable on FP or clojure |
| 13:34 | holo | i want to reduce partially a collection by joining some items of it to each other. with wich function can i accomplish this? |
| 13:34 | bosie | casion: like? |
| 13:34 | casion | and I constantly want to know implementation details |
| 13:34 | Frozenlock | atsidi: +++ The hard part of clojure is the *&^&%& java understuff |
| 13:34 | foodoo | holo: what does your input look like? |
| 13:34 | casion | bosie: mostly conceptual things relative to FP, like passing values around |
| 13:34 | bosie | foodoo: hah, didn't know |
| 13:34 | bosie | casion: good luck reading up on jvm's GC ;) |
| 13:34 | casion | casion: I want to solve everything with assignment |
| 13:35 | mdeboard | casion: Yeah, I describe switching from imperative programming to a functional context as it's like walking around with your hand balled into a fist (imperative) then having to learn how to relax it (fp) |
| 13:35 | mdeboard | casion: and recursion, apparently |
| 13:35 | Frozenlock | atsidi: and now in cljs it's the damn javascript :P Every example I saw assumed you had a working knowledge of javascript and/or DOM |
| 13:35 | casion | mdeboard: recursion I'm ok with |
| 13:36 | mdeboard | casion: Was a joke about addressing your comment to yourself |
| 13:36 | mdeboard | 13:33 <casion> casion: I want to solve everything with assignment |
| 13:36 | casion | lol |
| 13:36 | foodoo | Frozenlock: Pretty much the same thing with Clojure on the JVM, isn't its |
| 13:36 | casion | ahahahaha |
| 13:36 | holo | foodoo, ["hello", "mars", "world"] i want to join "hello" with "world" . without assoc please |
| 13:37 | mdeboard | (clojure.string/join " ") |
| 13:37 | foodoo | holo: And you generally want to join all odd entries together? Or what's the criterion? |
| 13:37 | Frozenlock | foodoo: Yes, which is a shame IMO. It's like learning 2 languages at the same time. |
| 13:37 | holo | foodoo, the output would be a new collection like ["helloworld", "mars"] or ["mars", "helloworld"] |
| 13:37 | foodoo | holo: Is your input collection alsways 3 elements long? |
| 13:37 | mdeboard | foodoo: I disagree, you don't have to know anything about the JVM beyond the notion of jars to write Clojure |
| 13:38 | holo | foodoo, yes, the length is known (but actually i'm waiting for the negative index patch submission to the nightly builds to make it more dynamic) |
| 13:38 | foodoo | mdeboard: When faced with stack traces, it helps to understand what is relevant to find the error. And some things just need Java interop like raising values to a power with Math/pow |
| 13:38 | Frozenlock | mdeboard: how to parse "12.0" ? |
| 13:38 | atsidi | Frozenlock: There's lots of that kind of thing. I'm always running across mentions of "now, generate a war file and deploy it as per usual." As if I deploy war files every day. |
| 13:39 | holo | foodoo, add the first element of the vector with the last. but i can use and odd criterion if i use a replace function first |
| 13:39 | nz- | what is the nice/idiomatic way to handle exceptions? |
| 13:39 | atsidi | The Clojure language is pretty easy, I've written a lot of Lisp over the years, but the Java stuff under it is a much bigger learning curve. |
| 13:39 | mdeboard | Frozenlock: Woops, touche :) |
| 13:40 | holo | foodoo, the problem is, how do i really avoid assoc in this? |
| 13:40 | foodoo | holo: So you want to have something like this: [first stuff-in-between last] --> [firstlast stuff-in-between] for any length of a collection? |
| 13:41 | nz- | http://en.wikipedia.org/wiki/WAR_file_format_(Sun) |
| 13:41 | mdeboard | foodoo: Also true re: stack traces |
| 13:41 | foodoo | holo: I don't see why you need to use assoc with vectors |
| 13:41 | mdeboard | However, there's no denying you have to know way more about the DOM for CLJS than the JVM for Clj |
| 13:41 | Frozenlock | mdeboard: Damnit |
| 13:41 | foodoo | mdeboard: agreed |
| 13:42 | Frozenlock | I will need to learn the DOM stuff now :s |
| 13:42 | holo | foodoo, that would be the best option, because it's more dynamic, but actually for now the length is known, so any of them is good for now |
| 13:43 | mdeboard | ibdknox: Is the warning message when you click the '-' button on the ns browser appropriately frightening? |
| 13:44 | mdeboard | ibdknox: If I click that button does it just remove the namespace from memory or delete the actual file or what? |
| 13:44 | ibdknox | mdeboard: I should put a picture of a monster |
| 13:44 | ibdknox | mdeboard: both |
| 13:44 | mdeboard | what. |
| 13:45 | ibdknox | you have to confirm it |
| 13:45 | foodoo | (defn join-ends [coll] (let [fst (first coll) mid (butlast (next coll)) end (last coll) ] (cons (+ fst end) mid))) |
| 13:45 | mdeboard | The warning should DEFINITELY say that it's going to delete the file. |
| 13:45 | foodoo | holo: just replace the + with string concatenation or whatever you like |
| 13:45 | ibdknox | hm |
| 13:45 | ibdknox | ok |
| 13:45 | holo | foodoo, checking |
| 13:46 | foodoo | holo: currently it takes an input that consists only of numbers. So if you want to use it with strings, you have to replace the + |
| 13:47 | holo | foodoo, thanks |
| 13:47 | ibdknox | mdeboard: what did you expect it to do? |
| 13:47 | mdeboard | ibdknox: At least for now, when LT is running in a browser tab, I'm not expecting it to be performing file system manipulation behind the scenes. Maybe when it's a native app and there's a more obvious connection between the actual files that already exist and what I'm looking at. |
| 13:48 | mdeboard | ibdknox: Just remove the ns from memory |
| 13:48 | ibdknox | I mean it's an editor |
| 13:48 | ibdknox | if you save it saves |
| 13:48 | ibdknox | if you add an ns it adds a file |
| 13:49 | mdeboard | ibdknox: Well,like I say, at least during this alpha stage when everyone, including clojure lightweights like me, are giving it a go, just make it more obvious that it deletes the file. I would be pissed if it deleted a file that wasn't under version control. |
| 13:50 | mdeboard | (especially the one I tried to remove :P) |
| 13:50 | ibdknox | righto |
| 13:50 | ibdknox | I figured the this cannot be undone and the REMOVE made it scary enough. I will make it scarier. :D |
| 13:51 | mdeboard | ibdknox: Scarier and more descriptive of the behavior I'd say |
| 13:52 | zilti | Are 32-bit-programs on windows 7 able to "see" and call 64bit-programs? |
| 13:54 | mdeboard | ibdknox: I guess I was unthinkingly using LT, and thought of it as simply a view on my code, disconnected (after loading it into memory) from the files themselves. Like once it's loaded, it's a new entity, and all changes that I make are to this new entity, not the old stuff. Now that I've given it a few minutes of thought that's pretty silly, but that's why I was surprised to find out it deletes the file. |
| 13:55 | ibdknox | mdeboard: yeah I get where you're coming from |
| 14:02 | ivan | zilti: yes, though sometimes you have to turn off redirection or use C:\windows\sysnative |
| 14:03 | robink | After adding [noir "1.2.2"] in a project.clj that also specifies [org.clojure/clojure "1.4.0"] in :dependencies, after running lein deps, I get an environment with Clojure 1.3.0 when running 'lein repl'. |
| 14:03 | robink | Am I doing something wrong? |
| 14:05 | nz- | robink: try lein deps :tree? |
| 14:05 | robink | nz-: OK |
| 14:05 | firesofmay | I am unable to install clj-http. Here's the gist of lein deps output : https://gist.github.com/3388644. :-/ |
| 14:05 | nz- | and see where the clojure 1.3.0 is coming from |
| 14:05 | robink | nz-: noir is pulling in clojure 1.3.0 |
| 14:06 | robink | nz-: I was hoping my requirement of clojure 1.4.0 in project.clj :dependencies would clobber noir's requests for an earlier Clojure version. |
| 14:07 | nz- | robink: https://github.com/technomancy/leiningen/issues/736 |
| 14:08 | nz- | that is similar issue |
| 14:09 | nz- | so noir has this [org.clojure/clojure "[1.2.1],[1.3.0]"] |
| 14:10 | nz- | meaning that it must have one of those versions, and it overrides your [org.clojure/clojure "1.4.0"] |
| 14:10 | nz- | what happens if you set it to [org.clojure/clojure "[1.4.0]"] in your pom.xml? |
| 14:13 | robink | nz-: Ah, OK |
| 14:13 | robink | nz-: Probably would be fixed. |
| 14:13 | robink | nz-: I'm using :exclusions [org.clojure/clojure] right now. |
| 14:13 | robink | nz-: Which also works. |
| 14:14 | nz- | and upgrading to noir 1.3.0-xxx would also work |
| 14:14 | robink | nz-: Ah, OK |
| 14:15 | robink | Also notice that org.cemerick/friend wants clojure 1.3.0 |
| 14:16 | robink | (0.0.9, current version on clojars) |
| 14:18 | nz- | actually if you set clojure version to "[1.4.0]" lein probably says that it can't be found |
| 14:19 | nz- | and downloads about 20 different clojure-1.3.0 alpha and beta versions as a side effect |
| 14:20 | robink | nz-: Ah. Why would it say that it couldn't be found? |
| 14:21 | nz- | don't know |
| 14:21 | nz- | downloading those versions is aslo odd |
| 14:21 | robink | I see |
| 14:22 | nz- | I think that is probably should say that main project.clj wants clojure 1.4.0 and noir want either 1.2.1 or 1.3.0 and those are not compatible -> error |
| 14:23 | robink | nz-: However, if any dependency requries an earlier version of clojure that's the one I get. |
| 14:25 | nz- | http://www.sonatype.com/books/mvnref-book/reference/pom-relationships-sect-project-dependencies.html#pom-relationships-sect-version-ranges |
| 14:26 | nz- | it is not about earlier or later version: Version number like "1.4.0" means that use 1.4.0 if possible, but use something else if not possible. "[1.4.0]" means that use that exact number |
| 14:26 | robink | nz-: Ah, and the packages pulling in Clojure 1.2,1.3 etc are doing the latter? |
| 14:27 | nz- | yes |
| 14:27 | robink | nz-: Ah, OK. So leiningen is doing exactly what it should. |
| 14:27 | robink | nz-: Which makes me mildly annoyed at the authors of those packages. |
| 14:30 | robink | Also interestingly, some packages don't show as pulling in an older version of clojure until you've added :exclusions [org.clojure/clojure] to other packages first. |
| 14:31 | nz- | robink: there is this issue, that should make lein warn about this: https://github.com/technomancy/leiningen/issues/734 |
| 14:32 | robink | nz-: Also, aleph simply stating clojure 1.3.0 as a dependency (without a range) is enough to make leiningen use clojure 1.3.0. |
| 14:36 | robink | Lastly, Leiningen is stating that data.json pulls in clojure 1.3.0, but nowhere in data.json 0.1.3's pom.xml does it list Clojure as a dependency in either a range or a single version. |
| 14:37 | uvtc | What is being used to generate these API docs: http://weavejester.github.com/compojure/ ? |
| 14:38 | weavejester | uvtc: Codox: https://github.com/weavejester/codox |
| 14:38 | uvtc | Thanks, weavejester . |
| 14:39 | nz- | robink: data.json pom.xml refers to org.clojure/pom.contrib "0.0.25", maybe it is in there |
| 14:40 | robink | nz-: Why is it not listed as a dependency of org.clojure/pom.contrib "0.0.25"? |
| 14:40 | nz- | robink: it uses pom.contrib as a parent => it inherits everything from that pom |
| 14:40 | robink | nz-: Ah, OK |
| 14:41 | nz- | aleph uses this :multi-deps thing, I don't know what that actually does |
| 14:41 | robink | nz-: Ah, OK |
| 14:49 | robink | Finally |
| 15:08 | xeqi | firesofmay: hmm, I see some of the dependencies in central's search http://search.maven.org/#artifactdetails|org.apache.httpcomponents|httpclient|4.2.1|jar |
| 15:08 | xeqi | so it should be working, but central has been having some problems lately |
| 15:09 | xeqi | oh, but the "name or service unknown" in that output is weird |
| 15:09 | firesofmay | xeqi oh okay. I have opened a thread in clojure group so that others get to know as well. |
| 15:09 | firesofmay | xeqi, I have never seen such output before. :-/ |
| 15:10 | xeqi | can you hit that with a browser? |
| 15:10 | firesofmay | xeqi, the link you posted? yeah I can. |
| 15:10 | xeqi | sorry, http://repo1.maven.org/maven2/ |
| 15:11 | firesofmay | xeqi, server not found. |
| 15:11 | firesofmay | for http://repo1.maven.org/maven2/ |
| 15:11 | xeqi | there the problem, for some reason you can't access it, but others are working |
| 15:11 | firesofmay | xeqi, you can access it? |
| 15:11 | xeqi | yeah |
| 15:11 | firesofmay | strange |
| 15:12 | xeqi | yeah, this is a bit beyond my ability to debug unfortunatly :/ |
| 15:12 | xeqi | unless its something simple like /etc/hosts pointing it to the wrong spot |
| 15:12 | firesofmay | xeqi, no problem. Thanks for your help. Even I am not sure what's wrong. |
| 15:12 | TEttinger2 | can someone explain to me how :sort works in congomongo? |
| 15:13 | TEttinger2 | in the (fetch) function, you can pass :sort as an option |
| 15:13 | TEttinger2 | but I have no idea how to tell it what to sort by |
| 15:13 | firesofmay | xeqi, i have nothing in my /etc/hosts so that can't be it. |
| 15:14 | xeqi | setting up a /etc/hosts entry for it to 93.184.215.223 might be a workaround |
| 15:15 | xeqi | thats the ip I get back from a wget real quick |
| 15:16 | firesofmay | so if i do http://93.184.215.223/maven2 in the browser to check should it work? |
| 15:16 | firesofmay | xeqi, ^ |
| 15:17 | xeqi | well, maybe not.. its a cdn ip :/ |
| 15:17 | firesofmay | xeqi, oh ok. |
| 15:19 | xeqi | hmm, looks like they try and detect the servername and send the right files |
| 15:19 | firesofmay | xeqi, i think i'll wait for sometime. maybe its an area wise issue. |
| 15:43 | amalloy | TEttinger2: look up how to sort in mongodb, and then just pass the "clojure version" of the json map it wants |
| 15:44 | TEttinger2 | amalloy, I think I got it (not sure) |
| 15:44 | TEttinger2 | I passed it a map of :sort to -1 to sort in descending order |
| 15:46 | michaelr525 | hello |
| 15:47 | ebaxt | so far I've found three mustache implementations in clojure, which one should I use? :) |
| 15:48 | uvtc | ebaxt: Not sure all of those are actually the templating library. |
| 15:48 | uvtc | I think you want https://clojars.org/de.ubercode.clostache/clostache |
| 15:49 | ebaxt | clostache, stencile and https://github.com/shenfeng/mustache.clj |
| 15:50 | ebaxt | uvtc: and to add to the confusion the cgrand's ring dsl :) |
| 15:51 | uvtc | The one I have listed at the [Dining Car](http://unexpected-vortices.com/clojure/dining-car.html) is Clostache. If you have something you'd recommend over that, for a specific reason, please let me know. :) |
| 15:52 | ebaxt | utvc: I haven't tried either of them :) Have you tried stencile? |
| 15:53 | amalloy | uvtc: dsantiago claims that stencil (his) is spec-compliant, while the others aren't even aware there is a spec |
| 15:54 | xeqi | see https://groups.google.com/forum/#!topic/clojure/2dRbv-S0UuQ for some discussion on spec issues |
| 15:54 | uvtc | grazie |
| 15:54 | xeqi | I would end up usuing stencil myself |
| 15:55 | xeqi | mainly just cause Raynes has prefiltered the choices |
| 15:55 | uvtc | Raynes-prefiltering is always nice. |
| 15:55 | amalloy | i let him pre-chew my food for me |
| 15:56 | xeqi | gotta make sure its not poisoned |
| 15:56 | uvtc | tee he he :) |
| 16:05 | xeqi | is there a listing of old conj talks? |
| 16:06 | xeqi | was hoping to find an archived "schedule" page to remind myself what was talked about |
| 16:06 | uvtc | Clostache also claims spec-compliance in the readme: https://github.com/fhd/clostache. I don't know what it means by "supporting lambdas" though. |
| 16:07 | uvtc | Added Stencil to the Dining Car. |
| 16:07 | uvtc | Also submitted pulls-request to add a :url to the project.clj for stencil (so the Clojars page links back to the github page). |
| 16:08 | Cr8 | rather than regular mustache |
| 16:08 | uvtc | Cr8: Which variant do you end up using? |
| 16:08 | Cr8 | well, with Javascript anyway. |
| 16:08 | uvtc | Ah. |
| 16:09 | Cr8 | I'll use hogan or handlebars, mostly for the ability to use the parent context inside of a conditional thing |
| 16:10 | Cr8 | even though the maintainer of mustache.js is a coworker |
| 16:12 | Cr8 | for clojure i usually use something geared toward what i'm outputting.. hiccup for HTML |
| 16:31 | mdeboard | ibdknox: I am encountering an issue trying to add this last function from the ns browser to the code document: http://ubuntuone.com/6BaDG5QfJS6HNd3bxTDyq9 The `(map...)' expr right before it is a new thing I added in LT. If I move the `(pdf<-)' expr above the map expr, it is copied to the code document consistently. Am I doing it wrong or is this an issue |
| 16:32 | mdeboard | I see, nevermind. It looks like one of the code blocks had focus so I couldn't get it to move over. |
| 16:32 | ibdknox | mdeboard: I just released 0.1.1 which fixes a number of issues people ran into |
| 16:35 | mdeboard | ibdknox: cool |
| 16:35 | mdeboard | "This will remove the file" :D |
| 16:38 | mdeboard | geeking out over here |
| 16:40 | mdeboard | Really the only thing that would conceivably stand in my way of using this to work on Clojure projects is the in-line documentation that is present in clojure-mode/slime |
| 16:41 | the-kenny | +it should work in Emacs :) |
| 16:41 | the-kenny | (Nevermind my trolling here. I think Light Table is a great piece of work, especially for teaching people Clojure) |
| 16:43 | mdeboard | the-kenny: What should work in Emacs? |
| 16:44 | the-kenny | Everything Light Table offers! :p Nah, I'm just trolling |
| 16:44 | mdeboard | oic |
| 16:44 | mdeboard | Yeah I think it was a wise decision to "decomplect" Clojure and Emacs |
| 16:45 | the-kenny | mdeboard: Yup, that's always good. It's also a very nice tool for starting Clojure. It's the "It just works" solution for everyone who's interested |
| 16:46 | mdeboard | true that |
| 16:47 | the-kenny | I'm also pretty curious about "Domain specific UIs". Think of previewing database queries from Congomongo, or korma-queries visualizing the JOINs |
| 16:48 | the-kenny | Or (I forgot the name) the library for neural networks |
| 16:49 | mdeboard | ibdknox: Is it possible/feasible to load all the namespace definitions for a project when you connect in the Table context? Such that as soon as I connect I can use any given function in my project without having to add a namespace definition to my code doc, then evaluate it. |
| 16:51 | mdeboard | I demand more features for my free version of your alpha software |
| 16:51 | ibdknox | mdeboard: hm, it's supposed to do that already - I'll have to see what I broke |
| 16:51 | mdeboard | Maybe I'm just doing it wrong, that's been the pattern so far |
| 16:58 | mdeboard | Bummed it's closed source, I'd like to contribute. |
| 17:02 | ibdknox | it'll make it there |
| 17:02 | ibdknox | just not yet - still too much in flux |
| 17:04 | Raynes | amalloy: Clostache has been spec compliant for a while now. It's still mighty slow compared to |
| 17:04 | Raynes | stencil. |
| 17:04 | Raynes | ibdknox: I can't remember how the light table tutorial told me to add a function. |
| 17:04 | Raynes | ibdknox: Teach me. |
| 17:06 | ibdknox | Raynes: there was a bug that messed things up. It's fixed in 0.1.1 - just type ( at the bottom of an editor |
| 17:06 | Raynes | ibdknox: Ah, yeah, I tried that and it didn't work, so I wasn't sure. |
| 17:06 | Raynes | Cool. |
| 17:07 | Raynes | ibdknox: How do I update now? Download the new jar, or... |
| 17:07 | tomoj | Raynes: have you by chance tried clostache with PersistentProtocolBufferMap |
| 17:07 | Raynes | tomoj: dsantiago is the one who benchmarks them. |
| 17:07 | Raynes | But really, what does it matter? Stencil is there and it is fast. |
| 17:07 | tomoj | oh, I hadn't seen stencil |
| 17:07 | Raynes | People keep making these things and I have no clue why. |
| 17:08 | Raynes | :p |
| 17:08 | tomoj | I couldn't get clostache to work with pbufs without (into {} %) (which was OK) |
| 17:11 | amalloy | tomoj: whuuuut. i guess i don't really know what clostache is for, but PPBMs should act like maps in all the ways i can think of |
| 17:12 | tomoj | hmm.. the problem was that extension fields were missing |
| 17:13 | tomoj | I should be sure I wasn't using my broken patch of clojure-protobuf |
| 17:14 | amalloy | i mostly don't know what extension fields are, but if seqing over the pbuf works, it's hard to see what clostache could do that doesn't work |
| 17:17 | Raynes | ibdknox: You should figure out how to make a .app out of the light table stuff. |
| 17:19 | Cr8 | oh heck yeah, 0.1.1 fixes my main complaint :) |
| 17:20 | Raynes | ibdknox: I'm going to code in light table for a few minutes once it finishes updating. I'm damn near tingly. |
| 17:27 | firesofmay | How do I set the platform to "WINDOWS" when I am trying to run Selenium Grid using clj-webdriver? |
| 17:30 | mattmoss | clojure-jack-in needs sound effects... |
| 17:30 | casion | mattmoss: that's not hard to do |
| 17:31 | mattmoss | casion: I imagine emacs playing sounds is there, somewhere. Heck, it folds my laundry, washes the windows and fuels up the car, so what else can't it do? (M-x butterfly) |
| 17:32 | casion | (play-sound) |
| 17:32 | clojurebot | Huh? |
| 17:32 | mattmoss | Heh. |
| 17:32 | casion | just hook it into clojue-lack-in |
| 17:32 | casion | except maybe type it properly |
| 17:32 | Raynes | ibdknox: Looks like switching namespaces doesn't work properly. |
| 17:32 | mattmoss | lol.. |
| 17:33 | Raynes | ibdknox: When I switch, it isn't completely switching, it's adding stuff and not removing the old namespace's stuff. |
| 17:33 | ibdknox | Raynes: hm? in the document? That's the point :) |
| 17:33 | mdeboard | Raynes: Do you mean it's not removing it from the code doc or |
| 17:34 | Raynes | ibdknox: If I double click foo.bar and it adds the code on the left and then double click foo.baz, it's supposed to just add it underneath the stuff from foo.bar? |
| 17:34 | Raynes | If that's expected then I apparently don't know how light table works at all. |
| 17:36 | mdeboard | Raynes: I don't think that's a weird thing for you to expect tbh, and I think it's reinforced by the fact the namespace definitions for the connected project aren't automatically loaded into memory, so you have to add an entire namespace to the code doc, then evaluate each block individually. Then if you want to move to another codeblock you need to hit C-S-d to clear the code doc, then load all that into memory. |
| 17:37 | Raynes | I'm not sure I understood anything you just said. |
| 17:38 | mdeboard | Raynes: My expectation was that when you connected to an existing project, you wouldn't have to manually evaluate each individual closure in order to use it in the scratch area. |
| 17:38 | Raynes | That apparently isn't the case. |
| 17:38 | mdeboard | Raynes: Also, C-S-d to clear your code doc. |
| 17:39 | mdeboard | Raynes: I got the impression from ibdknox that was the case but it was recently broken |
| 17:39 | Raynes | *shrug* |
| 17:40 | Raynes | All I know is that I just loaded a namespace into the 'doc' and it was available in scratch. |
| 17:40 | Raynes | Anyways, I guess if I can clear the document it's fine, but I still don't get why you'd want to put a bunch of namespaces underneath each other over there. |
| 17:40 | Raynes | That's just confusing. |
| 17:41 | mdeboard | Raynes: "When you open something on the table, it's added to a document that acts as though all of those things were in a single file. This means you can build up a context and work in it just like you would if file organization mapped cleanly to functionality. It's time we started working with our code in more logical units; as problems to be solved." |
| 17:41 | mdeboard | http://www.chris-granger.com/2012/08/17/light-table-reaches-010/ |
| 17:42 | mdeboard | so that in particular is deliberate |
| 17:42 | Raynes | Okay. |
| 17:42 | Raynes | I guess I misunderstood things. |
| 17:46 | ibdknox | Raynes: it's an experiment - I'm not sure if it works or not. I toyed with the idea of having an NS opening just reset the thing to that NS |
| 17:46 | Raynes | That's what I expected. |
| 17:46 | Raynes | I mean, you can clear the doc -- it isn't a big deal. |
| 17:46 | ibdknox | but individual editors would not |
| 17:46 | ibdknox | err |
| 17:46 | ibdknox | functions |
| 17:47 | ibdknox | I wanna see what people think, but my suspicion is it'll move that direction |
| 17:47 | Raynes | We need paredit and git integration. |
| 17:47 | Raynes | :p |
| 17:47 | ibdknox | truth |
| 17:48 | Raynes | Obviously you have more important things to worry about. |
| 17:48 | ibdknox | I'm excited about the stuff we'll be able to do with git integration |
| 17:48 | ibdknox | :) |
| 17:48 | casion | CVS too! |
| 17:48 | Raynes | What's cool is that you've already got what you need to do selective staging, ibdknox. |
| 17:49 | Raynes | The function blocks in the document will work just fine for that, I think. |
| 17:49 | ibdknox | Raynes: yep :) |
| 17:49 | Raynes | And that's probably one of the hardest parts. |
| 17:49 | mdeboard | casion: :| |
| 17:49 | casion | ibdknox: is having the UI resize logically a high priority? |
| 17:49 | casion | mdeboard: muahahaha! |
| 17:49 | ibdknox | casion: resize logically? |
| 17:49 | Raynes | ibdknox: I really like it. I mean, I can't write code in it for shit because it doesn't (at least) close brackets for me, but... |
| 17:49 | Raynes | It's awfully fun. |
| 17:50 | ibdknox | :) |
| 17:50 | casion | ibdknox: yeah, it seems to not handle window resizing very well |
| 17:50 | ibdknox | yeah, people used to paredit will have to wait a bit before it'll suit them |
| 17:50 | ibdknox | casion: can you give an example? |
| 17:50 | bosie | watching simple made easy by rich hickey |
| 17:50 | bosie | and i am wondering what he means by "data" |
| 17:50 | casion | sure, let me open it up real quick |
| 17:50 | ibdknox | casion: bigger or smaller? Bigger should be fine, but you can only reasonably make it so small |
| 17:50 | mdeboard | casion, ibdknox: The result window for the scratch pane seems to resize |
| 17:50 | mdeboard | resize in a good way |
| 17:51 | bosie | meaning i have a hash there instead of...what? |
| 17:51 | Raynes | ibdknox: Will it ever be possible to use light table to like one-off edit a file? |
| 17:52 | ibdknox | Raynes: yeah, it'll get there eventually |
| 17:52 | Raynes | </questions> |
| 17:52 | jballanc | any vim users around? what plugin(s) are you using for Clojure? |
| 17:52 | bosie | jballanc: haven't found a good one |
| 17:52 | foodoo | jballanc: vimclojure and tslime |
| 17:52 | jballanc | that's what I was afraid of |
| 17:53 | jballanc | yeah, I'm using vimclojure and slimv |
| 17:53 | jballanc | but they step all over eachother |
| 17:53 | foodoo | jballanc: didn't experience any conflicts with my setup |
| 17:53 | foodoo | do you know tmux? |
| 17:54 | jballanc | yeah, I've played with tslime |
| 17:54 | casion | ibdknox: only the left portion resizes for me at all in table |
| 17:54 | casion | in irepl it's fine |
| 17:54 | jballanc | somehow, tmux just seems like a not-really-there substitute for slim(e/v)+swank |
| 17:55 | jballanc | although I heard rumor that I should be using nrepl instead of swank |
| 17:55 | foodoo | could be. I'm not really acquainted with Emacs |
| 17:55 | Raynes | Rumor has it slime ain't got your love anymore. |
| 17:56 | jballanc | well, rumor also had it that light-table might get vim bindings ;-) |
| 17:56 | Raynes | It already has them to some extent. |
| 17:56 | Raynes | codemirror has a vim mode. |
| 17:56 | Raynes | Not sure how well it works. |
| 17:56 | Raynes | But codemirror has it and since light table uses it... |
| 17:56 | jballanc | hmm... |
| 17:56 | Raynes | I imagine you'll be able to turn things like that on at some point. |
| 17:57 | mdeboard | jballanc: You could always write a chrome extension that monkey patches the bindings |
| 17:57 | Raynes | The most important part is that you can contribute to make the editor better anytime you want. |
| 17:57 | Raynes | Just go contribute to codemirror. |
| 17:57 | ibdknox | casion: I'm not sure I believe you ;) Both are set to percentage widths, but the right side will expand much slower since it's a lower percentage |
| 17:57 | ibdknox | Raynes: someone actually creatively figured out a way to turn it on in LT now :) |
| 17:58 | @Chouser | codemirror vim bindings were a bit of a joke, last I checked |
| 17:58 | ibdknox | Chouser: they've gotten better |
| 17:58 | ibdknox | still a ton of work to do |
| 17:58 | @Chouser | oh, good |
| 17:58 | ibdknox | but they are much better |
| 17:59 | @Chouser | yeah -- I'm working in emacs + evil now, so I see all the work they're doing to add vim bindings to a fully function editor |
| 18:00 | ibdknox | alright, gotta go guys |
| 18:00 | casion | ibdknox: It's because of a simbl plugin I have apparently |
| 18:00 | casion | it works fine when I remove it |
| 18:01 | mdeboard | ibdknox: Back to the code mines |
| 18:01 | bosie | http://www.infoq.com/presentations/Simple-Made-Easy/ is there (simple) code showcasing his last 6 points? |
| 18:02 | mdeboard | bosie: Which points are those? |
| 18:03 | bosie | mdeboard: well, he names them "who, what, when, where, why and how" |
| 18:03 | bosie | for abstraction for simplicity (49:39) |
| 18:04 | jballanc | hmm...light table needs fullscreen for OS X :/ |
| 18:04 | Raynes | ibdknox: I'm using light table to add search methods to tentacles. |
| 18:04 | jballanc | wait |
| 18:04 | jballanc | found it |
| 18:04 | jballanc | :) |
| 18:06 | mdeboard | bosie: Seems fairly straightforward to infer from context ( I just rewatched) |
| 18:06 | bosie | mdeboard: then i am dumb |
| 18:07 | jballanc | is there a list of keyboard shortcuts for light table somewhere? |
| 18:07 | mdeboard | bosie: What I get from it is that when you're designing your abstractions, keep in mind how your data will be accessed, under what conditions, at what times, by whom |
| 18:08 | bosie | mdeboard: right but how do you avoid merging how and what |
| 18:08 | bosie | mdeboard: i imagine the java-equivalent would be interfaces? |
| 18:08 | bosie | mdeboard: which he says is not good |
| 18:10 | jballanc | ah, found it... it's the "^" in the corner |
| 18:10 | mdeboard | bosie: I don't have a good answer for you nor an example from the real world. It's like the definition of obscenity: I'll know it when I see it. |
| 18:10 | atsidi | Darn. I was hoping to get LB working, but I get "Exception in thread "main" javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated" |
| 18:10 | atsidi | the shell script worked, but nothing since the jar format has... Sigh... |
| 18:11 | bosie | mdeboard: same with the "why". rules? what? how can you have the why in one place, somehow defined with rules. |
| 18:11 | bosie | mdeboard: good for you ;) |
| 18:12 | Raynes | ibdknox: Haha, I can't edit my project.clj in light table? |
| 18:12 | Raynes | Yikes. |
| 18:12 | Raynes | I guess that falls under the one-off-file category. |
| 18:13 | mdeboard | bosie: I imagine the 'why' of abstraction design (pulling this out of my ass) would have to do with, like, shaping the data so that it reflects the reason the consumer is requesting the data. |
| 18:13 | bosie | mdeboard: which makes sense in the context of rules |
| 18:14 | bosie | mdeboard: wondering how you would isolate those rules and how specifically one actually writes rules |
| 18:16 | mdeboard | In the context of that talk I believe he was talking about logic programming e.g. Prolog |
| 18:16 | bosie | correct |
| 18:17 | bosie | mdeboard: actually it says "libraries, prolog" |
| 18:17 | jballanc | Raynes: I was able to edit a project.clj by clicking twice on the top-level namespace |
| 18:17 | jballanc | (in the namespace browser) |
| 18:18 | Raynes | Really? Cool. |
| 18:18 | bosie | so you guys have beta access to light table? |
| 18:18 | jballanc | bosie: it's open to everyone |
| 18:19 | jballanc | http://app.kodowa.com/playground |
| 18:19 | Cr8 | ack |
| 18:19 | Cr8 | where's undo? =P |
| 18:19 | mdeboard | bosie: There's lots of great course notes from Stanford, Princeton, etc., on abstraction design classes if you google "designing abstractions" |
| 18:19 | mdeboard | Cr8: C-z |
| 18:20 | mdeboard | bosie: I'm reading http://www.stanford.edu/~ouster/CS349W/lectures/abstraction.html atm :P |
| 18:20 | bosie | mdeboard: first thing that popped up |
| 18:21 | mdeboard | ya :P |
| 18:21 | mdeboard | i'm lazy |
| 18:22 | Raynes | light table's scratch thingy isn't giving me any output for (URLEncoder/encode "Dominik Picheta" "UTF-8") |
| 18:22 | Raynes | Oh, it has stopped giving me output for anything at all. |
| 18:23 | Raynes | Reloading fixed it. |
| 18:23 | Raynes | ibdknox: Stop breaking your software. |
| 18:23 | Cr8 | ahhh |
| 18:23 | mdeboard | I demand features for this free software! |
| 18:23 | Cr8 | my fingers were in the wrong place |
| 18:23 | Cr8 | i'd been hitting alt-z |
| 18:24 | Cr8 | which .. inserts omegas |
| 18:24 | mdeboard | Cr8: You should consult a physician |
| 18:24 | Raynes | I am the alpha and the omega. The black and the white. |
| 18:27 | jballanc | aside from a bit of key-binding schizophrenia, this is actually really neat! |
| 18:27 | jballanc | kudos ibdknox and team! |
| 18:36 | mdeboard | What LT really needs is better IRC integration |
| 18:53 | Raynes | ibdknox: Light table has managed to lose the code I've written twice in a row now. Not sure what is going on, but it completely broke. |
| 18:57 | mdeboard | Raynes: How do you mean lose? I just had an issue where I made a change to a code block, removed it from the code doc, brought it back then tried to save (the change I made was still there), but it wasn't actually modifying the file. |
| 18:57 | mdeboard | What I'm asking is, did you make a change to a block, remove it from the code doc then put it back? |
| 18:58 | Raynes | mdeboard: I mean I wrote a bunch of code (just added it) and then I switched namespaces and came back and the code was gone. I had also tried to evaluate the code, but that stopped working again too. I imagine the two things might be correlated. |
| 18:58 | mdeboard | d'oh |
| 19:19 | mdeboard | Raynes: By chance did you add lein-light to your profiles.clj |
| 19:24 | mdeboard | oops, nm, was reading obsolete blog post |
| 19:32 | Cr8 | Raynes: i have had that happen a couple times. Now I'm paranoidly cat'ing the file to make sure it saves when I do stuff >> |
| 19:35 | sadgur | hi im relatively new to clojure (and fp in general) i have a question about the way to dealing with intermediate values and immutability |
| 19:36 | sadgur | basically 50% of the time i want to append the number 4 to a list and then check if this list is different from the original list (which it wil be if the append happens) |
| 19:37 | sadgur | the problem is how to refer to this modifed list and compare it to the original which may not be modified at all |
| 19:37 | sadgur | if that makes sense |
| 19:38 | dnolen | sadgur: what kind of comparison? |
| 19:38 | sadgur | just to see if the are equal |
| 19:38 | sadgur | the logic is simple its just dealing with immutable values |
| 19:38 | uvtc | Hi sadgur. Not quite sure what you mean. Perhaps you could post the code you've already tried to refheap.com? |
| 19:39 | sadgur | yeah sure |
| 19:39 | sadgur | i might have cracked it bear with :P |
| 19:41 | uvtc | sadgur: You cracked it with the bear's help? Excellent. |
| 19:42 | uvtc | :) |
| 19:43 | sadgur | uvtc: they have paws for thought :) |
| 19:43 | uvtc | hahaha |
| 19:44 | uvtc | "A bear walks into a bar and says "I'd like a beer and . . . . . . a packet of peanuts." |
| 19:45 | sadgur | ha love that joke |
| 19:47 | wei_ | currently working on a game.. how would you do interactive graphics programming in the repl? |
| 19:48 | sadgur | wei_: wait for lighttable? |
| 19:48 | wei_ | haha. i actually have it open right now |
| 19:51 | sadgur | well my problem was trying to create an inner binding but only 50% of the time so i couldnt refer to it outside that scope |
| 19:51 | sadgur | but my solution worked fine i just made a function to handle that bit |
| 19:51 | sadgur | https://www.refheap.com/paste/4467 |
| 19:51 | sadgur | trival problem but i'm learning :) |
| 19:52 | sadgur | i was trying to store the new list essential but that binding only existed 50% of the time |
| 19:52 | sadgur | of course the program does nothing exciting just a test :P |
| 19:53 | uvtc | sadgur: Since `list` is a built-in function name, might be better to use a different name there. |
| 19:53 | sadgur | yeah i was wonder what the convention was |
| 19:53 | sadgur | xs |
| 19:53 | sadgur | perhaps |
| 19:53 | sadgur | haskell powered |
| 19:53 | sadgur | bear-list |
| 19:54 | sadgur | what is the convention for things of that sort |
| 19:54 | uvtc | Lessee... the docs tend to use "coll". |
| 19:54 | hyPiRion | It's not that problematic as long as the function is evident. |
| 19:54 | sadgur | well with a domain for the function i could call it "values" or something |
| 19:54 | sadgur | depends on what i use it for |
| 19:54 | sadgur | go go vim replace |
| 19:54 | hyPiRion | It's common to use coll, I suppose. |
| 19:55 | sadgur | alright thanks |
| 19:55 | aperiodic | wei_: quil! |
| 19:55 | aperiodic | wei_: https://github.com/quil/quil |
| 19:55 | wei_ | aperiodic: thanks, I'll check it out |
| 19:55 | aperiodic | dynamically rebind your draw fn to see your changes live, without restarting anything |
| 19:55 | aperiodic | it's great fun |
| 19:57 | hyPiRion | Ahh, I wonder when people "deprecate" (:use lib), and prefer (:require lib :refer :all) instead |
| 19:58 | mdeboard | Hm what am I doing wrong? Clojure is telling me it can't find any of the `clj-itext.*' files on the classpath https://gist.github.com/3390408 but all the files, including the one I pasted that snippet from, are in src/clj-itext/ |
| 19:59 | mdeboard | and each of the files has `(ns clj-itext.foo ... )' at the top. |
| 19:59 | mdeboard | $foo* :) |
| 20:00 | Cr8 | mdeboard: "clj_itext" would be the dir |
| 20:00 | Cr8 | ,(munge "clj-itext") |
| 20:00 | clojurebot | "clj_itext" |
| 20:00 | Cr8 | munge is the fn used to convert namespace names to dirs |
| 20:00 | mdeboard | Oh dammit |
| 20:00 | mdeboard | I'm an idiot |
| 20:01 | Cr8 | als |
| 20:01 | Cr8 | *also |
| 20:01 | Cr8 | ,(namespace-munge "clj-itext") |
| 20:01 | clojurebot | "clj_itext" |
| 20:02 | Cr8 | is for namespaces, I forgot |
| 20:02 | mdeboard | yeah but |
| 20:02 | Cr8 | munge is for classes |
| 20:02 | mdeboard | for src/foo_bar/baz.clj you can do (ns foo-bar.baz) |
| 20:02 | Cr8 | right |
| 20:02 | mdeboard | Learned this lesson already once, my brain sucks |
| 20:02 | uvtc | ,(doc munge) |
| 20:02 | clojurebot | "([s]); " |
| 20:03 | uvtc | Clojurebot, are you making some kind of ascii face at me? |
| 20:03 | sadgur | night everyone |
| 20:03 | Cr8 | source of namespace-munge: (.replace (str ns) \- \_)) |
| 20:03 | Cr8 | source of munge: ((if (symbol? s) symbol str) (clojure.lang.Compiler/munge (str s)))) |
| 20:04 | uvtc | Cr8: Ah. Right, right. Thanks. :) |
| 20:24 | arrdem | I just went to bump my project's version number and realized that I wasn't using any really sane version IDing system and that all of my git-flags were named for the location of the major bug fixed or feature added. I see the X.Y.Z-{RELEASES/STABLE} convention on Clojars... is this defined somewhere? |
| 20:25 | Raynes | Cr8: What do you do if it hasn't written the file? |
| 20:25 | Raynes | Bleh |
| 20:25 | Cr8 | Raynes: make a modification and try again. |
| 20:26 | cjfrisz | dnolen: sorry for the vague Twitter bug report |
| 20:26 | Cr8 | it doesn't really seem to get -stuck- in a bad state for me |
| 20:26 | Cr8 | but every once in a while I'll close a fn and reopen it to find my modifications didn't stick around, even though I thought i'd saved it |
| 20:26 | kaoD_ | hi |
| 20:27 | cjfrisz | Or rather, bug report via Twitter |
| 20:29 | dnolen | cjfrisz: heh, did you figure it out? |
| 20:30 | cjfrisz | dnolen: No, I still haven't. I just downgraded back to 0.2.0-alpha9 and everything works |
| 20:30 | cjfrisz | dnolen: So the error I'm getting is CompilerException java.lang.AssertionError: Assert failed: Unknown predicate in [number?] |
| 20:31 | dnolen | cjfrisz: alpha-11 is actually the latest. |
| 20:31 | cjfrisz | dnolen: Ooooh, let me give that a shot. The Github page currently says alpha10 is the guy to add to project.clj |
| 20:32 | dnolen | cjfrisz: yeah just updated readme, sorry about that. |
| 20:32 | dnolen | cjfrisz: not sure if it will make a difference for you. |
| 20:33 | dnolen | cjfrisz: seems strange that 10 doesn't work for you - all the changes were CLJS related far as I can tell. |
| 20:33 | cjfrisz | dnolen: Still the same issue |
| 20:33 | cjfrisz | dnolen: You should be able to reproduce it by running CTCO with the core.match dependency changed to alpha10 or alpha11 |
| 20:34 | dnolen | cjfrisz: ahh sorry my fault. here's the problem. |
| 20:34 | dnolen | cjfrisz: you need to replace :when w/ :guard I think. |
| 20:35 | cjfrisz | dnolen: I'll give that a shot |
| 20:35 | cjfrisz | Have a second |
| 20:35 | dnolen | cjfrisz: updating the README to mention breaking change. |
| 20:35 | cjfrisz | dnolen: I figured that it might be a syntax change, but the docs still said :when |
| 20:37 | dnolen | cjfrisz: updated the docs, sorry about that. |
| 20:37 | cjfrisz | dnolen: That did it! Thanks! |
| 20:37 | dnolen | cjfrisz: np. |
| 20:37 | dnolen | cjfrisz: apologies for not keeping the docs / readme up to date. |
| 20:40 | cjfrisz | dnolen: No easy task, I know |
| 20:40 | cjfrisz | dnolen: Lucky for me, there's exactly one "match" in CTCO, so a single query-replace did the job |
| 20:45 | xeqi | arrdem: I'm a fan of semantic versioning http://semver.org/ |
| 20:46 | xeqi | the -SNAPSHOT usually means work in development, that isn't ready for a release, but could be useable |
| 20:53 | bmaddy | Does anyone know of any example code that has core.logic working with clojurescript? I'm having a hard time getting it to work. |
| 20:54 | dnolen | bmaddy: CLJS core.logic is very, very paired down compared to Clojure JVM version. |
| 20:55 | dnolen | bmaddy: the tests in the repo should give you an idea of how to get it working. |
| 20:55 | bmaddy | Ahh, good call. Thanks, I'll check that out. |
| 20:57 | arrdem | xeqi: thanks. I ran into that page in my googling and didn't take it seriously. re-visiting. |
| 20:57 | dnolen | bmaddy: don't forget to require the macros in your ns form, easy source of error. |
| 21:20 | bmaddy | Oh geez, I didn't recompile my cljs. *smacks-self-on-head* |
| 21:20 | bmaddy | it seems to be working just fine. |
| 21:20 | dnolen | bmaddy: cool |
| 21:21 | Frozenlock | Is there a wrapper for most of the javascript functions in cljs? |
| 21:21 | dnolen | Frozenlock: what do you mean? |
| 21:22 | Frozenlock | Well looking at a js code, I see document.createTextNode |
| 21:22 | Frozenlock | Is there a `create-text-node'-like function? |
| 21:22 | dnolen | Frozenlock: those aren't JS functions, those are DOM functions. and no those are not wrapped, and they won't be. |
| 21:24 | Frozenlock | Oh! So I should call them like in the jvm? (.createTextNode ....)? |
| 21:27 | dnolen | Frozenlock: yes |
| 21:27 | Frozenlock | Thank you |
| 21:30 | symuyn | I'm having trouble getting a good word wrapping string function in Clojure. The only example I can find is at http://langref.org/all-languages/strings/reversing-a-string/textwrap, but it doesn't work for certain strings. |
| 21:30 | symuyn | It gives the solution of (re-seq #".{0,70} ")— |
| 21:30 | symuyn | ,(re-seq #".{0,70} " (apply str (repeat 10 "The quick brown fox jumps over the lazy dog. "))) |
| 21:30 | clojurebot | ("The quick brown fox jumps over the lazy dog. The quick brown fox jumps " "over the lazy dog. The quick brown fox jumps over the lazy dog. The " "quick brown fox jumps over the lazy dog. The quick brown fox jumps " "over the lazy dog. The quick brown fox jumps over the lazy dog. The " "quick brown fox jumps over the lazy dog. The quick brown fox jumps " ...) |
| 21:31 | symuyn | —but that doesn't work for short strings— |
| 21:31 | symuyn | ,(re-seq #".{0,70} " "A B C") |
| 21:31 | clojurebot | ("A B ") |
| 21:32 | symuyn | (Not to mention, of course, that this is naive about surrogate pairs, diacritics, and other Unicode fun, yeah. I'll probably have to write it all myself, but this should be a fairly common thing…) |
| 21:32 | gfredericks | well isn't the issue not the string length but that it always fails at the end? |
| 21:32 | symuyn | Oh, good point. Hmm— |
| 21:32 | gfredericks | ,(re-seq #".{0,70}( |\Z)" "A B C") |
| 21:32 | clojurebot | (["A B C" ""] ["" ""]) |
| 21:33 | gfredericks | bam |
| 21:33 | symuyn | Excellent; thank you very much. |
| 21:34 | symuyn | Hmm, I wonder if there's any Java or Clojure stuff for iterating on *logical* characters, such as surrogate pairs and diacritic-modified characters—I've been using Apple's Objective-C APIs lately, and their Unicode support has spoiled me, heh… |
| 21:35 | amalloy | symuyn: you might also like the one that lazybot uses: https://github.com/flatland/lazybot/blob/newcontrib/src/lazybot/gist.clj |
| 21:36 | symuyn | Wonderful; thank you again. |
| 21:41 | Raynes | amalloy: You.. |
| 21:41 | Raynes | amalloy: You kinda just linked to something really weird. |
| 21:43 | Raynes | amalloy: https://github.com/flatland/lazybot/blob/develop/src/lazybot/paste.clj isn't this the same thing? |
| 21:43 | Raynes | Only with a better pastebin. |
| 21:44 | gfredericks | what does [] accomplish in a regex? |
| 21:44 | amalloy | usually indicates the author has made an error |
| 21:44 | gfredericks | oh the ] must be a literal |
| 21:45 | amalloy | oh, sure, if there's another ] later |
| 21:45 | amalloy | [][] is supposed to match either square bracket, for example |
| 21:45 | gfredericks | I don't think it's obvious that that should work though |
| 21:45 | amalloy | (java's regex engine is broken so that it doesn't) |
| 21:45 | gfredericks | amalloy: I'm looking at line 8 from your link |
| 21:45 | amalloy | gfredericks: it has no meaning otherwise, and it's defined to work, so...? |
| 21:45 | gfredericks | amalloy: reasonable definitely |
| 21:46 | amalloy | i seem to be matching any 50-70 characters, along with any trailing ])|" characters |
| 21:47 | gfredericks | right |
| 21:47 | gfredericks | I was only surprised at the [] |
| 21:48 | amalloy | an important part of the perl philosophy: no syntactic construct left behind! any combination of characters that can plausibly be given meaning, must mean something :P |
| 21:49 | gfredericks | ha |
| 21:50 | gfredericks | by that logic should ()) match closing parens? |
| 21:50 | gfredericks | (and capture it) |
| 21:51 | Frozenlock | Cljs makes me realize how I've been spoiled with clojure-swank. |
| 21:51 | gfredericks | I can imagine [] beinge unhelpful for dynamically generated regexes |
| 21:51 | amalloy | gfredericks: no good because of context, though: ()) might be preceded by a ( |
| 21:52 | gfredericks | these context free grammars sure are context sensitive |
| 21:52 | amalloy | gfredericks: imagine if []abcd] didn't work, though. you'd have to write (?:]|[abcd]) |
| 21:52 | gfredericks | why not [\]abcd]? |
| 21:52 | amalloy | oh, i guess that's probably true |
| 21:53 | amalloy | &(re-seq #"[\]]" "ab[]") |
| 21:53 | lazybot | ⇒ ("]") |
| 21:53 | gfredericks | I don't even know what the ?: is supposed to do |
| 21:54 | Frozenlock | Annnnnnnd I just killed my repl. (keys (ns 'dom.test)) was a bad idea. |
| 21:54 | amalloy | gfredericks: without it you'd be creating a capturing group |
| 21:54 | gfredericks | ooh that yes |
| 21:55 | gfredericks | I always forget about that functionality since it isn't strictly necessary |
| 21:56 | gfredericks | it just occurred to me that not only do backreferences allow regexes to describe more than just regular languages, I think they also cause the regexes themselves to not be context-free |
| 21:56 | uvtc | How close are Java regexes to Perl 5 regexes? |
| 21:56 | amalloy | uvtc: very close, but not identical |
| 21:57 | amalloy | gfredericks: yes, a lot of atrocious stuff has gotten packed into regexes |
| 21:58 | uvtc | Ok, ok. Thanks. That's what I thought, re. regexes: Perl 5 ≅ Python ≅ Java ≅ PCRE. |
| 21:58 | uvtc | s/Ok/Oh/ :) |
| 22:03 | uvtc | Oh, the docs for java.util.regex.Pattern have a "Comparison to Perl 5" section. |
| 22:22 | uvtc | For a compojure project using the lein-ring plug-in, can I start the project while at the same time have access to the repl? |
| 22:30 | xeqi | uvtc: not that I'm aware of |
| 22:31 | uvtc | Thanks, xeqi. |
| 22:31 | xeqi | though you could start a repl and call run-jetty with :join? false |
| 22:31 | uvtc | Ah, right. Instead of using `lein ring server`. |
| 22:37 | casion | ,(= (1) [1]) |
| 22:37 | clojurebot | #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn> |
| 22:37 | casion | derp |
| 22:37 | casion | ,(= ('1) [1]) |
| 22:37 | clojurebot | #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn> |
| 22:37 | casion | whatever |
| 22:38 | chouser | ,(= '(1) [1]) |
| 22:38 | clojurebot | true |
| 22:38 | casion | can't even type, thinking is probably not my forte right now |
| 22:38 | chouser | :-) |
| 22:38 | casion | I had no idea that would be true :| |
| 22:39 | casion | back to the book I guess |
| 22:41 | zeromodulus | why are single segment namespaces discouraged in clojure? e.g. hello-world.core preferred over hello-world. |
| 22:44 | xeqi | because when they are compiled into a java class they end up in the default package |
| 22:44 | xeqi | which is discouraged cause it causes problems.. with importing ? I don't remember the specific |
| 22:44 | uvtc | clojurebot should have an answer for that one. |
| 22:45 | uvtc | ~single-segment-namespaces |
| 22:45 | clojurebot | I don't understand. |
| 22:45 | uvtc | ~namespaces |
| 22:45 | clojurebot | namespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it |
| 22:45 | uvtc | (funny: "without a period in it", and it leaves off the period at the end of the sentence. :) ) |
| 22:47 | amalloy | zeromodulus: hello.world is better than either of those. not single-segment, and doesn't introduce a meaningless .core suffix |
| 22:48 | chouser | Yeah, I've never been a fan of library .core namespaces |
| 22:48 | chouser | I think something at the top level to disambiguate is wise. zeromdoules.hello-world |
| 22:50 | gfredericks | core.core.core.core |
| 22:56 | uvtc | What is the terminology for that core.clj file that hello-world.core refers to? "the core module of the hello-world library"? |
| 23:00 | gfredericks | (ns core.core (:require [core.core.core :as core])) (defn core [core] core) |
| 23:08 | Raynes | I've never been a fan of the weird domain crap java people do. |
| 23:08 | uvtc | Seems like "core" is a good name choice for libs that contain more than one ... module. As good a name to standardize on as any. Maybe "main". |
| 23:08 | Raynes | com.mysite.freewebs.geocities.lol.im.putting.there.here.cuz.i.can.JavaFactory |
| 23:09 | gfredericks | Raynes: if it didn't produce so much FS depth would it be less annoying? |
| 23:09 | Raynes | No. |
| 23:09 | chouser | I prefer using the top level to disambiguate, and the inner level to name what it's actually for. |
| 23:10 | Raynes | I don't know what I'd use for 'core' in half of my libraries. |
| 23:10 | gfredericks | uvtc: in my head "main" means "the first thing that runs" in some context or another |
| 23:10 | Raynes | conch.usethistoshellout |
| 23:10 | gfredericks | Raynes: fs.core could be a core namespace |
| 23:10 | uvtc | Hm. So, maybe use project-name.core for libs, and project-name.main for apps? ... |
| 23:10 | Raynes | fs.filesystemstuffisinhere |
| 23:11 | chouser | stll don't like it |
| 23:11 | gfredericks | uvtc: that sounds totally reasonable. I'm not a core hater. |
| 23:11 | chouser | uvtc.project-name |
| 23:11 | Raynes | Blugh. |
| 23:11 | Raynes | And when the project changes hands? |
| 23:11 | uvtc | chouser: but I may not maintain project-name forever. |
| 23:11 | Raynes | Keep the namespace and be a liar? |
| 23:12 | RylandAlmanza | Anyone have experience writing android applications in clojure? |
| 23:12 | uvtc | immortality! |
| 23:12 | chouser | who cares? |
| 23:12 | chouser | sure |
| 23:12 | Raynes | I care. |
| 23:12 | chouser | the point is to not trample on fs |
| 23:12 | Raynes | I'd be maintaining miki.fs right now using your naming scheme. |
| 23:12 | chouser | you and I both make a namespace fs, and now nobody can use them in the same JVM |
| 23:13 | chouser | that matters a lot more than whose name is on the front |
| 23:13 | Raynes | Well, don't name a project fs since there already is one. *shrug* |
| 23:13 | gfredericks | chouser: I agree with you. does this make us conservatives? |
| 23:13 | chouser | so better yet come up with an actual clever/unique name |
| 23:13 | Raynes | Maybe we should use UUIDs as namespace prefixes then. |
| 23:13 | Raynes | But they could clash at some point. |
| 23:14 | chouser | gfredericks: heh. according to the definition Yegge provided, or the one he actually uses? |
| 23:14 | chouser | Raynes: if you prefer. |
| 23:14 | gfredericks | provided |
| 23:14 | uvtc | The Perl community has a neat way of dealing with it. One person uses Bicycle. Another separate lib uses Bicycle::Seat. Someone else, Bicycle::Tires, and still another Bicycle::Seat::MassiveSprings. |
| 23:15 | Raynes | chouser: Sorry if I sound like an asshole. I just don't get the big deal. We've been using this for years and I've yet to see any significant problems. Maybe people will start naming all their libraries fs in the future. *shrug* |
| 23:15 | Raynes | I should really rename fs, but I'd hate to change the namespace. People hate when I change fs things. :| |
| 23:15 | gfredericks | Raynes: fo.shiz? |
| 23:16 | chouser | Raynes: I'd like people to choose to avoid my libraries because of the state of the code or docs, not because the name conflicts with something else they already have. |
| 23:16 | Raynes | I've never had someone mention having that problem with my libraries. |
| 23:17 | Raynes | fwiw, fs wasn't my choice of name. It was a single segment namespace when I got it. |
| 23:18 | amalloy | Raynes: the clojure community is small. if the java or scala communities were as reckless as we are, there would be conflicts everywhere, and nobody could use clojure because our libs conflict with theirs |
| 23:18 | Raynes | Okay, I'm wrong. |
| 23:19 | Raynes | I don't bother arguing with amalloy. |
| 23:19 | amalloy | ooesn't maven central have a policy on this? like, we won't take your jars if you pick a stupid package name? |
| 23:19 | Raynes | chouser will give up and go away. I'd be here all night with amalloy. |
| 23:19 | amalloy | you wish |
| 23:19 | Raynes | Oooh |
| 23:19 | chouser | I'm already gone :-) |
| 23:19 | Frozenlock | So what's the moral of the story? How do you name a library? |
| 23:20 | amalloy | Frozenlock: right now? recklessly. in the future? we'll probably grow out of it |
| 23:20 | gfredericks | &(format "lib-%04d" (rand-int 10000)) |
| 23:20 | lazybot | ⇒ "lib-2712" |
| 23:20 | Frozenlock | frozenlock.library? |
| 23:20 | amalloy | i called one of my first libs amalloy-utils, and people didn't want to use it |
| 23:20 | Frozenlock | I would :) |
| 23:20 | gfredericks | I usually use my domain name, because raynes hates that |
| 23:20 | uvtc | Can I name mine bicycle.seat, and Frozenlock name his more specialized one bicycle.seat.massive-springs, and there will be no problems? |
| 23:20 | chouser | I wouldn't actually recommend using your own name for the top level, but it's better than nothing. |
| 23:20 | Raynes | Frozenlock: com.frozenlock.(UUID/randomUUID).code.doesstuff |
| 23:21 | uvtc | (I mean namespace names, not github project names, nor artifact-id's) |
| 23:21 | Raynes | chouser: What *would* you recommend? Could you nail out something solid? You realize all it takes to get people to change is to change that lein-newnew does by default. It was talked about before but not acted upon. |
| 23:21 | gfredericks | wait no I don't. I only do that for maven group-ids. |
| 23:21 | Raynes | what* |
| 23:22 | amalloy | uvtc: technomancy picks literaty characters or references and makes his "core" namespace first.last, and supporting libs first.last.whatever |
| 23:22 | amalloy | not the worst idea ever, but we can't all be so creative |
| 23:22 | chouser | Raynes: you do see a difference in risk between somename.fs and just fs, right? Whether you agree that it's too big a risk or not. |
| 23:23 | Raynes | I see a risk, but I don't care about it at all. |
| 23:23 | Frozenlock | Let's prepend with a bitcoin address. It will almost certainly be unique, and we can tip if we like it. |
| 23:23 | Raynes | But that doesn't mean I wont listen to what you have to say. |
| 23:23 | Raynes | chouser: Open a new issue about it on lein newnew. Let's talk things over with technomancy and friends and come up with something new. |
| 23:23 | Raynes | You can't revolutionize without starting the revolution. |
| 23:24 | chouser | I don't care enough to try to start a revolution. Just tossing in my opinion when the topic comes up. |
| 23:25 | chouser | See you folks later. |
| 23:25 | Raynes | And that folks is why we have the foo.core pattern. Ya'll come back now, ya hear. |
| 23:25 | chouser | :-) |
| 23:26 | gfredericks | ~core |
| 23:28 | clojurebot | core is what you put in a namespace when you can't think of a better way to avoid single-segment namespaces. |
| 23:43 | Frozenlock | Ok, I want to do this in cljs https://www.circuitlab.com/editor/ |
| 23:47 | zeromodulus | ooo, just discovered lein repl |
| 23:47 | zeromodulus | n.n |
| 23:49 | uvtc | zeromodulus: wait 'til you try the tab-completion... |
| 23:49 | zeromodulus | I did, hehe, that's why I'm happy about it. |
| 23:50 | Frozenlock | Isn't lein repl the most barebone you can get? |
| 23:51 | amalloy | Frozenlock: java -jar clojure.jar |
| 23:52 | Frozenlock | amalloy: I shiver at the idea of trying that |
| 23:52 | uvtc | Frozenlock: I don't think so. lein repl gives you the usual readline keyboard shortcuts, plus tab-completion. It's nice. |
| 23:52 | Frozenlock | Oh nice! |
| 23:52 | eggsby | Frozenlock: what do you use with cljs? I tried it yesterday with just java interop to google closure and it seemed painful, latest versions of cljs-build and domina don't seem to play nice together either :( |
| 23:53 | eggsby | is everyone doing cljs just using noir and pinot together? |
| 23:53 | Frozenlock | eggsby: I'm still getting started |
| 23:53 | eggsby | ah |
| 23:53 | Frozenlock | The DOM stuff is a real pain... |
| 23:54 | Frozenlock | At least I have my repl working in inferior-lisp |
| 23:54 | Frozenlock | Btw, anyone knows if there's an example of a cljs repl working inside the browser? |
| 23:54 | eggsby | To be honest I'm surprised there isn't a slick wrapper over google closure interop yet |
| 23:55 | Frozenlock | eggsby: ++ |
| 23:55 | eggsby | Frozenlock: iirc cljs one has that |
| 23:56 | eggsby | http://clojurescriptone.com/ I *think* |
| 23:57 | Frozenlock | I mean with a repl literally on the webpage |
| 23:57 | uvtc | Frozenlock: himera? |
| 23:57 | uvtc | http://himera.herokuapp.com/index.html |
| 23:58 | eggsby | ^ |
| 23:58 | Frozenlock | \o/ |
| 23:58 | Frozenlock | Thanks! |
| 23:58 | Frozenlock | I want to know how they do it without `eval' |
| 23:58 | eggsby | the source for that is up on github |
| 23:58 | uvtc | fogus wrote a blog post about it. |
| 23:59 | Frozenlock | Yes, the read will be interesting :) |
| 23:59 | Frozenlock | R E P L without eval is like... RPL |
| 23:59 | eggsby | lol |
| 23:59 | eggsby | R C P L ? |