Re: Open Source Projects for Beg/ Intermediate

2011-04-16 Thread Ulises
Not long ago I was faced with the same dilemma: I am learning clojure
and to practise and improve my skills I'd like to contribute to an
open source project. Which one should I pick?

And then I came across this: http://prog21.dadgum.com/80.html

Enjoy :)

U

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: call to idiomatic loop works as stand alone but not when wrapped in my function

2011-04-16 Thread Phlex

n 15/04/2011 01:21, Avram wrote:

Yes, I am missing a way to turn the [  filenames] into something like
name1 name2 …



You also missed Joost's answer =)
Use apply for this :

user (+ 1 2 3)
6
user (apply + (list 1 2 3))
6

So in your case :

(apply read-files-into-memory fnames)


hth,
Sacha

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

2011-04-16 Thread David McNeil
For those who duck it in the future, there is more discussion here:
http://groups.google.com/group/clojure-dev/browse_thread/thread/f4907ebca8ef6e11

-David

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


Re: eval'ing records

2011-04-16 Thread David McNeil
For those who duck it in the future, there is more discussion here:
http://groups.google.com/group/clojure-dev/browse_thread/thread/f4907ebca8ef6e11

-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


Clojure 1.2.1 download?

2011-04-16 Thread Wilson MacGyver
Now that 1.2.1 is released, will clojure.org download be updated too?

Or is this a release we should only consume via mvn repo?

Thanks

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

2011-04-16 Thread Alan
I don't see what you're getting at. I want to implement something big
all by myself, please tell me what to do is not productive for the
community, and not helpful for the novice asking. I want to get my
feet wet, could anybody use some basic help? is good for everyone
involved.

I disapprove of discouraging people from offering to help with OSS:
that's how you get started and how you get good.

On Apr 16, 1:40 am, Ulises ulises.cerv...@gmail.com wrote:
 Not long ago I was faced with the same dilemma: I am learning clojure
 and to practise and improve my skills I'd like to contribute to an
 open source project. Which one should I pick?

 And then I came across this:http://prog21.dadgum.com/80.html

 Enjoy :)

 U

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Weening myself off of global state - what's the idiomatic way to solve this?

2011-04-16 Thread Brandon Ferguson
Ended up updating it to use lazy sequences.

https://gist.github.com/887256

Already feels much better! I do still have a bit of state with the
tracking of which frame we're on but I'll certainly take that over the
glob of atoms before.

Next up is handling some of the more hairy bits with user input and
the like just to see how that would map, and getting multiple balls
running. Hopefully I can even get away from the lazy sequence method.

Thanks for the help!
-Brandon

On Apr 14, 11:19 pm, Brandon Ferguson bnfergu...@gmail.com wrote:
 Holy crap that's a lot to digest! Thanks! A lot of ideas in here to
 play with. For me and my purposes with Processing the big challenge
 has been the fact that I have little say about the draw loop. It just
 fires (or I can call it manually with a redraw, but then it just
 executes whatever is in that function). I had a nice recursive
 function with no state in the beginning but the first fire of draw
 would set it off and it'd draw a bunch of the screen and I'd never see
 anything after that from it (cause it'd never return and we'd not get
 to the next draw call/frame). Think there might be ways around that
 just not sure yet.

 Thanks again, and I'll certainly post with an update with where I get
 (probably won't be able to dive into it again until the weekend sadly :
 (  ).

 On Apr 14, 1:00 pm, Ken Wesson kwess...@gmail.com wrote:







  On Wed, Apr 13, 2011 at 1:22 PM, Brandon Ferguson bnfergu...@gmail.com 
  wrote:
   I'm not sure if this is the place to ask this but I've been struggling
   with a few things in the world of Clojure. I've been using Processing
   to learn Clojure (since I'm somewhat familiar with Processing) but the
   tough part has been dealing with things like x, y positions of objects
   without keeping some global state (I'm not sure if it's even
   possible).

  If you're currently using atoms, you already have a function to
  compute the new position from the old, say, next-position, which you
  use with something like (swap! ball-pos next-position).

  Now consider this: (iterate next-position initial-ball-pos). That
  evaluates to an (infinite!) sequence of ball positions. You could have
  an animation loop step along this sequence, render a frame, wait,
  step, render, wait, etc. until the ESC key is hit (or whatever).

  For multiple balls that might interact with one another, a given
  ball's next position becomes a function of the other ball positions
  and not just its own. So you end up with:

  (iterate next-world-state initial-world-state)

  with world states being e.g. maps of ball-IDs to ball-positions or
  something. Obviously, other kinds of changeable world state can be
  included, too, e.g. Pong paddle positions, or the locations and amount
  of damage taken by Arkanoid bricks.

  This works until you get interactive (e.g. letting a human player
  control a paddle or something). At that point, iterate becomes a bit
  icky because the function becomes impure (as it polls the input
  devices).

  Then you probably just want two components:

  1. A Swing GUI that captures mouse and keyboard events in the game's
  JPanel as well as rendering the frames there.
  2. A game loop.

  The simplest case uses the Swing EDT as the game loop, with a Timer
  triggering game updates. But that requires mutable state for the game
  state to persist between Timer events.

  The other case keeps most of the game state immutable, but requires a
  bit of mutability to pass input to the game from the GUI:

  1. The Swing event handlers post input messages to a
  LinkedBlockingQueue, or update atoms or refs holding the current
  position of the mouse and state (down or up) of relevant mouse buttons
  and keyboard keys.

  2. The game loop runs in its own thread and looks something like this:

  (loop [foo bar other game state variables]
    ...
      (recur new-foo new-bar new-other ...)...)

  The game checks the input state, or drains the LinkedBlockingQueue, or
  whatever when it comes around to updating the player's position.

  One way to do it is just to have a set of game world objects:

  (loop [time (System/currentTimeMillis)
         world (hash-set (cons (new-player) (generate-initial-world-state)))]
    (let [world (map (partial update-position world) world)
          new-objects (mapcat new-things world)
          damages (reduce (partial merge-with +) {} (map do-damage world))
          world (concat
                  new-objects
                  (remove dead?
                    (map (partial apply-damages damages) world)))]
      (SwingUtilities/invokeAndWait
        (fn []
          (let [g (get-the-jpanel's-double-buffer-graphics)]
            (doseq [obj world] (draw-on! obj g)))
          (flip-the-jpanel's-double-buffer!)))
      (if (some is-player? world)
        (let [elapsed (- (System/currentTimeMillis) time)
              sl (- *ms-per-frame* elapsed)]
          (if ( sl 0) (Thread/sleep sl))
          (recur 

Re: Open Source Projects for Beg/ Intermediate

2011-04-16 Thread Ulises
 I disapprove of discouraging people from offering to help with OSS:
 that's how you get started and how you get good.

Well, it's not really discouraging. Or at least, I don't see it that
way. I see it more like encouraging to contribute but not regardless
of personal interest. Personal interest on a project is a great
motivator. Technical interest is likely to get you some of the way,
but not all the way. Just mho :)

U

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

2011-04-16 Thread Sean Corfield
On Thu, Apr 14, 2011 at 6:47 PM, Carin Meier gigasq...@yahoo.com wrote:
 I have fallen for Clojure.  I would love to be able to practice and
 hone my skills while contributing something to an open source
 project.  Do you have any suggestions for projects that might have
 some low-hanging fruit for a newish person like me.  Any floors that
 need sweeping?

When I started with Clojure, I mostly focused on solving problems in
Clojure that cropped up in my day job (not using Clojure) so I was
essentially double developing a lot of things. That kept working in
a domain I knew, knowing how to solve those problems in language X and
then figuring out how to solve them elegantly in Clojure. Some times
I'd ask on the #clojure IRC channel on freenode for input - folks are
extremely helpful and the feedback was very valuable (and continues to
be!).

I think the advice to find - or create - a project that interests you
and solves a problem you have is good advice. You need to know the
domain so that you're not trying to learn two languages at once (the
idioms of the domain language and the idioms of the programming
language).

So, questions to Carin, Alex and Alan (and Ulises): What interests
you? What problems do you have that you'd like solutions for? Knowing
that, folks might be able to point you at existing projects to take
part in (or might confirm no such project exists and they'd be
interested in collaborating with you)...
-- 
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: Open Source Projects for Beg/ Intermediate

2011-04-16 Thread Phil Hagelberg
On Apr 14, 6:47 pm, Carin Meier gigasq...@yahoo.com wrote:
 I have fallen for Clojure.  I would love to be able to practice and
 hone my skills while contributing something to an open source
 project.  Do you have any suggestions for projects that might have
 some low-hanging fruit for a newish person like me.  Any floors that
 need sweeping?

Clojars could use some help: https://github.com/ato/clojars-web/issues

Here's a thread about possible improvements:
http://groups.google.com/group/clojars-maintainers/browse_thread/thread/d4149ec96316d5b1

Chime in on that thread if anything there looks appealing.

-Phil

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

2011-04-16 Thread Sam Aaron
It feels to me that in addition to asking which open source projects would be 
useful/beneficial for novices to hack on, it would be useful to have a list of 
open source projects that are useful/beneficial for novices to read and 
understand.

One thing that Clojure has taught me is that code reading is both possible and 
highly valuable. I think that having a list of approachable and idiomatic code 
bases would be a beneficial asset to our community.

Sam

---
http://sam.aaron.name

On 15 Apr 2011, at 02:47, Carin Meier wrote:

 I have fallen for Clojure.  I would love to be able to practice and
 hone my skills while contributing something to an open source
 project.  Do you have any suggestions for projects that might have
 some low-hanging fruit for a newish person like me.  Any floors that
 need sweeping?
 
 Carin Meier
 @carinmeier
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with your 
 first post.
 To unsubscribe from 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