Re: Debugging clojure functions which are invoked in java code (eclipse)

2011-08-30 Thread artella
The basic observation was as follows : Suppose I have a java project called "tinyJava" and a clojure project called "tiny". To use the clojure code in java, I had to export the clojure as a jar (say ttt.jar), and then in the java project I had to do the following : a)Rightclick on project tinyJav

Re: ClojureScript and lein?

2011-08-30 Thread Rich Hickey
This thread is no longer about Clojure - please take it elsewhere. Thanks, Rich On Aug 30, 2011, at 8:54 PM, Ken Wesson wrote: > On Tue, Aug 30, 2011 at 2:19 PM, Phil Hagelberg wrote: >> On Tue, Aug 30, 2011 at 10:10 AM, Ken Wesson wrote: VirtualBox is free: http://www.virtualbox.org/ >

Re: Trouble embedding clojurescript in server application

2011-08-30 Thread Raju Bitter
Found the problem: When I have a :main configuration entry in my project.clj, I get the error messages. Here's what my project.clj looks like: (defproject cljsconsole "1.0.0-SNAPSHOT" :description "Web Console for ClojureScript compilation" :repositories {"clojure-releases" "ht

Re: ClojureScript and lein?

2011-08-30 Thread Ken Wesson
On Tue, Aug 30, 2011 at 2:19 PM, Phil Hagelberg wrote: > On Tue, Aug 30, 2011 at 10:10 AM, Ken Wesson wrote: >>> VirtualBox is free:  http://www.virtualbox.org/ >> >> Emulators? I hadn't considered those [...] >> >> I'd think it especially likely that if there's a free one, there're a >> lot of s

Re: What are the advantages of clojurescript over straight-forward javascript?

2011-08-30 Thread Mark Rathwell
On Tue, Aug 30, 2011 at 6:06 PM, Mike S wrote: > > > Two question: > 1. Can I use clojurescript with dojo? You should be able to use the advanced compile option with Dojo, it is the only library other than Google Closure to meet the Closure compiler requirements for the advanced compilation optio

Re: Trouble embedding clojurescript in server application

2011-08-30 Thread Raju Bitter
I've experienced the same problem (long list of undeclared vars) on OS X (10.6.8), with JDK version 1.6.0.26 and 1.6.0.22, when I tried to call the cljs.closure/build function out of a Ring/Compojure web application. Then I tested on Ubuntu 11.04 in VirtualBox, just trying to compile a *.cljs file

Re: What are the advantages of clojurescript over straight-forward javascript?

2011-08-30 Thread David Nolen
On Tue, Aug 30, 2011 at 6:06 PM, Mike S wrote: > Two question: > 1. Can I use clojurescript with dojo? > You'll have to try it and see. > 2. what are the advantages of clojurescript compared to just writing > the code in javascript? I can see why clojure would be useful for java/ > jvm (dynami

What are the advantages of clojurescript over straight-forward javascript?

2011-08-30 Thread Mike S
Two question: 1. Can I use clojurescript with dojo? 2. what are the advantages of clojurescript compared to just writing the code in javascript? I can see why clojure would be useful for java/ jvm (dynamic/interactive development rather than compilation cycle, it does away with much java boilerp

Debugging clojure functions which are invoked in java code (eclipse)

2011-08-30 Thread artella
Hi, I was wondering if it is possible, when calling clojure code from within java, to have the debugger step between the java and clojure sources at the point where the clojure function is invoked. I have outlined the question in more detail at : http://stackoverflow.com/questions/7230977/debuggi

[CUFP 2011] Birds of a Feather sessions

2011-08-30 Thread Ashish Agarwal
= Birds of a Feather sessions (BOFs) Commercial Users of Functional Programming Workshop (CUFP 2011) http://cufp.org/bofs-2011 To

Closure Tools - Google Code

2011-08-30 Thread malathi malu
An easy templating system for both Java & JavaScript. Closure Templates simplify the task of dynamically generating HTML. They have a simple syntax that is natural ... code.google.com/closure Closure Service. "With Closure, funds travel between law offices and to lenders for payouts with the click

Re: Clojure for Android

2011-08-30 Thread Raju Bitter
There are 3 approaches you could take for using ClojureScript to develop an Android app: 1) Use ClojureScript in combination with PhoneGap: the generated JavaScript will then be run inside a webview component (headless browser). 2) Build a normal Android app with a Java/Android based UI, accessing

Re: Clojurescript Beginner's Question

2011-08-30 Thread atucker
That did it, thanks again! On Aug 30, 8:50 pm, "Gijs S." wrote: > I have not run your fade example, but I think the (.play anim) is to > blame. You should use (. anim (play)). The explanation for this is > athttps://github.com/clojure/clojurescript/wiki/Differences-from-Clojure > in the 'Host In

Re: newbie questions

2011-08-30 Thread Mark Nutter
There are some old "Getting Started" steps out there, but you'll probably get a better start if you Google for "leiningen" and "swank-clojure" for a more up-to-date technique. If you need to tell the Clojure process to quit, the syntax is (System/exit 0). Mark On Tue, Aug 30, 2011 at 4:32 PM,

newbie questions

2011-08-30 Thread labwork07
(1) I have followed the "Getting started" steps and installed clojure-mode in Emacs. However, when I edit a .clj file, I am in clojure-mode (Ch m) but no "clojure" on the menubar. There should be one, right? What am i missing. (2) I just use Mx inferior-lisp. But how do you get out of clojure

Re: Clojurescript Beginner's Question

2011-08-30 Thread Gijs S.
I have not run your fade example, but I think the (.play anim) is to blame. You should use (. anim (play)). The explanation for this is at https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure in the 'Host Interop' section. An example is at https://github.com/clojure/clojurescrip

Re: Clojurescript Beginner's Question

2011-08-30 Thread atucker
Thank you that works! But I see what you mean about rough edges, it's not for the faint-hearted. So for example I have no idea how to find out why fading works with this JavaScript: goog.require('goog.dom'); goog.require('goog.fx.dom'); function fade() { var kurdt = goog.dom.getElement("kur

Re: ClojureScript and lein?

2011-08-30 Thread Phil Hagelberg
On Tue, Aug 30, 2011 at 10:10 AM, Ken Wesson wrote: >> VirtualBox is free:  http://www.virtualbox.org/ > > Emulators? I hadn't considered those [...] > > I'd think it especially likely that if there's a free one, there're a > lot of software that won't quite work the same as on a separate PC, > an

Re: Protocols as a way to improve modularity?

2011-08-30 Thread Sergio Bossa
On Tue, Aug 30, 2011 at 7:29 PM, Ambrose Bonnaire-Sergeant wrote: > I've seen a common pattern of putting functions you want used by other > namespaces in a group at > the bottom of the file. The lack of forward declarations also encourages > this. Yep, I've already done that, just reasoning abo

Re: Protocols as a way to improve modularity?

2011-08-30 Thread Ambrose Bonnaire-Sergeant
Hi Sergio, I think the public/private function options cover your bases here. If you have so many public functions in a namespace, possibly could be a sign to separate them into other namespaces, possibly nested. I certainly think using protocols for this would be an abuse. I've seen a common p

Protocols as a way to improve modularity?

2011-08-30 Thread Sergio Bossa
Hi all, in an attempt to find the more idiomatic way to modularize Clojure applications, I was thinking at the role protocols play in such a context. That is, let's say we have a Clojure application with each source file representing a different module (there may obviously be other files with help

Re: ClojureScript and lein?

2011-08-30 Thread Ken Wesson
On Tue, Aug 30, 2011 at 1:03 PM, Mark Rathwell wrote: >> The sole alternative to an additional >> machine in that case is to perform major surgery on an existing one, >> involving a hard drive repartitioning > > VirtualBox is free:  http://www.virtualbox.org/ Emulators? I hadn't considered those,

Re: A re look at re-groups

2011-08-30 Thread Ken Wesson
On Tue, Aug 30, 2011 at 11:18 AM, Matt Smith wrote: > I have been studying patterns or the notion of idiomatic code in > Clojure.  The code in clojure.core has some good examples of proper > Clojure code and is well done.  For that reason I was a bit surprised > at the definition for re-groups: >

Re: ClojureScript and lein?

2011-08-30 Thread Mark Rathwell
> The sole alternative to an additional > machine in that case is to perform major surgery on an existing one, > involving a hard drive repartitioning VirtualBox is free: http://www.virtualbox.org/ On Tue, Aug 30, 2011 at 12:57 PM, Ken Wesson wrote: > On Mon, Aug 29, 2011 at 9:09 PM, Eric Lavi

Re: ClojureScript and lein?

2011-08-30 Thread Ken Wesson
On Mon, Aug 29, 2011 at 9:09 PM, Eric Lavigne wrote: >> I'm >> also a Mac user and probably in home all this howto will work, but in >> company where we all are using Windows there is no chance to get it >> working easily. > > There are people at your workplace who program in Clojure, or who are >

Re: A re look at re-groups

2011-08-30 Thread Matt Smith
On Aug 30, 10:16 am, Armando Blancas wrote: > > It seems like the loop/recur is non-idiomatic for this usage and could > > be done with either a map or reduce. > > It could be that it's faster that way. How does you code perform? Timings on this code for all three: (time (count (map re-match

Re: get keys from defrecord

2011-08-30 Thread Ken Wesson
On Mon, Aug 29, 2011 at 10:14 PM, Steve Miner wrote: > > On Aug 29, 2011, at 8:20 PM, Alex Miller wrote: > >> I'm not sure if there are any enhancements in the 1.3 record support >> for this feature. > > > In 1.3beta2, the record class has a static method getBasis that will give you > the fields.

Re: A re look at re-groups

2011-08-30 Thread Armando Blancas
> It seems like the loop/recur is non-idiomatic for this usage and could > be done with either a map or reduce. It could be that it's faster that way. How does you code perform? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, s

A re look at re-groups

2011-08-30 Thread Matt Smith
I have been studying patterns or the notion of idiomatic code in Clojure. The code in clojure.core has some good examples of proper Clojure code and is well done. For that reason I was a bit surprised at the definition for re-groups: (defn re-groups [^java.util.regex.Matcher m] (let [gc (.

Aw: is there a 4Clojure forum anywhere?

2011-08-30 Thread finbeu
Hmm, I got stuck on the "Compress a sequence". I had a look at the clojure/core.clj distinct function and I guess I have to use something similar to define my function. Or is it easier? - finbeu -- You received this message because you are subscribed to the Google Groups "Clojure" group. To p

Re: ClojureScript and lein?

2011-08-30 Thread Michael Jaaka
Ok, I have manage to run clojure script "Hello World" example, even without coping server dir. All I have done was uninstalling all java. Installing Jdk 1.6 update 27 with default paths suggested by installator. Installing cygwin with curl and unzip. And running this self-made script from cygwin

Re: Problem with ClojureScript and Node.js

2011-08-30 Thread Christopher Redinger
I checked in a change this morning that fixes this. On Wednesday, August 17, 2011 11:25:54 AM UTC-4, Mark McGranaghan wrote: > > > > On Jul 28, 4:50 pm, Anthony Grimes wrote: > > Oh! I apologize. I was replying via the google interface and didn't > realize > > it wasn't quoting. Here is a link

Re: Minor Speedup of STM removing milliseconds [Was: Why do transactions block each other?]

2011-08-30 Thread Michael Wood
Hi On 30 August 2011 14:05, Stefan Kamphausen wrote: > Hi, > > using a current git checkout of master (git describe says > 'clojure-1.3.0-beta2-2-g0689c47') I ran the test-code from > http://clojure.org/refs like this: > > (time (run 100 10 10 100)) > "Elapsed time: 18413.314789 msecs" > > Ac

Re: Clojurescript Beginner's Question

2011-08-30 Thread Gijs S.
Hi, I have run into a similar problem. The problem is something with the "require" and namespaces in JavaScript. The following worked for me: (ns example.example (:require [goog.fx.Dragger :as unused-alias])) And then to call the Dragger constructor: (goog.fx.Dragger. ) In the twitterbuzz exam

Minor Speedup of STM removing milliseconds [Was: Why do transactions block each other?]

2011-08-30 Thread Stefan Kamphausen
Hi, using a current git checkout of master (git describe says 'clojure-1.3.0-beta2-2-g0689c47') I ran the test-code from http://clojure.org/refs like this: (time (run 100 10 10 100)) "Elapsed time: 18413.314789 msecs" Actually I ran that code several times until I would see no improvement

Re: Why do transactions block each other?

2011-08-30 Thread Colin Yates
> > (thank you, Mr Murphy, for having made the tests look like beta2 behaved > differently from the others ...) > Hang on - I thought Murphy worked exclusively for us? Has he been moon-lighting again? If so, we will have to redesign our scheduling, our disaster recovery plan, our requirements c

Re: Clojurescript Beginner's Question

2011-08-30 Thread atucker
On Aug 30, 11:05 am, atucker wrote: / I thought perhaps the problem was related to this onehttp://groups.google.com/group/clojure/browse_thread/thread/2ad1db6d4..., / but Dragger.js hasn't been updated since January. Sorry! That's not true at all. But even in the older library version bundled

Re: Clojurescript Beginner's Question

2011-08-30 Thread atucker
Hmm thanks. I should try out Firebug myself. I thought perhaps the problem was related to this one http://groups.google.com/group/clojure/browse_thread/thread/2ad1db6d4022e0d3/dd53b4578496a731?lnk=gst&q=closure+version#dd53b4578496a731, but Dragger.js hasn't been updated since January. I also tr

Re: pretty-print by default?

2011-08-30 Thread Tassilo Horn
Phil Hagelberg writes: Hi Phil, >> You can set :repl-options [:print clojure.contrib/pprint], but that >> depends on pprint being required before the repl launches, and I >> can't think of a straightforward way to do that. Perhaps adding an >> :eval-init entry in project.clj which can contain ne

Re: Why do transactions block each other?

2011-08-30 Thread Laurent PETIT
2011/8/30 Kevin Downey > the two threads race to acquire the write lock and the winner runs, > the loser retries. my guess is acquiring the write lock helps avoid > live locks between transactions. > Yes, and after re-reading http://clojure.org/refs , the current behaviour does not seem to viola