How can i typecast a JavaObject?

2014-01-20 Thread Fabian Page
Hi 

I want to output some sound with javax.sound.sampled. 

But from AudioSystem.getSourceDataLine i get a AbstractDataLine which i 
need to typecast to a SourceDataLine. How can i make this typecast in 
clojure? 

Thanks
Fabian

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How can i typecast a JavaObject?

2014-01-20 Thread Gaofeng Zeng
(cast SourceDataLine a-instance)

On Monday, January 20, 2014 4:46:23 PM UTC+8, Fabian Page wrote:

 Hi 

 I want to output some sound with javax.sound.sampled. 

 But from AudioSystem.getSourceDataLine i get a AbstractDataLine which i 
 need to typecast to a SourceDataLine. How can i make this typecast in 
 clojure? 

 Thanks
 Fabian


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How can i typecast a JavaObject?

2014-01-20 Thread Meikel Brandmeyer (kotarak)
Hi,

Am Montag, 20. Januar 2014 09:46:23 UTC+1 schrieb Fabian Page:


 I want to output some sound with javax.sound.sampled. 

 But from AudioSystem.getSourceDataLine i get a AbstractDataLine which i 
 need to typecast to a SourceDataLine. How can i make this typecast in 
 clojure? 


Why do you need a typecast?

Kind regards
Meikel
 

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


slingshot.slingshot, clj + cljs

2014-01-20 Thread t x
Hi,

## Basic Question

  Is there a library that:
  (1) is like slingshot.slingshot and
  (2) has the same syntax + semantics in both clj and cljs ?

## Situation I'm stuck in:

  * I'm writing code in cljx. Thus, as much as possible, I'd prefer code
that simultaneously work with both clj and cljs

  * I want to throw arbitrary data. Thus, I'm using slingshot.

  * I don't know how to get slingshot to have same semantics in cljs land.

Thanks in advance for any pointers.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How can i typecast a JavaObject?

2014-01-20 Thread Fabian Page

I get a:
java.lang.IllegalArgumentException: Can't call public method of non-public 
class: public final void 
com.sun.media.sound.AbstractDataLine.open(javax.sound.sampled.AudioFormat,int) 
throws javax.sound.sampled.LineUnavailableException 

From a tutorial i saw that they first typecast the AbstractDataLine to a 
SouceDataLine. I wanted to make this typecast.

Kind regards
Fabian

Am Montag, 20. Januar 2014 10:15:04 UTC+1 schrieb Meikel Brandmeyer 
(kotarak):

 Hi,

 Am Montag, 20. Januar 2014 09:46:23 UTC+1 schrieb Fabian Page:


 I want to output some sound with javax.sound.sampled. 

 But from AudioSystem.getSourceDataLine i get a AbstractDataLine which i 
 need to typecast to a SourceDataLine. How can i make this typecast in 
 clojure? 


 Why do you need a typecast?

 Kind regards
 Meikel
  


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How can i typecast a JavaObject?

2014-01-20 Thread Fabian Page
From what i understood cast only checks if a-instance can be a 
SourceDataLine. But it doesn't cast the AbstractDataLine to a 
SourceDataLine?

Thanks Fabian

Am Montag, 20. Januar 2014 09:58:51 UTC+1 schrieb Gaofeng Zeng:

 (cast SourceDataLine a-instance)

 On Monday, January 20, 2014 4:46:23 PM UTC+8, Fabian Page wrote:

 Hi 

 I want to output some sound with javax.sound.sampled. 

 But from AudioSystem.getSourceDataLine i get a AbstractDataLine which i 
 need to typecast to a SourceDataLine. How can i make this typecast in 
 clojure? 

 Thanks
 Fabian



-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: slingshot.slingshot, clj + cljs

2014-01-20 Thread Herwig Hochleitner
Maybe your needs are met by the now builtin ex-info and ex-data. They work
the same in clj and cljs:

(try (throw (ex-info msg {:data map}))
  (catch :default e
(ex-data e)))

kind regards


2014/1/20 t x txrev...@gmail.com

 Hi,

 ## Basic Question

   Is there a library that:
   (1) is like slingshot.slingshot and
   (2) has the same syntax + semantics in both clj and cljs ?

 ## Situation I'm stuck in:

   * I'm writing code in cljx. Thus, as much as possible, I'd prefer code
 that simultaneously work with both clj and cljs

   * I want to throw arbitrary data. Thus, I'm using slingshot.

   * I don't know how to get slingshot to have same semantics in cljs land.

 Thanks in advance for any pointers.

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How can i typecast a JavaObject?

2014-01-20 Thread Meikel Brandmeyer (kotarak)
Hi,

Am Montag, 20. Januar 2014 11:34:29 UTC+1 schrieb Fabian Page:


 I get a:
 java.lang.IllegalArgumentException: Can't call public method of non-public 
 class: public final void 
 com.sun.media.sound.AbstractDataLine.open(javax.sound.sampled.AudioFormat,int)
  
 throws javax.sound.sampled.LineUnavailableException 

 From a tutorial i saw that they first typecast the AbstractDataLine to a 
 SouceDataLine. I wanted to make this typecast.


Ok. What you need is a type hint in the interop call, so that the compiler 
can emit a call to the right interface.

(.open #^SourceDataLine abstract-data-line-thingy 1)

If you had to do the several calls with that interface, you could the type 
hint at a more central spot.

(let [abstract-data-line-thingy #^SourceDataLine (obtain-thingy)]
  (doto abstract-data-line-thingy
(.open 1)
(.otherMethod 2)))

Hope that helps.

Meikel

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: slingshot.slingshot, clj + cljs

2014-01-20 Thread t x
Very nice.

Much better than the past 2 hours I spent writing a simpler version of
Throwable w/ data, i.e.:

(ns MyError
 (:gen-class
  :extends java.lang.Throwable
  :state state
  :init init
  :constructors {[Object] []}))


(defn -init
  [obj]
  [[] obj])


Thanks!


On Mon, Jan 20, 2014 at 3:41 AM, Herwig Hochleitner
hhochleit...@gmail.comwrote:

 Maybe your needs are met by the now builtin ex-info and ex-data. They work
 the same in clj and cljs:

 (try (throw (ex-info msg {:data map}))
   (catch :default e
 (ex-data e)))

 kind regards


 2014/1/20 t x txrev...@gmail.com

 Hi,

 ## Basic Question

   Is there a library that:
   (1) is like slingshot.slingshot and
   (2) has the same syntax + semantics in both clj and cljs ?

 ## Situation I'm stuck in:

   * I'm writing code in cljx. Thus, as much as possible, I'd prefer code
 that simultaneously work with both clj and cljs

   * I want to throw arbitrary data. Thus, I'm using slingshot.

   * I don't know how to get slingshot to have same semantics in cljs land.

 Thanks in advance for any pointers.

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_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
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How can i typecast a JavaObject?

2014-01-20 Thread Fabian Page
Thanks a lot! That problem is solved now :)

Fabian

Am Montag, 20. Januar 2014 12:51:43 UTC+1 schrieb Meikel Brandmeyer 
(kotarak):

 Hi,

 Am Montag, 20. Januar 2014 11:34:29 UTC+1 schrieb Fabian Page:


 I get a:
 java.lang.IllegalArgumentException: Can't call public method of 
 non-public class: public final void 
 com.sun.media.sound.AbstractDataLine.open(javax.sound.sampled.AudioFormat,int)
  
 throws javax.sound.sampled.LineUnavailableException 

 From a tutorial i saw that they first typecast the AbstractDataLine to a 
 SouceDataLine. I wanted to make this typecast.


 Ok. What you need is a type hint in the interop call, so that the compiler 
 can emit a call to the right interface.

 (.open #^SourceDataLine abstract-data-line-thingy 1)

 If you had to do the several calls with that interface, you could the type 
 hint at a more central spot.

 (let [abstract-data-line-thingy #^SourceDataLine (obtain-thingy)]
   (doto abstract-data-line-thingy
 (.open 1)
 (.otherMethod 2)))

 Hope that helps.

 Meikel



-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Looking to migrate thousands of Clojure applications from 1.2 to 1.5.

2014-01-20 Thread solo . levy
Thank you, Toby. I've shared this with my colleagues involved in this 
project and we're taking a look at it now.

On Thursday, January 16, 2014 12:59:47 PM UTC-5, Toby Crawley wrote:

 The isolation in Immutant is achieved (in part) by ShimDandy[1], which 
 can be used outside of Immutant with a bit of work. It's been on my list 
 for a while now to provide a sample application demonstrating usage - 
 there is a minimal example in the README. 

 Let me know if you are interested in the ShimDandy approach (or Immutant 
 for that matter), and I'll be happy to help however I can. 

 - Toby 

 [1]: https://github.com/projectodd/shimdandy 

 petr...@gmail.com javascript: writes: 

  Yes, but this requires custom class loaders. AFAIK this is already 
  implemented in Immutant project (http://immutant.org/) 
  
  On Thursday, January 16, 2014 11:13:11 PM UTC+7, solo...@gmail.comwrote: 
  
  Quick update and question: We've put together a preliminary migration 
 plan 
  and are considering options. 

  Can someone share information or point me to where I can learn whether 
 two 
  different versions of Clojure (1.2 and 1.5) can run in the same JVM? 
  
  
  -- 



-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Looking to migrate thousands of Clojure applications from 1.2 to 1.5.

2014-01-20 Thread solo . levy
An update, Toby--my colleague wrote a simple app with ShimDandy and it's 
working. So far so good. We're going to present it as a possible solution 
to our users on Wednesday and see what happens.


On Thursday, January 16, 2014 12:59:47 PM UTC-5, Toby Crawley wrote:

 The isolation in Immutant is achieved (in part) by ShimDandy[1], which 
 can be used outside of Immutant with a bit of work. It's been on my list 
 for a while now to provide a sample application demonstrating usage - 
 there is a minimal example in the README. 

 Let me know if you are interested in the ShimDandy approach (or Immutant 
 for that matter), and I'll be happy to help however I can. 

 - Toby 

 [1]: https://github.com/projectodd/shimdandy 

 petr...@gmail.com javascript: writes: 

  Yes, but this requires custom class loaders. AFAIK this is already 
  implemented in Immutant project (http://immutant.org/) 
  
  On Thursday, January 16, 2014 11:13:11 PM UTC+7, solo...@gmail.comwrote: 
  
  Quick update and question: We've put together a preliminary migration 
 plan 
  and are considering options. 

  Can someone share information or point me to where I can learn whether 
 two 
  different versions of Clojure (1.2 and 1.5) can run in the same JVM? 
  
  
  -- 



-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Looking to migrate thousands of Clojure applications from 1.2 to 1.5.

2014-01-20 Thread Toby Crawley
Good deal, thanks for keeping me posted. Let me know if you run in to
any issues.

- Toby

solo.l...@gmail.com writes:

 An update, Toby--my colleague wrote a simple app with ShimDandy and it's 
 working. So far so good. We're going to present it as a possible solution 
 to our users on Wednesday and see what happens.


 On Thursday, January 16, 2014 12:59:47 PM UTC-5, Toby Crawley wrote:

 The isolation in Immutant is achieved (in part) by ShimDandy[1], which 
 can be used outside of Immutant with a bit of work. It's been on my list 
 for a while now to provide a sample application demonstrating usage - 
 there is a minimal example in the README. 

 Let me know if you are interested in the ShimDandy approach (or Immutant 
 for that matter), and I'll be happy to help however I can. 

 - Toby 

 [1]: https://github.com/projectodd/shimdandy 

 petr...@gmail.com javascript: writes: 

  Yes, but this requires custom class loaders. AFAIK this is already 
  implemented in Immutant project (http://immutant.org/) 
  
  On Thursday, January 16, 2014 11:13:11 PM UTC+7, solo...@gmail.comwrote: 
  
  Quick update and question: We've put together a preliminary migration 
 plan 
  and are considering options. 

  Can someone share information or point me to where I can learn whether 
 two 
  different versions of Clojure (1.2 and 1.5) can run in the same JVM? 
  
  
  -- 



 -- 

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Looking to migrate thousands of Clojure applications from 1.2 to 1.5.

2014-01-20 Thread solo . levy
Thanks, Vijay. We'll evaluate this, too.

On Friday, January 17, 2014 5:20:12 PM UTC-5, Vijay Kiran wrote:


 May be this would help? https://github.com/flatland/classlojure

 On Thursday, January 16, 2014 5:13:11 PM UTC+1, solo...@gmail.com wrote:

 Quick update and question: We've put together a preliminary migration 
 plan and are considering options.
  
 Can someone share information or point me to where I can learn whether 
 two different versions of Clojure (1.2 and 1.5) can run in the same JVM?



-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: oob schemas, re: The Language of the System

2014-01-20 Thread James Gatannah


On Sunday, January 19, 2014 12:48:36 PM UTC-6, Brian Craft wrote:

 That helps, thanks. It's still unclear to me that this is important enough 
 to worry about. What application or service is hindered by string encoding 
 a date in JSON? An example would really help. It's not compelling to assert 
 or imagine some hypothetical application that benefits from knowing a field 
 is a date without having any other knowledge of it. I would guess that 
 cases where this matters are vanishingly few.


This isn't dates, but it's along the same lines:

I'm working on the central hub of a communications distributor/router/thing 
which has to deal with a wide range of diverse clients that each speak 
whatever format was the most expedient for whoever wrote that piece. The 
closest thing that we have to a standard is we mostly want to use JSON.

A huge chunk of our messages include UUIDs. This left me with two real 
options:
1. Special case every incoming message, based on what I know about the 
sender, and convert the fields that I know are supposed to represent a UUID 
(based on extremely informal verbal specs) as a message is read
2. Take the generic, weakly coupled approach: pass every incoming message 
through a parser that converts every value string into a UUID (if that 
conversion is possible).

The pain here could be alleviated with a formalized schema, but we're 
working too fast and furious for that. We tossed out the last one of those 
we had almost 2 months ago.

Dates really present the same challenge, but everything that's using those 
is tied to a relational database. So there, at least, we're forced to stick 
to something fairly standardized. (Though I *do* have another conversion 
function for converting those messages, which tends to change about once a 
week when some other developer decides to change column names...but that's 
a different story).

FWIW,
James




 On Sunday, January 19, 2014 9:03:53 AM UTC-8, jonah wrote:

 I read these self-describing, extensible points in the context of EDN, 
 which has a syntax/wire format for some types- maps, strings, etc- and also 
 has an extensibility syntax:

 #myapp/Person {:first Fred :last Mertz}

 These tagged elements are extensions because they allow values of types 
 not known to EDN to be included in the stream, and are self-describing in 
 two senses:

 * if a wire format reader does know how to create a myapp/Person{}, that 
 blob of data contains all the information needed to do so
 * if a wire format reader doesn't known how to create a myapp/Person, it 
 can still read past this particular element in the stream, because tags 
 have a defined envelope, so a reader can figure out where data comprising 
 this element ends

 The JSON example is mostly about the extensibility attribute. JSON's 
 format natively supports some types (like strings) but not others (like 
 dates), and for those others, JSON's format does not include a way to 
 bucket or envelope data comprising those unknown types. So JSON is not 
 extensible. 

 The google example is mostly about the self-describing attribute, and 
 to my mind is more accurately framed as a statement about the Internet as a 
 whole. Hypothetically, if all data exchange occurred using data formats 
 whose details were private arrangements between writers and readers- for 
 instance, all servers only spoke ProtocolBuffers and used a different 
 schema for each client- there would be no Internet at all, much less a 
 google who as a third party is able to broadly read and understand data 
 made available by servers. (Or, to your point, any ability to parse 
 anything useful from a server data stream by clients lacking knowledge of 
 the schema would be at best be inferential and heuristic- possible, but 
 infeasible on a large scale.)

 With all that said- my read is that Rich bundled those two points 
 together in the JSON date example- JSON doesn't have an extensibility 
 syntax to support dates, but people still have to transmit dates over JSON, 
 so how do they do that? One way is by adopting a  convention, which in 
 some ways is better than an out of band schema, because, as you say, a 
 convention gives a reader additional information to heuristically interpret 
 the stream, but in other ways is worse because it isn't consistent- some 
 people will want date fields to look like dateModified, others will want 
 modifiedDate, and others use modificationDatetime.

 So in a broad sense, it is not desirable to use a data format that does 
 not include an extensibility capability which itself is self-describing, 
 because a format that lacks extensibility creates a combinatorial explosion 
 in conventions to convey values not known to the format, and extensions 
 that are not self-describing require out of band agreements between readers 
 and writers that can preclude the scalable third-party interoperability 
 that is so important to the Internet. 

 Hope that helps.


 On Sat, Jan 18, 2014 at 6:08 

[ANN] play-clj, a game library

2014-01-20 Thread Zach Oakes
Today I'm releasing play-clj https://github.com/oakes/play-clj, a Clojure 
wrapper for LibGDX that allows you to write games for desktop OSes, 
Android, and iOS from the same Clojure codebase. The template automatically 
creates Leiningen projects for all three platforms:

lein new play-clj hello-world

I am also releasing Nightcode http://nightcode.info/ 0.2.6, which 
includes the play-clj template built-in. I've fixed a lot of bugs since 
releasing 0.2.0 last month, including finally fixing the REPL input problem.

If you'd like to help me continue working on stuff like play-clj and 
Nightcode, I am on Gittip https://www.gittip.com/oakes/ now.

I would also love help optimizing performance, which is pretty bad on 
mobile OSes at the moment. Try out my example 
gameshttps://github.com/oakes/play-clj-examples, 
including an in-progress clone of Notch's Ludum Dare entry, Minicraft.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] play-clj, a game library

2014-01-20 Thread Laurent PETIT
Congratulations !


2014/1/20 Zach Oakes zsoa...@gmail.com

 Today I'm releasing play-clj https://github.com/oakes/play-clj, a
 Clojure wrapper for LibGDX that allows you to write games for desktop OSes,
 Android, and iOS from the same Clojure codebase. The template automatically
 creates Leiningen projects for all three platforms:

 lein new play-clj hello-world

 I am also releasing Nightcode http://nightcode.info/ 0.2.6, which
 includes the play-clj template built-in. I've fixed a lot of bugs since
 releasing 0.2.0 last month, including finally fixing the REPL input problem.

 If you'd like to help me continue working on stuff like play-clj and
 Nightcode, I am on Gittip https://www.gittip.com/oakes/ now.

 I would also love help optimizing performance, which is pretty bad on
 mobile OSes at the moment. Try out my example 
 gameshttps://github.com/oakes/play-clj-examples,
 including an in-progress clone of Notch's Ludum Dare entry, Minicraft.

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] play-clj, a game library

2014-01-20 Thread Zach Oakes
Thanks! I submitted it to HN naturally:

https://news.ycombinator.com/item?id=7090003

On Monday, January 20, 2014 10:46:06 AM UTC-5, Laurent PETIT wrote:

 Congratulations !


 2014/1/20 Zach Oakes zso...@gmail.com javascript:

 Today I'm releasing play-clj https://github.com/oakes/play-clj, a 
 Clojure wrapper for LibGDX that allows you to write games for desktop OSes, 
 Android, and iOS from the same Clojure codebase. The template automatically 
 creates Leiningen projects for all three platforms:

 lein new play-clj hello-world

 I am also releasing Nightcode http://nightcode.info/ 0.2.6, which 
 includes the play-clj template built-in. I've fixed a lot of bugs since 
 releasing 0.2.0 last month, including finally fixing the REPL input problem.

 If you'd like to help me continue working on stuff like play-clj and 
 Nightcode, I am on Gittip https://www.gittip.com/oakes/ now.

 I would also love help optimizing performance, which is pretty bad on 
 mobile OSes at the moment. Try out my example 
 gameshttps://github.com/oakes/play-clj-examples, 
 including an in-progress clone of Notch's Ludum Dare entry, Minicraft.
  
 -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.comjavascript:
 Note that posts from new members are moderated - please be patient with 
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@googlegroups.com javascript:
 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 unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+u...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/groups/opt_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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] play-clj, a game library

2014-01-20 Thread Alex Miller
Might be a good topic for a Clojure/West submission

https://cognitect.wufoo.com/forms/clojurewest-2014-call-for-presentations/

On Monday, January 20, 2014 9:31:50 AM UTC-6, Zach Oakes wrote:

 Today I'm releasing play-clj https://github.com/oakes/play-clj, a 
 Clojure wrapper for LibGDX that allows you to write games for desktop OSes, 
 Android, and iOS from the same Clojure codebase. The template automatically 
 creates Leiningen projects for all three platforms:

 lein new play-clj hello-world

 I am also releasing Nightcode http://nightcode.info/ 0.2.6, which 
 includes the play-clj template built-in. I've fixed a lot of bugs since 
 releasing 0.2.0 last month, including finally fixing the REPL input problem.

 If you'd like to help me continue working on stuff like play-clj and 
 Nightcode, I am on Gittip https://www.gittip.com/oakes/ now.

 I would also love help optimizing performance, which is pretty bad on 
 mobile OSes at the moment. Try out my example 
 gameshttps://github.com/oakes/play-clj-examples, 
 including an in-progress clone of Notch's Ludum Dare entry, Minicraft.


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Redefining the notion of S-EXP, and pattern matching S-EXPs in clojure

2014-01-20 Thread Alex Miller
core.match can do some of this. https://github.com/clojure/core.match

data.zip has some extensions beyond zip that are useful (although a lot of 
what's there is cast in terms of xml-handling uses): 
https://github.com/clojure/data.zip

I have rolled variants of this a few times, mostly using zippers as the 
primary tool at the bottom. I wrote up some early variants of that work 
at http://www.ibm.com/developerworks/library/j-treevisit/ - the actual 
versions went quite a bit further but are not open source. Where we ended 
up was something that let you describe a pattern (support for basic Clojure 
data structures + records) for matches with bound variables, then invoke 
arbitrary transformation functions at the point of match.

Alex

On Sunday, January 19, 2014 11:40:39 AM UTC-6, Dave Tenny wrote:

 As I try to reconcile my ancient past in writing common lisp code with a 
 clojure learning exercise, 
 I wonder whether clojure philosophy redefines the notion of an s-expression
 or whether it just  adds vectors and maps to s-expressions in without 
 trying to define what an s-expression is.

 The question came up as I was looking for a certain capability in clojure 
 libraries.

 Back in the day when lisps had only parenthesized collection types, there 
 were lisp libraries
 (whose names I've long since forgotten) that would allow pattern matching 
 of s-expressions,
 so that you could describe a pattern, match it to some tree, pick up 
 matches and continue to match some more.

 Sort of like java.util.Matcher.find().

 However with every clojure program (and program output) being a huge set 
 of lists, vectors, and maps
 I was looking for an s-exp matcher that would allow pattern expressions of 
 and matching against paths of combinations of these data structures.

 Sort of like enlive/select can traverse a nasty list/vector/map output of 
 enlive/html-resource with predicates that will match a sequence of nodes in 
 the web page.
 (Only I don't think enlive/select returns matcher state that allows 
 continuation from where you left off, maybe it does, and of course it's 
 html oriented).

 Looking at the clojure.walk and clojure.zip stuff, I don't see anything 
 other than low level tools for certain kinds of traversals.

 What libraries are there for higher level reach in and grab patterns of 
 data abstractions that will work against a tree of lists/vectors/maps (and 
 preferably any other walkable data structure in clojure)?

 Looking for suggestions, and whatever philosophy there is about 
 s-expressions in clojure like reader environments.

 If I wanted lists, vectors, and maps with no zen, I'd be using python ;-)

 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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Clojure development laptop battery usage

2014-01-20 Thread Mars0i
On Sunday, January 19, 2014 11:19:45 PM UTC-6, g vim wrote:

 critical factor. I'm not sure I can work outside Leiningen, though. It 
 seems to be as much a part of the Clojure development process as anything. 


Just to be clear, Leiningen only eats CPU when started in an arbitrary 
directory.  When started from a Leiningen project directory, it doesn't use 
CPU unless I tell it to.  I have not investigated what it is in the project 
directory that Leiningen needs in order to feel at peace. :-) 

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Job Opportunity] Clojure Web Developer Role

2014-01-20 Thread Ray Miller
A UK-based Clojure job for a change... Metail is a start-up with a tech
team based in the centre of Cambride. We are looking to recruit a junior
developer to work on a mix of RESTful API handlers and frontend web
applications, all build using Clojure. This is an ideal job for a recent
graduate or someone relatively new to Clojure and looking to build out
their skillset.

Check out the job listing for more details:

 http://metail.com/job/junior-web-software-engineer-clojure/

Ray.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] play-clj, a game library

2014-01-20 Thread Zach Oakes
Thank you, I'll look into this. Someone mentioned it to me at our 
Pittsburgh Clojure meetup last week. I don't think I've ever been to the 
west coast!

On Monday, January 20, 2014 11:36:16 AM UTC-5, Alex Miller wrote:

 Might be a good topic for a Clojure/West submission

 https://cognitect.wufoo.com/forms/clojurewest-2014-call-for-presentations/

 On Monday, January 20, 2014 9:31:50 AM UTC-6, Zach Oakes wrote:

 Today I'm releasing play-clj https://github.com/oakes/play-clj, a 
 Clojure wrapper for LibGDX that allows you to write games for desktop OSes, 
 Android, and iOS from the same Clojure codebase. The template automatically 
 creates Leiningen projects for all three platforms:

 lein new play-clj hello-world

 I am also releasing Nightcode http://nightcode.info/ 0.2.6, which 
 includes the play-clj template built-in. I've fixed a lot of bugs since 
 releasing 0.2.0 last month, including finally fixing the REPL input problem.

 If you'd like to help me continue working on stuff like play-clj and 
 Nightcode, I am on Gittip https://www.gittip.com/oakes/ now.

 I would also love help optimizing performance, which is pretty bad on 
 mobile OSes at the moment. Try out my example 
 gameshttps://github.com/oakes/play-clj-examples, 
 including an in-progress clone of Notch's Ludum Dare entry, Minicraft.



-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] play-clj, a game library

2014-01-20 Thread john walker
Is there any chance of support for javascript/webgl?

On Monday, January 20, 2014 10:31:50 AM UTC-5, Zach Oakes wrote:

 Today I'm releasing play-clj https://github.com/oakes/play-clj, a 
 Clojure wrapper for LibGDX that allows you to write games for desktop OSes, 
 Android, and iOS from the same Clojure codebase. The template automatically 
 creates Leiningen projects for all three platforms:

 lein new play-clj hello-world

 I am also releasing Nightcode http://nightcode.info/ 0.2.6, which 
 includes the play-clj template built-in. I've fixed a lot of bugs since 
 releasing 0.2.0 last month, including finally fixing the REPL input problem.

 If you'd like to help me continue working on stuff like play-clj and 
 Nightcode, I am on Gittip https://www.gittip.com/oakes/ now.

 I would also love help optimizing performance, which is pretty bad on 
 mobile OSes at the moment. Try out my example 
 gameshttps://github.com/oakes/play-clj-examples, 
 including an in-progress clone of Notch's Ludum Dare entry, Minicraft.


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] play-clj, a game library

2014-01-20 Thread Zach Oakes
I don't have any plans at the moment for that. LibGDX actually does allow 
you to compile your game to HTML/JS, but it uses GWT which is a source code 
translator, so it only works with Java. Also, it doesn't have access to the 
parts of LibGDX that rely on native code, such as the physics engine 
(Box2D), so that limits it a bit.

On Monday, January 20, 2014 12:52:31 PM UTC-5, john walker wrote:

 Is there any chance of support for javascript/webgl?

 On Monday, January 20, 2014 10:31:50 AM UTC-5, Zach Oakes wrote:

 Today I'm releasing play-clj https://github.com/oakes/play-clj, a 
 Clojure wrapper for LibGDX that allows you to write games for desktop OSes, 
 Android, and iOS from the same Clojure codebase. The template automatically 
 creates Leiningen projects for all three platforms:

 lein new play-clj hello-world

 I am also releasing Nightcode http://nightcode.info/ 0.2.6, which 
 includes the play-clj template built-in. I've fixed a lot of bugs since 
 releasing 0.2.0 last month, including finally fixing the REPL input problem.

 If you'd like to help me continue working on stuff like play-clj and 
 Nightcode, I am on Gittip https://www.gittip.com/oakes/ now.

 I would also love help optimizing performance, which is pretty bad on 
 mobile OSes at the moment. Try out my example 
 gameshttps://github.com/oakes/play-clj-examples, 
 including an in-progress clone of Notch's Ludum Dare entry, Minicraft.



-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: cljx repetition

2014-01-20 Thread Stephen Cagle
I am not actually familiar with this form, don't know what [types] actually 
does:
(:require [macros.arrow :refer (=)]
  [types])
 
I don't think you need to be requiring the cljs macros twice as you seem to 
be doing in both forms.

Macros are in general somewhat of a sore spot in clojurescript. They work, 
but only by being sort of inlined into clojurescript from clojure. Giving 
macros parity in clojurescript is an open problem, and seems to be very 
difficult. Smarter minds than mine have looked at it and decided that what 
we have is the most pragmatic solution.

Macros in cljs need :require-macros, not much to be done about that.

Only real advice I can give is that in my opinion, if you are going to use 
cljx with defmacro's (as you appear to have done with 'macros.arrow), then 
you should put them in separate namespaces; something like 'macros.arrow 
and 'macros.cljs.arrow . Unless your macros can be shared across cljs AND 
clj, best to put them in different namespaces. By my (fallible) memory this 
really helped with getting the cljx-plugin working, otherwise I had funny 
errors where it appeared to be loading the clj macro instead of the cljs 
one.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Clojure run time isolation with the ability to share data structures

2014-01-20 Thread Giri Anantharaman
Hello

I am newbie to Clojure. Been using for a couple of months now. With that 
disclaimer out of the way, we have use-cases where we would like multiple 
clojure run times with in the same JVM  and have these run times share 
clojure data structures among themselves. We attempted to solve this 
problem with some help from OSGI (since our use-case was mostly OSGI 
bundles running clojure). This post to share our approach and solicit 
feedback / comments from others.

- OSGI provides individual bundle class loaders for each OSGI bundle. So 
given this running multiple clojure run times inside a single JVM is 
straight forward. However in order to share clojure data structures across 
these run times, several data structure interfaces from clojure.lang (IMap 
etc) must be loaded by a common class loader. However clojure.lang package 
also includes other classes, implementations and not to mention the clojure 
runtime (RT.java) and compiler (Compiler.java)

- Given the fact that clojure uses Thread Context Class Loader (TCCL) to 
load its classes, plus given that OSGI bundles can export packages, we were 
able to create a class loader that loaded all clojure.lang interfaces using 
a common class loader and things like RT / Compiler etc from individual 
bundle class loaders. Thus we have run time isolation with data structure 
sharing.

However we ran into some issues with sharing clojure.lang.IKeywordLookup. 
This interface references clojure.lang.Keyword. If one were to load 
clojure.lang.IKeywordLookup at some point it would also load 
clojure.lang.Keyword using the same class loader. clojure.lang.Keyword 
is also referenced else where in clojure (clojure.core, other 
implementation classes in clojure.lang). Therefore clojure.lang.Keyword 
would be loaded by different class loaders and this causes a java class 
loader linkage error, since while linking say a class A, that uses Keyword 
by itself and IKeywordLookup, JVM does not know which version of Keyword 
class should be used to resolve the class fully.

We worked around it by NOT sharing IKeywordLookup across run times. We can 
still share maps, vectors, lists etc. So this gets us most of what we want. 
However i was wondering if the issue we faced with IKeywordLookup / Keyword 
fixable in some other way. In the absence of a IKeyword interface we could 
not think of any.

Would be happy to hear what others think.
-Giri


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


let bindings

2014-01-20 Thread Andy Smith
Hi,

(let bindings form) is a special form. As I understand it, let can be 
reformulated in terms of functions e.g.

 (let [x 2] (* x 20)) equivalent to ((fn [x] (* x 20)) 2)
(let [x 3 y (* x x)] (- y x)) equivalent to ((fn [x] ((fn [x y] (- y x)) x 
(* x x))) 3)
 
So if we can always reformulate in this was, why cant let be implemented as 
a macro rather than a special form?

Where have I gone wrong in my understanding here?

Andy

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: let bindings

2014-01-20 Thread Andy Smith
typo : was=way

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: let bindings

2014-01-20 Thread Jozef Wagner
Hi,

fn does additional stuff which let doesn't. fn returns an object which you
can store and later call invoke on it. This is more than let promises. From
the implementation point, fn creates java class. This is not needed for let.

JW


On Mon, Jan 20, 2014 at 9:38 PM, Andy Smith the4thamig...@googlemail.comwrote:

 Hi,

 (let bindings form) is a special form. As I understand it, let can be
 reformulated in terms of functions e.g.

  (let [x 2] (* x 20)) equivalent to ((fn [x] (* x 20)) 2)
 (let [x 3 y (* x x)] (- y x)) equivalent to ((fn [x] ((fn [x y] (- y x)) x
 (* x x))) 3)

 So if we can always reformulate in this was, why cant let be implemented
 as a macro rather than a special form?

 Where have I gone wrong in my understanding here?

 Andy

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Clojure web server benchmarks

2014-01-20 Thread Jim Crossley
I just submitted a PR to include Immutant in the benchmarks, per a request 
from Chas on Twitter, and then I noticed Shantanu filed an issue to include 
Undertow, so I created a PR for it, too, since Immutant 2.x will be based 
on it.

The tl;dr is that Immutant performs a little worse than the :gen-class 
servlets included in the benchmarks, and a little better than the Jetty 
Ring Adapter, which is about what I'd expect. Undertow's numbers are just a 
skosh below http-kit, and can probably even be improved since the adapter's 
dep is about 20 betas behind the current release.

Jim

On Tuesday, January 14, 2014 8:39:13 AM UTC-5, Xfeep Zhang wrote:

 You 're right!

 ab has many limitations.

 Maybe httpload , wrk, Weighttp or ABs  ( several instances of AB)  are 
 better when test client and server do not run on the same computer.

 On Tuesday, January 14, 2014 5:52:59 PM UTC+8, Feng Shen wrote:

 Hi,  nginx-clojure looks great!

 A small tip: ab may not be the best tool, since it's single threaded.   A 
 better tool is wrk:  https://github.com/wg/wrk

 You can use wrk to better test nginx-clojure,  It should perform even 
 better than others.




 沈锋
 http://shenfeng.me


 On Tue, Jan 14, 2014 at 5:26 PM, Peter Taoussanis ptaou...@gmail.comwrote:

 Oh wow, that's fantastic!

 For those watching: Xfeep's fixed a number of config issues, updated all 
 the servers, and completely updated the chart.

 Absolutely well worth a look if you're interested in Clojure web server 
 performance.

 * Results are here: 
 https://github.com/ptaoussanis/clojure-web-server-benchmarks
 * His GitHub page: https://github.com/xfeep
 * His nginx/clojure lib: https://github.com/xfeep/nginx-clojure

 Cheers! :-)

 -- 
 *Peter Taoussanis*
  
 -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@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+u...@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 a topic in the 
 Google Groups Clojure group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/clojure/UrRLCdex7d4/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 clojure+u...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Nginx-Clojure Let You Deploy Clojure Web App on Nginx Without Any Java Web Server

2014-01-20 Thread Sergey Didenko
Hi Xfeep,

What are the good ways to handle some heavy Clojure calculations when using
nginx-clojure?

Under nginx model it's bad to block other incoming requests by holding a
working thread for too long, right?

So is it better to route complex job to http-kit? Or to use some kind of
queue? Or may be to use this nginx-clojure JVM pool that is off by default?


On Wed, Jan 15, 2014 at 3:18 PM, Xfeep Zhang easyj...@163.com wrote:



 On Wednesday, January 15, 2014 12:39:57 PM UTC+8, Roberto De Ioris wrote:


 i strongly suggest you to avoid the performance as a selling point,
 your
 project is cool but not for performance (and you are using a pipe to
 transfer requests data from nginx to the jvm so there ipc in place too,
 even if you can improve things using OS-specific syscall like splice).


 Although I have make it clear in the nginx english mail list,  people
 joined clojure group may still misunderstand.

 So please forgive me repeating the message here.

 In the nginx english mail list , I have said :

  With the default setting pipe is not used.

 Pipe is only used for enable jvm thread pool mode only when jvm_workers 
 0 (jvm_workers default = 0).

 Further more pipe is never used to transfer the whole request or response
 message.

 When under jvm thread pool mode, pipe is only used to transfer a event
 flag (only one pointer size)。



 --
 Roberto De Ioris
 http://unbit.it

  --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[ANN] Clidget, a lightweight CLJS state utility that helps you build small, composable UI ‘widgets’.

2014-01-20 Thread James Henderson
Hi all,

I've recently released Clidget v0.1.0, a new lightweight CLJS state utility
that allows you to build UIs through small, composable widgets.

Quick links:

   - GitHub https://github.com/james-henderson/clidget (README, Rationale
   and Getting Started)
   - Sample 'counter'
applicationhttps://github.com/james-henderson/clidget/tree/master/clidget-sample
   - TodoMVC 
implementationhttps://github.com/james-henderson/clidget/tree/master/todomvc

The fundamental idea behind Clidget is to ensure that you can write widgets
declaratively, in traditional Clojure style, as a function that *takes in
immutable values and returns a DOM element*. Then, rather than calling that
function with values, you* call it with atoms*, and Clidget figures out
when each widget needs to be re-rendered.

So, a counter widget would look something like this (using Dommy to create
the DOM element and core.async for event handling - you're free to choose
whatever you like):

(:require [cljs.core.async :as a]
  [dommy.core :as d]
  [clidget.widget :refer [defwidget] :include-macros true])
(:require-macros [dommy.macros :refer [node]]
 [cljs.core.async.macros :refer [go-loop]]))

(defwidget counter-widget [{:keys [counter]} events-ch]
  (node
   [:div
[:h2 counter is now:  counter]
[:p
 (doto (node [:button Increment counter])
   (d/listen! :click #(a/put! events-ch :inc-counter)))]]))



To include a widget in the page, call it (it’s just a function!), but
provide it with the *atoms* that it needs to watch:

(set! (.-onload js/window)
  (fn []
(let [!counter (atom 0)
  events-ch (doto (a/chan)
  ;; 'watch-events!' implemented below
  (watch-events! !counter))]

  (d/replace-contents! (.-body js/document)
   (counter-widget {:!counter !counter}
events-ch)]

(I'm prefixing the atom with '!', to easily differentiate between
atoms and values)



Finally, we implement watch-events! (no Clidget here):


(defn watch-events! [events-ch !counter]
  (go-loop []
(when-let [event (a/! events-ch)]
  (when (= :inc-counter event)
(swap! !counter inc))
  (recur

(We could do this inside the widget, given it's only a counter, but
it's probably better to separate it!)



*Why?!*

The main design decision behind Clidget was to favour simplicity over
performance (obviously within reason). Clidget does one thing (I hope it
does it well!) - figuring out which widgets to re-render and when. How you
update the state, render the widgets, pass the events, handle the events
etc is completely up to you.

There's no 'magic' in Clidget - you pass in atoms, it behaves pretty much
like Clojure's add-watch function. I've found this to be a really useful
quality when reasoning about applications - it makes the debugging headache
a lot more manageable.

Finally, I wanted to preserve Clojure's composability. One of the benefits
I really enjoy about working with Clojure is the ability to use many small
libraries without worrying about how they'll fit together. If you're a
Hiccup person, you can use your favourite Hiccup-like library; if you're an
Enlive/Mustache person, likewise! In Clidget, this also extends to JS
libraries - when you're working with the DOM elements that will end up on
the page, you can pass them to other JS libraries easily.


I've received a number of requests for a comparison with
Om/Cloact/React - it didn't fit into 140 characters, so it's here
https://github.com/james-henderson/clidget/blob/master/comparison.org.



*Feedback*


The idea behind Clidget is still very much experimental - I'd be very
interested to hear thoughts and feedback (good, bad, and 'what on
earth were you thinking?!') on the approach and/or implementation,
please let me know! GitHub, Twitter (@jarohen
https://twitter.com/jarohen) or through here are all good.



If you've got this far, thanks for reading!


James

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[ANN] Clidget, a lightweight CLJS state utility that helps you build small, composable UI ‘widgets’.

2014-01-20 Thread James Henderson
Hi all,

I've recently released *Clidget v0.1.0*, a new lightweight CLJS state
utility that allows you to build UIs through small, composable widgets.

Quick links:

   - GitHub https://github.com/james-henderson/clidget (README, Rationale
   and Getting Started)
   - Sample 'counter'
applicationhttps://github.com/james-henderson/clidget/tree/master/clidget-sample
   - TodoMVC 
implementationhttps://github.com/james-henderson/clidget/tree/master/todomvc

The fundamental idea behind Clidget is to ensure that you can write widgets
declaratively, in traditional Clojure style, as a function that *takes in
immutable values and returns a DOM element*. Then, rather than calling that
function with values, you* call it with atoms*, and Clidget figures out
when each widget needs to be re-rendered.

So, a counter widget would look something like this (using Dommy to create
the DOM element and core.async for event handling - you're free to choose
whatever you like):

(:require [cljs.core.async :as a]
  [dommy.core :as d]
  [clidget.widget :refer [defwidget] :include-macros true])
(:require-macros [dommy.macros :refer [node]]
 [cljs.core.async.macros :refer [go-loop]]))

(defwidget counter-widget [{:keys [counter]} events-ch]
  (node
   [:div
[:h2 counter is now:  counter]

[:p
 (doto (node [:button Increment counter])
   (d/listen! :click #(a/put! events-ch :inc-counter)))]]))



To include a widget in the page, call it (it’s just a function!), but
provide it with the *atoms* that it needs to watch:

(set! (.-onload js/window)
  (fn []
(let [!counter (atom 0)
  events-ch (doto (a/chan)
  ;; 'watch-events!' implemented below
  (watch-events! !counter))]

  (d/replace-contents! (.-body js/document)
   (counter-widget {:!counter !counter}
events-ch)]
(I'm prefixing the atom with '!', to easily differentiate between
atoms and values)



Finally, we implement watch-events! (no Clidget here):


(defn watch-events! [events-ch !counter]
  (go-loop []
(when-let [event (a/! events-ch)]
  (when (= :inc-counter event)
(swap! !counter inc))
  (recur

(We could do this inside the widget, given it's only a counter, but
it's probably better to separate it!)



*Why?!*

The main design decision behind Clidget was to favour simplicity over
performance (obviously within reason). Clidget does one thing (I hope it
does it well!) - figuring out which widgets to re-render and when. How you
update the state, render the widgets, pass the events, handle the events
etc is completely up to you.

There's no 'magic' in Clidget - you pass in atoms, it behaves pretty much
like Clojure's add-watch function. I've found this to be a really useful
quality when reasoning about applications - it makes the debugging headache
a lot more manageable.

Finally, I wanted to preserve Clojure's composability. One of the benefits
I really enjoy about working with Clojure is the ability to use many small
libraries without worrying about how they'll fit together. If you're a
Hiccup person, you can use your favourite Hiccup-like library; if you're an
Enlive/Mustache person, likewise! In Clidget, this also extends to JS
libraries - when you're working with the DOM elements that will end up on
the page, you can pass them to other JS libraries easily.

I've received a number of requests for a comparison with Om/Cloact/React -
it didn't fit into 140 characters, so it's
herehttps://github.com/james-henderson/clidget/blob/master/comparison.org
.


*Feedback*

The idea behind Clidget is still very much experimental - I'd be very
interested to hear thoughts and feedback (good, bad, and 'what on earth
were you thinking?!') on the approach and/or implementation, please let me
know! GitHub, Twitter (@jarohen https://twitter.com/jarohen) or through
here are all good.


If you've got this far, thanks for reading!

James

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Yesql 0.3.0 - Clojure SQL queries rethought.

2014-01-20 Thread Alexandr Kurilin
I might have missed this in the docs, but is there support for c.j.j's
optional keyword arguments such as :row-fn and :identifiers? I couldn't
quite figure out how to get that to work with yesql, as far as I can tell
you can only pass query parameters at this point.


On Thu, Jan 9, 2014 at 3:00 PM, Kris Jenkins krisajenk...@gmail.com wrote:

 Hmm...I'll have to mull that one. I have been thinking that I'm going to
 leave the whole issue of namespaces to Clojure, and let the call-site of
 (defqueries) decide. But I'll have to think it through some more. :-)

 Kris

 On Wednesday, 8 January 2014 00:26:58 UTC, Marco Shimomoto wrote:

 It looks great and I will try it.
 Have you thought about namespaces and different database implementations?
 Something like a general repository for SQL files and some vendor
 specific override repositories.

  --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
Alexandr Kurilin
206.687.8740 | @alex_kurilin https://twitter.com/alex_kurilin |
bloghttp://www.kurilin.net

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Does Pedestal have a future in the long run

2014-01-20 Thread Tom Faulhaber


On Monday, November 11, 2013 6:38:23 AM UTC-8, Brenton wrote:

 If you are looking for something that is finished and stable then do not 
 look at Pedestal. We will indicate stability with version numbers. When you 
 see a release of version 1.0 then you may want to have another look. A 1.0 
 release will not happen until we have thorough reference documentation.


If I waited for Clojure libraries to go to 1.0, I still be in Python or 
Java! (Not quite true, but within epsilon.)

Just scroll through the topics of this list for confirmation. Even within 
the Clojure organization, the only project that's made it to 1.0 is Clojure 
core on the JVM.
 

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: let bindings

2014-01-20 Thread Carlo Zancanaro
Hey Andy!

On Mon, Jan 20, 2014 at 12:38:23PM -0800, Andy Smith wrote:
 So if we can always reformulate in this was, why cant let be implemented as 
 a macro rather than a special form?

It can. Quite easily, in fact:

(defmacro my-let [bindings  body]
  (if (empty? bindings)
`(do ~@body)
(let [var (first bindings)
  val (second bindings)
  others (nnext bindings)]
  `((fn [~var]
  (my-let ~others ~@body))
~val

This is going to be a fair bit less efficient than the existing 'let'
implementation, though. The special form is, as far as I understand it,
an optimisation so that we're not constantly creating and destroying
function objects for the sake of local bindings (which are much simpler
than closures, which is what functions require here).

If there's another reason then I'm hoping someone will correct me, but I
can't think of any other reasons at the moment.

Carlo


signature.asc
Description: Digital signature


Re: let bindings

2014-01-20 Thread Kevin Downey
On 1/20/14, 12:38 PM, Andy Smith wrote:
 Hi,
 
 (let bindings form) is a special form. As I understand it, let can be 
 reformulated in terms of functions e.g.
 
  (let [x 2] (* x 20)) equivalent to ((fn [x] (* x 20)) 2)
 (let [x 3 y (* x x)] (- y x)) equivalent to ((fn [x] ((fn [x y] (- y x)) x 
 (* x x))) 3)
  
 So if we can always reformulate in this was, why cant let be implemented as 
 a macro rather than a special form?
 
 Where have I gone wrong in my understanding here?
 
 Andy
 

Clojure has made several choices which make implementing let via macro
expanding to function application a nonstarter:

1. Clojure is compiled.
  There is no interpreter for clojure, all clojure code is compiled to
bytecode before executing, even at the repl. So the compiler needs to be
fast for interactive work and cannot spend a lot of time in optimizing
passes typically used to avoid function call overhead for every local
name binding.

2. Debuggers
  There are a number of nice debugging tool kits for Java/the JVM. They
operating by reading metadata (like local names) from class files.
Because clojure maps let bound locals to the same JVM construct as Java,
you can re-use Java debuggers for Clojure.

3. JVM interop
  The JVM does not have TCO built in, so in order to provide general
constant space tail calls you must do extensive code transforms(breaks 1
and 2) or use your own calling convention(method call and trampoline,
instead of just a method call) which would complicate interop. Clojure
instead provides less general construct loop/recur for constant space
iteration. loop/recur is local to a function body, so if let macro
expanded to a fn call, you would not be able to recur from inside a let.

So while technically possible (there are scheme impls on the jvm that
may) Clojure does not expand let in to a fn call

-- 
And what is good, Phaedrus,
And what is not good—
Need we ask anyone to tell us these things?

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: let bindings

2014-01-20 Thread John Mastro
 If there's another reason then I'm hoping someone will correct me, but I
 can't think of any other reasons at the moment.

Since Clojure doesn't do tail call elimination implementing let atop fn would 
also use up stack. 

I believe many or all Schemes (which are required by the spec to eliminate all 
tail calls) do implement let in that way, but Common Lisps (where it's not 
promised by the spec, though some implementations with some settings will) does 
not, likely at least in part for the same reason. 

- John

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


The :type key is not printed in metadata.

2014-01-20 Thread eduardoejp
(set! *print-meta* true)
(pr-str (with-meta {} {:type :foo}))
 {}
(pr-str (with-meta {} {:class :foo}))
 ^{:class :foo} {}

Is that how it's supposed to be?

I find that behavior weird and troublesome for those wanting to use the 
:type key when serializing data (like me).

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Clojure development laptop battery usage

2014-01-20 Thread Michael Gardner
On Jan 20, 2014, at 11:14 , Mars0i marsh...@logical.net wrote:

 Just to be clear, Leiningen only eats CPU when started in an arbitrary 
 directory.  When started from a Leiningen project directory, it doesn't use 
 CPU unless I tell it to.  I have not investigated what it is in the project 
 directory that Leiningen needs in order to feel at peace. :-) 

I don’t see this behavior on my MBP with latest Leiningen. Have you reported it 
to the lein devs?

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] play-clj, a game library

2014-01-20 Thread Michael Gardner
On Jan 20, 2014, at 09:31 , Zach Oakes zsoa...@gmail.com wrote:

 Today I'm releasing play-clj, a Clojure wrapper for LibGDX that allows you to 
 write games for desktop OSes, Android, and iOS from the same Clojure codebase.

Neat!

How is Clojure’s performance on the latest Android devices? Good enough for 
simple real-time games while still remaining more-or-less idiomatic?

Also, does running Java on iOS still require jailbreaking?

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Clojure development laptop battery usage

2014-01-20 Thread Mars0i
No, didn't see it as a real problem.  

Odd.  Just checked my MBP, and the CPU-eating behavior doesn't occur on 
mine either.  Only on the MBA.  Both with Leiningen 2.3.4 and Java 
1.6.0_65, and same OS (10.6.8--I don't upgrade OSes often).  I'll have to 
check whether there's something different I did with the Leiningen 
configuration on the two machines.

On Monday, January 20, 2014 9:50:08 PM UTC-6, Michael Gardner wrote:

 On Jan 20, 2014, at 11:14 , Mars0i mars...@logical.net javascript: 
 wrote: 

  Just to be clear, Leiningen only eats CPU when started in an arbitrary 
 directory.  When started from a Leiningen project directory, it doesn't use 
 CPU unless I tell it to.  I have not investigated what it is in the project 
 directory that Leiningen needs in order to feel at peace. :-) 

 I don’t see this behavior on my MBP with latest Leiningen. Have you 
 reported it to the lein devs?

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] play-clj, a game library

2014-01-20 Thread Zach Oakes
You do not need to jailbreak your iOS device, because it isn't actually 
running Java. Instead, it uses RoboVM http://www.robovm.org/ to translate 
the bytecode into ARM machine code. There are already several LibGDX games 
written in Java on the App store.

Regarding performance, play-clj is very slow on Android for games with more 
than a handful of entities, so I could really use some help there. I assume 
it's similar on iOS. Right now, I bet there is a lot of low-hanging fruit 
in my code that could be improved to make it faster.

On Monday, January 20, 2014 10:57:22 PM UTC-5, Michael Gardner wrote:

 On Jan 20, 2014, at 09:31 , Zach Oakes zso...@gmail.com javascript: 
 wrote: 

  Today I'm releasing play-clj, a Clojure wrapper for LibGDX that allows 
 you to write games for desktop OSes, Android, and iOS from the same Clojure 
 codebase. 

 Neat! 

 How is Clojure’s performance on the latest Android devices? Good enough 
 for simple real-time games while still remaining more-or-less idiomatic? 

 Also, does running Java on iOS still require jailbreaking?

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Large File Processing] What am I doing wrong?

2014-01-20 Thread Jarrod Swart
I'm processing a large csv with Clojure, honestly not even that big (~18k 
rows, 11mb).  I have a list of exported data from a client and I am 
de-duplicating URLs within the list.  My final output is a series of 
vectors: [url url-hash].

The odd thing is how slow it seems to be going.  I have tried implementing 
this as a reduce, and finally I thought to speed things up I might try a 
with-open and a loop-recur.  It doesn't seem to have done much in my 
case.  I know I am doing something wrong I'm just not sure what yet.  The 
best I can do is about 4 seconds, which may only seem slow because I 
implemented it in python first and it takes a half second to finish.  Still 
this is one of the smaller files I will likely deal with so I'm worried 
that as the files grow it may get too slow.

The code is here on ref-heap for easy viewing: https://www.refheap.com/26098

Any advice is appreciated.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Clojure web server benchmarks

2014-01-20 Thread Peter Taoussanis
Thanks Jim, that's terrific!

For those following, updated results now 
available: https://github.com/ptaoussanis/clojure-web-server-benchmarks

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Redefining the notion of S-EXP, and pattern matching S-EXPs in clojure

2014-01-20 Thread Alan Moore
Take a look at clara-rules by Ryan Brush:

https://github.com/rbrush/clara-rules

Clara pattern matches in the RETE tradition but works very well with 
Clojure records and maps (and Java objects.) Depending on how you 
expose/insert your data into the working memory will make it easier or 
harder to do what you are looking for. If done right you can query your 
data using a very powerful DSL built into Clara. The query feature is very 
much along the lines of what Datalog is for databases, only Clara works 
with in-memory data and/or across Storm clusters.

I am working on a Light Table plugin for Clara that will be released 
sometime in the next few weeks. This should help make it easier to 
visualize Clara rule bases and inspect RETE graph state, agenda, partial 
matches, etc.

Good luck!

Alan


On Sunday, January 19, 2014 11:26:59 AM UTC-8, Jozef Wagner wrote:

 s-expression is a notation, with which nested lists can be represented in 
 a textual form. In any lisp language, your code is not working with 
 s-expressions, but with a data structure, which is most likely a cons. 

 s-expressions provide a convenient textual representation from which you 
 can *read* or into which you can *print*. As Clojure offers more than one 
 basic data structure for collections, it needs multiple notations in order 
 to textually represent a collection type alongside its contents. While 
 there is a cons type in Clojure, the clj syntax does not support 
 traditional s-expression syntax for cons, e.g.  (a . (b . NIL)). Closest 
 you can get is with (a b), which creates a list.

 If your matcher does not need to differentiate between collection types, 
 you can treat all collections as sequences and that way you can uniformly 
 walk/transform any nested sequence.

 JW


 On Sun, Jan 19, 2014 at 6:40 PM, Dave Tenny dave@gmail.comjavascript:
  wrote:

 As I try to reconcile my ancient past in writing common lisp code with a 
 clojure learning exercise, 
 I wonder whether clojure philosophy redefines the notion of an 
 s-expression
 or whether it just  adds vectors and maps to s-expressions in without 
 trying to define what an s-expression is.

 The question came up as I was looking for a certain capability in clojure 
 libraries.

 Back in the day when lisps had only parenthesized collection types, there 
 were lisp libraries
 (whose names I've long since forgotten) that would allow pattern matching 
 of s-expressions,
 so that you could describe a pattern, match it to some tree, pick up 
 matches and continue to match some more.

 Sort of like java.util.Matcher.find().

 However with every clojure program (and program output) being a huge set 
 of lists, vectors, and maps
 I was looking for an s-exp matcher that would allow pattern expressions 
 of and matching against paths of combinations of these data structures.

 Sort of like enlive/select can traverse a nasty list/vector/map output of 
 enlive/html-resource with predicates that will match a sequence of nodes in 
 the web page.
 (Only I don't think enlive/select returns matcher state that allows 
 continuation from where you left off, maybe it does, and of course it's 
 html oriented).

 Looking at the clojure.walk and clojure.zip stuff, I don't see anything 
 other than low level tools for certain kinds of traversals.

 What libraries are there for higher level reach in and grab patterns of 
 data abstractions that will work against a tree of lists/vectors/maps (and 
 preferably any other walkable data structure in clojure)?

 Looking for suggestions, and whatever philosophy there is about 
 s-expressions in clojure like reader environments.

 If I wanted lists, vectors, and maps with no zen, I'd be using python ;-)

 Thanks!

 -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.comjavascript:
 Note that posts from new members are moderated - please be patient with 
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@googlegroups.com javascript:
 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 unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+u...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/groups/opt_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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To 

[Job spam] Clojure data science in Singapore

2014-01-20 Thread Lim Yu-Xi
A Southeast Asian eCommerce startup is looking for Clojurians to help build 
a data science team.

http://functionaljobs.com/jobs/8671-clojure-data-scientist-at-lazada

Details in link, but if you like to code in Clojure (and other languages) 
and are interested in any of the following, please apply!
- Hacking together information from multiple disparate systems
- Open-ended problem solving
- Presenting large data sets succinctly to non-technical users
- Machine learning, recommender systems, data mining and other math stuff
- Keeping things DRY https://en.wikipedia.org/wiki/Don't_repeat_yourselfand 
automating 
*everything*

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: The :type key is not printed in metadata.

2014-01-20 Thread Jozef Wagner
The relevant piece of code is at
https://github.com/clojure/clojure/commit/6ab23a6e3c4c65868dcf042bd851933202b80f65

:type metadata has a special semantics, see
https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L3338and
https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L3133.
I wonder if we can replace it with ::type, which would cause less
problems.

JW


On Tue, Jan 21, 2014 at 2:54 AM, eduardoejp eduardo...@gmail.com wrote:

 (set! *print-meta* true)
 (pr-str (with-meta {} {:type :foo}))
  {}
 (pr-str (with-meta {} {:class :foo}))
  ^{:class :foo} {}

 Is that how it's supposed to be?

 I find that behavior weird and troublesome for those wanting to use the
 :type key when serializing data (like me).

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.