[ANN] clj-queue-by 0.1.1

2017-11-17 Thread Stefan Kamphausen
Dear Clojurians, We've released a small queuing library which fills a gap that core.async didn't really fill for us. https://github.com/acrolinx/clj-queue-by * A central, easy to use, thread-safe, in-memory working queue. * Easy to inspect to allow monitoring. * Stateful, not persistent, uses

[CfP] :clojureD 2018

2017-10-02 Thread Stefan Kamphausen
Dear Clojure-Community, The call for proposal for the next :clojureD is open: http://clojured.de/call-for-proposals/ We'd love to drown in your submissions so that we can deliver a conference programme just as excellent as 2017. :-) Oh, and ticket sale has started, too:

Re: [ANN] permissions - role & permission based access control

2016-10-13 Thread Stefan Kamphausen
Hi, Doesn't that feel like premature optimization to you, too? Bitmasks are much harder to read than sets with spelled out roles and I wonder if the performance gain is really worth that. And it poses a limit of 64 roles. I have seen several enterprise applications that had far more than 64

Re: [CfP] :clojureD 2017

2016-09-16 Thread Stefan Kamphausen
Hi, On Friday, September 16, 2016 at 6:16:14 AM UTC+2, Mars0i wrote: > > Glad that this is happening. > You might want to add the date to the CFP and Schedule pages. I only > found it on the Press page. > Thanks for your feedback. I've added the date to the CfP page. Did you look for it on

[CfP] :clojureD 2017

2016-09-14 Thread Stefan Kamphausen
Dear Clojure-community, Please let me bring the current call for proposals for the next iteration of the German clojure conference in Berlin, the :clojureD, to your attention: http://www.clojured.de/call-for-proposals/ We call to send us talks for the upcoming :clojureD conference 2017.

Re: Encapsulating Local Mutable State

2016-05-02 Thread Stefan Kamphausen
Good point, Paul. Thanks. Best, stefan -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To

Re: Encapsulating Local Mutable State

2016-04-16 Thread Stefan Kamphausen
Hi Francis, Thanks for taking the time to thoroughly explain your approach. I find it interesting and was not yet aware of it. Need to wrap my head around it a bit. Best, Stefan -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this

Encapsulating Local Mutable State

2016-04-15 Thread Stefan Kamphausen
Hi, Currently, I am in the process of writing a client to server API which is not trivial to consume. In particular it needs a 3-step authentication process: login with user name and password, get an authentication token, open a session with the token and finally consume the API with the

[ANN] :clojureD Registration Now Open

2015-12-17 Thread Stefan Kamphausen
Fellow Clojurians, The team organizing the German Clojure conference :clojureD would like you to know, that the registration is now open: http://www.clojured.de/registration/ Kind regards, stefan -- You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: add-watch and writing data into a core.async channel

2015-07-31 Thread Stefan Kamphausen
On Friday, July 31, 2015 at 8:21:18 AM UTC+2, Raymond Huang wrote: I'd like to use `add-watch` on an atom which writes the data to a core.async channel. So far, I've come up with this, but it seems bad because I create a new go-routine everytime something happens. Makes me think, one

Re: [ANN] CIDER 0.9

2015-06-18 Thread Stefan Kamphausen
Dear CIDER Devs, On Tuesday, June 16, 2015 at 4:33:48 PM UTC+2, Bozhidar Batsov wrote: CIDER 0.9 is finally out! You can read more about the release here http://batsov.com/articles/2015/06/16/cider-0-dot-9/ thanks for the time and effort you've put into this! Works fine for me. Update

Re: calling functions that accepts keyword arguments with a map

2015-02-16 Thread Stefan Kamphausen
Hi, On Friday, February 13, 2015 at 8:04:20 PM UTC+1, James Reeves wrote: A lot of utility libraries, such as my own Medley https://github.com/weavejester/medley, have mapply functions for this exact use-case. Generally, however, I find that keyword arguments are more trouble than

Re: Why STM read are not cached?

2015-02-11 Thread Stefan Kamphausen
Hi, It's been quite a while since I last looked into the impl of STM but I seem to remember that the committing transaction actively notifies other running transactions (see method barge) to restart and thus the restart is not triggered by the second deref at all. You could also find out

Re: Creating Hiccup From Code Keeping Formatting and Comments

2015-01-05 Thread Stefan Kamphausen
Hi, Thanks for your pointers. That is something to dive into. Cheers, stefan -- 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

Creating Hiccup From Code Keeping Formatting and Comments

2015-01-04 Thread Stefan Kamphausen
Hi, Currently, I am trying to write a presentation using ring and reveal.js. For the code samples, I'd like to write real clojure code, i.e. no strings or the like. Then, I want to turn that into a suitable hiccup vector which will create the correct reveal.js/highlight.js syntax. I

[ANN] Registration and Program For :clojureD

2014-11-20 Thread Stefan Kamphausen
Hi, With great pleasure, I'd like to announce the finalization of the program and opening of registration for the :clojureD, Germany's Clojure conference in Berlin. The conference: http://www.clojured.de/ 24th Jan 2015 in Berlin https://twitter.com/clojuredconf @clojuredconf The program:

Re: [ANN] Clojure 1.7.0-alpha4 now available

2014-11-17 Thread Stefan Kamphausen
Hi, Thumbs up from my side. The compilation issues with too long filenames in my projects on my system are gone now (CLJ-1330). No perf degradation either :-). Thanks Stefan -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group,

Re: Java Listener on Textfield

2014-11-03 Thread Stefan Kamphausen
Hi, not directly an answer to your question, but you may be interested in Seesaw and it binding facilities. Unless you are looking for pure Java solutions in which case your posting in the wrong group. Kind regards, stefan On Monday, November 3, 2014 1:52:46 PM UTC+1, Azzoug Youcef wrote:

Re: [ANN] Clojure 1.7.0-alpha3 now available

2014-10-28 Thread Stefan Kamphausen
Hi, have there been any changes how fns with a name and recursion are compiled? One of my projects has a function which does not compile with 1.7.0-alpha3 anymore, but did fine with 1.6.0. I tried to create a minimal example at https://github.com/ska2342/nested-fn-breaks-clojure-17 (I know

Re: atom swap! versus ref dosync+alter?

2014-09-30 Thread Stefan Kamphausen
Hi, On Tuesday, September 30, 2014 12:01:33 PM UTC+2, Joachim De Beule wrote: Dear list, I've got two threads that update the same location. One of them takes a lot of time. Given this, my question is if there is a reason to prefer an atom or a ref? is it really just two threads? Then

Re: [ANN] Clojure 1.7.0-alpha2

2014-09-12 Thread Stefan Kamphausen
On Wednesday, September 10, 2014 10:53:27 PM UTC+2, Alex Miller wrote: On Wednesday, September 10, 2014 11:05:36 AM UTC-5, puzzler wrote: When I explain to new Clojurists what the ! means, I explain that it calls attention to a mutation function that is unsafe to call inside a

Re: CLISP books any good to learn Clojure

2014-08-24 Thread Stefan Kamphausen
Practical Common Lisp will definitely help understanding Clojure, too. For example, the way, Macros are introduced and used, and understanding generic functions. http://www.gigamonkeys.com/book/ stefan On Sunday, August 24, 2014 12:49:07 PM UTC+2, Cecil Westerhof wrote: There are a lot of

Re: futures and atoms and bears, oh my!

2014-07-15 Thread Stefan Kamphausen
(defn foo I don't do a whole lot. [a b] ((let [y (bar(a b))] (println a b Hello, World! Now, *there* are some very suspicious parens around... 1. You're trying to call a as a function 2. Yes, you're calling bar with too few parameters, but how many? One. 3. Finally, after

Re: When to use ! in function name

2014-07-11 Thread Stefan Kamphausen
Hi, On Friday, July 11, 2014 11:10:53 AM UTC+2, Cecil Westerhof wrote: 2014-07-10 18:34 GMT+02:00 Plínio Balduino pbal...@gmail.com javascript:: IMO, ! is used when change any global state. A side effect like print on screen is not enough to cause a ! in the name. I think that's why the

Re: When to use ! in function name

2014-07-11 Thread Stefan Kamphausen
Hi, On Friday, July 11, 2014 11:33:34 AM UTC+2, Cecil Westerhof wrote: 2014-07-10 19:10 GMT+02:00 Softaddicts lprefo...@softaddicts.ca javascript:: ​but as I understood from others it is not about side-effects, but global state. as James and I already pointed out, that is not what it

Re: When to use ! in function name

2014-07-10 Thread Stefan Kamphausen
On Thursday, July 10, 2014 5:28:26 PM UTC+2, Cecil Westerhof wrote: When a function returns a true/false value you should end it with a '?'. Clojure Programming says that with side effects you should end the function name with a '!'. Use the bang! only for things not safe in an STM

Re: Instaparse: Dynamic Grammar With Declarations

2014-06-27 Thread Stefan Kamphausen
pass approach (while I thought I'd have to create the second grammar with string operations). * I'll stick to separating parsing and validation for now. Question answered, case closed, thanks! Cheers, stefan On Wednesday, June 25, 2014 11:31:21 PM UTC+2, Stefan Kamphausen wrote: Hi, first

Instaparse: Dynamic Grammar With Declarations

2014-06-25 Thread Stefan Kamphausen
Hi, first of all, please excuse this cross-post. I tried to get an answer on the instaparse list first, but it does not seem to reach so many instaparse users. Unfortunately I do not know the correct name for the problem I face, hence the rather vague subject. I am trying to parse a file

Re: restarts

2014-06-20 Thread Stefan Kamphausen
On Thursday, June 19, 2014 11:05:07 PM UTC+2, Thomas Heller wrote: Excuse my ignorance of not knowing anything about CL and restarts but I needed something like retry a while back. Restarts in CL are a different beast. Take a look at e.g.

Re: Leiningen 2.4.2 upgrade causing problems

2014-06-19 Thread Stefan Kamphausen
Hi, On Wednesday, June 18, 2014 6:13:02 PM UTC+2, Sean Corfield wrote: I am using Eastwood 0.1.2 without problems with Leiningen 2.4.2 but perhaps Stefan and others are seeing conflicts because of other stuff in ~/.lein/profiles.clj with Eastwood? That file is rather small on my machine:

Re: Leiningen 2.4.2 upgrade causing problems

2014-06-19 Thread Stefan Kamphausen
Hi Andy, On Thursday, June 19, 2014 3:39:41 PM UTC+2, Andy Fingerhut wrote: Stefan, with the ~/.lein/profiles.clj you pasted: {:user {:plugins [[jonase/eastwood 0.1.4] [cider/cider-nrepl 0.7.0-SNAPSHOT]] }} I do not see the problem. If I change 0.1.4 to 0.1.2 I do.

Re: Leiningen 2.4.2 upgrade causing problems

2014-06-18 Thread Stefan Kamphausen
Hi, FWIW... On Wednesday, June 18, 2014 5:06:09 AM UTC+2, Sean Corfield wrote: works for me... Does *not* work for me. I see the same error inside and outside of projects: $ java -version java version 1.7.0_11 Java(TM) SE Runtime Environment (build 1.7.0_11-b21) Java HotSpot(TM) 64-Bit

Re: Leiningen 2.4.2 upgrade causing problems

2014-06-18 Thread Stefan Kamphausen
Oh, great, yes, that helped. Unexpected. Thanks, stefan On Wednesday, June 18, 2014 11:09:52 AM UTC+2, Ambrose Bonnaire-Sergeant wrote: Rather upgrading *from* 0.1.2 fixes. Thanks, Ambrose On Wed, Jun 18, 2014 at 5:08 PM, Ambrose Bonnaire-Sergeant abonnair...@gmail.com javascript:

Re: PersistentVector PersistentHashMap - internal implementation

2014-06-03 Thread Stefan Kamphausen
Hi, On Tuesday, June 3, 2014 4:02:45 PM UTC+2, sorin cristea wrote: Hi all, I don't know if this question was already asked by someone here but can you tell me(explain) or guide me to a properly documentation about how is internal implemented PersistenVector and PersistentHashMap ,

Re: Books for learning Clojure

2014-04-23 Thread Stefan Kamphausen
Would German be an option for you? Just curious stefan -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first

Re: [ANN] Clojure 1.6.0-RC4 is now available

2014-03-24 Thread Stefan Kamphausen
RC4 works well for me. Thanks for all the effort you put into this. stefan -- 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

Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-23 Thread Stefan Kamphausen
On Sunday, March 23, 2014 6:02:26 PM UTC+1, Alex Miller wrote: Stefan, how do these numbers compare to RC1? Is RC2 better than RC1? If my tests can be trusted, there is an improvement between RC1 and RC2, but it is still worse than 1.5.1. *Version* *Java Version* *User time(s)* *Sys

Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-23 Thread Stefan Kamphausen
Hi, Additionally differences in -XX:+PrintCompilation ouput might be interesting. first, I tested with -XX:+PrintInlining and there actually is a difference for seqFrom: in 1.5.1 there are more occurrences of this function in the output (see data at the end of this post). Since the

Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-22 Thread Stefan Kamphausen
Hi, On Saturday, March 22, 2014 3:52:00 AM UTC+1, Alex Miller wrote: That's pretty weird. that's pretty true. 1.6.0-RC2 is out now - I would really appreciate it if you could give it a shot. Sure. Tried with Oracle JDK 7 and 8, each run two times and took the average. Each run

Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-21 Thread Stefan Kamphausen
Hi, after two days of git bisecting and running my tests over and over again, I give up. While I can repeatedly identify the commit which causes the biggest slowdown for me between the 1.5.1 tag and 1.6.0 RC1 I simply refuse to believe that the result of my analysis is correct. On

Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-21 Thread Stefan Kamphausen
On Saturday, March 22, 2014 12:41:55 AM UTC+1, Andy Fingerhut wrote: That is odd. This is a shot in the dark, and probably unhelpful because I do not know a good way to verify whether my guess is true, but perhaps the seqFrom method went from being small enough to be inlined by your JIT

Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-19 Thread Stefan Kamphausen
hi, RC1 works well with our largest project. See a 5-8% slow-down but no other problems. Regards, Stefan -- 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 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-19 Thread Stefan Kamphausen
Hi Alex, the runtime of the program changed from 19 to 20 seconds for one set of data and from approx 6minutes to 6:30 for another set. To me that is acceptable. We are reading a few MB of files into memory, create lots of intermediate vectors, maps and sets and output up to a few hundred

Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-19 Thread Stefan Kamphausen
Hi, On Wednesday, March 19, 2014 3:55:22 PM UTC+1, Michał Marczyk wrote: Hashes are cached for Clojure collections, keywords and symbols, but not for strings. I wonder if people who report these perf regressions use long string keys in their maps... As far as I can see, we have /lots/

Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-19 Thread Stefan Kamphausen
On Wednesday, March 19, 2014 4:34:45 PM UTC+1, Alex Miller wrote: Thanks, this is all really useful. I would appreciate any more detailed info. * No atoms, agents, refs * Almost purely functional plus logging and I/O * Multi-threaded using latest core.async with thread, no go * JVisualVM

Re: side-effect only function with map-like syntax (again)

2014-01-28 Thread Stefan Kamphausen
Does wrapping your map expression in a dorun do what you want? Stefan -- -- 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: Managing role-based permissions in Ring apps

2014-01-18 Thread Stefan Kamphausen
On Friday, January 17, 2014 8:29:21 PM UTC+1, Sam Ritchie wrote: Okay, here's my post: http://sritchie.github.io/2014/01/17/api-authentication-with-liberator-and-friend/ Gee, that's way more complicated than I expected. Thanks for sharing anyway! stefan -- -- You received this

Re: Managing role-based permissions in Ring apps

2014-01-12 Thread Stefan Kamphausen
On Monday, January 13, 2014 3:53:43 AM UTC+1, Sam Ritchie wrote: cemerick's Friend library is the way to do this: https://github.com/cemerick/friend I'm writing up a post on how to combine Friend with Liberator, for easy ACL management for RESTful APIs. Take a look and let us know what

How to indent clojure code in Emacs

2014-01-03 Thread Stefan Kamphausen
Hi, FWIW, I prefer M-C-q with the cursor on the opening paren of a form. Cheers, Stefan -- -- 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

Inconsistent Ref Values

2014-01-02 Thread Stefan Kamphausen
Hi, I've probably been staring at this for too long to see, what I am doing wrong. I have a Ref which contains a vector similar to the following (def data [{:a {:b 1 :c 0}} {:a {:d 1 :g 0}} {:a {:e 1 :h 0}} {:a {:f 1 :i 0}}]) There is a second ref, which is similar but without the

Re: Inconsistent Ref Values

2014-01-02 Thread Stefan Kamphausen
OK, got it. The get-in is stupid and is always returning 0. Please excuse the noise stefan -- -- 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

Re: contains? and transient set

2013-12-04 Thread Stefan Kamphausen
It looks like you're onto something here get works with transient maps: (get (transient {:a 1 :b 2}) :a) ;= 1 and with transient vectors, too: (get (transient [1 2 3]) 0) ;= 1 but not with transient sets: (get (transient #{1 2 3}) 2) ;= nil And using contains? in a reduce with a transient

Re: [ANN] Optimus - a Ring middleware for frontend performance optimization.

2013-11-27 Thread Stefan Kamphausen
On Wednesday, November 27, 2013 11:11:27 AM UTC+1, Magnar Sveen wrote: I think it would be best if the author chimed in, me too but it looks like there has been done some good work on optimizing the development workflow when you're working with languages that need to be transpiled.

Best Practice For Logging vs. Functional (and Elegant)

2013-11-26 Thread Stefan Kamphausen
Hi, logging is a side-effect and I try to keep it out of the functional parts of my code. But even for the parts where I want to introduce logging I find that it renders code less readable. As an example, say you've got an 'if-let' somewhere (if-let [a

Re: [ANN] Optimus - a Ring middleware for frontend performance optimization.

2013-11-26 Thread Stefan Kamphausen
Hi, I'd be very interested in learning, how Twixt[1] compares to Optimus and the other solutions cited. [1] https://github.com/AvisoNovate/twixt/ Regards, stefan -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: Best Practice For Logging vs. Functional (and Elegant)

2013-11-26 Thread Stefan Kamphausen
On Tuesday, November 26, 2013 8:56:11 PM UTC+1, Gary Verhaegen wrote: I haven't had time to really investigate it, but I was planning to delve into dire for exactly that problem. https://github.com/MichaelDrogalis/dire That looks interesting. Thanks for pointing out. Best, stefan --

Re: println / for unexpected behaviour

2013-11-25 Thread Stefan Kamphausen
Hi Edward, you are being hit by laziness here. Clojure's 'for' is not like the 'for' you may know from other programming languages. It is made for list comprehensions, that is it is building new list-y things. It does not do this instantly, the items may be realized only when the caller

Spit seems to use incorrect line terminator on Windoze

2013-11-24 Thread Stefan Kamphausen
I agree with Alex. I would not want any magic to happen to my string. Best, Stefan -- -- 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 -

Re: preferred way to dereference a ref: outside or inside dosync?

2013-11-23 Thread Stefan Kamphausen
On Saturday, November 23, 2013 3:17:07 PM UTC+1, Justin Smith wrote: Of course in a real app the key should be serialized to a persistent, consistent, and shared data store. Which of course depends on the app in question. The code above was taken from a 'real app', if 'an app that is used

Re: preferred way to dereference a ref: outside or inside dosync?

2013-11-22 Thread Stefan Kamphausen
On Friday, November 22, 2013 12:29:25 AM UTC+1, Jim foo.bar wrote: apart from the generate-keys fn which is intentionally simplistic and predictable so I can test somehow, I will admit that these are very good points indeed. How about (defn get-key-generator [] (let [i (atom 0)]

Re: preferred way to dereference a ref: outside or inside dosync?

2013-11-21 Thread Stefan Kamphausen
Hi, I may be missing something here, since this thread leaves me a bit confused. 1. Why are you using a Ref for the bank in the first place? It is a single identity and thus should be an atom, because you do not need to coordinate changes of at least two identities. If I am not mistaken, the

Re: preferred way to dereference a ref: outside or inside dosync?

2013-11-21 Thread Stefan Kamphausen
Hi, On Thursday, November 21, 2013 11:58:31 AM UTC+1, Jim foo.bar wrote: [...] 1. [...] Since there is a single identity, perhaps STM is an overkill... If I read your example correctly, it is not a typical use-case for STM. 2. can you ellaborate why you think this is debatable? All

Re: preferred way to dereference a ref: outside or inside dosync?

2013-11-20 Thread Stefan Kamphausen
Hi, you would only want to use Refs when you need to update at least two of them with transaction semantics. When you need to read only one of them, you can just deref them any time you want, if you need a consistent snapshot of two refs, you need to read them inside a transaction, i.e.

Re: Step by step debugging

2013-11-08 Thread Stefan Kamphausen
On Thursday, November 7, 2013 6:32:29 PM UTC+1, Lee wrote: In Common Lisp when you hit an error you're thrown into a break loop REPL in which you can view locals, move up and down the stack, and do lots of other fancier things (re-binding things, restarting...) that are probably useful

Re: StackOverflowError

2013-11-08 Thread Stefan Kamphausen
On Friday, November 8, 2013 11:11:14 AM UTC+1, ru wrote: Hi Jim, I forget to say that call to count have been done in not a bare repl, but inside a quite complex program after it did a lot of work on a quite big data. But, after long and profound analysis of source code I did not found

Re: doseq vs dorun

2013-10-18 Thread Stefan Kamphausen
Hi, On Friday, October 18, 2013 12:12:31 AM UTC+2, Brian Craft wrote: I briefly tried working with the reducers library, which generally made things 2-3 times slower, presumably because I'm using it incorrectly. I would really like to see more reducers examples, e.g. for this case:

Re: doseq vs dorun

2013-10-17 Thread Stefan Kamphausen
Hi, What is the idiomatic way of parallelizing a computation on a lazy seq? keep in mind, that pmap lazily processes the seq with a moving window the size of which depends on the available cores on your machine. If the processing of one element takes a long time, the parallel work will wait

Re: Can you explain the result of a expression?

2013-08-28 Thread Stefan Kamphausen
http://stackoverflow.com/questions/12412038/in-clojure-are-lazy-seqs-always-chunked -- -- 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 -

Re: function creation, partial or #()

2013-08-16 Thread Stefan Kamphausen
On Friday, August 16, 2013 9:45:53 AM UTC+2, Antonio Terreno wrote: I much prefer the #(), (fn[]) is longer so it's a no-go ;) fn has the huge advantage of taking an (optional) name, which will show up in stack traces. Just my 2ct Stefan -- -- You received this message because you

Re: function creation, partial or #()

2013-08-15 Thread Stefan Kamphausen
(let [params (map (fn [_] (gensym fnp-)) (range n))] (repeatedly n #(gensym fnp-)) Best, Stefan -- -- 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: IDE feature

2013-08-08 Thread Stefan Kamphausen
Just for the record: I've been coding in Lisp for close to 30 years make that 20 years in my case and I agree with Lee. Can't live without C-M-q, TAB, M-left/right, C-M-SPC but paredit is interfering too much for /my/ taste. stefan -- -- You received this message because you are

Re: Can we please deprecate the :use directive ?

2013-08-05 Thread Stefan Kamphausen
On Monday, August 5, 2013 2:13:02 PM UTC+2, Mikera wrote: To me the things that make Clojure namespace handling a nightmare for beginners are: - Bad error messages (no.1 problem!) - Confusion with keywords vs. symbols (why :use in ns declarations vs use at the repl?) - Confusion about

Re: help actually changing :use to :require :refer :all?

2013-07-29 Thread Stefan Kamphausen
Would it still bother you if the IDE helped maintain the ns declaration? IMHO, having to rely on my editor or an IDE to manage my code would be a language design smell. Not that I would mind a little help here and there, though -- e.g. indentation, completion and a message if there seem

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Stefan Kamphausen
On Tuesday, July 23, 2013 9:42:39 PM UTC+2, Shantanu Kumar wrote: One of the main issues I have faced with :use is, understanding a non-trivial codebase becomes very difficult and almost always requires Emacs Meta-dot. which is particularly annoying when you read code on a blog (as

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Stefan Kamphausen
On Tuesday, July 23, 2013 11:13:11 PM UTC+2, Ben wrote: On Tue, Jul 23, 2013 at 1:55 PM, Sean Corfield seanco...@gmail.comjavascript: wrote: On Tue, Jul 23, 2013 at 1:53 PM, Ben Wolfson wol...@gmail.comjavascript: wrote: On Tue, Jul 23, 2013 at 1:50 PM, Stefan Kamphausen ska

Re: easier way to write not not?

2013-07-17 Thread Stefan Kamphausen
Just for the record: I stumbled across the same question just a week ago. -- -- 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

Re: Clojure: Elegance vs. Performance?

2013-07-10 Thread Stefan Kamphausen
The Clojure philosophy is that it is rather irritating to think your recursive call is going to be cleverly optimized into a loop, and then if you're wrong, you have no good way to know that. So the idea is that you use the word recur to indicate that *you* think it can be optimized into

Re: Help deciphering ArityException message

2013-06-30 Thread Stefan Kamphausen
Just a little hint which may help you in the future. First, note the trailing $fn in reformat-headers$fn which tells you, that your problem is with an anonymous function. Second, you know that there is a second form for anonymous functions which uses fn instead of the reader macro. Third, fn

Loosing a space from an XML document

2013-06-19 Thread Stefan Kamphausen
Hi, Recently I found myself searching for a white space which got lost somewhere between reading an XML file and presenting some results from that via a little webapp. I think, I could track it down to the following example: user (clojure.pprint/pprint (clojure.zip/xml-zip

Re: Is there an approved way for testing if something is a zipper?

2013-06-12 Thread Stefan Kamphausen
Thanks for all your suggestions. Seems like a useful addition to clojure.zip to me. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated -

Re: license of Javascript files generated by Clojurescript?

2013-06-12 Thread Stefan Kamphausen
Hi, On Wednesday, June 12, 2013 2:29:42 PM UTC+2, David Pollak wrote: The license of the JavaScript generated by the ClojureScript compiler is the license of the source code that was compiled. And that license may be my company owns it and it's proprietary and we're not licensing it to

Is there an approved way for testing if something is a zipper?

2013-06-11 Thread Stefan Kamphausen
Hi, while working on some XML data extraction I got an NPE which boiled down to calling some zipper related functions on an empty vector or nil. I didn't find a function in clojure.zip, clojure.data.zip or clojure.data.zip.xml to test if an object passed to a function is actually a zipper.

Re: parsing xml with zip, xml and clojure.data.zip

2013-06-05 Thread Stefan Kamphausen
AFAIK your var myxml already refers to the root node of your XML document. So your first example searches for a tag called level1 inside the root tag (which is level1). Obviously, there is no such node and the text is empty. Your second example extracts a textual representation of the child

Re: ref-history-count always return 0?

2013-05-31 Thread Stefan Kamphausen
You may want to use the code from https://gist.github.com/Chouser/456326 to study how the history in refs works. See the accompanying discussion at http://clojure-log.n01se.net/date/2010-06-28.html. I've been using variants of that stress test to explain the ref history behavior since then

Re: Getting highlighted clojure code into a presentation

2013-05-18 Thread Stefan Kamphausen
Besides the obvious org-mode which exports with colors to HTML when you use #+BEGIN_SRC clojure ... #+END_SRC I also had some fun presenting with marginalia or impress.js, both using Alex Gorbatchev's Syntax Highlighter. (FWIW) -- -- You received this message because you are subscribed to

Re: Question about code style

2013-04-25 Thread Stefan Kamphausen
You might want to consider adding it to https://github.com/bbatsov/clojure-style-guide :-) -- -- 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

Re: Customize clojure-mode (emacs) question

2013-04-24 Thread Stefan Kamphausen
Take a look at the bottom of jason.clj: https://github.com/clojure/data.json/blob/master/src/main/clojure/clojure/data/json.clj -- -- 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

Re: Clojure/West 2013 videos?

2013-04-02 Thread Stefan Kamphausen
It may well be that I'll never get to the US in my whole life, who knows. Nevertheless, I get to watch fine recordings from interesting talks developed and given by people way smarter than me. And I get those for free. What an opportunity.. Patience is something I'm trying to teach my kids

Re: Beginners question - emacs compiling tests

2013-03-20 Thread Stefan Kamphausen
If you have a valid ns-form and still encounter that error, it may help to compile the file once using C-c C-k. I still need to do that (sometimes?) when I open a file in Emacs although I'd thought, that the complete project should have been loaded at REPL start. After that compilation of

Re: Beginners question - emacs compiling tests

2013-03-20 Thread Stefan Kamphausen
Hi, On Wednesday, March 20, 2013 9:44:19 AM UTC+1, Marko Topolnik wrote: This problem was cross-posted over here from StackOverflowhttp://stackoverflow.com/questions/15508152/beginners-emacs-clojure-compiling-error, where it has already been marked as solved. oh, sorry, didn't know

Re: Beginners question - emacs compiling tests

2013-03-20 Thread Stefan Kamphausen
On Wednesday, March 20, 2013 10:44:15 AM UTC+1, Marko Topolnik wrote: Because you usually don't want to wait the eternity it takes to compile and load absolutely everything. Even loading just the main namespace can be painfully slow, even if your project is just a few lines, due to the

Re: Raw strings

2013-03-18 Thread Stefan Kamphausen
Hi, On Monday, March 18, 2013 12:50:13 PM UTC+1, Marko Topolnik wrote: Dynamic regex building is a standard technique. Unfortunately, once you leave the regex literal world, you are back to escaping everything. this works pretty well, at least better than I expected, e.g.: user= (def r1

Re: Raw strings

2013-03-18 Thread Stefan Kamphausen
On Monday, March 18, 2013 12:25:07 PM UTC+1, Maik Schünemann wrote: http://dev.clojure.org/display/design/Alternate+string+quote+syntaxes It would have been nice to still have # available for this and #// for regexes. That's probably my Perl heritage leaking through, though :) -- -- You

Re: Create map from vector of keywords and other items

2013-02-21 Thread Stefan Kamphausen
Thank you all for your valuable input. I'll look into these soon. take-nthis definitely a function to keep in mind. Stefan -- -- 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

Create map from vector of keywords and other items

2013-02-20 Thread Stefan Kamphausen
Hi, given a vector of the form [:key1 1 2 3 :key2 4 :key3 5 6 7] I wand to create a map collecting the items behind each keyword as a vector like this: {:key1 [1 2 3] :key2 [4] :key3 [5 6 7]} I have already written two functions which achieve this, but neither of them feels good

Re: Clojure - Python Style suggestion

2013-02-05 Thread Stefan Kamphausen
A simple workaround I've considered, but haven't gotten around to doing anything about in e.g. Emacs, is to simply tone down the parens visually in the editor. Hierarchy of color, size, contrast, etc. matters a lot in perception, and by making the parens slightly less obvious visually

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

2013-01-16 Thread Stefan Kamphausen
Just a few things, you might find interesting * anything/helm: http://www.emacswiki.org/Anything * speedbar (used that in my early years; got rid of it eventually) * mtorus: http://www.emacswiki.org/emacs/MTorus (shameless self-plug) * M-. on functions * M-x ffap * iswitchb-buffer (just keep the

Re: Clojure 1.5.0 RC 1

2013-01-02 Thread Stefan Kamphausen
Hi, On Saturday, December 22, 2012 5:09:07 PM UTC+1, Stuart Halloway wrote: Please test it. my current projects work fine with this RC. Some even seem to be a little bit faster, but I didn't profile it thoroughly. Kind regards, Stefan -- You received this message because you are

Re: Coding Standard - ns usage

2012-11-08 Thread Stefan Kamphausen
Am Donnerstag, 8. November 2012 19:42:26 UTC+1 schrieb Luc: I am pragmatic and quite lazy, I use require with an alias inc An explicit call to use every now and then on the REPL, but no :use in ns. IMHO use and :use can be removed from the language. -- You received this message because

Find union of nodes with data.zip

2012-11-05 Thread Stefan Kamphausen
Hi, AFAIK the currently supposed way of parsing XML with Clojure is to use a combination of clojure.xml, clojure.zip, data.zip and data.zip.xml. Please correct me if I'm wrong. I am trying to extract the equivalent of a union of nodesets from an XML file (speaking in XPath terms). Example:

  1   2   3   >