Re: how to packge lein project in a maven-style?

2014-01-05 Thread Shantanu Kumar
There's Clojure Maven plugin if that can help:

https://github.com/talios/clojure-maven-plugin

Shantanu

On Monday, 6 January 2014 11:03:45 UTC+5:30, Qiu Xiafei wrote:
>
>
>
> Using maven, we usually package the project in a directory with sub dirs 
> like: 
> bin/ # bash/python scripts
> lib/  # all jars
> conf/   # resources/configuration files
>
> And, we often use the *maven-dependency-plugin* to copy dependency jars 
> and use the *maven-resources-plugin* to copy scripts and other resource 
> files. But I find no alernertives in lein.
>
> Is there any lein plugin can help me about this?
>
> 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: Advice for dealing with CSV data set

2014-01-05 Thread Shantanu Kumar
If you are only going to read the CSV files, you can put the CSV file in 
`resources` directory (so that it is part of the jar/uberjar), and use 
https://github.com/clojure/data.csv with 
http://clojuredocs.org/clojure_core/clojure.java.io/resource to read the 
data. If you need to make some change to the CSV file then it must lie 
outside of the JAR.

Shantanu

On Monday, 6 January 2014 10:09:55 UTC+5:30, Kyle Sexton wrote:
>
> I am new to clojure and working on a small jabber bot as a starter 
> project.  One of the things I am adding is a simple weather lookup, but 
> in doing so I need to convert zip code to lat/long.  I've found a 
> suitable CSV from http://www.boutell.com/zipcodes/ and am wondering the 
> best way to deal with the data.  I'd like to keep it "contained" in an 
> uberjar and not have to add a database as a requirement.  I've 
> considered sqlite, but again not sure if it can be inside the uberjar. 
>
> The data set is rather small: 
>
> , 
> | bash-3.2$ ls -larh zipcode.csv 
> | -rw-r--r--@ 1 kes  staff   2.4M Aug  6  2004 zipcode.csv 
> | bash-3.2$ wc -l zipcode.csv 
> |43205 zipcode.csv 
> | bash-3.2$ 
> ` 
>
> What would be the recommended way for dealing with this data? 
>
> -- 
> Kyle Sexton 
>

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


Advice for dealing with CSV data set

2014-01-05 Thread Kyle Sexton
I am new to clojure and working on a small jabber bot as a starter
project.  One of the things I am adding is a simple weather lookup, but
in doing so I need to convert zip code to lat/long.  I've found a
suitable CSV from http://www.boutell.com/zipcodes/ and am wondering the
best way to deal with the data.  I'd like to keep it "contained" in an
uberjar and not have to add a database as a requirement.  I've
considered sqlite, but again not sure if it can be inside the uberjar.

The data set is rather small:

,
| bash-3.2$ ls -larh zipcode.csv 
| -rw-r--r--@ 1 kes  staff   2.4M Aug  6  2004 zipcode.csv
| bash-3.2$ wc -l zipcode.csv 
|43205 zipcode.csv
| bash-3.2$ 
`

What would be the recommended way for dealing with this data?

-- 
Kyle Sexton

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


how to packge lein project in a maven-style?

2014-01-05 Thread Qiu Xiafei
Using maven, we usually package the project in a directory with sub dirs
like:
bin/ # bash/python scripts
lib/  # all jars
conf/   # resources/configuration files

And, we often use the *maven-dependency-plugin* to copy dependency jars and
use the *maven-resources-plugin* to copy scripts and other resource files.
But I find no alernertives in lein.

Is there any lein plugin can help me about this?

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: ANN: Om, a ClojureScript binding to Facebook's React

2014-01-05 Thread David Pidcock
Ha! Just saw your Sortable example popup in Git! 

Very cool. 



On Thursday, January 2, 2014 4:00:45 PM UTC-8, David Pidcock wrote:
> Very nice. Relatively easy to follow.  Basically it's re-implementing the 
> drag-list behaviour  in React.  I had thought to re-use some existing code, 
> provided I could inform React that the DOM was changing. (This is the 
> approach used by the example in the fiddler, albeit with jquery instead of 
> goog.closure as the UI manipulation library)
> 
> 
> I'm very interested to see what you do with this, in Om.
> This example is complex enough that following along would most likely fill in 
> the conceptual gaps for me, that the TODO example lacks.
> 
> 
> Again - inspiring work.. 
> 
> 
> -- David
> 
> 
> On Monday, December 30, 2013 10:02:37 PM UTC-8, David Nolen wrote:
> 
> From a React dev:
> 
> https://www.khanacademy.org/preview/content/items/xfa03b103
> 
> https://github.com/Khan/perseus/blob/master/src/widgets/orderer.jsx#L6-L439
> 
> 
> 
> 
> I'm sure this can be adapted for Om. I may write up a simpler Om example in 
> the future.
> 
> 
> David
> 
> 
> 
> On Tue, Dec 31, 2013 at 12:43 AM, David Pidcock  wrote:
> 
> 
> On Thursday, December 19, 2013 11:12:12 AM UTC-8, David Nolen wrote:
> 
> > Enjoy, 
> > http://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/
> 
> >
> 
> >
> 
> >
> 
> > David
> 
> 
> 
> I've been playing around with some basics. I'm still a relative n00b when it 
> comes to functional programming, and I've never looked at React before.
> 
> 
> 
> Very cool stuff.
> 
> 
> 
> I managed to get Om+React to display a list of items that are sorted by a 
> given key, and I have a content-editable span which updates the state of the 
> owner with new value of that key for a given item, and voila! the list item 
> moves to the correct position. (as expected)
> 
> 
> 
> 
> Now here's the tricky part...
> 
> I want to implement a drag-list, where I can drag-drop items into a new 
> position, and update the key based on the new position. I have that algorithm 
> working in a different project (using goog.DragListGroup) , but React does 
> not like you to manipulate the DOM outside it's knowledge.
> 
> 
> 
> 
> I found this :
> 
> https://groups.google.com/forum/#!searchin/reactjs/sortable/reactjs/mHfBGI3Qwz4/rXSr-1QUcKwJ
> 
> 
> 
> which lead to
> 
> http://jsfiddle.net/LQxy7/
> 
> 
> 
> Unfortunately,  I can't get this to work with Om. I am having trouble 
> navigating the data structures.
> 
> 
> 
> How are "props" created/accessed? I followed the TodoMVC example, but that 
> seems to be using "state", which I am given to understand should be kept as 
> high in the hierarchy as possible (per the React recommendations).  I tried 
> something like  (:value (om/get-props this)) from within IRender, but that 
> doesn't work. Also : (om/get-props this [:items] )  (following the idiom 
> established by get-state.
> 
> 
> 
> 
> I'm probably missing something obvious, so I thought I'd pop in here to see 
> if there's someone who can point me in the right direction.
> 
> 
> 
> 
> 
> --
> 
> 
> --
> 
> 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 the Google Groups 
> "Clojure" group.
> 
> To unsubscribe from this group and stop receiving emails from it, 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.


Cute Clojure tricks

2014-01-05 Thread Cedric Greevey
How many states can the US have and keep a flag with a reasonably close to
square arrangement of stars like it currently has?

(take-while #(<= % 100)
  (sort
(distinct
  (for [m (range 3 20)
n (range (int (* m 3/4)) (inc m))]
(- (* 2 m n) m n -1)

(8 13 18 23 25 32 39 41 50 59 61 72 83 85 94 98)

The next close-to-squarish possibility is 59 states. The stars would be a
7x5 grid with a superposed 6x4 grid, versus the present 6x5 and 5x4. But
just two states after that it could be exactly square, with 6x6 and 5x5
arrays. :)

Also: the flag would have to change if the US annexed either of its large
neighbors. Canada has 13 internal divisions which would become new states,
but 63 is not a solution. Mexico's 31 internal states would give the US 81
in total, but that is not a solution either. Both miss solutions by 2, but
in opposite directions. Mexico, plus graduating Puerto Rico and the U.S.
Virgin Islands to full statehood, would give 83, allowing a flag with 8x6
and 7x5 arrays of stars. (Of course, the GOP would never stand for anything
like this that would make such a large fraction of US voters Latino.)

-- 
-- 
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: Contributors needed for Rouge (Clojure on Ruby)

2014-01-05 Thread john walker
If boot time is your primary concern, this can help. The jvm is still 
there, though :/ 

https://github.com/technomancy/grenchman


On Saturday, January 4, 2014 9:43:22 AM UTC-5, g vim wrote:
>
> I have recently moved most of my work to Clojure and Clojurescript but 
> neither of these implementations seem suitable for non-http scripting, 
> for which I currently use Ruby. So, you can imagine my elation when I 
> discovered Rouge which is Clojure implemented on Ruby: 
>
> https://github.com/rouge-lang/rouge 
>
> The project looks fantastic but they seem to be short of contributors. 
> My programming skills are nowhere near advanced enough to work on this 
> myself so, please, if any of you Clojurians have proficiency in Ruby and 
> Clojure please consider contributing. 
>
> I looked at Python's Hy (hylang.org) which is an excellent project in 
> its own right and is heavily influenced by Clojure but its taregt is 
> generic Lisp 1 rather than Clojure. Rouge will enable Clojure to occupy 
> the non-http scripting space without competing directly with Clojure and 
> Clojurescript. 
>
> gvim 
>

-- 
-- 
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: Contributors needed for Rouge (Clojure on Ruby)

2014-01-05 Thread Russell Christopher
I wonder if Go could be a good substrate for native-compiled Clojure.


On Sun, Jan 5, 2014 at 5:27 PM, Mikera  wrote:

> On Sunday, 5 January 2014 18:18:22 UTC, John Gabriele wrote:
>>
>> On Saturday, January 4, 2014 1:12:12 PM UTC-5, Michael Gardner wrote:
>>
>>>
>>> > Hopefully the landscape for alternative Clojure hosts will improve
>>> with the completion of CinC [2].
>>>
>>> [2] https://github.com/Bronsa/CinC
>>
>>
>> Looks like CinC is now:
>>
>>   * https://github.com/clojure/tools.analyzer
>>   * https://github.com/clojure/tools.analyzer.jvm
>>   * https://github.com/clojure/tools.emitter.jvm
>>
>> This may be the topic for another thread, but could anyone please
>> summarize: Do these libs provide a path forward for a native compiled
>> Clojure? If so, what would that path be? (Ex. a tools.emitter.c?
>> tools.emitter.llvm?)
>>
>
> I'm somewhat sceptical of the value of trying to build a native-compiled
> Clojure. It is certainly theoretically possible, but making a *good* native
> Clojure implementation would require:
> 1. A really good garbage collector (for persistent data structures, lazy
> sequences etc.)
> 2. Excellent concurrency / multi-threading support with a robust
> concurrent memory model
> 3. Some sort of underlying object model / type system
> 4. A fast dynamic JIT compiler to recompile code in the running environment
> 5. A rich set of standard libraries (for collections, numerical tower etc.)
>
> This means reinventing something effectively equivalent to the JVM.
> except it wouldn't have the benefit of years of fine tuning and a huge
> cross-platform library ecosystem. Sounds like a backwards step to 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.


Re: [ANN] data.avl 0.0.10 -- fast sorted maps and sets with log-time rank queries

2014-01-05 Thread Mikera
On Sunday, 5 January 2014 23:33:41 UTC, Brandon Bloom wrote:
>
> Michał: This is awesome. Thanks for the continued awesome work on data 
> structures!
>  
>
>>   ;; if the key is not present in the collection, -1 is returned: 
>>   (avl/rank-of (avl/sorted-set 3 4 5) 0) 
>>   ;= -1 
>>
>
> Curious: Why not return nil instead of -1?
>

Without commenting on the specifics of data.avl: The usual reason to do 
this in index lookup code is that -1 is a valid primitive return value. If 
you wanted to use nil instead, it would mean boxing all other return 
values, which could be quite a big performance issue in various algorithms.

-- 
-- 
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] data.avl 0.0.10 -- fast sorted maps and sets with log-time rank queries

2014-01-05 Thread Brandon Bloom
Michał: This is awesome. Thanks for the continued awesome work on data 
structures!
 

>   ;; if the key is not present in the collection, -1 is returned: 
>   (avl/rank-of (avl/sorted-set 3 4 5) 0) 
>   ;= -1 
>

Curious: Why not return nil instead of -1?

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
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: Contributors needed for Rouge (Clojure on Ruby)

2014-01-05 Thread Joel Holdbrooks
As a suffix to my last reply; if Hy were capable of delivering acceptable 
truthy semantics and persistent data structures, I might recommend it.

On Saturday, January 4, 2014 9:44:08 AM UTC-8, g vim wrote:
>
> On 04/01/2014 17:28, gaz jones wrote: 
> > Why not just use Ruby or (my preference) Python? Both are great for 
> > quick CLI apps / scripts. Best tool for the job, and all that? 
> > 
>
> A Clojure layer on top of Ruby means less context switching which works 
> better for me as the Lisp mindset is very different from Ruby or Python. 
> However, I just looked at the Rouge docs and very little seems to have 
> been implemented so maybe it's dying. If so, I'll go with Hy which looks 
> much more mature. 
>
> gvim 
>

-- 
-- 
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: Contributors needed for Rouge (Clojure on Ruby)

2014-01-05 Thread Joel Holdbrooks
As one of the original contributors to Rouge I will definitely agree that 
it does need a lot of work. That being said, if there's interest and pull 
requests are submitted the original author or myself typically chime in. 
Both of us have been busy with other projects/life and haven't done much 
work on it in quite some time.

While Rouge itself is not 100% compatible with Clojure or complete, I 
certainly would recommend it over Hy for simple tasks and for the 
maintainers understanding of both Clojure and Lisp idioms. As far as I can 
tell, the Hy team seems more or less interested in a Pythonic Lisp. There 
was a huge debate, for instance, over whether or not 0, [], {}, (), and "" 
should be considered truthy in Hy which. If you ask me, that alone is a 
reason not to consider it unless, of course, you are looking for that.

Beside the topic, there is a Ruby 
librarythat includes implementations of 
various persistent data structures. Since 
I head about it I thought it would be nice to use those instead of the 
`freeze`ing of Ruby's data structures you see in Rouge currently. It would 
definitely be worth the effort/discussion and I'm sure Rouge would be open 
to that.

On Saturday, January 4, 2014 9:44:08 AM UTC-8, g vim wrote:
>
> On 04/01/2014 17:28, gaz jones wrote: 
> > Why not just use Ruby or (my preference) Python? Both are great for 
> > quick CLI apps / scripts. Best tool for the job, and all that? 
> > 
>
> A Clojure layer on top of Ruby means less context switching which works 
> better for me as the Lisp mindset is very different from Ruby or Python. 
> However, I just looked at the Rouge docs and very little seems to have 
> been implemented so maybe it's dying. If so, I'll go with Hy which looks 
> much more mature. 
>
> gvim 
>

-- 
-- 
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: Contributors needed for Rouge (Clojure on Ruby)

2014-01-05 Thread Mikera
On Sunday, 5 January 2014 18:18:22 UTC, John Gabriele wrote:
>
> On Saturday, January 4, 2014 1:12:12 PM UTC-5, Michael Gardner wrote:
>
>>
>> > Hopefully the landscape for alternative Clojure hosts will improve with 
>> the completion of CinC [2]. 
>>
>> [2] https://github.com/Bronsa/CinC
>
>
> Looks like CinC is now:
>
>   * https://github.com/clojure/tools.analyzer
>   * https://github.com/clojure/tools.analyzer.jvm
>   * https://github.com/clojure/tools.emitter.jvm
>
> This may be the topic for another thread, but could anyone please 
> summarize: Do these libs provide a path forward for a native compiled 
> Clojure? If so, what would that path be? (Ex. a tools.emitter.c? 
> tools.emitter.llvm?)
>

I'm somewhat sceptical of the value of trying to build a native-compiled 
Clojure. It is certainly theoretically possible, but making a *good* native 
Clojure implementation would require:
1. A really good garbage collector (for persistent data structures, lazy 
sequences etc.)
2. Excellent concurrency / multi-threading support with a robust concurrent 
memory model
3. Some sort of underlying object model / type system
4. A fast dynamic JIT compiler to recompile code in the running environment
5. A rich set of standard libraries (for collections, numerical tower etc.)

This means reinventing something effectively equivalent to the JVM. 
except it wouldn't have the benefit of years of fine tuning and a huge 
cross-platform library ecosystem. Sounds like a backwards step to 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.


ClojureScript integration with Emacs/Cider ?

2014-01-05 Thread Alexandru Nedelcu
Hi,

I can’t get auto-completion or jumping to the definition of a function in
Emacs, while working with ClojureScript. Is this a limitation of Emacs’
Cider  plugin?

I managed to get nRepl working by using the awesome
com.cemerick/austinplugin for lein
(besides including the plugin in
project.clj I’ve got no other special configuration). So to work with
ClojureScript, from inside an nRepl session, I execute the following (not
sure if this is right):

(cemerick.austin.repls/exec :exec-cmds ["google-chrome"])

In Emacs I do the same thing, by first starting the repl with
cider-jack-inand then I execute the above command. Compiling the
current buffer works
(C-c C-k), I can also send expressions for evaluation to the repl (C-x C-e).

However, as I said, auto-completion doesn’t work and neither does jumping
to the definition of a function. Is there any way to get these features
while working with ClojureScript in Emacs? Or maybe in another IDE?

Thanks,
-- 
Alexandru Nedelcu
www.bionicspirit.com

PGP Public Key:
https://bionicspirit.com/key.aexpk

-- 
-- 
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] Component: dependency injection and state management

2014-01-05 Thread Korny Sietsma
Thanks - I'd kind-of worked that out after posting (with the aid of a walk
outside, and a beer!) but it's nice to know I'm on the right track.
On 5 Jan 2014 19:05, "Stuart Sierra"  wrote:

> Hi Korny,
>
> Components implementing protocols can provide different implementations.
> In the Database example, both the "real" component and the "stub" component
> would have to implement some common protocol that defines the "primitive"
> capabilities needed by the application.
>
> Traditional update-in-place databases are hard to mock, but I sometimes
> stub a remote Datomic database with a local in-memory version.
>
> -S
>
>
>
> On Sun, Jan 5, 2014 at 1:23 PM, Korny Sietsma  wrote:
>
>> Hi - I've been playing with this and I'm a little confused.
>>
>> I can understand how you use the library to pass around stateful
>> components, and to start/stop them and wire them up etc.
>>
>> But I'm not sure I see how it should be used for more general dependency
>> injection.
>>
>> I'll pick a concrete example - in the readme you have an ExampleComponent
>> which calls "(get-user database :admin)"
>> the "get-user" function then gets the connection from the Database
>> component - but it's still coupled to the particular implementation of
>> "execute-query":
>>
>> (defn get-user [database username]
>>   (execute-query (:connection database)
>> "SELECT * FROM users WHERE username = ?"
>> username))
>>
>> If you wanted to unit test this function, you could pass whatever
>> database connection thing you'd like - but you couldn't stub out the whole
>> database, as execute-query is still coupled to the implementation of your
>> database.  More generally, anything that calls "get-user" will need to
>> provide some sort of working database, or mock/stub out the call to
>> execute-query, or the call to get-user itself.
>>
>> Is there something I'm missing?  Is there some way you could/would do
>> this with the component library?  Or is this not the point of the library?
>>
>> - Korny
>>
>>
>>
>> On 21 November 2013 02:01, Stuart Sierra wrote:
>>
>>> This is a small library/framework I've been working on for a few months.
>>>
>>> https://github.com/stuartsierra/component
>>>
>>> I use this to manage runtime state in combination with my "reloaded"
>>> workflow using tools.namespace.[1]
>>>
>>> I've started using this on some personal and professional projects and
>>> it seems to be working fairly well.
>>>
>>>
>>> [1]: http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded
>>>
>>>  --
>>> --
>>> 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.
>>>
>>
>>
>>
>> --
>> Kornelis Sietsma  korny at my surname dot com http://korny.info
>> .fnord { display: none !important; }
>>
>> --
>> --
>> 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 a topic in the
>> Google Groups "Clojure" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/clojure/jXnxVZaP2K4/unsubscribe.
>> To unsubscribe from this group and all its topics, 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_o

Re: Contributors needed for Rouge (Clojure on Ruby)

2014-01-05 Thread Timothy Baldridge
Sure, anyone can go and write an emitter using these tools, but this
doesn't solve the issues of a good type system, GC, JIT, etc. These tools
make it easier to make any Clojure implementation self hosting, but those
impls still need a good foundation to build on, and that's the hard part.

Timothy


On Sun, Jan 5, 2014 at 11:18 AM, John Gabriele  wrote:

> On Saturday, January 4, 2014 1:12:12 PM UTC-5, Michael Gardner wrote:
>
>>
>> > Hopefully the landscape for alternative Clojure hosts will improve with
>> the completion of CinC [2].
>>
>> [2] https://github.com/Bronsa/CinC
>
>
> Looks like CinC is now:
>
>   * https://github.com/clojure/tools.analyzer
>   * https://github.com/clojure/tools.analyzer.jvm
>   * https://github.com/clojure/tools.emitter.jvm
>
> This may be the topic for another thread, but could anyone please
> summarize: Do these libs provide a path forward for a native compiled
> Clojure? If so, what would that path be? (Ex. a tools.emitter.c?
> tools.emitter.llvm?)
>
>  --
> --
> 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.
>



-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
-- 
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] Component: dependency injection and state management

2014-01-05 Thread Stuart Sierra
Hi Korny,

Components implementing protocols can provide different implementations. In
the Database example, both the "real" component and the "stub" component
would have to implement some common protocol that defines the "primitive"
capabilities needed by the application.

Traditional update-in-place databases are hard to mock, but I sometimes
stub a remote Datomic database with a local in-memory version.

-S



On Sun, Jan 5, 2014 at 1:23 PM, Korny Sietsma  wrote:

> Hi - I've been playing with this and I'm a little confused.
>
> I can understand how you use the library to pass around stateful
> components, and to start/stop them and wire them up etc.
>
> But I'm not sure I see how it should be used for more general dependency
> injection.
>
> I'll pick a concrete example - in the readme you have an ExampleComponent
> which calls "(get-user database :admin)"
> the "get-user" function then gets the connection from the Database
> component - but it's still coupled to the particular implementation of
> "execute-query":
>
> (defn get-user [database username]
>   (execute-query (:connection database)
> "SELECT * FROM users WHERE username = ?"
> username))
>
> If you wanted to unit test this function, you could pass whatever database
> connection thing you'd like - but you couldn't stub out the whole database,
> as execute-query is still coupled to the implementation of your database.
>  More generally, anything that calls "get-user" will need to provide some
> sort of working database, or mock/stub out the call to execute-query, or
> the call to get-user itself.
>
> Is there something I'm missing?  Is there some way you could/would do this
> with the component library?  Or is this not the point of the library?
>
> - Korny
>
>
>
> On 21 November 2013 02:01, Stuart Sierra wrote:
>
>> This is a small library/framework I've been working on for a few months.
>>
>> https://github.com/stuartsierra/component
>>
>> I use this to manage runtime state in combination with my "reloaded"
>> workflow using tools.namespace.[1]
>>
>> I've started using this on some personal and professional projects and it
>> seems to be working fairly well.
>>
>>
>> [1]: http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded
>>
>>  --
>> --
>> 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.
>>
>
>
>
> --
> Kornelis Sietsma  korny at my surname dot com http://korny.info
> .fnord { display: none !important; }
>
> --
> --
> 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 a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojure/jXnxVZaP2K4/unsubscribe.
> To unsubscribe from this group and all its topics, 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] Component: dependency injection and state management

2014-01-05 Thread Korny Sietsma
Hi - I've been playing with this and I'm a little confused.

I can understand how you use the library to pass around stateful
components, and to start/stop them and wire them up etc.

But I'm not sure I see how it should be used for more general dependency
injection.

I'll pick a concrete example - in the readme you have an ExampleComponent
which calls "(get-user database :admin)"
the "get-user" function then gets the connection from the Database
component - but it's still coupled to the particular implementation of
"execute-query":

(defn get-user [database username]
  (execute-query (:connection database)
"SELECT * FROM users WHERE username = ?"
username))

If you wanted to unit test this function, you could pass whatever database
connection thing you'd like - but you couldn't stub out the whole database,
as execute-query is still coupled to the implementation of your database.
 More generally, anything that calls "get-user" will need to provide some
sort of working database, or mock/stub out the call to execute-query, or
the call to get-user itself.

Is there something I'm missing?  Is there some way you could/would do this
with the component library?  Or is this not the point of the library?

- Korny



On 21 November 2013 02:01, Stuart Sierra wrote:

> This is a small library/framework I've been working on for a few months.
>
> https://github.com/stuartsierra/component
>
> I use this to manage runtime state in combination with my "reloaded"
> workflow using tools.namespace.[1]
>
> I've started using this on some personal and professional projects and it
> seems to be working fairly well.
>
>
> [1]: http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded
>
>  --
> --
> 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.
>



-- 
Kornelis Sietsma  korny at my surname dot com http://korny.info
.fnord { display: none !important; }

-- 
-- 
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: Contributors needed for Rouge (Clojure on Ruby)

2014-01-05 Thread John Gabriele
On Saturday, January 4, 2014 1:12:12 PM UTC-5, Michael Gardner wrote:

>
> > Hopefully the landscape for alternative Clojure hosts will improve with 
> the completion of CinC [2]. 
>
> [2] https://github.com/Bronsa/CinC


Looks like CinC is now:

  * https://github.com/clojure/tools.analyzer
  * https://github.com/clojure/tools.analyzer.jvm
  * https://github.com/clojure/tools.emitter.jvm

This may be the topic for another thread, but could anyone please 
summarize: Do these libs provide a path forward for a native compiled 
Clojure? If so, what would that path be? (Ex. a tools.emitter.c? 
tools.emitter.llvm?)

-- 
-- 
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: Require namespace

2014-01-05 Thread Justin Smith
Agreed, sticking with require scales better than load-file, and require is 
actually the right way to use functionality in another ns. load-file is a 
clumsy tool and you will hit its limits quickly.

On Sunday, January 5, 2014 8:54:18 AM UTC-8, Tim Visher wrote:
>
> Hi juanghui, 
>
> If you're working out your stuff, more power to you, but I do want to 
> say that you sound quite far off the beaten path of Clojure usage, so 
> just be aware that you may be accomplishing your goal in a 
> non-standard, hard to support way. :) 
>
> On Sat, Jan 4, 2014 at 6:12 AM, jianghui > 
> wrote: 
> > Hi,Thank you so much ;) 
> > I use load-file at last and it works. 
> > 
> > 
> > 2014/1/3 Gary Trakhman > 
> >> 
> >> There's a reasonable blog post here on the matter: 
> >> 
> http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html
>  
> >> 
> >> It's a bit complicated to regurgitate it all in a mailing list response 
> >> :-). 
> >> 
> >> 
> >> On Thu, Jan 2, 2014 at 8:33 AM, > 
> wrote: 
> >>> 
> >>> 
> >>> Hi, 
> >>> 
> >>> I am a newbie of Clojure.I have some confusions of "how to require a 
> >>> namespace". 
> >>> 
> >>> 1、If I want to call a function of file B.clj  in the file A.clj,does I 
> >>> have to require the namespace of B.clj in A.clj? 
> >>> 
> >>> 2、In the file A.clj,if I need to call the functions of all *.clj in 
> the 
> >>> special directory,how to require the namespace of *.clj dynamically? 
> >>> 
> >>> Happy New Year! 
> >>> Thanks in advance! 
> >>> 
> >>> -- 
> >>> -- 
> >>> 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 the Google 
> Groups 
> >>> "Clojure" group. 
> >>> To unsubscribe from this group and stop receiving emails from it, 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 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 the Google 
> Groups 
> >> "Clojure" group. 
> >> To unsubscribe from this group and stop receiving emails from it, 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 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 the Google 
> Groups 
> > "Clojure" group. 
> > To unsubscribe from this group and stop receiving emails from it, 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: Require namespace

2014-01-05 Thread Tim Visher
Hi juanghui,

If you're working out your stuff, more power to you, but I do want to
say that you sound quite far off the beaten path of Clojure usage, so
just be aware that you may be accomplishing your goal in a
non-standard, hard to support way. :)

On Sat, Jan 4, 2014 at 6:12 AM, jianghui  wrote:
> Hi,Thank you so much ;)
> I use load-file at last and it works.
>
>
> 2014/1/3 Gary Trakhman 
>>
>> There's a reasonable blog post here on the matter:
>> http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html
>>
>> It's a bit complicated to regurgitate it all in a mailing list response
>> :-).
>>
>>
>> On Thu, Jan 2, 2014 at 8:33 AM,  wrote:
>>>
>>>
>>> Hi,
>>>
>>> I am a newbie of Clojure.I have some confusions of "how to require a
>>> namespace".
>>>
>>> 1、If I want to call a function of file B.clj  in the file A.clj,does I
>>> have to require the namespace of B.clj in A.clj?
>>>
>>> 2、In the file A.clj,if I need to call the functions of all *.clj in the
>>> special directory,how to require the namespace of *.clj dynamically?
>>>
>>> Happy New Year!
>>> Thanks in advance!
>>>
>>> --
>>> --
>>> 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.

-- 
-- 
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: Sorting Nested Vectors and filter out some

2014-01-05 Thread Jeff Angle
Hi Cedric,
Thanksvery insightful!

On Sunday, January 5, 2014 1:30:07 AM UTC+3, Cedric Greevey wrote:
>
> You might wish to consider a different data structure. For example, the 
> inner objects might be better off as maps with named keys, so your lookup 
> keys would be things like :amount rather than 5. And instead of out of band 
> values like the string "N/A" you'd just omit a mapping in such cases. At 
> the very least you may wish to consider using nil instead of "N/A" as an 
> out of band value for "not there".
>
> But a map would allow easily adding more data later on, as well as enable 
> giving the lookup keys meaningful names, and would keep the existing keys 
> stable when new ones were added. A map may also perform better if you end 
> up with a lot of optional keys, as missing mappings don't take up space 
> while "N/A" values in a vector do.
>
> As for naming integer positions using constants, such as (def amount 5), 
> there are two weaknesses with that approach.
>
> First, inserting new values will shift all of the existing ones that are 
> farther to the right to higher indices, so you'd have to change "amount" to 
> 6 and hope you hadn't missed any direct lookups with 5 instead of amount. 
> But if you use a map with a key of :amount, adding more keys can never move 
> the actual amount value away from :amount.
>
> And second, you can namespace keys to avoid collisions, with :my-ns/amount 
> and :other-ns/amount not colliding. You can namespace def'd integer 
> constants too, with (in-ns 'my-ns) (def amount 5) and (in-ns 'other-ns) 
> (def amount 7), but if one day you end up with a situation where two 
> namespaces def two different things to the key 5, the namespacing isn't 
> going to help you.
>
> Maps with named and namespaceable :keyword keys are much more robust and 
> scalable in large (or potentially-in-the-future-large) projects and in the 
> presence of many optional keys. With Clojure, it's strongly recommended to 
> use maps with named keys instead of positionally-significant entries in 
> vectors to represent structured tuples of data like you seem to have here. 
> The robustness becomes especially significant if you save and load data and 
> keep old data around as the application grows. If you reorder the vectors, 
> or insert new fields before existing ones, and then read in old data, the 
> values will end up with the wrong keys, whereas if you use maps, keywords, 
> and edn format the values in old data can never end up reading back in with 
> the wrong keys (as long as you never rename already-used keys for any 
> reason, which with meaningful names and especially namespacing you should 
> never need to do).
>
>

-- 
-- 
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: Contributors needed for Rouge (Clojure on Ruby)

2014-01-05 Thread Glen Mailer
Have you looked into running clojurescript on Node.js? 

This should be a reasonable environment for command line scripting

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