Re: ClojureScript: catching all javascript exceptions

2012-10-31 Thread xiefei
followed strategy #1 explained 
here to 
write (try ... (catch e ...)) and (try ... (catch _ ...)) , no luck. 
The compiler says "unsupported bind form".  Maybe this construct just not 
implemented now.

在 2012年9月27日星期四UTC+8下午11时08分22秒,Dima B写道:
>
> Hi,
>
> I came to the point where I need to be able to catch all javascript 
> exceptions, log them down and swallow. I've been trying to achieve this by
>
> (try ... (catch Exception e ...))
> (try ... (catch nil e ...))
> (try ... (catch js/object e ...))
>
> and nothing seems to do the trick.
>
> Could you please help me find the syntax which allows me to catch and 
> swallow all exceptions in clojurescript?
> I'm using all latest (clojurescript via cljsbuild).
>
> Thank you,
> Dima
>
>

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

Re: ClojureScript: catching all javascript exceptions

2012-10-31 Thread AtKaaZ
https://github.com/clojure/clojurescript/blob/master/src/cljs/clojure/reflect.cljs#L7
https://github.com/clojure/clojurescript/blob/master/src/cljs/clojure/browser/repl.cljs#L30

Looks implemented and it's same as in clojure ...
What do you think?

On Wed, Oct 31, 2012 at 9:31 AM, xiefei  wrote:

> followed strategy #1 explained 
> here to
> write (try ... (catch e ...)) and (try ... (catch _ ...)) , no luck.
> The compiler says "unsupported bind form".  Maybe this construct just not
> implemented now.
>
> 在 2012年9月27日星期四UTC+8下午11时08分22秒,Dima B写道:
>>
>> Hi,
>>
>> I came to the point where I need to be able to catch all javascript
>> exceptions, log them down and swallow. I've been trying to achieve this by
>>
>> (try ... (catch Exception e ...))
>> (try ... (catch nil e ...))
>> (try ... (catch js/object e ...))
>>
>> and nothing seems to do the trick.
>>
>> Could you please help me find the syntax which allows me to catch and
>> swallow all exceptions in clojurescript?
>> I'm using all latest (clojurescript via cljsbuild).
>>
>> Thank you,
>> Dima
>>
>>  --
> 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




-- 
I may be wrong or incomplete.
Please express any corrections / additions,
they are encouraged and appreciated.
At least one entity is bound to be transformed if you do ;)

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

Re: ClojureScript: catching all javascript exceptions

2012-10-31 Thread AtKaaZ
seems to be working here: https://himera.herokuapp.com/index.html

cljs.user> (try (+ 1 2) (catch js/Error e e))
3
cljs.user> (try (throw (js/Error. "err1")) (catch js/Error e e))
#



On Wed, Oct 31, 2012 at 10:19 AM, AtKaaZ  wrote:

>
> https://github.com/clojure/clojurescript/blob/master/src/cljs/clojure/reflect.cljs#L7
>
> https://github.com/clojure/clojurescript/blob/master/src/cljs/clojure/browser/repl.cljs#L30
>
> Looks implemented and it's same as in clojure ...
> What do you think?
>
>
> On Wed, Oct 31, 2012 at 9:31 AM, xiefei  wrote:
>
>> followed strategy #1 explained 
>> here to
>> write (try ... (catch e ...)) and (try ... (catch _ ...)) , no luck.
>> The compiler says "unsupported bind form".  Maybe this construct just not
>> implemented now.
>>
>> 在 2012年9月27日星期四UTC+8下午11时08分22秒,Dima B写道:
>>>
>>> Hi,
>>>
>>> I came to the point where I need to be able to catch all javascript
>>> exceptions, log them down and swallow. I've been trying to achieve this by
>>>
>>> (try ... (catch Exception e ...))
>>> (try ... (catch nil e ...))
>>> (try ... (catch js/object e ...))
>>>
>>> and nothing seems to do the trick.
>>>
>>> Could you please help me find the syntax which allows me to catch and
>>> swallow all exceptions in clojurescript?
>>> I'm using all latest (clojurescript via cljsbuild).
>>>
>>> Thank you,
>>> Dima
>>>
>>>  --
>> 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
>
>
>
>
> --
> I may be wrong or incomplete.
> Please express any corrections / additions,
> they are encouraged and appreciated.
> At least one entity is bound to be transformed if you do ;)
>
>


-- 
I may be wrong or incomplete.
Please express any corrections / additions,
they are encouraged and appreciated.
At least one entity is bound to be transformed if you do ;)

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

Re: Question about doseq

2012-10-31 Thread Ryan T.
Thank you both for your replies, they were very helpful.

Regards,

Ryan

On Wednesday, October 31, 2012 2:29:11 AM UTC+2, Ryan T. wrote:
>
> Hello all,
>
> I have the following code:
>
> (def my-hash {"1" {:a-key {:value "a value"} :another-key "another value" 
>>> :a-third-key []}
>>
>>  "2" {:a-key {:value "a value"} :another-key "another 
>>> value" :a-third-key []}}
>>
>>
> In the following example i get the following result: 
>
> user=> (doseq [[id item] my-hash] (println item))
>
> {:a-key {:value a value}, :another-key another value, :a-third-key []}
>
> {:a-key {:value a value}, :another-key another value, :a-third-key []}
>
> nil
>
>
> On the above example, it looks *almost* normal to me. For instance, why 
> *{:value 
> a value}* is not returned as *{:value "a value"} *? Same goes for *:another 
> key*
> It still looks like a hashmap though. Isn't it?
>
> The behavior however which confused me even more is the following:
>
> user=> (doseq [[id item] my-hash
>>   key (:a-key item)]
>> (println key)) 
>> [:value a value]
>> [:value a value]
>> nil
>
>
> I was expecting the above to return:
>
> {:value "a value"} 
>> {:value "a value"}
>> nil
>
>
> Can someone explain to me why vector is being returned and how can I 
> achieve the result I was expecting? What am I missing here? Am i misusing 
> the doseq bindings? 
>
> Thank you for your time
>

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

Re: ClojureScript: catching all javascript exceptions

2012-10-31 Thread Alexander Solovyov
On Wed, Oct 31, 2012 at 11:22 AM, AtKaaZ  wrote:
> seems to be working here: https://himera.herokuapp.com/index.html
>
> cljs.user> (try (+ 1 2) (catch js/Error e e))
> 3
> cljs.user> (try (throw (js/Error. "err1")) (catch js/Error e e))
> #

This is not working:

(try (throw "err1") (catch js/Error e e))

So it's better to use js/Object there:

(try (throw "err1") (catch js/Object e e))
(try (throw 1) (catch js/Object e e))
(try (throw (js/Error. "err1")) (catch js/Object e e))

All of those cases work.

-- 
Alexander

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


Re: Question about doseq

2012-10-31 Thread Ryan T.
*Meikel*, I do have one more question. I posted another question some time 
ago and the answer I got was 
this. I 
am a little bit confused why *:let *is not required there but I had to use 
it to make it work in this case. 

Regards,

Ryan

On Wednesday, October 31, 2012 8:27:13 AM UTC+2, Meikel Brandmeyer 
(kotarak) wrote:
>
> Hi,
>
> Am Mittwoch, 31. Oktober 2012 01:29:11 UTC+1 schrieb Ryan T.:
>>
>> user=> (doseq [[id item] my-hash
>>>   key (:a-key item)]
>>> (println key)) 
>>> [:value a value]
>>> [:value a value]
>>> nil
>>
>>
>>
> The next step in the doseq also introduces a seq traversal. So your map is 
> turned into a sequence of map entries. You can see this by providing map 
> with more than one entry. To get your result try the following (combined 
> with prn mentioned already):
>
> (doseq [[id item] my-hash
> :let [key (:a-key item)]]
>   (prn key))
>
> Kind regards
> Meikel
>
>

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

Re: Question about doseq

2012-10-31 Thread Meikel Brandmeyer (kotarak)
Hi,

I'm not sure what you are refering to in the provided link. If it's eg. 
about :warehouses, then the difference is, that :warehouses contains a 
vector in the example in the link. So you basically walk the warehouse 
vector one warehouse at a time. But here you of only a single item (the 
map), so you have to use :let. In case you'd want to treat the :warehouses 
vector also as single item (instead of walking it), you'd also have to add 
a :let there.

Bottom line: :let keeps item as single entity, no-:let walks item as 
sequence in an inner loop.

(for [x [[1 2] [3 4] [5 6]]
  y x]
  y)

=> (1 2 3 4 5 6)

(for [x [[1 2] [3 4] [5 6]]
  :let [y x]]
  y)

=> ([1 2] [3 4] [5 6])

I used for here, but doseq works the same way.

Hope this clarifies.

Meikel

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

Programming Golf attempt - Pig Latin

2012-10-31 Thread Sean S


Best I did wa*s *376 characters and that's with minifying*.
***
http://codegolf.stackexchange.com/questions/8797/ode-cay-olf-gay/8856#8856

Basically if the word starts with a vowel postfix "-ay"
If it doesn't have any vowels postfix "ay"
Otherwise take the first letter postfix "-" first letter "ay"

(defn no-vowel [a b]
(reduce #(and % %2) (map #(= (.indexOf a %) -1) (map string/lower-case 
(rest b)

(defn transform [text]
  (let [vowels ["a" "e" "i" "o" "u"]]
(if (> (.indexOf vowels (string/lower-case (first text))) -1)
(str text "-way")
(if (no-vowel vowels text)
  (str text "ay")
  (str (reduce str (rest text)) "-" (first text) "ay")


(defn ay-ya [text]
(reduce str
(map #(str (transform %) " ")  
 (string/split text #" " 

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

Re: reduce, reduce-kv, map, mapv, reducers/map and nil

2012-10-31 Thread Wolodja Wentland
On Tue, Oct 30, 2012 at 15:17 +0100, Herwig Hochleitner wrote:
>I've also run into this. Maybe this is just an oversight, since clojure
>handles nils gracefully almost everywhere else.
>Should CollFold and IKVReduce be extended to nil, or is there some
>rationale against it?

I would much rather prefer consistent behaviour than the current mixture and
can't really think of a good reason why we see the current behaviour. Maybe
someone more knowledgeable with the actual implementation of those function
can shed some light on the issue.

Guess it wouldn't be too far fetched to consider this to be a bug, but I
thought I ask here first.
-- 
Wolodja 

4096R/CAF14EFC
081C B7CD FF04 2BA9 94EA  36B2 8B7F 7D30 CAF1 4EFC


signature.asc
Description: Digital signature


Re: Question about doseq

2012-10-31 Thread Ryan T.
Thanks Meikel, your answer was very clear.

On Wednesday, October 31, 2012 12:49:06 PM UTC+2, Meikel Brandmeyer 
(kotarak) wrote:
>
> Hi,
>
> I'm not sure what you are refering to in the provided link. If it's eg. 
> about :warehouses, then the difference is, that :warehouses contains a 
> vector in the example in the link. So you basically walk the warehouse 
> vector one warehouse at a time. But here you of only a single item (the 
> map), so you have to use :let. In case you'd want to treat the :warehouses 
> vector also as single item (instead of walking it), you'd also have to add 
> a :let there.
>
> Bottom line: :let keeps item as single entity, no-:let walks item as 
> sequence in an inner loop.
>
> (for [x [[1 2] [3 4] [5 6]]
>   y x]
>   y)
>
> => (1 2 3 4 5 6)
>
> (for [x [[1 2] [3 4] [5 6]]
>   :let [y x]]
>   y)
>
> => ([1 2] [3 4] [5 6])
>
> I used for here, but doseq works the same way.
>
> Hope this clarifies.
>
> Meikel
>
>

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

Sonian is hiring Clojure developers

2012-10-31 Thread joegallo


http://www.sonian.com/about/careers/software-engineer-clojure-cloud/

Come work at Sonian and you'll be writing Clojure full-time, working
on interesting big data problems. The Sonian software stack comprises
multiple applications tied together with queues and rest interfaces,
focused on archiving and indexing over a petabyte of email. Everything
runs in the cloud (hundreds of nodes), and is thoroughly automated:
Want to check if your branch is good? Ask our IRC bot (written in
Clojure) to run tests on it! Tests passed? Ask the bot to merge your
branch!

Our team is fully remote, but we emphasize pairing with tmux and Skype
(and emacs!). In addition to Clojure/conj, a few times a year,
everybody gets together for a week in Boston to talk and hack
together.

If you want to know more, email me (joe.ga...@sonian.net), or if
you've already decided to apply, send your resume, cover letter,
github account, etc, to j...@sonian.net. Use subject line "Software
Engineer, Clojure / Cloud".

All the best,
Joe

(We're also hiring Ruby/Rails devs, btw!)

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

Variadic Arguments in Gen-class

2012-10-31 Thread JvJ
Does anyone know if it's possible to generate java methods which take 
variadic arguments using gen-class?

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

Re: Clojure CA over email thread on clojure-dev

2012-10-31 Thread Stuart Sierra
The discussion on the clojure-dev list is not about *if* CAs will be 
accepted electronically, but *how*. Stuart Halloway requested help finding 
examples of the processes that other organizations have developed for 
receiving contributor agreements. In particular, he wanted to know if some 
large open-source organization has already done the appropriate legal 
research.

We already know the paper CA process is a pain. We're trying to make it 
better.

-S

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

Re: Variadic Arguments in Gen-class

2012-10-31 Thread Neale Swinnerton
It isn't.

I created a first cut of a patch to support this[1] a while back,  but it's
messy and I haven't spent time on it since.

Ideally,  you'd want to specify a variadic signature using an idiomatic

[arg1 arg2 &  rest]

style rather that meta data + array arg required by my patch.

The gen-class code is pretty complex, so it's not straightforward to do
that,  YMMV.

Neale.

[1] https://groups.google.com/d/topic/clojure/HMpMavh0WxA/discussion
On Oct 31, 2012 1:30 PM, "JvJ"  wrote:

> Does anyone know if it's possible to generate java methods which take
> variadic arguments using gen-class?
>
> --
> 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 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

ANN: Spyscope 0.1.1

2012-10-31 Thread David Greenberg
Spyscope is a library that allows you to write very little code to get
threadsafe tracing of your Clojure.

Example: (println #spy/d (+ 1 2 3)) traces the execution of the form '(+ 1
2 3)

This version of spyscope has a few new features:
- :form replaces :ast for enabling printing the form being traced
- #spy/d logs all traces to the trace store, so that you can query them
later with the #spy/t query functions
- #spy/d does all of its printing on a single thread to avoid overlapped
output

To use, just include [spyscope "0.1.1"] in your project.clj, and require
spyscope somewhere.

See https://github.com/dgrnbrg/spyscope for details. Pull requests welcome!

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

Re: Clojure CA over email thread on clojure-dev

2012-10-31 Thread Laurent PETIT
I think I understand what Michael mean by "bias", am I the only one with a
CA to also understand it ? :-)

Let's try again: the root problem is not about having to send CAs via
paper, pidgeon or electronically. It is how to build a process so that it
does not get in the way of as many people willing to contribute as
possible, while maintaining guarantees for Rich and Clojure/core/dev (
legal guarantees, ease of management guarantees, etc.).

So to me, both parties should be involved in the process. Why wouldn't you
get feedback from the primary people that the new disposition will target,
and which by definition are not yet subscribed to clojure-dev ?

Sooner or later, the solution will have to work for these people, not to
work hypothetically for people in clojure-dev should they need to re-submit
their CA :-p

Just saying ...

2012/10/31 Stuart Sierra 

> The discussion on the clojure-dev list is not about *if* CAs will be
> accepted electronically, but *how*. Stuart Halloway requested help finding
> examples of the processes that other organizations have developed for
> receiving contributor agreements. In particular, he wanted to know if some
> large open-source organization has already done the appropriate legal
> research.
>
> We already know the paper CA process is a pain. We're trying to make it
> better.
>
> -S
>
>
>  --
> 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 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

Re: ANN Clojure documentation site (CDS) progress report for the week of October 28th, 2012

2012-10-31 Thread charlie
+1 also, it's been a great resource for me.  It also reads really well on
mobile devices.

On Tue, Oct 30, 2012 at 1:57 PM, titon barua  wrote:

> +1 for clojure-doc.org. As a beginner, i greatly appreciate your efforts
> and think this solves the 'lack of beginner friendly documentation' problem
> very well.  Keep up the good work. :)
>
>
> On Monday, October 29, 2012 3:57:36 AM UTC+6, Michael Klishin wrote:
>>
>> ## TL;DR
>>
>> The Clojure documentation project (http://clojure-doc.org) continues to
>> make progress.
>> Lion's share of the work this week went into the Concurrency and
>> Parallelism guide:
>>
>> http://clojure-doc.org/**articles/language/concurrency_**
>> and_parallelism.html
>>
>> which is now about 75% complete.
>>
>>
>> ## CDS Progress Report
>>
>> The Clojure Documentation Site (a.k.a. CDS) publishes
>> periodic reports (every week so far, possibly two weeks in the future)
>> to give the Clojure community a better idea of what CDS shapes up to
>> be and what it has to offer.
>>
>> This is a report for the week ending October 28st, 2012.
>>
>>
>> ## New Content
>>
>> This week was all improvements to existing guides, no new content merged.
>> There is at least one new tutorial
>> in the works by a contributor we've heard from, though.
>>
>>
>> ## Updates
>>
>> By far most of the work merged this week went into the Concurrency and
>> Parallelism guide [1]
>>
>> It now covers topics such as
>>
>>  * An overview of concurrency terminology and common hazards
>>  * Identity/Value separation in Clojure
>>  * atoms
>>  * agents
>>  * refs, STM in Clojure, STM limitations
>>  * vars
>>  * delays
>>  * futures
>>  * promises
>>  * dereferencing
>>  * some commonly used `java.util.concurrent` bits
>>  * other approaches to concurrency on the JVM available to Clojure
>> through libraries
>>
>> Reading that guide is highly recommended for developers of all expertise
>> levels with the language.
>>
>>
>> Tutorials updated this week:
>>
>>  * Getting Started With Emacs for Clojure [2]
>>
>> Other guides updated this week:
>>
>>  * Functions [3]
>>  * clojure.core Overview [4]
>>  * Interoperability with Java [5]
>>  * Community [6]
>>
>>
>>
>> ## Thank You, Contributors
>>
>> CDS would not be possible without the following people who make Clojure
>> community a better place:
>>
>>  * AtKaaZ
>>  * Ben Poweski
>>  * John Gabriele
>>  * Lee Hinman
>>  * Michael S. Klishin
>>  * Wes Freeman
>>
>>
>> ## You Can Help!
>>
>> ### How It Works
>>
>> We have a repository on GitHub [7] that has Markdown files, toolchain
>> setup instructions and several articles
>> as well as stubs for several more articles. The stubs help contributors
>> pick a topic to write about and not worry too much about
>> article structure initially. Just pick something that you are very
>> familiar with or interested in and write.
>>
>> When you are done, submit a pull request on GitHub and someone from the
>> existing contributors team will
>> suggest improvements or merge your work. Pretty straightforward.
>>
>> In order to make it easier for potential contributors to join the
>> project, we will post a brief list of
>> guides that do not require deep expertise and can benefit from
>> contributions by complete beginners.
>>
>> ### Existing Guides
>>
>> Tutorials that badly need to be written:
>>
>>  * Tutorial on VimClojure [8]
>>
>> Guides that have structure and good chunk of the content in place but
>> still have holes you
>> can help us plug:
>>
>>  * Java interop [5]
>>  * Collections and Sequences [9]
>>  * Namespaces [10]
>>  * clojure.core Overview [11]
>>
>> These guides are new and cover advanced topics, so we need as much
>> proof-reading as we can
>> get from the community:
>>
>>  * Concurrency and Parallelism in Clojure [1]
>>
>> ### New Content
>>
>> If you want to start working on one of those articles or have existing
>> content you've authored that can be ported,
>> please let us know on the Clojure mailing list.
>>
>>
>> ## Summary
>>
>> CDS is 2-3 guides from covering the language "reasonably well". There
>> still are holes in various guides
>> but mostly in the more advanced areas and
>>
>> Want to help us make things better? Join us by forking and contributing
>> to http://github.com/clojuredocs/**cds
>> .
>>
>>
>>
>> 1. http://clojure-doc.org/**articles/language/concurrency_**
>> and_parallelism.html
>>  2. 
>> http://clojure-doc.org/**articles/tutorials/emacs.html
>> 3. 
>> http://clojure-doc.org/**articles/language/functions.**html
>> 4. 
>> http://clojure-doc.org/**articles/language/core_**overview.html
>> 5. 
>> http://clojure-doc.org/**articles/language/in

Re: [core.logic] Detecting overlapping FDs

2012-10-31 Thread David Nolen
On Wed, Oct 31, 2012 at 12:00 AM, Anthony Rosequist <
anthony.rosequ...@gmail.com> wrote:

> I updated my gist with a solution that's working:
>
> https://gist.github.com/3981557
>
> Unfortunately, I had to copy my conde expression 3 times (to cover all
> combinations of the three tasks). So, what I really need to know is if
> there's a way for me to write those three condes as one goal that takes q
> as an input and supports an arbitrary number of tasks? Or would this
> strategy not be performant enough with more than 3 or 4 tasks?
>

With that kind repetition we can suspect it can be done more generally :) I
recommend examining the distincto goal that comes with core.logic. I
believe the "shape" of the solution will be almost identical to it.

For simplicity I would make a goal that does what those three conde's do in
recursive fashion. Once you have that working you can decide whether to
just merge that into time-intervaslo.

David

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

Re: ClojureScript: catching all javascript exceptions

2012-10-31 Thread Frank Siebenlist
Very useful example - thanks.

This should be explained in the official clojurescript doc pages in the 
exceptions section.

-FS.



On Oct 31, 2012, at 3:24 AM, Alexander Solovyov  wrote:

> On Wed, Oct 31, 2012 at 11:22 AM, AtKaaZ  wrote:
>> seems to be working here: https://himera.herokuapp.com/index.html
>> 
>> cljs.user> (try (+ 1 2) (catch js/Error e e))
>> 3
>> cljs.user> (try (throw (js/Error. "err1")) (catch js/Error e e))
>> #
> 
> This is not working:
> 
> (try (throw "err1") (catch js/Error e e))
> 
> So it's better to use js/Object there:
> 
> (try (throw "err1") (catch js/Object e e))
> (try (throw 1) (catch js/Object e e))
> (try (throw (js/Error. "err1")) (catch js/Object e e))
> 
> All of those cases work.
> 
> -- 
> Alexander
> 
> -- 
> 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 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


Re: Sonian is hiring Clojure developers

2012-10-31 Thread Andreas Liljeqvist
Is US-based a requirement set in stone?
Have to ask since you phrase it as "fully remote".

On Wed, Oct 31, 2012 at 2:07 PM, joegallo  wrote:

> http://www.sonian.com/about/careers/software-engineer-clojure-cloud/
>
> Come work at Sonian and you'll be writing Clojure full-time, working
> on interesting big data problems. The Sonian software stack comprises
> multiple applications tied together with queues and rest interfaces,
> focused on archiving and indexing over a petabyte of email. Everything
> runs in the cloud (hundreds of nodes), and is thoroughly automated:
> Want to check if your branch is good? Ask our IRC bot (written in
> Clojure) to run tests on it! Tests passed? Ask the bot to merge your
> branch!
>
> Our team is fully remote, but we emphasize pairing with tmux and Skype
> (and emacs!). In addition to Clojure/conj, a few times a year,
> everybody gets together for a week in Boston to talk and hack
> together.
>
> If you want to know more, email me (joe.ga...@sonian.net), or if
> you've already decided to apply, send your resume, cover letter,
> github account, etc, to j...@sonian.net. Use subject line "Software
> Engineer, Clojure / Cloud".
>
> All the best,
> Joe
>
> (We're also hiring Ruby/Rails devs, btw!)
>
>  --
> 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 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

Re: Variadic Arguments in Gen-class

2012-10-31 Thread JvJ
I guess my best bet for now is just  another java wrapper that converts 
Object... to Object[].

On Wednesday, 31 October 2012 09:49:06 UTC-4, sw1nn wrote:
>
> It isn't. 
>
> I created a first cut of a patch to support this[1] a while back,  but 
> it's messy and I haven't spent time on it since. 
>
> Ideally,  you'd want to specify a variadic signature using an idiomatic
>
> [arg1 arg2 &  rest]  
>
> style rather that meta data + array arg required by my patch. 
>
> The gen-class code is pretty complex, so it's not straightforward to do 
> that,  YMMV. 
>
> Neale. 
>
> [1] https://groups.google.com/d/topic/clojure/HMpMavh0WxA/discussion
> On Oct 31, 2012 1:30 PM, "JvJ" > wrote:
>
>> Does anyone know if it's possible to generate java methods which take 
>> variadic arguments using gen-class?
>>
>> -- 
>> 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 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

Re: Sonian is hiring Clojure developers

2012-10-31 Thread joegallo


> Is US-based a requirement set in stone? 


It's more of a timezone thing than a citizenship or location thing.  We 
have employees in North and South America, but a good number of activities 
(pairing generally and standup specifically) seem to work best if people 
are working the same hours more or less.

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

Swank-ritz doesn't start a REPL by defautl.

2012-10-31 Thread kilobyte
I have installed Swank-ritz by using package.el on the package provided at 
the site of Swank-ritz, when I start slime with M-x slime-connect, there is 
no REPL buffer in Emacs, although SLIME is working and I am able to eval 
clojure code using C-x C-e.

Any help would be apreciated,
Kind Regards,
Kabelo Moiloa

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

Re: MVC / Observer & Immutable Data

2012-10-31 Thread Alexey Petrushin
It seems that those concepts can't be directly ported, because MVC and 
Observer works with changing state, and in functional programming state is 
usually doesn't change.

Can You please provide links to simple GUI examples that demonstrate such 
techniques, like the TODO list for Backbone.js?

On Wednesday, October 31, 2012 4:09:41 AM UTC+4, Alexey Petrushin wrote:
>
> MVC / Observer in Immutable Data
>
> Can You please explain what are analogues of MVC / Observer techniques in 
> two cases:
>
> 1. Immutable Objects (OOP style)
> 2. Immutable Data (functional style)
>
> For example let's consider following simple GUI example (You can try it 
> live here http://tinkerbin.com/0XDHRXIl click 'Run' button to start it 
> and wait 2 sec for text to appear)
>
> It's built with JavaScript because it's easy to play and MVC / Observer 
> are very natural to it
>
> // Model containing the data.
> var Post = Backbone.Model.extend({}) 
>
> var PostView = Backbone.View.extend({
>   initialize: function() {
> // Registering view rendering method as
> // an observer on the model.
> this.model.on('all', this.render.bind(this))
>   },  
>   // Every time state of model changes 
>   // this method will be called.
>   render: function() {
> // Printing value of model.text attriubute. 
> this.$el.html(this.model.get('text'))
> return this
>   }
> })
> 
> // Now, any time the model is updated the view will be also 
> // automatically updated.
> post.set({text: "hello, it's me"})
>
> But I don't quite understand how to do the same with Immutable OOP and 
> Functional styles, what ways are there?
>
> Thanks, Alex.
>

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

Re: Sonian is hiring Clojure developers

2012-10-31 Thread Lee Hinman
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/31/12 7:07 AM, joegallo wrote:
> http://www.sonian.com/about/careers/software-engineer-clojure-cloud/
>
>  Come work at Sonian and you'll be writing Clojure full-time,
> working on interesting big data problems. The Sonian software stack
> comprises multiple applications tied together with queues and rest
> interfaces, focused on archiving and indexing over a petabyte of
> email. Everything runs in the cloud (hundreds of nodes), and is
> thoroughly automated: Want to check if your branch is good? Ask our
> IRC bot (written in Clojure) to run tests on it! Tests passed? Ask
> the bot to merge your branch!
> 
> Our team is fully remote, but we emphasize pairing with tmux and
> Skype (and emacs!). In addition to Clojure/conj, a few times a
> year, everybody gets together for a week in Boston to talk and
> hack together.
> 
> If you want to know more, email me (joe.ga...@sonian.net), or if 
> you've already decided to apply, send your resume, cover letter, 
> github account, etc, to j...@sonian.net. Use subject line
> "Software Engineer, Clojure / Cloud".
> 
> All the best, Joe
> 
> (We're also hiring Ruby/Rails devs, btw!)

We are also hiring for an another Clojure position, with more of a
search focus:

http://www.sonian.com/about/careers/software-engineer-search-engine-cloud/

; Lee Hinman

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (Darwin)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQkV7DAAoJEJ1kZdQ6zsrgeswP/RS8hbHvmUmDc61p6QbRmSVG
3/mwzSTbRGE7iR9tgFQJtKyAriR6CjLEvVH/goH0KePm2qR87IYkiHxztcg1jeaZ
Oqsef/Qu1SRYDnoDQfGG6V/HBpy4ImideGDanz0whfhwG5ZBP9Uie70fs+1ci7br
G/rZYjK+ipxwLqi9k5JZrIdXidpV0y5JDLFeN8jtuq6yHKqntplEhh6XEz5XYXOj
xAUKlD0dwHEtkIJt8PP44aOFRWavb9CWsnSq085cetizpJItz/Y4fK5/fkXFtZD0
Cf74046PicgLsDebE2mgiYnKx2YxbYeVk6EYYo6dJJhpIAU4dkEENKwjgu5FehoX
fKOt6F0/bhcCiqbVoQbSMR81Pms84puaDYJ2lKSovBJrKYrYfD41KPW62LNgIf/i
DyuEy8hJlTbh258pN/8AJ0AbG3vakFqMBPE6qzwsoKyUQN9MIUq8soNDJOxmBpy1
TH/Br9ptoRc7Ps1wXyBcc5BkLZBFYPvVpvS6WK3cn4nRaP0ZIUur77/Cc+8I0LkX
CVS/Q7ralvzdcqjeD6tdIWSwN95lH9MpmWUmP4AigWO+JbdS8CYBcqTfrbBSF5Hb
FEt2cJnMMApvuxR4VKei8RUga/sdsl3Rst+GaHyZHI8GryPZdiNPHCaxufjI2LIf
5/mKUn+BfmGZXG/49nF6
=6Cec
-END PGP SIGNATURE-

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


Documenting clojure data structures

2012-10-31 Thread Jason Bennett
Over the last month, I've been learning clojure for my new job, and taking 
Odersky's scala course on coursera. I've been enjoying my time with clojure 
much more, but the one thing I miss from scala is the ability to document a 
data structure. It's really nice in Java/Scala to type in an object and get 
a list of methods/members that are available, instead of having to trace 
the code and/or guess.

I've seen things in clojure like defrecord, but have not seen good examples 
of if this is a good way to give some structure to my data. I don't want to 
turn clojure into an OO language, but there are times when I'm passing 
around a large map that it would be nice to be able to know what to expect.

jason

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

Re: Documenting clojure data structures

2012-10-31 Thread gaz jones
you could try using contracts to specify what keys are supposed to be
in the map, or just use pre/post conditions built in to clojure?

https://github.com/fogus/trammel

On Wed, Oct 31, 2012 at 1:01 PM, Jason Bennett  wrote:
> Over the last month, I've been learning clojure for my new job, and taking
> Odersky's scala course on coursera. I've been enjoying my time with clojure
> much more, but the one thing I miss from scala is the ability to document a
> data structure. It's really nice in Java/Scala to type in an object and get
> a list of methods/members that are available, instead of having to trace the
> code and/or guess.
>
> I've seen things in clojure like defrecord, but have not seen good examples
> of if this is a good way to give some structure to my data. I don't want to
> turn clojure into an OO language, but there are times when I'm passing
> around a large map that it would be nice to be able to know what to expect.
>
> jason
>
> --
> 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 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


Re: ClojureScript: catching all javascript exceptions

2012-10-31 Thread Herwig Hochleitner
try in clojurescript is actually a macro that uses the builtin try* and
adds type dispatch.
So to catch everything, just use (try* ... (catch e ...)). This maps
directly to javascript's try.

This question seems to come up a lot: Maybe it should be documented where
it's visible to people looking for it. Maybe try's docstring?
Where did you first look for it, Dima?

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

Re: reduce, reduce-kv, map, mapv, reducers/map and nil

2012-10-31 Thread Herwig Hochleitner
Created an issue: http://dev.clojure.org/jira/browse/CLJ-1098

Don't know if patch is welcome, but fix should be trivial, so not much is
lost if declined.

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

Re: Documenting clojure data structures

2012-10-31 Thread Ben Mabey

On 10/31/12 12:04 PM, gaz jones wrote:

you could try using contracts to specify what keys are supposed to be
in the map, or just use pre/post conditions built in to clojure?

https://github.com/fogus/trammel

FYI, it looks like trammel's ideas are being moved over to 
https://github.com/clojure/core.contracts.


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


Re: Documenting clojure data structures

2012-10-31 Thread Paul deGrandis
If your concern is passing around associative data, contracts and general 
membership functions are the two most common approaches.

If you're dealing with some unknown thing, you can see what protocols it 
satisfies and what functions/operations those protocols specify.
Doc strings should be found on the protocols.

The combination of protocols, contracts, and generative testing will get 
you very far.

Paul
- - - -
FWIW, I'm currently working towards unifying test.generative and 
core.contract under a single "spec" backend.  The spec can also be used to 
generate documentation, perform verification via Alloy, and be queried with 
core.logic.

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

Re: MVC / Observer & Immutable Data

2012-10-31 Thread Paul deGrandis
Hi Alexey,

MVC as an architectural style is very common in functional programming, but 
it manifests itself differently as a software pattern.

Separating the data from functions that process and shape it, and functions 
that polish and present it is always a good idea.  This is the core concept 
behind MVC.
Complecting the presentation of data with a two-way data binding is: 1.) a 
violation of the architectural style but, 2.) very commonly used to manage 
stateful complexities within a browser-based application.

One strategy is to apply dataflow techniques (which compose nicely and lend 
themselves to functional programming).  In this strategy, input/data is 
taken and passed down a pipeline of functions that manipulate and shape the 
data and potentially update pieces of the system (including the view) along 
the way.
To store off some chunk of the browser's current state you can use 
LocalStorage, infer it from DOM directly, or use an atom.  Using an atom is 
the most popular (the DOM is slow, everyone is used to using atoms in 
Clojure).
A common concrete implementation of this idea is browser-based PubSub.

Also note that a well-engineered web application is almost always 
functional:  It takes a requests, models it as a piece of data (most likely 
a hashmap), performs some actions building up response data and returns a 
presentation of that response.  There's nothing stopping you from 
organizing your namespaces and files in an architecturally evident way (MVC 
or otherwise).

For a much longer discussion about the observer pattern and reactive 
ClojureScript in general, please see this thread: 
https://groups.google.com/forum/#!topic/clojure-dev/LzVu4dIvOrg

If you're only in Clojure, you might want to take a look at Aleph: 
https://github.com/ztellman/aleph

I hope this helps,
Paul


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

Re: Documenting clojure data structures

2012-10-31 Thread Ben Mabey

On 10/31/12 2:15 PM, Paul deGrandis wrote:
If your concern is passing around associative data, contracts and 
general membership functions are the two most common approaches.


If you're dealing with some unknown thing, you can see what protocols 
it satisfies and what functions/operations those protocols specify.

Doc strings should be found on the protocols.

The combination of protocols, contracts, and generative testing will 
get you very far.


Paul
- - - -
FWIW, I'm currently working towards unifying test.generative and 
core.contract under a single "spec" backend.  The spec can also be 
used to generate documentation, perform verification via Alloy, and be 
queried with core.logic.


This sounds like a fantastic approach.  Do you have any of your thoughts 
of how the spec would look like publicly available?  (or maybe a github 
project)


-Ben

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


Re: Documenting clojure data structures

2012-10-31 Thread Paul deGrandis


>
> This sounds like a fantastic approach.  Do you have any of your thoughts 
> of how the spec would look like publicly available?  (or maybe a github 
> project) 
>
>
It's not in the public currently but I'm hoping to have something together 
for consumption by Conj (Nov 14th).

At this time, the best supported approach is still protocols, membership 
functions, contracts, generative testing, and comments - as stated earlier 
in the thread.

Paul

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

Re: ClojureScript: catching all javascript exceptions

2012-10-31 Thread Steve Buikhuizen
Take a look 
at 
http://closure-library.googlecode.com/svn-history/r9/trunk/closure/goog/docs/class_goog_debug_ErrorReporter.html

Since all Google Closure is available to clojurescript (in web clients) you 
can use the static "install" method to log all errors in the client back to 
the server. 

This has been working well for me.

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

Re: Documenting clojure data structures

2012-10-31 Thread Zack Maril
Not sure this is exactly what you are looking for, but clojure.reflect has 
been helping me a ton lately. I've written a few wrappers around it that 
I've found quite useful: 
https://gist.github.com/3990888
Hope this helps!
-Zack

On Wednesday, October 31, 2012 2:26:38 PM UTC-7, Paul deGrandis wrote:
>
>
>
>> This sounds like a fantastic approach.  Do you have any of your thoughts 
>> of how the spec would look like publicly available?  (or maybe a github 
>> project) 
>>
>>
> It's not in the public currently but I'm hoping to have something together 
> for consumption by Conj (Nov 14th).
>
> At this time, the best supported approach is still protocols, membership 
> functions, contracts, generative testing, and comments - as stated earlier 
> in the thread.
>
> Paul
>
>

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

Re: Swank-ritz doesn't start a REPL by defautl.

2012-10-31 Thread Ryan Kelker
Try installing nrepl-ritz. Once installed do M-x clojure-mode, then do C-c 
C-z to enable the REPL-y .

Swank has been deprecated by nrepl => 
https://groups.google.com/forum/?fromgroups=#!topic/clojure/xzvI_kCaeNI

[ Ryan Kelker ]
 [ Software Engineering : 
http://runexec.github.com]
 [ Clojure Training : 
http://www.udemy.com/clojure-code]
 [ Skype : eleefont ]

On Thursday, November 1, 2012 1:33:14 AM UTC+9, kilobyte wrote:
>
> I have installed Swank-ritz by using package.el on the package provided at 
> the site of Swank-ritz, when I start slime with M-x slime-connect, there is 
> no REPL buffer in Emacs, although SLIME is working and I am able to eval 
> clojure code using C-x C-e.
>
> Any help would be apreciated,
> Kind Regards,
> Kabelo Moiloa
>

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

Re: reduce, reduce-kv, map, mapv, reducers/map and nil

2012-10-31 Thread Alan Busby
On Mon, Oct 29, 2012 at 10:00 PM, Wolodja Wentland  wrote:
> I find this behaviour quite unfortunate because I now have to explicitly test
> for nil? and ensure consistent behaviour. This inconsistency violates the
> principle of least-surprise and I am not sure if the current behaviour is
> intentional or merely an unfortunate implementation detail.

fold wont work in parallel on list/seqs/etc, so if you're trying to
get the improved threading performance out of fold/fold-into-vec
you'll have to supply a vector.

(vec nil) => []

Then;
(->> data
vec
(r/map inc)
fold-into-vec)



Unfortunately if you "vec" a vector, it'll actually do the work so you may want;

(defn ensure-vec [xs]
"Ensure's that the value provided is a vector"
(if (= (type xs) clojure.lang.PersistentVector)
  xs
  (vec xs)))



> P.S. Would it be possible to have something like fold-into-vec in 
> clojure.reducers?

Don't forget fold-into-map and fold-into-map-with, but both of those
will likely require a better merge/merge-with function for maps. :(



P.S.
As soon as I can find a moment, I can provide a JVM friendly library
for reducing over mmap'ed text files as well.

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


Re: ClojureScript: catching all javascript exceptions

2012-10-31 Thread Frank Siebenlist
Hi Steve,

That sounds very intriguing, but with my limited javascript&goog knowledge it's 
difficult to see how you would go about it.

Could you please elaborate on what you did and how you get those js-errors 
reported back to a web server as some form of logging-service (?).

Thanks, FrankS.



On Oct 31, 2012, at 5:28 PM, Steve Buikhuizen  
wrote:

> Take a look at 
> http://closure-library.googlecode.com/svn-history/r9/trunk/closure/goog/docs/class_goog_debug_ErrorReporter.html
> 
> Since all Google Closure is available to clojurescript (in web clients) you 
> can use the static "install" method to log all errors in the client back to 
> the server. 
> 
> This has been working well for me.
> 
> -- 
> 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 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