Heroku and lein-cljsbuild

2012-03-02 Thread Timothy Licata
Hello all,

I'm having trouble getting clojurescript to compile with
lein-cljsbuild on heroku.  It works locally through foreman and runs
fine on heroku other than the cljs compilation issue.

I've tried a few things.  First of all, heroku doesn't put
:dev-dependencies on the classpath by default[1].  When I enable
LEIN_DEV, the :dev-dependencies are downloaded, but the app times out
while booting[2].  If I try moving lein-cljsbuild from :dev-depencies
to :plugins in my project.clj, heroku rejects my git push[3].

Anyone faring any better?

Thanks,
Tim


[1]   app[web.1]: Warning: problem requiring leiningen.cljsbuild hook:
Could not locate leiningen/cljsbuild__init.class or
leiningen/cljsbuild.clj on classpath


[2]   heroku config:add LEIN_DEV=y
   ...
   heroku[web.1]: Starting process with command `lein run -m tl.core`
   app[web.1]: Compiling ClojureScript.
   ... (downloads lots of dependencies. can't finish before timing out?) ...
   heroku[web.1]: Error R10 (Boot timeout) - Web process failed
to bind to $PORT within 60 seconds of launch


[3]   heroku config:remove LEIN_DEV
   ...
   Copying 4 files to /tmp/build_c47l93hhsxf4/.lein-plugins
   exec: 1: -client: not found
 ! Failed to install dependencies with Leiningen
 ! Heroku push rejected, failed to compile Clojure app
 ! [remote rejected] sessions - master (pre-receive hook declined)

-- 
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


ClojureScript: browser REPL omitting namespace in generated JS

2012-03-02 Thread Stuart Campbell
Hello,

I'm encountering a problem where the browser REPL sometimes omits the
ClojureScript namespace in its generated JavaScript, e.g. (def x 42)
compiles to .x = 42 instead of foo.x = 42.

I've put together a minimal project, with steps to reproduce, on GitHub:
https://github.com/harto/cljs-eval-test

It looks to me like compiling a set of ClojureScript files (using
cljs.closure/build) causes some side-effect that prevents the problem. See
the GitHub README for details.

I'm on Mac OS X 10.5 with Java 1.6.0_26.

Regards,
Stuart

-- 
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: Clojurescript One: (def fiv 5) compiles to .fiv = 5;\n ?

2012-03-02 Thread Stuart Campbell
Hi,

I've come across this too. Please see my message ClojureScript: browser
REPL omitting namespace in generated JS.

Regards,
Stuart

On 16 January 2012 08:14, Indy inder...@indy.io wrote:

 Having the same issue and the only way I've resolved it is by having both
 the server and the cljs-repl running in the same repl.

- run script/repl from the *shell* or launch it as an inferior-lisp
- (use '[one.sample.dev-server :only (run-server cljs-repl)])
- (run-server)
- (cljs-repl)



 --
 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

Re: Clojurescript One and Websockets

2012-03-02 Thread Jay Fields
clojure + web sockets, not using aleph: 
http://blog.jayfields.com/2011/02/clojure-web-socket-introduction.html

On Mar 1, 2012, at 10:51 PM, Brian Rowe wrote:

 Hi,
 
 I'm thinking about using clojurescript one a starting point for a web game.  
 I would like to use websockets as the primary communication mechanism between 
 the browser and the server.  As far as I know Zack Tellman's Aleph is the 
 only clojure web server that supports websockets.  Is this true?  If so, are 
 there any guides showing how to modify clojurescript one to use Aleph?  If 
 there are no guides, how much work would it take to modify cljs one to use 
 aleph?
 
 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

-- 
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: defmulti and defmethods in separate namespaces without circular references?

2012-03-02 Thread Tim Visher
On Thu, Mar 1, 2012 at 8:33 PM, Cymen Vig cymen...@gmail.com wrote:
 I attempted to do something like this:

 (ns parent)
 (defmulti my-method (fn [x] (:method x))

 (ns child1)
 (defmethod my-method :zzz
   ...)

 (ns child2)
 (defmethod my-method :aaa
   ...)

 However the problem is the children need to use the parent namespace in
 order to have the method definition and the code that uses all of this needs
 to use all the namespaces too. This creates a circular reference and
 compilation fails.

I will not in any way claim to know how or why this works. I'm just
starting to use multimethods myself, but I'll give you my set up that
appears to be working at the moment.

I have a namespace:

(ns store.store)

(defmulti serialize method)

(defmulti slurp method)

in store.clj

I have 1 implementation:

(ns store.file-system
  [:use [store.store]]
  …)

(def base )

(defmethod serialize :file-system [_ file-name contents]
  (fs-utils/write-to contents (str base / file-name)))

(defmethod slurp :file-system [_ file-name]
  (clojure.core/slurp (str base / file-name)))

I then use this from another namespace, requiring store.store and
store.store.file-system:

(ns library
  [:require [wallpaper-manager-core.store.file-system :as
store-file-system]]
  [:require [wallpaper-manager-core.store.store :as store]])

(binding [store-file-system/base (fs/home)]
  (def library (ref (read-library) :validator library-validator)))

(defn serialize-library [library]
  (store/serialize :file-system library.clj library))

And this all seems to work fine for me. Maybe someone else can explain
why it does for me and doesn't for you. Maybe it has something to do
with `use` vs. `require`?

 1) Is it a bad idea to try to put the defmulti and defmethods into separate
 namespaces?

I don't personally see it as a bad idea, simply because I see defmulti
as a nice, clean way of defining an Interface with multiple
implementations to choose from. One of the ways that I'm using it it
to implement my html vs. json routes. I'm hoping that I can have a
route1.json namespace for all of the json requests and route1.html for
all the html requests. Based on my success with the store namespace I
don't foresee this being a problem, but maybe it will.

I heavily edited the code to remove uninteresting bits and I didn't
test it so be aware of that. :)

Hope that helps!

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
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: Is it possible to extend a parameterized type using gen-class?

2012-03-02 Thread Daniel Solano Gomez
On Thu Mar  1 21:53 2012, sim wrote:
 Hi all,
 
 This has me stumped and I found another message: 
 https://groups.google.com/forum/?fromgroups#!searchin/clojure/parameterised$20type/clojure/8YxzIYXH49c/xCxkMaGXBzUJ
  
 
 that says it isn't possible, but that was back in 2009, is it still not 
 possible?  Any work arounds apart from doing some of it in Java?
 
 I would like to be able to write some xWiki Macros in clojure, I have some 
 in java already but moving it all to clojure would be better.
 
 The java example is as follows:
 
 public class ExampleMacro extends AbstractMacroExampleMacroParameters 
 
 Which is from here: 
 http://rendering.xwiki.org/xwiki/bin/view/Main/ExtendingMacro 
 
 Any help/pointers would be greatly appreciated.
 
 -- sim

Yes, it is possible.  At the byte-code level there is (at least at
run-time) no difference between a generic and a non-generic class.  All
methods take/return the generic type just use Object.

For example, take the following implementation of AbstractCollectionE:

--- begin  ExampleCollection.clj ---

(ns ExampleCollection
  (:gen-class :extends java.util.AbstractCollection))

(def some-numbers [2 3 5 7 11 13]) 
  
(defn -size [_] (count some-numbers))

(defn -iterator [_] (.iterator some-numbers))


--- end  ExampleCollection.clj ---

You can use it as in the following:

--- begin Example.java ---
import java.util.Collection;
  
public class Example {
  public static void main(String[] args) {
CollectionLong foo = new ExampleCollection();
for (Long bar : foo) {
  System.out.println(bar);
}
  }
}
--- end Example.java ---

The Java file will compile and run, though it will complain about doing
an unsafe conversion.  This means that if the type that occurs at
runtime is wrong, you'll get a ClassCastException.

In any case, you can also use proxies to accomplish the same task if you
don't want to gen-class.

I hope this helps.

Sincerely,

Daniel


signature.asc
Description: Digital signature


Clojurescript wiki needs updating

2012-03-02 Thread László Török
Hi,

I noticed that [1] in the Runtime Polymorphism section says that
multimethods are not currently implemented in cljs.

I don't think that is correct.

[1] https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure
-- 
László Török

-- 
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: for behavior difference between clojure and clojurescript?

2012-03-02 Thread Benjamin Peter
Hi all,

thanks for responding.

On Mar 1, 1:21 am, David Nolen dnolen.li...@gmail.com wrote:
 Yes it's a known issue. Right now, = only works for two args. For the time
 being this is for performance reasons, a decent = is critical.

I see. Is there a know issues list or is the problem something that
should be noted on the differences to clojure page?

Or would you say clojurescript is in an early stage where you should
expect those issues and such a list would be high maintenance.

I just found the cljs jira instance. Another thing that comes to mind
would be to create an open and confirmed issues filter that could be
linked in the wiki.


Regards,

Ben.

-- 
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: need hint for A nil key on 4clojure

2012-03-02 Thread weiyongq
thanks

On 2月29日, 下午10时00分, Roman Perepelitsa roman.perepeli...@gmail.com
wrote:
 Most 4clojure exercises are meant for you to familiarize yourself with the
 clojure standard library. Usually you'll spend more time looking for the
 appropriate function on clojuredocs than actually coding the solution.

 Here's the section on 
 collections:http://clojuredocs.org/quickref/Clojure%20Core#Collections+-+Sequences

 Roman.

 2012/2/29 Kevin Ilchmann Jørgensen kijm...@gmail.com







  So, you need to give it a function which takes an key and a collection.

  (fn [k coll] ...)

  It should return true if two things are true.  That the collection
  _contains_ the key, and the key is _nil_

  Enjoy!

  /Kevin

  On Wed, Feb 29, 2012 at 7:15 AM, weiyongq weiyo...@gmail.com wrote:
   A nil key 
  http://www.4clojure.com/problem/134
   l look it no Elementary.please give me some help.

   --
   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

-- 
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


Looking to help out with an open source project...

2012-03-02 Thread Sam Garrett
Hello google Clojure group.

I'm fairly new to clojure but what I've used and implemented so far has 
been quite interesting. So I was wondering if anyone knew of/or has some 
open source projects written in Clojure that I could get involved in and 
help out, preferably something small as this will be my first involvement 
in open source. My day job is mostly using jquery and javascript for UI 
work so that's where my expertise lies but anyway I'm looking to improve 
and help out.

Thanks for reading and I look forward to helping out!

-- 
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: Bret Victor's live editable game in ClojureScript

2012-03-02 Thread Rostislav Svoboda
Hi Chris

 I think you may have actually missed the point in the video :) There's
 no pausing necessary - if I made the guy move on his own and changed
 his speed, you'd see it happen immediately.

The thing is, in order to change the speed of the guy you need to
refocus your eyes from the guy and start to scroll up and down in the
code panel on the left. And then, 30 sec later(!) when you find the
place where the speed is defined then you need to take a look at the
keyboard to see where your fingers are and... grrr :(

And then when you want to change the color you need to do the same
again... grrr :(

And if you use different keyboard layouts and start to type 'magenta'
or '#XYZ' then you realise 'Oh merde. Where are the '#' and 'm' keys?
Which keyboard layout am I using right now?' On french, german and
english keyboards the characters like '()#$[] are mapped somewhere
else. On the french keyboard even the 'm' is not there where you would
look for it... grrr :(

And then when you finally found the right place in the code and the
right keyboard layout you come to the point where you want to select
'exactly this(!) shade of azure blue' and you start to wonder what the
hell is color code for it... grrr :(

So no a slider for speed and color change makes a *huge* difference

 Based on what I've heard so far, my implementation is actually more
 real than what Victor himself created and does everything except for
 the slider/color-picker in his demo.

Well, yes that's true. I find your work really great!

cheers

Bost

-- 
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: for behavior difference between clojure and clojurescript?

2012-03-02 Thread David Nolen
On Thu, Mar 1, 2012 at 3:21 AM, Benjamin Peter benjaminpe...@arcor.dewrote:

 Hi all,

 thanks for responding.

 On Mar 1, 1:21 am, David Nolen dnolen.li...@gmail.com wrote:
  Yes it's a known issue. Right now, = only works for two args. For the
 time
  being this is for performance reasons, a decent = is critical.

 I see. Is there a know issues list or is the problem something that
 should be noted on the differences to clojure page?


JIRA is the issues list.


 Or would you say clojurescript is in an early stage where you should
 expect those issues and such a list would be high maintenance.


ClojureScript is still in an early stage. But ... many things are now
implemented and performance enhancements are becoming a higher priority.


 I just found the cljs jira instance. Another thing that comes to mind
 would be to create an open and confirmed issues filter that could be
 linked in the wiki.


Linking to a CLJS issues filter is a good idea.


 Regards,

 Ben.

-- 
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: ClojureScript: browser REPL omitting namespace in generated JS

2012-03-02 Thread David Nolen
Please open a ticket in JIRA. Thanks!

On Fri, Mar 2, 2012 at 4:50 AM, Stuart Campbell stu...@harto.org wrote:

 Hello,

 I'm encountering a problem where the browser REPL sometimes omits the
 ClojureScript namespace in its generated JavaScript, e.g. (def x 42)
 compiles to .x = 42 instead of foo.x = 42.

 I've put together a minimal project, with steps to reproduce, on GitHub:
 https://github.com/harto/cljs-eval-test

 It looks to me like compiling a set of ClojureScript files (using
 cljs.closure/build) causes some side-effect that prevents the problem. See
 the GitHub README for details.

 I'm on Mac OS X 10.5 with Java 1.6.0_26.

 Regards,
 Stuart

 --
 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

[ANN] Leiningen HTML5 Docs Plugin (first release)

2012-03-02 Thread Tassilo Horn
Hi all,

since I've never managed to get autodoc or marginalia running, I've
written my own API docs generator.  It lived happily as a leiningen task
in some project of mine with anything needed for generating docs for
this project shamelessly hard-coded, but today I found some spare time
to rip it out and make a stand-alone leiningen plugin out of it.

The homepage is

  https://github.com/tsdh/lein-html5-docs

and there you'll find how to install and configure it for your project's
needs.

To get an impression on how the generated docs look like, I've run it on
the current git master of clojure itself.  Here's the result:

  http://userpages.uni-koblenz.de/~horn/clojure-docs/

This first release already has version number 1.0.2, because I found
lots of bugs and unexpected things when running it on clojure itself.
1.0.0 did the job for my projects... ;-)

Bye,
Tassilo

-- 
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: Clojure in Python

2012-03-02 Thread Daniel Gagnon

 Well first of all, the real main drive, is that I don't know Java libs
 nearly as well as Python libs. Secondly, there's a lot of cruft (imo)
 in Clojure that doesn't need to exist in a dynamic VM. For instance,
 there's no reason to new up something with (Foo. 1 2). In python
 objects are functions, so (Foo 1 2) works just fine.


On a similar note, are you using Python's approach to characters (they are
simply a string of length 1)?

-- 
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: Clojure in Python

2012-03-02 Thread Timothy Baldridge
 On a similar note, are you using Python's approach to characters (they are
 simply a string of length 1)?

Yes, that's exactly what we're doing. As an aside note, the fact that
Python is so dynamic allows us to do some really interesting things
with sequences:

https://github.com/halgari/clojure-py/blob/master/clojure/lang/indexableseq.py

These 24 lines of python code allow us to create a seq out of any
object in Python that supports .__getitem__ So out-of-the box, you can
do treat python strings as sequences:

user= (first foo)
f

That IndexableSeq works with python lists, tuples, unicode, strings, etc.

Timothy

-- 
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


Serializing ClojureScript data structures

2012-03-02 Thread Chris McBride
In Clojure (str {:a 1}) returns {:a 1}.
In ClojureScript (str {:a 1}) returns [Object object].

As a result, in order to send data to and from the server I've been
doing this: (goog.json/serialize (cljs-js x)). This seems like
unnecessary overhead to convert everything a JS object first, is there
a technical reason why ClojureScript behaves differently here? Or has
this just not been implemented yet?

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: Serializing ClojureScript data structures

2012-03-02 Thread David Nolen
pr-str will do what you want. That said we should probably add toString
methods to the core datatypes to prevent this surprise.

David

On Fri, Mar 2, 2012 at 11:14 AM, Chris McBride cmm7...@gmail.com wrote:

 In Clojure (str {:a 1}) returns {:a 1}.
 In ClojureScript (str {:a 1}) returns [Object object].

 As a result, in order to send data to and from the server I've been
 doing this: (goog.json/serialize (cljs-js x)). This seems like
 unnecessary overhead to convert everything a JS object first, is there
 a technical reason why ClojureScript behaves differently here? Or has
 this just not been implemented yet?

 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

-- 
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: inconsistency in (keyword…) constructor

2012-03-02 Thread joegallo


 PS. same issue with (symbol name) and (symbol ns name)…


Huh, somehow I noticed this issue with symbol, but didn't see it with 
keyword.  I guess I've need the two arg version of symbol, but never needed 
the two arg version of keyword.

See some related discussion here: 
https://groups.google.com/d/topic/clojure/n25aZ5HA7hc/discussion

-- 
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: Serializing ClojureScript data structures

2012-03-02 Thread Chris McBride
Ok Thanks

On Mar 2, 11:19 am, David Nolen dnolen.li...@gmail.com wrote:
 pr-str will do what you want. That said we should probably add toString
 methods to the core datatypes to prevent this surprise.

 David







 On Fri, Mar 2, 2012 at 11:14 AM, Chris McBride cmm7...@gmail.com wrote:
  In Clojure (str {:a 1}) returns {:a 1}.
  In ClojureScript (str {:a 1}) returns [Object object].

  As a result, in order to send data to and from the server I've been
  doing this: (goog.json/serialize (cljs-js x)). This seems like
  unnecessary overhead to convert everything a JS object first, is there
  a technical reason why ClojureScript behaves differently here? Or has
  this just not been implemented yet?

  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

-- 
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: Serializing ClojureScript data structures

2012-03-02 Thread Alan Malloy
Related: str is a terrible way to serialize things in JVM-clojure as
well - pr-str is what you want. For example, {:x a} and {:x 'a} both
print the same with str. pr-str also handles lazy sequences, which str
doesn't.

On Mar 2, 8:19 am, David Nolen dnolen.li...@gmail.com wrote:
 pr-str will do what you want. That said we should probably add toString
 methods to the core datatypes to prevent this surprise.

 David







 On Fri, Mar 2, 2012 at 11:14 AM, Chris McBride cmm7...@gmail.com wrote:
  In Clojure (str {:a 1}) returns {:a 1}.
  In ClojureScript (str {:a 1}) returns [Object object].

  As a result, in order to send data to and from the server I've been
  doing this: (goog.json/serialize (cljs-js x)). This seems like
  unnecessary overhead to convert everything a JS object first, is there
  a technical reason why ClojureScript behaves differently here? Or has
  this just not been implemented yet?

  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

-- 
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: defmulti and defmethods in separate namespaces without circular references?

2012-03-02 Thread lambdatronic
I built a modeling system that uses the multi-method namespace separation 
you are talking about. The solution that I use simply leverages the 
difference between require, use, and refer. In each namespace that 
implements the multi-method, put (refer 'parent) after the ns form. In the 
parent namespace wait until the end of the file and place (require 'child1 
'child2 ...).

  Good luck,
~Gary

-- 
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: Looking to help out with an open source project...

2012-03-02 Thread Moritz Ulrich
I might have something for you. It's a small personal (and currently
unpublished) project involving Emacs, Clojure and ClojureScript. It
isn't very useful if you don't use Emacs :-)

Drop me an Email if you're interested.

On Thu, Mar 1, 2012 at 04:46, Sam Garrett samdgarr...@gmail.com wrote:
 Hello google Clojure group.

 I'm fairly new to clojure but what I've used and implemented so far has been
 quite interesting. So I was wondering if anyone knew of/or has some open
 source projects written in Clojure that I could get involved in and help
 out, preferably something small as this will be my first involvement in open
 source. My day job is mostly using jquery and javascript for UI work so
 that's where my expertise lies but anyway I'm looking to improve and help
 out.

 Thanks for reading and I look forward to helping out!

 --
 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



-- 
Moritz Ulrich

-- 
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: inconsistency in (keyword…) constructor

2012-03-02 Thread Frank Siebenlist
Just found your CLJ-891 and added a comment there that keyword has similar 
issues with a link to this thread.

See that you tried to solve it in java… while I tried to stay up in clj … but 
any protocol-based solution seems to be up in the air still (?).

Hopefully both interfaces can be enhanced in silmilar ways.

-FrankS.


On Mar 2, 2012, at 9:32 AM, joegallo wrote:

 
 PS. same issue with (symbol name) and (symbol ns name)…
 
 
 Huh, somehow I noticed this issue with symbol, but didn't see it with 
 keyword.  I guess I've need the two arg version of symbol, but never needed 
 the two arg version of keyword.
 
 See some related discussion here: 
 https://groups.google.com/d/topic/clojure/n25aZ5HA7hc/discussion

-- 
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: ClojureScript: browser REPL omitting namespace in generated JS

2012-03-02 Thread Stuart Campbell
Done! http://dev.clojure.org/jira/browse/CLJS-157

On 3 March 2012 01:15, David Nolen dnolen.li...@gmail.com wrote:

 Please open a ticket in JIRA. Thanks!

 On Fri, Mar 2, 2012 at 4:50 AM, Stuart Campbell stu...@harto.org wrote:

 Hello,

 I'm encountering a problem where the browser REPL sometimes omits the
 ClojureScript namespace in its generated JavaScript, e.g. (def x 42)
 compiles to .x = 42 instead of foo.x = 42.

 I've put together a minimal project, with steps to reproduce, on GitHub:
 https://github.com/harto/cljs-eval-test

 It looks to me like compiling a set of ClojureScript files (using
 cljs.closure/build) causes some side-effect that prevents the problem. See
 the GitHub README for details.

 I'm on Mac OS X 10.5 with Java 1.6.0_26.

 Regards,
 Stuart

  --
 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

-- 
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 STM vs Java Locks dissertation help data structure database connection

2012-03-02 Thread Riccardo
Hi! I am a student at Swansea University (UK), trying to present a
Project about Clojure STM performance and Java Locks performance
during the simulation of concurrent Banking transactions:

I intend to execute a concurrent transfer of (fixed amount of) money
from an account A to an account B in a dosync with a concurrent
transfer from account B to account A and repeat this conflict a N-
input number times. Like this:

(transfer account-a account-b 100)
(transfer account-b account-a 100)

Now, I don't think I am doing it right because i am not taking full
advantage of the STM, while I should perform on large sets of shared
objects to make the difference between STM and Locks.

FINALLY:
What I would like to do is:
1) connect to a database with the Accounts, and create an associated
data that works with STM.
2) Create N-random operations Like (account id-source, account-id-
destination, money)
3) Start counting time - perform the operations under STM - stop
counting time.
4) update the database and show statistics.

QUESTION: which kind of clojure data should I use in the point 1) to
make advantage of STM transactions? which database best suit the fact
that I will use the same data to perform operations in Clojure and in
Java (one at a time) ? I know mySQL at least :P

I really need some advice, I also would like to ear your opinion on
the other points (2,3,4).
Many thanks in advance!!

Riccardo

-- 
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


How I can use InteractionEvent in clojure?

2012-03-02 Thread Antonio Recio
How I can translate this InteractionEvent written for a java example to 
clojure?

void myCallback() {
vtkTransform t = new vtkTransform();
boxWidget.GetTransform(t);
boxWidget.GetProp3D().SetUserTransform(t);}


boxWidget.AddObserver(InteractionEvent, this, myCallback);


http://www.cmake.org/Wiki/VTK/Examples/Java/Miscellaneous/Cone6

http://www.vtk.org/doc/nightly/html/classvtkBoxWidget.html

-- 
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: Bret Victor - Inventing on Principle

2012-03-02 Thread Nicolas
The talk was really enligthing... but I would say it is still
research.

While I can trust you can make, say an intuitive and reactive UI for
flash like animations, I think there are still problems to take care
of for the program example.

Here this is just a simple algorithm without long calls inside,
without access to external systems or mutable state. All kind of
things that would simply fail to work properly in pratice.

I can see this as an evolution of unit testing and debugging. You
still need to mock dependancies and take care to build input data to
test your program. But in exchange you can check interractively
execution outcome and intermediate steps and tweak it until it provide
the required result.

You could then ask to generate the proper unit test because well all
information is already available.

But making this kind of UI fluid and easy including a way to properly
specify your mocks (and what is not mocked) is going to be complex...
But I agree, functional languages that tend to favor pure functions
really help there.



On 27 fév, 19:44, Colin Yates colin.ya...@gmail.com wrote:
 Amazing.

 The lesson for me (which has echoes of the 'hammock driven design' message)
 is that sometimes the best ideas come not from evolutions of existing
 answers but starting completely from scratch.  As techies, we sometimes (I
 think) restrict ourselves to improving our existing solutions which in
 effect restrict our solution space to our own (sometimes inferior)
 answers.  For example, I doubt any of his answers came as an improvement to
 existing IDEs - they are new creations.

 Hmm - not sure I made that clear - I learnt a lesson anyway.  Excellent
 points and I certainly found the video inspiring.

 Good link!

 Col







 On Friday, 24 February 2012 18:29:06 UTC, Damien wrote:

  Hi Everyone,

  You may have seen this already, if not I believe it's worth investing 1h
  of your life:
 http://vimeo.com/36579366

  That's already a good candidate for the technical talk of the year, if not
  the decade IMO.
  Ok, I'm getting a bit too enthusiastic here but this is so inspiring.

  After watching it, you can't help thinking that we have a whole new world
  to invent.
  As a side note, you may start thinking that a REPL is not good enough.
  - Personal message to Laurent Petit: please watch and start thinking about
  CCW 1.0 ;o) -
  It also feels like ClojureScript is on the right path.

  But, most importantly, beyond any technical consideration, the last part
  is a great life lesson.

  --
  Damien Lepage
 http://damienlepage.com
  @damienlepage https://twitter.com/#%21/damienlepage
  linkedin.com/in/damienlepage http://www.linkedin.com/in/damienlepage

-- 
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: ClojureScript: browser REPL omitting namespace in generated JS

2012-03-02 Thread Brenton
Thanks Stuart,

Looks like the problem might be here:

https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/repl.clj#L117

I'll dig into this this weekend.

On Mar 2, 6:30 pm, Stuart Campbell stu...@harto.org wrote:
 Done!http://dev.clojure.org/jira/browse/CLJS-157

 On 3 March 2012 01:15, David Nolen dnolen.li...@gmail.com wrote:







  Please open a ticket in JIRA. Thanks!

  On Fri, Mar 2, 2012 at 4:50 AM, Stuart Campbell stu...@harto.org wrote:

  Hello,

  I'm encountering a problem where the browser REPL sometimes omits the
  ClojureScript namespace in its generated JavaScript, e.g. (def x 42)
  compiles to .x = 42 instead of foo.x = 42.

  I've put together a minimal project, with steps to reproduce, on GitHub:
 https://github.com/harto/cljs-eval-test

  It looks to me like compiling a set of ClojureScript files (using
  cljs.closure/build) causes some side-effect that prevents the problem. See
  the GitHub README for details.

  I'm on Mac OS X 10.5 with Java 1.6.0_26.

  Regards,
  Stuart

   --
  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

-- 
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


Pretty print defn

2012-03-02 Thread Nikem
Hi.

Is it possible to pretty print a source code of the function defined
with defn? I have tried the following:

(defn qw []
  (inc 2))

(with-pprint-dispatch code-dispatch (pprint qw))

And got #user$qw user$qw@4743bf3d. But I would like to get at least
(inc 2). Is it possible at all?

Nikem

-- 
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: defmulti and defmethods in separate namespaces without circular references?

2012-03-02 Thread Cymen Vig
On Friday, March 2, 2012 7:03:10 AM UTC-6, tim.visher wrote:

 I will not in any way claim to know how or why this works. I'm just
 starting to use multimethods myself, but I'll give you my set up that
 appears to be working at the moment.

 I have a namespace:

 (ns store.store)

 (defmulti serialize method)

 (defmulti slurp method)

 in store.clj

 I have 1 implementation:

 (ns store.file-system
   [:use [store.store]]
   …)

 (def base )

 (defmethod serialize :file-system [_ file-name contents]
   (fs-utils/write-to contents (str base / file-name)))

 (defmethod slurp :file-system [_ file-name]
   (clojure.core/slurp (str base / file-name)))

 I then use this from another namespace, requiring store.store and
 store.store.file-system:

 (ns library
   [:require [wallpaper-manager-core.store.file-system :as
 store-file-system]]
   [:require [wallpaper-manager-core.store.store :as store]])

 (binding [store-file-system/base (fs/home)]
   (def library (ref (read-library) :validator library-validator)))

 (defn serialize-library [library]
   (store/serialize :file-system library.clj library))

 And this all seems to work fine for me. Maybe someone else can explain
 why it does for me and doesn't for you. Maybe it has something to do
 with `use` vs. `require`?

This does indeed work for me. What I was trying to do was avoid was having 
to do this part:

   ...
  [:require [wallpaper-manager-core.store.store :as store]])

As each time I add a defmethod implementation of my defmulti I'd have to 
add another require. But maybe that isn't such a bad thing so I'll go with 
this approach. I prefer it over having a super parent (*) namespace 
unless i needed that super parent in multiple places.

* by super parent I mean a namespace that is only used to include the 
namespaces that contain the defmulti and defmethods

Thanks,
Cymen

-- 
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: Pretty print defn

2012-03-02 Thread Mark Rathwell
(clojure.repl/source-fn 'qw) will give you the source.

On Fri, Mar 2, 2012 at 10:32 AM, Nikem gni...@gmail.com wrote:
 Hi.

 Is it possible to pretty print a source code of the function defined
 with defn? I have tried the following:

 (defn qw []
  (inc 2))

 (with-pprint-dispatch code-dispatch (pprint qw))

 And got #user$qw user$qw@4743bf3d. But I would like to get at least
 (inc 2). Is it possible at all?

 Nikem

 --
 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


Re: defmulti and defmethods in separate namespaces without circular references?

2012-03-02 Thread Daniel E. Renfer
I use a lot of multimethods with my framework, Ciste[0] and it can work,
the only thing is you have to be very careful about what you put where,
and it helps to have a lot of namespaces.

What I do is try to keep all of my defmulti's in one namespace and have
only defmethod's in another namespace. Originally, I had one master
namespace that required all of the defmethod namespaces (my routes
namespace) and then all my action namespaces only require the defmulti
namespaces.

I've since then moved on to use the 'definitializer' functionality of
Ciste to require those defmethod namespaces after all of the other
namespaces have been required.

I'm not saying it's the best coding style, but it works for me and my
applications. Be prepared to move functions around a lot to always stay
one step ahead of the dreaded cyclic dependency horror.

0: https://github.com/duck1123/ciste

On 03/02/2012 10:55 AM, Cymen Vig wrote:
 On Friday, March 2, 2012 7:03:10 AM UTC-6, tim.visher wrote:

 I will not in any way claim to know how or why this works. I'm just
 starting to use multimethods myself, but I'll give you my set up that
 appears to be working at the moment.

 I have a namespace:

 (ns store.store)

 (defmulti serialize method)

 (defmulti slurp method)

 in store.clj

 I have 1 implementation:

 (ns store.file-system
   [:use [store.store]]
   …)

 (def base )

 (defmethod serialize :file-system [_ file-name contents]
   (fs-utils/write-to contents (str base / file-name)))

 (defmethod slurp :file-system [_ file-name]
   (clojure.core/slurp (str base / file-name)))

 I then use this from another namespace, requiring store.store and
 store.store.file-system:

 (ns library
   [:require [wallpaper-manager-core.store.file-system :as
 store-file-system]]
   [:require [wallpaper-manager-core.store.store :as store]])

 (binding [store-file-system/base (fs/home)]
   (def library (ref (read-library) :validator library-validator)))

 (defn serialize-library [library]
   (store/serialize :file-system library.clj library))

 And this all seems to work fine for me. Maybe someone else can explain
 why it does for me and doesn't for you. Maybe it has something to do
 with `use` vs. `require`?

 This does indeed work for me. What I was trying to do was avoid was
 having to do this part:

...
   [:require [wallpaper-manager-core.store.store :as store]])

 As each time I add a defmethod implementation of my defmulti I'd have
 to add another require. But maybe that isn't such a bad thing so I'll
 go with this approach. I prefer it over having a super parent (*)
 namespace unless i needed that super parent in multiple places.

 * by super parent I mean a namespace that is only used to include
 the namespaces that contain the defmulti and defmethods

 Thanks,
 Cymen
 -- 
 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

Re: Pretty print defn

2012-03-02 Thread Phil Hagelberg
Mark Rathwell mark.rathw...@gmail.com writes:

 (clojure.repl/source-fn 'qw) will give you the source.

You can also use serializable-fn to create a function that will carry
its source around with it in metadata:

https://github.com/technomancy/serializable-fn

But it's not very well tested.

-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


lein run and standard input (*in*) with read-line

2012-03-02 Thread Tim Cross
Hi All,

I've been working on my first little clojure project for the past couple of 
days, but have now run into a problem with leiningen and was hoping someone 
could point me in the right direction to find a solution. 

I'm using lein 1.7.0, clojure 1.3.0 and openJDK 6 on a ubuntu based system. 

My code has a simple loop iin the -main funciton which calls read-line to 
get the input. 

If I run lein repl, execute (-main), I can enter data 
If I create an uberjar, and run it, I can enter data

However, if I use lein run, I cannot eneter any data. It appears the 
program enters the while loop, but when I try to enter data, nothing 
happens - no characters are echoed to the screen (as is the case in the 
other two invokations) and it appears that the program is waiting for input 
from some other input source. 

My guess is that lein run does something different wrt *in*, but I've no 
idea what and cannot find anything obvious in the docs. 

My project file is very simple -

(defproject clj-espeak 1.0.0-SNAPSHOT
  :description FIXME: write description
  :dependencies [[org.clojure/clojure 1.3.0]]
  :java-source-path java
  :ant [clj-espeak.core]
  :main clj-espeak.core)

The java-source-path is necessary for some java interface classes for a JNI 
based interface to a C based text to speech library. This seems to be 
working fine. 

My -main funciton is very simple

(defn -main [ args]
  (println Starting interpreter)
  (tts-initialize)
  (println Starting command loop.)
  (flush)
  (while true
(dispatch (parse-input (read-line)

As mentioned, this is my first clojure program. I'm also not a java 
programmer (though I did do some java back in the late 90's using java 
1.0). I'm hoping it is just something obvious I've missed and would 
appreciate any suggestions. 

Background

The reason I want to use lein run is that I want to execute the program via 
a shell script which is called by emacs. Emacs then communicates with this 
sub-process via standard input. The data it sends are commands to generate 
various bits of speech from text. Eventually, the aim is to have emacs 
start the clojure applicaiton, which will setup swank and also listen for 
input from emacs. I will then use slime to connect to the running process 
so that I can futher develop/refine the clojure code based on the input 
recieved from emacs. This is all part of developing a clojure based speech 
server for the emacspeak program. 

TIA

Tim

-- 
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

clj-time mailing list!

2012-03-02 Thread Sean Corfield
By popular request:

http://groups.google.com/group/clj-time

-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.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