Re: New Version of ClojureScript One

2012-01-31 Thread Craig Andera
> This is a problem with the current version of Leiningen. There are a
> couple of ways to work around the problem. Here is one:
>
> Create a new Leiningen project.
>
> lein new delete-me
> cd delete-me
>
> Open project.clj and change
>
> :dependencies [[org.clojure/clojure "1.3.0"]]
>
> to
>
> :dependencies [[org.clojure/clojure "1.2.1"]]
>
> Save this file and then run
>
> lein deps
>
> You can now delete this project. The whole point was to get
> clojure-1.2.1 into your local maven repository. lein should now work
> in ClojureScript One and with any other Clojure 1.3 projects.

I just ran into this myself. I think a slightly more convenient fix is to run

lein install org.clojure/clojure "1.2.1"

In any event, that did it for me. I'll try to get the wiki and website
updated so people can be aware of the workaround.

-- 
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: ClojureScript One - Getting Started with ClojureScript

2012-01-12 Thread Craig Andera
For anyone that wants to hear a bit more about Brenton's thinking
around ClojureScript One, we just published a podcast interview with
him on the Relevance blog. Have a listen if you feel so inclined!

http://thinkrelevance.com/blog/2012/01/12/podcast-episode-003.html

On Thu, Jan 12, 2012 at 2:35 PM, Brenton  wrote:
> We cannot share that information because it was a client project. It
> wasn't really a translation process. We simply attempted to solve the
> same problem with different tools. I do realize that seeing them side-
> by-side would be interesting but we just can't do it.
>
> Issue 22 is not related to this.
>
> On Jan 12, 11:46 am, Daniel Jomphe  wrote:
>> Will we be able to read the account of the experience of translating the
>> app from CoffeeScript to ClojureScript?
>>
>> And/or reading both code bases.
>>
>> Not sure if this account is covered 
>> byhttps://github.com/brentonashworth/one/issues/22
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Creating a Clojure Record from a string

2011-08-23 Thread Craig Andera
> (Class/forName "java.lang.String")

Oh, does that work in 1.3? Because (new (Class/forName "user.Foo"))
was the first thing I tried (under 1.2) and it doesn't work. Perhaps
unsurprisingly given that new is a special form.

-- 
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: Creating a Clojure Record from a string

2011-08-23 Thread Craig Andera
> Given:
>
> test=>(defrecord Foo [A B])
> test=>(class (Foo. 1 2))
> test.Foo
>
> How do I:
>
> test=>(new "test.Foo" 1 2)
> #:test.Foo{:A 1, :B 2}
>
> Currently I get " Unable to resolve classname: test/Foo".

Check out 
http://stackoverflow.com/questions/3748559/clojure-creating-new-instance-from-string-class-name.
Be sure to scroll down to see all the replies, since the macro one is
(IMO) the easiest to understand, although it has limitations.

-- 
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: Generating new exception classes in clojure

2011-08-22 Thread Craig Andera
> How can I catch a proxied Throwable class without catching everything?  I
> suppose I could grab the class and go at it with reflection...

I wrestled with this problem for a while, and got to "you can't do
it". At least, not without AOT compilation of some sort. I did come up
with a horrible, horrible hack that I'm simultaneously happy with and
ashamed of. You can check it out here:
https://github.com/candera/artifact/blob/master/src/artifact/error.clj

Tests are here in case they helps understand how it's supposed to
work: 
https://github.com/candera/artifact/blob/master/test/artifact/test/error_tests.clj

Again, this is a hack. Don't Try It At Home. :)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Miscellaneous noob questions

2010-06-18 Thread Craig Andera
> I'm a little confused over when to use a var vs. a ref vs. an agent
> vs. an atom. For writing small (<200 lines) single-threaded programs
> when do I want to use each one?

In addition to the great answers you got here, you could have a look
at my screencast series on vars, refs, agents, and atoms:

http://link.pluralsight.com/clojure

Ignore the (unfortunate) prominence of the Silverlight player - the
"mobile" button will give you downloads in all sorts of formats.

-- 
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: Leiningen documentation review?

2010-06-17 Thread Craig Andera
> Mostly I'd like feedback on the tutorial:
> http://github.com/technomancy/leiningen/blob/master/TUTORIAL.md

This sentence:

"Libraries for the JVM are packaged up as .jar files, which are
basically just .zip files with a little extra JVM-specific metadata
that contain either .class files (bytecode) or .clj source files."

needs reorganization. It's unclear whether the .class/.clj files are
contained in the .jar or in the metadata. Additionally, it's unclear
in the next sentence:

"These jar files are available through repositories that serve them up
over HTTP alongside their metadata."

whether that's the same metadata or something else.

-

In this sentence:

"In general relying on snapshot dependencies is discouraged, but
sometimes its necessary if you need bug fixes etc. that have not made
their way into a release yet."

s/its/it's/ or better yet (IMO) use "but is sometimes necessary".

-- 
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: Leiningen documentation review?

2010-06-17 Thread Craig Andera
> But if you've got some time to look over the readme, that would be
> great too: http://github.com/technomancy/leiningen/blob/master/README.md

Unnecessary (and ironic! :)) repetition of the word "around" in this sentence:

If you use Ant, you end up copying around a lot of the same tasks
around between XML files on all your projects; there's a lot of
repetition.

-- 
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: ICFP 2009 / ICFP 2010

2010-06-12 Thread Craig Andera
> There's one question that came up when I implemented this. Is there a
> way to get the name of a clojure function, when all I have is the
> function object? Is it stored alongside the function? I didn't see any
> metadata or anything. Would I really have to reverse lookup the name
> in some namespace maps?

Functions don't have to have names:

(fn [] (println "I'm anonymous!"))

If you have a symbol you can get the name, though:

(name '<) => "<"

or

(str '<) => "<"

The former will print only the name. The latter will print the
namespace, too, if the symbol has one.

Does that help?

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: let's all link to the "getting started" pages!

2010-06-02 Thread Craig Andera
Someone wrote an installer [1] that I've used successfully.

[1] http://github.com/paulbatum/clojure-clr/downloads

On Wed, Apr 7, 2010 at 4:37 PM, Sean Devlin  wrote:
> Anyone have instructions for CLR?
>
> On Apr 7, 2:50 pm, Meikel Brandmeyer  wrote:
>> Hi,
>>
>> On Wed, Apr 07, 2010 at 01:53:47PM -0400, Wilson MacGyver wrote:
>> > I noticed there is no section or link on using clojure with gradle. What
>> > can I do to help make that happen?
>>
>> Will add it.
>>
>> Sincerely
>> Meikel
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>
> To unsubscribe, reply using "remove me" as the subject.
>

-- 
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: Function Size

2010-05-30 Thread Craig Andera
You can bind functions inside a let, which can help if you're just
trying to make code less nested. The thread-first and thread-last
macros help here too. But if you're looking for the equivalent of the
"private" keyword (sort of) check out defn-.  Note the dash at the
end.

On Sunday, May 30, 2010, jbs  wrote:
> I'm new to Clojure and have a long background in Java.  After writing
> Clojure code for a month or so now, I find myself struggling with
> function size.  If I have expressions that can be grouped by
> association, then I can re-factor these expression(s) into a
> function.  However, the newly re-factored function is then accessible
> outside the (let []) of the function from which I'll access it.  This
> seems wrong since my new function is only intended to be accessed from
> it's calling function.
>
> In Java, code separation is encouraged to promote cohesion.  Classes
> are intended to be small and single purpose in nature.  The class's
> public method(s) are intended to provide the interface (or api) by
> which the functionality of the class is accessed.  In Java I can
> constrain access to a method by declaring it private making it
> invisible to calling classes.
>
> For Clojure I'd like to be able to specify the function or set of
> functions that expose the api of a namespace without implying that
> every function in the namespace is meant to be accessed directly.
>
> -jbs
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Announcing Clojure/core

2010-05-25 Thread Craig Andera
> I'm happy to announce Clojure/core, a joint endeavor between myself
> and Relevance, Inc.

Congratulations to everyone involved! Very exciting!

-- 
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: Is group-by lazy?

2010-05-25 Thread Craig Andera
> I've noticed that there is group-by in clojure 1.2. However it uses
> reduce and conj.
> Doesn't it consume all sequence at once?

Yes. But then, it would have to:

-
clojure.contrib.seq/group-by
([f coll])
  Returns a sorted map of the elements of coll keyed by the result of
  f on each element. The value at each key will be a vector of the
  corresponding elements, in the order they appeared in coll.

So let's say you did

(group-by first [[1 :a] [2 :a] [3 :a] [2 :b] [1 :b]])

You'd get

{1 [[1 :a] [1 :b]], 2 [[2 :a] [2 :b]], 3 [[3 :a]]}

And there's no way it would know about the second element in the first
entry unless it looked through the whole input collection.

> Here I have lazy version I have written once:
>
> (defn group-by
>        [input]
>          (lazy-seq
>            (when-let [s (seq input)]
>              (let [k (ffirst s) [vs r] (split-with #(-> % first (= k)) s)]
>                  (cons [k  vs] (group-by r))

That doesn't do the same thing as group-by. For one thing, it doesn't
take a function to produce the keys. So you might want to consider
choosing a different name.

-- 
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: code review:replace-first

2010-05-08 Thread Craig Andera
> Hi,there!
>
> I need a function that replaces a first found element of list.
> like that,
>
>>(replace-first :a :b [:c :c :a :c :a]
> [:c :c :b :c :a]
>       ~~
> ;replace first :a to :b

An interesting problem for a Sunday morning when I ought to be
cleaning the house. :) Here are my (admittedly inexpert) attempts.
First, a sort-of-imperative one:

(defn rmap-first [key value coll]
  (let [found (atom false)]
(map (fn [x] (if @found
   x
   (if (= key x)
 (do
   (reset! found true)
   value)
 x)))
 coll)))

But that's sort of yucky. So I also did this one, which I sort of like.

(defn replace-first
  ([key value coll]
 (if coll
   (if (= key (first coll))
 (lazy-cat [value] (next coll))
 (lazy-cat [(first coll)] (replace-first key value (next coll)))

Although I would have liked it better if I didn't have to use a vector
for the first argument of lazy-cat.

Others will have better solutions, I'm sure.

-- 
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: labrepl updated

2010-05-08 Thread Craig Andera
> Changed my mind and fixed this on the Clojure side [1]. Now you should be
> able to bind *err* to any old Writer you like.
>
> Stu
>
> [1]
> http://github.com/richhickey/clojure/tree/c4eb5719b0f30ea4c113e6e98a1c171c43a01abe

Just checked this out. Working fine now. Thanks!

I'll let you know if I find anything else as I go through the labs.

-- 
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: labrepl updated

2010-05-06 Thread Craig Andera
So if someone produces a fork of incanter that doesn't have the
warning (or David fixes up Incanter), then the problem goes away?
Because the other place I see the warnings coming out of is swank
itself.

On Thu, May 6, 2010 at 9:33 AM, Stuart Halloway
 wrote:
> This is another variant of the "Swank likes StringWriters, everybody else
> likes PrintWriters" problem, see e.g. [1]
>
> I would love to see somebody fix this, and I think it is simpler (and
> probably conceptually correct) to make swank use a PrintWriter, instead of
> requiring all possible tools to do a check for swank's sake. See [2]
>
> Until this is fixed, swank is busted for any app that produces a
> last-var-wins warning.
>
> [1] https://www.assembla.com/spaces/clojure-contrib/tickets/55
> [2]
> http://groups.google.com/group/clojure-dev/browse_thread/thread/369734ff42cbb06a/adbeb8d031a990d2?lnk=gst&q=printwriter#adbeb8d031a990d2
>
>> Update: Using the latest labrepl commit (fa89411ae "use private
>> compojure snapshot"), I'm now able to pull in incanter and use it
>> (albeit with tons of warnings about group-by and flatten from both
>> incanter and swank)...but only if I use script/repl via inferior-lisp.
>> I still can't get swank to work. It fails with the same error as
>> before [1].
>>
>> But at least I'm unblocked.
>>
>> [1]
>> swank.util.io.proxy$java.io.StringWriter$0 cannot be cast to
>> java.io.PrintWriter
>>  [Thrown class java.lang.ClassCastException]
>>
>> Restarts:
>> 0: [ABORT] Return to SLIME's top level.
>>
>> Backtrace:
>>  0: clojure.lang.Namespace.warnOnReplace(Namespace.java:85)
>>  1: clojure.lang.Namespace.reference(Namespace.java:106)
>>  2: clojure.lang.Namespace.refer(Namespace.java:164)
>>  3: clojure.core$refer__4606.doInvoke(core.clj:3175)
>>  4: clojure.lang.RestFn.invoke(RestFn.java:411)
>>  5: clojure.lang.AFn.applyToHelper(AFn.java:163)
>>  6: clojure.lang.RestFn.applyTo(RestFn.java:133)
>>  7: clojure.core$apply__3769.invoke(core.clj:537)
>>  8: clojure.core$load_lib__5243.doInvoke(core.clj:4693)
>>  9: clojure.lang.RestFn.applyTo(RestFn.java:143)
>> 10: clojure.core$apply__3769.invoke(core.clj:537)
>> 11: clojure.core$load_libs__5259.doInvoke(core.clj:4712)
>> 12: clojure.lang.RestFn.applyTo(RestFn.java:138)
>> 13: clojure.core$apply__3769.invoke(core.clj:539)
>> 14: clojure.core$use__5283.doInvoke(core.clj:4792)
>> 15: clojure.lang.RestFn.invoke(RestFn.java:409)
>> 16: user$eval__9709.invoke(NO_SOURCE_FILE:1)
>> 17: clojure.lang.Compiler.eval(Compiler.java:5344)
>> 18: clojure.lang.Compiler.eval(Compiler.java:5312)
>> 19: clojure.core$eval__4343.invoke(core.clj:2362)
>> 20: swank.commands.basic$eval_region__677.invoke(basic.clj:40)
>> 21: swank.commands.basic$eval_region__677.invoke(basic.clj:31)
>> 22: swank.commands.basic$eval__690$listener_eval__691.invoke(basic.clj:54)
>> 23: clojure.lang.Var.invoke(Var.java:365)
>> 24: user$eval__9707.invoke(Unknown Source)
>> 25: clojure.lang.Compiler.eval(Compiler.java:5344)
>> 26: clojure.lang.Compiler.eval(Compiler.java:5312)
>> 27: clojure.core$eval__4343.invoke(core.clj:2362)
>> 28: swank.core$eval_in_emacs_package__324.invoke(core.clj:59)
>> 29: swank.core$eval_for_emacs__387.invoke(core.clj:128)
>> 30: clojure.lang.Var.invoke(Var.java:373)
>> 31: clojure.lang.AFn.applyToHelper(AFn.java:169)
>> 32: clojure.lang.Var.applyTo(Var.java:482)
>> 33: clojure.core$apply__3769.invoke(core.clj:535)
>> 34: swank.core$eval_from_control__326.invoke(core.clj:66)
>> 35: swank.core$eval_loop__328.invoke(core.clj:71)
>> 36: swank.core$spawn_repl_thread__438$fn__468$fn__469.invoke(core.clj:183)
>> 37: clojure.lang.AFn.applyToHelper(AFn.java:159)
>> 38: clojure.lang.AFn.applyTo(AFn.java:151)
>> 39: clojure.core$apply__3769.invoke(core.clj:535)
>> 40: swank.core$spawn_repl_thread__438$fn__468.doInvoke(core.clj:180)
>> 41: clojure.lang.RestFn.invoke(RestFn.java:398)
>> 42: clojure.lang.AFn.run(AFn.java:24)
>> 43: java.lang.Thread.run(Thread.java:636)
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

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

Re: labrepl updated

2010-05-06 Thread Craig Andera
Update: Using the latest labrepl commit (fa89411ae "use private
compojure snapshot"), I'm now able to pull in incanter and use it
(albeit with tons of warnings about group-by and flatten from both
incanter and swank)...but only if I use script/repl via inferior-lisp.
I still can't get swank to work. It fails with the same error as
before [1].

But at least I'm unblocked.

[1]
swank.util.io.proxy$java.io.StringWriter$0 cannot be cast to java.io.PrintWriter
  [Thrown class java.lang.ClassCastException]

Restarts:
 0: [ABORT] Return to SLIME's top level.

Backtrace:
  0: clojure.lang.Namespace.warnOnReplace(Namespace.java:85)
  1: clojure.lang.Namespace.reference(Namespace.java:106)
  2: clojure.lang.Namespace.refer(Namespace.java:164)
  3: clojure.core$refer__4606.doInvoke(core.clj:3175)
  4: clojure.lang.RestFn.invoke(RestFn.java:411)
  5: clojure.lang.AFn.applyToHelper(AFn.java:163)
  6: clojure.lang.RestFn.applyTo(RestFn.java:133)
  7: clojure.core$apply__3769.invoke(core.clj:537)
  8: clojure.core$load_lib__5243.doInvoke(core.clj:4693)
  9: clojure.lang.RestFn.applyTo(RestFn.java:143)
 10: clojure.core$apply__3769.invoke(core.clj:537)
 11: clojure.core$load_libs__5259.doInvoke(core.clj:4712)
 12: clojure.lang.RestFn.applyTo(RestFn.java:138)
 13: clojure.core$apply__3769.invoke(core.clj:539)
 14: clojure.core$use__5283.doInvoke(core.clj:4792)
 15: clojure.lang.RestFn.invoke(RestFn.java:409)
 16: user$eval__9709.invoke(NO_SOURCE_FILE:1)
 17: clojure.lang.Compiler.eval(Compiler.java:5344)
 18: clojure.lang.Compiler.eval(Compiler.java:5312)
 19: clojure.core$eval__4343.invoke(core.clj:2362)
 20: swank.commands.basic$eval_region__677.invoke(basic.clj:40)
 21: swank.commands.basic$eval_region__677.invoke(basic.clj:31)
 22: swank.commands.basic$eval__690$listener_eval__691.invoke(basic.clj:54)
 23: clojure.lang.Var.invoke(Var.java:365)
 24: user$eval__9707.invoke(Unknown Source)
 25: clojure.lang.Compiler.eval(Compiler.java:5344)
 26: clojure.lang.Compiler.eval(Compiler.java:5312)
 27: clojure.core$eval__4343.invoke(core.clj:2362)
 28: swank.core$eval_in_emacs_package__324.invoke(core.clj:59)
 29: swank.core$eval_for_emacs__387.invoke(core.clj:128)
 30: clojure.lang.Var.invoke(Var.java:373)
 31: clojure.lang.AFn.applyToHelper(AFn.java:169)
 32: clojure.lang.Var.applyTo(Var.java:482)
 33: clojure.core$apply__3769.invoke(core.clj:535)
 34: swank.core$eval_from_control__326.invoke(core.clj:66)
 35: swank.core$eval_loop__328.invoke(core.clj:71)
 36: swank.core$spawn_repl_thread__438$fn__468$fn__469.invoke(core.clj:183)
 37: clojure.lang.AFn.applyToHelper(AFn.java:159)
 38: clojure.lang.AFn.applyTo(AFn.java:151)
 39: clojure.core$apply__3769.invoke(core.clj:535)
 40: swank.core$spawn_repl_thread__438$fn__468.doInvoke(core.clj:180)
 41: clojure.lang.RestFn.invoke(RestFn.java:398)
 42: clojure.lang.AFn.run(AFn.java:24)
 43: java.lang.Thread.run(Thread.java:636)

-- 
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: labrepl updated

2010-05-05 Thread Craig Andera
> I have updated the labrepl [1] to use the latest clojure 1.2 and contrib 1.2
> snapshots. Also, most of the dependencies are now frozen to specific
> snapshot timestamps (the project.clj file may be of interest to people living
> on the development edge).
>
> After a "lein clean;  lein deps" everything should work, please let me know
> if you see otherwise.

I'm seeing otherwise. I'm up to commit 70702523e25937bc8386 (back on
the edge, thanks to last-var-in wins), and I'm just running
script/swank from the command line (Ubuntu 9.10), but I'm having all
sorts of problems when I try to pull in incanter for the its-all-data
labs.

If I just run script/repl and try to use incanter.charts, I get this
[1]. If I run script/swank from the CL and connect via slime-connect
in emacs and do the use from the SLIME REPL, I instead get this [2] in
an SLDB buffer.

[1]
cand...@faerie:~/labrepl$ script/repl
Clojure 1.2.0-master-SNAPSHOT
2010-05-05 08:21:04.602::INFO:  Logging to STDERR via org.mortbay.log.StdErrLog
solutions.mini_browser.proxy$javax.servlet.http.HttpServlet$0
2010-05-05 08:21:04.622::INFO:  jetty-6.1.21
2010-05-05 08:21:09.464::INFO:  Started socketconnec...@0.0.0.0:9000
labrepl.proxy$javax.servlet.http.HttpServlet$0
2010-05-05 08:21:09.464::INFO:  jetty-6.1.21
2010-05-05 08:21:09.466::INFO:  Started socketconnec...@0.0.0.0:8080
Welcome to the labrepl. Browse to localhost:8080 to get started!
user=> (use 'incanter.charts)
WARNING: group-by already refers to: #'clojure.core/group-by in
namespace: incanter.core, being replaced by: #'incanter.core/group-by
WARNING: group-by already refers to: #'clojure.core/group-by in
namespace: incanter.charts, being replaced by:
#'incanter.core/group-by
java.lang.IllegalAccessError: flatten is not public (probability.clj:1)
user=>

[2]


  [Thrown class java.lang.ClassCastException]

Restarts:
 0: [ABORT] Return to SLIME's top level.

Backtrace:
  0: clojure.lang.Namespace.warnOnReplace(Namespace.java:85)
  1: clojure.lang.Namespace.intern(Namespace.java:75)
  2: clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:410)
  3: clojure.lang.Compiler.analyzeSeq(Compiler.java:5290)
  4: clojure.lang.Compiler.analyze(Compiler.java:5111)
  5: clojure.lang.Compiler.analyze(Compiler.java:5072)
  6: clojure.lang.Compiler.eval(Compiler.java:5348)
  7: clojure.lang.Compiler.load(Compiler.java:5777)
  8: clojure.lang.RT.loadResourceScript(RT.java:328)
  9: clojure.lang.RT.loadResourceScript(RT.java:319)
 10: clojure.lang.RT.load(RT.java:397)
 11: clojure.lang.RT.load(RT.java:369)
 12: clojure.core$load__5287$fn__5294.invoke(core.clj:4817)
 13: clojure.core$load__5287.doInvoke(core.clj:4816)
 14: clojure.lang.RestFn.invoke(RestFn.java:409)
 15: clojure.core$load_one__5228.invoke(core.clj:4641)
 16: clojure.core$load_lib__5243.doInvoke(core.clj:4678)
 17: clojure.lang.RestFn.applyTo(RestFn.java:143)
 18: clojure.core$apply__3769.invoke(core.clj:537)
 19: clojure.core$load_libs__5259.doInvoke(core.clj:4712)
 20: clojure.lang.RestFn.applyTo(RestFn.java:138)
 21: clojure.core$apply__3769.invoke(core.clj:539)
 22: clojure.core$use__5283.doInvoke(core.clj:4792)
 23: clojure.lang.RestFn.invoke(RestFn.java:422)
 24: 
incanter.charts$eval__5823$loading__5176__auto5824.invoke(charts.clj:19)
 25: incanter.charts$eval__5823.invoke(charts.clj:19)
 26: clojure.lang.Compiler.eval(Compiler.java:5344)
 27: clojure.lang.Compiler.eval(Compiler.java:5336)
 28: clojure.lang.Compiler.load(Compiler.java:5777)
 29: clojure.lang.RT.loadResourceScript(RT.java:328)
 30: clojure.lang.RT.loadResourceScript(RT.java:319)
 31: clojure.lang.RT.load(RT.java:397)
 32: clojure.lang.RT.load(RT.java:369)
 33: clojure.core$load__5287$fn__5294.invoke(core.clj:4817)
 34: clojure.core$load__5287.doInvoke(core.clj:4816)
 35: clojure.lang.RestFn.invoke(RestFn.java:409)
 36: clojure.core$load_one__5228.invoke(core.clj:4641)
 37: clojure.core$load_lib__5243.doInvoke(core.clj:4678)
 38: clojure.lang.RestFn.applyTo(RestFn.java:143)
 39: clojure.core$apply__3769.invoke(core.clj:537)
 40: clojure.core$load_libs__5259.doInvoke(core.clj:4712)
 41: clojure.lang.RestFn.applyTo(RestFn.java:138)
 42: clojure.core$apply__3769.invoke(core.clj:539)
 43: clojure.core$use__5283.doInvoke(core.clj:4792)
 44: clojure.lang.RestFn.invoke(RestFn.java:409)
 45: user$eval__5819.invoke(NO_SOURCE_FILE:1)
 46: clojure.lang.Compiler.eval(Compiler.java:5344)
 47: clojure.lang.Compiler.eval(Compiler.java:5312)
 48: clojure.core$eval__4343.invoke(core.clj:2362)
 49: swank.commands.basic$eval_region__677.invoke(basic.clj:40)
 50: swank.commands.basic$eval_region__677.invoke(basic.clj:31)
 51: swank.commands.basic$eval__690$listener_eval__691.invoke(basic.clj:54)
 52: clojure.lang.Var.invoke(Var.java:365)
 53: user$eval__5817.invoke(Unknown Source)
 54: clojure.lang.Compiler.eval(Compiler.java:5344)
 55: clojure.lang.Compiler.eval(Compiler.java:5312)
 56: clojure.core$eval__4343.invoke(core.clj:2362)
 57: swank.core$eval_in_emacs_package__324.invoke(cor

Re: Clojure Concurrency Screencast Available

2010-04-20 Thread Craig Andera
> > I enjoyed you presentations, but I have a bit of a tangent question.
> > I'm still new to slime, so it's not a comfortable environment for me
> > yet.  What I am wondering is how exactly, when operating with the
> > split code and repl buffers, you are getting code buffer expressions
> > to evaluate in the repl?  Is this a customization, or am I missing
> > something basic?
>
> This is pretty basic. There are commands for sending various bits of
> code from the code buffer to REPL. They are a standard part of slime,
> not clojure-specific. Most useful to me are C-M-x, which ships the def
> around the point to the repl, and C-c C-r, which evaluates the active
> region. Others can be found with C-h M in the code buffer, which
> brings up the documentation for the buffer mode.

Yep: that's good advice, although I can't say I find much in emacs to
be "basic", even after using it casually for 20 years :). The one I
tended to use in the tutorial (in case someone saw it flash by in the
minibuffer) is C-x C-e, which I have bound to lisp-eval-last-sexp, and
that is a custom binding. Something from Scheme-based muscle memory a
million years ago.

In addition to checking out C-h m (which is a great way to learn
keystrokes in emacs), you can also use the menu bar. If it's not
enabled, just do M-x menu-bar-mode, and you should see the menu bar
appear with a SLIME menu item. Pop it down and you'll see all sorts of
goodness with the keybindings listed as well.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure Concurrency Screencast Available

2010-04-16 Thread Craig Andera
One final update: all six parts are now available, including the "mobile"
downloads for offline viewing. http://link.pluralsight.com/clojure

On Tue, Apr 13, 2010 at 9:40 AM, Craig Andera wrote:

> Glad you've enjoyed them!
>
> 2010/4/13 Pelayo Ramón 
>
> I have seen the first 2, and as a clojure noobie I have to say that
>> they are great. Thanks a lot.
>>
>> On Tue, Apr 13, 2010 at 3:10 PM, Craig Andera 
>> wrote:
>> > If you mean "downloading and viewing on my computers and mobile
>> devices",
>> > then sure. There's no DRM. There's not even any registration required.
>> But
>> > if by "copying" you mean "distributing to other people", then no. If you
>> > have some other scenario in mind, contact me off-list and I'll hook you
>> up
>> > with the right people for that conversation.
>> >
>> > On Tue, Apr 13, 2010 at 4:30 AM, Hasan Hasan 
>> wrote:
>> >>
>> >> Hi,
>> >>
>> >> Is downloading and copying the videos free?
>> >>
>> >> On Tue, Apr 13, 2010 at 1:10 AM, Craig Andera 
>> >> wrote:
>> >>>
>> >>> That's typing-speed-mode. I wrote it. :) Available here [1]. You'll
>> >>> probably also want this [2] in your .emacs.
>> >>>
>> >>> [1]
>> http://www.pluralsight-training.net/community/blogs/craig/archive/2008/10/07/typing-speed-mode-emacs-minor-mode.aspx
>> >>> [2]
>> >>> (load "/path/to//typing-speed.el")
>> >>> (add-hook 'text-mode-hook 'turn-on-typing-speed-mode)
>> >>> On Mon, Apr 12, 2010 at 10:52 AM, Baishampayan Ghose
>> >>>  wrote:
>> >>>>
>> >>>> Craig Andera wrote:
>> >>>>>
>> >>>>> I've recorded a screencast on Clojure concurrency primitives. It's
>> >>>>> available at http://link.pluralsight.com/clojure. Thought some here
>> might
>> >>>>> find it useful. It's in six parts, the first four of which are up
>> now. The
>> >>>>> last two will be up by the middle of next week. Feedback welcome!
>> >>>>
>> >>>> Nice work! By the way, which Emacs mode do you have installed which
>> >>>> shows the WPM count?
>> >>>>
>> >>>> Regards,
>> >>>> BG
>> >>>>
>> >>>> --
>> >>>> Baishampayan Ghose 
>> >>>> oCricket.com
>> >>>>
>> >>>> --
>> >>>> You received this message because you are subscribed to the Google
>> >>>> Groups "Clojure" group.
>> >>>> To post to this group, send email to clojure@googlegroups.com
>> >>>> Note that posts from new members are moderated - please be patient
>> with
>> >>>> your first post.
>> >>>> To unsubscribe from this group, send email to
>> >>>> clojure+unsubscr...@googlegroups.com
>> >>>> For more options, visit this group at
>> >>>> http://groups.google.com/group/clojure?hl=en
>> >>>>
>> >>>> To unsubscribe, reply using "remove me" as the subject.
>> >>>
>> >>> --
>> >>> You received this message because you are subscribed to the Google
>> >>> Groups "Clojure" group.
>> >>> To post to this group, send email to clojure@googlegroups.com
>> >>> Note that posts from new members are moderated - please be patient
>> with
>> >>> your first post.
>> >>> To unsubscribe from this group, send email to
>> >>> clojure+unsubscr...@googlegroups.com
>> >>> For more options, visit this group at
>> >>> http://groups.google.com/group/clojure?hl=en
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> >> Groups "Clojure" group.
>> >> To post to this group, send email to clojure@googlegroups.com
>> >> Note that posts from new members are moderated - please be patient with
>> >> your first post.
>> >> To unsubscribe from this group, send email to
>> >> clojure+unsubscr...@googlegroups.com
>> >> For more options, visit this group at
>> >> http://groups.google.com/group/clojure?hl=en
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Clojure" group.
>> > To post to this group, send email to clojure@googlegroups.com
>> > Note that posts from new members are moderated - please be patient with
>> your
>> > first post.
>> > To unsubscribe from this group, send email to
>> > clojure+unsubscr...@googlegroups.com
>> > For more options, visit this group at
>> > http://groups.google.com/group/clojure?hl=en
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>>
>
>

-- 
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 Concurrency Screencast Available

2010-04-13 Thread Craig Andera
Glad you've enjoyed them!

2010/4/13 Pelayo Ramón 

> I have seen the first 2, and as a clojure noobie I have to say that
> they are great. Thanks a lot.
>
> On Tue, Apr 13, 2010 at 3:10 PM, Craig Andera 
> wrote:
> > If you mean "downloading and viewing on my computers and mobile devices",
> > then sure. There's no DRM. There's not even any registration required.
> But
> > if by "copying" you mean "distributing to other people", then no. If you
> > have some other scenario in mind, contact me off-list and I'll hook you
> up
> > with the right people for that conversation.
> >
> > On Tue, Apr 13, 2010 at 4:30 AM, Hasan Hasan 
> wrote:
> >>
> >> Hi,
> >>
> >> Is downloading and copying the videos free?
> >>
> >> On Tue, Apr 13, 2010 at 1:10 AM, Craig Andera 
> >> wrote:
> >>>
> >>> That's typing-speed-mode. I wrote it. :) Available here [1]. You'll
> >>> probably also want this [2] in your .emacs.
> >>>
> >>> [1]
> http://www.pluralsight-training.net/community/blogs/craig/archive/2008/10/07/typing-speed-mode-emacs-minor-mode.aspx
> >>> [2]
> >>> (load "/path/to//typing-speed.el")
> >>> (add-hook 'text-mode-hook 'turn-on-typing-speed-mode)
> >>> On Mon, Apr 12, 2010 at 10:52 AM, Baishampayan Ghose
> >>>  wrote:
> >>>>
> >>>> Craig Andera wrote:
> >>>>>
> >>>>> I've recorded a screencast on Clojure concurrency primitives. It's
> >>>>> available at http://link.pluralsight.com/clojure. Thought some here
> might
> >>>>> find it useful. It's in six parts, the first four of which are up
> now. The
> >>>>> last two will be up by the middle of next week. Feedback welcome!
> >>>>
> >>>> Nice work! By the way, which Emacs mode do you have installed which
> >>>> shows the WPM count?
> >>>>
> >>>> Regards,
> >>>> BG
> >>>>
> >>>> --
> >>>> Baishampayan Ghose 
> >>>> oCricket.com
> >>>>
> >>>> --
> >>>> You received this message because you are subscribed to the Google
> >>>> Groups "Clojure" group.
> >>>> To post to this group, send email to clojure@googlegroups.com
> >>>> Note that posts from new members are moderated - please be patient
> with
> >>>> your first post.
> >>>> To unsubscribe from this group, send email to
> >>>> clojure+unsubscr...@googlegroups.com
> >>>> For more options, visit this group at
> >>>> http://groups.google.com/group/clojure?hl=en
> >>>>
> >>>> To unsubscribe, reply using "remove me" as the subject.
> >>>
> >>> --
> >>> You received this message because you are subscribed to the Google
> >>> Groups "Clojure" group.
> >>> To post to this group, send email to clojure@googlegroups.com
> >>> Note that posts from new members are moderated - please be patient with
> >>> your first post.
> >>> To unsubscribe from this group, send email to
> >>> clojure+unsubscr...@googlegroups.com
> >>> For more options, visit this group at
> >>> http://groups.google.com/group/clojure?hl=en
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> >> Groups "Clojure" group.
> >> To post to this group, send email to clojure@googlegroups.com
> >> Note that posts from new members are moderated - please be patient with
> >> your first post.
> >> To unsubscribe from this group, send email to
> >> clojure+unsubscr...@googlegroups.com
> >> For more options, visit this group at
> >> http://groups.google.com/group/clojure?hl=en
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Clojure" group.
> > To post to this group, send email to clojure@googlegroups.com
> > Note that posts from new members are moderated - please be patient with
> your
> > first post.
> > To unsubscribe from this group, send email to
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 Concurrency Screencast Available

2010-04-13 Thread Craig Andera
If you mean "downloading and viewing on my computers and mobile devices",
then sure. There's no DRM. There's not even any registration required. But
if by "copying" you mean "distributing to other people", then no. If you
have some other scenario in mind, contact me off-list and I'll hook you up
with the right people for that conversation.

On Tue, Apr 13, 2010 at 4:30 AM, Hasan Hasan  wrote:

> Hi,
>
> Is downloading and copying the videos free?
>
>
> On Tue, Apr 13, 2010 at 1:10 AM, Craig Andera wrote:
>
>> That's typing-speed-mode. I wrote it. :) Available here [1]. You'll
>> probably also want this [2] in your .emacs.
>>
>> [1]
>> http://www.pluralsight-training.net/community/blogs/craig/archive/2008/10/07/typing-speed-mode-emacs-minor-mode.aspx
>>
>>
>> <http://www.pluralsight-training.net/community/blogs/craig/archive/2008/10/07/typing-speed-mode-emacs-minor-mode.aspx>
>> [2]
>> (load "/path/to//typing-speed.el")
>> (add-hook 'text-mode-hook 'turn-on-typing-speed-mode)
>>
>> On Mon, Apr 12, 2010 at 10:52 AM, Baishampayan Ghose <
>> b.gh...@ocricket.com> wrote:
>>
>>> Craig Andera wrote:
>>>
>>>> I've recorded a screencast on Clojure concurrency primitives. It's
>>>> available at http://link.pluralsight.com/clojure. Thought some here
>>>> might find it useful. It's in six parts, the first four of which are up 
>>>> now.
>>>> The last two will be up by the middle of next week. Feedback welcome!
>>>>
>>>
>>> Nice work! By the way, which Emacs mode do you have installed which shows
>>> the WPM count?
>>>
>>> Regards,
>>> BG
>>>
>>> --
>>> Baishampayan Ghose 
>>> oCricket.com
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clojure@googlegroups.com
>>> Note that posts from new members are moderated - please be patient with
>>> your first post.
>>> To unsubscribe from this group, send email to
>>> clojure+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>>
>>> To unsubscribe, reply using "remove me" as the subject.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 Concurrency Screencast Available

2010-04-12 Thread Craig Andera
That's typing-speed-mode. I wrote it. :) Available here [1]. You'll probably
also want this [2] in your .emacs.

[1]
http://www.pluralsight-training.net/community/blogs/craig/archive/2008/10/07/typing-speed-mode-emacs-minor-mode.aspx

<http://www.pluralsight-training.net/community/blogs/craig/archive/2008/10/07/typing-speed-mode-emacs-minor-mode.aspx>
[2]
(load "/path/to//typing-speed.el")
(add-hook 'text-mode-hook 'turn-on-typing-speed-mode)

On Mon, Apr 12, 2010 at 10:52 AM, Baishampayan Ghose
wrote:

> Craig Andera wrote:
>
>> I've recorded a screencast on Clojure concurrency primitives. It's
>> available at http://link.pluralsight.com/clojure. Thought some here might
>> find it useful. It's in six parts, the first four of which are up now. The
>> last two will be up by the middle of next week. Feedback welcome!
>>
>
> Nice work! By the way, which Emacs mode do you have installed which shows
> the WPM count?
>
> Regards,
> BG
>
> --
> Baishampayan Ghose 
> oCricket.com
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>
> To unsubscribe, reply using "remove me" as the subject.
>

-- 
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 Concurrency Screencast Available

2010-04-10 Thread Craig Andera
Mobile downloads are available now. Sorry about the delay. The refs module
is also up, so that's five of six. Part six by mid next week.

On Sat, Apr 10, 2010 at 9:26 AM, Craig Andera wrote:

> Right, good point: I should have seen that coming given the target
> audience. :)
>
> Within a few hours, a "mobile download" link will appear with wmvs and mp4s
> in a variety of resolutions so you can watch these offline on the device of
> your choosing. The conversion lags the rest of the process a little bit, but
> I'm told the upload is in progress now.
>
> Hope that helps.
>
>
> On Fri, Apr 9, 2010 at 7:22 PM, Jeff Heon  wrote:
>
>> I must say I appreciate video sharing sites like blip.tv and Vimeo
>> that allows one to download and watch their videos offline.
>> Very practical for those commuting and using portable devices 8)
>>
>> --
>> 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
>>
>> To unsubscribe, reply using "remove me" as the subject.
>>
>
>

-- 
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 Concurrency Screencast Available

2010-04-10 Thread Craig Andera
Right, good point: I should have seen that coming given the target audience.
:)

Within a few hours, a "mobile download" link will appear with wmvs and mp4s
in a variety of resolutions so you can watch these offline on the device of
your choosing. The conversion lags the rest of the process a little bit, but
I'm told the upload is in progress now.

Hope that helps.

On Fri, Apr 9, 2010 at 7:22 PM, Jeff Heon  wrote:

> I must say I appreciate video sharing sites like blip.tv and Vimeo
> that allows one to download and watch their videos offline.
> Very practical for those commuting and using portable devices 8)
>
> --
> 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
>
> To unsubscribe, reply using "remove me" as the subject.
>

-- 
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 Concurrency Screencast Available

2010-04-09 Thread Craig Andera
I've recorded a screencast on Clojure concurrency primitives. It's available
at http://link.pluralsight.com/clojure. Thought some here might find it
useful. It's in six parts, the first four of which are up now. The last two
will be up by the middle of next week. Feedback welcome!

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

To unsubscribe, reply using "remove me" as the subject.


Re: filter1 interesting?

2009-03-14 Thread Craig Andera

What about overloading first to accept a predicate?

(first even? (iterate inc 1)) => 2

On Sat, Mar 14, 2009 at 8:58 AM, e  wrote:
>
>>
>> Christophe Grand suggest (seek ...), which I personally like.
>>
> IMHO
> seek is pretty good for a number of reasons: short, implies first result.
> Minor objection would be that folks may not think it's what they want
> because of how it's used in C where they'd expect it to take a number of
> bytes and a block. (filter-one ...) or (find-first ...) are both ok to me
> ... and preferable to (first (filter ...)) the latter being an idiom you
> have to discover on your own.  Another very minor problem with the idiom is
> that the docs say that filter returns a lazy sequence, but it doesn't say
> that the order has to be the same as how the original sequence would be
> consumed.  Having an actual function makes the concept of "first" concrete.
> It unties it from filter having to be the implementation.
>
> yeah (seek ...) is pretty good.
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Clojure documentation for offline use?

2009-02-18 Thread Craig Andera

If you're just looking for the API documentation, then you could use
this file [1]. If you're looking for the rest of the stuff on the
site, then I'm not sure.

[1] http://clojure.googlegroups.com/web/clj-libs%20(3).html

On Wed, Feb 18, 2009 at 11:18 AM, Oliver  wrote:
>
> Hi,
>
> I'm wondering if there's any way of getting hold of the Clojure
> documentation for usage offline? There's no download link online and
> it doesn't appear in SVN. I attempted to scrape the site but it ended
> in failure, and there probably should be a better way than having to
> rely on scraping.
>
> Many thanks,
> Oliver
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Clojure on CLR/DLR

2009-02-17 Thread Craig Andera

> As far as I understood, the rules are that it should be derived from Clojure 
> and sports either an N or a CLR. So I suggest Conjure
>
> It looks like clojure, sounds pleasing, and sounds lispish (conj). And Lisp 
> to me sounds like magic (in the Arthur C. Clarke meaning that it is a 
> technology sufficiently advanced that it is indistinguishable from it).

Ooh - that's much better than mine. :)

+1!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
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 on CLR/DLR

2009-02-17 Thread Craig Andera

> I'm up for suggestions on the name.  The obvious ones:
>
>  - Clojure.net
>  - ClojureCLR
>  - IronClojure (paralleling IronPython/IronRuby, unless MS has Iron
> trademarked.)
>  - CLjR  (too cute)
>
> Perhaps Rich will have a preference.  He'll have to live with it
> longer than anyone and has branding/confusion issues to keep in mind.

So, as a long-time .NET guy, IronClojure seems like the best name, in
terms of making it obvious what it does: it's like IronRuby/Python,
but it's Clojure. Failing that, it seems like NClojure fits the
pattern of other JVM-ported efforts. I realize that there's already an
Enclojure.

Just to throw more chaff into the air:

* CoCLR: Clojure on the CLR. (Maybe pronounced cochlear?)
* Coc: Same as above.
* CoNET: Clojure on .NET.
* Icon: An Implementation of Clojure on .NET.
* Ichor: I can't think of an acronym here, but I want 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
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: A Clojure documentation browser

2009-02-16 Thread Craig Andera

> I think a problem with the current layout is that once you jump to one
> of the library sections you have to manually scroll back up to the
> index.  There are a few different ways this could be solved.
>
> a) You could just add a "top" link to each library section banner.
>
> b) Only show the currently selected library, and hide the rest.
>
> c) Same as above, but also change the library navigation to a tree
> view.
>
>  -> clojure.contrib.duck-streams
> -) *default-encoding*
> -) file
> -) pwd


I usually just hit "home", but I'm a keyboard kind of guy, and I
realize that not everyone is.

> I did a quick implementation of B, and I think it makes the page feel
> less cluttered (but I still feel it could be better).  However, I did
> add jQuery as a dependency.  I'm not sure how 'light' you were trying
> to keep this, but jQuery could simplify your JS.  Here is a diff:

I don't have a problem with jQuery per se, but I was really going for
something that would all live in one file, so that you can browse it
when disconnected, so that it's easy to copy around without having to
grab extra files, etc. etc. You'll notice there are no graphics, for
the same reason. Although I've considered using SVG to get around
that.

> Do with my idea as you wish.  I just wanted to to throw it out there.

Appreciate the feedback. My current plan is to leave it as is. Not
because I don't think your ideas have merit, but because this thing
started out as something I was poking around with for half an
hour...and then I spent a week working on it. So I'm sort of at the
point where the quality ascended to the point where it met the
decreasing trajectory of my interest. :)

> I also think the code would be cleaner with the JS and CSS in their
> own files, but I admit having everything in-lined makes it easy to
> call.

I would generally prefer things that way as well, but again I really
wanted to have the file be self-contained.

> Oh, almost forgot--if you do happen to try out my patch you will
> notice all the links from 'miglayout.internal' on will not behave
> correctly.  If you look at the DOM with Firebug you'll notice that the
> 'miglayout' DIV is not being closed and is capturing the others.  I
> didn't have a chance to track down the problem, but you might want to
> take a look.

Hmm. OK - that I'll have to check out. I have noticed that the
docstring elision gets a little confused when there are quotes or
backslashes in the docs. I haven't yet figured out if that's an issue
with my code or prxml. This could be related.

Thanks for the feedback!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: A Clojure documentation browser

2009-02-14 Thread Craig Andera

> clojure-contrib/build.xml is where the change I talked about would go. If
> you're up for giving it a try, that'd be great. I plan to look at it this
> weekend unless someone beats me to it.

If I did give it a shot, it likely wouldn't be until late next week,
so knock yourself 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
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: A Clojure documentation browser

2009-02-14 Thread Craig Andera

> Github is fine. Once I see your name on clojure.org/contributing, I'll
> commit this to clojure.contrib. For changes going forward, once you're happy
> with some update on github, just let me know and I'll pull it into contrib.
> For bug reporting, I recommend you add a section to the comments at the top
> of the file letting folks know how you'd like to be contacted for that. If I
> see a question or issue raised and it looks like you're not aware, I'll also
> give you a heads up.

OK, sounds good. My email address is already in the file, so we should
be all set.

> I just did a run and I like the new output!

Glad to hear it. :)

We talked about getting doc generation to be part of the build, which
I think is a fine idea. Whose task is that?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: A Clojure documentation browser

2009-02-13 Thread Craig Andera

> Please consider whether or not you'd like to send in a Contributor Agreement
> to enable that. If you hurry you could become the first registered Clojure
> contributor whose last name begins with A. :-) (clojure.org/contributing)

OK, I've added the things I want to add, and sent in the agreement,
which will probably make it to Rich next week. The code is on github
[1] - if you want it somewhere else, let me know. I assume someone
other than me will be committing it to Subversion, but if I'm wrong
let me know.

One other question: I don't monitor this list very closely at the
moment, so what's the mechanism for me to hear about bugs?

[1] http://github.com/candera/doc-browse/blob/master/gen_html_docs.clj

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: A Clojure documentation browser

2009-02-12 Thread Craig Andera

> Nice work!

Thanks.

> Two things related to 'strcat'.
>
> 1) This is already implemented as clojure.core/str (and is more
> efficient than concat'ing)
> 2) This function is never called :)

Yeah, that code was cut and pasted from some older work I did. It was
removed when I started using prxml.

> I have some idea's related to the presentation, but I don't have time
> to iterate them right now.

Well, pass them on whenever you get a minute. I've recently made some
updates that are live on github [1] that may have addressed what you
have in mind. Specifically, I've added the ability to collapse/expand
an individual namespace or all namespaces. I've uploaded an updated
example to the files section of this group [2].

There are two more things I want to do, which probably won't be
complete until next week:

* See if I can strip the docstring from the displayed source code,
since it's redundant.
* Move the code into clojure.contrib, probably under the namespace
clojure.contrib.gen-html-docs.

Later, I may also have a look at making the symbols in the source code
hyperlinks to the relevant place in the docs.

[1] http://github.com/candera/doc-browse/blob/master/core.clj
[2] http://clojure.googlegroups.com/web/clj-libs.html

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: A Clojure documentation browser

2009-02-11 Thread Craig Andera

As I mentioned previously, I'm going to see if I can get time this
week to set it up to go through clojure.contrib.prxml. If I don't run
into any issues, that will remove the dependency on the javax stuff
I'm importing. It will have the additional benefit of cutting the code
in half. I'll update here when I know more.

On Wed, Feb 11, 2009 at 8:04 AM, Konrad Hinsen
 wrote:
>
> On Feb 11, 2009, at 13:07, Christian Vest Hansen wrote:
>
>>> I suppose I need to add javax.xml to my classpath, but where do I get
>>> it from? I searched a bit and it looks like this is in the standard
>>> Java distribution, but in which jar file?
>>
>> It was added in Java 6. Could you perchance be running Java 5?
>
> Yes. Given that I run MacOS 10.4 on a PowerPC machine, that's the
> latest Java I can get.
>
> Is there any chance I could take a jar file from Java 6 and use it
> with my Java 5 installation?
>
> 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
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: A Clojure documentation browser

2009-02-11 Thread Craig Andera

> I like it a lot. I think it would be very cool if such an HTML file covering
> clojure-rooted and clojure-contrib-rooted namespaces were to become an
> output of building clojure-contrib.

I like that idea a lot.

> Please consider whether or not you'd like to send in a Contributor Agreement
> to enable that. If you hurry you could become the first registered Clojure
> contributor whose last name begins with A. :-) (clojure.org/contributing)

I'd be happy to add this to clojure-contrib. I'll send in the
Contributor Agreement sometime soon. There are a couple of tweaks I
want to make first, like seeing if I can switch from my homegrown HTML
output routines to clojure.contrib.pr-xml...which I found out about
via the docs I generated: exactly why I wrote this thing :). I also
need to add collapse/expand functionality to the namespaces. I hope to
complete that today.

Long term, I'd love it if the source code could be displayed so that
symbols become hyperlinks to the place in the generated HTML where
they are documented (if public). But that takes it well beyond the
80/20 scenario for my use case, so I'm not sure I'll get to 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
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: A Clojure documentation browser

2009-02-10 Thread Craig Andera

> When I was writing it,
> it sure seemed like I was missing a call to resolve somewhere, but
> when it worked for some symbols, I got a) excited, and b) confused. :)

Yep, that was basically it: I was calling get-source on the symbol
that named the member, but I wasn't bothering to namespace-qualify it
first. With that fixed, the source appears for pretty much
everything...which is awesome. I've posted an updated version of the
output here [1]. The updated code is on github [2].

BTW, I'll mention that if we went back to the namespace/folder
arrangement the way it was before (i.e. com.wangdera.doc-browse lives
in com/wangdera/doc-browse/doc-browse.clj), it would make for a lot
more logical folder structure when using GIT. That alone would make it
worth it to me.

[1] http://groups.google.com/group/clojure/web/clj-libs.html
[2] http://github.com/candera/doc-browse/tree/master

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: A Clojure documentation browser

2009-02-10 Thread Craig Andera

> I see that "show source" links are missing on your page for some
> functions -- does this indicate a failure of repl-utils/get-source?

I think so. But I'm willing to believe that the error is elsewhere.
It's just hard for me to see where it could be.

> These seem to work fine for me:
>
> user=> (use 'clojure.contrib.duck-streams)
> nil
>
> user=> (source writer)
>
> user=> (source slurp*)

Yep, those both work from the REPL for me as well. Which is why I'm
confused as to only writer appearing to work when I run it from within
my generator function.

This is probably due to my sadly lacking understanding of
symbols/vars/use/require/refer/etc. I'm loading the supplied list of
libraries via mapping require across a list of symbols ([1], line
317), and I know that differs from the use statement at the REPL, but
the fact that it works partially leads me puzzled. I would expect it
not to work at all. Perhaps it's only working for the things that have
been pulled in by some other library I'm using? When I was writing it,
it sure seemed like I was missing a call to resolve somewhere, but
when it worked for some symbols, I got a) excited, and b) confused. :)

[1] 
http://github.com/candera/doc-browse/blob/e093968731760f268b31dd88b65954a5e7a1c0ba/core.clj

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



A Clojure documentation browser

2009-02-10 Thread Craig Andera

One of the challenges with learning any new platform is learning the
libraries. As a way to improve both that an my knowledge of Clojure
itself, I whipped together doc-browse, a Clojure library that will
spit out an HTML page that contains documentation for a set of Clojure
libs. You can see an example of the output here [1]. The code is here
[2].

I have several purposes in sending this email:

1) To let people know about this in case they find it useful as well.
2) To get some eyes on the code - I know it surely sucks in several
ways, and this group is always good about pointing out things that
could be done better or more idiomatically.
3) To ask specifically why clojure.contrib.repl-utils.get-source fails
so often. I can't figure out why so many of the members fail to
display the source, when some of the others do, sometimes even in the
same namespace.
4) To ask if there's anything else people would particularly like to
see added/changed. On my list are to make each namespace collapsible
in the same way the source is.

[1] http://groups.google.com/group/clojure/web/clj-libs.html
[2] http://github.com/candera/doc-browse/tree/master

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Multimethod Reflection Question

2009-02-06 Thread Craig Andera

> (methods multifn)
>
> Returns a hash-map where the keys are vectors if the dispatch values of the
> multimethods were vectors, weird and cool :)
> How does one check for the existence of a key in a hash-map if the key is
> vector? I tried several things and nothing obvious seemed to work.

Vectors are values that compare like scalars do:

({[1 2 3] :numbers [\a \b \c] :letters} [1 2 3]) => :numbers
({[1 2 3] :numbers [\a \b \c] :letters} [3 4 5]) => nil

Which is both surprising (to a newbie like me) and extremely logical
in retrospect. :)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Clojure's code has moved to Google Code

2008-12-18 Thread Craig Andera

Does it makes sense to subscribe this group to those? I.e. to have
commit messages appear here. I've done it both ways on my own
projects, and I'm of split mind about it.

On Wed, Dec 17, 2008 at 9:33 AM, Rich Hickey  wrote:
>
>
>
> On Dec 17, 8:22 am, Rich Hickey  wrote:
>> I've moved Clojure's source repo to Google Code:
>>
>> http://code.google.com/p/clojure/
>>
>> as well as Clojure contrib:
>>
>> http://code.google.com/p/clojure-contrib/
>>
>> All new checkins will occur there.
>>
>
> There's also a read-only list/feed that will broadcast commit messages
> from both clojure and clojure-contrib:
>
> http://groups.google.com/group/clojure-commits
>
> 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
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: randomize a collection?

2008-12-01 Thread Craig Andera

Not sure if there's a built-in one, but I had a lot of fun coming up
with this one:

(defn shuffle [coll]
   (map second (sort (map (fn [x] [(rand) x]) coll

Now I'm looking forward to hearing how I could have done it
better...the real fun on this list, since Clojure has so many ways to
amaze!

On Mon, Dec 1, 2008 at 11:28 PM, Brian Doyle <[EMAIL PROTECTED]> wrote:
> Is there a function that takes a collection and randomizes, or shuffles, the
> items?
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: slime+clojure problem

2008-12-01 Thread Craig Andera

You should double-check: I had the same problem, and it was related to
not having an up-to-date implementation of Clojure. Be aware that you
probably need to run "ant clean jar" on the Clojure sources after
getting them from SVN.

On Mon, Dec 1, 2008 at 1:05 PM, Peter Eddy <[EMAIL PROTECTED]> wrote:
>
> On Dec 1, 1:00 pm, Craig McDaniel <[EMAIL PROTECTED]> wrote:
>> Make sure you're using the latest versions of clojure (SVN version,
>> not dated release), and swank-clojure as well.
>
> Thanks. Everything is current, I just sync'd everything to be sure but
> same problem.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: categorizing functions

2008-11-25 Thread Craig Andera

This is a reasonable idea, and I would find it useful as well.
However, it might be easier (and more appropriate) to make tagging a
feature of the documentation website that has come up here.

On Tue, Nov 25, 2008 at 11:38 AM, Mark Volkmann
<[EMAIL PROTECTED]> wrote:
>
> Sometimes it can be time consuming for someone new to Clojure, like
> myself, to find an existing function that does what they need. I think
> this would be easier if the standard functions were grouped in some
> meaningful way. For example, all these functions retrieve items from a
> sequence: first, second, rest, take, leave. I'm sure I omitted many.
>
> Could function metadata be used to help with this? What if functions
> had a piece of metadata named "categories". Each function could be in
> any number of categories. There could be function similar to find-doc
> that finds all the functions in a given category. The hardest part
> might be coming up with good category names.
>
> --
> 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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: one way to write a factorial function

2008-11-23 Thread Craig Andera

Clever!

Help me understand why this isn't written

(defn factorial [n]
  (apply * (range 1 (+ n 1)))

instead. That is, I don't get the purpose of the for statement.

On Sun, Nov 23, 2008 at 4:08 PM, prhlava <[EMAIL PROTECTED]> wrote:
>
>
> Hello folks,
>
> While learning, it occured to me that factorial function can be
> written as:
>
>
> (defn factorial [n]
> (apply * (for [x (range 1 (+ n 1))] x)))
>
>
> I know that it has big argument list for large numbers, but it seems
> to scale nicely (at least in clojure).
>
> I am sure this was discussed to death in lisp groups - have searched
> the net and did not find this version...
>
> kind regards,
>
> Vlad
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Clojure HTML Documentation

2008-11-21 Thread Craig Andera

Very nice! As it turns out, I've been heavily involved in writing the
documentation infrastructure that MSDN uses for the last few years, so
I have some sympathy for this problem space. :)

A few things I'd like to see:

* I'd like to see the URL for the page change when navigating to a new
topic. Right now it's pretty hard to bookmark a page or email a URL to
some particular piece of documentation since the URL is always
index.html.
* I want to be able to click on a namespace and see all the symbols
for just that namespace. Would make it easy to explore the libraries
by functional area.
* I'd like to be able to get back to the home page from any other
page, or go up to the namespace page.
* Maybe the namespace page could have snippets of the doc next to the
names. Perhaps the first 30 characters of the doc string or something
simple like that.
* If this supported annotations, that would be fantastic, but
obviously that's a whole 'nother level.

On Fri, Nov 21, 2008 at 3:17 AM, Mark McGranaghan <[EMAIL PROTECTED]> wrote:
>
> I've created some experimental HTML docs for Clojure. You can see them
> on S3:
> http://clj-doc.s3.amazonaws.com/tmp/doc-1116/index.html
>
> Or, just for kicks, on Amazon's new Cloud Front CDN:
> http://d2nbqsesuabw8o.cloudfront.net/tmp/doc-1116/index.html
>
> You can see the code I used to generate them on GitHub:
> http://github.com/mmcgrana/clj-doc
>
> The generation code is open for public perusal but will require some
> tweaking for public use (e.g. I still have paths hard coded). Any help
> along these lines would be greatly appreciated.
>
> Most methods in the clj-doc source have docstrings and in total its
> only a couple hundred lines of code: you should be able to find your
> way around if you're interested. The best entry point is bin/gen.clj.
> Again, any comments or suggests would be appreciated.
>
> I hope that some of you find this interesting/useful/helpful in your
> Clojure endeavors,
> - Mark
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: mutability

2008-11-20 Thread Craig Andera

I must be missing something. Even if you have to make every
modification inside a dosync using the syntax that you originally
provided, why not write a function that captures that and be done with
it? Or, if you have to, a macro? That is, it seems like the complaint
is "too much repeated code", but Clojure actually gives you *more*
tools for removing redundancy than most languages...

Maybe I'm missing something, though.

On Thu, Nov 20, 2008 at 10:42 PM, islon <[EMAIL PROTECTED]> wrote:
>
> I gave up, the resulting code would be a lot more complex than the
> scala version.
> But thanks for your advices.
>
> If anyone wants to port it I can send the source code, it's ~1000
> lines total.
>
> Islon
>
> On Nov 20, 11:38 pm, harrison clarke <[EMAIL PROTECTED]> wrote:
>> i was thinking that each stat would be an agent.
>> whatever boats your float, i guess. i'm probably not the person to go
>> to about idiomatic code. :V
>>
>> user> (let [player {:str (agent 5)
>>   :dex (agent 5)}
>>   str (:str player)
>>   dex (:dex player)]
>>   (println @str @dex)
>>   (send str + 1)
>>   (send dex * 2)
>>   (println @str @dex)
>>   (await str dex)
>>   (println @str @dex))
>> 5 5
>> 5 5
>> 6 10
>> nil
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: POLL: Domain name for project hosting site.

2008-11-17 Thread Craig Andera

Despite the fact that I suggested clojury and openjure in the first
place, I think I like clojr, forj, projecture, and clojects, in that
order.

Decisive - that's me!

> On Mon, Nov 17, 2008 at 3:08 PM, J. McConnell <[EMAIL PROTECTED]> wrote:
>>
>> I'm liking projecture
>>
>> On Mon, Nov 17, 2008 at 2:52 PM, Drew Crampsie <[EMAIL PROTECTED]> wrote:
>>>
>>> Hey All,
>>>
>>> I've finally found some time to start getting the project hosting site
>>> together, and i need a name.. so lets put it to a vote.
>>>
>>> Here are some suggestions so far, but please feel free to chime in
>>> with your own as well.
>>>
>>>  - projecture
>>>  - clojr
>>>  - proj4cloj
>>>  - clojforge, cloforj,
>>>  - forj
>>> - clojects
>>> - clojury
>>> - openjure
>>>
>>> Thanks for the help Clojurians!
>>>
>>> Cheers,
>>>
>>> drewc
>>>
>>>
>>> >
>>>
>>
>> >>
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Filter repeats

2008-11-16 Thread Craig Andera

One way I could think of to do this would be to build a map with each
unique item as a key and the count as its value. Then it would be
trivial to pull out the keys with the count as a specified value. I
started writing this, but my SLIME is royally screwed up right now
after the upgrade to Clojure HEAD. Sorry. Anyway, it shouldn't require
any refs - probably just a loop/recur.

Or maybe someone has a far more clever idea. :)

> On Sun, Nov 16, 2008 at 12:02 PM, npt11tpn <[EMAIL PROTECTED]> wrote:
>
>
> Hi guys,
> This is my first post to the group, but have been following the
> discussions for almost a year. Many thanks to Rich Hickey for creating
> a fantastic future-proof language which is a pleasure to use and to
> the great community!
> The following function (as part of a chemistry-related application)
> filters the elements of a sequence that a repeated a specified number
> of times. Wondering if the function could be simplified and written
> without the reference (newseq).
> Thanks a lot!
> Nik
>
> (defn filter-repeats [seq n]
>  "Returns a vector of the elements of a sequence that are repeated n
> times"
>  (let [newseq (ref [])]
>(doseq [u (set seq)]
>  (when (= (count (filter #(= % u) seq)) n)
>(dosync (commute newseq conj u
>@newseq))
>
> Usage e.g.
> (filter-repeats '(2 3 1 4 2 2 4 3 5 ) 2)
> [3 4]
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Newbie: Optional parameters without multiple definitions

2008-11-15 Thread Craig Andera

If you're cool with passing a map instead of plain parameters, you
could use destructuring to do this:

(defn test1 [{x :x, y :y, :or {:y 3}}]
[x y])

(test1 {:x 2}) => [2 3]

Another thing you could do would be to use variable arity and handle
the absence of the other parameters in the method body.

(defn test2 [x & y]
  (let [y (or (first y) 23)]
[x y]))

If you wanted something more like CL, you could use a hash-map and merge

(defn test3 [& p]
  (let [m (merge {:y 42} (hash-map p))
 x (:x m)
 y (:y m)]
 [x y]))

(Although for some reason that is blowing up in my repl at the moment.
Hopefully the idea is clear enough.)

If you find yourself doing this a lot, it seems like this is one place
where macros could help you out, although I've not written enough Lisp
for real to know if this is one of those places where something
simpler will suffice.

On Sat, Nov 15, 2008 at 11:59 AM, samppi <[EMAIL PROTECTED]> wrote:
>
> Is there a more concise way of expressing an optional parameter with a
> default other than writing another entire definition?
>
> That is, instead of:
>  (defn a-function ; two parameters, x and y, and y is 23 by default
>([x] (a-function x 23)
>([x y] ...))
>
> ...is it possible to do something like:
>  (defn a-function [x [y :default 3]
>...)
>
> I'm fine with the first way, but I'm just wondering if there's another
> way.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Newbie question: Sequences from a function

2008-11-15 Thread Craig Andera

One way to lazily produce f(n) over an infinite number of integers is
using map to apply your function to an infinite (lazy) series of
integers:

(map (fn [x] (* x 3)) (iterate inc 0))
=> (0 3 6 9 ...)

Although you'd be wise to use take when evaluating this in the REPL.

If you want to instead produce f(x) f(f(x)) f(f(f(x))) ... then check
out iterate.

On Sat, Nov 15, 2008 at 11:15 AM, samppi <[EMAIL PROTECTED]> wrote:
>
> Is there a way to make a lazy sequence whose sequential values are
> derived from some function? I'm thinking about two ways:
>
>(recursive-fn-seq f initial [n]) ; returns (initial (f initial) (f
> (f initial)) ...) n or infinity times
>(index-fn-seq f initial [n]); returns ((f i) (f (inc i)) (f (inc
> (inc i))) ...) to i = n or infinity
>
> I couldn't find either in the docs. Are either of these included in
> Clojure, and if not, is there a way to create them?
>
> Thanks for your answers?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: length of a list

2008-11-15 Thread Craig Andera

Unless I'm missing something:

(count '("CCC" "COC" "C(=O)C"))
=> 3

Or better yet:

(count ["CCC" "COC" "C(=O)C"])
=> 3

On Fri, Nov 14, 2008 at 11:46 PM, Rajarshi <[EMAIL PROTECTED]> wrote:
>
> Hi, I've been learning Lisp using SBCL, but my complaint has been it
> was difficult for me to link it to stuff I use (such as cheminforatics
> libs). So I'm very happy to have found Clojure.
>
> However, I've been stumped trying to find out how to get the number of
> elements in a list. Currently I'm using
>
> (def smiles '("CCC", "COC", "C(=O)C"))
> (reduce (fn [x y] (+ x y)) (for [x smiles] 1))
>
> Is there a simpler way to do this?
>
> Thanks,
> Rajarshi
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Concerned about Clojure's license choice.

2008-11-05 Thread Craig Andera

> I don't renounce ownership rights at all, not even for intellectual
> property. I just think "free" software licenses are useless at best
> and counterproductive at worst when applied to projects that are
> supposed to be free.

Free software needs a license if it's going to be adopted by
organizations with lawyers. That's true independent of their inherent
utility (or lack thereof).

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Debugging with JSwat

2008-10-29 Thread Craig Andera

As a follow-on to this, it turns out that debugging works *only* when
I pull the files in via require; neither slime-load-file nor
slime-eval-buffer nor load-file result in breakpoints getting hit.

On Fri, Oct 24, 2008 at 1:27 PM, Craig Andera <[EMAIL PROTECTED]> wrote:
>>> It's very likely/nearly certain I'm still doing something wrong - I
>>> appreciate the help.
>
> Indeed it was me: everything started working as soon as I made sure my
> .clj files were in CLASSPATH the way require describes they should be.
> I'm sure it doesn't help that I'm a Java n00b in addition to being a
> Clojure neophyte.
>
> As a bonus, require works now, too. Lesson learned: putting your files
> anywhere else is asking for trouble.
>
> Thanks, Bill - it's always inspiring when someone else makes an effort
> - keeps me from ignoring the problem for too long! (Been a fan of your
> blog for quite a while now, BTW.) Hat tip to Allen as well.
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Debugging with JSwat

2008-10-24 Thread Craig Andera

>> It's very likely/nearly certain I'm still doing something wrong - I
>> appreciate the help.

Indeed it was me: everything started working as soon as I made sure my
.clj files were in CLASSPATH the way require describes they should be.
I'm sure it doesn't help that I'm a Java n00b in addition to being a
Clojure neophyte.

As a bonus, require works now, too. Lesson learned: putting your files
anywhere else is asking for trouble.

Thanks, Bill - it's always inspiring when someone else makes an effort
- keeps me from ignoring the problem for too long! (Been a fan of your
blog for quite a while now, BTW.) Hat tip to Allen as well.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Debugging with JSwat

2008-10-24 Thread Craig Andera

> No, that's not enough. You didn't specify the port that you want to
> connect to JSwat on. add "address=" (or something similar) to this
> to specify which port you want to use. In my blog example, I'm using
> "":
> -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=

> Port "50525" is the port that SLIME/SWANK is using to establish the
> communications between your running Clojure instance and the emacs
> lisp code. You can't use this same port for JSwat.

Actually, there are two port-related messages in *inferior-lisp*: one
talks about the port that SLIME is using to talk to SWANK, and I used
the other one. So it appears that a port is chosen for you if you
don't specify one. And as I said, I'm able to attach JSwat and set
(and, more importantly, trigger) breakpoints in boot.clj. So I don't
think anything was wrong with how I was connecting JSwat.

That said, I went head and did as you suggested (it's a PITA to look
up the port every time as I had been doing), but still no luck.

> If you do the above, it should work for you.

If only that were true. :)

It's very likely/nearly certain I'm still doing something wrong - I
appreciate the help.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Debugging with JSwat

2008-10-24 Thread Craig Andera

> Are you doing all of the following:
>
> 1. Specify the appropriate debug options when you start Clojure (see
> step #4 in my blog post)

Yep. Here's the full command line:

c:\WINDOWS\system32\java.exe -Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n -cp
"C:/bin/clojure/clojure/svn/clojure.jar;c:/data/.clojure/*"
clojure.lang.Repl

> 2. Load the Clojure source file you want to debug (you can't debug
> definitions created in the repl)

Did so from the SLIME REPL via (load-file "/path/to/my/source.clj")

> 3. Start JSwat and use the "Session/Attach..." menu option to attach
> to the correct host/port (in my case, "localhost" and "" since I'm
> debugging a local Java instance and I specified port "" when I
> started Java)

Yep. Localhost and 50525 for me this time (got port from the message
spewed into *inferior-lisp*).

> 4. In JSwat, open the same Clojure source file you loaded in step #2
> and add a breakpoint (you can just click on the source line#) - note
> that you can only add breakpoints to lines in a defn, not lines in a
> defmacro definition

Yep.

> 5. In the Clojure repl evaluate a form that will call the function
> that has your breakpoint.

Yep.

> 6. In JSwat, you should see that the breakpoint has been hit and
> program execution is paused

Nope. :p

Fortunately I've since solved the problem I originally wanted the
debugger for (yay REPL), but it still would be nice to get this to
work...

I'm puzzled by my ability to successfully hit breakpoints in boot.clj.
That seems to imply I'm doing something partially right.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Debugging with JSwat

2008-10-24 Thread Craig Andera

[Tried sending this before. Never appears to have shown up. Trying
again after mucking with my Google account some.]

On Tue, Oct 21, 2008 at 11:11 AM, Allen Rohner <[EMAIL PROTECTED]> wrote:
>
>> I wonder if this doesn't have something to do with the fact that I'm
>> doing everything via the REPL. Is it possible to break on code you've
>> evaluated via M-x slime-eval-buffer? I'm able to set breakpoints in
>> (e.g.) boot.clj.
>
> I think it does. The compiler associates a file name line number with
> each line in your file. The debugger uses those line numbers to set
> breakpoints i.e. "set breakpoint on file foo.clj, line 15". Eval-ing
> into the repl you don't get useful line numbers. Try using slime-load-
> file.

No love with slime-load-file. When I get some time I'll try sticking
my code into a .jar and see if that gets me anywhere.

Or has anyone ever gotten this to work?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Debugging with JSwat

2008-10-20 Thread Craig Andera

I'm a total Clojure beginner, not to mention a C# guy with little Java
experience, but as I suspect I'm not alone I'll go ahead and ask
what's probably a dumb question. :)

I'm writing some simple code, and I've hit the point where having a
debugger would be helpful. Once I convinced clojure-swank to launch
java with the right arguments, I was able to attach JSwat, to open my
.clj files, and to set breakpoints. But my breakpoints never trigger.

I've googled a bit, but haven't come across the (probably obvious)
answer to my problem. What am I missing?

I'm on Windows 2008, running clojure under clojure-swank from emacs.

[Later]

I wonder if this doesn't have something to do with the fact that I'm
doing everything via the REPL. Is it possible to break on code you've
evaluated via M-x slime-eval-buffer? I'm able to set breakpoints in
(e.g.) boot.clj.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---