Re: Question about doseq

2012-10-31 Thread Meikel Brandmeyer (kotarak)
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

Re: ClojureScript: catching all javascript exceptions

2012-10-31 Thread xiefei
followed strategy #1 explained herehttps://github.com/clojure/clojurescript/wiki/Exception-Handling to write (try ... (catch e ...)) and (try ... (catch _ ...)) , no luck. The compiler says unsupported bind form. Maybe this construct just not implemented now. 在

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

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)) #Error: err1 On Wed, Oct 31, 2012 at 10:19 AM, AtKaaZ atk...@gmail.com wrote:

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

Re: ClojureScript: catching all javascript exceptions

2012-10-31 Thread Alexander Solovyov
On Wed, Oct 31, 2012 at 11:22 AM, AtKaaZ atk...@gmail.com 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)) #Error: err1 This is not working: (try (throw

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 thishttps://groups.google.com/d/msg/clojure/79AXDY4Gp7w/As9LZYDT87AJ. 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,

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

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

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

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

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

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

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

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

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

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

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 titani...@gmail.com wrote: +1 for clojure-doc.org. As a beginner, i greatly appreciate your efforts and think this solves the 'lack of beginner friendly

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

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 alexan...@solovyov.net wrote: On Wed, Oct 31, 2012 at 11:22 AM, AtKaaZ atk...@gmail.com wrote: seems to be working

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 joega...@gmail.com wrote: http://www.sonian.com/about/careers/software-engineer-clojure-cloud/ Come work at Sonian and you'll be writing Clojure full-time,

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.

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

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

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?

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

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

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 jaso...@gmail.com wrote: Over the last month, I've been learning clojure for my

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

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

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

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

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

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

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

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.

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

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 :