Re: accum

2009-06-17 Thread Mark Derricutt
There's prebuilt SNAPSHOT releases available in Howard's Tapestry repository
- been using them happily from my maven based clojure app for awhile.
Thou an official 1.0 stamped release in maven central (along with
clojure-lang) would be most welcome.

-- 

On Wed, Jun 17, 2009 at 6:05 PM, Parth  wrote:

> I am not sure if a pre-built clojure-contrib.jar is available.
>

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

2009-06-17 Thread kkw

I only knew about map, apply, and reduce from studying haskell in uni.
I've not heard of 'reduce' referred to as 'accum', but then again when
I wanted to determine the number of elements in a seq, I kept
searching for 'length' and 'size' but didn't think of 'count', so it
can be a bit tricky eh? I've certainly asked my fair share of noob-
questions, and folks in this group have been quite happy to oblige me.
I now find it easier to ask a question in this group about functions
I've wanted, rather than implement (or poorly re-implement, as I did
in my earlier days!) popular functions.

clojure.contrib isn't a part of clojure.core (otherwise it'd called
clojure.core right?), but it I think it's very well-worth downloading
and compiling. Parth's build instructions for clojure.contrib are
good. However, clojure.contrib isn't required for 'accum'/'reduce'
because 'reduce' is part of clojure.core. In fact, at the REPL you can
enter:

(doc reduce)

and clojure.core will give you some information. (find-doc "reduce")
turns up some extra stuff also. 'find-doc' is great! I admit that
(find-doc "accum") didn't lead to 'reduce' which is mildly sad, but
I'm sure I'll cope somehow.

Even though clojure.contrib hasn't been released as 1.0 or anything
official-sounding, I reckon it still beats the heck out of me
reinventing the wheel, especially with the calibre of folks who've
contributed to clojure.contrib. If you don't feel comfortable with the
offerings in clojure.contrib, that's fine also. Perhaps other folks
can give testimonies about the usefulness/utility of clojure.contrib?
I've found clojure.contrib really helpful and had no problems with it,
even though there's no official release of it.

Wishing you peace,

Kev

On Jun 17, 4:49 pm, Sean Devlin  wrote:
> Wrexsoul,
> Your right, I was out of line.  I'm sorry.  I should go through the
> effort to explain myself rather than resort to personal attacks.
>
> Sean
>
> On Jun 17, 1:25 am, Wrexsoul  wrote:
>
>
>
> > On Jun 17, 12:57 am, Sean Devlin  wrote:
>
> > > Daniel, don't feed the WrexTroll
>
> > Personal attacks are unwelcome here.
>
> > > > Indeed! It's called reduce:
>
> > > >http://clojure.org/api#toc476
>
> > > > I'm shocked you haven't noticed it in the API documentation.
>
> > I SPECIFICALLY did a search of the entire api docs to see if there was
> > anything like "accum" already in there. I examined every occurrence of
> > "seq" and turned up a blank.
>
> > The docs definitely have problems if this can be missed despite a very
> > thorough search. The only more-thorough search would have been to
> > actually read the docs in their entirety, rather than to search them!
>
> > > > Being able to read is one of the most basic, useful skills
> > > > in programming.
>
> > This rudeness is uncalled-for.
>
> > > > Especially if you want to be pompous without being an ass.
>
> > Personal attacks are unwelcome here.
>
> > > > Oh? What about compared to this:
>
> > > > (use 'clojure.contrib.seq-utils)
>
> > > > (def *tris* (reductions + (iterate inc 1)))
>
> > Depends on a library that hasn't been released yet.
--~--~-~--~~~---~--~~
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: Another Clojure Box

2009-06-17 Thread Emeka
Darmac,

I use Scite Just edited it in order to run Clojure Repl(help help from
this group). That's not great, it is ugly. I would like to use yours if it
is as simple as Scite editor and pretty easy to install.

Regards,
Emeka

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

2009-06-17 Thread Konrad Hinsen

On 17.06.2009, at 08:36, Chris Dean wrote:

> Sure.  It's easy to write one's own version of get et.al.  What's hard
> to do is to get packages that you didn't write to use that version of
> get.  You need everyone to use c.c.generic.collection or all the
> different libraries will have trouble interacting with each other.

Right. That's why I think Clojure should have a standard library, and  
multimethod versions of common functions should be in it. That's the  
only way to encourage the use of common interfaces.

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



reasoning/logic programming from Clojure

2009-06-17 Thread Daniel Lyons
Hi everyone,

I'm doing a short talk on declarative/logic programming, reasoning and  
expert systems for the Albuquerque Lisp/Scheme group this Sunday. I  
have to talk about Prolog and CLIPS but since the future is here I  
hope to give some time to Clojure.

If you've done something cool with Clojure and the Datalog contrib  
module, called into Jess or done anything else remotely logical/ 
declarative-like from Clojure that you think might be relevant to such  
a talk, please send me a line. I'd really like to take it as an  
opportunity to trumpet Clojure's grandeur.

Also, if you're going to be in Albuquerque this Sunday, the meeting  
will be at the UNM HPC Center and starts at 2 PM.

Thanks,

—
Daniel Lyons




--~--~-~--~~~---~--~~
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 goes Git!

2009-06-17 Thread Rick Moynihan

2009/6/17 Rich Hickey :
>
> Clojure and contrib repos are now on GitHub:
>
> http://github.com/richhickey/clojure
> http://github.com/richhickey/clojure-contrib
>
> Issues and other development collaboration has moved to Assembla:
>
> http://www.assembla.com/spaces/clojure
> http://www.assembla.com/spaces/clojure-contrib
>
> General discussions are going to stay right here on Google Groups:
>
> http://groups.google.com/group/clojure
>
> And there's a new group for Clojure developers and contributors:
>
> http://groups.google.com/group/clojure-dev
>
> non-contributors can follow along:
>
> http://groups.google.com/group/clojure-dev/feeds
>
> You can follow Clojure development on Twitter (exact content TBD):
>
> http://twitter.com/clojuredev
>
> Some items are still outstanding:
>
>        Importation of existing issues
>        Placement of generated contrib documentation
>        Patch submission policy
>
> In particular, please don't send pull requests via GitHub at this
> time.
>
> The move to git was much requested, but accompanied by a certain
> amount of apprehension from the non-git-savvy and some Windows users.
> If you *are* git-savvy, please do your best to support others on the
> group and irc as they get setup and find their bearings.
>
> I'm looking forward to these new tools further enhancing the
> collaboration amongst the Clojure community.
>
> Thanks again to all for your participation!
>
> Rich

This is awesome news, and something I'm really glad to see!

Cheers,

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 goes Git!

2009-06-17 Thread Mark Volkmann
On Tue, Jun 16, 2009 at 8:17 PM, Antony Blakey wrote:

>
> On 17/06/2009, at 10:37 AM, Mark Volkmann wrote:
>
> > I think you've got that backwards. A "git push" is how I would ask
> > the remote repo to accept my changes. A "git pull" says I want to
> > update my local repo with changes someone made in the remote repo.
>
> No, you can send a *request* to Rich, via GitHub, to pull from your
> repository. That's what a git pull *request* is - it's a request for
> someone else to git pull. A 'git pull' is, as you say, the command to
> pull commits into your repository and apply them, but that's not what
> Rich is talking about here.
>
> A common GitHub workflow is to fork someone's repository, clone your
> fork, push your changes to your GitHub fork, and then send a pull
> request to the owner of the 'canonical' repository that you forked
> from, asking them to pull certain commits from your fork.
>

We must be talking about a different way of using git. In my case I created
a local repo from the remote github repo using the following command:

git clone git://github.com/richhickey/clojure.git

After doing this, I still contend that the correct way to update my local
repo is to cd to the directory of my local repo and run "git pull". Do you
think that's wrong? It seems to me in this scenario the command we shouldn't
use it "git push" because that would attempt push my changes back to the
github repo.

-- 
R. Mark Volkmann
Object Computing, Inc.

--~--~-~--~~~---~--~~
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 goes Git!

2009-06-17 Thread Paul Stadig
On Wed, Jun 17, 2009 at 7:03 AM, Mark Volkmann wrote:

> On Tue, Jun 16, 2009 at 8:17 PM, Antony Blakey wrote:
>
> We must be talking about a different way of using git. In my case I created
> a local repo from the remote github repo using the following command:
>
> git clone git://github.com/richhickey/clojure.git
>
> After doing this, I still contend that the correct way to update my local
> repo is to cd to the directory of my local repo and run "git pull". Do you
> think that's wrong? It seems to me in this scenario the command we shouldn't
> use it "git push" because that would attempt push my changes back to the
> github repo.


Mark,
You are correct. The way that you should update *your* repository is to
issue the "git pull" command within the working directory. Look at it from
Rich's perspective. There are two ways that he can get changes from your
repo into his repo. One is for you to cd into your directory and issue a
"git push" command, but that assumes that you have access to write to his
repo.

The other way is for him to cd into his directory and issue the "git pull"
command. This only assumes that he has read access to your repo. There is a
feature of GitHub (the website, not git itself) that is called a "pull
request". You do not have write access to Rich's repo, but you want him to
incorporate your changes, so you send him a "pull request". It is basically
just an e-mail saying, "Hey, Rich, I have a cool new change that I'd like to
see incorporated, cd into your working directory and issue a 'git pull'."

Rich has said to hold off on sending "pull requests" through the GitHub
website. He is not saying that you cannot update your repo.


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 goes Git!

2009-06-17 Thread Christian Vest Hansen

On Wed, Jun 17, 2009 at 1:03 PM, Mark Volkmann wrote:
> On Tue, Jun 16, 2009 at 8:17 PM, Antony Blakey 
> wrote:
>>
>> On 17/06/2009, at 10:37 AM, Mark Volkmann wrote:
>>
>> > I think you've got that backwards. A "git push" is how I would ask
>> > the remote repo to accept my changes. A "git pull" says I want to
>> > update my local repo with changes someone made in the remote repo.
>>
>> No, you can send a *request* to Rich, via GitHub, to pull from your
>> repository. That's what a git pull *request* is - it's a request for
>> someone else to git pull. A 'git pull' is, as you say, the command to
>> pull commits into your repository and apply them, but that's not what
>> Rich is talking about here.
>>
>> A common GitHub workflow is to fork someone's repository, clone your
>> fork, push your changes to your GitHub fork, and then send a pull
>> request to the owner of the 'canonical' repository that you forked
>> from, asking them to pull certain commits from your fork.
>
> We must be talking about a different way of using git. In my case I created
> a local repo from the remote github repo using the following command:
>
> git clone git://github.com/richhickey/clojure.git
>
> After doing this, I still contend that the correct way to update my local
> repo is to cd to the directory of my local repo and run "git pull". Do you
> think that's wrong? It seems to me in this scenario the command we shouldn't
> use it "git push" because that would attempt push my changes back to the
> github repo.

You cannot `git push` to Rich's github repository unless he has added
you as a contributor. However, you can fork his repository on github,
clone it, and `git push` to that.

Indeed, when Rich has made changes to his repository and you want
those changes in your local repository, you do a `git pull`.

A "pull request" is a github workflow term for when you have a fork
(created with the "fork" button on github) with your own changes, and
you want Rich to pull in those changes. To do that, you press the
"pull request" button and Rich will get a private message, and
possibly also an email, with your request.

>
> --
> R. Mark Volkmann
> Object Computing, Inc.
>
> >
>



-- 
Venlig hilsen / Kind regards,
Christian Vest Hansen.

--~--~-~--~~~---~--~~
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 goes Git!

2009-06-17 Thread Meikel Brandmeyer

Hi,

Am 17.06.2009 um 02:17 schrieb Rich Hickey:


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


For the mercurial users out there:
Both repos work with the latest hg-git
from http://hg-git.github.com! :)))

Sincerely
Meikel



smime.p7s
Description: S/MIME cryptographic signature


Re: Clojure and Jacob

2009-06-17 Thread janus

Meikel,
I face a little challenge while using vbaxl.

I wanted to achieve the below
Set myRange = Worksheets("Sheet1").Range("A1:C10")
answer = Application.WorksheetFunction.Min(myRange)

I did ;
(def myRange (.. Dispatch (call ws "Range" "A1:C10")(toDispatch)))
Which seems to work, but I was not able to proceed further.

Another concern that I have is this;
I have another excel code that works, but it throws this error
"AWT-EventQueue-0" com.jacob.comFailException:Can't map name to
dispid: Close


Regards,
Emeka


--~--~-~--~~~---~--~~
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 goes Git!

2009-06-17 Thread stephaner

Hi,

I like this introductory tutorial on git :
http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html

It doesn't show working with github, some tutorials are availables on
github site.
But it dit help me to get started.

Bye,

Stephane _/)



On Jun 17, 2:11 am, Tassilo Horn  wrote:
> Antoni Batchelli  writes:
>
> Hi Antoni,
>
> > For learning Git I found "Git Magic" 
> > (http://www-cs-students.stanford.edu/~blynn/gitmagic/
> >   ) to be very helpful, and "Git Internals" 
> > (https://peepcode.com/products/git-internals-pdf
> >   ) if you want to understand how it works internally.
>
> I just want to add John Wiegley's excellent
>
>   Git from the bottom up [1]
>
> to the list of must-reads for mastering git.
>
> Bye,
> Tassilo
> __
> [1]http://ftp.newartisans.com/pub/git.from.bottom.up.pdf
--~--~-~--~~~---~--~~
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 goes Git!

2009-06-17 Thread Matt Clark

On Jun 17, 9:16 am, Meikel Brandmeyer  wrote:
> For the mercurial users out there:
> Both repos work with the latest hg-git
> fromhttp://hg-git.github.com!:)))

Meikel, thanks for this!  I am one of those reticent Windows users who
have given both git (with github) and mercurial a decent try and I
found Hg to be a much more user friendly experience.  This looks like
it should keep me happy.

- Matt
--~--~-~--~~~---~--~~
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 goes Git!

2009-06-17 Thread Konrad Hinsen

On Jun 17, 2009, at 14:16, Meikel Brandmeyer wrote:

> Am 17.06.2009 um 02:17 schrieb Rich Hickey:
>
>> http://github.com/richhickey/clojure
>> http://github.com/richhickey/clojure-contrib
>
> For the mercurial users out there:
> Both repos work with the latest hg-git
> from http://hg-git.github.com! :)))

It didn't work for me this morning. I used hg-git to clone the  
Clojure repository and then tried to build it. The build failed, and  
further inspection showed that core.clj was a few hundred lines  
shorter than the copy at github. I didn't pursue the issue any further.

I have used hg-git on various small repositories without problems,  
but Clojure seems to be too much for it.

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: reasoning/logic programming from Clojure

2009-06-17 Thread Sean Devlin

Sounds awesome!  Will you be able to post any material after the
talk?  You know, slides, videos, notes, etc?

Sean

On Jun 17, 5:35 am, Daniel Lyons  wrote:
> Hi everyone,
>
> I'm doing a short talk on declarative/logic programming, reasoning and  
> expert systems for the Albuquerque Lisp/Scheme group this Sunday. I  
> have to talk about Prolog and CLIPS but since the future is here I  
> hope to give some time to Clojure.
>
> If you've done something cool with Clojure and the Datalog contrib  
> module, called into Jess or done anything else remotely logical/
> declarative-like from Clojure that you think might be relevant to such  
> a talk, please send me a line. I'd really like to take it as an  
> opportunity to trumpet Clojure's grandeur.
>
> Also, if you're going to be in Albuquerque this Sunday, the meeting  
> will be at the UNM HPC Center and starts at 2 PM.
>
> Thanks,
>
> —
> Daniel Lyons
--~--~-~--~~~---~--~~
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 goes Git!

2009-06-17 Thread Mark Volkmann
On Tue, Jun 16, 2009 at 7:17 PM, Rich Hickey  wrote:

>
> Clojure and contrib repos are now on GitHub:
>
> http://github.com/richhickey/clojure
> http://github.com/richhickey/clojure-contrib
>

Does this announcement have any impact on the Google Code Subversion
repositories? Will those continue to be updated or do the GitHub
repositories replace them?

-- 
R. Mark Volkmann
Object Computing, Inc.

--~--~-~--~~~---~--~~
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: No OO restrictions is good. why not still add dependency injection?

2009-06-17 Thread AndrewC.



On Jun 16, 11:34 am, Jules  wrote:
> I still don't know what dependency injection means exactly. The
> examples I've seen that are said to use dependency injection can be
> solved by using first class functions. Are first class functions what
> you want?

Dependecy injection is nothing more than the difference between this:

public class Bosh {
  private final Dependecy dep = new DependencyImpl();
}

and this:

public class Bosh {
  private final Dependecy dep;
  public Bosh(Dependency dep) { this.dep = dep; }
}

In both cases Bosh needs a Dependency. It depends on having one. In
the first  case the actual implementation is hard coded. In the second
the implementation is provided, or to put it another way, the
dependency is injected.

Higher order functions obviously fit the bill. Map depends on a
mapping function, which you have to inject as a parameter when you
call 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: Clojure goes Git!

2009-06-17 Thread Jonas Bonér

Awesome. Good decision.

On Jun 17, 2:17 am, Rich Hickey  wrote:
> Clojure and contrib repos are now on GitHub:
>
> http://github.com/richhickey/clojurehttp://github.com/richhickey/clojure-contrib
>
> Issues and other development collaboration has moved to Assembla:
>
> http://www.assembla.com/spaces/clojurehttp://www.assembla.com/spaces/clojure-contrib
>
> General discussions are going to stay right here on Google Groups:
>
> http://groups.google.com/group/clojure
>
> And there's a new group for Clojure developers and contributors:
>
> http://groups.google.com/group/clojure-dev
>
> non-contributors can follow along:
>
> http://groups.google.com/group/clojure-dev/feeds
>
> You can follow Clojure development on Twitter (exact content TBD):
>
> http://twitter.com/clojuredev
>
> Some items are still outstanding:
>
>         Importation of existing issues
>         Placement of generated contrib documentation
>         Patch submission policy
>
> In particular, please don't send pull requests via GitHub at this
> time.
>
> The move to git was much requested, but accompanied by a certain
> amount of apprehension from the non-git-savvy and some Windows users.
> If you *are* git-savvy, please do your best to support others on the
> group and irc as they get setup and find their bearings.
>
> I'm looking forward to these new tools further enhancing the
> collaboration amongst the Clojure community.
>
> Thanks again to all for your participation!
>
> 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: accum

2009-06-17 Thread CuppoJava

Finding the right function in the doc admittedly takes a little
practice. I've learned gradually, that Clojure pretty much has all its
bases covered though. You just need to find the function. And this
forum is filled with very helpful and friendly people, who will tell
you the function name, if you describe the behavior you want, and if
you ask nicely. "assoc-in" and "update-in" were the two functions that
I needed help finding when I started.
 -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: Clojure goes Git!

2009-06-17 Thread Meikel Brandmeyer

Hi,

Am 17.06.2009 um 15:26 schrieb Konrad Hinsen:


It didn't work for me this morning. I used hg-git to clone the
Clojure repository and then tried to build it. The build failed, and
further inspection showed that core.clj was a few hundred lines
shorter than the copy at github. I didn't pursue the issue any  
further.


I have used hg-git on various small repositories without problems,
but Clojure seems to be too much for it.


hg-git put me in the lazy branch. I'm not sure how the
branches are handled by the hg-git module. I just
did "hg update -C origin/master" to get back to the
master  and branch and everything worked for me.
(At least it compiled w/o problems, haven't had the
chance to check in detail.)

Sincerely
Meikel



smime.p7s
Description: S/MIME cryptographic signature


Re: accum

2009-06-17 Thread Mark Volkmann
On Wed, Jun 17, 2009 at 9:41 AM, CuppoJava wrote:

>
> Finding the right function in the doc admittedly takes a little
> practice. I've learned gradually, that Clojure pretty much has all its
> bases covered though. You just need to find the function. And this
> forum is filled with very helpful and friendly people, who will tell
> you the function name, if you describe the behavior you want, and if
> you ask nicely. "assoc-in" and "update-in" were the two functions that
> I needed help finding when I started.
>

This is exactly why I created "Clojure Categorized" at
http://java.ociweb.com/mark/clojure/ClojureCategorized.html. I'd love to see
this become part of the main Clojure website in which case I would stop
hosting it. It's not currently complete, but I think it's a good start.
Feedback welcomed!

-- 
R. Mark Volkmann
Object Computing, Inc.

--~--~-~--~~~---~--~~
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 goes Git!

2009-06-17 Thread Luke Renn

If you're looking for a git/github workflow I can't recommend the
following post enough:

http://blog.mhartl.com/2008/10/14/setting-up-your-git-repositories-for-open-source-projects-at-github/

I use something similar to (barely) contribute to compojure.  There
isn't anything like his 'edge' branch in compojure so it's a bit
simpler.  I also branch for each fix or feature (he just creates a
single personal branch).  It might seem complicated, but it ends up
being very clean and more closely matches the command line experience
imho (origin is the project, not your github fork).

Some things I'd recommend are never ever work on master (should always
fast forward), always branch for a feature or fix, and rebase that
branch before pushing it to github.

--~--~-~--~~~---~--~~
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: Runtime Compilation of Clojure from Android

2009-06-17 Thread Marklar

Very nice, thanks for sharing.

I tried the first version you posted on my rooted G1. It could
evaluate strings and numbers, but unfortunately when I tried to create
a function it didn't do anything. It just stopped, though the activity
was still responding (the menu worked, etc). I looked at logcat but
couldn't find anything.

I will try to look at again in more detail, if I figure it out I will
definitely let you know.

On Jun 16, 4:11 pm, George Jahad  wrote:
> On Jun 16, 3:15 am, "Remco van 't Veer"  wrote:
>
> > Cool!  Please share the code on github or whatever.
>
> ok, I've forked your clojure tree and added my patches 
> here:http://github.com/GeorgeJahad/clojure/tree/master
> The main changes are in Compiler.java, with a few in build.xml and
> main.clj.
>
> Note that you'll probably need to set the sdk-location in build.xml
>
> I've cleaned things up a bit and set out a new prebuilt calc apk 
> here:http://georgejahad.com/clojure/calc-debug.apk
>
> (Note: I've only tested these install instructions out on a Linux host
> with this sdk: android-sdk-linux_x86-1.5_r2.zip)
>
> To configure the emulator:
> emulator -avd 
> adb  install -r    calc-debug.apk
> adb shell mkdir /data/clojure
> adb shell mkdir /data/clojure/classes
> adb shell chmod 777 /data/clojure
> adb shell chmod 777 /data/clojure/classes
> adb forward tcp:8032 tcp:8032
>
> Then start up the calc app from the emulator gui.
>
> Then access the repl like so:
> telnet localhost 8032
>
> Now you can compile from the repl.
>
> My only change to examples.calc.clj was to add clojure.contrib.server-
> socket and invoke it like so from the :create routine:
>
>    (create-repl-server 8032)
>    (repl)
> My fork of your calc source is 
> here:http://github.com/GeorgeJahad/clj-android/blob/7f0497ee1aa155075d9733...

--~--~-~--~~~---~--~~
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: reasoning/logic programming from Clojure

2009-06-17 Thread Richard Newman

> Sounds awesome!  Will you be able to post any material after the
> talk?  You know, slides, videos, notes, etc?

Seconded -- I haven't *yet* done anything cool with Clojure and  
Datalog... but I would like to :)

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

2009-06-17 Thread Richard Newman

> Finding the right function in the doc admittedly takes a little
> practice.

I often end up reading through /api to find what I want, but "Clojure  
Categorized" might be a much faster way to do it:

http://java.ociweb.com/mark/clojure/ClojureCategorized.html

I don't know if it's kept up-to-date (the copyright header says  
2009...), but much of the core stuff is stable 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: cannot use swig native shared libraries

2009-06-17 Thread Antonio, Fabio Di Narzo

With the relatively recent release of clojure 1.0.0, I decided to give
another try to using SWIG-generated native libraries with it.
It still doesn't work on my box: I get an "UnsatisfiedLinkError"
exception when trying to call a native function. Still, calling the
function from plain Java code works as expected.

To demonstrate it I packed up a folder with a minimal, reproducible
example:
http://clojure.googlegroups.com/web/SWIGTest.tar.bz2
The archive file size is so small I included sources & compiled files
too (shared library compiled for Linux-i386 machines). A "compile.sh"
shell script is included as a guidance if you want to compile it all
yourself. Run the .clj script and you should get the aforementioned
exception. Run the plain java app. by:
$ java SwigTest
from the root folder and you should get the number "3" printed on
screen.

I would appreciate any comment about the issue.

Thanks for the great work,
all the bests,
Antonio, Fabio Di Narzo.

On Apr 29, 12:42 pm, "Antonio, Fabio Di Narzo"
 wrote:
> 2009/4/29 Tony Hursh :
>
>
>
>
>
> > On Apr 27, 2009, at 8:45 PM, jim wrote:
>
> >> Hey Antonio,
>
> >> I'm getting a similar error. I wanted to call setuid from Clojure, so
> >> I followed this link's example:
> >>http://www2.sys-con.com/itsg/virtualcd/Java/archives/0510/Silverman/i...
>
> >> to build a java class and a shared library. I added the class to my
> >> classpath and was able to import my UID class. But when I tried to
> >> call the UID.setuid method, it gave me that UnsatisfiedLinkError. Did
> >> you find a solution to your problem?
>
> >> Jim
>
> >> On Apr 22, 8:41 am, "Antonio, Fabio Di Narzo"
> >>  wrote:
> >>> Hi all.
> >>> I'm having problems with usingswig-generated wrappers with Clojure.
> >>> I'm running ubuntu-8.04-i386, gcc-4.2.4,swig-1.3.33, openjdk-1.6.0,
> >>> latest clojure release.
>
> >>> I've cut down a minimal reproducible example.
>
> > (snip)
>
> > Not a direct solution for whatever's going wrong with The Horror That
> > IsSWIG,
>
> Sure, theSWIGC file is unreadable, and very far from an hypothetical
> handwritten C wrapper. However, I would underline that it works
> smoothly in the Java language, and only gives problems with Clojure.
>
> I'm also wondering now if the problem is restricted to my linux
> platform, or is more general (win, mac, different JDKs, etc.).
>
> >but have you guys tried using JNA instead?
>
> I'm working with already existent (SWIG-based) libraries. I'll
> consider JNA for the future. Tnx for the tip.
>
> a.
>
>
>
> > IIRC, the JRuby folks managed to get the entire POSIX library working
> > through JNA, and I think I've seen mention of a similar success with
> > the Win32API.
>
> --
> Antonio, Fabio Di Narzo
> Ph.D. student at
> Department of Statistical Sciences
> University of Bologna, Italy
--~--~-~--~~~---~--~~
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: reasoning/logic programming from Clojure

2009-06-17 Thread Daniel Lyons


On Jun 17, 2009, at 7:39 AM, Sean Devlin wrote:

>
> Sounds awesome!  Will you be able to post any material after the
> talk?  You know, slides, videos, notes, etc?


Sure thing. I'll post my slides and whatever code I wind up writing. I  
don't think anyone will be taping it though (which is probably a  
blessing).

—
Daniel Lyons


--~--~-~--~~~---~--~~
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.contrib.trace enhancement proposal: dotrace

2009-06-17 Thread Stuart Sierra

Hi Michel,
Thanks for working on this!  I'm going away this week, but I'll be
sure to look at this more closely when I get back.  (I wrote the first
c.c.trace, it may have been modified by others since.)
-Stuart Sierra

On Jun 16, 7:13 pm, Michel Salim  wrote:
> I've often felt the need to enable tracing on some particular
> functions, but do not really want to modify their definitions and then
> add a requirement on clojure.contrib.trace. Here's a macro I came up
> with, inspired by the tracing syntax in Chez Scheme:
>
> (defmacro dotrace
>   "Given a sequence of functions to trace, evaluate the given
> expressions
>   in an environment in which the given functions have tracing enabled"
>   [fns & exprs]
>   (if (empty? fns)
>     `(do ~...@exprs)
>     (let [func  (first fns)
>           fns (next fns)]
>       `(let [f# ~func]
>          (binding [~func (fn [& args#] (trace-fn-call '~func f# args#))]
>            (dotrace ~fns ~...@exprs))
>
> I've tested and it appears to work fine (both from REPL -- there was a
> slight hiccup earlier when I was testing; turns out that my
> CLOJURE_EXT directory contains a JAR file from an Enclojure project
> that bundles its own clojure-contrib.jar; and from Slime).
>
> If others find it useful, I'd love for this to be added. Please let me
> know if there are any improvements I could make -- this is my first
> Clojure macro, so I'm sure I'm doing some non-idiomatic things.
>
> Thanks,
>
> --
> Michel S.
> (my contributor agreement should be with Rich already)
--~--~-~--~~~---~--~~
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: No OO restrictions is good. why not still add dependency injection?

2009-06-17 Thread Raoul Duke

Andrew, you have just said what needs to be said about DI that for
some reason it seems like nobody else on earth ever says -- no, they
have to write some giant screed that includes references to Hollywood.
No wonder technology sucks, when the people writing the tutorials
can't even explain things well. Many thanks for your post.

(I did already grok DI, but seriously, the tutorials I've ever seen
have always been insane.)

> Dependecy injection is nothing more than the difference between this:
>
> public class Bosh {
>  private final Dependecy dep = new DependencyImpl();
> }
>
> and this:
>
> public class Bosh {
>  private final Dependecy dep;
>  public Bosh(Dependency dep) { this.dep = dep; }
> }
>
> In both cases Bosh needs a Dependency. It depends on having one. In
> the first  case the actual implementation is hard coded. In the second
> the implementation is provided, or to put it another way, the
> dependency is injected.

--~--~-~--~~~---~--~~
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: Runtime Compilation of Clojure from Android

2009-06-17 Thread George Jahad

Odd, it does work on my rooted G1, (an Android Developer Phone.)

Remco, does it work for you, either on the emulator or the G1?

What you are seeing indicates that run-time compilation isn't working
at all for you.  (Self-evalution of numbers and strings from the repl
don't require compilation, and worked even before I made my changes.)
If you get a chance,  try the current version of the apk, along with
the current instructions from my 2nd post:
http://groups.google.com/group/clojure/msg/0f378ff4a352e151


If that doesn't work, send me your logcat output as well as an "ls -l"
on:
/data/clojure
/data/clojure/classes


> It just stopped, though the activity was still responding (the menu worked, 
> etc).

I don't believe there is a menu in calc app. Which menu are you
referring to?

Also, if you have time, please try it on the emulator and see if it
works for you there.

Thanks much for the beta test.

g


On Jun 17, 5:32 am, Marklar  wrote:
> Very nice, thanks for sharing.
>
> I tried the first version you posted on my rooted G1. It could
> evaluate strings and numbers, but unfortunately when I tried to create
> a function it didn't do anything. It just stopped, though the activity
> was still responding (the menu worked, etc). I looked at logcat but
> couldn't find anything.
>
> I will try to look at again in more detail, if I figure it out I will
> definitely let you know.
>
> On Jun 16, 4:11 pm, George Jahad  wrote:
>
> > On Jun 16, 3:15 am, "Remco van 't Veer"  wrote:
>
> > > Cool!  Please share the code on github or whatever.
>
> > ok, I've forked your clojure tree and added my patches 
> > here:http://github.com/GeorgeJahad/clojure/tree/master
> > The main changes are in Compiler.java, with a few in build.xml and
> > main.clj.
>
> > Note that you'll probably need to set the sdk-location in build.xml
>
> > I've cleaned things up a bit and set out a new prebuilt calc apk 
> > here:http://georgejahad.com/clojure/calc-debug.apk
>
> > (Note: I've only tested these install instructions out on a Linux host
> > with this sdk: android-sdk-linux_x86-1.5_r2.zip)
>
> > To configure the emulator:
> > emulator -avd 
> > adb  install -r    calc-debug.apk
> > adb shell mkdir /data/clojure
> > adb shell mkdir /data/clojure/classes
> > adb shell chmod 777 /data/clojure
> > adb shell chmod 777 /data/clojure/classes
> > adb forward tcp:8032 tcp:8032
>
> > Then start up the calc app from the emulator gui.
>
> > Then access the repl like so:
> > telnet localhost 8032
>
> > Now you can compile from the repl.
>
> > My only change to examples.calc.clj was to add clojure.contrib.server-
> > socket and invoke it like so from the :create routine:
>
> >    (create-repl-server 8032)
> >    (repl)
> > My fork of your calc source is 
> > here:http://github.com/GeorgeJahad/clj-android/blob/7f0497ee1aa155075d9733...
>
>
--~--~-~--~~~---~--~~
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: Runtime Compilation of Clojure from Android

2009-06-17 Thread George Jahad

Odd, it does work on my rooted G1, (an Android Developer Phone.)

Remco, does it work for you, either on the emulator or the G1?

What you are seeing indicates that run-time compilation isn't working
at all for you.  (Self-evalution of numbers and strings from the repl
don't require compilation, and worked even before I made my changes.)
If you get a chance,  try the current version of the apk, along with
the current instructions from my 2nd post:
http://groups.google.com/group/clojure/msg/0f378ff4a352e151


If that doesn't work, send me your logcat output as well as an "ls -l"
on:
/data/clojure
/data/clojure/classes


> It just stopped, though the activity was still responding (the menu worked, 
> etc).

I don't believe there is a menu in calc app. Which menu are you
referring to?

Also, if you have time, please try it on the emulator and see if it
works for you there.

Thanks much for the beta test.

g


On Jun 17, 5:32 am, Marklar  wrote:
> Very nice, thanks for sharing.
>
> I tried the first version you posted on my rooted G1. It could
> evaluate strings and numbers, but unfortunately when I tried to create
> a function it didn't do anything. It just stopped, though the activity
> was still responding (the menu worked, etc). I looked at logcat but
> couldn't find anything.
>
> I will try to look at again in more detail, if I figure it out I will
> definitely let you know.
>
> On Jun 16, 4:11 pm, George Jahad  wrote:
>
> > On Jun 16, 3:15 am, "Remco van 't Veer"  wrote:
>
> > > Cool!  Please share the code on github or whatever.
>
> > ok, I've forked your clojure tree and added my patches 
> > here:http://github.com/GeorgeJahad/clojure/tree/master
> > The main changes are in Compiler.java, with a few in build.xml and
> > main.clj.
>
> > Note that you'll probably need to set the sdk-location in build.xml
>
> > I've cleaned things up a bit and set out a new prebuilt calc apk 
> > here:http://georgejahad.com/clojure/calc-debug.apk
>
> > (Note: I've only tested these install instructions out on a Linux host
> > with this sdk: android-sdk-linux_x86-1.5_r2.zip)
>
> > To configure the emulator:
> > emulator -avd 
> > adb  install -r    calc-debug.apk
> > adb shell mkdir /data/clojure
> > adb shell mkdir /data/clojure/classes
> > adb shell chmod 777 /data/clojure
> > adb shell chmod 777 /data/clojure/classes
> > adb forward tcp:8032 tcp:8032
>
> > Then start up the calc app from the emulator gui.
>
> > Then access the repl like so:
> > telnet localhost 8032
>
> > Now you can compile from the repl.
>
> > My only change to examples.calc.clj was to add clojure.contrib.server-
> > socket and invoke it like so from the :create routine:
>
> >    (create-repl-server 8032)
> >    (repl)
> > My fork of your calc source is 
> > here:http://github.com/GeorgeJahad/clj-android/blob/7f0497ee1aa155075d9733...
>
>
--~--~-~--~~~---~--~~
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: Runtime Compilation of Clojure from Android

2009-06-17 Thread George Jahad

Odd, it does work on my rooted G1, (an Android Developer Phone.)

Remco, does it work for you, either on the emulator or the G1?

What you are seeing indicates that run-time compilation isn't working
at all for you.  (Self-evalution of numbers and strings from the repl
don't require compilation, and worked even before I made my changes.)
If you get a chance,  try the current version of the apk, along with
the current instructions from my 2nd post:
http://groups.google.com/group/clojure/msg/0f378ff4a352e151


If that doesn't work, send me your logcat output as well as an "ls -l"
on:
/data/clojure
/data/clojure/classes


> It just stopped, though the activity was still responding (the menu worked, 
> etc).

I don't believe there is a menu in calc app. Which menu are you
referring to?

Also, if you have time, please try it on the emulator and see if it
works for you there.

Thanks much for the beta test.

g


On Jun 17, 5:32 am, Marklar  wrote:
> Very nice, thanks for sharing.
>
> I tried the first version you posted on my rooted G1. It could
> evaluate strings and numbers, but unfortunately when I tried to create
> a function it didn't do anything. It just stopped, though the activity
> was still responding (the menu worked, etc). I looked at logcat but
> couldn't find anything.
>
> I will try to look at again in more detail, if I figure it out I will
> definitely let you know.
>
> On Jun 16, 4:11 pm, George Jahad  wrote:
>
> > On Jun 16, 3:15 am, "Remco van 't Veer"  wrote:
>
> > > Cool!  Please share the code on github or whatever.
>
> > ok, I've forked your clojure tree and added my patches 
> > here:http://github.com/GeorgeJahad/clojure/tree/master
> > The main changes are in Compiler.java, with a few in build.xml and
> > main.clj.
>
> > Note that you'll probably need to set the sdk-location in build.xml
>
> > I've cleaned things up a bit and set out a new prebuilt calc apk 
> > here:http://georgejahad.com/clojure/calc-debug.apk
>
> > (Note: I've only tested these install instructions out on a Linux host
> > with this sdk: android-sdk-linux_x86-1.5_r2.zip)
>
> > To configure the emulator:
> > emulator -avd 
> > adb  install -r    calc-debug.apk
> > adb shell mkdir /data/clojure
> > adb shell mkdir /data/clojure/classes
> > adb shell chmod 777 /data/clojure
> > adb shell chmod 777 /data/clojure/classes
> > adb forward tcp:8032 tcp:8032
>
> > Then start up the calc app from the emulator gui.
>
> > Then access the repl like so:
> > telnet localhost 8032
>
> > Now you can compile from the repl.
>
> > My only change to examples.calc.clj was to add clojure.contrib.server-
> > socket and invoke it like so from the :create routine:
>
> >    (create-repl-server 8032)
> >    (repl)
> > My fork of your calc source is 
> > here:http://github.com/GeorgeJahad/clj-android/blob/7f0497ee1aa155075d9733...
>
>
--~--~-~--~~~---~--~~
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: accum

2009-06-17 Thread Wrexsoul

On Jun 17, 3:10 am, Mark Derricutt  wrote:
> There's prebuilt SNAPSHOT releases available in Howard's Tapestry repository
> - been using them happily from my maven based clojure app for awhile.
> Thou an official 1.0 stamped release in maven central (along with
> clojure-lang) would be most welcome.

Yes. I'd prefer to avoid dependency on unstable code.
--~--~-~--~~~---~--~~
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: accum

2009-06-17 Thread Wrexsoul

On Jun 17, 2:05 am, Parth  wrote:
> On Jun 17, 10:24 am, Wrexsoul  wrote:
>
> > On Jun 17, 12:44 am, Daniel Lyons  wrote:
>
> > > (use 'clojure.contrib.seq-utils)
>
> > Don't have that library. Still hasn't been released yet, last I
> > checked.
>
> I am not sure if a pre-built clojure-contrib.jar is available.

The downloads section at the site has nothing.

> You could consider building from sources. It should be quite
> straightforward.

"Nothing" as in not even a source zip/tarball, nevermind a precompiled
jar.

> [src]% git clone  git://github.com/richhickey/clojure-contrib.git

Don't have git, or for that matter a unix operating system.


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

2009-06-17 Thread Wrexsoul

On Jun 17, 3:20 am, kkw  wrote:
> I only knew about map, apply, and reduce from studying haskell in uni.
> I've not heard of 'reduce' referred to as 'accum', but then again when
> I wanted to determine the number of elements in a seq, I kept
> searching for 'length' and 'size' but didn't think of 'count', so it
> can be a bit tricky eh?

Guess-the-synonym -- fun for the entire family! But I looked not only
for "accumulate" or similarly but when I didn't see it, for every
single function whose documentation mentioned "seq", figuring that
should cover everything taking a sequence as input.

> I've certainly asked my fair share of noob-
> questions, and folks in this group have been quite happy to oblige me.

Yes; it seems the derision comes when you don't find something and
then instead of asking after it here you actually implement it
yourself. :) This is rather odd -- normally, self-help should be
rewarded in preference to always bugging the forum for assistance, not
punished. Sharing your efforts that might benefit others, likewise.

> clojure.contrib isn't a part of clojure.core (otherwise it'd called
> clojure.core right?), but it I think it's very well-worth downloading
> and compiling.

Only catch -- the downloads section of its web site has no downloads,
binary or source.

> Even though clojure.contrib hasn't been released as 1.0 or anything
> official-sounding, I reckon it still beats the heck out of me
> reinventing the wheel, especially with the calibre of folks who've
> contributed to clojure.contrib. If you don't feel comfortable with the
> offerings in clojure.contrib, that's fine also.

The two concerns I have are:
1. Lack of a source release, at least in a form that you can just
   download from Firefox, unzip with Winzip, and compile with ant.
2. Likelihood of things changing/breaking if I use a pre-1.0 build.

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

2009-06-17 Thread Wrexsoul

On Jun 17, 10:51 am, Mark Volkmann  wrote:
> On Wed, Jun 17, 2009 at 9:41 AM, CuppoJava wrote:
> > Finding the right function in the doc admittedly takes a little
> > practice. I've learned gradually, that Clojure pretty much has all its
> > bases covered though. You just need to find the function. And this
> > forum is filled with very helpful and friendly people, who will tell
> > you the function name, if you describe the behavior you want, and if
> > you ask nicely. "assoc-in" and "update-in" were the two functions that
> > I needed help finding when I started.
>
> This is exactly why I created "Clojure Categorized" 
> athttp://java.ociweb.com/mark/clojure/ClojureCategorized.html. I'd love to see
> this become part of the main Clojure website in which case I would stop
> hosting it. It's not currently complete, but I think it's a good start.
> Feedback welcomed!

Thanks, I'll check it out.
--~--~-~--~~~---~--~~
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: accum

2009-06-17 Thread Cosmin Stejerean
On Wed, Jun 17, 2009 at 12:51 PM, Wrexsoul  wrote:

>
> > Even though clojure.contrib hasn't been released as 1.0 or anything
> > official-sounding, I reckon it still beats the heck out of me
> > reinventing the wheel, especially with the calibre of folks who've
> > contributed to clojure.contrib. If you don't feel comfortable with the
> > offerings in clojure.contrib, that's fine also.
>
> The two concerns I have are:
> 1. Lack of a source release, at least in a form that you can just
>   download from Firefox, unzip with Winzip, and compile with ant.


By the way, there is a Download button on
http://github.com/richhickey/clojure/tree/master and
http://github.com/richhickey/clojure-contrib/tree/master that allows you to
download a snapshot in zip or tgz formats.


-- 
Cosmin Stejerean
http://offbytwo.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: multimethods

2009-06-17 Thread Fogus

> would it be possible for routines to check to see if they are not
> using multimethod-ness, and in that case be performance optimized, yet
> have the syntax for them all be somehow less different?

There is certainly a case for that, but (correct me if I'm wrong), but
one of the underlying philosophies to Clojure is "pay for what you
use".  This goes a long way toward explaining many of the language
design decisions, mms being only one.

On the other hand, it may be cleaner if multimethod-ness could be
garnered from the way a common function form is ... well, formed:

(fun  [] ...) ;; equivalent to defn
(fun [] ...);; lambda
(fun  :on [] ...) ;; equivalent to defmulti with bodies being
the dispatch functions
(fun  :when  [] ...) ;; equivalent to defmulti

This could likely be done using macros.

-m


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

2009-06-17 Thread Kyle Schaffrick

On Wed, 17 Jun 2009 10:51:48 -0700 (PDT),
Wrexsoul  wrote:
> On Jun 17, 3:20 am, kkw  wrote:
>> I only knew about map, apply, and reduce from studying haskell in uni.
>> I've not heard of 'reduce' referred to as 'accum', but then again when
>> I wanted to determine the number of elements in a seq, I kept
>> searching for 'length' and 'size' but didn't think of 'count', so it
>> can be a bit tricky eh?
> 
> Guess-the-synonym -- fun for the entire family! But I looked not only
> for "accumulate" or similarly but when I didn't see it, for every
> single function whose documentation mentioned "seq", figuring that
> should cover everything taking a sequence as input.

For reference, Wikipedia offers "accumulate", "compress", "inject", and
"foldr"/"fold-right" as common synonyms for reduce.  Similarly "collect"
and "transform" for map. Perhaps these words should appear in the
docstrings just for searching purposes?

> 
>> I've certainly asked my fair share of noob-
>> questions, and folks in this group have been quite happy to oblige me.
> 
> Yes; it seems the derision comes when you don't find something and
> then instead of asking after it here you actually implement it
> yourself. :) This is rather odd -- normally, self-help should be
> rewarded in preference to always bugging the forum for assistance, not
> punished. Sharing your efforts that might benefit others, likewise.
> 

As a friendly suggestion, I'd like to offer that perhaps the derision is
caused not by the fact that you had the initiative to implement it
yourself, but rather by such phrasing as:

> I'm shocked that [reduce/accum/foldr] is missing from clojure.core.
> [...] This is one of the most basic, useful functions in functional
> programming.

This seems to assert *as fact* that it is missing, fails to acknowledge
the possibility that (either by accident or by documentation that could
be more comprehensive) you simply overlooked it, and perhaps worst of
all, suggests incompetence on the developers' part for excluding it.

There are many extremely smart people, far smarter than I am, working on
Clojure and participating in this mailing list. When in doubt, I invoke
maximum humility, because I am usually wrong :)

-Kyle


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



Adding source file information to compiler exceptions

2009-06-17 Thread vseguip

Currently Clojure adds source and line information in the cause string
to exceptions thrown when compiling. This makes it difficult  for
slime to highlight this errors as it actually has to parse the cause
message to get the source and file. This regex parsing fails in my
system (I have fixed the regex for my system but nobody else seems to
suffer from this issue). A more robust way would be to attach source
and line fields to the exception thrown by the compiler.I have two
questions

a) Is it ok with me publishing a tiny patch that does this in the list
or is there a preferred way to communicate patches?
b) Does this have any chance of actually being merged?

Cheers,
  V. Seguí
--~--~-~--~~~---~--~~
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: Adding source file information to compiler exceptions

2009-06-17 Thread J. McConnell

On Wed, Jun 17, 2009 at 2:55 PM, vseguip  wrote:
>
> or is there a preferred way to communicate patches?

This is new:

http://clojure.org/patches

- J.

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

2009-06-17 Thread Rich Hickey



On Jun 17, 12:44 am, Daniel Lyons  wrote:
> On Jun 16, 2009, at 10:34 PM, Wrexsoul wrote:
>
>
>
>
>
>
>
> > I'm shocked that this is missing from clojure.core:
>
> > (defn accum [f init coll]
> >  (loop [x init c coll]
> >    (if (empty? c)
> >      x
> >      (recur (f x (first c)) (rest c)
>
> > user=> (accum + 0 [1 2 3])
> > 6
> > user=> (accum + 0 [1 2 3 4 5])
> > 15
>
> > This is one of the most basic, useful functions in functional
> > programming. :)
>
> Indeed! It's called reduce:
>
> http://clojure.org/api#toc476
>
> I'm shocked you haven't noticed it in the API documentation. Being  
> able to read is one of the most basic, useful skills in programming.  
> Especially if you want to be pompous without being an ass.
>

Please refrain from communicating this way on this group. If a post
annoys you please ignore it. It is much more important that we
maintain civility and respectfulness here.

Thanks,

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: accum

2009-06-17 Thread Daniel Lyons


On Jun 17, 2009, at 1:43 PM, Rich Hickey wrote:
> Please refrain from communicating this way on this group. If a post
> annoys you please ignore it. It is much more important that we
> maintain civility and respectfulness here.


My apologies to Wrexsoul. I was out of line. Civility and mutual  
respect are more important.

—
Daniel Lyons


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

2009-06-17 Thread Rich Hickey



On Jun 17, 1:22 am, Wrexsoul  wrote:
> On Jun 17, 12:44 am, Parth  wrote:
>
>
>
>
>
> > On Jun 17, 9:34 am, Wrexsoul  wrote:
> > > I'm shocked that this is missing from clojure.core:
>
> > > (defn accum [f init coll]
> > >   (loop [x init c coll]
> > >     (if (empty? c)
> > >       x
> > >       (recur (f x (first c)) (rest c)
>
> > > user=> (accum + 0 [1 2 3])
> > > 6
> > > user=> (accum + 0 [1 2 3 4 5])
> > > 15
>
> > > This is one of the most basic, useful functions in functional
> > > programming. :)
>
> > > Here's any triangular number:
>
> > > (defn tri [n] (accum + 0 (take n (iterate inc 1
>
> > Maybe "apply" can be used
>
> > user=> (apply + [1 2 3])
> > 6
> > user=> (apply + [1 2 3 4 5])
> > 15
>
> Yes, in the specific case of + it can, or other functions already
> defined to take arbitrary arguments and accumulate them.
>
> > or "reduce"?
> > user=> (reduce + 0 [1 2 3])
> > 6
> > user=> (reduce + 10 [1 2 3])
> > 16
> > user=> (reduce + 0 [1 2 3 4 5])
> > 15
>
> Well that's weird. I SPECIFICALLY did a search of the entire api docs
> to see if there was anything like "accum" already in there. I examined
> every occurrence of "seq" and turned up a blank.
>
> The docs definitely have problems if this can be missed despite a very
> thorough search. The only more-thorough search would have been to
> actually read the docs in their entirety, rather than to search them!

You are off to a bad start here on the group, and I'd advise that you
change your tone significantly.

Are you here to complain? If so, please take it somewhere else. If you
couldn't find something you thought for sure should be there, you
could have gotten an answer in seconds from the helpful people here or
on the IRC. They, and I, want to help each other (and you!) be
productive. What you are doing here is not contributing to that, not
for yourself nor for others. I don't appreciate it, nor do the others
who work on or with Clojure.

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: Clojure goes Git!

2009-06-17 Thread Sudish Joseph

I'll second this.  One large source of confusion when first switching to
git is the seeming obtuseness of the terminology and concepts.  The
model itself is actually quite simple and everything becomes easier once
you get the basic concepts inside git (I think of it as repo = directed
graph of nodes and pointers into the graph & git = graph editor).

John Wiegley's doc does a great job of explaining that model, as he
says, from the bottom up.

-Sudish

Tassilo Horn  writes:
> I just want to add John Wiegley's excellent
>
>   Git from the bottom up [1]
>
> to the list of must-reads for mastering git.
>
> Bye,
> Tassilo
> __
> [1] http://ftp.newartisans.com/pub/git.from.bottom.up.pdf

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



clojuredev on Twitter

2009-06-17 Thread Mark Volkmann

Yikes! I thought I might learn some interesting things by following
clojuredev on Twitter, but the "Ticket created ..." messages are
overwhelming.

-- 
R. Mark Volkmann
Object Computing, Inc.

--~--~-~--~~~---~--~~
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: clojuredev on Twitter

2009-06-17 Thread Rich Hickey

There's a one-time import of issues from Google Code going on right
now. I imagine the issues volume will slow down quite a bit when
that's done. Hang tight, I'm looking for feedback on what should be in
the Twitter stream.

Rich

On Wed, Jun 17, 2009 at 4:46 PM, Mark Volkmann wrote:
>
> Yikes! I thought I might learn some interesting things by following
> clojuredev on Twitter, but the "Ticket created ..." messages are
> overwhelming.
>
> --
> R. Mark Volkmann
> Object Computing, Inc.
>
> >
>

--~--~-~--~~~---~--~~
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: clojuredev on Twitter

2009-06-17 Thread Richard Newman

> Yikes! I thought I might learn some interesting things by following
> clojuredev on Twitter, but the "Ticket created ..." messages are
> overwhelming.

Heh, I've got those plus maybe a hundred ticket emails trickling in  
from Assembla. Seems it's emailing me the entire ticket history of the  
Clojure project. Ouch.

--~--~-~--~~~---~--~~
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: Another Clojure Box

2009-06-17 Thread e
will definitely check it out.  Thanks.

On Tue, Jun 16, 2009 at 8:20 PM, Darmac  wrote:

>
> Hi, I have been experimenting with Clojure last two months and in my
> learning process I used several applications.
> So, I have made a package and want it to share it with everybody that
> want to learn Clojure.
>
> What's wrong with the existing Clojure Box? well... nothing at all;
> but if you are like me and want to avoid the complexity of learning a
> new programming language in a new ide (for me) like emacs you may be
> find this package usefull.
>
> You have a customized version of scite, an application named
> WinCommand to work more confortable with Clojure repl and JSwat to
> debug your code.
>
> Remember that WinCommand is developed using .Net framework (VS 2008)
> but it was developed 4-5 years ago and my programming skills wasn't
> the bests, so if you find something that can be fixed you can suggest
> me.
>
> Give it a try and let me know what do you think about it!
>
> Ahh...jejeje... well.. if you want to download it you can find here:
> http://sites.google.com/site/dariomac/Home/projects
>
> >
>

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

2009-06-17 Thread Wrexsoul

On Jun 17, 2:25 pm, Cosmin Stejerean  wrote:
> On Wed, Jun 17, 2009 at 12:51 PM, Wrexsoul  wrote:
>
> > > Even though clojure.contrib hasn't been released as 1.0 or anything
> > > official-sounding, I reckon it still beats the heck out of me
> > > reinventing the wheel, especially with the calibre of folks who've
> > > contributed to clojure.contrib. If you don't feel comfortable with the
> > > offerings in clojure.contrib, that's fine also.
>
> > The two concerns I have are:
> > 1. Lack of a source release, at least in a form that you can just
> >   download from Firefox, unzip with Winzip, and compile with ant.
>
> By the way, there is a Download button 
> onhttp://github.com/richhickey/clojure/tree/masterandhttp://github.com/richhickey/clojure-contrib/tree/masterthat
>  allows you to
> download a snapshot in zip or tgz formats.

There is? I just saw that the obvious download link went to an empty
list of files and hit "back".

Snapshots are unstable, right? The API might still change out from
under anything that uses 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: accum

2009-06-17 Thread Wrexsoul

On Jun 17, 2:47 pm, Kyle Schaffrick  wrote:
> As a friendly suggestion, I'd like to offer that perhaps the derision is
> caused not by the fact that you had the initiative to implement it
> yourself, but rather by such phrasing as:
>
> > I'm shocked that [reduce/accum/foldr] is missing from clojure.core.
> > [...] This is one of the most basic, useful functions in functional
> > programming.
>
> This seems to assert *as fact* that it is missing

Well *something* was certainly missing, or I would have found it. You
can't reasonably claim I was lax in my search efforts in this
instance.

> perhaps worst of all, suggests incompetence on the developers' part for
> excluding it.

I didn't intend to suggest anything of the sort, only surprise. I have
the feeling that clojure is still slightly incomplete, based on a
number of factors including the way it's discussed here and that
there's no later version than 1.0 apparent yet, so I do expect to find
the odd thing is missing, from the core or from the docs, from time to
time, and I don't take that or intend it to be taken as implying
incompetence on anyone's part, just youth on the part of the entire
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: accum

2009-06-17 Thread Wrexsoul

On Jun 17, 3:52 pm, Daniel Lyons  wrote:
> On Jun 17, 2009, at 1:43 PM, Rich Hickey wrote:
>
> > Please refrain from communicating this way on this group. If a post
> > annoys you please ignore it. It is much more important that we
> > maintain civility and respectfulness here.
>
> My apologies to Wrexsoul. I was out of line. Civility and mutual  
> respect are more important.

Thank you.
--~--~-~--~~~---~--~~
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: Dynamically accessing static fields

2009-06-17 Thread Michael Reid

On Mon, Jun 15, 2009 at 9:13 AM, Parth wrote:
>
>
>
> On Jun 15, 7:08 am, James Koppel  wrote:
>> I am trying to write a function to simplify working with GridBagConstraints
>> -- that is, instead of writing
>>
>> (let [c (GridBagConstraints.)]
>>     (set! (.weightx c) 2.0)
>>     (set! (.gridwidth c) GridBagConstraints/REMAINDER)
>>     (let [button (JButton. "Hello, world!")]
>>       (.setConstraints (.getLayout *my-container*) button c)
>>       (.add *my-container* button)))
>>
>> I could simply write
>>
>> (gridbag-add *my-container*
>>                   (JButton. "Hello, world!")
>>                   "weightx=2.0;gridwith=GridBagConstraints/REMAINDER")
>>
>> A simple combination of regexes and read-string would easily allow me to
>> extract the symbol 'GridBagConstraints/REMAINDER from the example string,
>> but I'm having trouble actually converting it into its value. Using resolve
>> simply returns nil, and getting "." to work dynamically seems to be
>> fruitless, as even this simple call
>>
>> (. (resolve 'GridBagConstraints) REMAINDER)
>>
>> throws an exception.
>>
>> So, the question is, how do I go dynamically from a string like
>> "GridBagConstraints/REMAINDER" to the actual value of the static field?
>>
>> Of course, eval does the trick, but I'd rather not have to resort to it.
>
> One way to do that would be to use a map:
>
> user=> (def m {"Math/PI" Math/PI "Math/E" Math/E})
> #'user/m
> user=> (defn foo [n s] [n (get m s :not-found)])
> #'user/foo
> user=> (foo 10 "Math/PI")
> [10 3.141592653589793]
> user=>
>
> You could also consider writing a function that takes these
> as parameters and returns the updated container. That way
> you can avoid the regex.
>
> Regards,
> Parth
>

Not sure if this can be fit in with what you're trying to do, but you
can accomplish this with a macro:

user=> (defmacro resolve-sym-str [s] (let [[ns sym] (.split s "/")]
(symbol ns sym)))
#'user/resolve-sym-str
user=> (resolve-sym-str "Math/PI")
3.141592653589793
user=>

However, looking at this further, it seems that the first part of what
you have tried works:

user=> (import '(java.awt GridBagConstraints))
nil
user=> (resolve 'GridBagConstraints)
java.awt.GridBagConstraints

Now you can use Java's reflection API to grab the field you want:

user=> (-> (resolve 'GridBagConstraints) (.getDeclaredField
"REMAINDER") (.get nil))
0

So it would appear this is possible without a macro, which probably
makes it easier to use.

/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: accum

2009-06-17 Thread Wrexsoul

On Jun 17, 4:00 pm, Rich Hickey  wrote:
> On Jun 17, 1:22 am, Wrexsoul  wrote:
> > The docs definitely have problems if this can be missed despite a very
> > thorough search. The only more-thorough search would have been to
> > actually read the docs in their entirety, rather than to search them!
>
> You are off to a bad start here on the group

Not through any fault of mine.

> and I'd advise that you change your tone significantly.

What "tone"? I've posted only ASCII. People may have read things into
my posts that I didn't intend, but that is hardly my responsibility.

> Are you here to complain?

I am not.

I have tried, in good faith, to share useful tidbits I've come up with
and to avoid unduly burdening the group with newbie questions. I see
that my efforts are not appreciated by very many people, and may
decide to not bother participating here further because of that. In
which case you can all rejoice, for I shall be out of your collective
hair.

> If you couldn't find something you thought for sure should be there, you
> could have gotten an answer in seconds from the helpful people here or
> on the IRC.

Don't got IRC, and if I can't find something after a pretty thorough
search, but know I can easily implement it myself with just a few
lines of code, why would I trouble the forum for help?

> What you are doing here is not contributing to that

I have tried to contribute, and I have acted always in good faith. If
you cannot see that, then that is not my problem. If you don't want
that, or you feel that my attempts to contribute have for some reason
failed, then, again, there is not much I can do about it. "Try harder"
is not very useful advice for someone who is already trying as hard as
they can.

> I don't appreciate it, nor do the others who work on or with Clojure.

That much is apparent, which is why I will probably take my leave of
this forum very soon. If I'm "not good enough" by your exacting
standards here, then so be 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: accum

2009-06-17 Thread Rich Hickey



On Jun 17, 5:45 pm, Wrexsoul  wrote:
> On Jun 17, 2:47 pm, Kyle Schaffrick  wrote:
>
> > As a friendly suggestion, I'd like to offer that perhaps the derision is
> > caused not by the fact that you had the initiative to implement it
> > yourself, but rather by such phrasing as:
>
> > > I'm shocked that [reduce/accum/foldr] is missing from clojure.core.
> > > [...] This is one of the most basic, useful functions in functional
> > > programming.
>
> > This seems to assert *as fact* that it is missing
>
> Well *something* was certainly missing, or I would have found it. You
> can't reasonably claim I was lax in my search efforts in this
> instance.
>

reduce/foldl is called some variant of either reduce or fold in the
majority of languages in which it appears:

http://en.wikipedia.org/wiki/Fold_(higher-order_function)

Anyone who is going to make claims about it being one of the basics of
functional programming should know that. Certainly it's been called
reduce in Lisp for decades. The only language in which it is called
anything like 'accum' is C++, the least functional of the bunch.

reduce is also mentioned twice in the very short page on sequences:

http://clojure.org/sequences

The only thing that was missing was thoroughness, and a willingness to
ask, on your part.

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



Google Code issues

2009-06-17 Thread Rich Hickey

Chas Emerick and Jarkko Oranen have copied the Google Code issues into
Assembla.

Thanks guys!

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: Google Code issues

2009-06-17 Thread Mark Derricutt
Congrats on the move to github - I'm curious however, why the use of
Assembla for bugtracking/wiki as opposed to github's own flavour?

Mark

-- 

On Thu, Jun 18, 2009 at 10:11 AM, Rich Hickey  wrote:

> Chas Emerick and Jarkko Oranen have copied the Google Code issues into
> Assembla.

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

2009-06-17 Thread Max Suica

Wrexsoul, please mate, these are good guys. Remember the beauty and
tradition of the language you're learning. It's a lisp and gives you
the power to effortlessly create almost any abstraction you can
imagine. Not being convinced of the beauty of this, open you mind a
bit and humble yourself some in order to feel that wonder. Otherwise
you'll just feel you're using a fairly new and immature language that
just doesn't have much traction in the real world yet and hits your
with inconveniences here and there which you wouldn't have to deal
with in other places. But then you miss the feeling of getting to work
with a system that'll create what you imagine, and that's important to
feel whatever you're using. You possibly didn't feel that way in your
other language, even if it had nice enterprise level documentation.
Even if you just want to be more productive, this feeling of freedom
of expression is key. I've personally felt it here and in haskell and
not anywhere else.

Sure clojure is still new and immature. I've felt your feeling of
incompleteness. But guess what, that feeling gives you an excuse. And
excuse to read core code. An excuse to implement things that belong
here and know that you've created something good. Really, a reason to
learn and say "what brand new thing can I do in clojure today?"

Every day.

Rest of you guys, if you ignore prideful people's pride and focus on
the person... well, you find out that they really are people...
eventually... maybe. We'll see. But I have a feeling wrex could really
love how functional this lang is.

peace all,
-max
--~--~-~--~~~---~--~~
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: Dynamically accessing static fields

2009-06-17 Thread James Koppel
Thanks! Seems I forgot java.lang.reflect exists when I wrote that.

On Wed, Jun 17, 2009 at 4:47 PM, Michael Reid  wrote:

>
> On Mon, Jun 15, 2009 at 9:13 AM, Parth wrote:
> >
> >
> >
> > On Jun 15, 7:08 am, James Koppel  wrote:
> >> I am trying to write a function to simplify working with
> GridBagConstraints
> >> -- that is, instead of writing
> >>
> >> (let [c (GridBagConstraints.)]
> >> (set! (.weightx c) 2.0)
> >> (set! (.gridwidth c) GridBagConstraints/REMAINDER)
> >> (let [button (JButton. "Hello, world!")]
> >>   (.setConstraints (.getLayout *my-container*) button c)
> >>   (.add *my-container* button)))
> >>
> >> I could simply write
> >>
> >> (gridbag-add *my-container*
> >>   (JButton. "Hello, world!")
> >>   "weightx=2.0;gridwith=GridBagConstraints/REMAINDER")
> >>
> >> A simple combination of regexes and read-string would easily allow me to
> >> extract the symbol 'GridBagConstraints/REMAINDER from the example
> string,
> >> but I'm having trouble actually converting it into its value. Using
> resolve
> >> simply returns nil, and getting "." to work dynamically seems to be
> >> fruitless, as even this simple call
> >>
> >> (. (resolve 'GridBagConstraints) REMAINDER)
> >>
> >> throws an exception.
> >>
> >> So, the question is, how do I go dynamically from a string like
> >> "GridBagConstraints/REMAINDER" to the actual value of the static field?
> >>
> >> Of course, eval does the trick, but I'd rather not have to resort to it.
> >
> > One way to do that would be to use a map:
> >
> > user=> (def m {"Math/PI" Math/PI "Math/E" Math/E})
> > #'user/m
> > user=> (defn foo [n s] [n (get m s :not-found)])
> > #'user/foo
> > user=> (foo 10 "Math/PI")
> > [10 3.141592653589793]
> > user=>
> >
> > You could also consider writing a function that takes these
> > as parameters and returns the updated container. That way
> > you can avoid the regex.
> >
> > Regards,
> > Parth
> >
>
> Not sure if this can be fit in with what you're trying to do, but you
> can accomplish this with a macro:
>
> user=> (defmacro resolve-sym-str [s] (let [[ns sym] (.split s "/")]
> (symbol ns sym)))
> #'user/resolve-sym-str
> user=> (resolve-sym-str "Math/PI")
> 3.141592653589793
> user=>
>
> However, looking at this further, it seems that the first part of what
> you have tried works:
>
> user=> (import '(java.awt GridBagConstraints))
> nil
> user=> (resolve 'GridBagConstraints)
> java.awt.GridBagConstraints
>
> Now you can use Java's reflection API to grab the field you want:
>
> user=> (-> (resolve 'GridBagConstraints) (.getDeclaredField
> "REMAINDER") (.get nil))
> 0
>
> So it would appear this is possible without a macro, which probably
> makes it easier to use.
>
> /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: Google Code issues

2009-06-17 Thread Richard Newman

> Chas Emerick and Jarkko Oranen have copied the Google Code issues into
> Assembla.

I notice the contrib issues have not yet been moved over.

Will anything screw up if I create issues in Assembla before the move  
has occurred? In other words, should I wait?

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



Apply a function to some values in a map

2009-06-17 Thread Rowdy Rednose

Say I've got this map of keys to integer values:

(def m {:one 0 :two 0 :three 0})

I want to write a function "inc-values-in-map" that takes such a map,
a collection of keys and will increment those keys' values in the map.

In other words, calling

(inc-values-in-map m [:one :three])

should return

{:one 1, :two 0, :three 1}

I've come up with this:

(defn inc-values-in-map
  [map keys]
  (merge-with + map (zipmap keys (repeat 1

Aren't there more elegant ways to implement this function?

--~--~-~--~~~---~--~~
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: Apply a function to some values in a map

2009-06-17 Thread Timothy Pratley

Your version is already succinct, is there something you particularly
don't like about it?

I would probabbly write it like this:
(defn inc-values-in-map
  [map keys]
  (reduce #(assoc %1 %2 (inc (%1 %2 0))) map keys))
Because it caters better with (inc-values-in-map m
[:one :three :one :four])

Or more readably:
(defn assoc-fn
  [f default]
  (fn [m k]
(assoc m k (f (m k default
(defn inc-values-in-map
  [map keys]
  (reduce (assoc-fn inc 0) map keys))

But its longer than yours :)



On Jun 18, 3:21 pm, Rowdy Rednose  wrote:
> Say I've got this map of keys to integer values:
>
> (def m {:one 0 :two 0 :three 0})
>
> I want to write a function "inc-values-in-map" that takes such a map,
> a collection of keys and will increment those keys' values in the map.
>
> In other words, calling
>
> (inc-values-in-map m [:one :three])
>
> should return
>
> {:one 1, :two 0, :three 1}
>
> I've come up with this:
>
> (defn inc-values-in-map
>   [map keys]
>   (merge-with + map (zipmap keys (repeat 1
>
> Aren't there more elegant ways to implement this function?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Clojure in "Computing in Science and Engineering"

2009-06-17 Thread Konrad Hinsen

The July/August issue of the IEEE magazine "Computing in Science and  
Engineering" has an introduction to functional programming for  
scientists that uses Clojure for the examples. It is already  
available (a bit in advance of the paper issue) at IEEE's Computing  
Now portal:

http://www2.computer.org/portal/web/computingnow/0609/whatsnew/cise

I happen to be the author of the article and also a member of the  
editorial board of the magazine, so I have no merit for getting it  
published :-)

BTW, if anyone has an interesting scientific application in Clojure  
(including a mixture of Clojure + Java, for example), and wants to  
write about it, please contact me! Actually, I am interested in  
articles on any interesting technology for scientific computing, it  
doesn't even have to be Clojure.

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: Clojure in "Computing in Science and Engineering"

2009-06-17 Thread Max Suica

On Jun 18, 2:00 am, Konrad Hinsen  wrote:
> The July/August issue of the IEEE magazine "Computing in Science and  
> Engineering" has an introduction to functional programming for  
> scientists that uses Clojure for the examples. It is already  
> available (a bit in advance of the paper issue) at IEEE's Computing  
> Now portal:
>
>        http://www2.computer.org/portal/web/computingnow/0609/whatsnew/cise
>
> I happen to be the author of the article and also a member of the  
> editorial board of the magazine, so I have no merit for getting it  
> published :-)
>
> BTW, if anyone has an interesting scientific application in Clojure  
> (including a mixture of Clojure + Java, for example), and wants to  
> write about it, please contact me! Actually, I am interested in  
> articles on any interesting technology for scientific computing, it  
> doesn't even have to be Clojure.
>
> Konrad.

Awesome! I've been looking to see if any papers would start being
written about/using clojure. Will be exciting to see science done in
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: Apply a function to some values in a map

2009-06-17 Thread Stephen C. Gilardi


On Jun 18, 2009, at 1:21 AM, Rowdy Rednose wrote:


I've come up with this:

(defn inc-values-in-map
 [map keys]
 (merge-with + map (zipmap keys (repeat 1

Aren't there more elegant ways to implement this function?


Here's a shot at generalizing mapping over values in a map:

(ns rednose)

(defn map-vals
  ([f m]
 (reduce conj {}
 (map (fn [[k v]] [k (f v)]) m)))
  ([f m keyseq]
 (conj m (map-vals f (select-keys m keyseq)

(defn main
  []
  (let [a {:one 0 :two 0 :three 0}]
(map-vals inc a [:one :three])))

user=> (run rednose)
{:one 1, :two 0, :three 1}

--Steve



smime.p7s
Description: S/MIME cryptographic signature


Re: clojure.contrib.trace enhancement proposal: dotrace

2009-06-17 Thread Michel Salim

You're welcome -- the changes are in my github fork of Rich's clojure-
contrib repository,

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

I'll send you a pull request, but it appears that you're not on github
just yet.

--
Michel

On Jun 17, 1:13 pm, Stuart Sierra  wrote:
> Hi Michel,
> Thanks for working on this!  I'm going away this week, but I'll be
> sure to look at this more closely when I get back.  (I wrote the first
> c.c.trace, it may have been modified by others since.)
> -Stuart Sierra
>
> On Jun 16, 7:13 pm, Michel Salim  wrote:
>
> > I've often felt the need to enable tracing on some particular
> > functions, but do not really want to modify their definitions and then
> > add a requirement on clojure.contrib.trace. Here's a macro I came up
> > with, inspired by the tracing syntax in Chez Scheme:
>
> > (defmacro dotrace
> >   "Given a sequence of functions to trace, evaluate the given
> > expressions
> >   in an environment in which the given functions have tracing enabled"
> >   [fns & exprs]
> >   (if (empty? fns)
> >     `(do ~...@exprs)
> >     (let [func  (first fns)
> >           fns (next fns)]
> >       `(let [f# ~func]
> >          (binding [~func (fn [& args#] (trace-fn-call '~func f# args#))]
> >            (dotrace ~fns ~...@exprs))
>
> > I've tested and it appears to work fine (both from REPL -- there was a
> > slight hiccup earlier when I was testing; turns out that my
> > CLOJURE_EXT directory contains a JAR file from an Enclojure project
> > that bundles its own clojure-contrib.jar; and from Slime).
>
> > If others find it useful, I'd love for this to be added. Please let me
> > know if there are any improvements I could make -- this is my first
> > Clojure macro, so I'm sure I'm doing some non-idiomatic things.
>
> > Thanks,
>
> > --
> > Michel S.
> > (my contributor agreement should be with Rich already)
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---