On Google App Engine and reference types

2009-10-01 Thread samppi
I've heard a lot that Google App Engine's use of many JVMs makes Clojure refs, etc. less useful than they are on one JVM. I'm curious— what are the consequences of using a ref normally in Google App Engine? How would it be broken? Would each JVM, invisibly, each store a different value for the

Debugging questions

2009-10-01 Thread Ze maria
Hello guys,I've read the Stuart Halloway's book, worked through it, and I've being programming in clojure in the last few weeks. I'm using Clojure 1.0.1-alpha-SNAPSHOT with emacs + slime + swank. Until now, everything went smoothly, however as my code went bigger it become harder to debug

Re: Timing, JIT, Heisen-code

2009-10-01 Thread Fredrik Ohrstrom
Oh, and by the way: the expression (+ 1 2 3) is indeed a constant. Be very wary of tests that verify the execution speed of constants since it is definitely the goal of the JVM developers to make the JVM compile these into a single constant mov in the machine code! Of course such code is so fast

REPL integration in a existing java project

2009-10-01 Thread DomS
Hello all, I'm trying to integrate an REPL in a existing java project, but i dont know how it works or where to start. At first it should only have the functionality from an ordinary clj repl. Later we want to extend it with some functions and macros, to control our software via console. Help

Re: ClojureCLR and CLR structs

2009-10-01 Thread Shawn Hoover
Works for me. Thanks! On Thu, Oct 1, 2009 at 1:24 AM, David Miller dmiller2...@gmail.com wrote: Should be fixed in the latest commit. Any of the following will work. (System.Reflection.Assembly/Load WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35) (import

Citing clojure

2009-10-01 Thread Hadley Wickham
Hi all, Are there any preferences for citing clojure in academic publications? Thanks, Hadley --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: RFC: laziness-safe, semi-dynamic environment Var(Lite)

2009-10-01 Thread jon
On Sep 29, 10:31 pm, Rich Hickey richhic...@gmail.com wrote: On Tue, Sep 29, 2009 at 4:04 PM, jon superuser...@googlemail.com wrote: Before leaping to implementation/performance issues, I think it is important to think about the semantics of this - what does it mean? I think you will get a

Re: Timing, JIT, Heisen-code

2009-10-01 Thread Jonathan Smith
On Sep 30, 1:18 pm, Matt Brown mrbrow...@gmail.com wrote: Hi. Thanks all, for your comments. You need to use a bigger number than 1000 for these results to be meaningful. Out of curiousity, why is this? Does the JIT do something different after 1000 iterations? Or is the concern

Re: Re: Schema for data structures

2009-10-01 Thread Emeka
Artyom, (provide/contract [interp (- AE? number?)]) ;; interpret an arithmetical expression yielding a number (define (interp exp) ;; type-case is very much like a case ... of in Haskell/ML (type-case AE exp (num (n) n) (plus (l r) (+ (interp l) (interp r))) (sub (l

Re: RFC: laziness-safe, semi-dynamic environment Var(Lite)

2009-10-01 Thread Rich Hickey
On Thu, Oct 1, 2009 at 12:03 PM, jon superuser...@googlemail.com wrote: On Sep 29, 10:31 pm, Rich Hickey richhic...@gmail.com wrote: On Tue, Sep 29, 2009 at 4:04 PM, jon superuser...@googlemail.com wrote: Before leaping to implementation/performance issues, I think it is important to think

Syntax for proxy methods?

2009-10-01 Thread timc
Can someone please advise me if this is possible: // --- IX.java --- interface IX { void doit(); void doit(int n); } ; --- x.clj --- (def prx (proxy [IX][] (doit ([] (doseq [x someSeq] (doit x)) ([y] (print y When I tried something of this form, it looks like the call of

Problem using shell-out in Windows command prompt

2009-10-01 Thread Nick Day
Hey, I've just been trying to run a couple of simple commands using shell- out (e.g. (sh dir)) in a repl in Windows command prompt, but am running up against errors of the type java.io.IOException: Cannot run program dir: CreateProcess error=2, The system cannot find the file specified

Re: Syntax for proxy methods?

2009-10-01 Thread Jarkko Oranen
On Oct 1, 9:18 pm, timc timgcl...@gmail.com wrote: snip (def prx (proxy [IX][]   (doit     ([] (doseq [x someSeq] (doit x))     ([y] (print y When I tried something of this form, it looks like the call of the 1- arg function from the 0-arg function can't be resolved. Thanks in

server-socket on exit event

2009-10-01 Thread ngocdaothanh
I want to write a simple socket server in Clojure. I want to perform some action when a client disconnects. I tried server-socket: http://richhickey.github.com/clojure-contrib/server-socket-api.html but it does not support on exit event. Is there a solution? Should I look at something like

Re: server-socket on exit event

2009-10-01 Thread Roger Gilliar
I want to write a simple socket server in Clojure. I want to perform some action when a client disconnects. --- The following code works for me. read-input returns nil if the socket is closed (the client disconnects) Regards Roger (defn read-input

Re: server-socket on exit event

2009-10-01 Thread ngocdaothanh
Roger, your code is not event based. I'm new to Clojure and as a small exercise I just want to create a simple chat server for telnet clients, any usable socket library is OK: * Chat messages are broadcast to all clients * When a client disconnect, all others will receive A client has

Re: Syntax for proxy methods?

2009-10-01 Thread timc
No, its a proxy for an interface. On Oct 1, 7:22 pm, Jarkko Oranen chous...@gmail.com wrote: On Oct 1, 9:18 pm, timc timgcl...@gmail.com wrote: snip (def prx (proxy [IX][]   (doit     ([] (doseq [x someSeq] (doit x))     ([y] (print y When I tried something of this form, it

Re: Citing clojure

2009-10-01 Thread Dragan Djuric
I usualy cite Rich's conference paper and Stuart's book. @conference{hickey2008clojure, title={{The Clojure programming language}}, author={Hickey, R.}, booktitle={Proceedings of the 2008 symposium on Dynamic languages}, year={2008}, organization={ACM New York, NY, USA} } This paper

Re: server-socket on exit event

2009-10-01 Thread Roger Gilliar
Am 01.10.2009 um 21:28 schrieb ngocdaothanh: Roger, your code is not event based. What do you mean by not event based ? Regards Roger --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: Problem using shell-out in Windows command prompt

2009-10-01 Thread Stefan Tilkov
On Oct 1, 2009, at 7:39 PM, Nick Day wrote: Hey, I've just been trying to run a couple of simple commands using shell- out (e.g. (sh dir)) in a repl in Windows command prompt, but am running up against errors of the type java.io.IOException: Cannot run program dir: CreateProcess error=2,

Re: Problem using shell-out in Windows command prompt

2009-10-01 Thread John Harrop
On Thu, Oct 1, 2009 at 1:39 PM, Nick Day nicke...@gmail.com wrote: Hey, I've just been trying to run a couple of simple commands using shell- out (e.g. (sh dir)) in a repl in Windows command prompt, but am running up against errors of the type java.io.IOException: Cannot run program dir:

Re: Citing clojure

2009-10-01 Thread John Harrop
On Thu, Oct 1, 2009 at 3:42 PM, Dragan Djuric draga...@gmail.com wrote: I usualy cite Rich's conference paper and Stuart's book. @conference{hickey2008clojure, title={{The Clojure programming language}}, author={Hickey, R.}, booktitle={Proceedings of the 2008 symposium on Dynamic

Re: server-socket on exit event

2009-10-01 Thread John Harrop
On Thu, Oct 1, 2009 at 4:02 PM, Roger Gilliar ro...@gilliar.de wrote: Am 01.10.2009 um 21:28 schrieb ngocdaothanh: Roger, your code is not event based. What do you mean by not event based ? He means he wants automatic notification if a connection is dropped. I'm not sure TCP/IP has a

Re: Syntax for proxy methods?

2009-10-01 Thread timc
Oops, I spoke too hastily -- thank you Jarkko. On Oct 1, 8:38 pm, timc timgcl...@gmail.com wrote: No, its a proxy for an interface. On Oct 1, 7:22 pm, Jarkko Oranen chous...@gmail.com wrote: On Oct 1, 9:18 pm, timc timgcl...@gmail.com wrote: snip (def prx (proxy [IX][]   (doit  

Two minor typos in the cheatsheet

2009-10-01 Thread AlamedaMike
odd and even should be odd? and even? Thanks for creating this. Most useful. --~--~-~--~~~---~--~~ 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

Re: server-socket on exit event

2009-10-01 Thread ngocdaothanh
I'm not sure TCP/IP has a native facility for that. I'm afraid John's statement is correct: http://www.velocityreviews.com/forums/t125620-client-socket-disconnection-event-not-received-on-server-socket-java-nio.html and trying to read and write until something wrong happens as demonstrated in

Re: Citing clojure

2009-10-01 Thread Krukow
On Oct 1, 10:17 pm, John Harrop jharrop...@gmail.com wrote: @conference{hickey2008clojure,  title={{The Clojure programming language}},  author={Hickey, R.},  booktitle={Proceedings of the 2008 symposium on Dynamic languages},  year={2008},  organization={ACM New York, NY, USA} }