Re: core.async and Joy of Clojure

2014-05-02 Thread gamma235
Wow! I had no idea about the daily specials mailing list. I have joined now though, so if I see a JOC special pop up I'll snatch it up. I don't have an e-reading platform that I like, so I have only been reading > bits and pieces of either edition. I find using my laptop with ibooks and a

simple static analysis in cljs process

2014-05-02 Thread t x
Hi, I'm currently running cljs with :optimizations none. I would like to "inject" a trivial static analysis phase of my cljs code. I.e, something like: *.cljs files -> call a clojure function of mine, which sees everything as sexps -> standard pipeline to generate *.js files Is there

Re: Vim+fireplace+lein repl+tools.namespace give: "nREPL: namespace not found"

2014-05-02 Thread Oskar Kvist
Yeah once one knows how to, it's not that bad. I used to restart the repl when this happened before and it was really annoying. :P Still, it would be great if fireplace could do something about it. :p On Saturday, May 3, 2014 2:33:09 AM UTC+2, guns wrote: > > On Fri 2 May 2014 at 05:16:41PM -07

Re: Vim+fireplace+lein repl+tools.namespace give: "nREPL: namespace not found"

2014-05-02 Thread guns
On Fri 2 May 2014 at 05:16:41PM -0700, Oskar Kvist wrote: > Hi guns, thanks for your input! > > I see, but it only happens from within Vim, not if I run `ctnr/refresh` in > the repl outside vim. I made an issue on fireplace's github that describes > how to reproduce the problem. > https://github.c

Re: Vim+fireplace+lein repl+tools.namespace give: "nREPL: namespace not found"

2014-05-02 Thread Oskar Kvist
Hi guns, thanks for your input! I see, but it only happens from within Vim, not if I run `ctnr/refresh` in the repl outside vim. I made an issue on fireplace's github that describes how to reproduce the problem. https://github.com/tpope/vim-fireplace/issues/149 On Friday, May 2, 2014 6:06:59 P

Re: Vim+fireplace+lein repl+tools.namespace give: "nREPL: namespace not found"

2014-05-02 Thread guns
On Fri 2 May 2014 at 09:06:59AM -0700, Oskar Kvist wrote: > Hi! > > I'm using Vim, vim-fireplace, `lein repl`, and tools.namespace. > > When I run `(tools.namespace.repl/refresh)` from within vim via > fireplace, it usually (perhaps always) works the first time. Say > there is a simple error like

Re: Vim+fireplace+lein repl+tools.namespace give: "nREPL: namespace not found"

2014-05-02 Thread Oskar Kvist
Although, sometimes it works. I don't know exactly what conditions triggers it. Maybe it depends on where the error is, what type of error it is, or something else. Sigh. On Friday, May 2, 2014 6:06:59 PM UTC+2, Oskar Kvist wrote: > > Hi! > > I'm using Vim, vim-fireplace, `lein repl`, and tools.

Re: deep thinking

2014-05-02 Thread Mars0i
On Friday, May 2, 2014 5:39:51 PM UTC-5, Mars0i wrote: > > There's a lot in between the amazingly common practice of barely > commenting code--as if it was self-explanatory--and literate programming. > Part of the reason I comment my code is so that *I* can understand it > later. > Also, I ful

Re: deep thinking

2014-05-02 Thread James Reeves
On 2 May 2014 23:43, Mark Engelberg wrote: > On the other side, we have people who insist that well-written code never > needs an explanation, and argue that explanations actively make things > worse. Just to be clear, this isn't something I'm arguing for. - James -- You received this messag

Re: deep thinking

2014-05-02 Thread Mark Engelberg
I find both sides of this argument to be bafflingly extremist. On one side, we have people who think that literate programming is so important and so compelling, that the state and ease of the tooling surrounding it doesn't really matter. On the other side, we have people who insist that well-wri

Re: deep thinking

2014-05-02 Thread Mars0i
There's a lot in between the amazingly common practice of barely commenting code--as if it was self-explanatory--and literate programming. Part of the reason I comment my code is so that *I* can understand it later. -- You received this message because you are subscribed to the Google Groups "

Re: deep thinking

2014-05-02 Thread James Reeves
On 2 May 2014 23:01, u1204 wrote: > I've attached a piece of code from Clojure, including the terse > "documentation". I presume one of the early Clojure authors wrote it > so I assume it is "best case, production code" by Java experts. > 1. The code you've attached wasn't written by anyone invo

Re: Clojure Course on Coursera

2014-05-02 Thread Ivan Schuetz
Looks good, thanks! Am Freitag, 2. Mai 2014 01:49:11 UTC+2 schrieb Colin Fleming: > > There's this one here: http://mooc.cs.helsinki.fi/clojure, which is run > by the University of Helsinki. I haven't done the course but I heard good > things about it. > > > On 2 May 2014 11:21, Ivan Schuetz >wr

Re: deep thinking

2014-05-02 Thread Raoul Duke
> This is code Clojure programmers depend on to work. Are you suggesting > that it is easier to read this code than a few paragraphs of natural > language? > > I must say I really find it puzzling that there is so much > resistance to writing words. It's not that hard. if the code is so bad that i

Re: deep thinking

2014-05-02 Thread u1204
James, > 3. I want to know how the library works internally. > > The third use-case is the only time literate programming makes sense, but > it's also the least used of the three. I'm also not hugely convinced it's > actually much use - whenever I read literate programs in Clojure I find > mysel

Re: Datascript and React.js for a Clojure web app

2014-05-02 Thread Kirstie Cook
dohI had set up the database but hadn't run the migration. Thank you Gjis! On Friday, May 2, 2014 5:11:55 AM UTC-5, Gijs S. wrote: > > > Hi, > > The steps to run on Heroku have been elaborated in the README, including > setting up the database: > https://github.com/thegeez/clj-crud/blob/mas

Re: seesaw >> canvas >> paint

2014-05-02 Thread Dave Ray
Someone asked something similar on reddit and my response had a couple examples of rendering app state: http://www.reddit.com/r/Clojure/comments/23uweq/watchers_and_paint_and_repaint_oh_my/ch7iw4s Hope this helps, Dave On Fri, May 2, 2014 at 1:27 PM, Christopher Howard wrote: > Suppose one i

seesaw >> canvas >> paint

2014-05-02 Thread Christopher Howard
Suppose one is using seesaw, and wants to have a canvas with lots of images and whatnot drawn inside it. The github examples pretty well cover that. However, what if you want the paint function to behave differently depending on some data elsewhere? (For example, the canvas is supposed to be a visu

Re: [ANN] packthread 0.1.0

2014-05-02 Thread James Reeves
The non-standard license might make using this library difficult to use for some companies. You may want to consider using an existing open source license that's broadly similar, such as MIT. - James On 2 May 2014 09:00, Fabien Todescato wrote: > Thanks for that great work ! Reminds me of simi

Re: problem creating lein uberjar of my cascalog +clojure project

2014-05-02 Thread John Wiseman
Hi, Sindhu. The problem is in how you've specified the org.apache.hadoop/hadoop-core dependency (I just ran into this myselfvery recently). It shouldn't be in the :dev profile, it should be in the :provided profile. This should work for you: (defproject to

Re: deep thinking

2014-05-02 Thread James Reeves
On 2 May 2014 18:08, wrote: > > Writing "just the code" is about as effective as a book containing > only the physics equations with no text, correct but opaque. > A physics equation doesn't completely describe a system. A program does. Any software designer worth his title would first collect r

Re: clojure.test parameterized tests

2014-05-02 Thread Brian Craft
Wow, I never would have figured that out from the docs. Thanks. Just found a different problem with my solution: nested tests, as described in the docs, prevent the use of fixtures. You have to add test-ns-hook when using nested tests, and then fixtures aren't run. On Friday, May 2, 2014 11:05:

research on documentation

2014-05-02 Thread daly
How Programmers Comment When They Thin Nobody's Watching http://www.cgl.uwaterloo.ca/~commenting "Documentation is essential to software development. Experienced programmers know this well from having worked with poorly documented code. They wish to improve their documentation techniques and

Re: clojure.test parameterized tests

2014-05-02 Thread Karsten Schmidt
You can use the `testing` macro and wrap it in a function, which accepts your type/protocol implementation or even individual protocol methods as args. Example here: https://github.com/thi-ng/geom/blob/master/test/core.org#callable-contexts On 2 May 2014 18:08, "Brian Craft" wrote: > Thanks. I d

Re: deep thinking

2014-05-02 Thread Fuzz Leonard
On 2 May 2014, at 10:08, d...@axiom-developer.org wrote: (Just as an aside, there is a conference called "Write the Docs". see http://writethedocs.org) The only way to find out is to read the code - that is, the algorithm, not just the names. (This code was documented, by the way.) In my

deep thinking

2014-05-02 Thread daly
(Just as an aside, there is a conference called "Write the Docs". see http://writethedocs.org) > The only way to find out is to read the code - that is, the algorithm, > not just the names. (This code was documented, by the way.) In my > experience clashes between the natural language semantics

Re: clojure.test parameterized tests

2014-05-02 Thread Brian Craft
Thanks. I did something similar. I have different implementations per db, so use a global *db* var: (ct/deftest run-tests (matrix1)) ; matrix1 tests against *db* (ct/deftest test-h2 (binding [*db* (h2/create-db2 "test" {:subprotocol "h2:mem"})] (run-tests))) (defn test-ns-hook [] (tes

Re: Vim+fireplace+lein repl+tools.namespace give: "nREPL: namespace not found"

2014-05-02 Thread Oskar Kvist
And to be clear, the fireplace issues that I found when searching for a solution have all been fixed and closed. On Friday, May 2, 2014 6:06:59 PM UTC+2, Oskar Kvist wrote: > > Hi! > > I'm using Vim, vim-fireplace, `lein repl`, and tools.namespace. > > When I run `(tools.namespace.repl/refresh)`

Vim+fireplace+lein repl+tools.namespace give: "nREPL: namespace not found"

2014-05-02 Thread Oskar Kvist
Hi! I'm using Vim, vim-fireplace, `lein repl`, and tools.namespace. When I run `(tools.namespace.repl/refresh)` from within vim via fireplace, it usually (perhaps always) works the first time. Say there is a simple error like a misspelled word. The second time I try to run `(tools.namespace.re

Re: Converting sequence from sort into a list

2014-05-02 Thread Dave Tenny
Sort returns a seq, but not necessarily something for which list? is true. On Fri, May 2, 2014 at 11:01 AM, Plínio Balduino wrote: > Hi Dave > > Sorry if I didn't get it, but doesn't sort already return a list? > > Could explain? > > Plínio > > > > On Fri, May 2, 2014 at 11:53 AM, Dave Tenny w

Re: clojure.test parameterized tests

2014-05-02 Thread Chris Price
I have been curious about this too. I was playing around with it a few weeks ago and came up with this: https://github.com/cprice404/clj-shared-test-sandbox/blob/master/test/shared_tests_foo/core_test.clj Which is pretty gross; it uses `binding` + a dynamic var in the shared test namespace, an

Re: Converting sequence from sort into a list

2014-05-02 Thread Gary Trakhman
Ah, scratch that, list* returns a seq as well. On Fri, May 2, 2014 at 11:07 AM, Gary Trakhman wrote: > I believe what he wants is a persistentlist. You could get one from > (apply list) or more succinctly/esoterically (list* ..) > > Sort returns a seq view over the array returned by java.util.A

Re: Converting sequence from sort into a list

2014-05-02 Thread Gary Trakhman
I believe what he wants is a persistentlist. You could get one from (apply list) or more succinctly/esoterically (list* ..) Sort returns a seq view over the array returned by java.util.Array.sort() (defn sort "Returns a sorted sequence of the items in coll. If no comparator is supplied, use

Re: Converting sequence from sort into a list

2014-05-02 Thread Plínio Balduino
Hi Dave Sorry if I didn't get it, but doesn't sort already return a list? Could explain? Plínio On Fri, May 2, 2014 at 11:53 AM, Dave Tenny wrote: > I have a sequence from a call to 'sort'. > I want a list. > > What is the best way to do this? > > (apply list (sort ...))? > > Will it have p

Converting sequence from sort into a list

2014-05-02 Thread Dave Tenny
I have a sequence from a call to 'sort'. I want a list. What is the best way to do this? (apply list (sort ...))? Will it have problems on large sequence inputs? I can't use (into () (sort ...)) since that conjoins and ruins the sort order. -- You received this message because you are subsc

Re: core.async and Joy of Clojure

2014-05-02 Thread Mars0i
Nice to know about the 7 models book. I wasn't aware of it. I can't give you an opinion about JoC 2nd vs. 1st ed., though. I haven't read either thoroughly. I only got the first edition when I bought the pre-release 2nd edition package last fall. I don't have an e-reading platform that I li

Re: Proposing a new Clojure documentation system (in Clojure)

2014-05-02 Thread Gregg Reynolds
On Fri, May 2, 2014 at 4:00 AM, Val Waeselynck wrote: > > That is NOT what I said. Please go back and read my response more >> carefully. >> > > Apologies, guess I disagree only with Gregg on that point then. > I guess this illustrates a point that is usually overlooked: no matter how good your d

Re: Proposing a new Clojure documentation system (in Clojure)

2014-05-02 Thread Gregg Reynolds
On Thu, May 1, 2014 at 9:49 PM, Sean Corfield wrote: > On Apr 30, 2014, at 4:08 PM, Val Waeselynck wrote: > > As for what Gregg and Sean objected - that Clojure code is > self-sufficient as documenting itself - I have to simply disagree. > > That is NOT what I said. Please go back and read my

Re: Cleaner solution, anyone?

2014-05-02 Thread Divyansh Prakash
I've been trying out my code in both Clojure and ClojureScript REPLs. 1. Ratio not being a type in js might cause inconsistencies if not used carefully. (for eg in a web app that uses both clj and cljscript) 2. Lazy sequences in Clojure are lazy in

Re: how can I print the function name as parameter?

2014-05-02 Thread Erlis Vidal
Wow, Thank you all! I'll try all the proposal but I think I'll use the tool.trace recommended by Henry. On Fri, May 2, 2014 at 8:08 AM, Toby Crawley wrote: > A simpler version: > > (defmacro show [f & args] > (let [f-var# (resolve f)] > `(println ~f-var# (~f ~@args > > On Friday,

Re: how can I print the function name as parameter?

2014-05-02 Thread Toby Crawley
A simpler version: (defmacro show [f & args] (let [f-var# (resolve f)] `(println ~f-var# (~f ~@args On Friday, May 2, 2014 8:04:30 AM UTC-4, Toby Crawley wrote: > > You could implement show as a macro that resolves the var before calling > the fn: > > (defmacro show [f & args] >

Re: how can I print the function name as parameter?

2014-05-02 Thread Toby Crawley
You could implement show as a macro that resolves the var before calling the fn: (defmacro show [f & args] (let [f-var# (resolve f)] `(let [r# (~f ~@args)] (println ~f-var# r# user> (show + 1 2) #'clojure.core/+ 3 - Toby unlo...@bytopia.org writes: > You need to pass not the f

Re: how can I print the function name as parameter?

2014-05-02 Thread Alexander Yakushev
You need to pass not the function itself, but its Var. Because Vars are the ones that hold metadata. (show #'elementary/nothing-but-the-truth true) On Friday, May 2, 2014 4:28:49 AM UTC+2, Erlis Vidal wrote: > > Hi guys, > > I want to write a function (show) that will receive a function as > p

Re: Datascript and React.js for a Clojure web app

2014-05-02 Thread Gijs S.
Hi, The steps to run on Heroku have been elaborated in the README, including setting up the database: https://github.com/thegeez/clj-crud/blob/master/README.md I've also disabled the ability to change the name of the Admin account, so the Admin/admin login stays valid. -Gijs On Thursday, Ma

Re: Proposing a new Clojure documentation system (in Clojure)

2014-05-02 Thread Val Waeselynck
> That is NOT what I said. Please go back and read my response more > carefully. > Apologies, guess I disagree only with Gregg on that point then. > > Anyway, I think speculating about the necessity of such a > documentation system is not the best thing to do - I suggest we give it a >

Re: Cleaner solution, anyone?

2014-05-02 Thread Divyansh Prakash
Exactly! By the way, I posted the same questionto stackoverflow. A. Webb seems to agree with Steve, showing a version using reduced. Thank you for the response, guys! On Friday, May 2, 2014 1:38:09 AM UTC+5:30, Guru De

Re: [ANN] packthread 0.1.0

2014-05-02 Thread Fabien Todescato
Thanks for that great work ! Reminds me of similar techniques in the context of logic programming : http://www.info.ucl.ac.be/~pvr/edcg.html :) > > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegro

Re: how can I print the function name as parameter?

2014-05-02 Thread henry w
in case you are not aware of it https://github.com/clojure/tools.trace may already do just what you want. but if not, then how about this show fn takes a symbol as arg? that is how tools.trace/trace-vars does it. On Friday, May 2, 2014 3:28:49 AM UTC+1, Erlis Vidal wrote: > > Hi guys, > > I w

Re: twitter-api and streaming calls

2014-05-02 Thread Simon Katz
Thanks Andrew and Gary. You've saved me a lot of time! On Friday, 2 May 2014 02:43:51 UTC+1, Gary Trakhman wrote: > > Oh, nice, I was concerned about reconnections and backfill issues, if I > have to change anything substantial again I'll reimplement on top of the > java api that provides this