Re: expectations 2.0 has been released

2014-03-16 Thread Jay Fields
Jochen (and anyone else affected by this): Sorry, took me a few days, but I've released 2.0.7, which fixes all the bugs reported above. Cheers, Jay On Thu, Mar 13, 2014 at 6:54 AM, Jay Fields j...@jayfields.com wrote: Thanks for all the examples, I'll look today at getting these fixed up

Re: expectations 2.0 has been released

2014-03-13 Thread Jay Fields
2]] (assert (string? a ;; shows both errors Ciao ...Jochen Am Mittwoch, 12. März 2014 02:28:37 UTC+1 schrieb Jay Fields: expectations is a minimilist's unit testing framework website: http://jayfields.com/expectations/ github: https://github.com/jaycfields/expectations changelog

Re: expectations 2.0 has been released

2014-03-12 Thread Jay Fields
On Wednesday, March 12, 2014 2:53:09 PM UTC-4, Sean Corfield wrote: Since `given` was a relatively simple macro, we added it to worldsingles.util.test and switched all our test namespaces to refer given from there instead, and then upgraded to Expectations 2.0.6. Seems to have gone

expectations 2.0 has been released

2014-03-11 Thread Jay Fields
expectations is a minimilist's unit testing framework website: http://jayfields.com/expectations/ github: https://github.com/jaycfields/expectations changelog: https://github.com/jaycfields/expectations/blob/master/CHANGELOG.md some large changes that will hopefully result in even more concise

Re: Lessons Learned from Adopting Clojure

2014-02-06 Thread Jay Fields
On Wed, Feb 5, 2014 at 10:40 PM, Sean Corfield s...@corfield.org wrote: FWIW, I find the language of Expectations to be much better suited to describing the desired behaviors of a system I want to build than the assertion-based language of clojure.test - so for me it's about test-before, not

Re: Lessons Learned from Adopting Clojure

2014-02-05 Thread Jay Fields
On Wed, Feb 5, 2014 at 4:35 PM, James Trunk james.tr...@gmail.com wrote: As a TDD practitioner and Expectations user, I've been following this thread with great interest! @Jay: Will your change in thinking have any impact on Expectations? I don't anticipate making any changes to expectations,

Lessons Learned from Adopting Clojure

2014-02-04 Thread Jay Fields
tl; dr: I'm presenting Lessons Learned from Adopting Clojure in Chicago on Feb 11th: http://www.eventbrite.com/e/goto-night-with-jay-fields-tickets-10366768283?aff=eorgf Five years ago DRW Trading was primarily a Java shop, and I was primarily developing in Ruby. Needless to say, it wasn't

Re: Lessons Learned from Adopting Clojure

2014-02-04 Thread Jay Fields
On Tuesday, February 4, 2014 8:17:44 AM UTC-5, Magomimmo wrote: thanks for the report. I only have few doubts about REPL making TDD to shame. In this blog entry - http://blog.jayfields.com/2014/01/repl-driven-development.html - I demonstrate (very briefly, by design) my workflow. I also

Re: What's your testing flow with the current clj tools?

2014-01-25 Thread Jay Fields
I use emacs expectations[1] These days I do more repl-driven-development than test-driven-development, so the tests tend to come after solving the problem at hand. At that point I run all the tests via lein expectations[2] to get an idea of what's broken. Now that I know what test namespaces

Re: What's your testing flow with the current clj tools?

2014-01-25 Thread Jay Fields
sorry, I forgot to mention you can you also expectations/run-all-tests (with or without a regex) if you're the kind of developer who likes to live in the repl. On Sat, Jan 25, 2014 at 8:19 AM, Jay Fields j...@jayfields.com wrote: I use emacs expectations[1] These days I do more repl-driven

Re: is there a tutorial about working at the REPL?

2013-12-29 Thread Jay Fields
make the app work with 'lein run' and it'll work in the repl as well. On Sun, Dec 29, 2013 at 4:30 PM, larry google groups lawrencecloj...@gmail.com wrote: If it can't find the file, `clojure.java.io/resource` returns nil; and (slurp nil) throws an IllegalArgumentException, which doesn't seem

Re: Best way to loop a map of maps

2013-12-03 Thread Jay Fields
I was going to type in the example with multiple bindings, but this will probably be more helpful: http://blog.jayfields.com/2013/05/clojure-combining-calls-to-doseq-and-let.html On Tue, Dec 3, 2013 at 6:05 PM, Ryan arekand...@gmail.com wrote: Hi all, I am trying to figure out a better way to

Re: Breaking out of doseq

2013-11-27 Thread Jay Fields
I'm not sure doseq is what you want.. I'd probably just use loop recur. On Wed, Nov 27, 2013 at 9:43 AM, Jonathon McKitrick jmckitr...@gmail.com wrote: To clarify what I'm trying to do, I have a map of regexes, and after iterating them, when one matches (the order of the regexes is significant)

Re: maintainability, DSLs, declarative APIs, etc.

2013-11-15 Thread Jay Fields
I've worked extensively in Java, Ruby, and Clojure, so I have plenty of experience with having and not having meta-programming and macros. In my opinion meta-programming and macros are not black art, they are simply part of the language. If someone chooses to do something that isn't easy to

Re: maintainability, DSLs, declarative APIs, etc.

2013-11-15 Thread Jay Fields
On Fri, Nov 15, 2013 at 3:30 PM, Brian Craft craft.br...@gmail.com wrote: I've heard people doing contract work in ruby swearing when they encounter another DSL: it kills their productivity. those same people wouldn't have Ruby contracting work if it weren't for metaprogramming... -- -- You

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

2013-10-20 Thread Jay Fields
expectations has the same thing as well: https://github.com/jakemcc/lein-autoexpect I think midje, speclj, and expectations all have emacs modes as well - which completely eliminate the JVM start up issue. On Sun, Oct 20, 2013 at 4:36 PM, Waldemar waldemar.sch...@googlemail.com wrote: I

Re: reference types (var, atom, ref, agent) and add-watch: deterministic order of notification

2013-09-13 Thread Jay Fields
Watch behavior varies a bit by ref type, I believe. You'll probably want to look into the details of the specific ref type you're using. for atoms and refs, I believe the watch is done on the thread that's updating the ref. Since retries can occur you can't really count on ordering. You could

Re: Sorting a collection on multiple fields

2013-09-11 Thread Jay Fields
20} {:name zack :age 21}] (sort-by (juxt :name :age) (compare-many [compare ]))) On Saturday, 31 August 2013 17:28:45 UTC+2, Jay Fields wrote: I would solve it like this- (defn multi-compare [[c cs] [x xs] [y ys]] (if (= x y) (multi-compare cs xs ys) (c x y

Re: Sorting a collection on multiple fields

2013-08-31 Thread Jay Fields
I would solve it like this- (defn multi-compare [[c cs] [x xs] [y ys]] (if (= x y) (multi-compare cs xs ys) (c x y))) (defn multi-comparator [comparators] (fn [xs ys] (if (= (count xs) (count ys) (count comparators)) (multi-compare comparators xs ys)

profiler?

2013-08-27 Thread Jay Fields
What are you all using these days? I've been using YourKit and I'm fairly happy with it. Just making sure I'm not missing out on some new hotness. Cheers, Jay -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Place of function?

2013-08-26 Thread Jay Fields
you're probably looking for fn? On Mon, Aug 26, 2013 at 9:11 AM, Christian Sperandio christian.speran...@gmail.com wrote: Hi, Does anyone know why the functions like: map?, number?, vector?, … belongs to the clojure.core but not function? ? Christian -- -- You received this message

Re: preference and implications of using as- vs let

2013-08-19 Thread Jay Fields
On Mon, Aug 19, 2013 at 6:41 PM, Anand Prakash anand.prak...@gmail.com wrote: What is the major benefit of as- = (- 4 (#(* % %)) (+ 12) ) 28 = (- 4 (as- y (* y y)) (+ 12)) 28 Solving the contrived example doesn't really help answer the original question of preference and tradeoffs. As to

Re: vec to map with consolidated vals

2013-08-17 Thread Jay Fields
Of your proposed solutions, this one (defn to-consolidated-map [parts] (- parts (map (partial apply hash-map)) (apply merge-with +)) Is the one I thought of first and also find very readable. On Saturday, August 17, 2013, David Chelimsky wrote: Sorry - pressed send before refreshing and

Re: function creation, partial or #()

2013-08-17 Thread Jay Fields
Sean, it sounds like you want (swap! some-a update-in [:k1 :k2] (fnil conj []) id) But that's based on some pretty limited context. On Friday, August 16, 2013, Sean Corfield wrote: On Fri, Aug 16, 2013 at 4:32 PM, Timothy Baldridge tbaldri...@gmail.comjavascript:; wrote: I'm just going

function creation, partial or #()

2013-08-13 Thread Jay Fields
Say you have a simple function: (defn do-work [f] (f)) When you want to call do-work you need a function, let's pretend we want to use this function: (defn say-hello [n] (println hello n)) Which of the following solutions do you prefer? (do-work (partial say-hello bob)) (do-work #(say-hello

Re: Do you like the Clojure syntax?

2013-08-12 Thread Jay Fields
I'll repeat something I've said publicly several times (sorry if you've previously heard it) - My first exposure to Clojure was a Stu Halloway blog post: http://thinkrelevance.com/blog/tags/java-next. At the time I was writing mostly Ruby some Java. I remember finding Clojure syntax repulsive.

Re: Wrong documentation of contains?

2013-08-07 Thread Jay Fields
contains? is possibly poorly named, contains-key? would probably have avoided this entire issue. That said, I'd like to see contains? return false for things where it doesn't make sense, longs, keywords, etc. For a list, it seems like converting the list to a vectoc (via vec) would be a reasonable

Re: Wrong documentation of contains?

2013-08-07 Thread Jay Fields
at an index. On Wed, Aug 7, 2013 at 9:45 AM, Jay Fields j...@jayfields.com wrote: that's kind of my point, you wouldn't use contains? with a list 99.99% of the time (you probably want some), so if the perf is terrible while you're figuring out that you want some, it doesn't matter. On Wed, Aug

should contains? throw an exception on sorted maps?

2013-08-03 Thread Jay Fields
This: (contains? (sorted-map 1 2 3 4) :a) Results in this: ClassCastException java.lang.Long cannot be cast to clojure.lang.Keyword clojure.lang.Keyword.compareTo (Keyword.java:102) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this

Re: Does this abstraction have any existing name?

2013-07-26 Thread Jay Fields
I defined update-vals in jry: https://github.com/jaycfields/jry/blob/master/src/clojure/jry.clj#L74-L75 It doesn't traverse nested maps, but I haven't ever needed that ability either. 1) I've never seen a name for that. 2) not in core. I'm sure it's been written 50 times in various helper libs.

Re: Does this abstraction have any existing name?

2013-07-26 Thread Jay Fields
PM, Jay Fields j...@jayfields.com wrote: I defined update-vals in jry: https://github.com/jaycfields/jry/blob/master/src/clojure/jry.clj#L74-L75 It doesn't traverse nested maps, but I haven't ever needed that ability either. 1) I've never seen a name for that. 2) not in core. I'm sure it's

Re: [ANN] verily, non-magic testing lib

2013-07-24 Thread Jay Fields
I've never spoken to Steven in anything that wasn't a public email to this list, so it wasn't me. I'm not sure who the self-proclaimed project guardians are, but I just wanted to make sure no one thought I was trying to protect https://github.com/jaycfields/expectations in anyway. I don't

Re: Domain-specific language design books

2013-07-19 Thread Jay Fields
this is a great book: http://www.amazon.com/Domain-Specific-Languages-Addison-Wesley-Signature-Series/dp/0321712943 don't let the language selection deter you. the patterns are abstract and can easily be applied to Clojure. On Thu, Jul 18, 2013 at 4:30 PM, JvJ kfjwhee...@gmail.com wrote: Does

Re: Proposed change to let- syntax

2013-07-19 Thread Jay Fields
I'm already using as- in prod. I think the ship has sailed on convincing Rich not to include them. On Fri, Jul 19, 2013 at 5:39 AM, Alex Baranosky alexander.barano...@gmail.com wrote: I use some- and cond- pretty heavily... I know I'm just one dude, but I am grateful they're in core so I

Re: Comma separated String values from vector

2013-07-16 Thread Jay Fields
this seems to do what you want: (clojure.string/join , (map pr-str my-strings)) On Tue, Jul 16, 2013 at 10:17 AM, Cedric Greevey cgree...@gmail.com wrote: (apply str \ (interpose \, \ my-strings) \) might work... On Tue, Jul 16, 2013 at 9:53 AM, sunilmu...@gmail.com wrote: Hi All, I'm

Re: Multiple REPLs in Emacs? (was: test run startup time

2013-07-11 Thread Jay Fields
On Thu, Jul 11, 2013 at 5:53 PM, Sean Corfield seancorfi...@gmail.comwrote: On Wed, Jul 10, 2013 at 10:53 AM, Jay Fields j...@jayfields.com wrote: I work in emacs with 2 repls running - 1 for running my app and 1 for running my tests. What is the magic to get this working and how does

Re: test run startup time

2013-07-10 Thread Jay Fields
There are significantly more productive ways to work, but they'll require you to know your environment well. I work in emacs with 2 repls running - 1 for running my app and 1 for running my tests. I use emacs-live[1], the unplugged-pack[2], expectations[3] for my tests. In emacs 'switch

Re: (newbie) replace certain values of a map based on a predicate

2013-07-05 Thread Jay Fields
I use update-vals from https://github.com/jaycfields/jry fairly often. As long as you don't mind doing the pred check in the fn you pass to update-vals, it should do the trick. Cheers, Jay On Fri, Jul 5, 2013 at 5:14 PM, Jim - FooBar(); jimpil1...@gmail.comwrote: You'll never really 'replace'

Re: Clojure in production

2013-06-13 Thread Jay Fields
On Monday, June 10, 2013 5:47:25 PM UTC-4, Plinio Balduino wrote: Hi there I'm writing a talk about Clojure in the real world and I would like to know, if possible, which companies are using Clojure for production or to make internal tools. I've previously written about adopting

Re: expectations documentation

2013-06-12 Thread Jay Fields
On Tuesday, June 11, 2013 2:39:33 PM UTC-4, Jay Fields wrote: expectations* has always had a decent amount of documentation; however, it's traditionally been in the form of blog entries. I spent a bit of time and converted those entries into the following site: http://jayfields.com

Re: [pre-ANN] test2, the last Clojure testing framework

2013-06-11 Thread Jay Fields
On Tuesday, June 11, 2013 12:39:59 AM UTC-4, Steven Degutis wrote: It's pretty frustrating that I, a regular old Clojure user who likes writing tests, can't mix and match tools from existing testing libraries. Seriously, there's 4 major ones (clojure.test, speclj, midje, expectations) and

Re: [pre-ANN] test2, the last Clojure testing framework

2013-06-11 Thread Jay Fields
On Tuesday, June 11, 2013 11:11:23 AM UTC-4, Steven Degutis wrote: Jay, [elided] That's the issue I'm trying to solve. Maybe that's not what everyone sees in this. But this is the big win I see in it. I think that's a good goal, I think you should stick to that, instead of continuing to

expectations documentation

2013-06-11 Thread Jay Fields
expectations* has always had a decent amount of documentation; however, it's traditionally been in the form of blog entries. I spent a bit of time and converted those entries into the following site: http://jayfields.com/expectations/index.html If you've never looked at expectations and you'd

Re: expectations documentation

2013-06-11 Thread Jay Fields
No worries. It's been on my todo list for awhile, and confusion about features motivated the actual effort. -- -- 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

Re: expectations documentation

2013-06-11 Thread Jay Fields
. The bottom two also overlap the isn't github fun links. Haven't seen expectations before. Looks really nice. Phil From: clo...@googlegroups.com javascript: [clo...@googlegroups.comjavascript:] on behalf of Jay Fields [j...@jayfields.com

Re: [pre-ANN] test2, the last Clojure testing framework

2013-06-09 Thread Jay Fields
I'd like to mention that expectations* has 0 open pull requests, 0 open issues, and is very actively maintained**. Steven, I don't want to discourage you from creating your own testing framework, I think everyone should, it's a very educational experience. I just wanted to be clear that no one

Re: Refactoring tools

2013-06-09 Thread Jay Fields
nrepl has macroexpansion, so you can already have 1/2 of what you want - better than nothing. On Friday, March 22, 2013 9:42:10 PM UTC-4, Alex Baranosky wrote: I'd really like to see a way to factor to code that uses -/- and back again. On Fri, Mar 22, 2013 at 12:01 PM, Laurent PETIT

Re: Refactoring tools

2013-06-09 Thread Jay Fields
I've written the 2nd one in emacs lisp, the first one would be even easier. If you're using emacs, you should give it a shot, it was a great learning experience for me. On Friday, March 22, 2013 10:54:36 PM UTC-4, Russell Mull wrote: I find myself doing that a lot by hand, a tool to help

Re: [pre-ANN] test2, the last Clojure testing framework

2013-06-09 Thread Jay Fields
On Sunday, June 9, 2013 8:50:46 PM UTC-4, Steven Degutis wrote: But that's what I meant, that he's proposing we start with his lib and add extensibility in the places we want it. So my response to that still applies. That's not at all what I said, proposed, alluded to, or anything of the

Re: feeding leiningen a local JAR file

2013-06-08 Thread Jay Fields
David Chelimsky recently released: https://github.com/dchelimsky/lein-expand-resource-paths On Friday, June 7, 2013 10:37:46 PM UTC-4, David Williams wrote: Try here http://nakkaya.com/2010/03/16/adding-custom-libraries-into-local-leiningen-repository/ On Wednesday, November 21, 2012

Re: Best IDE

2013-06-08 Thread Jay Fields
I was actually thinking pretty much the same thing. About a year ago I'd never used emacs and now I've contributed to emacs-live*, expectations-mode**, etc, etc. I also have my own emacs lisp open source*** that I use for all kinds of tweaking. My favorite recent addition - I can run my app

[job opening] DRW (http://drw.com) is looking for a Sr. Software Engineer - Clojure/JRuby

2013-06-07 Thread Jay Fields
DRW (http://drw.com) is looking for a Sr. Software Engineer - Clojure/JRuby more info: http://drw.submit4jobs.com/index.cfm?fuseaction=83084.viewjobdetailCID=83084JID=149069 My experience working for DRW: http://blog.jayfields.com/2013/04/year-five.html Drop me a line if you want more info.

Re: Clojure Login form error: java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to clojure.lang.Atom

2013-05-02 Thread Jay Fields
On Thursday, May 2, 2013 10:19:51 AM UTC-4, David Toomey wrote: [snipped] If you want help in the future, I'd recommend spending less time demanding answers and more time reading responses and code. I've never looked at the 4clojure source, didn't even know it was on github. I've never

Re: Sending Clojure Objects over TCP

2013-02-06 Thread Jay Fields
http://code.google.com/p/jetlang/wiki/Remoting On Wed, Feb 6, 2013 at 8:16 PM, JvJ kfjwhee...@gmail.com wrote: Does anyone know if there's a simplified networking library that allows this? -- -- You received this message because you are subscribed to the Google Groups Clojure group. To

Re: Migrate from IDEs to emacs or vim (already experienced with it) ?

2013-02-02 Thread Jay Fields
If you knew neither, I'm convinced emacs would be the right answer. You'll have more peers to using both that can help you work through problems. You can edit the environment using a language that is similar to clojure... There are many small reasons like that. But, you're desire to stay in vim

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

2013-01-29 Thread Jay Fields
On Tue, Jan 29, 2013 at 9:28 AM, Feng Shen shen...@gmail.com wrote: I have programming Clojure for almost 2 years, for a living. This is probably an important part of what answer the OP is looking for. When I was doing Clojure for about 10% of my job IntelliJ was fine. Now that it's 90% of my

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

2013-01-29 Thread Jay Fields
, responses inline- 2013/1/28 Jay Fields j...@jayfields.com: There are too many reasons to list, but it all comes down to a simple question for me: do you want the ability to easily automate tasks that you often repeat? Is this really the core of your concerns? Are you talking about

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

2013-01-29 Thread Jay Fields
Rich, almost all keystrokes have names you can use from M-x - if you prefer that to keystrokes. On Tue, Jan 29, 2013 at 11:59 AM, Rich Morin r...@cfcl.com wrote: On Jan 29, 2013, at 08:50, Dennis Haupt wrote: i don't know emacs, so i would like to know as well what the killer features are that

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

2013-01-29 Thread Jay Fields
-clojure and i read somewhere that i should use nRepl or something like that. regards. Josh. On Tue, Jan 29, 2013 at 9:17 PM, Jay Fields j...@jayfields.com wrote: Rich, almost all keystrokes have names you can use from M-x - if you prefer that to keystrokes. On Tue, Jan 29, 2013 at 11:59

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

2013-01-29 Thread Jay Fields
...@gmail.com wrote: Am 29.01.2013 23:05, schrieb Phil Hagelberg: Jay Fields writes: On Tue, Jan 29, 2013 at 11:45 AM, Laurent PETIT laurent.pe...@gmail.com wrote: Hello Jay, I'd like to learn a little bit more from what makes you prefer emacs over IntelliJ. As the main developer

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

2013-01-28 Thread Jay Fields
I used IntelliJ for clojure dev for almost 3 years. About six months ago I finally took the time to learn emacs, and I strongly regret not doing it much earlier. There are too many reasons to list, but it all comes down to a simple question for me: do you want the ability to easily automate tasks

Re: Is contributing to clojurescript is intentionally made hard ?

2013-01-18 Thread Jay Fields
I'm not sure I've ever sent an email where the entire content should be +1, but this is the one where it felt most compelling. Please split the list. Sent from my iPhone On Jan 18, 2013, at 4:25 PM, Phil Hagelberg p...@hagelb.org wrote: Irakli Gozalishvili writes: - I do understand that

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

2013-01-16 Thread Jay Fields
emacs-live is a pretty great starting point. It's the 'whole-kitchen-sink', but it's great for finding out what you don't know. emacs-rocks videos are good (and short) I also put off learning it until late last year, and I'm not completely converted. I *love* it and would be very unhappy if I

Re: Will the JVM will always likely, remain the primary Clojure implementation ?

2012-12-28 Thread Jay Fields
It might help if you told us why you're asking this question. My guess would be that you want to introduce Clojure, but you're afraid of backing yourself into a corner if it begins to die off. If that is the case, I think choosing to adopt is a safe choice (I've made the same choice, and many

Re: Autotest for Clojure/Midje?

2012-12-11 Thread Jay Fields
another option: https://github.com/jaycfields/expectations https://github.com/jakemcc/lein-autoexpect On Tue, Dec 11, 2012 at 12:38 PM, Timothy Baldridge tbaldri...@gmail.com wrote: For a project I'm working on it would be awesome to have my tests auto-rerun after every file change. I know

Re: what Jetty jars do I need for WebSockets?

2012-12-10 Thread Jay Fields
that trying to learn both Clojure and the JVM (which automatically entails parts of the Java eco-system), is a little overwhelming at first. But I suppose that is true of learning anything new. On Sunday, December 9, 2012 9:04:44 PM UTC-5, Jay Fields wrote: I don't have the answer, but I would

Re: what Jetty jars do I need for WebSockets?

2012-12-09 Thread Jay Fields
I don't have the answer, but I would strongly recommend webbit: https://github.com/webbit/webbit I've been using it for quite awhile and I've been very happy with it. On Sun, Dec 9, 2012 at 8:55 PM, larry google groups lawrencecloj...@gmail.com wrote: I am still fairly new to Clojure, the JVM

Re: Proposed change to let- syntax

2012-11-30 Thread Jay Fields
On Fri, Nov 30, 2012 at 10:37 AM, Rich Hickey richhic...@gmail.com wrote: The new names being considered for let-, test- and when- are: A) let- becomes as- I prefer -as, but don't feel strongly about it. (- 1 str (-as one-str (count one-str) (* 2 one-str))) ;;

Re: help choosing dev environment for clojure

2012-11-25 Thread Jay Fields
I spent 3 years doing Clojure (for prod apps) in IntelliJ. 3 months ago I switched to emacs - and would never go back. If the idea of customizing your dev environment to automate repetitive tasks is appealing to you, start learning emacs immediately. I deeply regret not learning emacs

Re: Can't dynamically bind non-dynamic var

2012-11-16 Thread Jay Fields
agreed. also, I prefer (constantly 400) over (fn [] 400) On Fri, Nov 16, 2012 at 8:11 AM, Baishampayan Ghose b.gh...@gmail.com wrote: Check out 'with-redefs' in clojure.core. -BG Sent from phone. Please excuse brevity. On 16 Nov 2012 08:02, faenvie fanny.aen...@gmx.de wrote: hi

Re: Proposed change to let- syntax

2012-11-16 Thread Jay Fields
I think using 'let' is what makes this confusing. I'd like to have a macro/fn for both ideas being discussed in this thread, ideally they'd both be named in a way that causes the least amount of confusion. I'm not sure what those names are, perhaps (- 1 (inc) (rebind a-num (- 2 a-num)

Re: Proposed change to let- syntax

2012-11-16 Thread Jay Fields
another thought - a really nice thing about if, let, and if-let is that if you know how to use if and let, if-let just makes sense. You can't say the same about -, let, and let- with the current proposal. On Fri, Nov 16, 2012 at 7:32 AM, Alex Nixon a...@swiftkey.net wrote: On 16 November 2012

Re: How to write this in idiomatic Clojure code?

2012-11-15 Thread Jay Fields
That code is clear enough that I wouldn't feel obligated to change it if I encountered it. You could also (defmulti crazy class) (defmethod crazy SomeClass [input] (seq (process-some-class-instance input)) (defmethod crazy :default [{:keys [children]}] (map crazy children)) On Thu, Nov

ANN: expectations 1.4.18

2012-11-05 Thread Jay Fields
What - expectations is a minimalist's testing framework - what you are testing is inferred from the expected and actual forms - stacktraces are trimmed of clojure library lines and java.lang lines - focused error failure messages Where - https://github.com/jaycfields/expectations When - read

Re: Bug: incorrect stack trace for function names containing -

2012-10-09 Thread Jay Fields
I noticed something similar, but I'm using 1.3. Maybe it's a bug in nrepl? On Tue, Oct 9, 2012 at 6:39 AM, Alex Nixon a...@swiftkey.net wrote: Hey all, I believe I've come across a minor bug in Clojure 1.4.0 (and I see the same behaviour in 1.5.0-alpha5): user= (defn a-b []) #'user/a-b

Re: Bug: incorrect stack trace for function names containing -

2012-10-09 Thread Jay Fields
being defined in defns would be beneficial; AFunction could then override throwArity to just use the :name of the function being called, thus avoiding any confusion introduced by munged or un-munging names. None of the above is related to nREPL. - Chas On Oct 9, 2012, at 9:10 AM, Jay Fields

Re: basic quoting question

2012-10-08 Thread Jay Fields
symbol, 'X in the last case, implements IFn, and you're calling it with the symbol 'Y as an argument. On Mon, Oct 8, 2012 at 9:43 AM, Brian Craft craft.br...@gmail.com wrote: user= (X Y) ClassCastException java.lang.String cannot be cast to clojure.lang.IFn user/eval116 (NO_SOURCE_FILE:32)

Re: ANN: a Clojure docs site, and github organization

2012-10-06 Thread Jay Fields
The CA process isn't what stops me from contributing, the post a patch to Jira is what seems broken to me. I don't even remember how to create a patch. Clojure is on github - we live in a fork pull request world, it's time for Clojure to get on board with that. I once noticed that a Clojure fn

Re: Clojure : a good start for non-programmers?

2012-09-26 Thread Jay Fields
On Mon, Sep 24, 2012 at 2:11 AM, Gregorius R. gzym...@gmail.com wrote: Hello Clojurists! is clojure a good start to learn programming? It depends what your goal is. If you were planning a long career in the software development industry, then I think it's a great place to start. As other's

Re: ANN lein-expectations 0.0.7

2012-08-09 Thread Jay Fields
Corfield wrote: lein-expectations - the plugin for running Jay Fields' awesome Expectations testing library - has been updated for Leiningen 2.0. If you are using Leiningen 1.x, continue to use lein-expectations 0.0.5. If you are on Leiningen 2.x, you should use lein-expectations 0.0.7 so that exit

Re: ANN lein-expectations 0.0.7

2012-08-08 Thread Jay Fields
On Aug 8, 2012, at 1:09 AM, Sean Corfield wrote: expecting not to throw a specific exception is a bit trickier... You can expect a specific exception easily, but not an exception message easily... -- You received this message because you are subscribed to the Google Groups Clojure group.

Re: ANN lein-expectations 0.0.7

2012-08-07 Thread Jay Fields
2012 à 20:43, Sean Corfield seancorfi...@gmail.com a écrit : lein-expectations - the plugin for running Jay Fields' awesome Expectations testing library - has been updated for Leiningen 2.0. If you are using Leiningen 1.x, continue to use lein-expectations 0.0.5. If you are on Leiningen 2

Re: ANN lein-expectations 0.0.7

2012-08-07 Thread Jay Fields
. Cheers, -- Laurent 2012/8/7 Jay Fields j...@jayfields.com Hello all, expectations (github.com/jaycfields/expectations) is an opinionated testing framework that is available for anyone to use. I've been using it to test my production code for almost 2 years now, and it's used

Re: What concurrency models to document?

2012-08-02 Thread Jay Fields
I find auto-concurrency in clojure to be misleadingly thrown around as free. I think a good description of what is free would be helpful, and examples of concurrency patterns that are still necessary above clojure data structures. A common example from my work is a screen that will need to

Re: What concurrency models to document?

2012-08-02 Thread Jay Fields
I don't find it to be one of the reasons I use Clojure... Nor do I find it significantly easier than other options I've used in the past (e.g. Java + Jetlang) I feel like concurrency is the half-truth we tell to encourage borderline adopters or spark interest. I don't believe it's a motivating

Re: s-expression levels and higher order functions

2012-07-20 Thread Jay Fields
In https://github.com/jaycfields/jry I define update values, which allows you to (update-values {:a 1 :b 2} inc) ;= {:a 2 :b 3} I've used that in combination with update-in to do all sorts of transformations. That is obviously designed for maps, which is what your example looks like to me.

Re: How to speed up Clojure Training for New Recruitment

2012-06-20 Thread Jay Fields
consulting models. It doesn't have to be this way. On Wed, Jun 20, 2012 at 7:53 AM, Jay Fields j...@jayfields.com wrote: That's a complicated question. I think consultants* are incentivized to present new technologies to clients and convince them it's the right choice.** However, I don't think

Re: Standard alias for partial?

2012-06-19 Thread Jay Fields
I use %, (def % partial) On Tue, Jun 19, 2012 at 2:28 PM, Jim - FooBar(); jimpil1...@gmail.com wrote: what if you need the '$' for interop? Jim On 19/06/12 19:25, JvJ wrote: This is not really a big deal, but I was wondering if there was a shorter alias for partial in the standard

Re: Standard alias for partial?

2012-06-19 Thread Jay Fields
uh, it's going to do what you expect... user= (def % partial) #'user/% user= (map #(inc %) [1 2 3]) (2 3 4) On Tue, Jun 19, 2012 at 2:33 PM, Jim - FooBar(); jimpil1...@gmail.com wrote: On 19/06/12 19:32, Timothy Baldridge wrote: That works until you try to use the shorthand for anonymous

Re: Standard alias for partial?

2012-06-19 Thread Jay Fields
I'd actually like to see %(...) become (partial ...), as I think people associate % with anonymous functions. Which is why I chose (% ...), as it's close to what I wish we had. I get your point though, and I don't disagree. But, this does keep coming up, so I think a shorter syntax for partial

Re: meta-questions - [clojure] in front of Subject line

2012-06-18 Thread Jay Fields
Personally, I'd like to have [] as well, but I've recently been educated on the opposing point of view - and I concede that your personal workflow determines what you prefer - and, it's all preferences at the end of the day (no right or wrong answer). My personal workflow would benefit from [],

Re: meta-questions - [clojure] in front of Subject line

2012-06-18 Thread Jay Fields
this is also true of the ActionScript solution... let's get back on topic, tabs or spaces? On Mon, Jun 18, 2012 at 9:02 AM, Tassilo Horn tass...@member.fsf.orgwrote: Dave Kincaid kincaid.d...@gmail.com writes: [Automatic insertion of [clojure] depending on user preference] Seems like a

Re: How to speed up Clojure Training for New Recruitment

2012-06-18 Thread Jay Fields
On Mon, Jun 18, 2012 at 3:11 AM, Murtaza Husain murtaza.hus...@sevenolives.com wrote: Hi, Just wanted to get pointers on how do you manage the training of recruits. It is difficult to find clojure talent, and we are located in India, where it is close to impossible. Also the non

Re: Converting String to Hashmap

2012-06-18 Thread Jay Fields
first of all, what gender is n? =) http://blog.jayfields.com/2011/03/clojure-eval-ing-string-in-clojure.html On Mon, Jun 18, 2012 at 11:18 AM, Antix matthias.kal...@googlemail.comwrote: Hi Guys, I'm very new to clojure and searching for a way to convert a given String to a Hashmap as far as

destructuring with :or

2012-06-12 Thread Jay Fields
Is there any reason that (let [[x y :or {x 1 y 2}] nil] [x y]) can't work? -- 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

Re: destructuring with :or

2012-06-12 Thread Jay Fields
right, I know it's possible to do what you guys are describing. What I meant to ask is, should :or be allowed in destructuring vectors? I can't see any reason for it not to be allowed. On Jun 12, 2012, at 7:10 PM, Sean Corfield wrote: On Tue, Jun 12, 2012 at 12:28 PM, Tassilo Horn

Re: problem with .indexOf

2012-06-08 Thread Jay Fields
You probably just want map-indexed... Sent from my iPhone On Jun 8, 2012, at 9:24 AM, Christian Guimaraes cguimaraes...@gmail.com wrote: Hello all, I have the code below: (def data '(a b c c b a)) (for [value data] (hash-map id (.indexOf data value) value value)) That gives me

Re: problem with .indexOf

2012-06-08 Thread Jay Fields
a, :id 0} {:v b, :id 1} {:v c, :id 2} {:v c, :id 3} {:v b, :id 4} {:v a, :id 5}) /k On Fri, Jun 8, 2012 at 3:31 PM, Jay Fields j...@jayfields.com wrote: You probably just want map-indexed... Sent from my iPhone On Jun 8, 2012, at 9:24 AM, Christian Guimaraes cguimaraes...@gmail.com

Re: [PATCH] RFC: Add Functions `tabify` And `untabify`

2012-06-08 Thread Jay Fields
I wouldn't mind seeing more in clojure.string. e.g. daserize, underscore, pascal-case, camel-case On Fri, Jun 8, 2012 at 9:46 AM, Stuart Sierra the.stuart.sie...@gmail.comwrote: Seems like a fairly specialized function. No harm in including it where it's needed, but does it need to go in

Re: Creating a hashmap

2012-06-05 Thread Jay Fields
(zipmap (range 1 4) [a b c]) On Tue, Jun 5, 2012 at 7:59 AM, Christian Guimaraes cguimaraes...@gmail.com wrote: Hello all, I'm studying a little bit of Clojure and facing a doubt here. I hava a list (a b c) and want to create a hashmap using the elements from this list. The keys will be

  1   2   >