Enjoying test-is

2009-03-11 Thread mikel
I just wanted to say thanks to Stuart Sierra for test-is. When I start using some new compiler, there always comes a point, if I keep it up long enough, that I get annoyed with my little ad hoc tests and want some sort of testing framework to make things easier. test-is does the job. Thanks,

Re: Debugging support for clojure?

2009-03-11 Thread Tassilo Horn
Joshua jhaw...@gmail.com writes: Hi Joshua, The eclipse plugin also provides some debugging support. Ok, so Eclipse IntelliJ support debugging. Does SLIME do, too? Bye, Tassilo --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Static type guy trying to convert

2009-03-11 Thread mikel
On Mar 10, 11:44 pm, e evier...@gmail.com wrote: On Wed, Mar 11, 2009 at 12:26 AM, Raffael Cavallaro raffaelcavall...@gmail.com wrote: [...comments on Harrop's marketing tactics...] h, that could sound like more of an endorsement than anything he could have said, himself!  

Re: Debugging support for clojure?

2009-03-11 Thread Tassilo Horn
Phil Hagelberg p...@hagelb.org writes: Hi Phil, If not, is there better way than inserting gazillions of printlns to check why and where a function doesn't do the right thing? Most definitely! Break your functions up into smaller pieces, then write tests for them using test-is. If your

Re: transposing a small java class in clojure

2009-03-11 Thread rb
On Mar 10, 8:24 pm, Kevin Downey redc...@gmail.com wrote: I don't know how many arguments the method you are overriding with onLogin takes, but the function you define should take one more argument then the method you are overiding, the first argument being an explicit reference to an

Re: filter1 interesting?

2009-03-11 Thread Vagif Verdi
Is (first (filter ..) lazy like in haskell ? I would hate to wait for filter to get all results just to throw them out and pick the first one. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: filter1 interesting?

2009-03-11 Thread Christian Vest Hansen
On Wed, Mar 11, 2009 at 9:01 AM, Vagif Verdi vagif.ve...@gmail.com wrote: Is (first (filter ..) lazy like in haskell ? Yes. I would hate to wait for filter to get all results just to throw them out and pick the first one. -- Venlig hilsen / Kind regards, Christian Vest Hansen.

Re: filter1 interesting?

2009-03-11 Thread Laurent PETIT
filter is lazy. first is not 3/11 Vagif Verdi vagif.ve...@gmail.com Is (first (filter ..) lazy like in haskell ? I would hate to wait for filter to get all results just to throw them out and pick the first one. --~--~-~--~~~---~--~~ You received this

Witch Emcas for Windows to use with Clojure

2009-03-11 Thread anderspe
Hi! I thinking of test to use Emacs for Clojure development, but under Windows i have found 2 diffrent XEmacs or Gnu Emacs what is the recommendation, to use... ?!! Or is it just a matter of tast.. // Anders --~--~-~--~~~---~--~~ You received this message

Re: Witch Emcas for Windows to use with Clojure

2009-03-11 Thread Paul Drummond
Not sure about XEmacs vs Gnu Emacs but for GNU Emacs there are some options. By far the best option when starting out is ClojureBox: http://clojure.bighugh.com/ It's a one-click installer to get you started. It includes everything you need to develop in Clojure with Emacs including Slime. If

Re: Witch Emcas for Windows to use with Clojure

2009-03-11 Thread anderspe
Thanks, will test this. // Anders On 11 Mar, 12:00, Paul Drummond paul.drumm...@iode.co.uk wrote: Not sure about XEmacs vs Gnu Emacs but for GNU Emacs there are some options.  By far the best option when starting out is ClojureBox: http://clojure.bighugh.com/ It's a one-click installer to

Re: Witch Emcas for Windows to use with Clojure

2009-03-11 Thread Marko Kocić
Or you can compile emacs from CVS for yourself. It's not that hard as it used do be. --~--~-~--~~~---~--~~ 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 To

Re: Debugging support for clojure?

2009-03-11 Thread Jeffrey Straszheim
Probably. The Java BigInteger classes are not particularly fast, and do not seem to be a priority to Sun. Therefore Clojure is not competitive on large integer algorithms. On Wed, Mar 11, 2009 at 2:21 AM, Tassilo Horn tass...@member.fsf.orgwrote: Phil Hagelberg p...@hagelb.org writes: Hi

design patterns for event driven applications

2009-03-11 Thread Anatoly Yakovenko
I just starting playing around with clojure, and i know nothing of java beyond the syntax. I am trying to implement an interface that gets called by some 3rd party application whenver an event occurs. If i was doing this in haskell I would serialize the events in a channel and write a parser to

Re: Static type guy trying to convert

2009-03-11 Thread Laurent PETIT
2009/3/11 mikel mev...@mac.com Saying that something sucks and suggesting that people who like it are fools isn't an argument, it's just yanking people's chains to get attention. Are you talking about Linus's speak against cvs, subversion and their users ? :-) ok, this was just a joke,

Re: Enjoying test-is

2009-03-11 Thread stephaner
I use test-is too, this is a very usefull test framework. The framework is very easy to use and provide nice output when tests fail. Since I'm still learning Clojure, I do enjoy using the actual versus expected output of a failed test. Thanks again Mr. Sierra,

Re: Static type guy trying to convert

2009-03-11 Thread Jon Harrop
On Wednesday 11 March 2009 04:44:17 e wrote: ...Afterall he could have chosen a dynamically typed language for his business if he had wanted to... FWIW, my company ships products written in many different languages including dynamic languages and I have been programming in dynamic languages

Re: Static type guy trying to convert

2009-03-11 Thread Konrad Hinsen
On Mar 11, 2009, at 3:31, Jon Harrop wrote: Most of the reasons given in this thread were red herrings and many of static typing's real issues were not even touched upon: ... I'd add two more: - Metaprogramming is a lot more complicated with static typing. Look at MetaOCaml or

cells/add-watch question

2009-03-11 Thread linh
I have a question about cells. I'm not sure how to explain my problem so maybe the easiest way is to show some code. Let's say I have this piece of code: (def my-atom (atom {... big map with many entries ...})) . (add-watch my-atom :update update-fn) . (swap! my-atom (some-fn ...)) When

Re: Static type guy trying to convert

2009-03-11 Thread Cosmin Stejerean
On Tue, Mar 10, 2009 at 9:31 PM, Jon Harrop j...@ffconsultancy.com wrote: [...] 2. The whole thing does not need to be complete or even functional for you to start unit testing. Apples and oranges: unit tests are not the same between dynamic and static code bases because dynamic code

Re: design patterns for event driven applications

2009-03-11 Thread Jeffrey Straszheim
It is impossible to give a simple answer. You need to be more specific about the needs of your application. Will it need to be concurrent, for instance? On Tue, Mar 10, 2009 at 7:49 PM, Anatoly Yakovenko aeyakove...@gmail.comwrote: I just starting playing around with clojure, and i know

Re: Static type guy trying to convert

2009-03-11 Thread Jay Fields
On Tue, Mar 10, 2009 at 11:44 PM, e evier...@gmail.com wrote: My interest right now in following clojure is to learn ALL the arguments, including his. The problems with Jon's criticisms is that they are the same fear, uncertainty and doubt ideas that are repeated time and time again by

Request: Can clojure.contrib.walk provide a reduce type operation?

2009-03-11 Thread Jeffrey Straszheim
Currently the clojure.contrib.walk code provides a nice way to perform a depth first map operation on trees. However, I need to fold across a tree. It would be nice if walk provided this. --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: What profilers are you using?

2009-03-11 Thread pmf
On Mar 11, 4:41 am, Allen Rohner aroh...@gmail.com wrote: Replying to my own question because I figured it out. On the profiler tab, before you hit start profiling, click the settings checkbox. Edit the start from class field. Mine was set to jline.**. After changing it to the appropriate

Re: On the importance of recognizing and using maps

2009-03-11 Thread Konrad Hinsen
On Mar 8, 2009, at 18:53, Rich Hickey wrote: I know people usually think of collections when they see vector/map/ set, and they think classes and types define something else. However, the vast majority of class and type instances in various languages are actually maps, and what the

Re: Static type guy trying to convert

2009-03-11 Thread Jon Harrop
On Wednesday 11 March 2009 15:05:39 Konrad Hinsen wrote: On Mar 11, 2009, at 3:31, Jon Harrop wrote: Most of the reasons given in this thread were red herrings and many of static typing's real issues were not even touched upon: ... I'd add two more: - Metaprogramming is a lot more

Re: cells/add-watch question

2009-03-11 Thread Raffael Cavallaro
On Mar 11, 11:20 am, linh nguyenlinh.m...@gmail.com wrote: According to the API doc, add-watch must have 4 args: a key, a reference, its old-state and its new state. What I'm missing here is an addtional arg that can be passed in some way to update-fn so that update-fn knows what entries

Re: cells/add-watch question

2009-03-11 Thread Raffael Cavallaro
On Mar 11, 1:24 pm, Raffael Cavallaro raffaelcavall...@gmail.com wrote: ;; this just makes a big map atom where integer keys are associated with integer values should rather be as follows to get integer keyword keys: (def my-atom (atom (assoc (apply hash-map

Re: On the importance of recognizing and using maps

2009-03-11 Thread Cosmin Stejerean
On Wed, Mar 11, 2009 at 12:00 PM, Konrad Hinsen konrad.hin...@laposte.netwrote: On Mar 8, 2009, at 18:53, Rich Hickey wrote: I know people usually think of collections when they see vector/map/ set, and they think classes and types define something else. However, the vast majority of

Re: Static type guy trying to convert

2009-03-11 Thread Jon Harrop
On Wednesday 11 March 2009 15:30:01 Cosmin Stejerean wrote: Actually it happens a lot in real code and in many non-trivial programs in static typed languages you end up with a proliferation of types that are simply there to make the compiler happy. To me it happens very often where I know

Re: Debugging support for clojure?

2009-03-11 Thread Howard Lewis Ship
Just updated, working like a charm. On Tue, Mar 10, 2009 at 5:17 PM, CuppoJava patrickli_2...@hotmail.com wrote: Have you updated to the latest version? If it's setup properly, you should be able to set breakpoints by clicking on the grey column on the left side of your code. Also, not

Re: What profilers are you using?

2009-03-11 Thread Allen Rohner
pmf wrote: On Mar 11, 4:41 am, Allen Rohner aroh...@gmail.com wrote: Replying to my own question because I figured it out. On the profiler tab, before you hit start profiling, click the settings checkbox. Edit the start from class field. Mine was set to jline.**. After changing it to

Re: Static type guy trying to convert

2009-03-11 Thread Raoul Duke
Another red herring: you are describing a disadvantage of nominal over structural typing. Not dynamic vs static typing. there are probably several different arguments being conflated in such discussions. for example, theory vs. practice: there is the theory of what in fact are the options

Re: android app development with clojure

2009-03-11 Thread rob
Hi Remco, If you've written up anything, or plan to, on your progress on getting Clojure going on the Android platform I'm very interested in learning more. Thanks! Rob On Feb 6, 12:29 pm, Remco van 't Veer rwvtv...@gmail.com wrote: Got startup time down to 5 seconds by completely eliminating

Re: android app development with clojure

2009-03-11 Thread rob
That is exciting! Have you posted any code or advice/instruction on how one could repeat what you did with Clojure on the Android phone? Rob On Feb 6, 12:29 pm, Remco van 't Veer rwvtv...@gmail.com wrote: Got startup time down to 5 seconds by completely eliminating the use of lispreader and

Re: cells/add-watch question

2009-03-11 Thread linh
Thanks Raffael, I'll try that On Mar 11, 6:42 pm, Raffael Cavallaro raffaelcavall...@gmail.com wrote: On Mar 11, 1:24 pm, Raffael Cavallaro raffaelcavall...@gmail.com wrote: ;; this just makes a big map atom where integer keys are associated with integer values should rather be as

Re: What is Clojure NOT good for?

2009-03-11 Thread Howard Lewis Ship
I ran into a bit of the but we can hire Java coders mentality when I presented Clojure at a local JUG. Due to time constraints, I didn't get into it at the time, but my basic thought is: I don't care what you know, I care what you can learn! Also, there's the myth of the immediately productive

keys of struct-maps

2009-03-11 Thread jim
Is there a more efficient way of getting the keys of a struct-map besides creating an instance and passing it to keys: (def ts (create-struct :a :b)) (keys (struct ts)) (:a :b) Thanks, Jim --~--~-~--~~~---~--~~ You received this message because you are

Re: Static type guy trying to convert

2009-03-11 Thread Jon Harrop
On Wednesday 11 March 2009 18:18:59 Raoul Duke wrote: Another red herring: you are describing a disadvantage of nominal over structural typing. Not dynamic vs static typing. there are probably several different arguments being conflated in such discussions. for example, theory vs.

Re: Static type guy trying to convert

2009-03-11 Thread Cosmin Stejerean
On Wed, Mar 11, 2009 at 1:03 PM, Jon Harrop j...@ffconsultancy.com wrote: On Wednesday 11 March 2009 15:30:01 Cosmin Stejerean wrote: Actually it happens a lot in real code and in many non-trivial programs in static typed languages you end up with a proliferation of types that are simply

Re: Request: Can clojure.contrib.walk provide a reduce type operation?

2009-03-11 Thread Kevin Downey
if your walk pushes the items into a Queue, you can just reduce across the Queue On Wed, Mar 11, 2009 at 9:24 AM, Jeffrey Straszheim straszheimjeff...@gmail.com wrote: Currently the clojure.contrib.walk code provides a nice way to perform a depth first map operation on trees.  However, I need

Re: Request: Can clojure.contrib.walk provide a reduce type operation?

2009-03-11 Thread Jeffrey Straszheim
Yeah, I figured something like that out, but it was non-obvious. It might be nice helper function sometime down the road. On Wed, Mar 11, 2009 at 3:49 PM, Kevin Downey redc...@gmail.com wrote: if your walk pushes the items into a Queue, you can just reduce across the Queue On Wed, Mar 11,

Re: Static type guy trying to convert

2009-03-11 Thread Jon Harrop
On Wednesday 11 March 2009 18:35:46 Cosmin Stejerean wrote: On Wed, Mar 11, 2009 at 1:03 PM, Jon Harrop j...@ffconsultancy.com wrote: Another red herring: you are describing a disadvantage of nominal over structural typing. Not dynamic vs static typing. You are correct, my apologies. I

Re: Static type guy trying to convert

2009-03-11 Thread ntu...@googlemail.com
On Mar 11, 5:26 am, Raffael Cavallaro raffaelcavall...@gmail.com wrote: Some of you may not know of Jon's behvior on comp.lang.lisp so some background will be useful here. I would appreciate it if you would consider his arguments instead of discrediting him. His post is not insulting and

Re: Dotted method invocations (and other reader niceties) do not work in #= forms

2009-03-11 Thread Chas Emerick
Replying to my own (old) post -- the reason why all reader capabilities aren't available in #= forms is that the reader isn't currently being recursively applied to the body of those forms. Only certain aspects of the full reader's functionality (like dotted constructor invocations) are being

Re: Static type guy trying to convert

2009-03-11 Thread chris
I don't think it is impossible to begin adding type inference and stronger typing to clojure or any fully dynamic language. You could begin with a set of runtime tests (such as range of a given number or what keys are in a dictionary). These tests allow you to go from an untyped world to a

Re: Static type guy trying to convert

2009-03-11 Thread Jon Harrop
On Wednesday 11 March 2009 20:27:15 chris wrote: Lets take this discussion forward and think of how we could incrementally add the important benefits of strongly typed and inferred systems like ML, Haskell, and F# to Clojure while keeping the very beautiful and clean syntax and minimal mental

Re: Static type guy trying to convert

2009-03-11 Thread Raffael Cavallaro
On Mar 11, 4:17 pm, ntu...@googlemail.com ntu...@googlemail.com wrote: I would appreciate it if you would consider his arguments instead of discrediting him. His post is not insulting and contains valid arguments. So please don't shoot the messenger. When the messenger is habitually

Re: Static type guy trying to convert

2009-03-11 Thread Joshua
You can get those warm fuzzies back when you develop in an IDE such as Netbeans, IntelliJ, or Eclipse. They can compile the code and provide some feedback. The plugins are kinda young, but they may provide enough to help make the jump. Joshua On Mar 10, 1:16 am, zoltar

Re: keys of struct-maps

2009-03-11 Thread Timothy Pratley
They are not currently exposed, but a trivial patch will achieve what you want: http://groups.google.com/group/clojure/web/struct.patch user= (defstruct ts :a :b) #'user/ts user= (struct-keys ts) (:a :b) Regards, Tim. On Mar 12, 5:23 am, jim jim.d...@gmail.com wrote: Is there a more

Re: Request: Can clojure.contrib.walk provide a reduce type operation?

2009-03-11 Thread Stuart Sierra
On Mar 11, 12:24 pm, Jeffrey Straszheim straszheimjeff...@gmail.com wrote: Currently the clojure.contrib.walk code provides a nice way to perform a depth first map operation on trees. However, I need to fold across a tree. It would be nice if walk provided this. Hi Jeffrey, I agree it would

Re: cells/add-watch question

2009-03-11 Thread Timothy Pratley
This is beacuse my-atom contains a lot of data and I don't want to search for the change. Just curious, but shouldn't equality tests in Clojure always be instant regardless of data size due to shared structure? I suppose I'm curious what 'shared structure' gives and what it doesn't.

Re: Enjoying test-is

2009-03-11 Thread Stuart Sierra
On Mar 11, 2:45 am, mikel mev...@mac.com wrote: I just wanted to say thanks to Stuart Sierra for test-is. On Mar 11, 9:15 am, stephaner stepha...@gmail.com wrote: I use test-is too, this is a very usefull test framework. You're both very welcome! -Stuart Sierra

Re: filter1 interesting?

2009-03-11 Thread Stuart Sierra
On Wed, Mar 11, 2009 at 9:01 AM, Vagif Verdi vagif.ve...@gmail.com wrote: Is (first (filter ..) lazy like in haskell ? It's lazy in the sense that it will only consume the sequence up to first positive result. If it doesn't find one, it will consume the entire sequence and return nil.

Re: What is Clojure NOT good for?

2009-03-11 Thread Stuart Sierra
Ok, here's a real one: if you need to use a lot of C/C++ libraries, for which there are no Java replacements, Clojure won't be much fun, because C/C++ interop with Java is not fun. You'll probably be happier with a Lisp/Scheme implementation that compiles to C; several such languages exist.

Re: On the importance of recognizing and using maps

2009-03-11 Thread Chouser
On Wed, Mar 11, 2009 at 1:54 PM, Cosmin Stejerean cstejer...@gmail.com wrote: IMHO a big reason Python programmers don't typically treat objects like is maps/dictionaries is that the set of things found in the map (dictionary) for that object (__dict__) are just a small subset of the

Re: design patterns for event driven applications

2009-03-11 Thread CuppoJava
Hi Anatoly, Unfortunately I don't know of a nice way of expressing an event-driven architecture in Clojure, but I'm very interested in what you said about accomplishing it in Haskell. Would you mind explaining that in some more detail? Perhaps if I understood it, I can even help come up with a

Is Clojure's lack of support for forward referencing a feature or a bug?

2009-03-11 Thread quasar
It seems it makes Clojure source code to be in the order of lowest-to- highest abstraction. Naive mutual recursion based on top-level functions is impossible. I am curious, is it due to the current implementaiton of Reader or by design? Best regards, Leonid

Re: Debugging support for clojure?

2009-03-11 Thread Jerry K
Also, I've not looked at any of the math code in clojure contrib, but expressed as such, I wouldn't expect the idiom (mod (expt n exp) m) to be at all fast for reasons largely independent of the numeric implementation underneath. Computing the entire power and then reducing it modulo m is going

Another cells library

2009-03-11 Thread Jeffrey Straszheim
I've put together another cells-like library. Mine differs from the others in that it uses ref's and transactions, allowing global integrity checks, rollbacks, and other features that the agent based cells systems do not have. It can be found at:

Re: Is Clojure's lack of support for forward referencing a feature or a bug?

2009-03-11 Thread pmf
On Mar 11, 4:23 pm, quasar quasistellarli...@gmail.com wrote: It seems it makes Clojure source code to be in the order of lowest-to- highest abstraction. Naive mutual recursion based on top-level functions is impossible. I am curious, is it due to the current implementaiton of Reader or by

Re: Is Clojure's lack of support for forward referencing a feature or a bug?

2009-03-11 Thread Timothy Pratley
Clojure does support forward referencing (if I understand your question): user= (declare a) user= (defn b [x] (a x)) user= (defn a [x] (b x)) user= (a 4) java.lang.StackOverflowError Note: (declare a) is a synonym for (def a) which works also. It is also quite trivial to patch the compiler to

Re: Static type guy trying to convert

2009-03-11 Thread Jon Harrop
On Thursday 12 March 2009 00:01:43 James Reeves wrote: On Mar 11, 2:31 am, Jon Harrop j...@ffconsultancy.com wrote: 2. The whole thing does not need to be complete or even functional for you to start unit testing. Apples and oranges: unit tests are not the same between dynamic and

Re: Static type guy trying to convert

2009-03-11 Thread Raoul Duke
On the other hand, I do seem to get less bugs than with Ruby, so perhaps immutability is a more significant factor than static typing when it comes to creating robust applications. in a way, i can totally believe that, and it sounds really good, even if it isn't true :-) i mean, one of the

Re: On the importance of recognizing and using maps

2009-03-11 Thread Cosmin Stejerean
On Wed, Mar 11, 2009 at 5:34 PM, Chouser chou...@gmail.com wrote: [...] Defining a instance method for a Python class allows you to connect some code to your data, which internally uses a type pointer from the instance to the class. In Clojure you can put functions directly in the metadata

Re: What is Clojure NOT good for?

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

Re: keys of struct-maps

2009-03-11 Thread jim
Thanks. I found a way to accomplish what I needed, but I'll tuck that patch in my back pocket for later. Jim On Mar 11, 5:07 pm, Timothy Pratley timothyprat...@gmail.com wrote: They are not currently exposed, but a trivial patch will achieve what you

Re: Static type guy trying to convert

2009-03-11 Thread Jon Harrop
On Thursday 12 March 2009 00:28:06 Raoul Duke wrote: i mean, one of the major benefits, i think, of immutability is that you are in so many ways actually reducing the cognitive load that you are under when running mental simulations of your program -- which is a crucial part of being a

Question about throwing errors

2009-03-11 Thread Mark Engelberg
I'm thinking about implementing a backtracking mechanism that throws errors as a way to escape out of the current computation and try another possibility. I'd want to create a specific error to escape, and the backtracking mechanism should only catch this very specific error. Now, I vaguely

Re: Static type guy trying to convert

2009-03-11 Thread Mark Engelberg
I know of someone who tracked all his bugs in a year of coding in both Scheme (dynamic) and ML (static). He said that there was no real difference. The kind of bugs that are caught by static type systems are also quickly identified upon an initial run with a few basic test cases in a dynamic

Re: Question about throwing errors

2009-03-11 Thread David Nolen
Doesn't error-kit do this? On Wed, Mar 11, 2009 at 10:15 PM, Mark Engelberg mark.engelb...@gmail.comwrote: I'm thinking about implementing a backtracking mechanism that throws errors as a way to escape out of the current computation and try another possibility. I'd want to create a specific

Re: Static type guy trying to convert

2009-03-11 Thread James Reeves
On Mar 12, 12:26 am, Jon Harrop j...@ffconsultancy.com wrote: On Thursday 12 March 2009 00:01:43 James Reeves wrote: This doesn't have to be the case. There is nothing inherently magical about a types that makes them more concise to define than a unit test. Type inference: you don't write

Re: Static type guy trying to convert

2009-03-11 Thread e
This is a nice post . . . would the partially static typing come from the IDE? That seems like the trend right now, but then you gotta get a good IDE, and no two would ever be the same, which I think is controversial. On Wed, Mar 11, 2009 at 4:27 PM, chris cnuern...@gmail.com wrote: I don't

Re: Clojure plugin for IntelliJ IDEA published

2009-03-11 Thread Ilya Sergey
Hi Mike. What are you talking about assume compilation of Clojure classes. For this we have to implement first some script, which will compile some of your files. You're first who asked for such functionality and this is really cool. So, we're going to implement it in near-term future. It seems

Re: Static type guy trying to convert

2009-03-11 Thread e
A while ago, I did some brute force tests on a simple stack-based language to get some testable metrics on how many unit tests you need to guarantee correctness. With a language of 7 instructions and a maximum program size of 8 instructions, there are about 6.7 million program permutations.

Bug in set?

2009-03-11 Thread Raffael Cavallaro
user= (use 'clojure.set) nil user= (set (list [:a 1] [:b 2])) #{[:b 2] [:a 1]} user= (set (list [:a 1] [:b 2] [:c 3])) #{[:b 2] [:c 3] [:a 1]} user= (difference *1 *2) #{[:c 3]} user= (difference (set (list [:a 1] [:b 2])) (set (list [:a 1] [:b 2] [:c 3]))) #{} Is this a bug or am I just not

Re: What is Clojure NOT good for?

2009-03-11 Thread e
On Wed, Mar 11, 2009 at 6:28 PM, Stuart Sierra the.stuart.sie...@gmail.comwrote: Ok, here's a real one: if you need to use a lot of C/C++ libraries, for which there are no Java replacements, Clojure won't be much fun, because C/C++ interop with Java is not fun. You'll probably be happier

Re: Bug in set?

2009-03-11 Thread Stephen C. Gilardi
On Mar 11, 2009, at 11:11 PM, Raffael Cavallaro wrote: user= (use 'clojure.set) nil user= (set (list [:a 1] [:b 2])) #{[:b 2] [:a 1]} user= (set (list [:a 1] [:b 2] [:c 3])) #{[:b 2] [:c 3] [:a 1]} user= (difference *1 *2) #{[:c 3]} user= (difference (set (list [:a 1] [:b 2])) (set (list [:a

Re: Workflow poll?

2009-03-11 Thread Shawn Hoover
On Sat, Mar 7, 2009 at 4:53 PM, Mark Engelberg mark.engelb...@gmail.comwrote: I've been using the Clojure-in-a-box setup for Windows, which was absolutely instrumental in getting me to try out Clojure. But if I keep downloading the latest versions of Clojure, it drifts out of sync with the

Re: Bug in set?

2009-03-11 Thread Raffael Cavallaro
On Mar 11, 11:43 pm, Stephen C. Gilardi squee...@mac.com wrote: Here are the expressions and results in a simplified notation: #{a b c} - #{a b} = #{c} #{a b} - #{a b c} = #{} ok, so I was misunderstanding how difference works. I thought both would evaluate to #{c}. thanks

Re: version of - short-circuiting on nil

2009-03-11 Thread rzeze...@gmail.com
Not that I have any immediate use for this at the moment, but I +1 your proposal. I make use of the ?. operating in Groovy, and it can be helpful. On Mar 10, 4:08 am, Laurent PETIT laurent.pe...@gmail.com wrote: Hello, 2009/3/10 Jason Wolfe jawo...@berkeley.edu (let [person

Re: cells/add-watch question

2009-03-11 Thread Timothy Pratley
And equality time does depend on the size of the data structure too it seems: user= (def v (doall (range 1000))) user= (def v2 (doall (range 1000))) user= (time (= v2 v)) Elapsed time: 2.772923 msecs user= (def v (doall (range 10))) user= (def v2 (doall (range 10))) user= (time (= v2 v))