#clojure logs

2012-07-23

00:00clj_newb_2834020this is really baffling me
00:00clj_newb_2834020it's like the bemuda triangle
00:00wmealingboth accessing it the same url style ?
00:00clj_newb_2834020yes
00:01clj_newb_2834020they're running the _eaxct_ same code
00:01clj_newb_2834020from git
00:01wmealingoh yeah, but http://whatever not https:// on another
00:01wmealingand localhost not ip address, that kind of thing
00:01clj_newb_2834020I even have all the leingingen *.jar files checked into git
00:01clj_newb_2834020(repl/connect "http://localhost:9000/repl")
00:02wmealingno extra firewall ?
00:02wmealingdoes the sample work http://himera.herokuapp.com/index.html
00:02wmealingon that machine
00:03clj_newb_2834020cljs.user> (+ 2 3) 5 cljs.user>
00:03wmealingyep
00:04wmealingcan you test your other system
00:04wmealingfrom that browser
00:04clj_newb_2834020brilliant
00:04clj_newb_2834020unfortunately, not yet, other system is at home
00:04clj_newb_2834020this is brilliant; checking whether the problem is the browser
00:04clj_newb_2834020or the web serer
00:05clj_newb_2834020also, how does https://github.com/fogus/himera/blob/master/src/cljs/himera/client/repl.cljs work
00:05clj_newb_2834020I don't see the repl/connect anywhere
00:05wmealingi dont know enough sorry clj_newb
00:06wmealingsomething else might fire it off
00:06clj_newb_2834020fogus, are you here?
00:29emezeskeAnd God said, "Let there be lambdas."
00:29emezeskeAnd there were lambdas.
00:33dhklAman.
00:38dhklemezeske: 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:45clj_newb_298jthe good news is that now clojurescript repl is equally broken on both my desktop and my laptop
00:45clj_newb_298junfortunatel, I can't git revert it, since it has something to do with a directory that I had .gitignored
00:45clj_newb_298jthe bad news is ... I now have to fix this
00:47clj_newb_298jwoot
00:47clj_newb_298jand now I have fixed it
00:47clj_newb_298jyay
00:57emezeskedhkl: 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:58emezeskedhkl: Not a very good answer, though :(
00:59dhklemezeske: For some reason, my extern file isn't being processed, and the symbols are munged. I couldn't figure out why :-\
01:00wmealingclj_newb_298j, win !
01:00wmealingclj_newb_298j, so it was not "exactly" the same ?
01:01clj_newb_298jthere was some directory that I had gitignored that caused all the problem
01:01wmealingoh suck
01:01wmealingbut good you've got it solved
01:01clj_newb_298jin the future, I'm going to develop everything in VMs, so besides the hardware, it'll always the the exact same
01:02wmealingi have another suggestion
01:02wmealingits a little odd, but it might work
01:02clj_newb_298jdo tell
01:02clj_newb_298jdoes it involve common sense and logic?
01:02wmealingi'm not sure, its what i'd do, put it that way.
01:02emezeskedhkl: I believe the :exters files are read relative to the classpath
01:02emezeskedhkl: If that's any help
01:02clj_newb_298jwmealing: well, let's heart it
01:03wmealingyou might be able to do something like jenkins for your build and test it with selenium
01:03wmealingor test it with a browser, something like that
01:03clj_newb_298ji tried selenium before
01:03clj_newb_298jit unfortunately crashes the _JVM_ after something like 50 calls
01:03wmealingthere are other options right ?
01:04clj_newb_298jfor controlling the browser besides selenium?
01:06dhklemezeske: 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:07emezeskedhkl: That sounds like the right setup to me.
01:07emezeskedhkl: O_o
01:13dhklemezeske: Yeah, it's super strange. Thanks for your help though
01:15emezeskedhkl: 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:16emezeskedhkl: I assume that's an IRC typo and not the way it's set up in your project ;)
01:22dhklemezeske: yeah, it was an IRC typo :)
01:24dhklsorry
01:28emezeskedhkl: haha no worries
02:57kralnamaste
03:00magopianhello there
03:14antoineBhello, what is the difference between #(%) and (fn [x] x)
03:16ro_stthe way it's written
03:16ro_stfunctionally identical, otherwise
03:16ro_stthe first is expanded to the second upon reading by the reader
03:16hiredman,'#(%)
03:16clojurebot(fn* [p1__27#] (p1__27#))
03:17pyrtsaThere is more. The first tries to call the first argument.
03:17ro_stah :-) one important difference
03:17antoineB,(def a #(%))
03:17clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
03:17ro_stbecause % is in function position
03:17pyrtsa#(%) <--> (fn [x] (x))
03:19antoineBso i can't make (fn [x] x) with #() syntax?
03:19pyrtsaantoineB: AFAIK, no.
03:19antoineBok
03:22mduerksenantoineB: #(do %)
03:22antoineBi am looking for a macro that apply the first arguement as first argument to all the other elements?
03:23antoineB(macro-a 12 (+ 1) (+ 2)) => '(13 14)
03:23unlinkIs it possible to have polymorphic functions and values in Clojure monads?
03:24unlink(other than bind and return)
03:24amalloyantoineB: if that macro existed, it would surely be a function, not a macro
03:24antoineBmduerksen: #(identity %)
03:26antoineBamalloy: (macro-a 12 (+ 1) (+ 2)) => [(+ 12 1) (+ 12 2)] better?
03:26amalloythere's still no reason to make it a macro
03:27bpr(= macro-a ->)
03:27amalloyoh
03:27amalloybpr: not close
03:27amalloyantoineB: okay, now it looks like a macro, but i can't think why you'd want it
03:27antoineB-> is where i get the idea of macro-a
03:30unlinkDo 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:30antoineBdo to something like: (macro-a state (func params) (func params))
03:30antoineBwhere func return arrays and modify state
03:33ro_stsuch 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:34ro_sti guess a macro that converts enlive code to enfocus is possible
03:35mduerksenantoineB: you might want to look at juxt
03:36ro_stRaynes: are you able to use templates and template code clj and cljs with mustache?
03:36ro_sti'm not locked into en* … yet
03:37RaynesI'm not sure what you'd use for a mustache library in cljs.
03:37RaynesThere are probably js libs you could use.
03:39dhklNot a cljs library, but hogan.js is quite nice to use as a JS mustache implementation
03:39ro_stit's very close: https://www.refheap.com/paste/3738
03:40ro_sti'm sure (through symlinking) i can make the paths identical
03:40ro_stit's just those selectors
03:40ro_stit's be *awesome* to be able to write and test templates in the jvm with a repl and midje
03:42antoineBmduerksen: the default of juxt it is not clean i need to pass #(func % params)
03:42antoineBi will write my own macro
03:50antoineBi would like to use my own library jar into a lein project how i do that?
03:51ro_stthere was an article about that on planet.clojure.in in the last couple days
03:53antoineBok simple but efficient
04:16antoineBhere is the macro http://pastebin.com/JnEbLPLt
04:51francisMy 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:52francisI'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:52franciscould anyone point me in the right direction?
04:53dhklfranics: Have you looked at options like ring and compojure?
04:54francisI have, but I belive that I'm totally missing the whole http/server idea here
04:55francisI have a ring server, I want to set it up so I can post data to it
04:55unlinkIs lein-cljsbuild the Whole Story(TM) about building ClojureScript applications?
04:55francisso I would have a 'listener' at a specific url that accepts json/s-expression data?
04:58francisdhkl: Thanks, what I needed was in the compojure wiki.
05:00dhklfranics: No problem. Also check out https://github.com/ring-clojure/ring/wiki/ for what's happening under the hood.
05:00ro_stunlink: yup
05:00ro_stunlink: https://github.com/emezeske/lein-cljsbuild/blob/0.2.4/example-projects/advanced/project.clj
05:01ro_stclone that and start coding
05:01unlinkro_st: What if I don't have an accompanying Clojure project?
05:01jballancquick question: what's the best way to set *out* to a file?
05:01dhklunlink: it is used quite extensively. The clojurescript wiki also recommends it.
05:02jballancall I've figured out is with-open and then binding to bind the file to *out*...but that seems clumsy
05:02ro_stunlink: you don't need one. you can use a cljsbuild project and write .cljs files exclusively
05:03ro_stbut i suggest you use some clj to do a webserver and some html to make testing easy
05:03dhklro_st: Do you have any experience with using externs along with lein-cljsbuild?
05:03unlinkI guess I just don't want to use leiningen if I don't absolutely need to.
05:04ro_stno. but i do with vanilla Google Closure
05:05ro_sti think cljsbuild simply passes all the externs along to the gclosure compiler directly
05:05dhklro_st: I've been having problem with lein-cljsbuild not using the extern files I supplied to it in project.clj
05:06dhklIt seems like no matter what I do, advanced optimization will munge even the names I defined in the extern file
05:07dhklI have to fall back to coffeescript for now to keep the project going :-\
05:07ro_styou're using externs to talk to an external library, right?
05:08ro_stare you sure that a) it's finding the file? b) the file's externs are correctly defined?
05:11dhklro_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:12dhklThe extern file should be in the classpath. And in the externs.js, I just have something simple like: var angular = {}; angular.module = function() {};
05:13dhklTo prevent the closure compiler from munging the angular.module call into something weird
05:14ro_styeah that should work
05:14ro_stit might be that you need to decorate with /** @constructor */ somewhere, or similar
05:15ro_styou need to figure out what the root cause is first. can't find? or invalid syntax?
05:16dhklwell, it basically munged angular.module(...) to angular.sb(...)
05:16ro_staha
05:16ro_stis module something that gets called as new angular.module(); ?
05:17ro_stif so, it needs a @constructor jsdoc
05:17dhklI think so.
05:17ro_styay static analysis syntactic crutches
05:17dhkl:-) thanks ro_st!
05:17ro_stbonne chance
05:35ro_stany enlive users? how do i compose defsnippet with clone-for?
06:11stainis 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:11stainbut it feels like I might fork off lots of while loops when people might never check it
06:12stainalso 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:22ordnungswidriganybody has a pointer how to generate all sublists of a list in core.logic?
06:29shinta42anyone using lighttable?
06:47michaelr`hello!!!
06:48ro_st3 bangs. something the matter?
07:00michaelr`ro_st: ah, you know, the life :)
07:01ro_stdebugging clojurescript is maddening.
07:01ro_st#justsaying
07:02unlinkro_st: how do you?
07:02ro_styou learn to read the js it makes
07:02ro_stand lean heavily on chrome dev tools
07:05S11001001just don't mess up and you won't need to debug anything
07:06ro_stin a language set up to learn by experimentation? ;)
07:11michaelr`hmm
07:12michaelr`should i define functions in a (let) expression in a (defn)?
07:12michaelr`like (defn [] (let [f (fn [] 123)]) (f))
07:12michaelr`like (defn [] (let [f (fn [] 123)] (f)))
07:12michaelr`can it be a peformance hit?
07:13cshellI don't think so, it would be if you did defn inside
07:13michaelr`essentially I want to refactor one large function into a few, but they don't have meaning outside of that function
07:13cshellyou're just creating an anonymouse function
07:13ro_stuse letfn: (defn ff [] (letfn [(fn-name [args] ddd)] …))
07:14ro_stand it's compiled once at compile time
07:14CheironHi, how to map this Scala code to clojure? http://pastie.org/4305591
07:14ro_stno performance hit
07:14michaelr`great
07:14michaelr`thanks
07:14cshellnice, didn't know that
07:14ro_stit's actually a great way to refactor
07:15ro_stwhen you find yourself needing one inner fn somewhere else, promoting it to the top is a 5 second op
07:15michaelr`,(doc letfn)
07:15clojurebot"([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:15ro_stCheiron: (let [[left secondLeft] (parse leftSheet object)] ...)
07:16ro_stCheiron: i'm assuming that var(…) destructures
07:16ro_stin scala
07:16ro_stwooo it's working
07:18ro_stquestion for people who get macros: https://www.refheap.com/paste/3741
07:37ro_stwith enlive/enfocus, how do i transform the node at the root of the defsnippet?
07:37ro_sti've tried using :root in the selector, no dice
07:38cshelluse the same selector
07:39ro_stas the snippet's defining selector?
07:40cshellyes
07:40ro_stthat doesn't appear to work :(
07:41cshellwhat's your snippet?
07:42ro_sthttps://www.refheap.com/paste/3742
07:42ro_stand i call (variable {:template {:name "mySubject"} :value "The subject!"})
07:43cshellin this can you call just :a for the second selctor?
07:43ro_stdoh *blush*
07:44ro_stthanks
07:44cshellnp :)
07:45ro_stare you in enlive, enfocus, or both?
07:45cshelljust enlive
07:48ro_stcool
07:48ro_stvery nice system
07:49cshellyeah, it makes it very easy for my web designer and I to work together
07:50jsnikerisHi 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:50jsnikerisDoes anyone see anything wrong with that?
07:51cshellwhat happens?
07:51ro_stcan i do multiple transforms like i do there or do i have to thread with -> somehow?
07:51jsnikeriscshell: I just see the usual header message
07:52cshellro_st: yes just put them sequentially [selector](tranform) [selector](transform)
07:52cshelljsnikeris: can you put the print outside of the profile to make sure tthat print works outside?
07:52ro_steven if the selector is the same?
07:53cshellyeah
07:53cshelli think it chains though - so your first output will effect the second
07:53ro_stit doesn't
07:54ro_stnot within a single transform anyway
07:54cshelldid you put two selectors?
07:54ro_stah i need do→
07:56ro_styup that does the trick
07:56jsnikeriscshell: the content of profiles.clj needs to be a map
08:04cshelljsnikeris: hmmm, not sure, I've never used lein2, only read the docs
08:04cshellfrom the top of the sample file, exppressions should be working
08:06ro_sti never got repl init to work
08:06ro_stbreak time phew
08:06FrozenlockGood morning fellows!
08:08jsnikeriscshell: Ah, didn't know there was a sample file. Thanks!
08:08FrozenlockIs 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:12jsnikerisro_st: it looks like you need to specify init-ns as well
08:14jsnikerisro_st: I lied. Just :init is fine
08:15S11001001Frozenlock: clojure.xml operates on its particular maps, not maps in general; you need to make clojure.xml maps out of your maps first
08:16FrozenlockS11001001: O_o
08:16S11001001so let's say you write a function that accepts args of this form: {:name "blah" :vals [...]}
08:16S11001001ought this same function just understand how to deal with maps that don't follow that format?
08:17S11001001like I want to pass {:private (fn [x] 42)}
08:17S11001001this will not work
08:17FrozenlockOh! So there's a given set of keys I need to have?
08:18S11001001the best way is to take an XML you have and parse it
08:18S11001001then you will see the format the maps ought to be in
08:18S11001001and, yes
08:18FrozenlockI will do, thanks :)
08:57sayyestolifeI'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:59sayyestolifeIs this error familiar to anyone?
09:19antares_sayyestolife: yes
09:19skoodgeis it possible to access the local variables of a datatype that was defined using deftype inside of the extend-protocol macro?
09:19antares_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:20antares_skoodge: you should be able to access fields with (.field struct) for any deftype-defined type
09:26skoodgeantares_: that works, thanks a lot!
10:17cshellthis is a noob js question, but in js/html do distinct <script> tags have visibility into previous <script>tags?
10:17antoineBhow can i add an element to a list
10:17antoineB?
10:17cshellconj
10:17cshell,(doc conj)
10:17clojurebot"([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:17sayyestolifeantares_: but I don't have any references to hiccup.page-helpers anywhere in my code
10:18antoineB,(list? (conj '(1 2) 3))
10:18clojurebottrue
10:18sh10151cshell: 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:18antoineBin my code i get it to be of type Cons
10:18cshell,(conf '(1 2) 3)
10:18clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: conf in this context, compiling:(NO_SOURCE_PATH:0)>
10:18uvtc~cheatsheet
10:18clojurebotCheatsheets with tooltips can be found at http://jafingerhut.github.com/ .
10:18uvtcantoineB: ^^
10:18cshell,(conj '(1 2) 3)
10:18clojurebot(3 1 2)
10:19cshellsh10151: thanks!
10:19antoineBuvtc: i know, in my code the use of conj return a non list? object
10:19ro_stuvtc: those cheatsheets rock!
10:19cshellonly if the collection was another list
10:20csheller, was something other than a list
10:20clojurelearnerHello Lein Gurus, Need help on setting up lein environment for a plugin development
10:20clojurelearnerRef: https://github.com/technomancy/leiningen/blob/preview/doc/PLUGINS.md
10:20clojurelearnerDuring 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:20clojurelearnerAs given in the instructions, I have setup .lein-classpath to include plugin src folder path
10:20clojurelearnerbut "lein classpath" from test project doesn't seem to be picking it up
10:20clojurelearnerAny idea what I am missing? Any help is much appreciated
10:21ro_stclojurelearner: #leiningen might also be of help to you
10:21antoineBcshell: ArraySeq
10:21uvtcantoineB: a lot of clojure functions return (lazy) seq's. So, they may not be a concrete list, per se.
10:21clojurelearnerro_st: Thanks, I tried but no help :(
10:22antoineBclojure.lang.ArraySeq cannot be cast to clojure.lang.IPersistentStack
10:22antoineBi want use pop
10:24antoineBuvtc: ok
10:24uvtcantoineB: Note that you can always get a list or vector if you really want by doing `(list my-seq)` or `(vec my-seq)`.
10:25antoineBrest is ok
10:26uvtcantoineB: 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:27antoineBuvtc: my mistake was to belive my object was of type 'list
10:28antares_sayyestolife: Noir may have them. Have you tried Noir 1.3 betas?
10:29ro_stclojurelearner: i suggest issuing on github. if it's not doing as the docs say, file a bug.
10:31ro_stit's not as immediate as resolving it with someone on here, but it's quite likely to help out in the end
10:33clojurelearnerro_st: Cheers mate. I will try Github
10:33uvtcAt 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:35uvtcWill this function consume too much stack, or does the recur save it?
10:35ro_stgood luck :)
10:35ro_strecur doesn't use the stack
10:35ro_stthat's the whole reason it exists
10:36ro_stunder the hood, (loop .. (condition ? recur : quit)) is rewritten to while (condition) {...}
10:36uvtcro_st: Right. But there's 2 paths out of that `do`. One that consumes stack, and one that doesn't ...
10:36ToxicFroguvtc: the one that consumes stack will never consume more than n stack frames
10:37ToxicFrogSo you'll hit tower sizes that take effectively infinite time to run before you run out of stack.
10:37ro_stuvtc: the if at the top saves the stack
10:38ro_sti think the first leg of the if is the final move in the solution
10:38uvtcro_st: right.
10:39uvtcToxicFrog: 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:39uvtcWhoops. I take that back.
10:39uvtcI just got dumped out of my repl.
10:40uvtcThough it didn't tell me why...
10:40uvtcThis was at a hanoi level of 15.
10:40uvtcI like saying "hanoi level", btw.
10:42duck1123With recursion, like war, it's important to have an exit strategy
10:43uvtcduck1123: 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:44ToxicFroguvtc: hanoi is O(n!), so your 15-level hanoi would require 1307674368000 iterations.
10:44uvtcduck1123: but this hanoi example has 2 non-trivial ways out: one is the typical `recur` tail call, and the other is not.
10:45uvtcToxicFrog: 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:45ToxicFroguvtc: (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:46uvtcToxicFrog: 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:47uvtcToxicFrog: 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:48uvtcToxicFrog: Maybe you meant that the other way round: `recur` is tail-recursion implemented using iteration.
10:48uvtc:)
10:48duck1123The nice thing about recur is that it'll throw if it's not in the tail call. That extra assertion is nice.
10:50ToxicFroguvtc: well, ok, recur is used to implement iterative functions using tail recursion and is internally implemented with iteration anyways
10:50uvtcduck1123: I agree, it's nice that it catches those for you.
10:52duck1123I'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:52antares_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:53ro_stall 3 up from cape town, south africa
10:53uvtcantares_: Northeast, USA : works
10:53duck1123works for all, Detroit, MI
10:53_zachantares_: NYC, all work
10:53antares_ok, thank you
10:54llasramantares_: names do no not resolve, SE US
10:54antares_haha
10:54TimMcantares_: You forgot to (take 3 ...) -- the channel is going to realize the full seq!
10:54antares_llasram: yes, it is a name resolution issue. We use zerigo and they just suffered a massive DDoS attack (possibly still going on).
10:55TimMcAll works, Cambridge, MA. :-P
10:55carminecall works, Omaha NE
10:56S11001001this is a clever ploy by antares_ to get people to visit his sites and I shan't be hoodwinked so easily
10:59uvtcantares_: 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:59TimMcIt's actually far more devious: He wants his URLs in the browser history autocomplete so that we'll poke at them later.
11:00ro_sti wish everyone putting stuff on clojars did what antares_ does. these sites rock
11:00ro_st,(inc antares_)
11:00clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: antares_ in this context, compiling:(NO_SOURCE_PATH:0)>
11:00ro_stlol
11:00uvtc(inc antares_ )
11:00lazybot⇒ 1
11:01antares_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:01kmicuCan anyone disscuss about this https://vimeo.com/46163090 @ 16:35 and 32:15 ;)?
11:01pzolhi… 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:02antares_I shouldn't have mentioned those "SEO purposes", now S11001001 and TimMc won't ever believe anything I say :P
11:02wmealingantares_, all 3 working, Brisbane, Australia.
11:02antares_pzol: yes, by using po# (a local name starting with po then will be generated)
11:04pzolantares_ 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:05duck1123pzol: Are you trying to point po to the po where the macro is defined, or where it is used?
11:05pzolduck1123 when it is used
11:05antares_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:07jballancquick question: what's the suggested way to set *out* to a file
11:08jballancI know I can do with-open and use binding...but it seems clumsy
11:08pzolantares_ hmm with po# it expands too early
11:09antares_jballanc: binding. If you want to do it permanently, alter-var-root.
11:09jballancso there's no with-out-file?
11:09jballancthat's mildly dissapointing :(
11:10TimMcThere could be in maybe 2 lines of code. :-)
11:10jballancwell...yes :)
11:10duck1123I think for most people that want an out file, it's not that simple
11:11jballancI was actually asking in regards to pr
11:11jballancsince pr automatically dumps to *out*
11:11antoineBis there a problem to make a recursive call of a macro ?
11:12duck1123pzol: 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:12pzolduck1123 :) any hints what to google for?
11:13duck1123I 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:15pzolduck1123 that would spoil my dsl :)
11:16duck1123you could get fancy with resolve (dynamically resolving vars in the current ns) *insert brittleness disclaimer*
11:17llasrampzol: Is ~'po not what you want, like you're doing with ~'xs?
11:17llasram(inserting obligatory note on the evils of variable capture etc)
11:18pzolllasram 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:18llasram~'po expands "immediately" to the non-namespaced symbol 'po'
11:18clojurebotsymbols is kind of fun
11:20llasram&(let [po :foo] `(defn example [~'xs] [~po ~'po]))
11:20lazybot⇒ (clojure.core/defn clojure.core/example [xs] [:foo po])
11:21llasrampzol: What am I missing?
11:21duck1123llasram: that's what I was looking for
11:23llasramAh, cool
11:23antoineBsomeone can ensure me that executing a macro from another macro is impossible?
11:24duck1123,(-> 2 (->> println))
11:24clojurebot2
11:24duck1123nope
11:24antoineBi mean inside a defmacro
11:25antoineB(defmacro a [...] ... (a )...)
11:25llasramantoineB: You can have a macro recursively call another macro. It has exactly the same problems as normal recursive functions
11:25llasramHave to make sure it terminates without blowing the stack :-)
11:26pzolthanks will try the double macro ;)
11:34antoineBthe idea of the macro https://gist.github.com/3164252
11:37TimMcpzol: I think with-open is recursive.
11:43antoineBTimMc: with my meaning of "recursive macro" it is not, the call is under a `()
11:45llasramantoineB: 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:45llasram(In that the macro creates a recursive expansion, rather than recursively calling itself as part of generating expansion)
11:46TimMcantoineB: Just make a defn that contains most of the syntax manipulation, then call that for the recursive work.
11:47bitpimpjust found out Puppet Labs is using Clojure
11:47TimMcantoineB: https://github.com/baznex/imports/blob/master/src/org/baznex/imports.clj#L166 <-- here's a macro calling a fn
11:47llasrambitpimp: Oh, interesting. What for?
11:47nDuffbitpimp: ...given as DeepakG (brownman, on IRC) is working there.
11:48bitpimpllasram: PuppetDB
11:48nDuff...yup, that's Deepak's project.
11:49bitpimpgithub.com/puppetlabs/puppetdb
11:50nDuff(grimradical on github)
11:50llasramInteresting
11:51bitpimpthe presenter cited clojure as one of their four languages
11:52bitpimpclojure for creating thousands of nodes in minutes with puppet
11:56llasramnDuff: 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:57bitpimpwell, one thing that would drive me to puppet is their 800+ person irc \
11:58bitpimpthat's a community
12:02nDuffllasram: Really? Chef's model seemed a lot saner to me for exactly that use case, and that's after extensive use of both.
12:03nDuffllasram: ...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:03nDuffI 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:03nDuffNever felt the need to do that in Chef.
12:04grim_radicalnDuff, bitpimp: indeed, we use clojure (I'm deepak from puppet labs)
12:04grim_radicalnDuff: good to see you!
12:04bitpimpgrim_radical: greetings
12:04nDuffgrim_radical: Likewise! Missed you stepping in. :)
12:04llasramnDuff: 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:05julienfantinTrying 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:05nDuffllasram: ...so, Chef scripts aren't actually imperative -- they're executed in two passes: The first sets up resources, the second compiles and executes.
12:05llasramnDuff: Hmm, ok. I'll have to take a closer look at it some time then.
12:05nDuffllasram: ...ordering is used for implicit dependency information, so deps aren't usually explicitly declared.
12:05grim_radicalit'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:07nDuffgrim_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:07nDuffgrim_radical: ...how long has that been available as a customer-visible feature?
12:07grim_radicalnDuff: not too long...maybe 2 months?
12:07nDuffHeh. Not bad uptake, then.
12:08grim_radicali'm curious about other clojure projects (that aren't developer tools) with large, end-user deployments
12:08kreig1by end user deployment you mean running on user machine?
12:09grim_radicalkreig1: that's what i'm thinking, yeah
12:09kreig1our 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:09grim_radicalkreig1: oh, nice!
12:10kreig1it's a security tool, aimed towards the upper end of the market, so not every going to be "tons of users"
12:11nDuffgrim_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:12grim_radicalnDuff: not me...maybe someone covered it at OSCON?
12:13grim_radicali 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:13bitpimpgrim_radical: nope... Michael Stahnke at puppet camp chicago
12:13kreig1anyone in Chicago?
12:13grim_radicalbitpimp: ah, mike! yeah, that makes sense now
12:14kreig1is there a clojure group in Chicago yet?
12:14bitpimpdefinitely
12:14antares_bitpimp: puppet uses Clojure?
12:14kreig1\who bitpimp
12:14bitpimpBedra is here now
12:14grim_radicalantares_: yes
12:14kreig1hey, stupid pidgin!
12:14bitpimpantares_: yep
12:14nDuffDoes Chicago have substantial shops using Clojure other than GroupOn?
12:14nDuffThey were the only one I knew about, and I'm not going anywhere _near_ that business model again.
12:15kreig1nDuff: we are clojure, but I just live and work in Chicago, the company is in NYC
12:15nDuffHmm.
12:15kreig1nDuff: there are several financial firms using it too, but not as core elements
12:15kreig1nDuff: a couple lisp companies too 8) Common Lisp that is
12:15grim_radicalkreig1: 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:17kreig1our clojure code is really two parts, a rule system for our malware analysists to write rules/triggers in that identify malware behavior
12:17nDuff...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:17kreig1and a Noir app that provides a UI to the malware analysis and a DB of all the results (150gig+, in postgres, via Korma)
12:17grim_radicalkreig1: ah, cool
12:17dpritchettgrim_radical: did you ever work with Jesse W at puppet?
12:17kreig1nDuff: oh, lots of fun stuff here
12:18kreig1nDuff: natural language processing, CL, clojure, rails, lots of civic engagement stuff too
12:18grim_radicaldpritchett: 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:18kreig1nDuff: here meaning chicago
12:18nDuffkreig1: Mmm -- encouraging to hear it.
12:18technomancykreig1: do you have any special handling of DB schema changes?
12:19dpritchettcool! i know he likes clojure so i was surprised to see you doing some of it there, he never mentioned it
12:19kreig1nDuff: if you ever want more specifi info, let me know craig@red-bean.com
12:19grim_radicaldpritchett: this project came together fairly recently, after he left i believe. but i support all clojurians everywhere. :)
12:20grim_radicalkreig1: yeah, my stuff is all clojure, but lots of interop with java libs (activemq, jetty, etc)
12:20nDuffkreig1: 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:20grim_radicalkreig1: also using postgres, but we use clojureql + raw sql for our database interactions
12:20kreig1technomancy: 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:20technomancygotcha; ok
12:21kreig1technomancy: however, I recently wrote little lib for running clojure code against the DB for some migrations
12:21technomancyI'm also favouring a light approach, but not quite so hands-off =)
12:21technomancyhttps://github.com/heroku/buildkits/blob/master/src/buildkits/db/migrate.clj
12:21kreig1technomancy: when you have DBs of this size, automating is just inviting fuckage
12:22kreig1technomancy; I prefer to handle them myself. Most of the automation is really to make my dev cycle easier
12:23technomancyI 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:23kreig1technomancy: that's even lighter than mine
12:23grim_radicaltechnomancy: yeah, we do something similar to your migration code
12:23grim_radicalonly the code is uglier. :P
12:23kreig1technomancy: we have an "appliance" deployment that is the most prone to getting out of sync, since we have to coord with client
12:24kreig1technomancy: but that's a situation where our lead engineer runs the update
12:24kreig1technomancy: it's not a "mass deployment" system, but this will change as we bring a few more appliance clients online
12:24technomancyyeah, 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:25grim_radicalas it's end-users running my stuff, we just auto-migrate at daemon startup before we do anything else
12:25kreig1technomancy: yah, and in this case, it's all written up in a document, with the sql they should run
12:25grim_radicalwe're pretty rigorous about testing that in-house before unleashing it on the world, though
12:25kreig1grim_radical: we can't do that, because a migration might take a day or more
12:25grim_radicalkreig1: ouch, yeah. :(
12:25antoineBi try to add my own jar inside lib/ but when i use (import 'stuff) it didn't find the class?
12:26technomancyI 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:26technomancythough I suppose down migrations would also be useful for switching away from backwards-incompatible schema change branches in dev too
12:26kreig1technomancy: yah, I have never downmigrated in my life, so I don't support those in my little tool
12:26grim_radicaltechnomancy: yeah, me too
12:27technomancyantoineB: lib/ is just a cache; it's not the canonical store of dependencies
12:27technomancy~repeatability
12:27clojurebotrepeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability
12:27technomancy^ antoineB might be interested in that link
12:29kreig1grim_radical: we used clojureql at first, but switched to korma because I found it easier to compose queries
12:29grim_radicalkreig1: heh, we actually did the opposite. :)
12:29grim_radicali think that at the time (~5 months ago?) korma couldn't handle some of the aspects of our schema
12:30kreig1grim_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:30grim_radicalwe use lots of composite keys and a slew of postgres-specific features
12:30kreig1grim_radical: I never touch the entity shit
12:30grim_radicalahh
12:30kreig1grim_radical: so compound keys are no prob
12:31grim_radicalre-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:31kreig1instead I have funcs like "ensure-joined"
12:33kreig1I break query composition down into a couple steps
12:33kreig1joins, conditionals, project/field selection
12:34kreig1our query tools are built on top of those three phases
12:35kreig1same artial query can then be used for getting my results, or doing a count on some distinct field
12:47grcemacs/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:49alex_baranoskyI'm seeing some weird behavior I don't understand, and could use some help
12:50alex_baranoskyI 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:51alex_baranoskyI'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:51hiredman:(
12:51alex_baranoskyat least one of the culprits i sa simple defn'ed fn
12:52hiredmandon't use = on functions
12:52alex_baranoskyso it isn't like it is being generated each time through
12:53alex_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:54hiredmanalex_baranosky: don't do that
12:54alex_baranoskyha, classic
12:54technomancyhiredman: are you referring to the way he's testing or the way he's tweeting on IRC?
12:55hiredmantechnomancy: the testing, but the tweeting on irc is also annoying
12:56duck1123alex_baranosky: Is it possible for you to pass around and compare the vars that point to the fns?
12:56technomancyhiredman@thelastcitadel.com: gotcha
12:57alex_baranoskyI was thinking that I could try that
12:58grchmm 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:58kreig1grc: woah
12:58grcstill at least I've got it working again, albeit without defauts
12:58technomancygrc: that must be a very old version of swank
12:59grctechnomancy: I won't argue but the laptops only 3 months old.. where have I screwed up? (semi-rhetorical)
13:00technomancydepends on how you installed it
13:00duck1123grc: Are you specifying swank-clojure in your project, or plugins? What version?
13:01grcduck1123: :plugins [[lein-swank "1.4.4"]])
13:01hiredmanwin 15
13:04grcand lein version gives 2.0.0-preview6
13:05duck1123trying to define a map like {"foo" {"bar" {"baz" "quux"}}} in java makes me realize how spoiled I've been by Clojure
13:06gtrakduck1123: pain
13:07gtrakMap<String,Map<String,Map<String,String>>> map = new HashMap<String,Map<String,Map<String,String>>>()
13:07duck1123gtrak: yep, that's the line
13:08gtrakthen you have to recursively put in the inner ones
13:09gtrakgenerally you'd just use objects instead
13:19zerokarmaleftgrc: i'd double check to see if you have old versions of lein-swank hanging around in ~/.m2
13:40technomancycurious: how many emacs users are still on 23?
13:40Bronsao/
13:41technomancynDuff: yeah, but it's been stable for years
13:41Bronsathat, plus i dont want to touch my conf anymore
13:41uvtc`apt-cache search emacs24` gives me results on Xubuntu 12.04.
13:41nDufftechnomancy: ...sure, but there are people (myself included) who prefer to stick with vendor-supported environments
13:41kreig1I'm running 24.1.1 on arch
13:42nDuffuvtc: I'm surprised -- on current Mint, I had to install it through a PPA.
13:42technomancynDuff: yeah, understandable. I feel that way about everything except emacs =)
13:42uvtcnDuff: I've currently got it installed via the PPA. Just noticed that apt-cache can get an emacs24 today, actually.
13:43kreig123.4.1 on openbsd 5.1 8)
13:43nDuffuvtc: apt-cache shows PPA contents when they're added.
13:43nDuffuvtc: ...so that's actually _not_ an indication that it's upstream.
13:43technomancyI've required 24 for the starter kit for over a year
13:44uvtcnDuff: 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:44nDuffuvtc: Right -- that was recently added _to the PPA_.
13:44technomancynrepl.el currently requires it
13:44uvtcnDuff: Ah. Thanks.
13:44technomancygiven that people still on 23 can continue using slime we'll probably leave it that way
13:45technomancybecause supporting 23 means giving up closures and partial application, which is a huge pain in the neck
13:45nDuffOooh. How's nrepl.el coming in terms of competitiveness with slime?
13:45technomancynDuff: catching up.
13:45nDuffNice.
13:46technomancythe stack trace handling hasn't been merged yet; that's probably the main thing keeping me from telling everyone to use it
13:48technomancyI have a branch that lets you browse namespaces like ido-find-file, which you can't do in slime =)
13:48cemericktechnomancy: I'm thinking of adding a :pprint option to the eval middleware. Any objections?
13:48technomancycemerick: sounds reasonable
13:49cemerickThe same could theoretically be accomplished via session-local middlewares, but that's a recursive rabbit hole that I'm not ready to tackle.
13:49technomancydo you have to have commit rights to be able to tag issues in github?
13:50cemerickprobably
13:50amalloytechnomancy: yes
13:50technomancylame
13:50amalloyi thought you'd discovered and complained about this before
13:51amalloysomeone else, i guess
13:51dpritchettDon't you remember the DongML zedshaw drama?
13:51technomancyI keep having to hold myself back from tagging these nrepl issues
13:51cemerickNothing keeps one from complaining about the same thing multiple times.
13:51amalloycemerick: no, but i was surprised he discovered it multiple times :P
13:52cemericktechnomancy: there aren't any nrepl issues on github…?
13:52technomancycemerick: sorry, nrepl.el
13:52cemerickah, right
13:53amalloyduck1123, gtrak: fwiw, java 7 cuts the nonsense on that line in half. still pretty unpleasant, but not as bad
13:53TimMcamalloy: What, typedefs?
13:53TimMcOr inferred generic types?
13:54gtrakTimMc: diamond operator, yea
13:54amalloyhaha what, typedefs?
13:55TimMcI can hope, can't I? :-)
13:55gtrakre: typedefs, I would say 'if only', but I've actually used C++
13:56nDuffgtrak: Yes, but C++ ruins _lots_ of things that can be good if implemented better.
13:56gtraknDuff: pretty sure most of us are in a similar camp on that here
13:57gtrakI would venture to say it's 'mutiple inheritance? why are you inheriting in the first place?'
13:57emezeske_Bah, multiple inheritence is fine in C++, just don't do it with non-abstract classes and you're fine
13:57HodappnDuff: you'll receive no flaming from me on that.
13:57emezeske_If you inherit from two concrete classes, well, you reap what you sowed
13:59gtrakor 'you should treat your inheritance hierarchies as data'
13:59nDuffEh. MI _can_ be sane -- see Clojure's approach, disallowing use in any ambiguous case but providing a method to manually establish precedence.
13:59HodappIt 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:00nDuffI'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:00nDuffHodapp: Heh.
14:00Hodappand they will never make the connection between the two things.
14:01HodappSimple 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:02Hodappthey've just turned something stateless into something stateful, something simple into something complex, and made optimization that much more difficult.
14:02nDuffHodapp: May I quote you?
14:03Hodapper, sure
14:03Hodappwhat did I quotably say?
14:04nDuffHeh -- the 3-line rant as a whole, I think, puts things well.
14:05Hodappfair enough
14:05HodappHave you heard of Greenspun's Tenth Rule? He put it more concisely, I think.
14:06TimMc" Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.
14:06TimMc"
14:06Hodapp...including Common Lisp.
14:07gtrakthis is the joke of clojure and java
14:07clojurebotIn Ordnung
14:07Hodappgtrak: bah?
14:07TimMcclojurebot: forget this |is| the joke of clojure and java
14:07clojurebotI forgot that this is the joke of clojure and java
14:08gtrakoh oops, java has some metaprogramming... let's use it to build a lisp :-)
14:08gtrakjvm/java's a sufficiently complicated C program
14:08HodappI have also been reading about Aspect Oriented Programming with some curiosity
14:08TimMcTCons<String,TCons<String,TCons<Double,TNil>>> for a 3-tuple :-P
14:14SegFaultAX|work2What does the :let key do in a doseq expression?
14:15emezeskeSegFaultAX|work2: (doseq [... :let [...]] ...) -> (doseq [...] (let [...] ...))
14:15emezeskeSegFaultAX|work2: It basically just gives you a let while avoiding one level of indentation
14:19uvtcOh, 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:20uvtcHm. Doesn't work for `dotimes` for me though ...
14:20uvtc&(dotimes [i 10 :let [j (* i i)]] (println j))
14:20lazybotjava.lang.IllegalArgumentException: dotimes requires exactly 2 forms in binding vector in clojure.core:1
14:21uvtcwhereas
14:21uvtc&(doseq [i (range 10) :let [j (* i i)]] (println j))
14:21lazybot⇒ 0 1 4 9 16 25 36 49 64 81 nil
14:25amalloyuvtc: doseq is the same as for; other functions are not
14:26uvtcamalloy: Ah, the docs for `doseq` even say, "with bindings and filtering as provided by "for".
14:26uvtc"
14:26amalloyemezeske: it's more than that, really, because you can put more seqs and/or :while/:when tests after your :let
14:27amalloydoesn't matter so much in 'doseq, but in 'for you need that to prevent adding an element to the output seq
14:27amalloy(or to keep it flat, or whatever)
14:28emezeskeamalloy: Wow, I did not know you could do that
14:29emezeskeamalloy: Speaking of, is that documented decently anywhere? Every time I try to look at the docs for e.g. (for) I am disappointed
14:29amalloyeh? for shows you a two-element iteration with a :when and a :while test. what more do you want?
14:31emezeskeI... I swear that wasn't there before
14:31amalloydnolen: 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:31amalloyemezeske: since at least clojure 1.2, sorry man
14:32amalloymaybe you were disappointed because you were actually looking at the docs for <
14:32emezeskeamalloy: I just, I have no idea what's going on anymore
14:32hiredmanamalloy: uncheked_inc may not have an instrinsic
14:32amalloyhiredman: i hadn't checked that yet, but looking now i do see one
14:32amalloy"public static long clojure.lang.Numbers.unchecked_inc(long)", oa(LCONST_1, LADD)
14:33hiredmanyeah, I just looked and see it too
14:33augustlis it possible to make leiningen use ~/.m2/settings.xml for deploy repository credentials?
14:33hiredmanamalloy: interesting, what is the context for the call to inc?
14:33augustlI already have my auth details there, would be nice if I didn't need to copy it into ~/.lein
14:34amalloyhiredman: https://gist.github.com/3165282
14:36amalloyrelevant section of the disassembly: https://gist.github.com/3165293
14:37hiredmanamalloy: the intrinsic stuff actually emits both paths, with a guard and jmp to the correct path
14:38amalloywhat would it guard? the object on the stack is already a primitive long, not an Object; there's nothing to check
14:39amalloyeither way, i've updated https://gist.github.com/3165293 with the whole disassembly if that's helpful; pop() is at line 460
14:39hiredmanah, sorry, I am mistaken, I was looking at the "intrinsic predicate" stuff, which is not relevant
14:43dnolenamalloy: hmm, what's the output for prim fns that take long?
14:43amalloyi don't understand the question, dnolen
14:43dnolenamalloy: what I mean what does inc look like when it's taking a long from within a prim fn.
14:44amalloyyou mean like, what does (defn f ^long [^long i] (inc i)) compile to?
14:44dnolenamalloy: yes
14:44hiredmanamalloy: interestingly it looks like the compiler only uses intrinsics for ifs
14:45hiredmanso the call to clojure.lang.Numbers.unchecked_inc is as close as you'll get
14:45amalloydnolen: it uses ladd
14:46hiredman:|
14:46hiredmanmaybe I am looking at the wrong version of the compiler
14:46amalloyhiredman: i'm using 1.4.0 release, fwiw. dnolen: https://gist.github.com/3165351
14:47_zachis there a clojure-py equivalent to python's "if __NAME__ == '__MAIN__'"?
14:47_zachexcept lowercase
14:47hiredmanpffft, emacs opened Compiler.java.orig when I wasn't looking
14:48dnolenamalloy: hmm what happens you move those math ops into a helper prim fn that takes long?
14:48amalloyhiredman: 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:49technomancy_zach: sure, (defn -main [& args] [...])
14:49amalloydnolen: it compiles to an invokePrim of the helper
14:50hiredmanamalloy: it is because one of the ops there is boxing
14:51hiredmancount
14:51hiredman(long (count ...)) might fix it
14:51amalloyoh, that makes sense. like, mod doesn't have a primitive version?
14:52_zachtechnomancy: Ah, didn't know that was implemented. Thanks.
14:52technomancy_zach: probably worth reading through `lein help tutorial` at some point; explains all that stuff.
14:52hiredmanamalloy: ah, yeah, maybe mod
14:53_zachtechnomancy: Ah, I see -- I was talking about clojure-py, not jvm.
14:53technomancyoh, no idea
14:53_zachtechnomancy: Thanks though :)
14:53technomancymisread
14:53hiredmanmust be mod, mod is a regular clojure function
14:54amalloyyeah, that's it
14:55amalloyif i switch mod to +, it uses primitives
14:55amalloyi'm a bit sad it doesn't at least do the inc with primitives first, before boxing up for mod
14:56hiredmanit is interesting, a sort of inverted flow of control
14:57hiredmandepending 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:57hiredmanit may do what you want if you hoist the bits out as a let
14:58SegFaultAX|work2emezeske: Seems kinda pointless.
14:58amalloyit probably will
14:59amalloyaha, but rem *does* have an intrinsic
14:59amalloyand i don't care whether i use mod or rem
14:59dnolenamalloy: still, seems a bit strange to me.
15:00amalloydnolen: agreed it could manifest a bit less mysteriously, but the end behavior makes sense eventually
15:02ro_sttechnomancy: how tough is it to run some additional clojure code when swank-clojure handles "load buffer" and "compile buffer"?
15:02ro_stemezeske, lynaghk: i'm the guy from the cljsbuild issue about cljx
15:02amalloyyeah, with rem instead of mod it does all the math in primitives, converting (count buf) from an int to a long first
15:03technomancyro_st: I don't think it'd be that difficult, but swank-clojure is essentially unmaintained at present
15:03ro_stbut it's actively used, right? i'm not the only one? :)
15:04ro_sti'm investigating the possibility of teaching it how to use cljx https://github.com/lynaghk/cljx
15:04technomancyyeah, it's very widespread
15:04hiredmanI 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:04technomancyro_st: I would recommend doing it on top of nrepl so other editors can benefit from it too
15:04ro_stso 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:05ro_stdoes lein swank start up an nrepl?
15:05technomancyro_st: no, you can use regular `lein repl`
15:05technomancythen use https://github.com/kingtim/nrepl.el as a client
15:06ro_stum, ok so this is an area where i'm still weak. i've been using clojure-jack-in
15:06technomancyyeah, it's still a bit behind swank, but improving very quickly
15:06ro_stooh
15:06technomancyonce a couple more features make it in we'll make a wider announcement and get more people using it
15:07ro_stso this is intended to be a successor to swank-clojure?
15:07technomancyyeah
15:07technomancyyou can already use M-x nrepl-jack-in to get started
15:08technomancyif you use the "stacktraces" branch it's fairly usable
15:08technomancysee https://github.com/kingtim/nrepl.el/issues?state=open for a list of what's still missing
15:08ro_stit looks like it supports all the stuff i use
15:08ro_stahh completion. i actually don't use it as much as i could
15:09ro_ststill haven't learned to use tab instead of enter to accept completion and so i end up typing it out
15:09technomancyheh
15:09technomancyI think what you want could be implemented as an nrepl middleware
15:09ro_stjump-to-def, doc-lookup, and the various ways to compile and eval are critical
15:10ro_stum, so, back to cljx; does this project have awareness of the active buffer's project.clj?
15:11ro_stso would i be able to read it in and invoke lein plugins and so on?
15:13ro_stthis tool looks great. i'm probably going to stay away for now; can't lose productivity at the mo
15:15ro_stdebug repl looks super handy
15:15technomancydebug repl hasn't been ported to nrepl yet
15:15technomancystill on the TODOs
15:16ro_stit looks like it's going to be a great toolset once you've achieved your TODOs
15:16technomancybut yeah, the default launch for nrepl goes through leiningen, so it knows all about the project structure
15:16ro_sti guess the primary reason is to use nREPL instead of whatever the current one uses?
15:17ro_stthat'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:18ro_stdoes swank-clojure support reloading?
15:18emezeskero_st: Ah, cool, I did not connect you two as one person :)
15:18ro_stobliterating and reloading an NS?
15:18ro_stemezeske: :)
15:18ro_stRObert STuttaford
15:19emezeskeAha!
15:19ro_stawesome productivity beyond what i enjoy is tantalizingly close :-) looks like i need to be patient, though. and duplicate all my enlive templates.
15:20llasramro_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:20ro_stahh that's a great tip. i reboot my entire repl at the moment
15:21ro_sttechnomancy: what would jump-to-resource do? (on your nrepl.el todo list)
15:23ro_sti'm guessing paredit continues to work just fine with nrepl.el
15:44dgrnbrgis there a way to get lein2 to respect my http_proxy?
15:44dgrnbrgi 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:50dgrnbrgI 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:52pipelinedryman: -Dhttp.proxyHost
15:53pppaulanyone here use joodoo?
15:56dnolendgrnbrg: side note, did you get my message about core.logic?
15:56dgrnbrgdnolen: I did, and i looked through it, but i haven't had a chance to run it
15:57dgrnbrgdoes that capture the tree of interest?
15:57dgrnbrgit's great you didn't need to use mutation to capture that information
15:57dgrnbrgalso, i think i have a simple heuristic that should make for an effective planner
15:58dgrnbrgi haven't looked at jim's code, but i imagine they could be combined
15:58ro_stdnolen: *bow* thank you for your awesome work on cljs. much appreciated.
15:59technomancyro_st: C-c C-l in slime forces a full reload
15:59technomancyjump-to-resource would just find the given file on the classpath and open it in emacs
16:00ro_stok great, i wasn't sure
16:00technomancysomeone told me I should store all my SQL in resources/ and I thought that sounded absolutely horrid
16:00technomancybut if I had a jump-to-resource command it wouldn't be so bad
16:00dgrnbrgpipeline: i am passing -Dhttp.proxyHost and -Dhttp.proxyPort to leiningen, but it isn't hitting the proxy i'm telling it about
16:00ro_stwhat, .sql files?
16:00pipelinenow that is interesting dgrnbrg
16:01dgrnbrgpipeline: I have done this:
16:01pipelinedgrnbrg: 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:01dgrnbrgexport LEIN_JVM_OPTS="-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128"
16:01clojurebotGabh mo leithsc?al?
16:01dgrnbrgthen I run leiningen
16:02technomancyro_st: yeah
16:02pipelinedryman: try socks port instead ?
16:02pipelinedgrnbrg: rather
16:02dgrnbrgand I'm also using cntlm, which i've successfully tested w/ wget
16:02pipelineand failing all else: tsocks
16:02Raynestechnomancy: How is stacktraces coming along in nrepl.el?
16:03RaynesI've mostly seen "I'm implemented half of it, but realized it is totally wrong."
16:04dgrnbrgpipeline: I opened the socks proxy, and used the same -D options to lein, but it still didn't work or even get hit
16:06technomancyRaynes: yeah, kingtim has a branch where he fixed all the issues
16:06dgrnbrgcemerick, 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:06Raynestechnomancy: So there is a branch of stacktraces?
16:06technomancyRaynes: there's still a bug preventing colorized stack traces
16:06RaynesOh I could care less.
16:06technomancybut regular clj-stacktrace.repl/pst works
16:06RaynesI just want a damn stack trace.
16:06technomancytry his stacktrace branch
16:06RaynesThat's literally all that is keeping me from nrepl.el.
16:06RaynesAwesome will do, dood.
16:07technomancydgrnbrg: lein sets those properties from environment variables and values in project.clj IIRC
16:07dgrnbrgtechnomancy: i'm not seeing lein pick them up, though :(
16:08Raynestechnomancy: I want ALL the branches!
16:09RaynesExcept for yours, since it makes everything not work anymore. :(
16:10technomancyRaynes: I think I've found the bug that's causing that
16:10RaynesCool!
16:11RaynesAre you my daddy? I wish you were my daddy.
16:11technomancydgrnbrg: I think it's supposed to be http.proxy as a URL?
16:11technomancyI've never used a proxy before but I seem to recall it that way
16:11technomancyRaynes: well I have no idea what the fix is
16:12cemerickdgrnbrg: Leiningen looks for an http_proxy env var though, and passes that along.
16:12Raynesamalloy can appreciate.
16:12Raynestechnomancy: Luckily you and I have different priorities and I couldn't care less about ido var selection.
16:13cemerickhttp_proxy seems odd to me, but maybe that's typical for these sorts of things.
16:13technomancyRaynes: it's affecting completion and doc lookup too though
16:13technomancysame bug
16:13Raynestechnomancy: What is the bug?
16:14dgrnbrgI have the proxy as localhost b/c we use a weird M$ proxy that i need to use an adapter to traverse
16:14pipelinetsocks + ssh -D
16:14pipelineall you ever need
16:14technomancyRaynes: nrepl-buffer-ns gets set to "user" in a lot of cases where
16:14technomancys/where//
16:15technomancyRaynes: probably another bug that causes nrepl-current-ns to return bogus values on your machine but not mine
16:15technomancyand the first bug affects my machine and not yours
16:15technomancyro_st: doesn't need documentation actually
16:15technomancyjust uses :arglists metadata
16:15ro_stit rocks
16:16ro_sti've been triggering and waiting for ac-completion to give me a doc-popup |-(
16:16technomancyyeah, supposedly kingtim is working on porting that to nrepl.el; can't wait
16:16dgrnbrgpipeline: i don't understand where ssh fits in
16:16pipelinedgrnbrg: ssh will set up a SOCKS4 proxy for you; tsocks will coerce non-SOCKS-aware apps into using it
16:16dgrnbrgpipeline: i can't even ssh out
16:16dgrnbrgi can only use ntlm
16:18llasramdgrnbrg: :-(
16:18dgrnbrgSo, I have cntlm working w/ wget
16:19ro_stweird that string/split uses s re and re-* use re s
16:19dgrnbrgbut then lein2 doesn't seem to pick up the http_proxy
16:20technomancythe proxy stuff certainly isn't widely used; it could have issues with the implementation
16:20Raynestechnomancy: Stacktraces branch works.
16:20dgrnbrgtechnomancy: which files does it live it?
16:20Raynestechnomancy: Should I report this working or something?
16:20dgrnbrgi'll happily debug and try to give a patch
16:22technomancydgrnbrg: looks like get-proxy-settings is defined in leiningen-core/src/leiningen/core/classpath.clj
16:22technomancyRaynes: sure; there's an open issue for it
16:24ro_stis there a fancy-schmancy method for interleaving two vectors together, like a zipper on clothing?
16:24cmcbrideIm 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:25Raynes&(doc interleave)
16:25lazybot⇒ "([c1 c2] [c1 c2 & colls]); Returns a lazy seq of the first item in each coll, then the second etc."
16:25technomancyro_st: see also mapcat vector
16:25ro_stinterleave. of course
16:25Raynes&(interleave [1 2 3] [4 5 6])
16:25lazybot⇒ (1 4 2 5 3 6)
16:25technomancybut I guess interleave is better
16:25TimMc&(mapcat vector [:a :b :c] (range 5)) ;; if you're
16:25lazybot⇒ (:a 0 :b 1 :c 2)
16:25TimMcugh, technomancy!
16:25TimMcyou sniper
16:25RaynesPretty sure I won.
16:25ro_st(inc Raynes)
16:25lazybot⇒ 14
16:25ro_st:)
16:25technomancyI wonder if interleave is faster
16:26Raynes&(time (interleave (range 1000000) (range 2000000))) ;; Accurate benchmark!
16:26lazybotExecution Timed Out!
16:27technomancyRaynes: I saw the actual message at the bottom of the stacktrace buffer a few times; were you seeing this at all?
16:28Raynestechnomancy: Not yet.
16:28technomancyok, I haven't seen it since the first few times I ran it, so I could have been seeing some stale state
16:29technomancyRaynes: 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:30ro_st,(re-seq #"(#[^#]+#)" "#template# #user#")
16:30Raynestechnomancy: 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:30clojurebot(["#template#" "#template#"] ["#user#" "#user#"])
16:30ro_stwhy the duplication?
16:30RaynesObviously 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:30RaynesIt'll be the sanest thing around.
16:30kreig1emacs and nrepl?
16:31ro_stRaynes: great getting started dox. screencasts.
16:31technomancyRaynes: first I'll make an announcement on the swank-clojure mailing list
16:31ro_stclojurescriptone.com is a great example to follow
16:31TimMc,(re-seq #"#[^#]+#" "#template# #user#")
16:31clojurebot("#template#" "#user#")
16:31ro_stcertainly hooked me.
16:31cmcbrideHey I was just wondering if anyone happened to notice my korma question
16:31ro_stcmcbride: does vanilla jdbc do the same thing?
16:32ro_stkorma is just a dsl for generating sql. once that's done, it hands it off to your driver to query
16:32hiredmancemerick: is there an nrepl middleware for compiling clojurescript yet? like himera or whatever over nrepl
16:32ro_sttx TimMc
16:32cmcbridero_st: Im not sure, Ive never used jdbc outside of korma.
16:32cemerickhiredman: not that I know of; plugging the bits together should be straightforward though.
16:32kreig1cmcbride: http://stackoverflow.com/questions/7605953/how-to-change-mysql-timezone-in-java-connection
16:32kreig1cmcbride: that may help
16:33technomancyro_st: screencasts would be great; are you volunteering? =)
16:33RaynesMeh @ clojurescriptone.
16:33ro_sttechnomancy: as long as someone else narrates
16:33ro_sti sound like edmund jackson
16:33hiredmancemerick: just trying to avoid writing one
16:33RaynesI still don't really understand what clojurescript one is or its purpose, and its buzzwordy name doesn't give anything away.
16:33cemerick1. {:op "cljs-compile" :code "…"} 2. return js 3. profit.
16:33ro_stRaynes: ignore it. i'm talking about its presentation
16:34hiredmanyeah, but you have to name the thing
16:34TimMcro_st: If you put in more capturing groups, you'll see what the repetition is about.
16:34SegFaultAX|work2Is korma decent?
16:34technomancyro_st: a british accent would be exactly the thing
16:34hiredman(and figure out how to call the cljs compiler)
16:35cemerickhiredman: who, me? :-P
16:35cemerickI've been kicking the cljs can down the road for a while now, but won't be able to continue for much longer.
16:35kingtimtechnomancy, Raynes: did you see my stacktrace fixes?
16:35ro_stRaynes: 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:35TimMc,(re-seq #"(1)2(3)" "01234")
16:35clojurebot(["123" "1" "3"])
16:35hiredmanwell who ever
16:35technomancykingtim: yeah, looking great
16:35ro_sttechnomancy: south african, actually :-)
16:35kreig1korma is pretty awesome IMO, and I've written two ORMs, used many more including WebObjects/EOF, ActiveRecord, DataMapper, Hibernate etc..
16:35technomancykingtim: I'm still affected by the nrepl-buffer-ns bug, but that's a separate issue
16:36ro_stSegFaultAX|work2: korma works beautifully. doesn't pretend to be an orm. just clean sql generaton in clojure.
16:36technomancykingtim: also, the "blowing-chunks" branch fixes that other issue with clojail
16:36kingtimtechnomancy: i have been looking at that, I think I have some suggestions that may help
16:36hiredmanI 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:36kreig1SegFaultAX|work2: I never use the "entity" stuff in Korma, just like ro_st said, it's functional sql generation
16:36kingtimtechnomancy: cool, i will get those merged in this evening
16:36SegFaultAX|work2ro_st: That's really all I want. A DSL for generating SQL queries. I strongly dislike ORMs (even though I use them regularly)
16:36amalloySegFaultAX|work2: s/even though/because?
16:36Rayneskingtim: You're my hero, you know.
16:36SegFaultAX|work2amalloy: Or that, yea.
16:37ro_stkreig1, SegFaultAX|work2: the entity stuff is tres useful. cuts out a lotta joinerplate crap
16:37kingtimRaynes: wow, thanks
16:37SegFaultAX|work2amalloy: But even before I was a heavy ORM user I didn't like the idea.
16:37kreig1ro_st: I wrote my own join helpers
16:37kreig1ro_st: I don't really have things that work as entities
16:37technomancykingtim: 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:37SegFaultAX|work2ro_st: tres? Link?
16:37hiredmanb
16:37Rayneskingtim: I'd bear your children if I had the physical capacity to do so.
16:38SegFaultAX|work2kreig1: I'm not familiar with the korma lingo just yet. What's an entity?
16:38ro_sti used korma to script a conversion from a ~20 table sql to mongo. i had all the sql i needed in an afternoon
16:38kreig1SegFaultAX|work2: just read the docs 8)
16:38ro_stRaynes: how many beers in are you?
16:38ro_stSegFaultAX|work2: http://sqlkorma.com/docs#entities. simple-as-that
16:38RaynesI'm a minor. Though I guess that isn't saying much.
16:38RaynesWell, not a minor.
16:39SegFaultAX|work2kreig1: Well, that doesn't sound like a very complicated transition. 20 tables is small and easily manageable.
16:39RaynesI'm 'underage'. I guess that's what they call this.
16:39ro_stthat just determines your enthuueuesiasm. can never spell that word
16:39SegFaultAX|work2ro_st: Thanks, reading.
16:39Raynesenthusiasm?
16:39ro_stgimme one of those beers :P
16:39kingtimtechnomancy: okay, cool
16:40SegFaultAX|work2ro_st: Enthusiasm is spelled phonetically.
16:40kingtimtechnomancy: I will try to send you some feedback on the ido branch tonight
16:40technomancygreat
16:40ro_sti say it en-theee-ooo
16:40technomancykingtim: have you thought about a mailing list?
16:41ro_stanyway :)
16:41Hodappentheogen?
16:41SegFaultAX|work2kreig1: Huh, why don't you like entities? It seems like a pretty handy way to describe your data model in clojure.
16:41technomancykingtim: you could piggy-back on http://groups.google.com/group/clojure-tools/ too if you don't want to start your own
16:41SegFaultAX|work2Or perhaps: what's wrong with korma entities?
16:41kreig1SegFaultAX|work2: cause I don't have entities in my data world at all
16:41kreig1SegFaultAX|work2: aka what a user might consider an "entity" does not live in a table anywhere
16:41kingtimtechnomancy: i was thinking something like that would be good with
16:41kingtimtechnomancy: all the activity lately
16:42technomancyit'll slow down once we've got more features in place I'm sure
16:42technomancybut it'd be good to coordinate on the next release
16:42kingtimtechnomancy: absolutely
16:43SegFaultAX|work2kreig1: No? Your model doesn't have any users? Or rather, a "thing" that is the canonical representation of a user in your system.
16:43technomancydid you have anything specific in mind for the next version?
16:43SegFaultAX|work2kreig1: I mean even if that's represented by multiple relations in the database, conceptually it's just one "thing".
16:43kingtimtechnomancy: I'd like to the current basic feature set stabilized to the point where we can make some sort of public announcement
16:44kreig1SegFaultAX|work2: we have users and orgs and a few things, but they are at best administrative addons to the real data
16:44kingtimtechnomancy: and then I think the next big thing is debug support
16:44SegFaultAX|work2kreig1: I see. What kind of applicaiton is this, if I may ask?
16:44ro_stSegFaultAX|work2: kreig1 probably has another level of abstraction on top of the sql. kinda like how datomic does on top of postgres
16:44technomancykingtim: something simple like the debug-repl, or do you want to target a more elaborate approach?
16:45kreig1SegFaultAX|work2: malware analysis database, I am effectively storing core.logic fact tuples
16:45SegFaultAX|work2kreig1: Neat! Where do you work?
16:45kingtimtechnomancy: i was thinking simple first, and then we could go from there
16:45kreig1SegFaultAX|work2: ThreatGRID (the site is opaque unless ou are buzzword compliant CSO)
16:45SegFaultAX|work2ro_st: Sure, that's true of almost any system. But we're specifically talking about the datastore and query layer.
16:46SegFaultAX|work2kreig1: What kinds of threat do you catalogue and analyze?
16:46kingtimtechnomancy: thoughts?
16:46kreig1ro_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:46technomancykingtim: personally I'm happy with the debug-repl, but there are occasional times when a really awful bug requires a stepping debugger
16:46kingtimtechnomancy: word
16:47technomancyI'm OK with falling back to swank for that since it happens so rarely (~1/year for me)
16:47kreig1ro_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:47technomancythere are others who might insist on it, but we can get them to help implement that when they complain =)
16:47kingtimtechnomancy: :)
16:47ro_stkreig1: for sure :-)
16:47kreig1also, fact tuples with all natural keys works really awesome in SQL
16:48kingtimtechnomancy: 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:48kreig1SegFaultAX|work2: malware threats 8) we do dynamic and static analysis, throw the results in a DB, and mine
16:49SegFaultAX|work2kreig1: I've only see a talk on core.logic, I'm not really familiar yet with the internals. What is a fact?
16:49technomancykingtim: 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:49kreig1SegFaultAX|work2: a statement like process-modified-file PID "the/path/that/was/modified"
16:49wingyhow do i tell "lein ring server" to allow public ips to access the server?
16:50kreig1ok, gotta get back to hack
16:50SegFaultAX|work2wingy: Probably bind it to a non-loopback interface.
16:50technomancykingtim: I can work on the project-scoping issues and moving away from auto-mode-alist
16:50SegFaultAX|work2wingy: 0.0.0.0 to bind to all interfaces.
16:50SegFaultAX|work2Just a guess, though.
16:50kingtimtechnomancy: probably a good idea to setup an email list
16:51wingySegFaultAX|work2: yeah that would be my guess as well coming from node.js
16:51wingytrying to figure out how to bind it
16:51kreig1wingy: I usually will have it run on my local interface, and then use ssh port forwarding to access it remotely
16:51kreig1wingy: that basically provides encryption and acces control for free
16:51technomancykingtim: I've been having trouble with google groups; might want to check out librelist.com
16:51technomancyvery low-maintenance
16:51kreig1ssh thehostrunningringserver -L 9999:127.00.1:9999
16:51kingtimtechnomancy: would be good to have a place to discuss some of this stuff
16:52kreig1wingy: replace 9999 with the port ring server actually listens on 8)
16:52kingtimtechnomancy: what issues are you having with google groups?
16:52RaynesThe fact that Google has turned email into a hash bang twitterish nightmare.
16:52technomancythe hashbang is a big part of it; the moderation interface sometimes just stops working
16:52kreig1wingy: or are you talking about deploying it, like a live service?
16:52technomancyand you get overrun with spam if you don't turn on moderated first-posts
16:52wingykreig1: development only
16:53kreig1wingy: yah, for dev, I suggest the ssh port forwarding. we do that alot around here
16:53SegFaultAX|work2wingy: Alternatively, you can use localtunnel to also have a temporary URL for your local machine.
16:53technomancythis morning I was seeing its search turn up zero results for something I was able to find in my local mail client
16:53wingyok ill give it a try .. seems like a good thing to do
16:54kingtimtechnomancy: hmm.. okay
16:55SegFaultAX|work2wingy: Check it, yo: http://progrium.com/localtunnel/
16:55technomancykingtim: just a suggestion; if you're comfortable with google's go for it
16:56ro_stman clojure is awesome.
16:57kingtimtechnomancy: i will have limited cycles after tonight
16:57ro_sti'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:57kingtimtechnomancy: until next week
16:57ro_stand i can see it all working in the browser. awesome!
16:57kingtimtechnomancy: so I was thinking of pushing another marmalade release with what we have today
16:58technomancykingtim: sure, including pending pull requests?
16:58kingtimtechnomancy: plus the stacktrace and the blowing-chunks
16:58RaynesDo it!
16:58technomancykingtim: I think the completion pull req should be able to make it in too
16:59ro_stthis sounds exciting
16:59iwohey, what is the (java interop?) way to create a synchronized method?
16:59kingtimtechnomancy: i think you are right, i have a working version of that
16:59kingtimtechnomancy: and then get the ido into the next release
16:59iwoi'm using 'proxy' as i need to implement an existing Java interface
17:00iwobut i need to mark one of the methods synchronized
17:00kingtimtechnomancy: how does that feel?
17:00iwo(i'm assuming dosync/sync is not what i need)
17:01TimMciwo: In Java, I think the 'synchronize' keyword on methods is sugar for a synchronize(this) { } block containing the method's body.
17:01technomancykingtim: 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:01technomancyI think that's the point at which I'll explicitly announce that I won't be maintaining swank further
17:01iwoTimMc: yes i think you're right. so how does one create that block in clojure?
17:01amalloyiwo: TimMc's assertion is correct, and the clojure macro is ##(doc locking)
17:01lazybot⇒ "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:02iwoamalloy: thanks!!
17:03kingtimtechnomancy: most excellent, thank you for all your contributions so far
17:03technomancykingtim: yeah, really glad to see it coming together
17:03TimMcamalloy: Thanks, couldn't find the name. I'll make a note on ClojureDocs.
17:03kreig1technomancy: what is the official way to use emacs and nrepl?
17:04technomancykreig1: https://github.com/kingtim/nrepl.el <- this is the way forward
17:04kreig1got it
17:04kreig1thanks
17:05kingtimcemerick: just wanted to say thanks for the nrepl server, so far it has been rock solid and easy to work with
17:05technomancykreig1: still a bit rough around the edges, but it's improving quickly
17:05kreig1my production work is lagging behind clojure cutting edge, but I have a personal project were I deliberately try these things out
17:05ebaxtHi! 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:05Raynescemerick is mah main man.
17:05kreig1ok, relocating
17:06cemerickkingtim: Good to hear; are you using it in an app of yours or something?
17:06kingtimcemerick: nrepl.el
17:06duck1123grrr. almost tried to type "defn" when creating a new Java method. (really wish I was using Clojure)
17:06cemerickoh!
17:07cemerickkingtim: sorry, I don't often find my way over to the emacs side of the field. :-) I've heard good things, though.
17:07Raynescemerick: Still using Vim?
17:07kingtimcemerick: no worries
17:07cemerickRaynes: See, you say that now… ;-)
17:07cemerickRaynes: For misc. editing, yeah.
17:08wingykreig1: 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:08kingtimcemerick: i spend countless hours in intellij
17:08cemerickEvery 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:08TimMcwingy: I think you have those ports backwards.
17:10emezeskeebaxt: 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:11emezeskeebaxt: I would suggest looking at the macroexpand output for the macro, it might give further clues
17:11ebaxtemezeske: Thanks, I'll do that
17:12Rayneswingy: I recommend localtunnel.
17:13emezeskeebaxt: 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:13emezeskeebaxt: If I understand your goal correctly
17:13ebaxtemezeske: I added a ~' in front of the symbols and it worked. Tanks
17:13wingyRaynes: ok ill check it out
17:13emezeskeebaxt: Schweeet
17:15ro_stit 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:15ro_stor do i have to add "" to the second side
17:15technomancyro_st: yeah, concat it onto an infinite seq
17:17ro_sti'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:17gfredericksmacros: "I added a ~' and it worked."
17:17ro_stso it'll almost always be unbalanced
17:17gfredericksclojurebot: macros is I added a ~' and it worked.
17:17clojurebot'Sea, mhuise.
17:17gfredericks~macros
17:17clojurebotmacros is I added a ~' and it worked.
17:17gfredericks:(
17:17technomancyheh
17:17gfrederickshow do you make him leave off the first bit
17:18gfredericksclojurebot: forget macros is I added a ~' and it worked.
17:18clojurebotOk.
17:18cemerickro_st: sounds like you want string interpolation, or something like weavejester's comb.
17:18ro_sti'm replacing strings with enlive nodes
17:18ro_stso straight string stuff is out
17:18ro_st*looks at comb*
17:19cemerickah, ok, nevermind. :-)
17:19ro_stthanks for the recommend, though!
17:19ro_stalways appreciated
17:19cemerickkeep calm and ignore cemerick
17:21ro_sthttp://clojuredocs.org/quickref/Clojure%20Core is a fantastic overview of the language, btw.
17:21ro_stlove how it's organised
17:22TimMcgfredericks: <reply> after the is
17:22ro_stboom. got it working
17:22TimMcgfredericks: Also, you just taught him the "forget" version as well.
17:26ro_stcheers folks. it's been emotional.
17:32amalloyTimMc: <reply> isn't what you want there
17:33amalloyoh, for leaving off the first bit it is; not for making him forget
17:35amalloyTimMc: did you fix it already in PM?
17:40augustlweird.. "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:41augustlI 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:41augustlor even try to know where the source files are, and even compile it
17:46emezeskeaugustl: 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:47emezeskeaugustl: I don't ever really compile stuff, though, so that's just a guess on my part
17:47augustlI get the same error when I remove the myapp_mongodb dependency as well
17:47technomancyyou can't load any clojure code without compiling it
17:47emezeskeI mean AOT compile
17:48technomancysure, but that's not what the error above says
17:48augustlemezeske: not sure how "lein ring" knows where the source files are though, as all that's really in the project is the jar
17:48augustlunless some metadata in ~/.m2 contains the local path to the sources or something like that..
17:48emezeskeaugustl: The jar does not include the source files?
17:48augustljars only contain .class files no?
17:48emezesketechnomancy: I should not even guess about compilation stuff.
17:48technomancyheh
17:49technomancyaugustl: no, jars usually contain source
17:49augustlah I see
17:49technomancyunless it's from a java lib
17:49amalloytechnomancy: *clojure jars usually contain source
17:50augustlI suppose lein-ring isn't updated for leiningen 2
17:50weavejesterlein-ring works with lein 2
17:50weavejesteror lein 1
17:50augustlhmm, I wonder what I've done wrong then
17:51weavejester"lein ring server" just executes your handler with run-jetty
17:51augustlmy project.clj for the curious https://www.refheap.com/paste/3751
17:51technomancyweavejester: does clojure's open-in-browser functionality work reasonably for most people?
17:52technomancyit always ends up using firefox for me, so the fact that lein-ring opens the browser by default drives me nuts
17:52emezesketechnomancy: You can do server_headless, I think, to avoid that
17:52Raynestechnomancy: server-headless
17:52augustlwould make more sense to have it opposite imo :)
17:52weavejestertechnomancy: As far as I know it does. It just uses the clojure.java.browse namespace, or whatever it is
17:52augustllein server-with-browser or w/e
17:53weavejestertechnomancy: Also, in lein 2, you can put :ring {:open-browser? false} in your user.clj
17:53weavejesterUm, profile.clj
17:53technomancyweavejester: aha; that's the ticket; thanks
17:53emezeskeweavejester: Nice!
17:53weavejesterUnder the user profile
17:53augustlcan anyone think of a reason for why I'm getting the compilation error in the unrelated project btw? :)
17:53augustlweavejester: oh, nice
17:55weavejesteraugustl: What happens when you just load the handler namespace in via a REPL?
17:57augustlweavejester: that works fine
17:57augustlhere's the full "lein ring server-headless" output https://www.refheap.com/paste/3752
17:57augustlsame for just "server", with and without port number
17:58augustlalso, 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:58weavejesteraugustl: Which version of lein-ring and lein?
17:59augustlweavejester: lein-ring 0.7.1, Leiningen 2.0.0-preview7 on Java 1.7.0_05-icedtea OpenJDK 64-Bit Server VM
18:00weavejesteraugustl: Hm, same as me then, and I haven't noticed any issues like this. What does your project.clj look like?
18:00augustlweavejester: https://www.refheap.com/paste/3751
18:01augustlI'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:02weavejesteraugustl: 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:02augustl..and now it suddenly works. All I did was a "lein upgrade" which probably reinstalled the version I already had
18:03TimMcamalloy: Yes, fixed in PM.
18:03augustlweavejester: I'm not using the checkouts directory no. lein 2 loads from ~/.m2 now right?
18:04weavejesteraugustl: 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:04augustlalso, I just passed midnight.. Perhaps that caused maven to redownload some stuff
18:14augustlare 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:15jbarrioshow would one best handle logging progress updates inside of a long-running doseq?
18:15jbarriosImperatively I'd keep a counter and log an update ever X items processed...
18:16augustljbarrios: afaik actors are well suited for that, as you'll get a callback when the transaction has been committed
18:16augustlafaik, iirc, etc :)
18:17jbarriosagents you mean?
18:18augustluh yeah
18:18emezeskejbarrios: 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:19jbarriosemezeske: hmm, true
18:23jbarriosif my-stuff is a lazy seq will (map vec ... ) fully instantiate it before it returns?
18:24amalloyemezeske: (map vec x y) is always an error :P
18:24emezeskejbarrios: I believe the map call should be totally lazy
18:24amalloy(map vector x y), however...
18:24CheironHi, 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:24jbarriosthanks
18:24augustlI'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:25emezeskeamalloy: Did you have a clojure REPL wired directly into your brain?
18:25amalloyi have several brains-in-jars wired into my clojure repl
18:25emezeskehaha
18:26emezeskeI picture amalloy-vision as having little wiggley marks underneath buggy clojure code (like a spellchecker)
18:26amalloyif only
18:27emezeskejbarrios: Not sure if you saw, but make sure you use (map vector ...) instead of vec, as amalloy pointed out
18:28augustlI 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:28technomancyaugustl: something like this: lein with-profile production ring server
18:28Raynesemezeske: Actually, amalloy vision is like looking through a dirty aquarium at the world.
18:29RaynesPoor guy has terrible eyesight.
18:29amalloyhah, a dirty aquarium. that's not bad
18:29emezeskeRaynes: Oh, I thought you were gonna say he was some kind of sea creature
18:29weavejesteraugustl: 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:30augustlI see, thanks
18:30amalloyemezeske: if this conversation were happening in real life, i would be making whalesong noises now
18:30emezeskeamalloy: I knew this was a dream...
18:38aphyrDoes anyone know where with-out-writer went?
18:40AWizzArdnot sure, but try clojure.java.io
18:40aphyrTrying 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:40AWizzArd,(apropos "out-writer")
18:40aphyrNot in clojure.java.io any more. :/
18:40clojurebot()
18:41technomancyis it that much extra overhead to bind *out* manually?
18:41aphyrMust be a better way to do it now, I just haven't found it.
18:41technomancyclojure.java.io/writer can give you what you need
18:41technomancymy guess would be it was abandoned because it doesn't justify creating a macro over such a tiny thing
18:42aphyrYeah, I actually can't figure out what (writer) does from its docs
18:43aphyrSupposed to take URIs or filenames and return appropriate writers for them?
18:49jsnikeristechnomancy: any ideas on how to handle https://github.com/kingtim/nrepl.el/issues/30 ?
18:54technomancyjsnikeris: that's probably going to have to be handled on the clojure side
18:54technomancyI'd be surprised if :init doesn't already work
18:54technomancy:init-ns might be harder, but it should be done on the nrepl side rather than the client side
18:55jsnikeristechnomancy: 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:56technomancyjsnikeris: hmmm... I see
18:57technomancyjsnikeris: we don't have to launch a headless nrepl
18:57jsnikeristechnomancy: interesting. I'm going to give that a try
18:58technomancyotherwise we'd just have to expand leiningen.repl/start-server
18:59technomancyjsnikeris: are you seeing this bug where nrepl-buffer-ns is nearly always set to "user"?
18:59jsnikeristechnomancy: yeah, you need to evaluate the namespace form of each buffer
18:59technomancyC-c C-n?
19:00jsnikeristechnomancy: 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:01technomancyso when I run C-c C-k, it doesn't set nrepl-buffer-ns
19:01jsnikerisI think the semantics of nrepl-buffer-ns is: the namespace that code will be evaluated in when you use the interactive-eval commands
19:02jsnikeristechnomancy: Hmm, I'd expect C-c C-k to set it, but I'm not sure if it actually does.
19:02jsnikeristechnomancy: let me see
19:03technomancyI think that's the bug; it's supposed to
19:04technomancyjsnikeris: actually it does set it, but it sets it to "user"
19:04jsnikeristechnomancy: hmm, I'll take a look
19:05technomancyin nrepl-make-response-handler
19:05jsnikeristechnomancy: heh, there's a TODO above `nrepl-load-file`
19:06jsnikeris;; TODO: implement reloading ns
19:06technomancyoh, I imagined that as :reload-all type reloading
19:06technomancyrather than setting it elisp side
19:06technomancyanyway, I implemented that on my reload branch
19:08technomancyI thought it was something specific to my setup, but I'm seeing it with emacs -Q as well
19:08jbarriosbtw, I ended up using this, in case anyone remember my original question earlier:
19:08jbarrios(doseq [[line counter total] (map vector coll (cycle (range 0 1000)) (range))]
19:08jbarrios (if (zero? counter)
19:08jbarrios (println "Processed" total "entries")
19:08jbarrios ... do something)
19:08technomancybut I guess I can train my fingers to do C-c C-n for now
19:08jbarrios
19:08jbarrioserr, you get the idea. do something no in the else
19:09jsnikeristechnomancy: Yeah, I think it is inadequate. What's the behavior in SLIME?
19:09technomancyjsnikeris: I think the ns is calculated from the in-buffer ns form every time
19:09technomancywhich is much more reliable
19:10jsnikeristechnomancy: I tried doing that, but what if you're trying to evaluate the namespace form itself
19:10technomancysure, C-c C-k doesn't use that
19:10jsnikeristechnomancy: you end up trying to define the namespace in a namespace that doesn't exist
19:11technomancyI think as long as your first operation is a full compile you're fine
19:11technomancywhich it should be anyway
19:11dnolendgrnbrg: 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:11jsnikeristechnomancy: then perhaps that should happen automatically
19:12dnolendgrnbrg: 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:12technomancyjsnikeris: if it's easy to turn off
19:12technomancyjsnikeris: IIRC vimclojure did that for a while and it really annoyed some people
19:12dnolendgrnbrg: where it get interested is whether it will be possible to use it to optimize your program while it's running.
19:12technomancybut you shouldn't be putting side-effects in the top-level anyway, so personally I'm ok with it
19:13jsnikeristechnomancy: yeah, but maybe you don't want to do things behind the users back
19:13technomancyanyone remember the details re: vimclojure and automatically compiling a file when you open it?
19:13jsnikerisI can see how people might not like that
19:13technomancyjsnikeris: maybe disable the auto-compilation if the first form isn't (ns [...])
19:14technomancysince that's a pretty good heuristic for throwaway code vs proper project code
19:15aphyrWhat's the idiomatic way to catch wrapped exceptions in 1.3?
19:15jsnikeristechnomancy: 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:16technomancyjsnikeris: it wouldn't work with the bootclasspath, but it might otherwise
19:16dnolenaphyr: I think that hassle is why most people skipped to 1.4
19:16technomancyinteresting idea
19:16aphyryeah, IIRC (catch) is basically useless, haha
19:17aphyrGuess I'll unwrap for now, stuck on 1.3 libs for a bit
19:17technomancyjsnikeris: curious why you're still on 23
19:17jsnikeristechnomancy: My only concern is that you might run into classpath issues where two projects require different versions of the same library
19:18jsnikeristechnomancy: I track Debian stable
19:18amalloyaphyr: +1 for skipping to 1.4, but slingshot probably makes exception-catching reasonably okay on 1.3
19:19technomancyjsnikeris: I know I've already had a few features merged that depend on having closures
19:20technomancywe could be liberal with lexical-let, but we should turn off support for lexical scope if we want to target 23
19:21jsnikeristechnomancy: yeah my understanding was that using lexical-let was good practice, although I'm not too familiar with the issue
19:22technomancyit's just a question of how many people are still on 23 I guess
19:22jsnikeristechnomancy: I mean 24 was *just* release
19:23technomancyyeah, but the starter kit has required it for over a year
19:23technomancyit's been stable for ages
19:23technomancyI've only heard one or two complaints around the starter kit
19:24jsnikerisI'm not saying that it's not stable, only that some people are still using 23.
19:24jsnikerisDebian Wheezy, which is yet to be released will use 23.4
19:24amalloyi'm not upgrading to 24 anytime soon
19:26jsnikeristechnomancy: If it's not too hard to support 23, I think we should. I'll be happy to shoulder responsibility :)
19:33merkourishi
19:33merkourisI was hoping someone might be able to help me.
19:34merkourisI'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:38amalloyyou forgot the arglist for a defn
19:48technomancyjsnikeris: there's still a chance 24 could make it into wheezy
19:49jsnikeristechnomancy: That'd be great. I was under the impression that the tree was locked except for bug fixes.
19:51amalloybug: emacs 23 is not as good as 24?
19:51jsnikerisamalloy: heh
19:51haspakerHi there, folks
19:51technomancyjsnikeris: have you tried nix?
19:51jsnikeristechnomancy: 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:52jsnikeristechnomancy: I haven't even heard of it. Googling...
19:52jsnikeristechnomancy: wow, google didn't help much. What is it?
19:52technomancyjsnikeris: 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:52technomancyclojurebot: nix?
19:52clojurebotnix 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:52jsnikeriswhoah, cool
19:53jsnikerisI'll check that out
19:53technomancyif it weren't for nix I don't think I could use squeeze
19:53gfredericks~botsmack
19:53clojurebotclojurebot evades successfully!
19:53haspakerAsked this in the wrong channel before, but I'll try again
19:54haspakerAny idea on how to make this function less verbose / more effective? http://pastebin.com/tMuUNFsv
19:54haspakerI don't really need to make it any better, but one can usually learn a lot from watching experienced people solve things
19:54jsnikeristechnomancy: So, even if I connect in a terminal using "lein repl :connect <port>", the repl-options aren't processed.
19:54jsnikerisso I'm thinking it might be the client's responsibility to handle initialization tasks
19:55jsnikerisrather than nREPL's
19:55technomancyjsnikeris: well :init should still be handled, but I guess not :init-ns?
19:56technomancymaking nrepl.el parse project.clj is really not a road I want to go down =\
19:56technomancyI think there should be a way to honor init-ns for every client that connects.
19:56technomancyerr--not that it already exists, but that it should be added
19:56jsnikeristechnomancy: well I'm trying to set a binding (*print-length*), and it doesn't seem to be working
19:57jsnikerislet me try something more simple like printing something
19:57technomancyyeah, binding won't work in :init
19:58technomancyhaspaker: I'd see if you could re-formulate it in terms of a reduce on a seq rather than loop/recur
20:00jsnikeristechnomancy: Yeah, so try adding having a profiles.clj like this:
20:01jsnikeris{:user {:repl-options {:init (print "Hello")}}}
20:01jsnikerisenter some project
20:01jsnikerislein repl
20:01jsnikerisyou should see the statement printed
20:01jsnikeristhen open a new terminal and lein repl :connect to the server opened in the first terminal
20:01jsnikerisno print statement
20:02technomancyyeah, that's actually intentional
20:03technomancyit's only supposed to be run once
20:03haspakertechnomancy: I'll look into that
20:04jsnikerisah ok. So it is run when the server initializes
20:06jsnikeristechnomancy: So if I want to set *print-length* and *print-level* automatically every REPL, how would you recommend doing so?
20:07technomancythat 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:07technomancyalong with :init-ns
20:07technomancytoo bad cemerick's not here; I'd ask him which is appropriate
20:08jsnikerisgotcha, I'll take at the interaction between leiningen and nREPL to see what's up
20:09jsnikeristechnomancy: 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:09kreig1big cookies do not help hacking
20:09technomancyyeah, I think so
20:10kreig1no matter how delicious
20:10jsnikeriskreg1: sugar coma?
20:10jsnikeriskreig1:
20:10kreig1yup
20:27amalloywelllllll
20:27amalloynot the way let and do are currently defined to behave at the top level
20:27gfrederickseh?
20:28amalloy(do (def x 1) (def y x)) ;; succeeds
20:28kreig1"General and abstract ideas are the source of the greatest errors of mankind." -- Rousseau
20:28gfredericksoh hmm
20:28gfredericksI guess so
20:28amalloy(let [] (def x 1) (def y x)) ;; probably doesn't
20:28gfredericksoh I wasn't thinking that way
20:28gfredericksI forgot let gives you a do
20:28technomancydo is special-cased in the compiler to compile sub-expressions independently
20:28technomancyin order to help with the Gilardi Scenaria
20:29technomancyScenario
20:29kreig1oh wow, didn't know that
20:29gfredericksamalloy: that one does work, and I'm not sure why you thought it didn't
20:29technomancygfredericks: it doesn't work in a fresh repl
20:29gfrederickswat
20:29technomancyit only works because you've got state sticking around
20:30amalloytechnomancy: no, it does work fine
20:30technomancyoh, never mind
20:30amalloythe 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:31zelliois there a way to inspect a java constructor to see what arguments it expects? ( when doing inter-op )
20:31technomancyI wonder if that was improved since 1.2
20:32gfredericksamalloy: 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:33technomancyzellio: the slime inspector does that
20:34zellioreally? awesome
20:34zelliothanks
20:36zelliohrmm, do you have to configure it special?
20:37technomancyC-c S-i my.class.Name RET should do the trick
20:38Raynesamalloy_: Can you restart lazybot when you get a chance? Please.
20:39zellioahh that's the syntax, thanks technomancy
20:43Kowboywhy aren't vectors, sets, and maps seqs?
20:45kreig1they are sequable
20:46kreig1that is not a true answer to your question tho 8)
20:46gfredericksI was wondering about vectors at one point. I don't think I got a very strong answer from anybody.
20:47gfredericksI think the main thing we came up with was that seq? is not a useful function most of the time
20:47technomancyinc
20:47gfredericksperhaps only when dealing with code
20:48ToxicFrogYeah, 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:48kreig1my 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:48kreig1that make sense ot others?
20:49kreig1and 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:49gfredericksdepends on what you mean by "arrays ... can define an interface ..."
20:49kreig1you can extend their interface, witha protocol for example
20:52kreig1I 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:52kreig1I don't see that as a problem at this stage
20:53Kowboyjust threw me off for awhile when using seq?
20:53gfredericksKowboy: checkout seqable? and sequential?
20:54kreig1Kowboy: me too, awhile ago
20:55dnolengfredericks: as kreig1 says, a desire to avoid complecting ideas (as well as the implementation)
20:56gfredericksdnolen: you're talking about why vectors etc are not seqs?
20:56kreig1dnolen: hmm, what part of my statement you read re: complecting ideas?
20:56dnolengfredericks: yes
20:56dnolenkreig1: I was agreeing w/ you.
20:56kreig1I know, but I am trying to understand what you meant with that terminology
20:57kreig1what from my statement did you map to "complecting ideas"
20:57gfredericksdnolen: and so lists are seqs because it'd be going to far to separate those?
20:57dnolenkreig1: though I disagree about the uniformity regularity parts. it's uniformity and regularity in a deeper way IMO
20:57dnolengfredericks: list are naturally & trivially seqs.
20:57dnolengfredericks: vectors were seqable but the details have changed. ChunkedSeqs are quite neat IMO.
20:58fentonanyone run into emacs not finding lein, when trying to do a clojure-jack-in? http://pastie.org/4309462
20:59kreig1really, if you look at the ISeq interface, it becomes clearer
20:59kreig1first/more/next/cons/empty
21:00kreig1map 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:00dnolenkreig1: I find the presence of next in ISeq a bit yucky. I prefer what's been done ClojureScript.
21:00gfredericksha I saw the empty and first thought of clojure.core/empty, which was confusing
21:00kreig1dnolen: which is?
21:01dnolenkreig1: much simpler, ISeq is just -first, -rest
21:01dnolenkreig1: next is in it's own protocol INext
21:02dnolenkreig1: I actually added INext, originally CLJS only had ISeq.
21:02gfredericksoh I just noticed that cljs lets you ##(let [[a b] #{2 3}] [a b])
21:02kreig1hmm, not sure I understand iseq without next
21:03kreig1(first (more sufficient in your opinion?
21:04dnolenkreig1: -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:06kreig1got t
21:07kreig1ok, 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:08kreig1but which actually are quite different structures, in terms of their implementation
21:08jbarrioshmm, why does with-open exhaust my heap even when I am not writing anything to the file?
21:08kreig1so, when we define those differences, or use the contours of those differences as the basis for defining interfaces
21:09jbarrios(with-open ... (doseq ...) ) holds on to head?
21:09kreig1We can more easily put those itnerfaces on new things, like datomic, or an sql query, or whatever
21:10kreig1because 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:10jbarriosreally, wth
21:11kreig1jbarrios could it be the try?
21:11jbarriosI don't know.
21:11jbarriosguess we'll find out
21:13kreig1doseq should not be retaining the head itself
21:13jbarriosit doesn't
21:13dnolenkreig1: 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:14kreig1dnolen: 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:14kreig1,(ns foo (:print "I AM A ROBOT"))
21:14clojurebotI AM A ROBOT
21:14gfredericksO_O
21:14kreig1makes ns a little too funky for my taste 8)
21:15gfredericks,(ns foo (:eval :evaled))
21:15clojurebot:evaled
21:15gfredericksooh
21:15gfredericks,(ns foo (:System/exit))
21:15clojurebot#<CompilerException java.lang.RuntimeException: No such var: clojure.core/exit, compiling:(NO_SOURCE_PATH:0)>
21:15dnolenRaynes: uh oh
21:15kreig1yah, it calls name on it and only looks it up in clojure.core
21:15dnolenoh actualy hiredman maintains clojurebot right?
21:15kreig1so you are restricted to that namespace
21:15gfredericksdnolen: yeah
21:16gfredericksand lazybot is asleep so we can't see if it works there too
21:16kreig1my CA should have arrived, but I'm on on the website
21:16gfredericksmaybe @tryclj.com
21:16kreig1it's in clojure 1.4, so it works there
21:16gfredericks"You tripped the alarm! class clojure.lang.Compiler is bad!"
21:16kreig1mind you, the jail tryclj uses is pretty good, aka uses java sec. policy to restrict you from touching some classes
21:16kreig1see 8)
21:16kreig1good on them
21:17Raynesdnolen: clojurebot is about as secure as a jail cell with no door.
21:17technomancyclojurebot uses "restart every ten minutes" sandboxing which is also pretty effective
21:17gfredericks,(System/exit)
21:17clojurebot#<CompilerException java.lang.RuntimeException: java.lang.NoSuchFieldException: exit, compiling:(NO_SOURCE_PATH:0)>
21:17technomancyover a long enough time span anyway
21:17dnolenRaynes: heh
21:17gfredericksam I crazy?
21:17gfredericksoh it needs an arg
21:17gfredericks,(System/exit 0)
21:17clojurebot#<SecurityException java.lang.SecurityException: denied>
21:17Raynesamalloy_: Nevermind. Apparently you're never coming back, so I'll do it.
21:18gfrederickstechnomancy: restart the jvm or the whole vm?
21:19Raynescraigbro: 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:20craigbroRaynes: hat tip for sure
21:20gfredericksyet still lazybot doesn't allow eval </ungrateful whine>
21:20jbarriosyeah, looks like it
21:20RaynesWell preventing eval is kinda the whole point. :p
21:20gfredericksRaynes: https://github.com/flatland/clojail/issues/2
21:21RaynesYeah, I forgot about that.
21:26craigbrohttps://github.com/craigbro/clojure/commit/d1ca441737aa16128fec6c8a8dcd472180c6b7bf
21:26craigbroThat's my patch to fix the ns form issue
21:26craigbrocan someone take a look and tell me if I'm still a heretic Common Lisp hacker vandalising clojure.core or not?
21:28zelliocraigbro: if i've learend anything about clojure after coming to it from common lisp, you will always be =P
21:29dnolencraigbro: you could replace some with a set look up.
21:29craigbrook, will try that
21:30craigbrohere isa question about the compiler: is it gonna keep making a new list for that set of valid names each time?
21:30craigbroor does it recognize it as a literal and get smart about it
21:31dnolencraigbro: recognizes literals
21:33craigbroso, 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:33craigbrohence, the (or symbol? keyword?
21:35craigbrooh, now I gotta learn how to suash git commits togehter
21:37gfredericksgit suash
21:39craigbrogot it
21:39craigbroi rebased, pulled, merged pushed ...
21:42craigbropull request sent
21:42gfrederickspull request to clojure/clojure?
21:43dnolencraigbro: you can't send pull requests. JIRA.
21:43craigbrooh well
21:43gfredericksthis is the part where he finds out about snailmail
21:43craigbrolet it languish there
21:43craigbroI already sent in my CA
21:44craigbrook, closed with comment
21:45craigbroletme guess, open issue, attach patch
21:45dnolencraigbro: yep
21:46jsnikerisIs there a way for two let bindings to refer to eachother?
21:46dnolenjsnikeris: not really
21:46gfredericksjsnikeris: letfn if you're making functions
21:46zellio(let [foo 0] (let [bar foo] ))?
21:47zelliootherwise no
21:47jsnikerisI'm trying to make a tree structure that has a pointer to its parent and its children
21:48aphyr(defrecord Node [parent me children])
21:48jsnikerisaphyr: yeah
21:48zellio(defstruct node :parent :children)
21:48zellioer, what aphyr said
21:49jsnikerisnow create a Node with some children
21:49aphyrpoint of interest:
21:49aphyrare you looking for a functional, immutable structure, or a mutable stateful one?
21:50jsnikerisaphyr: I'd prefer to use a record so, immutable
21:51aphyrOK. Be aware that mutating elements in doubly-linked trees is going to be more complex.
21:51jsnikerisdnolen: You said, "not really". Is there any way to achieve the same effect?
21:52aphyrMore expensive, too: any mutation will be O(n).
21:52jsnikerisaphyr: I don't plan on mutating them.
21:54peregrine81hey 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:54aphyrYou know creation is mutation, right? That it'll take n^2-n ops to make the tree?
21:55aphyr(long story short I really don't advise doing this, if you want dual traversability use a mutable structure under the hood)
21:55jsnikerisaphyr: Let me explain what I'm trying to do, and let me know if this is a bad idea.
21:56peregrine81really dying here
21:57jsnikerisI'm going to be persisting these Nodes in a database. A Node is uniquely identified by its name and its parent Node.
21:57jsnikerisBut it's convenient to also be able to access all the children of a given Node
21:58jsnikerisSo I was planning on having the children be a lazy sequence that retrieves the children from the database
21:59jsnikerisSo to be able to persist a given Node, I need to know its parent node.
21:59aphyrBut you don't actually need to traverse back up the tree from a given node?
21:59aphyr(e.g. we're just talking about a map of paths to nodes)
22:00jsnikerisaphyr: I'm not sure at this point, but it would be nice to be able to
22:00aphyrSo first off, I'd be wary of wrapping up DB IO in lazy-seqs.
22:01aphyrJust be aware of how that's going to work, haha. :)
22:01aphyrI'm guessing you're writing these structures to a mutable database
22:01aphyrwhich suggests to me the in-memory structure may be mutable too.
22:02craigbrodnolen: alrighty JIRA issue created and patch attached
22:02craigbrodnolen: now I can go back to reading core.clj:117+
22:03aphyrThere 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:04aphyrIf your parents are identified by, say, unique IDs instead of vector/string paths, I'd just store a parent ID around.
22:05aphyrCreating 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:06aphyrChances are what you want is already *in* some java graph library, so you might consider proxying to that.
22:06aphyrIf you want a purely functional tree, you can express it with partially applied functions for nodes.
22:07aphyre.g. each node is a function which takes a child name (or nothing) and returns another node function, or its own value.
22:07aphyrUnsure of how efficient that is in Clojure, though.
22:08jsnikerisaphyr: what is the path field of the record?
22:09aphyrdunno, you tell me
22:09aphyrI figured something like [parent child1 child-of-child1]
22:09aphyror "/foo/bar/baz", that sort of thing
22:09aphyrWhatever it is that you need to serialize the record
22:10aphyrIf you're using a relational store, just take the primary key.
22:10jsnikerisaphyr: gotcha. Thanks for the advice. I need to think about this some more.
22:10jsnikerisaphyr: You gave me some good ideas, I appreciate it.
22:52hashpuppy#scala
22:56hashpuppyI'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:58uvtchashpuppy: your third question: s/being/well being/
22:58hashpuppyyes. thanks :)
22:59uvtcer, wait. Hyphenate that: s/being/well-being/
22:59uvtchashpuppy: y/w :)
23:44scottjthat poll has nothing to do with clojure or programming.
23:46eggsbytrue scottj
23:46eggsbydo you have adhd?
23:50amalloyhe probably got distracted and left
23:50eggsbytrue, he may be meditating though