2012-07-23
| 00:00 | clj_newb_2834020 | this is really baffling me |
| 00:00 | clj_newb_2834020 | it's like the bemuda triangle |
| 00:00 | wmealing | both accessing it the same url style ? |
| 00:00 | clj_newb_2834020 | yes |
| 00:01 | clj_newb_2834020 | they're running the _eaxct_ same code |
| 00:01 | clj_newb_2834020 | from git |
| 00:01 | wmealing | oh yeah, but http://whatever not https:// on another |
| 00:01 | wmealing | and localhost not ip address, that kind of thing |
| 00:01 | clj_newb_2834020 | I even have all the leingingen *.jar files checked into git |
| 00:01 | clj_newb_2834020 | (repl/connect "http://localhost:9000/repl") |
| 00:02 | wmealing | no extra firewall ? |
| 00:02 | wmealing | does the sample work http://himera.herokuapp.com/index.html |
| 00:02 | wmealing | on that machine |
| 00:03 | clj_newb_2834020 | cljs.user> (+ 2 3) 5 cljs.user> |
| 00:03 | wmealing | yep |
| 00:04 | wmealing | can you test your other system |
| 00:04 | wmealing | from that browser |
| 00:04 | clj_newb_2834020 | brilliant |
| 00:04 | clj_newb_2834020 | unfortunately, not yet, other system is at home |
| 00:04 | clj_newb_2834020 | this is brilliant; checking whether the problem is the browser |
| 00:04 | clj_newb_2834020 | or the web serer |
| 00:05 | clj_newb_2834020 | also, how does https://github.com/fogus/himera/blob/master/src/cljs/himera/client/repl.cljs work |
| 00:05 | clj_newb_2834020 | I don't see the repl/connect anywhere |
| 00:05 | wmealing | i dont know enough sorry clj_newb |
| 00:06 | wmealing | something else might fire it off |
| 00:06 | clj_newb_2834020 | fogus, are you here? |
| 00:29 | emezeske | And God said, "Let there be lambdas." |
| 00:29 | emezeske | And there were lambdas. |
| 00:33 | dhkl | Aman. |
| 00:38 | dhkl | emezeske: I'm trying to use clojurescript + Angular.js with lein-cljsbuild in a toy project. Thanks for the work on cljsbuild, btw. I have tried to use the :externs option to prevent some of the names from munging but it didn't seem to work. Is there anyway I can tell if cljsbuild used an extern file? |
| 00:45 | clj_newb_298j | the good news is that now clojurescript repl is equally broken on both my desktop and my laptop |
| 00:45 | clj_newb_298j | unfortunatel, I can't git revert it, since it has something to do with a directory that I had .gitignored |
| 00:45 | clj_newb_298j | the bad news is ... I now have to fix this |
| 00:47 | clj_newb_298j | woot |
| 00:47 | clj_newb_298j | and now I have fixed it |
| 00:47 | clj_newb_298j | yay |
| 00:57 | emezeske | dhkl: Hmm, I usually grep through the output JS file for whole symbols, and if I don't see them I assume the :externs were not right :) |
| 00:58 | emezeske | dhkl: Not a very good answer, though :( |
| 00:59 | dhkl | emezeske: For some reason, my extern file isn't being processed, and the symbols are munged. I couldn't figure out why :-\ |
| 01:00 | wmealing | clj_newb_298j, win ! |
| 01:00 | wmealing | clj_newb_298j, so it was not "exactly" the same ? |
| 01:01 | clj_newb_298j | there was some directory that I had gitignored that caused all the problem |
| 01:01 | wmealing | oh suck |
| 01:01 | wmealing | but good you've got it solved |
| 01:01 | clj_newb_298j | in the future, I'm going to develop everything in VMs, so besides the hardware, it'll always the the exact same |
| 01:02 | wmealing | i have another suggestion |
| 01:02 | wmealing | its a little odd, but it might work |
| 01:02 | clj_newb_298j | do tell |
| 01:02 | clj_newb_298j | does it involve common sense and logic? |
| 01:02 | wmealing | i'm not sure, its what i'd do, put it that way. |
| 01:02 | emezeske | dhkl: I believe the :exters files are read relative to the classpath |
| 01:02 | emezeske | dhkl: If that's any help |
| 01:02 | clj_newb_298j | wmealing: well, let's heart it |
| 01:03 | wmealing | you might be able to do something like jenkins for your build and test it with selenium |
| 01:03 | wmealing | or test it with a browser, something like that |
| 01:03 | clj_newb_298j | i tried selenium before |
| 01:03 | clj_newb_298j | it unfortunately crashes the _JVM_ after something like 50 calls |
| 01:03 | wmealing | there are other options right ? |
| 01:04 | clj_newb_298j | for controlling the browser besides selenium? |
| 01:06 | dhkl | emezeske: I have my extern file in <project-root>/resources/externs/externs.js, and I specified the path in :externs to be ["externs/extern.js"]. It should be available to the clojusre compiler. I'm so confused.. |
| 01:07 | emezeske | dhkl: That sounds like the right setup to me. |
| 01:07 | emezeske | dhkl: O_o |
| 01:13 | dhkl | emezeske: Yeah, it's super strange. Thanks for your help though |
| 01:15 | emezeske | dhkl: It's probably a typo, but your comment earlier had the FS path as externs.js, and the :externs as extern.js (note the missing "s") |
| 01:16 | emezeske | dhkl: I assume that's an IRC typo and not the way it's set up in your project ;) |
| 01:22 | dhkl | emezeske: yeah, it was an IRC typo :) |
| 01:24 | dhkl | sorry |
| 01:28 | emezeske | dhkl: haha no worries |
| 02:57 | kral | namaste |
| 03:00 | magopian | hello there |
| 03:14 | antoineB | hello, what is the difference between #(%) and (fn [x] x) |
| 03:16 | ro_st | the way it's written |
| 03:16 | ro_st | functionally identical, otherwise |
| 03:16 | ro_st | the first is expanded to the second upon reading by the reader |
| 03:16 | hiredman | ,'#(%) |
| 03:16 | clojurebot | (fn* [p1__27#] (p1__27#)) |
| 03:17 | pyrtsa | There is more. The first tries to call the first argument. |
| 03:17 | ro_st | ah :-) one important difference |
| 03:17 | antoineB | ,(def a #(%)) |
| 03:17 | clojurebot | #<Exception java.lang.Exception: SANBOX DENIED> |
| 03:17 | ro_st | because % is in function position |
| 03:17 | pyrtsa | #(%) <--> (fn [x] (x)) |
| 03:19 | antoineB | so i can't make (fn [x] x) with #() syntax? |
| 03:19 | pyrtsa | antoineB: AFAIK, no. |
| 03:19 | antoineB | ok |
| 03:22 | mduerksen | antoineB: #(do %) |
| 03:22 | antoineB | i am looking for a macro that apply the first arguement as first argument to all the other elements? |
| 03:23 | antoineB | (macro-a 12 (+ 1) (+ 2)) => '(13 14) |
| 03:23 | unlink | Is it possible to have polymorphic functions and values in Clojure monads? |
| 03:24 | unlink | (other than bind and return) |
| 03:24 | amalloy | antoineB: if that macro existed, it would surely be a function, not a macro |
| 03:24 | antoineB | mduerksen: #(identity %) |
| 03:26 | antoineB | amalloy: (macro-a 12 (+ 1) (+ 2)) => [(+ 12 1) (+ 12 2)] better? |
| 03:26 | amalloy | there's still no reason to make it a macro |
| 03:27 | bpr | (= macro-a ->) |
| 03:27 | amalloy | oh |
| 03:27 | amalloy | bpr: not close |
| 03:27 | amalloy | antoineB: okay, now it looks like a macro, but i can't think why you'd want it |
| 03:27 | antoineB | -> is where i get the idea of macro-a |
| 03:30 | unlink | Do I need leiningen to accomplish something like `lein cljsbuild auto'? I just have a self-contained ClojureScript application without an accompanying Clojure codebase (and thuse no other need for a project.clj). |
| 03:30 | antoineB | do to something like: (macro-a state (func params) (func params)) |
| 03:30 | antoineB | where func return arrays and modify state |
| 03:33 | ro_st | such a pity enfocus uses string selectors and enlive uses keywords. would be awesome to be able to write template code once and use it in both jvm and js |
| 03:34 | ro_st | i guess a macro that converts enlive code to enfocus is possible |
| 03:35 | mduerksen | antoineB: you might want to look at juxt |
| 03:36 | ro_st | Raynes: are you able to use templates and template code clj and cljs with mustache? |
| 03:36 | ro_st | i'm not locked into en* … yet |
| 03:37 | Raynes | I'm not sure what you'd use for a mustache library in cljs. |
| 03:37 | Raynes | There are probably js libs you could use. |
| 03:39 | dhkl | Not a cljs library, but hogan.js is quite nice to use as a JS mustache implementation |
| 03:39 | ro_st | it's very close: https://www.refheap.com/paste/3738 |
| 03:40 | ro_st | i'm sure (through symlinking) i can make the paths identical |
| 03:40 | ro_st | it's just those selectors |
| 03:40 | ro_st | it's be *awesome* to be able to write and test templates in the jvm with a repl and midje |
| 03:42 | antoineB | mduerksen: the default of juxt it is not clean i need to pass #(func % params) |
| 03:42 | antoineB | i will write my own macro |
| 03:50 | antoineB | i would like to use my own library jar into a lein project how i do that? |
| 03:51 | ro_st | there was an article about that on planet.clojure.in in the last couple days |
| 03:53 | antoineB | ok simple but efficient |
| 04:16 | antoineB | here is the macro http://pastebin.com/JnEbLPLt |
| 04:51 | francis | My current understanding of HTTP is that I can do a couple of verbs (I'm interested in post and get) to interact with a server and give a web applicaion data to work with. |
| 04:52 | francis | I'd like to implement this in clojure, using the clj-http library (https://github.com/dakrone/clj-http) - but I'm still rather confused about how I get my server to 'listen' for http posts |
| 04:52 | francis | could anyone point me in the right direction? |
| 04:53 | dhkl | franics: Have you looked at options like ring and compojure? |
| 04:54 | francis | I have, but I belive that I'm totally missing the whole http/server idea here |
| 04:55 | francis | I have a ring server, I want to set it up so I can post data to it |
| 04:55 | unlink | Is lein-cljsbuild the Whole Story(TM) about building ClojureScript applications? |
| 04:55 | francis | so I would have a 'listener' at a specific url that accepts json/s-expression data? |
| 04:58 | francis | dhkl: Thanks, what I needed was in the compojure wiki. |
| 05:00 | dhkl | franics: No problem. Also check out https://github.com/ring-clojure/ring/wiki/ for what's happening under the hood. |
| 05:00 | ro_st | unlink: yup |
| 05:00 | ro_st | unlink: https://github.com/emezeske/lein-cljsbuild/blob/0.2.4/example-projects/advanced/project.clj |
| 05:01 | ro_st | clone that and start coding |
| 05:01 | unlink | ro_st: What if I don't have an accompanying Clojure project? |
| 05:01 | jballanc | quick question: what's the best way to set *out* to a file? |
| 05:01 | dhkl | unlink: it is used quite extensively. The clojurescript wiki also recommends it. |
| 05:02 | jballanc | all I've figured out is with-open and then binding to bind the file to *out*...but that seems clumsy |
| 05:02 | ro_st | unlink: you don't need one. you can use a cljsbuild project and write .cljs files exclusively |
| 05:03 | ro_st | but i suggest you use some clj to do a webserver and some html to make testing easy |
| 05:03 | dhkl | ro_st: Do you have any experience with using externs along with lein-cljsbuild? |
| 05:03 | unlink | I guess I just don't want to use leiningen if I don't absolutely need to. |
| 05:04 | ro_st | no. but i do with vanilla Google Closure |
| 05:05 | ro_st | i think cljsbuild simply passes all the externs along to the gclosure compiler directly |
| 05:05 | dhkl | ro_st: I've been having problem with lein-cljsbuild not using the extern files I supplied to it in project.clj |
| 05:06 | dhkl | It seems like no matter what I do, advanced optimization will munge even the names I defined in the extern file |
| 05:07 | dhkl | I have to fall back to coffeescript for now to keep the project going :-\ |
| 05:07 | ro_st | you're using externs to talk to an external library, right? |
| 05:08 | ro_st | are you sure that a) it's finding the file? b) the file's externs are correctly defined? |
| 05:11 | dhkl | ro_st: I spoke to emezeske about this earlier. My extern file is in <project-root>/resources/externs/externs.js, and I set the extern path to "externs/externs.js" in project.clj. |
| 05:12 | dhkl | The extern file should be in the classpath. And in the externs.js, I just have something simple like: var angular = {}; angular.module = function() {}; |
| 05:13 | dhkl | To prevent the closure compiler from munging the angular.module call into something weird |
| 05:14 | ro_st | yeah that should work |
| 05:14 | ro_st | it might be that you need to decorate with /** @constructor */ somewhere, or similar |
| 05:15 | ro_st | you need to figure out what the root cause is first. can't find? or invalid syntax? |
| 05:16 | dhkl | well, it basically munged angular.module(...) to angular.sb(...) |
| 05:16 | ro_st | aha |
| 05:16 | ro_st | is module something that gets called as new angular.module(); ? |
| 05:17 | ro_st | if so, it needs a @constructor jsdoc |
| 05:17 | dhkl | I think so. |
| 05:17 | ro_st | yay static analysis syntactic crutches |
| 05:17 | dhkl | :-) thanks ro_st! |
| 05:17 | ro_st | bonne chance |
| 05:35 | ro_st | any enlive users? how do i compose defsnippet with clone-for? |
| 06:11 | stain | is there a 'delayed future'? I am thinking of using a future to represent a job that is finished, and within the future is a while loop that checks the job status on the server |
| 06:11 | stain | but it feels like I might fork off lots of while loops when people might never check it |
| 06:12 | stain | also it would be good if this loop was not continuing if you used (deref) with a timeout.. am I better making my own thingie? |
| 06:22 | ordnungswidrig | anybody has a pointer how to generate all sublists of a list in core.logic? |
| 06:29 | shinta42 | anyone using lighttable? |
| 06:47 | michaelr` | hello!!! |
| 06:48 | ro_st | 3 bangs. something the matter? |
| 07:00 | michaelr` | ro_st: ah, you know, the life :) |
| 07:01 | ro_st | debugging clojurescript is maddening. |
| 07:01 | ro_st | #justsaying |
| 07:02 | unlink | ro_st: how do you? |
| 07:02 | ro_st | you learn to read the js it makes |
| 07:02 | ro_st | and lean heavily on chrome dev tools |
| 07:05 | S11001001 | just don't mess up and you won't need to debug anything |
| 07:06 | ro_st | in a language set up to learn by experimentation? ;) |
| 07:11 | michaelr` | hmm |
| 07:12 | michaelr` | should i define functions in a (let) expression in a (defn)? |
| 07:12 | michaelr` | like (defn [] (let [f (fn [] 123)]) (f)) |
| 07:12 | michaelr` | like (defn [] (let [f (fn [] 123)] (f))) |
| 07:12 | michaelr` | can it be a peformance hit? |
| 07:13 | cshell | I don't think so, it would be if you did defn inside |
| 07:13 | michaelr` | essentially I want to refactor one large function into a few, but they don't have meaning outside of that function |
| 07:13 | cshell | you're just creating an anonymouse function |
| 07:13 | ro_st | use letfn: (defn ff [] (letfn [(fn-name [args] ddd)] …)) |
| 07:14 | ro_st | and it's compiled once at compile time |
| 07:14 | Cheiron | Hi, how to map this Scala code to clojure? http://pastie.org/4305591 |
| 07:14 | ro_st | no performance hit |
| 07:14 | michaelr` | great |
| 07:14 | michaelr` | thanks |
| 07:14 | cshell | nice, didn't know that |
| 07:14 | ro_st | it's actually a great way to refactor |
| 07:15 | ro_st | when you find yourself needing one inner fn somewhere else, promoting it to the top is a 5 second op |
| 07:15 | michaelr` | ,(doc letfn) |
| 07:15 | clojurebot | "([fnspecs & body]); fnspec ==> (fname [params*] exprs) or (fname ([params*] exprs)+) Takes a vector of function specs and a body, and generates a set of bindings of functions to their names. All of the names are available in all of the definitions of the functions, as well as the body." |
| 07:15 | ro_st | Cheiron: (let [[left secondLeft] (parse leftSheet object)] ...) |
| 07:16 | ro_st | Cheiron: i'm assuming that var(…) destructures |
| 07:16 | ro_st | in scala |
| 07:16 | ro_st | wooo it's working |
| 07:18 | ro_st | question for people who get macros: https://www.refheap.com/paste/3741 |
| 07:37 | ro_st | with enlive/enfocus, how do i transform the node at the root of the defsnippet? |
| 07:37 | ro_st | i've tried using :root in the selector, no dice |
| 07:38 | cshell | use the same selector |
| 07:39 | ro_st | as the snippet's defining selector? |
| 07:40 | cshell | yes |
| 07:40 | ro_st | that doesn't appear to work :( |
| 07:41 | cshell | what's your snippet? |
| 07:42 | ro_st | https://www.refheap.com/paste/3742 |
| 07:42 | ro_st | and i call (variable {:template {:name "mySubject"} :value "The subject!"}) |
| 07:43 | cshell | in this can you call just :a for the second selctor? |
| 07:43 | ro_st | doh *blush* |
| 07:44 | ro_st | thanks |
| 07:44 | cshell | np :) |
| 07:45 | ro_st | are you in enlive, enfocus, or both? |
| 07:45 | cshell | just enlive |
| 07:48 | ro_st | cool |
| 07:48 | ro_st | very nice system |
| 07:49 | cshell | yeah, it makes it very easy for my web designer and I to work together |
| 07:50 | jsnikeris | Hi all, I'm having trouble getting lein2 to eval things when the REPL is initializing. Just to test, I've got {:user {:repl-options {:init (print "hello")}}} in my ~/.lein/profiles.clj |
| 07:50 | jsnikeris | Does anyone see anything wrong with that? |
| 07:51 | cshell | what happens? |
| 07:51 | ro_st | can i do multiple transforms like i do there or do i have to thread with -> somehow? |
| 07:51 | jsnikeris | cshell: I just see the usual header message |
| 07:52 | cshell | ro_st: yes just put them sequentially [selector](tranform) [selector](transform) |
| 07:52 | cshell | jsnikeris: can you put the print outside of the profile to make sure tthat print works outside? |
| 07:52 | ro_st | even if the selector is the same? |
| 07:53 | cshell | yeah |
| 07:53 | cshell | i think it chains though - so your first output will effect the second |
| 07:53 | ro_st | it doesn't |
| 07:54 | ro_st | not within a single transform anyway |
| 07:54 | cshell | did you put two selectors? |
| 07:54 | ro_st | ah i need do→ |
| 07:56 | ro_st | yup that does the trick |
| 07:56 | jsnikeris | cshell: the content of profiles.clj needs to be a map |
| 08:04 | cshell | jsnikeris: hmmm, not sure, I've never used lein2, only read the docs |
| 08:04 | cshell | from the top of the sample file, exppressions should be working |
| 08:06 | ro_st | i never got repl init to work |
| 08:06 | ro_st | break time phew |
| 08:06 | Frozenlock | Good morning fellows! |
| 08:08 | jsnikeris | cshell: Ah, didn't know there was a sample file. Thanks! |
| 08:08 | Frozenlock | Is there a way to export a map to XML? I'm playing with clojure.xml, but can't figure out how to do it :( |
| 08:12 | jsnikeris | ro_st: it looks like you need to specify init-ns as well |
| 08:14 | jsnikeris | ro_st: I lied. Just :init is fine |
| 08:15 | S11001001 | Frozenlock: clojure.xml operates on its particular maps, not maps in general; you need to make clojure.xml maps out of your maps first |
| 08:16 | Frozenlock | S11001001: O_o |
| 08:16 | S11001001 | so let's say you write a function that accepts args of this form: {:name "blah" :vals [...]} |
| 08:16 | S11001001 | ought this same function just understand how to deal with maps that don't follow that format? |
| 08:17 | S11001001 | like I want to pass {:private (fn [x] 42)} |
| 08:17 | S11001001 | this will not work |
| 08:17 | Frozenlock | Oh! So there's a given set of keys I need to have? |
| 08:18 | S11001001 | the best way is to take an XML you have and parse it |
| 08:18 | S11001001 | then you will see the format the maps ought to be in |
| 08:18 | S11001001 | and, yes |
| 08:18 | Frozenlock | I will do, thanks :) |
| 08:57 | sayyestolife | I'm working with a completely fresh noir project, and I get this error when trying lein run: "Exception in thread "main" java.lang.IllegalStateException: escape-html already refers to: #'hiccup.core/escape-html in namespace: hiccup.page, compiling:(page.clj:1)" |
| 08:59 | sayyestolife | Is this error familiar to anyone? |
| 09:19 | antares_ | sayyestolife: yes |
| 09:19 | skoodge | is it possible to access the local variables of a datatype that was defined using deftype inside of the extend-protocol macro? |
| 09:19 | antares_ | sayyestolife: you need to rename hiccup.page-helpers to hiccup.page, I think. It is due to a namespace rename in Hiccup 1.0. |
| 09:20 | antares_ | skoodge: you should be able to access fields with (.field struct) for any deftype-defined type |
| 09:26 | skoodge | antares_: that works, thanks a lot! |
| 10:17 | cshell | this is a noob js question, but in js/html do distinct <script> tags have visibility into previous <script>tags? |
| 10:17 | antoineB | how can i add an element to a list |
| 10:17 | antoineB | ? |
| 10:17 | cshell | conj |
| 10:17 | cshell | ,(doc conj) |
| 10:17 | clojurebot | "([coll x] [coll x & xs]); conj[oin]. Returns a new collection with the xs 'added'. (conj nil item) returns (item). The 'addition' may happen at different 'places' depending on the concrete type." |
| 10:17 | sayyestolife | antares_: but I don't have any references to hiccup.page-helpers anywhere in my code |
| 10:18 | antoineB | ,(list? (conj '(1 2) 3)) |
| 10:18 | clojurebot | true |
| 10:18 | sh10151 | cshell: wrong channel maybe? in any case the scope of JS variables is by the entire document, but if you are running code directly in <script> rather than in an onload function, it will obviously only have access to variables defined prior to it in the document |
| 10:18 | antoineB | in my code i get it to be of type Cons |
| 10:18 | cshell | ,(conf '(1 2) 3) |
| 10:18 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: conf in this context, compiling:(NO_SOURCE_PATH:0)> |
| 10:18 | uvtc | ~cheatsheet |
| 10:18 | clojurebot | Cheatsheets with tooltips can be found at http://jafingerhut.github.com/ . |
| 10:18 | uvtc | antoineB: ^^ |
| 10:18 | cshell | ,(conj '(1 2) 3) |
| 10:18 | clojurebot | (3 1 2) |
| 10:19 | cshell | sh10151: thanks! |
| 10:19 | antoineB | uvtc: i know, in my code the use of conj return a non list? object |
| 10:19 | ro_st | uvtc: those cheatsheets rock! |
| 10:19 | cshell | only if the collection was another list |
| 10:20 | cshell | er, was something other than a list |
| 10:20 | clojurelearner | Hello Lein Gurus, Need help on setting up lein environment for a plugin development |
| 10:20 | clojurelearner | Ref: https://github.com/technomancy/leiningen/blob/preview/doc/PLUGINS.md |
| 10:20 | clojurelearner | During plugin development, having to re-run lein install in your plugin project and then switch to a test project can be very cumbersome. You can avoid this annoyance by creating a .lein-classpath file in your test project containing the path to the src directory of your plugin. |
| 10:20 | clojurelearner | As given in the instructions, I have setup .lein-classpath to include plugin src folder path |
| 10:20 | clojurelearner | but "lein classpath" from test project doesn't seem to be picking it up |
| 10:20 | clojurelearner | Any idea what I am missing? Any help is much appreciated |
| 10:21 | ro_st | clojurelearner: #leiningen might also be of help to you |
| 10:21 | antoineB | cshell: ArraySeq |
| 10:21 | uvtc | antoineB: a lot of clojure functions return (lazy) seq's. So, they may not be a concrete list, per se. |
| 10:21 | clojurelearner | ro_st: Thanks, I tried but no help :( |
| 10:22 | antoineB | clojure.lang.ArraySeq cannot be cast to clojure.lang.IPersistentStack |
| 10:22 | antoineB | i want use pop |
| 10:24 | antoineB | uvtc: ok |
| 10:24 | uvtc | antoineB: Note that you can always get a list or vector if you really want by doing `(list my-seq)` or `(vec my-seq)`. |
| 10:25 | antoineB | rest is ok |
| 10:26 | uvtc | antoineB: oops, sorry, that one with `list` was wrong. It would be `(apply list my-seq)`, though I'm not sure where you'd ever need that, actually. :) |
| 10:27 | antoineB | uvtc: my mistake was to belive my object was of type 'list |
| 10:28 | antares_ | sayyestolife: Noir may have them. Have you tried Noir 1.3 betas? |
| 10:29 | ro_st | clojurelearner: i suggest issuing on github. if it's not doing as the docs say, file a bug. |
| 10:31 | ro_st | it's not as immediate as resolving it with someone on here, but it's quite likely to help out in the end |
| 10:33 | clojurelearner | ro_st: Cheers mate. I will try Github |
| 10:33 | uvtc | At http://rosettacode.org/wiki/Towers_of_Hanoi#Clojure , the `towers-of-hanoi` function has 2 recursion paths (is that the correct term?). One calls the function by its name, and the other uses `recur`... |
| 10:35 | uvtc | Will this function consume too much stack, or does the recur save it? |
| 10:35 | ro_st | good luck :) |
| 10:35 | ro_st | recur doesn't use the stack |
| 10:35 | ro_st | that's the whole reason it exists |
| 10:36 | ro_st | under the hood, (loop .. (condition ? recur : quit)) is rewritten to while (condition) {...} |
| 10:36 | uvtc | ro_st: Right. But there's 2 paths out of that `do`. One that consumes stack, and one that doesn't ... |
| 10:36 | ToxicFrog | uvtc: the one that consumes stack will never consume more than n stack frames |
| 10:37 | ToxicFrog | So you'll hit tower sizes that take effectively infinite time to run before you run out of stack. |
| 10:37 | ro_st | uvtc: the if at the top saves the stack |
| 10:38 | ro_st | i think the first leg of the if is the final move in the solution |
| 10:38 | uvtc | ro_st: right. |
| 10:39 | uvtc | ToxicFrog: sounds like you're correct. I'm running the function with a fairly large value of `n`, and it hasn't overflowed, but it's still running. |
| 10:39 | uvtc | Whoops. I take that back. |
| 10:39 | uvtc | I just got dumped out of my repl. |
| 10:40 | uvtc | Though it didn't tell me why... |
| 10:40 | uvtc | This was at a hanoi level of 15. |
| 10:40 | uvtc | I like saying "hanoi level", btw. |
| 10:42 | duck1123 | With recursion, like war, it's important to have an exit strategy |
| 10:43 | uvtc | duck1123: That's what's interesting here. Most recursion examples I've seen so far have either an easy way to exit the recursion (such as returning a constant), and then the alternative is a tail `recur` call. |
| 10:44 | ToxicFrog | uvtc: hanoi is O(n!), so your 15-level hanoi would require 1307674368000 iterations. |
| 10:44 | uvtc | duck1123: but this hanoi example has 2 non-trivial ways out: one is the typical `recur` tail call, and the other is not. |
| 10:45 | uvtc | ToxicFrog: Sorry. I may be mistaken about 15 being the last one I tried. That's the last one shown in my repl history, but it may have been 18 that caused it to exit (not sure). |
| 10:45 | ToxicFrog | uvtc: (recur) is really iteration implemented with tail-recursion; other lisps (ie, those not subject to the limitations of the JVM) don't have an explicit recur, but automatically tail-call optimize any call in tail position. |
| 10:46 | uvtc | ToxicFrog: Though I do know that my laptop fan was definitely telling me that the computer was very busy and if I could please lay off it for a minute it would certainly be grateful. |
| 10:47 | uvtc | ToxicFrog: right. In Scheme I'd just call the function by name in both positions, perhaps noting to myself that one was in tail-call position and the other was not. |
| 10:48 | uvtc | ToxicFrog: Maybe you meant that the other way round: `recur` is tail-recursion implemented using iteration. |
| 10:48 | uvtc | :) |
| 10:48 | duck1123 | The nice thing about recur is that it'll throw if it's not in the tail call. That extra assertion is nice. |
| 10:50 | ToxicFrog | uvtc: well, ok, recur is used to implement iterative functions using tail recursion and is internally implemented with iteration anyways |
| 10:50 | uvtc | duck1123: I agree, it's nice that it catches those for you. |
| 10:52 | duck1123 | I've had times where I was using recur and without thinking about it wanted to add a logging statement to the end. Had I not been using recur and was relying on automatic TCO, that would've mysteriously failed at the worst times |
| 10:52 | antares_ | folks, can you please try opening http://clojurewerkz.org, http://clojureneo4j.info and http://clojuremongodb.info and tell me if it works (and what country/state your are in)? Trying to figure out if Zerigo is fully back up. |
| 10:53 | ro_st | all 3 up from cape town, south africa |
| 10:53 | uvtc | antares_: Northeast, USA : works |
| 10:53 | duck1123 | works for all, Detroit, MI |
| 10:53 | _zach | antares_: NYC, all work |
| 10:53 | antares_ | ok, thank you |
| 10:54 | llasram | antares_: names do no not resolve, SE US |
| 10:54 | antares_ | haha |
| 10:54 | TimMc | antares_: You forgot to (take 3 ...) -- the channel is going to realize the full seq! |
| 10:54 | antares_ | llasram: yes, it is a name resolution issue. We use zerigo and they just suffered a massive DDoS attack (possibly still going on). |
| 10:55 | TimMc | All works, Cambridge, MA. :-P |
| 10:55 | carminec | all works, Omaha NE |
| 10:56 | S11001001 | this is a clever ploy by antares_ to get people to visit his sites and I shan't be hoodwinked so easily |
| 10:59 | uvtc | antares_: Nice that you added those links to the relevant clojars pages. BTW, I notice on a number of them that there's 2 links to the same github page: one in the text, and the other as a button underneath the text. |
| 10:59 | TimMc | It's actually far more devious: He wants his URLs in the browser history autocomplete so that we'll poke at them later. |
| 11:00 | ro_st | i wish everyone putting stuff on clojars did what antares_ does. these sites rock |
| 11:00 | ro_st | ,(inc antares_) |
| 11:00 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: antares_ in this context, compiling:(NO_SOURCE_PATH:0)> |
| 11:00 | ro_st | lol |
| 11:00 | uvtc | (inc antares_ ) |
| 11:00 | lazybot | ⇒ 1 |
| 11:01 | antares_ | uvtc: links like "Clojure client for X" are for SEO purposes, buttons are the same everywhere. Links to clojars were added the next day after you suggested it to me. |
| 11:01 | kmicu | Can anyone disscuss about this https://vimeo.com/46163090 @ 16:35 and 32:15 ;)? |
| 11:01 | pzol | hi… i have a defmacro (defmacro def-check [check-name path] `(defn ~check-name [& ~'xs] (includes? xs (get-in po ~path)))) - but the po inside expands to user/po … can I prevent that so it expands to just po and not user/po ? |
| 11:02 | antares_ | I shouldn't have mentioned those "SEO purposes", now S11001001 and TimMc won't ever believe anything I say :P |
| 11:02 | wmealing | antares_, all 3 working, Brisbane, Australia. |
| 11:02 | antares_ | pzol: yes, by using po# (a local name starting with po then will be generated) |
| 11:04 | pzol | antares_ ok… now I do use(def-check origin[:origin]) but I need po to be resolved when I call it later like this: (let [po {:origin "LAX" }] (origin "LAX")) |
| 11:05 | duck1123 | pzol: Are you trying to point po to the po where the macro is defined, or where it is used? |
| 11:05 | pzol | duck1123 when it is used |
| 11:05 | antares_ | pzol: if you use po# once in the macro, within that macro you need to continue using po#. Outside of it that name will not be known. This is to prevent var shadowing. Two alternatives you have a local generated names or fully-qualified symbol names. |
| 11:07 | jballanc | quick question: what's the suggested way to set *out* to a file |
| 11:08 | jballanc | I know I can do with-open and use binding...but it seems clumsy |
| 11:08 | pzol | antares_ hmm with po# it expands too early |
| 11:09 | antares_ | jballanc: binding. If you want to do it permanently, alter-var-root. |
| 11:09 | jballanc | so there's no with-out-file? |
| 11:09 | jballanc | that's mildly dissapointing :( |
| 11:10 | TimMc | There could be in maybe 2 lines of code. :-) |
| 11:10 | jballanc | well...yes :) |
| 11:10 | duck1123 | I think for most people that want an out file, it's not that simple |
| 11:11 | jballanc | I was actually asking in regards to pr |
| 11:11 | jballanc | since pr automatically dumps to *out* |
| 11:11 | antoineB | is there a problem to make a recursive call of a macro ? |
| 11:12 | duck1123 | pzol: I could've sworn there was a way to do this and I've done it before, but I'm not finding it in my code and the repl is failing me |
| 11:12 | pzol | duck1123 :) any hints what to google for? |
| 11:13 | duck1123 | I think your best bet is if you want to use a local var in a macro, just pass that var in as one of the params |
| 11:15 | pzol | duck1123 that would spoil my dsl :) |
| 11:16 | duck1123 | you could get fancy with resolve (dynamically resolving vars in the current ns) *insert brittleness disclaimer* |
| 11:17 | llasram | pzol: Is ~'po not what you want, like you're doing with ~'xs? |
| 11:17 | llasram | (inserting obligatory note on the evils of variable capture etc) |
| 11:18 | pzol | llasram no … that would expand immediately… the macro defines a defn, I need the po to be evaluated in the context in which it is called finally |
| 11:18 | llasram | ~'po expands "immediately" to the non-namespaced symbol 'po' |
| 11:18 | clojurebot | symbols is kind of fun |
| 11:20 | llasram | &(let [po :foo] `(defn example [~'xs] [~po ~'po])) |
| 11:20 | lazybot | ⇒ (clojure.core/defn clojure.core/example [xs] [:foo po]) |
| 11:21 | llasram | pzol: What am I missing? |
| 11:21 | duck1123 | llasram: that's what I was looking for |
| 11:23 | llasram | Ah, cool |
| 11:23 | antoineB | someone can ensure me that executing a macro from another macro is impossible? |
| 11:24 | duck1123 | ,(-> 2 (->> println)) |
| 11:24 | clojurebot | 2 |
| 11:24 | duck1123 | nope |
| 11:24 | antoineB | i mean inside a defmacro |
| 11:25 | antoineB | (defmacro a [...] ... (a )...) |
| 11:25 | llasram | antoineB: You can have a macro recursively call another macro. It has exactly the same problems as normal recursive functions |
| 11:25 | llasram | Have to make sure it terminates without blowing the stack :-) |
| 11:26 | pzol | thanks will try the double macro ;) |
| 11:34 | antoineB | the idea of the macro https://gist.github.com/3164252 |
| 11:37 | TimMc | pzol: I think with-open is recursive. |
| 11:43 | antoineB | TimMc: with my meaning of "recursive macro" it is not, the call is under a `() |
| 11:45 | llasram | antoineB: When you call a macro, it applies normal macro-expansion rules, even when called recursively. So something like what you have as the 'working' version is what recursive macros usually look like |
| 11:45 | llasram | (In that the macro creates a recursive expansion, rather than recursively calling itself as part of generating expansion) |
| 11:46 | TimMc | antoineB: Just make a defn that contains most of the syntax manipulation, then call that for the recursive work. |
| 11:47 | bitpimp | just found out Puppet Labs is using Clojure |
| 11:47 | TimMc | antoineB: https://github.com/baznex/imports/blob/master/src/org/baznex/imports.clj#L166 <-- here's a macro calling a fn |
| 11:47 | llasram | bitpimp: Oh, interesting. What for? |
| 11:47 | nDuff | bitpimp: ...given as DeepakG (brownman, on IRC) is working there. |
| 11:48 | bitpimp | llasram: PuppetDB |
| 11:48 | nDuff | ...yup, that's Deepak's project. |
| 11:49 | bitpimp | github.com/puppetlabs/puppetdb |
| 11:50 | nDuff | (grimradical on github) |
| 11:50 | llasram | Interesting |
| 11:51 | bitpimp | the presenter cited clojure as one of their four languages |
| 11:52 | bitpimp | clojure for creating thousands of nodes in minutes with puppet |
| 11:56 | llasram | nDuff: OOC, why did you consider chef > puppet? I ended up going with puppet at my current job w/o having actually used either, just because Puppet's model seemed a better fit if each deployment isn't a full nuke+pave |
| 11:57 | bitpimp | well, one thing that would drive me to puppet is their 800+ person irc \ |
| 11:58 | bitpimp | that's a community |
| 12:02 | nDuff | llasram: Really? Chef's model seemed a lot saner to me for exactly that use case, and that's after extensive use of both. |
| 12:03 | nDuff | llasram: ...the persistent serverside datastore makes a huge, huge difference -- likewise the search facilities, and having a _real_ language as opposed to the awful DSL |
| 12:03 | nDuff | I always ended up writing helpers in Puppet whenever I wanted to do something exceptionally fancy, writing out a config file and executing the tool. |
| 12:03 | nDuff | Never felt the need to do that in Chef. |
| 12:04 | grim_radical | nDuff, bitpimp: indeed, we use clojure (I'm deepak from puppet labs) |
| 12:04 | grim_radical | nDuff: good to see you! |
| 12:04 | bitpimp | grim_radical: greetings |
| 12:04 | nDuff | grim_radical: Likewise! Missed you stepping in. :) |
| 12:04 | llasram | nDuff: Ah, well I haven't felt the need to do that with Puppet, whereas several of the Chef examples I read looked like basically imperative scripts assuming a fresh env each time. I must have just been looking at bad examples :-) |
| 12:05 | julienfantin | Trying to use clojure.algo.monads in clojurescript, it compiles fine but I get a runtime error saying the namespace is not defined : https://www.refheap.com/paste/3747 |
| 12:05 | nDuff | llasram: ...so, Chef scripts aren't actually imperative -- they're executed in two passes: The first sets up resources, the second compiles and executes. |
| 12:05 | llasram | nDuff: Hmm, ok. I'll have to take a closer look at it some time then. |
| 12:05 | nDuff | llasram: ...ordering is used for implicit dependency information, so deps aren't usually explicitly declared. |
| 12:05 | grim_radical | it's a bit strange feeling, as there are seriously thousands of puppetdb users at this point...though none of them know of or care about the fact that it's in clojure (as it shoud be) |
| 12:07 | nDuff | grim_radical: Nice. Our Puppet deployment here at Indeed is a bit slow-moving (we're just now moving to a JSON extlookup database... name escapes me, but it's a huge improvement over the jumble of CSV files that is the current mechanism) |
| 12:07 | nDuff | grim_radical: ...how long has that been available as a customer-visible feature? |
| 12:07 | grim_radical | nDuff: not too long...maybe 2 months? |
| 12:07 | nDuff | Heh. Not bad uptake, then. |
| 12:08 | grim_radical | i'm curious about other clojure projects (that aren't developer tools) with large, end-user deployments |
| 12:08 | kreig1 | by end user deployment you mean running on user machine? |
| 12:09 | grim_radical | kreig1: that's what i'm thinking, yeah |
| 12:09 | kreig1 | our project is in use by some very large end-users, both our SaaS and "appliance" version, but it's a small count of actual machines |
| 12:09 | grim_radical | kreig1: oh, nice! |
| 12:10 | kreig1 | it's a security tool, aimed towards the upper end of the market, so not every going to be "tons of users" |
| 12:11 | nDuff | grim_radical: ...by the way, bitpimp was just mentioning ClojureDB having been covered in a public presentation recently -- any chance that might have been you? |
| 12:12 | grim_radical | nDuff: not me...maybe someone covered it at OSCON? |
| 12:13 | grim_radical | i did get a number of people that came up to our booth at oscon that were asking about the clojure parts of it, which was neat |
| 12:13 | bitpimp | grim_radical: nope... Michael Stahnke at puppet camp chicago |
| 12:13 | kreig1 | anyone in Chicago? |
| 12:13 | grim_radical | bitpimp: ah, mike! yeah, that makes sense now |
| 12:14 | kreig1 | is there a clojure group in Chicago yet? |
| 12:14 | bitpimp | definitely |
| 12:14 | antares_ | bitpimp: puppet uses Clojure? |
| 12:14 | kreig1 | \who bitpimp |
| 12:14 | bitpimp | Bedra is here now |
| 12:14 | grim_radical | antares_: yes |
| 12:14 | kreig1 | hey, stupid pidgin! |
| 12:14 | bitpimp | antares_: yep |
| 12:14 | nDuff | Does Chicago have substantial shops using Clojure other than GroupOn? |
| 12:14 | nDuff | They were the only one I knew about, and I'm not going anywhere _near_ that business model again. |
| 12:15 | kreig1 | nDuff: we are clojure, but I just live and work in Chicago, the company is in NYC |
| 12:15 | nDuff | Hmm. |
| 12:15 | kreig1 | nDuff: there are several financial firms using it too, but not as core elements |
| 12:15 | kreig1 | nDuff: a couple lisp companies too 8) Common Lisp that is |
| 12:15 | grim_radical | kreig1: yeah, same kind of deployment for our stuff as well...a single installation of our stuff per site, but lots of different sites (< 10k deployments, nearest i can figure) |
| 12:17 | kreig1 | our clojure code is really two parts, a rule system for our malware analysists to write rules/triggers in that identify malware behavior |
| 12:17 | nDuff | ...it's on the shortlist, anyhow, along with SFO, Portland, and Seattle, but not knowing what's available there in terms of fun/interesting work has given me a bit of pause. |
| 12:17 | kreig1 | and a Noir app that provides a UI to the malware analysis and a DB of all the results (150gig+, in postgres, via Korma) |
| 12:17 | grim_radical | kreig1: ah, cool |
| 12:17 | dpritchett | grim_radical: did you ever work with Jesse W at puppet? |
| 12:17 | kreig1 | nDuff: oh, lots of fun stuff here |
| 12:18 | kreig1 | nDuff: natural language processing, CL, clojure, rails, lots of civic engagement stuff too |
| 12:18 | grim_radical | dpritchett: we technically didn't overlap in our tenures at puppet, though I was running the puppet conferences when he was there...so i believe we've had a few beers. :) |
| 12:18 | kreig1 | nDuff: here meaning chicago |
| 12:18 | nDuff | kreig1: Mmm -- encouraging to hear it. |
| 12:18 | technomancy | kreig1: do you have any special handling of DB schema changes? |
| 12:19 | dpritchett | cool! i know he likes clojure so i was surprised to see you doing some of it there, he never mentioned it |
| 12:19 | kreig1 | nDuff: if you ever want more specifi info, let me know craig@red-bean.com |
| 12:19 | grim_radical | dpritchett: this project came together fairly recently, after he left i believe. but i support all clojurians everywhere. :) |
| 12:20 | grim_radical | kreig1: yeah, my stuff is all clojure, but lots of interop with java libs (activemq, jetty, etc) |
| 12:20 | nDuff | kreig1: It'll be a bit -- we're planning on sticking around Austin for another year or so -- but I'm making a note and will hopefully be able to find it when we get nearer that point. :) |
| 12:20 | grim_radical | kreig1: also using postgres, but we use clojureql + raw sql for our database interactions |
| 12:20 | kreig1 | technomancy: well, that's kinda complicated. We have a very flat schema, no artificial keys etc. Since we have only a handful of DBs to manage, we do alot by hand, just a file that explains the changes, and we run them by hand during a maint window |
| 12:20 | technomancy | gotcha; ok |
| 12:21 | kreig1 | technomancy: however, I recently wrote little lib for running clojure code against the DB for some migrations |
| 12:21 | technomancy | I'm also favouring a light approach, but not quite so hands-off =) |
| 12:21 | technomancy | https://github.com/heroku/buildkits/blob/master/src/buildkits/db/migrate.clj |
| 12:21 | kreig1 | technomancy: when you have DBs of this size, automating is just inviting fuckage |
| 12:22 | kreig1 | technomancy; I prefer to handle them myself. Most of the automation is really to make my dev cycle easier |
| 12:23 | technomancy | I guess you can probably get away with that if you don't have schema changes on long-running branches that part of the team isn't privvy to |
| 12:23 | kreig1 | technomancy: that's even lighter than mine |
| 12:23 | grim_radical | technomancy: yeah, we do something similar to your migration code |
| 12:23 | grim_radical | only the code is uglier. :P |
| 12:23 | kreig1 | technomancy: we have an "appliance" deployment that is the most prone to getting out of sync, since we have to coord with client |
| 12:24 | kreig1 | technomancy: but that's a situation where our lead engineer runs the update |
| 12:24 | kreig1 | technomancy: it's not a "mass deployment" system, but this will change as we bring a few more appliance clients online |
| 12:24 | technomancy | yeah, seems like as long as the person running that can remain aware of all the relevant changes and the reasoning behind them you'd be all right |
| 12:25 | grim_radical | as it's end-users running my stuff, we just auto-migrate at daemon startup before we do anything else |
| 12:25 | kreig1 | technomancy: yah, and in this case, it's all written up in a document, with the sql they should run |
| 12:25 | grim_radical | we're pretty rigorous about testing that in-house before unleashing it on the world, though |
| 12:25 | kreig1 | grim_radical: we can't do that, because a migration might take a day or more |
| 12:25 | grim_radical | kreig1: ouch, yeah. :( |
| 12:25 | antoineB | i try to add my own jar inside lib/ but when i use (import 'stuff) it didn't find the class? |
| 12:26 | technomancy | I decided to completely punt on down migrations because if you're running down migrations in production you're already well into disaster-recovery and you need lots of human attention anyway |
| 12:26 | technomancy | though I suppose down migrations would also be useful for switching away from backwards-incompatible schema change branches in dev too |
| 12:26 | kreig1 | technomancy: yah, I have never downmigrated in my life, so I don't support those in my little tool |
| 12:26 | grim_radical | technomancy: yeah, me too |
| 12:27 | technomancy | antoineB: lib/ is just a cache; it's not the canonical store of dependencies |
| 12:27 | technomancy | ~repeatability |
| 12:27 | clojurebot | repeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability |
| 12:27 | technomancy | ^ antoineB might be interested in that link |
| 12:29 | kreig1 | grim_radical: we used clojureql at first, but switched to korma because I found it easier to compose queries |
| 12:29 | grim_radical | kreig1: heh, we actually did the opposite. :) |
| 12:29 | grim_radical | i think that at the time (~5 months ago?) korma couldn't handle some of the aspects of our schema |
| 12:30 | kreig1 | grim_radical: our data model is complicated, it's both data warehousing (highly variable views into huge data) with a view specific views/queries that hit a fuckton of data |
| 12:30 | grim_radical | we use lots of composite keys and a slew of postgres-specific features |
| 12:30 | kreig1 | grim_radical: I never touch the entity shit |
| 12:30 | grim_radical | ahh |
| 12:30 | kreig1 | grim_radical: so compound keys are no prob |
| 12:31 | grim_radical | re-evaluation of korma is something that's on my roadmap (as clojureql is kind of dormant, i suppose) but haven't gotten around to it yet |
| 12:31 | kreig1 | instead I have funcs like "ensure-joined" |
| 12:33 | kreig1 | I break query composition down into a couple steps |
| 12:33 | kreig1 | joins, conditionals, project/field selection |
| 12:34 | kreig1 | our query tools are built on top of those three phases |
| 12:35 | kreig1 | same artial query can then be used for getting my results, or doing a count on some distinct field |
| 12:47 | grc | emacs/slime question: I had clojure-jack-in working fine till recently on OSX. Following a possibly related ports update clojure-jack-in fails with open-network-stream: make client process failed. Any suggestions on working out what's broken and how to fix? |
| 12:49 | alex_baranosky | I'm seeing some weird behavior I don't understand, and could use some help |
| 12:50 | alex_baranosky | I have a test that if you give a function a particular route, then it parses out the params and also return the given handler function |
| 12:51 | alex_baranosky | I've tested like 50 routes, and most of them pass fine, but a handful seem to be making new instances of the function each time, so they aren't technically equal |
| 12:51 | hiredman | :( |
| 12:51 | alex_baranosky | at least one of the culprits i sa simple defn'ed fn |
| 12:52 | hiredman | don't use = on functions |
| 12:52 | alex_baranosky | so it isn't like it is being generated each time through |
| 12:53 | alex_baranosky | @hiredman, what's the alternative if I want to test that the 'right' function gets returned, and calling those functions is a bit unpleasant? |
| 12:54 | hiredman | alex_baranosky: don't do that |
| 12:54 | alex_baranosky | ha, classic |
| 12:54 | technomancy | hiredman: are you referring to the way he's testing or the way he's tweeting on IRC? |
| 12:55 | hiredman | technomancy: the testing, but the tweeting on irc is also annoying |
| 12:56 | duck1123 | alex_baranosky: Is it possible for you to pass around and compare the vars that point to the fns? |
| 12:56 | technomancy | hiredman@thelastcitadel.com: gotcha |
| 12:57 | alex_baranosky | I was thinking that I could try that |
| 12:58 | grc | hmm a bit more digging : lein swank kicks off a swank server that is not listening on localhost, but my public IPv4 address instead. Is this configurable anywhere? |
| 12:58 | kreig1 | grc: woah |
| 12:58 | grc | still at least I've got it working again, albeit without defauts |
| 12:58 | technomancy | grc: that must be a very old version of swank |
| 12:59 | grc | technomancy: I won't argue but the laptops only 3 months old.. where have I screwed up? (semi-rhetorical) |
| 13:00 | technomancy | depends on how you installed it |
| 13:00 | duck1123 | grc: Are you specifying swank-clojure in your project, or plugins? What version? |
| 13:01 | grc | duck1123: :plugins [[lein-swank "1.4.4"]]) |
| 13:01 | hiredman | win 15 |
| 13:04 | grc | and lein version gives 2.0.0-preview6 |
| 13:05 | duck1123 | trying to define a map like {"foo" {"bar" {"baz" "quux"}}} in java makes me realize how spoiled I've been by Clojure |
| 13:06 | gtrak | duck1123: pain |
| 13:07 | gtrak | Map<String,Map<String,Map<String,String>>> map = new HashMap<String,Map<String,Map<String,String>>>() |
| 13:07 | duck1123 | gtrak: yep, that's the line |
| 13:08 | gtrak | then you have to recursively put in the inner ones |
| 13:09 | gtrak | generally you'd just use objects instead |
| 13:19 | zerokarmaleft | grc: i'd double check to see if you have old versions of lein-swank hanging around in ~/.m2 |
| 13:40 | technomancy | curious: how many emacs users are still on 23? |
| 13:40 | Bronsa | o/ |
| 13:41 | technomancy | nDuff: yeah, but it's been stable for years |
| 13:41 | Bronsa | that, plus i dont want to touch my conf anymore |
| 13:41 | uvtc | `apt-cache search emacs24` gives me results on Xubuntu 12.04. |
| 13:41 | nDuff | technomancy: ...sure, but there are people (myself included) who prefer to stick with vendor-supported environments |
| 13:41 | kreig1 | I'm running 24.1.1 on arch |
| 13:42 | nDuff | uvtc: I'm surprised -- on current Mint, I had to install it through a PPA. |
| 13:42 | technomancy | nDuff: yeah, understandable. I feel that way about everything except emacs =) |
| 13:42 | uvtc | nDuff: I've currently got it installed via the PPA. Just noticed that apt-cache can get an emacs24 today, actually. |
| 13:43 | kreig1 | 23.4.1 on openbsd 5.1 8) |
| 13:43 | nDuff | uvtc: apt-cache shows PPA contents when they're added. |
| 13:43 | nDuff | uvtc: ...so that's actually _not_ an indication that it's upstream. |
| 13:43 | technomancy | I've required 24 for the starter kit for over a year |
| 13:44 | uvtc | nDuff: Hm. Well, I previously had to install emacs-snapshot. Now I'm seeing emacs24 available ... I don't think it was listed there before (in the output of apt-cache search). |
| 13:44 | nDuff | uvtc: Right -- that was recently added _to the PPA_. |
| 13:44 | technomancy | nrepl.el currently requires it |
| 13:44 | uvtc | nDuff: Ah. Thanks. |
| 13:44 | technomancy | given that people still on 23 can continue using slime we'll probably leave it that way |
| 13:45 | technomancy | because supporting 23 means giving up closures and partial application, which is a huge pain in the neck |
| 13:45 | nDuff | Oooh. How's nrepl.el coming in terms of competitiveness with slime? |
| 13:45 | technomancy | nDuff: catching up. |
| 13:45 | nDuff | Nice. |
| 13:46 | technomancy | the stack trace handling hasn't been merged yet; that's probably the main thing keeping me from telling everyone to use it |
| 13:48 | technomancy | I have a branch that lets you browse namespaces like ido-find-file, which you can't do in slime =) |
| 13:48 | cemerick | technomancy: I'm thinking of adding a :pprint option to the eval middleware. Any objections? |
| 13:48 | technomancy | cemerick: sounds reasonable |
| 13:49 | cemerick | The same could theoretically be accomplished via session-local middlewares, but that's a recursive rabbit hole that I'm not ready to tackle. |
| 13:49 | technomancy | do you have to have commit rights to be able to tag issues in github? |
| 13:50 | cemerick | probably |
| 13:50 | amalloy | technomancy: yes |
| 13:50 | technomancy | lame |
| 13:50 | amalloy | i thought you'd discovered and complained about this before |
| 13:51 | amalloy | someone else, i guess |
| 13:51 | dpritchett | Don't you remember the DongML zedshaw drama? |
| 13:51 | technomancy | I keep having to hold myself back from tagging these nrepl issues |
| 13:51 | cemerick | Nothing keeps one from complaining about the same thing multiple times. |
| 13:51 | amalloy | cemerick: no, but i was surprised he discovered it multiple times :P |
| 13:52 | cemerick | technomancy: there aren't any nrepl issues on github…? |
| 13:52 | technomancy | cemerick: sorry, nrepl.el |
| 13:52 | cemerick | ah, right |
| 13:53 | amalloy | duck1123, gtrak: fwiw, java 7 cuts the nonsense on that line in half. still pretty unpleasant, but not as bad |
| 13:53 | TimMc | amalloy: What, typedefs? |
| 13:53 | TimMc | Or inferred generic types? |
| 13:54 | gtrak | TimMc: diamond operator, yea |
| 13:54 | amalloy | haha what, typedefs? |
| 13:55 | TimMc | I can hope, can't I? :-) |
| 13:55 | gtrak | re: typedefs, I would say 'if only', but I've actually used C++ |
| 13:56 | nDuff | gtrak: Yes, but C++ ruins _lots_ of things that can be good if implemented better. |
| 13:56 | gtrak | nDuff: pretty sure most of us are in a similar camp on that here |
| 13:57 | gtrak | I would venture to say it's 'mutiple inheritance? why are you inheriting in the first place?' |
| 13:57 | emezeske_ | Bah, multiple inheritence is fine in C++, just don't do it with non-abstract classes and you're fine |
| 13:57 | Hodapp | nDuff: you'll receive no flaming from me on that. |
| 13:57 | emezeske_ | If you inherit from two concrete classes, well, you reap what you sowed |
| 13:59 | gtrak | or 'you should treat your inheritance hierarchies as data' |
| 13:59 | nDuff | Eh. MI _can_ be sane -- see Clojure's approach, disallowing use in any ambiguous case but providing a method to manually establish precedence. |
| 13:59 | Hodapp | It just continues to baffle me how much the C++ devs around me will say that any given feature of Clojure (or Erlang, or Scala, or Lisp, or whatever) is completely academic and of no real usefulness, and shortly thereafter they will implement an ad-hoc, clunky version of that feature. |
| 14:00 | nDuff | I've actually been pretty impressed with how well the C3 MRO tracks my own intent -- it's historically been pretty much a DWIM thing for me. |
| 14:00 | nDuff | Hodapp: Heh. |
| 14:00 | Hodapp | and they will never make the connection between the two things. |
| 14:01 | Hodapp | Simple example: They'll write classes like RayTriangleIntersector with methods like 'setTriangle', and they'll never grasp that this is basically just writing an entire class to wrap a single function and perform currying or partial eval on it. |
| 14:02 | Hodapp | they've just turned something stateless into something stateful, something simple into something complex, and made optimization that much more difficult. |
| 14:02 | nDuff | Hodapp: May I quote you? |
| 14:03 | Hodapp | er, sure |
| 14:03 | Hodapp | what did I quotably say? |
| 14:04 | nDuff | Heh -- the 3-line rant as a whole, I think, puts things well. |
| 14:05 | Hodapp | fair enough |
| 14:05 | Hodapp | Have you heard of Greenspun's Tenth Rule? He put it more concisely, I think. |
| 14:06 | TimMc | " Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp. |
| 14:06 | TimMc | " |
| 14:06 | Hodapp | ...including Common Lisp. |
| 14:07 | gtrak | this is the joke of clojure and java |
| 14:07 | clojurebot | In Ordnung |
| 14:07 | Hodapp | gtrak: bah? |
| 14:07 | TimMc | clojurebot: forget this |is| the joke of clojure and java |
| 14:07 | clojurebot | I forgot that this is the joke of clojure and java |
| 14:08 | gtrak | oh oops, java has some metaprogramming... let's use it to build a lisp :-) |
| 14:08 | gtrak | jvm/java's a sufficiently complicated C program |
| 14:08 | Hodapp | I have also been reading about Aspect Oriented Programming with some curiosity |
| 14:08 | TimMc | TCons<String,TCons<String,TCons<Double,TNil>>> for a 3-tuple :-P |
| 14:14 | SegFaultAX|work2 | What does the :let key do in a doseq expression? |
| 14:15 | emezeske | SegFaultAX|work2: (doseq [... :let [...]] ...) -> (doseq [...] (let [...] ...)) |
| 14:15 | emezeske | SegFaultAX|work2: It basically just gives you a let while avoiding one level of indentation |
| 14:19 | uvtc | Oh, interesting. :let is mentioned in the docs for `for`, but it appears you can use :let anywhere you've got a `let` binding vector. |
| 14:20 | uvtc | Hm. Doesn't work for `dotimes` for me though ... |
| 14:20 | uvtc | &(dotimes [i 10 :let [j (* i i)]] (println j)) |
| 14:20 | lazybot | java.lang.IllegalArgumentException: dotimes requires exactly 2 forms in binding vector in clojure.core:1 |
| 14:21 | uvtc | whereas |
| 14:21 | uvtc | &(doseq [i (range 10) :let [j (* i i)]] (println j)) |
| 14:21 | lazybot | ⇒ 0 1 4 9 16 25 36 49 64 81 nil |
| 14:25 | amalloy | uvtc: doseq is the same as for; other functions are not |
| 14:26 | uvtc | amalloy: Ah, the docs for `doseq` even say, "with bindings and filtering as provided by "for". |
| 14:26 | uvtc | " |
| 14:26 | amalloy | emezeske: it's more than that, really, because you can put more seqs and/or :while/:when tests after your :let |
| 14:27 | amalloy | doesn't matter so much in 'doseq, but in 'for you need that to prevent adding an element to the output seq |
| 14:27 | amalloy | (or to keep it flat, or whatever) |
| 14:28 | emezeske | amalloy: Wow, I did not know you could do that |
| 14:29 | emezeske | amalloy: Speaking of, is that documented decently anywhere? Every time I try to look at the docs for e.g. (for) I am disappointed |
| 14:29 | amalloy | eh? for shows you a two-element iteration with a :when and a :while test. what more do you want? |
| 14:31 | emezeske | I... I swear that wasn't there before |
| 14:31 | amalloy | dnolen: i don't quite understand what i need to do to get the compiler to do primitive arithmetic for me. i have (set! *unchecked-math* true), and my deftype has a primitive-long field named 'start, but (inc start) compiles as a call to clojure.lang.Numbers.unchecked_inc:(J)J |
| 14:31 | amalloy | emezeske: since at least clojure 1.2, sorry man |
| 14:32 | amalloy | maybe you were disappointed because you were actually looking at the docs for < |
| 14:32 | emezeske | amalloy: I just, I have no idea what's going on anymore |
| 14:32 | hiredman | amalloy: uncheked_inc may not have an instrinsic |
| 14:32 | amalloy | hiredman: i hadn't checked that yet, but looking now i do see one |
| 14:32 | amalloy | "public static long clojure.lang.Numbers.unchecked_inc(long)", oa(LCONST_1, LADD) |
| 14:33 | hiredman | yeah, I just looked and see it too |
| 14:33 | augustl | is it possible to make leiningen use ~/.m2/settings.xml for deploy repository credentials? |
| 14:33 | hiredman | amalloy: interesting, what is the context for the call to inc? |
| 14:33 | augustl | I already have my auth details there, would be nice if I didn't need to copy it into ~/.lein |
| 14:34 | amalloy | hiredman: https://gist.github.com/3165282 |
| 14:36 | amalloy | relevant section of the disassembly: https://gist.github.com/3165293 |
| 14:37 | hiredman | amalloy: the intrinsic stuff actually emits both paths, with a guard and jmp to the correct path |
| 14:38 | amalloy | what would it guard? the object on the stack is already a primitive long, not an Object; there's nothing to check |
| 14:39 | amalloy | either way, i've updated https://gist.github.com/3165293 with the whole disassembly if that's helpful; pop() is at line 460 |
| 14:39 | hiredman | ah, sorry, I am mistaken, I was looking at the "intrinsic predicate" stuff, which is not relevant |
| 14:43 | dnolen | amalloy: hmm, what's the output for prim fns that take long? |
| 14:43 | amalloy | i don't understand the question, dnolen |
| 14:43 | dnolen | amalloy: what I mean what does inc look like when it's taking a long from within a prim fn. |
| 14:44 | amalloy | you mean like, what does (defn f ^long [^long i] (inc i)) compile to? |
| 14:44 | dnolen | amalloy: yes |
| 14:44 | hiredman | amalloy: interestingly it looks like the compiler only uses intrinsics for ifs |
| 14:45 | hiredman | so the call to clojure.lang.Numbers.unchecked_inc is as close as you'll get |
| 14:45 | amalloy | dnolen: it uses ladd |
| 14:46 | hiredman | :| |
| 14:46 | hiredman | maybe I am looking at the wrong version of the compiler |
| 14:46 | amalloy | hiredman: i'm using 1.4.0 release, fwiw. dnolen: https://gist.github.com/3165351 |
| 14:47 | _zach | is there a clojure-py equivalent to python's "if __NAME__ == '__MAIN__'"? |
| 14:47 | _zach | except lowercase |
| 14:47 | hiredman | pffft, emacs opened Compiler.java.orig when I wasn't looking |
| 14:48 | dnolen | amalloy: hmm what happens you move those math ops into a helper prim fn that takes long? |
| 14:48 | amalloy | hiredman: i think ido-mode will do that if you C-x C-f while Compiler.java is open - it's biased away from already-open buffers |
| 14:49 | technomancy | _zach: sure, (defn -main [& args] [...]) |
| 14:49 | amalloy | dnolen: it compiles to an invokePrim of the helper |
| 14:50 | hiredman | amalloy: it is because one of the ops there is boxing |
| 14:51 | hiredman | count |
| 14:51 | hiredman | (long (count ...)) might fix it |
| 14:51 | amalloy | oh, that makes sense. like, mod doesn't have a primitive version? |
| 14:52 | _zach | technomancy: Ah, didn't know that was implemented. Thanks. |
| 14:52 | technomancy | _zach: probably worth reading through `lein help tutorial` at some point; explains all that stuff. |
| 14:52 | hiredman | amalloy: ah, yeah, maybe mod |
| 14:53 | _zach | technomancy: Ah, I see -- I was talking about clojure-py, not jvm. |
| 14:53 | technomancy | oh, no idea |
| 14:53 | _zach | technomancy: Thanks though :) |
| 14:53 | technomancy | misread |
| 14:53 | hiredman | must be mod, mod is a regular clojure function |
| 14:54 | amalloy | yeah, that's it |
| 14:55 | amalloy | if i switch mod to +, it uses primitives |
| 14:55 | amalloy | i'm a bit sad it doesn't at least do the inc with primitives first, before boxing up for mod |
| 14:56 | hiredman | it is interesting, a sort of inverted flow of control |
| 14:57 | hiredman | depending on what kind of args the compiler can tell x takes in the expression (x y z), y and z will be emitted differently |
| 14:57 | hiredman | it may do what you want if you hoist the bits out as a let |
| 14:58 | SegFaultAX|work2 | emezeske: Seems kinda pointless. |
| 14:58 | amalloy | it probably will |
| 14:59 | amalloy | aha, but rem *does* have an intrinsic |
| 14:59 | amalloy | and i don't care whether i use mod or rem |
| 14:59 | dnolen | amalloy: still, seems a bit strange to me. |
| 15:00 | amalloy | dnolen: agreed it could manifest a bit less mysteriously, but the end behavior makes sense eventually |
| 15:02 | ro_st | technomancy: how tough is it to run some additional clojure code when swank-clojure handles "load buffer" and "compile buffer"? |
| 15:02 | ro_st | emezeske, lynaghk: i'm the guy from the cljsbuild issue about cljx |
| 15:02 | amalloy | yeah, with rem instead of mod it does all the math in primitives, converting (count buf) from an int to a long first |
| 15:03 | technomancy | ro_st: I don't think it'd be that difficult, but swank-clojure is essentially unmaintained at present |
| 15:03 | ro_st | but it's actively used, right? i'm not the only one? :) |
| 15:04 | ro_st | i'm investigating the possibility of teaching it how to use cljx https://github.com/lynaghk/cljx |
| 15:04 | technomancy | yeah, it's very widespread |
| 15:04 | hiredman | I am thinking about writing up a proposal for reflection object inline caching, I have the branch (which mostly works) and I updated it to the latest master, but clojure/core would go all ಠ_ಠ if I just handed them a branch |
| 15:04 | technomancy | ro_st: I would recommend doing it on top of nrepl so other editors can benefit from it too |
| 15:04 | ro_st | so that i can continue to use all the toys properly (tight emacs repl integration and stuff like midje-mode) but produce cljs from that code |
| 15:05 | ro_st | does lein swank start up an nrepl? |
| 15:05 | technomancy | ro_st: no, you can use regular `lein repl` |
| 15:05 | technomancy | then use https://github.com/kingtim/nrepl.el as a client |
| 15:06 | ro_st | um, ok so this is an area where i'm still weak. i've been using clojure-jack-in |
| 15:06 | technomancy | yeah, it's still a bit behind swank, but improving very quickly |
| 15:06 | ro_st | ooh |
| 15:06 | technomancy | once a couple more features make it in we'll make a wider announcement and get more people using it |
| 15:07 | ro_st | so this is intended to be a successor to swank-clojure? |
| 15:07 | technomancy | yeah |
| 15:07 | technomancy | you can already use M-x nrepl-jack-in to get started |
| 15:08 | technomancy | if you use the "stacktraces" branch it's fairly usable |
| 15:08 | technomancy | see https://github.com/kingtim/nrepl.el/issues?state=open for a list of what's still missing |
| 15:08 | ro_st | it looks like it supports all the stuff i use |
| 15:08 | ro_st | ahh completion. i actually don't use it as much as i could |
| 15:09 | ro_st | still haven't learned to use tab instead of enter to accept completion and so i end up typing it out |
| 15:09 | technomancy | heh |
| 15:09 | technomancy | I think what you want could be implemented as an nrepl middleware |
| 15:09 | ro_st | jump-to-def, doc-lookup, and the various ways to compile and eval are critical |
| 15:10 | ro_st | um, so, back to cljx; does this project have awareness of the active buffer's project.clj? |
| 15:11 | ro_st | so would i be able to read it in and invoke lein plugins and so on? |
| 15:13 | ro_st | this tool looks great. i'm probably going to stay away for now; can't lose productivity at the mo |
| 15:15 | ro_st | debug repl looks super handy |
| 15:15 | technomancy | debug repl hasn't been ported to nrepl yet |
| 15:15 | technomancy | still on the TODOs |
| 15:16 | ro_st | it looks like it's going to be a great toolset once you've achieved your TODOs |
| 15:16 | technomancy | but yeah, the default launch for nrepl goes through leiningen, so it knows all about the project structure |
| 15:16 | ro_st | i guess the primary reason is to use nREPL instead of whatever the current one uses? |
| 15:17 | ro_st | that's great. it should be possible to have the lein cljx plugin provide hooks to this tool to run whenever considering forms from it for compilation? |
| 15:18 | ro_st | does swank-clojure support reloading? |
| 15:18 | emezeske | ro_st: Ah, cool, I did not connect you two as one person :) |
| 15:18 | ro_st | obliterating and reloading an NS? |
| 15:18 | ro_st | emezeske: :) |
| 15:18 | ro_st | RObert STuttaford |
| 15:19 | emezeske | Aha! |
| 15:19 | ro_st | awesome productivity beyond what i enjoy is tantalizingly close :-) looks like i need to be patient, though. and duplicate all my enlive templates. |
| 15:20 | llasram | ro_st: slime-compile-and-load-file will re-evaluate all the forms in the active file, but won't obliterate the NS first... There may be a way to do it when you really need a fresh base, but I always just end up evaling (remove-ns (symbol (str *ns*))) in the REPL |
| 15:20 | ro_st | ahh that's a great tip. i reboot my entire repl at the moment |
| 15:21 | ro_st | technomancy: what would jump-to-resource do? (on your nrepl.el todo list) |
| 15:23 | ro_st | i'm guessing paredit continues to work just fine with nrepl.el |
| 15:44 | dgrnbrg | is there a way to get lein2 to respect my http_proxy? |
| 15:44 | dgrnbrg | i am behind an ntlm proxy, and i've got cntlm ready to traverse the ntlm proxy, but i can't get lein2 to bootstrap itself |
| 15:50 | dgrnbrg | I am using lein2, but it doesn't seem to be using my http_proxy variable, since i'm not seeing hits on the proxy i listed there |
| 15:52 | pipeline | dryman: -Dhttp.proxyHost |
| 15:53 | pppaul | anyone here use joodoo? |
| 15:56 | dnolen | dgrnbrg: side note, did you get my message about core.logic? |
| 15:56 | dgrnbrg | dnolen: I did, and i looked through it, but i haven't had a chance to run it |
| 15:57 | dgrnbrg | does that capture the tree of interest? |
| 15:57 | dgrnbrg | it's great you didn't need to use mutation to capture that information |
| 15:57 | dgrnbrg | also, i think i have a simple heuristic that should make for an effective planner |
| 15:58 | dgrnbrg | i haven't looked at jim's code, but i imagine they could be combined |
| 15:58 | ro_st | dnolen: *bow* thank you for your awesome work on cljs. much appreciated. |
| 15:59 | technomancy | ro_st: C-c C-l in slime forces a full reload |
| 15:59 | technomancy | jump-to-resource would just find the given file on the classpath and open it in emacs |
| 16:00 | ro_st | ok great, i wasn't sure |
| 16:00 | technomancy | someone told me I should store all my SQL in resources/ and I thought that sounded absolutely horrid |
| 16:00 | technomancy | but if I had a jump-to-resource command it wouldn't be so bad |
| 16:00 | dgrnbrg | pipeline: i am passing -Dhttp.proxyHost and -Dhttp.proxyPort to leiningen, but it isn't hitting the proxy i'm telling it about |
| 16:00 | ro_st | what, .sql files? |
| 16:00 | pipeline | now that is interesting dgrnbrg |
| 16:01 | dgrnbrg | pipeline: I have done this: |
| 16:01 | pipeline | dgrnbrg: it looks to me on my system that lein is a wrapper script... so instead of passing your -Ds, add them to JAVA_OPTS environment variable? |
| 16:01 | dgrnbrg | export LEIN_JVM_OPTS="-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128" |
| 16:01 | clojurebot | Gabh mo leithsc?al? |
| 16:01 | dgrnbrg | then I run leiningen |
| 16:02 | technomancy | ro_st: yeah |
| 16:02 | pipeline | dryman: try socks port instead ? |
| 16:02 | pipeline | dgrnbrg: rather |
| 16:02 | dgrnbrg | and I'm also using cntlm, which i've successfully tested w/ wget |
| 16:02 | pipeline | and failing all else: tsocks |
| 16:02 | Raynes | technomancy: How is stacktraces coming along in nrepl.el? |
| 16:03 | Raynes | I've mostly seen "I'm implemented half of it, but realized it is totally wrong." |
| 16:04 | dgrnbrg | pipeline: I opened the socks proxy, and used the same -D options to lein, but it still didn't work or even get hit |
| 16:06 | technomancy | Raynes: yeah, kingtim has a branch where he fixed all the issues |
| 16:06 | dgrnbrg | cemerick, technomancy: does pomegranate respect -Dhttp.proxyHost and -Dhttp.proxyPort in the latest lein2? Is there any debugging for how lein is connecting to the outside available? |
| 16:06 | Raynes | technomancy: So there is a branch of stacktraces? |
| 16:06 | technomancy | Raynes: there's still a bug preventing colorized stack traces |
| 16:06 | Raynes | Oh I could care less. |
| 16:06 | technomancy | but regular clj-stacktrace.repl/pst works |
| 16:06 | Raynes | I just want a damn stack trace. |
| 16:06 | technomancy | try his stacktrace branch |
| 16:06 | Raynes | That's literally all that is keeping me from nrepl.el. |
| 16:06 | Raynes | Awesome will do, dood. |
| 16:07 | technomancy | dgrnbrg: lein sets those properties from environment variables and values in project.clj IIRC |
| 16:07 | dgrnbrg | technomancy: i'm not seeing lein pick them up, though :( |
| 16:08 | Raynes | technomancy: I want ALL the branches! |
| 16:09 | Raynes | Except for yours, since it makes everything not work anymore. :( |
| 16:10 | technomancy | Raynes: I think I've found the bug that's causing that |
| 16:10 | Raynes | Cool! |
| 16:11 | Raynes | Are you my daddy? I wish you were my daddy. |
| 16:11 | technomancy | dgrnbrg: I think it's supposed to be http.proxy as a URL? |
| 16:11 | technomancy | I've never used a proxy before but I seem to recall it that way |
| 16:11 | technomancy | Raynes: well I have no idea what the fix is |
| 16:12 | cemerick | dgrnbrg: Leiningen looks for an http_proxy env var though, and passes that along. |
| 16:12 | Raynes | amalloy can appreciate. |
| 16:12 | Raynes | technomancy: Luckily you and I have different priorities and I couldn't care less about ido var selection. |
| 16:13 | cemerick | http_proxy seems odd to me, but maybe that's typical for these sorts of things. |
| 16:13 | technomancy | Raynes: it's affecting completion and doc lookup too though |
| 16:13 | technomancy | same bug |
| 16:13 | Raynes | technomancy: What is the bug? |
| 16:14 | dgrnbrg | I have the proxy as localhost b/c we use a weird M$ proxy that i need to use an adapter to traverse |
| 16:14 | pipeline | tsocks + ssh -D |
| 16:14 | pipeline | all you ever need |
| 16:14 | technomancy | Raynes: nrepl-buffer-ns gets set to "user" in a lot of cases where |
| 16:14 | technomancy | s/where// |
| 16:15 | technomancy | Raynes: probably another bug that causes nrepl-current-ns to return bogus values on your machine but not mine |
| 16:15 | technomancy | and the first bug affects my machine and not yours |
| 16:15 | technomancy | ro_st: doesn't need documentation actually |
| 16:15 | technomancy | just uses :arglists metadata |
| 16:15 | ro_st | it rocks |
| 16:16 | ro_st | i've been triggering and waiting for ac-completion to give me a doc-popup |-( |
| 16:16 | technomancy | yeah, supposedly kingtim is working on porting that to nrepl.el; can't wait |
| 16:16 | dgrnbrg | pipeline: i don't understand where ssh fits in |
| 16:16 | pipeline | dgrnbrg: ssh will set up a SOCKS4 proxy for you; tsocks will coerce non-SOCKS-aware apps into using it |
| 16:16 | dgrnbrg | pipeline: i can't even ssh out |
| 16:16 | dgrnbrg | i can only use ntlm |
| 16:18 | llasram | dgrnbrg: :-( |
| 16:18 | dgrnbrg | So, I have cntlm working w/ wget |
| 16:19 | ro_st | weird that string/split uses s re and re-* use re s |
| 16:19 | dgrnbrg | but then lein2 doesn't seem to pick up the http_proxy |
| 16:20 | technomancy | the proxy stuff certainly isn't widely used; it could have issues with the implementation |
| 16:20 | Raynes | technomancy: Stacktraces branch works. |
| 16:20 | dgrnbrg | technomancy: which files does it live it? |
| 16:20 | Raynes | technomancy: Should I report this working or something? |
| 16:20 | dgrnbrg | i'll happily debug and try to give a patch |
| 16:22 | technomancy | dgrnbrg: looks like get-proxy-settings is defined in leiningen-core/src/leiningen/core/classpath.clj |
| 16:22 | technomancy | Raynes: sure; there's an open issue for it |
| 16:24 | ro_st | is there a fancy-schmancy method for interleaving two vectors together, like a zipper on clothing? |
| 16:24 | cmcbride | Im using korma to connect to a mysql database. The datetimes are stored in EST (not my choice). It seems like the JDBC driver/or korma is converting the time into UTC. Is there anyway to stop this from happening? |
| 16:25 | Raynes | &(doc interleave) |
| 16:25 | lazybot | ⇒ "([c1 c2] [c1 c2 & colls]); Returns a lazy seq of the first item in each coll, then the second etc." |
| 16:25 | technomancy | ro_st: see also mapcat vector |
| 16:25 | ro_st | interleave. of course |
| 16:25 | Raynes | &(interleave [1 2 3] [4 5 6]) |
| 16:25 | lazybot | ⇒ (1 4 2 5 3 6) |
| 16:25 | technomancy | but I guess interleave is better |
| 16:25 | TimMc | &(mapcat vector [:a :b :c] (range 5)) ;; if you're |
| 16:25 | lazybot | ⇒ (:a 0 :b 1 :c 2) |
| 16:25 | TimMc | ugh, technomancy! |
| 16:25 | TimMc | you sniper |
| 16:25 | Raynes | Pretty sure I won. |
| 16:25 | ro_st | (inc Raynes) |
| 16:25 | lazybot | ⇒ 14 |
| 16:25 | ro_st | :) |
| 16:25 | technomancy | I wonder if interleave is faster |
| 16:26 | Raynes | &(time (interleave (range 1000000) (range 2000000))) ;; Accurate benchmark! |
| 16:26 | lazybot | Execution Timed Out! |
| 16:27 | technomancy | Raynes: I saw the actual message at the bottom of the stacktrace buffer a few times; were you seeing this at all? |
| 16:28 | Raynes | technomancy: Not yet. |
| 16:28 | technomancy | ok, I haven't seen it since the first few times I ran it, so I could have been seeing some stale state |
| 16:29 | technomancy | Raynes: the only thing I'd consider blocking from wider release is that it activates for all buffers rather than just buffers inside the given project |
| 16:30 | ro_st | ,(re-seq #"(#[^#]+#)" "#template# #user#") |
| 16:30 | Raynes | technomancy: What is our attack plan for getting people to use nrepl.el over SLIME. In particular, new people, which is where it will be most important. |
| 16:30 | clojurebot | (["#template#" "#template#"] ["#user#" "#user#"]) |
| 16:30 | ro_st | why the duplication? |
| 16:30 | Raynes | Obviously if people want to use SLIME, they can continue to do so, but I think new people should most definitely at least start with nrepl.el. |
| 16:30 | Raynes | It'll be the sanest thing around. |
| 16:30 | kreig1 | emacs and nrepl? |
| 16:31 | ro_st | Raynes: great getting started dox. screencasts. |
| 16:31 | technomancy | Raynes: first I'll make an announcement on the swank-clojure mailing list |
| 16:31 | ro_st | clojurescriptone.com is a great example to follow |
| 16:31 | TimMc | ,(re-seq #"#[^#]+#" "#template# #user#") |
| 16:31 | clojurebot | ("#template#" "#user#") |
| 16:31 | ro_st | certainly hooked me. |
| 16:31 | cmcbride | Hey I was just wondering if anyone happened to notice my korma question |
| 16:31 | ro_st | cmcbride: does vanilla jdbc do the same thing? |
| 16:32 | ro_st | korma is just a dsl for generating sql. once that's done, it hands it off to your driver to query |
| 16:32 | hiredman | cemerick: is there an nrepl middleware for compiling clojurescript yet? like himera or whatever over nrepl |
| 16:32 | ro_st | tx TimMc |
| 16:32 | cmcbride | ro_st: Im not sure, Ive never used jdbc outside of korma. |
| 16:32 | cemerick | hiredman: not that I know of; plugging the bits together should be straightforward though. |
| 16:32 | kreig1 | cmcbride: http://stackoverflow.com/questions/7605953/how-to-change-mysql-timezone-in-java-connection |
| 16:32 | kreig1 | cmcbride: that may help |
| 16:33 | technomancy | ro_st: screencasts would be great; are you volunteering? =) |
| 16:33 | Raynes | Meh @ clojurescriptone. |
| 16:33 | ro_st | technomancy: as long as someone else narrates |
| 16:33 | ro_st | i sound like edmund jackson |
| 16:33 | hiredman | cemerick: just trying to avoid writing one |
| 16:33 | Raynes | I still don't really understand what clojurescript one is or its purpose, and its buzzwordy name doesn't give anything away. |
| 16:33 | cemerick | 1. {:op "cljs-compile" :code "…"} 2. return js 3. profit. |
| 16:33 | ro_st | Raynes: ignore it. i'm talking about its presentation |
| 16:34 | hiredman | yeah, but you have to name the thing |
| 16:34 | TimMc | ro_st: If you put in more capturing groups, you'll see what the repetition is about. |
| 16:34 | SegFaultAX|work2 | Is korma decent? |
| 16:34 | technomancy | ro_st: a british accent would be exactly the thing |
| 16:34 | hiredman | (and figure out how to call the cljs compiler) |
| 16:35 | cemerick | hiredman: who, me? :-P |
| 16:35 | cemerick | I've been kicking the cljs can down the road for a while now, but won't be able to continue for much longer. |
| 16:35 | kingtim | technomancy, Raynes: did you see my stacktrace fixes? |
| 16:35 | ro_st | Raynes: my point is you gotta sell it a little. if peeps see it in action, and why all the stuff you're doing is useful, it'll give them the strength they need to grok emacs |
| 16:35 | TimMc | ,(re-seq #"(1)2(3)" "01234") |
| 16:35 | clojurebot | (["123" "1" "3"]) |
| 16:35 | hiredman | well who ever |
| 16:35 | technomancy | kingtim: yeah, looking great |
| 16:35 | ro_st | technomancy: south african, actually :-) |
| 16:35 | kreig1 | korma is pretty awesome IMO, and I've written two ORMs, used many more including WebObjects/EOF, ActiveRecord, DataMapper, Hibernate etc.. |
| 16:35 | technomancy | kingtim: I'm still affected by the nrepl-buffer-ns bug, but that's a separate issue |
| 16:36 | ro_st | SegFaultAX|work2: korma works beautifully. doesn't pretend to be an orm. just clean sql generaton in clojure. |
| 16:36 | technomancy | kingtim: also, the "blowing-chunks" branch fixes that other issue with clojail |
| 16:36 | kingtim | technomancy: i have been looking at that, I think I have some suggestions that may help |
| 16:36 | hiredman | I am playing with this dashboard thing (neat charts generated via incater) but it would be nice to make it more interactive by embedding a clojurescript repl, and doing chart generation via jquery or something |
| 16:36 | kreig1 | SegFaultAX|work2: I never use the "entity" stuff in Korma, just like ro_st said, it's functional sql generation |
| 16:36 | kingtim | technomancy: cool, i will get those merged in this evening |
| 16:36 | SegFaultAX|work2 | ro_st: That's really all I want. A DSL for generating SQL queries. I strongly dislike ORMs (even though I use them regularly) |
| 16:36 | amalloy | SegFaultAX|work2: s/even though/because? |
| 16:36 | Raynes | kingtim: You're my hero, you know. |
| 16:36 | SegFaultAX|work2 | amalloy: Or that, yea. |
| 16:37 | ro_st | kreig1, SegFaultAX|work2: the entity stuff is tres useful. cuts out a lotta joinerplate crap |
| 16:37 | kingtim | Raynes: wow, thanks |
| 16:37 | SegFaultAX|work2 | amalloy: But even before I was a heavy ORM user I didn't like the idea. |
| 16:37 | kreig1 | ro_st: I wrote my own join helpers |
| 16:37 | kreig1 | ro_st: I don't really have things that work as entities |
| 16:37 | technomancy | kingtim: if the pending pull reqs get merged and limit activating nrepl to only files inside a project, I'd be ready to start encouraging swank users to switch. |
| 16:37 | SegFaultAX|work2 | ro_st: tres? Link? |
| 16:37 | hiredman | b |
| 16:37 | Raynes | kingtim: I'd bear your children if I had the physical capacity to do so. |
| 16:38 | SegFaultAX|work2 | kreig1: I'm not familiar with the korma lingo just yet. What's an entity? |
| 16:38 | ro_st | i used korma to script a conversion from a ~20 table sql to mongo. i had all the sql i needed in an afternoon |
| 16:38 | kreig1 | SegFaultAX|work2: just read the docs 8) |
| 16:38 | ro_st | Raynes: how many beers in are you? |
| 16:38 | ro_st | SegFaultAX|work2: http://sqlkorma.com/docs#entities. simple-as-that |
| 16:38 | Raynes | I'm a minor. Though I guess that isn't saying much. |
| 16:38 | Raynes | Well, not a minor. |
| 16:39 | SegFaultAX|work2 | kreig1: Well, that doesn't sound like a very complicated transition. 20 tables is small and easily manageable. |
| 16:39 | Raynes | I'm 'underage'. I guess that's what they call this. |
| 16:39 | ro_st | that just determines your enthuueuesiasm. can never spell that word |
| 16:39 | SegFaultAX|work2 | ro_st: Thanks, reading. |
| 16:39 | Raynes | enthusiasm? |
| 16:39 | ro_st | gimme one of those beers :P |
| 16:39 | kingtim | technomancy: okay, cool |
| 16:40 | SegFaultAX|work2 | ro_st: Enthusiasm is spelled phonetically. |
| 16:40 | kingtim | technomancy: I will try to send you some feedback on the ido branch tonight |
| 16:40 | technomancy | great |
| 16:40 | ro_st | i say it en-theee-ooo |
| 16:40 | technomancy | kingtim: have you thought about a mailing list? |
| 16:41 | ro_st | anyway :) |
| 16:41 | Hodapp | entheogen? |
| 16:41 | SegFaultAX|work2 | kreig1: Huh, why don't you like entities? It seems like a pretty handy way to describe your data model in clojure. |
| 16:41 | technomancy | kingtim: you could piggy-back on http://groups.google.com/group/clojure-tools/ too if you don't want to start your own |
| 16:41 | SegFaultAX|work2 | Or perhaps: what's wrong with korma entities? |
| 16:41 | kreig1 | SegFaultAX|work2: cause I don't have entities in my data world at all |
| 16:41 | kreig1 | SegFaultAX|work2: aka what a user might consider an "entity" does not live in a table anywhere |
| 16:41 | kingtim | technomancy: i was thinking something like that would be good with |
| 16:41 | kingtim | technomancy: all the activity lately |
| 16:42 | technomancy | it'll slow down once we've got more features in place I'm sure |
| 16:42 | technomancy | but it'd be good to coordinate on the next release |
| 16:42 | kingtim | technomancy: absolutely |
| 16:43 | SegFaultAX|work2 | kreig1: No? Your model doesn't have any users? Or rather, a "thing" that is the canonical representation of a user in your system. |
| 16:43 | technomancy | did you have anything specific in mind for the next version? |
| 16:43 | SegFaultAX|work2 | kreig1: I mean even if that's represented by multiple relations in the database, conceptually it's just one "thing". |
| 16:43 | kingtim | technomancy: I'd like to the current basic feature set stabilized to the point where we can make some sort of public announcement |
| 16:44 | kreig1 | SegFaultAX|work2: we have users and orgs and a few things, but they are at best administrative addons to the real data |
| 16:44 | kingtim | technomancy: and then I think the next big thing is debug support |
| 16:44 | SegFaultAX|work2 | kreig1: I see. What kind of applicaiton is this, if I may ask? |
| 16:44 | ro_st | SegFaultAX|work2: kreig1 probably has another level of abstraction on top of the sql. kinda like how datomic does on top of postgres |
| 16:44 | technomancy | kingtim: something simple like the debug-repl, or do you want to target a more elaborate approach? |
| 16:45 | kreig1 | SegFaultAX|work2: malware analysis database, I am effectively storing core.logic fact tuples |
| 16:45 | SegFaultAX|work2 | kreig1: Neat! Where do you work? |
| 16:45 | kingtim | technomancy: i was thinking simple first, and then we could go from there |
| 16:45 | kreig1 | SegFaultAX|work2: ThreatGRID (the site is opaque unless ou are buzzword compliant CSO) |
| 16:45 | SegFaultAX|work2 | ro_st: Sure, that's true of almost any system. But we're specifically talking about the datastore and query layer. |
| 16:46 | SegFaultAX|work2 | kreig1: What kinds of threat do you catalogue and analyze? |
| 16:46 | kingtim | technomancy: thoughts? |
| 16:46 | kreig1 | ro_st: yah, kinda. We have an "expert system" based on core.logic, and I am for the msot part dumping core.logic facts, we call them observations and tie a bunch of metadata to them, into the DB |
| 16:46 | technomancy | kingtim: personally I'm happy with the debug-repl, but there are occasional times when a really awful bug requires a stepping debugger |
| 16:46 | kingtim | technomancy: word |
| 16:47 | technomancy | I'm OK with falling back to swank for that since it happens so rarely (~1/year for me) |
| 16:47 | kreig1 | ro_st: we started before datomics was released, and noway I'm putting our crown jewels in something that new, maybe a few years down the line |
| 16:47 | technomancy | there are others who might insist on it, but we can get them to help implement that when they complain =) |
| 16:47 | kingtim | technomancy: :) |
| 16:47 | ro_st | kreig1: for sure :-) |
| 16:47 | kreig1 | also, fact tuples with all natural keys works really awesome in SQL |
| 16:48 | kingtim | technomancy: i actually wouldn't mind trying to work on it, just want to get something i can work in on day to day basis beforehand |
| 16:48 | kreig1 | SegFaultAX|work2: malware threats 8) we do dynamic and static analysis, throw the results in a DB, and mine |
| 16:49 | SegFaultAX|work2 | kreig1: I've only see a talk on core.logic, I'm not really familiar yet with the internals. What is a fact? |
| 16:49 | technomancy | kingtim: right; I'd totally love to have it, but it sounds really hard and there are a number of other more pressing features I'd want first |
| 16:49 | kreig1 | SegFaultAX|work2: a statement like process-modified-file PID "the/path/that/was/modified" |
| 16:49 | wingy | how do i tell "lein ring server" to allow public ips to access the server? |
| 16:50 | kreig1 | ok, gotta get back to hack |
| 16:50 | SegFaultAX|work2 | wingy: Probably bind it to a non-loopback interface. |
| 16:50 | technomancy | kingtim: I can work on the project-scoping issues and moving away from auto-mode-alist |
| 16:50 | SegFaultAX|work2 | wingy: 0.0.0.0 to bind to all interfaces. |
| 16:50 | SegFaultAX|work2 | Just a guess, though. |
| 16:50 | kingtim | technomancy: probably a good idea to setup an email list |
| 16:51 | wingy | SegFaultAX|work2: yeah that would be my guess as well coming from node.js |
| 16:51 | wingy | trying to figure out how to bind it |
| 16:51 | kreig1 | wingy: I usually will have it run on my local interface, and then use ssh port forwarding to access it remotely |
| 16:51 | kreig1 | wingy: that basically provides encryption and acces control for free |
| 16:51 | technomancy | kingtim: I've been having trouble with google groups; might want to check out librelist.com |
| 16:51 | technomancy | very low-maintenance |
| 16:51 | kreig1 | ssh thehostrunningringserver -L 9999:127.00.1:9999 |
| 16:51 | kingtim | technomancy: would be good to have a place to discuss some of this stuff |
| 16:52 | kreig1 | wingy: replace 9999 with the port ring server actually listens on 8) |
| 16:52 | kingtim | technomancy: what issues are you having with google groups? |
| 16:52 | Raynes | The fact that Google has turned email into a hash bang twitterish nightmare. |
| 16:52 | technomancy | the hashbang is a big part of it; the moderation interface sometimes just stops working |
| 16:52 | kreig1 | wingy: or are you talking about deploying it, like a live service? |
| 16:52 | technomancy | and you get overrun with spam if you don't turn on moderated first-posts |
| 16:52 | wingy | kreig1: development only |
| 16:53 | kreig1 | wingy: yah, for dev, I suggest the ssh port forwarding. we do that alot around here |
| 16:53 | SegFaultAX|work2 | wingy: Alternatively, you can use localtunnel to also have a temporary URL for your local machine. |
| 16:53 | technomancy | this morning I was seeing its search turn up zero results for something I was able to find in my local mail client |
| 16:53 | wingy | ok ill give it a try .. seems like a good thing to do |
| 16:54 | kingtim | technomancy: hmm.. okay |
| 16:55 | SegFaultAX|work2 | wingy: Check it, yo: http://progrium.com/localtunnel/ |
| 16:55 | technomancy | kingtim: just a suggestion; if you're comfortable with google's go for it |
| 16:56 | ro_st | man clojure is awesome. |
| 16:57 | kingtim | technomancy: i will have limited cycles after tonight |
| 16:57 | ro_st | i'm coming in at close to 1/7th the code of the original google closure javascript i wrote, including tests. and i've written 90% of that code in plain clojure in the repl |
| 16:57 | kingtim | technomancy: until next week |
| 16:57 | ro_st | and i can see it all working in the browser. awesome! |
| 16:57 | kingtim | technomancy: so I was thinking of pushing another marmalade release with what we have today |
| 16:58 | technomancy | kingtim: sure, including pending pull requests? |
| 16:58 | kingtim | technomancy: plus the stacktrace and the blowing-chunks |
| 16:58 | Raynes | Do it! |
| 16:58 | technomancy | kingtim: I think the completion pull req should be able to make it in too |
| 16:59 | ro_st | this sounds exciting |
| 16:59 | iwo | hey, what is the (java interop?) way to create a synchronized method? |
| 16:59 | kingtim | technomancy: i think you are right, i have a working version of that |
| 16:59 | kingtim | technomancy: and then get the ido into the next release |
| 16:59 | iwo | i'm using 'proxy' as i need to implement an existing Java interface |
| 17:00 | iwo | but i need to mark one of the methods synchronized |
| 17:00 | kingtim | technomancy: how does that feel? |
| 17:00 | iwo | (i'm assuming dosync/sync is not what i need) |
| 17:01 | TimMc | iwo: In Java, I think the 'synchronize' keyword on methods is sugar for a synchronize(this) { } block containing the method's body. |
| 17:01 | technomancy | kingtim: sounds like a good plan. if we get the auto-mode-alist issue and the nrepl-buffer-ns bug fixed in the next release I'll be thrilled. |
| 17:01 | technomancy | I think that's the point at which I'll explicitly announce that I won't be maintaining swank further |
| 17:01 | iwo | TimMc: yes i think you're right. so how does one create that block in clojure? |
| 17:01 | amalloy | iwo: TimMc's assertion is correct, and the clojure macro is ##(doc locking) |
| 17:01 | lazybot | ⇒ "Macro ([x & body]); Executes exprs in an implicit do, while holding the monitor of x. Will release the monitor of x in all circumstances." |
| 17:02 | iwo | amalloy: thanks!! |
| 17:03 | kingtim | technomancy: most excellent, thank you for all your contributions so far |
| 17:03 | technomancy | kingtim: yeah, really glad to see it coming together |
| 17:03 | TimMc | amalloy: Thanks, couldn't find the name. I'll make a note on ClojureDocs. |
| 17:03 | kreig1 | technomancy: what is the official way to use emacs and nrepl? |
| 17:04 | technomancy | kreig1: https://github.com/kingtim/nrepl.el <- this is the way forward |
| 17:04 | kreig1 | got it |
| 17:04 | kreig1 | thanks |
| 17:05 | kingtim | cemerick: just wanted to say thanks for the nrepl server, so far it has been rock solid and easy to work with |
| 17:05 | technomancy | kreig1: still a bit rough around the edges, but it's improving quickly |
| 17:05 | kreig1 | my production work is lagging behind clojure cutting edge, but I have a personal project were I deliberately try these things out |
| 17:05 | ebaxt | Hi! I'm trying to write a macro that defines a set of functions. It works, but when I pull the macro out into another namespace I get a 'can't create defs outside of current ns'. Can anyone point me in the right direction? |
| 17:05 | Raynes | cemerick is mah main man. |
| 17:05 | kreig1 | ok, relocating |
| 17:06 | cemerick | kingtim: Good to hear; are you using it in an app of yours or something? |
| 17:06 | kingtim | cemerick: nrepl.el |
| 17:06 | duck1123 | grrr. almost tried to type "defn" when creating a new Java method. (really wish I was using Clojure) |
| 17:06 | cemerick | oh! |
| 17:07 | cemerick | kingtim: sorry, I don't often find my way over to the emacs side of the field. :-) I've heard good things, though. |
| 17:07 | Raynes | cemerick: Still using Vim? |
| 17:07 | kingtim | cemerick: no worries |
| 17:07 | cemerick | Raynes: See, you say that now… ;-) |
| 17:07 | cemerick | Raynes: For misc. editing, yeah. |
| 17:08 | wingy | kreig1: i dont get ssh forwarding .. is this correct if i want public ip being able to access my lein server listening on 3000? ssh localhost -L 3000:127.0.0.1:8080 |
| 17:08 | kingtim | cemerick: i spend countless hours in intellij |
| 17:08 | cemerick | Every now and then, I think about pushing at the eclim stuff and seeing what I can do to get it working with ccw, but… |
| 17:08 | TimMc | wingy: I think you have those ports backwards. |
| 17:10 | emezeske | ebaxt: The macro is probably producing symbols (e.g. for the function names) that are fully-qualified in the original namespace, perhaps because you are using syntax quoting |
| 17:11 | emezeske | ebaxt: I would suggest looking at the macroexpand output for the macro, it might give further clues |
| 17:11 | ebaxt | emezeske: Thanks, I'll do that |
| 17:12 | Raynes | wingy: I recommend localtunnel. |
| 17:13 | emezeske | ebaxt: You probably just need to make sure it's not trying to (defn a/f [] ...) in namespace b, and instead just does (defn f [] ...), if that makes sense |
| 17:13 | emezeske | ebaxt: If I understand your goal correctly |
| 17:13 | ebaxt | emezeske: I added a ~' in front of the symbols and it worked. Tanks |
| 17:13 | wingy | Raynes: ok ill check it out |
| 17:13 | emezeske | ebaxt: Schweeet |
| 17:15 | ro_st | it appears that both interleave and mapcat only grab as long as both sides have content. is there one that will grab the last el from the first side even if the second side has nothing? |
| 17:15 | ro_st | or do i have to add "" to the second side |
| 17:15 | technomancy | ro_st: yeah, concat it onto an infinite seq |
| 17:17 | ro_st | i've got a template "So #placeholder# what." i've split on #[^#]+#, replaced it with something else, and now i'm stitching the plain text and the enlive nodes back together ready for enlive's content to use |
| 17:17 | gfredericks | macros: "I added a ~' and it worked." |
| 17:17 | ro_st | so it'll almost always be unbalanced |
| 17:17 | gfredericks | clojurebot: macros is I added a ~' and it worked. |
| 17:17 | clojurebot | 'Sea, mhuise. |
| 17:17 | gfredericks | ~macros |
| 17:17 | clojurebot | macros is I added a ~' and it worked. |
| 17:17 | gfredericks | :( |
| 17:17 | technomancy | heh |
| 17:17 | gfredericks | how do you make him leave off the first bit |
| 17:18 | gfredericks | clojurebot: forget macros is I added a ~' and it worked. |
| 17:18 | clojurebot | Ok. |
| 17:18 | cemerick | ro_st: sounds like you want string interpolation, or something like weavejester's comb. |
| 17:18 | ro_st | i'm replacing strings with enlive nodes |
| 17:18 | ro_st | so straight string stuff is out |
| 17:18 | ro_st | *looks at comb* |
| 17:19 | cemerick | ah, ok, nevermind. :-) |
| 17:19 | ro_st | thanks for the recommend, though! |
| 17:19 | ro_st | always appreciated |
| 17:19 | cemerick | keep calm and ignore cemerick |
| 17:21 | ro_st | http://clojuredocs.org/quickref/Clojure%20Core is a fantastic overview of the language, btw. |
| 17:21 | ro_st | love how it's organised |
| 17:22 | TimMc | gfredericks: <reply> after the is |
| 17:22 | ro_st | boom. got it working |
| 17:22 | TimMc | gfredericks: Also, you just taught him the "forget" version as well. |
| 17:26 | ro_st | cheers folks. it's been emotional. |
| 17:32 | amalloy | TimMc: <reply> isn't what you want there |
| 17:33 | amalloy | oh, for leaving off the first bit it is; not for making him forget |
| 17:35 | amalloy | TimMc: did you fix it already in PM? |
| 17:40 | augustl | weird.. "lein test" works, and build works just fine, but "lein ring server" errors with a stack trace and "Exception in thread "main" java.lang.ClassNotFoundException: clojure.walk, compiling:(myapp_mongodb/db.clj:62)" - and I'm not in the myapp_mongodb project! Can anyone thing of a reason for why "lein ring server-headless" would try to compile a unrelated project? :S |
| 17:41 | augustl | I do depend on myapp_mongodb, but I can't think of a reason for why "lein ring" should know where the source files are |
| 17:41 | augustl | or even try to know where the source files are, and even compile it |
| 17:46 | emezeske | augustl: I think AOT compilation in clojure is transitive, so if for whatever reason "lein ring server" is trying to compile your app, it would also try to compile its dependencies. |
| 17:47 | emezeske | augustl: I don't ever really compile stuff, though, so that's just a guess on my part |
| 17:47 | augustl | I get the same error when I remove the myapp_mongodb dependency as well |
| 17:47 | technomancy | you can't load any clojure code without compiling it |
| 17:47 | emezeske | I mean AOT compile |
| 17:48 | technomancy | sure, but that's not what the error above says |
| 17:48 | augustl | emezeske: not sure how "lein ring" knows where the source files are though, as all that's really in the project is the jar |
| 17:48 | augustl | unless some metadata in ~/.m2 contains the local path to the sources or something like that.. |
| 17:48 | emezeske | augustl: The jar does not include the source files? |
| 17:48 | augustl | jars only contain .class files no? |
| 17:48 | emezeske | technomancy: I should not even guess about compilation stuff. |
| 17:48 | technomancy | heh |
| 17:49 | technomancy | augustl: no, jars usually contain source |
| 17:49 | augustl | ah I see |
| 17:49 | technomancy | unless it's from a java lib |
| 17:49 | amalloy | technomancy: *clojure jars usually contain source |
| 17:50 | augustl | I suppose lein-ring isn't updated for leiningen 2 |
| 17:50 | weavejester | lein-ring works with lein 2 |
| 17:50 | weavejester | or lein 1 |
| 17:50 | augustl | hmm, I wonder what I've done wrong then |
| 17:51 | weavejester | "lein ring server" just executes your handler with run-jetty |
| 17:51 | augustl | my project.clj for the curious https://www.refheap.com/paste/3751 |
| 17:51 | technomancy | weavejester: does clojure's open-in-browser functionality work reasonably for most people? |
| 17:52 | technomancy | it always ends up using firefox for me, so the fact that lein-ring opens the browser by default drives me nuts |
| 17:52 | emezeske | technomancy: You can do server_headless, I think, to avoid that |
| 17:52 | Raynes | technomancy: server-headless |
| 17:52 | augustl | would make more sense to have it opposite imo :) |
| 17:52 | weavejester | technomancy: As far as I know it does. It just uses the clojure.java.browse namespace, or whatever it is |
| 17:52 | augustl | lein server-with-browser or w/e |
| 17:53 | weavejester | technomancy: Also, in lein 2, you can put :ring {:open-browser? false} in your user.clj |
| 17:53 | weavejester | Um, profile.clj |
| 17:53 | technomancy | weavejester: aha; that's the ticket; thanks |
| 17:53 | emezeske | weavejester: Nice! |
| 17:53 | weavejester | Under the user profile |
| 17:53 | augustl | can anyone think of a reason for why I'm getting the compilation error in the unrelated project btw? :) |
| 17:53 | augustl | weavejester: oh, nice |
| 17:55 | weavejester | augustl: What happens when you just load the handler namespace in via a REPL? |
| 17:57 | augustl | weavejester: that works fine |
| 17:57 | augustl | here's the full "lein ring server-headless" output https://www.refheap.com/paste/3752 |
| 17:57 | augustl | same for just "server", with and without port number |
| 17:58 | augustl | also, tests are running file, which starts a server with `ring.adapter.jetty/run-jetty` using the same handler as the one in my project.clj |
| 17:58 | weavejester | augustl: Which version of lein-ring and lein? |
| 17:59 | augustl | weavejester: lein-ring 0.7.1, Leiningen 2.0.0-preview7 on Java 1.7.0_05-icedtea OpenJDK 64-Bit Server VM |
| 18:00 | weavejester | augustl: Hm, same as me then, and I haven't noticed any issues like this. What does your project.clj look like? |
| 18:00 | augustl | weavejester: https://www.refheap.com/paste/3751 |
| 18:01 | augustl | I'm probably just doing something weird that causes clojure to barf I guess. I've had syntax errors causing bizzare stack traces many times :) |
| 18:02 | weavejester | augustl: You could try clearing your .m2 directory… myapp-mongodb also seems a bit suspicious. I think snapshots are only checked periodically for updates… Unless you're using the checkouts directory? |
| 18:02 | augustl | ..and now it suddenly works. All I did was a "lein upgrade" which probably reinstalled the version I already had |
| 18:03 | TimMc | amalloy: Yes, fixed in PM. |
| 18:03 | augustl | weavejester: I'm not using the checkouts directory no. lein 2 loads from ~/.m2 now right? |
| 18:04 | weavejester | augustl: Right. If you're using a snapshot, maybe it's caching a bad version? If you clear it out of .m2, or use checkouts, that might solve your problem... |
| 18:04 | augustl | also, I just passed midnight.. Perhaps that caused maven to redownload some stuff |
| 18:14 | augustl | are there any changeable reference types in clojure that doesn't need to be dereferenced on use? So that it's transparent whether it's actually changeable or a plain var. Read: I don't want to have to @ it wheneve I use it. |
| 18:15 | jbarrios | how would one best handle logging progress updates inside of a long-running doseq? |
| 18:15 | jbarrios | Imperatively I'd keep a counter and log an update ever X items processed... |
| 18:16 | augustl | jbarrios: afaik actors are well suited for that, as you'll get a callback when the transaction has been committed |
| 18:16 | augustl | afaik, iirc, etc :) |
| 18:17 | jbarrios | agents you mean? |
| 18:18 | augustl | uh yeah |
| 18:18 | emezeske | jbarrios: You could pair the elements you are iterating over with indices with something like (map vec my-stuff (range)), and then look at the index of the current item in the doseq body |
| 18:19 | jbarrios | emezeske: hmm, true |
| 18:23 | jbarrios | if my-stuff is a lazy seq will (map vec ... ) fully instantiate it before it returns? |
| 18:24 | amalloy | emezeske: (map vec x y) is always an error :P |
| 18:24 | emezeske | jbarrios: I believe the map call should be totally lazy |
| 18:24 | amalloy | (map vector x y), however... |
| 18:24 | Cheiron | Hi, what would be a good way to perform many operations on a map? calling assoc return new instance, i want to call many assoc |
| 18:24 | jbarrios | thanks |
| 18:24 | augustl | I'm passing a "ref" and it works fine in my tests, but when running my actual server I get NullPointerExceptions. Defererencing solves it. How come the behaviour is different in tests? Are more/fewer threads created in the actual server perhaps? |
| 18:25 | emezeske | amalloy: Did you have a clojure REPL wired directly into your brain? |
| 18:25 | amalloy | i have several brains-in-jars wired into my clojure repl |
| 18:25 | emezeske | haha |
| 18:26 | emezeske | I picture amalloy-vision as having little wiggley marks underneath buggy clojure code (like a spellchecker) |
| 18:26 | amalloy | if only |
| 18:27 | emezeske | jbarrios: Not sure if you saw, but make sure you use (map vector ...) instead of vec, as amalloy pointed out |
| 18:28 | augustl | I start the server with "lein ring server", does that set clojure in "production mode" in some shape or form, if there's even such a thing? |
| 18:28 | technomancy | augustl: something like this: lein with-profile production ring server |
| 18:28 | Raynes | emezeske: Actually, amalloy vision is like looking through a dirty aquarium at the world. |
| 18:29 | Raynes | Poor guy has terrible eyesight. |
| 18:29 | amalloy | hah, a dirty aquarium. that's not bad |
| 18:29 | emezeske | Raynes: Oh, I thought you were gonna say he was some kind of sea creature |
| 18:29 | weavejester | augustl: By default "lein ring" uses LEIN_NO_DEV to check if the server is in production, but a more customizable approach would be to use profiles. |
| 18:30 | augustl | I see, thanks |
| 18:30 | amalloy | emezeske: if this conversation were happening in real life, i would be making whalesong noises now |
| 18:30 | emezeske | amalloy: I knew this was a dream... |
| 18:38 | aphyr | Does anyone know where with-out-writer went? |
| 18:40 | AWizzArd | not sure, but try clojure.java.io |
| 18:40 | aphyr | Trying to write forms to a file, but the 1.3 contrib-nova seems to have obliterated http://clojuredocs.org/clojure_core/1.2.0/clojure.core/*print-dup* |
| 18:40 | AWizzArd | ,(apropos "out-writer") |
| 18:40 | aphyr | Not in clojure.java.io any more. :/ |
| 18:40 | clojurebot | () |
| 18:41 | technomancy | is it that much extra overhead to bind *out* manually? |
| 18:41 | aphyr | Must be a better way to do it now, I just haven't found it. |
| 18:41 | technomancy | clojure.java.io/writer can give you what you need |
| 18:41 | technomancy | my guess would be it was abandoned because it doesn't justify creating a macro over such a tiny thing |
| 18:42 | aphyr | Yeah, I actually can't figure out what (writer) does from its docs |
| 18:43 | aphyr | Supposed to take URIs or filenames and return appropriate writers for them? |
| 18:49 | jsnikeris | technomancy: any ideas on how to handle https://github.com/kingtim/nrepl.el/issues/30 ? |
| 18:54 | technomancy | jsnikeris: that's probably going to have to be handled on the clojure side |
| 18:54 | technomancy | I'd be surprised if :init doesn't already work |
| 18:54 | technomancy | :init-ns might be harder, but it should be done on the nrepl side rather than the client side |
| 18:55 | jsnikeris | technomancy: I'm not too familiar with leiningen's internals, but a quick look at repl.clj seemed to indicate that those options are only processed by REPL-y |
| 18:56 | technomancy | jsnikeris: hmmm... I see |
| 18:57 | technomancy | jsnikeris: we don't have to launch a headless nrepl |
| 18:57 | jsnikeris | technomancy: interesting. I'm going to give that a try |
| 18:58 | technomancy | otherwise we'd just have to expand leiningen.repl/start-server |
| 18:59 | technomancy | jsnikeris: are you seeing this bug where nrepl-buffer-ns is nearly always set to "user"? |
| 18:59 | jsnikeris | technomancy: yeah, you need to evaluate the namespace form of each buffer |
| 18:59 | technomancy | C-c C-n? |
| 19:00 | jsnikeris | technomancy: yeah. I was thinking of automatically evaluating the namespace form when you open a buffer, but that won't work if that buffer's stuff isn't on your classpath |
| 19:01 | technomancy | so when I run C-c C-k, it doesn't set nrepl-buffer-ns |
| 19:01 | jsnikeris | I think the semantics of nrepl-buffer-ns is: the namespace that code will be evaluated in when you use the interactive-eval commands |
| 19:02 | jsnikeris | technomancy: Hmm, I'd expect C-c C-k to set it, but I'm not sure if it actually does. |
| 19:02 | jsnikeris | technomancy: let me see |
| 19:03 | technomancy | I think that's the bug; it's supposed to |
| 19:04 | technomancy | jsnikeris: actually it does set it, but it sets it to "user" |
| 19:04 | jsnikeris | technomancy: hmm, I'll take a look |
| 19:05 | technomancy | in nrepl-make-response-handler |
| 19:05 | jsnikeris | technomancy: heh, there's a TODO above `nrepl-load-file` |
| 19:06 | jsnikeris | ;; TODO: implement reloading ns |
| 19:06 | technomancy | oh, I imagined that as :reload-all type reloading |
| 19:06 | technomancy | rather than setting it elisp side |
| 19:06 | technomancy | anyway, I implemented that on my reload branch |
| 19:08 | technomancy | I thought it was something specific to my setup, but I'm seeing it with emacs -Q as well |
| 19:08 | jbarrios | btw, I ended up using this, in case anyone remember my original question earlier: |
| 19:08 | jbarrios | (doseq [[line counter total] (map vector coll (cycle (range 0 1000)) (range))] |
| 19:08 | jbarrios | (if (zero? counter) |
| 19:08 | jbarrios | (println "Processed" total "entries") |
| 19:08 | jbarrios | ... do something) |
| 19:08 | technomancy | but I guess I can train my fingers to do C-c C-n for now |
| 19:08 | jbarrios | |
| 19:08 | jbarrios | err, you get the idea. do something no in the else |
| 19:09 | jsnikeris | technomancy: Yeah, I think it is inadequate. What's the behavior in SLIME? |
| 19:09 | technomancy | jsnikeris: I think the ns is calculated from the in-buffer ns form every time |
| 19:09 | technomancy | which is much more reliable |
| 19:10 | jsnikeris | technomancy: I tried doing that, but what if you're trying to evaluate the namespace form itself |
| 19:10 | technomancy | sure, C-c C-k doesn't use that |
| 19:10 | jsnikeris | technomancy: you end up trying to define the namespace in a namespace that doesn't exist |
| 19:11 | technomancy | I think as long as your first operation is a full compile you're fine |
| 19:11 | technomancy | which it should be anyway |
| 19:11 | dnolen | dgrnbrg: re: core.logic search tree - it captures all paths in the tree as far as I can tell. so it's good enough for visualization. |
| 19:11 | jsnikeris | technomancy: then perhaps that should happen automatically |
| 19:12 | dnolen | dgrnbrg: it's actually very, very fast since it doesn't need to actually run your core.logic program and it doesn't need to follow recursions. I think it can easily be used to produce optimized core.logic programs. |
| 19:12 | technomancy | jsnikeris: if it's easy to turn off |
| 19:12 | technomancy | jsnikeris: IIRC vimclojure did that for a while and it really annoyed some people |
| 19:12 | dnolen | dgrnbrg: where it get interested is whether it will be possible to use it to optimize your program while it's running. |
| 19:12 | technomancy | but you shouldn't be putting side-effects in the top-level anyway, so personally I'm ok with it |
| 19:13 | jsnikeris | technomancy: yeah, but maybe you don't want to do things behind the users back |
| 19:13 | technomancy | anyone remember the details re: vimclojure and automatically compiling a file when you open it? |
| 19:13 | jsnikeris | I can see how people might not like that |
| 19:13 | technomancy | jsnikeris: maybe disable the auto-compilation if the first form isn't (ns [...]) |
| 19:14 | technomancy | since that's a pretty good heuristic for throwaway code vs proper project code |
| 19:15 | aphyr | What's the idiomatic way to catch wrapped exceptions in 1.3? |
| 19:15 | jsnikeris | technomancy: What do you think of the viability of having a single REPL that spans across multiple projects? If you open a buffer of a new project, it uses Pomegranate to modify the classpath appropriately. Could you run into trouble doing that? |
| 19:16 | technomancy | jsnikeris: it wouldn't work with the bootclasspath, but it might otherwise |
| 19:16 | dnolen | aphyr: I think that hassle is why most people skipped to 1.4 |
| 19:16 | technomancy | interesting idea |
| 19:16 | aphyr | yeah, IIRC (catch) is basically useless, haha |
| 19:17 | aphyr | Guess I'll unwrap for now, stuck on 1.3 libs for a bit |
| 19:17 | technomancy | jsnikeris: curious why you're still on 23 |
| 19:17 | jsnikeris | technomancy: My only concern is that you might run into classpath issues where two projects require different versions of the same library |
| 19:18 | jsnikeris | technomancy: I track Debian stable |
| 19:18 | amalloy | aphyr: +1 for skipping to 1.4, but slingshot probably makes exception-catching reasonably okay on 1.3 |
| 19:19 | technomancy | jsnikeris: I know I've already had a few features merged that depend on having closures |
| 19:20 | technomancy | we could be liberal with lexical-let, but we should turn off support for lexical scope if we want to target 23 |
| 19:21 | jsnikeris | technomancy: yeah my understanding was that using lexical-let was good practice, although I'm not too familiar with the issue |
| 19:22 | technomancy | it's just a question of how many people are still on 23 I guess |
| 19:22 | jsnikeris | technomancy: I mean 24 was *just* release |
| 19:23 | technomancy | yeah, but the starter kit has required it for over a year |
| 19:23 | technomancy | it's been stable for ages |
| 19:23 | technomancy | I've only heard one or two complaints around the starter kit |
| 19:24 | jsnikeris | I'm not saying that it's not stable, only that some people are still using 23. |
| 19:24 | jsnikeris | Debian Wheezy, which is yet to be released will use 23.4 |
| 19:24 | amalloy | i'm not upgrading to 24 anytime soon |
| 19:26 | jsnikeris | technomancy: If it's not too hard to support 23, I think we should. I'll be happy to shoulder responsibility :) |
| 19:33 | merkouris | hi |
| 19:33 | merkouris | I was hoping someone might be able to help me. |
| 19:34 | merkouris | I'm going through the tutorial for noir, on the forms page, I paste the code and get a error : error: java.lang.IllegalArgumentException: Parameter declaration hiccup.core/html should be a vector |
| 19:38 | amalloy | you forgot the arglist for a defn |
| 19:48 | technomancy | jsnikeris: there's still a chance 24 could make it into wheezy |
| 19:49 | jsnikeris | technomancy: That'd be great. I was under the impression that the tree was locked except for bug fixes. |
| 19:51 | amalloy | bug: emacs 23 is not as good as 24? |
| 19:51 | jsnikeris | amalloy: heh |
| 19:51 | haspaker | Hi there, folks |
| 19:51 | technomancy | jsnikeris: have you tried nix? |
| 19:51 | jsnikeris | technomancy: So I tried omitting the :headless option when nrepl creates a server, and the repl-options are processed for the *nrepl-server* buffer, but not for clients that subsequently connect to that server |
| 19:52 | jsnikeris | technomancy: I haven't even heard of it. Googling... |
| 19:52 | jsnikeris | technomancy: wow, google didn't help much. What is it? |
| 19:52 | technomancy | jsnikeris: http://nixos.org/nix <- lets you get new packages on a system like squeeze in a completely isolated way that can't compromise system stability |
| 19:52 | technomancy | clojurebot: nix? |
| 19:52 | clojurebot | nix is a purely functional package manager exhibiting many similar characteristics to Clojure's persistent data structures or git commit trees: http://nixos.org/nix/ |
| 19:52 | jsnikeris | whoah, cool |
| 19:53 | jsnikeris | I'll check that out |
| 19:53 | technomancy | if it weren't for nix I don't think I could use squeeze |
| 19:53 | gfredericks | ~botsmack |
| 19:53 | clojurebot | clojurebot evades successfully! |
| 19:53 | haspaker | Asked this in the wrong channel before, but I'll try again |
| 19:54 | haspaker | Any idea on how to make this function less verbose / more effective? http://pastebin.com/tMuUNFsv |
| 19:54 | haspaker | I don't really need to make it any better, but one can usually learn a lot from watching experienced people solve things |
| 19:54 | jsnikeris | technomancy: So, even if I connect in a terminal using "lein repl :connect <port>", the repl-options aren't processed. |
| 19:54 | jsnikeris | so I'm thinking it might be the client's responsibility to handle initialization tasks |
| 19:55 | jsnikeris | rather than nREPL's |
| 19:55 | technomancy | jsnikeris: well :init should still be handled, but I guess not :init-ns? |
| 19:56 | technomancy | making nrepl.el parse project.clj is really not a road I want to go down =\ |
| 19:56 | technomancy | I think there should be a way to honor init-ns for every client that connects. |
| 19:56 | technomancy | err--not that it already exists, but that it should be added |
| 19:56 | jsnikeris | technomancy: well I'm trying to set a binding (*print-length*), and it doesn't seem to be working |
| 19:57 | jsnikeris | let me try something more simple like printing something |
| 19:57 | technomancy | yeah, binding won't work in :init |
| 19:58 | technomancy | haspaker: I'd see if you could re-formulate it in terms of a reduce on a seq rather than loop/recur |
| 20:00 | jsnikeris | technomancy: Yeah, so try adding having a profiles.clj like this: |
| 20:01 | jsnikeris | {:user {:repl-options {:init (print "Hello")}}} |
| 20:01 | jsnikeris | enter some project |
| 20:01 | jsnikeris | lein repl |
| 20:01 | jsnikeris | you should see the statement printed |
| 20:01 | jsnikeris | then open a new terminal and lein repl :connect to the server opened in the first terminal |
| 20:01 | jsnikeris | no print statement |
| 20:02 | technomancy | yeah, that's actually intentional |
| 20:03 | technomancy | it's only supposed to be run once |
| 20:03 | haspaker | technomancy: I'll look into that |
| 20:04 | jsnikeris | ah ok. So it is run when the server initializes |
| 20:06 | jsnikeris | technomancy: So if I want to set *print-length* and *print-level* automatically every REPL, how would you recommend doing so? |
| 20:07 | technomancy | that should be declared in project.clj and read by the repl task; either reply or nrepl should handle binding it for each incoming connection |
| 20:07 | technomancy | along with :init-ns |
| 20:07 | technomancy | too bad cemerick's not here; I'd ask him which is appropriate |
| 20:08 | jsnikeris | gotcha, I'll take at the interaction between leiningen and nREPL to see what's up |
| 20:09 | jsnikeris | technomancy: My guess is that it should be nREPL's responsibility because REPL-y is just an nREPL client as far as I can tell |
| 20:09 | kreig1 | big cookies do not help hacking |
| 20:09 | technomancy | yeah, I think so |
| 20:10 | kreig1 | no matter how delicious |
| 20:10 | jsnikeris | kreg1: sugar coma? |
| 20:10 | jsnikeris | kreig1: |
| 20:10 | kreig1 | yup |
| 20:27 | amalloy | welllllll |
| 20:27 | amalloy | not the way let and do are currently defined to behave at the top level |
| 20:27 | gfredericks | eh? |
| 20:28 | amalloy | (do (def x 1) (def y x)) ;; succeeds |
| 20:28 | kreig1 | "General and abstract ideas are the source of the greatest errors of mankind." -- Rousseau |
| 20:28 | gfredericks | oh hmm |
| 20:28 | gfredericks | I guess so |
| 20:28 | amalloy | (let [] (def x 1) (def y x)) ;; probably doesn't |
| 20:28 | gfredericks | oh I wasn't thinking that way |
| 20:28 | gfredericks | I forgot let gives you a do |
| 20:28 | technomancy | do is special-cased in the compiler to compile sub-expressions independently |
| 20:28 | technomancy | in order to help with the Gilardi Scenaria |
| 20:29 | technomancy | Scenario |
| 20:29 | kreig1 | oh wow, didn't know that |
| 20:29 | gfredericks | amalloy: that one does work, and I'm not sure why you thought it didn't |
| 20:29 | technomancy | gfredericks: it doesn't work in a fresh repl |
| 20:29 | gfredericks | wat |
| 20:29 | technomancy | it only works because you've got state sticking around |
| 20:30 | amalloy | technomancy: no, it does work fine |
| 20:30 | technomancy | oh, never mind |
| 20:30 | amalloy | the compiler does a fair amount of scanning for def forms and creating vars for them before the subform is executed, so i don't know exactly what you have to do to create an issue |
| 20:31 | zellio | is there a way to inspect a java constructor to see what arguments it expects? ( when doing inter-op ) |
| 20:31 | technomancy | I wonder if that was improved since 1.2 |
| 20:32 | gfredericks | amalloy: I was thinking of (do (foo) (bar) (baz)) => (let [_0 (foo) _1 (bar)] (baz)), but since let has do built in that's not even remotely interesting |
| 20:33 | technomancy | zellio: the slime inspector does that |
| 20:34 | zellio | really? awesome |
| 20:34 | zellio | thanks |
| 20:36 | zellio | hrmm, do you have to configure it special? |
| 20:37 | technomancy | C-c S-i my.class.Name RET should do the trick |
| 20:38 | Raynes | amalloy_: Can you restart lazybot when you get a chance? Please. |
| 20:39 | zellio | ahh that's the syntax, thanks technomancy |
| 20:43 | Kowboy | why aren't vectors, sets, and maps seqs? |
| 20:45 | kreig1 | they are sequable |
| 20:46 | kreig1 | that is not a true answer to your question tho 8) |
| 20:46 | gfredericks | I was wondering about vectors at one point. I don't think I got a very strong answer from anybody. |
| 20:47 | gfredericks | I think the main thing we came up with was that seq? is not a useful function most of the time |
| 20:47 | technomancy | inc |
| 20:47 | gfredericks | perhaps only when dealing with code |
| 20:48 | ToxicFrog | Yeah, it seems like most of the functions you'd want to use are valid on all seqables, not just seqs, so it doesn't come up much |
| 20:48 | kreig1 | my understanding is that the notion of being sequable, as opposed to "being sequences" is because native java collections, like arrays for example, cannot have their inheritence/type changed, but can define an interface for returning a sequence of themsevles, and in the context of immutable data structures, that's nearly the same |
| 20:48 | kreig1 | that make sense ot others? |
| 20:49 | kreig1 | and since sequence functions are going to assume immutable sequence data types, a mutable java type should return a immutable sequence (tho I bet that is not always the case) |
| 20:49 | gfredericks | depends on what you mean by "arrays ... can define an interface ..." |
| 20:49 | kreig1 | you can extend their interface, witha protocol for example |
| 20:52 | kreig1 | I think there are alot of places in clojure where uhm, uniformity, regularity, and distinct categories are not primary drivers of the design, but rather, implimentation is |
| 20:52 | kreig1 | I don't see that as a problem at this stage |
| 20:53 | Kowboy | just threw me off for awhile when using seq? |
| 20:53 | gfredericks | Kowboy: checkout seqable? and sequential? |
| 20:54 | kreig1 | Kowboy: me too, awhile ago |
| 20:55 | dnolen | gfredericks: as kreig1 says, a desire to avoid complecting ideas (as well as the implementation) |
| 20:56 | gfredericks | dnolen: you're talking about why vectors etc are not seqs? |
| 20:56 | kreig1 | dnolen: hmm, what part of my statement you read re: complecting ideas? |
| 20:56 | dnolen | gfredericks: yes |
| 20:56 | dnolen | kreig1: I was agreeing w/ you. |
| 20:56 | kreig1 | I know, but I am trying to understand what you meant with that terminology |
| 20:57 | kreig1 | what from my statement did you map to "complecting ideas" |
| 20:57 | gfredericks | dnolen: and so lists are seqs because it'd be going to far to separate those? |
| 20:57 | dnolen | kreig1: though I disagree about the uniformity regularity parts. it's uniformity and regularity in a deeper way IMO |
| 20:57 | dnolen | gfredericks: list are naturally & trivially seqs. |
| 20:57 | dnolen | gfredericks: vectors were seqable but the details have changed. ChunkedSeqs are quite neat IMO. |
| 20:58 | fenton | anyone run into emacs not finding lein, when trying to do a clojure-jack-in? http://pastie.org/4309462 |
| 20:59 | kreig1 | really, if you look at the ISeq interface, it becomes clearer |
| 20:59 | kreig1 | first/more/next/cons/empty |
| 21:00 | kreig1 | map a vector or a java array into that, and you can see that a array is not a sequence, without an index being hidden somewhere on it 8) |
| 21:00 | dnolen | kreig1: I find the presence of next in ISeq a bit yucky. I prefer what's been done ClojureScript. |
| 21:00 | gfredericks | ha I saw the empty and first thought of clojure.core/empty, which was confusing |
| 21:00 | kreig1 | dnolen: which is? |
| 21:01 | dnolen | kreig1: much simpler, ISeq is just -first, -rest |
| 21:01 | dnolen | kreig1: next is in it's own protocol INext |
| 21:02 | dnolen | kreig1: I actually added INext, originally CLJS only had ISeq. |
| 21:02 | gfredericks | oh I just noticed that cljs lets you ##(let [[a b] #{2 3}] [a b]) |
| 21:02 | kreig1 | hmm, not sure I understand iseq without next |
| 21:03 | kreig1 | (first (more sufficient in your opinion? |
| 21:04 | dnolen | kreig1: -rest can be fully lazy. next cannot. But next also has performance benefts - many seqs themselves know if there is more or there isn't and can avoid the over head of (seq (rest ...)) |
| 21:06 | kreig1 | got t |
| 21:07 | kreig1 | ok, so the "complecting" of ideas, is looking for uniformity of "sequences" at this general level of a type unifying all things that via some form we can walk throuugh, or grab the nth element of etc... |
| 21:08 | kreig1 | but which actually are quite different structures, in terms of their implementation |
| 21:08 | jbarrios | hmm, why does with-open exhaust my heap even when I am not writing anything to the file? |
| 21:08 | kreig1 | so, when we define those differences, or use the contours of those differences as the basis for defining interfaces |
| 21:09 | jbarrios | (with-open ... (doseq ...) ) holds on to head? |
| 21:09 | kreig1 | We can more easily put those itnerfaces on new things, like datomic, or an sql query, or whatever |
| 21:10 | kreig1 | because we are being explicit about what the data type knows, what state it keeps about itself, and not having to shoehorn it into an overly generic abstract "list" or 'sequence' that tries to cover all the different forms of access (indexed, first/next/rest, lazy etc...) |
| 21:10 | jbarrios | really, wth |
| 21:11 | kreig1 | jbarrios could it be the try? |
| 21:11 | jbarrios | I don't know. |
| 21:11 | jbarrios | guess we'll find out |
| 21:13 | kreig1 | doseq should not be retaining the head itself |
| 21:13 | jbarrios | it doesn't |
| 21:13 | dnolen | kreig1: I recommend reading lines 117 - 280 in core.cljs of ClojureScript. It's kind of surprising how few fundamental ideas there are in Clojure. Nearly all of the protocols define 1 method. |
| 21:14 | kreig1 | dnolen: on that note, I have a patch to the ns macro, that checks that the "references", like :import, :use, :require are one of the supported type because attempting to invoke named funtion in clojure.core 8) |
| 21:14 | kreig1 | ,(ns foo (:print "I AM A ROBOT")) |
| 21:14 | clojurebot | I AM A ROBOT |
| 21:14 | gfredericks | O_O |
| 21:14 | kreig1 | makes ns a little too funky for my taste 8) |
| 21:15 | gfredericks | ,(ns foo (:eval :evaled)) |
| 21:15 | clojurebot | :evaled |
| 21:15 | gfredericks | ooh |
| 21:15 | gfredericks | ,(ns foo (:System/exit)) |
| 21:15 | clojurebot | #<CompilerException java.lang.RuntimeException: No such var: clojure.core/exit, compiling:(NO_SOURCE_PATH:0)> |
| 21:15 | dnolen | Raynes: uh oh |
| 21:15 | kreig1 | yah, it calls name on it and only looks it up in clojure.core |
| 21:15 | dnolen | oh actualy hiredman maintains clojurebot right? |
| 21:15 | kreig1 | so you are restricted to that namespace |
| 21:15 | gfredericks | dnolen: yeah |
| 21:16 | gfredericks | and lazybot is asleep so we can't see if it works there too |
| 21:16 | kreig1 | my CA should have arrived, but I'm on on the website |
| 21:16 | gfredericks | maybe @tryclj.com |
| 21:16 | kreig1 | it's in clojure 1.4, so it works there |
| 21:16 | gfredericks | "You tripped the alarm! class clojure.lang.Compiler is bad!" |
| 21:16 | kreig1 | mind you, the jail tryclj uses is pretty good, aka uses java sec. policy to restrict you from touching some classes |
| 21:16 | kreig1 | see 8) |
| 21:16 | kreig1 | good on them |
| 21:17 | Raynes | dnolen: clojurebot is about as secure as a jail cell with no door. |
| 21:17 | technomancy | clojurebot uses "restart every ten minutes" sandboxing which is also pretty effective |
| 21:17 | gfredericks | ,(System/exit) |
| 21:17 | clojurebot | #<CompilerException java.lang.RuntimeException: java.lang.NoSuchFieldException: exit, compiling:(NO_SOURCE_PATH:0)> |
| 21:17 | technomancy | over a long enough time span anyway |
| 21:17 | dnolen | Raynes: heh |
| 21:17 | gfredericks | am I crazy? |
| 21:17 | gfredericks | oh it needs an arg |
| 21:17 | gfredericks | ,(System/exit 0) |
| 21:17 | clojurebot | #<SecurityException java.lang.SecurityException: denied> |
| 21:17 | Raynes | amalloy_: Nevermind. Apparently you're never coming back, so I'll do it. |
| 21:18 | gfredericks | technomancy: restart the jvm or the whole vm? |
| 21:19 | Raynes | craigbro: The amount of time put into clojail and the number of holes I've fixed over the past two years, it better be good. |
| 21:20 | craigbro | Raynes: hat tip for sure |
| 21:20 | gfredericks | yet still lazybot doesn't allow eval </ungrateful whine> |
| 21:20 | jbarrios | yeah, looks like it |
| 21:20 | Raynes | Well preventing eval is kinda the whole point. :p |
| 21:20 | gfredericks | Raynes: https://github.com/flatland/clojail/issues/2 |
| 21:21 | Raynes | Yeah, I forgot about that. |
| 21:26 | craigbro | https://github.com/craigbro/clojure/commit/d1ca441737aa16128fec6c8a8dcd472180c6b7bf |
| 21:26 | craigbro | That's my patch to fix the ns form issue |
| 21:26 | craigbro | can someone take a look and tell me if I'm still a heretic Common Lisp hacker vandalising clojure.core or not? |
| 21:28 | zellio | craigbro: if i've learend anything about clojure after coming to it from common lisp, you will always be =P |
| 21:29 | dnolen | craigbro: you could replace some with a set look up. |
| 21:29 | craigbro | ok, will try that |
| 21:30 | craigbro | here isa question about the compiler: is it gonna keep making a new list for that set of valid names each time? |
| 21:30 | craigbro | or does it recognize it as a literal and get smart about it |
| 21:31 | dnolen | craigbro: recognizes literals |
| 21:33 | craigbro | so, my understanding is that refernce should always have a keyword first, but apparently in a few places in the clojure test suite, I got a symbol |
| 21:33 | craigbro | hence, the (or symbol? keyword? |
| 21:35 | craigbro | oh, now I gotta learn how to suash git commits togehter |
| 21:37 | gfredericks | git suash |
| 21:39 | craigbro | got it |
| 21:39 | craigbro | i rebased, pulled, merged pushed ... |
| 21:42 | craigbro | pull request sent |
| 21:42 | gfredericks | pull request to clojure/clojure? |
| 21:43 | dnolen | craigbro: you can't send pull requests. JIRA. |
| 21:43 | craigbro | oh well |
| 21:43 | gfredericks | this is the part where he finds out about snailmail |
| 21:43 | craigbro | let it languish there |
| 21:43 | craigbro | I already sent in my CA |
| 21:44 | craigbro | ok, closed with comment |
| 21:45 | craigbro | letme guess, open issue, attach patch |
| 21:45 | dnolen | craigbro: yep |
| 21:46 | jsnikeris | Is there a way for two let bindings to refer to eachother? |
| 21:46 | dnolen | jsnikeris: not really |
| 21:46 | gfredericks | jsnikeris: letfn if you're making functions |
| 21:46 | zellio | (let [foo 0] (let [bar foo] ))? |
| 21:47 | zellio | otherwise no |
| 21:47 | jsnikeris | I'm trying to make a tree structure that has a pointer to its parent and its children |
| 21:48 | aphyr | (defrecord Node [parent me children]) |
| 21:48 | jsnikeris | aphyr: yeah |
| 21:48 | zellio | (defstruct node :parent :children) |
| 21:48 | zellio | er, what aphyr said |
| 21:49 | jsnikeris | now create a Node with some children |
| 21:49 | aphyr | point of interest: |
| 21:49 | aphyr | are you looking for a functional, immutable structure, or a mutable stateful one? |
| 21:50 | jsnikeris | aphyr: I'd prefer to use a record so, immutable |
| 21:51 | aphyr | OK. Be aware that mutating elements in doubly-linked trees is going to be more complex. |
| 21:51 | jsnikeris | dnolen: You said, "not really". Is there any way to achieve the same effect? |
| 21:52 | aphyr | More expensive, too: any mutation will be O(n). |
| 21:52 | jsnikeris | aphyr: I don't plan on mutating them. |
| 21:54 | peregrine81 | hey where might I find the java-utils maven repo? I've tried to use this in my lein script [org.clojure.contrib/java-utils "1.3.0"] and keep getting not found :? |
| 21:54 | aphyr | You know creation is mutation, right? That it'll take n^2-n ops to make the tree? |
| 21:55 | aphyr | (long story short I really don't advise doing this, if you want dual traversability use a mutable structure under the hood) |
| 21:55 | jsnikeris | aphyr: Let me explain what I'm trying to do, and let me know if this is a bad idea. |
| 21:56 | peregrine81 | really dying here |
| 21:57 | jsnikeris | I'm going to be persisting these Nodes in a database. A Node is uniquely identified by its name and its parent Node. |
| 21:57 | jsnikeris | But it's convenient to also be able to access all the children of a given Node |
| 21:58 | jsnikeris | So I was planning on having the children be a lazy sequence that retrieves the children from the database |
| 21:59 | jsnikeris | So to be able to persist a given Node, I need to know its parent node. |
| 21:59 | aphyr | But you don't actually need to traverse back up the tree from a given node? |
| 21:59 | aphyr | (e.g. we're just talking about a map of paths to nodes) |
| 22:00 | jsnikeris | aphyr: I'm not sure at this point, but it would be nice to be able to |
| 22:00 | aphyr | So first off, I'd be wary of wrapping up DB IO in lazy-seqs. |
| 22:01 | aphyr | Just be aware of how that's going to work, haha. :) |
| 22:01 | aphyr | I'm guessing you're writing these structures to a mutable database |
| 22:01 | aphyr | which suggests to me the in-memory structure may be mutable too. |
| 22:02 | craigbro | dnolen: alrighty JIRA issue created and patch attached |
| 22:02 | craigbro | dnolen: now I can go back to reading core.clj:117+ |
| 22:03 | aphyr | There are a few options. If you want a classic object graph, you can define the tree immutably and easily with (defrecord path value), and simply have your lazy-seq call (Node. (concat parent-path child-name) child-value) |
| 22:04 | aphyr | If your parents are identified by, say, unique IDs instead of vector/string paths, I'd just store a parent ID around. |
| 22:05 | aphyr | Creating cyclic dependencies between immutable objects is tough; I think you'd have to use an Atom somewhere, or just break down and use a mutable deftype. |
| 22:06 | aphyr | Chances are what you want is already *in* some java graph library, so you might consider proxying to that. |
| 22:06 | aphyr | If you want a purely functional tree, you can express it with partially applied functions for nodes. |
| 22:07 | aphyr | e.g. each node is a function which takes a child name (or nothing) and returns another node function, or its own value. |
| 22:07 | aphyr | Unsure of how efficient that is in Clojure, though. |
| 22:08 | jsnikeris | aphyr: what is the path field of the record? |
| 22:09 | aphyr | dunno, you tell me |
| 22:09 | aphyr | I figured something like [parent child1 child-of-child1] |
| 22:09 | aphyr | or "/foo/bar/baz", that sort of thing |
| 22:09 | aphyr | Whatever it is that you need to serialize the record |
| 22:10 | aphyr | If you're using a relational store, just take the primary key. |
| 22:10 | jsnikeris | aphyr: gotcha. Thanks for the advice. I need to think about this some more. |
| 22:10 | jsnikeris | aphyr: You gave me some good ideas, I appreciate it. |
| 22:52 | hashpuppy | #scala |
| 22:56 | hashpuppy | I'm running a quick poll to learn more about productivity by querying members of the scala, clojure, and haskell community. If you guys have 2 minutes, it would be much appreciated: https://docs.google.com/spreadsheet/embeddedform?formkey=dGZpbHExdHZteXY4VkpaRnBQUzRPRHc6MQ |
| 22:58 | uvtc | hashpuppy: your third question: s/being/well being/ |
| 22:58 | hashpuppy | yes. thanks :) |
| 22:59 | uvtc | er, wait. Hyphenate that: s/being/well-being/ |
| 22:59 | uvtc | hashpuppy: y/w :) |
| 23:44 | scottj | that poll has nothing to do with clojure or programming. |
| 23:46 | eggsby | true scottj |
| 23:46 | eggsby | do you have adhd? |
| 23:50 | amalloy | he probably got distracted and left |
| 23:50 | eggsby | true, he may be meditating though |