Var binding and lazy structures behavior (bug?)

2009-05-22 Thread Josip Gracin
Hi! I'm getting unexpected behavior trying to use binding and map. Here's what happens. (def *v*) (defn fun [i] *v*) (defn bv [] (binding [*v* 100] (map fun [1 2]))) Evaluating (bv) throws "Var *v* is unbound exception". I expected it to return (100 100). Using the released Clojure 1.0

Re: Clojure for high-end game development

2009-05-22 Thread Brian Sletten
Most game development is obviously still done w/ C++, even for backend services which just astounds me. At best, some developers might be using Tomcat for community sites and whatnot. The tide is probably starting to turn, but there's not a lot of Clojure just yet. At Riot (http://riotgame

Re: Question about indentation in emacs.

2009-05-22 Thread Phil Hagelberg
pj writes: > I would like it to indent like this: > > (defn calendar-initial-sync [server user mailfile password formula] > (with-session session hostname username password > (with-open-db session db dbname > (with-search-results db docs formula > (foreach-note docs doc > > C

Question about indentation in emacs.

2009-05-22 Thread pj
Greetings. This is more of emacs question than Clojure question. I am trying to figure out how to change emacs Clojure mode's default indentation behaviour. By default, emacs is indenting my code like this: (defn calendar-initial-sync [server user mailfile password formula] (with-session ses

Re: Question about building modular code in Clojure

2009-05-22 Thread Mark Engelberg
OK, after looking at deftemplate with macroexpand, it's starting to make more sense. I suppose one downside to this versus load is that it's probably much more difficult to debug (just because all your code is wrapped in a macro), but basically I like the idea. --~--~-~--~~--

Re: Clojure at JavaOne

2009-05-22 Thread Christophe Grand
Rich Hickey a écrit : > Actually, let me extend that invitation - if anyone's got a small > (one-page-ish) Clojure program that does something interesting, and > are willing to have it demonstrated at JavaOne, please paste it > somewhere and post a note here. > I'm dabbling with a quick and d

Bay Area Clojure User Group meeting in SF during JavaOne (6/3) with Rich Hickey

2009-05-22 Thread Tom Faulhaber
We're very excited to announce a Bay Area Clojure User Group meeting in San Francisco with special guest Rich Hickey. The meeting will be Wed. June 3 @ 5:30PM. This is during the JavaOne conference and we hope that all Clojurians (and those interested in Clojure) who find themselves in SF for the

Re: compilation and classpath

2009-05-22 Thread Mark Engelberg
I also had lots of problems getting compilation to work. I think perhaps Clojure is making some assumptions about where your working directory is located relative to your clojure.jar and classpath, and if you have a different directory structure, things fail. For me, the solution was to explicit

Re: Bit-Shift without Sign-Extend?

2009-05-22 Thread Vincent Foley
Like other mentioned in the thread, Java has neither the >>> operator, nor unsigned data types. With that said, I think the function you are looking for is bit-shift- right: user> (bit-shift-right 2r1110 1) 7 I hope this helps. Vincent. On May 21, 9:39 pm, CuppoJava wrote: > Hi everyone, > I

Re: compilation and classpath

2009-05-22 Thread tsuraan
> You probably need to set (and create!) the correct compilation > (output) directory. This defaults to a "classes" directory as a > subdirectory of your current working directory. So if you had: And this worked! Now that I'm looking for the *compile-path* variable, I see that it's mentioned in

Re: compilation and classpath

2009-05-22 Thread Christopher Wilson
You probably need to set (and create!) the correct compilation (output) directory. This defaults to a "classes" directory as a subdirectory of your current working directory. So if you had: test/main.clj you'd need classes/ also make sure that this directory is on your classpath. I think this

Re: Bit-Shift without Sign-Extend?

2009-05-22 Thread Michael Wood
On Fri, May 22, 2009 at 5:17 PM, CuppoJava wrote: > > Wow that's news to me... > I thought this was a fairly standard operator. I'm surprised that Java > doesn't have a correct version of it. I think the problem is that Java does not have unsigned bytes (or other integer types). e.g. see here:

compilation and classpath

2009-05-22 Thread tsuraan
I'm having some trouble getting clojure to generate .class files. I have a directory layout like this: test/ main.clj where main.clj is the same file as from http://clojure.org/compilation, but with the 'clojure.examples.hello replaced with 'test.main . I've tried running clojure a few dif

Re: Bit-Shift without Sign-Extend?

2009-05-22 Thread CuppoJava
Wow that's news to me... I thought this was a fairly standard operator. I'm surprised that Java doesn't have a correct version of it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gr

Re: Clojure for high-end game development

2009-05-22 Thread Jeff Heon
> EA is a publisher, not a producer. And they did publish the videogame Abuse, which is made from a list variant: http://en.wikipedia.org/wiki/Abuse_(computer_game) Interestingly, there is a thread about video game programming using Lisp here: http://news.ycombinator.com/item?id=516778 And the

Re: Clojure for high-end game development

2009-05-22 Thread Ian Phillips
> You would think with Clojure's ability to make use of mutli cpu > hardware it would be a good choice for high-end game development. > > Does anyone know if big game studios like Electronic Arts are using or > looking into Clojure for this purpose? It's unlikely to be used in a core game engine

Re: Clojure for high-end game development

2009-05-22 Thread Daniel Lyons
On May 21, 2009, at 12:35 PM, tcg wrote: > Does anyone know if big game studios like Electronic Arts are using or > looking into Clojure for this purpose? Apparently one company wrote some games in Lisp (Jak and Daxter): http://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp Who knows? It

Clojure to the rescue....

2009-05-22 Thread Luc Prefontaine
This Monday, I got a call from a friend who's working at a large US company selling chips and scanners for id cards. They are biding on a large contract for a foreign country and need to provide printed samples in their answer to this RFP. The deadline is next week. The sample ids had to be printe

Re: Clojure at JavaOne

2009-05-22 Thread Brian Doyle
I have a one pagish program that you pass in your screen resolution and it randomly picks out a new desktop image from ftp.gnome.org, downloads the image and updates your desktop. This assumes your using Gnome. http://github.com/heyZeus/clojure-stuff/blob/0c81123fcb3dc4bafa0df94b6e32dc49729595d3/

Re: Clojure at JavaOne

2009-05-22 Thread Mark Derricutt
I did something similar the other week: http://www.talios.com/connecting_the_clouds__the_internet_in_new_zealand_in_pdf.htm Using clj_web_crawler and XHtmlRenderer to make a PDF of a locally available book (in wiki format) on the history of the New Zealand Internet. On Fri, May 22, 2009 at 11:16

Re: Clojure at JavaOne

2009-05-22 Thread Rich Hickey
On May 22, 7:16 am, Rich Hickey wrote: > On May 21, 11:38 pm, Adrian Cuthbertson > wrote: > > > >... impact part can be merged with the "business application" mindset by > > >generating a report that includes the data visualization (I think PDF > > >generation is built into processing). > > >

Re: Clojure at JavaOne

2009-05-22 Thread Rich Hickey
On May 21, 11:38 pm, Adrian Cuthbertson wrote: > >... impact part can be merged with the "business application" mindset by > >generating a report that includes the data visualization (I think PDF > >generation is built into processing). > > I've been doing some work with enlive and XHtmlRendere

Re: Question about building modular code in Clojure

2009-05-22 Thread Konrad Hinsen
On 22.05.2009, at 11:01, Mark Engelberg wrote: > I was thinking that if you have: > (def a 2) > (def b 3) > (defn f [] a) > > and you set it up with your deftemplate macro where f is the thing > that is parameterized, then if you try to pass in a new value for f, > like: > (fn [] b), it macro exp

Re: Clojure as a Java lib documentation / examples?

2009-05-22 Thread David Powell
On Fri 22/05/09 02:23 , Brett Morgan brett.mor...@gmail.com sent: > > Hi guys, > > I have some evil thoughts of using Clojure as a java library so that i > can use both the STM and the persistent data structures in projects > that my team of java developers can work with. > > As much as I'd l

Re: Clojure at JavaOne

2009-05-22 Thread David Powell
On Thu 21/05/09 17:43 , "Rich Hickey" richhic...@gmail.com sent: > > I'd like to do something modest but distinguishing. I have a vague > notion of showing some Clojure data originating in some XML off the > web, being passed to some filtering/walking code, getting displayed, > stored in a DB,

Re: La Clojure plugin for IntelliJ IDEA updated

2009-05-22 Thread Ilya Sergey
Hi Toni. Unfortunately for now we don't have neither description of existing features nor complete how-to manual. In fact some details look quite similar to Scala support, which is described here: http://www.jetbrains.net/confluence/display/SCA/Scala+Plugin+for+IntelliJ+IDEA We're going to add suc

Re: Question about building modular code in Clojure

2009-05-22 Thread Mark Engelberg
On Fri, May 22, 2009 at 1:37 AM, Konrad Hinsen wrote: > As long as it uses the same variables as the template, it would still > work, but (like the load-and-redefine method) it would fail as soon > as the template author decides to change the names of his variables. > I suppose that to some exten

Re: Bit-Shift without Sign-Extend?

2009-05-22 Thread David Powell
On Fri 22/05/09 03:39 , "CuppoJava" patrickli_2...@hotmail.com sent: > > Hi everyone, > I'm just wondering where the equivalent of the ">>>" > operator is forClojure. I need it to do a divide-by-power-of-2 on unsigned > bytes. Java doesn't have this either. Its >>> operator doesn't work prop

Re: Clojure for high-end game development

2009-05-22 Thread David Powell
On Fri 22/05/09 09:50 , "jdz" yohoho...@gmail.com sent: > > On May 21, 9:35 pm, tcg mail.com> wrote:> You would think with Clojure's ability to make > use of mutli cpu> hardware it would be a good choice for high-end > game development. > Clojure is not the only language which provides access

Re: La Clojure plugin for IntelliJ IDEA updated

2009-05-22 Thread Ilya Sergey
Vagif, Of course, we have plans to support remoter REPL as well. For now you may use `remote debug' run configuration type to connect to the appropriate application port and debug it. With best regards, Ilya 2009/5/21 Vagif Verdi > > Do you have plans to add connect/disconnect to existing runn

Re: Question about building modular code in Clojure

2009-05-22 Thread Konrad Hinsen
On 22.05.2009, at 10:03, Mark Engelberg wrote: > However, there seems to be one way that this solution falls short of > the load-and-redefine technique. I don't think it can ever fall short of the load-and-redefine technique because you can emulate it completely (unless I overlooked somethin

Podcast mentioning Clojure

2009-05-22 Thread Konrad Hinsen
The following podcast (from "IEEE Internet Computing") about functional programming for the Web is a nice introduction to the advantages of functional programming, and it does mention Clojure: http://www2.computer.org/portal/web/computingnow/functionalweb Those who have a hard time c

Re: Question about building modular code in Clojure

2009-05-22 Thread Mark Engelberg
On Wed, May 20, 2009 at 8:14 AM, Konrad Hinsen wrote: > Here is another solution that I consider preferable to the use of > load. Konrad, this is an interesting approach, and it does feel like a better way to organize similar modules than using load. However, there seems to be one way that this

Re: Clojure for high-end game development

2009-05-22 Thread jdz
On May 21, 9:35 pm, tcg wrote: > You would think with Clojure's ability to make use of mutli cpu > hardware it would be a good choice for high-end game development. Clojure is not the only language which provides access to multiple CPUs/cores. When programming with immutable data structures, th