Re: can't see the error

2011-09-26 Thread Baishampayan Ghose
> i wasn't really trying to achieve anything useful - just messing
> around and see where i get.
>
> now i'm here:
> (defrecord point [x y z])
> (defn genPoints [n]
>  (let [random (new Random)
>        randomInt #(.nextInt random)
>        randomPoint #(new point (randomInt) (randomInt) (randomInt))]
>    (repeatedly n randomPoint)))
>
> is there a way to avoid writing (randomInt)(randomInt)(randomInt) and
> instead something like (magic (repeatedly 3 randomInt))?

This is how I would write it -

(defrecord Point [x y z])

;;; Only needed in pre Clojure 1.3.0
;;; In Clojure 1.3.0, ->Point will be generated automatically
;; (defn ->Point
;;   [x y z]
;;   (Point. x y z))

(defn gen-points [n]
  (let [random (java.util.Random.)
random-int #(.nextInt random)
random-point #(apply ->Point (repeatedly 3 random-int))]
(repeatedly n random-point)))

Hope this helps.

Regards,
BG

-- 
Baishampayan Ghose
b.ghose at gmail.com

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


Re: Randomly select an element from a sorted-set (rand-nth (sorted-set ..))

2011-09-26 Thread Alan Malloy
On Sep 26, 2:12 pm, Paul Richards  wrote:
> On Sep 26, 2:12 pm, Paul Richards  wrote:
>
> > Hi,
> > How can I efficiently pick a random element from a sorted-set?
>
> I've come up with a bit of a hack, which relies on me not caring about
> non-uniform distributions.  If I create a custom comparator with a
> "random" backdoor, I can select random elements from the sorted set:
>
> (defn my-comp [a b]
>     (if (or (= :random a) (= :random b))
>         (- (* 2 (rand-int 2)) 1)
>         (compare a b)))
>
> ; Create test collection (of strings) using the special comparator
> (def coll (apply sorted-set-by my-comp (map str (range 1 1000
>
> (map #(first (subseq coll > %)) ["500" "200" "700" :random :random])
> ; Result: ("501" "201" "701" "626" "286")
>
> Bonus question..  What is the distribution of the random selection?
>
> (I suspect elements will be chosen with some probability like (1/2)^H
> (where H is the height of the element within the red-black tree).  I
> should probably generate a histogram to find out..)

I think it's complicated by what you expect "chosen" to mean. If you
were randomly selecting a single element, you would only ever choose
one at the bottom of the tree; the internal nodes would never be
selected, right? Of course, you can't do that, since `get` does an
equality check before returning the item. And if you're selecting a
subseq, it depends on what test(s) you supply, and how many items you
take, and...

Anyway, this is sorta fun to generalize to wrap any other comparator:

(defn hackable-comparator [f]
  (fn [& xs]
(if (some #{:random} xs)
  (- (* 2 (rand-int 2)) 1)
  (apply f xs

(def my-comp (hackable-comparator compare))

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Randomly select an element from a sorted-set (rand-nth (sorted-set ..))

2011-09-26 Thread Benny Tsai
On Monday, September 26, 2011 2:58:59 PM UTC-6, Paul Richards wrote:
>
> This will replace an O(n) call to "nth" with an O(n) call to copy into 
> a vector, so still leaving me with O(n). 
>

Oops, right :)  If you're getting random elements out of the same sorted set 
multiple times, then it might be still be worth it to pay the cost of 
vectorizing the set once in exchange for faster subsequent random 
selections.  But if not, then I guess not so much.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Randomly select an element from a sorted-set (rand-nth (sorted-set ..))

2011-09-26 Thread Paul Richards
On Sep 26, 6:04 pm, Benny Tsai  wrote:
> The reason that (rand-nth (seq (sorted-set 1 2 3))) performs badly on large
> sets is probably because nth is O(n) on sequences.  nth is much much faster
> on vectors, so I would suggest trying out (rand-nth (vec (sorted-set 1 2
> 3))) and see if that works for your application.

This will replace an O(n) call to "nth" with an O(n) call to copy into
a vector, so still leaving me with O(n).

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Randomly select an element from a sorted-set (rand-nth (sorted-set ..))

2011-09-26 Thread Paul Richards
On Sep 26, 6:13 pm, Jeremy Heiler  wrote:
> On Mon, Sep 26, 2011 at 9:12 AM, Paul Richards  
> wrote:
> > Hi,
> > How can I efficiently pick a random element from a sorted-set?
>
> > If I try rand-nth I get this:
> > user=> (rand-nth (sorted-set 1 2 3))
> > java.lang.UnsupportedOperationException: nth not supported on this
> > type: PersistentTreeSet (NO_SOURCE_FILE:0)
>
> > I can get this expression to work if I naively apply seq:
> > user=> (rand-nth (seq (sorted-set 1 2 3)))
> > 1
>
> > However this performs very badly on large sets.  Is there a more
> > efficient way to do this?
>
> > (I need to keep my elements in a sorted-set for other parts of the
> > application, where I rely on subseq.)
>
> Try just getting the value with rand-int directly. The sorted-set uses
> a tree map underneath, so look up time is consistent with a map. Also,
> count is O(1).
>
> (get foo (rand-int (count foo)))

I feel I picked a bad example.  My sorted-set does not contain
integers, the elements are (collections of) strings.  Trying this
approach leads to a different failure:

user=> (get (sorted-set "a" "b" "c") 1)
java.lang.ClassCastException: java.lang.String cannot be cast to
java.lang.Number (NO_SOURCE_FILE:0)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Randomly select an element from a sorted-set (rand-nth (sorted-set ..))

2011-09-26 Thread Paul Richards
On Sep 26, 2:12 pm, Paul Richards  wrote:
> Hi,
> How can I efficiently pick a random element from a sorted-set?
>

I've come up with a bit of a hack, which relies on me not caring about
non-uniform distributions.  If I create a custom comparator with a
"random" backdoor, I can select random elements from the sorted set:

(defn my-comp [a b]
(if (or (= :random a) (= :random b))
(- (* 2 (rand-int 2)) 1)
(compare a b)))

; Create test collection (of strings) using the special comparator
(def coll (apply sorted-set-by my-comp (map str (range 1 1000

(map #(first (subseq coll > %)) ["500" "200" "700" :random :random])
; Result: ("501" "201" "701" "626" "286")



Bonus question..  What is the distribution of the random selection?

(I suspect elements will be chosen with some probability like (1/2)^H
(where H is the height of the element within the red-black tree).  I
should probably generate a histogram to find out..)

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


Re: clojure : collaborative learning ...

2011-09-26 Thread Kevin Lynagh
Are these two related?

https://github.com/jandot/bioclojure

https://github.com/jayunit100/BioClojure

What exactly are you trying to make---a set of libraries or starter-
kit for Incanter on bioinformatics problems?

I've found it much easier to write code towards solving a concrete
problem and factoring it apart into a library afterwards, rather than
building a toolkit without a particular focus.
If your group has a specific problem, I'd love to hear about it.

On Sep 25, 7:34 pm, Jay Vyas  wrote:
> Hi guys :
>
> - We started the BioClojure project to learn about Clojure by applying it to
> some bioinformatics problems.
>
> -Its gone well, and we now know the basics of leiningan, java-interop, and
> basic map-oriented programming.
>
> -But of course, thats not enough --- we are now aspiring to reach that next
> level of Clojure zen -- using the really powerful features, like macros ---
> to engineer a real app.
>
> So > Is  anyone interested in learning about incanter, machine learning,
> parser combinators, and clojure  ?  We wanted to add a text file analysis
> module to BioClojure, and it would be a good learning experience for all of
> us.  In particular, we're interested in learning more about macros, and
> higher level programming/engineering in Clojure.

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


Re: ClojureScript: Problem getting Browser Repl Env to Work

2011-09-26 Thread David Nolen
I don't this is a bug. ClojureScript requires UTF-8.

David

On Mon, Sep 26, 2011 at 5:03 PM, Volker Schlecht
wrote:

> Got it ... here's what was missing from my index.html:
>
> 
>
> If I remove that, browser.repl fails. Can anyone else reproduce /
> confirm this?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: can't see the error

2011-09-26 Thread Andy Fingerhut
This:

randomPoint #(apply new point (repeatedly 3 randomInt))

does not work, but is almost what you want.  It doesn't work because new is
a macro, and apply only works with functions as the first arg.

Using the following two lines, first to define a function, then to use it
with apply, seems like it ought to work.  Not sure whether it is magic
enough for you, though :-)

newpt #(new point %1 %2 %3)
randomPoint #(apply newpt (repeatedly 3 randomInt))

Andy


On Mon, Sep 26, 2011 at 3:49 PM, Jeremy Heiler wrote:

> On Mon, Sep 26, 2011 at 5:33 PM, Dennis Haupt 
> wrote:
> > now i'm here:
> > (defrecord point [x y z])
> > (defn genPoints [n]
> >  (let [random (new Random)
> >randomInt #(.nextInt random)
> >randomPoint #(new point (randomInt) (randomInt) (randomInt))]
> >(repeatedly n randomPoint)))
> >
> > is there a way to avoid writing (randomInt)(randomInt)(randomInt) and
> > instead something like (magic (repeatedly 3 randomInt))?
>
> I'm not sure if this the best way, but it would work.
>
> (eval `(new point ~@(take 3 (repeatedly #(rand-int 10)
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from 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: can't see the error

2011-09-26 Thread Jeremy Heiler
On Mon, Sep 26, 2011 at 5:33 PM, Dennis Haupt  wrote:
> now i'm here:
> (defrecord point [x y z])
> (defn genPoints [n]
>  (let [random (new Random)
>        randomInt #(.nextInt random)
>        randomPoint #(new point (randomInt) (randomInt) (randomInt))]
>    (repeatedly n randomPoint)))
>
> is there a way to avoid writing (randomInt)(randomInt)(randomInt) and
> instead something like (magic (repeatedly 3 randomInt))?

I'm not sure if this the best way, but it would work.

(eval `(new point ~@(take 3 (repeatedly #(rand-int 10)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Does macros evaluates its arguments before?

2011-09-26 Thread Alan Malloy
I suspect your repl was stale, since this doesn't work at all. By an
amusing coincidence, though, it doesn't break, just returns the wrong
answer:

user=> (defmacro infix [e] `(let [[x# f# y#] '~e] (f# x# y#)))
#'user/infix
user=> (infix (5 + 4))
4

That is, the *symbol* +, not the function +, is called as a function.
Symbols act like keywords in that they look themselves up in maps. The
"map" 5 does not contain the symbol '+, so the not-found value of 4 is
returned.

On Sep 26, 10:22 am, ru  wrote:
> Thanks to all!
>
> With your help I have found the solution that coincide with Bronsa's
> (my special respect to Bronsa):
>
> user=> (defmacro infix [e] `(let [[x# f# y#] '~e] (f# x# y#)))
> #'user/infix
> user=> (infix (5 + 4))
> 9
>
> But, this solution seems to me awkward and showing that Clojure
> compiler does not handling quite strictly language specification
> requirements. I.e., this single quote compiler should substitute
> itself to fulfill requirement of unevaluation arguments of macro.
>
> Sincerely,
>   Ru

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: can't see the error

2011-09-26 Thread Dennis Haupt
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

i wasn't really trying to achieve anything useful - just messing
around and see where i get.

now i'm here:
(defrecord point [x y z])
(defn genPoints [n]
  (let [random (new Random)
randomInt #(.nextInt random)
randomPoint #(new point (randomInt) (randomInt) (randomInt))]
(repeatedly n randomPoint)))

is there a way to avoid writing (randomInt)(randomInt)(randomInt) and
instead something like (magic (repeatedly 3 randomInt))?

Am 25.09.2011 22:14, schrieb Baishampayan Ghose:
> On Mon, Sep 26, 2011 at 1:21 AM, Dennis Haupt
>  wrote:
>> (let [rand (new java.util.Random) nextInt (fn [a] (.nextInt
>> rand))] ((map (print) (iterate ((nextInt "dummy") 0)
>> 
>> 
>> the error is: java.lang.ClassCastException: java.lang.Integer
>> cannot be cast to clojure.lang.IFn (NO_SOURCE_FILE:0)
>> 
>> why does it want to cast my "0" to a function? and how can i get
>> rid of the dummy parameter [a]?
> 
> You have too many parentheses in your code. The error is coming 
> because of the ``((nextInt "dummy") 0)'' line where you are trying
> to call an integer (the result of calling nextInt on "dummy") as a 
> function.
> 
> I don't know what exactly you are trying to achieve here, but
> assuming that you want n consecutive pseudo-random integers, I
> would write it like this -
> 
> (let [rnd (java.util.Random.) next-int #(.nextInt rnd)] (repeatedly
> 10 next-int)) ; substitute 10 with desired number
> 
> Regards, BG
> 


- -- 

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.14 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOgO+8AAoJENRtux+h35aGF2kP/3MGVpxqqkax5O0kmX/Kh9u5
b48b6YrlgPwbSvTra2aqs+4rLF4U8mUUN82XyacB+PFAc6PeE3I8/aJudUvFO0RP
c8qL31NKPSm8RTvhPWzBejh2pyu1cP4qZtmgrSFfSan34n/oadfi0w8c1AjHsQqr
MVMMo2gY/U4J68wG2I7bNdbx3VT1OtmZlY04UBh5D9F6NXJ11+hEZLS89K32F6up
hi0EoruOxgeJnWDMLdTsKCUiSzlI8m6ZSlRVu8aj/xkdfcDXQhNVLp/UEmKhX355
wdkZm7VHHKop1c057vlXO8Fz6eUZ2E1RV3jf2osieg3Exj5s4cHncUES5cxZ14NF
6b0Avqxf69yX5ids2OOTaTqWrniRVqhf2KyDZGmgJfgwDyfLxMeephp/3glfYrbf
L3CIsXmjwebtFkwDm9LJvO8DXsOY+NU2ZgwfGCRqbwNxQU+0TMsGGgIypvD2rnM1
zAQE9kmcKLALLOwFcu6hN/OntpjtOk5e51hA7V/1oAk8H0BWOEKW1aYMggwoySgG
ti9BPg8MqyTBtZmqFUyOPFH3EQr8sEjRXpu2Wf1RxATShfNWwalqeOHbEhV/vJkO
SunWpUn/eqKaTzAq+ZI9VrWteMrmklHDlo7PhEwkp6JVFxUj3psfkQeqdY9fSRjz
Ei2jqCQXBMRO2CGEC/+R
=bKcz
-END PGP SIGNATURE-

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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 Repl -- Swank-like workflow with Emacs?

2011-09-26 Thread Volker Schlecht
The example given in the wiki uses an in-browser repl. If you want to
work with the "regular" rhino-repl, replace

(require '[cljs.repl.browser :as browser])

with

(require '[cljs.repl.rhino :as rhino])

And you should be all set.

On Sep 26, 4:28 pm, Paul Koerbitz  wrote:
> Hi David!
>
> thanks for the fast reply and this solution.
>
> I haven't gotten it to work yet, but this is more than likely due to me not
> really understanding how to put all the moving parts together.
>
> Here is what I did:
>
> Put your code into 'browser-repl'. Now if I execute this on the command line
> I get this prompt
>
> #'user/env
> "Type: " :cljs/quit " to quit"
> Starting Server on Port: 9000
> ClojureScript:cljs.user>
>
> and when I open up some page with clojure script (e.g.
> samples/repl/index.html) I can execute sutff in the browser such as
> (js/alert "hello, world!").
>
> However, if I run the script as an inferior-lisp process I also get this
> output in the *inferior-lisp* window
>
> #'user/env
> "Type: " :cljs/quit " to quit"
> Starting Server on Port: 9000
> ClojureScript:cljs.user>
>
> but I can't connect the browser. the file still loads but if I enter stuff
> in the repl the repl just hangs.
>
> I am sure I am missing something, right now I just don't see what.
>
> thanks for the help so far.
> Paul
>
>
>
>
>
>
>
> On Mon, Sep 26, 2011 at 15:55, David Nolen  wrote:
> > I've created the following wiki -
> >https://github.com/clojure/clojurescript/wiki/Emacs-&-inferior-lisp-mode
>
> > Let me know if this needs more clarification.
>
> > David
>
> > On Mon, Sep 26, 2011 at 9:15 AM, Paul Koerbitz 
> > wrote:
>
> >> Dear Clojurians,
>
> >> I was toying with Clojurescript and really like using the Repl as
> >> described herehttps://github.com/clojure/clojurescript/wikito try
> >> things out. (thanks for all the great to everyone involved!!)
>
> >> Has anyone hooked this into Emacs in a Swank-like fashion? I would love to
> >> be able to send forms to C-c C-c or ''compile'' a file with C-c C-k.
>
> >> thanks
> >> Paul
>
> >> --
> >> You received this message because you are subscribed to the Google
> >> Groups "Clojure" group.
> >> To post to this group, send email to clojure@googlegroups.com
> >> Note that posts from new members are moderated - please be patient with
> >> your first post.
> >> To unsubscribe from this group, send email to
> >> clojure+unsubscr...@googlegroups.com
> >> For more options, visit this group at
> >>http://groups.google.com/group/clojure?hl=en
>
> >  --
> > You received this message because you are subscribed to the Google
> > Groups "Clojure" group.
> > To post to this group, send email to clojure@googlegroups.com
> > Note that posts from new members are moderated - please be patient with
> > your first post.
> > To unsubscribe from 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: ClojureScript: Problem getting Browser Repl Env to Work

2011-09-26 Thread Volker Schlecht
Got it ... here's what was missing from my index.html:



If I remove that, browser.repl fails. Can anyone else reproduce /
confirm this?

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


Re: Does macros evaluates its arguments before?

2011-09-26 Thread Bronsa
oh, that's right

2011/9/26 Alan Malloy 

> Noo, then you can't do, for example, (let [x 1] (infix (x + 1))).
>
> On Sep 26, 8:34 am, Bronsa  wrote:
> > or simply replace ~e with '~e
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from 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: Does macros evaluates its arguments before?

2011-09-26 Thread Tassilo Horn
ru  writes:

Hi Ru,

> Thank you very much, really grand job!

I'm glad to have helped.

> By the way, I was preparing this example for students. So, you've done
> all the work for me! :)

The bill will arrive anytime soon. :-)

Bye,
Tassilo

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Does macros evaluates its arguments before?

2011-09-26 Thread ru
Tassilo!

Thank you very much, really grand job!
By the way, I was preparing this example for students. So, you've done
all the work for me! :)

Best regards,
 Ru

On 26 сен, 22:31, Tassilo Horn  wrote:
> Hi again,
>
> just for the fun of doing it, here's a recursive version of infix:
>
> --8<---cut here---start->8---
> (defmacro infix [x]
>   (if (sequential? x)
>     `(~(second x) (infix ~(first x)) (infix ~(nth x 2)))
>      x))
> --8<---cut here---end--->8---
>
> That works fine no matter if you use vectors or lists, because I simply
> pick the operator and the 2 args manually.
>
> I think it's educational to follow a complete macroexpansion process.
> Here's an example:
>
> --8<---cut here---start->8---
> (let [a 3, b 2, c 3]
>   (infix ((a * b) + [c * c])))
>
> Expands to:
> (let* [a 3 b 2 c 3]
>   (+ (infix (a * b)) (infix [c * c])))
>
> Expands to:
> (let* [a 3 b 2 c 3]
>   (+ (* (infix a) (infix b)) (infix [c * c])))
>
> Expands to:
> (let* [a 3 b 2 c 3]
>   (+ (* a (infix b)) (infix [c * c])))
>
> Expands to:
> (let* [a 3 b 2 c 3]
>   (+ (* a b) (infix [c * c])))
>
> Expands to:
> (let* [a 3 b 2 c 3]
>   (+ (* a b) (* (infix c) (infix c
>
> Expands to:
> (let* [a 3 b 2 c 3]
>   (+ (* a b) (* c (infix c
>
> Finally, expands to:
> (let* [a 3 b 2 c 3]
>   (+ (* a b) (* c c)))
> --8<---cut here---end--->8---
>
> HTH,
> Tassilo

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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 Repl -- Swank-like workflow with Emacs?

2011-09-26 Thread Paul Koerbitz
Hi David!

thanks for the fast reply and this solution.

I haven't gotten it to work yet, but this is more than likely due to me not
really understanding how to put all the moving parts together.

Here is what I did:

Put your code into 'browser-repl'. Now if I execute this on the command line
I get this prompt

#'user/env
"Type: " :cljs/quit " to quit"
Starting Server on Port: 9000
ClojureScript:cljs.user>

and when I open up some page with clojure script (e.g.
samples/repl/index.html) I can execute sutff in the browser such as
(js/alert "hello, world!").

However, if I run the script as an inferior-lisp process I also get this
output in the *inferior-lisp* window

#'user/env
"Type: " :cljs/quit " to quit"
Starting Server on Port: 9000
ClojureScript:cljs.user>

but I can't connect the browser. the file still loads but if I enter stuff
in the repl the repl just hangs.

I am sure I am missing something, right now I just don't see what.

thanks for the help so far.
Paul

On Mon, Sep 26, 2011 at 15:55, David Nolen  wrote:

> I've created the following wiki -
> https://github.com/clojure/clojurescript/wiki/Emacs-&-inferior-lisp-mode
>
> Let me know if this needs more clarification.
>
> David
>
> On Mon, Sep 26, 2011 at 9:15 AM, Paul Koerbitz wrote:
>
>> Dear Clojurians,
>>
>> I was toying with Clojurescript and really like using the Repl as
>> described here https://github.com/clojure/clojurescript/wiki to try
>> things out. (thanks for all the great to everyone involved!!)
>>
>> Has anyone hooked this into Emacs in a Swank-like fashion? I would love to
>> be able to send forms to C-c C-c or ''compile'' a file with C-c C-k.
>>
>> thanks
>> Paul
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from 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: ClojureScript Repl -- Swank-like workflow with Emacs?

2011-09-26 Thread Paul Koerbitz
Hi David, everyone,

oops, my bad, sending forms to the *inferior-lisp* buffer actually works
with C-c C-e. I just can't type anything in directly but I assume that is
due to my Emacs setup (as a die-hard vim user I am using viper and that
sometimes makes things behave a little weird). Thanks again for your help.

cheers
Paul

On Mon, Sep 26, 2011 at 16:28, Paul Koerbitz wrote:

> Hi David!
>
> thanks for the fast reply and this solution.
>
> I haven't gotten it to work yet, but this is more than likely due to me not
> really understanding how to put all the moving parts together.
>
> Here is what I did:
>
> Put your code into 'browser-repl'. Now if I execute this on the command
> line I get this prompt
>
> #'user/env
> "Type: " :cljs/quit " to quit"
> Starting Server on Port: 9000
> ClojureScript:cljs.user>
>
> and when I open up some page with clojure script (e.g.
> samples/repl/index.html) I can execute sutff in the browser such as
> (js/alert "hello, world!").
>
> However, if I run the script as an inferior-lisp process I also get this
> output in the *inferior-lisp* window
>
> #'user/env
> "Type: " :cljs/quit " to quit"
> Starting Server on Port: 9000
> ClojureScript:cljs.user>
>
> but I can't connect the browser. the file still loads but if I enter stuff
> in the repl the repl just hangs.
>
> I am sure I am missing something, right now I just don't see what.
>
> thanks for the help so far.
> Paul
>
>
> On Mon, Sep 26, 2011 at 15:55, David Nolen  wrote:
>
>> I've created the following wiki -
>> https://github.com/clojure/clojurescript/wiki/Emacs-&-inferior-lisp-mode
>>
>> Let me know if this needs more clarification.
>>
>> David
>>
>> On Mon, Sep 26, 2011 at 9:15 AM, Paul Koerbitz 
>> wrote:
>>
>>> Dear Clojurians,
>>>
>>> I was toying with Clojurescript and really like using the Repl as
>>> described here https://github.com/clojure/clojurescript/wiki to try
>>> things out. (thanks for all the great to everyone involved!!)
>>>
>>> Has anyone hooked this into Emacs in a Swank-like fashion? I would love
>>> to be able to send forms to C-c C-c or ''compile'' a file with C-c C-k.
>>>
>>> thanks
>>> Paul
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clojure@googlegroups.com
>>> Note that posts from new members are moderated - please be patient with
>>> your first post.
>>> To unsubscribe from this group, send email to
>>> clojure+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>
>>
>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from 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.contrib.io, clojure.contrib.http.agent and clojure.contrib.http.connection for Clojure 1.3

2011-09-26 Thread Alf Kristian Støyle
Looks really good. However it does not seem to support asynchronous
calls, which was really what we were looking for. We thought
http-agent was a cool idea.

Guess it wouldn't be too much work to use agents to store results of
clj_http though, I will definitely give it a try!

Cheers,
Alf



On Mon, Sep 26, 2011 at 17:18, Benny Tsai  wrote:
> Mark McGranaghan and Lee Hinman's clj-http is a nice HTTP library that's
> fully compatible with Clojure 1.3:
>
> https://github.com/dakrone/clj-http
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from 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.contrib.io, clojure.contrib.http.agent and clojure.contrib.http.connection for Clojure 1.3

2011-09-26 Thread Alf Kristian Støyle
> Most of clojure.contrib.io was moved into Clojure itself, as
> clojure.java.io. There is no future plan for functions from
> clojure.contrib.io which have not already been copied into clojure.java.io.

Guess I should have noticed that :) We certainly had no problems
replacing clojure.contrib.io with clojure.java.io.

> clojure.contrib.http-agent was a weak idea with mediocre execution. (I wrote
> it.) It is fundamentally flawed in how it deals with exceptions,
> error-codes, and blocking. Feel free to continue to use it, but I am not
> supporting it.

Ok, no problem. We will only use it for this workshop anyways.

Thanks,
Alf

>
> Regards,
> -Stuart Sierra
> clojure.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

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Does macros evaluates its arguments before?

2011-09-26 Thread Tassilo Horn
Hi again,

just for the fun of doing it, here's a recursive version of infix:

--8<---cut here---start->8---
(defmacro infix [x]
  (if (sequential? x)
`(~(second x) (infix ~(first x)) (infix ~(nth x 2)))
 x))
--8<---cut here---end--->8---

That works fine no matter if you use vectors or lists, because I simply
pick the operator and the 2 args manually.

I think it's educational to follow a complete macroexpansion process.
Here's an example:

--8<---cut here---start->8---
(let [a 3, b 2, c 3]
  (infix ((a * b) + [c * c])))

Expands to:
(let* [a 3 b 2 c 3]
  (+ (infix (a * b)) (infix [c * c])))

Expands to:
(let* [a 3 b 2 c 3]
  (+ (* (infix a) (infix b)) (infix [c * c])))

Expands to:
(let* [a 3 b 2 c 3]
  (+ (* a (infix b)) (infix [c * c])))

Expands to:
(let* [a 3 b 2 c 3]
  (+ (* a b) (infix [c * c])))

Expands to:
(let* [a 3 b 2 c 3]
  (+ (* a b) (* (infix c) (infix c

Expands to:
(let* [a 3 b 2 c 3]
  (+ (* a b) (* c (infix c

Finally, expands to:
(let* [a 3 b 2 c 3]
  (+ (* a b) (* c c)))
--8<---cut here---end--->8---

HTH,
Tassilo

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


Re: clojure.contrib.io, clojure.contrib.http.agent and clojure.contrib.http.connection for Clojure 1.3

2011-09-26 Thread Sean Corfield
On Mon, Sep 26, 2011 at 6:45 AM, Stuart Sierra
 wrote:
> Most of clojure.contrib.io was moved into Clojure itself, as
> clojure.java.io.

When I created 
http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
I did it based on the modules folder here
https://github.com/clojure/clojure-contrib/tree/master/modules

I don't see io or http there - were those migrated in 1.2.0? Or were
they just dropped when monolithic contrib was broken into modules?
Should I update that wiki page to show more/older modules and where
they went?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/
Railo Technologies, Inc. -- http://www.getrailo.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Does macros evaluates its arguments before?

2011-09-26 Thread Tassilo Horn
ru  writes:

Hi Ru,

> With your help I have found the solution that coincide with Bronsa's
> (my special respect to Bronsa):
>
> user=> (defmacro infix [e] `(let [[x# f# y#] '~e] (f# x# y#)))
> #'user/infix
> user=> (infix (5 + 4))
> 9

Alan already told you that this solution is not really good.  It works
only if the operands are number literals.

> But, this solution seems to me awkward and showing that Clojure
> compiler does not handling quite strictly language specification
> requirements. I.e., this single quote compiler should substitute
> itself to fulfill requirement of unevaluation arguments of macro.

The macro doesn't evaluate its arguments, but it creates an expansion
that looks roughly like (let [[x op y] (5 + 6)] ...).  In this
macro-generated code, (5 + 4) is evaluated at runtime, and then the
exception is thrown.  So its not that defmacro evals its args, but your
macro creates code that blows up at runtime.

Bye,
Tassilo

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: can't see the error

2011-09-26 Thread Dennis Haupt
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

i don't have the magic eye to spot the parenthesis-errors yet

Am 25.09.2011 22:15, schrieb Mark Rathwell:
>> (let [rand (new java.util.Random) nextInt (fn [a] (.nextInt
>> rand))] ((map (print) (iterate ((nextInt "dummy") 0)
> 
> extra parenthesis in three places, and the first argument to
> iterate is a function, not a long:
> 
> (let [rand (new java.util.Random) nextInt (fn [a] (.nextInt
> rand))] (map print (iterate nextInt 0)))
> 
> 
> On Sun, Sep 25, 2011 at 3:51 PM, Dennis Haupt
>  wrote: (let [rand (new java.util.Random)
> nextInt (fn [a] (.nextInt rand))] ((map (print) (iterate ((nextInt
> "dummy") 0)
> 
> 
> the error is: java.lang.ClassCastException: java.lang.Integer
> cannot be cast to clojure.lang.IFn (NO_SOURCE_FILE:0)
> 
> why does it want to cast my "0" to a function? and how can i get
> rid of the dummy parameter [a]?
> 
>> 
>> -- You received this message because you are subscribed to the
>> Google Groups "Clojure" group. To post to this group, send email
>> to clojure@googlegroups.com Note that posts from new members are
>> moderated - please be patient with your first post. To
>> unsubscribe from this group, send email to 
>> clojure+unsubscr...@googlegroups.com For more options, visit this
>> group at http://groups.google.com/group/clojure?hl=en
> 


- -- 

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.14 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOgLayAAoJENRtux+h35aG5UgQAJMV850ntNNio3g2HCcaVj4E
LH4KfnIhC0otFrEQQfHg3ha+mBuo9flt55NnHGMfEBNdxCTkfpm0SDzqt6QTKBRA
aGDDJuTyAbmnSvGnOkk60RRqeVS1QOErRyjzrMugNxguNQ5ZUKmZ5GeTndLHn0w0
g81CRfF0CSLD8j9ng98iJOdn/VwyijeATQo2b/DQhkyKHyFzlyGT3LXrRgWYAI5o
NbCzMC1K/0o9LPyP9TGBvOoRrKQ28WzMsJGWhV0bWNmsMzeZokE99UDSUvYpRM+f
OpyL/4MCkW6f1imGWzLpSBMHZqLSwkXX7U2fNrMGj1zi4knir/D3LF+aw5XLmkms
oS6IO5qnttQ1IHCsdC9nflYfk891CNEwgGS9jG7RPJ75Zls6VzYL6zT8V/RN1xr3
3s2fYVH2elIM1SVXphTRsY5bqw7xNa0Jti8ual9j5+t+HiQ8qyqX6Yxf6KQZ+9Ux
EkfpjjFw2Fh4JpJ9dYK1sOncho9j18TLE6afUuTLPYqPlhV5b0AcpPJ3XEA0ayef
U2Plapgp4Jxk6IMGAoMyD/fyaRkiOKIQw+TucWc4F2icX10LjVbM2eacyKLwvwPo
gmgGHfNyRj4dHOmRv40x9JheRiqJdXtuoWEks9wSY3D6sUS3qWNplCwfpJMWhIhT
Dc/HVQYRIunjZ+cGALHQ
=It6H
-END PGP SIGNATURE-

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Does macros evaluates its arguments before?

2011-09-26 Thread ru
Thanks to all!

With your help I have found the solution that coincide with Bronsa's
(my special respect to Bronsa):

user=> (defmacro infix [e] `(let [[x# f# y#] '~e] (f# x# y#)))
#'user/infix
user=> (infix (5 + 4))
9

But, this solution seems to me awkward and showing that Clojure
compiler does not handling quite strictly language specification
requirements. I.e., this single quote compiler should substitute
itself to fulfill requirement of unevaluation arguments of macro.

Sincerely,
  Ru


-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Unable to use/refer/require clojure.contrib

2011-09-26 Thread Stuart Sierra
Hi Zhi Yang,

The easiest way to make the transition to 1.3 is to start using "new" 
contrib libraries first. Most of them are still compatible with Clojure 1.2, 
so you can update your libraries first, make sure everything works, then 
update to Clojure 1.3.

Regards,
-Stuart Sierrra
clojure.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: Randomly select an element from a sorted-set (rand-nth (sorted-set ..))

2011-09-26 Thread Jeremy Heiler
On Mon, Sep 26, 2011 at 9:12 AM, Paul Richards  wrote:
> Hi,
> How can I efficiently pick a random element from a sorted-set?
>
> If I try rand-nth I get this:
> user=> (rand-nth (sorted-set 1 2 3))
> java.lang.UnsupportedOperationException: nth not supported on this
> type: PersistentTreeSet (NO_SOURCE_FILE:0)
>
> I can get this expression to work if I naively apply seq:
> user=> (rand-nth (seq (sorted-set 1 2 3)))
> 1
>
> However this performs very badly on large sets.  Is there a more
> efficient way to do this?
>
> (I need to keep my elements in a sorted-set for other parts of the
> application, where I rely on subseq.)

Try just getting the value with rand-int directly. The sorted-set uses
a tree map underneath, so look up time is consistent with a map. Also,
count is O(1).

(get foo (rand-int (count foo)))

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Randomly select an element from a sorted-set (rand-nth (sorted-set ..))

2011-09-26 Thread Benny Tsai
The reason that (rand-nth (seq (sorted-set 1 2 3))) performs badly on large 
sets is probably because nth is O(n) on sequences.  nth is much much faster 
on vectors, so I would suggest trying out (rand-nth (vec (sorted-set 1 2 
3))) and see if that works for your application.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Does macros evaluates its arguments before?

2011-09-26 Thread Alan Malloy
Noo, then you can't do, for example, (let [x 1] (infix (x + 1))).

On Sep 26, 8:34 am, Bronsa  wrote:
> or simply replace ~e with '~e

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: trace-forms macro

2011-09-26 Thread Jonathan Fischer Friberg
I looked at it today and have updated the macro.
(same gist: https://gist.github.com/1209498)

Additions:
It detects if a form contains (recur ...), and if it does,
the form isn't wrapped in (try ...).

trace vectors, maps, and sets.

trace (fn* ...) & (new ...)

---

The code feels a bit "thrown together" right now, if anyone would like to
take a look,
that would be great.

---

To Marczyk:
Sure, where to?

Jonathan

On Sat, Sep 24, 2011 at 10:27 PM, Michał Marczyk
wrote:

> Oh, that's a nice idea! Definitely looks like a worthy addition to the
> trace lib.
>
> I believe the process around contributions to contrib involves a CA,
> though; Jonathan: do you have one in place? Any chance you might be
> convinced to submit one if not? :-)
>
> Sincerely,
> Michał
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from 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: Randomly select an element from a sorted-set (rand-nth (sorted-set ..))

2011-09-26 Thread Michael Gardner
On Sep 26, 2011, at 8:12 AM, Paul Richards wrote:

> How can I efficiently pick a random element from a sorted-set?

If your sorted set is densely packed (if most possible values do appear in the 
set), then you could just pick a random value, see if it's in the set, and 
repeat until you find a match.

Otherwise, you could use a sorted-vector. I don't know if there's a good 
implementation out there, though, so you might have to roll your own.

Or you could use a sorted-set that can do a "random binary search", where it 
chooses between the first and second halves at random rather than by comparison 
with a particular value. Maybe you could subclass the Clojure sorted-set to do 
this, though I'm guessing it's not made for subclassing.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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] ClojureCLR 1.3.0 released

2011-09-26 Thread tonyl
Oh yeah, I am going it in Mono and in the Windows machine with .Net
thanks for the big release :)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Does macros evaluates its arguments before?

2011-09-26 Thread Bronsa
or simply replace ~e with '~e

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

Re: clojure.contrib.io, clojure.contrib.http.agent and clojure.contrib.http.connection for Clojure 1.3

2011-09-26 Thread Benny Tsai
Mark McGranaghan and Lee Hinman's clj-http is a nice HTTP library that's 
fully compatible with Clojure 1.3:

https://github.com/dakrone/clj-http

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Does macros evaluates its arguments before?

2011-09-26 Thread Mark Rathwell
Use macroexpand-1 to expand a call to this macro, and it should be
clear what is going on.  The expanded code tries to call 5 as a
function.  What you are probably trying to do here is make (5 + 2) a
list, not a function call.

;; (note the unquote splicing of e)

(defmacro infix [e] `(let [[x# f# y#] (list ~@e)] (f# x# y#)))


2011/9/26 Aaron Cohen :
>
>
> 2011/9/26 ru 
>>
>> That's exactly means evaluation of argument that's contradict to
>> mentioned above documentation!
>>
>> On 26 сен, 18:18, Tassilo Horn  wrote:
>> > > Ok, this is working! But, what's the difference?
>> >
>> > Your code:
>> >
>> >   user=> (defmacro infix [e] `(let [[x# f# y#] ~e] (f# x# y#)))
>> >
>> > The ~e evaluates the given form, which looks like a function but is not.
>> >
>>
> In other words, your version of infix expands to approximately: (let [x_1
> f_2 y_3] (5 + 4)] (f_2 x_1 y_3)) and the destructuring in "let" is what
> causes the problem at runtime.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from 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: Does macros evaluates its arguments before?

2011-09-26 Thread Aaron Cohen
2011/9/26 ru 
>
> That's exactly means evaluation of argument that's contradict to
> mentioned above documentation!
>
> On 26 сен, 18:18, Tassilo Horn  wrote:
> > > Ok, this is working! But, what's the difference?
> >
> > Your code:
> >
> >   user=> (defmacro infix [e] `(let [[x# f# y#] ~e] (f# x# y#)))
> >
> > The ~e evaluates the given form, which looks like a function but is not.
> >
>
> In other words, your version of infix expands to approximately: (let [x_1
f_2 y_3] (5 + 4)] (f_2 x_1 y_3)) and the destructuring in "let" is what
causes the problem at runtime.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Does macros evaluates its arguments before?

2011-09-26 Thread Dave Ray
The argument isn't being evaluated during macro expansion, it's being
evaluated when the expanded form is evaluated by the repl:

user=> (macroexpand '(infix (5 + 4)))
(let* [vec__590 (5 + 4) x__574__auto__ (clojure.core/nth vec__590 0
nil) f__575__auto__ (clojure.core/nth vec__590 1 nil) y__576__auto__
(clojure.core/nth vec__590 2 nil)] (f__575__auto__ x__574__auto__
y__576__auto__))
user=> (let* [vec__590 (5 + 4) x__574__auto__ (clojure.core/nth
vec__590 0 nil) f__575__auto__ (clojure.core/nth vec__590 1 nil)
y__576__auto__ (clojure.core/nth vec__590 2 nil)] (f__575__auto__
x__574__auto__ y__576__auto__))
java.lang.ClassCastException: java.lang.Integer cannot be cast to
clojure.lang.IFn (NO_SOURCE_FILE:0)

Make sense?

Dave

On Mon, Sep 26, 2011 at 10:26 AM, ru  wrote:
> Timothy!
>
> Thank you for the explanation. I understand quite well about
> performance. I do'nt understand why it evaluates argument (5 + 4)
> during expansion in my case?
>
> Ru
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from 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: Does macros evaluates its arguments before?

2011-09-26 Thread ru
Well, Tassilo.

That's exactly means evaluation of argument that's contradict to
mentioned above documentation!

On 26 сен, 18:18, Tassilo Horn  wrote:
> ru  writes:
> > user=> (defmacro infix [[x f y]] `(~f ~x ~y))
> > #'user/infix
> > user=> (infix (5 + 4))
> > 9
>
> > Ok, this is working! But, what's the difference?
>
> Your code:
>
>   user=> (defmacro infix [e] `(let [[x# f# y#] ~e] (f# x# y#)))
>
> The ~e evaluates the given form, which looks like a function but is not.
>
> Bye,
> Tassilo

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Does macros evaluates its arguments before?

2011-09-26 Thread ru
Timothy!

Thank you for the explanation. I understand quite well about
performance. I do'nt understand why it evaluates argument (5 + 4)
during expansion in my case?

Ru

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Does macros evaluates its arguments before?

2011-09-26 Thread Timothy Baldridge
One very important difference is that your original version creates
three variables on-the-fly. It then copies the input into these
variables, just to perform a simple addition. This could have a fairly
severe performance penalty in a inner loop. David's version doesn't
suffer from this. The performance hit is a onetime compile cost, from
there it will run just as fast as prefix notation.

As to the actual macro syntax errors you had, I haven't a clue...

Timothy

On Mon, Sep 26, 2011 at 9:11 AM, ru  wrote:
> user=> (defmacro infix [[x f y]] `(~f ~x ~y))
> #'user/infix
> user=> (infix (5 + 4))
> 9
>
> Ok, this is working! But, what's the difference?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>



-- 
“One of the main causes of the fall of the Roman Empire was
that–lacking zero–they had no way to indicate successful termination
of their C programs.”
(Robert Firth)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Does macros evaluates its arguments before?

2011-09-26 Thread Tassilo Horn
ru  writes:

> user=> (defmacro infix [[x f y]] `(~f ~x ~y))
> #'user/infix
> user=> (infix (5 + 4))
> 9
>
> Ok, this is working! But, what's the difference?

Your code:

  user=> (defmacro infix [e] `(let [[x# f# y#] ~e] (f# x# y#)))

The ~e evaluates the given form, which looks like a function but is not.

Bye,
Tassilo

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Does macros evaluates its arguments before?

2011-09-26 Thread ru
user=> (defmacro infix [[x f y]] `(~f ~x ~y))
#'user/infix
user=> (infix (5 + 4))
9

Ok, this is working! But, what's the difference?

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Does macros evaluates its arguments before?

2011-09-26 Thread David Nolen
Try:

(defmacro infix [[x f y]] `(~f ~x ~y)))

On Mon, Sep 26, 2011 at 9:57 AM, Ruslan Sorokin  wrote:

> **
> Hi dear clojurians!
>
> From Clojure documentation (http://clojure.org/evaluation):
>
> ..If the operator of a call is a symbol that names a global var that is a
> macro function, that macro function is called and is passed the *
> unevaluated* operand forms.
>
> But:
>
> ru@ru-desktop ~/clojure/clojure-1.2.1 $ java -cp clojure.jar clojure.main
> Clojure 1.2.1
> user=> (defmacro infix [e] `(let [[x# f# y#] ~e] (f# x# y#)))
> #'user/infix
> user=> (infix [5 + 4])
> 9
> user=> (infix (5 + 4))
> java.lang.ClassCastException: java.lang.Integer cannot be cast to
> clojure.lang.IFn (NO_SOURCE_FILE:0)
> user=>
>
> So, it is tried to evaluate the form (5 + 4). Is not it?
> As I remember from Lisp, UNevaluation of arguments is one of the main
> properties of macros. Am I right?
> Thank you in advance for the any explanations.
>
> Sincerely,
>   Ru
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from 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

Does macros evaluates its arguments before?

2011-09-26 Thread Ruslan Sorokin

Hi dear clojurians!

From Clojure documentation (http://clojure.org/evaluation):

..If the operator of a call is a symbol that names a global var that is 
a macro function, that macro function is called and is passed the 
/unevaluated/ operand forms.


But:

ru@ru-desktop ~/clojure/clojure-1.2.1 $ java -cp clojure.jar clojure.main
Clojure 1.2.1
user=> (defmacro infix [e] `(let [[x# f# y#] ~e] (f# x# y#)))
#'user/infix
user=> (infix [5 + 4])
9
user=> (infix (5 + 4))
java.lang.ClassCastException: java.lang.Integer cannot be cast to 
clojure.lang.IFn (NO_SOURCE_FILE:0)

user=>

So, it is tried to evaluate the form (5 + 4). Is not it?
As I remember from Lisp, UNevaluation of arguments is one of the main 
properties of macros. Am I right?

Thank you in advance for the any explanations.

Sincerely,
  Ru

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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 Repl -- Swank-like workflow with Emacs?

2011-09-26 Thread David Nolen
I've created the following wiki -
https://github.com/clojure/clojurescript/wiki/Emacs-&-inferior-lisp-mode

Let me know if this needs more clarification.

David

On Mon, Sep 26, 2011 at 9:15 AM, Paul Koerbitz wrote:

> Dear Clojurians,
>
> I was toying with Clojurescript and really like using the Repl as described
> here https://github.com/clojure/clojurescript/wiki to try things out.
> (thanks for all the great to everyone involved!!)
>
> Has anyone hooked this into Emacs in a Swank-like fashion? I would love to
> be able to send forms to C-c C-c or ''compile'' a file with C-c C-k.
>
> thanks
> Paul
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

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

Re: clojure.contrib.io, clojure.contrib.http.agent and clojure.contrib.http.connection for Clojure 1.3

2011-09-26 Thread Stuart Sierra
Hi Alf,

Most of clojure.contrib.io was moved into Clojure itself, as 
clojure.java.io. There is no future plan for functions from 
clojure.contrib.io which have not already been copied into clojure.java.io.

clojure.contrib.http-agent was a weak idea with mediocre execution. (I wrote 
it.) It is fundamentally flawed in how it deals with exceptions, 
error-codes, and blocking. Feel free to continue to use it, but I am not 
supporting it.

Regards,
-Stuart Sierra
clojure.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: Sample application as showcase of Clojure DSL / Metaprogramming?

2011-09-26 Thread Brian Marick

On Sep 24, 2011, at 4:17 PM, alexey.petrushin wrote:
> So, maybe there's an interesting Open Source Project that uses this
> approach? With clean code that can be seen as showcase of such
> techniks, and You can dig in it and see all this in action by
> Yourself? It would be really interesting.


https://github.com/marick/Midje has a DSL for expressing tests (called 
"facts"). Although the DSL is pretty simple, the code behind them isn't. But 
you could see some interesting things if you macroexpanded facts, and I'd be 
glad to answer questions posted to the mailing list.

-
Brian Marick, Artisanal Labrador
Now working at http://path11.com
Contract programming in Ruby and Clojure
Occasional consulting on Agile


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


ClojureScript Repl -- Swank-like workflow with Emacs?

2011-09-26 Thread Paul Koerbitz
Dear Clojurians,

I was toying with Clojurescript and really like using the Repl as described
here https://github.com/clojure/clojurescript/wiki to try things out.
(thanks for all the great to everyone involved!!)

Has anyone hooked this into Emacs in a Swank-like fashion? I would love to
be able to send forms to C-c C-c or ''compile'' a file with C-c C-k.

thanks
Paul

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

Randomly select an element from a sorted-set (rand-nth (sorted-set ..))

2011-09-26 Thread Paul Richards
Hi,
How can I efficiently pick a random element from a sorted-set?

If I try rand-nth I get this:
user=> (rand-nth (sorted-set 1 2 3))
java.lang.UnsupportedOperationException: nth not supported on this
type: PersistentTreeSet (NO_SOURCE_FILE:0)

I can get this expression to work if I naively apply seq:
user=> (rand-nth (seq (sorted-set 1 2 3)))
1

However this performs very badly on large sets.  Is there a more
efficient way to do this?

(I need to keep my elements in a sorted-set for other parts of the
application, where I rely on subseq.)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Sample application as showcase of Clojure DSL / Metaprogramming?

2011-09-26 Thread Tarantoga
Hello Alexey,

Probably, russian is your primary language? Then look here for the
examples of the DSL:
1. http://my-clojure.blogspot.com/search/label/DSL  -- a simple
embedded DSL for the application configuration;
2. Here (http://scala.by/meetups/2011/09/10/4.html) you may get the
slides of my presentation and my speech in MS Word format. It is about
DSLs construction.

Regards,
  Dmitry

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Sample application as showcase of Clojure DSL / Metaprogramming?

2011-09-26 Thread Michael Jaaka
While the statement that creating any syntax is true for LISP, so for
Clojure its not because of missing reader macro ("The read table is
currently not accessible to user programs." from http://clojure.org/reader).

Nevertheless I found homoiconicity very useful. I turned my XML
document (with my imagined syntax) into Clojure code which was just
bunch of functions and macros (for changing the execution the control
flow). It was made for my custom forms, context validations and
transformations into Java objects in GWT project (unfortunately the
client side still had to interpret the data structures to create
froms, but the rest could be executed with Clojure on the server
side).

Above example resembles the ANT with the difference that I hadn't to
write complicated interpreter and class hierarchy (one module less)
and still gained better flexibility and maintenance in future.


On Sep 24, 11:17 pm, "alexey.petrushin" 
wrote:
> Hello, I'm learning Clojure (work mainly with Java and Ruby),
> interested in it after reading Paul Graham and watched very
> interesting presentation about persistent data structures by Rich
> Hickey.
>
> So, one of the cornerstones of Paul Graham articles is - Lisp has no
> syntax, so You can create any syntax that suits You best, and because
> code is just a data it's very easy to do.
>
> You can model any concept - create DSL best suited for Your problem or
> model Object Oriented approach, Inheritance, and so on.
>
> But I believe, it's very hard to demonstrate this advantages on the
> simple samples. You has to do something real and complex to see
> advantages of this approach.
>
> So, maybe there's an interesting Open Source Project that uses this
> approach? With clean code that can be seen as showcase of such
> techniks, and You can dig in it and see all this in action by
> Yourself? It would be really interesting.
>
> Thanks.
>
> P.S. One more small question - as far as I know right now
> ClojureScript doesn't support eval and requires Java for compiling,
> any plans to support this in future?
> ClojureScript compiler written in ClojureScript / JavaScript without
> Java requirement?

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Sample application as showcase of Clojure DSL / Metaprogramming?

2011-09-26 Thread David Nolen
On Mon, Sep 26, 2011 at 1:35 AM, Alexey Petrushin <
alexey.petrus...@gmail.com> wrote:

> 1. No compilation step, quick live prototyping in browser.
>

Already possible, and IMO better experience than pretty much anything else
out there - Browser REPL


> 2. Pure browser environment, no need to install anything.
>

Not sure what the benefit is here. Even CoffeeScript requires an install to
be useful for real development. w/o Google Closure, ClojureScript's
footprint would be unwieldy.

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