Chicago Clojure meetup

2009-03-23 Thread Cosmin Stejerean
If you're in or around Chicago I'd like to invite you to come out for the first meeting of the Chicago Clojure User Group on April 15th. Full details are at http://onclojure.com/chicago/ -- Cosmin Stejerean http://offbytwo.com --~--~-~--~~~---~--~~ You received th

Suggestion for Java Clojure code, use of checkstyle or code formatter

2009-03-23 Thread BerlinBrown
I was curious about how some of the clojure code worked and observed that the coding style is a little bit non idiomatic from typical Java coding conventions. E.g. there aren't any javadoc comments on methods or classes, non standard indents. Something like checkstyle might prove useful. http:/

Re: Slime integration

2009-03-23 Thread Phil Hagelberg
Vagif Verdi writes: > When i use slime with lisp, it shows me function parameters, when > cursor is on a function name. But with clojure it only shows me > Evaluation Aborted. Is this because that feature not implemented, or i > setup something wrong ? Works for me. Would need more details to

Slime integration

2009-03-23 Thread Vagif Verdi
When i use slime with lisp, it shows me function parameters, when cursor is on a function name. But with clojure it only shows me Evaluation Aborted. Is this because that feature not implemented, or i setup something wrong ? --~--~-~--~~~---~--~~ You received this

Re: Mapping a function over a map's values

2009-03-23 Thread Jeff Valk
On Mon, 23 Mar 2009 at 20:10, David Sletten wrote: > I think Mark was referring to the call to 'keys'. But apparently > Clojure doesn't need to traverse the map to generate the keys? The call to keys just creates a seq. There's no traversal until you consume it. > Not sure what you mean here.

arbitrary partitioning of collection

2009-03-23 Thread Parth Malwankar
Hello, I have a use case for reading binary data from a file into a C equivalent structure. I read the binary date into a byte array before processing. I came up with a split-byte-array function for this: (defn split-byte-array "takes a byte-array and returns its various fields as a list of

Re: I need help tracking down a performance problem.

2009-03-23 Thread Mark Engelberg
On Mon, Mar 23, 2009 at 7:31 PM, Vincent Foley wrote: > More generally, is it possible that I'm just doing this whole thing > wrong?  That using vectors to represent binary fields and records in a > declarative is just a bad idea and that I should try and explore lower- > level alternatives? >

Re: I need help tracking down a performance problem.

2009-03-23 Thread Vincent Foley
I can try that. More generally, is it possible that I'm just doing this whole thing wrong? That using vectors to represent binary fields and records in a declarative is just a bad idea and that I should try and explore lower- level alternatives? Vincent On Mar 23, 3:35 pm, Christophe Grand wr

Re: Proposed Change to str-utils

2009-03-23 Thread Sean
Okay, it's up. Still new to github. Sorry about that. I *think* it's here: http://github.com/francoisdevlin/clojure-str-utils-proposal/tree/master I'm not sure what the directory structure should be for everything still. Perhaps somebody can point out how it should be done. I'll put the origi

Re: Proposed Change to str-utils

2009-03-23 Thread David Nolen
Looks interesting and maybe even very useful. Why not put your code on Github or some other public repo of your liking. It's much nicer than pasting all this code ;) On Mon, Mar 23, 2009 at 9:18 PM, Sean wrote: > > Hello Everyone, > I've been reviewing the str-utils package, and I'd like to prop

Proposed Change to str-utils

2009-03-23 Thread Sean
Hello Everyone, I've been reviewing the str-utils package, and I'd like to propose a few changes to the library. I've included the code at the bottom. USE MULTI-METHODS I'd like to propose re-writing the following methods to used multi- methods. Every single method will take an input called in

Re: Mapping a function over a map's values

2009-03-23 Thread David Sletten
On Mar 23, 2009, at 5:24 AM, Jeff Valk wrote: > > On Mon, 23 Mar 2009 at 03:29, Mark Engelberg wrote: > >> But it traverses m twice, which is likely to be less efficient. > > I wondered about this too, and actually no. I think Mark was referring to the call to 'keys'. But apparently Clojure d

Re: parallel iteration

2009-03-23 Thread pmf
On Mar 24, 12:01 am, Rowdy Rednose wrote: > Hi group, > > say I have 2 sequences > > (def seq-a '("a1" "a2" "a3")) > (def seq-b '("b1" "b2" "b3")) > > and want to iterate over them in parallel, like this > > (par-doseq [a seq-a b seq-b] (prn a b)) > > which should print > > "a1" "b1" > "a2" "b2"

Re: Trying to get a list of random numbers using repeat

2009-03-23 Thread Krešimir Šojat
> user=> (repeat 10 (rand-int 49)) > (4 4 4 4 4 4 4 4 4 4) Hi, (rand-int 49) will produce one integer, and repeat will repeat it 10 times, that is why you see same number repeated. To fix this use: user=> (take 10 (repeatedly #(rand-int 49))) (21 29 9 20 15 34 8 28 16 26) -- Krešimir Šojat --~-

Trying to get a list of random numbers using repeat

2009-03-23 Thread Paul Drummond
Hi all, user=> (repeat 10 (rand-int 49)) (4 4 4 4 4 4 4 4 4 4) Can someone please tell me why this doesn't work? It must be something obvious but I can't see the wood for the trees right now - it's late and my head hurts! Thanks, Paul. -- Iode Software Ltd, registered in England No. 6299803.

Re: STM and useful concurrency

2009-03-23 Thread Luc Prefontaine
On Mon, 2009-03-23 at 14:49 -0500, Cosmin Stejerean wrote: > > > The fact that B is tried once concurrently with A, and is then aborted > and retried is in my opinion the same as transaction B being stuck > waiting on a lock while A is being processed, but I can see how trying > B concurrently

Re: ANN: Preliminary Clojure Support in Buildr

2009-03-23 Thread Christian Vest Hansen
On Thu, Feb 26, 2009 at 8:36 PM, Daniel Spiewak wrote: > >> > > Note that you cannot mix Java and Clojure sources within the same >> > > project. > > It is supported in the latest changeset.  The following configurations > are possible: > > - > Just Clojure: >  * src/main/cloj

parallel iteration

2009-03-23 Thread Rowdy Rednose
Hi group, say I have 2 sequences (def seq-a '("a1" "a2" "a3")) (def seq-b '("b1" "b2" "b3")) and want to iterate over them in parallel, like this (par-doseq [a seq-a b seq-b] (prn a b)) which should print "a1" "b1" "a2" "b2" "a3" "b3" The way I do it currently is using "map" (and "last" to

Re: version of -> short-circuiting on nil

2009-03-23 Thread Laurent PETIT
Hello, there has been plenty of time to speak about that in the previous thread on the subject, and it's a shame these interesting proposals had to wait for the release of the functionality to pop up :-). But I think it's my fault: when nobody did additional comments on the thread, I considered o

Re: What makes Clojure an easier Lisp?

2009-03-23 Thread rob
I don't think anyone would claim that Clojure is an easier Lisp, if anything it is harder. Programming in Common Lisp or Scheme is very simple. Clojure on the other hand is like CL or Scheme with additional cognitive demands on the programmer to think about functional and concurrent programming

Re: User contributed packages (Cabel, CPAN, etc)

2009-03-23 Thread Laurent PETIT
2009/3/23 Phil Hagelberg > > Bradbev writes: > > > I feel that the next big growth phase for Clojure will be in the user > > community and the code that we can generate. A good package manager > > will help fuel that growth. > > I agree. The more I work with packages that have dependencies the

Re: PATCH: universal parent type for Clojure hierarchies

2009-03-23 Thread Meikel Brandmeyer
Hi, Am 23.03.2009 um 11:17 schrieb Konrad Hinsen: I added one more fix to this patch: 8) The docstring of defmulti now says that the optional hierarchy argument must be a var referring to a hierarchy, rather than the hierarchy itself. This is not correct. defmulti may take any of Clojure's r

Re: Problem with CLASSPATH

2009-03-23 Thread Rich
Let me clarify my last post. In both cases, the directory was on the class path (either implicitly as ".", or explicitly given the absolute path). However, in both cases I got the same FileNotFound exception. -Rich- On Mar 23, 6:39 am, Rich wrote: > "." should be set by default. I verified tha

Re: STM and useful concurrency

2009-03-23 Thread Cosmin Stejerean
On Mon, Mar 23, 2009 at 2:36 PM, Mark Volkmann wrote: > > > In the case where two transactions need to modify the same Ref they > > definitely to be serialized, either by explicitly using locks in Java, or > by > > letting Clojure automatically retry one of them. In either case it about > the > >

Re: STM and useful concurrency

2009-03-23 Thread Raoul Duke
> that was happening? I know I could insert my own code to track that, > but it seems like this may be a commonly needed tool for Clojure to > detect excessive conflicts/retries in transactions. Maybe we could set > a special variable like *track-retries* that would cause Clojure to > produce a te

Re: STM and useful concurrency

2009-03-23 Thread Mark Volkmann
On Mon, Mar 23, 2009 at 11:19 AM, Cosmin Stejerean wrote: > > On Sun, Mar 22, 2009 at 9:12 PM, Mark Volkmann > wrote: >> >> I'm trying to understand the degree to which Clojure's STM provides >> more concurrency than Java's blocking approach. I know it's difficult >> to make generalizations and

Re: I need help tracking down a performance problem.

2009-03-23 Thread Christophe Grand
Hi Vincent! Vincent Foley a écrit : > Using the new versions of null-string and read-field-aux that you gave > me, in my real application, the execution time went from 160 seconds > to 150 seconds. As for using macros, I wrote one for the example > program, but I realized that it wouldn't work i

Re: Information Hiding

2009-03-23 Thread Joshua Fox
> I was envisioning .. only traverse the "public keys" You could provide a function which uses select-keys to return a new map with only the public* *keys. This can be seen as an interface into the map held in the ref for "read" access, though not for "write". Joshua --~--~-~--~~--

Re: March 20th 2009 Rich Hickey Appreciation Day!

2009-03-23 Thread Albert Cardona
> Thank you so much Rich to ease our collective pain !!! > Gaudeamus igitur ... Albert -- Albert Cardona http://albert.rierol.net --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

Re: Information Hiding

2009-03-23 Thread Konrad Hinsen
On Mar 23, 2009, at 18:20, Mark Engelberg wrote: > standard maps. I guess, loosely speaking, I was envisioning a model > in which seq on a hash map would only traverse the "public keys", so > that library functions will work on your objects, without exposing > innards. But perhaps there is no c

Re: Information Hiding

2009-03-23 Thread Mark Engelberg
On Mon, Mar 23, 2009 at 10:09 AM, Konrad Hinsen wrote: > You seem to envisage exposing some aspects of your data structure as > part of the public API and have others reserved for use by > "authorized" support function. Could you give an example of a > situation where this would be advantageous c

Re: Information Hiding

2009-03-23 Thread Konrad Hinsen
On Mar 23, 2009, at 9:27, Mark Engelberg wrote: > still be essential to the notion of equality). Any other tricks or > techniques for helping to hide or separate out the portions of a data > structure that are meant to be accessed or "altered" from the portions > that should only be accessed and

Re: Problem with CLASSPATH

2009-03-23 Thread Rich
"." should be set by default. I verified that it was set using (. System getProperties). I also tried explicitly setting the absolute path using -cp. No luck on either count. -Rich- On Mar 23, 5:14 am, revoltingdevelopment wrote: > I also had the NO_SOURCE_FILE error when using contrib packages

Re: March 20th 2009 Rich Hickey Appreciation Day!

2009-03-23 Thread Tom Faulhaber
I'll jump on this bandwagon, too! I had Rich's talk on "Clojure for Lisp Programmers" bookmarked for a couple of months last year and was afraid to watch it because I had a feeling I might be unable to resist the lure of Clojure. Finally, in early November, I watched the video. I was hooked. Suc

Re: STM and useful concurrency

2009-03-23 Thread Cosmin Stejerean
On Sun, Mar 22, 2009 at 9:12 PM, Mark Volkmann wrote: > > I'm trying to understand the degree to which Clojure's STM provides > more concurrency than Java's blocking approach. I know it's difficult > to make generalizations and that specific applications need to be > measured, but I'll give it a g

Re: Can Clojure simulate Class?Lisp can!

2009-03-23 Thread Dan
2009/3/19 Edward Shen > > Hello,guys! > I'm reading 《Programming Clojure》. I've seen closure. But I > haven't seen how simulate Class. > Lisp can simulate Class by closure and nest Function. > Example: >(define (make-account balance) > (define (withdraw amount) > (if (>= balance amou

Re: I need help tracking down a performance problem.

2009-03-23 Thread Vincent Foley
Using the new versions of null-string and read-field-aux that you gave me, in my real application, the execution time went from 160 seconds to 150 seconds. As for using macros, I wrote one for the example program, but I realized that it wouldn't work in my application, because I sometimes use (ap

Re: Ant and debian 5.0 version issues

2009-03-23 Thread Dan Beauchesne
Thanks man. Removing gcj does the trick. Sorry for the noise. --~--~-~--~~~---~--~~ 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 g

Re: Mapping a function over a map's values

2009-03-23 Thread Jeff Valk
On Mon, 23 Mar 2009 at 10:48, Konrad Hinsen wrote: > It is already in clojure.contrib, with exactly that implementation, > and for exactly that reason: Well I'm glad we agree then. :-) And thanks for the pointer. -Jeff --~--~-~--~~~---~--~~ You received this m

Re: Slime errors with clojure_20090320

2009-03-23 Thread suresh
When I was faced with the very same issue, removing .slime directory from my home directory seems to have 'fixed' the issue. Cheers, suresh On Mar 23, 6:51 am, Dan Pomohaci wrote: > Hi, > > When I start slime with the new clojure_20090320 in classpath I get the > messages: > user=> user=> java

Re: Mapping a function over a map's values

2009-03-23 Thread Konrad Hinsen
On Mar 23, 2009, at 16:36, Jeff Valk wrote: >> I prefer the into version which allows to write a mapmap that >> preserves the >> map type (eg sorted or hash): >> >> (defn mapmap [f m] >> (into (empty m) (for [[k v] m] [k (f v)]))) > > Agreed. If it were in contrib, this would make most sense.

Re: Mapping a function over a map's values

2009-03-23 Thread Jeff Valk
On Mon, 23 Mar 2009 at 07:57, Christophe Grand wrote: > I prefer the into version which allows to write a mapmap that preserves the > map type (eg sorted or hash): > > (defn mapmap [f m] > (into (empty m) (for [[k v] m] [k (f v)]))) Agreed. If it were in contrib, this would make most sense.

Re: Mapping a function over a map's values

2009-03-23 Thread Jeff Valk
On Mon, 23 Mar 2009 at 03:29, Mark Engelberg wrote: > But it traverses m twice, which is likely to be less efficient. I wondered about this too, and actually no. Zipmap is efficient. It constructs its return map in a single loop from two lazy seqs. Performance is practically identical to the "

Re: Slime errors with clojure_20090320

2009-03-23 Thread Paul Stadig
There was some talk in the IRC channel on Friday about "releases" http://clojure-log.n01se.net/date/2009-03-20.html#10%3a17 One of the things mentioned was adding some way to detect (at runtime) the version of Clojure. I realize it is more complicated because we're on the bleeding edge here and w

Re: Problem with CLASSPATH

2009-03-23 Thread revoltingdevelopment
I also had the NO_SOURCE_FILE error when using contrib packages, upon upgrade to 20090320. My CLASSPATH included ".". I had to revert to starting clojure with an explicit -cp. I'm new to both Java and Clojure, but this led me to think my CLASSPATH was being ignored. I chalked it up to my misun

Re: What makes Clojure an easier Lisp?

2009-03-23 Thread Konrad Hinsen
On Mar 22, 2009, at 21:26, Joshua Fox wrote: > I dove into Lisp and Scheme several times in the past, but only > with Clojure did Lisp really "catch"? > > 1. Clojure abandons the 1950's cruft, with all-caps and > abbreviations like SETQ and CDR. However, Scheme does this too, > without ach

Re: Slime errors with clojure_20090320

2009-03-23 Thread David Nolen
You need to make sure all the different moving parts are based on the newest version of Clojure as well. This includes swank-clojure, clojure-mode, and any other libs you might be using. On Mon, Mar 23, 2009 at 9:51 AM, Dan Pomohaci wrote: > > Hi, > > When I start slime with the new clojure_20090

Re: Information Hiding

2009-03-23 Thread David Nolen
You could always build something where setters/getters are auto-magically created if specified by the constructor macro. And with clojure.contrib.def you could auto-magically generate private setters/getters. On Mon, Mar 23, 2009 at 4:27 AM, Mark Engelberg wrote: > > I've been thinking quite a bi

Re: Java Posse exposure

2009-03-23 Thread MarkH
Thanks for the article. I found it very informative. --~--~-~--~~~---~--~~ 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

Re: User contributed packages (Cabel, CPAN, etc)

2009-03-23 Thread Laurent PETIT
2009/3/23 Warren > > Sounds like OSGi. Any progress on Clojure working with OSGi? Hello, For the general OSGi infrastructure, I don't know. For Eclipse in particular, yes: I've succesfully run a "proof of concept" class from within clojuredev. To be able to do that, I have used the Eclipse "b

Slime errors with clojure_20090320

2009-03-23 Thread Dan Pomohaci
Hi, When I start slime with the new clojure_20090320 in classpath I get the messages: user=> user=> java.lang.Exception: Unable to resolve symbol: lazy-cons in this context (core.clj:70) user=> user=> java.lang.Exception: No such var: swank.swank/ignore-protocol-version (NO_SOURCE_FILE:5) user=

Re: Mapping a function over a map's values

2009-03-23 Thread Konrad Hinsen
On Mar 23, 2009, at 14:26, Mark Volkmann wrote: >> That leaves the question whether there is still any need for the >> clojure.lang.ISeq implementation. At the moment it is used for lists, >> but that is not particularly consistent. I guess I will remove it. > > Maybe you should keep it to suppor

Part 3 of the monad tutorial

2009-03-23 Thread Konrad Hinsen
I just published part 3 of my monad tutorial for Clojure: http://onclojure.com/2009/03/23/a-monad-tutorial-for-clojure- programmers-part-3/ This part's topics are - m-zero, m-plus, and :when clauses in domonad - the state monad As always, don't hesitate to leave your comments on the bl

Re: Problem with CLASSPATH

2009-03-23 Thread Mark Volkmann
On Mon, Mar 23, 2009 at 7:34 AM, Rich wrote: > > Structure.clj does call ns as shown below: > > (ns Structure) > > So, as far as I can tell, Clojure should look for Structure.clj in the > class path. At least, that's what it used to do. I guess I could move > all the code into a sub-directory, an

Re: Mapping a function over a map's values

2009-03-23 Thread Mark Volkmann
On Mon, Mar 23, 2009 at 7:04 AM, Konrad Hinsen wrote: > > On Mar 23, 2009, at 12:15, Mark Volkmann wrote: > >>> Look at clojure.contrib.generic.functor/fmap. It does what you need >>> for maps, for all the other Clojure collections (where it works like >>> map except that its return value is a co

STM implementation question

2009-03-23 Thread Tom Davies
I'm struggling to understand the following lines of code from clojure.lang.LockingTransaction.run: if (ref.tvals == null) { ref.tvals = new Ref.TVal(e.getValue(), commitPoint, msecs); } else if (ref.faults.get() > 0) {

Re: Information Hiding

2009-03-23 Thread Stuart Sierra
On Mar 23, 7:30 am, Mark Volkmann wrote: > I hadn't run across :: before. How do you determine the namespace of a > keyword? I'd like to see the difference between > > (def k1 :a)  and  (def k2 ::b) > > Of course both create vars (k1 and k2) in the user namespace by > default, but I want to under

Re: Mapping a function over a map's values

2009-03-23 Thread Christophe Grand
I prefer the into version which allows to write a mapmap that preserves the map type (eg sorted or hash): (defn mapmap [f m] (into (empty m) (for [[k v] m] [k (f v)]))) Christophe On Mon, Mar 23, 2009 at 7:53 AM, Jeff Valk wrote: > > On Sun, 22 Mar 2009 at 23:27, Jeff Valk wrote: > > > Ah, go

Month/Day names

2009-03-23 Thread David Sletten
Is there a simpler way to do this? (defn get-months [] (drop-last (.getMonths (java.text.DateFormatSymbols. (defn get-weekdays [] (drop 1 (.getWeekdays (java.text.DateFormatSymbols. Aloha, David Sletten --~--~-~--~~~---~--~~ You received this mess

Re: March 20th 2009 Rich Hickey Appreciation Day!

2009-03-23 Thread jim
Ditto. > March 20th 2009 Rich Hickey Appreciation Day > > -Rayne --~--~-~--~~~---~--~~ 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

Re: Problem with CLASSPATH

2009-03-23 Thread Rich
Structure.clj does call ns as shown below: (ns Structure) So, as far as I can tell, Clojure should look for Structure.clj in the class path. At least, that's what it used to do. I guess I could move all the code into a sub-directory, and rename all the namespaces--but I'd rather keep it organize

Re: User contributed packages (Cabel, CPAN, etc)

2009-03-23 Thread Warren
Sounds like OSGi. Any progress on Clojure working with OSGi? On Mar 22, 9:59 pm, Phil Hagelberg wrote: > Bradbev writes: > > I feel that the next big growth phase for Clojure will be in the user > > community and the code that we can generate.  A good package manager > > will help fuel that gr

Re: Shouldn't all defs have a - version?

2009-03-23 Thread Phlex
On 23/03/2009 9:03, Mark Engelberg wrote: > defn- is pretty useful. But wouldn't it be equally useful to have > def-, defmulti-, defmacro-, etc.? > > I'm aware that it is possible to add the private tag to the metadata > of the var, but in many code samples I've seen, people routinely get > this

Re: Mapping a function over a map's values

2009-03-23 Thread Konrad Hinsen
On Mar 23, 2009, at 12:15, Mark Volkmann wrote: >> Look at clojure.contrib.generic.functor/fmap. It does what you need >> for maps, for all the other Clojure collections (where it works like >> map except that its return value is a collection of the same type as >> the input value), and you can i

Re: Possible Bug In clojure.zip/remove

2009-03-23 Thread Jason Sankey
Frantisek Sodomka wrote: > On Mar 19, 12:58 pm, Jason Sankey wrote: >> Also, is there somewhere I can contribute test cases for this to >> prevent a future regression? > > Tests for clojure.zip can from now on go to test-clojure.clojure-zip: > http://code.google.com/p/clojure-contrib/source/brow

Re: Problem with CLASSPATH

2009-03-23 Thread Mark Volkmann
On Mon, Mar 23, 2009 at 4:59 AM, Rich wrote: > > Hi, > > I'd been using the 20081217 release. The following code worked, as > long as Structure was in the working directory: > > Clojure > user=> (use 'Structure) > nil > > However, after I updated to 20090320, I get the following errors: > > Cloju

Re: Information Hiding

2009-03-23 Thread Mark Volkmann
On Mon, Mar 23, 2009 at 3:27 AM, Mark Engelberg wrote: > > I suspect that if you use double-colon keywords for the keys, you get > a bit more privacy in the sense that these keys are slightly harder to > accidentally manipulate from other namespaces, so perhaps that could > at least be an informa

Re: March 20th 2009 Rich Hickey Appreciation Day!

2009-03-23 Thread Paul Drummond
I'm (fashionably?) late to share my appreciation. Excellent language - I can only imagine good things for Clojure in the future. Thanks Rich! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post

Re: Mapping a function over a map's values

2009-03-23 Thread Mark Volkmann
On Mon, Mar 23, 2009 at 3:11 AM, Konrad Hinsen wrote: > > On 22.03.2009, at 21:10, Jon Nadal wrote: > >> I often need to map a function over the values of a map while >> preserving keys--something like: > ... >> Is there a more concise way to do this in Clojure?  If not, is this >> something that

PATCH: universal parent type for Clojure hierarchies

2009-03-23 Thread Konrad Hinsen
The attached patch to clojure.core implements an optional universal parent type for Clojure hierarchies and defines such a type for the global default hierarchy. With this patch applied, Clojure passes the test_clojure and test_contrib test suites in clojure.contrib. I also tested it with a

Problem with CLASSPATH

2009-03-23 Thread Rich
Hi, I'd been using the 20081217 release. The following code worked, as long as Structure was in the working directory: Clojure user=> (use 'Structure) nil However, after I updated to 20090320, I get the following errors: Clojure user=> (use 'Structure) java.io.FileNotFoundException: Could not

Re: March 20th 2009 Rich Hickey Appreciation Day!

2009-03-23 Thread Timothy Pratley
double thumbs up :) --~--~-~--~~~---~--~~ 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...@g

Re: Information Hiding

2009-03-23 Thread Mark Engelberg
Yes, the :private metadata tag is probably the simplest way to make the whole object private, and then just expose the manipulation functions. The closure solution is similar in this regard. I guess the point I failed to convey is that I'm really wondering if there's a way to effectively make so

Re: March 20th 2009 Rich Hickey Appreciation Day!

2009-03-23 Thread Konrad Hinsen
On Mar 22, 2009, at 11:47, stephaner wrote: > I join the crowd too, Me too! Like many here, I have used lots of languages over time, starting with Microsoft Basic in 1982 and ranging from various Assemblers via C and Fortran to more recent high-level languages. For the last twelve years,

Re: Information Hiding

2009-03-23 Thread Joshua Fox
> Any other tricks or techniques There is defn- as well as the :private metadata tag. Joshua --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, se

Re: Problem with SwingWorker and proxy-super

2009-03-23 Thread timc
Thanks for that Tim - perfect. On Mar 19, 11:49 pm, Timothy Pratley wrote: > http://clojure.org/java_interop > "Note that while method fns can be provided to override protected > methods, they have no other access to protected members, nor to super, > as these capabilities cannot be proxied." >

Re: Information Hiding

2009-03-23 Thread David Sletten
On Mar 22, 2009, at 10:27 PM, Mark Engelberg wrote: > > I've been thinking quite a bit about the OO side of Clojure the past > couple of days, and trying to figure out how common OO design patterns > would look when ported over to Clojure's way of doing things. > > The most obvious thing that ot

Re: Clojure talk at TSS

2009-03-23 Thread Mark Engelberg
On Mon, Mar 23, 2009 at 1:45 AM, Howard Lewis Ship wrote: > If you have a long running process that continually modifies a > collection and retains the new version ... does the new version retain > the old version?  For how long? In general, I think it's safe to assume that anything in the old v

Clojure talk at TSS

2009-03-23 Thread Howard Lewis Ship
I had a good time presenting an overview of Clojure at this years TheServerSide Java Symposium. A few questions from the crowd (of about 15 attendees) that I couldn't accurately respond to: 1) What prevents thread starvation when using (dosync) and ref's? It seems to me that conflicting transac

Re: Mapping a function over a map's values

2009-03-23 Thread Mark Engelberg
On Sun, Mar 22, 2009 at 11:53 PM, Jeff Valk wrote: > For the record, I think the original approach is the most clear. And it's > actually shorter. > > (defn mapmap [f m] >  (zipmap (keys m) (map f (vals m But it traverses m twice, which is likely to be less efficient. --~--~-~--~--

Information Hiding

2009-03-23 Thread Mark Engelberg
I've been thinking quite a bit about the OO side of Clojure the past couple of days, and trying to figure out how common OO design patterns would look when ported over to Clojure's way of doing things. The most obvious thing that others have noted is that you can effectively simulate a mutable ob

Re: What's a convenient way of calling super.method()?

2009-03-23 Thread Mark Engelberg
On Sun, Mar 22, 2009 at 1:17 PM, CuppoJava wrote: > So, considering it seems that not many other people have run into this > issue, can I assume that most people just haven't had a need to call a > super multi-method? Is it a bad design choice to call your inherited > methods? I haven't needed t

Re: Mapping a function over a map's values

2009-03-23 Thread Konrad Hinsen
On 22.03.2009, at 21:10, Jon Nadal wrote: > I often need to map a function over the values of a map while > preserving keys--something like: ... > Is there a more concise way to do this in Clojure? If not, is this > something that might be worth putting in the contrib? Look at clojure.contrib.g

Shouldn't all defs have a - version?

2009-03-23 Thread Mark Engelberg
defn- is pretty useful. But wouldn't it be equally useful to have def-, defmulti-, defmacro-, etc.? I'm aware that it is possible to add the private tag to the metadata of the var, but in many code samples I've seen, people routinely get this wrong (I believe you need to attach the metadata to t

Re: Ant and debian 5.0 version issues

2009-03-23 Thread Michael Wood
On Mon, Mar 23, 2009 at 5:11 AM, Dan Beauchesne wrote: > > > Michael Wood writes: >> >> Are you sure it's not trying to use gcj instead of Sun java? >> >> What do "java -version" and "javac -version" give you?  And does >> "update-alternatives --list java" or javac print anything? > > java -vers