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 out of the box.
>
>
> On Thu, May 1, 2014 at 9:13 PM, Andrew Fitzgerald 
> 
> > wrote:
>
>> I had the same (very frustrating issue) recently. I ended up just using 
>> the official twitter API which is written in Java 
>> https://github.com/twitter/hbc
>>
>>
>> On Thursday, May 1, 2014 6:59:04 PM UTC-4, Simon Katz wrote:
>>>
>>> Hi,
>>>
>>> I'm playing with twitter-api (https://github.com/adamwynne/twitter-api) 
>>> and streaming calls. I've also tried twitter-streaming-client (
>>> https://github.com/mccraigmccraig/twitter-streaming-client).
>>>
>>> With the examples each of those provide, I'm getting *EOFException: 
>>> JSON error (end-of-file)* errors.
>>>
>>> I can of course post more details, but I'm hoping someone else might 
>>> have come across this and be able to give me a pointer as to what's 
>>> happening.
>>>
>>> I wonder if perhaps something's changed in the Twitter API recently to 
>>> break things.
>>>
>>> __
>>> Simon
>>>
>>  -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 want to write a function (show) that will receive a function as 
> parameter. How can print the original name of that function? I've tried 
> with meta, resolve, name but none of them give me the result I want. 
>
> The goal is that I want to write a function that print the name of the 
> function that will be executed then the result of that execution. If 
> there's a better way to achieve this I'll appreciate your suggestions. 
>
> Thanks!
> Erlis 
>
> (defn show [f sol]
>   (print (meta f)))
>
>
> (defn -main []
>(show elementary/nothing-but-the-truth true))
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 Devanla wrote:
>
> Neat, so in your last solution are you trying to get rid of recur and 
> solve 1 - (1/2)^x =  ?
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 
> try, and then everyone can decide for themselves if it's useful. After all, 
> it's in Clojure, so this should not take too long, right ? ;) 
>
> Go ahead and build something and see if people like it. That's probably a 
> better approach than trying to discuss it anyway. 
>

We'll do.
 

> Sean Corfield -- (904) 302-SEAN 
> An Architect's View -- http://corfield.org/ 
>
> "Perfection is the enemy of the good." 
> -- Gustave Flaubert, French realist novelist (1821-1880) 
>
(By the way, that's actually from Montesquieu (Liberalist ,1689-1755), in 
*Cahiers*. I'd rather translate it "Better is the deadly enemy of good".)
 

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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, May 1, 2014 8:54:45 PM UTC+2, Kirstie Cook wrote:
>
> very coolI've cloned it to play around with it. It runs locally just 
> fine, but when deploying to heroku I get a 404 not found after trying to 
> login or sign up. is there anything else that needs to be in order to 
> deploy it to heroku?
>
> On Wednesday, April 30, 2014 8:32:24 AM UTC-5, Gijs S. wrote:
>>
>> Hi all,
>>
>> I've released a Clojure web application. It includes a front-end using 
>> DataScript and React.js in ClojureScript.
>>
>> More details here: 
>> http://thegeez.net/2014/04/30/datascript_clojure_web_app.html
>>
>> The code is on github: https://github.com/thegeez/clj-crud
>>
>> Demo on heroku: http://clj-crud.herokuapp.com/
>>
>> Best regards,
>> Gijs 
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 
> parameter. How can print the original name of that function? I've tried 
> with meta, resolve, name but none of them give me the result I want. 
>
> The goal is that I want to write a function that print the name of the 
> function that will be executed then the result of that execution. If 
> there's a better way to achieve this I'll appreciate your suggestions. 
>
> Thanks!
> Erlis 
>
> (defn show [f sol]
>   (print (meta f)))
>
>
> (defn -main []
>(show elementary/nothing-but-the-truth true))
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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
>> parameter. How can print the original name of that function? I've tried
>> with meta, resolve, name but none of them give me the result I want.
>>
>> The goal is that I want to write a function that print the name of the
>> function that will be executed then the result of that execution. If
>> there's a better way to achieve this I'll appreciate your suggestions.
>>
>> Thanks!
>> Erlis
>>
>> (defn show [f sol]
>>   (print (meta f)))
>>
>>
>> (defn -main []
>>(show elementary/nothing-but-the-truth true))
>>
>>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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] 
>   (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 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 
> >> parameter. How can print the original name of that function? I've tried 
> >> with meta, resolve, name but none of them give me the result I want. 
> >> 
> >> The goal is that I want to write a function that print the name of the 
> >> function that will be executed then the result of that execution. If 
> >> there's a better way to achieve this I'll appreciate your suggestions. 
> >> 
> >> Thanks! 
> >> Erlis 
> >> 
> >> (defn show [f sol] 
> >>   (print (meta f))) 
> >> 
> >> 
> >> (defn -main [] 
> >>(show elementary/nothing-but-the-truth true)) 
> >> 
> >> 
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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, 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]
>>   (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 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
>> >> parameter. How can print the original name of that function? I've
>> tried
>> >> with meta, resolve, name but none of them give me the result I want.
>> >>
>> >> The goal is that I want to write a function that print the name of the
>> >> function that will be executed then the result of that execution. If
>> >> there's a better way to achieve this I'll appreciate your suggestions.
>> >>
>> >> Thanks!
>> >> Erlis
>> >>
>> >> (defn show [f sol]
>> >>   (print (meta f)))
>> >>
>> >>
>> >> (defn -main []
>> >>(show elementary/nothing-but-the-truth true))
>> >>
>> >>
>>
>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 word-sized chunks, whereas 
ClojureScript appears to be truly lazy.

This might be important, because the following code *terminates in 
clojurescript, but not in clojure*:

(take 2 (map state (range)))

due to the 2 reasons listed above.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 response more
> carefully.


Not what I said either.  Where did "self-sufficient" come from?

-Gregg

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 documentation is, somebody will always misread it.  Which gets
back to the point I was trying to make: the ultimate source of
authoritative information about what the code does is the code itself.  It
does not follow that the names used in the code are reliable guides to what
the code means.  Consider the following (mangled from
http://en.wikibooks.org/wiki/Clojure_Programming/Examples/Lazy_Fibonacci):

(def factorial
  ((fn rfact [a b]
 (lazy-seq (cons a (rfact b (+ a b)
   0 1))


Obviously not a factorial function; to know what it is, you have to read
the code, which expresses an algorithm (in this case fibonacci).  Something
this extreme probably doesn't happen very often, but something very like it
happens all the time.  Yesterday I was working through some Java code
called "fooReader".  The docstring said it inherited from XMLReader.  It
did not, rather it inherited from XMLFilter.  Which in turn inherits from
AbstractWriter.  So what is it, a Reader, Filter, or Writer?  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 of function and var names on the one
had, and the jobs they actually do on the other, is pervasive, and I see
little chance that this will ever change.  Not because programmers are dumb
but because coming up with expressive and accurate names is hard and time
consuming.

Which leads to a larger point: a genuine improvement in the Clojure
documentation situation requires (IMHO) some Deep Thinking about the nature
of code, the relation between code (text) and algorithm, natural language
text, expressivity, programmer practices, etc.  In other words, we should
follow Rich Hickey's example - I take it that Clojure itself emerged from
some Deep Thinking about the nature of computation, programming language
design, etc.

-Gregg

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 like, 
so I have only been reading bits and pieces of either edition.  I'll read 
it seriously when the paper edition comes (unless I buy a tablet first).

(Are you on the Manning Publishing daily specials mailing list?  That's how 
I got the pre-release package for 1/2 price, and I have seen that offer 
more than once since I bought the package.  It may that at this point they 
won't offer any further 1/2 price deals on JoC, but if they do, you could 
buy it that way.)

On Friday, May 2, 2014 1:07:36 AM UTC-5, gamma235 wrote:
>
> Thank you Mars0i!!
>
> I have a first edition copy of JOC and really like the way it just lays 
> things out for you. I am hesitating to buy the 2nd edition, though, due to 
> the hefty price-tag, though I am curious about logic programming and data. 
> Would you say it is worth the money?
>
> I am now reading the 7 concurrency models in 7 weeks beta version 
> (recommended by Alex Ott, above) and am finding it thoroughly enjoyable. It 
> masquerades as language agnostic, but the first half is virtually a Clojure 
> book in the way it introduces Java's concurrency solutions (or lack 
> thereof), priming you for the subsequent chapters that go into Clojure's 
> primitives, core.async, and even Clojurescript. There is a chapter on 
> actors, using Elixir, and then the latter half gets more  general talking 
> about how concurrency relates to big data and Hadoop, using Java. In 
> general, I think all of the information is pertinent for a Clojure 
> programmer who wants to become more well-rounded on the subject.
>
> J
>
> On Friday, May 2, 2014 1:07:00 PM UTC+9, Mars0i wrote:
>>
>> On Monday, April 28, 2014 9:42:06 AM UTC-5, gamma235 wrote:
>>>
>>> I heard that Joy of Clojure would be adding a lot in the 2nd edition, 
>>> including a section on core.logic; is core.async also on that list? 
>>>
>>
>> I bought the pre-release + final release *Joy of Clojure* 2nd ed. 
>> package, so I have the v10 prerelease version.  This seems to be the final 
>> version before the regular release.  I did a search through the v10 pdf, 
>> and found no instances of "core.async", and the string "async" appeared 
>> only in the word "asynchronous".  By contrast, there are indeed many 
>> instances of "core.logic".
>>
>> The eBook version is supposed to come out in mid-May, and the print and 
>> other electronic versions some time after that.  The last email that I got 
>> says that the book "is now in production where it will get a thorough 
>> polishing before publication."  So it sounds as if the authors and 
>> publisher are only fixing typos and doing other small changes at this 
>> point, and that core.async will not be discussed in the book.
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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 subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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, uses compare. comparator must
  implement java.util.Comparator."
  {:added "1.0"
   :static true}
  ([coll]
   (sort compare coll))
  ([^java.util.Comparator comp coll]
   (if (seq coll)
 (let [a (to-array coll)]
   (. java.util.Arrays (sort a comp))
   (seq a))
 (


(class (sort (range 10)))
clojure.lang.ArraySeq


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  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 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 subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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.Array.sort()
>
> (defn sort
>
>   "Returns a sorted sequence of the items in coll. If no comparator is
>   supplied, uses compare. comparator must
>   implement java.util.Comparator."
>   {:added "1.0"
>:static true}
>   ([coll]
>(sort compare coll))
>   ([^java.util.Comparator comp coll]
>(if (seq coll)
>  (let [a (to-array coll)]
>(. java.util.Arrays (sort a comp))
>(seq a))
>  (
>
>
> (class (sort (range 10)))
> clojure.lang.ArraySeq
>
>
> 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  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 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 subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clojure@googlegroups.com
>>> Note that posts from new members are moderated - please be patient with
>>> your first post.
>>> To unsubscribe from this group, send email to
>>> clojure+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to clojure+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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, and then it calls `clojure.test/run-tests` from inside of a 
`deftest`.  I'm sure there's got to be a better way, but that was as far as 
I got in the small amount of time that I was able to spend on it.

On Thursday, May 1, 2014 5:58:51 PM UTC-7, Brian Craft wrote:
>
> I have a number of tests that I would like to run against different 
> implementations of a protocol. In clojure.test there doesn't appear to be a 
> way to parameterize a test over the implementations. Is there a good way to 
> do this?
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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  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 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 subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojure/sN37zftHSQ4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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.repl/refresh)`, I get back the error "nREPL: namespace 
not found". I don't know exactly what causes it. If I search for it on the 
web, most hits are fireplace issues. But it says "nREPL", and maybe 
"namespace not found" can have something to do with tools.namespace 
unloading them while refreshing. If I quit and restart `lein repl`, the 
error disappears the first time I do `(tools.namespace.repl/refresh)`. But 
for the second error after the restart, it comes back, i.e. the exact same 
thing happens as before, only I have managed to fix one more error in my 
code.

Does anyone know what's wrong?

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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)` 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.repl/refresh)`, I get back the error "nREPL: namespace 
> not found". I don't know exactly what causes it. If I search for it on the 
> web, most hits are fireplace issues. But it says "nREPL", and maybe 
> "namespace not found" can have something to do with tools.namespace 
> unloading them while refreshing. If I quit and restart `lein repl`, the 
> error disappears the first time I do `(tools.namespace.repl/refresh)`. But 
> for the second error after the restart, it comes back, i.e. the exact same 
> thing happens as before, only I have managed to fix one more error in my 
> code.
>
> Does anyone know what's wrong?
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 []
  (test-h2))

Clumsy, but seems to be the only option.

On Friday, May 2, 2014 8:29:23 AM UTC-7, Chris Price wrote:
>
> 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, and then it calls `clojure.test/run-tests` from inside of a 
> `deftest`.  I'm sure there's got to be a better way, but that was as far as 
> I got in the small amount of time that I was able to spend on it.
>
> On Thursday, May 1, 2014 5:58:51 PM UTC-7, Brian Craft wrote:
>>
>> I have a number of tests that I would like to run against different 
>> implementations of a protocol. In clojure.test there doesn't appear to be a 
>> way to parameterize a test over the implementations. Is there a good way to 
>> do this?
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 of function
> and var names on the one had, and the jobs they actually do on the
> other, is pervasive, and I see little chance that this will ever
> change.  Not because programmers are dumb but because coming up with
> expressive and accurate names is hard and time consuming.

Imagine if a physics professor said that the only way to understand
anything was to read the formula... not the text "documentation". In
some sense it is true that the formula (i.e. code) is "truth" but
everyone EXPECTS that the surrounding text is accurate and up to
date. Otherwise, there would be a LOT of people telling the author
about the mismatch. Why don't we expect the same in programming?
Writing "just the code" is about as effective as a book containing
only the physics equations with no text, correct but opaque.

We CAN have accurate, up-to-date, documentation. It requires changes
to the way we write software. In particular, clear and accurate
documentation should be a REQUIREMENT for every change checked into
a repository. We have "code reviews" to check for bad code. The code
review should also check that the code mirrors the documentation.

This doesn't require a tool, per se, but a good tool would help
others navigate among the ideas.



> Which leads to a larger point: a genuine improvement in the Clojure
> documentation situation requires (IMHO) some Deep Thinking about the nature
> of code, the relation between code (text) and algorithm, natural language
> text, expressivity, programmer practices, etc.  In other words, we should
> follow Rich Hickey's example - I take it that Clojure itself emerged from
> some Deep Thinking about the nature of computation, programming language
> design, etc.

Any software designer worth his title would first collect requirements.
Then each of the proposed solutions can be checked to see if they
fulfill the requirements. Most of the posted ideas don't begin to
fulfill the requirements. Good documentation is not a new idea.
It has been thought about deeply before.

I know that some people dismiss literate programming "by fiat" (aka
it is worthless..., it can't work..., it adds nothing..., etc) but
surely Knuth is a "Deep Thinker" on par with Rich Hickey. 

Knuth said:

  "I believe that the time is ripe for significantly better
   documentation of programs, and that we can best achieve this
   by considering programs to be works of literature. Hence, my 
   title "Literate Programming".
   Let us change our traditional attitude to the construction
   of programs: Instead of imagining that our main task is to 
   instruct a computer what to do, let us concentrate rather on
   explaining to human beings what we want a computer to do."

Knuth said:

  "Yet to me, literate programming is certainly the most important
   thing that came out of the TeX project. Not only has it enabled
   me to write and maintain programs faster and more reliably than
   ever before, and been one of my greatest sources of joy since 
   the 1980s -- it has actually been indispensable at times. Some
   of my major programs, such as the MMIX meta-simulators, could
   not have been written with any other methodology that I've ever
   heard of. The complexity was simply too daunting for my limited
   brain to handle; without literate programming, the whole enterprise
   would have flopped miserably.
   If people discover nice ways to use the newfangled multi-
   threaded machines, I would expect the discovery to come from
   people who routinely use literate programming. Literate programming
   is what you need to rise above the ordinary level of achievement"

Bill Hart, on the SAGE Mailing list wrote:

  "Another thing I've been enjoying lately is literate programming.
   Amazingly it turns out to be faster to write a literate program
   than an ordinary program because debugging takes almost no time."

Ross Williams, in the FunnelWeb Tutorial wrote:

  "The effect of this simple shift of emphasis can be so profound as
   to change one's whole approach to programming. Under the literate
   programming paradigm, the central activity of programming
   becomes that of conveying meaning to other intelligent beings
   rather than merely convincing the computer to behave in a 
   particular way. It is the difference between performing and 
   exposing a magic trick."




























  

























-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojur

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
experience clashes between the natural language semantics of function
and var names on the one had, and the jobs they actually do on the
other, is pervasive, and I see little chance that this will ever
change.  Not because programmers are dumb but because coming up with
expressive and accurate names is hard and time consuming.


Imagine if a physics professor said that the only way to understand
anything was to read the formula... not the text "documentation". In
some sense it is true that the formula (i.e. code) is "truth" but
everyone EXPECTS that the surrounding text is accurate and up to
date. Otherwise, there would be a LOT of people telling the author
about the mismatch. Why don't we expect the same in programming?


Because, unlike the laws of physics, programming "formula" are in a 
constant state of flux and can be modified by mortals. Physics formulae 
describe a system; code is the system.



:Fuzz

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups "Clojure" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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 []
>   (test-h2))
>
> Clumsy, but seems to be the only option.
>
> On Friday, May 2, 2014 8:29:23 AM UTC-7, Chris Price wrote:
>>
>> 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, and then it calls `clojure.test/run-tests` from inside of a
>> `deftest`.  I'm sure there's got to be a better way, but that was as far as
>> I got in the small amount of time that I was able to spend on it.
>>
>> On Thursday, May 1, 2014 5:58:51 PM UTC-7, Brian Craft wrote:
>>>
>>> I have a number of tests that I would like to run against different
>>> implementations of a protocol. In clojure.test there doesn't appear to be a
>>> way to parameterize a test over the implementations. Is there a good way to
>>> do this?
>>>
>>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 habits, but there is little consensus for them
 to follow. Somehow, the many different standards must be compared
 objectively."

  

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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:56 AM UTC-7, Karsten Schmidt wrote:
>
> 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 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 []
>>   (test-h2))
>>
>> Clumsy, but seems to be the only option.
>>
>> On Friday, May 2, 2014 8:29:23 AM UTC-7, Chris Price wrote:
>>>
>>> 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, and then it calls `clojure.test/run-tests` from inside of a 
>>> `deftest`.  I'm sure there's got to be a better way, but that was as far as 
>>> I got in the small amount of time that I was able to spend on it.
>>>
>>> On Thursday, May 1, 2014 5:58:51 PM UTC-7, Brian Craft wrote:

 I have a number of tests that I would like to run against different 
 implementations of a protocol. In clojure.test there doesn't appear to be 
 a 
 way to parameterize a test over the implementations. Is there a good way 
 to 
 do this?

>>>  -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 requirements.
>

Collecting requirements assumes you know what you're looking for. In this
case it seems wiser to experiment.

I know that some people dismiss literate programming "by fiat" (aka
> it is worthless..., it can't work..., it adds nothing..., etc) but
> surely Knuth is a "Deep Thinker" on par with Rich Hickey.
>

A lot of the praise for literate programming, including the quotations you
provide, is that it's a way of helping the original author understand the
software they're writing.

But as a form of *documentation,* I'm not convinced literate programming
has much worth. When I approach a new library or tool, I typically find
myself in one of three states:

   1. I understand the concept of the library, but need a reference.
   2. I don't understand the concept of the library, and need it explaining
   to me.
   3. I want to know how the library works internally.

For the first use-case, what I'm after is an index, like Autodoc or Codox.
A literate program isn't particularly good for this, because it follows a
linear narrative.

For the second use-case I want an in-depth description of what the library
does, along with plenty of examples. Literate programming fits this case a
little better, but isn't geared up around the idea of providing example
code. Literate programs show you what the program does, but not necessarily
how to use it effectively.

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
myself skipping down to the code, as it's actually easier for me to read
the code than the English text accompanying it!

And is that such a surprise? Computer languages are designed (or should be
designed) for readability by humans. They're a specialised language for
describing code to other people, and only incidentally executable by
computers. If execution of code was all we cared about, we'd be writing
assembly.

I'm also of the opinion that programming languages are far more expressive
today than they were back when Knuth originally came up with the idea of
literate programming.

- James

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 torunproject "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME";
  :license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[cascalog "1.10.2-SNAPSHOT"]
 [org.clojure/clojure "1.5.1"][clj-time "0.7.0"]]
  :profiles {:provided
 {:dependencies [[org.apache.hadoop/hadoop-core "1.1.2"]]}}
  :jvm-opts ["-Xmx768m"]
  :repositories [["conjars.org" "http://conjars.org/repo";]]
  :main torunproject.core)

About :provided, the lein
tutorialsays
the following:

---

Many Java frameworks expect deployment of a jar file or derived archive
sub-format containing a subset of the application's necessary dependencies.
The framework expects to provide the missing dependencies itself at
run-time. Dependencies which are provided by a framework in this fashion
may be specified in the :provided profile. Such dependencies will be
available during compilation, testing, etc., but won't be included by
default by the uberjar task or plugin tasks intended to produce stable
deployment artifacts.

For example, Hadoop job jars may be just regular (uber)jar files containing
all dependencies except the Hadoop libraries themselves:

(project example.hadoop "0.1.0"
  ...
  :profiles {:provided
 {:dependencies
  [[org.apache.hadoop/hadoop-core "0.20.2-dev"]]}}
  :main example.hadoop)


John




On Thu, May 1, 2014 at 5:54 AM, sindhu hosamane  wrote:

> I have a cascalog project which is working perfect in eclipse .
> Now i have single node hadoop cluster up and running .
> To run my cascalog project on hadoop cluster  , i have to create a jar
> using lein uberjar.
> But i have the error and cannot create a jar :
>
> Exception in thread "main" java.lang.ClassNotFoundException:
> org.apache.hadoop.fs.FileSystem, compiling:(core.clj:1:1)
>
> Caused by: java.lang.ClassNotFoundException:
> org.apache.hadoop.fs.FileSystem
>
> What could be the reason ? my core.clj(source code)  of project contains (
> defn -main) and also included :main in my project.clj .
>
> For reference i am also attaching my project for which i want to create a
> jar using uberjar . I need a help.
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 visual representation of model data.) Should you
just have the paint function capture the (modifiable) data variable,
and use that each time? Or...?

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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 visual representation of model data.) Should you
> just have the paint function capture the (modifiable) data variable,
> and use that each time? Or...?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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/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, May 1, 2014 8:54:45 PM UTC+2, Kirstie Cook wrote:
>>
>> very coolI've cloned it to play around with it. It runs locally just 
>> fine, but when deploying to heroku I get a 404 not found after trying to 
>> login or sign up. is there anything else that needs to be in order to 
>> deploy it to heroku?
>>
>> On Wednesday, April 30, 2014 8:32:24 AM UTC-5, Gijs S. wrote:
>>>
>>> Hi all,
>>>
>>> I've released a Clojure web application. It includes a front-end using 
>>> DataScript and React.js in ClojureScript.
>>>
>>> More details here: 
>>> http://thegeez.net/2014/04/30/datascript_clojure_web_app.html
>>>
>>> The code is on github: https://github.com/thegeez/clj-crud
>>>
>>> Demo on heroku: http://clj-crud.herokuapp.com/
>>>
>>> Best regards,
>>> Gijs 
>>>
>>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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
> myself skipping down to the code, as it's actually easier for me to read
> the code than the English text accompanying it!


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.

I am currently writing a literate version of Clojure and I'm trying to
explain this method. I can read the code and I've been programming in
Java since it was called Oak but I must say I still find this quite
opaque and hard to explain. I'm also familiar with the visitor pattern.

This code has low-level, semantically void operations like "v + 2"
operations on indices, similar in style to pointer operations in C.
There is flag testing (e.g. dann != 0) on variables whose names are not
exactly indicitive of the semantics. There are unexplained "options
flags" which "can be used to modify the default behavior of the class".
There is endless nested testing of conditions. If I have to add a new
attrName what contracts do I need to fulfill? What invariants must I
maintain? Should w be v+6 or anns be v+6?

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.


/**
 * Makes the given visitor visit the Java class of this 
 * {@link ClassReader}. This class is the one specified in the 
 * constructor (see {@link #ClassReader(byte[]) ClassReader}).
 *
 * @param classVisitor the visitor that must visit this class.
 * @param attrsprototypes of the attributes that must be parsed 
 * during the visit of the class. Any attribute whose
 * type is not equal to the type of one the 
 * prototypes will not be parsed: its byte array
 * value will be passed unchanged to the ClassWriter. 
 * This may corrupt it if this value contains 
 * references to the constant pool, or has syntactic 
 * or semantic links with a class element that has
 * been transformed by a class adapter between the 
 * reader and the writer.
 * @param flagsoption flags that can be used to modify the 
 * default behavior of this class. See 
 * {@link #SKIP_DEBUG}, {@link #EXPAND_FRAMES}.
 */
public void accept(
final ClassVisitor classVisitor,
final Attribute[] attrs,
final int flags){
byte[] b = this.b; // the bytecode array
char[] c = new char[maxStringLength]; // buffer used to read strings
int i, j, k; // loop variables
int u, v, w; // indexes in b
Attribute attr;

int access;
String name;
String desc;
String attrName;
String signature;
int anns = 0;
int ianns = 0;
Attribute cattrs = null;

// visits the header
u = header;
access = readUnsignedShort(u);
name = readClass(u + 2, c);
v = items[readUnsignedShort(u + 4)];
String superClassName = v == 0 ? null : readUTF8(v, c);
String[] implementedItfs = new String[readUnsignedShort(u + 6)];
w = 0;
u += 8;
for(i = 0; i < implementedItfs.length; ++i)
{
implementedItfs[i] = readClass(u, c);
u += 2;
}

boolean skipCode = (flags & SKIP_CODE) != 0;
boolean skipDebug = (flags & SKIP_DEBUG) != 0;
boolean unzip = (flags & EXPAND_FRAMES) != 0;

// skips fields and methods
v = u;
i = readUnsignedShort(v);
v += 2;
for(; i > 0; --i)
{
j = readUnsignedShort(v + 6);
v += 8;
for(; j > 0; --j)
{
v += 6 + readInt(v + 2);
}
}
i = readUnsignedShort(v);
v += 2;
for(; i > 0; --i)
{
j = readUnsignedShort(v + 6);
v += 8;
for(; j > 0; --j)
{
v += 6 + readInt(v + 2);
}
}
// reads the class's attributes
signature = null;
String sourceFile = null;
String sourceDebug = null;
String enclosingOwner = null;
String enclosingName = null;
String enclosingDesc = null;

i = readUnsignedShort(v);
v += 2;
for(; i > 0; --i)
{
attrName = readUTF8(v, c);
// tests are sorted in decreasing frequency order
// (based on frequencies observed on typical classes)
if(attrName.equals("SourceFile"))
{
sourceFile = readUTF8(v + 6, c);
}
else if(attrName.equals("

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 it needs comments, then fix the freaking
source code in the first place.

;-) ;-)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 >wrote:
>
>> What happened with this? I would really love to make a Clojure course in 
>> Coursera... Still none :(
>>
>>
>> Am Donnerstag, 20. September 2012 14:43:52 UTC+2 schrieb Belun:
>>
>>> It would be really interesting to see a course about Clojure on 
>>> coursera.org, where a Scala and functional programming course just 
>>> started https://class.coursera.org/course/progfun
>>
>>  -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 involved in Clojure
AFAIK. According to the header at the top of the file, it's open source
code written by France Telecom.

2. The code is Java, rather than Clojure, and I believe we were talking
about documenting the latter. Less expressive languages like Java tend to
need more in the way of additional documentation, because there's less
opportunity for useful abstraction.

3. I wouldn't class this as an example of well-written code, even for Java
:)

- James

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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-written code never
needs an explanation, and argue that explanations actively make things
worse.

I find it difficult to relate because it seems so clear to me that both
these extremes are false and that the truth lies somewhere in the middle.

I really liked the spirit of the poster who kicked off this thread.  Let's
build tools that explore more points along the spectrum than just
full-blown Knuth literate programming, or just Clojure doc-strings, or no
comments at all.  I think there's a sweet spot in there that we haven't
reached yet.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 fully support literate programming for those who find it especially 
useful.   And I think we all agree that something more than "no comments 
anywhere" is what's needed.  It's a matter of degree, and the appropriate 
degree probably depends on the language, the nature of the code, including 
how well variables and functions are named, the expected readers of the 
code, the future use of the code, etc.  I think programmers differ in how 
much they can get from just reading through code, some people will be 
coming from other areas of programming, or will need to understand part of 
a library without understanding the whole thing, etc.  More text is better 
for some purposes, but not for all. 

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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.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.repl/refresh)`, I get back the error "nREPL: namespace 
> not found". I don't know exactly what causes it. If I search for it on the 
> web, most hits are fireplace issues. But it says "nREPL", and maybe 
> "namespace not found" can have something to do with tools.namespace 
> unloading them while refreshing. If I quit and restart `lein repl`, the 
> error disappears the first time I do `(tools.namespace.repl/refresh)`. But 
> for the second error after the restart, it comes back, i.e. the exact same 
> thing happens as before, only I have managed to fix one more error in my 
> code.
>
> Does anyone know what's wrong?
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 a misspelled word. The second time I
> try to run `(tools.namespace.repl/refresh)`, I get back the error
> "nREPL: namespace not found". I don't know exactly what causes it. If
> I search for it on the web, most hits are fireplace issues. But it
> says "nREPL", and maybe "namespace not found" can have something to
> do with tools.namespace unloading them while refreshing. If I quit
> and restart `lein repl`, the error disappears the first time I do
> `(tools.namespace.repl/refresh)`. But for the second error after the
> restart, it comes back, i.e. the exact same thing happens as before,
> only I have managed to fix one more error in my code.

Hi Oskar,

ctnr/refresh is a good way to reboot the REPL's state without having to
restart the process. To do this, it removes namespaces, then re-requires
them in dependency order.

If you have an error in one of your namespaces, that namespace and all
namespaces that depend on it will no longer be available, so you will
get "namespace not found".

There is probably a way to change fireplace to deal with this situation,
but for now you should be able to work around this by creating the
namespace manually from a namespace that does exist, like the `user` ns:

user=> (create-ns 'my.broken-ns)

The namespace will still be broken, but you should now at least see
compiler errors.

HTH

guns


pgpDW8xGdWbno.pgp
Description: PGP signature


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 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)` 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.repl/refresh)`, I get back the error "nREPL: namespace 
> not found". I don't know exactly what causes it. If I search for it on the 
> web, most hits are fireplace issues. But it says "nREPL", and maybe 
> "namespace not found" can have something to do with tools.namespace 
> unloading them while refreshing. If I quit and restart `lein repl`, the 
> error disappears the first time I do `(tools.namespace.repl/refresh)`. But 
> for the second error after the restart, it comes back, i.e. the exact same 
> thing happens as before, only I have managed to fix one more error in my 
> code.
>
> Does anyone know what's wrong?
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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.com/tpope/vim-fireplace/issues/149

Oh, I meant that you should run `(create-ns 'my.ns)` from another
namespace _within_ Vim.

OTOH, I'm happy you've posted an issue. I run into this problem too, but
I was content to just work around it.

guns


pgp11_PruTzNp.pgp
Description: PGP signature


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 -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.com/tpope/vim-fireplace/issues/149 
>
> Oh, I meant that you should run `(create-ns 'my.ns)` from another 
> namespace _within_ Vim. 
>
> OTOH, I'm happy you've posted an issue. I run into this problem too, but 
> I was content to just work around it. 
>
> guns 
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 any tutorial / mini example of how to do something like this?

Thanks!

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 repl to be really helpful in, 
because I can copy and paste to test the code, and when I have questions I 
can meander and see what makes things break. 



On Friday, May 2, 2014 11:49:50 PM UTC+9, Mars0i wrote:
>
> 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 like, 
> so I have only been reading bits and pieces of either edition.  I'll read 
> it seriously when the paper edition comes (unless I buy a tablet first).
>
> (Are you on the Manning Publishing daily specials mailing list?  That's 
> how I got the pre-release package for 1/2 price, and I have seen that offer 
> more than once since I bought the package.  It may that at this point they 
> won't offer any further 1/2 price deals on JoC, but if they do, you could 
> buy it that way.)
>
> On Friday, May 2, 2014 1:07:36 AM UTC-5, gamma235 wrote:
>>
>> Thank you Mars0i!!
>>
>> I have a first edition copy of JOC and really like the way it just lays 
>> things out for you. I am hesitating to buy the 2nd edition, though, due to 
>> the hefty price-tag, though I am curious about logic programming and data. 
>> Would you say it is worth the money?
>>
>> I am now reading the 7 concurrency models in 7 weeks beta version 
>> (recommended by Alex Ott, above) and am finding it thoroughly enjoyable. It 
>> masquerades as language agnostic, but the first half is virtually a Clojure 
>> book in the way it introduces Java's concurrency solutions (or lack 
>> thereof), priming you for the subsequent chapters that go into Clojure's 
>> primitives, core.async, and even Clojurescript. There is a chapter on 
>> actors, using Elixir, and then the latter half gets more  general talking 
>> about how concurrency relates to big data and Hadoop, using Java. In 
>> general, I think all of the information is pertinent for a Clojure 
>> programmer who wants to become more well-rounded on the subject.
>>
>> J
>>
>> On Friday, May 2, 2014 1:07:00 PM UTC+9, Mars0i wrote:
>>>
>>> On Monday, April 28, 2014 9:42:06 AM UTC-5, gamma235 wrote:

 I heard that Joy of Clojure would be adding a lot in the 2nd edition, 
 including a section on core.logic; is core.async also on that list? 

>>>
>>> I bought the pre-release + final release *Joy of Clojure* 2nd ed. 
>>> package, so I have the v10 prerelease version.  This seems to be the final 
>>> version before the regular release.  I did a search through the v10 pdf, 
>>> and found no instances of "core.async", and the string "async" appeared 
>>> only in the word "asynchronous".  By contrast, there are indeed many 
>>> instances of "core.logic".
>>>
>>> The eBook version is supposed to come out in mid-May, and the print and 
>>> other electronic versions some time after that.  The last email that I got 
>>> says that the book "is now in production where it will get a thorough 
>>> polishing before publication."  So it sounds as if the authors and 
>>> publisher are only fixing typos and doing other small changes at this 
>>> point, and that core.async will not be discussed in the book.
>>>
>>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.