Re: find source file for namespace?

2009-12-28 Thread Emeka
Hello nchubrich,

I thinking that you can do this with easy using namespace which would lead
you to resolve the file name and then figure out the path.

Emeka

On Mon, Dec 28, 2009 at 2:43 AM, nchubrich nicholas.chubr...@gmail.comwrote:

 Does anyone know how to dynamically access the pathname for a
 particular piece of code?  I.E., I'd like to be able to write a
 function that can be called in any context and returns the pathname
 for the code it was called in.  (My intended use for this is to
 develop a testing package; I want to figure out an appropriate place
 to save the test files.)

 --
 You 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.comclojure%2bunsubscr...@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: idiomatic way to use cond.

2009-12-28 Thread Jeff Rose
I can think of a couple ways to break it up.  First, you can pull the
expressions inside of each do form out into separate functions.
Whether they are defined above the current function or inside it using
let, both would clean it up and give a label to each of the groups of
expressions (the function name).  Otherwise if you have duplicated
expressions in the do forms, then you could do the minimum amount
possible in the cond and put it in a let to keep the return value, and
then use it to execute the rest of the code within the body of the
let.  One of those seems to work for me most of the time, but I could
be missing something too...

Cheers,
Jeff

On Dec 28, 4:59 am, RD rdsr...@gmail.com wrote:
 Hello All,
       When every I write clj code that involves cond. It always involves a
 do in almost all of the classes.

 somethiing like
    (cond
         condition1 (do exp1 exp2 exp)
         condition2 (do exp1 exp2 ...)
         true (do ...))

 Is there a better way (without the explicit do) to write this??

 regards,
 rdsr

-- 
You 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: Probability Monad

2009-12-28 Thread Konrad Hinsen
On 24.12.2009, at 05:18, jim wrote:

 I was looking at the probability monad today and think this definition
 of m-bind might be easier to understand.

 (defmonad dist-m
  [m-result (fn m-result-dist [v]
  {v 1})
   m-bind   (fn m-bind-dist [mv f]
  (reduce (partial merge-with +)
  (for [[x p] mv
[y q] (f x)]
{y (* q p)})))
   ])

 What do you think?

I agree. In fact, I had reinvented merge-with because I wasn't aware  
of its existence.

 Also, I was thinking about cond-dist-m. What if dist-m was redefined
 to be this

 (defmonad dist-m
  [m-result (fn m-result-dist [v]
  {v 1})
   m-bind   (fn m-bind-dist [mv f]
  (if (empty? mv)
{}
(reduce (partial merge-with +)
(for [[x p] mv
  [y q] (f x)]
  {y (* q p)}
   m-zero {}
   m-plus   (fn m-plus-dist [ mvs]
  (if-let [mv (first (drop-while empty? mvs))]
mv
{}))
   ])

 I think that would roll cond-dist-m into dist-m, eliminating the need
 for a seperate monad. Don't know if you'd thought of that and
 discarded it or not.

At first glance I doubt that this works. Did you try it?

Your m-bind looks equivalent to the one of my original dist-m, with  
just an optimization for the case of an empty map. If that is true,  
then your dist-m can't include the features of cond-dist-m, which  
require a different m-bind.

It is in fact essential for cond-dist-m not to eliminate invalid  
values from the distributions immediately, but to accumulate their  
weights into the map entry for some special value (nil in my  
implementation). Otherwise the probabilities come out wrong for multi- 
step computations containing more than one :when clause.

Konrad.

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


Re: Why use monads

2009-12-28 Thread Konrad Hinsen
On 27.12.2009, at 23:03, Vagif Verdi wrote:

 Except different types of monads do not compose, so you have to create
 another artificial structure called monad transformers. And these new
 structures introduce so much new artificial complexity that any
 possible simplification becomes a moot point.

Please don't confuse the composition of computational steps in a monad  
with the composition of several monadic effects into a single combined  
monad. The first is quite well understood and I have yet to see anyone  
who has used monads in real life claim that they are not useful. The  
second aspect is more difficult and less well understood. The current  
most popular approach, monad transformers, may turn out to be  
insufficient or too complicated, and it may or may not be replaced by  
something else. Time will tell. The important point is that that  
utility of monads does not depend on monad transformers.

 This fact is realized even in haskell community:
 http://lambda-the-ultimate.org/node/2749#comment-41078

That article is about monad transformers, not monads themselves. BTW,  
monad transformers are simpler in Clojure than they are in Haskell  
(they are ordinary functions), so some arguments in that thread don't  
apply to the same degree.

Konrad.

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


Re: defmethod question....

2009-12-28 Thread Mike Meyer
On Sun, 27 Dec 2009 08:59:53 -0800 (PST)
Jason Wolfe jawo...@berkeley.edu wrote:

  That doesn't seem to be possible - I can't find a function that
  accepts a PersistentStructMap and returns the symbol passed to struct
  so it knows the keylist to use for the arguments. Nor could I find the
  magic incantation to let me use those symbol names with derive, which
  would let me use keywords for them. I got something working by having
  the dispatch function use sets of keys from the maps, but that seems
  fragile. Writing defFOO and FOO macros that attached the appropriate
  metadata to each struct seem possible, but sorta ugly.
 
 I believe this is the current way to do it.  For each struct type I
 intend to use in this way, I write a
 
 (defn make-A [a b c]
   (with-meta (struct A a b c) {:type ::A}))
 
 function and use this to construct all of my struct instances.

To bad. I did think of a nice way to do this with current constructs,
but it doesn't work now :-(. However, not only does it solve my
problem, it might be useful elsewhere, so I'll describe it in hopes
that it might get further consideration.

Basically, the idea is to allow destructured argument lists in an
overloaded defn, treating them as failed if some of the assignment
in the argument list aren't made. So you could solve this problem with
something like:

(defstruct foo :a :b :c)
(defstruct bar :c :d :e)
(defn struct-dispatch
  ([{_ :a _ :b _ :c}] ::foo)
  ([{_ :c _ :d _ :e}] ::bar))
(defmulti struct-method struct-dispatch)
(defmethod struct-method ::foo
   ; work on struct foo
   )
(defmethod struct-method ::bar
   ; work on struct bar
   )

Other supported destructurings would also be possible. In the extreme
case, Oz-style unification would be really cool, but that could also
be really expensive.

   mike
-- 
Mike Meyer m...@mired.org http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

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

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


Re: idiomatic way to use cond.

2009-12-28 Thread Meikel Brandmeyer
Hi,

Am 28.12.2009 um 04:59 schrieb RD:

(cond
 condition1 (do exp1 exp2 exp)
 condition2 (do exp1 exp2 ...)
 true (do ...))
 
 Is there a better way (without the explicit do) to write this??

Since the results of exp1 up to expN-1 are thrown away you are doing them only 
for side effects. Try to restructure your code in a more functional fashion, so 
that you get (let [res1 exp1 res2 exp2 ...] (expN resN-1)). Then tho do will be 
gone. If the side effects are necessary (eg. I/O) the ugly do should remind you 
of this.

If the expression chain gets too long, you should refactor them in their own 
functions.

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


Getting started with few Java knowledge

2009-12-28 Thread Joop Kiefte
Hello folks,

I have been learning a bit of Java at school a loong time ago
(programming basics), when we were programming applets and I
outscored all others with ease as I was the only one who could program
already, and now I do android programming in Java, but I have never
ever made a normal Java project, so I feel I'm missing some essentials
to get started in Clojure when I want to create stand-alone apps.
Can some of you maybe help me getting started on a Clojure project,
e.g. the files I need to have to get it compiled nicely to a working
JAR-package? (I use eclipse with CCW, but explanations for emacs are
fine as well.) I have been looking online but I don't succeed well
with the instructions found out there, I think it assumes too many
knowledge of Java...

Thanks beforehand, I would really appreciate your help (and don't be
shy to make it verbose and full of hints ;))

Joop Kiefte, 20 yrs, the Netherlands

-- 
Communication is essential. So we need decent tools when communication
is lacking, when language capability is hard to acquire...

- http://esperanto.net  - http://esperanto-jongeren.nl

Linux-user #496644 (http://counter.li.org) - first touch of linux in 2004

-- 
You 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: Monad problem: rewriting a recursive domonad call to not blow up the stack

2009-12-28 Thread Konrad Hinsen
On 27.12.2009, at 01:47, samppi wrote:

 creates a new rule that repeats a given subrule. The problem with rep+
 right now is that it increases the stack for every token it consumes,
 which overflows the stack with large amounts of tokens.

 Is there, then, a way to rewrite rep+ so that it does not grow the
 stack?

I don't see one immediately. The problem is not really related to  
monads, it's that your rep+ is recursive but not tail-recursive. Tail- 
recursive monadic functions can be handled using lazy evaluation, but  
this simple solution does not work in your case. Your rep+ needs to be  
written in a very different way.

One idea: if you can express rep+ in terms of m-until, you can then  
use the specialized version state-m-until that is not recursive any  
more.

Konrad.

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


Re: Getting started with few Java knowledge

2009-12-28 Thread Nurullah Akkaya
check this out,

http://github.com/nakkaya/clojure-stub

it will create a bare bones Hello World! application, that you can
build on top of, including an ant task for creating a jar file for
your application.

Regards,
--
Nurullah Akkaya
http://nakkaya.com



On Mon, Dec 28, 2009 at 12:57 PM, Joop Kiefte iko...@gmail.com wrote:
 Hello folks,

 I have been learning a bit of Java at school a loong time ago
 (programming basics), when we were programming applets and I
 outscored all others with ease as I was the only one who could program
 already, and now I do android programming in Java, but I have never
 ever made a normal Java project, so I feel I'm missing some essentials
 to get started in Clojure when I want to create stand-alone apps.
 Can some of you maybe help me getting started on a Clojure project,
 e.g. the files I need to have to get it compiled nicely to a working
 JAR-package? (I use eclipse with CCW, but explanations for emacs are
 fine as well.) I have been looking online but I don't succeed well
 with the instructions found out there, I think it assumes too many
 knowledge of Java...

 Thanks beforehand, I would really appreciate your help (and don't be
 shy to make it verbose and full of hints ;))

 Joop Kiefte, 20 yrs, the Netherlands

 --
 Communication is essential. So we need decent tools when communication
 is lacking, when language capability is hard to acquire...

 - http://esperanto.net  - http://esperanto-jongeren.nl

 Linux-user #496644 (http://counter.li.org) - first touch of linux in 2004

 --
 You 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: Processing list more elegantly

2009-12-28 Thread Conrad
I think this is indeed the best way to do this- On closer examination,
although there's some overhead in using reductions it appears to be
slower by only a constant factor- So with larger data sets it'll
retain a reasonable performance, same ball park as my tail-call
optimized versions.

On Dec 27, 8:52 pm, David Cabana drcab...@gmail.com wrote:
 Try this:

 (use '[clojure.contrib.seq-utils :only (reductions)])

 (defn left-total [lst]
   (map vector lst
                       (reductions + (cons 0 lst



 On Sun, Dec 27, 2009 at 8:36 PM, Conrad drc...@gmail.com wrote:
  I've been writing Clojure code today and have noticed the same pattern
  show up multiple times, but can't find an elegant way to code it in
  idiomatic Clojure. I feel like I'm missing an obvious solution...
  anyone else see something I don't? Thanks in advance!

  The problem boils down to the following minimal example: Suppose you
  want to write a function left-total which takes a list of number and
  returns pairs of said numbers, along with the total of numbers to the
  left:

  = (left-total [3 5 10 1 2 7])
  ([3 0] [5 3] [10 8] [1 18] [2 19] [7 21])

  I can think of several ways to write this function. Three acceptable
  versions of this function are written below, but all of them are
  hideous looking. Is there a better solution? (Note that any solution
  should avoid thrashing the stack or performing more than the minimum
  number of additions.)

-- 
You 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: Help with my vec matching function

2009-12-28 Thread ajuc
I would write this like that:

(def v #{[1 2 3]   [9 8 3]   [1 2]   [1]   [1 0 3 4]   [1 2 3 4 5]} )

(defn better-match [pattern match1 match2]
   ;;here choosing better matching vec from these 2 - sorry, I'm too
lazy :)
  )

(reduce #(better-match [1 2 3] %1 %2) [] v)

-- 
You 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: Help with my vec matching function

2009-12-28 Thread ajuc
I don't know if I understan correctly the requirements, but this is my
try.


(def v #{[1 2 3]   [9 8 3]   [1 2]   [1]   [1 0 3 4]   [1 2 3 4 5]} )

(defn matching [p v]
  (reduce + (map #(if (= %1 %2) 1 0) p v)))

(defn better-match [p v1 v2]
  (if
(or
  ( (matching p v1) (matching p v2))
  (and
 (= (matching p v1) (matching p v2)) ( (count v1) (count
v2
v1
v2))

(reduce #(better-match [1 2 4 4 5] %1 %2) [] v)

-- 
You 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: Using map on multiple collections.

2009-12-28 Thread Heinz N. Gies

On Dec 27, 2009, at 22:33 , Meikel Brandmeyer wrote:

 Checking for nil here is independent on the contents of the lists. The `(map 
 seq lists)` first turns everything in lists into a seq. If a collection is 
 empty it will be turned into nil. This nil is independent of any contained 
 nil of any other collection at that point in the iteration. The second point 
 where nil shows up is fnil. first returns nil when it gets passed nil. We 
 have to modify it to return the default in that case. However the passed nil 
 is again from the seq itself not the  contents. So contained nils are not a 
 problem at all.
 
 user= (extend-tupel :x [1 nil 3] [4 5 6 7])
 ((1 4) (nil 5) (3 6) (:x 7))

Ah sorry, you're right, I misinterpreted fnil wrong :) so yes, that is really 
way nicer :) thanks for the hint to fnil too, so it seems not to be in the 
stable clojure yet :( too sad, but copy  paste from your link does :D.


Best regards,
Heinz

-- 
You 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: Processing list more elegantly

2009-12-28 Thread Meikel Brandmeyer
Hi,

Am 28.12.2009 um 02:36 schrieb Conrad:

 = (left-total [3 5 10 1 2 7])
 ([3 0] [5 3] [10 8] [1 18] [2 19] [7 21])

If in doubt, use lazy-seq.

(defn left-total
  [accum-fn accum s]
  (lazy-seq
(when-let [[f  r] (seq s)]
(cons [f accum] (left-total accum-fn (accum-fn accum f) r)

user= (left-total + 0 [3 5 10 1 2 7])
([3 0] [5 3] [10 8] [1 18] [2 19] [7 21])

Since you said, that + is more complicated in your specific case, you might 
want this more general form. Otherwise the above can of course be simplified…

Sincerely
Meikel

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


Re: Help with my vec matching function

2009-12-28 Thread Robert Campbell
Thanks ajuc.

I updated the implementation to match your algorithm:

(defn closest-match
  Searches the haystack vecs for the closest match to the needle vec
  [#^IPersistentVector needle #^IPersistentVector haystack]
  (letfn [(matching [candidate]
(reduce + (map #(if (= %1 %2) 1 0) needle candidate)))
  (closest [v1 v2]
   (if (or ( (matching v1) (matching v2))
   (and (= (matching v1) (matching v2))
( (count v1) (count v2 v1 v2))]
(reduce #(closest %1 %2) [] haystack)))

It now factors in the second step, taking the shortest candidate.

(closest-match [1 2 3] #{[1 2 3] [9 8 3] [1 2] [1] [1 0 3 4] [1 2 3 4 5]})

now correctly returns [1 2 3] instead of [1 2 3 4 5]




On Mon, Dec 28, 2009 at 4:23 PM, ajuc aju...@gmail.com wrote:
 I don't know if I understan correctly the requirements, but this is my
 try.


 (def v #{[1 2 3]   [9 8 3]   [1 2]   [1]   [1 0 3 4]   [1 2 3 4 5]} )

 (defn matching [p v]
  (reduce + (map #(if (= %1 %2) 1 0) p v)))

 (defn better-match [p v1 v2]
  (if
    (or
      ( (matching p v1) (matching p v2))
      (and
         (= (matching p v1) (matching p v2)) ( (count v1) (count
 v2
    v1
    v2))

 (reduce #(better-match [1 2 4 4 5] %1 %2) [] v)

 --
 You 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: Getting started with few Java knowledge

2009-12-28 Thread Laurent PETIT
2009/12/28 Joop Kiefte iko...@gmail.com

 [...] I think this works a lot nicer than CCW. [...]


As a ccw contributor, I would be pleased if you could you elaborate on this
?
What does it mean to be a lot nicer than CCW ?

Is it you would like that ccw, when creating a new clojure project, also
creates a basic ant script to be able to compile your project independently
of ccw's out-of-the-box eclipse builder ?
Is it something else ?

Thanks,

-- 
Laurent

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

Re: Help with my vec matching function

2009-12-28 Thread Robert Campbell
How might I add a third and final condition, where those candidates
with equal scores AND equal counts are all returned together?

A first try was this:

(defn closest-match
  Searches the haystack vecs for the closest match to the needle vec
  [#^IPersistentVector needle #^IPersistentVector haystack]
  (letfn [(matching [candidate]
(reduce + (map #(if (= %1 %2) 1 0) needle candidate)))
  (closest [v1 v2]
   (cond
 (and (= (matching v1) (matching v2))
  (= (count v1) (count v2))) [v1 v2]
 (or ( (matching v1) (matching v2))
 (and (= (matching v1) (matching v2))
  ( (count v1) (count v2 v1
 :else v2))]
(reduce #(closest %1 %2) [] haystack)))

(closest-match [1 2] #{[1 2 \a] [1 2 \b] [2 1]})
[[1 2 \b] [1 2 \a]]
(closest-match [1 2] #{[1 2] [1 2 \a] [1 2 \b] [2 1]})
[1 2]

It looks good at first, but I quickly noticed that I broke the whole
reduction by introducing a pair where we expend only a vec:

(closest-match [1 2] #{[1 2 \a] [1 2 \b] [2 1] [1 2 \c]})
[1 2 \a]

What we should be getting [[1 2 \a] [1 2 \b] [1 2 \c]] since each of
them is equally close to [1 2 3]




On Mon, Dec 28, 2009 at 5:20 PM, Robert Campbell rrc...@gmail.com wrote:
 Thanks ajuc.

 I updated the implementation to match your algorithm:

 (defn closest-match
  Searches the haystack vecs for the closest match to the needle vec
  [#^IPersistentVector needle #^IPersistentVector haystack]
  (letfn [(matching [candidate]
                    (reduce + (map #(if (= %1 %2) 1 0) needle candidate)))
          (closest [v1 v2]
                   (if (or ( (matching v1) (matching v2))
                           (and (= (matching v1) (matching v2))
                                ( (count v1) (count v2 v1 v2))]
    (reduce #(closest %1 %2) [] haystack)))

 It now factors in the second step, taking the shortest candidate.

 (closest-match [1 2 3] #{[1 2 3] [9 8 3] [1 2] [1] [1 0 3 4] [1 2 3 4 5]})

 now correctly returns [1 2 3] instead of [1 2 3 4 5]




 On Mon, Dec 28, 2009 at 4:23 PM, ajuc aju...@gmail.com wrote:
 I don't know if I understan correctly the requirements, but this is my
 try.


 (def v #{[1 2 3]   [9 8 3]   [1 2]   [1]   [1 0 3 4]   [1 2 3 4 5]} )

 (defn matching [p v]
  (reduce + (map #(if (= %1 %2) 1 0) p v)))

 (defn better-match [p v1 v2]
  (if
    (or
      ( (matching p v1) (matching p v2))
      (and
         (= (matching p v1) (matching p v2)) ( (count v1) (count
 v2
    v1
    v2))

 (reduce #(better-match [1 2 4 4 5] %1 %2) [] v)

 --
 You 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: Why use monads

2009-12-28 Thread David Brown
On Mon, Dec 28, 2009 at 12:44:31PM +0100, Konrad Hinsen wrote:

 This fact is realized even in haskell community:
 http://lambda-the-ultimate.org/node/2749#comment-41078

That article is about monad transformers, not monads themselves. BTW,
monad transformers are simpler in Clojure than they are in Haskell
(they are ordinary functions), so some arguments in that thread don't
apply to the same degree.

Well, they still end up mostly as just functions in Haskell, with lots
of extra wrapping and unwrapping to get the type system to work.

The advantage in Haskell, is that 'lift' and friends (liftIO) figure
out at compile time how many invocations are needed to get to the
right monad.

My biggest complaint about the monad transformers was that they make
the program design fragile.  Having to make small changes to what
monads were used tended to have a pervasive effect on the rest of the
code.  Much of this had to do with type declarations, so this might
not be as much of an issue with Clojure.

David

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


Re: Help with my vec matching function

2009-12-28 Thread ajuc


On 28 Gru, 20:57, Robert Campbell rrc...@gmail.com wrote:
 How might I add a third and final condition, where those candidates
 with equal scores AND equal counts are all returned together?

Reduce can work with functions like
f : x * y - x

So we can modify function closest to be like that (untested):

(closest [ v1s v2]
  (if  (empty v1s)
   v2
   (cond
 (and (= (matching (first v1s)) (matching v2))
  (= (count (first v1s)) (count v2))) (into
v1s v2))
 (or ( (matching (first v1s)) (matching v2))
 (and (= (matching (first v1s)) (matching v2))
  ( (count (first v1s)) (count v2
[v1]
 :else [v2])))

Also, we use matching on the same arguments a lot, so it would be good
to memoize that function.

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


Re: Clojure and c++ and a bit more

2009-12-28 Thread atucker
I see.  Thanks, that makes a lot of sense.

So just because this sort of multiple reference isn't explicit (or
even visible) in Clojure, that doesn't mean it's not happening.  Under
the hood, a derived data structure is more than likely to share memory
with its progenitor.  And that's for very good performance reasons
(option b in my C++ comparison).

But doesn't that all that data-sharing happen in tree-like structures
under the careful control of the compiler?  I find myself wondering
whether circular references need remain a possibility in this
context.  Perhaps we could still consider a simple reference-counting
mechanism (much like the one you mention, boost::shared_ptr).

Thanks
Alistair


On Dec 25, 5:38 pm, mac markus.gustavs...@gmail.com wrote:
 On Dec 24, 6:14 pm, atucker agjf.tuc...@googlemail.com wrote:



  I am also curious about this.  Apologies, possibly naive question
  ahead :)

  My background is in C++.  By choosing to work with immutable values
  (i.e. with a lot of consts), I found that I was able to avoid most of
  explicit memory management, pointers etc.  Exceptions were:

  (a) when interfacing with other people's code, and
  (b) when making optimisations, e.g. to save a needless copy-on-return.

  Otherwise everything happened behind the scenes as variables with
  automatic lifespan, passing into and out of scope, had their memory
  allocated and deallocated on the stack.

  Surely this is the most performant approach to memory management where
  it is possible?  And doesn't Clojure's pure-functional ethos make it
  possible?

  Alistair

 It's great until you want to have more than one reference to a
 particular piece of data.
 Then you have two options:
 a) Copy
 b) Make another pointer to it

 Option a) is often good enough. But if it's a huge object (like sound
 or picture data) you probably can't afford copying it.

 Option b) means that you now have lost the ability to manage the
 memory through scope alone. You will need manual management or some
 kind of GC mechanism. In C++ you often use boost::shared_ptr but
 that can't handle circular references so there is still a manual
 management component to it.

 When option a) is too expensive and option b) is too complicated,
 that's when you need a real GC.

-- 
You 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: Help with my vec matching function

2009-12-28 Thread Robert Campbell
That makes sense. I updated the function to:

(defn closest-match
  Returns the closest matches of needle in the haystack
  [#^IPersistentVector needle #^IPersistentVector haystack]
  (letfn [(matching [candidate]
(println  checking  candidate)
(reduce + (map #(if (= %1 %2) 1 0) needle candidate)))
  (closest [v1s v2]
   (cond (empty? v1s) [v2]
 (and (= (matching (first v1s)) (matching v2))
  (= (count (first v1s)) (count v2))) (conj v1s v2)
 (or ( (matching (first v1s)) (matching v2))
 (and (= (matching (first v1s)) (matching v2))
  ( (count (first v1s)) (count v2 v1s
 :else [v2]))]
(reduce #(closest %1 %2) [] haystack)))

This does work now:

(closest-match [1 2 3] #{[1 2 \a] [1 2 \b] [2 1] [1] [1 2 \c] [1 2 3 4 5]})
[[1 2 3 4 5]]

(closest-match [1 2] #{[1 2 \a] [1 2 \b] [2 1] [1] [1 2 \c] [1 2 3 4 5]})
[[1 2 \b] [1 2 \c] [1 2 \a]]

(closest-match [2 1 3] #{[1 2 \a] [1 2 \b] [2 1] [1] [1 2 \c] [1 2 3 4 5]})
[[2 1]]

One place I'm going to try to improve upon is how it reacts when there
are no matches. Right now, it will return the smallest candidate
because the third cond predicate will be true:
(and (= (matching (first v1s)) (matching v2))  ; (= 0 0)
   ( (count (first v1s)) (count v2 v1s  ; basically finds the
smallest candidate

(closest-match [\a \b] #{[1 2 \a] [1 2 \b] [2 1] [1] [1 2 \c] [1 2 3 4 5]})
[[1]]

(closest-match [\a \b] #{[1 2 \a] [1 2 \b] [2 1] [1] [1 2 \c] [1 2 3 4 5] []})
[[]]

I think when matches = 0, or there is literally no intersection
between the needle and the candidates, I will just return [].

Rob




On Mon, Dec 28, 2009 at 6:28 PM, ajuc aju...@gmail.com wrote:


 On 28 Gru, 20:57, Robert Campbell rrc...@gmail.com wrote:
 How might I add a third and final condition, where those candidates
 with equal scores AND equal counts are all returned together?

 Reduce can work with functions like
 f : x * y - x

 So we can modify function closest to be like that (untested):

 (closest [ v1s v2]
          (if  (empty v1s)
                   v2
                   (cond
                     (and (= (matching (first v1s)) (matching v2))
                          (= (count (first v1s)) (count v2))) (into
 v1s v2))
                     (or ( (matching (first v1s)) (matching v2))
                         (and (= (matching (first v1s)) (matching v2))
                              ( (count (first v1s)) (count v2
 [v1]
                     :else [v2])))

 Also, we use matching on the same arguments a lot, so it would be good
 to memoize that function.

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

-- 
You 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: struct-maps and key removal

2009-12-28 Thread Rich Hickey
On Tue, Dec 15, 2009 at 1:11 PM, Richard Newman holyg...@gmail.com wrote:
 Isn't the whole point of a struct that it guarantees that certain keys
 are present?

 Oh, I agree -- dissoc on a struct-map would return a non-struct-map.
 I'm not suggesting that struct-maps should be able to be dissociated
 from one of their keys, I'm wondering whether it's better to return an
 array-map or hash-map from dissoc rather than blow up.

 (Or whether there should be a `without-keys` function that behaves
 much like dissoc but works on any map, and have rename-keys and other
 implicit dissoc functions use that instead. rename-keys on a struct-
 map's core keys implies an abandonment of struct-ness, no?)

 I suppose the question is are struct-maps 'structs' or
 maps? (speaking ontologically). If they're structs, then it's happy
 coincidence that the map get/assoc functions work on them, and
 slightly confusing that they print as ordinary maps. If they're maps,
 where their struct-ness is an optimization, then dissoc should work in
 the same way that assoc on an array-map can sometimes return a hash-map.

 The main reason I bring this up is that I had no reason to suspect
 that the maps returned from my SQL queries were actually struct-maps.
 They printed like any other map, and work correctly for every non-
 removing map operation. Having some subset of maps error on core API
 operations seems opposed to abstraction-oriented programming. It trips
 my disgust switch to see code like

 (rename-keys
   (if (struct-map? m)
     (into {} m)
     m)
   {:foo :bar})


Yes. The behavior for the new deftypes, when used as maps, is as you
desire - a dissoc of a field key yields an ordinary map (no longer of
the deftype type).

Enhancements to structs are on hold pending analysis of their utility
in light of deftypes.

Rich

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


Re: How to efficiently compare related persistent collections (maps, sets)?

2009-12-28 Thread Rich Hickey
On Wed, Dec 16, 2009 at 3:04 PM, ajay gopalakrishnan ajgop...@gmail.com wrote:
 If the sets data structure is also not shared, then the paper I mentioned
 (link provided earlier) is one of the fastest to date. And it is very small
  easy to implement.


I think an implementation of persistent sets based upon treaps would
make a useful contribution:

http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.54.5678

Rich

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


Re: Getting started with few Java knowledge

2009-12-28 Thread Joop Kiefte
I am just clueless in CCW how to get it compiled nicely. It doesn't
get you started with the files you need minimally to get it compiled
correctly and I remain clueless on how to get it to work.

And I get duplicated files probably because of eclipse works (include
every compiled file in the project as it is in the same directory). I
got lost there =x.

At least I would like to see a basic workflow document about CCW, and
better of course to have it nicely built in in Eclipse.

I hope you understand what I mean...

2009/12/28 Laurent PETIT laurent.pe...@gmail.com:

 2009/12/28 Joop Kiefte iko...@gmail.com

 [...] I think this works a lot nicer than CCW. [...]

 As a ccw contributor, I would be pleased if you could you elaborate on this
 ?
 What does it mean to be a lot nicer than CCW ?

 Is it you would like that ccw, when creating a new clojure project, also
 creates a basic ant script to be able to compile your project independently
 of ccw's out-of-the-box eclipse builder ?
 Is it something else ?

 Thanks,

 --
 Laurent

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



-- 
Communication is essential. So we need decent tools when communication
is lacking, when language capability is hard to acquire...

- http://esperanto.net  - http://esperanto-jongeren.nl

Linux-user #496644 (http://counter.li.org) - first touch of linux in 2004

-- 
You 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: Roadmap for 2010

2009-12-28 Thread Rich Hickey
On Tue, Dec 15, 2009 at 11:32 PM, ashishwave ashishw...@gmail.com wrote:
 Request for prioritizing the 2010 roadmap. New year is just few days
 ahead :-)


I don't like to publish roadmaps, as often the best features in any
particular year wouldn't have been on the roadmap for that year.

  What should be the new features which we would like to see in clojure
  May be some faatures from other dialects of LISP or some other jvm
 based language feature or something innovative idea.

  Let us list/share those ideas as a community  ;-)


That is what this forum is all about. I assure you I pay attention to
the issues faced by Clojure users. It's just that often the connection
between the perceived need and the actual solution flows through ideas
I haven't had yet. I try to get people engaged in those ideas as soon
as they have some useful form. I'd hate to have a roadmap get in the
way of that process.

Rich

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


Re: Probability Monad

2009-12-28 Thread jim
I figured you'd had a good reason for doing it the way you did.

Konrad Hinsen wrote:
 On 24.12.2009, at 05:18, jim wrote:

  I was looking at the probability monad today and think this definition
  of m-bind might be easier to understand.
 
  (defmonad dist-m
   [m-result (fn m-result-dist [v]
   {v 1})
m-bind   (fn m-bind-dist [mv f]
   (reduce (partial merge-with +)
   (for [[x p] mv
 [y q] (f x)]
 {y (* q p)})))
])
 
  What do you think?

 I agree. In fact, I had reinvented merge-with because I wasn't aware
 of its existence.

  Also, I was thinking about cond-dist-m. What if dist-m was redefined
  to be this
 
  (defmonad dist-m
   [m-result (fn m-result-dist [v]
   {v 1})
m-bind   (fn m-bind-dist [mv f]
   (if (empty? mv)
 {}
 (reduce (partial merge-with +)
 (for [[x p] mv
   [y q] (f x)]
   {y (* q p)}
m-zero {}
m-plus   (fn m-plus-dist [ mvs]
   (if-let [mv (first (drop-while empty? mvs))]
 mv
 {}))
])
 
  I think that would roll cond-dist-m into dist-m, eliminating the need
  for a seperate monad. Don't know if you'd thought of that and
  discarded it or not.

 At first glance I doubt that this works. Did you try it?

 Your m-bind looks equivalent to the one of my original dist-m, with
 just an optimization for the case of an empty map. If that is true,
 then your dist-m can't include the features of cond-dist-m, which
 require a different m-bind.

 It is in fact essential for cond-dist-m not to eliminate invalid
 values from the distributions immediately, but to accumulate their
 weights into the map entry for some special value (nil in my
 implementation). Otherwise the probabilities come out wrong for multi-
 step computations containing more than one :when clause.

 Konrad.

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


Re: Why use monads

2009-12-28 Thread jim
Don't really understand what point you're making. The way I see it,
monads are incredibly useful for combining functions that all have the
same signature. When you realize that that's the domain you're working
in, you can use a monad and raise the level of abstraction that you're
working at. In this area, the task seems to be educating programmers
about how to use monads effectively. Lot of work yet to do, yet the
theoretical foundation seems to be solid.

Composing monads is a totally different subject with a lot of
theoretical work yet to be done. Presently, monad transformers seem to
be the way forward, but that's open to debate as you've pointed out.

Vagif Verdi wrote:
 On Dec 22, 2:10 pm, jim jim.d...@gmail.com wrote:
  Chouser,
 
  You're right that maybe-comp is simpler. Once you realize that the
  functions you want to compose are monadic functions under the maybe-m
  monad, you get that composition for 'free', with no further mental
  effort.

 Except different types of monads do not compose, so you have to create
 another artificial structure called monad transformers. And these new
 structures introduce so much new artificial complexity that any
 possible simplification becomes a moot point.

 This fact is realized even in haskell community:
 http://lambda-the-ultimate.org/node/2749#comment-41078

 I'd say that monads add way too much complexity in most cases.
 Especially in impure languages where you can do many things much
 simpler than involving monads.

-- 
You 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: Getting started with few Java knowledge

2009-12-28 Thread Laurent PETIT
OK I think I understand.

As an open source project written on free-time, ccw is open to any
contribution.
Especially, newcomers to Java (and presumably Eclipse) such as you, which
will find big wholes in documentation or usability, are invited to
contribute : you can discuss things on ccw user's ml, file tickets in ccw's
google group ticket system, propose enhancements to the documentation, etc.

Help welcome !

-- 
Laurent



2009/12/28 Joop Kiefte iko...@gmail.com

 I am just clueless in CCW how to get it compiled nicely. It doesn't
 get you started with the files you need minimally to get it compiled
 correctly and I remain clueless on how to get it to work.

 And I get duplicated files probably because of eclipse works (include
 every compiled file in the project as it is in the same directory). I
 got lost there =x.

 At least I would like to see a basic workflow document about CCW, and
 better of course to have it nicely built in in Eclipse.

 I hope you understand what I mean...

 2009/12/28 Laurent PETIT laurent.pe...@gmail.com:
 
  2009/12/28 Joop Kiefte iko...@gmail.com
 
  [...] I think this works a lot nicer than CCW. [...]
 
  As a ccw contributor, I would be pleased if you could you elaborate on
 this
  ?
  What does it mean to be a lot nicer than CCW ?
 
  Is it you would like that ccw, when creating a new clojure project,
 also
  creates a basic ant script to be able to compile your project
 independently
  of ccw's out-of-the-box eclipse builder ?
  Is it something else ?
 
  Thanks,
 
  --
  Laurent
 
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient with
 your
  first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.comclojure%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en



 --
 Communication is essential. So we need decent tools when communication
 is lacking, when language capability is hard to acquire...

 - http://esperanto.net  - http://esperanto-jongeren.nl

 Linux-user #496644 (http://counter.li.org) - first touch of linux in 2004

 --
 You 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.comclojure%2bunsubscr...@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

Access to nested static classes

2009-12-28 Thread Mark Tomko
Is there a way to reference nested static members of Java classes
using Clojure?  I tried a few things and couldn't get it to work.  To
simplify the question a bit, I wrote the following Java class:

package org.tomko.konkordans;

public class NestedStatics {
public static String FOO = foo;
public static class LevelOne {
public static enum LevelTwo {
YES,NO;
}
}
}

Then, at the REPL:

user= (str org.tomko.konkordans.NestedStatics/FOO)
foo
user= (str.org.tomko.konkordans.NestedStatics/LevelOne)
java.lang.ClassNotFoundException:
str.org.tomko.konkordans.NestedStatics (NO_SOURCE_FILE:0)
user=

So, it's clear that I have the NestedStatics class in my classpath,
and that I can reference static members that are of a fundamental data
type.  But attempting to reach in one level deeper does not succeed.

I also tried importing LevelOne into my namespace using a :use, but
that didn't work - although I'm a bit hazy on the precise syntax for
that so it might be my fault.  A search in this forum didn't turn up
anything quite like this, but there was some discussion about import
statics that might be relevant.

-- 
You 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: Access to nested static classes

2009-12-28 Thread Mark Tomko
This, however, does not work:

(ns org.tomko.konkordans.analysis
  (:import
(org.tomko.konkordans NestedStatics)))

(def foo NestedStatics$LevelOne$LevelTwo/NO)

user= (load-file /Users/mark/IdeaProjects/Konkordans/src/org/tomko/
konkordans/analysis.clj)
java.lang.Exception: No such namespace: NestedStatics$LevelOne
$LevelTwo (analysis.clj:5)

On Dec 28, 5:48 pm, Mark Tomko mjt0...@gmail.com wrote:
 This appears to work:

 user= (str org.tomko.konkordans.NestedStatics$LevelOne)
 class org.tomko.konkordans.NestedStatics$LevelOne

 Is this depending on a detail of implementation?  It feels funny to
 me, but perhaps it's the best way to do it.

 On Dec 28, 5:42 pm, David Brown cloj...@davidb.org wrote:



  On Mon, Dec 28, 2009 at 02:32:48PM -0800, Mark Tomko wrote:
  user= (str.org.tomko.konkordans.NestedStatics/LevelOne)

  Does

      str.org.tomko.konkordans.NestedStatics$LevelOne/ONE

  Work?

  You can always look in the class output directory that the Java
  compiler generates, and see the resulting class name that it creates
  (just change the slashes in the path into dots).

  David

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


Loading a .clj file automatically at repl startup?

2009-12-28 Thread Mike K
Is it possible to load a library such as foo.clj (with (ns foo ...) at
the top of the file) into the repl automatically at startup, rather
than having to (use 'foo) every time the repl starts?  I'd like to
avoid creating a .jar file.

If possible, I'd like to do this both from the command line (java -
cp ...) and from within slime / emacs.

   Thanks,
   Mike

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


Re: latest docs for datatypes+protocols?

2009-12-28 Thread Sean Devlin
This search might help:

http://groups.google.com/groups/search?safe=offq=data+types+protocols+group:clojuresa=Xoi=spellspell=1

Sean

On Dec 28, 5:44 pm, Raoul Duke rao...@gmail.com wrote:
 hi,

 i'm trying to catch up on DP, where are the best online succinct docs
 for these? (e.g. ishttp://www.assembla.com/wiki/show/clojure/Datatypesright? 
 that's the
 first hit i get from google.)

 thank you!

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


Re: Roadmap for 2010

2009-12-28 Thread Jules
 the issues faced by Clojure users.

Is there a list somewhere?

Jules

On Dec 28, 8:07 pm, Rich Hickey richhic...@gmail.com wrote:
 On Tue, Dec 15, 2009 at 11:32 PM, ashishwave ashishw...@gmail.com wrote:
  Request for prioritizing the 2010 roadmap. New year is just few days
  ahead :-)

 I don't like to publish roadmaps, as often the best features in any
 particular year wouldn't have been on the roadmap for that year.

   What should be the new features which we would like to see in clojure
   May be some faatures from other dialects of LISP or some other jvm
  based language feature or something innovative idea.

   Let us list/share those ideas as a community  ;-)

 That is what this forum is all about. I assure you I pay attention to
 the issues faced by Clojure users. It's just that often the connection
 between the perceived need and the actual solution flows through ideas
 I haven't had yet. I try to get people engaged in those ideas as soon
 as they have some useful form. I'd hate to have a roadmap get in the
 way of that process.

 Rich

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


Re: Loading a .clj file automatically at repl startup?

2009-12-28 Thread Tom Hicks
Depending how you're starting the REPL, it looks like there is also
a command line option. Here's parts of the doc string from the main fn
in src/clj/clojure/main.clj (version 1.0.0):

(defn main
  Usage: java -cp clojure.jar clojure.main [init-opt*] [main-opt]
[arg*]

  With no options or args, runs an interactive Read-Eval-Print Loop

  init options:
-i, --init path   Load a file or resource
-e, --eval string Evaluate expressions in string; print non-nil
values

...[snip]

- Runs all init options in order
- Runs a repl or script if requested

  The init options may be repeated and mixed freely, but must appear
before
  any main option. The appearance of any eval option before running a
repl
  suppresses the usual repl greeting message: \Clojure ~(clojure-
version)\.


Caveat: I haven't actually tried this.
   -tom


On Dec 28, 5:01 pm, Sean Devlin francoisdev...@gmail.com wrote:
 There's a user.clj file that can be customized for this purpose.  Make
 sure it's in your classpath.

 On Dec 28, 6:16 pm, Mike K mbk.li...@gmail.com wrote:

  Is it possible to load a library such as foo.clj (with (ns foo ...) at
  the top of the file) into the repl automatically at startup, rather
  than having to (use 'foo) every time the repl starts?  I'd like to
  avoid creating a .jar file.

  If possible, I'd like to do this both from the command line (java -
  cp ...) and from within slime / emacs.

     Thanks,
     Mike

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


Re: Processing list more elegantly

2009-12-28 Thread Timothy Pratley
I find this quite interesting because Meikel has effectively created a
faster version of reductions:

(defn cumulative
  ([accum-fn s]
   (rest (cumulative accum-fn 0 s)))
  ([accum-fn accum s]
   (lazy-seq
 (when-let [[f  r] (seq s)]
   (cons accum (cumulative accum-fn (accum-fn accum f) r))

(defn left-total
  [coll]
  (map list coll (cumulative + 0 coll)))

I did some microbenchmarking and it does appear to be 2x as fast as
reductions, and processes the special case left-total just as fast as
one of the original proposals. Oddly left-tot2 performs very poorly
though it was claimed to be fast. I suppose this could be yet another
case of microbenchmarking being evil - but looking at the code the
reductions version seems to use an atom which implies some unnecessary
overhead? Or maybe I am missing something important about their
differences.

I followed the link to the discussion about the original reductions
and it all seems to be pre-lazy-seq so maybe this is just a case of
the function should be updated?


Below are the timing results (don't recommend basing anything off them
as just adhoc)


user= (time (dotimes [i 1000] (left-total3 coll)))
Elapsed time: 1460.309131 msecs
nil
user= (time (dotimes [i 1000] (left-total3 coll)))
Elapsed time: 1600.225655 msecs
nil
user= (time (dotimes [i 1000] (left-total2 coll)))
Elapsed time: 960.14 msecs
nil
user= (time (dotimes [i 1000] (left-total2 coll)))
Elapsed time: 957.096643 msecs
nil
user= (time (dotimes [i 1000] (left-total coll)))
Elapsed time: 702.240509 msecs
nil
user= (time (dotimes [i 1000] (left-total coll)))
Elapsed time: 685.018973 msecs
nil
user= (time (dotimes [i 1000] (left-total3 coll)))
Elapsed time: 1492.383251 msecs
nil
user= (time (dotimes [i 1000] (left-total coll)))
Elapsed time: 719.915803 msecs
nil
user= (time (dotimes [i 1000] (left-tot2 coll)))
Elapsed time: 10286.935494 msecs




(defn left-total2 [lst]
 (let [tot (atom 0)]
   (map (fn [cur]
  (let [old-tot @tot]
(swap! tot (partial + cur))
[cur old-tot]))
lst)))


(use 'clojure.contrib.seq-utils)
(defn left-total3
  [coll]
  (map list coll (reductions + 0 coll)))


(defn left-tot2 [lst]
 (loop [result  [ ]
   tot   0
   terms  lst]

   (if (empty? terms)
 result
 (let [f (first terms)]
   (recur (conj result [f tot])
 (+ tot f)
 (rest terms))

2009/12/29 Conrad drc...@gmail.com:
 Thanks Meikel- Let me see if I understand what's going on here...

 Usually, calling left-total recursively from a non-tail call
 position, as you do in this example, would abuse the call stack.
 However, since the call is happening from within a lazy-seq, does this
 mean the number of items on the call stack will remain unhindered,
 despite the non-tail-call recursion?

 Experimentally, this version seems to perform as well as any of my
 solutions (under 2 secs for 1 mil items) This suggests it is, indeed,
 not causing any abuse of the call stack.

 This is definitely cleaner and more flexible than any other solution
 suggested so far, I think.

 On Dec 28, 9:11 am, Meikel Brandmeyer m...@kotka.de wrote:
 Hi,

 Am 28.12.2009 um 02:36 schrieb Conrad:

  = (left-total [3 5 10 1 2 7])
  ([3 0] [5 3] [10 8] [1 18] [2 19] [7 21])

 If in doubt, use lazy-seq.

 (defn left-total
   [accum-fn accum s]
   (lazy-seq
     (when-let [[f  r] (seq s)]
         (cons [f accum] (left-total accum-fn (accum-fn accum f) r)

 user= (left-total + 0 [3 5 10 1 2 7])
 ([3 0] [5 3] [10 8] [1 18] [2 19] [7 21])

 Since you said, that + is more complicated in your specific case, you might 
 want this more general form. Otherwise the above can of course be simplified…

 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

-- 
You 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: Processing list more elegantly

2009-12-28 Thread Conrad
I think you're right on the money here, Timothy: I'm not a Clojure
guru, but it does seem from a naive perspective that Meikel's code
let's you implement reductions in a way that significantly
outperforms the current implementation.

On Dec 28, 9:39 pm, Timothy Pratley timothyprat...@gmail.com wrote:
 I find this quite interesting because Meikel has effectively created a
 faster version of reductions:

 (defn cumulative
   ([accum-fn s]
    (rest (cumulative accum-fn 0 s)))
   ([accum-fn accum s]
    (lazy-seq
      (when-let [[f  r] (seq s)]
        (cons accum (cumulative accum-fn (accum-fn accum f) r))

 (defn left-total
   [coll]
   (map list coll (cumulative + 0 coll)))

 I did some microbenchmarking and it does appear to be 2x as fast as
 reductions, and processes the special case left-total just as fast as
 one of the original proposals. Oddly left-tot2 performs very poorly
 though it was claimed to be fast. I suppose this could be yet another
 case of microbenchmarking being evil - but looking at the code the
 reductions version seems to use an atom which implies some unnecessary
 overhead? Or maybe I am missing something important about their
 differences.

 I followed the link to the discussion about the original reductions
 and it all seems to be pre-lazy-seq so maybe this is just a case of
 the function should be updated?

 Below are the timing results (don't recommend basing anything off them
 as just adhoc)

 user= (time (dotimes [i 1000] (left-total3 coll)))
 Elapsed time: 1460.309131 msecs
 nil
 user= (time (dotimes [i 1000] (left-total3 coll)))
 Elapsed time: 1600.225655 msecs
 nil
 user= (time (dotimes [i 1000] (left-total2 coll)))
 Elapsed time: 960.14 msecs
 nil
 user= (time (dotimes [i 1000] (left-total2 coll)))
 Elapsed time: 957.096643 msecs
 nil
 user= (time (dotimes [i 1000] (left-total coll)))
 Elapsed time: 702.240509 msecs
 nil
 user= (time (dotimes [i 1000] (left-total coll)))
 Elapsed time: 685.018973 msecs
 nil
 user= (time (dotimes [i 1000] (left-total3 coll)))
 Elapsed time: 1492.383251 msecs
 nil
 user= (time (dotimes [i 1000] (left-total coll)))
 Elapsed time: 719.915803 msecs
 nil
 user= (time (dotimes [i 1000] (left-tot2 coll)))
 Elapsed time: 10286.935494 msecs

 (defn left-total2 [lst]
  (let [tot (atom 0)]
    (map (fn [cur]
           (let [old-tot @tot]
             (swap! tot (partial + cur))
             [cur old-tot]))
         lst)))

 (use 'clojure.contrib.seq-utils)
 (defn left-total3
   [coll]
   (map list coll (reductions + 0 coll)))

 (defn left-tot2 [lst]
  (loop [result  [ ]
            tot       0
            terms  lst]

    (if (empty? terms)
      result
      (let [f (first terms)]
        (recur (conj result [f tot])
                  (+ tot f)
                  (rest terms))

 2009/12/29 Conrad drc...@gmail.com:



  Thanks Meikel- Let me see if I understand what's going on here...

  Usually, calling left-total recursively from a non-tail call
  position, as you do in this example, would abuse the call stack.
  However, since the call is happening from within a lazy-seq, does this
  mean the number of items on the call stack will remain unhindered,
  despite the non-tail-call recursion?

  Experimentally, this version seems to perform as well as any of my
  solutions (under 2 secs for 1 mil items) This suggests it is, indeed,
  not causing any abuse of the call stack.

  This is definitely cleaner and more flexible than any other solution
  suggested so far, I think.

  On Dec 28, 9:11 am, Meikel Brandmeyer m...@kotka.de wrote:
  Hi,

  Am 28.12.2009 um 02:36 schrieb Conrad:

   = (left-total [3 5 10 1 2 7])
   ([3 0] [5 3] [10 8] [1 18] [2 19] [7 21])

  If in doubt, use lazy-seq.

  (defn left-total
    [accum-fn accum s]
    (lazy-seq
      (when-let [[f  r] (seq s)]
          (cons [f accum] (left-total accum-fn (accum-fn accum f) r)

  user= (left-total + 0 [3 5 10 1 2 7])
  ([3 0] [5 3] [10 8] [1 18] [2 19] [7 21])

  Since you said, that + is more complicated in your specific case, you 
  might want this more general form. Otherwise the above can of course be 
  simplified…

  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

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

merge doesn't work on deftypes implementing IPersistentMap

2009-12-28 Thread Allen Rohner
I tried to call merge on a deftype implementing IPersistentMap, and
got an exception:

user (deftype Foo [a b] clojure.lang.IPersistentMap)
#'user/Foo

user (Foo 1 2)
#:Foo{:a 1, :b 2}
user (merge (Foo 1 2) {:a 3})
; Evaluation aborted.

nth not supported on this type: PersistentArrayMap
  [Thrown class java.lang.UnsupportedOperationException]

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

Backtrace:
  0: clojure.lang.RT.nth(RT.java:811)
  1: user.Foo__15735.cons(NO_SOURCE_FILE:1)
  2: clojure.lang.RT.conj(RT.java:534)
  3: clojure.core$conj__3951.invoke(core.clj:67)
  4: clojure.core$merge__4623$fn__4624.invoke(core.clj:1919)
  5: clojure.core$reduce__4135.invoke(core.clj:665)
  6: clojure.core$reduce__4135.invoke(core.clj:656)
  7: clojure.core$merge__4623.doInvoke(core.clj:1919)
  8: clojure.lang.RestFn.invoke(RestFn.java:422)
  9: user$eval__15820.invoke(NO_SOURCE_FILE:1)
 10: clojure.lang.Compiler.eval(Compiler.java:5258)
 11: clojure.lang.Compiler.eval(Compiler.java:5226)
 12: clojure.core$eval__4674.invoke(core.clj:2018)
 --more--


Interestingly, drewr on IRC pointed out that
(merge {:a 3} (Foo 1 2)) works. I then figured out that
(merge {} (Foo 1 2) {:a 3}) works.

This seems like a bug to me. Is it?

Allen


-- 
You 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: Access to nested static classes

2009-12-28 Thread David Brown
On Mon, Dec 28, 2009 at 02:50:59PM -0800, Mark Tomko wrote:
This, however, does not work:

(ns org.tomko.konkordans.analysis
  (:import
(org.tomko.konkordans NestedStatics)))

(def foo NestedStatics$LevelOne$LevelTwo/NO)

The class is called NestedStatics$LevelOne$LevelTwo, so you would have
to import that if you wanted to use it.  As far as the JVM is
concerned, NestedStatics, NestedStatics$LevelOne and
NestedStatics$LevelOne$LevelTwo are just three independent classes.

Java added nested classes, but didn't really add them to the JVM.  It
just makes longer class names using the '$'.

It's probably safe to rely on this behavior, since there is plenty of
code that depends upon it working this way.

David

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


Language similarities

2009-12-28 Thread jim
Had an interesting conversation with a programmer friend of mine. He's
skeptical of my Lisp leanings and mostly sticks to the 'normal'
languages; C++, Java, etc.

I made that comment that pretty much all the languages derived from
Algol like the C family, Java, Pascal, etc. were pretty much the same.
He looked at me like I was insane. :) :)

I guess when you're looking back on the world from the vantage point
of s-expressions, they do look the same. IMHO. :) Erlang and Haskell
would have a similar effect, I would suspect.

Jim

-- 
You 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: Help with my vec matching function

2009-12-28 Thread Tom Hicks
A technique that works for me is to create sequences which are
augmented
with properties and then filter and transform those sequences in a
kind of pipeline.
Using that approach I came up with the following:

(defn eval-candidate [needle candidate]
  Returns a map representing derived information about the candidate
vector and its
   fit with the search target (needle) vector
  {:score (reduce + (map #(if (= %1 %2) 1 0) needle candidate))
   :len (count candidate)
   :vec candidate}
)

(defn closest-match [needle haystack]
  Tries to find the best fit for the given needle vector in the
   haystack of candidate vectors
  (let [augmented (map (partial eval-candidate needle) haystack)
max-score (apply max (map :score augmented))]
(if (= max-score 0)  ; no good matches
at all
  []
  (let [candidates (filter #(= max-score (:score %)) augmented)]
(if ( (count candidates) 1) ; a single match wins
  (let [min-length (apply min (map :len candidates))
winners (filter #(= min-length (:len %)) candidates)]
(map :vec winners) )
  (map :vec candidates)
  ) ) ) )
)

cheers,
-tom

-- 
You 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: find source file for namespace?

2009-12-28 Thread nchubrich
But finding the source path from the namespace is what I can't figure
out.  You can look at metadata on a var, and this has a :file field,
but typically :file says NO_SOURCE_PATH.

On Dec 28, 12:33 am, Emeka emekami...@gmail.com wrote:
 Hello nchubrich,

 I thinking that you can do this with easy using namespace which would lead
 you to resolve the file name and then figure out the path.

 Emeka

 On Mon, Dec 28, 2009 at 2:43 AM, nchubrich nicholas.chubr...@gmail.comwrote:

  Does anyone know how to dynamically access the pathname for a
  particular piece of code?  I.E., I'd like to be able to write a
  function that can be called in any context and returns the pathname
  for the code it was called in.  (My intended use for this is to
  develop a testing package; I want to figure out an appropriate place
  to save the test files.)

  --
  You 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.comclojure%2bunsubscr...@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: Language similarities

2009-12-28 Thread ngocdaothanh
I don't know Algol, but I think you're correct:
http://www.paulgraham.com/diff.html


On Dec 29, 1:14 pm, jim jim.d...@gmail.com wrote:
 Had an interesting conversation with a programmer friend of mine. He's
 skeptical of my Lisp leanings and mostly sticks to the 'normal'
 languages; C++, Java, etc.

 I made that comment that pretty much all the languages derived from
 Algol like the C family, Java, Pascal, etc. were pretty much the same.
 He looked at me like I was insane. :) :)

 I guess when you're looking back on the world from the vantage point
 of s-expressions, they do look the same. IMHO. :) Erlang and Haskell
 would have a similar effect, I would suspect.

 Jim

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


ANN: Planet Clojure

2009-12-28 Thread Baishampayan Ghose
Hello Clojurians!

Introducting, Planet Clojure :) Clojure is growing very fast and there 
are a lot of people who write about Clojure. It was time we had our own 
Planet. So here you go -

http://planet.clojure.in/

I have added a few blogs to the Planet already, but if you write about 
Clojure and want your blog to be syndicated on Plane Clojure please send 
me the link to your blog's Atom/RSS feed and I will happily put you on 
the Planet.

If you have any suggestion/objection/bug report, feel free to contact me.

Regards,
BG

-- 
Baishampayan Ghose b.gh...@ocricket.com
oCricket.com

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


Re: ANN: Planet Clojure

2009-12-28 Thread Konrad Hinsen
On 29 Dec 2009, at 07:14, Baishampayan Ghose wrote:

 Introducting, Planet Clojure :) Clojure is growing very fast and there
 are a lot of people who write about Clojure. It was time we had our  
 own
 Planet. So here you go -

 http://planet.clojure.in/

Thanks - this looks nice!


 I have added a few blogs to the Planet already, but if you write about
 Clojure and want your blog to be syndicated on Plane Clojure please  
 send
 me the link to your blog's Atom/RSS feed and I will happily put you on
 the Planet.

Here's another Clojure blog:

http://onclojure.wordpress.com/

Konrad.

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


Re: Loading a .clj file automatically at repl startup?

2009-12-28 Thread Joost
You can also create a small start.clj file that does whatever it needs
to do (use 'foo) and ends with a call to (clojure.main/repl)

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