Re: A website written using Clojure.

2009-06-26 Thread Emeka
Stuart Sierra,


I want to use StringTemplate, could you give me a lead?


Emeka
On Thu, Jun 25, 2009 at 9:31 PM, Stuart Sierra
wrote:

>
> On Jun 25, 3:59 pm, Berlin Brown  wrote:
> > But does anyone have a problem with Lisp/S-Expressions to HTML/XHtml,
> > especially for the entire document.  What is wrong with using some
> > form of templating system.
>
> Yes, I'm partial to StringTemplate, a Java template framework.  Very
> simple, like a functional language itself.
> http://www.stringtemplate.org/
>
> -SS
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[OT] github (?) question

2009-06-26 Thread Laurent PETIT
Hi, this is an OT question, but since Rich encouraged git gurus here on the
ml to on help non gurus, then I ask :-)

By just surfing on github website, I find a cloned repository of
clojure-contrib, e.g. clone done by user XXX.

>From the main page of this repo, I can see who else cloned XXX's repo, who
else watches XXX's repo.

But what I would like to do is see whether XXX's repo is a clone of another
repo, and go up the chain to the real "master" repo.

Is this possible from the UI of github, or do I have to clone XXX's repo,
invoke some git command on my clone, ... and repeat the operation at each
node of the cloning graph ?


Thanks in advance,

(Of course, for clojure-contrib I guess that Rich's repo is the master, but
still it's rather a guess than an evidence provided by the tools to me).

-- 
Laurent

--~--~-~--~~~---~--~~
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: [OT] Convincing others about Clojure

2009-06-26 Thread Baishampayan Ghose
Hello,

Wow! Thanks a lot for the awesome advice.

Thank you Konrad, Daniel, Berlin, Jonah, Raoul and others for the
fantastic tips.

I have, in-fact been able to convince our advisor about using Clojure.
This won't have been possible without your help.

Clojure, the language and the community rocks.

Now to get down to implementing the plan.

Regards,
BG

-- 
Baishampayan Ghose 
oCricket.com



signature.asc
Description: OpenPGP digital signature


Re: [OT] Convincing others about Clojure

2009-06-26 Thread Laurent PETIT
Hi,

Out of curiosity, which (combination of) advice do you think 'closed the
deal' ?

Regards,

-- 
Laurent
2009/6/26 Baishampayan Ghose 

> Hello,
>
> Wow! Thanks a lot for the awesome advice.
>
> Thank you Konrad, Daniel, Berlin, Jonah, Raoul and others for the
> fantastic tips.
>
> I have, in-fact been able to convince our advisor about using Clojure.
> This won't have been possible without your help.
>
> Clojure, the language and the community rocks.
>
> Now to get down to implementing the plan.
>
> Regards,
> BG
>
> --
> Baishampayan Ghose 
> oCricket.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
-~--~~~~--~~--~--~---



Re: [OT] github (?) question

2009-06-26 Thread Alex Combas
Yes Rich Hickey's git repository for clojure and clojure-contrib are the
main development repositorys.

http://github.com/richhickey/clojure/tree/master
http://github.com/richhickey/clojure-contrib/tree/master

The reason why git has no big flashing sign pointing to his repositorys is
because git is a *distributed* version control system.
In git's eyes every repository of clojure is just as good as every other
repository, git would be perfectly happy to pull push and branch
and merge from anyone's repository, so If you want to know which is the main
development branch then you need to either find the link on the
clojure.org website or else make an educated guess.

Best regards,
Alex



On Fri, Jun 26, 2009 at 12:48 AM, Laurent PETIT wrote:

> Hi, this is an OT question, but since Rich encouraged git gurus here on the
> ml to on help non gurus, then I ask :-)
>
> By just surfing on github website, I find a cloned repository of
> clojure-contrib, e.g. clone done by user XXX.
>
> From the main page of this repo, I can see who else cloned XXX's repo, who
> else watches XXX's repo.
>
> But what I would like to do is see whether XXX's repo is a clone of another
> repo, and go up the chain to the real "master" repo.
>
> Is this possible from the UI of github, or do I have to clone XXX's repo,
> invoke some git command on my clone, ... and repeat the operation at each
> node of the cloning graph ?
>
>
> Thanks in advance,
>
> (Of course, for clojure-contrib I guess that Rich's repo is the master, but
> still it's rather a guess than an evidence provided by the tools to me).
>
> --
> Laurent
>
> >
>

--~--~-~--~~~---~--~~
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: [OT] github (?) question

2009-06-26 Thread Mike Hinchey
On the Source tab, the "fork of" link tells you - that is, Rich's don't have
that line, so it is the root.  On the Network Members tab, it shows a tree
of the forks, with Rich at the root.

You can browse all of the data in a repository through the website, so you
shouldn't have to clone.  And you only need to Fork (a github concept, not
git), if you want to push something different to your own public clone.

Ultimately, what matters to GIT is the sha1 commit keys, which tell you a
commit/tree is identical to another or not.  I don't think you can tell
about clones other than by looking at the sha1s or the Fork graphs that
github draws.  The forks graph only tells you about the clones that github
knows about.

And as Alex says, being the root doesn't really mean master, authoritative,
or best.

-Mike

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new 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: [OT] github (?) question

2009-06-26 Thread Laurent PETIT
Hello,

OK, I thought that the graph of cloned repositories was oriented, but it
seems I was wrong :)

Still, I don't see the "fork of" link, so maybe the person that created its
clone did not do it via the fork functionality of github, but rather did it
from its [desk/lap]top, and pushed his repo on his personal space at github
?

More specifically, I'm talking about
http://github.com/kevinoneill/clojure-contrib/tree/master , where I don't
see any "fork of" link.

Can you explain that to me ?

Regards,

-- 
Laurent

2009/6/26 Mike Hinchey 

> On the Source tab, the "fork of" link tells you - that is, Rich's don't
> have that line, so it is the root.  On the Network Members tab, it shows a
> tree of the forks, with Rich at the root.
>
> You can browse all of the data in a repository through the website, so you
> shouldn't have to clone.  And you only need to Fork (a github concept, not
> git), if you want to push something different to your own public clone.
>
> Ultimately, what matters to GIT is the sha1 commit keys, which tell you a
> commit/tree is identical to another or not.  I don't think you can tell
> about clones other than by looking at the sha1s or the Fork graphs that
> github draws.  The forks graph only tells you about the clones that github
> knows about.
>
> And as Alex says, being the root doesn't really mean master, authoritative,
> or best.
>
> -Mike
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new 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: defn memory question

2009-06-26 Thread Rich Claxton

Thanks for all the interesting answers.


On Jun 25, 5:23 pm, Stuart Sierra  wrote:
> On Jun 25, 6:25 am, RichClaxton wrote:
>
> > Hello I have just started learning Clojure and functional programming,
> > quick question, what happens internally when I do a defn, does this
> > create the byte code, or a ref to the function which is stored, as it
> > does actually create a function object, I was just wondering about
> > memory and GC issues.
>
> It gets complicated, because the JVM stores bytecode in a special
> memory location that is separate from the heap.  In all but very early
> versions of Clojure, however, there's a dynamic classloader so that
> defined functions can get garbage collected.
>
> Each (fn ...) or (defn ...) form is a dynamically-created class.  But,
> as others have said, there is only one class for each time you *write*
> (fn...), not a new class each time you call it.  So if you have one
> (fn...) form that gets called a hundred times with different closed-
> over values, it's still only going to create one class.
>
> The only time GC of fns might be an issue is if you're constructing
> the (fn...) forms in code and eval'ing them.  Even then, adjusting the
> JVM memory parameters should be sufficient.
>
> -SS
--~--~-~--~~~---~--~~
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: [OT] github (?) question

2009-06-26 Thread Christophe Grand
Hi Laurent,

kevinoneill repos were mirrors of google-code's SVN.

On Fri, Jun 26, 2009 at 10:47 AM, Laurent PETIT wrote:

> Hello,
>
> OK, I thought that the graph of cloned repositories was oriented, but it
> seems I was wrong :)
>
> Still, I don't see the "fork of" link, so maybe the person that created its
> clone did not do it via the fork functionality of github, but rather did it
> from its [desk/lap]top, and pushed his repo on his personal space at github
> ?
>
> More specifically, I'm talking about
> http://github.com/kevinoneill/clojure-contrib/tree/master , where I don't
> see any "fork of" link.
>
> Can you explain that to me ?
>
> Regards,
>
> --
> Laurent
>
> 2009/6/26 Mike Hinchey 
>
> On the Source tab, the "fork of" link tells you - that is, Rich's don't
>> have that line, so it is the root.  On the Network Members tab, it shows a
>> tree of the forks, with Rich at the root.
>>
>> You can browse all of the data in a repository through the website, so you
>> shouldn't have to clone.  And you only need to Fork (a github concept, not
>> git), if you want to push something different to your own public clone.
>>
>> Ultimately, what matters to GIT is the sha1 commit keys, which tell you a
>> commit/tree is identical to another or not.  I don't think you can tell
>> about clones other than by looking at the sha1s or the Fork graphs that
>> github draws.  The forks graph only tells you about the clones that github
>> knows about.
>>
>> And as Alex says, being the root doesn't really mean master,
>> authoritative, or best.
>>
>> -Mike
>>
>>
>>
>>
>
>
>
> >
>


-- 
Professional: http://cgrand.net/ (fr)
On Clojure: http://clj-me.blogspot.com/ (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: [OT] github (?) question

2009-06-26 Thread Laurent PETIT
Ahh, yes, back in pre git time, thanks Christophe for the explanation.

Regards,

-- 
Laurent

2009/6/26 Christophe Grand 

> Hi Laurent,
>
> kevinoneill repos were mirrors of google-code's SVN.
>
> On Fri, Jun 26, 2009 at 10:47 AM, Laurent PETIT 
> wrote:
>
>> Hello,
>>
>> OK, I thought that the graph of cloned repositories was oriented, but it
>> seems I was wrong :)
>>
>> Still, I don't see the "fork of" link, so maybe the person that created
>> its clone did not do it via the fork functionality of github, but rather did
>> it from its [desk/lap]top, and pushed his repo on his personal space at
>> github ?
>>
>> More specifically, I'm talking about
>> http://github.com/kevinoneill/clojure-contrib/tree/master , where I don't
>> see any "fork of" link.
>>
>> Can you explain that to me ?
>>
>> Regards,
>>
>> --
>> Laurent
>>
>> 2009/6/26 Mike Hinchey 
>>
>> On the Source tab, the "fork of" link tells you - that is, Rich's don't
>>> have that line, so it is the root.  On the Network Members tab, it shows a
>>> tree of the forks, with Rich at the root.
>>>
>>> You can browse all of the data in a repository through the website, so
>>> you shouldn't have to clone.  And you only need to Fork (a github concept,
>>> not git), if you want to push something different to your own public clone.
>>>
>>> Ultimately, what matters to GIT is the sha1 commit keys, which tell you a
>>> commit/tree is identical to another or not.  I don't think you can tell
>>> about clones other than by looking at the sha1s or the Fork graphs that
>>> github draws.  The forks graph only tells you about the clones that github
>>> knows about.
>>>
>>> And as Alex says, being the root doesn't really mean master,
>>> authoritative, or best.
>>>
>>> -Mike
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>
>
>
> --
> Professional: http://cgrand.net/ (fr)
> On Clojure: http://clj-me.blogspot.com/ (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: [OT] Convincing others about Clojure

2009-06-26 Thread Baishampayan Ghose
Laurent,

> Out of curiosity, which (combination of) advice do you think 'closed the
> deal' ?

Well, the guy is a real startup veteran. I explained to him with some
help from a bunch of Paul Graham essays that we want to use Clojure just
because it is "practically" more suitable for the problem at hand and
not because we are academically inclined Lisp purists.

I just needed to convince him that I am not religious about using _some_
Lisp but I am choosing Clojure because as an Engineer I think that would
give us a distinct edge against the competitors.

And the fact that Clojure runs on the JVM and has direct access to Java
libs helped the case.

He, being a fairly intelligent and pragmatic man, accepted my logic.

Thanks a bunch guys.

Regards,
BG

-- 
Baishampayan Ghose 
oCricket.com



signature.asc
Description: OpenPGP digital signature


Re: [OT] Convincing others about Clojure

2009-06-26 Thread Alex Combas
Thats great to hear, hope everything goes well, let us know how it turns
out!

Best regards,
agc



On Fri, Jun 26, 2009 at 1:55 AM, Baishampayan Ghose wrote:

> Laurent,
>
> > Out of curiosity, which (combination of) advice do you think 'closed the
> > deal' ?
>
> Well, the guy is a real startup veteran. I explained to him with some
> help from a bunch of Paul Graham essays that we want to use Clojure just
> because it is "practically" more suitable for the problem at hand and
> not because we are academically inclined Lisp purists.
>
> I just needed to convince him that I am not religious about using _some_
> Lisp but I am choosing Clojure because as an Engineer I think that would
> give us a distinct edge against the competitors.
>
> And the fact that Clojure runs on the JVM and has direct access to Java
> libs helped the case.
>
> He, being a fairly intelligent and pragmatic man, accepted my logic.
>
> Thanks a bunch guys.
>
> Regards,
> BG
>
> --
> Baishampayan Ghose 
> oCricket.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
-~--~~~~--~~--~--~---



Re: Question regarding example in Stuart Halloway's book (page 120)

2009-06-26 Thread Rowdy Rednose

I find the pdf actually pretty useful as a quick reference until I'm
familiar with all the function names.

There's however a small mistake on page 28. The 'd' doesn't belong
there in the 2nd line of this example:

(let [{a :a, b :b, c :c, :as m :or {a 2 b 3}} {:a 5 :c 6}]
  [a b c d m])
-> [5 3 6 {:c 6, :a 5}]

Rowdy

On Jun 25, 9:52 am, Rich Hickey  wrote:
> On Wed, Jun 24, 2009 at 7:18 PM, Stephen C. Gilardi wrote:
>
> > On Jun 24, 2009, at 7:02 PM, arasoft wrote:
>
> >> Why does this work?
>
> >> (take-while (complement #{\a\e\i\o\u}) "the-quick-brown-fox")
>
> >> When I do something similar, like
>
> >> (take-while (complement #(Character/isWhitespace %)) "the-quick-brown-
> >> fox")
>
> >> I have to deal with the parameter explicitly ("%"). How is the
> >> parameter hidden in the set/function? Could I do something like that
> >> in my own code (not sure I'd want to, just curious what magic is at
> >> work here)?
>
> > In addition to functions, several of Clojure's other objects are
> > "invokable"--they can operate successfully as the first item in a call
> > expression (a list in code).
>
> > Invoking a set returns the element in the set that's = to the argument or
> > nil
> > Invoking a map returns the value in the map whose corresponding key is = to
> > the argument or nil
> > Invoking a keyword requires a map as its argument and returns the value in
> > the map corresponding to the key that's = to the keyword or nil
>
> > "Being invokable" in Clojure is equivalent to implementing the IFn
> > interface. You can see in this diagram which objects in Clojure implement
> > IFn:
>
> >http://github.com/Chouser/clojure-classes/blob/032beae497fddc426db05c...
>
> > (IFn is at the lower right).
>
> For all those who want to understand how the class hierarchies map to
> various Clojure abstractions, I have broken down that (rather
> daunting) graph into separate areas in various slides from the
> tutorial I gave at ILC09:
>
> http://clojure.googlegroups.com/web/tutorial.pdf
>
> There you can much more clearly see how the collections, seqs, refs,
> and various concepts like
> sequential/associative/counted/reversible/metadata/callability/java
> collection/java interop are organized.
>
> Rich
--~--~-~--~~~---~--~~
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: Improved Error Messages - Part XXXVIII

2009-06-26 Thread Rich Hickey

On Fri, Jun 26, 2009 at 12:31 AM, Four of Seventeen wrote:
>
> Got another one.
>
> (if-not (zero? diskqueue-count (if value
>                                 (trait-dir trait)
>                                 (trait-undecided-dir trait)))
>
> # of args passed to: core$fn (foo.clj:1625)>
>
> This should be saying wrong number of args passed to core$zero? rather
> than core$fn. I don't know why it isn't.
>
> (For those who missed it, the error is a missing pair of parentheses:
>
> (if-not (zero? (diskqueue-count (if value
>                                  (trait-dir trait)
>                                  (trait-undecided-dir trait
>
> ).
>

http://www.assembla.com/spaces/clojure/tickets/136-Enhancement--give-meaningful-names-to-inline-expanders

Thanks for the report,

Rich

--~--~-~--~~~---~--~~
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: [OT] github (?) question

2009-06-26 Thread CHEN Cheng

On Fri, Jun 26, 2009 at 10:47:02AM +0200, Laurent PETIT wrote:
> Hello,
> 
> OK, I thought that the graph of cloned repositories was oriented, but it
> seems I was wrong :)
> 
> Still, I don't see the "fork of" link, so maybe the person that created its
> clone did not do it via the fork functionality of github, but rather did it
> from its [desk/lap]top, and pushed his repo on his personal space at github
> ?
> 
> More specifically, I'm talking about
> http://github.com/kevinoneill/clojure-contrib/tree/master , where I don't
> see any "fork of" link.
> 
> Can you explain that to me ?

To understand that, you need to know how github "fork of" works.
I have no idea either, but here is my guess:

Github decides which repo forked of by section '[remote "origin"]'
in file .git/config.

Generally, if you "git clone git://git-repo", the origin is recorded
into this section. However, not all repos have the section. For example:
$ mkdir repo_a
$ git init
$ cd ../repo_b
$ git push ../repo_a master
In this case, repo_a/.git/config has no '[remote "origin"]' section.

Without this section, github has no idea where this repo forked of,
and consequently, the "fork of" link is not shown.

> 
> Regards,
> 
> -- 
> Laurent
> 
> 2009/6/26 Mike Hinchey 
> 
> > On the Source tab, the "fork of" link tells you - that is, Rich's don't
> > have that line, so it is the root.  On the Network Members tab, it shows a
> > tree of the forks, with Rich at the root.
> >
> > You can browse all of the data in a repository through the website, so you
> > shouldn't have to clone.  And you only need to Fork (a github concept, not
> > git), if you want to push something different to your own public clone.
> >
> > Ultimately, what matters to GIT is the sha1 commit keys, which tell you a
> > commit/tree is identical to another or not.  I don't think you can tell
> > about clones other than by looking at the sha1s or the Fork graphs that
> > github draws.  The forks graph only tells you about the clones that github
> > knows about.
> >
> > And as Alex says, being the root doesn't really mean master, authoritative,
> > or best.
> >
> > -Mike
> >
> >
> > >
> >
> 
> > 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new 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: [OT] github (?) question

2009-06-26 Thread Bruce Williams

Near the name of the repository it should say what repo it was forked  
from, if any. You can just follow the chain up.

The "Network" diagram is also useful when trying to discover the  
canonical repo -- or the most up-to-date one.

Cheers,
Bruce

On Jun 26, 2009, at 12:48 AM, Laurent PETIT   
wrote:

> Hi, this is an OT question, but since Rich encouraged git gurus here  
> on the ml to on help non gurus, then I ask :-)
>
> By just surfing on github website, I find a cloned repository of  
> clojure-contrib, e.g. clone done by user XXX.
>
> From the main page of this repo, I can see who else cloned XXX's  
> repo, who else watches XXX's repo.
>
> But what I would like to do is see whether XXX's repo is a clone of  
> another repo, and go up the chain to the real "master" repo.
>
> Is this possible from the UI of github, or do I have to clone XXX's  
> repo, invoke some git command on my clone, ... and repeat the  
> operation at each node of the cloning graph ?
>
>
> Thanks in advance,
>
> (Of course, for clojure-contrib I guess that Rich's repo is the  
> master, but still it's rather a guess than an evidence provided by  
> the tools to me).
>
> -- 
> Laurent
>
> >


--~--~-~--~~~---~--~~
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 does Clojure macros work?

2009-06-26 Thread Michele Simionato

I am writing a rather long series of articles about Scheme on Artima,
"The Adventures of a Pythonista in Schemeland" (maybe somebody here
has
heard of it). Last week I arrived at point of discussing hygienic
macros
(http://www.artima.com/weblogs/viewpost.jsp?thread=260195)
and I wanted to spent a few words about the differences between
Scheme and other lisps. In particular I want to asset the status of
Clojure
macros with respect to hygiene.

Since they look a lot like Common Lisp macros, I initially assumed
that
Clojure macros were not hygienic, but after performing some experiment
I
realized that I was half wrong.  For instance, I expected this code to
fail due to free-symbol capture:

user=> (defmacro m [x] `(list ~x))
#'user/m
user=> (let [list 1] (m 2))
(2)

Instead, it works correctly. Therefore, I assume that Clojure
is renaming the free symbols in the macro body (in this case 'list).
On the other hand, Clojure macros are not fully hygienic, otherwise
a would not be defined in this example:

user=> (defmacro def-a[x] `(def a ~x))
#'user/def-a
user=> (def-a 1)
#'user/a
user=> a
1

It seems that in order to avoid variable capture for bound symbols
I need to use good old (gensym):

user=> (defmacro def-a[x] (let [a (gensym)] `(def ~a ~x)))
#'user/def-a
user=> (def-a 1)
#'user/G__77

Am I right in my assumptions? Is there a document explaining how
Clojure macros work? The macro system seems quite unique, in the sense
that I do not know of any other macro system working in the same way.

   Michele Simionato

--~--~-~--~~~---~--~~
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: [OT] github (?) question

2009-06-26 Thread Laurent PETIT
Thanks all, Christophe gave the explanation.

-- 
Laurent

2009/6/26 Bruce Williams 

>
> Near the name of the repository it should say what repo it was forked
> from, if any. You can just follow the chain up.
>
> The "Network" diagram is also useful when trying to discover the
> canonical repo -- or the most up-to-date one.
>
> Cheers,
> Bruce
>
> On Jun 26, 2009, at 12:48 AM, Laurent PETIT 
> wrote:
>
> > Hi, this is an OT question, but since Rich encouraged git gurus here
> > on the ml to on help non gurus, then I ask :-)
> >
> > By just surfing on github website, I find a cloned repository of
> > clojure-contrib, e.g. clone done by user XXX.
> >
> > From the main page of this repo, I can see who else cloned XXX's
> > repo, who else watches XXX's repo.
> >
> > But what I would like to do is see whether XXX's repo is a clone of
> > another repo, and go up the chain to the real "master" repo.
> >
> > Is this possible from the UI of github, or do I have to clone XXX's
> > repo, invoke some git command on my clone, ... and repeat the
> > operation at each node of the cloning graph ?
> >
> >
> > Thanks in advance,
> >
> > (Of course, for clojure-contrib I guess that Rich's repo is the
> > master, but still it's rather a guess than an evidence provided by
> > the tools to me).
> >
> > --
> > Laurent
> >
> > >
>
>
> >
>

--~--~-~--~~~---~--~~
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 does Clojure macros work?

2009-06-26 Thread Michele Simionato

On Jun 26, 9:53 am, Michele Simionato 
wrote:
>  I want to asset the status of Clojure
> macros with respect to hygiene.

Some further experiment:

$ clj
Clojure 1.1.0-alpha-SNAPSHOT
user=> (def x 42)
#'user/x
user=> (defmacro m[] 'x)
#'user/m
user=> (m)
42
user=> (let [x 43] (m))
43

There is no referential transparency, it seems. Also, it looks like
Clojure macros are runtime macros,
i.e. they may depend from runtime values and macro expansion cannot be
performed statically
without running the program (which is usually considered pretty bad).
Am I correct?
Finally, as an unrelated question, is there an equivalent of macrolet
in Clojure?
Thanks,

 Michele Simionato
--~--~-~--~~~---~--~~
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 does Clojure macros work?

2009-06-26 Thread Rich Hickey

On Fri, Jun 26, 2009 at 3:53 AM, Michele
Simionato wrote:
>
> I am writing a rather long series of articles about Scheme on Artima,
> "The Adventures of a Pythonista in Schemeland" (maybe somebody here
> has
> heard of it). Last week I arrived at point of discussing hygienic
> macros
> (http://www.artima.com/weblogs/viewpost.jsp?thread=260195)
> and I wanted to spent a few words about the differences between
> Scheme and other lisps. In particular I want to asset the status of
> Clojure
> macros with respect to hygiene.
>
> Since they look a lot like Common Lisp macros, I initially assumed
> that
> Clojure macros were not hygienic, but after performing some experiment
> I
> realized that I was half wrong.  For instance, I expected this code to
> fail due to free-symbol capture:
>
> user=> (defmacro m [x] `(list ~x))
> #'user/m
> user=> (let [list 1] (m 2))
> (2)
>
> Instead, it works correctly. Therefore, I assume that Clojure
> is renaming the free symbols in the macro body (in this case 'list).
> On the other hand, Clojure macros are not fully hygienic, otherwise
> a would not be defined in this example:
>
> user=> (defmacro def-a[x] `(def a ~x))
> #'user/def-a
> user=> (def-a 1)
> #'user/a
> user=> a
> 1
>
> It seems that in order to avoid variable capture for bound symbols
> I need to use good old (gensym):
>
> user=> (defmacro def-a[x] (let [a (gensym)] `(def ~a ~x)))
> #'user/def-a
> user=> (def-a 1)
> #'user/G__77
>
> Am I right in my assumptions?

Not quite. But it takes a bit more digging to see how. Most important,
the macro does not yield an expansion with an unqualified 'a:

user=> (ns foo)
nil

foo=> (defmacro def-a[x] `(def a ~x))
#'foo/def-a

;use macroexpand to see what the macro does
foo=> (macroexpand-1 '(def-a 42))
(def foo/a 42)

Therefor, its use is still hygienic - in the expansion, 'a means
whatever it means in ns foo:

foo=> (in-ns 'user)
#

;currently defining vars can't be done from a foreign namespace, so
this fails as expected

user=> (foo/def-a 42)
java.lang.Exception: Can't refer to qualified var that doesn't exist
(NO_SOURCE_FILE:9)

user=> (in-ns 'foo)
#

foo=> a
java.lang.Exception: Unable to resolve symbol: a in this context
(NO_SOURCE_FILE:0)

foo=> (def-a 42)
#'foo/a

foo=> a
42

> Is there a document explaining how
> Clojure macros work? The macro system seems quite unique, in the sense
> that I do not know of any other macro system working in the same way.
>

It is unique, and it is not renaming. I call the process resolving,
and the basic purpose is hygiene - macros yield qualified symbols
reflecting their meanings at macro definition time.

http://clojure.org/reader#syntax-quote
http://clojure.org/evaluation

You can use auto-gensyms (bar#) to get unique names, but you must take
extra effort to get a macro to emit an unqualified (and thus
capturing) symbol, e.g. ~'bar will yield the unqualified symbol 'bar
in the expansion.

Hope that helps (tip - use macroexpand while exploring macros)

Rich

--~--~-~--~~~---~--~~
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 does Clojure macros work?

2009-06-26 Thread Rich Hickey

On Fri, Jun 26, 2009 at 9:22 AM, Michele
Simionato wrote:
>
> On Jun 26, 9:53 am, Michele Simionato 
> wrote:
>>  I want to asset the status of Clojure
>> macros with respect to hygiene.
>
> Some further experiment:
>
> $ clj
> Clojure 1.1.0-alpha-SNAPSHOT
> user=> (def x 42)
> #'user/x
> user=> (defmacro m[] 'x)
> #'user/m
> user=> (m)
> 42
> user=> (let [x 43] (m))
> 43
>
> There is no referential transparency, it seems.

How not?

> Also, it looks like
> Clojure macros are runtime macros,
> i.e. they may depend from runtime values and macro expansion cannot be
> performed statically
> without running the program (which is usually considered pretty bad).
> Am I correct?

No. Please use macroexpand in order to facilitate yourunderstanding.
By using quote, and not syntax-quote, you have written an
intentionally capturing macro:

user=> (def x 42)
#'user/x
user=> (defmacro m[] 'x)
#'user/m
user=> (macroexpand '(m))
x
user=> (let [x 43] (m)) ;i.e. (let [x 43] x)
43

The correct way is to use syntax-quote:

user=> (defmacro m[] `x)
#'user/m
user=> (macroexpand '(m))
user/x
user=> (let [x 43] (m)) ;i.e. (let [x 43] user/x)
42

> Finally, as an unrelated question, is there an equivalent of macrolet
> in Clojure?

Not yet.

Rich

--~--~-~--~~~---~--~~
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: ClassNotFoundException turn up randomly at compilation

2009-06-26 Thread C. Florian Ebeling

> I randomly get ClassNotFoundExceptions when I try to compile a file.

> I'm running the MacPorts packaged version 1.0.0 of Clojure on OS X
> 10.5.7. (With JLine support.)

I should probably mention the java version as well:
Apple-bundled 1.6.0_13-b03-211 (64 bit)



-- 
Florian Ebeling
Twitter: febeling
florian.ebel...@gmail.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
-~--~~~~--~~--~--~---



ClassNotFoundException turn up randomly at compilation

2009-06-26 Thread C. Florian Ebeling

Hi,

I randomly get ClassNotFoundExceptions when I try to compile a file.
This is a paste from the repl:

Clojure 1.0.0-
user=> (compile 'app.hello)
java.lang.RuntimeException: java.lang.ClassNotFoundException:
app.hello$exec__4 (NO_SOURCE_FILE:0)
user=> (compile 'app.hello)
app.hello

I'm really fresh to Clojure, but that strikes me as very odd. I just
execute the same command twice. But no regularity, before that it
would fail for 20 or so time in a row.

I'm running the MacPorts packaged version 1.0.0 of Clojure on OS X
10.5.7. (With JLine support.)

FWIW, this is the Hello World I try to run, probably still buggy as well.

;; file app/hello.clj:
(ns app.hello (:gen-class)
(:import java.io.BufferedReader)
(:import java.io.InputStreamReader))

(refer 'clojure.core) ;; not sure if this is necessary

(defn capture [command]
  (let [process (.exec (Runtime/getRuntime) command)
input (BufferedReader. (InputStreamReader. (.getInputStream process)))]
   (loop [line (.readLine input) output (list)]
 (if (zero? line)
 (reverse output)
   (recur (.readline input) (cons line output))

Florian


-- 
Florian Ebeling
Twitter: febeling
florian.ebel...@gmail.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
-~--~~~~--~~--~--~---



Re: how does Clojure macros work?

2009-06-26 Thread Michele Simionato


On Jun 26, 3:51 pm, Rich Hickey  wrote:
> By using quote, and not syntax-quote, you have written an
> intentionally capturing macro

Acc, I missed that. I have read the documentation of syntax-quote now:

""
For Symbols, syntax-quote resolves the symbol in the current context,
yielding a fully-qualified symbol (i.e. namespace/name or
fully.qualified.Classname). If a symbol is non-namespace-qualified and
ends with '#', it is resolved to a generated symbol with the same name
to which '_' and a unique id have been appended. e.g. x# will resolve
to x_123. All references to that symbol within a syntax-quoted
expression resolve to the same generated symbol.
""

That means that I do not need gensym, I can just add a `#` to the
identifiers I want to introduce hygienically, right?
I guess this is what you meant by autogensym in the other post. A
pretty cool idea, actually.
--~--~-~--~~~---~--~~
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: Small question: inserting something at the beginning of a vector

2009-06-26 Thread samppi

Thanks for the replies, everyone.

@Mr. Gilardi, this is for a one-time only thing. I have a function,
called rep*, that builds up a vector from left to right. Another,
separate function, called rep+, calls rep*, but it needs to slip in an
element at the vector's beginning.

I'm considering changing rep+'s documentation to state that it will
return a "collection" rather than a "vector", and then just use cons
without vec.

On Jun 24, 3:58 pm, "Stephen C. Gilardi"  wrote:
> On Jun 24, 2009, at 6:44 PM, arasoft wrote:
>
> > This also works:
> > (into [-1] [0 1 2 3 4])
> > but I am more than uncertain whether it is "proper".
>
> Generally, the need to insert at the beginning of a vector should  
> trigger some close scrutiny as to whether vector is the right data  
> type to use in this case.
>
> The choice of which operations Clojure provides for each data type was  
> driven by a guiding principle of providing only those operations that  
> are efficient and appropriate for that type.
>
> Of the Clojure collections, "list" is the one best suited for  
> insertion at the front.
>
> --Steve
>
>  smime.p7s
> 3KViewDownload
--~--~-~--~~~---~--~~
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 does Clojure macros work?

2009-06-26 Thread Laurent PETIT
Hi,

2009/6/26 Michele Simionato 

>
>
> On Jun 26, 3:51 pm, Rich Hickey  wrote:
> > By using quote, and not syntax-quote, you have written an
> > intentionally capturing macro
>
> Acc, I missed that. I have read the documentation of syntax-quote now:
>
> ""
> For Symbols, syntax-quote resolves the symbol in the current context,
> yielding a fully-qualified symbol (i.e. namespace/name or
> fully.qualified.Classname). If a symbol is non-namespace-qualified and
> ends with '#', it is resolved to a generated symbol with the same name
> to which '_' and a unique id have been appended. e.g. x# will resolve
> to x_123. All references to that symbol within a syntax-quoted
> expression resolve to the same generated symbol.
> ""
>
> That means that I do not need gensym, I can just add a `#` to the
> identifiers I want to introduce hygienically, right?
> I guess this is what you meant by autogensym in the other post. A
> pretty cool idea, actually.


The unique gotcha I'm aware of with the '#' autogensym is that it is
transformed at read time, so be aware of not using it in some loop assuming
that you will have a new identifier each time, or do not use it to generate
an identifier that would be defined (by using a variant of def -> defn,
defstruct, defmacro ..) by the macro (if you do so, then each new macro
invocation would continuously override a unique definition, rather than
creating new ones with unique names).



Regards,

-- 
Laurent

--~--~-~--~~~---~--~~
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 does Clojure macros work?

2009-06-26 Thread Meikel Brandmeyer

Hi,

Am 26.06.2009 um 16:39 schrieb Michele Simionato:


That means that I do not need gensym, I can just add a `#` to the
identifiers I want to introduce hygienically, right?
I guess this is what you meant by autogensym in the other post. A
pretty cool idea, actually.


Exactly, here a short real-world example.

(defmacro with-out-str
  [& body]
  `(let [out-string# (StringWriter.)]
 (binding [*out* out-string#]
   ~...@body)
 (.toString out-string#)))

This macro is 100% hygienic. Things like
binding or StringWriter are resolved to the
binding and StringWriter in effect, when the
macro was defined. Also out-string# generates
a new local which does not clash with the
user code injected via ~...@body.

I think this is a very easy way to write macros.
It is almost a visual template of the final code.

Note: I didn't investigate whether there is
a StringWriter and what it's interface is. The
point of the example is the macro...

Sincerely
Meikel



smime.p7s
Description: S/MIME cryptographic signature


Re: Small question: inserting something at the beginning of a vector

2009-06-26 Thread Meikel Brandmeyer

Hi,

Am 26.06.2009 um 17:09 schrieb samppi:


@Mr. Gilardi, this is for a one-time only thing. I have a function,
called rep*, that builds up a vector from left to right. Another,
separate function, called rep+, calls rep*, but it needs to slip in an
element at the vector's beginning.


Maybe you can pass the rep+ element as an
option to rep*?

(defn rep*
  ([stuff] (rep* [] stuff))
  ([v stuff]
   (reduce conj v stuff)))

(defn rep+
  [stuff]
  (rep* [my-val] stuff))

But that might depend on the how my-val is
calculated and whether it depends on the
output of rep* and whether you call rep* at
all from rep+...

Sincerely
Meikel



smime.p7s
Description: S/MIME cryptographic signature


executing tasks on a schedule

2009-06-26 Thread Stuart Halloway

I am working on a Clojure project that is becoming more and more  
schedule-oriented. So far I have been using Clojure's native  
concurrency constructs, but I am becoming tempted to use Java's  
concurrency primitives to get interruptability, etc. -- or maybe even  
wrap a Java library like Quartz.

Has anyone else been down this road?

Stu

--~--~-~--~~~---~--~~
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: [OT] Convincing others about Clojure

2009-06-26 Thread Raoul Duke

> He, being a fairly intelligent and pragmatic man, accepted my logic.

"dibs!", i would sincerely very much like to hook up with your
advisers and investors when i start my company! i mean, that sounded
like an all-too-reasonable experience! :-)

(so, you hiring?)

sincerely.

--~--~-~--~~~---~--~~
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: A website written using Clojure.

2009-06-26 Thread Jonathan Smith

On Jun 25, 3:59 pm, Berlin Brown  wrote:
> On Jun 25, 3:52 pm, Mike Hinchey  wrote:
>
>
>
> > Instead of eval in the doseq, you could use a macro with a do block,
> > something like:
> > user> (defmacro deftags [tags]
> >         `(do ~@(map (fn [tag]
> >                       `(defn ~(symbol (str tag "-with"))
> >                          [block#] (str ~tag block#)))
> >                     tags)))
> > #'user/deftags
>
> > user> (deftags ["html"])
> > #'user/html-with
>
> > user> (html-with [1])
> > "html[1]"
>
> > -Mike
>
> > On Thu, Jun 25, 2009 at 11:51 AM, CuppoJava 
> > wrote:
>
> > > Thanks for the reply.
>
> > > I use doseq instead of map because I need it to run immediately, and
> > > I'm not interested in the return values of the functions.
>
> > > I also would love to be able to simply the (eval ...) part, but I
> > > don't know of any other way to dynamically define a function in
> > > Clojure. If you know of a way it'd help me out a lot.
> > >   -Patrick
>
> I am not looking at the code, I hate when people nitpick every snippet
> they see.  I don't think that gets anyone anywhere.
>
> But does anyone have a problem with Lisp/S-Expressions to HTML/XHtml,
> especially for the entire document.  What is wrong with using some
> form of templating system.  I think that is what Lisp has (see Lisp's
> Html-template).
>
> I am not talking about this particular application, but just in
> general.  I love the ability to take sections of HTML or snippets of
> HTML and use that as the View and then break that off from the
> application code.
>
> But that is just me.

Don't sort of you get that for 'free' with an s-expr system anyway?

You have 'syntax quote' (perfect for making templates) and very robust
mapping functions in clojure.

All you would have to do after that is keep all of your "html" list
generating functions (snippets) in a separate 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: Poll for a new name for clojure eclipse plugin 'clojure-dev'

2009-06-26 Thread e
+1 for jecl

On Thu, Jun 25, 2009 at 5:33 PM, Alex Combas  wrote:

> How about the name: jecl
>
> "jecl" breaks down:
>
> (j)ecl = (j)ava
> j(ec)l = (ec)lipse
> je(cl) = (cl)ojure
>
> jecl.net is not registered (yet)
>
> "develop clojure on eclipse with jecl" has a ring to it, I think
>
> ..and of course there is the story of Jekyll(clojure) and Hyde(java) where
> Jekyll is a good doctor and
> Hyde is the terrible monster that he turns into when he doesn't take his
> medicine. ;)
>
> But just an idea 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: Small question: inserting something at the beginning of a vector

2009-06-26 Thread Stephen C. Gilardi


On Jun 26, 2009, at 11:09 AM, samppi wrote:


I'm considering changing rep+'s documentation to state that it will
return a "collection" rather than a "vector", and then just use cons
without vec.


You might also consider describing it as a "seq". If you use "cons",  
the object returned will be of type "clojure.lang.Cons" which extends  
clojure.lang.ASeq. It would be correct to call it either a collection  
or a seq, but I consider calling it a seq more idiomatic in Clojure.


  user=> (def c (cons 1 [2 3 4]))
  #'user/c
  user=> (class c)
  clojure.lang.Cons
  user=> (coll? c)
  true
  user=> (seq? c)
  true
  user=> (pprint (ancestors (class c)))
  #{java.util.List clojure.lang.IPersistentCollection clojure.lang.Obj
java.util.Collection clojure.lang.Seqable clojure.lang.IMeta
clojure.lang.ASeq java.lang.Object clojure.lang.Streamable
java.lang.Iterable clojure.lang.IObj clojure.lang.Sequential
clojure.lang.ISeq}
  nil

--Steve



smime.p7s
Description: S/MIME cryptographic signature


Re: [OT] Convincing others about Clojure

2009-06-26 Thread Baishampayan Ghose
Raoul Duke wrote:
>> He, being a fairly intelligent and pragmatic man, accepted my logic.
> 
> "dibs!", i would sincerely very much like to hook up with your
> advisers and investors when i start my company! i mean, that sounded
> like an all-too-reasonable experience! :-)
> 
> (so, you hiring?)

We are hiring; but do you live in Mumbai, India? :)

Regards,
BG

-- 
Baishampayan Ghose 
oCricket.com



signature.asc
Description: OpenPGP digital signature


Re: [OT] Convincing others about Clojure

2009-06-26 Thread Raoul Duke

> We are hiring; but do you live in Mumbai, India? :)

no, but i do know some folks around there (although they are all happy
where they are, as far as i know). do you allow telecommuting from
usa? ;-)

best of luck with the venture.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Bug: ClassNotFoundException with macro using private helper function.

2009-06-26 Thread Four of Seventeen

I had code something like this:

(defn- foo [args] body)

(defmacro bar [args] body)
  `(foo ~some-args (fn [~more-args] ~...@body)))

and it complained that foo was not public when I invoked bar from
outside its home namespace.

OK, easy workaround, I thought:

(defmacro bar [args] body)
  (let [x foo]
`(~x ~some-args (fn [~more-args] ~...@body)))

And now at the line BEFORE the line that uses the macro:

#

The cause exception turns out to be:

Caused by: java.lang.ClassNotFoundException: mumble.frotz.foobar
$foo__165
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:
55)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at clojure.lang.RT.classForName(RT.java:1487)
at clojure.lang.LispReader$EvalReader.invoke(LispReader.java:928)
at clojure.lang.LispReader$DispatchReader.invoke(LispReader.java:540)
at clojure.lang.LispReader.read(LispReader.java:145)
at clojure.lang.RT.readString(RT.java:1191)
... 24 more

Can anyone tell me what the hell is causing this? How do I work around
it, without making "foo" public?

I have also tried

(defmacro bar [args] body)
  (let [x #(foo %1 %2)]
`(~x ~some-args (fn [~more-args] ~...@body)))

with nearly identical results:

Caused by: java.lang.ClassNotFoundException:mumble.frotz.foobar
$bar__169$d_r__171

That is, now it's the #() defined closure that it apparently can't
find.

This is a showstopper. I can't make further progress on this project
until I know how to fix 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: Poll for a new name for clojure eclipse plugin 'clojure-dev'

2009-06-26 Thread Howard Lewis Ship
I favor the idea of picking a strong, evocative word and just using that.
Pick a city, a sport team, the name of a piece of art ... just something
bold and memorable. If your tool is good, people will associate it properly.

When I'm naming projects, I get a white board and just start writing down
names as fast as I can think of them. Once I've filled the board, there's
usually an obvious winner.

On Wed, Jun 24, 2009 at 5:02 AM, Laurent PETIT wrote:

> Hi all,
>
> Among the last interesting proposals, some seem not possible to follow,
> because the names are already used :
>
> corona : sounded good, but already used (and it's even an eclipse
> subproject)
> Eclisp: already used by a lisp project for eclipse
> clipse: not really used, but very closed to eclipse
>
>
> So far, we still have :
> enclave
> pinhole
> REPtiLe
> EclipseClojure (along the lines of VimClojure)
> Eclair
> conjclipse (?)
> Troy (!?!)
> Ectoplasm (!?!)
> cljdt (?)
> eclj (?)
>
> I guess this ml will quickly get tired of helping the (currently named)
> clojure-dev team choose a new name, but for those not yet tired of this,
> please (re-)react :-)
>
> 2009/6/24 Antony Blakey 
>
>
>> eclisp :)
>>
>> On 24/06/2009, at 11:05 AM, Matthew Erker wrote:
>>
>> >
>> > I second that vote.
>> > (Though I prefer Clipse, which is somewhat taken.)
>> >
>> >
>> > On Jun 23, 6:47 pm, Rayne  wrote:
>> >> I vote Corona.
>> >
>> > >
>>
>> Antony Blakey
>> -
>> CTO, Linkuistics Pty Ltd
>> Ph: 0438 840 787
>>
>> There are two ways of constructing a software design: One way is to
>> make it so simple that there are obviously no deficiencies, and the
>> other way is to make it so complicated that there are no obvious
>> deficiencies.
>>   -- C. A. R. Hoare
>>
>>
>>
>>
>>
>
>
> >
>


-- 
Howard M. Lewis Ship

Creator of Apache Tapestry
Director of Open Source Technology at Formos

--~--~-~--~~~---~--~~
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: Bug: ClassNotFoundException with macro using private helper function.

2009-06-26 Thread Four of Seventeen

This is odd. Doing a clean & build made this go away. After I did
that, load-file also worked, and using the first workaround (let [x
foo]) at that.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Running compojure in clojure eclipse plugin

2009-06-26 Thread Stephan Mühlstrasser

Hi,

I'm not really familiar with compojure, but I was able to run
Compojure in the REPL inside of the clojure eclipse plug-in by using
the steps described under http://en.wikibooks.org/wiki/Compojure/Getting_Started
as a guideline:

- Built compojure from source as it is described under "Build from
Source". I refer below to the path as 
- Created a new Clojure project in Eclipse
- Removed the clojure and clojure-contrib JAR files provided by the
Clojure Eclipse plugin from the Java build path of the project as
Compojure brings its own copies with it
- Added all the JAR files from /deps and /compojure.jar  to the Java build path of the project
- Create a source file "hello.clj" under the "src" folder of the
project with the proposed content
- Right-click on the "hello.clj" file and select "Run As > Clojure
REPL"
- Pointed browser to http://localhost:8080/, and "Hello world" was
displayed in the browser

Regards
Stephan

On 25 Jun., 03:51, "sailormoo...@gmail.com" 
wrote:
> Sorry but it's a bit off-topic, any one tried running compojure in
> REPL in clojure eclipse plug-in??
> I failed with that while it works in Netbeans plug-in.Any help? Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
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
-~--~~~~--~~--~--~---



Displaying Clojure code on a Website

2009-06-26 Thread Kai

Hi all,

I'm new to this discussion group and Clojure. I'm sharing the first
"bigger-than-REPL" script that I've written because I haven't seen
anything else like it for Clojure. It's a script that takes Clojure
code as input and generates a pretty HTML version. You can view it
here (I ran the script through itself):

http://kai.myownsiteonline.com/clojure/html.clj.html

The style sheet is kept separate for cases with more than one Clojure
script shown on a page. Also, it still formats just as well without
the javascript; the javascript only contains code that highlights
Clojure script as you mouse over it.

I don't have any particular intention by creating this script, it was
just a warmup into Clojure. Feel free to use it for whatever purpose.
I'd appreciate comments on the coding style as well as how to make it
faster - core.clj takes a good 10 minutes! It was a pain and a
pleasure to code :)

~ Kai

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



General Lisp Comment: side effects with Lisp oriented languages

2009-06-26 Thread BerlinBrown

One small issue I see with Lisp languages over something like Haskell
where side effects are greatly minimized.  I tend to write code in
this style:

-
(when-let [seco-files (.getMergeFilesPrimary *main-global-state*)]
   (merge-memory-handler-primary prim-files))

Or something similar, you don't have to understand what is going on
with my logic, but if you notice 'seco-files' may return or may return
something else.  Also, getMergeFilesPrimary may throw an exception.

If I remember, some languages like Haskell give you a little bit more
power to detect what will go wrong.

How do you deal with with this in Clojure?  What is your coding style
to prevent this.  I guess I could write every function such that it
returns a value, but I normally don't.

And clojure code is certainly better than Java.

--~--~-~--~~~---~--~~
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: executing tasks on a schedule

2009-06-26 Thread Berlin Brown



On Jun 26, 11:43 am, Stuart Halloway 
wrote:
> I am working on a Clojure project that is becoming more and more
> schedule-oriented. So far I have been using Clojure's native
> concurrency constructs, but I am becoming tempted to use Java's
> concurrency primitives to get interruptability, etc. -- or maybe even
> wrap a Java library like Quartz.
>
> Has anyone else been down this road?
>
> Stu

Yea, I don't know about Clojure libraries, but also see Spring
Batch...which like you mentioned is based on Quartz.
--~--~-~--~~~---~--~~
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: Displaying Clojure code on a Website

2009-06-26 Thread Richard Newman

> I'm new to this discussion group and Clojure. I'm sharing the first
> "bigger-than-REPL" script that I've written because I haven't seen
> anything else like it for Clojure. It's a script that takes Clojure
> code as input and generates a pretty HTML version. You can view it
> here (I ran the script through itself):

That's pretty cool! Thanks for sharing!

--~--~-~--~~~---~--~~
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: [OT] Convincing others about Clojure

2009-06-26 Thread Gert Verhoog

On 26/06/2009, at 8:55 PM, Baishampayan Ghose wrote:

> Well, the guy is a real startup veteran. I explained to him with some
> help from a bunch of Paul Graham essays that we want to use Clojure  
> just
> because it is "practically" more suitable for the problem at hand and
> not because we are academically inclined Lisp purists.

Good to hear you could convince your advisor. If you ever need to  
defend yourself against claims that Clojure is for academic Lisp  
purists, show'em this: http://www.loper-os.org/?p=42

("...Clojure is the False Lisp, which Reeketh of the Cube Farm...")
It seems that not every "real" academic Lisp purist likes Clojure all  
that much :)

disclaimer: I consider myself academically inclined, but I'm also a  
professional software developer with deadlines.
I love Clojure both in theory and practice!

cheers,
gert


--~--~-~--~~~---~--~~
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: Convincing others about Clojure

2009-06-26 Thread fft1976

On Jun 24, 11:38 pm, Konrad Hinsen  wrote:

> I'd reply that you can always fall back to Java for time-critical  
> stuff.

Is this really relevant? You may fall back to Java for some of your
procedure implementations, but your data structures that they need to
work on would be the dynamically typed Lisp ones.
--~--~-~--~~~---~--~~
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: Small question: inserting something at the beginning of a vector

2009-06-26 Thread samppi

Thanks for the replies. Mr. Brandmeyer's solution is exactly what I
needed; I don't really want to change rep+'s return value from a
vector, which would sort of break backwards compatibility.

On Jun 26, 8:25 am, Meikel Brandmeyer  wrote:
> Hi,
>
> Am 26.06.2009 um 17:09 schrieb samppi:
>
> > @Mr. Gilardi, this is for a one-time only thing. I have a function,
> > called rep*, that builds up a vector from left to right. Another,
> > separate function, called rep+, calls rep*, but it needs to slip in an
> > element at the vector's beginning.
>
> Maybe you can pass the rep+ element as an
> option to rep*?
>
> (defn rep*
>    ([stuff] (rep* [] stuff))
>    ([v stuff]
>     (reduce conj v stuff)))
>
> (defn rep+
>    [stuff]
>    (rep* [my-val] stuff))
>
> But that might depend on the how my-val is
> calculated and whether it depends on the
> output of rep* and whether you call rep* at
> all from rep+...
>
> Sincerely
> Meikel
>
>  smime.p7s
> 2KViewDownload
--~--~-~--~~~---~--~~
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 does Clojure macros work?

2009-06-26 Thread Konrad Hinsen

On 26.06.2009, at 15:22, Michele Simionato wrote:

> Finally, as an unrelated question, is there an equivalent of macrolet
> in Clojure?

Not in Clojure itself, but there is an implementation in an external  
library, clojure.contrib.macro-utils:
http://github.com/richhickey/clojure-contrib/blob/ 
82cf0409d0fcb71be477ebfc4da18ee2128a2ad1/src/clojure/contrib/ 
macro_utils.clj

Concerning your other questions, I think most of them have been  
answered already. In general, the main difference between macros in  
Clojure and Common Lisp comes from the fact that Clojure has  
namespaces and both namespace-qualified and unqualified symbols. This  
takes care of many of the typical problems with non-hygienic macros  
in Common Lisp, while still permitting intentional variable capture.  
It's a pretty neat design once you have understood all the details!

Konrad.

--~--~-~--~~~---~--~~
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: Displaying Clojure code on a Website

2009-06-26 Thread CuppoJava

Hi Kai,
That is really cool! Do you mind if I use it on my webpage?

As for coding style, I must say that yours is very clear. It was very
easy to read through the whole thing.

  -Patrick
--~--~-~--~~~---~--~~
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: Displaying Clojure code on a Website

2009-06-26 Thread Kai

I fixed a bug that messed up spacing (ampersands weren't converted in
html-pre-format), so be sure to use the latest version.

Of course, feel free to use it on your webpage!

~ Kai

On Jun 26, 9:09 pm, CuppoJava  wrote:
> Hi Kai,
> That is really cool! Do you mind if I use it on my webpage?
>
> As for coding style, I must say that yours is very clear. It was very
> easy to read through the whole thing.
>
>   -Patrick
--~--~-~--~~~---~--~~
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: Displaying Clojure code on a Website

2009-06-26 Thread CuppoJava

Thanks a lot!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



The API docs are gone!

2009-06-26 Thread Four of Seventeen

I just went to check the API docs about something and they're gone! In
fact, everything at clojure.org has been trashed. The site has
apparently been vandalized.

The vandals appear to have replaced every page on the site with some
kind of a maintenance page copied from some unrelated site. Probably
they think that's somehow funny. I don't.

Rich Hickey:
1. Restore from backups ASAP.
2. Secure your server! This cannot be allowed to happen again, not
when we're trying to evangelize Clojure.


--~--~-~--~~~---~--~~
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: The API docs are gone!

2009-06-26 Thread CuppoJava

Are you sure? It resembles a regular site maintenance to me...
--~--~-~--~~~---~--~~
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: The API docs are gone!

2009-06-26 Thread Richard Newman

Clojure.org looks normal to me. I checked /api and the front page.

--~--~-~--~~~---~--~~
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: The API docs are gone!

2009-06-26 Thread Four of Seventeen

On Jun 26, 11:14 pm, CuppoJava  wrote:
> Are you sure? It resembles a regular site maintenance to me...

It resembles a "regular site maintenance" for some website other than
clojure.org.

Not that it really matters why it is/was down. The API docs going down
for any amount of time longer than a minute or so is bad bad news.
Worse, web.archive.org doesn't seem to have ANY of it, and though
Google's cache does links in it don't use Google's cache so you have
to craft a query to put the particular page you want in the search
results to view it.

By contrast, in over a decade of using http://java.sun.com/javase/6/docs/api/
and its predecessors I have never, ever seen an incorrect response
(i.e. one that didn't contain the API docs) except when the network
was down at my end.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



java.ext.dirs problem

2009-06-26 Thread Chouser
When I starting Clojure, I generally point -Djava.ext.dirs
at a "classpaths" directory.  That's where I dump jars,
symlinks to jars, and symlinks to the 'src' and 'classes'
directories of the various projects I have installed.

I know that some people have had trouble with java.ext.dirs
and instead use wildcards in their classpaths or other more
complicated solutions.  But since I've never seen these
problems described in enough detail to reproduce or
troubleshoot, when I stumbled on one tonight I thought it'd
be worth documenting...

Here is the simplest way I've found to produce the error I'm
seeing:

1. Compile clojure-contrib
2. Create a "classpaths" directory with symlink to
   clojure-contrib/classes, so as to add the compiled contrib
   classes to the classpath.  Mine lookes like this:

$ ls -l classpaths/
total 0
lrwxrwxrwx 1 chouser chouser 32 2009-06-27 00:54 classes ->
../proj/clojure-contrib/classes/

3. Start clojure and try to use something from contrib:

java -Djava.ext.dirs=classpaths -cp proj/clojure/clojure.jar clojure.main
user=> (require 'clojure.contrib.math)
java.lang.NoClassDefFoundError: clojure/lang/RT (NO_SOURCE_FILE:0)

The full stack trace for that exception is attached.


I've found two workarounds so far.  Take your pick:

A. Add clojure.jar to the "classpaths" directory.  Once
that's done, it doesn't matter if you also specify it in -cp
on the java command line or not:

$ ls -l classpaths/
total 0
lrwxrwxrwx 1 chouser chouser 32 2009-06-27 00:54 classes ->
../proj/clojure-contrib/classes/
lrwxrwxrwx 1 chouser chouser 27 2009-06-27 01:06 clojure.jar ->
../proj/clojure/clojure.jar

B. Remove the contrib link from "classpaths" and specify it
on the java command line instead:

java -Djava.ext.dirs=classpaths -cp proj/clojure-contrib/classes clojure.main

--Chouser

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---

Exception in thread "main" java.lang.NoClassDefFoundError: clojure/lang/RT 
(NO_SOURCE_FILE:0)
at clojure.lang.Compiler.eval(Compiler.java:4617)
at clojure.core$eval__4654.invoke(core.clj:1739)
at clojure.main$eval_opt__6559.invoke(main.clj:223)
at clojure.main$initialize__6566.invoke(main.clj:242)
at clojure.main$null_opt__6588.invoke(main.clj:267)
at clojure.main$main__6608.doInvoke(main.clj:336)
at clojure.lang.RestFn.invoke(RestFn.java:426)
at clojure.lang.Var.invoke(Var.java:350)
at clojure.lang.AFn.applyToHelper(AFn.java:175)
at clojure.lang.Var.applyTo(Var.java:463)
at clojure.main.main(main.java:37)
Caused by: java.lang.NoClassDefFoundError: clojure/lang/RT
at clojure.contrib.math__init.(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at clojure.lang.RT.loadClassForName(RT.java:1521)
at clojure.lang.RT.load(RT.java:389)
at clojure.lang.RT.load(RT.java:371)
at clojure.core$load__5749$fn__5752.invoke(core.clj:3784)
at clojure.core$load__5749.doInvoke(core.clj:3783)
at clojure.lang.RestFn.invoke(RestFn.java:413)
at clojure.core$load_one__5701.invoke(core.clj:3620)
at clojure.core$load_lib__5722.doInvoke(core.clj:3657)
at clojure.lang.RestFn.applyTo(RestFn.java:147)
at clojure.core$apply__3900.doInvoke(core.clj:390)
at clojure.lang.RestFn.invoke(RestFn.java:443)
at clojure.core$load_libs__5734.doInvoke(core.clj:3683)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply__3900.doInvoke(core.clj:390)
at clojure.lang.RestFn.invoke(RestFn.java:443)
at clojure.core$require__5740.doInvoke(core.clj:3751)
at clojure.lang.RestFn.invoke(RestFn.java:413)
at user$eval__1.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:4601)
... 10 more
Caused by: java.lang.ClassNotFoundException: clojure.lang.RT
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 32 more


Re: The API docs are gone!

2009-06-26 Thread ataggart



On Jun 26, 9:12 pm, Four of Seventeen  wrote:
> Not that it really matters why it is/was down. The API docs going down
> for any amount of time longer than a minute or so is bad bad news.
...
> By contrast, in over a decade of usinghttp://java.sun.com/javase/6/docs/api/
> and its predecessors I have never, ever seen an incorrect response
> (i.e. one that didn't contain the API docs) except when the network
> was down at my end.

As in, operated by Sun Microsystems?  There's a donate button on the
clojure.org homepage if you want to help improve the site
infrastructure.

You can also use (doc ...) and (find-doc ...) if you can't get to the
web-based API docs.
--~--~-~--~~~---~--~~
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: The API docs are gone!

2009-06-26 Thread CuppoJava

It was a server maintenance for wikispaces.org which is the hosting
site for the Clojure website. Nothing sinister about it.
--~--~-~--~~~---~--~~
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: java.ext.dirs problem

2009-06-26 Thread Laurent PETIT

While I'm far from a java classpath-related issues problem, I think I
know enough to say that placing your libs in the java.ext.dirs
classpath is a trick that could lead to problems.

It's primary and sole intent is to hold extensions to the java API
that then would be loaded with the core java APIs.
That's certainly why you're having problems when you mess up the
dependencies in places where there is a hierarchy of classloaders
involved : clojure-contrib was loaded with the "main classloader"
along with java core libraries, and clojure was loaded with a "child"
classloader. And thus clojure-contrib classes were not able to see any
of the classes in the child classloader.

The problem with this java.ext.dirs is of the category of problems
pointed out by C. Martin (and others!) as a design smell : the one
named "viscosity" : "doing things right is harder than doing things
wrong". It's so easy to put everything in this java.ext.dirs directory
that it's difficult resisting the temptation !

Regards,

-- 
Laurent

2009/6/27 Chouser :
> When I starting Clojure, I generally point -Djava.ext.dirs
> at a "classpaths" directory.  That's where I dump jars,
> symlinks to jars, and symlinks to the 'src' and 'classes'
> directories of the various projects I have installed.
>
> I know that some people have had trouble with java.ext.dirs
> and instead use wildcards in their classpaths or other more
> complicated solutions.  But since I've never seen these
> problems described in enough detail to reproduce or
> troubleshoot, when I stumbled on one tonight I thought it'd
> be worth documenting...
>
> Here is the simplest way I've found to produce the error I'm
> seeing:
>
> 1. Compile clojure-contrib
> 2. Create a "classpaths" directory with symlink to
>   clojure-contrib/classes, so as to add the compiled contrib
>   classes to the classpath.  Mine lookes like this:
>
> $ ls -l classpaths/
> total 0
> lrwxrwxrwx 1 chouser chouser 32 2009-06-27 00:54 classes ->
> ../proj/clojure-contrib/classes/
>
> 3. Start clojure and try to use something from contrib:
>
> java -Djava.ext.dirs=classpaths -cp proj/clojure/clojure.jar clojure.main
> user=> (require 'clojure.contrib.math)
> java.lang.NoClassDefFoundError: clojure/lang/RT (NO_SOURCE_FILE:0)
>
> The full stack trace for that exception is attached.
>
>
> I've found two workarounds so far.  Take your pick:
>
> A. Add clojure.jar to the "classpaths" directory.  Once
> that's done, it doesn't matter if you also specify it in -cp
> on the java command line or not:
>
> $ ls -l classpaths/
> total 0
> lrwxrwxrwx 1 chouser chouser 32 2009-06-27 00:54 classes ->
> ../proj/clojure-contrib/classes/
> lrwxrwxrwx 1 chouser chouser 27 2009-06-27 01:06 clojure.jar ->
> ../proj/clojure/clojure.jar
>
> B. Remove the contrib link from "classpaths" and specify it
> on the java command line instead:
>
> java -Djava.ext.dirs=classpaths -cp proj/clojure-contrib/classes clojure.main
>
> --Chouser
>
> >
>

--~--~-~--~~~---~--~~
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: Enlive questions

2009-06-26 Thread cody



On May 6, 12:36 am, Christophe Grand  wrote:
> Hello Ryan,
>
> rzeze...@gmail.com a écrit :> Either I've missed something, orEnlive*appears* 
> to have problems
> > handling comment tags.
>
> Indeed. I pushed a fix, please tell me whether it works for you now.
>
> Thanks for the report.
>
> Christophe

Maybe unrelated, but

=>(html-resource (java.io.StringReader. "th"))

({:type :comment, :data " o noes a comment "})

Not the result I would expect.

--~--~-~--~~~---~--~~
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: executing tasks on a schedule

2009-06-26 Thread ataggart

What do you need that a cron job wouldn't provide?

On Jun 26, 8:43 am, Stuart Halloway  wrote:
> I am working on a Clojure project that is becoming more and more  
> schedule-oriented. So far I have been using Clojure's native  
> concurrency constructs, but I am becoming tempted to use Java's  
> concurrency primitives to get interruptability, etc. -- or maybe even  
> wrap a Java library like Quartz.
>
> Has anyone else been down this road?
>
> Stu
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---