Re: How to migrate definitions to another namespace ?

2009-08-28 Thread Laurent PETIT
Could some kind of :force true flag be generally interesting for the def special form ? (:force true would force an unmap first, if necessary) 2009/8/29 Vagif Verdi > > Thx to all. ns-unmap and remove-ns are what i need. > > From my CL experience i was looking for something like unitern. > > >

Re: How to migrate definitions to another namespace ?

2009-08-28 Thread Vagif Verdi
Thx to all. ns-unmap and remove-ns are what i need. >From my CL experience i was looking for something like unitern. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email t

Re: How to migrate definitions to another namespace ?

2009-08-28 Thread Mike Hinchey
I use (remove-ns 'my-ns), then reload the entire file. -Mike --~--~-~--~~~---~--~~ 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 memb

Re: How to migrate definitions to another namespace ?

2009-08-28 Thread Timothy Pratley
How about something like this? user=> (ns fun) fun=> (defn myfun [] 1) fun=> (defn myfun2 [] 1) fun=> (keys (ns-publics 'fun)) (myfun myfun2) fun=> (doseq [s (keys (ns-publics 'fun))] (ns-unmap 'fun s)) fun=> (myfun) java.lang.Exception: Unable to resolve symbol: myfun in this context (NO_SOURCE

Re: How to migrate definitions to another namespace ?

2009-08-28 Thread J. McConnell
On Aug 28, 2009, at 11:55 PM, Vagif Verdi wrote: > > I often refactor my code and move some functions to new modules. > Unfortunately i cannot load them, because clojure says that function > with such name is already loaded from another namespace. I could not > find nothing better but to close my

How to migrate definitions to another namespace ?

2009-08-28 Thread Vagif Verdi
I often refactor my code and move some functions to new modules. Unfortunately i cannot load them, because clojure says that function with such name is already loaded from another namespace. I could not find nothing better but to close my clojure session (which means bring down the web server) and

Re: Order of keys within a map?

2009-08-28 Thread Travis
Is the number 8 just a magic number? Can it be changed with an environment variable or system variable or binding? I would definitely like to. I am particularly annoyed by how the function into changes my array maps into hash maps when they grow. The type of the first argument is an array map, so

Significant isa? / multimethod optimization opportunity

2009-08-28 Thread Chas Emerick
In the course of doing some profiling tonight, I hit on a hotspot in some particularly multimethod- and isa?-heavy code. It didn't take me long to find that the bases and supers support fns for isa? were at the root of the issue, with bases in particular taking more time in aggregate than

Re: Clojure/EPL and the GPL

2009-08-28 Thread Daniel Renfer
perhaps this link in the FAQ for the EPL will clear things up. http://www.eclipse.org/legal/eplfaq.php#USEINANOTHER On Fri, Aug 28, 2009 at 1:11 PM, Tassilo Horn wrote: > > Matthias Benkard writes: > > Hi Matthias, > >> On 28 Aug., 13:42, Tassilo Horn wrote: >>> I have a licensing question. Am

Re: with-open should use a close multimethod?

2009-08-28 Thread Jarkko Oranen
> I'll submit a patch if it's wanted.  This would fit in core, or maybe > contrib.duck-streams with a slightly different name. This should be in core I think, so that it can work with with-open— unless we're going to duplicate with-open in contrib. :/ -- Jarkko --~--~-~--~~--

Re: Clojure/EPL and the GPL

2009-08-28 Thread Tassilo Horn
Matthias Benkard writes: Hi Matthias, > On 28 Aug., 13:42, Tassilo Horn wrote: >> I have a licensing question. Am I allowed to include clojure.jar in a >> GPL project? > > IANAL, but if I understand the GPL correctly, it prohibits you from > distributing a GPL-covered programme that is based o

Re: Why doesn't regex implement ifn?

2009-08-28 Thread Chas Emerick
On Aug 28, 2009, at 12:13 PM, Chouser wrote: > On Fri, Aug 28, 2009 at 10:01 AM, Shawn > Hoover wrote: >> >> However, unless the platforms agree on literal regex >> syntax (they don't, beyond the basic "asdf|[0-9]+" >> features) will prevent true portability of the literals. > > This is an inte

Re: clj-apache-http not being found in classpath?

2009-08-28 Thread Dan McGrady
Your right, clj-apache-http.jar didn't build properly. It only contained a manifest. When I do "ant" in the /clj-apache-http/ folder I get this (terminal output): http://gist.github.com/177087 I'll try to figure out how to build it properly later today, I'm coming from Ruby so I'm not familiar w

Re: Lazy Exceptions

2009-08-28 Thread B Smith-Mannschott
On Fri, Aug 28, 2009 at 16:57, John Harrop wrote: > On Fri, Aug 28, 2009 at 8:50 AM, Rich Hickey wrote: >> >> On Thu, Aug 27, 2009 at 8:10 PM, Tim Snyder wrote: >> > >> > Well, I can see that LazySeq does indeed catch and wrap all Exceptions >> > in a RuntimeException.  I also think I can work ar

Re: Lazy Exceptions

2009-08-28 Thread Rich Hickey
On Fri, Aug 28, 2009 at 10:57 AM, John Harrop wrote: > On Fri, Aug 28, 2009 at 8:50 AM, Rich Hickey wrote: >> >> On Thu, Aug 27, 2009 at 8:10 PM, Tim Snyder wrote: >> > >> > Well, I can see that LazySeq does indeed catch and wrap all Exceptions >> > in a RuntimeException.  I also think I can work

Re: Why doesn't regex implement ifn?

2009-08-28 Thread Chouser
On Fri, Aug 28, 2009 at 10:01 AM, Shawn Hoover wrote: > > However, unless the platforms agree on literal regex > syntax (they don't, beyond the basic "asdf|[0-9]+" > features) will prevent true portability of the literals. This is an interesting and crucial assertion. If the regex syntaxes do no

Re: clj-apache-http not being found in classpath?

2009-08-28 Thread Richard Newman
> I am trying to play around with the clojure-twitter library (http:// > github.com/mattrepl/clojure-twitter/tree) and it depends on clj- > apache- > http (http://github.com/rnewman/clj-apache-http/tree/master). This is my lib, so I'll answer :) > Now when I run: > > java -cp CLASSPATH twitt

Re: Why doesn't regex implement ifn?

2009-08-28 Thread Chas Emerick
On Aug 28, 2009, at 10:01 AM, Shawn Hoover wrote: > Why wouldn't #"" produce whatever the corollary regex object is on > each host platform? > > I had a couple suggestions on clojure-dev for ClojureCLR that line > up with the "produce the corollary idea": > http://groups.google.com/group/cloju

Re: Lazy Exceptions

2009-08-28 Thread John Harrop
On Fri, Aug 28, 2009 at 8:50 AM, Rich Hickey wrote: > > On Thu, Aug 27, 2009 at 8:10 PM, Tim Snyder wrote: > > > > Well, I can see that LazySeq does indeed catch and wrap all Exceptions > > in a RuntimeException. I also think I can work around it, but I'd > > like to know why this was done? > >

Re: Why doesn't regex implement ifn?

2009-08-28 Thread Chouser
On Thu, Aug 27, 2009 at 9:05 PM, Chas Emerick wrote: > > > On Aug 27, 2009, at 1:34 PM, Chouser wrote: > >> The benefits of #"" producing a real java.util.regex.Pattern >> object instead of some Clojury wrapper will decrease as it >> becomes more common to write Clojure code that can run on >> non

Re: I18n

2009-08-28 Thread Stuart Sierra
My recommendation would be to keep your localized strings separate from your source code, either in properties files or using a text template system such as stringtemplate.org -SS On Aug 28, 1:16 am, ngocdaothanh wrote: > Hi all, > > Is there an i18n library for Clojure? What Java i18n library

Re: Clojure/EPL and the GPL

2009-08-28 Thread Matthias Benkard
On 28 Aug., 13:42, Tassilo Horn wrote: > I have a licensing question.  Am I allowed to include clojure.jar in a > GPL project? IANAL, but if I understand the GPL correctly, it prohibits you from distributing a GPL-covered programme that is based on Clojure, because it would need to be linked to

Re: I18n

2009-08-28 Thread cody koeninger
On Aug 28, 12:16 am, ngocdaothanh wrote: > Hi all, > > Is there an i18n library for Clojure? What Java i18n library should I > use in a Clojure program (it suits Clojure syntax for example)? For > Ruby and Erlang I prefer Gettext, but for Java it seems > that .properties files are in major use.

Re: Why doesn't regex implement ifn?

2009-08-28 Thread Shawn Hoover
On Thu, Aug 27, 2009 at 9:05 PM, Chas Emerick wrote: > > > On Aug 27, 2009, at 1:34 PM, Chouser wrote: > > > The benefits of #"" producing a real java.util.regex.Pattern > > object instead of some Clojury wrapper will decrease as it > > becomes more common to write Clojure code that can run on >

Re: Java STM

2009-08-28 Thread John Harrop
On Fri, Aug 28, 2009 at 4:45 AM, peter veentjer wrote: > > Clojure's STM is part of a holistic language design where > > people will normally be programming with immutable persistent > > composite data structures. Getting a consistent view of such a data > > structure doesn't require a transaction

Re: Java STM

2009-08-28 Thread Rich Hickey
On Fri, Aug 28, 2009 at 4:45 AM, peter veentjer wrote: > >> No. I don't want to use transactions for workflow. I don't want >> blocking transactions. I don't want read tracking. > > With multiverse it depends on the engine being used and the settings > on the transaction. And readonly transactions

Re: with-open should use a close multimethod?

2009-08-28 Thread C. Florian Ebeling
+1 Coming across that problem just yesterday. On Fri, Aug 28, 2009 at 3:54 PM, Sean Devlin wrote: > > +1 > > On Aug 28, 9:41 am, Chas Emerick wrote: >> Definitely +1, yes. >> >> - Chas >> >> On Aug 28, 2009, at 4:27 AM, Mike Hinchey wrote: >> >> > I have a suggestion for the with-open macro.  I

clj-apache-http not being found in classpath?

2009-08-28 Thread dmix
I am trying to play around with the clojure-twitter library (http:// github.com/mattrepl/clojure-twitter/tree) and it depends on clj-apache- http (http://github.com/rnewman/clj-apache-http/tree/master). So I cloned the repo, built it with ant and added the clj-apache- http.jar to my classpath. N

Re: with-open should use a close multimethod?

2009-08-28 Thread J. McConnell
+1 On Fri, Aug 28, 2009 at 4:27 AM, Mike Hinchey wrote: > I have a suggestion for the with-open macro. It calls .close when it's > finished. I'd like it to have a (defmulti close type) so it's behavior is > extensible. A standard method could be defined for java.io.Closeable and a > :default

Re: Why doesn't regex implement ifn?

2009-08-28 Thread Rich Hickey
On Thu, Aug 27, 2009 at 9:05 PM, Chas Emerick wrote: > > > On Aug 27, 2009, at 1:34 PM, Chouser wrote: > >> The benefits of #"" producing a real java.util.regex.Pattern >> object instead of some Clojury wrapper will decrease as it >> becomes more common to write Clojure code that can run on >> non

Re: Lazy Exceptions

2009-08-28 Thread Rich Hickey
On Thu, Aug 27, 2009 at 8:10 PM, Tim Snyder wrote: > > Well, I can see that LazySeq does indeed catch and wrap all Exceptions > in a RuntimeException.  I also think I can work around it, but I'd > like to know why this was done? > > Was it necessary given the checked vs. unchecked exception system

Re: with-open should use a close multimethod?

2009-08-28 Thread Chas Emerick
Definitely +1, yes. - Chas On Aug 28, 2009, at 4:27 AM, Mike Hinchey wrote: > I have a suggestion for the with-open macro. It calls .close when > it's finished. I'd like it to have a (defmulti close type) so it's > behavior is extensible. A standard method could be defined for > java.i

Re: vimclojure issues

2009-08-28 Thread Meikel Brandmeyer
Hi, On Aug 28, 10:36 am, viksit wrote: > Actually, I've got the same problem. > > (defn greet [] (println "Hello, World!")) > > With \et. > > example2.clj > 1,7All > Error detected while processing function > vimclojure#EvalToplevel: > line8: > E605: Exception not caught: Error:

Re: with-open should use a close multimethod?

2009-08-28 Thread Sean Devlin
+1 On Aug 28, 9:41 am, Chas Emerick wrote: > Definitely +1, yes. > > - Chas > > On Aug 28, 2009, at 4:27 AM, Mike Hinchey wrote: > > > I have a suggestion for the with-open macro.  It calls .close when   > > it's finished.  I'd like it to have a (defmulti close type) so it's   > > behavior is ex

Re: vimclojure issues

2009-08-28 Thread viksit
Actually, I've got the same problem. (defn greet [] (println "Hello, World!")) With \et. example2.clj 1,7All Error detected while processing function vimclojure#EvalToplevel: line8: E605: Exception not caught: Error: Not in toplevel expression! Press ENTER or type command to con

Re: Lazy Exceptions

2009-08-28 Thread Meikel Brandmeyer
Hi, On Aug 28, 6:07 am, eyeris wrote: > When you say "the original" do you mean the outer-most > RuntimeException or the inner-most exception? It think I meant the outer-most exception. Sincerely Meikel --~--~-~--~~~---~--~~ You received this message because y

Clojure/EPL and the GPL

2009-08-28 Thread Tassilo Horn
Hi all, I have a licensing question. Am I allowed to include clojure.jar in a GPL project? On the net I've found out that the EPL is not GPL compliant, and there's an explicit statement by the FSF that it's not possible to include GPL code inside an EPL licensed project, or to create an EPL lic

Re: with-open should use a close multimethod?

2009-08-28 Thread Seth
Sounds good to me. On Aug 28, 4:27 am, Mike Hinchey wrote: > I have a suggestion for the with-open macro.  It calls .close when it's > finished.  I'd like it to have a (defmulti close type) so it's behavior is > extensible.  A standard method could be defined for java.io.Closeable and a > :defau

Re: Java STM

2009-08-28 Thread Emeka
Peter, you will get there some day. On Fri, Aug 28, 2009 at 8:45 AM, peter veentjer wrote: > > > No. I don't want to use transactions for workflow. I don't want > > blocking transactions. I don't want read tracking. > > With multiverse it depends on the engine being used and the settings > on t

Re: Java STM

2009-08-28 Thread peter veentjer
> No. I don't want to use transactions for workflow. I don't want > blocking transactions. I don't want read tracking. With multiverse it depends on the engine being used and the settings on the transaction. And readonly transactions also don't track reads. > > And since Clojure is using MVCC, d

with-open should use a close multimethod?

2009-08-28 Thread Mike Hinchey
I have a suggestion for the with-open macro. It calls .close when it's finished. I'd like it to have a (defmulti close type) so it's behavior is extensible. A standard method could be defined for java.io.Closeable and a :default method with no type hint. I've come across a few cases where some

Re: clojure vs scala

2009-08-28 Thread Emeka
e, I just picked a new word 'Rogramming'? Regards, Emeka On Fri, Aug 28, 2009 at 1:30 AM, e wrote: > > > On Thu, Aug 27, 2009 at 9:57 AM, Emeka wrote: > >> e, >> >> What is inspiring in it? >> > > H from time to time, people use percent literacy as a measure of > public intellectual