Re: Clojure Users Group - Denmark

2013-11-15 Thread Krukow
On Thursday, November 14, 2013 11:40:08 PM UTC+1, Jacob Mortensen wrote: I do clojure+clojurescript hobby programming at home. I live in copenhagen. It seems there is a clojure user group here in copenhagen, but I havent been able to locate it. We've started to write some of the

Persistent Data Structures for Objective-C/LLVM

2013-03-28 Thread Krukow
Hi, Kind of an unusual question, but is anyone in this group aware of a c, objective-c or LLVM-based implementation of the Clojure persistent data structures? - Karl -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send

Re: Persistent Data Structures for Objective-C/LLVM

2013-03-28 Thread Karl Krukow
On 28/03/2013, at 18.07, Omer Iqbal wrote: Most foundation objective c data structures are immutable (NSArray, NSDictionary, NSSet etc), and are most probably more performant than clojure counterparts, though terribly less elegant. However there's the clojure-scheme project

[cljs] Implement transport for a REPL

2012-11-27 Thread Krukow
Hi, I have a special non-browser environment which doesn't support a ClojureScript REPL at the moment. I was wondering if someone has any insight into how much work it would be to create an equivalent of the browser-connected repl for a new environment. That is, I'd like a repl running in the

Re: [cljs] Implement transport for a REPL

2012-11-27 Thread Karl Krukow
possible. I've been to meaning to merge some experimental work I've done creating a Node.js ClojureScript REPL in hopes that some one would be willing to take it further. David On Tue, Nov 27, 2012 at 4:22 PM, Krukow karl.kru...@gmail.com wrote: Hi, I have a special non-browser environment

Re: [cljs] Implement transport for a REPL

2012-11-27 Thread Karl Krukow
to meaning to merge some experimental work I've done creating a Node.js ClojureScript REPL in hopes that some one would be willing to take it further. David On Tue, Nov 27, 2012 at 4:22 PM, Krukow karl.kru...@gmail.com wrote: Hi, I have a special non-browser environment which doesn't support

cljs: extend-protocol to Keyword

2012-11-26 Thread Krukow
Hi, I'm writing my first ClojureScript program. I defined a protocol for a query language which I wanted to extend to various data types, including keywords. However keywords are strings when it comes to dispatch. Is this a bug, or by design? ClojureScript:cljs.user (defprotocol Foo (-a [x]

Re: cljs: extend-protocol to Keyword

2012-11-26 Thread Krukow
Thanks both for the responses. I'm extending to string for now, which is fine for my usecase. - Karl On Monday, November 26, 2012 9:28:06 PM UTC+1, Krukow wrote: Hi, I'm writing my first ClojureScript program. I defined a protocol for a query language which I wanted to extend to various

cljs: dynamic/reflective calls

2012-11-26 Thread Krukow
Continuing my exploration of ClojureScript.. I'm writing a small query language. The syntax consists of data structures like [:button {:name Login}] In general maps are interpreted as filters. The keys of the maps correspond to method on JavaScript objects (that I don't control). So I want

Re: cljs: dynamic/reflective calls

2012-11-26 Thread Karl Krukow
Ah :) Cheers, - Karl On 26/11/2012, at 23.03, David Nolen wrote: You can use `aget` for that. (aget object someProperty) David On Mon, Nov 26, 2012 at 5:00 PM, Krukow karl.kru...@gmail.com wrote: Continuing my exploration of ClojureScript.. I'm writing a small query language

Re: Clojure introduction to the Zürich IT geeks

2012-09-13 Thread Krukow
I have a potential customer in Zürich, so I might be around within the next months. Who should I contact if I get specific dates, and what kind of intro are you looking for? - Karl On Thursday, September 13, 2012 11:24:42 AM UTC+2, al-maisan wrote: Hello there! We are still looking for

Re: Clojure introduction to the Zürich IT geeks

2012-09-13 Thread Karl Krukow
On 13/09/2012, at 20.54, Muharem Hrnjadovic wrote: Hello Karl, just drop me an email (ideally 2 weeks in advance so we can announce and promote the event). Since this would be the first meetup about Clojure I thought we would target beginners to intermediate users. Sure, will do. I don't

Re: Can we use Clojure like a general library in Java?

2012-06-03 Thread Karl Krukow
Regarding those... Some time ago I created a project containing only the persistent data structures for use with Java et al. https://github.com/krukow/clj-ds It is the data structures only so no bootstrap penalty. There are also Java'ish improvements like basic Generics and improved

Re: Do you leave a Swank / nREPL in your production servers?

2012-05-25 Thread Karl Krukow
Sorry to ask what may be an obvious question to you. But what is a good way of embedding a swank server inside a production app? I'm kind of an emacs beginning and in development I just do lein swank and slime-connect from Emacs- that works fine. If I'm embedding swank clojure server in

Re: Do you leave a Swank / nREPL in your production servers?

2012-05-25 Thread Karl Krukow
Sorry, and thanks for the info. /Karl On 25/05/2012, at 22.46, Phil Hagelberg wrote: On Fri, May 25, 2012 at 1:41 PM, Karl Krukow karl.kru...@gmail.com wrote: If I'm embedding swank clojure server in non-development, the code would need to start up swank - how would I do that? Just add

Re: Do you leave a Swank / nREPL in your production servers?

2012-05-25 Thread Karl Krukow
Thanks Sean for the detailed information. This will be really useful to me. /Karl On 25/05/2012, at 23.30, Sean Corfield wrote: On Fri, May 25, 2012 at 1:46 PM, Phil Hagelberg p...@hagelb.org wrote: On Fri, May 25, 2012 at 1:41 PM, Karl Krukow karl.kru...@gmail.com wrote: If I'm embedding

Re: ANN Welle, a Clojure client for Riak with batteries included

2012-05-24 Thread Krukow
Thanks. I'm quite interested in this. I've been using sumo for some time, and that has been working out fine for the simple use cases I have. Would you mind giving your opinion on how these libraries compare (tradeoffs) On Wednesday, May 16, 2012 4:23:16 PM UTC+2, Michael Klishin wrote: I

Workflow and development tools for ClojureScript One

2012-02-19 Thread Krukow
I was wondering what a good workflow for working with ClojureScript One would be. For regular Clojure, I use Emacs with swank-clojure (using Sam's Live coding emacs, which is great for Emacs beginners, https://github.com/overtone/live-coding-emacs). That works quite well for me, giving a good

Re: Cannot access variables without namespace in ClojureScript repl.

2012-02-16 Thread Krukow
On Jan 15, 3:32 pm, Brenton bashw...@gmail.com wrote: We found a couple of problems with theClojureScriptREPL while working onOneand will address them soon. If you confirm that this is the problem, please let us know. Also, feel free to add an issue to JIRA with the steps to reproduce. [snip]

Re: Latest Bagwell paper for a new implementation of Clojure vectors ?

2011-11-15 Thread Karl Krukow
On Tuesday, November 15, 2011, Justin Balthrop jus...@justinbalthrop.com wrote: My understanding from the talk was that RRB-Trees have performance identical to PersistentVector as long as you don't concat or split them. So why not just replace the PersistentVector implementation with an

Re: Latest Bagwell paper for a new implementation of Clojure vectors ?

2011-11-15 Thread Karl Krukow
On 15/11/2011, at 19.13, Justin Balthrop wrote: It wouldn't change the performance profile of existing programs because currently there isn't a way to concat two vectors and get a new vector. I don't envision changing the behavior of clojure.core/concat, that should still return a seq. It

Re: Latest Bagwell paper for a new implementation of Clojure vectors ?

2011-11-13 Thread Karl Krukow
Hi, Yes, Phil Bagwell presented that at the Conj. I'm really interested in this stuff, so as an exercise in Clojure, I've started thinking about how to implement it. At first I'll try and do it without looking at Scala - if I get stuck I might peek a bit :) If you're interested, I'll put it

Re: Latest Bagwell paper for a new implementation of Clojure vectors ?

2011-11-13 Thread Krukow
By the way, I don''t see it as a replacement for PersistentVector, but rather as an additional data structure, that could perhaps be put somewhere in contrib if it turns out well. /Karl On Nov 13, 9:54 am, Karl Krukow karl.kru...@gmail.com wrote: Hi, Yes, Phil Bagwell presented

Re: Latest Bagwell paper for a new implementation of Clojure vectors ?

2011-11-13 Thread Karl Krukow
not sure what the best way to implement low-level stuff like this is in Clojure. Once I get my head around the details of the algorithm, and I have a working Java version, I'll try and port it to Clojure (and I'll probably ask here for advice). /Karl On Sun, Nov 13, 2011 at 10:02 AM, Krukow

Re: Latest Bagwell paper for a new implementation of Clojure vectors ?

2011-11-13 Thread Karl Krukow
primitive types. David On Sun, Nov 13, 2011 at 12:38 PM, Karl Krukow karl.kru...@gmail.com wrote: On 13/11/2011, at 18.14, David Nolen wrote: This would be awesome. From his talk it sounds like it shouldn't replace PersistentVector at all, in fact you should be able to share structure

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-30 Thread Krukow
On Oct 25, 5:11 pm, Fogus mefo...@gmail.com wrote: This should be epic. Indeed. Please sign me up for: * ClojureScript * Pallet -- 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: How Clojure protocols are implemented internally?

2011-05-10 Thread Krukow
On May 9, 12:09 am, David Nolen dnolen.li...@gmail.com wrote: On Sun, May 8, 2011 at 4:43 PM, Dmitry Kakurin dmitry.kaku...@gmail.comwrote: Very well, something along these lines would be my guess too. But that would mean that in case 2 protocols are no faster than multimethods. They

Re: How Clojure protocols are implemented internally?

2011-05-08 Thread Krukow
On May 7, 11:28 pm, Dmitry Kakurin dmitry.kaku...@gmail.com wrote: Let me rephrase my question to avoid unfortunate confusion with standard count function: Suppose I have extended my own IMyCountable protocol with a single mycount method to String class. What happens when I call (mycount

Re: SubVector's (via 'subvec') do not support 'transient'

2011-05-01 Thread Krukow
On Apr 30, 8:16 pm, Nathan Sorenson n...@sfu.ca wrote: Yes but the contract of subvec is that it returns a persistent vector and the resulting data structure returns true under the vector? predicate. I know that subvec returns a different type because I've looked at the Java source code but

License question

2010-08-16 Thread Krukow
adopted by other languages (Scala, Erjang, Seph) and projects which may be incompatible with the EPL license. Personally, I am interested in releasing clj-ds [1] as MIT licensed, but only if acceptable by Rich. Thanks. /Karl http://github.com/krukow/clj-ds -- You received this message because

Re: Question on defrecord

2010-08-11 Thread Krukow
On Aug 11, 7:03 pm, Shantanu Kumar kumar.shant...@gmail.com wrote: I tried to assign a data type to a var and then instantiate it using the var, but it doesn't seem to work: user= (defrecord X []) user.X user= (X.) #:user.X{} user= X user.X user= (def hey X) #'user/hey user=

Re: Generics in PersistentXXX classes

2010-08-09 Thread Krukow
On Aug 4, 5:33 pm, Alex Tkachman alex.tkach...@gmail.com wrote: Guys, Thanks fo reference. I am still be curious if it should be done directly in Clojure runtime and available if clojure.jar is in classpath Hello Alex, You can easily use clojure.jar but there are a number of

Re: Generics in PersistentXXX classes

2010-08-09 Thread Krukow
On Aug 4, 3:51 pm, Matt Fowles matt.fow...@gmail.com wrote: Alex~ There is a project on github that does exactly this. http://github.com/krukow/clj-ds I don't know much about the current state of it, but I have plans in the next month or so to try it out at work. http://github.com

Re: Records can't be treated as functions anymore

2010-08-02 Thread Krukow
On Aug 2, 3:50 pm, Baishampayan Ghose b.gh...@gmail.com wrote: Hello, [snip..] The documentation says defrecord provides a complete implementation of a persistent map. If a record is analogous to a map, why can't we treat it as one? If it's not a bug, what is the rationale behind it?

Re: Slime, debug-repl clojure debugging toolkit

2010-07-23 Thread Krukow
On Jul 23, 6:19 am, George Jahad cloj...@blackbirdsystems.net wrote: [snip] as i explained above you have to use swank/break with case 3. in addition to these 4 cases, it sounds like you are having a problem viewing the local java object, which is why i suggested using the vanilla

Re: Slime, debug-repl clojure debugging toolkit

2010-07-23 Thread Krukow
On Jul 23, 3:59 pm, Hugo Duncan hugodun...@users.sourceforge.net wrote: On Fri, 23 Jul 2010 02:35:13 -0400, Krukow karl.kru...@gmail.com wrote: So I guess the problem is in swank/break. Should be fixed in 1.3.0-SNAPSHOT now. -- Hugo Duncan I've verified that it works here. Thanks

Re: Slime, debug-repl clojure debugging toolkit

2010-07-22 Thread Krukow
) java.lang.Throwable: Exiting back to main repl from debug-repl dr-1-1001 = b foo dr-1-1001 = c bar dr-1-1001 = so it seems I can't escape back to the main repl. 3) From a shell run: krukow:~/workspaces/trifork/intrafoo_clj$ lein swank Listening for transport dt_socket at address: 8030 WARNING: group

Re: Slime, debug-repl clojure debugging toolkit

2010-07-22 Thread Krukow
On Jul 21, 4:02 pm, Ramakrishnan Muthukrishnan vu3...@gmail.com wrote: On Wed, Jul 21, 2010 at 6:04 PM, Krukow karl.kru...@gmail.com wrote:  0: com.trifork.intrafoo.clj.extract_contacts $extract_all.invoke(NO_SOURCE_FILE:1)      Locals:        pref = /Users/krukow/workspaces/trifork

Slime, debug-repl clojure debugging toolkit

2010-07-21 Thread Krukow
become the current repl in the Emacs session. Example. krukow:~/workspaces/trifork/intrafoo_clj$ cat project.clj ... :dev-dependencies [[swank-clojure 1.2.1] [org.clojars.gjahad/debug-repl 0.3.0-SNAPSHOT] [cdt 1.0.1-SNAPSHOT] ] :jvm-opts [- agentlib:jdwp

Re: Slime, debug-repl clojure debugging toolkit

2010-07-21 Thread Krukow
On Jul 21, 8:47 am, Ramakrishnan Muthukrishnan vu3...@gmail.com wrote: On Wed, Jul 21, 2010 at 11:52 AM, Krukow karl.kru...@gmail.com wrote: I am interested in getting the combination of Emacs+slime+swank- clojure, alex-and-georges.debug-repl and clojure debugging toolkit to work together

Re: Clojure on BEAM

2010-07-12 Thread Krukow
On Jul 11, 11:55 am, stewart setor...@gmail.com wrote: Hi All, Has anybody considered implementing Clojure on BEAM. Are there any works or current attempts currently available? In your view where are the real trip ups for this to happen. Instead you should take a look at Erjang /karl --

Re: Reflection warning on definterface/deftype fields/methods

2010-07-04 Thread Krukow
On Jul 4, 8:51 am, Adrian Cuthbertson adrian.cuthbert...@gmail.com wrote: I've tried every permutation of type hinting, but cannot get rid of those warnings. Any ideas? -Thanks, Adrian. Notice this: user (set! *warn-on-reflection* true) true user (import '(java.io File)) java.io.File

Re: RFC: clj-ds Clojure data structure for Java (et al.)

2010-06-08 Thread Krukow
On Jun 8, 3:11 pm, B Smith-Mannschott bsmith.o...@gmail.com wrote: Yes please! OK :) One nit: you probably didn't mean to check in your build products. The classes directory is full of *.class files. No, I didn't want the class files - I was a bit fast on the commit. I'll clean it up.

Re: Datatype Usage Examples

2010-05-28 Thread Krukow
/circuitbreaker-clojure-1-2/ Code: http://github.com/krukow/clojure-circuit-breaker Specifically, what I'd like to know is:  - How to define and access member data fields -also mutable in case of deftype- to my ADTs. The example is there for immutable fields. Why do you need mutability

Re: Datatype Usage Examples

2010-05-28 Thread Krukow
On May 28, 9:59 pm, Sina K. Heshmati s...@khakbaz.com wrote: Hi Krukow, [snip] The only member data _I'm_ able find are the ones that are passed to the default constructor, namely at the time that the abstraction is reified. What if I'd have to give create a member field

RFC: my use of protocols and datatypes

2010-05-05 Thread Krukow
at github: - http://github.com/krukow/clojure-circuit-breaker/blob/master/src/net/higher_order/integration/circuit_breaker/states.clj - http://github.com/krukow/clojure-circuit-breaker/blob/master/src/net/higher_order/integration/circuit_breaker/atomic.clj Ideas being that (wrap-with (fn ..) (make

Re: lazy-seq question

2010-05-05 Thread Krukow
On May 5, 2:54 pm, Robert Luo robort...@gmail.com wrote: [snip] (repeated-seq #(range % 5) 0) the elements are: 0 1 2 3 4 4 5 6 7 8 8 ... I think you mean, (def s (repeated-seq #(range % (+ % 5)) 0) ) However, I want to get rid of the duplicated index element (4, 8 etc), e.g. To

Re: Mahout in Clojure

2010-05-05 Thread Krukow
On May 5, 2:40 pm, klathrop gamingscien...@gmail.com wrote: [snip] Its the RecommenderBuilder that's giving me trouble.  I've tried using proxy with no luck.  Any suggestions? Can you post the code that fails? /Karl -- You received this message because you are subscribed to the Google Groups

Re: Datatypes and Protocols update

2010-04-23 Thread Krukow
On Apr 22, 6:53 pm, Rich Hickey richhic...@gmail.com wrote: [snip..] Feedback and errata welcome as always, 1) Typo on http://clojure.org/protocols: Section Basics defprotocol will automatically generate a corresponding interface, with the same name as the protocol, i.e. given a protocol

Re: Set performance

2010-04-05 Thread Krukow
On Apr 2, 3:28 pm, Chas Emerick cemer...@snowtide.com wrote: As Clojure moves towards being self-hosted, fewer and fewer of the   data structures will be implemented in Java, thereby ensuring   dependence on the Clojure runtime.  Just FYI. Yes, I've realized that as well :-) I would have to

Re: Set performance

2010-04-05 Thread Krukow
On Apr 5, 3:06 pm, ineol leo.l...@gmail.com wrote: It has nothing to do with Clojure but your colleague can look at the Google collection library that contains an ImmutableSet.http://guava-libraries.googlecode.com/svn/trunk/javadoc/com/google/co... Yes, there is also Scalas data structures

Set performance

2010-03-29 Thread Krukow
Hello, a colleague of mine asked me a question about clojures set implementation performance. He needed an immutable set on the jvm platform for a Java/Scala project, and since I've been saying that Clojures data structures have good performance he tried clojures set. He was dissapointed though

Re: Debugging in Clojure

2010-01-22 Thread Krukow
On Jan 22, 2:27 am, ajay gopalakrishnan ajgop...@gmail.com wrote: Is this the preferred way of debugging in Clojure? Please don't top post. I've heard people have success with regular debuggers, e.g. JSwat, although I haven't tried this myself... /Karl -- You received this message because

Re: Ref history

2010-01-10 Thread Krukow
On Jan 10, 6:21 pm, Dragan Djuric draga...@gmail.com wrote: Is this on purpose (and what is the reason), or it's just that nobody thought that would be useful? Of course, I am talking about the read-only access to the history. [snip...] To minimize memory consumption, refs only keep history

Re: Ants: Good Java solution?

2010-01-03 Thread Krukow
On Jan 2, 4:03 pm, ianp ian.phill...@gmail.com wrote: snip Yes, exactly. This is the problem with a Java based version (at least with one that uses the standard collections libraries). At the very least your reporting function would have to make a complete copy of the world state while

Re: Clojure 1.1 release candidate 1

2009-12-18 Thread Krukow
On Dec 17, 9:09 pm, Rich Hickey richhic...@gmail.com wrote: There is now a release candidate for Clojure 1.1: http://clojure.googlecode.com/files/clojure-1.1.0-rc1.zip and also a new 1.1.x branch in git corresponding to the release. Please try these out ASAP and provide feedback here.

Re: QCon video download

2009-12-16 Thread Krukow
On Dec 16, 6:33 pm, tsuraan tsur...@gmail.com wrote: Does anybody have a download link for the QCon talk that is linked from the clojure front page?  I tend to use platforms where Flash support is even worse than normal, whereas mplayer tends to be very good at playing videos on every machine

Re: Apply performance and logging JIT compilation

2009-12-10 Thread Krukow
Doh... -- 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 unsubscribe from this group, send email to

Re: Slides that accompany the Rich's QCon talk

2009-12-10 Thread Krukow
On Dec 11, 12:21 am, Dragan Djuric draga...@gmail.com wrote: HI, I have just watched Rich's QCon talk and in some parts he is referring to the slides that are not displayed in the video. Of, course, the talk is perfectly fine without that, but I need to understand some specific tricky

Apply performance and logging JIT compilation

2009-12-08 Thread Krukow
I am writing a function that has to wrap other code. One simple approach is to do user (defn wrap-fun [f] (fn [ args] (println pre-processing) (let [res (apply f args)] (println post-processing) res))) #'user/wrap-fun user (def w (wrap-fun (fn

Re: Datatypes and protocols - update

2009-12-02 Thread Krukow
Thanks for sharing the insights. /Karl -- 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: Datatypes and protocols - update

2009-12-01 Thread Krukow
On Dec 1, 2:42 am, Rich Hickey richhic...@gmail.com wrote: I have done a lot of work on performance, and refined the design. The big news is that you can now directly implement a protocol inside a deftype, and you can also reify protocols. This cements protocols as the superior way to model

Re: Datatypes and protocols - update

2009-12-01 Thread Krukow
On Dec 1, 10:56 pm, Rich Hickey richhic...@gmail.com wrote: [snip] There are 2 ways to make a deftype reach a protocol. First, you can implement the protocol directly in the deftype/reify, supplying the protocol where you do interfaces, and the methods of the protocol as methods of the type.

Re: problem with resolve

2009-11-24 Thread Krukow
On Nov 24, 12:01 pm, kony kulakow...@gmail.com wrote: Hi, I found that resolve does not work correctly (I guess) when it is called from other thread than main: I guess your new thread also has the root binding for *ns* the current namespace, which apparently is core user= (.start (new

Re: problem with resolve

2009-11-24 Thread Krukow
Three concurrent replies. We'd be better off using locks :-) -- 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

Re: Deep deref

2009-11-24 Thread Krukow
On Nov 14, 5:42 pm, André Thieme splendidl...@googlemail.com wrote: But in real programs things are not so easy. We have refs in refs. This is just a thought experiment. But what about actually having refs in refs? I'm not sure if I am reinventing mutable object here, so please shoot me down

Re: Deep deref

2009-11-24 Thread Krukow
On Nov 24, 7:50 pm, Krukow karl.kru...@gmail.com wrote: On Nov 14, 5:42 pm, André Thieme splendidl...@googlemail.com wrote: But in real programs things are not so easy. We have refs in refs. This is just a thought experiment. But what about actually having refs in refs? I'm not sure if I

Re: problem with resolve

2009-11-24 Thread Krukow
On Nov 24, 9:45 pm, kony kulakow...@gmail.com wrote: On 24 Lis, 18:07, Krukow karl.kru...@gmail.com wrote: Three concurrent replies. We'd be better off using locks :-) Three concurrent replies but each of them brings something new ;) Thank you very much for all of them! ... what

Re: Datatypes and Protocols - early experience program

2009-11-23 Thread Krukow
On Nov 20, 5:24 pm, Rich Hickey richhic...@gmail.com wrote: Yup. The fixed field access to deftypes via keyword literal lookup is the fastest offered by any Clojure data structure. Rich While we are talking performance. Is there a simple way to explain the performance characteristics of

Re: leiningen - a Clojure build tool

2009-11-23 Thread Krukow
:dependencies [[org.clojars.krukow/clojure-1.1.0-alpha-snapshot 75cd05080f7260c54007d7728fb280ae53b56f63]]) I ran deps: krukow:~/Projects/clojure/circuitbreaker$ lein deps [copy] Copying 1 file to /Users/krukow/Projects/clojure/ circuitbreaker/lib krukow:~/Projects/clojure/circuitbreaker$ ls

Re: Datatypes and Protocols - early experience program

2009-11-23 Thread Krukow
On Nov 12, 1:10 pm, Rich Hickey richhic...@gmail.com wrote: An early version of the code for a few important new language features, datatypes[1] and protocols[2] is now available in the 'new' branch[3]. Note also that the build system[4] has builds of the new branch, and that the new branch

Re: Mysterious errors w/ protocols and types

2009-11-23 Thread Krukow
and protocol functions: krukow:~/emacs/clojure/clojure$ rlwrap java -cp clojure-1.1.0-75cd05080f7260c54007d7728fb280ae53b56f63.jar clojure.main Clojure 1.1.0-alpha-SNAPSHOT user= (defprotocol P (foo [x args])) P user= (deftype T [x]) #'user/T user= (extend ::T P {:foo (fn [x args] args)}) nil user= (foo

Re: Datatypes and Protocols - early experience program

2009-11-23 Thread Krukow
On Nov 24, 4:55 am, Allen Rohner aroh...@gmail.com wrote: The first stumbling point I reached is that deftypes provide an automatic implementation for IPersistentMap, but not IFn. I attempted to write (instance key), which exploded, but (key instance) works just fine. My existing code uses

Re: Datatypes and Protocols - early experience program

2009-11-20 Thread Krukow
On Nov 20, 8:51 pm, Chouser chou...@gmail.com wrote: On Thu, Nov 19, 2009 at 12:39 PM, Krukow karl.kru...@gmail.com wrote: [snip] I guess I am just asking if the performance guarantees are those I would expect of Clojure (i.e., too fast ;-)) This is definitely still too fast.  In fact

Re: Datatypes and Protocols - early experience program

2009-11-19 Thread Krukow
On Nov 19, 12:01 am, samppi rbysam...@gmail.com wrote: Question: are the general mechanisms for accessing and setting fields their keywords and assoc respectively:   (deftype Bar [a b c d e])   (def b (Bar 1 2 3 4 5))   (:c b)   (def c (assoc b :e 2)) Does (:c b) and (assoc b :e 2) take

Re: Datatypes and Protocols - early experience program

2009-11-12 Thread Krukow
On Nov 12, 1:10 pm, Rich Hickey richhic...@gmail.com wrote: An early version of the code for a few important new language features, datatypes[1] and protocols[2] is now available in the 'new' branch[3]. Note also that the build system[4] has builds of the new branch, and that the new branch

Re: noob having a tough time with emacs setup

2009-10-10 Thread Krukow
On Oct 10, 7:10 am, Paul Nakata paulnak...@gmail.com wrote: I've tried the ELPA install method and installing with sources from git and get this error. I'm currently set up with everything in ~/src/ and I've pulled everything from git using the directions

Re: swap! and dosync

2009-10-08 Thread Krukow
On Oct 8, 3:43 am, Timothy Pratley timothyprat...@gmail.com wrote: Atoms can't do this, as they are synchronous (called and returned immediately) - hence the warning about potentially being called multiple times. The reason that swap! may fail is that it is performing a compare- and-swap

Re: Citing clojure

2009-10-01 Thread Krukow
On Oct 1, 10:17 pm, John Harrop jharrop...@gmail.com wrote: @conference{hickey2008clojure,  title={{The Clojure programming language}},  author={Hickey, R.},  booktitle={Proceedings of the 2008 symposium on Dynamic languages},  year={2008},  organization={ACM New York, NY, USA} }

Re: java/scala oneliner

2009-09-18 Thread Krukow
On Sep 18, 6:24 am, Wilson MacGyver wmacgy...@gmail.com wrote: Hmmm, your solution produces nils in REPL. user= (map #(printf Happy Birthday %s\n (if (= 2 %) Dear XXX To You)) (range 4)) (Happy Birthday To You Happy Birthday To You nil Happy Birthday Dear XXX nil Happy Birthday To You

Re: Ensure and STM: find the bug...

2009-09-16 Thread Krukow
On Sep 16, 11:15 am, Christophe Grand christo...@cgrand.net wrote: I think you managed to produce a deadlock :-( thread 1 is commiting and has a write lock on a1 thread 2 is commiting and has a write lock on a2 thread1 tries to acquire a read lock on a2 (in the validator) and blocks

Re: Ensure and STM: find the bug...

2009-09-16 Thread Krukow
On Sep 16, 10:06 pm, Rich Hickey richhic...@gmail.com wrote: On Sep 16, 11:39 am, Stuart Halloway stuart.hallo...@gmail.com wrote: The docs could be more clear, but if validate-fn must be side effect   free then it certainly can't look at any other refs. Yes. The docs should say the

Re: Is knowing Java a prerequisite for using Clojure?

2009-09-16 Thread Krukow
On Sep 17, 4:46 am, Hugh Aguilar hugoagui...@rosycrew.com wrote: Greetings. I am interested in Clojure and will be reading the mailing list to find out what you folks are up to. My concern right now is that I don't know Java. Is this a prerequisite for learning Clojure? Can I program in

Ensure and STM: find the bug...

2009-09-15 Thread Krukow
After a discussion in dcug about the write-skew anomaly, I wanted to write a program exhibiting the anomaly, together with a similar program using ensure to eliminate it. My program doesn't work: it exhibits the anomaly, but ensure doesn't fix it, and neither does adding a validator to the refs.

Re: Ensure and STM: find the bug...

2009-09-15 Thread Krukow
On Sep 15, 10:23 pm, Mark Volkmann r.mark.volkm...@gmail.com wrote: I think the problem is that you only ensure one of the Refs. If you want to make sure that a condition between multiple Refs isn't violated, you need to sure all of them. Otherwise other transactions will be free to modify

Re: Ensure and STM: find the bug...

2009-09-15 Thread Krukow
On Sep 16, 12:32 am, Timothy Pratley timothyprat...@gmail.com wrote: I ran program #1 and #2 on Clojure 1.1.0-alpha-SNAPSHOT from git - program #1 output skew - program #2 no output What version are you using? Could be something that's been fixed recently. I was running a fairly recent,

STM implementation questions

2009-09-05 Thread Krukow
I am digging somewhat into Clojure internals for a talk I'm doing. Now I've reached the LockingTransaction class, and have a few questions, I hope someone can answer. In some of the Clojure presentations it says that Readers never impede writers/readers, writers never impede readers. What does

Re: STM implementation questions

2009-09-05 Thread Krukow
On Sep 5, 8:18 pm, Rich Hickey richhic...@gmail.com wrote: Given sufficient history, readers will not be retried due to the activity of writers. It is true that while history is being dynamically acquired there may be retries. Unless you have some pathological transaction relationships,

Re: STM implementation questions

2009-09-05 Thread Krukow
On Sep 5, 6:55 pm, Mark Volkmann r.mark.volkm...@gmail.com wrote: I have lots of detail on this in my article athttp://ociweb.com/mark/stm/article.html. Yes, it's bookmarked in the TO READ group :-) I just want to be precise in my presentation. I'd say it means block as in wait until the

Fixing production systems on-the-fly

2009-09-04 Thread Krukow
I was thinking about the capability of changing production systems on the fly. E.g. by having an accessible repl in a running production system. If you have a bug in a function, you can fix it by re-def'ing it - that is great. However, suppose you want to do a system upgrade where you want to

Re: Fixing production systems on-the-fly

2009-09-04 Thread Krukow
On Sep 4, 1:38 pm, Christophe Grand christo...@cgrand.net wrote: You have to be prepared to deal with potential inconsistencies: a closure (or any object) can hold a reference to the value of a function. OK - I realized this already for running threads, e.g., executing a function where a var

Re: Filter Causing StackOverflowError?

2009-09-03 Thread Krukow
On Sep 2, 7:02 pm, tmountain tinymount...@gmail.com wrote: (defn generate-chain [source]   (loop [the-list (map #(list (first (split-at 2 %)) (last %))                       (partition 3 1 (.split (.replace source \n ) )))          res (hash-map)]     (if (empty? the-list)       res  

Re: Is there a cleaner way to filter a map?

2009-09-02 Thread Krukow
On Sep 2, 5:02 pm, Krukow karl.kru...@gmail.com wrote: Or if you like point-free style (into {}    (filter (comp even? second)             {:dog 5 :cat 4 :mouse 7 :cow 6})) = {:cat 4, :cow 6} Saving a few chars, and perhaps more readable: user (into {} (filter (comp even

Re: Is there a cleaner way to filter a map?

2009-09-02 Thread Krukow
On Sep 2, 1:44 am, Richard Newman holyg...@gmail.com wrote: Conrad,    (into {}      (filter (fn [[key val]]                (even? val))      {:dog 5 :cat 4 :mouse 7 :cow 6}))    =    {:cat 4, :cow 6} Or if you like point-free style (into {} (filter (comp even? second)

A better flatten

2009-09-02 Thread Krukow
Hello, At some point I needed at flatten function taking a list of atomic elements or nested lists, and producting a flat list of only atomic elements (in the same order). It should be lazy. This is what I came up with. Can anyone see a more elegant solution (I feel I am working low-level

Re: A better flatten

2009-09-02 Thread Krukow
On Sep 3, 1:13 am, Sudish Joseph sud...@gmail.com wrote: The other solutions seem higher level, but it's worth noting that destructuring -- (let [[x xs] lst] ...) -- uses next and is therefore not fully lazy in that you will peek ahead by one into the lazy sequence, so to speak.  You have

Re: Two possible additions: non-reflective classobject calls support for map-conj on arrays

2009-09-01 Thread Krukow
On Sep 1, 11:10 am, Lauri Pesonen lauri.peso...@iki.fi wrote: snip I just wanted to point out that the Java Properties class inherits Hashtable which is already (into) compatible, i.e. user (let [props (. System getProperties)]         ((into {} props) os.arch)) x86 Ok. That is certainly

Two possible additions: non-reflective classobject calls support for map-conj on arrays

2009-08-31 Thread Krukow
I have two minor minor suggestions for Clojure changes. 1) Consider this function: user (set! *warn-on-reflection* true) true user (defn reader-from-classpath [s] (- (.getResourceAsStream java.lang.String s) (java.io.InputStreamReader.) (java.io.BufferedReader.))) Reflection

Re: How to represents a Big text file using sequence?

2009-08-31 Thread Krukow
On Aug 31, 4:44 pm, wangzx wangzaixi...@gmail.com wrote: Is there other APIs like the Sequence but provide stream-like API? You can try this, which I've used on short files recently: (defn #^Class class-identity [#^Class c] c) (defn #^java.io.BufferedReader reader-from-classpath [#^String s]

Danish Clojure meetups + JAOO 2009 Clojure workshop

2009-08-20 Thread Krukow
Dates are now final for the Copenhagen and Aarhus Clojure meetings. Trifork and Azul Systems are sponsoring the events: Trifork provides a room, some drinks and sandwiches, and Azul is letting us run Clojure on one of their large boxes (864 cores, loads of RAM ;-). I will be trying to reproduce

  1   2   >