Re: [ANN] ClojureCLR 1.3.0 released

2011-09-24 Thread Baishampayan Ghose
> ClojureCLR 1.3.0 is now available.
>
> Same updates as Clojure 1.3.0.

Wow, David. That's some incredible work that you've done. Even though
I don't use ClojureCLR, I can understand the amount of effort that has
gone into the release.

Heartiest congratulations.

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: :use :only support in ClojureScript now available

2011-09-24 Thread Jason Hickner
Nice! This is great. Will the :only directive always be required, or
will we eventually be able to pull in entire namespaces?

- Jason

On Sep 23, 8:16 am, David Nolen  wrote:
> A lot people have been clamoring for this. This has been merged into master.
>
> (:use [foo.bar :only [...]])
>
> (:use-macros [foo.bar :only [...]])
>
> Are now both supported! Thanks to all that helped out!
>
> Cheers,
> 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


[ANN] ClojureCLR 1.3.0 released

2011-09-24 Thread dmiller
ClojureCLR 1.3.0 is now available.

Same updates as Clojure 1.3.0.

Same acknowledgments, as this depends on the work of all those fine
people who bring you Clojure on the JVM.
Additional acknowledgments:
- Kurt Schelfthout
- Shawn Hoover
- David Powell
- Alan Salewski


To get started with a binary distribution:
https://github.com/richhickey/clojure-clr/wiki/Getting-started-binary-distribution
To get started with source: 
https://github.com/richhickey/clojure-clr/wiki/Getting-started-source-distribution


- David Miller

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

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

the website says:

deftype supports mutable fields, defrecord does not

so deftype seems to be what would be a java bean with simple
properties in java

Am 24.09.2011 23:11, schrieb Matt Hoyt:
> Both of them are java objects.  Records has more default
> functionality like implementing equals, hashcode, etc.  You can
> read more about the differences here: http://clojure.org/datatypes
> 
> assoc for records sets the value of the property for the record.
> 
> Matt Hoyt 
> 
>
> 
*From:* Dennis Haupt 
> *To:* clojure@googlegroups.com *Sent:* Saturday, September 24, 2011
> 3:54 PM *Subject:* Re: beginner question
> 
> i assumed my game to be so much fun that no one would ever want to 
> stop playing it.
> 
> Am 24.09.2011 22:26, schrieb Matt Hoyt:
>> You need a check in the loop to see if the player wants to end
>> the game. Clojure doesn't have a break statement like Java so
>> you created a infinite loop that will never end.  To make sure
>> the game ends you need to have a base case.  Example of a main
>> game loop in clojure:
> 
>> (loop [game-state initial-state] (if (game-ends? game-state) 
>> (close-game game-state) (recur (render (logic game-state)
> 
>> You should also look into records to store the game's state. 
>> Records are faster than hash maps and you have polymorphism with 
>> protocols.
> 
> if i remember correctly, deftype = map, defrecord = class? how does
> "assoc" work on records?
> 
> 
> Be
>> careful of the lazy functions in clojure like map.  It will only 
>> execute when you ask a value for it.
> 
> render should do that
> 
> 
>> Matt Hoyt 
>> 
>
>> 
> 
> *From:* Dennis Haupt  >
>> *To:* clojure@googlegroups.com 
> *Sent:* Saturday, September 24, 2011
>> 2:36 PM *Subject:* beginner question
> 
>> in java, i would start coding a game with a loop like this:
>> while (true) { logic(); render(); }
> 
>> i would store the current state of the world in an object 
>> containing the complete data of the whole game and update its 
>> values in each iteration.
> 
>> how would i do this in clojure?
> 
>> the outer loop could look like (def next [oldstate] ()) <- 
>> input = current game, return value = next iteration
> 
>> (loop [world initalState] (recur (next world))) // <- the loop
> 
>> but how would be world look like? the "best" (most trivial)
>> thing that i could think of is for it to be a map which is passed
>> along several transform functions, for example
> 
>> (def playerHealthRegen [world] (...)) <- input = world (a map), 
>> output = a new map with a new entry at key "playerhealth"
> 
>> each function would then return a slightly modified version of
>> the world, and at the end, i'll have my completely new state.
> 
>> is that about right? or is there a completely different way i 
>> overlooked?
> 
> 
>> -- You received this message because you are subscribed to the 
>> Google Groups "Clojure" group. To post to this group, send email
>> to clojure@googlegroups.com 
> >
> Note
>> that posts from new members are moderated - please be patient
>> with your first post. To unsubscribe from this group, send email
>> to clojure+unsubscr...@googlegroups.com
>>  
>>  > For more options, visit
> this
>> group at http://groups.google.com/group/clojure?hl=en
> 
> 
>> -- You received this message because you are subscribed to the 
>> Google Groups "Clojure" group. To post to this group, send email
>> to clojure@googlegroups.com 
>> Note that
> posts from new members are
>> moderated - please be patient with your first post. To
>> unsubscribe from this group, send email to 
>> clojure+unsubscr...@googlegroups.com
>  For more options, visit this
>> group at http://groups.google.com/group/clojure?hl=en
> 
> 
> 
> -- You received this message because you are subscribed to the
> Google Groups "Clojure" group. To post to this group, send email to
> clojure@googlegroups.com  Note
> that posts from new members are moderated - please be patient with 
> your first post. To unsubscribe from this group, send email to 
> clojure+unsubscr...@googlegroups.com
>  For more options, visit this
> group at http://groups.google.com/group/clojure?hl=en
> 
> 
> -- You received this message because you are subscribed to the
> Google Groups "Clojure" group. To post to this group, send email to
> clojure@googlegroups.com Note that posts from new members are
> moderated - please be patient with your first post. To unsu

Re: beginner question

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

mutable? like in "not functional"?
*reading*

Am 24.09.2011 23:11, schrieb Matt Hoyt:
> Both of them are java objects.  Records has more default
> functionality like implementing equals, hashcode, etc.  You can
> read more about the differences here: http://clojure.org/datatypes
> 
> assoc for records sets the value of the property for the record.
> 
> Matt Hoyt 
> 
>
> 
*From:* Dennis Haupt 
> *To:* clojure@googlegroups.com *Sent:* Saturday, September 24, 2011
> 3:54 PM *Subject:* Re: beginner question
> 
> i assumed my game to be so much fun that no one would ever want to 
> stop playing it.
> 
> Am 24.09.2011 22:26, schrieb Matt Hoyt:
>> You need a check in the loop to see if the player wants to end
>> the game. Clojure doesn't have a break statement like Java so
>> you created a infinite loop that will never end.  To make sure
>> the game ends you need to have a base case.  Example of a main
>> game loop in clojure:
> 
>> (loop [game-state initial-state] (if (game-ends? game-state) 
>> (close-game game-state) (recur (render (logic game-state)
> 
>> You should also look into records to store the game's state. 
>> Records are faster than hash maps and you have polymorphism with 
>> protocols.
> 
> if i remember correctly, deftype = map, defrecord = class? how does
> "assoc" work on records?
> 
> 
> Be
>> careful of the lazy functions in clojure like map.  It will only 
>> execute when you ask a value for it.
> 
> render should do that
> 
> 
>> Matt Hoyt 
>> 
>
>> 
> 
> *From:* Dennis Haupt  >
>> *To:* clojure@googlegroups.com 
> *Sent:* Saturday, September 24, 2011
>> 2:36 PM *Subject:* beginner question
> 
>> in java, i would start coding a game with a loop like this:
>> while (true) { logic(); render(); }
> 
>> i would store the current state of the world in an object 
>> containing the complete data of the whole game and update its 
>> values in each iteration.
> 
>> how would i do this in clojure?
> 
>> the outer loop could look like (def next [oldstate] ()) <- 
>> input = current game, return value = next iteration
> 
>> (loop [world initalState] (recur (next world))) // <- the loop
> 
>> but how would be world look like? the "best" (most trivial)
>> thing that i could think of is for it to be a map which is passed
>> along several transform functions, for example
> 
>> (def playerHealthRegen [world] (...)) <- input = world (a map), 
>> output = a new map with a new entry at key "playerhealth"
> 
>> each function would then return a slightly modified version of
>> the world, and at the end, i'll have my completely new state.
> 
>> is that about right? or is there a completely different way i 
>> overlooked?
> 
> 
>> -- You received this message because you are subscribed to the 
>> Google Groups "Clojure" group. To post to this group, send email
>> to clojure@googlegroups.com 
> >
> Note
>> that posts from new members are moderated - please be patient
>> with your first post. To unsubscribe from this group, send email
>> to clojure+unsubscr...@googlegroups.com
>>  
>>  > For more options, visit
> this
>> group at http://groups.google.com/group/clojure?hl=en
> 
> 
>> -- You received this message because you are subscribed to the 
>> Google Groups "Clojure" group. To post to this group, send email
>> to clojure@googlegroups.com 
>> Note that
> posts from new members are
>> moderated - please be patient with your first post. To
>> unsubscribe from this group, send email to 
>> clojure+unsubscr...@googlegroups.com
>  For more options, visit this
>> group at http://groups.google.com/group/clojure?hl=en
> 
> 
> 
> -- You received this message because you are subscribed to the
> Google Groups "Clojure" group. To post to this group, send email to
> clojure@googlegroups.com  Note
> that posts from new members are moderated - please be patient with 
> your first post. To unsubscribe from this group, send email to 
> clojure+unsubscr...@googlegroups.com
>  For more options, visit this
> group at http://groups.google.com/group/clojure?hl=en
> 
> 
> -- You received this message because you are subscribed to the
> Google Groups "Clojure" group. To post to this group, send email to
> clojure@googlegroups.com Note that posts from new members are
> moderated - please be patient with your first post. To unsubscribe
> from this group, send email to 
> clojure+unsubscr...@googlegroups.com For more options, visit th

Re: beginner question

2011-09-24 Thread Matt Hoyt
Both of them are java objects.  Records has more default functionality like 
implementing equals, hashcode, etc.  You can read more about the differences 
here: http://clojure.org/datatypes

assoc for records sets the value of the property for the record. 

Matt Hoyt



From: Dennis Haupt 
To: clojure@googlegroups.com
Sent: Saturday, September 24, 2011 3:54 PM
Subject: Re: beginner question

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

i assumed my game to be so much fun that no one would ever want to
stop playing it.

Am 24.09.2011 22:26, schrieb Matt Hoyt:
> You need a check in the loop to see if the player wants to end the
> game. Clojure doesn't have a break statement like Java so you
> created a infinite loop that will never end.  To make sure the game
> ends you need to have a base case.  Example of a main game loop in
> clojure:
> 
> (loop [game-state initial-state] (if (game-ends? game-state) 
> (close-game game-state) (recur (render (logic game-state)
> 
> You should also look into records to store the game's state.
> Records are faster than hash maps and you have polymorphism with
> protocols.

if i remember correctly, deftype = map, defrecord = class?
how does "assoc" work on records?


Be
> careful of the lazy functions in clojure like map.  It will only
> execute when you ask a value for it.

render should do that

> 
> Matt Hoyt 
> 
>
> 
*From:* Dennis Haupt 
> *To:* clojure@googlegroups.com *Sent:* Saturday, September 24, 2011
> 2:36 PM *Subject:* beginner question
> 
> in java, i would start coding a game with a loop like this: while
> (true) { logic(); render(); }
> 
> i would store the current state of the world in an object
> containing the complete data of the whole game and update its
> values in each iteration.
> 
> how would i do this in clojure?
> 
> the outer loop could look like (def next [oldstate] ()) <-
> input = current game, return value = next iteration
> 
> (loop [world initalState] (recur (next world))) // <- the loop
> 
> but how would be world look like? the "best" (most trivial) thing
> that i could think of is for it to be a map which is passed along
> several transform functions, for example
> 
> (def playerHealthRegen [world] (...)) <- input = world (a map),
> output = a new map with a new entry at key "playerhealth"
> 
> each function would then return a slightly modified version of the 
> world, and at the end, i'll have my completely new state.
> 
> is that about right? or is there a completely different way i
> overlooked?
> 
> 
> -- You received this message because you are subscribed to the
> Google Groups "Clojure" group. To post to this group, send email to
> clojure@googlegroups.com  Note
> that posts from new members are moderated - please be patient with 
> your first post. To unsubscribe from 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


- -- 

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

iQIcBAEBAgAGBQJOfkN+AAoJENRtux+h35aGWBkQAKnIObEE9/uJV2FdOnOLEZ0P
nDSqdKvGr95+OdX24cTQqYcnsjYogaUSFaDjTEl95x68B2SKcAxKSrl35KMbAfry
pSYmcrRDEjDzjKMQf8RY1h5IMvacJFvpcuCX+VT96RCqBwTtjaLC4xG/iGpwLD5T
n9BAn6D5Js5HosAXg5bsu+0g4Lg04L/skaRsrPtA6YvwEkA+7IMCX2Y1s6zmZwYD
ciNWhVvBFsLiFtrPSmgCRw3tAPBWjx8JrtjvMtq5nrdi3hBQMUtSxOdTwWhbKwdT
V4LwynaTt8fusXVrV9cKlWVHH28o6OED2j8fh+Ndrz6MiG89Pjp0DXIYfHJECS4a
N5Pwvs1ID2l78yhoAlmU6IvaQyEcqqR2NzTxqXrv/HqbUYbfnZeX3HX7d6sCTec9
bJ3fFn0mpW8WFF7VCE08A90bNepISBcTMJ7RsI4fRoke/Vvt0DFU3IjyfHwy/Cil
4n3Slt0UsuCIZi+p+sG6zrI4PXDJ4JZ3QoWP7VQM2IerVPAdqw4srP2MHwrwQ17J
MdZFqqEF9ANke+rqQQDiZUGizgA8UT/VYlwUOHnKGqBoegt2TUhb69htvbaKwAIJ
PZMXbKn7eImS/KUQTNFZNYaKWkJJsE4HJ9Ac2EearQ8R6I6N65BKBITdXp+jVd2s
mgt8Hyn3Lgbdk4mTVH8U
=tnGf
-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

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this gr

Re: beginner question

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

i assumed my game to be so much fun that no one would ever want to
stop playing it.

Am 24.09.2011 22:26, schrieb Matt Hoyt:
> You need a check in the loop to see if the player wants to end the
> game. Clojure doesn't have a break statement like Java so you
> created a infinite loop that will never end.  To make sure the game
> ends you need to have a base case.  Example of a main game loop in
> clojure:
> 
> (loop [game-state initial-state] (if (game-ends? game-state) 
> (close-game game-state) (recur (render (logic game-state)
> 
> You should also look into records to store the game's state.
> Records are faster than hash maps and you have polymorphism with
> protocols.

if i remember correctly, deftype = map, defrecord = class?
how does "assoc" work on records?


 Be
> careful of the lazy functions in clojure like map.  It will only
> execute when you ask a value for it.

render should do that

> 
> Matt Hoyt 
> 
>
> 
*From:* Dennis Haupt 
> *To:* clojure@googlegroups.com *Sent:* Saturday, September 24, 2011
> 2:36 PM *Subject:* beginner question
> 
> in java, i would start coding a game with a loop like this: while
> (true) { logic(); render(); }
> 
> i would store the current state of the world in an object
> containing the complete data of the whole game and update its
> values in each iteration.
> 
> how would i do this in clojure?
> 
> the outer loop could look like (def next [oldstate] ()) <-
> input = current game, return value = next iteration
> 
> (loop [world initalState] (recur (next world))) // <- the loop
> 
> but how would be world look like? the "best" (most trivial) thing
> that i could think of is for it to be a map which is passed along
> several transform functions, for example
> 
> (def playerHealthRegen [world] (...)) <- input = world (a map),
> output = a new map with a new entry at key "playerhealth"
> 
> each function would then return a slightly modified version of the 
> world, and at the end, i'll have my completely new state.
> 
> is that about right? or is there a completely different way i
> overlooked?
> 
> 
> -- You received this message because you are subscribed to the
> Google Groups "Clojure" group. To post to this group, send email to
> clojure@googlegroups.com  Note
> that posts from new members are moderated - please be patient with 
> your first post. To unsubscribe from 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


- -- 

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

iQIcBAEBAgAGBQJOfkN+AAoJENRtux+h35aGWBkQAKnIObEE9/uJV2FdOnOLEZ0P
nDSqdKvGr95+OdX24cTQqYcnsjYogaUSFaDjTEl95x68B2SKcAxKSrl35KMbAfry
pSYmcrRDEjDzjKMQf8RY1h5IMvacJFvpcuCX+VT96RCqBwTtjaLC4xG/iGpwLD5T
n9BAn6D5Js5HosAXg5bsu+0g4Lg04L/skaRsrPtA6YvwEkA+7IMCX2Y1s6zmZwYD
ciNWhVvBFsLiFtrPSmgCRw3tAPBWjx8JrtjvMtq5nrdi3hBQMUtSxOdTwWhbKwdT
V4LwynaTt8fusXVrV9cKlWVHH28o6OED2j8fh+Ndrz6MiG89Pjp0DXIYfHJECS4a
N5Pwvs1ID2l78yhoAlmU6IvaQyEcqqR2NzTxqXrv/HqbUYbfnZeX3HX7d6sCTec9
bJ3fFn0mpW8WFF7VCE08A90bNepISBcTMJ7RsI4fRoke/Vvt0DFU3IjyfHwy/Cil
4n3Slt0UsuCIZi+p+sG6zrI4PXDJ4JZ3QoWP7VQM2IerVPAdqw4srP2MHwrwQ17J
MdZFqqEF9ANke+rqQQDiZUGizgA8UT/VYlwUOHnKGqBoegt2TUhb69htvbaKwAIJ
PZMXbKn7eImS/KUQTNFZNYaKWkJJsE4HJ9Ac2EearQ8R6I6N65BKBITdXp+jVd2s
mgt8Hyn3Lgbdk4mTVH8U
=tnGf
-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: trace-forms macro

2011-09-24 Thread Michał Marczyk
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


Re: beginner question

2011-09-24 Thread Matt Hoyt
You need a check in the loop to see if the player wants to end the game.  
Clojure doesn't have a break statement like Java so you created a infinite loop 
that will never end.  To make sure the game ends you need to have a base case.  
Example of a main game loop in clojure:

(loop [game-state initial-state]
  (if (game-ends? game-state)
    (close-game game-state)
    (recur (render (logic game-state)

You should also look into records to store the game's state.  Records are 
faster than hash maps and you have polymorphism with protocols.  Be careful of 
the lazy functions in clojure like map.  It will only execute when you ask a 
value for it. 
 
Matt Hoyt



From: Dennis Haupt 
To: clojure@googlegroups.com
Sent: Saturday, September 24, 2011 2:36 PM
Subject: beginner question

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

in java, i would start coding a game with a loop like this:
while (true) {
logic();
render();
}

i would store the current state of the world in an object containing
the complete data of the whole game and update its values in each
iteration.

how would i do this in clojure?

the outer loop could look like
(def next [oldstate] ()) <- input = current game, return value =
next iteration

(loop [world initalState] (recur (next world))) // <- the loop

but how would be world look like? the "best" (most trivial) thing that
i could think of is for it to be a map which is passed along several
transform functions, for example

(def playerHealthRegen [world] (...)) <- input = world (a map), output
= a new map with a new entry at key "playerhealth"

each function would then return a slightly modified version of the
world, and at the end, i'll have my completely new state.

is that about right? or is there a completely different way i overlooked?

- -- 

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

iQIcBAEBAgAGBQJOfjE+AAoJENRtux+h35aGo0MQAMipkc8e0YTPxsWsLzaVoQuz
MtXerKHHqqbuyxy+mzlc4xFfFUfs//wQGdk/ExZhby7eNVBc9AGYKarCyG/DVxfM
HwN7RVHIKDtWoHQk71dthSAzkHgbZvFxjO2W3EkI10rTsCYNFx1WV4o/PMt/KYJj
phmtO9LcHmb/ySsLveTmSdJTYjSDb7ENudLbM2z/4SP9AqN21sU1HRNF/Y4gLnq3
tnnGmbpRU8Xs6xv8O8oluRrhjgpGF58okG+JnnW+aqF95OaDMp2dQ2mPKxcWLzmt
zkMj41jC28By05oVPIIOstB50rOzU0VAQvEJRDohz2E2sxbhFfUci7G/75hvBkYz
vUXeQi4TCYM/gQlOOiAqUuutWpYWBbgL7OOHck3VkGn7UEKBguhkMTO/xGJjFxbY
6/pxIy7i7+DbSXfq+tu5sw2XAS96tctD1dWVdFjfpKukckvcDff3/L0ObKwIxTQu
BN9tqoUOs1Tp2OBJhkEJfaBMgUKqX5+IW/mKARVywNFLRWTAYs74OTO86ei/jTPo
kqwu2NGE9p/iHpLAxin8sz6I34kOlHJ2X7Xi4PBC19mmVgErt+A8MIvELuxhKBYw
BxoWZ11bccphKHFUdEDaj43pd1DqFhLqqpDvFWumUIO48pnDRpYcYcRLZ/6raCXv
apIq/CL5V7UHCJ+d/ANo
=Ckx2
-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

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

2011-09-24 Thread John
To break down the update into multiple steps use the -> macro:

=>(defn step [world-state])
  (-> world-state
update-health
update-physics
update-ai))

where e.g. update-health is something like

=>(defn update-health [world-state]
  (update-in world-state [:player :health] inc))

then yeah just iterate or loop/recur

=>(take 20 (iterate step init-state))

this is the purely functional way of doing it.



On Sep 24, 3:36 pm, Dennis Haupt  wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> in java, i would start coding a game with a loop like this:
> while (true) {
> logic();
> render();
>
> }
>
> i would store the current state of the world in an object containing
> the complete data of the whole game and update its values in each
> iteration.
>
> how would i do this in clojure?
>
> the outer loop could look like
> (def next [oldstate] ()) <- input = current game, return value =
> next iteration
>
> (loop [world initalState] (recur (next world))) // <- the loop
>
> but how would be world look like? the "best" (most trivial) thing that
> i could think of is for it to be a map which is passed along several
> transform functions, for example
>
> (def playerHealthRegen [world] (...)) <- input = world (a map), output
> = a new map with a new entry at key "playerhealth"
>
> each function would then return a slightly modified version of the
> world, and at the end, i'll have my completely new state.
>
> is that about right? or is there a completely different way i overlooked?
>
> - --
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v2.0.14 (MingW32)
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/
>
> iQIcBAEBAgAGBQJOfjE+AAoJENRtux+h35aGo0MQAMipkc8e0YTPxsWsLzaVoQuz
> MtXerKHHqqbuyxy+mzlc4xFfFUfs//wQGdk/ExZhby7eNVBc9AGYKarCyG/DVxfM
> HwN7RVHIKDtWoHQk71dthSAzkHgbZvFxjO2W3EkI10rTsCYNFx1WV4o/PMt/KYJj
> phmtO9LcHmb/ySsLveTmSdJTYjSDb7ENudLbM2z/4SP9AqN21sU1HRNF/Y4gLnq3
> tnnGmbpRU8Xs6xv8O8oluRrhjgpGF58okG+JnnW+aqF95OaDMp2dQ2mPKxcWLzmt
> zkMj41jC28By05oVPIIOstB50rOzU0VAQvEJRDohz2E2sxbhFfUci7G/75hvBkYz
> vUXeQi4TCYM/gQlOOiAqUuutWpYWBbgL7OOHck3VkGn7UEKBguhkMTO/xGJjFxbY
> 6/pxIy7i7+DbSXfq+tu5sw2XAS96tctD1dWVdFjfpKukckvcDff3/L0ObKwIxTQu
> BN9tqoUOs1Tp2OBJhkEJfaBMgUKqX5+IW/mKARVywNFLRWTAYs74OTO86ei/jTPo
> kqwu2NGE9p/iHpLAxin8sz6I34kOlHJ2X7Xi4PBC19mmVgErt+A8MIvELuxhKBYw
> BxoWZ11bccphKHFUdEDaj43pd1DqFhLqqpDvFWumUIO48pnDRpYcYcRLZ/6raCXv
> apIq/CL5V7UHCJ+d/ANo
> =Ckx2
> -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: trace-forms macro

2011-09-24 Thread Luc Prefontaine
Fine, I will have a closer look at the issues you mentioned.
I'll repost here when the code is available so you can have a look at it.

Luc

On Sat, 24 Sep 2011 21:33:47 +0200
Jonathan Fischer Friberg  wrote:

> >
> > I am moving the trace contrib stuff to 1.3. I would like to include
> > your trace-forms
> > macro in it. Feeling ok with this ? Comments ?
> >
> 
> Sounds good to me.
> After all, I sent it to this list so that others could make use of it!
> 
> When it comes to issues, in 1.3 it's not allowed to recur across
> (try ...), which means that the macro wont work with (loop
> (recur ...)) or (fn ... (recur ...)).
> 
> Also, the big missing thing is that (trace-special-form) doesn't
> cover fn*, i.e. the body of functions wont be traced.
> 
> Jonathan
> 
> On Sat, Sep 24, 2011 at 7:03 AM, Luc Prefontaine <
> lprefonta...@softaddicts.ca> wrote:
> 
> > Hi Jonathan,
> >
> > I am moving the trace contrib stuff to 1.3. I would like to include
> > your trace-forms
> > macro in it. Feeling ok with this ? Comments ?
> >
> > The issues you underlined are not runtime errors, they are
> > compilation errors.
> > There's not much you can do to trap these.
> > The macro is still valuable for runtime tracing.
> >
> > Luc P.
> >
> > On Mon, 12 Sep 2011 11:31:39 +0200
> > Jonathan Fischer Friberg  wrote:
> >
> > > Hello,
> > >
> > > I made a small macro, if anyone is interested.
> > > https://gist.github.com/1209498
> > >
> > > It wraps one or more forms and if an exception is thrown,
> > > prints the form that caused it, and throws the exception itself.
> > >
> > > Examples:
> > >
> > > user=> (trace-forms 3)
> > > 3
> > >
> > > user=> (trace-forms (+ 6 (/ 9 0)))
> > > java.lang.ArithmeticException: Divide by zero (NO_SOURCE_FILE:9)
> > > Form failed: (/ 9 0)
> > > Form failed: (+ 6 (/ 9 0))
> > >
> > > user=> (trace-forms (let [a 0 b (/ 9 a)] b))
> > > java.lang.ArithmeticException: Divide by zero (NO_SOURCE_FILE:75)
> > > Form failed: (/ 9 a)
> > > Form failed: (let* [a 0 b (/ 9 a)] b)
> > > Form failed: (let [a 0 b (/ 9 a)] b)
> > >
> > > Issues:
> > >
> > > user=> (trace-forms (let [b (/ 9 a)] b))
> > > java.lang.Exception: Unable to resolve symbol: a in this context
> > > (NO_SOURCE_FILE:94)
> > >
> > > user=> (trace-forms (let [a (java.lang.DoesNotExist.)] a))
> > > java.lang.ClassNotFoundException: java.lang.DoesNotExist
> > > (NO_SOURCE_FILE:93)
> > >
> > > 
> > >
> > > Thoughts?
> > >
> > > Jonathan
> > >
> >
> >
> >
> > --
> > Luc P.
> >
> > 
> > The rabid Muppet
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Clojure" group.
> > To post to this group, send email to clojure@googlegroups.com
> > Note that posts from new members are moderated - please be patient
> > with your first post.
> > To unsubscribe from this group, send email to
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en
> >
> 



-- 
Luc P.


The rabid Muppet

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

2011-09-24 Thread Alan Malloy
This is about right, though instead of a loop/recur you can just (map
render (iterate next-state start-state))

On Sep 24, 12:36 pm, Dennis Haupt  wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> in java, i would start coding a game with a loop like this:
> while (true) {
> logic();
> render();
>
> }
>
> i would store the current state of the world in an object containing
> the complete data of the whole game and update its values in each
> iteration.
>
> how would i do this in clojure?
>
> the outer loop could look like
> (def next [oldstate] ()) <- input = current game, return value =
> next iteration
>
> (loop [world initalState] (recur (next world))) // <- the loop
>
> but how would be world look like? the "best" (most trivial) thing that
> i could think of is for it to be a map which is passed along several
> transform functions, for example
>
> (def playerHealthRegen [world] (...)) <- input = world (a map), output
> = a new map with a new entry at key "playerhealth"
>
> each function would then return a slightly modified version of the
> world, and at the end, i'll have my completely new state.
>
> is that about right? or is there a completely different way i overlooked?
>
> - --
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v2.0.14 (MingW32)
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/
>
> iQIcBAEBAgAGBQJOfjE+AAoJENRtux+h35aGo0MQAMipkc8e0YTPxsWsLzaVoQuz
> MtXerKHHqqbuyxy+mzlc4xFfFUfs//wQGdk/ExZhby7eNVBc9AGYKarCyG/DVxfM
> HwN7RVHIKDtWoHQk71dthSAzkHgbZvFxjO2W3EkI10rTsCYNFx1WV4o/PMt/KYJj
> phmtO9LcHmb/ySsLveTmSdJTYjSDb7ENudLbM2z/4SP9AqN21sU1HRNF/Y4gLnq3
> tnnGmbpRU8Xs6xv8O8oluRrhjgpGF58okG+JnnW+aqF95OaDMp2dQ2mPKxcWLzmt
> zkMj41jC28By05oVPIIOstB50rOzU0VAQvEJRDohz2E2sxbhFfUci7G/75hvBkYz
> vUXeQi4TCYM/gQlOOiAqUuutWpYWBbgL7OOHck3VkGn7UEKBguhkMTO/xGJjFxbY
> 6/pxIy7i7+DbSXfq+tu5sw2XAS96tctD1dWVdFjfpKukckvcDff3/L0ObKwIxTQu
> BN9tqoUOs1Tp2OBJhkEJfaBMgUKqX5+IW/mKARVywNFLRWTAYs74OTO86ei/jTPo
> kqwu2NGE9p/iHpLAxin8sz6I34kOlHJ2X7Xi4PBC19mmVgErt+A8MIvELuxhKBYw
> BxoWZ11bccphKHFUdEDaj43pd1DqFhLqqpDvFWumUIO48pnDRpYcYcRLZ/6raCXv
> apIq/CL5V7UHCJ+d/ANo
> =Ckx2
> -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


beginner question

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

in java, i would start coding a game with a loop like this:
while (true) {
logic();
render();
}

i would store the current state of the world in an object containing
the complete data of the whole game and update its values in each
iteration.

how would i do this in clojure?

the outer loop could look like
(def next [oldstate] ()) <- input = current game, return value =
next iteration

(loop [world initalState] (recur (next world))) // <- the loop

but how would be world look like? the "best" (most trivial) thing that
i could think of is for it to be a map which is passed along several
transform functions, for example

(def playerHealthRegen [world] (...)) <- input = world (a map), output
= a new map with a new entry at key "playerhealth"

each function would then return a slightly modified version of the
world, and at the end, i'll have my completely new state.

is that about right? or is there a completely different way i overlooked?

- -- 

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

iQIcBAEBAgAGBQJOfjE+AAoJENRtux+h35aGo0MQAMipkc8e0YTPxsWsLzaVoQuz
MtXerKHHqqbuyxy+mzlc4xFfFUfs//wQGdk/ExZhby7eNVBc9AGYKarCyG/DVxfM
HwN7RVHIKDtWoHQk71dthSAzkHgbZvFxjO2W3EkI10rTsCYNFx1WV4o/PMt/KYJj
phmtO9LcHmb/ySsLveTmSdJTYjSDb7ENudLbM2z/4SP9AqN21sU1HRNF/Y4gLnq3
tnnGmbpRU8Xs6xv8O8oluRrhjgpGF58okG+JnnW+aqF95OaDMp2dQ2mPKxcWLzmt
zkMj41jC28By05oVPIIOstB50rOzU0VAQvEJRDohz2E2sxbhFfUci7G/75hvBkYz
vUXeQi4TCYM/gQlOOiAqUuutWpYWBbgL7OOHck3VkGn7UEKBguhkMTO/xGJjFxbY
6/pxIy7i7+DbSXfq+tu5sw2XAS96tctD1dWVdFjfpKukckvcDff3/L0ObKwIxTQu
BN9tqoUOs1Tp2OBJhkEJfaBMgUKqX5+IW/mKARVywNFLRWTAYs74OTO86ei/jTPo
kqwu2NGE9p/iHpLAxin8sz6I34kOlHJ2X7Xi4PBC19mmVgErt+A8MIvELuxhKBYw
BxoWZ11bccphKHFUdEDaj43pd1DqFhLqqpDvFWumUIO48pnDRpYcYcRLZ/6raCXv
apIq/CL5V7UHCJ+d/ANo
=Ckx2
-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: trace-forms macro

2011-09-24 Thread Jonathan Fischer Friberg
>
> I am moving the trace contrib stuff to 1.3. I would like to include your
> trace-forms
> macro in it. Feeling ok with this ? Comments ?
>

Sounds good to me.
After all, I sent it to this list so that others could make use of it!

When it comes to issues, in 1.3 it's not allowed to recur across (try ...),
which means that the macro wont work with (loop (recur ...)) or (fn ...
(recur ...)).

Also, the big missing thing is that (trace-special-form) doesn't cover fn*,
i.e. the body of functions wont be traced.

Jonathan

On Sat, Sep 24, 2011 at 7:03 AM, Luc Prefontaine <
lprefonta...@softaddicts.ca> wrote:

> Hi Jonathan,
>
> I am moving the trace contrib stuff to 1.3. I would like to include your
> trace-forms
> macro in it. Feeling ok with this ? Comments ?
>
> The issues you underlined are not runtime errors, they are compilation
> errors.
> There's not much you can do to trap these.
> The macro is still valuable for runtime tracing.
>
> Luc P.
>
> On Mon, 12 Sep 2011 11:31:39 +0200
> Jonathan Fischer Friberg  wrote:
>
> > Hello,
> >
> > I made a small macro, if anyone is interested.
> > https://gist.github.com/1209498
> >
> > It wraps one or more forms and if an exception is thrown,
> > prints the form that caused it, and throws the exception itself.
> >
> > Examples:
> >
> > user=> (trace-forms 3)
> > 3
> >
> > user=> (trace-forms (+ 6 (/ 9 0)))
> > java.lang.ArithmeticException: Divide by zero (NO_SOURCE_FILE:9)
> > Form failed: (/ 9 0)
> > Form failed: (+ 6 (/ 9 0))
> >
> > user=> (trace-forms (let [a 0 b (/ 9 a)] b))
> > java.lang.ArithmeticException: Divide by zero (NO_SOURCE_FILE:75)
> > Form failed: (/ 9 a)
> > Form failed: (let* [a 0 b (/ 9 a)] b)
> > Form failed: (let [a 0 b (/ 9 a)] b)
> >
> > Issues:
> >
> > user=> (trace-forms (let [b (/ 9 a)] b))
> > java.lang.Exception: Unable to resolve symbol: a in this context
> > (NO_SOURCE_FILE:94)
> >
> > user=> (trace-forms (let [a (java.lang.DoesNotExist.)] a))
> > java.lang.ClassNotFoundException: java.lang.DoesNotExist
> > (NO_SOURCE_FILE:93)
> >
> > 
> >
> > Thoughts?
> >
> > Jonathan
> >
>
>
>
> --
> Luc P.
>
> 
> The rabid Muppet
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from 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-24 Thread Volker Schlecht
Not that I could detect any ... monitoring the traffic from Firebug
shows me a GET request that sends a lot of sensible looking
javascript, then I see a POST to localhost:9000 which gets answered by
the goog.provide for the repl. The only detectable difference I see on
the browser side is that the POST is kept open in the example that
comes with ClojureScript and is directly ended after sending the
goog.provide in my own example.

On Sep 23, 10:06 pm, David Nolen  wrote:
> Are you getting any missing resources errors?
>
> On Fri, Sep 23, 2011 at 4:03 PM, Volker Schlecht
> wrote:
>
>
>
>
>
>
>
> > No unfortunately not, with neither FF nor Chrome, and using the
> > Javascript Debuggers of both ...
>
> > On Sep 21, 10:27 pm, David Nolen  wrote:
> > > Do you get any JS errors from the browser at the JS console?
>
> > > David
>
> > > On Wed, Sep 21, 2011 at 4:23 PM, Volker Schlecht
> > > wrote:
>
> > > > Hi,
>
> > > > no, I've tried it against - essentially - a manual replication of the
> > > > built-in sample. But thanks for the hint, because the sample does
> > > > work, but so far I haven't figured out the deciding difference ... at
> > > > least I have a reference now to compare against.
>
> > > > Thanks!
> > > > Volker
>
> > > > On Sep 21, 7:26 pm, David Nolen  wrote:
> > > > > Hmm in my experience
>
> > > > > 1. Start the Browser REPL
> > > > > 2. Open your project's main html file (index.html)
>
> > > > > And you're good to go. Sometimes you need to refresh the browser but
> > > > that's
> > > > > about it as far as I can tell.
>
> > > > > Are you trying this against the built in sample?
>
> > > > > David
>
> > > > > On Tue, Sep 20, 2011 at 4:32 PM, Volker Schlecht
> > > > > wrote:
>
> > > > > > Hi everybody,
>
> > > > > > I'm trying out the new browser repl-environment using both the
> > > > > > tutorial (
> >https://github.com/clojure/clojurescript/wiki/The-REPL-and-
> > > > > > Evaluation-Environments) but so far am unable to get it to work.
>
> > > > > > Using current (as of the writing of this mail) master from github,
> > and
> > > > > > following the Steps in the tutorial:
>
> > > > > > 1. Starting up the repl works, leads me straight to the repl (i.e.
> > > > > > allows me to enter an expression). I remember trying a previous
> > > > > > version of the in-browser repl which worked for me, but in which i
> > > > > > couldn't enter anything before the browser initiated a connection.
> > The
> > > > > > docs mention a wait for a browser connection being neccesary here
> > ...
>
> > > > > > 2. Setting up the XPC communication works, i.e. I see the initial
> > GET
> > > > > > request receiving sensible-looking javascript, and I see a POST of
> > > > > > "ready" being answered by a "goog.provide('user')".
>
> > > > > > 3. That's it however - connection closed. Non-surprisingly,
> > entering
> > > > > > any expression only hangs the REPL.
>
> > > > > > Using curl as per browser.clj:
>
> > > > > > 1. Startting REPL works, as above
> > > > > > 2. curl -v -d "ready"http://localhost:9000/respondswith
>
> > > > > > < HTTP/1.1 200 OK
> > > > > > < Server: ClojureScript REPL
> > > > > > < Content-Type: text/javascript; charset=utf-8
> > > > > > < Content-Length: 26
> > > > > > <
> > > > > > * Connection #0 to host localhost left intact
> > > > > > * Closing connection #0
> > > > > > goog.provide('cljs.user');
>
> > > > > > 3. Looking not too bad except for the closed connection, so
> > entering
> > > > > > (+ 1 1) hangs the REPL
>
> > > > > > 4. curl -v -d "2"http://127.0.0.1:9000thenrespondswith the
> > > > > > compiled javascript as far as I can tell:
>
> > > > > > < HTTP/1.1 200 OK
> > > > > > < Server: ClojureScript REPL
> > > > > > < Content-Type: text/javascript; charset=utf-8
> > > > > > < Content-Length: 61
> > > > > > <
> > > > > > cljs.core.pr_str.call(null,cljs.core._PLUS_.call(null,1,1));
> > > > > > * Connection #0 to host localhost left intact
> > > > > > * Closing connection #0
>
> > > > > > To me it seems that something is awry with keeping that connection
> > > > > > really open on my system.
>
> > > > > > I'm on Debian SID and tried with firefox 6 and 7-beta as well as
> > with
> > > > > > google-chrome. JDK is Oracle Java 1,6.0_26-b03, ClojureScript is as
> > > > > > stated above a vanilla copy of current master, freshly
> > bootstrapped.
>
> > > > > > Reverting to select previous states of ClojureScript (i.e. right
> > after
> > > > > > clojure.browser was merged into master, and right before) yielded
> > no
> > > > > > better results, except that those didn't get me to a REPL prompt at
> > > > > > all and were stuck at "Server started...". The last and only time I
> > > > > > had that working was with the clojure.browser branch from some time
> > > > > > around August 26th.
>
> > > > > > What am I doing wrong? Any hints?
>
> > > > > > regards,
> > > > > > Volker
>
> > > > > > --
> > > > > > You received this message because you are subscribed to the Google
> > > > > > Groups "Clojure" grou

Re: Spread work onto multiple threads (in pure Clojure)

2011-09-24 Thread Andy Fingerhut
I don't know whether there are similar limitations of parallelism when
launching threads via sends to agents.  I haven't looked at that yet.  If
you have an example program you can share, preferably trimmed down to the
core of the issue, I might be able to look at it.

I only know about pmap performance in such detail from using it on computer
language benchmarks game Clojure programs, and trying to figure out why they
weren't finishing sooner.  It helped to print messages when threads started
and ended, examine that output, and then read pmap source code to figure out
why it explained that output.

Andy


On Sat, Sep 24, 2011 at 9:16 AM, Lee Spector  wrote:

>
> Thanks for this info -- I didn't realize quite how pmap worked.
>
> I often launch parallel threads with pmap and have sometimes been puzzled
> by dips in processor utilization that I can't trace to memory resource
> contention, etc.
>
> I have similar issues sometimes when I launch parallel threads via sends to
> agents. Will this behave similarly to pmap? If so, is there a
> straightforward way to get the same kind of benefit as medusa-pmap in an
> agent context?
>
>  -Lee
>
>
> On Sep 22, 2011, at 11:34 PM, Andy Fingerhut wrote:
>
> > pmap will limit the maximum number of simultaneous threads.  So will the
> medusa library's medusa-pmap.
> >
> > The difference is that if one job early in the list takes, e.g., 100
> times longer than the next 20, and you have 4 cpus available, pmap will
> start the first (4+2)=6 in parallel threads, let jobs 2 through 6 complete,
> and then wait for the first one to finish before starting number 7.  Thus
> most of the time will be spent running one thread.  This has the advantage
> of limiting the memory required to store intermediate results, but the
> disadvantage of low usage of multiple cpu cores.
> >
> > Medusa has a medusa-pmap that will also limit the parallelism, but it
> lets you pick the level of parallelism (it isn't fixed at (# cpus + 2)), and
> it will continue starting new threads, even if that means using more memory
> when one job takes much longer than the following jobs.
> >
> > If you like pmap's behavior except for the number of threads, you can
> always copy its source code into your own program and change that number
> pretty easily.
> >
> > Andy
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from 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: [ANN] Clojure 1.3 Released

2011-09-24 Thread Ben Smith-Mannschott
See also:

http://dev.clojure.org/jira/browse/CLJ-838

I've submitted some patches there to recode changes.txt to Markdown a
week or two ago. I updated it last night for f0b092b66 "more
changes.txt tweaks"

// Ben

On Sat, Sep 24, 2011 at 15:47, Mark Nutter  wrote:
> Totally awesome, thanks to everyone.
> I don't like the way github presents the changes.txt file, so I forked a
> copy and did a teeny bit of markup tweaking so it will display in nice
> touchy-feely HTML layout, if anyone is interested.
> https://github.com/manutter51/Clojure-1.3-Changes-text/blob/master/README.creole
> Cheers.
>
> On Fri, Sep 23, 2011 at 5:44 PM, Christopher Redinger 
> wrote:
>>
>> We are pleased to announce today the release of Clojure 1.3:
>>
>>   http://clojure.org/downloads
>>
>> For maven/leiningen users, your settings are now:
>>
>>   :dependencies [[org.clojure/clojure "1.3.0"]]
>>
>> This release includes many significant features and performance
>> enhancements, documented here:
>>
>>   https://github.com/clojure/clojure/blob/1.3.x/changes.txt
>>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from 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: Spread work onto multiple threads (in pure Clojure)

2011-09-24 Thread Lee Spector

Thanks for this info -- I didn't realize quite how pmap worked. 

I often launch parallel threads with pmap and have sometimes been puzzled by 
dips in processor utilization that I can't trace to memory resource contention, 
etc.

I have similar issues sometimes when I launch parallel threads via sends to 
agents. Will this behave similarly to pmap? If so, is there a straightforward 
way to get the same kind of benefit as medusa-pmap in an agent context?

 -Lee


On Sep 22, 2011, at 11:34 PM, Andy Fingerhut wrote:

> pmap will limit the maximum number of simultaneous threads.  So will the 
> medusa library's medusa-pmap.
> 
> The difference is that if one job early in the list takes, e.g., 100 times 
> longer than the next 20, and you have 4 cpus available, pmap will start the 
> first (4+2)=6 in parallel threads, let jobs 2 through 6 complete, and then 
> wait for the first one to finish before starting number 7.  Thus most of the 
> time will be spent running one thread.  This has the advantage of limiting 
> the memory required to store intermediate results, but the disadvantage of 
> low usage of multiple cpu cores.
> 
> Medusa has a medusa-pmap that will also limit the parallelism, but it lets 
> you pick the level of parallelism (it isn't fixed at (# cpus + 2)), and it 
> will continue starting new threads, even if that means using more memory when 
> one job takes much longer than the following jobs.
> 
> If you like pmap's behavior except for the number of threads, you can always 
> copy its source code into your own program and change that number pretty 
> easily.
> 
> Andy

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

2011-09-24 Thread Marc Limotte
Thanks, Mark.

This IS easier to read.

On Sat, Sep 24, 2011 at 9:47 AM, Mark Nutter  wrote:

> Totally awesome, thanks to everyone.
>
> I don't like the way github presents the changes.txt file, so I forked a
> copy and did a teeny bit of markup tweaking so it will display in nice
> touchy-feely HTML layout, if anyone is interested.
>
>
> https://github.com/manutter51/Clojure-1.3-Changes-text/blob/master/README.creole
>
> Cheers.
>
>
> On Fri, Sep 23, 2011 at 5:44 PM, Christopher Redinger 
> wrote:
>
>> We are pleased to announce today the release of Clojure 1.3:
>>
>>   http://clojure.org/downloads
>>
>> For maven/leiningen users, your settings are now:
>>
>>   :dependencies [[org.clojure/clojure "1.3.0"]]
>>
>> This release includes many significant features and performance
>> enhancements, documented here:
>>
>>   https://github.com/clojure/clojure/blob/1.3.x/changes.txt
>>
>>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from 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: [ANN] Clojure 1.3 Released

2011-09-24 Thread Mark Nutter
Totally awesome, thanks to everyone.

I don't like the way github presents the changes.txt file, so I forked a
copy and did a teeny bit of markup tweaking so it will display in nice
touchy-feely HTML layout, if anyone is interested.

https://github.com/manutter51/Clojure-1.3-Changes-text/blob/master/README.creole

Cheers.

On Fri, Sep 23, 2011 at 5:44 PM, Christopher Redinger wrote:

> We are pleased to announce today the release of Clojure 1.3:
>
>   http://clojure.org/downloads
>
> For maven/leiningen users, your settings are now:
>
>   :dependencies [[org.clojure/clojure "1.3.0"]]
>
> This release includes many significant features and performance
> enhancements, documented here:
>
>   https://github.com/clojure/clojure/blob/1.3.x/changes.txt
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Something missing from the clojure compiler's java annotation support for gen-class and defrecord? Am I driving while bouncing off the guard rails?

2011-09-24 Thread Warren Wood
I'm not sure deftype handles annotations on *parameters* of
constructors. I'd be pleasantly surprised to be shown it does though.

I think Stuart's workaround should work, though I think I might have
to make my Java adaptor extend my Clojure gen-class rather than the
other way around.

On Sep 23, 3:42 pm, Tarantoga  wrote:
> Deftype handles annotations and all the other features of java
> classes. Have a look here for an 
> example:http://translate.google.com/translate?sl=auto&tl=en&js=n&prev=_t&hl=e...
>
> On Sep 23, 10:11 pm, Warren Wood  wrote:
>
>
>
>
>
>
>
> > Excellent, thanks!   And thanks for sharing the taxi from Strange Loop
> > to STL tuesday night! :)
>
> > On Sep 23, 2:07 pm, Stuart Sierra  wrote:
>
> > > Hi Warren,
>
> > > Clojure doesn't try to be support every possible feature of Java when
> > > generating Java classes, it just provides enough for interop purposes.
> > > Annotations have always been a weak area. I don't know if annotations on
> > > constructor arguments in `gen-class` are supported, but my suspicion is 
> > > they
> > > are not.
>
> > > A patch would be possible - the `gen-class` code is written mostly in
> > > Clojure. But the easier solution for now would be to write a small class 
> > > in
> > > Java and `:extend` it in your gen-class.
>
> > > -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