Re: bounded memoize

2010-03-10 Thread Steve Purcell
On 9 Mar 2010, at 23:22, Michał Marczyk wrote: In the way of early feedback -- that's looks super neat! I've got this instant feeling that this would be a great clojure.contrib.memoize. +1 That would be wonderful. -- You received this message because you are subscribed to the Google Groups

Re: bounded memoize

2010-03-10 Thread Laurent PETIT
2010/3/10 Steve Purcell st...@sanityinc.com: On 9 Mar 2010, at 23:22, Michał Marczyk wrote: In the way of early feedback -- that's looks super neat! I've got this instant feeling that this would be a great clojure.contrib.memoize. +1 That would be wonderful. Well, in the way of early

Re: clojure.core/compare and persistent lists

2010-03-10 Thread Timothy Pratley
On 10 March 2010 02:19, K. kotot...@gmail.com wrote: How should I compare two persistent lists ? Is it acceptable for you to use '=' user= (= '(1 2) '(3 4)) false user= (= '(1 2) '(1 2)) true or do you really really need the +1 0 -1 behavior? Is there any problem with ISeq requiring compareTo?

Re: recursive call boxing primitives?

2010-03-10 Thread John Lawrence Aspden
Oops, sorry, I thought my post was stuck in the moderation queue and have only just noticed the replies while browsing through the list history! Thanks to everyone who replied. Your version looks to be about six times faster than mine was. Thanks ever so much! In fact I wouldn't have noticed the

Re: What's an idiomatic translation of this CL data structure?

2010-03-10 Thread Per Vognsen
CL's defparameter corresponds to plain def. There is a level of structure you are not representing: alternatives. Here is what I'd use: :sentence [[:noun-phrase :verb-phrase]] ... :article [the a] ... The string literals are the implicit terminals and are thus easy to distinguish. An article

REPL, refs and casting

2010-03-10 Thread Mike Erickson
I am seeing a difference in running the contents of a function vs. running the function by name in a REPL. I am writing a simple blackjack game in Clojure, and have a ref called 'cards' for representing the state of the game. I initialize it this way: user (dosync (alter cards assoc     :deck

Re: Visual Studio plugin

2010-03-10 Thread Eric Thorsen
It does it matter to me how it gets written (C# or ClojureCLR) The desire is to have a plugin that supports syntax highlighting, completion, debugging, etc. but what I really am looking for is something that can manage repl(s) that can load the libraries for a given solution or set of projects

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-10 Thread evins.mi...@gmail.com
On Mar 4, 7:33 am, Jan Rychter j...@rychter.com wrote: I haven't hacked on new Clojure stuff for the past two months or so. Now, having updated my repositories, I find that everybody just dropped ant and moved to leiningen. I tried to make sense of things, but can't. I must be missing

collections within collections

2010-03-10 Thread Glen Rubin
I am working on the following problem: Find the only Pythagorean triplet, {a, b, c}, for which a + b + c = 1000 My strategy is to produce a series of triplets of a^2 + b^2 and then filter out the ones where the c^2 is a perfect square, in order to determine Pythagorean triplets. I wrote a

difficulty with becoming a contributor

2010-03-10 Thread John R. Williams
I have some patches I'd like to submit, but I'm having trouble with the submission process. I've sent in a CA, and my name is on the contributor list (at http://clojure.org/contributing), but I still can't submit tickets on Assembla, and my membership to clojure-dev is still pending. Do I need to

Re: difficulty with becoming a contributor

2010-03-10 Thread Brian Hurt
On Wed, Mar 10, 2010 at 1:31 PM, John R. Williams j...@pobox.com wrote: I have some patches I'd like to submit, but I'm having trouble with the submission process. I've sent in a CA, and my name is on the contributor list (at http://clojure.org/contributing), but I still can't submit tickets

Re: collections within collections

2010-03-10 Thread Wilson MacGyver
you can define a function to filter the result like (defn answer? [x] (filter #(every? integer? %) x)) and then just call it by doing user= (map #(answer? %) (trips (range 1 7))) (() () ([3 4 5]) () ()) On Wed, Mar 10, 2010 at 1:20 PM, Glen Rubin rubing...@gmail.com wrote: I am working on

Re: collections within collections

2010-03-10 Thread Stuart Halloway
Hi Glen, When your are working with infinite sets in Clojure, is it better to take advantage of laziness as far as possible, instead of passing limits such as the coll argument to trips. Here's how I would think about this problem: (defn pairs-adding-to-n Pairs of distinct positive

Re: collections within collections

2010-03-10 Thread Michael Gardner
On Mar 10, 2010, at 12:20 PM, Glen Rubin wrote: However, the output of my trips function yields multiple collections of vectors inside of a larger vector. I am completely befuddled as to how to process this behemoth. You can merge the structure into a single list of triples by applying

Library for physical quantities, units, and dimensions

2010-03-10 Thread Konrad Hinsen
I have started working on a Clojure library for working with physical quantities that have units and dimensions. While there are still some important features missing, I consider the existing features sufficiently stable. The library requires the current master branch of the Clojure github

Re: Library for physical quantities, units, and dimensions

2010-03-10 Thread Wilson MacGyver
great! That's one thing I miss from time to time from Haskell. Haskell has a physical unit library. On Wed, Mar 10, 2010 at 3:08 PM, Konrad Hinsen konrad.hin...@fastmail.net wrote: I have started working on a Clojure library for working with physical quantities that have units and dimensions.

Interesting integer behavior

2010-03-10 Thread Brian Hurt
In a recent clojure: user= (class 2147483647) java.lang.Integer user= (class (inc 2147483647)) java.math.BigInteger user= (class (inc (inc 2147483647))) java.lang.Long user= This isn't *technically* a bug, but it is an odd behavior. Brian -- You received this message because you are

Re: difficulty with becoming a contributor

2010-03-10 Thread Tayssir John Gabbour
Hi, For Assembla, I first had to watch the Clojure space in order to post a ticket. (It's a confusing interface.) Though it explicitly told me I should, so perhaps that's not the problem you face. For posting on clojure-dev, I asked about it on IRC and Rich added me... I'm sure you can just

Re: enclojure install killed netbeans 6.8

2010-03-10 Thread strattonbrazil
No, I moved the entire 6.8 directory out of .netbeans and it still didn't run. You still think I should focus on getting rid of just the clojure files? Netbeans can't just rebuild that directory seeing as it's not there anymore? Josh On Mar 9, 2:01 pm, Mark Nutter manutte...@gmail.com wrote:

Re: collections within collections

2010-03-10 Thread Tyler Perkins
I like Clojure, but as a point of comparison, here's a Haskell solution, as typed in the REPL: Prelude let bOf a = 1000*(500 - a)/(1000 - a) Prelude let nearInt x = x - fromInteger(truncate x) 0.01 Prelude head [ ( a, b, sqrt(a^2 + b^2) ) | a - [1..], b - [bOf a], nearInt b ]

Re: Software Training Center and Startup Incubator

2010-03-10 Thread startup
Sorry I forgot to mention, please go to the site if you want to support, by thumbs up or comment. There is a 100,000 euro prize and 500,000 euro investment for the top two ideas, I think this money would go a long way to further fund the development of clojure and Lisp aboption. On Mar 10,

Re: Clojure for financial applications

2010-03-10 Thread Jeff Rose
On Mar 8, 5:50 pm, Jonathan Shore jonathan.sh...@gmail.com wrote: Now OO may be antithetical to the traditional way of using lisp, however, I see myself needing something close to an OO-style mapping for part of what I do.   Currently my trading strategies have large and disparate state

Re: REPL in a browser

2010-03-10 Thread Jeff Rose
You mean Clojurescript? http://github.com/richhickey/clojure-contrib/tree/master/clojurescript/ It would be great to have more people working on it... On Mar 9, 12:12 pm, Jozef Wagner jozef.wag...@gmail.com wrote: Thank you. They seem to use java to generate (with GWT) both client-side html

Re: enclojure install killed netbeans 6.8

2010-03-10 Thread Mark Nutter
I haven't tried removing the entire 6.8 directory (except in conjunction with a complete reinstall of NetBeans), so I can't say whether that should or should not work, but I have manually removed the enclojure plugin via deleting the clojure-specific files and that has gotten me out of a few jams.

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-10 Thread Brent Millare
Since leiningen downloads everything to a local repo, can't we do away with copies and use symlinks if they are supported by the filesystem? I feel there should be an option for this. -Brent On Mar 4, 1:59 pm, David Nolen dnolen.li...@gmail.com wrote: On Thu, Mar 4, 2010 at 10:19 AM, Stuart

Re: REPL, refs and casting

2010-03-10 Thread Timothy Pratley
On 10 March 2010 21:03, Mike Erickson mike.erick...@gmail.com wrote: but calling (deal 2 :house) bombs out with the following stacktrace: Hi Mike, I tried running your code and it worked fine for me... so I think something else is playing tricks on you here like maybe you changed the function

Re: REPL, refs and casting

2010-03-10 Thread Timothy Pratley
On 11 March 2010 17:10, Timothy Pratley timothyprat...@gmail.com wrote: I tried running your code and it worked fine for me... Ah excuse me it only 'worked' because I used vectors instead of lists: [5 \S]]] [:player []]), :house ([:house []]), :deck nil} --- should give you the clue you need,

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-10 Thread Meikel Brandmeyer
Hi, On Mar 11, 5:07 am, Brent Millare brent.mill...@gmail.com wrote: Since leiningen downloads everything to a local repo, can't we do away with copies and use symlinks if they are supported by the filesystem? I feel there should be an option for this. Why not adding the files from the repo

Re: REPL, refs and casting

2010-03-10 Thread Timothy Pratley
On 11 March 2010 17:15, Timothy Pratley timothyprat...@gmail.com wrote: You probably want to use conj instead of concat! Actually ignore that! I was being confused by the deck-building. Can you try running this code: http://gist.github.com/328912 It is exactly the same as yours but uses known

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-10 Thread Alex Osborne
Brent Millare brent.mill...@gmail.com writes: Since leiningen downloads everything to a local repo, can't we do away with copies and use symlinks if they are supported by the filesystem? I feel there should be an option for this. What benefit does this have aside from a tiny saving in disk

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-10 Thread Richard Newman
What benefit does this have aside from a tiny saving in disk space? Not that tiny when you multiply it across the dozens of projects on your hard drive. repos $ du -hc $(ls */lib/*.jar) | fgrep total 291Mtotal Add to that the size of the Maven repo itself. Symlinks are nice. * you

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-10 Thread Alex Osborne
Richard Newman holyg...@gmail.com writes: What benefit does this have aside from a tiny saving in disk space? Not that tiny when you multiply it across the dozens of projects on your hard drive. repos $ du -hc $(ls */lib/*.jar) | fgrep total 291M total Cost (on standard disks): 5 cents.

Re: REPL, refs and casting

2010-03-10 Thread Timothy Pratley
Hi Mike, On 10 March 2010 21:03, Mike Erickson mike.erick...@gmail.com wrote: I am writing a simple blackjack game in Clojure I've written up a little commentary as to how I'd approach this problem differently: http://gist.github.com/328929 which hopefully will give you some ideas. The general

Re: bounded memoize

2010-03-10 Thread Meikel Brandmeyer
Hello Laurent, On Mar 10, 11:45 am, Laurent PETIT laurent.pe...@gmail.com wrote: * usage of refs : I had a bad feeling, and cgrand confirmed this to me by pointing an even more interesting counter-argument. Me: using refs is not mandatory since you do not need to synchronize this change

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-10 Thread Richard Newman
repos $ du -hc $(ls */lib/*.jar) | fgrep total 291Mtotal Cost (on standard disks): 5 cents. Sorry, that's tiny. It's even less than 0.5% of the small SSD I have in my laptop. Seriously, this is just premature optimization. You're seriously fine with every single Leiningen-based