Re: Clojure 1.0

2009-05-04 Thread Mark H.
Congrats Rich and contributors! You all have made a great tool and a great community as well! mfh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googleg

Re: March 20th 2009 Rich Hickey Appreciation Day!

2009-03-21 Thread Mark H.
Thanks Rich!!! mfh --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to clojure+unsubscr...@goo

Re: categorizing forms

2009-03-08 Thread Mark H.
On Mar 8, 5:30 pm, Mark Volkmann wrote: > I made an attempt at categorizing all special forms, functions and > macros in clojure.core, plus some outside that namespace. > Seehttp://www.ociweb.com/mark/clojure/ClojureCategorized.html. I'd love > some feedback on the names of the categories and wh

Re: float vs fraction (just playing around)

2009-03-08 Thread Mark H.
On Mar 6, 8:06 pm, David Sletten wrote: > It comes as no surprise that certain numbers cannot be represented by   > a finite string of decimal digits. We all realize that 1/3 =   > 0...., and the "..." part is critical. Take it away and the   > equality goes away too. In other words, if that

Re: float vs fraction (just playing around)

2009-03-06 Thread Mark H.
On Mar 5, 10:00 pm, "mike.farn...@gmail.com" wrote: > I was sort of surprised by this. > > user=> (+ (float (* (/ 2) (/ 3))) (float (* (/ 2) (/ 3))) ) > 0.3334 > >  (=  (+ (float (* (/ 2) (/ 3))) (float (* (/ 2) (/ 3))) ) (/ 3) ) > yields true > > How is tracking these number internally? > >

Re: What is Clojure NOT good for?

2009-03-06 Thread Mark H.
On Mar 6, 7:46 am, Luke VanderHart wrote: > The biggest barrier to using Clojure in an "enterprise" environment is > that enterprise projects are typically built and maintained by 100s of > replaceable code-monkeys and consultants, all of which understand Java > and almost none of which understan

Re: Clojure + Terracotta: We Have REPL!

2009-03-05 Thread Mark H.
On Mar 5, 12:23 pm, Paul Stadig wrote: > I had one last, major hurdle, and was helped by Chouser (thank you!). > > http://paul.stadig.name/2009/03/clojure-terracotta-we-have-repl.html > > Still lots more to do, and probably some simple changes that could be > rolled back into the Clojure codebase

Re: function call preconditions

2009-02-26 Thread Mark H.
On Feb 26, 5:55 am, Laurent PETIT wrote: > While not checking types at compile time, it seems to me that a lot of > clojure code still needs in the docstring some sort of "preconditions > warnings". Do you mean something like "Contract Programming," as in e.g., the Eiffel programming language?

Re: Concurrency and file writing

2009-02-14 Thread Mark H.
On Feb 14, 6:48 am, James Reeves wrote: > I've been having some difficulty coming up with a scheme for writing > to files in a thread-safe manner. The files are named with the hash of > their content, so they are effectively immutable. > > The problem comes with writing them for the first time. I

Re: run clojure on 5,832 cores?

2009-02-14 Thread Mark H.
On Feb 14, 10:00 am, Christian Vest Hansen wrote: > You run into problems with the garbage collector when the heap gets > big: the bigger the heap, the longer it takes to compact. Azul has > hardware support for their garbage collector which allows their > compaction phase to run concurrently wit

Re: run clojure on 5,832 cores?

2009-02-13 Thread Mark H.
SiCortex had a nice booth at Supercomputing '08. They have desktop versions of their machines too. I've heard that the SiCortex machines have a fabulous communication network, but they expect you to use it via their MPI stack. I don't think they offer a shared memory abstraction that the JVM co

Re: unchecked methods for floats/doubles?

2009-02-06 Thread Mark H.
On Feb 6, 7:14 pm, Korny Sietsma wrote: > Hi folks - I was trying the example posted below, and I discovered a > slight snag - unchecked-* methods don't exist for doubles or floats! > (and if you call (unchecked-multiply 1.2 3.4) you get "No matching > method found"... which caused some confusion

Re: Strapped to the JVM?

2009-02-06 Thread Mark H.
On Feb 6, 4:19 pm, mikel wrote: > Can you imagine a Clojure implementation on a different underlying > runtime? Which ones might possibly be suitable? Can you imagine a > Clojure on top of, say the CLR? Or on top of a Common Lisp? Or on GHC > or perhaps the LLVM? There's Clojure as a language an

Re: Memory Consumption of Large Sequences

2009-02-02 Thread Mark H.
On Feb 2, 5:32 pm, Keith Bennett wrote: > I have a lot of work to do to learn how to think in functional > programming.  These kinds of discussions are very helpful. A picky point -- lazy sequences aren't really a functional programming thing (although restricting side effects makes it easier to

Re: Memory Consumption of Large Sequences

2009-02-02 Thread Mark H.
On Feb 2, 5:32 pm, Keith Bennett wrote: > I am just now learning Clojure, and for me, understanding what's going > on underneath the surface helps me understand how to use the language > properly.  As I said previously, the amount of memory consumed by a > list will very rarely be an issue.  Howe

Re: Memory Consumption of Large Sequences

2009-02-02 Thread Mark H.
On Feb 2, 10:06 am, Keith Bennett wrote: > I'm curious to know how to minimize memory consumption in Clojure for > large lists.  I did the following test in repl: > > (def d ()) > (dotimes [_ 10] (def d (cons "x" d))) Let me translate this into pseudocode for you: Make d into a global refer

Re: Clojure is "not a serious language"

2009-01-31 Thread Mark H.
On Jan 30, 8:40 pm, Jon Harrop wrote: > Apologies if you've seen this before but I just thought it was absolutely > hillarious: > > http://www.3ofcoins.net/2009/01/30/common-lisp-clojure-and-seriousness/ Hey, I have to admit, I was scared when I saw you show up here, but now I think I understand

Re: Clojure for Games/Simluation/Art (Optimization in Clojure)

2009-01-28 Thread Mark H.
On Jan 28, 7:09 am, Konrad Hinsen wrote: > It is possible to generalize the Fast Multipole Method somewhat, but   > it remains a technique for a limited (though important) class of   > interactions. It is rather unlikely that it will be of any use for   > simulating a flock of birds. The FMM its

Re: Streams work

2009-01-26 Thread Mark H.
On Jan 24, 2:25 pm, Frantisek Sodomka wrote: > Word "streams" invokes association to data-flow languages. For a > while, I was following Project V: > > Simple Example of the Difference Between Imperative, Functional and > Data > Flow.http://my.opera.com/Vorlath/blog/2008/01/06/simple-example-of-

Re: Agent as a processing queue

2009-01-22 Thread Mark H.
On Jan 22, 4:24 pm, e wrote: > At first, there will only be one thread for the first pass, but the number > will grow as subtasks fire sub-sub tasks.  I am sure this is a silly way to > sort because the threadspawning time is so much longer than the filtering > time, but it's just an exercise. I

Re: Streams work

2009-01-21 Thread Mark H.
On Jan 21, 5:21 pm, e wrote: > I would think it would be useful to have something exactly like a stream but > that allowed as many iterators as you like but that a mutex prevented any > two from consuming the same piece of information.   That might be useful for something, but it's hard to make

Re: pmap memory hogging

2009-01-21 Thread Mark H.
On Jan 21, 8:56 am, Perry Trolard wrote: > If I understand what you did correctly, the reason it worked for you > is that Rich committed a fix to SVN in the meantime! Awesome, real-time fix! > > The last (count result-p) call takes a few seconds (probably > > because there's a one-to-one mappin

Re: pmap memory hogging

2009-01-20 Thread Mark H.
On Jan 20, 8:36 am, Perry Trolard wrote: > Yesterday I had a strange case of pmap (parallel map) eating up all of > the heap space I'd make available -- from 256M up to a Gig. I track > SVN, & I know for sure this wasn't happening last Wednesday (the > 14th). Calling map in place of pmap caused t

Re: pmap memory hogging

2009-01-20 Thread Mark H.
On Jan 20, 10:38 am, Perry Trolard wrote: > But I don't think lazyness is the problem: > > user=> (def r (doall (map inc (range 100 > #'user/r > user=> (count r) > 100 > user=> (pmap inc [0]) > java.lang.OutOfMemoryError: Java heap space (NO_SOURCE_FILE:0) Hm, that's funny, the latte

Re: Mysterious performance anomalies

2009-01-20 Thread Mark H.
On Jan 20, 1:41 pm, Rich Hickey wrote: > Let's keep from making the same mistakes as c.l.l, including calling > people trolls. Sorry, yes Rich, I will refrain from using such titles in the future. mfh --~--~-~--~~~---~--~~ You received this message because you ar

Re: pmap memory hogging

2009-01-20 Thread Mark H.
On Jan 20, 10:38 am, Perry Trolard wrote: > > Doesn't pmap have to construct the whole sequence explicitly in order > > to map its execution across more than one processor?  or does it take > > in a lazy fashion? > > Semi-lazy, according to the doc: > >  Like map, except f is applied in parallel.

Re: Mysterious performance anomalies

2009-01-20 Thread Mark H.
On Jan 20, 9:31 am, Jon Harrop wrote: > On Tuesday 20 January 2009 08:01:19 ivant wrote: > > > IIRC, the only major complain Rich has about JVM is the lack > > of tail-call optimization. > > That's a pretty major problem. :-) btw, did you ever stop trolling comp.lang.lisp? You were the main rea

Re: pmap memory hogging

2009-01-20 Thread Mark H.
On Jan 20, 8:36 am, Perry Trolard wrote: > Yesterday I had a strange case of pmap (parallel map) eating up all of > the heap space I'd make available -- from 256M up to a Gig. I track > SVN, & I know for sure this wasn't happening last Wednesday (the > 14th). Calling map in place of pmap caused t

Re: Mysterious performance anomalies

2009-01-20 Thread Mark H.
On Jan 20, 12:01 am, ivant wrote: > On Jan 20, 3:14 am, e wrote: > > > That's a solid arg, too . . . but it would be stronger if we weren't > > importing things from java all the time.  If we said like, "(gui-frame > > "hello"), which happened to be implemented as a JFrame . . . then that'd be >

Re: Mysterious performance anomalies

2009-01-19 Thread Mark H.
will ever be a JM ... that is a chip that natively > executes byte code.  I wonder what they'd have to say, then.  I think I'll > do a Google search.  I also wonder if it was a tough decision for Rich to > cut the CLI support.  I know he feels fine looking back. > > On Sun, Ja

Re: Mysterious performance anomalies

2009-01-17 Thread Mark H.
On Jan 16, 6:47 am, e wrote: > Is it much much easier to make byte code than assembly code? I'll chime in too to say that x86 is only king of the desktop / laptop world -- many portable devices are ARM-based (and a lot of Windows apps run on ARM), and there are other architectures used for enter

Re: Synchronization Benchmarks

2009-01-15 Thread Mark H.
Welcome to the group! :-) On Jan 15, 1:38 am, stuhood wrote: > The benchmark contains 4 bi-directional dictionary implementations: >  * MDict - Java implementation using the synchronized keyword, >  * RWDict - Java implementation using a ReadWriteLock, >  * CLJDict - Clojure implementation using

Re: when performance matters

2009-01-15 Thread Mark H.
On Jan 15, 12:09 am, bOR_ wrote: > I remember from 5 years ago that a collegue of mine improved a > diffusion algorithm for a successor of me by some heavy algorithms. My > own algorithm was a simple loop-over-the- array once, dump-a-fraction- > of-each-cell-into-spatially-neighbouring-cells-in-t

Re: when performance matters

2009-01-14 Thread Mark H.
On Jan 14, 6:37 pm, Asbjørn Bjørnstad wrote: > Look closer, I'm using a 1-D array and indexing by hand :-) oops, sorry about that -- i see you are doing the right thing here ;-) > > 3. I noticed you are doing 20 iterations of Gauss-Seidel.  There are > > some smart ways to speed up multiple st

Re: when performance matters

2009-01-14 Thread Mark H.
On Jan 14, 12:29 pm, chris wrote: > For a completely different way of doing this, you could certainly use > GPGPU programming to speed this up. > ... > You want this for a game engine anyway; do it in opengl or directx > using shaders. I recommend OpenCL or CUDA instead for less pain ;-) (Well,

Re: when performance matters

2009-01-14 Thread Mark H.
On Jan 14, 8:27 am, Asbjørn Bjørnstad wrote: > Anyway, here is a core part of the algorithm. It's a diffusion > step, this gets called 3 times and in total this takes up more than > one second of cpu time on my machine which makes framerates very > slow. If anyone got any improvements I'd be hap

Re: when performance matters

2009-01-13 Thread Mark H.
I humbly propose that folks shouldn't complain about Clojure being slow for their apps until they have at least one of the following: 1. A targeted benchmark for an important bottleneck in their application, implemented in both Clojure and the current implementation language, with performance res

Re: when performance matters

2009-01-13 Thread Mark H.
On Jan 11, 9:41 pm, Mark P wrote: > The programs I write perform applied mathematical > optimization (using mainly integer arithmetic) > and often take hours (occasionally even days) > to run.  So even small percentage improvements > in execution speed can make a significant > practical differenc

Re: Clojure now running in production

2009-01-13 Thread Mark H.
On Jan 13, 7:38 am, Luc Prefontaine wrote: > as of yesterday pm, Clojure is running in a live system in a big > veterinarian hospital. Awesome, congratulations!!! :-D mfh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

Re: what should multiple-ref-updating functions return?

2009-01-06 Thread Mark H.
On Jan 6, 1:35 pm, "Mark Volkmann" wrote: > I'm tempted to say that if a function doesn't have a name that implies > what it returns or a comment describing what it returns, then callers > shouldn't use it. That just means that the return value isn't defined, so you shouldn't rely on it returnin

Re: yet another Clojure snake

2009-01-06 Thread Mark H.
On Jan 6, 1:07 pm, "Mark Engelberg" wrote: > Decide on a data representation that represents the entire state of > the game world at a given instant. > > Write a function which can draw this state. > Write a function which takes the state and player keypresses as input, > and returns a new update

Re: yet another Clojure snake

2009-01-06 Thread Mark H.
On Jan 6, 7:18 am, "Mark Volkmann" wrote: > I wish there was a convention for identifying constants in Clojure, > even if it's not enforced. I'd be fine with making their names all > uppercase as in Java, but I'm open to other suggestions. The naming convention in Common Lisp for constants is +

Re: quote on side effects

2009-01-05 Thread Mark H.
On Jan 5, 12:48 pm, "Mark Volkmann" wrote: > I'm trying to recall where I heard a quote that goes something like this. > > "If none of your functions have side effects then all you're doing is > heating up the processor." > > Of course you should avoid side effects in most of your functions, but

Re: Math functions

2009-01-05 Thread Mark H.
On Jan 3, 7:46 pm, vogelrn wrote: > sqrt(a/b) should always be equal to sqrt(a)/sqrt(b) since (a/b)^m = > a^m/b^m for b != 0.  However, I'm unsure of whether it's the best > option for ratios because unless both the numerator and the > denominator are perfect squares, you're going to end up with

Re: automatic concurrency

2009-01-03 Thread Mark H.
On Jan 3, 9:53 pm, Brian Will wrote: > > Remember that "parallel" and "concurrent" are two different things. > > "Concurrent" is something you deal with all the time if you are > > writing GUI apps:  there are different threads and they interact in > > some possibly unpredictable way.  You can ha

Re: literate snake

2009-01-03 Thread Mark H.
On Jan 3, 10:14 am, "Mark Volkmann" wrote: > What do you think of this way of resolving the issue? Note the use of the > local variable "message". That can get set to either "You win!" or "You > killed the snake!" inside dosync. Then outside dosync I check that and call > new-game only if it's

Re: Math functions

2009-01-03 Thread Mark H.
On Jan 3, 11:48 am, "Mark Engelberg" wrote: > If you give it an exact number (i.e., not a floating point), Floating-point numbers are exact -- it's their operations that may not be. *ducks* Seriously, handy code -- many thanks! I should check with someone whether sqrt(a/b) -> sqrt(a)/sqrt(b)

Re: automatic concurrency

2009-01-03 Thread Mark H.
On Jan 3, 2:08 pm, Brian Will wrote: > http://en.wikipedia.org/wiki/Automatic_parallelization The article looks out-of-date and inaccurate, alas... mfh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" gr

Re: automatic concurrency

2009-01-03 Thread Mark H.
On Jan 3, 12:20 pm, "Mark Volkmann" wrote: > One of the stated benefits of functional programming I've seen is that > the compiler of a functional language can analyze code and determine > statements within a function 
that can safely be run concurrently. As > far as I know Clojure doesn't yet do

Re: literate snake

2009-01-02 Thread Mark H.
On Jan 2, 5:39 pm, "Mark Volkmann" wrote: > For anyone still following this, the latest code that incorporates > many of the suggestions I've received here is > athttp://www.ociweb.com/mark/programming/ClojureSnake.html, replacing my > original version. It now uses refs. I think I have the dosyn

Re: literate snake

2009-01-02 Thread Mark H.
On Jan 2, 11:07 am, "Mark Volkmann" wrote: > The most controversial thing about this code is probably my use of def > to change the state of the snake and the apple. It's not yet clear to > me that using atoms is needed here, but I need to think about that > more. Not atoms, refs. Or agents for

Re: New library: BigInteger random numbers & other PRNG utils

2009-01-02 Thread Mark H.
On Jan 2, 12:46 am, "Mark H." wrote: > I've written a pseudorandom number generator for arbitrarily large > integers, as well as a number of other utilities for pseudorandom > numbers.   Other features: * Function to generate a random seed, using either Java's Sec

New library: BigInteger random numbers & other PRNG utils

2009-01-02 Thread Mark H.
I've written a pseudorandom number generator for arbitrarily large integers, as well as a number of other utilities for pseudorandom numbers. Features: * Everything is a lazy seq * Gaussian (mean 0, variance 1) - pseudorandom doubles * Arbitrarily large pseudorandom uniformly distributed integer

Re: Emacs+SLIME+Clojure troubles

2009-01-01 Thread Mark H.
On Jan 1, 6:48 pm, "Bill Clementson" wrote: > Looks like the correct patch to basic.clj should be: > (defslimefn create-repl [target] '("user" user)) That fixes everything -- thank you :-D mfh --~--~-~--~~~---~--~~ You received this message because you are subscr

Re: Emacs+SLIME+Clojure troubles

2009-01-01 Thread Mark H.
On Jan 1, 5:44 pm, "Stephen C. Gilardi" wrote: > On Jan 1, 2009, at 7:57 PM, Bill Clementson wrote: > > > Or is there some other "dynamic > > documentation for a function" that you're referring to? > > For me, it throws the exception when I type a space and SLIME tries to   > look up the argument

Re: Emacs+SLIME+Clojure troubles

2009-01-01 Thread Mark H.
On Jan 1, 5:55 am, "Remco van 't Veer" wrote: > I got repl to start with a small change to swank-clojure: > >  http://github.com/remvee/swank-clojure/commit/ed89d6997bce3c5076e779a... I changed that one line to say (defslimefn create-repl [target] '(user user)) and the SLIME repl works, but th

Re: Constant expression optimization

2009-01-01 Thread Mark H.
Konrad and Cliff -- both useful replies, thank you :-) Happy New Year everyone! mfh --~--~-~--~~~---~--~~ 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 un

Re: making code readable

2008-12-31 Thread Mark H.
On Dec 31, 8:13 am, "Mark Volkmann" wrote: > Suppose you had been studying Clojure for one week before coming > across this code. Would you know what was going on here? Let's see ... > we've got an anonymous function that uses an anonymous function which > iterates some number of times calling do

Re: Constant expression optimization

2008-12-31 Thread Mark H.
On Dec 31, 8:49 am, Konrad Hinsen wrote: > Suppose I write > > (defn foo [x] >    (let [f (. Math log 0.5)] >      (* f x))) > > Does the Clojure compiler calculate the constant expression (. Math   > log 0.5) once, or at every function call? Folding constants in nontrivial floating-point expres

Re: swank-clojure license

2008-12-30 Thread Mark H.
On Dec 30, 10:26 am, Phil Hagelberg wrote: > lpetit writes: > > I'm not sure. From what I remember, what you describe is more related > > to LGPL ? > > No, the LGPL allows using the code in another program that is Free but > not GPL-licensed. Actually the LGPL allows linking to the library (som

Re: Parallel words frequency ranking

2008-12-30 Thread Mark H.
On Dec 28, 7:50 pm, Piotr 'Qertoip' Włodarek wrote: > On 38MB file it takes 28s, compared to 38s of similar but sequential > version. Another good thing is to make a simple performance model, perhaps aided by timings of individual components, before you start parallelizing everything ;-) How lo

Re: Parallel words frequency ranking

2008-12-30 Thread Mark H.
On Dec 30, 9:18 am, Mibu wrote: > In an ideal world, standard functions like map, sort, reduce, filter, > etc. would know when to parallelize on their own, or even better, the > compiler will do it for them. The former is easier than the latter ;-) Even the smartest autoparallelizing compilers

Re: Parallel words frequency ranking

2008-12-29 Thread Mark H.
On Dec 28, 7:50 pm, Piotr 'Qertoip' Włodarek wrote: > Following my recent adventure with words ranking, here's the parallel > version: > > ... > (defn parallel-top-words [in-filepath out-filepath] >   (let [string  (slurp in-filepath) 'slurp' just reads the whole file in at once as a string, rig

Re: making code readable

2008-12-29 Thread Mark H.
On Dec 29, 1:15 pm, "Mark Volkmann" wrote: > It's early enough in the life of Clojure that we haven't developed any > deeply held habits yet. I think it would be a good idea for you and > other Clojure committers to at least suggest the way you think things > should be done in code. If you think

Re: Random Number Generation Issues

2008-12-26 Thread Mark H.
On Dec 23, 3:10 pm, Jason wrote: > For the time-being, you could try something like: > > user> (def *random* (java.util.Random.)) > #'user/*random* > > user> (defn my-rand-int [max-val] >         (let [bit-length (.bitLength (BigInteger. (str max-val)))] >           (loop [] >             (let [x

Uploaded prng-utils.clj

2008-12-22 Thread Mark H.
Spurred by discussions in the "DISCUSS: replace (rand)" thread, http://groups.google.com/group/clojure/browse_thread/thread/25dc26841ed00710/44050938894f9296?lnk=gst&q=rand#44050938894f9296 I've adapted, written, and tested some utilities for handling pseudorandom numbers. Here are the highligh

Re: Numeric tower and Java's math library

2008-12-22 Thread Mark H.
On Dec 22, 8:08 am, Stuart Sierra wrote: > Yeah, I love (expt 2 64) as a Common Lisp parlor trick.  I've thought > about trying to write a Clojure "pow", but I don't know enough about > the algorithms involved.  How do you compute something like 25/9 to > the power of 3/2? That's much harder tha

Re: DISCUSS: replace (rand)

2008-12-14 Thread Mark H.
On Dec 14, 9:40 am, Konrad Hinsen wrote: > Isn't that the standard Box-Muller transform? Ah, yes, now I know what to call it ;-) Yes, it's a particular implementation of the Box-Muller transform that is designed to avoid trig functions. http://en.wikipedia.org/wiki/Marsaglia_polar_method > (d

Re: DISCUSS: replace (rand)

2008-12-14 Thread Mark H.
On Dec 14, 6:09 am, Randall R Schulz wrote: > On Saturday 13 December 2008 23:19, Mark H. wrote: > > > So I'm going to stop pretending like I'm an expert and actually post > > some Clojure code.  Be constructively critical 'cause I'm a n00b in > > th

Re: DISCUSS: replace (rand)

2008-12-13 Thread Mark H.
So I'm going to stop pretending like I'm an expert and actually post some Clojure code. Be constructively critical 'cause I'm a n00b in that regard ;-) This is a pseudorandom number generator for the Gaussian (0,1) distribution. (defn next-gaussrand-state [current- state] ^{:doc "Given the cu

Re: Working combination of .emacs, Aquamacs, swank-clojure, clojure-mode?

2008-12-12 Thread Mark H.
Thanks Bill for posting such detailed Clojure+SLIME setup instructions on your blog! :-D One thing that tripped me up was that my .emacs was loading a custom SLIME (since I use the .emacs for Emacs 21 as well as Emacs 22, and Emacs 21 does not come with SLIME by default). The custom SLIME was an

Re: Dr. Dobbs: "It's Time to Get Good at Functional Programming"

2008-12-12 Thread Mark H.
On Dec 10, 1:28 pm, Randall R Schulz wrote: > There seems to be a bit of an oversight. I recall at least one other article on (Common) Lisp in Dr. Dobb's Journal which was disastrously poorly written (misleading, outdated, irrelevant information, even though the article was "pro-Lisp"). It's no

Re: DISCUSS: replace (rand)

2008-12-07 Thread Mark H.
On Dec 5, 2:32 pm, "Mark H." <[EMAIL PROTECTED]> wrote: > On Dec 4, 12:07 am, "don.aman" <[EMAIL PROTECTED]> wrote: > > > Since we're being all high-level, it'd be good for a random function > > which allows us to specify the ran

Re: DISCUSS: replace (rand)

2008-12-05 Thread Mark H.
On Dec 4, 12:07 am, "don.aman" <[EMAIL PROTECTED]> wrote: > Since we're being all high-level, it'd be good for a random function > which allows us to specify the range of numbers, since % doesn't > promise an even spread of probabilities (especially for large ranges). Sure it does, as long as you

Re: DISCUSS: replace (rand)

2008-12-03 Thread Mark H.
On Dec 3, 9:27 am, Konrad Hinsen <[EMAIL PROTECTED]> wrote: > I'd provide two interfaces: > > 1) Low-level: (rng seed) yielding a pair [random-number, new-seed] > 2) High-level: (random seed) yielding an infinite (obviously lazy)   > seq of the random numbers obtained starting from the given seed.

Re: DISCUSS: replace (rand)

2008-12-03 Thread Mark H.
On Dec 2, 5:42 am, Stuart Halloway <[EMAIL PROTECTED]> wrote: > Is it big enough to matter? My intuition says "yes".  That's worth   > nothing, so I will write some tests when I have some spare time ...   > but secretly I was hoping that this thread would goad someone else   > into writing the tes

Re: Clojure could be to Concurrency-Oriented Programming what Java was to OOP

2008-12-02 Thread Mark H.
On Dec 1, 12:03 am, bc <[EMAIL PROTECTED]> wrote: > I've written a blog post titled "Clojure could be to Concurrency- > Oriented Programming what Java was to OOP" in which I discuss > Clojure's approach to concurrency:http://bc.tech.coop/blog/081201.html > > Any comments/criticisms would be apprec

Re: No complex numbers?

2008-11-23 Thread Mark H.
On Nov 23, 7:29 am, Rock <[EMAIL PROTECTED]> wrote: > Any plans to include them in future versions? If not, I guess I'll use > the Apache.Commons.Math library or possibly JScience. BTW which one do you prefer? I'm scared to try random numerical libraries since people find bugs in them all the ti

Re: Dividing by zero and floating-point infinity

2008-11-20 Thread Mark H.
On Nov 19, 1:10 pm, samppi <[EMAIL PROTECTED]> wrote: > I am not familiar with how Java's arithmetic works, but it seems > fromhttp://hanuska.blogspot.com/2007/08/arithmeticexception-vs-nan.html > andhttp://www.concentric.net/~Ttwang/tech/javafloat.htmthat dividing > a double or float by 0 should

Re: Readable names

2008-11-14 Thread Mark H.
On Nov 12, 5:52 am, David <[EMAIL PROTECTED]> wrote: > No, I think that, if at all, we need a single set of macros. As far as > the IDEs are concerned, if we all try "inventing" our own (or plugins > for the existing ones), they will all be half-done at best. It's > better to focus on one project

Re: Readable names

2008-11-14 Thread Mark H.
On Nov 12, 4:47 am, Dave Newton <[EMAIL PROTECTED]> wrote: > There's "terse", and there's "concise". I know you're attempting humor, but > IMO there's a difference between "association"/"assoc" and "assoc"/"a" in the > amount of information being lost in each pair. Nothing stopping anybody from

Re: chunk-file function

2008-11-14 Thread Mark H.
On Nov 12, 2:20 pm, "Brian Doyle" <[EMAIL PROTECTED]> wrote: > I had to process each line of a very large file, 120MB, > and did not want to read in the whole file at once.   I > wrote this function, chunk-file, that allows me to pass > in a function and args that will process each line. What hap

Re: Readable names

2008-11-11 Thread Mark H.
On Nov 11, 1:17 am, Albert Cardona <[EMAIL PROTECTED]> wrote: > Perhaps one way to do that would be to have a higher-order doc function, > that replied with keywords belonging to it. For example, a mock-up call > for "Maps": > >  >>> (doc Maps) > > Maps are this and that, and can be manipulat

Re: Readable names

2008-11-10 Thread Mark H.
On Nov 10, 9:55 am, "Robert Lally" <[EMAIL PROTECTED]> wrote: > - The current users of Clojure probably aren't representative of the > development community as a whole. I'm not suggesting that they/we are better > or worse than average. Just that early adopters are atypical, exemplified by > the f

Re: Readable names

2008-11-10 Thread Mark H.
On Nov 10, 5:48 am, "Robert Lally" <[EMAIL PROTECTED]> wrote: > One of the many things that I really like about Clojure is that it abandoned > Lisp tradition where it was pragmatic to do so. One of the prime examples > for me was the use of first and rest rather than car and cdr. To me that made

Re: Recommending Approach to Performance Critical Code

2008-11-09 Thread Mark H.
On Nov 9, 11:59 am, CuppoJava <[EMAIL PROTECTED]> wrote: > You seem to know a lot about this, so I can be more specific. I'm > using a conjugate gradient method for solving (and caching) systems of > equations, so there's no need to explicitly form a matrix (therefore > object allocation isn't a p

Re: Recommending Approach to Performance Critical Code

2008-11-09 Thread Mark H.
On Nov 9, 7:13 am, "Michael Beauregard" <[EMAIL PROTECTED]> wrote: > That's not true. Matrix inversion is common enough in graphics > programming. I wrote a physics engine that neglected quantum effects > and still needed to invert matrices ;-) > > http://java.sun.com/javase/technologies/desktop/j

Re: Recommending Approach to Performance Critical Code

2008-11-09 Thread Mark H.
On Nov 8, 9:36 pm, CuppoJava <[EMAIL PROTECTED]> wrote: > I'm rewriting my physics engine over from Java, which is number > heavy. > There's a lot of matrix multiplication and inversions. May I ask if you wrote the Java numerics code yourself or whether you used an existing library instead? Also

Re: Recommending Approach to Performance Critical Code

2008-11-06 Thread Mark H.
On Nov 6, 7:05 pm, CuppoJava <[EMAIL PROTECTED]> wrote: > I'm doing some heavy numerical matrix crunching and would like to > write it in as elegant a way as possible without sacrificing any > speed. Can you define "matrix crunching" more precisely? mfh --~--~-~--~~~-

Re: Having struggle in understanding FP (and Clojure question)

2008-11-06 Thread Mark H.
On Nov 6, 11:58 am, Konrad Hinsen <[EMAIL PROTECTED]> wrote: > On 05.11.2008, at 17:16, Mark H. wrote: > For the immediate future, yes. But with changing computer   > architectures, the existing algorithms and routines may lose much of   > their interest in the future. Haha,

Re: Having struggle in understanding FP (and Clojure question)

2008-11-05 Thread Mark H.
On Nov 4, 11:46 pm, Konrad Hinsen <[EMAIL PROTECTED]> wrote: > > Long answer:  SISAL is an example of a functional parallel language > > Ah, right, there was SISAL... unfortunately long forgotten. I saw a retrospective presentation on it at SIAM PP this spring by one of the Livermore folks who pr

Re: Having struggle in understanding FP (and Clojure question)

2008-11-04 Thread Mark H.
On Nov 4, 10:01 am, Konrad Hinsen <[EMAIL PROTECTED]> wrote: > On the other hand, I am not sure that all important algorithms   > already have purely functional equivalents that are sufficiently   > efficient for real life. Is there an efficient purely functional   > algorithm for matrix inversion

Re: Having struggle in understanding FP (and Clojure question)

2008-11-04 Thread Mark H.
On Nov 3, 6:44 pm, cwyang <[EMAIL PROTECTED]> wrote: > So, I understand as follows: > - OOP: keeping objects, which has states and methods. >        methods are encapuslated to the corresponding object. > - FP: keeping objects(or structs or variables, whatever it is called) >       and functions o

Re: Back on max again...

2008-11-03 Thread Mark H.
On Nov 3, 6:48 pm, Cosmin Stejerean <[EMAIL PROTECTED]> wrote: > I think clearly spelling out how objects of a type should be sorted is   > the point of the Comparable interface. Ah, yes, this is true, I hadn't realized that String and Date both implement Comparable. Comparable is supposed to im

Re: Back on max again...

2008-11-03 Thread Mark H.
On Nov 3, 5:39 pm, "Paul Stadig" <[EMAIL PROTECTED]> wrote: > Could/Should the max function be modified to work against the > Comparable interface instead of expecting its arguments to be numbers? > > I'm working with a sequence of strings that are dates in the > "-mm-dd" format, and I want to

Re: Concerned about Clojure's license choice.

2008-11-02 Thread Mark H.
On Nov 2, 10:31 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > (There are  examples of projects 'weakening' the GPL in  various ways > to suit their needs.) Just out of curiosity (I don't have an interest in this particular issue at the moment so I'm not taking a side in this debate), what

Re: idiomatic Clojure for agents?

2008-10-28 Thread Mark H.
On Oct 28, 8:48 am, Stuart Halloway <[EMAIL PROTECTED]> wrote: > Java does thread protect, but it is synchronized. Also java.math and   > java.util's random number generator aren't pluggable with alternate   > implementations. For that I would need SecureRandom. > > For my simple example I think I

Re: idiomatic Clojure for agents?

2008-10-28 Thread Mark H.
On Oct 27, 7:06 pm, Stuart Halloway <[EMAIL PROTECTED]> wrote: > ; take samples, tracking number that land > ; :in circle and :total number > (defn sample-for-pi [count] >    (reduce (fn [{in :in total :total} point] >             {:in (if (in-circle? point) (inc in) in) >              :total (inc

Re: Clojure's first year

2008-10-17 Thread Mark H.
On Oct 17, 4:09 am, "Paul Stadig" <[EMAIL PROTECTED]> wrote: > One of the things that I have always thought was crucial to creating a new > Lisp (or any language really) is a Benevolent Dictator. I like the fact that > you have a strong vision, and although you are very open to suggestions, you >

Re: Clojure's first year

2008-10-16 Thread Mark H.
Congrats Rich and HBD Clojure! I'm getting back into Clojure for scripting and am loving it. The sequence functions work great on strings and are fabulous for simple text manipulation without invoking the heavy hammer of the regex engine. It's a nice puzzle to make my brain work that way again

  1   2   >