Re: JavaWorld article

2009-05-12 Thread Joshua Fox
: The responsiveness, the skill, the quality and power of the code, never cease to amaze me. Thanks also to everyone who read and commented on the article. Regards, Joshua On Wed, Mar 4, 2009 at 8:33 PM, Joshua Fox joshuat...@gmail.com wrote: I am working on a short article to appear in JavaWorld sometime

Saving repl functions

2009-04-03 Thread Joshua Fox
When I have been experimenting on the REPL, I sometimes want to save my work. Is there a way of serializing an image of the REPL into Clojure sourcecode? Joshua --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

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

2009-03-24 Thread Joshua Fox
Why presumably with side effects?Otherwise you would use repeat. A pure function returns the same value every time, so there is no reason to call it repeatedly. Joshua On Tue, Mar 24, 2009 at 10:04 AM, Paul Drummond paul.drumm...@iode.co.ukwrote: 2009/3/23 Krešimir Šojat kso...@gmail.com:

Re: simple debugging utility

2009-03-24 Thread Joshua Fox
Eric Rochester has a debug macro, together with a walkthrough of how he built it, here http://writingcoding.blogspot.com/2008/09/stemming-part-19-debugging.html Joshua On Tue, Mar 24, 2009 at 4:43 PM, Mark Volkmann r.mark.volkm...@gmail.comwrote: I want to write a function or macro that

Re: Information Hiding

2009-03-23 Thread Joshua Fox
Any other tricks or techniques There is defn- http://clojure.org/api#toc189 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, send

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

What makes Clojure an easier Lisp?

2009-03-22 Thread Joshua Fox
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 achieving the ease of Clojure. 2. Clojure is typically illustrated

Re: March 20th 2009 Rich Hickey Appreciation Day!

2009-03-21 Thread Joshua Fox
Hear, Hear! It was far more natural to learn than Lisp and Scheme. The language has lots of brilliant features that make me think I wish I had thought of that. And I like the way Rich has built the community. Joshua --~--~-~--~~~---~--~~ You received this

Re: Request Feedback on Clojure Blog Article

2009-03-20 Thread Joshua Fox
I like the sequential let too. For one thing, it allows for the breaking apart of complex expressions into more comprehensible parts, with well named intermediate variables resulting in self documenting code. About the 7-part *let* as shown in your example: Could we get some opinions about

Re: Request Feedback on Clojure Blog Article

2009-03-19 Thread Joshua Fox
Great article! Although I’ve done only a little Ruby metaprogramming, my sense is that Clojure’s macros make it more powerful than Ruby in this respect It would be good to see a comparison of metaprogramming with macros. They sometimes are used for similar purposes, but of course are not the same

Re: Request Feedback on Clojure Blog Article

2009-03-19 Thread Joshua Fox
On Wed, Mar 18, 2009 at 10:40 PM, Stephen C. Gilardi squee...@mac.com wrote: Because parallel bindings are also useful Could you explain? I don't understand the justification for let in Lisp, when let* seems so much more useful. Joshua

Re: Main Function for Program Entry Point

2009-03-15 Thread Joshua Fox
Of course, defining the function makes it easier to invoke your code if you think it might have wider usefulness. Joshua On Sun, Mar 15, 2009 at 3:55 AM, Keith Bennett keithrbenn...@gmail.comwrote: Is it a good idea or a bad idea to provide a main() function as the program's entry point? As

Bytecode optimization

2009-03-12 Thread Joshua Fox
I was just reading thishttp://developer.amd.com/documentation/Articles/pages/01302008_jvm.aspx and wondering: Does Clojure's pure-functional design enhance VM-level bytecode optimization by simplifying escape analysis? Joshua --~--~-~--~~~---~--~~ You received

Re: Capitalize string

2009-03-08 Thread Joshua Fox
How about this? user= (defn upper-first [s] (apply str (Character/toUpperCase (first s)) (rest s))) #'user/upper-first user= (upper-first a) A On Sun, Mar 8, 2009 at 3:39 PM, David Sletten da...@bosatsu.net wrote: Is there a function to capitalize the first letter of a string or a

What is Clojure NOT good for?

2009-03-06 Thread Joshua Fox
Is it fair to say that Clojure shines in algorithmic processing, string processing, concurrency management, but that there are better choices in other areas: - Application programming , where the key challenge is fitting a standard three-tier application to the business domain. - Enterprise

Re: Clojure's syntax design: macros vs functions

2009-03-05 Thread Joshua Fox
expressions get evaluated and which don't, at least when you are dealing with side effects. I think that this is the key point. The Clojure syntax is built around its pure-functional core. Side effects are dangerous, and the rule there is mutator beware. Joshua

Re: Inclusive-exclusive range

2009-03-04 Thread Joshua Fox
With pointer-based strings or arrays, as in C , it is natural to start at index 0, so that you can do pointer arithmetic: address+0 is the first character/item. Then, if you have a string or array of length n, the last item is at n-1. Joshua On Wed, Mar 4, 2009 at 2:07 PM, Mibu

Re: Inclusive-exclusive range

2009-03-04 Thread Joshua Fox
This is discussed, with references, here http://en.wikipedia.org/wiki/Array#Index_of_the_first_element --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Clojure creates lots of classloaders

2009-03-04 Thread Joshua Fox
I think it is the best way to load and discard lots of dynamically-loaded and in fact dynamically-generated classes. Joshua On Wed, Mar 4, 2009 at 5:21 PM, Hendrik geheimm...@gmail.com wrote: Hi, I got a question: Clojure seems to create poopillions of DynamicClassLoader instances. Why does

warning on mutation

2009-03-04 Thread Joshua Fox
Can Clojure generate warnings when a function has side effects, particularly in transactions and other places where one should avoid them? Perhaps just a warning on access to any objects other than those of Clojure types and pre-approved immutable Java types (String, Number, etc.)? Joshua

JavaWorld article

2009-03-04 Thread Joshua Fox
I am working on a short article to appear in JavaWorld sometime this spring. Its goal is to encourage senior Java developers to learn more about Clojure. The audience is experienced and knowledgeable about Java, but LISP to them is a distant memory from college. So, rather than present a tutorial,

Re: Opinions on - macro?

2009-03-01 Thread Joshua Fox
is a function of more than one argument. Re-written with place- holders it would be: (- a-thing (frobnicate ,,) (baz ,,) (bar ,, bla) (foo ,,)) Does that make it more clear? -Drew On Feb 28, 9:39 pm, Joshua Fox joshuat...@gmail.com wrote: - confuses me: Does it treat functions with multiple

Re: Internal structure of evaluation results

2009-03-01 Thread Joshua Fox
I find it confusing. Nothing seems to be where it should be, there are almost no examples Just my opinion, but I think that Clojure is very well documented, both on clojure.org and on various online articles. But I'm tired of doing it every time when some (sub)results type gets changed In

Re: Opinions on - macro?

2009-02-28 Thread Joshua Fox
- confuses me: Does it treat functions with multiple parameters different from functions with one parameter? Am I right that it can only be used with the latter? Joshua --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Extensive use of let?

2009-02-25 Thread Joshua Fox
Of course, the use of let does not make the code any more imperative or less functional, as long as there are no side effects. Also, the scope is limited to the let block, keeping it clean, and there should be no harm to performance. IMHO, the code with let is simply more readable and therefore

Why pass bindings as vector

2009-02-24 Thread Joshua Fox
Why do many core macros pass bindings as a vector, then destructure them in various ways into symbols and values. This is instead of just providing the symbol and value, e.g., (defmacro my-macro [s v body] `(let [~s ~v] ... In at least five macros in core.clj, this was changed

Re: alternate syntax

2009-02-23 Thread Joshua Fox
It's a good idea. Not for anyone to actually use, but as an demonstration of code is data, and of the separation of surface syntax from the code data-structure. Can you do this without reader macros? Can you keep it homoiconic? (Apparently so, given the transformation rules, but I wonder if there

Re: building a class or jar file from clojure

2009-02-09 Thread Joshua Fox
Ahead of Time compilation might be what you are looking for . This lets you distribute.class files rather than your .clj source files, and makes for slightly faster code at startup. http://groups.google.com/group/clojure/msg/58e3f8e5dfb876c9 Joshua On Mon, Feb 9, 2009 at 6:52 PM, hank williams

Re: Programming Clojure sample code: fixes for breaking changes

2009-01-24 Thread Joshua Fox
A related point about the validator function (for Refs), possible the result of the same change in the Clojure codebaseOn page 133 of Beta 5.0, (def messages (ref () :validator validate-message-list) The code samples, using, the bundled clojure, do work. However, right above the code on p.