Re: Tron clone in Clojure

2011-04-04 Thread Ryan Sattler
Here's a 2D game I wrote in Clojure for comparision: http://github.com/ShardPhoenix/SAGame This was my first significant Clojure program so the code is a bit rough, but the core game state is handled in a pure-functional way, and is continuously passed around the main loop. -- Ryan Sattler -- Y

Re: (take-by f coll), (drop-by f coll): Problem Comparing Adjacent Items Of A Collection

2011-04-04 Thread Meikel Brandmeyer
Hi, On 5 Apr., 01:27, Ken Wesson wrote: > Oh, and it also doesn't hold onto the head: Your version of partition-by is basically equivalent to: (defn partition-by [f coll] (lazy-seq (when-let [s (seq coll)] (let [fst (first s) value(f fst)

Re: bug report : cl-format

2011-04-04 Thread Tom Faulhaber
Hi Carlos, This certainly looks like a bug. I've filed issue 768 on myself (http://dev.clojure.org/jira/browse/CLJ-768) and I'll take a look as soon as I get a chance. Thanks for bringing this up, Tom On Apr 3, 1:49 pm, Carlos Ungil wrote: > Hello, > > I don't know if there is a better way to

Re: Clojure Code Highlighting in Presentations

2011-04-04 Thread Heinz N. Gies
Thanks a lot people :) I see there is no best but a ton of possibilities! Your help is very much appreciated Regards, Heinz smime.p7s Description: S/MIME cryptographic signature

Re: ANN: Clojure wrappers for Liquibase and Spring-JDBC

2011-04-04 Thread Shantanu Kumar
I have created a Leiningen plugin for Clj-Liquibase to enable a command-line access. The URL is below - your feedback will be appreciated: https://bitbucket.org/kumarshantanu/lein-lb/src You can discuss about it either here or in the project discussion group: http://groups.google.com/group/bitum

Re: Tron clone in Clojure

2011-04-04 Thread Shree Mulay
really cool! On Apr 4, 4:10 pm, "pepijn (aka fliebel)" wrote: > Hi, > > I'm at the moment writing a 2D game 'thing' (wouldn't call it a > framework or engine really) I don't have it released yet, but when I > do, I'll post it on this list. > > In my 'thing', I just do something like this for the

How to profile my app?

2011-04-04 Thread Base
Hi Group! I am hoping to get a little help figuring out how to profile my app. I have been working on this for a while and appear to have a bottleneck somewhere. I could attempt to manually step through the app step by step, but I am looking to see if there is a better solution. How to you all

Re: (take-by f coll), (drop-by f coll): Problem Comparing Adjacent Items Of A Collection

2011-04-04 Thread Ken Wesson
On Mon, Apr 4, 2011 at 7:07 PM, Ken Wesson wrote: >> I summarised my issues with the different solutions. Since things got >> a bit philosophical I wrote up a short blog post on my point of view: >> http://bit.ly/hInw0J > > I'm surprised to hear that partition-by is not very lazy, and will > hang

Re: Protocols and name collisions

2011-04-04 Thread Alan
You can't turn clojure.core/first into a protocol - it's already a bare function. When you define a protocol with a first method, you define a new function in your namespace called first, which delegates to protocol implementations. The compiler is complaining that you're shadowing clojure.core/fir

Protocols and name collisions

2011-04-04 Thread Timothy Baldridge
I'm trying out some protocol code. Here's what I'm trying: (defprotocol AFirst (first [s])) this blows up with : (defprotocol AFirst (first [f])) Warning: protocol #'foo/AFirst is overwriting function first WARNING: first already refers to: #'clojure.core/first in namespace: foo, being replaced

Re: (take-by f coll), (drop-by f coll): Problem Comparing Adjacent Items Of A Collection

2011-04-04 Thread Ken Wesson
> I summarised my issues with the different solutions. Since things got > a bit philosophical I wrote up a short blog post on my point of view: > http://bit.ly/hInw0J I'm surprised to hear that partition-by is not very lazy, and will hang on an infinite seq. Fortunately, that can be fixed: (defn

Re: (take-by f coll), (drop-by f coll): Problem Comparing Adjacent Items Of A Collection

2011-04-04 Thread Meikel Brandmeyer
Hi, On 3 Apr., 14:45, Roman Sykora <4rt.f...@gmail.com> wrote: > Now, my question is what's the improvement of > > > (defn take-by [f coll] > >   (let [fs (map f coll) > >          ps (map = fs (rest fs)) > >          zs (map #(if %1 %2 sentinel) ps (rest coll))] > >     (cons (first coll) (take-

Re: Shaping my game API

2011-04-04 Thread Timothy Baldridge
In a test game engine I developed, I simply used maps and created a sort of "duck" typing. It actually worked quite well. For instance, each entity would have a :physics-update function: ((:physics-update entity) entity timespan) It ended up working very well. I had a few thousand entities, all u

Re: Shaping my game API

2011-04-04 Thread Joost
Pepijn de Vos wrote: > Hey, Hi, Just a couple of remarks: > I'm writing some Clojure game stuff, and I'm having trouble coming up with a > sensible model for the game objects. > > The basic idea is that I have a bunch of objects that represent the game, and > call 'act' on them, supplying the

Re: Tron clone in Clojure

2011-04-04 Thread pepijn (aka fliebel)
Hi, I'm at the moment writing a 2D game 'thing' (wouldn't call it a framework or engine really) I don't have it released yet, but when I do, I'll post it on this list. In my 'thing', I just do something like this for the game loop(pseudocode): (doseq [frame (iterate #(map act %) initial-state)]

Shaping my game API

2011-04-04 Thread Pepijn de Vos
Hey, I'm writing some Clojure game stuff, and I'm having trouble coming up with a sensible model for the game objects. The basic idea is that I have a bunch of objects that represent the game, and call 'act' on them, supplying the current world to get their next state. The objects have a few p

Access constructor and fields with default (package) access level

2011-04-04 Thread leonelag
Hi, This question in StackOverflow.com shows that it's not possible to access constructors and fields of existing Java classes with package- level access: http://stackoverflow.com/questions/5540931/clojure-cant-access-non-public-fields-in-the-same-package Since integration with existing Java cod

clj3D, a Clojure 3D Library

2011-04-04 Thread Alfredo
Good evening (in Italy are 7:40 pm) to everyone, this is my first post on Clojure Google Group so I'm really excited. In first place I want to thanks Rich Hickey for making this awesome language and all the other people that work on clojure.core, as well as all the programmers that contribute every

Re: (take-by f coll), (drop-by f coll): Problem Comparing Adjacent Items Of A Collection

2011-04-04 Thread Alan
Yes. Generally push lazy-seq as high in the chain as you can (but no higher!), for that reason.. On Apr 3, 11:09 pm, Roman Sykora <4rt.f...@gmail.com> wrote: > Thank you for your time and kind answers. I really enjoy reading this > group and the whole clojure community. Enough flattery ;) > > A qu

Re: using clojure for (java) code generation; advice sought

2011-04-04 Thread B Smith-Mannschott
The issue of Multi-threading has cropped up WRT templating. It's not clear from the StringTemplate documentation what is and what isn't thread safe. From the look of the API, though I wouldn't be on anything. Fleet, mentioned in the previous message seems to have a real problem here too since flee

Tron clone in Clojure

2011-04-04 Thread Tzach
I present my take on the classic Tron game in Clojure, inspired by Paul Richards Clojuroids and Mark Volkmann Snake games (thanks guys) Code and Jar are available here: https://sites.google.com/site/tzachlivyatan/tron-clone-in-clojure Inputs and comments will be appreciated! specifically, I'm un

Re: Clojure Code Highlighting in Presentations

2011-04-04 Thread semperos
On my Mac, I use pygmentize on the command-line to generate a syntax-colored HTML file from a Clojure source file. Then I open the HTML file in Safari and copy-and-paste the code into Keynote. The Mac clipboard keeps the formatting between those two programs. A bit round-a

Re: Clojure Code Highlighting in Presentations

2011-04-04 Thread jweiss
I use emacs, and there's the htmlize feature which will output highlighted code in HTML, looking the same as it does in emacs. It not only preserves highlighting in clojure code or other languages, but in *any* emacs buffer. http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el.cgi On Apr 3, 8:15 pm,

Re: (take-by f coll), (drop-by f coll): Problem Comparing Adjacent Items Of A Collection

2011-04-04 Thread Roman Sykora
Thank you for your time and kind answers. I really enjoy reading this group and the whole clojure community. Enough flattery ;) A question remains though (for now). Would I use (lazy-seq (some (stuff ...))) instead of (some (stuff (lazy-seq ...))) because some stuff would only be

Re: Clojure Code Highlighting in Presentations

2011-04-04 Thread Jose Figueroa Martinez
Hello, I use my own web code highlighter based on vim7. It output html code which can be used with lot of css color styles. Try it, maybe it can help you :-) http://buhoz.net/codevim/ Saludos. José Figueroa Martínez. On 3 abr, 17:15, "Heinz N. Gies" wrote: > Hi everyone, > not a clojure techn