Re: Converting Leiningen project.clj to Gradle

2014-09-17 Thread Korny Sietsma
Which ci environment? I'm a little surprised, as those I've used will let you run arbitrary command lines. I've run leiningen from Jenkins, Bamboo, and ThoughtWorks Go, all with no problems... On 17 Sep 2014 21:22, "Adam Markham" wrote: > Unfortunately using Leiningen in this project is out of th

Re: map semantics

2014-02-09 Thread Korny Sietsma
Agreed - there are always tradeoffs. Another common example is that pretty well any language that uses IEEE floating point is also breaking referential transparency in the interest of pragmatism: user=> (= 0.3 (+ 0.1 0.2)) false user=> (= (bigdec 0.3) (+ (bigdec 0.1) (bigdec 0.2))) true - Kor

Re: Alternative ->> macro for threading sequences?

2014-02-08 Thread Korny Sietsma
> >> >> >> is optimal for the following reason: >> >> >> >> >> >> If you're doing "map" and "map alone", i.e. >> >> >> >> (->> things >> >> (map f1) >> >> (map f2)

Re: Alternative ->> macro for threading sequences?

2014-02-07 Thread Korny Sietsma
r) instead. - Korny On 6 February 2014 18:34, Jozef Wagner wrote: > I agree with Colin, the cognitive load is greater than benefits of such > approach. BTW you can use comp to chain consecutive map transformation > functions. (map (comp pacify wrangle) things) > > JW > > &g

Alternative ->> macro for threading sequences?

2014-02-06 Thread Korny Sietsma
Hi folks, I seem to regularly find myself writing ->> threaded code that follows similar patterns: (->> things (map wrangle) (map pacify) (filter effable) (map #(aggravate % :bees :sharks)) (reduce mapinate {}) i.e. all stages of the code actually operate on a collection rath

Re: Lessons Learned from Adopting Clojure

2014-02-06 Thread Korny Sietsma
I've been doing something very similar, but using IntelliJ + Cursive Clojure - run Midje autotest inside the IDE for running tests, and also for manually evaluating snippets of code. Cursive gives me a lot of what I had from Emacs - paredit editing, tight repl integration (alt-enter mapped to "ev

Re: Coverage tools in Clojure

2014-02-04 Thread Korny Sietsma
My 2c - on my last project it would have been handy to have some test coverage tools, they can be useful to sanity check your testing. However, it's worth noting that compared to a java project, we had far fewer lines of code, so manually reviewing code for tests was a lot easier. And there were

Re: Recommendations for parsing/validating a JSON structure

2014-01-27 Thread Korny Sietsma
Parsing is easy - use either https://github.com/clojure/data.json or https://github.com/dakrone/cheshire (Cheshire used to have some advantages over data.json but I have the impression data.json has caught up). For validation I've used Prismatic Schema - https://github.com/prismatic/schema - it's

Re: [ANN] Component: dependency injection and state management

2014-01-05 Thread Korny Sietsma
hard to mock, but I sometimes > stub a remote Datomic database with a local in-memory version. > > -S > > > > On Sun, Jan 5, 2014 at 1:23 PM, Korny Sietsma wrote: > >> Hi - I've been playing with this and I'm a little confused. >> >> I can under

Re: [ANN] Component: dependency injection and state management

2014-01-05 Thread Korny Sietsma
Hi - I've been playing with this and I'm a little confused. I can understand how you use the library to pass around stateful components, and to start/stop them and wire them up etc. But I'm not sure I see how it should be used for more general dependency injection. I'll pick a concrete example -

Re: How to go about 'proving' why dynamically typed languages are better.

2013-12-23 Thread Korny Sietsma
This ties in nicely to my summary of how I feel about static typing: Static typing is a premature optimisation. Like most optimisations, it has genuine value, but if you apply it globally and too early, you end up causing more pain than you gain. "sometime type discussions lead to lead to early a

Re: Am I missing something?

2013-12-04 Thread Korny Sietsma
We had to tell Cheshire to always use bigdecimals - and I think there was something else, can't remember. Not all that advanced, really. On 4 Dec 2013 16:17, "Brian Craft" wrote: > > > On Tuesday, December 3, 2013 8:48:34 PM UTC-8, Korny wrote: >> >> * Compojure for routing, and static resources

Re: Am I missing something?

2013-12-03 Thread Korny Sietsma
My 2c on this : We are doing similar things at my current client - with less pain. I suspect you've been unlucky in your choice of libraries, and maybe expecting more than you get in clojure's ecosystem - ruby, python etc have been around a lot longer, and with a lot more focus on database use. We

Re: Is The Joy if Clojure up to date?

2013-12-01 Thread Korny Sietsma
Whereas the Joy of Clojure makes me think of a certain '70s book with interesting illustrations, that I used to stealthily read in the back shelves of the local library as a teen. The Joy of Clojure is an awesome book. Though part of me wishes it had at least one '70s style line drawing of Rich in

Re: Regarding Clojure's license

2013-11-13 Thread Korny Sietsma
> any sufficiently poorly worded argument is indistinguishable from trolling. Is that original? I want to quote it. A lot. - Korny On 14 Nov 2013 01:42, "Paul L. Snyder" wrote: > On Wed, 13 Nov 2013, Phillip Lord wrote: > > > "Paul L. Snyder" writes: > > > > > On Wed, 13 Nov 2013, musicdenotat

Re: blog article on RSpec like TDD with a rapid feedback cycle in Clojure

2013-10-20 Thread Korny Sietsma
Note you can do the same thing in midje : https://github.com/marick/Midje/wiki/Auto test - it works quite nicely. On 20 Oct 2013 21:04, "Waldemar" wrote: > I noticed that some struggle finding a good TDD workflow, in > Clojure, > with a rapid feedback cycle

Re: clj-ldap - Clojure LDAP client

2013-10-06 Thread Korny Sietsma
Hi - is anyone maintaining any of these ldap libraries? I ask because: - neither has updates in 2 years - the underlying umboundid library now supplies a "bindAndRevertAuthentication" function that implements what was discussed previously in this thread - you can bind without mutating the existing

Re: [ANN] cljsfiddle.net

2013-09-28 Thread Korny Sietsma
Nice - this would have been handy this morning for clojure cup hacking! (Though core.async support would have made it even better) - Korny On 28 September 2013 20:24, Jonas wrote: > Hi > > I’m working on a ClojureScript playground application ( > http://cljsfiddle.net) similar to jsfiddle[1],

XML namespace parsing - any movement?

2013-09-18 Thread Korny Sietsma
So, the background - there is a page about fuller xml support at http://dev.clojure.org/display/DXML/Fuller+XML+support - Currently none of the xml parsing options support this - the best I've found is https://github.com/grammati/eksemel but it hasn't been touched in 2 years, and the last commit m

Re: [ANN] modern-cljs tutorials updated

2013-09-14 Thread Korny Sietsma
You know you're a lisp programmer when you feel conflicted about balancing parentheses around emoticons. (like this :)) (or like this :) - Korny On 13 Sep 2013 12:35, "Cedric Greevey" wrote: > On Thu, Sep 12, 2013 at 2:47 PM, Mimmo Cosenza wrote: > >> Hi All, >> after a very long (and beautiful

Re: BigDecimal and ==, with a proposed fix

2013-09-03 Thread Korny Sietsma
It'd be great if this got fixed - we met an ugly bug yesterday due to this on our project. (Our system validates that the sum of two monetary fields A and B equals the sum of two monetary fields C and D. We parse the fields via Cheshire with conversion to bigdecimal turned on - but any fields wit

Re: Do you like the Clojure syntax?

2013-08-13 Thread Korny Sietsma
I think it depends on what is important to you. For me, the syntax is core to the language because it encourages a certain mindset. The default for everything is (verb noun noun noun...) - this is the kingdom of verbs, and functions are how you build things. If you added an infix syntax, or some

Re: Can we please deprecate the :use directive ?

2013-08-05 Thread Korny Sietsma
Agree that :use should be deprecated, mostly as it's quite a barrier to folks new to the language that you need to know 3 different parts of the ns macro before you start. However "objectively bad" is strong language indeed. ":refer :all" is vital anywhere you want a DSL - if using something like

Re: Interest in a commercial IDE for Clojure?

2013-07-27 Thread Korny Sietsma
>* jump-to-symbol-definition > - see my post on ST2 in the "is intellij idea a >good idea" thread dated July 25th. I checked that post and couldn't see anything about jump to symbol - I'm mobile though so may have missed something. Can ST2 or 3 do this? - Korny On 28 Jul 2013 04:45, "Greg" wrot

Re: is intellij idea a good ide for clojure development?

2013-07-25 Thread Korny Sietsma
Indeed - I was using a community-edition intellij setup the other day, and only realised when I went to edit some JavaScript, and found some features missing (like code indenting). We use intellij (mostly) in our team at work, and I use emacs (mostly) at home. My current take on this endless deba

Re: Proposed change to let-> syntax

2013-07-20 Thread Korny Sietsma
It'd be better, when coming up with great ideas, if you didn't reply to 15-month-old threads as if they were recent! It makes for very confusing reading in most mail clients. Better to start a new thread, if you feel like the discussion is still relevant. - Korny On 19 Jul 2013 22:28, "Daniel Dinn

Re: In what OS do you code?

2013-06-17 Thread Korny Sietsma
une 2013 21:51, Alexandru Nedelcu wrote: > On Sun, Jun 16, 2013 at 4:40 AM, Korny Sietsma wrote: > >> How are all the Linux users handling Java installation? Using an official >> Oracle installer, or your package manager somehow, or something else? Or >> using (gasp) openJ

Re: In what OS do you code?

2013-06-15 Thread Korny Sietsma
How are all the Linux users handling Java installation? Using an official Oracle installer, or your package manager somehow, or something else? Or using (gasp) openJDK? I use Windows (client mandated) at work and OSX on my laptop. We use Vagrant to run virtual Linux (Centos) boxen at work, with pu

Re: Database migrations

2013-06-14 Thread Korny Sietsma
We used drift for a while, but found it didn't add much over plain sql, and was forcing us to write "down" migrations, which imho are a mistake. We ended up moving to Flyway, a very straightforward Java migration library, with a thin clojure wrapper. This has the advantages of using plain sql fil

Re: Clojure in production

2013-06-13 Thread Korny Sietsma
We're building a few clojure projects at IOOF (a large Australian superannuation firm) - the biggest is a transformation and routing system for communicating with other superannuation companies, written in clojure for the back end, and angular.js for the UI. (It's technically in "production" but t

Re: feeding leiningen a local JAR file

2013-06-09 Thread Korny Sietsma
That looks very helpful, thanks. I've been bitten by this hard in the past - I wanted to play with a few different Processing jars in Quil, none of which had Maven versions; and even using lein-localrepo, it was excessively complex to add these jars to my local maven repo just so I could play with

Re: Best IDE

2013-06-04 Thread Korny Sietsma
My 2c - I use emacs, I love it. I don't inflict it on my team, and I strongly disagree with it being "easy". To learn the basics, yes, but full fluency? If you have someone fluent in IntelliJ, with the major keystrokes in their muscle memory, and an instinctive familiarity with all the gui featu

Re: Real-world Clojure application

2013-05-23 Thread Korny Sietsma
The trouble is, so much depends on the problem space. For example, my team is building a "real world" clojure application - mostly data transformation and routing - but in the "real world" the actual speed of clojure execution is fairly insignificant compared to I/O. You could extract just the dat

Re: Getting highlighted clojure code into a presentation

2013-05-18 Thread Korny Sietsma
rote: > I feel silly for even suggesting but is pprint not good enough? do you > need colors? (unaware of what those do in emacs) > > > On Sat, May 18, 2013 at 6:42 AM, Korny Sietsma wrote: > >> Hi folks - I had to prepare some slides for a conference, and I struggled >

Getting highlighted clojure code into a presentation

2013-05-17 Thread Korny Sietsma
Hi folks - I had to prepare some slides for a conference, and I struggled to get nice looking clojure code onto a slide. I eventually arrived at the following, but it's awfully clunky: * write code in emacs * turn off rainbow delimiters as html-fontify doesn't like them * M-x load-theme whiteboar

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

2013-05-14 Thread Korny Sietsma
Thanks - I'd missed that, looked at the Java method but not the Clojure type signature :) - Korny On 13 May 2013 16:24, Meikel Brandmeyer (kotarak) wrote: > Hi, > > Am Montag, 13. Mai 2013 02:25:03 UTC+2 schrieb Korny: > >> If I call (add-identity agent {:private-key-path "foo" :passphrase "ba

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: Not using dependency injection - how do I share services around?

2013-05-10 Thread Korny Sietsma
It's interesting to note that clojure.java.jdbc used to use our first option - they had a dynamically bound var *db* that you assigned using the (with-connection) macro. As of version 0.0.3 this has been deprecated in favour of something like your second option - now you pass an explicit db parame

Re: Struggling with encapsulation

2013-05-10 Thread Korny Sietsma
I would generally handle this sort of encapsulation at the namespace level. Put (create-woobly) and (add-job) and all the other woobly-related functions into a woobly namespace. Also add any functions that access info from a woobly bag-o-state, or mutate a woobly to make a woobly-with-extras. Fu

Re: idiomatic way to force evaluation of a lazy operation

2013-05-04 Thread Korny Sietsma
wrote: > On 04.05.2013 12:16, Korny Sietsma wrote: > > What's the idiomatic way to avoid this? The options seem to be either > > to use > > (doall (map parse-record records)) > > or (mapv parse-record records) > > > > Is either of these better? The la

idiomatic way to force evaluation of a lazy operation

2013-05-04 Thread Korny Sietsma
Hi folks, we have some code that needs to _not_ be lazy - the rough code we have is: (defn parse-and-store [raw-data] (try (let [records (split-records raw-data) results (map parse-record records)] (do (save-audit-data! raw-data) (map (save-result! results)

Re: Lambda Jam schedule posted (Chicago, July 8-10)

2013-04-23 Thread Korny Sietsma
Sounds awesome. For folks in (or near) Australia, we also have the Yow! Lambda Jam conference in Brisbane in May: http://www.yowconference.com.au/lambdajam/index.html Not as stellar a lineup as the Chicago one, but should be a great conference nonetheless. - Korny On 20 April 2013 16:21, Alex

Re: Good Clojure style?

2013-04-14 Thread Korny Sietsma
I've been forgetting my car keys consistently for the last 20 years - but now I'm in my mid 40s it's easy to blame it on ageing :-) I've been coding for longer than I've been losing car keys, and I can't say I've noticed a lot of decline. As for the lack of grey beards at conferences (mentioned el

Re: Refactoring tools

2013-03-23 Thread Korny Sietsma
Awesome - great stuff! (pity no pony though) - Korny On 24 March 2013 13:01, Alex Baranosky wrote: > Korny, > > Slamhound does some of what you're talking about, but not as an editor > extension, https://github.com/technomancy/slamhound > > > On Sat, Mar 23, 2013

Re: Refactoring tools

2013-03-23 Thread Korny Sietsma
I'd also love something to optimise the "ns" form - I'm regularly doing tasks by hand that could in theory be automated; adding a new not-yet-imported library can be quite tedious, it'd be great to be able to type "(defdb" and be able to hit a key combo to add a new :require entry. A generalised "

Re: Windows Installation

2013-03-10 Thread Korny Sietsma
As Jonathan Friberg says - "lein.bat" works fine. As Windows seems to often go hand-in-hand with intrusive proxies, you might also want to make sure you have environment variables "HTTP_PROXY" and "HTTPS_PROXY" pointing to a working proxy, if necessary you can run your own proxy using cntlm : http:

Re: :use an entire namespace full of protocols or stick with :require?

2013-03-09 Thread Korny Sietsma
[reviving a slightly old thread] Note that as of clojure 1.4 you can also do: (:require foo.bar :refer :all) in fact from comments I've seen elsewhere there is a general intention to remove :use entirely? It'd be good to have some clarity on this. The vast majority of code samples use :use, som

Re: Clojure Performance For Expensive Algorithms

2013-02-22 Thread Korny Sietsma
Isn't that always the way, though? Build your program in a powerful, expressive language, then profile it, find the critical parts, and optimise them - where possible in the same language, and where that's too ugly/painful, drop down a layer to a lower level language. I did lots of this in the lat

Re: emacs - how to wean me off the family of Java IDEs

2013-02-01 Thread Korny Sietsma
ckage from http://www.emacswiki.org/emacs/sr-speedbar.el and installing it manually - that seems to work fine (even without disabling make-local-hook). If/when I find time to dig further, I'll try to work out what is going wrong for me with the melpa install. - Korny On 2 February 2013 14:04, Korny Sietsm

Re: emacs - how to wean me off the family of Java IDEs

2013-02-01 Thread Korny Sietsma
has been deprecated for a while now and has now been > removed. In general, you can just ignore it and everything will work > correctly. So: > > (defalias 'make-local-hook 'ignore) > > before you load anything should solve this problem. Whether any other > problems r

Re: Decoupling documentation from code?

2013-01-23 Thread Korny Sietsma
at 23:15, Korny Sietsma wrote: > > The flip side, of course, is that having documentation separate from > > code often leads to the documentation becoming out of sync with thecode. > > > > What happens when someone renames or moves some code, but doesn't also > > move

Re: emacs - how to wean me off the family of Java IDEs

2013-01-23 Thread Korny Sietsma
On 17 January 2013 17:26, Sean Corfield wrote: > Error: Symbol's function definition is void: make-local-hook bump - anyone know a workaround for this - I was interested in sr-speedbar, especially for editing over an ssh session, but it doesn't seem to work with emacs 24? - Korny -- Korneli

Re: Decoupling documentation from code?

2013-01-21 Thread Korny Sietsma
The flip side, of course, is that having documentation separate from code often leads to the documentation becoming out of sync with the code. What happens when someone renames or moves some code, but doesn't also move the docs? What happens if they change the implementation? Will people remembe

Re: emacs - how to wean me off the family of Java IDEs

2013-01-17 Thread Korny Sietsma
I've been using projectile for project-level commands, and found it quite good - it autodetects project root from things like .git directories, and then gives you commands like "open file in project", "search in project" etc. - Korny -- Sent from my geek device... Spelling mistakes can be blamed o

Re: If a protocol creates a Java interface under the covers...

2012-06-15 Thread Korny Sietsma
You keep talking about performance. I'm a long way from being a clojure expert, but one thing I *do* know is that premature optimization is the root of many many evils. May I suggest you first get your app working, in a clean understandable fashion, ideally with some solid unit tests. Then, and o

Re: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread Korny Sietsma
"Yes emacs is very weird for newbies, but most clojurians use it." I tend to think this is an unnecessary barrier for entry - yes, people would be more productive in the long run using emacs, but it has it's own big learning curve, and is definitely not necessary to get started in clojure. It's g

Re: Clojure stack

2011-05-19 Thread Korny Sietsma
Just adding my +1 - as someone relatively new to clojure, leiningen is a great way to get up and running, for a reasonably experienced developer. (It's a big improvement on when I first tried clojure a couple of years ago!) There seem to be windows instructions at https://github.com/technomancy/le

Re: how would I do this functionally? (internally mutable state)

2009-05-29 Thread Korny Sietsma
/web/dupfinder.rb>. Of > course it must be benefiting to some extent from the fact that the > Ruby version has a lot less abstraction, but I don't see how the > approach is fundamentally any different or why there would be such a > large performance disparity. I must be missing som

Re: how would I do this functionally? (internally mutable state)

2009-05-28 Thread Korny Sietsma
Cool stuff - I really should go to bed now, but I'll look at this further in the morning. By the way, in response to whoever suggested pre-sorting files; I sort-of do this (in the old ruby version) but actually, mostly the program is looking for duplicate *directories* of files - the goal is to p

Re: how would I do this functionally? (internally mutable state)

2009-05-28 Thread Korny Sietsma
thy Pratley : >> >> Sounds like a job for lazy-map to me! >> http://kotka.de/projects/clojure/lazy-map.html >> >> >> On May 28, 11:52 am, Korny Sietsma wrote: >>> Hi all, >>> >>> I have some ruby code that I'm thinking of

Re: how would I do this functionally? (internally mutable state)

2009-05-27 Thread Korny Sietsma
; (nth (get-info "abc") 1) > (nth (get-info "abc") 2) > (println "D") > (nth (get-info "abc") 0) > (nth (get-info "abc") 1) > (nth (get-info "abc") 2) > > result: > > A > size abc > B > quickhash abc

how would I do this functionally? (internally mutable state)

2009-05-27 Thread Korny Sietsma
Hi all, I have some ruby code that I'm thinking of porting to clojure, but I'm not sure how to translate this idiom to a functional world: I have objects that are externally immutable, but have internal mutable state they use for optimisation, specifically in this case to defer un-needed calculat

value of *file* in the REPL - guaranteed?

2009-05-25 Thread Korny Sietsma
Hi - I noticed that while http://clojure.org/api#toc16 indicates: *file* The path of the file being evaluated, as a String. Evaluates to nil when there is no file, eg. in the REPL. It actually seems to evaluate to "NO_SOURCE_FILE". I'm trying to write a quick and dirty logger that logs to

Re: Olabani says google testing Clojure for appengine

2009-04-08 Thread Korny Sietsma
Phillip Calçado (another Thoughtworker) has also done some playing with this: http://fragmental.tw/2009/04/08/clojure-on-google-app-engine/ - Korny On Wed, Apr 8, 2009 at 3:10 PM, BerlinBrown wrote: > > http://olabini.com/blog/tag/gae/ > > > > -- Kornelis Sietsma korny at my surname dot com

Re: Ironicly Maven2 is the lightest I could come up with

2009-04-03 Thread Korny Sietsma
If there was a DRY > way to adapt it to multi-module clojure I would try that too. I think > "Ties" is probably closure to what I want though, if it were brought > up to date. > > On Apr 2, 3:10 pm, Korny Sietsma wrote: > > On Fri, Apr 3, 2009 at 4:39 AM,

Re: Ironicly Maven2 is the lightest I could come up with

2009-04-02 Thread Korny Sietsma
On Fri, Apr 3, 2009 at 4:39 AM, dysinger wrote: > The Java world for good or bad has rallied > around maven repos. There are 10s of thousands of libs "up in there". While there are lots of Java / Maven users, there are also a lot who *don't* use it, and indeed many who actively avoid stuff tha

Re: basic question on structuring refs

2009-04-02 Thread Korny Sietsma
009 at 6:11 PM, Laurent PETIT wrote: > Hello, > > 2009/4/2 Korny Sietsma > >> >> If I understand correctly, two threads calling do_something_to with >> different keys won't collide, as they read @world but don't change it. I'll >> get a collisi

Re: Setting up Clojure on OS X

2009-04-01 Thread Korny Sietsma
Good stuff - but I'm surprised you link to Phil Hagelberg's port of clojure-mode, but not to his emacs-starter-kit: http://github.com/technomancy/emacs-starter-kit/tree/master If you are going down the emacs path, but don't already have your own emacs setup, I highly recommend the starter kit -

Re: basic question on structuring refs

2009-04-01 Thread Korny Sietsma
On Apr 1, 5:46 am, Christophe Grand wrote: > > Hello Korny, > > > > I share your questioning. > > > > On 1 avr, 06:57, Korny Sietsma wrote: > > > > > (A) one ref for the whole world - in which case how do I stop parallel > > > changes to two unr

Re: Full Clojure, Right Now! (tm)

2009-04-01 Thread Korny Sietsma
Emacs built with the emacs-starter-kit from http://github.com/technomancy/emacs-starter-kit/tree/master gets both clojure and clojure.contrib set up correctly. To use other jars, I had to hack the emacs-starter-kit stuff slightly; it seems that swank-clojure by default adds all jars in "~/.clojure

basic question on structuring refs

2009-03-31 Thread Korny Sietsma
Hi - I'm struggling with what is probably a very basic STM problem... so forgive me if I've missed something obvious. I have a world that is a list of structures The world itself will change occasionally - i.e. I'll add or remove structures from the overall list, and I'll regularly be reading the

Re: file io

2009-03-29 Thread Korny Sietsma
sweet :) - Korny On Fri, Mar 27, 2009 at 4:34 AM, Victor Rodriguez wrote: > > On Tue, Mar 24, 2009 at 11:05 PM, Korny Sietsma wrote: > > It'd be nice to have a macro that worked more like the first example - > > "spit" is great for one-liners, but the

Re: file io

2009-03-25 Thread Korny Sietsma
gt;> > With the pretty print function released by Tom Faulhaber, it's even >> possible >> > to painlessly write configuration back while keeping it clear (though >> not >> > currently possible to maintain things such as comments, I fear), >> > >> &

Re: file io

2009-03-25 Thread Korny Sietsma
ooh - that's precisely why I was looking into duck-streams myself; thanks for that! Mind you, after a while in the Ruby world, I'd highly recommend looking at YAML for config files - it's human readable and fairly easily writeable, and lets you add arrays, nested structures, etc. fairly easily. Fo

Re: file io

2009-03-24 Thread Korny Sietsma
It'd be nice to have a macro that worked more like the first example - "spit" is great for one-liners, but the fact that it opens and closes the file each time you call it seems a bit painful for anything more complex. Something that ends up working like: (with-out-as "test.txt" (println "hello

mocking in clojure

2009-03-13 Thread Korny Sietsma
Hi folks - are there any frameworks out there for mocking? Stubbing functions is pretty straightforward (and I see that fact comes with a stubbing function built in), but I'd really like something that can do mocking and mock expectations - something similar to stub, but with checking that the stub

Re: Java equivalent to Python's Imaging Library (PIL)

2009-03-12 Thread Korny Sietsma
I'm interested too - got some ruby stuff using rmagick I'd like to rewrite - there's jmagick but it sounds like a pain to get it working on osx, and there's a library that wraps imagemagick command-line, but something native that supports: - 48 bits-per-pixel images - colour profiles - digital cam

Re: Static type guy trying to convert

2009-03-11 Thread Korny Sietsma
On Thu, Mar 12, 2009 at 11:26 AM, Jon Harrop wrote: > IME, the trouble can be well worth it. I once wasted two weeks trying to track > down bugs in a thousand lines of code using unit tests and never managed it. > When I finally caved in and tried to leverage the static type system instead, > I f

Re: What is Clojure NOT good for?

2009-03-11 Thread Korny Sietsma
Agreed. An interesting parallel is getting Java developers to use Javascript well - sure, anyone can look at javascript code and probably work it out - it's a much smaller jump to javascript syntax than clojure syntax. But even so, I know lots of Java coders who never really "get" javascript stuf

Re: emacs / swank / slime startup problem - ClassNotFoundException: swank.swank

2009-03-03 Thread Korny Sietsma
Thanks - that seemed to fix it! - Korny On Wed, Mar 4, 2009 at 1:34 AM, Bradbev wrote: > > On Mar 3, 4:46 am, Korny Sietsma wrote: >> Hi folks; >> >> I have an intermittent problem that's driving me nuts. >> I'm running the emacs-starter-kit setup for e

emacs / swank / slime startup problem - ClassNotFoundException: swank.swank

2009-03-03 Thread Korny Sietsma
Hi folks; I have an intermittent problem that's driving me nuts. I'm running the emacs-starter-kit setup for editing clojure, recently updated from git, and when I first run "M-x slime", I often get the following messages: user=> user=> java.lang.IllegalArgumentException: URI has an authority com

Re: compiling a GUI app and also: interference of Java's built-in architechture

2009-02-18 Thread Korny Sietsma
As an end-user of various guis - the "no extra dependencies" and "instantly cross platform" points can be a huge win, for users, if not for developers. I regularly use tools like JEdit and JDiskReport and JXplorer - and they *just work*. On Linux, and Solaris, and Windows, and OS/X. And over ss

Re: unchecked methods for floats/doubles?

2009-02-08 Thread Korny Sietsma
Excellent - thanks for clarifying this! - Korny On Sun, Feb 8, 2009 at 12:27 AM, Rich Hickey wrote: > > > On Feb 7, 2009, at 3:43 AM, Korny Sietsma wrote: > >> >> Ah - I didn't realise that. I was trying to avoid the overhead, as I >> understood it, of both

Re: unchecked methods for floats/doubles?

2009-02-07 Thread Korny Sietsma
objects? Specifically, when I call: (loop [x (double x) y (double y)] ... do maths to x and y (recur x y) ) Is it going to have to convert x and y between 'double' and 'Double' at all, or will it just work with primitive types??? - Korny On Sat, Feb 7, 2009 at 6:29 PM, Ma

unchecked methods for floats/doubles?

2009-02-06 Thread Korny Sietsma
Hi folks - I was trying the example posted below, and I discovered a slight snag - unchecked-* methods don't exist for doubles or floats! (and if you call (unchecked-multiply 1.2 3.4) you get "No matching method found"... which caused some confusion :) ) Is this something that might change in the

Re: function that takes primitives?

2009-01-23 Thread Korny Sietsma
Fair enough - though my problem couldn't be fixed by caching, it could be inlined without too much pain. I just wanted to check I hadn't missed something - I'm still learning clojure bit by bit, and while it's fabulously well documented for such a new language, it's still easy to miss this sort o

updated pdf of clojure manual?

2009-01-22 Thread Korny Sietsma
Hi folks; Is there any way to get an updated dump of clojure.org as a pdf file? I like to print out stuff and read it on the train, and the clojure_manual.pdf available on the google groups site is a tad old, good for an introduction, but I'd like to read the bleeding edge stuff off-line. - Korny

function that takes primitives?

2009-01-22 Thread Korny Sietsma
Hi folks, Is there any way to make a function that takes primitive parameters? It seems you can't, but I might be missing something. I have the following code (a start to playing with mandelbrot sets): (defn step [x0, y0, xn, yn] (let [xm (+(-(* xn xn)(* yn yn)) x0) ym (+(* 2 xn yn) y0

Re: SLIME: trouble with java.lang.OutOfMemoryError

2009-01-11 Thread Korny Sietsma
I have had similar problems with enclojure. But having gone through similar IDE pain working in Ruby on Rails, the Netbeans support ended up being way ahead of most IDEs, so I have hopes that enclojure will get there in time. (My biggest annoyance? The fact that you can't open existing code as

Re: yet another Clojure snake

2009-01-08 Thread Korny Sietsma
On Fri, Jan 9, 2009 at 7:55 AM, Tom Ayerst wrote: > 2009/1/8 Mark Volkmann >> >> On Thu, Jan 8, 2009 at 11:05 AM, Tom Ayerst wrote: >> > The point, for me, is that Mark Engelberg's construct allowed the system >> > to >> > work with no mutation >> >> I don't yet see how that is possible. > > We

Re: yet another Clojure snake

2009-01-07 Thread Korny Sietsma
As a complete clojure newbie (hi folks!) from a Ruby/Java background, I kind-of don't like either - I'd pull out a named function like: (def add-mix-and-beat [bowl, dry-ingredients wet-ingredients] ... and then use your second example, but now it's: (def make-cookies-2a [flower baking-soda salt