Re: Possible namespace bug

2010-05-26 Thread Brent Millare
Hi Meikel, Well if #'user/x is the correct behavior, then the repl behavior needs to be fixed. Either one may be correct but that does not explain the discrepancy. Also I agree that eval should be avoided, but I found an extreme case where it was necessary (due to the desired side effect of

Re: Possible namespace bug

2010-05-26 Thread Brent Millare
Ah wait, I may have read that wrong. So what I understand is because I am calling it from the the -e, it is ran in the user ns. Ok that makes sense. On May 26, 2:28 am, Brent Millare brent.mill...@gmail.com wrote: Hi Meikel, Well if #'user/x is the correct behavior, then the repl behavior

Re: Possible namespace bug

2010-05-26 Thread Meikel Brandmeyer
Hi, On May 26, 8:35 am, Brent Millare brent.mill...@gmail.com wrote: Ah wait, I may have read that wrong. So what I understand is because I am calling it from the the -e, it is ran in the user ns. Ok that makes sense. Exactly! And in the Repl you are still in the bar namespace. Doing a

Re: Why is MVCC history managed manually?

2010-05-26 Thread Peter
Hi Rich, maybe this is a better way of looking at it. When you create a transaction, you get a new UnitOfTime object that has the sequential timestamp in it. The Transaction object keeps a reference to the UnitOfTime object for the rest of the Transaction objects life. private static final

Re: weird repl + classloader behavior

2010-05-26 Thread Erik Söhnel
On 25 Mai, 08:03, Brent Millare brent.mill...@gmail.com wrote: Erik, what you said seems to make sense. So the question now is, since a new classloader is started during each eval at the repl, does that mean that it is closed after each repl statement? This seems to be the case because after

Question on bound-fn source

2010-05-26 Thread YD
(defmacro bound-fn [ fntail] `(bound-fn* (fn ~...@fntail))) Shouldn't it be: (fn [] ~...@fntail) ? If you try to use this function by passing more than one function as arguments to it, you'll get an exception. e.g. (bound-fn f1 f2) I'm a newbie to clojure and I'm not quite sure if this is a

Stockholm Clojure User Group

2010-05-26 Thread Patrik Fredriksson
Hi! There is now a Clojure user group in Stockholm, Sweden (via http://twitter.com/peter_hultgren/status/14648902541). Join us at http://groups.google.com/group/stockholm-clojure-user-group /Patrik -- You received this message because you are subscribed to the Google Groups Clojure group. To

Re: Question on bound-fn source

2010-05-26 Thread Meikel Brandmeyer
Hi, On May 26, 12:41 pm, YD ydong.pub...@gmail.com wrote: (defmacro bound-fn   [ fntail]   `(bound-fn* (fn ~...@fntail))) Shouldn't it be: (fn [] ~...@fntail) ? If you try to use this function by passing more than one function as arguments to it, you'll get an exception. e.g. (bound-fn

Re: Why is MVCC history managed manually?

2010-05-26 Thread Rich Hickey
On May 25, 11:29 am, Peter peter.r.fos...@gmail.com wrote: Hi Rich, If you set up your object dependencies correctly then the objects you want will stay in memory. Your history list would be a list of WeakReference so it could be GC'd. This is nothing about read tracking, more about

Re: weird repl + classloader behavior

2010-05-26 Thread Brent Millare
Hi Erik, From what I understand, to close a classloader, you would need to also remove all references to it or set the references to it to nil/null. In the case of an eval in the repl, again I'm assuming we do lose that reference once we are out of the scope of the eval. While I said not

non-monolithic contrib build, starting with matchure

2010-05-26 Thread Stuart Halloway
Based on the discussion of release granularity that started with the proposed move of matchure to contrib [1], we are going to start doing granular builds of Clojure. Matchure can be the first: It can be part of the full contrib build, but also released as a standalone library with its own

Re: Question on bound-fn source

2010-05-26 Thread YD
Thank you, now I see the point. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from

Re: Why is MVCC history managed manually?

2010-05-26 Thread Peter
Hi Rich, First, and foremost, it creates interaction relationships between transactions that otherwise have no overlap. You see this in the memory blowup during overlapping transactions. This rubs against a design objective in Clojure's STM to absolutely minimize transactional overlap and

Re: promoting contrib.string to clojure, feedback requested

2010-05-26 Thread Stuart Halloway
Stu, What happened to *not* promoting string? Changed our mind. It helps keep the people with prerelease books busy. ;-) Seriously: I did an audit of several third-party libraries, and concluded that for some libs, the presence of these string functions in core could be the make-or-break

Re: promoting contrib.string to clojure, feedback requested

2010-05-26 Thread Mark Engelberg
Are these going to be in their own namespace (clojure.string), or in core? I hope the former, because many of these names (replace, reverse, join, split) are too valuable to be dedicated only to strings. -- You received this message because you are subscribed to the Google Groups Clojure group.

Re: promoting contrib.string to clojure, feedback requested

2010-05-26 Thread Stuart Halloway
Definitely! It will be clojure.string. Ticket updated to reflect this. Are these going to be in their own namespace (clojure.string), or in core? I hope the former, because many of these names (replace, reverse, join, split) are too valuable to be dedicated only to strings. -- You received

Re: promoting contrib.string to clojure, feedback requested

2010-05-26 Thread Sean Devlin
Stu Halloway, Changes like this are a nuisance as a documentation guy :| It makes Beta seem further away, but it's a tough call and someone has to make it. Such is life on the edge. As far as technical feedback goes, it seems like a VERY useful list to promote to core. There are a few things

Re: promoting contrib.string to clojure, feedback requested

2010-05-26 Thread Fogus
Changed our mind. It helps keep the people with prerelease books   busy. ;-) Oh great! I'm going to have to cancel my appearance on The View because of this. I have mentioned my gripes in the IRC, but for public view I would love better names for chomp and chop. In isolation those names are

Re: promoting contrib.string to clojure, feedback requested

2010-05-26 Thread Peter Schuller
chomp = rtrim (rtrim foo\n) = foo is much more clear to me, plus it leaves the door open for trim and ltrim functions should the need arise. I like this. And in general I often fine the entire trio useful, and adopting the ltrim/trim/rtrim naming makes it nice and tidy. While I recognize the

Re: promoting contrib.string to clojure, feedback requested

2010-05-26 Thread Brian Carper
On May 26, 8:16 am, Stuart Halloway stuart.hallo...@gmail.com wrote: If you are a user of clojure.contrib.string, please take a look at the   proposed promotion to clojure [1]. Feedback welcome! It is my hope   that this promotion has enough batteries included that many libs can   end their

Re: promoting contrib.string to clojure, feedback requested

2010-05-26 Thread Mike Meyer
On Wed, 26 May 2010 19:47:25 +0200 Peter Schuller peter.schul...@infidyne.com wrote: chomp = rtrim (rtrim foo\n) = foo is much more clear to me, plus it leaves the door open for trim and ltrim functions should the need arise. I like this. And in general I often fine the entire trio

Re: promoting contrib.string to clojure, feedback requested

2010-05-26 Thread Brian Carper
On May 26, 10:29 am, Fogus mefo...@gmail.com wrote: I have mentioned my gripes in the IRC, but for public view I would love better names for chomp and chop.  In isolation those names are meaningless, so I suggest: Almost every name in a programming language is meaningless in isolation. But we

Re: promoting contrib.string to clojure, feedback requested

2010-05-26 Thread Fogus
chomp has a clear meaning to anyone who's touched Perl/Ruby/shell- scripting. Believe me I can sympathize with this, but just because they are well- known to some doesn't mean that they are good names. On that note, just because rtrim and less make sense to me... you know the rest. :-) :f

question about agent implementation

2010-05-26 Thread Michael Harrison (goodmike)
I'm preparing a presentation about asynchronous concurrency in Clojure, and I'm planning on talking a bit about how Clojure's constructs make good, sensible use of Java's concurrency libraries. My question is about clojure.lang.Agent. In the doRun method, I'm missing what prevents a race condition

Re: question about agent implementation

2010-05-26 Thread Peter Schuller
question is about clojure.lang.Agent. In the doRun method, I'm missing what prevents a race condition in the updating of the agent's state variable. Unless I am misunderstanding the context in which the code runs, I believe it is correct because doRun() is guaranteed never to run concurrently

Re: matchure becoming clojure.contrib.match

2010-05-26 Thread Drew Colthorp
Good point Ben. That change was obviously ill-conceived. On May 25, 7:16 am, B Smith-Mannschott bsmith.o...@gmail.com wrote: On Mon, May 24, 2010 at 05:41, Drew Colthorp dcolth...@gmail.com wrote: A few weeks ago I announced a pattern matching library called matchure. I'm excited to say it's

Re: promoting contrib.string to clojure, feedback requested

2010-05-26 Thread Mohammad Khan
This thread has potential to be the longest thread of clojure mailing list! personally, I like strip or trim than chomp/chop. On Wed, May 26, 2010 at 2:08 PM, Fogus mefo...@gmail.com wrote: chomp has a clear meaning to anyone who's touched Perl/Ruby/shell- scripting. Believe me I can

Re: promoting contrib.string to clojure, feedback requested

2010-05-26 Thread Praki Prakash
personally, I like strip or trim than chomp/chop. +1 Seeing how Clojure dropped/changed many classic Lisp monikers, there is no reason to use comp/chop which may be familiar to somebody with Perl/Python but confusing to others. -- You received this message because you are subscribed to the

Re: Todo item annotation in Clojure.

2010-05-26 Thread Thomas
Thanks to sids, the project now has lein todo functionality. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your

Re: promoting contrib.string to clojure, feedback requested

2010-05-26 Thread Justin Kramer
I've done Perl coding and I still mix up chomp and chop. The meaning of trim, ltrim, and rtrim is immediately clear to me. trim, ltrim, and rtrim could take an optional argument for characters to strip: (rtrim foo) ;; strip trailing whitespace (rtrim foo \r\n) ;; equivalent to chomp If

Re: question about agent implementation

2010-05-26 Thread Peter Schuller
Unless I am misunderstanding the context in which the code runs, I Which I was. Please ignore my previous post (sorry, think before I post... think before I post...) and consider me joined in the OP's question. -- / Peter Schuller -- You received this message because you are subscribed to

Re: Announcing Clojure/core

2010-05-26 Thread Luke VanderHart
Very cool. The website doesn't say... how was/is the Clojure/core team selected? Are they all Relevance employees, or freelance? Do you plan on ever bringing more people on board? Although I'm not quite as qualified as some of the others, that's something I'd potentially be very interested in,

Re: question about agent implementation

2010-05-26 Thread Peter Schuller
Unless I am misunderstanding the context in which the code runs, I Which I was. Please ignore my previous post (sorry, think before I post... think before I post...) and consider me joined in the OP's question. And every time this happens I wonder if I should just leave it to avoid flooding

Re: Anyone experienced in using clojure as a database

2010-05-26 Thread Luke VanderHart
Clojure is not a great choice for this. It's oriented as a programming language, not a database. It doesn't have any built-in persistence mechanisms, and while it has many virtues, it's a little bit of a memory hog. That isn't really what you want in an in-memory DB. For anything more than a toy

Re: promoting contrib.string to clojure, feedback requested

2010-05-26 Thread Stuart Halloway
The people have spoken! The trims have it! Stu I've done Perl coding and I still mix up chomp and chop. The meaning of trim, ltrim, and rtrim is immediately clear to me. trim, ltrim, and rtrim could take an optional argument for characters to strip: (rtrim foo) ;; strip trailing

Re: promoting contrib.string to clojure, feedback requested

2010-05-26 Thread Stuart Sierra
On May 26, 12:42 pm, Sean Devlin francoisdev...@gmail.com wrote: I'd like to see a specific proposal for replace replace-first. Stuart Sierra put a lot of effort into getting those fns the way they are in contrib, and we should be careful to not undo any lessons learned in the process. Yes,

Some suggestions for transients

2010-05-26 Thread Michael Jaaka
Hi! I have some suggestions about transients (btw. the http://clojure.org/transients is not linked from http://clojure.org). Maybe before you give up reading the whole post I will post as first the digression: vars binding and transient are similar, however in the first case we have thread

Re: question about agent implementation

2010-05-26 Thread Michael Harrison (goodmike)
Thanks for your post, Peter. I'm tracing the code, and it's interesting. The interesting point is definitely the agent's aq member, the AtomicReference that wraps an ActionQueue. The aq.compareAndSet call keeps the value of the ActionQueue from switching out form under us while we attempt to set

Re: question about agent implementation

2010-05-26 Thread Peter Schuller
Where is Action's execute method called in the event the queue is not empty? If the agent's queue was non-empty from the perspective of enqueue(), that means one of the following is true: (1) A previous enqueue() has already scheduled the execution of an action, but it has not yet begun

Re: question about agent implementation

2010-05-26 Thread Michael Harrison (goodmike)
OK, chouser gave me the explanation on IRC. It's amazing that we can pop into #clojure and there's one of the two people who've touched this file. Thanks, chouser! The compareAndSet (CAS) that protects the agent's queue from overlapping updates forces the agent's actions into serial execution.

Re: question about agent implementation

2010-05-26 Thread Michael Harrison (goodmike)
Thanks for the explanation, Peter, and for accompanying me on this journey into the unknown. Your description of enqueue is what chouser explained to me too. Someday I have to write some code with a queue named eat so that eat will pop itself. Cheers, Michael On May 26, 5:54 pm, Peter Schuller

labrepl dependencies

2010-05-26 Thread Harrison Maseko
Hi all, The instructions on the labrepl git page says to download missing dependencies of the labrepl. For some reason I cannot download them in NetBeans running on Ubuntu 10.04. Can I also just download them manually one by one? If so, what, specifically, are the dependencies that the labrepl

Re: labrepl dependencies

2010-05-26 Thread Base
Hi Harrison. Welcome! I am not familiar with netbeans but reading the labrepl instructions it appears that dependencies will auto resolve. Is there an error? Any more info? On May 26, 5:34 pm, Harrison Maseko lis...@gmail.com wrote: Hi all, The instructions on the labrepl git page says to

Re: promoting contrib.string to clojure, feedback requested

2010-05-26 Thread Eric Schulte
Mark Engelberg mark.engelb...@gmail.com writes: If you're developing a trio, like ltrim, trim, rtrim, wouldn't it be better to call them triml, trim, trimr so that they show up next to each other in the alphabetized documentation? +1 for modifiers at the end Let's not forget those of us who

Re: labrepl dependencies

2010-05-26 Thread Paul Hobbs
Harrison, Use leiningen (http://github.com/technomancy/leiningen) and then run lein deps at your command line. -- Paul Hobbs On Wed, May 26, 2010 at 11:34 PM, Harrison Maseko lis...@gmail.com wrote: Hi all, The instructions on the labrepl git page says to download missing dependencies of

NullPointerException on disj

2010-05-26 Thread Allen Johnson
Hey everyone. I was playing around with the protocols/deftype stuff and ran into a weird NullPointerException when calling the satisfies? function. Seems to only happen with a java.lang.Object instance. Clojure 1.2.0-master-SNAPSHOT user= (defprotocol Greeter (greet [this])) Greeter user=