Re: Running out of memory when using filter?

2008-12-12 Thread Rich Hickey
On Dec 12, 6:15 pm, Mark Engelberg mark.engelb...@gmail.com wrote: On Fri, Dec 12, 2008 at 6:37 AM, Rich Hickey richhic...@gmail.com wrote: I'm appreciate the time you and others have spent on this, and will improve filter, but I'm not sure where you are getting your presumptions about

Re: throw-if with no exception class

2008-12-11 Thread Rich Hickey
On Dec 10, 10:52 pm, Stephen C. Gilardi [EMAIL PROTECTED] wrote: On Dec 10, 2008, at 4:38 AM, Ralf Bensmann wrote: Being a Java trainer for a long time, we talk with students about the handle-or-declare rule in Java and the two types of exceptions: checked (declared) and unchecked

Re: Is it possible to tell programatically if I'm in a transactional context?

2008-12-11 Thread Rich Hickey
On Dec 8, 7:44 pm, Dave Griffith [EMAIL PROTECTED] wrote: The basic use case is as a guard for I/O, to prevent them from from filling the disk/spamming the network accidentally in case of transaction live-lock. Probably a bit more paranoia than is idiomatic in the dynamically-typed world,

Re: memory issue with nth

2008-12-11 Thread Rich Hickey
On Dec 11, 2:28 pm, Christian Vest Hansen karmazi...@gmail.com wrote: Wo-hoo! I found a fix. I think it is only a JVM issue to the extent that the 1.6 JVM might be able to mask the bug by doing escape analysis or some such other magic, but that dosn't mean that the bug isn't there. It's

Re: Strings as functions of maps

2008-12-11 Thread Rich Hickey
On Dec 11, 4:37 pm, Stefan Rusek sru...@gmail.com wrote: If we have the following map: (def m {:key 1 'sym 2 str 3}) The following are equivalent: (:key m) (m :key) As are the following: ('sym m) (m 'sym) I think the commutativity of maps with symbols and keywords is a valuable

Re: memory issue with nth

2008-12-11 Thread Rich Hickey
On Dec 11, 5:56 pm, Rich Hickey richhic...@gmail.com wrote: On Dec 11, 2:28 pm, Christian Vest Hansen karmazi...@gmail.com wrote: Wo-hoo! I found a fix. I think it is only a JVM issue to the extent that the 1.6 JVM might be able to mask the bug by doing escape analysis or some

Re: why can't I set! stuff in user.clj?

2008-12-11 Thread Rich Hickey
On Dec 10, 2008, at 1:50 PM, Stephen C. Gilardi wrote: On Dec 10, 2008, at 8:51 AM, Stuart Halloway wrote: Thanks for the info. Is this limitation of user.clj arbitrary, or motivated by some concern that the average Clojure user should know about? Is the a reason not to load the bindings

Re: Learning Clojure

2008-12-10 Thread Rich Hickey
On Wed, Dec 10, 2008 at 4:32 PM, Brian Will [EMAIL PROTECTED] wrote: A Java reference type is basically any type allocated on the heap. The four Clojure reference types are particular Java reference types. My complaint is this is exactly the sort of weirdness that causes learners to scratch

Re: Non-NS-qualified hierarchies

2008-12-10 Thread Rich Hickey
On Wed, Dec 10, 2008 at 12:45 AM, J. McConnell [EMAIL PROTECTED] wrote: On Tue, Dec 9, 2008 at 7:05 PM, Rich Hickey [EMAIL PROTECTED] wrote: Thanks. I think it does a bit too much - I only want to relax the requirement for namespace-qualification, not any of the other assertions (e.g

Re: List comprehension: :when AND :while for the same binding?

2008-12-09 Thread Rich Hickey
On Mon, Dec 8, 2008 at 7:15 PM, Chouser [EMAIL PROTECTED] wrote: On Mon, Dec 8, 2008 at 10:42 AM, Rich Hickey [EMAIL PROTECTED] wrote: On Dec 8, 10:08 am, Chouser [EMAIL PROTECTED] wrote: doseq currently supports both. If both appear on the same binding, the :while is always test first

Re: Calling superclass methods from implemented methods

2008-12-09 Thread Rich Hickey
On Dec 9, 12:24 am, Matt Revelle [EMAIL PROTECTED] wrote: The attached patch adds :super-methods option to generate-class as a map, {local-name [name [param-types] return-type], ...}. The mechanics work as Rich suggested in an earlier message, a method is created that has the same type

Re: Non-NS-qualified hierarchies

2008-12-09 Thread Rich Hickey
On Mon, Dec 8, 2008 at 9:21 AM, J. McConnell [EMAIL PROTECTED] wrote: On Mon, Dec 8, 2008 at 9:05 AM, Rich Hickey [EMAIL PROTECTED] wrote: On Dec 7, 9:01 am, Mibu [EMAIL PROTECTED] wrote: Is it possible to remove the asserts in derive that restrict the parent and child to namespace-qualified

Re: Thanks for Clojure

2008-12-08 Thread Rich Hickey
On Dec 6, 11:12 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I've moved pretty much all my spare-time projects over to clojure and it's been a pleasure so far. It's a nice piece of work. It seemed appropriate to say thanks for it. So thanks! You're quite welcome! Rich

Re: reduction

2008-12-08 Thread Rich Hickey
On Dec 7, 4:10 pm, Christophe Grand [EMAIL PROTECTED] wrote: Rich Hickey a écrit : I think the problem is that in the original and subsequent versions, work was being done in the current case that needn't be (checking the status of coll), and that we need more laziness than lazy-cons

Re: Non-NS-qualified hierarchies

2008-12-08 Thread Rich Hickey
On Dec 7, 9:01 am, Mibu [EMAIL PROTECTED] wrote: Is it possible to remove the asserts in derive that restrict the parent and child to namespace-qualified names? It would be much more useful if the asserts are moved to the global- hierarchy case ([child parent]) and the private hierarchies

Re: List comprehension: :when AND :while for the same binding?

2008-12-08 Thread Rich Hickey
On Dec 6, 7:52 pm, André Thieme [EMAIL PROTECTED] wrote: (for [x (range 1 20) :when ( x 8) :while ( 0 (rem x 13))] x) == java.lang.Exception: Unsupported binding form: :while But: (for [x (range 1 20) :when ( x 8)] x) == (9 10 11 12 13 14 15 16 17 18 19) And: (for [x (range 1 20)

Re: List comprehension: :when AND :while for the same binding?

2008-12-08 Thread Rich Hickey
On Dec 8, 10:08 am, Chouser [EMAIL PROTECTED] wrote: On Mon, Dec 8, 2008 at 9:06 AM, Rich Hickey [EMAIL PROTECTED] wrote: On Dec 6, 7:52 pm, André Thieme [EMAIL PROTECTED] wrote: (for [x (range 1 20) :when ( x 8) :while ( 0 (rem x 13))] x) == java.lang.Exception: Unsupported binding

Re: Calling superclass methods from implemented methods

2008-12-08 Thread Rich Hickey
On Dec 8, 9:30 am, Matt Revelle [EMAIL PROTECTED] wrote: I'm working on a patch to add support for calling the superclass' implementation of a method when overriding a method in Clojure with ns/:genclass. This looks like it requires a modification of the InstanceMethodExpr class in

Re: Running out of memory when using filter?

2008-12-08 Thread Rich Hickey
On Dec 8, 2008, at 8:56 PM, Stephen C. Gilardi wrote: I think I finally see the problem. The rest expression in filter's call to lazy-cons has a reference to coll in it. That's all it takes for coll to be retained during the entire calculation of the rest. (defn filter Returns a

Re: reduction

2008-12-07 Thread Rich Hickey
On Dec 7, 5:29 am, Christophe Grand [EMAIL PROTECTED] wrote: Chouser a écrit : Testing just now on large collections, the version using 'map' is indeed not only slower, but also overflows the stack. Hm... and perhaps I see why now. Is it computing the entire chain up to each result

Re: Test wether something is an atom (as it is known in Scheme)

2008-12-05 Thread Rich Hickey
On Dec 5, 9:03 am, Stephen C. Gilardi [EMAIL PROTECTED] wrote: On Dec 5, 2008, at 8:50 AM, Mark McGranaghan wrote: This is indeed the definition used in the clojure.contrib.pred library: http://github.com/kevinoneill/clojure-contrib/tree/master/src/clojure... That's true. However, with

Re: Test wether something is an atom (as it is known in Scheme)

2008-12-05 Thread Rich Hickey
. There is class, and, more useful, instance? Rich 2008/12/5 Rich Hickey [EMAIL PROTECTED] On Dec 5, 9:03 am, Stephen C. Gilardi [EMAIL PROTECTED] wrote: On Dec 5, 2008, at 8:50 AM, Mark McGranaghan wrote: This is indeed the definition used in the clojure.contrib.pred library

Re: License of/permission for Clojure's logo

2008-12-04 Thread Rich Hickey
On Dec 3, 11:30 pm, samppi [EMAIL PROTECTED] wrote: I want to put the Clojure logo:http://clojure.googlegroups.com/web/Clojure-logo.png?gda=y8lqvUIAAABo... ...on Wikipedia's article on Clojure. What is the license of Clojure's logo--is it a free image? Or can Mr. Hickley give me

Re: Bug (I think): Can't sort collection of vectors containing big integers

2008-12-04 Thread Rich Hickey
On Dec 4, 2:32 am, puzzler [EMAIL PROTECTED] wrote: OK, after my last goof-up in reporting a bug, I'm reluctant to state with certainty that this is a bug, but it sure seems that way: This works: (sort [[5 2] [1 0] [3 4]]) This works: (sort [3243214324324132413243243243243243243234

Re: delimited continuations for web development

2008-12-04 Thread Rich Hickey
On Dec 2, 12:52 pm, Jan Rychter [EMAIL PROTECTED] wrote: Rich Hickey [EMAIL PROTECTED] writes: On Jun 20, 11:58 am, Jaime Barciela [EMAIL PROTECTED] wrote: Hello Phil, My understanding is that Common Lisp doesn't have support for continuations either and that's why Weblocks uses cl

Atoms

2008-12-04 Thread Rich Hickey
I've added a new reference type - atom. Docs here: http://clojure.org/atoms Feedback welcome, Rich --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Capabilities and Limits of (bean ...)?

2008-12-04 Thread Rich Hickey
On Dec 4, 8:01 pm, Randall R Schulz [EMAIL PROTECTED] wrote: Hi, I have a fairly elaborate library for representing roughly JSON-like data. It has the ability to create JavaBean counterparts to any of its values, whether atomic or structured. In order to see how this might interact with

Re: Lazy living, without variables

2008-12-02 Thread Rich Hickey
On Dec 1, 9:35 pm, Timothy Pratley [EMAIL PROTECTED] wrote: The reason is simple - plain mutable variables have no concurrency semantics. What if you closed over a mutable local? Now you have an object with no synchronization, a concurrency mess. Thanks Rich for the clarification...

Re: Lazy living, without variables

2008-12-02 Thread Rich Hickey
On Dec 2, 8:43 am, Luke Amdor [EMAIL PROTECTED] wrote: The @ symbol is a reader macro. It's a hard coded table so that when the reader comes across the @ symbol it knows to instead change it to a deref call. For eg, (def a (ref 0)) (dosync (alter inc a)) @a ;; is the same thing as

Re: Test Coerced-BigDecimal in clojure.contrib.test-clojure throws an Exception

2008-12-02 Thread Rich Hickey
On Nov 18, 5:35 pm, Stephen C. Gilardi [EMAIL PROTECTED] wrote: I think Clojure should change to allow (bigdec 3) to succeed. BigDecimal has a valueOf method that accepts a long. It has a constructor that accepts an int. I haven't made a bug report on this yet, but here it is. SVN 1135

Re: Seq forms with preceding #^metadata lose the metadata

2008-12-02 Thread Rich Hickey
On Dec 2, 4:30 am, Kei Suzuki [EMAIL PROTECTED] wrote: Hi, Whenever a seq form is preceded by #^metadata, the metadata is ignored or only {:line n} is associated with. For example, these return the metadata as expected: (meta (with-meta '(1) {:v 1})) (meta (with-meta (quote (1)) {:v

Re: AOT/gen-class docs

2008-12-02 Thread Rich Hickey
for building Clojure apps without runtime codegen, for delivery in those environments that preclude it (e.g. Android, unsigned applets). Looking forward to feedback from people trying to reach those targets. Rich On Nov 27, 10:32 am, Rich Hickey [EMAIL PROTECTED] wrote: On Nov 26, 11:06 pm, Chas

Re: proposal: match multimethod

2008-12-02 Thread Rich Hickey
On Dec 1, 5:07 pm, Stuart Halloway [EMAIL PROTECTED] wrote: I am thinking about adding a match method to Clojure-contrib. This would work like Ruby's threequals (===, a.k.a. case equality) and would be implemented as a multimethod to do sensible things with a wide variety of types. (1)

Re: clojure.main default print function

2008-12-02 Thread Rich Hickey
On Dec 2, 2:37 pm, Perry Trolard [EMAIL PROTECTED] wrote: Clarification: clojure.lang.Repl's behavior hasn't changed, it's just that the clojure.main default REPL behaves differently from it. Those who don't call clojure.main in their clj scripts won't notice a difference. Fixed (svn

Re: Possible Reflector Bug

2008-12-02 Thread Rich Hickey
On Sat, Nov 29, 2008 at 6:17 PM, JMan [EMAIL PROTECTED] wrote: Consider these 2 interfaces: - PackagePrivateInterface.java package test; interface PackagePrivateInterface { public void myPublicMethod(); } - PublicTagInterface.java package test; public interface

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

2008-12-01 Thread Rich Hickey
On Dec 1, 3:03 am, bc [EMAIL PROTECTED] wrote: Hi all, 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

Re: Defaulted (get ...) Not Documented

2008-12-01 Thread Rich Hickey
On Dec 1, 10:19 am, Randall R Schulz [EMAIL PROTECTED] wrote: Hi, I looked for a version of (get map key) that would supply a default value if the key was not present in the map. I was surprised to see (by looking at the Data Structure documentation page,

Re: Lazy living, without variables

2008-12-01 Thread Rich Hickey
On Dec 1, 7:37 pm, Timothy Pratley [EMAIL PROTECTED] wrote: Local variables are good in these situations 1) You want to accumulate some changes eg: // sum odds int x = 0; for (int i=0; i100; i++) { if ( i%2==1 ) x+=i; } ;It is relatively easy to rearrange these sort of things into a

Re: Recursively / Iteratively Building Maps

2008-11-30 Thread Rich Hickey
On Nov 30, 2008, at 12:14 PM, Randall R Schulz wrote: On Sunday 30 November 2008 09:06, Randall R Schulz wrote: Hi, This is my first Clojure how-to question. I tried to find an answer on the Wiki and in the list archives, but to no avail. How do I build up a map one association at a

Re: infix operators

2008-11-30 Thread Rich Hickey
On Nov 30, 2008, at 5:47 PM, Randall R Schulz wrote: On Sunday 30 November 2008 13:30, André Thieme wrote: ... Although a standard reader macro for infix syntax would be a nice thing to have in Clojure. ... Am I the only person who thinks this is a dead-end proposal that should be

Re: loop recur vs recursion

2008-11-29 Thread Rich Hickey
On Nov 29, 2008, at 6:49 AM, Daniel Renfer wrote: Even if you don't think you'll run into the possibility of blowing your stack, it's still a good idea to use recur when doing tail call recursion. The compiler will help you out by making sure it really is a tail call. Remember, recur

Re: reader macros Perl-like

2008-11-28 Thread Rich Hickey
On Nov 28, 8:21 am, Mark Volkmann [EMAIL PROTECTED] wrote: I've been learning Clojure for about a month now and like it so far. In the interest of making it easier to convince other people to give it a try, I think it would be a good idea to carefully consider some readability issues before

Re: Modified import for consistency with use and require

2008-11-28 Thread Rich Hickey
On Nov 28, 8:36 am, Meikel Brandmeyer [EMAIL PROTECTED] wrote: Dear Clojurians, currently the trio of require, use and import is slightly inconsistent. While use and require allow either symbols or lists, import only allows lists. (The vector notation doesn't make sense for import). So

Re: ANT script/task for AOT compiling of clojure files?

2008-11-28 Thread Rich Hickey
On Nov 28, 2008, at 11:55 AM, Stephen C. Gilardi wrote: I am not in favor of creating the directory nor fabricating the classpath. Clojure currently creates the directory. Since that appears unintentional, fixing that would go a long way to improving the behavior that caught me.

Re: Compiling too much?

2008-11-28 Thread Rich Hickey
On Nov 28, 4:53 pm, Meikel Brandmeyer [EMAIL PROTECTED] wrote: Hi, I noticed a problem with AOT if not all libraries are compiled. For example contrib only provides a jar with the sources. Compiling a library using - say - clojure.contrib.def will compile clojure.contrib.def with the

Re: AOT/gen-class docs

2008-11-27 Thread Rich Hickey
On Nov 26, 11:06 pm, Chas Emerick [EMAIL PROTECTED] wrote: Looks good so far, Rich. Should be a blissfully smooth transition from the legacy gen-class impl. This is only tangentially related to the docs you're writing, but I won't let that stop me: As you know, I have at least one use

Re: AOT/gen-class docs

2008-11-27 Thread Rich Hickey
On Nov 27, 11:42 am, Michael Reid [EMAIL PROTECTED] wrote: gen-class will always create a relationship between the stub class and the load (__init) class, as well as the namespace in which the implementations will be found, the naming conventions for matching etc. It's a high-level

Re: trampoline for mutual recursion

2008-11-27 Thread Rich Hickey
On Nov 27, 8:37 am, lpetit [EMAIL PROTECTED] wrote: On Nov 27, 1:58 pm, lpetit [EMAIL PROTECTED] wrote: and the modification of trampoline along these lines : (defn trampoline [f] (let [ret (f)] (cond f (fn? ret) (recur ret) (instance?

Re: trampoline for mutual recursion

2008-11-26 Thread Rich Hickey
On Nov 26, 10:28 am, dreish [EMAIL PROTECTED] wrote: Now that you've gone this far, why not do this? - class clojure.lang.TailCall contains an AFn - Compiler checks for a tail call position and instead of calling it, returns new TailCall(AFn) - In invoke, while returnvalue instanceof

Re: commute

2008-11-26 Thread Rich Hickey
On Nov 26, 2:35 pm, Mark Volkmann [EMAIL PROTECTED] wrote: On Wed, Nov 26, 2008 at 1:13 PM, Shawn Hoover [EMAIL PROTECTED] wrote: On Wed, Nov 26, 2008 at 1:55 PM, Mark Volkmann [EMAIL PROTECTED] wrote: The documentation for commute says Sets the in-transaction-value of ref This

Re: Patch: universal main() with repl/script/compile

2008-11-26 Thread Rich Hickey
On Nov 26, 5:13 pm, Stephen C. Gilardi [EMAIL PROTECTED] wrote: On Nov 24, 2008, at 11:57 AM, Stephen C. Gilardi wrote: I've uploaded a patch along those lines: ant-compile-main.patch,http://tinyurl.com/5azp3u based on our recent work on this. This includes Compile.java, main.clj,

AOT/gen-class docs

2008-11-26 Thread Rich Hickey
I've started documenting AOT compilation and the new :gen-class option for ns: http://clojure.org/compilation It's still a work in progress. Feedback welcome. Rich --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Patch: universal main() with repl/script/compile

2008-11-26 Thread Rich Hickey
On Nov 26, 9:17 pm, Mark Volkmann [EMAIL PROTECTED] wrote: This is probably more of a Java question than a Clojure question. I'm thinking most people will want clojure-contrib in their classpath. I tried this using SVN 1127 without success. java -cp clojure-contrib.jar -jar clojure.jar

Re: Adapting a functional pretty-printer to Clojure

2008-11-25 Thread Rich Hickey
On Nov 25, 12:51 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Nov 25, 12:50 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Nov 25, 12:22 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: This approach might just be too inefficient -- perhaps it would be best to implement the

Re: trampoline for mutual recursion

2008-11-25 Thread Rich Hickey
On Nov 25, 10:42 am, Stephen C. Gilardi [EMAIL PROTECTED] wrote: On Nov 25, 2008, at 9:05 AM, Rich Hickey wrote: I've added trampoline to ease the conversion/creation of mutually recursive algorithms in Clojure. Very cool! Thanks for enabling that. In looking over the implementation

Re: seq and vector

2008-11-24 Thread Rich Hickey
On Nov 24, 2:41 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Nov 24, 12:41 am, Kevin Downey [EMAIL PROTECTED] wrote: I don't think you understand. clojure data structures are IMMUTABLE. every call to conj, or anyother function returns a new object. To optimize there is sharing of

Re: Keyword constraints not enforced

2008-11-24 Thread Rich Hickey
On Nov 23, 9:09 am, James Reeves [EMAIL PROTECTED] wrote: On Nov 23, 11:38 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, According tohttp://clojure.org/reader: Keywords are like symbols, except: o They can and must begin with a colon, e.g. :fred. o They

Re: Isolating I/O and other side-effects?

2008-11-24 Thread Rich Hickey
On Nov 24, 7:22 pm, dokondr [EMAIL PROTECTED] wrote: Providing that Clojure is NOT a pure functional language like Haskell, yet how can I isolate imperative-style computational structures from the main body of the functional program? You can't, other than manually. How can I ensure

Re: Clojure HTML Documentation

2008-11-23 Thread Rich Hickey
On Nov 21, 3:17 am, Mark McGranaghan [EMAIL PROTECTED] wrote: I've created some experimental HTML docs for Clojure. You can see them on S3:http://clj-doc.s3.amazonaws.com/tmp/doc-1116/index.html Or, just for kicks, on Amazon's new Cloud Front

Re: No complex numbers?

2008-11-23 Thread Rich Hickey
numeric types. Rich On Nov 23, 3:42 pm, Rich Hickey [EMAIL PROTECTED] wrote: On Nov 23, 8:56 am, Rock [EMAIL PROTECTED] wrote: On Nov 23, 2:37 pm, André Thieme [EMAIL PROTECTED] wrote: On 23 Nov., 13:29, Rock [EMAIL PROTECTED] wrote: I've just noticed there is no support

Re: seq and vector

2008-11-22 Thread Rich Hickey
On Nov 22, 1:07 pm, [EMAIL PROTECTED] wrote: In one of my data structures I have a vector as a buffer where things are appended to. In addition the things in that buffer sometimes get modified using map or filter. Now as map and filter return sequences I wonder how to get a vector back

Re: seq and vector

2008-11-22 Thread Rich Hickey
On Nov 22, 4:59 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Nov 22, 9:48 pm, Rich Hickey [EMAIL PROTECTED] wrote: map and filter don't modify anything. What does it mean to filter a vector? Yes yes, I know that. Still in English its sometimes easier to be sloppy and pretend

Re: loss of gen-and-load-class functionality

2008-11-21 Thread Rich Hickey
On Nov 20, 4:42 pm, Stuart Sierra [EMAIL PROTECTED] wrote: On Nov 20, 2:14 pm, Stephen Wrobleski [EMAIL PROTECTED] wrote: Furthermore, requiring the use of (ns ..) to create a class makes defining a class with a macro somewhat tedious (seems like you'd have to bind *ns*, so that (ns ..)

Re: Newbie: Creating a MapEntry

2008-11-21 Thread Rich Hickey
On Nov 21, 11:40 am, samppi [EMAIL PROTECTED] wrote: Yes, thank you—(key) and (val) were what I was interested in, so I'll use the latter function you gave. What I'm wondering though is, if MapEntries aren't guaranteed for the future, what is being planned for (key) and (val) too. Oh, well.

Re: Which paper discusses Henry Baker's (sp?) egal?

2008-11-21 Thread Rich Hickey
On Nov 21, 12:36 pm, Brett Hoerner [EMAIL PROTECTED] wrote: I've watched a lot of Clojure videos now, and keep hearing Rich mention Henry Baker's egal. Does someone have the actual paper title where Baker talks about this? I have an ACM subscription (and assume that's where I'd find it) -

Re: Use of / to call static method in generated classes

2008-11-21 Thread Rich Hickey
On Nov 21, 4:20 pm, Craig McDaniel [EMAIL PROTECTED] wrote: Testing the new (ns ... :genclass ...), I copied Rich's example fromhttp://paste.lisp.org/display/70665: (ns my.hello (:gen-class :extends javax.swing.DefaultCellEditor :constructors {[Integer] [javax.swing.JCheckBox]}

Re: Macros and syntax-quote

2008-11-20 Thread Rich Hickey
On Nov 20, 6:39 am, Meikel Brandmeyer [EMAIL PROTECTED] wrote: Hi, On 20 Nov., 11:29, Rock [EMAIL PROTECTED] wrote: I was what the difference might be with respect to this: `(let [frame ~frame] (.setTitle frame ~title) (.setVisible frame) frame) This won't work, since

Re: Bug + Patch: compile fails for namespaces with dashes in their names.

2008-11-20 Thread Rich Hickey
On Nov 20, 12:18 am, Chouser [EMAIL PROTECTED] wrote: Since SVN rev 1110: user= (compile 'clojure.contrib.str-utils) java.lang.Exception: Namespace name must match file, had: clojure.contrib.str-utils and clojure/contrib/str_utils.clj (NO_SOURCE_FILE:0) I think the only problem is that

Re: Macros and syntax-quote

2008-11-20 Thread Rich Hickey
On Nov 20, 7:38 am, Meikel Brandmeyer [EMAIL PROTECTED] wrote: Hi, On 20 Nov., 13:30, Rich Hickey [EMAIL PROTECTED] wrote: Yes. Please use auto-gensyms (name#): `(let [frame# ~frame] (.setTitle frame# ~title) (.setVisible frame#) frame#) With this specific example, my

Re: Possible bug? StringIndexOutOfBoundException

2008-11-20 Thread Rich Hickey
On Nov 20, 12:37 pm, Feng [EMAIL PROTECTED] wrote: I start getting StringIndexOutOfBoundException since svn rev 1113 (use source name in smap). Fixed - rev 1120 - thanks for the report. Rich --~--~-~--~~~---~--~~ You received this message because you are

Re: Suggest allowing java property to specify *compile-path*

2008-11-20 Thread Rich Hickey
On Nov 20, 11:28 am, Stephen C. Gilardi [EMAIL PROTECTED] wrote: Currently the compiler writes classes to the hierarchy under the value of *compile-path* whose root binding is classes. As we see in Stuart's build.xml patch, it can convenient to be able to specify such a path as part of the

Re: Clojure at the JVM Languages Summit

2008-11-20 Thread Rich Hickey
On Sep 30, 1:17 pm, Allen Rohner [EMAIL PROTECTED] wrote: Thanks. The summit was really fantastic - so many interesting and smart people and lots of great presentations and conversations. Left me exhausted and a bit MIA here, which I'm afraid will continue through my talk Monday at the

Re: Modified doto

2008-11-19 Thread Rich Hickey
On Oct 23, 9:53 am, Rich Hickey [EMAIL PROTECTED] wrote: On Oct 21, 10:30 am, mb [EMAIL PROTECTED] wrote: Hi, On 21 Okt., 14:41, mb [EMAIL PROTECTED] wrote: (defmacro doto- The name is actually also up to discussion. doto is already in use and this change is incompatible to legacy

Re: Is this boolean behavior intentional?

2008-11-19 Thread Rich Hickey
On Nov 19, 1:12 pm, Raffael Cavallaro [EMAIL PROTECTED] wrote: user (def test-array (make-array (. Boolean TYPE) 100)) #'user/test-array user (aget test-array 0) false user (= (aget test-array 0) false) true user (if (aget test-array 0) 'true-value 'false-value) true-value Same issue

Re: Reclaiming scan and touch

2008-11-19 Thread Rich Hickey
On Nov 19, 6:51 pm, mifrai [EMAIL PROTECTED] wrote: I know it's minor and nit-picky but so long as we're rolling out so many breaking changes is it possible to reclaim scan and touch instead of leaving dead functions that need an :exclude? Yes, done. Rich

Re: Patch: standalone compiler (almost)

2008-11-18 Thread Rich Hickey
On Nov 18, 2008, at 12:53 AM, Stephen C. Gilardi wrote: On Nov 17, 2008, at 11:42 PM, Stephen C. Gilardi wrote: It seems there's something not quite right, though. I did a fresh checkout of 1108 and built with ant and ran with java -jar clojure.jar and got an exception: Making

Re: Agent errors reporting

2008-11-18 Thread Rich Hickey
On Tue, Nov 18, 2008 at 3:14 AM, Toralf Wittner [EMAIL PROTECTED]wrote: On Sun, 2008-11-16 at 01:35 +0100, [EMAIL PROTECTED] wrote: Currently agent errors are only reported when the agent is derefenced or further actions are dispatched to the agent. It would be great if one can get

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

2008-11-18 Thread Rich Hickey
On Tue, Nov 18, 2008 at 9:42 AM, Raffael Cavallaro [EMAIL PROTECTED] wrote: On Nov 18, 1:46 am, Cosmin Stejerean [EMAIL PROTECTED] wrote: What kind of bugs are acceptable for the purpose of a known good combination? Is slime starting up sufficient? It's a whole lot better than slime

Re: Can functions be decompiled?

2008-11-18 Thread Rich Hickey
On Nov 18, 2:48 pm, Konrad Hinsen [EMAIL PROTECTED] wrote: On 18.11.2008, at 19:32, Shawn Hoover wrote: For functions defined in libs that you load into Clojure, you can find out the file and line from the metadata. For functions you define in the REPL, this trick won't help. Say you

Re: Strange behaviour

2008-11-17 Thread Rich Hickey
On Nov 17, 7:56 am, Konrad Hinsen [EMAIL PROTECTED] wrote: On Nov 17, 2008, at 13:33, mb wrote: vals returns a clojure.lang.APersistentMap$ValSeq, which is not a list. Hence list? returns false and you get the true branch, ie. the thing itself. A. It looks like a list, but it

Re: recur in catch and finally?

2008-11-17 Thread Rich Hickey
On Nov 17, 2:06 am, mb [EMAIL PROTECTED] wrote: Hi, On 17 Nov., 02:09, Chouser [EMAIL PROTECTED] wrote: You could of course work around this by putting your loop in some other function and calling it from inside catch. In this specific case I used: (last (take-while #(not (nil? %))

Re: Patch: standalone compiler (almost)

2008-11-17 Thread Rich Hickey
On Nov 17, 8:50 am, Stephen C. Gilardi [EMAIL PROTECTED] wrote: On Nov 16, 2008, at 10:34 PM, Rich Hickey wrote: Since it only requires main, might I suggest you write this in Clojure instead? I gave that a try. Here's a simple version of a driver for the compiler, stored in src/ clj

Re: add-classpath erroring out, post r1100...

2008-11-17 Thread Rich Hickey
On Nov 17, 1:00 pm, Scott Fleckenstein [EMAIL PROTECTED] wrote: Hi All, I've run into a bug since upgrading past revision 1100, specifically around adding to the classpath at runtime using add-classpath. I've attached a test case

Re: Newbie: Default map parameters

2008-11-17 Thread Rich Hickey
On Nov 17, 5:16 pm, Mark Volkmann [EMAIL PROTECTED] wrote: On Mon, Nov 17, 2008 at 3:48 PM, Rich Hickey [EMAIL PROTECTED] wrote: On Nov 17, 4:22 pm, samppi [EMAIL PROTECTED] wrote: Inhttp://groups.google.com/group/clojure/browse_thread/thread/62140a28b..., the following example

Re: reader macros

2008-11-16 Thread Rich Hickey
On Nov 16, 7:59 am, Jeff Rose [EMAIL PROTECTED] wrote: Thanks for responding. I had already seen the shebang script hack on the wiki, and although impressive I don't think it's a solution. It's shocking to me that someone who is into lisp would even think of getting rid of read macros

Re: Filter repeats

2008-11-16 Thread Rich Hickey
first post to the group, but have been following the discussions for almost a year. Many thanks to Rich Hickey for creating a fantastic future-proof language which is a pleasure to use and to the great community! The following function (as part of a chemistry-related application) filters

Re: Patch: standalone compiler (almost)

2008-11-16 Thread Rich Hickey
On Nov 16, 9:47 pm, Stuart Sierra [EMAIL PROTECTED] wrote: Hi Rich, and all, I took a stab at writing a static compiler class, i.e. a main() that just compiles all the .clj files on the command line and saves the .class files. Patch attached. It almost works. The only thing that seems

Re: Getting a flat sequence from a map (and vice versa)

2008-11-15 Thread Rich Hickey
On Nov 15, 12:09 am, Brian Doyle [EMAIL PROTECTED] wrote: Another way to create a map is: user= (apply hash-map [:a 1 :b 2 :c 3]) {:a 1, :c 3, :b 2} Yes, that's fine, and for the flatten: (interleave (keys m) (vals m)) Rich On Fri, Nov 14, 2008 at 9:42 PM, samppi [EMAIL PROTECTED]

Re: Patch: precompiling Clojure core sources in Ant build script

2008-11-14 Thread Rich Hickey
On Nov 14, 12:51 pm, Stuart Sierra [EMAIL PROTECTED] wrote: Patch attached. This precompiles everything except parallel.clj, which requires an extra Jar. It also omits the source .clj files from the clojure.jar file. -Stuart Sierra Patch applied (svn 1101) - thanks! Rich

Re: let accepting a vector

2008-11-13 Thread Rich Hickey
On Nov 13, 8:36 am, Stuart Halloway [EMAIL PROTECTED] wrote: Hi Meikel, I spent a few minutes trying to write a macro to do this that doesn't use eval. So far no good. Is it truly impossible, though? I have never seen a good discussion of things that can be done only with eval. Any

Donations

2008-11-13 Thread Rich Hickey
Some people have asked how to donate to Clojure, so I've turned donations on in SF: https://sourceforge.net/project/project_donations.php?group_id=137961 Thanks to all for your support! Rich --~--~-~--~~~---~--~~ You received this message because you are

Changes for AOT compilation

2008-11-13 Thread Rich Hickey
We're coming around the other side of the few breaking changes I wanted to get done before release 1.0. The changes are: New regex format: http://groups.google.com/group/clojure/msg/eddd7f0d292da683 Uniform binding syntax using vectors:

Re: Simple Namespace Question

2008-11-13 Thread Rich Hickey
On Nov 13, 2:31 pm, Stuart Halloway [EMAIL PROTECTED] wrote: (clojure.core/ns clojure) or if you are on an old build I think it would be (clojure/ns clojure) This is coming in my book notes, I promise :), but ns should not be used to change namespaces in the repl, only in-ns should be

Re: clojure.zip: replace error

2008-11-13 Thread Rich Hickey
On Nov 13, 11:20 pm, Parth Malwankar [EMAIL PROTECTED] wrote: Hello, While setting ns to clojure.zip, I get the following error: user= (ns clojure.zip) java.lang.IllegalStateException: replace already refers to: #'clojure.zip/replace in namespace: clojure.zip (NO_SOURCE_FILE:0)

Re: Just Wondering: Tag metadata

2008-11-12 Thread Rich Hickey
On Nov 12, 6:49 pm, samppi [EMAIL PROTECTED] wrote: Onhttp://clojure.org/reader... A shorthand version allows the metadata to be a simple symbol or keyword, in which case it is treated as a single entry map with a key of :tag and a value of the symbol provided, e.g.: #^String

Re: Just Wondering: Tag metadata

2008-11-12 Thread Rich Hickey
On Nov 12, 7:21 pm, samppi [EMAIL PROTECTED] wrote: Ah, yes. I meant, what are these hints? What does the compiler change? Is it some sort of informal type enforcement or something? The hints are described here: http://clojure.org/java_interop#typehints It is strictly a performance

Re: Readable names

2008-11-10 Thread Rich Hickey
On Nov 10, 2008, at 8:48 AM, Robert Lally 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. Sure, I can read code

Re: The Dread Revision 1089

2008-11-10 Thread Rich Hickey
On Nov 10, 2008, at 9:46 AM, Graham Fawcett wrote: Hi folks, I haven't been bitten by the do not use revisions, R1089 onward, but it seems that others have. I'm just curious why the team decided not to use a branch for these breaking changes, and merging back with trunk once the

Re: The Dread Revision 1089

2008-11-10 Thread Rich Hickey
On Nov 10, 10:17 am, Rich Hickey [EMAIL PROTECTED] wrote: On Nov 10, 2008, at 9:46 AM, Graham Fawcett wrote: Hi folks, I haven't been bitten by the do not use revisions, R1089 onward, but it seems that others have. I'm just curious why the team decided not to use a branch

Re: a macro question, this time completely specified :-)

2008-11-09 Thread Rich Hickey
On Nov 9, 8:21 am, Stuart Halloway [EMAIL PROTECTED] wrote: You should be able to do this without the ref. Have the agent's state contain a pair of [has-run, fn-result]. The semantics of your runonce aren't clear to me, but here are some strategies: As Chouser proposed, if you only want a

<    3   4   5   6   7   8   9   10   >