Re: Clojure's n00b attraction problem

2010-06-30 Thread Meikel Brandmeyer
Hi,

On Jun 30, 3:25 am, Michael Richter  wrote:

> I swear, step by step Clojure is falling into the Common Lisp death spiral.
>  As usual, too, it's the community at fault, not the creator.

Please keep the church in the town. The Clojure community is one of
the best and friendliest I had ever the honor of being part of. While
with increasing community size smugness creeps in, this is a) only
happening with singular persons (I'm guilty, myself) and b) not
exhibited by the "core" community - the gurus being around since the
first announcement.

As you might have noticed: from the "old guard" eg. Laurent and Chas
chimed in. And their answers were helpful and free of smugness. The
community is product of its members - "old" and "new" ones. So while
you are right: clojure *might* fall into the CL trap, and if so it's
the community's fault. But that is certainly far from what's happening
at the moment.

Sincerely
Meikel

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread Laurent PETIT
Hi,

2010/6/30 Michał Marczyk :
> [...]
> Then again, given that CCW has paredit built-in, I'm not going to
> claim Emacs is likely to be much better. (I actually find it simpler,
> but if the students in question have Java classes ahead of them / in
> parallel, they'll likely need an IDE anyway, so...) I wonder how much
> hassle it would be to provide Enclojure with an implementation too;
> perhaps I'll into this in the future.

I hope this will be possible in the future. I've done everything I
could think about to make it possible. paredit.clj is totally
decoupled from eclipse, and only depends on clojure and contrib (and
in its next version, from another clojure library which only depends
on clojure).

But I would suggest waiting a little bit more before digging into it,
because the new version will be far superior in terms of API and
implementation (not in term of features, in this release) to the
current one. If everything goes well, I'll eventually publish it to
clojars, of course.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Compile multiple files in Emacs (interactive development)

2010-06-30 Thread Oleg
Hello Guys!

Does somebody knows better way to compile all files of my project in
proper order in emacs
after i've changed my working directory to project base and after
command 'M-x slime'?

I'm developing compojure application and now i have to reload all my
project files (about 10) in emacs and click "C-c C-k" to compile every
of them.
It's boring, especially if my project will grow.

Is there a better solution?

Cheers, Oleg

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Compile multiple files in Emacs (interactive development)

2010-06-30 Thread Alex Ott
Hello

It's better to use lein or maven to run swank server - this will compile
all sources, and provide proper classpath, etc.  In Maven you can specify
script, that will be loaded automatically on swank start. For Lein, I don't
know about such feature, although it's not so hard to implement

Oleg  at "Wed, 30 Jun 2010 02:16:42 -0700 (PDT)" wrote:
 O> Hello Guys!

 O> Does somebody knows better way to compile all files of my project in
 O> proper order in emacs
 O> after i've changed my working directory to project base and after
 O> command 'M-x slime'?

 O> I'm developing compojure application and now i have to reload all my
 O> project files (about 10) in emacs and click "C-c C-k" to compile every
 O> of them.
 O> It's boring, especially if my project will grow.

 O> Is there a better solution?

 O> Cheers, Oleg



-- 
With best wishes, Alex Ott, MBA
http://alexott.blogspot.com/   http://alexott.net
http://alexott-ru.blogspot.com/

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


newline and println on windows

2010-06-30 Thread David Powell

I raised a ticket a while ago regarding newline and println on Windows.

http://www.assembla.com/spaces/clojure/tickets/300-newline-should-output-
platform-specific-newline-sequence

Currently these functions always output ASCII 10 line feeds.  I believe that 
they should output the platform default line-endings as Java does, so on 
Windows they would output ASCII 13 10.

http://java.sun.com/j2se/1.4.2/docs/api/java/io/BufferedWriter.html

If you are currently writing code like (println "hello world\r"), in order to 
work around the situation on Windows, then you will need to remove that work-
around, but I'd think that that is pretty unlikely.  The patch wouldn't affect 
the behaviour of code such as (print "hello world\r\n").

Any opposition?

-- 
Dave

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread cageface
On Jun 29, 8:17 pm, Michael Richter  wrote:
> A good salesman also doesn't come across as smugly self-satisfied and
> projecting a sense of superiority.

I did a moderate amount of CL hacking in 2003-4 and I've been dipping
my toes back in lately with Clojure but I hardly count as a "lisp
weenie". I say Lisp and FP are hard not because I have mastered them
but because I am still learning and *I* have found them hard. From
what I've observed in other programmers I'm far from alone in this.

Honestly I think it's noobs like me that are going to make the most
difference in the near-term success of Clojure. We're the experienced
Python and Java and Ruby programmers in Chas' survey that are looking
for a better way to solve the problems we face in our work. We
recognize that languages like Clojure might be the answer, but also
that they require a new, different, and initially painful way of
thinking. We're motivated enough to get over hurdles like classpaths,
java installs, IDEs etc. and those of us that do have the
determination and ability to stick with it will be the ones that build
the killer app that puts Clojure in the spotlight. The reality is that
a lot of us are going to fall by the wayside. I was comfortable in
Ruby after a few weekends. I still struggle with FP & Lisp after 10
years of study. If you're one of those people to whom s-expr syntax,
recursion, immutability etc seem simple & natural and logical
congratulate yourself but also show some humility. You're the
exception, not the norm.

So, what do noobs like me need from Clojure? Honestly not much. The
tools are there to get real work done and because of Clojure I'm more
optimistic about Lisp than I've ever been. More extensive
documentation, a single blessed build tool, some tutorials on
protocols etc would all be welcome but the lack of these things isn't
stopping anybody that wouldn't have been stopped anyway.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: newline and println on windows

2010-06-30 Thread Shawn Hoover
On Wed, Jun 30, 2010 at 7:39 AM, David Powell  wrote:

>
> I raised a ticket a while ago regarding newline and println on Windows.
>
> http://www.assembla.com/spaces/clojure/tickets/300-newline-should-output-
> platform-specific-newline-sequence
>
> Currently these functions always output ASCII 10 line feeds.  I believe
> that
> they should output the platform default line-endings as Java does, so on
> Windows they would output ASCII 13 10.
>
> http://java.sun.com/j2se/1.4.2/docs/api/java/io/BufferedWriter.html
>
> If you are currently writing code like (println "hello world\r"), in order
> to
> work around the situation on Windows, then you will need to remove that
> work-
> around, but I'd think that that is pretty unlikely.  The patch wouldn't
> affect
> the behaviour of code such as (print "hello world\r\n").
>
> Any opposition?
>

I never had a need for it, but I don't see a reason to oppose either. I
tested your patch with cmd.exe, cygwin bash, and emacs modes, and it worked
fine. The only thing that messed up was the swank-clojure REPL, showing ^M
in any lines that were printed with println, but I think the swank-clojure
server could bind the proposed var back to \n and all would be well.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: usage examples in clojure api docs

2010-06-30 Thread Mark Fredrickson
Hello Tim,

> Knuth originally created an idea of literate programming
> where you embed source code into latex documents. He called
> such documents "web" documents (because nobody had yet used
> the word "web").

Thanks for passing along your code. I have some familiarity with
noweb. I use Sweave every day (R's noweb implementation), though not
for many of its more advanced features. I specifically avoided the
using the phrase "literate programming" for a few reasons:

1. I have never defined chunks in different orders than they should
execute. I have no need for this feature. As I understand it, out-of-
order chunks are a cornerstone of the lit. prog. model.

2. Insofar as "literate programming" implies "noweb", I dislike the
<<>>=/@ syntax. Moreover, this syntax requires a smarter parser to
understand any options inside the <<...>>= directives. My parser is
dumb. My insight is that I can do the same things as <>=
through a macro (output-forms ...). The system is extensible, unlike
noweb.

3. Insofar as "literate programming" implies "LaTeX," while I write a
lot of TeX, I intend to use this system for blog posts, README files,
perhaps even inline documentation as mentioned above. My experience
with Sweave shows that writing other document types is not the
default. Perhaps there is an option to not inject \Schunk{...} into
my .txt files, but changeling is designed from the group up to support
many different output contexts.

I may be reinventing the wheel, but mine has bling rims. ;-)

-Mark

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread Greg
> Tying the fortunes of Clojure to Java was a brilliant move and one
> that I've advocated for years but the trend I've seen lately to try to
> paper over the Java underpinnings of the language worries me, as does
> talk of making Clojure-in-Clojure. There's a small but viable market
> for people doing difficult things in a Java-flavored Lisp (Runa,
> Flightcaster, BackType etc), but this is where the future of Clojure
> lies - as a power tool for heavy lifting on the Java platform.

Worries you???

As far as I understand, Clojure will be able to interop with Java even when 
Clojure-in-Clojure happens, so there's nothing to worry about.

I'm quite excited about Clojure-in-Clojure. The possibilities that will offer 
are awesome. I'm looking forward to the day when it runs on LLVM. If that 
happens. :-)

- Greg

On Jun 29, 2010, at 11:15 PM, cageface wrote:

> On Jun 29, 6:25 pm, Michael Richter  wrote:
>> Are you *trying* to evoke the "Smug Lisp Weenie" vibe, cageface, or is this
>> just a natural byproduct of being a burgeoning Smug Clojure Weenie?
> 
> How many times do I have to say I'm in favor of making things as easy
> as possible for beginners before I'm exempt from this charge? How many
> decades does Lisp have to spend on the sidelines before Lispers admit
> that maybe, just maybe, it's not for everybody?
> 
> Tying the fortunes of Clojure to Java was a brilliant move and one
> that I've advocated for years but the trend I've seen lately to try to
> paper over the Java underpinnings of the language worries me, as does
> talk of making Clojure-in-Clojure. There's a small but viable market
> for people doing difficult things in a Java-flavored Lisp (Runa,
> Flightcaster, BackType etc), but this is where the future of Clojure
> lies - as a power tool for heavy lifting on the Java platform.
> 
> -- 
> 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 this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: basic help with netbeans/enclojure installation

2010-06-30 Thread Jared
I don't think you wrote what you intended to write.

"Enclojure is not yet compatible with NetBeans 6.8. You can access
NetBeans 6.8 downloads here:"

I think you mean:
"Enclojure is not yet compatible with NetBeans 6.9. You can access
NetBeans 6.8 downloads here:"



On Jun 17, 6:45 pm, Chas Emerick  wrote:
> Indeed, it appears that enclojure andNetBeans6.9 do not mix well.  
> I've updated the "getting started" wiki page 
> (http://www.assembla.com/wiki/show/clojure/Getting_Started_with_Netbea...
> ) with a note to reflect this, and point directly at the 6.8 download  
> page.
>
> FYI, there is also an enclojure-specific group/mailing list:
>
> http://groups.google.com/group/enclojure
>
> Cheers,
>
> - Chas
>
> On Jun 17, 2010, at 8:19 AM, Lee Spector wrote:
>
>
>
> > Thanks all. I've now installedNetBeans6.8 and modulo a couple of  
> > update cycles on components everything went smoothly and I'm now  
> > runningNetBeans/Enclojure.
>
> > Perhaps the getting started instructions ought to include a comment  
> > about the requiredNetBeansversion.
>
> > -Lee

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


How to: an anonymous recursive function

2010-06-30 Thread Tim Robinson
So I am reading On Lisp + some blogs while learning Clojure (I know,
scary stuff :)

Anyway, I've been playing around to see if I can get an anonymous
recursive function to work, but alas I am still a n00b and not even
sure what Clojure's approach to this would be.

How would I do this in Clojure?:

My first attempt:

((fn [x]
   (if (= x 0)
   1
   (* 2 (recur (dec z) 5)

Then my second:

((fn [x]
   (let [z (if (= x 0)
   1
   (* 2 x))]
  (recur (dec z  5)

Ideally one could do:

((recursive-fn #( if (= % 0) 1 (* 2 %)) (recur it))  5)


Obviously none work, and I believe I understand why. I just don't
understand how to actually do this or if for some reason Clojure
avoids this for some reason.

I am not actually trying to accomplish a specific task, so the example
was made to be simple not meaningful. I'm just playing around to learn
recursive functions and Clojure style.

Thanks,
Tim



-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread Sean Allen
>
> Tying the fortunes of Clojure to Java was a brilliant move and one
> that I've advocated for years but the trend I've seen lately to try to
> paper over the Java underpinnings of the language worries me, as does
> talk of making Clojure-in-Clojure. There's a small but viable market
> for people doing difficult things in a Java-flavored Lisp (Runa,
> Flightcaster, BackType etc), but this is where the future of Clojure
> lies - as a power tool for heavy lifting on the Java platform.
>

So those who left Java behind years ago but like Lisps in general and Clojure
in particular and want to minimize their contact with Java, where do
they fit in your view?
Enemies of the proper use of Clojure? Destroyers of the future?

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: reify bug?

2010-06-30 Thread Greg
Many thanks Adrian!

(This is the OP, I sent an email from another account because I thought there 
were issues with this one).

On Jun 29, 2010, at 9:39 AM, Adrian Cuthbertson wrote:

> Sorry, you don't need the type hists just the "this" arg...
> 
> (seq (.list (java.io.File. ".") (reify java.io.FilenameFilter (accept
> [_ f s] (not (.startsWith s "."))
> 
> On Tue, Jun 29, 2010 at 3:35 PM, Adrian Cuthbertson
>  wrote:
>> You need the "this" arg and I find you need to hint the exact types
>> when reifying java interfaces;
>> 
>> (seq (.list (java.io.File. ".") (reify java.io.FilenameFilter
>> (^boolean accept [_ ^java.io.File f ^String s] (not (.startsWith s
>> "."))
>> 
>> ... works for me.
>> 
>> - Rgds, Adrian
>> 
> 
> -- 
> 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 this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Documentation and examples (and where is the documentation on reduce)?

2010-06-30 Thread michele

Mother's invention is a lazy necessity, I think.


On Jun 29, 9:46 pm, Meikel Brandmeyer  wrote:
> Hi,
>
> Am 29.06.2010 um 19:11 schrieb michele:
>
> > Meikel, idiots are nice people too, so don't feel bad. But seriously,
> > why do you think we work this hard to make the computer do all this
> > things for us? Because we're lazy.
>
> Ah. IMHO, computer help us solving problems which we wouldn't have without 
> them.
>
> But then: laziness is the source of intelligence. Or was it the other way 
> around?
>
> ;)
>
> Sincerely
> Meikel

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread Alessio Stalla
On Jun 30, 5:19 am, Michael Richter  wrote:
> On 30 June 2010 11:15, cageface  wrote:
>
> > On Jun 29, 6:25 pm, Michael Richter  wrote:
> > > Are you *trying* to evoke the "Smug Lisp Weenie" vibe, cageface, or is
> > this
> > > just a natural byproduct of being a burgeoning Smug Clojure Weenie?
>
> > How many times do I have to say I'm in favor of making things as easy
> > as possible for beginners before I'm exempt from this charge?
>
> You're exempt from this "charge" (I view it more as a "trivially obvious
> observation" myself) when you stop talking like a Smug Lisp Weenie.
>
> Hint: you're not coming across as a Smug Lisp Weenie because of the "make it
> as easy as possible for beginners" portion of your posts.

I'm a CLer, and I've been following Clojure's development for a while,
though I haven't used it yet. I agree that the answers you get from
experienced CLers sometimes contain a fair amount of smugness;
however, I suspect that the questions also play a role here... how
often are Java, C#, C++ people asked "why is Java/C#/C++ so hard for
newbies"? How do you think they'll answer the nth time that question
is made?
I also follow comp.lang.java.programmer for example: if you look at
there, most newbie questions are like "why doesn't such-and-such
work?" and are routinely answered along the lines of "first, sit down
and code a self-contained example of the problem, then post it here,
then, and only then, maybe someone will answer" - and no one
complains. Oh, and no one asks why Java is so hard, either. And Java
*is* hard, no matter what people think.
I suspect that's because most people who learn Java do so as part of
their job, they accept it's hard and spend a fair amount of time in
learning it. People who learn Lisp often do so in their free time, and
aren't prepared to spend time studying. That doesn't mean that a one-
click-install for a Lisp with an IDE and some popular libraries
preinstalled wouldn't be useful - it would be great! But who is going
to maintain it? If you pay me well enough, I'll do it, I promise :)
but until then, no one will do it unless he is so interested in having
a newbie-friendly Lisp that he'll spend part of his free time for
that. Are you that individual?

Cheers,
Alessio

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread Paul Moore
On 30 June 2010 04:02, Jason Smith  wrote:
> So I'll say it again, it's just not that simple.  Unless you already
> know Java, and the only learning curve you face is the new features in
> Clojure.  Then it's not bad. But it does give you new ways to cut your
> foot off more quickly. :-)

An interesting alternative "not that simple" point of view, that it's
not Clojure's Lisp-like features that are the hard bit, but the Java
integration :-)

Based on this comment, maybe I could ask an alternative question - can
you suggest where I should go to read some tutorials which would give
me a fast start on "just enough" Java infrastructure to get
comfortable in Clojure? Most of the Java tutorials I've seen tend to
assume I want to learn Java - I know enough Java to read code samples,
and that'll do for what I want.

Paul.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread Paul Moore
On 29 June 2010 23:31, Sean Corfield  wrote:
> FWIW, I blogged a short step-by-step post on getting up and running
> with Leiningen to show some Clojure at the repl, run as a script and
> compiled to a JAR and run via java:
>
> http://corfield.org/blog/post.cfm/getting-started-with-clojure
>
> Bear in mind my blog audience is folks with some familiarity with Java...

That's nice! I never noticed lein repl before...

One thing I've found is that the experience (as described) is a lot
simpler on Unix/Linux/Mac than my experience on Windows. Part of the
reason may be that lein self-install doesn't work on Windows. I may
look into that.

I wonder - would a Windows installer package that installed clojure,
clojure-contrib and leiningen, and set up some basic paths and start
menu shortcuts be of use? I'm not a great fan of installers myself,
but I suspect that once I get a "clean" working environment set up for
myself, it wouldn't be a big step to package that up in an installer
so that others could use it.

Paul.

PS What are the standards for jar naming conventions? I have seen some
people use "clojure.jar" and others use "clojure-1.1.0.jar". Should I
have version numbers in my jar filenames? Is there a "Java best
practice" I should be referring to for things like this?

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: New Primitive data types (equal branch) - impact on optimized code.

2010-06-30 Thread j-g-faustus
Tried the equiv branch briefly: The "1.1 style" version is ~4%
quicker, but still ~4x slower than Java and ~2x slower than mutable
deftype.

But I found another issue: Array access apparently converts primitives
to boxed values at every access. This is perhaps because aget/aset is
a function and primitives cannot cross function boundaries?
That would explain the relative slowness of arrays.

Here is a test case http://gist.github.com/458669
And a profiler screenshot 
http://i589.photobucket.com/albums/ss334/j-g-faustus/profiling/array-test-50k.png

15% CPU time goes to Double.valueOf(double) in all-primitive array
access and another ~4% to intCast(int).

The number of calls to Double.valueOf(double) seems to suggest that it
is called only on aset, not on aget, though I can't think of any
reason how that could be.

Does anyone know more about this?


Regards
jf


On Jun 29, 9:31 pm, David Nolen  wrote:
>
> You should give the latest equiv branch a shot and let us know. The gap
> should be a bit smaller since arithmetic operations won't box their results.
>
> David

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: usage examples in clojure api docs

2010-06-30 Thread Tim Daly



Mark Fredrickson wrote:

Hello Tim,

  

Knuth originally created an idea of literate programming
where you embed source code into latex documents. He called
such documents "web" documents (because nobody had yet used
the word "web").



Thanks for passing along your code. I have some familiarity with
noweb. I use Sweave every day (R's noweb implementation), though not
for many of its more advanced features. I specifically avoided the
using the phrase "literate programming" for a few reasons:

1. I have never defined chunks in different orders than they should
execute. I have no need for this feature. As I understand it, out-of-
order chunks are a cornerstone of the lit. prog. model.
  

Actually I rarely use this feature.
I do use the fact that equal chunk names get combined so that I can split a
large chunk into parts and add explanations in the middle.

2. Insofar as "literate programming" implies "noweb", I dislike the
<<>>=/@ syntax. Moreover, this syntax requires a smarter parser to
understand any options inside the <<...>>= directives. My parser is
dumb. My insight is that I can do the same things as <>=
through a macro (output-forms ...). The system is extensible, unlike
noweb.
  
Literate programming and noweb are independent. As I said, the lisp 
version of tangle

uses latex syntax such as

\begin{chunk}{some chunk name}
 (your code)
\end{chunk}

rather than the

<>=
 (your code)
@

This has the considerable advantage that your document is pure latex.

3. Insofar as "literate programming" implies "LaTeX," while I write a
lot of TeX, I intend to use this system for blog posts, README files,
perhaps even inline documentation as mentioned above. My experience
with Sweave shows that writing other document types is not the
default. Perhaps there is an option to not inject \Schunk{...} into
my .txt files, but changeling is designed from the group up to support
many different output contexts.

  

The same magic can happen in TeX since latex is only a macro layer.

I may be reinventing the wheel, but mine has bling rims. ;-)
  
The details are not important but the use of literate programming (or 
whatever term
you prefer) is important  and can dramatically change the quality of the 
system.

-Mark

  


--
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: How to: an anonymous recursive function

2010-06-30 Thread Mike Meyer
On Tue, 29 Jun 2010 22:44:58 -0700 (PDT)
Tim Robinson  wrote:

> So I am reading On Lisp + some blogs while learning Clojure (I know,
> scary stuff :)
> 
> Anyway, I've been playing around to see if I can get an anonymous
> recursive function to work, but alas I am still a n00b and not even
> sure what Clojure's approach to this would be.
> How would I do this in Clojure?:

IIUC based on examples involving label and letrec, you want a
recursive function whose name isn't visible outside of some restricted
scope. letfn is analogous to those, and that would look like:

(letfn [(anon [x]
  (if (= x 0)
  1
  (* 2 (anon (dec x)]
   (anon 5))

> My first attempt:
> 
> ((fn [x]
>(if (= x 0)
>1
>(* 2 (recur (dec z) 5)
> 
> Then my second:
> 
> ((fn [x]
>(let [z (if (= x 0)
>1
>(* 2 x))]
>   (recur (dec z  5)
> 
> Ideally one could do:
> 
> ((recursive-fn #( if (= % 0) 1 (* 2 %)) (recur it))  5)
> 
> 
> Obviously none work, and I believe I understand why. I just don't
> understand how to actually do this or if for some reason Clojure
> avoids this for some reason.

On the other hand, maybe I misunderstood what you're trying to do, in
which case an example of what you mean by "anonymous recursive
function" in another language (CL or Scheme by preference) would help.

   http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread Chas Emerick


On Jun 30, 2010, at 4:09 AM, Paul Moore wrote:


Based on this comment, maybe I could ask an alternative question - can
you suggest where I should go to read some tutorials which would give
me a fast start on "just enough" Java infrastructure to get
comfortable in Clojure? Most of the Java tutorials I've seen tend to
assume I want to learn Java - I know enough Java to read code samples,
and that'll do for what I want.


Off the top of my head, the only "must have" piece of knowledge is how  
namespaces and source files relate to the classpath, which is  
described here:


http://clojure.org/libs

If you're not clear on what the classpath is: in rough terms, it's the  
same as PATH or PYTHONPATH, but can include .jar and .zip files as  
additional search roots, and all JVM resources are loaded from it.   
Classes (and namespaces) are loaded using a path corresponding to  
their full name, with each name segment corresponding to a path segment.


In short, put all your source files in directories corresponding to  
their namespace segments within a 'src' directory, make sure that  
'src' directory is on your classpath (java -cp src:clojure.jar  
clojure.main, for example), and you're good to go; require and use  
will work as they should.


Beyond that, you need to know about the underlying host to the extent  
that you use its facilities and libraries.  In that arena, the basics  
are:


(.methodName instance arg1 arg2 ...)
(ClassName/staticMethodName arg1 arg2 ...)
(ClassName. ctor-arg1 ctor-arg2 ...)

Other handy (and sometimes necessary, depending on what specific  
libraries, etc you're using) bits are described here:


http://clojure.org/java_interop

Cheers,

- Chas

--
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: How to: an anonymous recursive function

2010-06-30 Thread Nicolas Oury
user=> (fn plouf [] (plouf))
#
user=> ((fn plouf [] (plouf)))
java.lang.StackOverflowError (NO_SOURCE_FILE:0)


(plouf/plaf is approximate french for foo/bar)

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: How to: an anonymous recursive function

2010-06-30 Thread Shawn Hoover
On Wed, Jun 30, 2010 at 1:44 AM, Tim Robinson wrote:

> So I am reading On Lisp + some blogs while learning Clojure (I know,
> scary stuff :)
>
> Anyway, I've been playing around to see if I can get an anonymous
> recursive function to work, but alas I am still a n00b and not even
> sure what Clojure's approach to this would be.
>
> How would I do this in Clojure?:
>
> My first attempt:
>
> ((fn [x]
>   (if (= x 0)
>   1
>   (* 2 (recur (dec z) 5)
>
> Then my second:
>
> ((fn [x]
>   (let [z (if (= x 0)
>   1
>   (* 2 x))]
>  (recur (dec z  5)
>
> Ideally one could do:
>
> ((recursive-fn #( if (= % 0) 1 (* 2 %)) (recur it))  5)
>
>
> Obviously none work, and I believe I understand why. I just don't
> understand how to actually do this or if for some reason Clojure
> avoids this for some reason.
>
> I am not actually trying to accomplish a specific task, so the example
> was made to be simple not meaningful. I'm just playing around to learn
> recursive functions and Clojure style.
>

Hi Tim,

You're running into an error that you can only recur from the tail position?
That's because you're trying to use the result of recur to do further
computation. Clojure doesn't allow this with recur, because recur is more of
a loop or goto construct behind the scenes. If you really want to run your
algorithm that way you just have to give the fn a name and then call the
name.

This should work:

((fn my-fn [x]
  (if (= x 0)
  1
  (* 2 (my-fn (dec x) 5)

That accomplishes the question as asked, but you may also want to look into
calling reduce as a different approach to the problem.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: New Primitive data types (equal branch) - impact on optimized code.

2010-06-30 Thread Nicolas Oury
On Wed, Jun 30, 2010 at 3:19 PM, j-g-faustus wrote:

>
> The number of calls to Double.valueOf(double) seems to suggest that it
> is called only on aset, not on aget, though I can't think of any
> reason how that could be.
>
> Does anyone know more about this?


Do you use the client or server Hotspot?

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Clojure's n00b attraction problem

2010-06-30 Thread Nicolas Oury
On Wed, Jun 30, 2010 at 4:35 AM, Greg  wrote:

>
> As far as I understand, Clojure will be able to interop with Java even when
> Clojure-in-Clojure happens, so there's nothing to worry about.
>
> I'm quite excited about Clojure-in-Clojure. The possibilities that will
> offer are awesome. I'm looking forward to the day when it runs on LLVM. If
> that happens. :-)


Javascript is a nice thought too.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: New Primitive data types (equal branch) - impact on optimized code.

2010-06-30 Thread David Nolen
On Wed, Jun 30, 2010 at 10:19 AM, j-g-faustus
wrote:

> Tried the equiv branch briefly: The "1.1 style" version is ~4%
> quicker, but still ~4x slower than Java and ~2x slower than mutable
> deftype.
>
> But I found another issue: Array access apparently converts primitives
> to boxed values at every access. This is perhaps because aget/aset is
> a function and primitives cannot cross function boundaries?
> That would explain the relative slowness of arrays.
>
> Here is a test case http://gist.github.com/458669
> And a profiler screenshot
> http://i589.photobucket.com/albums/ss334/j-g-faustus/profiling/array-test-50k.png
>
> 15% CPU time goes to Double.valueOf(double) in all-primitive array
> access and another ~4% to intCast(int).
>
> The number of calls to Double.valueOf(double) seems to suggest that it
> is called only on aset, not on aget, though I can't think of any
> reason how that could be.
>
> Does anyone know more about this?
>
>
> Regards
> jf


On the equiv branch I don't see this at all. Also on the equiv branch most
of your type hints inside the fn are unnecessary.

(defn ^:static test-double ^doubles [^long n]
  (let [len  5
arr (double-array 5)
nn]
(dotimes [_ n]
  (dotimes [i len]
(dotimes [j (inc i)]
  (aset arr j
(+ 1.0 (- (aget arr i) (aget arr j)))
arr))

David

>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Clojure's n00b attraction problem

2010-06-30 Thread Phil Hagelberg
On Wed, Jun 30, 2010 at 12:24 AM, Alessio Stalla
 wrote:
> That doesn't mean that a one-
> click-install for a Lisp with an IDE and some popular libraries
> preinstalled wouldn't be useful - it would be great! But who is going
> to maintain it? If you pay me well enough, I'll do it, I promise :)
> but until then, no one will do it unless he is so interested in having
> a newbie-friendly Lisp that he'll spend part of his free time for
> that. Are you that individual?

Thank you. I'm hearing a lot of "somebody should do $X" in this thread
and precious little "I'm going to help by doing $X".

The former is useless; please stop it.

-Phil

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread Phil Hagelberg
On Wed, Jun 30, 2010 at 9:27 AM, Phil Hagelberg  wrote:
> On Wed, Jun 30, 2010 at 12:24 AM, Alessio Stalla
>  wrote:
>> That doesn't mean that a one-
>> click-install for a Lisp with an IDE and some popular libraries
>> preinstalled wouldn't be useful - it would be great! But who is going
>> to maintain it? If you pay me well enough, I'll do it, I promise :)
>> but until then, no one will do it unless he is so interested in having
>> a newbie-friendly Lisp that he'll spend part of his free time for
>> that. Are you that individual?
>
> Thank you. I'm hearing a lot of "somebody should do $X" in this thread
> and precious little "I'm going to help by doing $X".
>
> The former is useless; please stop it.

Or rather to be less harsh: the former has been discussed to death by
this point and is no longer helpful.

-Phil

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread cageface
On Jun 29, 10:50 pm, Sean Allen  wrote:
> So those who left Java behind years ago but like Lisps in general and Clojure
> in particular and want to minimize their contact with Java, where do
> they fit in your view?
> Enemies of the proper use of Clojure? Destroyers of the future?

Dogs barking up the wrong tree.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: How to: an anonymous recursive function

2010-06-30 Thread Dominic Cooney
If you name the Y combinator, then you can write recursive anonymous functions:



You can't use Clojure's recur as written because it isn't in tail
position--the result of the function isn't just the value of the recur
expression (in the first instance it is (* 2 (recur ...)) however I
note that z is free in that expression, which looks suspicious.

If your goal is to define a function that computes 2^n with
tail-recursion, then consider threading an "accumulator" parameter
through the recursive function; something like this:

((fun [acc x]
(if (= x 0)
  acc
  (recur (* 2 acc) (dec x))) 1 5)

Of course, you might consider a helper wrapper function that supplies
the 1 "default" accumulator.

Many functional languages optimize tail calls to jmp instructions;
that's hard to do efficiently in general on the JVM because it doesn't
support tail calls. I expect Clojure has designed recur to work the
way it does because some algorithms depend on the tail call
optimization, but the restrictions of recur make it possible to
compile efficiently as a jmp. So it's a nice compromise.



HTH,

Dominic

On Wed, Jun 30, 2010 at 2:44 PM, Tim Robinson  wrote:
> So I am reading On Lisp + some blogs while learning Clojure (I know,
> scary stuff :)
>
> Anyway, I've been playing around to see if I can get an anonymous
> recursive function to work, but alas I am still a n00b and not even
> sure what Clojure's approach to this would be.
>
> How would I do this in Clojure?:
>
> My first attempt:
>
> ((fn [x]
>   (if (= x 0)
>       1
>       (* 2 (recur (dec z) 5)
>
> Then my second:
>
> ((fn [x]
>       (let [z (if (= x 0)
>                   1
>                   (* 2 x))]
>          (recur (dec z  5)
>
> Ideally one could do:
>
> ((recursive-fn #( if (= % 0) 1 (* 2 %)) (recur it))  5)
>
>
> Obviously none work, and I believe I understand why. I just don't
> understand how to actually do this or if for some reason Clojure
> avoids this for some reason.
>
> I am not actually trying to accomplish a specific task, so the example
> was made to be simple not meaningful. I'm just playing around to learn
> recursive functions and Clojure style.
>
> Thanks,
> Tim
>
>
>
> --
> 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 this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clj on OSX

2010-06-30 Thread Glenn, Jacob
On 6/29/10 8:46 PM, "Sean Corfield"  wrote:

> I just installed that (on OS X 10.6.4) and I went this route:
> 
> Download the ZIP file. Rename it to remove the .zip extension (leaving
> the .jar extension). Double-click the .jar file. It fired up a
> clj.main process (which didn't seem to go away?) but it did create the
> ~/.clj tree.
> 
> I copied ~/.clj/bin/clj to ~/bin/ (which is already on my path) and
> then ran: clj
> 
> Up popped clj.main again, this time with a REPL in a window
> proclaiming Clojure 1.2.0-master-SNAPSHOT and the familiar user=>
> prompt.
> 
> I tried clj repl and clj list, both of which also worked. I haven't
> tried much else. I couldn't figure out how to get lein to take
> advantage of the new .clj stuff so if anyone has advice... :)
> 
> See if that route works better for you.
> 
> BTW, I was also using Clojure-MacOSX which seemed to be a really nice
> package since it included the TextMate bundle as well.

Thanks very much for your help. Where are you getting the .zip file you
describe? As far as I can tell the Github project only includes a link to
the .jar file. When I try to run that file by double-clicking it I get an
error dialog: "The Java JAR file 'clj-1.0.0-SNAPSHOT-standalone.jar' could
not be launched. Check the Console for possible error messages." When I try
running 'java -jar clj-1.0.0-SNAPSHOT-standalone.jar self-install' from the
command line I get the exception and stack trace I described previously.

I'm still using Clojure 1.1.0 - maybe I need 1.2 to make it work?

Re: the TextMate bundle, I installed that too but can't get it to see my
installed Clojure libraries. I've symlinked all my .jar files to
~/Library/Java/Extensions, and I can use them just fine from the REPL. But
when I try to run a file using the Clojure bundle commands in TextMate I get
a FileNotFoundException. If I do 'Get java.class.path' I can see a few .jar
files in my classpath under $TM_PROJECT_DIRECTORY$TM_BUNDLE_PATH/Vendor. I
have not defined shell variables for $TM_PROJECT_DIRECTORY or
$TM_BUNDLE_PATH in the TextMate preferences, but it looks like everything
gets installed into ~/Library/Application Support/
TextMate/Bundles/Clojure.tmbundle/Vendor. Out of desperation I symlinked my
.jar files into that directory too, but they still don't show up in the
classpath via TextMate (though as I said I can use them from the REPL with
no problem). Of course what I would really like is to be able to drop .jar
files into some directory and have them Just Work .

So yeah, obviously I don't have a clue how to set this stuff up. If there
are any other Mac-using clojurians who want to share best practices for
getting up and running that would be a great help.

Jake

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: New Primitive data types (equal branch) - impact on optimized code.

2010-06-30 Thread j-g-faustus
$ java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02-279-10M3065)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01-279, mixed mode)

Running the bechmark with -client or -server flag makes just a couple
of percent difference in timing.

On Jun 30, 5:20 pm, Nicolas Oury  wrote:
> On Wed, Jun 30, 2010 at 3:19 PM, j-g-faustus 
> wrote:
>
>
>
> > The number of calls to Double.valueOf(double) seems to suggest that it
> > is called only on aset, not on aget, though I can't think of any
> > reason how that could be.
>
> > Does anyone know more about this?
>
> Do you use the client or server Hotspot?

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: New Primitive data types (equal branch) - impact on optimized code.

2010-06-30 Thread j-g-faustus
OK, I'll try again. Thanks.

jf

On Jun 30, 6:14 pm, David Nolen  wrote:
> On Wed, Jun 30, 2010 at 10:19 AM, j-g-faustus
> wrote:
>
>
>
>
>
> > Tried the equiv branch briefly: The "1.1 style" version is ~4%
> > quicker, but still ~4x slower than Java and ~2x slower than mutable
> > deftype.
>
> > But I found another issue: Array access apparently converts primitives
> > to boxed values at every access. This is perhaps because aget/aset is
> > a function and primitives cannot cross function boundaries?
> > That would explain the relative slowness of arrays.
>
> > Here is a test casehttp://gist.github.com/458669
> > And a profiler screenshot
> >http://i589.photobucket.com/albums/ss334/j-g-faustus/profiling/array-...
>
> > 15% CPU time goes to Double.valueOf(double) in all-primitive array
> > access and another ~4% to intCast(int).
>
> > The number of calls to Double.valueOf(double) seems to suggest that it
> > is called only on aset, not on aget, though I can't think of any
> > reason how that could be.
>
> > Does anyone know more about this?
>
> > Regards
> > jf
>
> On the equiv branch I don't see this at all. Also on the equiv branch most
> of your type hints inside the fn are unnecessary.
>
> (defn ^:static test-double ^doubles [^long n]
>   (let [len  5
>         arr (double-array 5)
>         n    n]
>     (dotimes [_ n]
>       (dotimes [i len]
>         (dotimes [j (inc i)]
>           (aset arr j
>                 (+ 1.0 (- (aget arr i) (aget arr j)))
>     arr))
>
> David
>
>
>
>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread Sean Allen
On Wed, Jun 30, 2010 at 12:56 PM, cageface  wrote:
> On Jun 29, 10:50 pm, Sean Allen  wrote:
>> So those who left Java behind years ago but like Lisps in general and Clojure
>> in particular and want to minimize their contact with Java, where do
>> they fit in your view?
>> Enemies of the proper use of Clojure? Destroyers of the future?
>
> Dogs barking up the wrong tree.
>

The larger the clojure community gets, the more you should be prepared
for those dogs then.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread cageface
On Jun 30, 10:17 am, Sean Allen  wrote:
> The larger the clojure community gets, the more you should be prepared
> for those dogs then.

To put it more bluntly - the day that clojure no longer interoperates
smoothly with java is the day it becomes useless to me. I'm all for
hiding the guts from beginners but it's going to be a good long while
before you can actually get anything done with clojure without
directly interfacing with java.

For example, I'm using clojure for two things at work: replicating
data between a sybase and oracle DB and syncing data from ldap to an
xml-rpc client and a proprietary calendaring solution with it's own
java api. I can defend my use of clojure here because it's actually
better than python at this - faster and with more mature drivers and
able to invoke java apis directly. My code is full of direct calls to
various java methods, invocations of java constructors etc. Without
clojure's excellent java support it would be off the table as an
option for this project and without decent knowledge of java I
wouldn't be able to use it. I suspect most of the non-trival tasks for
which other people are using clojure rely on a number of java
libraries for which no clojure wrapper exists and I don't think is
likely to change soon or even that we *should* wrap everything.

I don't know what the implementation plans are exactly for clojure-in-
clojure but abandoning the JVM would be extremely unwise.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread David Nolen
On Wed, Jun 30, 2010 at 1:42 PM, cageface  wrote:

> I don't know what the implementation plans are exactly for clojure-in-
> clojure but abandoning the JVM would be extremely unwise.


Clojure-in-Clojure isn't about abandoning the JVM. It's about implementing
more of Clojure in itself. This has several benefits, *one* of which is
making it easier to port Clojure to other platforms.

For example, I would love to see some portion of Clojure run on a platform
that has much faster boot times so I can use Clojure for one-off shell
scripts.

David

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Clojure's n00b attraction problem

2010-06-30 Thread Nicolas Oury
On Wed, Jun 30, 2010 at 6:42 PM, cageface  wrote:

>
> To put it more bluntly - the day that clojure no longer interoperates
> smoothly with java is the day it becomes useless to me. I'm all for
> hiding the guts from beginners but it's going to be a good long while
> before you can actually get anything done with clojure without
> directly interfacing with java.
>

Nobody thinks about that. It's just about allowing lower level (at the
object level and not the abstract sequences level) code to be written
without having to use Java.

One of the many benefits is more portability, for those that are interested.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Clj on OSX

2010-06-30 Thread Sean Allen
> Thanks very much for your help. Where are you getting the .zip file you
> describe? As far as I can tell the Github project only includes a link to
> the .jar file. When I try to run that file by double-clicking it I get an
> error dialog: "The Java JAR file 'clj-1.0.0-SNAPSHOT-standalone.jar' could
> not be launched. Check the Console for possible error messages." When I try
> running 'java -jar clj-1.0.0-SNAPSHOT-standalone.jar self-install' from the
> command line I get the exception and stack trace I described previously.

Downloading the jar file using either Safari or Chrome on Mac OS gets
you a .zip file rather than the .jar that Firefox gives you.
Perhaps a webkit issue.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Let's respect CLOJURE_HOME

2010-06-30 Thread Greg
It seems like a lot of n00b (and non-n00b) related problems have to do with the 
location of clojure.jar and clojure-contrib.jar. People generally don't like 
having to keep track of all the clojure.jars, and it would be nice if it was 
easy to switch versions for scripts like clj and such.

May I propose as a possible remedy CLOJURE_HOME. CLOJURE_HOME is the absolute 
path of a directory containing clojure.jar and possibly clojure-contrib.jar. 
Scripts should check if it's defined and use it instead of hard-coded paths, as 
an example, here's my clj script (in newLISP):

http://www.taoeffect.com/other/clj.lsp.html

It's really simple, at least in newLISP, to do this:

(constant 'CLOJURE_HOME (or (env "CLOJURE_HOME") (string (env "HOME") 
"/.clojure"))

Input welcome!

- Greg

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread Avram
 > Javascript is a nice thought too.

I haven't tried it but there is a library for generating javascript
from clojure forms...
http://github.com/arohner/scriptjure#readme

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread RobertLJ
Well said Phil. I would like to volunteer to help.  It just so happen
that I have some time to help work on  a solution.  I am going to take
a few days to do some research before starting. Any help that the
clojure community can give me would gladly be apreciated

Robert

On Jun 30, 12:35 pm, Phil Hagelberg  wrote:
> On Wed, Jun 30, 2010 at 9:27 AM, Phil Hagelberg  wrote:
> > On Wed, Jun 30, 2010 at 12:24 AM, Alessio Stalla
> >  wrote:
> >> That doesn't mean that a one-
> >> click-install for a Lisp with an IDE and some popular libraries
> >> preinstalled wouldn't be useful - it would be great! But who is going
> >> to maintain it? If you pay me well enough, I'll do it, I promise :)
> >> but until then, no one will do it unless he is so interested in having
> >> a newbie-friendly Lisp that he'll spend part of his free time for
> >> that. Are you that individual?
>
> > Thank you. I'm hearing a lot of "somebody should do $X" in this thread
> > and precious little "I'm going to help by doing $X".
>
> > The former is useless; please stop it.
>
> Or rather to be less harsh: the former has been discussed to death by
> this point and is no longer helpful.
>
> -Phil

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread Greg
> For example, I would love to see some portion of Clojure run on a platform 
> that has much faster boot times so I can use Clojure for one-off shell 
> scripts.

I've mentioned this before, but I can't help myself as I see lots of people who 
want to use Clojure for scripting but complain about its boot times (no duh 
:-p), but there's an awesome Lisp-based scripting language called newLISP you 
might want to check out:

http://www.newlisp.org

On Jun 30, 2010, at 1:50 PM, David Nolen wrote:

> On Wed, Jun 30, 2010 at 1:42 PM, cageface  wrote:
> I don't know what the implementation plans are exactly for clojure-in-
> clojure but abandoning the JVM would be extremely unwise.
> 
> Clojure-in-Clojure isn't about abandoning the JVM. It's about implementing 
> more of Clojure in itself. This has several benefits, *one* of which is 
> making it easier to port Clojure to other platforms.
> 
> For example, I would love to see some portion of Clojure run on a platform 
> that has much faster boot times so I can use Clojure for one-off shell 
> scripts.
> 
> David 
> 
> -- 
> 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 this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Clojure's n00b attraction problem

2010-06-30 Thread Alessio Stalla


On 30 Giu, 18:35, Phil Hagelberg  wrote:
> On Wed, Jun 30, 2010 at 9:27 AM, Phil Hagelberg  wrote:
> > On Wed, Jun 30, 2010 at 12:24 AM, Alessio Stalla
> >  wrote:
> >> That doesn't mean that a one-
> >> click-install for a Lisp with an IDE and some popular libraries
> >> preinstalled wouldn't be useful - it would be great! But who is going
> >> to maintain it? If you pay me well enough, I'll do it, I promise :)
> >> but until then, no one will do it unless he is so interested in having
> >> a newbie-friendly Lisp that he'll spend part of his free time for
> >> that. Are you that individual?
>
> > Thank you. I'm hearing a lot of "somebody should do $X" in this thread
> > and precious little "I'm going to help by doing $X".
>
> > The former is useless; please stop it.
>
> Or rather to be less harsh: the former has been discussed to death by
> this point and is no longer helpful.

I'm not sure I get your point. I didn't mean to say "somebody should
do X, but not me"; I mean that if nobody does X, it's because
ultimately nobody is sufficiently interested in X to do it himself or
pay someone else to do it. It's easy to complain if X is missing, it's
a bit harder to work towards making X exist.

Cheers,
Alessio

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clj on OSX

2010-06-30 Thread Greg
Hey Glenn,

I feel your pain. Here's how I've set things up on my Mac:

Created ~/.clojure

Inside there I have this:

$ ls -l
total 72
drwxr-xr-x   8 gslepak  gslepak272 Jun 26 19:12 clj.git/
-rwxr-xr-x@  1 gslepak  gslepak   2201 Jun 30 02:05 clj.lsp*
drwxr-xr-x  11 gslepak  gslepak374 Jun 26 17:26 clojure-1.1/
drwxr-xr-x  16 gslepak  gslepak544 Jun 26 17:23 clojure-contrib-1.1/
drwxr-xr-x   6 gslepak  gslepak204 Jun 26 17:18 clojure-contrib-dev/
lrwxr-xr-x   1 gslepak  gslepak 39 Jun 27 22:51 clojure-contrib.jar@ -> 
clojure-contrib-dev/clojure-contrib.jar
drwxr-xr-x  18 gslepak  gslepak612 Jun 28 22:38 clojure.git/
lrwxr-xr-x   1 gslepak  gslepak 23 Jun 27 22:51 clojure.jar@ -> 
clojure.git/clojure.jar
lrwxr-xr-x   1 gslepak  gslepak 65 Jun 27 22:58 jline.jar@ -> 
/Users/gslepak/.m2/repository/jline/jline/0.9.94/jline-0.9.94.jar
drwxr-xr-x  18 gslepak  gslepak612 Jun 26 18:33 leiningen.git/

I tried liebke's clj stuff (it's listed there as clj.git), but because of this 
issue I don't use it: http://github.com/liebke/clj/issues#issue/4

Basically I've downloaded the clojure 1.1 release, but also the git repository 
for 1.2. Similar for clojure-contrib, except I grabbed the last working build 
from the nightly builds on http://build.clojure.org/job/clojure-contrib/ 
because the git repo doesn't compile (it has bugs).

Anyway, I then have clojure.jar and clojure-contrib.jar symlinks pointing to 
the versions I want.

In addition, I've written my own clj script that's pretty smart and makes it 
easy to switch between clojure versions, you can find its source here:

http://www.taoeffect.com/other/clj.lsp.html

It requires newlisp installed, but newlisp is like ~200KB and simple to install 
via a standard OS X install package obtainable from newlisp.org. Plus it's an 
awesome scripting language.

My clj script will respect the CLOJURE_HOME environment variable, and I can 
also easily point it to use another clojure jar file using the -c flag.

Finally, I've also had problems getting the Clojure.tmbundle working. Rather, 
everything works, except for the REPL, which seems completely broken and 
nothing I tried would fix it. I even tried getting some of the forked versions 
but they all failed as well.

I recommend IntelliJ, it might not be the perfect Mac solution, but it's a 
really nice IDE and I've made setup instructions here:

http://gregslepak.posterous.com/clojure-development-with-intellijs-la-clojure

Hope that helps!

- Greg

On Jun 30, 2010, at 12:01 PM, Glenn, Jacob wrote:

> On 6/29/10 8:46 PM, "Sean Corfield"  wrote:
> 
>> I just installed that (on OS X 10.6.4) and I went this route:
>> 
>> Download the ZIP file. Rename it to remove the .zip extension (leaving
>> the .jar extension). Double-click the .jar file. It fired up a
>> clj.main process (which didn't seem to go away?) but it did create the
>> ~/.clj tree.
>> 
>> I copied ~/.clj/bin/clj to ~/bin/ (which is already on my path) and
>> then ran: clj
>> 
>> Up popped clj.main again, this time with a REPL in a window
>> proclaiming Clojure 1.2.0-master-SNAPSHOT and the familiar user=>
>> prompt.
>> 
>> I tried clj repl and clj list, both of which also worked. I haven't
>> tried much else. I couldn't figure out how to get lein to take
>> advantage of the new .clj stuff so if anyone has advice... :)
>> 
>> See if that route works better for you.
>> 
>> BTW, I was also using Clojure-MacOSX which seemed to be a really nice
>> package since it included the TextMate bundle as well.
> 
> Thanks very much for your help. Where are you getting the .zip file you
> describe? As far as I can tell the Github project only includes a link to
> the .jar file. When I try to run that file by double-clicking it I get an
> error dialog: "The Java JAR file 'clj-1.0.0-SNAPSHOT-standalone.jar' could
> not be launched. Check the Console for possible error messages." When I try
> running 'java -jar clj-1.0.0-SNAPSHOT-standalone.jar self-install' from the
> command line I get the exception and stack trace I described previously.
> 
> I'm still using Clojure 1.1.0 - maybe I need 1.2 to make it work?
> 
> Re: the TextMate bundle, I installed that too but can't get it to see my
> installed Clojure libraries. I've symlinked all my .jar files to
> ~/Library/Java/Extensions, and I can use them just fine from the REPL. But
> when I try to run a file using the Clojure bundle commands in TextMate I get
> a FileNotFoundException. If I do 'Get java.class.path' I can see a few .jar
> files in my classpath under $TM_PROJECT_DIRECTORY$TM_BUNDLE_PATH/Vendor. I
> have not defined shell variables for $TM_PROJECT_DIRECTORY or
> $TM_BUNDLE_PATH in the TextMate preferences, but it looks like everything
> gets installed into ~/Library/Application Support/
> TextMate/Bundles/Clojure.tmbundle/Vendor. Out of desperation I symlinked my
> .jar files into that directory too, but they still don't show up in the
> classpath via TextMate (though as I said I can use

Re: Clojure's n00b attraction problem

2010-06-30 Thread David Nolen
On Wed, Jun 30, 2010 at 1:55 PM, Greg  wrote:

> For example, I would love to see some portion of Clojure run on a platform
> that has much faster boot times so I can use Clojure for one-off shell
> scripts.
>
>
> I've mentioned this before, but I can't help myself as I see lots of people
> who want to use Clojure for scripting but complain about its boot times (no
> duh :-p), but there's an awesome Lisp-based scripting language called
> newLISP you might want to check out:
>
> http://www.newlisp.org
>

I don't need to use Clojure for shell scripting. I mostly use it for long
running processes. But it would be nice.

Sure I could use newLISP, but I could also just as well use PLT Scheme /
Racket.

Point is, I'd rather just use Clojure.

David

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Let's respect CLOJURE_HOME

2010-06-30 Thread Rick Moynihan
On 30 June 2010 18:45, Greg  wrote:
> It seems like a lot of n00b (and non-n00b) related problems have to do with 
> the location of clojure.jar and clojure-contrib.jar. People generally don't 
> like having to keep track of all the clojure.jars, and it would be nice if it 
> was easy to switch versions for scripts like clj and such.
>
> May I propose as a possible remedy CLOJURE_HOME. CLOJURE_HOME is the absolute 
> path of a directory containing clojure.jar and possibly clojure-contrib.jar. 
> Scripts should check if it's defined and use it instead of hard-coded paths, 
> as an example, here's my clj script (in newLISP):
>
> http://www.taoeffect.com/other/clj.lsp.html
>
> It's really simple, at least in newLISP, to do this:
>
>        (constant 'CLOJURE_HOME (or (env "CLOJURE_HOME") (string (env "HOME") 
> "/.clojure"))
>
> Input welcome!

On the face of it this seems like a good idea, however it doesn't
really fit with the models used by tools such as leiningen, mvn or the
JVM.  At best a CLOJURE_HOME initiative can only expect to work within
its own world of clj scripts etc.

Though having a clj script adopt CLOJURE_HOME is probably a good idea,
i.e. the script is then reusable across multiple installs of clojure
it's not really a "n00b" friendly solution.  Like others I don't think
we can gloss over handling the JVMs classpath; it's part and parcel of
Clojure and the JVM.  Trying to dust it under the carpet will only
confuse people more.

This isn't to say that the Clojure community shouldn't work hard to
make this stuff easier.  Personally I think that leiningen is the
easiest model for beginners, and it scales nicely up to larger
projects too.  This is why I'd love to see "lein swank" styled support
for each of the IDE's/Editors.

R.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Let's respect CLOJURE_HOME

2010-06-30 Thread Brian Schlining
>
>
> >
> > May I propose as a possible remedy CLOJURE_HOME. CLOJURE_HOME is the
> absolute path of a directory containing clojure.jar and possibly
> clojure-contrib.jar. Scripts should check if it's defined and use it instead
> of hard-coded paths, as an example, here's my clj script (in newLISP):
>
> On the face of it this seems like a good idea, however it doesn't
> really fit with the models used by tools such as leiningen, mvn or the
> JVM.  At best a CLOJURE_HOME initiative can only expect to work within
> its own world of clj scripts etc.


I can't speak for leiningen but many (most?) launcher script in the Java
world use this as a standard convention. If you look through the launcher
scripts for maven, groovy, scala, ant, etc you will see environment
variables JAVA_HOME, M2_HOME (for Maven 2), GROOVY_HOME, SCALA_HOME and
ANT_HOME.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Compile multiple files in Emacs (interactive development)

2010-06-30 Thread Mark Engelberg
Try making a file that uses or requires all your other files.  Then
just ctrl-c ctrl-k in that file.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Let's respect CLOJURE_HOME

2010-06-30 Thread cageface
My clj file looks like this:

#!/bin/sh

export CLASSPATH=$CLOJUREPATH:./lib/*:.:$CLASSPATH

if [ -z "$1" ]; then
exec java -server jline.ConsoleRunner clojure.main
else
SCRIPT=$(dirname $1)
export CLASSPATH=$SCRIPT/*:$SCRIPT:$CLASSPATH
exec java -server clojure.main "$1" "$@"
fi

Having clj look in the current directory for jars/classes/.clj files
the same way Python and Ruby do makes dealing with libraries easier.

So, +1.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread Phil Hagelberg
>> > Thank you. I'm hearing a lot of "somebody should do $X" in this thread
>> > and precious little "I'm going to help by doing $X".
>>
>> > The former is useless; please stop it.
>>
>> Or rather to be less harsh: the former has been discussed to death by
>> this point and is no longer helpful.
>
> I'm not sure I get your point. I didn't mean to say "somebody should
> do X, but not me"; I mean that if nobody does X, it's because
> ultimately nobody is sufficiently interested in X to do it himself or
> pay someone else to do it. It's easy to complain if X is missing, it's
> a bit harder to work towards making X exist.

I wasn't complaining about what you said; I was just glad someone else
was recognizing that talk is cheap and effort is not.

-Phil

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread Brian Goslinga
On Jun 30, 12:50 pm, David Nolen  wrote:
> On Wed, Jun 30, 2010 at 1:42 PM, cageface  wrote:
> > I don't know what the implementation plans are exactly for clojure-in-
> > clojure but abandoning the JVM would be extremely unwise.
>
> Clojure-in-Clojure isn't about abandoning the JVM. It's about implementing
> more of Clojure in itself. This has several benefits, *one* of which is
> making it easier to port Clojure to other platforms.
>
> For example, I would love to see some portion of Clojure run on a platform
> that has much faster boot times so I can use Clojure for one-off shell
> scripts.
>
> David
For the time being, you could use nailgun.  My clj script uses nailgun
and for a warm start I can run clj -e "(System/exit 0)" in 20
milliseconds.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread Kevin Downey
won't someone please think of the children?

On Wed, Jun 30, 2010 at 1:42 PM, Brian Goslinga
 wrote:
> On Jun 30, 12:50 pm, David Nolen  wrote:
>> On Wed, Jun 30, 2010 at 1:42 PM, cageface  wrote:
>> > I don't know what the implementation plans are exactly for clojure-in-
>> > clojure but abandoning the JVM would be extremely unwise.
>>
>> Clojure-in-Clojure isn't about abandoning the JVM. It's about implementing
>> more of Clojure in itself. This has several benefits, *one* of which is
>> making it easier to port Clojure to other platforms.
>>
>> For example, I would love to see some portion of Clojure run on a platform
>> that has much faster boot times so I can use Clojure for one-off shell
>> scripts.
>>
>> David
> For the time being, you could use nailgun.  My clj script uses nailgun
> and for a warm start I can run clj -e "(System/exit 0)" in 20
> milliseconds.
>
> --
> 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 this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en



-- 
And what is good, Phaedrus,
And what is not good—
Need we ask anyone to tell us these things?

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Let's respect CLOJURE_HOME

2010-06-30 Thread Rick Moynihan
On 30 June 2010 21:14, Brian Schlining  wrote:
>>
>> >
>> > May I propose as a possible remedy CLOJURE_HOME. CLOJURE_HOME is the
>> > absolute path of a directory containing clojure.jar and possibly
>> > clojure-contrib.jar. Scripts should check if it's defined and use it 
>> > instead
>> > of hard-coded paths, as an example, here's my clj script (in newLISP):
>>
>> On the face of it this seems like a good idea, however it doesn't
>> really fit with the models used by tools such as leiningen, mvn or the
>> JVM.  At best a CLOJURE_HOME initiative can only expect to work within
>> its own world of clj scripts etc.
>
> I can't speak for leiningen but many (most?) launcher script in the Java
> world use this as a standard convention. If you look through the launcher
> scripts for maven, groovy, scala, ant, etc you will see environment
> variables JAVA_HOME, M2_HOME (for Maven 2), GROOVY_HOME, SCALA_HOME and
> ANT_HOME.

This is true.  And I agree that where scripts are used this technique
can be useful.  And in this regard it's a good convention.

However, I don't see it helping newcomers to Clojure significantly, as
the classpath issues people face are the deeper issue.  Also teaching
newcomers that this is the convention isn't really true, as tools like
Lieningen or maven don't really fit with this approach as they treat
the clojure platform as just another library dependency.

Clojure doesn't yet have a standard launch script.  In the past I've
argued that it'd be nice if it had one, though I now feel lein/mvn are
better tools for this job.  That said, having a clj launch script can
be useful, and might ease the out of box experience, but again the
true launcher will always be the java JVM executable, and I'm not sure
this is something we should really try and hide.

R.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: How to: an anonymous recursive function

2010-06-30 Thread Tim Robinson
Thanks for all the replies. Sorry if my responses are delayed. I'm
still on newb moderation mode, so I find my response can take 2 - 10
hours to be published.

> note that z is free in that expression, which looks suspicious.

yup, it was supposed to be x. It was a copy paste error. I normally
would evaluate the function, but in this case I was expecting errors.

As for acc or other options, I was hoping to create a recursive fn
that could generically accept an anonymous function as an argument,
which was what I was
thinking.

Using a form like:

((recursive-fn #(do-stuff (self (dec %))) (recur self))  5)

(obviously not the way - just the notion)

kind of thing.

When I am home tonight I can play aorund with the examples provided.

Thanks,
Tim





On Jun 30, 8:59 am, Dominic Cooney  wrote:
> If you name the Y combinator, then you can write recursive anonymous 
> functions:
>
> 
>
> You can't use Clojure's recur as written because it isn't in tail
> position--the result of the function isn't just the value of the recur
> expression (in the first instance it is (* 2 (recur ...)) however I
> note that z is free in that expression, which looks suspicious.
>
> If your goal is to define a function that computes 2^n with
> tail-recursion, then consider threading an "accumulator" parameter
> through the recursive function; something like this:
>
> ((fun [acc x]
>     (if (= x 0)
>       acc
>       (recur (* 2 acc) (dec x))) 1 5)
>
> Of course, you might consider a helper wrapper function that supplies
> the 1 "default" accumulator.
>
> Many functional languages optimize tail calls to jmp instructions;
> that's hard to do efficiently in general on the JVM because it doesn't
> support tail calls. I expect Clojure has designed recur to work the
> way it does because some algorithms depend on the tail call
> optimization, but the restrictions of recur make it possible to
> compile efficiently as a jmp. So it's a nice compromise.
>
> 
>
> HTH,
>
> Dominic
>
> On Wed, Jun 30, 2010 at 2:44 PM, Tim Robinson  wrote:
> > So I am reading On Lisp + some blogs while learning Clojure (I know,
> > scary stuff :)
>
> > Anyway, I've been playing around to see if I can get an anonymous
> > recursive function to work, but alas I am still a n00b and not even
> > sure what Clojure's approach to this would be.
>
> > How would I do this in Clojure?:
>
> > My first attempt:
>
> > ((fn [x]
> >   (if (= x 0)
> >       1
> >       (* 2 (recur (dec z) 5)
>
> > Then my second:
>
> > ((fn [x]
> >       (let [z (if (= x 0)
> >                   1
> >                   (* 2 x))]
> >          (recur (dec z  5)
>
> > Ideally one could do:
>
> > ((recursive-fn #( if (= % 0) 1 (* 2 %)) (recur it))  5)
>
> > Obviously none work, and I believe I understand why. I just don't
> > understand how to actually do this or if for some reason Clojure
> > avoids this for some reason.
>
> > I am not actually trying to accomplish a specific task, so the example
> > was made to be simple not meaningful. I'm just playing around to learn
> > recursive functions and Clojure style.
>
> > Thanks,
> > Tim
>
> > --
> > 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 this group, send email to
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/clojure?hl=en

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Let's respect CLOJURE_HOME

2010-06-30 Thread Steve Molitor
JRuby uses JRUBY_HOME, which contains jruby.jar, a few other other essential
jars and gems, and any locally installed gems. (Gems are ruby's packaging
mechanism.)  It also includes a jruby (jruby.bat on windows) executable
script.  This script parses command line args, sets up the classpath using
JRUBY_HOME, and if the first arg is a ruby file, evaluates that file.  It
supports options for adding to the 'include path'.  I'm not sure but I think
groovy does something similar.

If something similar were created for clojure, newbie instructions might
look like this.

1.  Download and unpack clojure-for-newbies.zip
2.  Add clojure-for-newbies/bin to your PATH.
3.  Create hello_world.clj with the following contents:
 (println "hello world")
4.  Type 'clojure hello_world.clj' to invoke your script

The 'clojure' script could also support options for adding jars and .clj
files to the class/load path.  With this approach a newbie could go a long
way without having to worry about lein/maven, projects, packaging,
compiling, etc.

On the other hand I did find it very easy to get started with lein (can't
remember how to spell its full name).   I love 'lein repl' (in spite of its
current limitations) - very newbie friendly for me as I could start
experimenting right away.  I have found clojure to be pretty newbie
friendly, but I do come from a Java background.

Steve



On Wed, Jun 30, 2010 at 3:14 PM, Brian Schlining wrote:

>
>> >
>> > May I propose as a possible remedy CLOJURE_HOME. CLOJURE_HOME is the
>> absolute path of a directory containing clojure.jar and possibly
>> clojure-contrib.jar. Scripts should check if it's defined and use it instead
>> of hard-coded paths, as an example, here's my clj script (in newLISP):
>>
>> On the face of it this seems like a good idea, however it doesn't
>> really fit with the models used by tools such as leiningen, mvn or the
>> JVM.  At best a CLOJURE_HOME initiative can only expect to work within
>> its own world of clj scripts etc.
>>
>
> I can't speak for leiningen but many (most?) launcher script in the Java
> world use this as a standard convention. If you look through the launcher
> scripts for maven, groovy, scala, ant, etc you will see environment
> variables JAVA_HOME, M2_HOME (for Maven 2), GROOVY_HOME, SCALA_HOME and
> ANT_HOME.
>
> --
> 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 this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Clojure's n00b attraction problem

2010-06-30 Thread Greg
> Point is, I'd rather just use Clojure.


Ah, well in that case, have you tried using Nailgun?

http://martiansoftware.com/nailgun/index.html

On Jun 30, 2010, at 3:34 PM, David Nolen wrote:

> On Wed, Jun 30, 2010 at 1:55 PM, Greg  wrote:
>> For example, I would love to see some portion of Clojure run on a platform 
>> that has much faster boot times so I can use Clojure for one-off shell 
>> scripts.
> 
> I've mentioned this before, but I can't help myself as I see lots of people 
> who want to use Clojure for scripting but complain about its boot times (no 
> duh :-p), but there's an awesome Lisp-based scripting language called newLISP 
> you might want to check out:
> 
> http://www.newlisp.org
> 
> I don't need to use Clojure for shell scripting. I mostly use it for long 
> running processes. But it would be nice. 
> 
> Sure I could use newLISP, but I could also just as well use PLT Scheme / 
> Racket. 
> 
> Point is, I'd rather just use Clojure.
> 
> David 
> 
> -- 
> 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 this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Let's respect CLOJURE_HOME

2010-06-30 Thread Steve Molitor
>> the true launcher will always be the java JVM executable, and I'm
>> not sure this is something we should really try and hide.

I think it should be hidden, at least for newbies.  Maven hides it - I
invoke 'mvn' and have no idea how it invokes java.  I don't know what jars
it puts in the classpath, etc., and I don't need to know.  Lein hides it too
and I like that.

Ideally a clojure installation package would include lein and a launcher
that utilized lein for clojure-contrib.jar etc.

Steve


On Wed, Jun 30, 2010 at 4:17 PM, Rick Moynihan wrote:

> On 30 June 2010 21:14, Brian Schlining  wrote:
> >>
> >> >
> >> > May I propose as a possible remedy CLOJURE_HOME. CLOJURE_HOME is the
> >> > absolute path of a directory containing clojure.jar and possibly
> >> > clojure-contrib.jar. Scripts should check if it's defined and use it
> instead
> >> > of hard-coded paths, as an example, here's my clj script (in newLISP):
> >>
> >> On the face of it this seems like a good idea, however it doesn't
> >> really fit with the models used by tools such as leiningen, mvn or the
> >> JVM.  At best a CLOJURE_HOME initiative can only expect to work within
> >> its own world of clj scripts etc.
> >
> > I can't speak for leiningen but many (most?) launcher script in the Java
> > world use this as a standard convention. If you look through the launcher
> > scripts for maven, groovy, scala, ant, etc you will see environment
> > variables JAVA_HOME, M2_HOME (for Maven 2), GROOVY_HOME, SCALA_HOME and
> > ANT_HOME.
>
> This is true.  And I agree that where scripts are used this technique
> can be useful.  And in this regard it's a good convention.
>
> However, I don't see it helping newcomers to Clojure significantly, as
> the classpath issues people face are the deeper issue.  Also teaching
> newcomers that this is the convention isn't really true, as tools like
> Lieningen or maven don't really fit with this approach as they treat
> the clojure platform as just another library dependency.
>
> Clojure doesn't yet have a standard launch script.  In the past I've
> argued that it'd be nice if it had one, though I now feel lein/mvn are
> better tools for this job.  That said, having a clj launch script can
> be useful, and might ease the out of box experience, but again the
> true launcher will always be the java JVM executable, and I'm not sure
> this is something we should really try and hide.
>
> R.
>
> --
> 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 this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Let's respect CLOJURE_HOME

2010-06-30 Thread Mike Anderson
On Jun 30, 6:45 pm, Greg  wrote:
> It seems like a lot of n00b (and non-n00b) related problems have to do with 
> the location of clojure.jar and clojure-contrib.jar. People generally don't 
> like having to keep track of all the clojure.jars, and it would be nice if it 
> was easy to switch versions for scripts like clj and such.
>
> May I propose as a possible remedy CLOJURE_HOME. CLOJURE_HOME is the absolute 
> path of a directory containing clojure.jar and possibly clojure-contrib.jar. 
> Scripts should check if it's defined and use it instead of hard-coded paths, 
> as an example, here's my clj script (in newLISP):

Sounds sensible in principle, though I think the issue for n00bs is
that configuring *anything* is a barrier because even the slightest
mistake in interpreting the documentation or configuring your
environment is pretty painful.

For n00bs, if it is much more complicated than unzipping a Clojure
distribution or navigating to the right Eclipse update site then
you're already going to lose a lot of people.

For those of us n00bs who primarily use IDEs like myself, I'd vote for
just improving the integration with the IDE's automatic management of
classpaths / build paths etc. To give it credit, Counterclockwise does
a decent job to get people started quickly in terms of adding the
Clojure jars automatically to an Eclipse project.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Let's respect CLOJURE_HOME

2010-06-30 Thread Greg
> However, I don't see it helping newcomers to Clojure significantly

With respect, I'm a newcomer to Clojure, and the CLOJURE_HOME convention would 
help me significantly. :-)

I think something that needs to be acknowledged is that "newcomers" and "n00bs" 
are not necessarily idiots, they're just new to the platform, and they're 
coming from places where, as Brian pointed, they're used to there being a 
central location for things (PYTHON_HOME, ANT_HOME, etc.).

> Lieningen or maven don't really fit with this approach as they treat
> the clojure platform as just another library dependency.

Yet Maven has a MAVEN_HOME. :-)

Even if Leiningen/Maven ignore CLOJURE_HOME, that's fine, it certainly doesn't 
hurt to adopt CLOJURE_HOME as a convention for scripts that currently hard-code 
clojure.jar's location, or download it themselves, wasting space and adding 
confusion. When that happens it's hard to know what version of Clojure these 
scripts are running, and it makes it unwieldy then to interface it with your 
own code. A problem, I think, that doesn't just affect newcomers to Clojure.

> and I'm not sure this is something we should really try and hide.

CLOJURE_HOME doesn't hide anything, it's set by the user after all.

Cheers,
Greg

On Jun 30, 2010, at 5:17 PM, Rick Moynihan wrote:

> On 30 June 2010 21:14, Brian Schlining  wrote:
>>> 
 
 May I propose as a possible remedy CLOJURE_HOME. CLOJURE_HOME is the
 absolute path of a directory containing clojure.jar and possibly
 clojure-contrib.jar. Scripts should check if it's defined and use it 
 instead
 of hard-coded paths, as an example, here's my clj script (in newLISP):
>>> 
>>> On the face of it this seems like a good idea, however it doesn't
>>> really fit with the models used by tools such as leiningen, mvn or the
>>> JVM.  At best a CLOJURE_HOME initiative can only expect to work within
>>> its own world of clj scripts etc.
>> 
>> I can't speak for leiningen but many (most?) launcher script in the Java
>> world use this as a standard convention. If you look through the launcher
>> scripts for maven, groovy, scala, ant, etc you will see environment
>> variables JAVA_HOME, M2_HOME (for Maven 2), GROOVY_HOME, SCALA_HOME and
>> ANT_HOME.
> 
> This is true.  And I agree that where scripts are used this technique
> can be useful.  And in this regard it's a good convention.
> 
> However, I don't see it helping newcomers to Clojure significantly, as
> the classpath issues people face are the deeper issue.  Also teaching
> newcomers that this is the convention isn't really true, as tools like
> Lieningen or maven don't really fit with this approach as they treat
> the clojure platform as just another library dependency.
> 
> Clojure doesn't yet have a standard launch script.  In the past I've
> argued that it'd be nice if it had one, though I now feel lein/mvn are
> better tools for this job.  That said, having a clj launch script can
> be useful, and might ease the out of box experience, but again the
> true launcher will always be the java JVM executable, and I'm not sure
> this is something we should really try and hide.
> 
> R.
> 
> -- 
> 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 this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: basic help with netbeans/enclojure installation

2010-06-30 Thread Chas Emerick

Fixed, thanks.

- Chas

On Jun 30, 2010, at 12:42 AM, Jared wrote:


I don't think you wrote what you intended to write.

"Enclojure is not yet compatible with NetBeans 6.8. You can access
NetBeans 6.8 downloads here:"

I think you mean:
"Enclojure is not yet compatible with NetBeans 6.9. You can access
NetBeans 6.8 downloads here:"



On Jun 17, 6:45 pm, Chas Emerick  wrote:

Indeed, it appears that enclojure andNetBeans6.9 do not mix well.
I've updated the "getting started" wiki page (http://www.assembla.com/wiki/show/clojure/Getting_Started_with_Netbea 
...

) with a note to reflect this, and point directly at the 6.8 download
page.

FYI, there is also an enclojure-specific group/mailing list:

http://groups.google.com/group/enclojure

Cheers,

- Chas

On Jun 17, 2010, at 8:19 AM, Lee Spector wrote:




Thanks all. I've now installedNetBeans6.8 and modulo a couple of
update cycles on components everything went smoothly and I'm now
runningNetBeans/Enclojure.



Perhaps the getting started instructions ought to include a comment
about the requiredNetBeansversion.



-Lee


--
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


--
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Let's respect CLOJURE_HOME

2010-06-30 Thread Rick Moynihan
On 30 June 2010 22:44, Steve Molitor  wrote:
>>> the true launcher will always be the java JVM executable, and I'm
>>> not sure this is something we should really try and hide.
>
> I think it should be hidden, at least for newbies.  Maven hides it - I
> invoke 'mvn' and have no idea how it invokes java.  I don't know what jars
> it puts in the classpath, etc., and I don't need to know.  Lein hides it too
> and I like that.
>
> Ideally a clojure installation package would include lein and a launcher
> that utilized lein for clojure-contrib.jar etc.

Yes, and this is what I've been trying to argue all along... that
lein, with its simplified classpath management/jvm options is probably
the best option for beginners.

My point about the JVM being the true launcher, is more that I don't
think it's Clojure's responsibility to try and dictate how the VM is
invoked, by a script or otherwise.  There are many ways to invoke
Clojure (lein, mvn, nailgun, shell script, java -cp, java -jar etc...
from inside a java program etc... ) though confusing, each has its own
merits.  And new users will soon need to understand whats going on
underneath.

I'm not saying there shouldn't be a "preferred route" for newcomers to
play with Clojure and have this taken care of for them; I just think
Clojure itself should ship without it, with the only assumption being
it's a jar on the classpath.

R.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread Mike Meyer
Ok, my turn to contribute something more than just messages. Still
just talking, though.

http://www.mired.org/home/mwm/papers/simple-clojure.html

is a writeup on how to get as much out of clojure as possible with a
minimal amount of Java infrastructure knowledge. It's still a WIP, so
feedback, corrections, etc. are welcome.

 http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread Chas Emerick
Not one person has ever said *anything* about Clojure not  
interoperating smoothly with Java, or abandoning the JVM.  Suggesting,  
implying, or speculating about anything otherwise, bluntly or not, is  
sort of laughable given how much work Rich has been putting into 1.2  
(and later, with the equiv/prim/etc stuff) getting *closer* to the JVM  
(with e.g. deftype/record/interface), and therefore clojure-in-clojure.


An oldie-but-goodie post from Chouser talking about what clojure-in- 
clojure is and why it matters:


http://blog.n01se.net/?p=41

And, if writing data structures and such in Clojure that have perf  
characteristics identical to those written in Java isn't "getting  
anything done", I need a drink. :-P


- chas

On Jun 30, 2010, at 1:42 PM, cageface wrote:


To put it more bluntly - the day that clojure no longer interoperates
smoothly with java is the day it becomes useless to me. I'm all for
hiding the guts from beginners but it's going to be a good long while
before you can actually get anything done with clojure without
directly interfacing with java.

I don't know what the implementation plans are exactly for clojure-in-
clojure but abandoning the JVM would be extremely unwise.


--
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread Chas Emerick
That's a great first start.  My only initial comment would be that  
Clojure is a lisp, or maybe a Lisp, but it's definitely not a LISP. ;-)


- Chas

On Jun 30, 2010, at 8:11 PM, Mike Meyer wrote:


Ok, my turn to contribute something more than just messages. Still
just talking, though.

http://www.mired.org/home/mwm/papers/simple-clojure.html

is a writeup on how to get as much out of clojure as possible with a
minimal amount of Java infrastructure knowledge. It's still a WIP, so
feedback, corrections, etc. are welcome.

  http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more  
information.


O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

--
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


--
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clj on OSX

2010-06-30 Thread Sean Corfield
On Wed, Jun 30, 2010 at 9:01 AM, Glenn, Jacob  wrote:
> Thanks very much for your help. Where are you getting the .zip file you
> describe?

In the QuickStart, I click on the link in "Download
http://incanter.org/downloads/clj.jar"; and what I get is clj.jar.zip
(I'm using Chrome as my browser). It's not a ZIP, it's a JAR. Hence
the rename.

Can't help with the TextMate bundle, sorry. I installed it per
Clojure-MacOSX and it just worked.
-- 
Sean A Corfield -- (904) 302-SEAN
Railo Technologies, Inc. -- http://getrailo.com/
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure's n00b attraction problem

2010-06-30 Thread cageface
On Jun 30, 5:15 pm, Chas Emerick  wrote:
> An oldie-but-goodie post from Chouser talking about what clojure-in-
> clojure is and why it matters:
>
> http://blog.n01se.net/?p=41

To quote:
"But a more fascinating benefit is that porting Clojure to non-JVM
targets will be much easier. The majority of the effort so far put
into ClojureCLR and ClojureScript has been rewriting the data
structures for the target platform. This has required a lot of hand-
written C# and JavaScript (respectively) all of which can become
quickly obsolete as changes are made to the primary Java versions."

... stuff about running on Parrot etc...

Presumably over time we'll have more pure clojure-layers over the ugly
java libs. Having to maintain a port version of each of these wrappers
for C# and JS and any other target sounds like a lot of unpleasant
grunt work to me. I've been working on wrapping the JNDI stuff up in a
less retarded interface, for example, but I'm definitely not going to
take the time to port it to C# and JS is obviously out so that's at
least one tiny step towards a fractured clojure world.

I sure don't have fond memories of dropping #+sbcl and #+cmu and #
+allegro readers all over my CL code to make all the different CL
implementations happy and I don't anticipate much joy in a similarly
balkanized clojure world. A clojure written mostly in clojure but
still exclusively a jvm lang makes sense but the rest of this just
sounds like idle hackery for its own sake. Far be it from me to
condemn consenting adults for the ways they choose to spend their
spare time though.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en