Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-12 Thread Meikel Brandmeyer (kotarak)
Hi, Am Samstag, 11. Mai 2013 21:25:11 UTC+2 schrieb Alex Baranosky: > > Most of the code I see and write at work at Runa uses (not (empty? foo)). > I'll continue to defend the position that it is more obvious code, and > therefore better (imo :) ) > > seq belongs to seq-land. empty? belongs to

Re: Calling a java function with multiple implementations based on type

2013-05-12 Thread Meikel Brandmeyer (kotarak)
For reference: https://github.com/hugoduncan/clj-ssh/blob/develop/src/clj_ssh/ssh.clj#L145 -- -- 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 moderate

Re: Calling a java function with multiple implementations based on type

2013-05-12 Thread Meikel Brandmeyer (kotarak)
Hi, Am Montag, 13. Mai 2013 02:25:03 UTC+2 schrieb Korny: > > If I call (add-identity agent {:private-key-path "foo" :passphrase "bar"}) > the clj-ssh library (eventually) calls a java method: > > (.addIdentity agent "foo" "bar") > > This method has several implementations, including: > public

Re: Calling a java function with multiple implementations based on type

2013-05-12 Thread Philip Potter
Clojure will use reflection to find *a* method, but if you want it to pick the correct one from multiple overloads, you need to give clojure type hints so it knows the correct static types of the parameters. At least I think that's how it works. When I've hit this before, I've just played with typ

Re: ANN: MPEdn, an EDN reader/writer for OS X and iOS

2013-05-12 Thread John Hunter
Thanks for sharing this, Matthew! On Saturday, February 23, 2013 11:56:54 AM UTC+8, Matthew Phillips wrote: > > Hello all, > > just letting anyone who might be interested know that I've posted MPEdn, > an EDN reader/writer implementation for OS X and iOS: > > https://github.com/scramjet/mpedn >

Re: Utility libraries and dependency hygiene

2013-05-12 Thread Dave Kincaid
Thanks for this, Stuart. I hope it's not too late. As one who has spent the last couple weeks spinning up a new project that uses its own local Ivy repository I've been feeling this pain first hand. The number of dependencies I have had to add just for a few Clojure libraries has been quite pai

Re: Utility libraries and dependency hygiene

2013-05-12 Thread Mikera
On Monday, 13 May 2013 09:20:19 UTC+8, Stuart Sierra wrote: > Isolated dependency loading is not possible in the JVM without complex > ClassLoader-based schemes like OSGI, which come with their own set of > problems. > > -S > > Hi Stuart, That's true for compiled Java classes on the classpath,

Re: unusual question: how do you get morale?(or moral support)

2013-05-12 Thread Sean Corfield
+100 :) I write code because I have to. If my job doesn't have me doing much programming, I spin up OSS projects in my spare time. When my job has me doing hardcore programming all the time, my urges are satisfied and my OSS projects don't get as much love. If my wife's away for the weekend, to fi

Re: Utility libraries and dependency hygiene

2013-05-12 Thread Stuart Sierra
Isolated dependency loading is not possible in the JVM without complex ClassLoader-based schemes like OSGI, which come with their own set of problems. -S On Mon, May 13, 2013 at 9:45 AM, Angel Java Lopez wrote: > Node.js + NPM (its package manager) has a nice version management. > > If your mo

Calling a java function with multiple implementations based on type

2013-05-12 Thread Korny Sietsma
Hi folks - I met some strange behaviour today using the clj-ssh library - but it looks like it might not be the library's fault as such. If I call (add-identity agent {:private-key-path "foo" :passphrase "bar"}) the clj-ssh library (eventually) calls a java method: (.addIdentity agent "foo" "bar"

Re: [ANN] - purnam 0.0.9 (javascript.dot.notation language extensions for cljs)

2013-05-12 Thread zcaudate
Thanks Rich, I couldn`t have said it any better =) Do you have the link for the proposal? On Monday, May 13, 2013 8:42:41 AM UTC+10, Rich Morin wrote: > > On May 12, 2013, at 12:42, Michael Klishin wrote: > > If you had to describe your library in one sentence, what would it be? > > I'd be happ

Re: [ANN] - purnam 0.0.9 (javascript.dot.notation language extensions for cljs)

2013-05-12 Thread zcaudate
I've updated the read me with more `practical` examples at the top and made another announcement =) But regarding the language extensions: @David. These are a set of optional extensions. But having said that, I really do hope that that you put `def.n` macro and `obj` into the main clojurescri

[ANN] - purnam "0.0.10" - angular.js language extensions

2013-05-12 Thread zcaudate
I had a vague description for purnam 0.0.9: https://groups.google.com/forum/?fromgroups=#!topic/clojure/AgZ_wVtdUFI Its the same code with a different read me... Get it here: https://github.com/zcaudate/purnam Excerpt: Features Purnam has three main components: 1. Angular Language Exten

Re: Utility libraries and dependency hygiene

2013-05-12 Thread Angel Java Lopez
Only a lateral quick comment: Node.js + NPM (its package manager) has a nice version management. If your module A needs D version 0.1, and module B needs D version 0.2, no problem. Both versions are added, and A loads version 0.1, meanwhile B loads version 0.2. The trick is the search path for mo

Utility libraries and dependency hygiene

2013-05-12 Thread Stuart Sierra
Based on a recent thread about "utility" libraries, I would like to take this opportunity to ask everyone to help us avoid the dependency mess that Common Lisp has gotten into, where there are over a dozen such "convenience" libraries[1]. By all means, use these libraries in your *applications* if

ritz-nrepl starts up slowly?

2013-05-12 Thread yizhen wei
Hi, I found that my ritz-nrepl takes 25 plus seconds to start. While the nrepl would only take 10 secs. I'm using ubuntu 13.05 with 2.3g dual core and 4gb ram. My project contains around 7 dependencies. Is it normal to take this long to start the repl? I also noticed that the lein ritz-nrepl

Re: unusual question: how do you get morale?(or moral support)

2013-05-12 Thread u1204
>Hi. I've been meaning to ask (all of)you, how do you get moral support? How >do you put yourself into that mood so that you're happy/willing to program? >What motivates you to do it? Is it the people you surround yourself with or >the financial support? Are they enough to subconsciously motivate y

Re: [ANN] - purnam 0.0.9 (javascript.dot.notation language extensions for cljs)

2013-05-12 Thread Rich Morin
On May 12, 2013, at 12:42, Michael Klishin wrote: > If you had to describe your library in one sentence, what would it be? > I'd be happy to tweet about it but currently can't really understand > what it is, seems to be like 3 things mashed together. It seems a bit like ClojureScript and HotCocoa

Re: [ANN] - purnam 0.0.9 (javascript.dot.notation language extensions for cljs)

2013-05-12 Thread zcaudate
Thanks Michael and everyone for their feedback Let me have a think about it and `rebrand`. On Monday, May 13, 2013 5:42:59 AM UTC+10, Michael Klishin wrote: > > > 2013/5/12 zcaudate > > >> Additional features are listed > > > If you had to describe your library in one sentence, what would it be?

Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-12 Thread Gavin Grover
Or even define `if-not-empty` or `when-not-empty` without the double `not`. On Sunday, May 12, 2013 9:04:43 AM UTC+8, Jean Niklas L'orange wrote: > > On Saturday, May 11, 2013 11:28:34 PM UTC+2, Sean Corfield wrote: > >> you could just write [...] >> > > In some cases, this is even more readable:

Re: Clojure performance measuring

2013-05-12 Thread Marc Hämmerle
Not really - at least not for what you presumably want to do. If you want to stick with NewRelic you could have a look at their custom instrumentation: https://newrelic.com/docs/java/custom-instrumentation-with-the-java-agent); otherwise I'd use something like metrics, ostrich and instrument the ca

Re: unusual question: how do you get morale?(or moral support)

2013-05-12 Thread Rostislav Svoboda
Well everything in life - especially in engineering - has its ups and downs. Teamwork is the key! https://www.youtube.com/watch?v=Nebd9yoraac :) -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegro

Re: unusual question: how do you get morale?(or moral support)

2013-05-12 Thread AtKaaZ
Hey, thanks for sharing. I think I am the opposite of that, I am unable to code just for myself, if no one else is directly (and immediately) impacted by what I do then I get bored fast (but this is probably coupled with the fact that I am unable to code the way I want yet like some editor where

Re: unusual question: how do you get morale?(or moral support)

2013-05-12 Thread Softaddicts
I just put my ear buds and select music according to my mood and my task choice. I have around 10 days of music on my iPad, all sorts of styles. Sometimes, however I need to select a pleasant task knowing that I am not in a mood to tackle a p.i.t.a. subject. These times are very low on my mood sca

Re: unusual question: how do you get morale?(or moral support)

2013-05-12 Thread Simone Mosciatti
I code only for myself, and honestly coding is what I like to do. I remember these days being in a very bad mood and all I wanted to do was to sit and code. I believe that what motivate myself is my own EGO, code for me is only about solving problem, and more problem I solve better my ego is.

Re: [ANN] - purnam 0.0.9 (javascript.dot.notation language extensions for cljs)

2013-05-12 Thread Michael Klishin
2013/5/12 zcaudate > Additional features are listed If you had to describe your library in one sentence, what would it be? I'd be happy to tweet about it but currently can't really understand what it is, seems to be like 3 things mashed together. Thanks! -- MK http://github.com/michaelklish

unusual question: how do you get morale?(or moral support)

2013-05-12 Thread AtKaaZ
Hi. I've been meaning to ask (all of)you, how do you get moral support? How do you put yourself into that mood so that you're happy/willing to program? What motivates you to do it? Is it the people you surround yourself with or the financial support? Are they enough to subconsciously motivate you?

Re: [ANN] - purnam 0.0.9 (javascript.dot.notation language extensions for cljs)

2013-05-12 Thread zcaudate
Additional features are listed. Also, I`ve discovered a really easy way of automating TDD using karma, which quickens the compilation/testing dramatically and the jasmin macros where built for that: functions When f.n and def.n are used for function definitions, there is no need to write ?, ?>

Re: [ANN] - purnam 0.0.9 (javascript.dot.notation language extensions for cljs)

2013-05-12 Thread zcaudate
Thanks Michael. I really didn't know how to 'sell' it because there's quite a bit of thought in there about how to make it work with existing javascript libraries so that the clojure syntax does not get in the way and it's difficult Maybe I have started talking def.n or about TDD first. I poste

Help translate common-lisp code

2013-05-12 Thread Michi Oshima
Hi, I'm looking at the following function from a common-lisp project called "clon" (a task scheduler library by Gabor Melis ). I've been trying to port the project to better understand how it works and also to learn Clojure: (defun make-scheduler (schedule &key (now

Re: Clojure performance measuring

2013-05-12 Thread Marc Hämmerle
Even though New Relic works best when used with a supported server/container, you'll still get some basic JVM stats like memory out of it. Other than that you could also take a look metrics ( https://github.com/codahale/metrics) as it has JVM instrumentation in place and push the data to Graphite,

Re: CLI sub-commands in an uberjar?

2013-05-12 Thread Dick Davies
Yeah, think that'll work (and thanks, I'd have had trouble working that out myself!) - i'll look at that and cliopatra and see which works out best. On 12 May 2013 13:52, Marc Limotte wrote: > How about something like this: > > (defn -main [fstr & args] > (let [fsymbol (binding [*read-eval* f

Re: CLI sub-commands in an uberjar?

2013-05-12 Thread Dick Davies
Nice one, looks pretty dead on. On 12 May 2013 14:07, Ray Miller wrote: > On 12 May 2013 10:37, Dick Davies wrote > >> >> I've got a half-decent utility written that i want to provide to our >> ops team (and not let them know it's Clojure based ssshhh). >> >> Works great with 'lein run

Re: [ANN] - purnam 0.0.9 (javascript.dot.notation language extensions for cljs)

2013-05-12 Thread Michał Marczyk
Heh, looking at the repo I see you're underselling your library. :-) For those who haven't clicked on the link, there's quite a funky DSL for Angular and some Jasmine stuff in there too. The ?/! also seem to support accessor syntax for reaching properties whose names are themselves determined by r

Re: [ANN] - purnam 0.0.9 (javascript.dot.notation language extensions for cljs)

2013-05-12 Thread Michał Marczyk
Just FYI, js/object.a.b.c -- 15 chars (set! js/object.a.b.c 10) -- 25 chars This assumes object lives in current JS scope (of course so does the JS 12 char version). Also, aget is variadic, so (aget object "a" "b" "c") works fine in released versions of ClojureScript (that's 25 chars and looks

Re: [ANN] - purnam 0.0.9 (javascript.dot.notation language extensions for cljs)

2013-05-12 Thread David Nolen
It wasn't intentional that aset not be variadic, I'm surprised no one has ever opened a ticket for this. Fixed in master and it inlines into efficient javascript: (defn bad-code [obj val] (aset obj "inner" "number" 10) (aset val "inner" "count" (+ 10 (aget obj "inner" "count"))) On Sun, Ma

Re: js->clj not working

2013-05-12 Thread nchurch
Thanks for the pointer; really helpful. I'll have to watch that talk by Chris Houser as that is what I will try to do (extend ISeq). On May 12, 9:06 am, Konrad Scorciapino wrote: > It can only handle Object objects. Check > outhttp://stackoverflow.com/questions/16044897/why-cant-i-call-seq-func

[ANN] Equate - a fact management library

2013-05-12 Thread Kelker Ryan
Equate is a fact management library for the Clojure language.https://github.com/runexec/equate -- -- 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 mod

Re: js->clj not working

2013-05-12 Thread Konrad Scorciapino
It can only handle Object objects. Check out http://stackoverflow.com/questions/16044897/why-cant-i-call-seq-functions-in-a-sequence-generated-by-js-clj 2013/5/11 nchurch > I'm trying to get a map out of a Goog events object (and also out of > Domina events objects). Calling js->clj on either

Re: ANN: kits 1.5.1 - some of Runa's core utilities

2013-05-12 Thread Mikera
I have a bunch here too: https://github.com/mikera/clojure-utils Happy to contribute any of these into a common effort, providing it is GitHub based and accepts rapid pull requests :-) On Friday, 10 May 2013 08:15:10 UTC+8, Dave Sann wrote: > > A question for the community. > > There are severa

Re: ANN: kits 1.5.1 - some of Runa's core utilities

2013-05-12 Thread Dmitry Groshev
One more (kinda obvious): https://github.com/Prismatic/plumbing On Friday, May 10, 2013 6:26:42 PM UTC+4, John Hume wrote: > > On Thu, May 9, 2013 at 7:15 PM, Dave Sann > > wrote: > >> There are several "projects" that provide a bunch of base level/common >> functions and extensions (similar to

Re: CLI sub-commands in an uberjar?

2013-05-12 Thread Ray Miller
On 12 May 2013 10:37, Dick Davies wrote > > I've got a half-decent utility written that i want to provide to our > ops team (and not let them know it's Clojure based ssshhh). > > Works great with 'lein run -m thingy.core/fn1 arg', but there are several > functions > I want to expose as 's

Re: CLI sub-commands in an uberjar?

2013-05-12 Thread Marc Limotte
How about something like this: (defn -main [fstr & args] (let [fsymbol (binding [*read-eval* false] (read-string fstr))] (when-not (#{'println 'str 'list} fsymbol) (throw (Exception. "Invalid function"))) (apply (eval fsymbol) args))) Marc On Sun, May 12, 201

Re: Clojure performance measuring

2013-05-12 Thread Jonathon McKitrick
Does it help profile SQL calls as well? -- Jonathon McKitrick On Sun, May 12, 2013 at 8:30 AM, Kelker Ryan wrote: > Try VisualVM. https://visualvm.java.net/ > > Here's a screenshot of the memory usage monitor > https://visualvm.java.net/images/monitor.jpg > > 12.05.2013, 16:55, "Stuart Sierra

Re: [ANN] - purnam 0.0.9 (javascript.dot.notation language extensions for cljs)

2013-05-12 Thread zcaudate
Well... This is strictly for working with js objects. The syntax is a wrapper around the functions 'aget-in' and 'aset-in' which I wrote. I just assumed that get-in doesn't work because you have to use aget for js objects... so they were an attempt to mimic that with js-objects. The .. Operator

Re: Clojure performance measuring

2013-05-12 Thread Kelker Ryan
Try VisualVM. https://visualvm.java.net/ Here's a screenshot of the memory usage monitor https://visualvm.java.net/images/monitor.jpg 12.05.2013, 16:55, "Stuart Sierra" : > We've found YourKit (a commercial product) to be helpful. > -S > > On Sunday, May 12, 2013 2:46:52 AM UTC+10, Jonathon McKi

[ANN] flyingmachine/serialize 0.1.0

2013-05-12 Thread Daniel Higginbotham
I've created my second clojar and would love any feedback: https://github.com/flyingmachine/serialize. It's a tiny library for serializing datomic entities (though maybe it should be called "mapify" instead of "serialize"). Here's an example of it in use: (defserializer ent->topic (attr :id :

Re: [ANN] - purnam 0.0.9 (javascript.dot.notation language extensions for cljs)

2013-05-12 Thread Thomas Heller
Hey, 2 quick notes. 1) CLJS support the ".." interop which makes interacting with native javascript objects a little nicer. (set! (.. obj -inner -number) 10) compiles to "obj.inner.number = 10;" (.. obj -inner -number) compiles to "obj.inner.number" 2) Be careful when interacting with nativ

Re: [ANN] - purnam 0.0.9 (javascript.dot.notation language extensions for cljs)

2013-05-12 Thread Michael Klishin
2013/5/12 zcaudate > Because the javascript dot-notation is awesome and the > javascript/clojurescript interop (aget aset, . and .-accessors) > make for really ugly code. > Does ClojureScript not support get-in? -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin -- -- Y

Re: [ANN] - purnam 0.0.9 (javascript.dot.notation language extensions for cljs)

2013-05-12 Thread Baishampayan Ghose
Really interesting code! Good work. ~BG Sent from phone. Please excuse brevity. On 12 May 2013 15:07, "zcaudate" wrote: > This is a quick and dirty release for interested parties. I found it very > useful when working with angularjs. The syntax should not change that much > but there will be mor

[ANN] - purnam 0.0.9 (javascript.dot.notation language extensions for cljs)

2013-05-12 Thread zcaudate
This is a quick and dirty release for interested parties. I found it very useful when working with angularjs. The syntax should not change that much but there will be more documentation in the future. I would love to have some input into additional features that could be added. Excerpt from Git

CLI sub-commands in an uberjar?

2013-05-12 Thread Dick Davies
Hi all I've got a half-decent utility written that i want to provide to our ops team (and not let them know it's Clojure based ssshhh). Works great with 'lein run -m thingy.core/fn1 arg', but there are several functions I want to expose as 'subcommands' e.g. java -jar thingy.jar fn1 arg

Re: Released lein-cljsbuild 0.3.1

2013-05-12 Thread Evan Mezeske
Oops, I just had to release version 0.3.2 -- I had merged an old pull request that depended on ClojureScript 0-0-1803 instead of 0-0-1806. Fixed. On Saturday, May 11, 2013 6:54:37 PM UTC-7, David Nolen wrote: > > Thanks! > > On Saturday, May 11, 2013, Evan Mezeske wrote: > >> Nothing major in th

Re: Clojure performance measuring

2013-05-12 Thread Stuart Sierra
We've found YourKit (a commercial product) to be helpful. -S On Sunday, May 12, 2013 2:46:52 AM UTC+10, Jonathon McKitrick wrote: > > If I cannot get New Relic to work, I'm going to stick to my development > platform for initial optimization and memory troubleshooting. > > What tools do you reco