Re: Clojure Poll 09/2008

2008-09-11 Thread Tom Emerson
On Thu, Sep 11, 2008 at 11:52 AM, Allen Rohner <[EMAIL PROTECTED]> wrote: > I already voted, but I agree with this. Having a standard way to run > clojure scripts from a command line would be very useful. One could trivially take the command-line generated by the shell magick and put it into a s

Re: Clojure Poll 09/2008

2008-09-11 Thread Apurva Sharan
Yes - I know. And there is 'println' also... The full mini-language provided by format is much more powerful ... [1]> (format nil "~{[~{~a~^:~}]~^~&~}" '((1 2 3)(7 8 9))) "[1:2:3] [7:8:9]" [2]> (format nil "~r" 123456) "one hundred and twenty-three thousand, four hundred and fifty-six" [3]> B

Re: Making Clojure Popular

2008-09-11 Thread AlamedaMike
Great minds think alike. ;-) I just left a post on Rich's poll (comment #33) much to this effect. > The most important purpose > of the book would be give people confidence in Clojure. yes, because the language can then be seen to clearly hang together as a whole, rather than just as a random as

Re: Clojure Poll 09/2008

2008-09-11 Thread Allen Rohner
On Sep 11, 8:32 am, "Paul Stadig" <[EMAIL PROTECTED]> wrote: > I have a stupid idea as well (related to reader macros). Is there any > way we can get the reader to not have problems with > "#!/usr/bin/clojure" as the first line? > > This would allow simple and standard use of Clojure in a script

Re: Method dispatch on class - "ns-*" functions accepting symbols

2008-09-11 Thread Stephen C. Gilardi
On Sep 11, 2008, at 8:12 AM, Rich Hickey wrote:Using the latest syntax is good, although the idiom for static callsis (Classname/method args). For instance:(clojure.lang.Namespace/find sym)instead of:(.find clojure.lang.Namespace sym)because static methods really aren't functions taking classes, bu

Re: Clojure Poll 09/2008

2008-09-11 Thread Stuart Sierra
On Sep 11, 1:18 am, Apurva Sharan <[EMAIL PROTECTED]> wrote: > 3) Equivalent of 'format' macro. This would be really helpful in debugging. There is a "printf" in recent Clojure SVN. -Stuart --~--~-~--~~~---~--~~ You received this message because you are subscribed

Debian package for clojure

2008-09-11 Thread Paul Stadig
I have created a debian package for clojure. I've basically packaged up the JAR with the bin script from http://github.com/jochu/clojure-extra/tree/master. It's still a work-in-progress, but if there are any debian users out there, I'd like feedback. To install the debian package you need to first

Re: Clojure Poll 09/2008

2008-09-11 Thread Paul Stadig
I have a stupid idea as well (related to reader macros). Is there any way we can get the reader to not have problems with "#!/usr/bin/clojure" as the first line? This would allow simple and standard use of Clojure in a script file. Or perhaps a solution (other than mucking with the reader) is to

Re: Clojure Poll 09/2008

2008-09-11 Thread noahr
Another (possibly stupid) idea: Have some prefix-character to allow you to have the argument to a macro be evaluated (sorta like a function), and its resulting data structure given to the macro instead. I realize the whole point of macros is that the arguments ARENT evaluated, but would it be use

Re: local functions?

2008-09-11 Thread Parth Malwankar
On Sep 11, 3:01 am, Allen Rohner <[EMAIL PROTECTED]> wrote: > > For very short functions one can use the cut notation: #(...). In case > > there are several functions or functions going over several lines, this > > is a sign that they should go into an own defn(-) with appropriate > > docstring.

Re: Clojure Poll 09/2008

2008-09-11 Thread Chouser
On Thu, Sep 11, 2008 at 3:23 AM, hoeck <[EMAIL PROTECTED]> wrote: > > Funny, had this idea too and know playing with an implementation of > relational algebra in clojure. I'm using clojures hashmaps for indexes > and vectors to represent the tuples. For conditions, I am using > functions returning

Re: Type hints for expressions and a problem

2008-09-11 Thread Alex Charlton
Thank you. I looked right over that. On Sep 11, 8:12 am, ".Bill Smith" <[EMAIL PROTECTED]> wrote: > Take a look athttp://clojure.org/java_interop. > > Bill > > > Would someone be able to point me towards some information on that > > syntax? --~--~-~--~~~---~--~~ Yo

Re: Method dispatch on class - "ns-*" functions accepting symbols

2008-09-11 Thread Rich Hickey
On Sep 10, 10:59 pm, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote: > On Sep 10, 2008, at 2:08 PM, Rich Hickey wrote: > > > It would work, but it seems like overkill. In particular, there's no > > intention to extend it any further, and all symbol versions do the > > same thing, call find-ns an

Re: Type hints for expressions and a problem

2008-09-11 Thread .Bill Smith
Take a look at http://clojure.org/java_interop. Bill > Would someone be able to point me towards some information on that > syntax? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gr

Re: Type hints for expressions and a problem

2008-09-11 Thread Alex Charlton
Aw, dang. Just caught the typo: '(javax.imageio_._ImageIO) I'm afraid I don't understand the usage of the preceding dot used in the examples: (.read ImageIO (new File name))) and (.createGraphics #^java.awt.image.BufferedImage (load-image "...")) Would someone be able to point me towards some i

Re: Making Clojure Popular

2008-09-11 Thread Albert Cardona
> I think there should be a book on Clojure. Not a book on how to use Clojure > but a book on how Clojure was built. Somebody should be able to actually > build their own Clojure at the end of it. There is no reason why they should > do this and this is not the purpose of the book. The most impor

Re: Type hints for expressions and a problem

2008-09-11 Thread Alex Charlton
Sorry about the double post. I was unable to see my post from last night until now. On Sep 10, 9:50 pm, Alex Charlton <[EMAIL PROTECTED]> wrote: > I imported the following: > > (import '(java.awt.image BufferedImage) >            '(java.io File) >            '(javax.imageio.ImageIO)) > > On Sep 1

Re: Bug in clojure.zip/up?

2008-09-11 Thread Rich Hickey
On Sep 10, 12:26 pm, Christophe Grand <[EMAIL PROTECTED]> wrote: > Hello, > > I'm playing with zippers (and zip filters) and I think there's a bug > when you replace the root: > user=> (-> [:before] zip/vector-zip (zip/replace [:after]) zip/up) > [[[:after]] nil] > > Changing (when path ...) to

Making Clojure Popular

2008-09-11 Thread PJ Fitzpatrick
Somebody mentioned in the last few days that they were wondering how Clojure can be made more popular. I actually have two ideas on this but will only mention one of them here. The other is a bit self serving so I don't think it is appropriate :-) I think there should be a book on Clojure. Not a

Re: Type hints for expressions and a problem

2008-09-11 Thread Alex Charlton
I imported the following: (import '(java.awt.image BufferedImage) '(java.io File) '(javax.imageio.ImageIO)) On Sep 10, 9:27 pm, ".Bill Smith" <[EMAIL PROTECTED]> wrote: > Did you import ImageIO? > > Bill --~--~-~--~~~---~--~~ You received t

Re: Type hints for expressions and a problem

2008-09-11 Thread Timothy Pratley
Hi Alex, This works for me: (import '(javax.imageio ImageIO) '(java.io File)) (defn load-image [name] (.read ImageIO (new File name))) (load-image "tim/disaster2007_Genoa19.gif") I'd suggest not worrying about type tips until after you get your code doing what you want it to do. Type tip

Re: Type hints for expressions and a problem

2008-09-11 Thread Alex Charlton
Thanks for the type hint clarification. I had imported the packages via: (import '(java.awt.image BufferedImage) '(java.io File) '(javax.imageio.ImageIO)) Should that not be enough? --~--~-~--~~~---~--~~ You received this message because yo

Re: Processing wrapper

2008-09-11 Thread hoeck
Wow, cool, thanks! --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For mo

Re: Clojure Poll 09/2008

2008-09-11 Thread hoeck
On 10 Sep., 21:28, Allen Rohner <[EMAIL PROTECTED]> wrote: > Finally, not that I'm asking you or anyone else to build this, I'm > just throwing this out there to see if anyone else is thinking along > the same lines as me :-). I think it would be really cool to build a > database in Clojure. SQL