Re: [ANN] Deeto - A Java dynamic proxy factory for interface-typed data transfer objects

2019-07-03 Thread gvim

Sounds like everything I escaped from when I discovered Clojure.

gvim

On 03/07/2019 22:38, henrik42 wrote:

Hi everyone,

I'm pleased to announce the release of Deeto 0.1.0 [1]

Deeto is a Clojure library for Java developers. With Deeto you can
define your data transfer object types via interfaces in Java. You do
not need to implement these interfaces. Instead you can ask Deeto to
analyze (via reflection) the interface class and then give you a
factory for it.

Deeto returns Java dynamic proxys which implements `Cloneable` and
`Serializable`. The proxy has sane `equals`, `hashCode` and `clone`
implemetations.

It's available now on Clojars.

Henrik

[1] https://github.com/henrik42/deeto/tree/0.1.0

--
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
<mailto:clojure+unsubscr...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/clojure/51f21a20-ae63-449d-a126-5d5545ab876a%40googlegroups.com
<https://groups.google.com/d/msgid/clojure/51f21a20-ae63-449d-a126-5d5545ab876a%40googlegroups.com?utm_medium=email_source=footer>.
For more options, visit https://groups.google.com/d/optout.


--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/5D1D43E5.2090903%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kotlin null-safety in Clojure?

2016-12-30 Thread gvim

On 30/12/2016 19:19, James Reeves wrote:

Well, Kotlin is statically typed, and Clojure is dynamically typed. Null
checking on dynamically typed languages is hard (impossible?) to achieve
without impacting performance.

- James



Personally, I'd trade the whole of clojure.spec & core.typed for this 
feature of Kotlin.


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/d/optout.


Re: Kotlin null-safety in Clojure?

2016-12-30 Thread gvim

On 30/12/2016 19:19, James Reeves wrote:

Well, Kotlin is statically typed, and Clojure is dynamically typed. Null
checking on dynamically typed languages is hard (impossible?) to achieve
without impacting performance.

- James



Could spec + macros bring Clojure somewhere near? Just a naive shot in 
the dark :)


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/d/optout.


Kotlin null-safety in Clojure?

2016-12-30 Thread gvim
What would it take to implement Kotlin's null-safety in Clojure? Are 
there any Clojure-specific gotchas which make it more difficult than in 
Kotlin?


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/d/optout.


Re: [ANN] [book] Mastering Clojure published!

2016-04-03 Thread gvim

On 03/04/2016 05:46, Akhil Wali wrote:

I'm pleased to announce that Mastering Clojure has been published.
This book is a fast paced exploration of the more advanced features of
the Clojure language.
It also demonstrates a handful of interesting libraries, such as
core.async, pulsar, core.logic and cats.

https://www.packtpub.com/application-development/mastering-clojure
https://github.com/PacktPublishing/Mastering-Clojure
http://www.amazon.com/Mastering-Clojure-Akhil-Wali/dp/1785889745/

It's been almost a year since I've started working on this book.
A big thanks to everyone involved!



Congratulations, Akhil.

To anyone intending to publish, please think twice before going with 
Packt as their pricing is ridiculous. Compare "Mastering Clojure" with 
"Web Development with Clojure" (Pragmatic Bookshelf):


"Mastering Clojure" - 266 pages / 42.82 Euros = $48.81
"Web Development with Clojure" - 250 pages / $24 = 21.05 Euros

O'Reilly and Prag Prog books are also better produced, IMHO, with less 
of the sidebar padding you find in Packt books.


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/d/optout.


Re: Clojure as first language

2016-03-19 Thread gvim

On 21/02/2016 10:45, Terje Dahl wrote:

I believe that the simplicity of Clojure's syntax in combination with
its clean functional nature and prefix notation makes it ideal as a
"first language" for anyone who wants to start programming - including,
and perhaps especially kids.

Is there anything written about this?
Arguments ... experiences ... perhaps even research ...?



For kids and student maybe but for anyone setting out to earn a living 
from programming Clojure would be a bad choice right now as the job 
market is overwhelmingly OOP-dominated and once you grok Clojure OOP can 
become intolerable. Better to get a foundation in Javascript, 
Python/Ruby and Java first then add Clojure later. According to 
Indeed.co.uk there are only 21 jobs in the UK with Clojure in the title.


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/d/optout.


Luminus in Techempower benchmarks

2016-02-27 Thread gvim

In the latest round of Techempower benchmarks:

https://www.techempower.com/benchmarks/#section=data-r12=peak=json

... I was surprised to find Luminus performing no better than Hapi 
(Node) and significantly worse than Java frameworks. Figures are 
requests/second:


FORTUNES
- Hapi: 1.9
- Luminus:   0.9
- Gemini:   55.5

JSON SERIALISATION
- Hapi: 0.3  (Raw db)
- Luminus:   0.8
- Rapidoid: 78.4


SINGLE QUERY
- Hapi: 2.9
- Luminus:   8.7
- Gemini:   75.8

MULTI-QUERY
- Hapi:   33.0
- Luminus: 20.4
- Dropwizard: 65.8

DATA UPDATES
- Hapi:20.9
- Luminus:  20.0
- Ninja:   54.7

PLAINTEXT
- Hapi:0.7
- Luminus:  0.0
- Rapidoid:  100.0



Any ideas?

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/d/optout.


Re: Scala/Clojure/F# - Functional Programming Advocates - New York/Chicago/San Fran

2016-02-01 Thread gvim

Alex

I was looking at Indeed.com for U.S. FP job stats and I found for 
"United States" by title:


Java: 12,125
Scala: 336
Clojure: 28

Considering Clojure 1.0 has been around for nearly 7 years and Scala 2.0 
is almost a decade old is it fair to conclude that FP and Clojure in 
particular are likely to remain niche as far as paid work goes? It seems 
the OO juggernaut just rolls on regardless :(


gvim



On 01/02/2016 20:54, a...@functionalworks.com wrote:

Hey All,

I am currently working with some of the worlds most talented FP teams in
the US to help them build out there Clojure, F# and Scala teams.

If you are looking for a new gig within the Functional Space and want to
work alongside some of the best engineers then drop me a line!
a...@functionalworks.com <mailto:a...@functionalworks.com>

Paying up to $180,000 + Benefits + Bonus + Stock!

Look forward to hearing from you.

thanks,

Alex Mesropians



--
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/d/optout.


Re: Compare between clojure and Java

2016-01-05 Thread gvim

On 05/01/2016 13:44, Josh Kamau wrote:

Here is an extremely simple example:

Problem: add a list of numbers

java: You put something like this in a class in a method

int[] numbers = {1,2,3,4,5,6,7,7,8,4,3} ;

int sum = 0 ;
for(int i = 0; i < sum.length; i++) {
 sum = sum + i;
}

return sum;


clojure: You put this in a clojure namespace

(def numbers [1 2 3 4 54 56 6])

;;to get the sum
(reduce + numbers)


You get the idea ;)

Josh



Even more painful is:

public class Klass {
public HashMap<String, String> data = new HashMap<String, String>();
data.put("key1", "value1");
data.put("key2", "value2");
data.put("key3", "value3");
data.put("key4", "value4");
}

 versus:

(def my-map {:key1 "value1" :key2 "value2" :key3 "value3" :key4 "value4"})

The complexity is compounded in Java if you want mixed-type values or 
arbitrary nesting. In Clojure it is pure simplicity:


(def my-map {:key1 "value1" :key2 55 :key3 [:m1 {:k1 "val1" :k2 67} :m2 
{:k1 "val1" :k2 [1 2 3 4]}] :key4 #{2 4 "name" :id}})


(get-in my-map [:key3 3 :k2 3])  ; => 4

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/d/optout.


Re: Compare between clojure and Java

2016-01-05 Thread gvim

On 05/01/2016 13:44, Josh Kamau wrote:

Here is an extremely simple example:

Problem: add a list of numbers

java: You put something like this in a class in a method

int[] numbers = {1,2,3,4,5,6,7,7,8,4,3} ;

int sum = 0 ;
for(int i = 0; i < sum.length; i++) {
 sum = sum + i;
}

return sum;


clojure: You put this in a clojure namespace

(def numbers [1 2 3 4 54 56 6])

;;to get the sum
(reduce + numbers)


You get the idea ;)

Josh




Or simply:

(reduce + [1 2 3 4 54 56 6])

--
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/d/optout.


Re: Reviewers needed for new Clojure book!

2015-08-24 Thread gvim

Akhil

Have you considered approaching O'Reilly or Pragmatic? Packt books tend 
to be on the slim side which might affect your potential for covering so 
many topics in any kind of depth. IMHO they're also overpriced.


gvim



On 24/08/2015 07:46, Akhil Wali wrote:

If anyone is interested in being a reviewer for a new book *Mastering
Clojure* by Packt Publishing, please let me know.
Reviewers will be entitled to a 6 montn subscription of PacktLib
https://www.packtpub.com/books/subscription/packtlib.

Here's the list of topics covered in this title.

  *


  * Working with Sequences and Types
  * Orchestrating Concurrency and Parallelism
  * Parallelization using Reducers
  * Writing Macros
  * Composing Transducers
  * Using Functors and Monads
  * Programming with Logic
  * Asynchronous Programming
  * Reactive Programming
  * Working with Tests
  * Troubleshooting and Best Practices


--
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
mailto:clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
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/d/optout.


Re: [ANN] New Clojure Book: Clojure Data Structures and Algorithms Cookbook

2015-08-20 Thread gvim

On 20/08/2015 12:21, Rafik NACCACHE wrote:

Hi Guys,

I am proud to let you know that my book dealing about advanced
algorithms in Clojure has hit the shelves. Please head over to:

https://www.packtpub.com/application-development/clojure-data-structures-and-algorithms-cookbook

Rafik



Congrats, Rafik. The book looks great. I just wish you'd gone with a 
publisher with more realistic pricing.


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/d/optout.


Power of Clojure/Lisp s-expressions as a debugging aid

2015-08-19 Thread gvim
As a relative Clojure novice I'm finding Lisp's s-expressions provide a 
simplified debugging experience, Java stacktraces aside, unparallelled 
in any other language I've come across. I was recently having trouble 
with this function:


(defn shared-aspects [my-id your-id]
  (for [[{left :l right :r id1 :id asp1 :aspect} {asp2 :aspect}]
 (partition 2 (sql-aspects-by-id {:mi my-id :yi your-id}))
:let [asp1 (keyword asp1)
  asp2 (keyword asp2)
  rg (if (= id1 my-id) (str (asp-colour asp1)
(asp-colour asp2))
(str (asp-colour asp2)
 (asp-colour asp1)))]]
{:rg rg :asp-id ((first (sql-joint-aspect-id {:le left :ri right 
:ty shared})) :id)}))



The magic of s-expressions allowed me to extract what I suspected was 
the culprit:


(partition 2 (sql-aspects-by-id {:mi my-id :yi your-id}))

... and test it separately in the REPL. I was able to first test the 
function's output, assess it's suitability for the end result I required 
then, when found unsatisfactory, substitute various alternatives to 
partition and slot the modified version back into the main function 
defintion. This option of wrapping and substituting is what makes Lisp 
so special within a live REPL.


Other functional languages, such as Scala and Haskell, claim to enjoy a 
similar level of composability but I can't imagine anything without 
s-expressions offering quite the same experience.


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/d/optout.


Re: ClojureScript Self-hosting Demo

2015-07-31 Thread gvim

On 31/07/2015 19:08, David Nolen wrote:

Some more words  demos here
http://swannodette.github.io/2015/07/29/clojurescript-17/

Cheers,
David



Amazing work, David. Clojure[script] really is THE fountain of 
innovation. Whilst Clojurescript may not be as mainstream as React, 
Angular etc. developments within it are shaping the whole client-side 
development scene. Self-hosting Clojurescript, along with demand-driven 
data modelling, is truly mind-blowing.


Well done.

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/d/optout.


Function behaving differently in web app route

2015-07-31 Thread gvim

I have a route in my Luminus project:

  (POST /add_link  [my_id fname surname day2 month2 year2 hour2 min2 
zone2]
   (let [link (add-user-planets-aspects! [fname 
surname nil nil nil


(Integer/parseInt day2) (Integer/parseInt month2) (Integer/parseInt year2)

(Integer/parseInt hour2) (Integer/parseInt min2) 0 zone2])
  your-id ((first (link :aspects-added)) 
:user_id)
  link-id ((add-link (Integer/parseInt 
my_id) your-id friend) :id)]

  (l/render reg_response.html
   (if ( link-id 0) {:h2 Link added 
:text (str Link id:  link-id)}
 {:h2 No link 
added :text There was something wrong with your link submission.}


In the REPL add-link does what it should but within the route it only 
does half the job, ie. it generates a link-id but doesn't do everything 
defined within its body:


(defn add-link [my-id your-id link-type]
  (let [link-id ((add-link-id my-id your-id link-type) :id)
shared (add-links-aspects my-id your-id link-id)
synastry (add-links-synastry my-id your-id link-id)]
{:shared shared :synastry synastry :id link-id}))

I've tried (doall (add-link   to avoid lazy eval possibilities but 
it didn't make any difference. What options are there for tracing what 
add-link is doing/not doing? The app connects to a postgres database.


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/d/optout.


Re: Help with data structure transformation

2015-06-06 Thread gvim

On 06/06/2015 05:01, Sean Corfield wrote:

Page 84 is where it shows that maps are a sequence of pairs.

The destructuring in James's code is on vectors -- the pairs in the
sequence.

Hope that helps?

Sean



Page 84 describes the sequence abstraction in general but it's the 
implicit seq in for destructuring that threw me as I can't recall an 
example of it in any books I've read. I don't know what to make of this, 
for example:


(seq {:a aa :b bb :c cc})
([:c cc] [:b bb] [:a aa])   ;; Fine so far

(let [[x y z] (seq {:a aa :b bb :c cc})] [x y z])
[[:c cc] [:b bb] [:a aa]]   ;; Consistent with first example above

(for [[x y z] {:a aa :b bb :c cc}] [x y z])
([:c cc nil] [:b bb nil] [:a aa nil]);; WTF?

Taken together these make no sense to me.

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/d/optout.


Help with data structure transformation

2015-06-05 Thread gvim

I have a YeSQL query:

(get-signs {:em emails})  ;; emails is a vector of email address strings

... which produces this list of maps:

(
{:email a...@gmail.com, :sign Scorpio, :planet Mercury, :surname 
Blogs, :first_name Joe}
{:email a...@gmail.com, :sign Leo, :planet Moon, :surname Blogs, 
:first_name Joe}
{:email a...@gmail.com, :sign Scorpio, :planet Venus, :surname 
Blogs, :first_name Joe}
{:email a...@gmail.com, :sign Cancer, :planet Mars, :surname 
Blogs, :first_name Joe}
{:email a...@gmail.com, :sign Libra, :planet Sun, :surname Blogs, 
:first_name Joe}


{:email d...@gmail.com, :sign Scorpio, :planet Mars, :surname 
Doe, :first_name Jane}
{:email d...@gmail.com, :sign Taurus, :planet Moon, :surname Doe, 
:first_name Jane}
{:email d...@gmail.com, :sign Cancer, :planet Mercury, :surname 
Doe, :first_name Jane}
{:email d...@gmail.com, :sign Virgo, :planet Venus, :surname Doe, 
:first_name Jane}
{:email d...@gmail.com, :sign Leo, :planet Sun, :surname Doe, 
:first_name Jane}

)

I want to transform this data structure into a list of maps in this format:

{:email a...@gmail.com :planet-signs {:Sun Libra :Moon Leo :Mercury 
Scorpio :Venus Scorpio :Mars Cancer]}


I started with:

(defn extract-planet-signs [emails]
  (let [results (group-by :email (get-signs {:em emails}))]
(for [email-key (keys results)
  {:keys [email sign planet surname first_name]} (results 
email-key)


... but beyond that I'm a bit stuck. Any ideas?

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/d/optout.


Re: Help with data structure transformation

2015-06-05 Thread gvim
I must re-read Clojure Programming (O'Reilly) in that case as I don't 
recall the authors mentioning this kind of destructuring.


gvim


On 06/06/2015 03:33, Fluid Dynamics wrote:

On Friday, June 5, 2015 at 10:07:05 PM UTC-4, g vim wrote:

That works but I missed this possibility because I'm still not clear
how:

(group-by :email signs)

 which produces a map of the form:

{a...@gmail.com javascript:
  [{:email a...@gmail.com javascript:, :sign Cancer,
:planet Mars, :surname
Blogs, :first_name Joe}
  . ]}

 can be destructured with the vector [email signs]. I assumed a map
must be destructured with a map but couldn't find a solution as the map
keys are unique values, ie. email addresses.


The code was (for [[email signs] (group-by...)]...). The for iterates
over the map produced by group-by, producing individual map entries, and
map entries can be treated as two-element seqs/vectors of [key value],
which is what the destructuring does here, putting the key in local
binding email and the value, a vector with maps in it, in signs.

--
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
mailto:clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
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/d/optout.


Re: Help with data structure transformation

2015-06-05 Thread gvim

That works but I missed this possibility because I'm still not clear how:

(group-by :email signs)

 which produces a map of the form:

{a...@gmail.com
[{:email a...@gmail.com, :sign Cancer, :planet Mars, :surname 
Blogs, :first_name Joe}

. ]}

 can be destructured with the vector [email signs]. I assumed a map 
must be destructured with a map but couldn't find a solution as the map 
keys are unique values, ie. email addresses.


I reduced your solution to:

(defn extract-planet-signs [emails]
  (for [[email signs] (group-by :email (get-signs {:em emails}))]
{:email email, :signs (into {} (map (juxt :planet :sign) signs))}))

Thanks

gvim






On 05/06/2015 21:26, James Reeves wrote:

Perhaps something like:

(defn planet-sign-map [signs]
   (into {} (map (juxt :planet :sign) signs)))

(defn extract-planet-signs [signs]
(for [[email signs] (group-by :email signs)]
 {:email email, :signs (planet-sign-map signs)}))

(defn find-planet-signs [emails]
   (extract-planet-signs (get-signs {:em emails})))

- James

On 5 June 2015 at 17:24, gvim gvi...@gmail.com
mailto:gvi...@gmail.com wrote:

I have a YeSQL query:

(get-signs {:em emails})  ;; emails is a vector of email address strings

... which produces this list of maps:

(
{:email a...@gmail.com mailto:a...@gmail.com, :sign Scorpio,
:planet Mercury, :surname Blogs, :first_name Joe}
{:email a...@gmail.com mailto:a...@gmail.com, :sign Leo, :planet
Moon, :surname Blogs, :first_name Joe}
{:email a...@gmail.com mailto:a...@gmail.com, :sign Scorpio,
:planet Venus, :surname Blogs, :first_name Joe}
{:email a...@gmail.com mailto:a...@gmail.com, :sign Cancer,
:planet Mars, :surname Blogs, :first_name Joe}
{:email a...@gmail.com mailto:a...@gmail.com, :sign Libra,
:planet Sun, :surname Blogs, :first_name Joe}

{:email d...@gmail.com mailto:d...@gmail.com, :sign Scorpio,
:planet Mars, :surname Doe, :first_name Jane}
{:email d...@gmail.com mailto:d...@gmail.com, :sign Taurus,
:planet Moon, :surname Doe, :first_name Jane}
{:email d...@gmail.com mailto:d...@gmail.com, :sign Cancer,
:planet Mercury, :surname Doe, :first_name Jane}
{:email d...@gmail.com mailto:d...@gmail.com, :sign Virgo,
:planet Venus, :surname Doe, :first_name Jane}
{:email d...@gmail.com mailto:d...@gmail.com, :sign Leo, :planet
Sun, :surname Doe, :first_name Jane}
)

I want to transform this data structure into a list of maps in this
format:

{:email a...@gmail.com mailto:a...@gmail.com :planet-signs {:Sun
Libra :Moon Leo :Mercury Scorpio :Venus Scorpio :Mars Cancer]}

I started with:

(defn extract-planet-signs [emails]
   (let [results (group-by :email (get-signs {:em emails}))]
 (for [email-key (keys results)
   {:keys [email sign planet surname first_name]} (results
email-key)

... but beyond that I'm a bit stuck. Any ideas?

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
mailto: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
mailto:clojure%2bunsubscr...@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
mailto:clojure%2bunsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
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
mailto:clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

Re: Help with data structure transformation

2015-06-05 Thread gvim
Yes, I'm fine with the concept. Just can't remember coming across it in 
the textbooks but maybe I wasn't paying attention :)


gvim


On 06/06/2015 04:08, Sean Corfield wrote:

It’s because if you treat a hash map as a sequence β€” as `for` does β€” you get a 
sequence of pairs (key/value β€” map entries):

(seq {:a 1 :b 2})
;;= ([:a 1] [:b 2])

Does that help?

Sean


On Jun 5, 2015, at 7:41 PM, gvim gvi...@gmail.com wrote:

I must re-read Clojure Programming (O'Reilly) in that case as I don't recall 
the authors mentioning this kind of destructuring.

gvim


On 06/06/2015 03:33, Fluid Dynamics wrote:

On Friday, June 5, 2015 at 10:07:05 PM UTC-4, g vim wrote:

That works but I missed this possibility because I'm still not clear
how:

(group-by :email signs)

 which produces a map of the form:

{a...@gmail.com javascript:
  [{:email a...@gmail.com javascript:, :sign Cancer,
:planet Mars, :surname
Blogs, :first_name Joe}
  . ]}

 can be destructured with the vector [email signs]. I assumed a map
must be destructured with a map but couldn't find a solution as the map
keys are unique values, ie. email addresses.


The code was (for [[email signs] (group-by...)]...). The for iterates
over the map produced by group-by, producing individual map entries, and
map entries can be treated as two-element seqs/vectors of [key value],
which is what the destructuring does here, putting the key in local
binding email and the value, a vector with maps in it, in signs.




--
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/d/optout.


Re: Help with timestamp with timezone in YeSQL

2015-05-17 Thread gvim
'Turns out I was looking in the wrong place. YeSQL relieves you of all 
the clj-time formatting as you can simply add the PostgreSQL cast 
directly to your placeholder so this:


-- name: add-birth!
INSERT INTO births (date_time) VALUES (:date_time)

 becomes:

-- name: add-birth!
INSERT INTO births (date_time) VALUES (:date_time::timestamptz)

Now this works:

(add-birth! {:date_time 1967-07-31 06:30:00 America/Caracas})

gvim



On 17/05/2015 01:36, Sam Roberton wrote:

On Sunday, 17 May 2015 01:46:14 UTC+10, g vim wrote:

snip/

   (c/to-timestamp 1967-07-31 06:30:00 America/Caracas)

 evaluates to nil. However:

(c/to-timestamp 1967-07-31 06:30:00)

 gives me an:  #inst 1967-07-31T06:30:00.0-00:00 ,
whatever that is, so I checked the clj-time docs and it appears
to-timestamp doesn't handle timezones.

Any ideas?


Looks like you might want this:

user (clj-time.format/parse (clj-time.format/formatter -MM-dd
HH:mm:ss ZZZ) 1967-07-31 06:30:00 America/Caracas)
#object[org.joda.time.DateTime 0x79e05a0 1967-07-31T10:30:00.000Z]

I suspect you'll then need some further work to make sure that the Joda
DateTime object correctly converts into what you actually want stored in
the database when it's set on the SQL PreparedStatement (something like
this
http://tapestryjava.blogspot.ie/2014/09/postgres-jdbc-time-zones.html,
but extending the type to Joda's DateTime rather than java.util.Date) --
or alternatively you might be OK just coercing the above to a
java.sql.Date or java.sql.Timestamp.

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
mailto:clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
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/d/optout.


Help with timestamp with timezone in YeSQL

2015-05-16 Thread gvim

I have a YeSQL query:

-- name: add-birth!
INSERT INTO births (date_time) VALUES (:date_time)

In PostgreSQL I can enter:

INSERT INTO births (date_time) VALUES   ('1967-07-31 06:30:00 
America/Caracas')


... and all is well but my defquery equivalent:

(add-birth! {:date_time 1967-07-31 06:30:00 America/Caracas})

 fails because the date_time string is passed to PostgreSQL as a 
varchar, not a timestamp with timezone. So, to remedy this I tried 
clj-time's coerce function:


(add-birth! {:date_time (c/to-timestamp 1967-07-31 06:30:00 
America/Caracas)})


 which fails again because:

 (c/to-timestamp 1967-07-31 06:30:00 America/Caracas)

 evaluates to nil. However:

(c/to-timestamp 1967-07-31 06:30:00)

 gives me an:  #inst 1967-07-31T06:30:00.0-00:00 , 
whatever that is, so I checked the clj-time docs and it appears 
to-timestamp doesn't handle timezones.


Any ideas?

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/d/optout.


Re: Clojure needs a web framework with more momentum

2015-05-04 Thread gvim

On 04/05/2015 14:34, Ernie de Feria wrote:

I would like to echo the sentiment expressed by several posters in this
thread, but with a slight twist. A few years back I picked up Ruby and
Ruby on Rails as the language/framework to create a website with
moderate complexity and functionality. I did this without any prior
experience with the language of framework. What allowed me to quickly
pick up both was the excellent documentation around the language and
framework. For example, with the information from
http://guides.rubyonrails.org and the canonical application built in
https://www.railstutorial.org one can acquire the necessary knowledge to
develop highly functional websites. Branching out to leverage
non-canonical libraries/products then becomes a fairly easy exercise
(MongoDB instead of MySQL, Mongoid instead of ActiveRecords, etc.). What
allows that to happen is the momentum built around the Rails ecosystem
via community participation and documentation.

We have recently started to build our back end infrastructure in
Clojure. Many times we have discussed the value and desire to unify our
development efforts on and around Clojure. Inevitably we tally up all
the functionality inherited from Ruby gems (that play nice with Rails -
the Framework) that would have to be replicated in Clojure and there
always shortcomings, not necessarily in the availability of libraries
that perform these functions, but in the readily accessible
documentation about how to best integrate them.

The composable libraries over framework mantra is technically solid.
What we're missing, in the web development with Clojure subset of the
community, is the stewardship to create and maintain a canonical
amalgamation of composable libraries and the best practices around them
- a la https://railstutorial.org. This would lower the barrier of entry
into the web development realm for Clojure developers. My 2+ cents.



Clojure needs its own Rails or Typesafe Reactive Platform otherwise I 
fear it will remain a niche player. What's to lose? The current approach 
will always remain an option.


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/d/optout.


Re: Clojure needs a web framework with more momentum

2015-05-04 Thread gvim

On 04/05/2015 15:24, Timothy Baldridge wrote:

The thing that bugs me the most about these sort of conversations about
best practices is that they often present a set of solutions without
first analyzing the problem at hand.

If I came to this mailing list and asked I want to write a websever in
Clojure..what should I use?. The response would most likely be Ring +
Compojure. Okay, not bad options, but that recommendation has been given
with absolutely no analysis of what I'm trying to accomplish. What if I
need async? What if I need web sockets? What sort of connection load am
I expecting? Will my system handle mostly persistent connections (like
websockets or SSE), or will it be more canned (and cacheable) data? If
someone recommends Ring to me, I may be pigeonholed into some system
I'll have to refactor later. Perhaps the best option is Aleph or Pedestal.

That's the real issue with canned responses like rails tutorial. They
assume my needs match your needs and match the needs of most people.
That's just not the best way to go about doing software development. And
it's a problem I've seen in so many areas of computing.

I've lost countless hundreds of hours of my life to frameworks that
default to bulky serialization formats (like XML or JSON), or frameworks
that assume LAN connections to the servers, or frameworks that assume I
won't be using multi-threading, or frameworks that assume I won't try to
load 10k rows on a single page, or frameworks that assume any number of
things. The thing I love the most about the Clojure community is that,
more than any other community I've been a part of, they try to ask you
to think before you jump.

So what I would recommend is more of a set of guidelines, and matrices.
List all the frameworks/libraries on one axis, and features on another,
and start commenting. Make a page like this:
(http://en.wikipedia.org/wiki/Comparison_of_video_container_formats)

Mention that Ring is well supported by the community, but doesn't work
well with fully async servers, mention that Aleph does all the async you
need, but is a bit non-standard. Mention that data.json is pure Clojure,
but cheshire is most likely faster.

Just present the options, and let the users make up their own minds. You
don't understand the needs of all of your users. So don't try to solve
their problems, instead present them with options and let them make up
their own minds.  I guarantee you that whatever tech you recommend to
someone, the won't like some aspect of it,  so better to present them
with all the options and let them choose, then they can only blame
themselves if it doesn't work out exactly like they expected.



A seasoned professional/Clojure guru like yourself will obviously prefer 
a customised approach but the beginner and mid-level developer faces a 
different problem - how to get something fully-featured up quickly and 
maybe get paid for doing a job within a limited budget  timescale where 
exploring all the options and how to fit them together just isn't an option.


I'm all in favour of library composition but not exclusively. In the 
Python world they have Django and a tradition of do-it-yourself 
lightweight options. I don't understand why we can't adopt a similar 
approach.


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/d/optout.


Re: Clojure needs a web framework with more momentum

2015-05-04 Thread gvim

On 04/05/2015 23:17, blake wrote:

I went from Ruby to Clojure in short-order and while I struggled
mightily with the functional aspect (after assiduously avoiding those
concepts for years), I much prefer every aspect of Clojure web
programming to Rails.

The bible of rails programming is the Hartl book. In the edition I read,
before you got to any actual programming, you were introduced to
14β€”fourteen! I counted!β€”different domains, including things like RSpec
and Cucumber. And it was all treated with this, Well, you can figure
out what this all does because, hey, it looks just like English
attitude, with a patina of you don't need to know what's going on under
the covers.

The advantage of having an opinionated framework is that it saves one
the effort of having to make up one's own mind. This means you're
trusting someone with literally no understanding of your problem domain
to make up your mind for you. It's sort of amazing that this works at
all, and that there aren't =more= vulnerabilities turning up like the
Rails XML hack.
​
This made me really uncomfortable with Rails.

My current Clojure web app is more sophisticated than anything I did
with Rails, though my Rails apps doubtless carried far more untapped
potential. But I know just about exactly what it does. I know because I
added each piece of middleware as I needed it, and this allowed me to
understand what going on. I needed access to Mongo and MS-SQL, so I
added those. I needed a front-end so I started with Hiccup, which is
obvious (and remarkably similar to Smalltalk's Seaside, which I've
used), and then added in some Javascript.

I'll turn the Javascript into Clojurescript, but I felt that was too
much to absorb at once. And unlike Rails, I didn't need to absorb every
hot library du jour to get going. (And damned if in Rails, each tutorial
has a different idea of which libraries are essential.)

Then I added authentication, and threading (which was ridiculously
easy), and so on. Each piece as needed, with an understanding of what
was going on. Now, I don't get ALL of it. But I know where my weaknesses
are. I have, now, an opinionated framework, but it's made of =my=
opinions. And I made those opinions by looking at what the libraries I'm
using did, which is way simpler in a shallow functional world than in an
object-drill-down world.

In Rails, you don't know what you don't know.



Do the advantages you've pointed out apply to teamwork, though? That's 
supposed to be where frameworks make life easier.


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/d/optout.


Re: Clojure needs a web framework with more momentum

2015-05-04 Thread gvim

On 04/05/2015 23:49, Raoul Duke wrote:

vulnerabilities that would not exist using an integrated framework.


fwiw, web + security always makes me think of http://liftweb.net/



Can you elaborate? Lift got it right or was a disaster?

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/d/optout.


Re: Clojure needs a web framework with more momentum

2015-05-04 Thread gvim

On 05/05/2015 00:03, Raoul Duke wrote:

Can you elaborate? Lift got it right or was a disaster?


oh! good question, sorry :-)

i believe it got it far more right than wrong.



I've been pretty impressed with Scala's main framework, Play 2. There 
seems to be a lot of momentum behind their Typesafe Reactive Platform 
and, like Rails, plenty of resources to get new users up to speed.


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/d/optout.


Re: Clojure needs a web framework with more momentum

2015-05-04 Thread gvim

On 04/05/2015 21:48, Robert Levy wrote:

Another thing worth mentioning that I don't see already mentioned is the
case for a web framework from a security perspective:
https://www.youtube.com/watch?v=CBL59w7fXw4 Having a lot of different
pieces without standard ways of putting them together can introduce
vulnerabilities that would not exist using an integrated framework.



See the first message in the thread. That was one of my concerns.

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/d/optout.


Re: Clojure needs a web framework with more momentum

2015-05-03 Thread gvim

On 03/05/2015 19:01, Hildeberto Mendonça wrote:

I would recommend watching the video Simple made easy by Rich Hickey:
http://www.infoq.com/presentations/Simple-Made-Easy . By watching this
video, I realized there is no sense writing frameworks in Clojure. Not
because the video says so, but because the approach of using libraries
to compose solutions makes a lot more sense. Django and Rails are
examples of easy technologies, while Clojure and its libraries are an
example of simple. You will also understand Sean when he said that
Clojure doesn't need to be the solution for low-level problems.

Do you actually program in Clojure? Have you experienced web development
in Clojure? I'm asking that because my personal experience was actually
good. I'm happier writing Clojure web apps adding libraries on demand
instead of having a huge piece of software with a lot of things that I
don't use at all.


Rich Hickey's videos got me into Clojure so, yes, I've watched all of 
them several times.


Yes, I do program in Clojure. Exclusively at the moment as I'm currently 
free to work on my own startup project. I'm using Luminus and enjoy it 
so I didn't start this thread out of dissatisfaction with Luminus itself 
but more from a sense of frustration at seeing so little input coming 
from the community compared with other languages.


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/d/optout.


Re: Clojure needs a web framework with more momentum

2015-05-03 Thread gvim

On 03/05/2015 23:55, James Reeves wrote:

On 3 May 2015 at 23:36, gvim gvi...@gmail.com
mailto:gvi...@gmail.com wrote:

Yes, I do program in Clojure. Exclusively at the moment as I'm
currently free to work on my own startup project. I'm using Luminus
and enjoy it so I didn't start this thread out of dissatisfaction
with Luminus itself but more from a sense of frustration at seeing
so little input coming from the community compared with other languages.


By what measurement?

- James


I posted some figures at the beginning of this thread where I was 
comparing frameworks, not components. A framework is more than the sum 
of it's components so I don't think comparing Ring and Compojure to 
Phoenix or Play is relevant. Clojure frameworks aren't the only ones 
built from components.


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/d/optout.


Re: Clojure needs a web framework with more momentum

2015-05-03 Thread gvim

On 03/05/2015 05:24, Sean Corfield wrote:

On Sat, May 2, 2015 at 8:18 PM, Mark Engelberg mark.engelb...@gmail.com
mailto:mark.engelb...@gmail.com wrote:

Clojure is great for creating new, disruptive web models, but what's
the easiest path to creating something that can be done trivially
with, say, Drupal or Django?


The question tho' is why you'd want to use Clojure for something that is
already trivially solved with free packaged software for widely used
scripting languages where cheap, plentiful developers are falling over
themselves to help... :)

Clojure doesn't have to be the solution for every problem. It certainly
doesn't need to be the solution for low-value problems...


Forgive me if that sounds a little elitist. What if I want to do what 
Django can do but in Clojure? If Clojure is a better option there should 
be something which can do more than Django. If my only choice is library 
composition by definition it doesn't do what Django does well, ie. a 
fully-structured setup out of the box with a predictable, best of breed 
set of technologies.


There are many businesses, large and small, who will only go with a 
well-established web framework with a vibrant community. Sadly, 
Clojure's preference for protecting its niche means it will never be an 
option for these opportunities, hence its poor showing in job listings. 
Do we, as a community, want to be paid for what we do?


There's one factor missing from this discussion which is framework 
community. I think there's immense value in the community factor which 
emerges when a web framework gains a lot of mindshare. From what I've 
read in this thread there will probably never be anything like RailsConf 
for a Clojure web framework simply because shared knowledge can only go 
so far with the library composition approach.



Perfection is the enemy of the good (Gustave Flaubert).


The whole is greater than the sum of its parts. (Aristotle)

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/d/optout.


Re: Clojure needs a web framework with more momentum

2015-05-03 Thread gvim

On 03/05/2015 14:39, larry google groups wrote:

The industry has been moving against frameworks for 15 years now. The
peak of the monolithic framework craze was Struts, back in 2000. After
that, people started craving something less bloated. That's why the
whole industry was so excited when Rails emerged in 2004. Bruce Eckel
summed up the sudden change of mood in his essay The departure of the
hyper-enthusiasts:

http://www.artima.com/weblogs/viewpost.jsp?thread=141312

But after awhile, people began to feel that even Rails was bloated,
which lead to the emergence of micro-frameworks like Sinatra.

And then, continuing with the trend, we've seen the emergence of
eco-systems, such as Clojure, that allow the trend to go further:
Clojure supports such high levels composition that frameworks are no
longer needed. And this is the direction the industry has been moving
for the last 15 years. Clojure is simply out in front. Most languages
don't allow this level of composition.



The web development industry as reflected in job postings at 
Indeed.co.uk is still dominated by the likes of Rails, Django, Laravel, 
Zend, Symfony  Spring so I'm not sure how you've concluded that there's 
been a 15-year trend towards composition. Ruby and Python have had 
lightweight composable alternatives for many years but Rails and Django 
still dominate. I'm not against the composition at all. I just think we 
need more structured alternatives that we can at least brand and market 
as well as teach to Clojure beginners.


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/d/optout.


Re: Clojure needs a web framework with more momentum

2015-05-02 Thread gvim

On 02/05/2015 22:06, Fluid Dynamics wrote:


Those numbers aren't going to be an apples-to-apples comparison.
Contributors may be lower for the Clojure libs because as a Lisp it
enables them to be enormously more productive (up to 10x) than the other
languages. The greater expressiveness allows the same functionality to
live in a smaller codebase (as measured in LOC), likely reducing the
number of commits for a given amount of functionality. And Clojure's
concurrency and immutability constructs likely reduce the number of
bugs, and thus the number of tickets and the number of commits whose
primary purpose is to fix bugs.



Considering 3 of those languages - Elixir, Haskell and Scala - are 
functional with immutable data structures and equivalent concurrency to 
Clojure's I can't quite agree with you.


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/d/optout.


Clojure needs a web framework with more momentum

2015-05-02 Thread gvim
I recently did some research into web frameworks on Github. Here's what 
I found:



FRAMEWORK   LANG  CONTRIBUTORS COMMITS

LuminusClojure28678
CaribouClojure 2275

BeegoGolang991522

PhoenixElixir  1241949

YesodHaskell   1303722

LaravelPHP2684421

PlayScala   4176085

SymfonyPHP113020914

RailsRuby   269151000


One could conclude from this that the Clojure community isn't that 
interested in web development but the last Clojure survey suggests 
otherwise. Clojure's library composition approach to everything only 
goes so far with large web applications, as Aaron Bedra reminded us in 
March last year: www.youtube.com/watch?v=CBL59w7fXw4 . Less manpower 
means less momentum and more bugs. Furthermore, I have a hunch that 
Clojure's poor adoption as indicated by Indeed.com maybe due to this 
immaturity in the web framework sphere. Why is it that Elixir, with a 
much smaller community and lifespan than Clojure's, has managed to put 4 
times as much mindshare into its main web framework when its module 
output, as measured by modulecounts.com, is a tiny fraction of Clojure's?


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/d/optout.


Re: Clojure needs a web framework with more momentum

2015-05-02 Thread gvim

On 02/05/2015 22:25, Fluid Dynamics wrote:


Ah, but none of them are Lisps. No macros, no DSLs, and thus much less
of the productivity/code-size-efficiency gains.



Elixir's macros are quite Lispy under the hood and all 3 languages can 
arguably generate sophisticated DSLs. I'm as much a fan of Lisp's 
benefits as you are but I honestly can't attribute this manpower 
discrepancy to the fact that Clojure is a Lisp. I think the community's 
overemphasis on library composition could be a bigger factor.


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/d/optout.


Re: Clojure needs a web framework with more momentum

2015-05-02 Thread gvim

On 03/05/2015 00:39, James Reeves wrote:


I agree that web development in Clojure can be improved, but I don't see
why it follows that we should be writing web frameworks.

Luminus is a web framework. We don't have to write web frameworks at 
all, that's true. Neither did the Ruby community. They had Sinatra 
before Rails but it was Rails which brought them huge mindshare and, 
more importantly, plenty of developers earning a good living. All I'm 
saying is there's room for both approaches but the outside world, where 
people make a living, tends to prefer web frameworks. Clojure needs 
something like Scala's Play/Reactive framework which has a bit of 
industry momentum behind it. It's been 5 years since Clojure 1.0 so the 
excuse that Clojure is still finding its feet is no longer valid.



Why is it that Elixir, with a much smaller community and lifespan
than Clojure's, has managed to put 4 times as much mindshare into
its main web framework when its module output, as measured by
modulecounts.com http://modulecounts.com/, is a tiny fraction of
Clojure's?


By what measurement are you drawing this conclusion?

You've listed contributors and commits for single repositories, but that
will clearly produce erroneous results when comparing a monolithic
project to a very modular one.



Elixir's Phoenix is as modular as Luminus so the comparison is valid. 
The 2 leading Rails developers behind it - Jose Valim and Chris McCord - 
recognised before Elixir reached 1.0 that a strong web framework was 
essential to gaining mindshare.


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/d/optout.


Re: Clojure needs a web framework with more momentum

2015-05-02 Thread gvim

On 03/05/2015 01:37, Luc Prefontaine wrote:

Business case...

I have two business cases at hand.

None can be done with frameworks w/o making the end products look like any 
other one in their respective space and having to bend to framework limitations.

Being disruptive requires a different approach.

Having to write all these individual libs ourselves would make these two 
product sets much more difficult to create. Experimentation would also suffer a 
lot.

Now we have the elements to create new recipes instead of everyone eating the 
same dry cake that's been left on the shelf for a year.

Aside from HR tagging, I see little value in a branded framework.
Being reluctant to be part of a tagged herd, I can't agree with you :)

But given my (bad) character this may explain that :)

Luc P.


All I'm saying is it doesn't have to be either/or. Clojure is big enough 
for modular and (relatively :)) monolithic approaches.


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/d/optout.


Re: Clojure needs a web framework with more momentum

2015-05-02 Thread gvim

On 03/05/2015 00:53, Christopher Small wrote:

I disagree with the premise entirely. I think that the Clojure community
has just done a better job of building smaller, more modular tooling.
And this is frankly something I prefer, and find refreshing in the
Clojure sphere (as compared with my previous Rails webdev experience).

Note that to put things on the same footing, you'd want to be noting
that Luminus depend on Ring and Compojure, with commit counts 761 and
865 resp, and contributor counts 73 and 29 resp.

I'm not saying that Clojure can't improve it's offering in web dev with
added libraries etc, but I wouldn't want to see us move away from the
modularity with which we've built things, because I think it's a win.

Just my 2 c

Chris Small


Most decent web frameworks these days are built from modular components 
so this distinction is a bit laboured. Rails is built on top of Active* 
and Rack so the Ring/Compojure distinction is illusory. Laravel is built 
on top of Symfony components it could be argued that Symfony has played 
a similar role to Ring/Compojure in the PHP community.


Clojure's modular approach is great but I just don't see the need to 
polarise when there's such a strong business case for structured 
frameworks. If you look at most of the jobs in web development at 
Indeed.com they're almost exclusively framework-based. Modular is great 
but it would also be nice to see a few more Clojure jobs advertised.


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/d/optout.


Re: Embedded systems and transpiling Clojure to Nim

2015-05-01 Thread gvim
I've looked around intermittently for something Clojure-esque to fill 
the scripting/sysadmin void and Pixie is the only thing I've come across 
which inspires hope. The only remaining issue for me is whether it can 
tap into existing (Python) libraries as that's what tends to swing the 
vote for scripting languages. With more languages fragmenting the 
landscape building a community and sizeable selection of libraries is 
that much harder but I hope Pixie rises above the legions of 
Lisp-in-language-X exercises one finds on Hacker News by the dozen.


gvim



On 01/05/2015 18:10, Timothy Baldridge wrote:

Yes, I when we finally get around to doing binary releases I plan on
shipping x86_64, x86 and ARM7 binaries, as those are the platforms I
have access to.

The other thing that would hinder adoption to other platforms is most
likely the stacklet library (lightweight threads), Pixie uses this
fairly heavily and it would probably need to be ported to PPC.

And yes there is a LuaJIT version of Clojure with support for Terra:
https://github.com/ohpauleez/cljs-terra

Doesn't look like it's been maintained recently however.

Timothy



On Fri, May 1, 2015 at 10:18 AM, Herwig Hochleitner
hhochleit...@gmail.com mailto:hhochleit...@gmail.com wrote:

Tim,

I went with what I saw on http://pypy.org/features.html ... runs on
Intel x86 (IA-32) , x86_64 and ARM platforms, with PPC being stalled
 Not sure if that's just for the JIT, but if it were, they
would list non-JIT platforms separately, no?

I'm aware, that you use RPython directly, but you still reuse a lot
of RPython from PyPy, right? Has pixie been tested on any non-x86
platform yet?
​
Alan,

have you seen https://github.com/raph-amiard/clojurescript-lua ?

--
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
mailto: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
mailto:clojure%2bunsubscr...@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
mailto:clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.




--
β€œ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
mailto:clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
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/d/optout.


Re: Who's using Clojure?

2015-03-08 Thread gvim

On 06/03/2015 10:46, Fergal Byrne wrote:


Clojure is winning one dev at a time. There are almost no cases of teams
switching back to Java or Scala once they've worked with Clojure for a
while. The same cannot be said for Groovy or Scala, which are being
abandoned in good numbers.



What's your source evidence for these assertions?

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/d/optout.


Re: Who's using Clojure?

2015-03-03 Thread gvim

On 04/03/2015 00:55, Marcus Blankenship wrote:

Have things changed in 4 years?  ;-)



Figures in my last post are for London.

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/d/optout.


Re: Who's using Clojure?

2015-03-03 Thread gvim

On 04/03/2015 00:55, Marcus Blankenship wrote:

Have things changed in 4 years?  ;-)



The leading jobs indicator - indeed.co.uk - shows Clojure adoption 
trailing a long way behind the other 2 main JVM languages - Scala and 
Groovy. Numbers are exclusive/inclusive of other languages in the job title:


Java:  3,889/4,675
Scala:   231/306
Groovy  24/58
Clojure  6/12

It seems Clojure will probably remain a niche language.

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/d/optout.


Re: Is Caribou Dormant ?

2015-02-28 Thread gvim

On 27/02/2015 07:26, Sven Richter wrote:

Hi,

Please have a look at: https://github.com/sveri/closp/ and tell me what
you are missing.
You might as well open feature / pull requests and I will consider
adding them.

Best Regards,
Sven


Great work, Sven. Just what I was looking for. Next - THE BOOK :)

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/d/optout.


Re: Is Caribou Dormant ?

2015-02-26 Thread gvim

On 26/02/2015 09:59, SΓ©bastien Orban wrote:

The way Clojure allow us to re use discrete component, rather than to
have them integrated from the get go(or getting integrated via various
hack), explain partially why there's no huge following to create a
framework of this kind. Luminus is a nice example - a start point to
understand this, as opinionated as Rails, but with more leeway to change
it's bit and piece. Don't forget Hoplon too, it bring us another
interesting viewpoint ! (And Boot. I love boot)

Clearly different than Rails or Play, but I'm happy about it -
otherwise, why wouldn't we use directly Rails ?



Do look at the Aaron Bedra video: 
http://www.youtube.com/watch?v=CBL59w7fXw4. He's the co-author or 
Programming Clojure and in the video he points out some of the 
advantages there are, particularly from a security point of view, in 
adopting a more integrated framework.


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/d/optout.


Re: Is Caribou Dormant ?

2015-02-25 Thread gvim
Caribou was Clojure's Rails so I'm sad to see it wither. I think Clojure 
adoption continues to suffer from the lack of a full-featured, 
strongly-backed web framework like Play and Rails. I don't see why 
support for a big framework can't co-exist with lightweight library 
composition options. The Ruby community embraces diversity from Sinatra 
all the way up to Rails with plenty of variety in between. Different 
projects  developers require different approaches and there are many 
advantages in using a large, strongly supported web framework. See Aaron 
Bedra's excellent video - www.youtube.com/watch?v=CBL59w7fXw4 - for more 
on this.


gvim


On 25/02/2015 23:36, Geraldo Lopes de Souza wrote:

Hi,

I'm checking Caribou, and wanna know if anyone is using it.
It appears that it is a dormant project by the looks of the last update

https://github.com/caribou/caribou

Thanks in advance,

Geraldo Lopes de Souza



--
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/d/optout.


Re: [ANN] Buddy 0.4.0: Security library for clojure.

2015-02-22 Thread gvim

On 22/02/2015 11:36, Andrey Antukh wrote:

Documentation:
https://funcool.github.io/buddy-core/latest/
https://funcool.github.io/buddy-auth/latest/
https://funcool.github.io/buddy-hashers/latest/
https://funcool.github.io/buddy-sign/latest/



Great addition to Clojure web development security. For new users might 
I suggest adding a namespace table to -core, -hashers and -sign as with 
-auth?


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/d/optout.


Re: Help with Liberator POST route

2015-02-19 Thread gvim

On 19/02/2015 12:56, Jonathan Barber wrote:


Replace min with minute in the route (or change minute in the curl
POST to min). Because the field names don't agree, the compojure
destructing doesn't match and you end up trying to parseInt nil.

Cheers



Thanks for spotting that one :). Still not there, though. Now getting 
simply Method not allowed.


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/d/optout.


Re: Help with Liberator POST route

2015-02-19 Thread gvim

On 19/02/2015 16:20, Sam Ritchie wrote:

Try adding

:allowed-methods [:get :post]

to your resource.

You'll want to use ANY for all liberator routes, since they manage the
responses for incorrect content types internally. If you specify GET or
POST, it's up to you to return the proper responses if the methods
aren't supported (since Compojure will return nil and try to match
further down your list of routes.



OK, will use ANY. Still puzzled, though, as to why Method not allowed 
was returned when I clearly specifed POST.


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/d/optout.


Re: Help with Liberator POST route

2015-02-18 Thread gvim

On 18/02/2015 15:32, Andy- wrote:

Without having tested it: I think you're curl -d format is wrong. It's
not semicolon separated:
http://superuser.com/questions/149329/what-is-the-curl-command-line-syntax-to-do-a-post-request

HTH



That solved the curl data submission problem but I'm still getting 
errors and suspect the POST defroute isn't correct. 'Trouble all the 
examples of :post submissions in the docs are mixed up with other 
factors so it's difficult to isolate the correct information.


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/d/optout.


Help with Liberator POST route

2015-02-18 Thread gvim

I have a Liberator app which works with this:

(defresource user [day month year hour min region location]
  :available-media-types [application/json]
  :handle-ok (generate-string (clc/calc day month year hour min 0 (str 
region / location


(defroutes app-routes
  (GET /user/:day/:month/:year/:hour/:min/:region/:location [day 
month year hour min region location]
   (user (Integer/parseInt day) (Integer/parseInt month) 
(Integer/parseInt year) (Integer/parseInt hour) (Integer/parseInt min) 
region location))


 but doesn't work with POST:

(defroutes app-routes
  (POST /user [day month year hour min region location]
   (user (Integer/parseInt day) (Integer/parseInt month) 
(Integer/parseInt year) (Integer/parseInt hour) (Integer/parseInt min) 
region location))



Testing with with:

curl -d 
day=10;month=8;year=1970;hour=13;minute=45;region=Europe;location=London 
http://localhost:3000/user


 returns an error with the first parameter truncated:

java.lang.NumberFormatException For input string: 
14;month=10;year=1960;hour=13;minute=44;region=Europe;location=London


What am I doing wrong and why is the POST data truncated in the error 
message?


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/d/optout.


Re: Let bindings and immutability

2015-02-11 Thread gvim

On 12/02/2015 01:53, Ben Wolfson wrote:

The multiple-binding form of let can be recursively transformed into
nested lets:

(let [name1 value1 name2 value2 ... name value] body)

(let [name1 value1] (let [name2 value2] ...  (let [name value] body)))

All you're doing with your let form is shadowing the name; there's no
mutation. If you had something like this:

(let [x 1]
(let [x (inc x)]
  (println x))  ;; prints 2
(println x)) ;; prints 1

it would be more obvious; it's less apparent in your case because
there's no room for the extra forms.



That explains it but I think Clojure's syntax is misleading here. 
Without knowledge of this magic the mind doesn't readily translate:


(let [x 1
x (inc x)
x (inc x)
x (inc x)]
   x)


 into:

(let [x 1]
  (let [x (inc x)]
(let [x (inc x)]
  (let [x (inc x)]
  x

The single bracket pair in the original leads the unwitting newcomer to 
assume all the x'es are in the same scope.


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/d/optout.


Re: Let bindings and immutability

2015-02-11 Thread gvim

On 12/02/2015 01:44, Laurens Van Houtven wrote:

Hi,

You’re confusing mutation with single assignment. You’re not mutating anything: 
1 is still 1, 2 is still 2; you’re just assigning the same name to different 
numbers. The numbers themselves are immutable.



It's x that bothers me, not the values assigned to it. I don't quite get 
it as x seems to behave here like any old mutable variable in Ruby or 
Python even if it's not called mutation. I suppose I've just never 
really got this (big) one :(


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/d/optout.


Let bindings and immutability

2015-02-11 Thread gvim

Why is this possible in a language based on immutability:

(let [x 1
x (inc x)
x (inc x)
x (inc x)]
   x)

;;= 4

Maybe under the hood (ie. memory registers/pointers etc.) this isn't 
strictly mutation but as a relative newcomer to Clojure I find it goes 
against the grain of what I find elsewhere in the language.


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/d/optout.


Re: Updates to cheat sheet at clojure.org/cheatsheet

2015-02-05 Thread gvim

On 05/02/2015 20:46, Andy Fingerhut wrote:

I'm happy to host an updated ClojureScript cheat sheet, and give
technical help and advice to anyone wanting to update it.

As I don't use ClojureScript myself (at least not yet), I don't have the
motivation to update it myself.

Andy



Sorry if my reply suggested any responsibility on your part. It was 
meant as a general observation.


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/d/optout.


Re: Updates to cheat sheet at clojure.org/cheatsheet

2015-02-05 Thread gvim

On 05/02/2015 17:04, Andy Fingerhut wrote:

Thanks to Alex Miller, who has updated the cheat sheet version published
at http://clojure.org/cheatsheet

It was updated from v13 to v21.  If you are curious what changes have
been made between those versions, you can read the change log here:
https://github.com/jafingerhut/clojure-cheatsheets/blob/master/src/clj-jvm/CHANGELOG.txt

As always, the most recent version, plus tooltips containing doc strings
and a search box, can be found by clicking on the Download other
versions with tooltips link near the top of that page.

Andy



Contrasts sharply with cljs-cheatsheet which is now 3 years old:

https://github.com/readevalprintlove/clojurescript-cheatsheet

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/d/optout.


Re: [ANN] Reagent + Sente (+ Heroku) = Rente

2015-01-22 Thread gvim

On 22/01/2015 07:01, Henrik Mohr wrote:


OT: I'm supporting a production app with
Clojure/ClojureScript/Datomic/Ring/Sente etc. on a Heroku 2X dyno having
1 GB of RAM.
It works like a charm!

Best,
Henrik



What kind of load? Is a basic web app even do-able on a 1X dyno, ie. 
512Mb RAM? It's just that the no-cost lead-in is such an attractive 
proposition for more conservative clients.


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/d/optout.


Re: [ANN] Reagent + Sente (+ Heroku) = Rente

2015-01-21 Thread gvim

As per the documentation:

$ lein run

$ lein figwheel
Figwheel: focusing on build-ids (client)
Compiling ClojureScript.
Figwheel: Starting server at http://localhost:3449
Figwheel: Serving files from 
'(resources|dev-resources|resources-index/dev)/public'

Compiling resources/public/js/app.js from (src/rente/client dev)...
Compiling resources/public/js/app.js failed.
java.io.FileNotFoundException: resources/public/js/app.js (No such file 
or directory)


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/d/optout.


Re: [ANN] Reagent + Sente (+ Heroku) = Rente

2015-01-21 Thread gvim

Thanks. Working now. Great work!

Slightly OT: for low cost VPS hosting with only 512Mb or 1Gb RAM Node.js 
is often the only option. A full-stack Clojurescript option built on 
similar tech as Sente would be fantastic.


gvim



On 21/01/2015 12:46, Henrik Mohr wrote:

Thanks for your comment, please pull again and retry:

lein figwheel
Figwheel: focusing on build-ids (client)
Compiling ClojureScript.
Figwheel: Starting server at http://localhost:3449
Figwheel: Serving files from
'(resources|dev-resources|resources-index/dev)/public'
Compiling resources/public/js/app.js from (src/rente/client dev)...
Successfully compiled resources/public/js/app.js in 14.874 seconds.
notifying browser that file changed:  /js/app.js
notifying browser that file changed:  /js/out/goog/deps.js
notifying browser that file changed:  /js/out/rente/client/views.js
notifying browser that file changed:  /js/out/rente/client/ws.js
notifying browser that file changed:  /js/out/start.js
notifying browser that file changed:  /js/out/rente/client/app.js

Best regards,
Henrik



--
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/d/optout.


Clojure ecommerce

2015-01-05 Thread gvim
Are there currently any Clojure ecommerce packages or libraries, 
preferably open source? Something like Shopify. Failing that, what are 
Clojure developers using to build ecommerce sites?


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/d/optout.


Re: Clojure ecommerce

2015-01-05 Thread gvim

On 05/01/2015 17:39, Sean Corfield wrote:

I can't answer the first part but I can say that at World Singles, we're using 
a combination of Braintree, SBW, Paymentwall, Paypal and a few others, almost 
all wrapped up in custom Clojure code.

Paymentwall is easy to integrate (since it uses a captive UI on the front end 
and then just pings a URL you provide with a success payload). Braintree is the 
next easiest since it offers a front end JS library that posts to their servers 
and then pings a URL you provide with a success payload (although it can also 
be used easily in server-to-server mode).



SBW?

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/d/optout.


Function order in Clojure vs scripting languages

2014-12-07 Thread gvim
Considering Clojure has a compile phase why is it more dependent on 
function definition order than scripting languages like Perl? My naive 
assumption is that one of the benefits of a compile phase is that every 
definition is defined ahead of runtime.


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/d/optout.


Problem with lein new template

2014-11-12 Thread gvim

With quite a few lein templates I'm having this problem, eg. :

$ lein new splat flow1

Failed to resolve version for splat:lein-template:jar:RELEASE: Could not 
find metadata splat:lein-template/maven-metadata.xml in local ... 
/repository)

This could be due to a typo in :dependencies or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment 
variable.

Could not find template splat on the classpath.


No proxy involved so I'm not sure where to start.

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/d/optout.


Chestnut memory usage

2014-10-13 Thread gvim

I've just setup a `lein new chestnut` project and after:

$ lein repl
   (run)
   (browser-repl)

 Activity Monitor shows 3 Java processes:

main: 953Mb
main: 747Mb
java: 634Mb

Over 2.3Gb RAM just to get a CLJS browser repl? I haven't even added 
Lighttable into the mix or IntelliJ :(


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/d/optout.


Re: Advice for building backend REST services from scratch using clojure

2014-10-07 Thread gvim

On 11/04/2014 09:17, Colin Yates wrote:

  * you can fight it as hard as you like but you will eventually end up
using emacs, clojure-mode, cider, paredit and magit and then wonder
how you ever lived without it, but not without spending at least a
month or two cursing anything to do with emacs :).



Whilst I love Emacs, clojure-mode  cider for working with Clojure I 
wasted far too much time trying to get a Clojurescript browser repl 
working with cider. Tried Weasel but it didn't seem to be keeping up 
with Clojurescript releases or else it was some other mysterious bug. 
Austin seemed to require far too much boilerplate addition to get 
anything working so I eventually resorted to Lighttable which has smooth 
interaction with a browser repl in Chrome.


Until the whole lein/cider/Clojurescript/browser repl toolchain settles 
into something stable I would caution anyone trumpeting the advantages 
of Emacs. For Clojurescript the current state of play seems to favour 
Lighttable and Cursive.


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/d/optout.


Re: Advice for building backend REST services from scratch using clojure

2014-10-07 Thread gvim

On 11/04/2014 09:17, Colin Yates wrote:

  * you can fight it as hard as you like but you will eventually end up
using emacs, clojure-mode, cider, paredit and magit and then wonder
how you ever lived without it, but not without spending at least a
month or two cursing anything to do with emacs :).



To supplement my last post, I would add that the main factor against 
Lighttable, for me, is its insane memory consumption. I don't know 
whether or not it was due to leaving it on overnight but I found it 
consuming 1.4GB RAM when I returned to editing the other day. To some 
accustomed to working with Java/JVM languages this may not be such a big 
deal but to me it matters as I work on my laptop much of the time.


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/d/optout.


Clojuredocs broken

2014-10-03 Thread gvim
Clojuredocs.org seems to be broken. Typing into the search boxes freezes 
after a few characters and searches often produce a 404 page. I'm on OS 
X 10.8. Same result with Chrome and Safari.


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/d/optout.


Re: Clojure cheat sheet now links to ClojureDocs.org for things added since Clojure 1.4

2014-09-29 Thread gvim

On 29/09/2014 22:52, Andy Fingerhut wrote:


As usual, the latest Clojure cheat sheets are available at [2].  The
version at clojure.org/cheatsheet http://clojure.org/cheatsheet will
be updated some time to match.

Andy

[1] http://clojuredocs.org
[2] http://jafingerhut.github.io


Any chance of an updated cljs-cheatsheet? The one listed on the same 
github page is 3 years old.


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/d/optout.


Re: [ANN] Nginx-Clojure v0.2.5 released!

2014-09-08 Thread gvim

On 08/09/2014 04:20, Xfeep wrote:

  In addition one Java thread will tie up one native OS thread.
A
On Monday, September 8, 2014 10:50:13 AM UTC+8, Yuexiang Zhang wrote:

Not only Wildfly but also most of mainstream pure java webservers
use thread pool to handle http requests. Nginx-Clojure can also be
configurated to use thread pool with one or many JVM instances.

Advanced Java webservers use Java NIO (I/O multipexing) to do the
first phrase (Http request accepting and simple parsing)  then run
user business flow with thread pool. The first phrase only need one
or very few threads. But at the second phrase (using thread pool)
largely existing Java Socket API based libraries such as JDBC
drivers, Http Client are  blocking so if there are many connections
they 'll eat up all threads and make the webserver hang because a OS
can only support less threads than connections. By the way threads
in JVM are not cheap and they use more memory than pure native OS
threads and OS threads are pre-emptive and scheduled at constant
time slice so if there are too many threads scheduling will cost too
many of cpu cycles to do real works.

For large scalar application one JVM instance is really not enough.
Typical scenario is we use serveral Java webservers such as tomcat,
jetty, glassfish etc, and
put a reverse proxy such as Nginx, Haproxy, Apache in the front of
them. And Nginx-Clojure make this work easier because it can
automatic embed JVM instances into Nginx worker processes and we
need not maintain too many webservers.

Since JDK 5, JVM instances can share Class data to reduce memory
usage and the startup time for java applications. And on our
  enviroment typically we use coroutine based sockets to work with
Apache http client , Solr client ,etc. Coroutines are cooperative
and cheaper than threads and be created as much as our memory can bear.

Xfeep



Thanks. Very informative. 'Looks like Nginx-Clojure is a good option.

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/d/optout.


Re: [ANN] Nginx-Clojure v0.2.5 released!

2014-09-07 Thread gvim

On 07/09/2014 13:45, Yuexiang Zhang wrote:


0.2.5 (2014-09-07)

 1. New Feature: Reference variables in jvm_options  different jvm
debug ports for jvm processes (issue #42)
 2. New Feature: Server Sent Events(SSE)  Long polling (issue #41,
issue #36)
 3. New Feature: Supports 64-bit JDK on 64-bit Windows (issue #40)
 4. New Feature: Coroutine based socket supports JDK8 (issue #39)
 5. New Feature: More easier to archive Sub/Pub services with Broadcast
Events to all Nginx workers (issue #39)
 6. New Feature: Asynchronous Channel a wrapper of asynchronous socket
to make the usage easier (issue #37)
 7. Enhancement: Fix--On Windows a little many write events happen and
these events seem useless (issue #35)




What are the trade-offs, if any, compared with Immutant + Wildfly (on 
CentOS 6)? Memory usage is of particular interest.


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/d/optout.


Re: [ANN] Nginx-Clojure v0.2.5 released!

2014-09-07 Thread gvim

On 07/09/2014 17:51, Yuexiang Zhang wrote:


 From Nginx-Clojure the most attractive things to us is :

 1. Nginx's architecture is Master + Worker processes, Nginx-Clojure
embed one JVM in per Worker process. So if any of worker process
crashes, the other JVM instances can still work and the Master will
recreate a new Worker process embedding with a new JVM instance.
 2. Nginx's perfect performance when handle even over 10 thousand
connections
 3. Coroutine based socket let old Java Socket API based app/libraries
won't lock a thread anymore
 4. IO (Coroutine based socket, Asynchronous socket  Channel) are on
top of Nginx IO API which is more worldly-wise than Java NIO on huge
scalar server application.
 5. JVMs are not goot at huge memory management. Configurable multiple
JVM instances (is the same number of Nginx Worker processes) will
  manage less memory. e.g. we have ten Nginx Worker processes in one
Nginx instance every JVM instance will only manage 1/10 memory
 6.   Nginx already has many modules / features such as rate limit ,
spdy , pages cache, image filter etc. Most of them maybe are
difficult or less effective to be implemented in pure Java world.



I'm fairly new to Clojure/JVM but I was under the impression Java 
webservers such as Wildfly (= JBoss) had a reputation for managing 
memory efficiently by spawning threads, ie. only a single JVM instance 
required? Your scenario with multiple JVMs/1 per worker sounds like a 
much bigger memory footprint but, as I said, I'm new to Java.


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/d/optout.


Re: Useless Java error messages

2014-09-01 Thread gvim

On 01/09/2014 17:50, Luc Prefontaine wrote:

Where do you see a Java error here ?

I see the Clojure implementation
reporting that you are
trying to apply a numeric operator
to a null/nil value :)

I agree the JVM stack traces are not nice
and polluted by all the frames which
may/may not be relevant.

The messages are not always as clear as
this one either.

You do not have any source file
line number anywhere in the stack
trace pointing to your code ?

Luc P.



Sorry, I was a bit trigger-happy with this one. Turns out it was Emacs 
cider truncating the stack trace to a single line. Someone on IRC 
pointed me to `(pst)` within Emacs cider which displays the full stack 
trace.


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/d/optout.


Puzzling list comp error: Don't know how to create ISeq from: clojure.lang.Keyword

2014-08-30 Thread gvim

I have a long function which produces `list-of-lists` :

((Sun 21 li 13 201.2139410)
 (Moon 11 le 21 131.3457459)
 ..)

 before entering a list comprehension (simplified for brevity):

 (defn calc ...
(let [ .
...
list-of-lists (map #(rest (first %)) results)]
(for [l list-of-lists
 plan (keyword (first l))
  deg (Integer/parseInt (second l))
  sign (signs (keyword (first (rest (rest l)
  min (Integer/parseInt (second (rest (rest l
  long (Float/parseFloat (last l))]
   {:deg deg :min min :long long})))

When I call the function I get this error:

IllegalArgumentException Don't know how to create ISeq from: 
clojure.lang.Keyword  clojure.lang.RT.seqFrom (RT.java:505)


I've tested all the bindings in the repl and they produce the desired 
data so it seems the final construction of the map is where the problem 
lies.


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/d/optout.


Re: Puzzling list comp error: Don't know how to create ISeq from: clojure.lang.Keyword

2014-08-30 Thread gvim

On 30/08/2014 15:07, Alexey Kachayev wrote:

for macro expects each pair to be either binding-form/collection-expr or
one of known modifiers (:let, :when, :while).

Here:

plan (keyword (first l))

you give a pair of binding-form and keyword (which is really impossible
to iterate over).

If you meant let-binding for plan, dec, min and long, use :let modifier
(you can find example in documentation -
http://clojuredocs.org/clojure_core/clojure.core/for).



Yes, of course :) I confused list comp bindings with let bindings. Thanks.

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/d/optout.


Re: Puzzling list comp error: Don't know how to create ISeq from: clojure.lang.Keyword

2014-08-30 Thread gvim

On 30/08/2014 15:07, Alexey Kachayev wrote:

for macro expects each pair to be either binding-form/collection-expr or
one of known modifiers (:let, :when, :while).

Here:

plan (keyword (first l))

you give a pair of binding-form and keyword (which is really impossible
to iterate over).

If you meant let-binding for plan, dec, min and long, use :let modifier
(you can find example in documentation -
http://clojuredocs.org/clojure_core/clojure.core/for).



I'm going to have to reduce the resulting list next so I thought to use 
a map version of the list comp. but ran into a similar error:


 (defn calc ...
 (let [ .
 ...
 list-of-lists (map #(rest (first %)) results)]
(- list-of-lists
(map #(let [plan (keyword (first %))
  deg (Integer/parseInt (second %))
  sign (signs (keyword (first (rest (rest %)
  min (Integer/parseInt (second (rest (rest %
  long (Float/parseFloat (last %))]
  {plan {:sign sign :deg deg :min min :long long}})))


Don't know how to create ISeq from: astro.calc$calc$fn__29869

Now I'm using a let form but the error is similar.

gvim


















2014-08-30 16:47 GMT+03:00 gvim gvi...@gmail.com
mailto:gvi...@gmail.com:

I have a long function which produces `list-of-lists` :

((Sun 21 li 13 201.2139410 tel:201.2139410)
  (Moon 11 le 21 131.3457459)
  ..)

 before entering a list comprehension (simplified for brevity):

  (defn calc ...
 (let [ .
 ...
 list-of-lists (map #(rest (first %)) results)]
 (for [l list-of-lists
  plan (keyword (first l))
   deg (Integer/parseInt (second l))
   sign (signs (keyword (first (rest (rest l)
   min (Integer/parseInt (second (rest (rest l
   long (Float/parseFloat (last l))]
{:deg deg :min min :long long})))

When I call the function I get this error:

IllegalArgumentException Don't know how to create ISeq from:
clojure.lang.Keyword  clojure.lang.RT.seqFrom (RT.java:505)

I've tested all the bindings in the repl and they produce the
desired data so it seems the final construction of the map is where
the problem lies.

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
mailto: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+unsubscribe@__googlegroups.com
mailto:clojure%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/__group/clojure?hl=en
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+unsubscribe@__googlegroups.com
mailto:clojure%2bunsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/__optout
https://groups.google.com/d/optout.




--
Kind regards,
Alexey S. Kachayev,
CTO at Attendify.com
--
http://github.com/kachayev
http://twitter.com/kachayev
Skype: kachayev
Tel: +380-996692092

--
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
mailto:clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
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/d/optout.


Re: Puzzling list comp error: Don't know how to create ISeq from: clojure.lang.Keyword

2014-08-30 Thread gvim

On 30/08/2014 17:04, Alexey Kachayev wrote:

Thread-first macro -will insert list-of-listsas first argument for map,
which is definitely not what you expect. Use threading-last -instead.



I've never quite understood the distinction other than - does 
everything top to bottom and - does the reverse. From what you're 
saying the choice also affects which position the argument is inserted? 
If so this presents a complication in that threading through several 
functions may require the argument to be inserted in different positions?


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/d/optout.


Re: [ANN] Leiningen 2.3.4 released

2014-08-24 Thread gvim
Has 2.4.3 been fixed yet? I had to revert to 2.4.2 due to clojure.nrepl 
namespace errors. Could this be due to the release of cider-nrepl 0.7.0 
which I have loaded in my .lein/profile.clj?


gvim



On 24/08/2014 02:27, Dave Sann wrote:

Do exclusions apply to plugins?

if I have

:plugins [[com.keminglabs/cljx 0.4.0 :exclusions [org.clojure/clojure]]]

I get

([com.keminglabs/cljx 0.4.0] - [org.clojars.trptcolin/sjacket
0.1.0.6] - [org.clojure/clojure [1.3.0,)]
Consider using [com.keminglabs/cljx 0.4.0 :exclusions
[org.clojure/clojure]].)
([com.keminglabs/cljx 0.4.0] - [org.clojars.trptcolin/sjacket
0.1.0.6] - [net.cgrand/regex 1.1.0] - [org.clojure/clojure [1.2.0,)]
Consider using [com.keminglabs/cljx 0.4.0 :exclusions
[org.clojure/clojure]].)
([com.keminglabs/cljx 0.4.0] - [org.clojars.trptcolin/sjacket
0.1.0.6] - [net.cgrand/parsley 0.9.1] - [org.clojure/clojure
[1.2.0,)]
Consider using [com.keminglabs/cljx 0.4.0 :exclusions
[org.clojure/clojure]].)
([com.keminglabs/cljx 0.4.0] - [org.clojars.trptcolin/sjacket
0.1.0.6] - [net.cgrand/parsley 0.9.1] - [net.cgrand/regex 1.1.0]
- [org.clojure/clojure [1.2.0,)]
Consider using [com.keminglabs/cljx 0.4.0 :exclusions
[org.clojure/clojure]].)

If it's a dependency, I don get the errors.

Dave


On Wednesday, 20 November 2013 05:41:07 UTC+11, Phil Hagelberg wrote:


Hello folks. I'm happy to announce the release of Leiningen 2.3.4.

This one is primarily a bugfix release; though there are a few minor
enhancements.

## 2.3.4 / 2013-11-18

* Suggest `:exclusions` to possibly confusing `:pedantic?`
dependencies. (Nelson Morris, Phil Hagelberg)
* Optionally look for snapshot templates in `new` task. (Travis Vachon)
* Allow task chains to be declared without commas in project.clj.
(Jean Niklas L'orange)
* Support extra configurability in `:pom-plugins`. (Dominik Dziedzic)
* Fix a bug where implicit :aot warning triggered incorrectly. (Jean
Niklas L'orange)
* Fix a bug where `lein repl connect` ignored port argument. (Toby
Crawley)

This brings all the functionality of the deprecated lein-pedantic
plugin
into Leiningen itself. The snapshot template functionality allows
template developers to test their changes more easily, and the support
for improved task chaining allows us to express higher-order task
invocations in project.clj in a properly nested way without
resorting to
commas, which are a hack to work around shell arguments' lack of
structuring.

As usual, running `lein upgrade` will pull in the latest stable
release,
and if you run into any issues you can always run `lein downgrade
2.3.3`
to go back to the previous release. Please report any issues on the
Leiningen mailing list or the GitHub issue tracker.

Thanks to all the contributors and users who helped us get to this
release.

-Phil

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


--
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/d/optout.


Re: IllegalStateException Attempting to call unbound fn

2014-08-22 Thread gvim

On 22/08/2014 07:54, Serzh Nechyporchuk wrote:

You should import LinkedBlockingQueue to your namespace.

(ns ...
  (:import java.util.concurrent.LinkedBlockingQueue))  (recommended way)
or
(import 'java.util.concurrent.LinkedBlockingQueue)

Why do this error is misleading for you?



Because the original error made no mention of this. Only a reference to 
the last function call:


(testf 42)

I'm also pretty sure I had the function containing this Java call 
working in my Emacs buffer before I added the testf function.


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/d/optout.


IllegalStateException Attempting to call unbound fn

2014-08-21 Thread gvim

I can't work out why this code produces an exception:

(defn fints [ args]
  (assert (every? integer? args))
  (vec args))

(defn testf [x]
  (fints x))

(testf 42)

IllegalStateException Attempting to call unbound fn: #'gh1.core/testf 
clojure.lang.Var$Unbound.throwArity (Var.java:43)


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/d/optout.


Re: IllegalStateException Attempting to call unbound fn

2014-08-21 Thread gvim

On 21/08/2014 09:39, Serzh Nechyporchuk wrote:

Can you put all file that you try to load?


Here it is. Just bits and pieces for practice:

(ns gh1.core)

(defn foo
  I don't do a whole lot.
  [x]
  (println x Hello, World!))

(foo Garry)

(doseq [x [1 2 3 4 5]
y [11 22 33 44 55]]
(prn (* x y)))



(defn mp [] (map #(+ % 5) [1 2 3 4 5]))

(map #(+ % 5) [1 2 3 4 5])

(prn-str {:a 1 :b 2 :c 3})

(defn fill-queue [filler-func]
  (let [q (LinkedBlockingQueue. 10)
fill (fn fill [x]
   (if (.offer q x 1 TimeUnit/SECONDS)
 x
 (recur x)))
f (future (filler-func fill) nil)]
((fn drain []
   (lazy-seq
(let [x (.take q)]
  (cons x (drain



(defmacro ints [ args]
  (assert (every? integer? args))
  (vec args))

(defn fints [ args]
  (assert (every? integer? args))
  (vec args))

(defn testf [x]
  (fints x))

(testf 42)

--
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/d/optout.


Re: IllegalStateException Attempting to call unbound fn

2014-08-21 Thread gvim

On 21/08/2014 14:35, Serzh Nechyporchuk wrote:

This code works fine for me. Did you try to reload repl?



Reloaded but now getting this error:

CompilerException java.lang.IllegalArgumentException: Unable to resolve 
classname: LinkedBlockingQueue


Maybe something needs :require-ing

If this is the source of the original problem the error messages are 
very misleading and need some work.


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/d/optout.


Re: Is Clojure a language for growth?

2014-08-20 Thread gvim

On 20/08/2014 14:09, Phillip Lord wrote:

When I got my first Java job, I had no experience at it; day one was
popping into town to buy a how to program Java book.

Actually, I had very little experience and no qualifications in
programming at all; perhaps the world was a different place then.



How long ago was that?

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/d/optout.


Re: Clojure production environment

2014-08-20 Thread gvim

On 20/08/2014 14:18, Larry Staton Jr. wrote:

Immutant behind nginx behind Elastic Load Balancer on AWS. Deploy tool
of choice is make.



I understood that Immutant is now a library which runs on something like 
Wildfly 8. Anyone using Wildfly as I'm considering it for an app?


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/d/optout.


Re-upload corrupted Rich Hickey video?

2014-07-15 Thread gvim

Clojure for Lisp Programmers Part 1 by Rich Hickey:

http://www.youtube.com/watch?v=cPNkH-7PRTk

 seems to have become corrupted. Can anyone re-upload the original?

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/d/optout.


When to prefer keywords as functions?

2014-07-03 Thread gvim
I'm reading Cloujure in Action as an introduction to Clojure and, 
although, I understand a keyword can be used as a function I don't 
understand the difference between:


(ns org.currylogic.damages.http.expenses
   (:require [clojure.data.json :as json-lib]
  [clojure.xml :as xml-core]))

... and

(ns org.currylogic.damages.http.expenses
   (require [clojure.data.json :as json-lib]
 [clojure.xml :as xml-core]))


When is it idiomatic or even preferable to substitute a function with a 
keyword equivalent?



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/d/optout.


Re: When to prefer keywords as functions?

2014-07-03 Thread gvim

On 03/07/2014 18:36, James Reeves wrote:


The reason for this is to make it clear that you're not executing the
require function directly, but instead passing options to the ns form.



I don't understand not executing the require function directly.

I've also seen the when function called as :when in the body of a let 
statement so could you elaborate on this non-macro example? I need to be 
clear on when it is preferable to use a keyword function rather than a 
normal function call.


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/d/optout.


Re: Clojure equivalent of 3-level enumeration in Ruby?

2014-06-20 Thread gvim

On 18/06/2014 17:07, Gary Trakhman wrote:

Try http://clojuredocs.org/clojure_core/clojure.core/for




I couldn't get anywhere near what was so easy in Ruby. Nested 
enumeration seems difficult in Clojure.


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/d/optout.


Re: Clojure equivalent of 3-level enumeration in Ruby?

2014-06-20 Thread gvim

On 20/06/2014 13:38, Timothy Baldridge wrote:

Care to explain? How does it get much simpler than:

(for [x some-collection
y x
   z y]
   z)



Because it's 3 levels deep and requires substituting the vars back into 
maps to then create a returned map. Your for example doesn't emulate 
Ruby's each_with_index, as in the example, as far as I'm aware. I'm 
fairly new to Clojure so the obvious may not be so obvious to me yet :)


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/d/optout.


Re: Clojure equivalent of 3-level enumeration in Ruby?

2014-06-20 Thread gvim

On 20/06/2014 14:28, Dave Della Costa wrote:

Rather than start with the code you are trying to duplicate, consider
the data structure(s) that you have as input and the data structure you
want to end up with.

It's certainly possible to emulate the kind of nested loop structure you
are asking about in Clojure, but most likely it's not how you'd
structure the solution in the first place.  For one, the Ruby example
heavily depends on mutability, which is not as common in Clojure-land.

But here's one rough sketch, just as a simple example:

I might make personals and aspected vectors of keywords, and I'd end up
doing something more like

(def find-aspects
   [astro-data]
   (reduce #(update-in %1 [%2] (do-aspected-stuff ...)) {} personals))

With do-aspected-stuff being something like:

(defn do-aspected-stuff
   [personal-key astro-data]
   (reduce #(if (= personal-key %2) %1 (calc-angles astro-data %1 %2)) {}
aspected))

and so on and so forth with calc-angles doing its own looping thing with
all the calculations you have to do (glossing over the rest as hopefully
you get the picture at this point), and everything gets deposited in the
hash-map at the very top of the chain at the end.

Hope this helps.

DD


Great, thanks. These are the kind of pointers I was looking for without 
expecting anyone to do the whole job :). Someone on IRC also mentioned 
prismatic/plumbing as possibly helpful.


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/d/optout.


Re: Leiningen 2.4.2 upgrade causing problems

2014-06-18 Thread gvim

On 18/06/2014 04:05, Sean Corfield wrote:

works for me...

Leiningen 2.4.2; Java build 1.8.0_05-b13; OS X 10.8.5 - lein help new
works fine outside of a project and also inside the context of a
project that depends on Clojure 1.6.0.

Are you running lein inside a project or outside? What do you have in
your profiles.clj file?

Sean


My ~/.lein/profiles.clj below. No problems if I remove it and run `lein 
help new` again.


{:user
  {:plugins
[[cider/cider-nrepl 0.7.0-SNAPSHOT]
 [lein-ancient 0.5.5]
 [lein-immutant 1.2.1]
 [com.jakemccrary/lein-test-refresh 0.5.0]]
   :dependencies
 [[org.clojure/clojure 1.6.0]
  [nrepl-inspect 0.4.1]
  [org.clojure/tools.trace 0.7.8]
  [co.paralleluniverse/pulsar 0.5.1]]
:repl-options
  {:nrepl-middleware
 [cider.nrepl.middleware.classpath/wrap-classpath
  cider.nrepl.middleware.complete/wrap-complete
  cider.nrepl.middleware.info/wrap-info
  cider.nrepl.middleware.inspect/wrap-inspect
  cider.nrepl.middleware.stacktrace/wrap-stacktrace
  cider.nrepl.middleware.trace/wrap-trace]}}}

--
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/d/optout.


Re: Leiningen 2.4.2 upgrade causing problems

2014-06-18 Thread gvim

On 18/06/2014 04:05, Sean Corfield wrote:


Leiningen 2.4.2; Java build 1.8.0_05-b13; OS X 10.8.5 - lein help new
works fine outside of a project and also inside the context of a
project that depends on Clojure 1.6.0.

Are you running lein inside a project or outside? What do you have in
your profiles.clj file?

Sean



Running `lein help new` from ~/.lein . By process of elimination I 
discovered the culprit is:


  [co.paralleluniverse/pulsar 0.5.1]

It's still weird, though, because I'm almost certain I checked this when 
I set about debugging my profiles.clj file yesterday.


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/d/optout.


Clojure equivalent of 3-level enumeration in Ruby?

2014-06-18 Thread gvim
I have a method in Ruby that involves 3-level enumeration and would like 
to rewrite it in Clojure. Without asking anyone to do the job :), what 
is the best equivalent to this kind of Ruby iteration in Clojure? I 
looked at prewalk and postwalk but wasn't convinced that was what's 
required. Map could also get a bit messy here.


gvim



SIGNS = { ar:'Aries', ta:'Taurus', ge:'Gemini', cn:'Cancer', le:'Leo', 
vi:'Virgo',
  li:'Libra', sc:'Scorpio', sa:'Sagittarius', cp:'Capricorn', 
aq:'Aquarius', pi:'Pisces' }
RULERS = {Aries:[:Mars], Taurus:[:Venus], Gemini:[:Mercury], 
Cancer:[:Moon], Leo:[:Sun], Virgo:[:Mercury], Libra:[:Venus],
  Scorpio:[:Mars, :Pluto], Sagittarius:[:Jupiter], 
Capricorn:[:Saturn], Aquarius:[:Saturn, :Uranus], Pisces:[:Jupiter, 
:Neptune]}
ANGLES = {cnj:{orb:7.5, deg:[0], type:'g'}, squ:{orb:6, deg:[90,270], 
type:'r'},
  tri:{orb:6, deg:[120,240], type:'g'}, opp:{orb:7.5, 
deg:[180], type:'r'}}

PERSONALS = %i(Sun Moon Mercury Venus Mars)
ASPECTED = %i(Sun Moon Mercury Venus Mars Jupiter Saturn Uranus Neptune 
Pluto)



def find_aspects(astro_data)
  results = {}
  PERSONALS.each_with_index do |p,i|
results[p] = {}
ASPECTED[i+1..9].each do |a|
  next if p == a
  ANGLES.each do |asp, data|
data[:deg].each do |d|
  exact = astro_data[p][:long] + d
  exact -= 360 if exact = 360
  range_start = exact - data[:orb]
  range_end = (exact + data[:orb] = 360) ? (exact + data[:orb] 
- 360) : (exact + data[:orb])

  target_long = astro_data[a][:long]
  if target_long = range_start  target_long = range_end
width = target_long = exact ? (exact - target_long) : 
(target_long - exact)

results[p][a] = [asp,width]
  end
end
  end
end
  end
  return results
end

--
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/d/optout.


Leiningen 2.4.2 upgrade causing problems

2014-06-17 Thread gvim
OS X Mountain Lion / lein 2.4.2 / clojure 1.6.0 / 	Java(TM) SE Runtime 
Environment (build 1.8.0_05-b13)


Running `lein help new` I'm getting an exception including this:

Caused by: java.io.FileNotFoundException: Could not locate 
clojure/data/priority_map__init.class or clojure/data/priority_map.clj 
on classpath:

at clojure.lang.RT.load(RT.java:443)

Everything was working before the recent Leiningen upgrade.

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/d/optout.


Convert clj-time date-time to UTC

2014-06-14 Thread gvim
I want to convert a time specified with a TZ datababse timezone such as 
America/Caracas into a UTC date-time but I can only find in clj-time 
from-time-zone and to-time-zone allowing the zone to be specified as a 
string. I want:


(t/some-utc-func (t/date-time 1967 7 31 6 30) (t/time-zone-for-id 
America/Caracas))


to give me:

#DateTime 1967-07-31T10:30:00.000-00:00

Even the (t/from-time-zone []) output would do if I could read the UTC 
date and time straight from it.


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/d/optout.


Re: Convert clj-time date-time to UTC

2014-06-14 Thread gvim

On 14/06/2014 16:12, Stephen Gilardi wrote:

This is not quite to your exact specification, but should help you to
write what you want:

user (defn to-utc [dt]
(t/to-time-zone dt (t/time-zone-for-offset 0)))
#'user/to-utc
user (to-utc (t/from-time-zone (t/date-time 1967 7 31 6 30)
(t/time-zone-for-id America/Caracas)))
#DateTime 1967-07-31T10:30:00.000Z



Thanks. Can't think why it's not baked into the library, though, as it 
must be a common requirement.


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/d/optout.


Re: Convert clj-time date-time to UTC

2014-06-14 Thread gvim

On 14/06/2014 17:59, Stephen Gilardi wrote:

You're welcome.

As another small refinement, I noticed that there's a var for the utc
timezone:

(t/time-zone-for-offset 0)


can be replaced with

t/utc



I tried t/utc in place of your function but it didn't produce the 
desired result.


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/d/optout.


Re: Convert clj-time date-time to UTC

2014-06-14 Thread gvim

On 14/06/2014 21:59, Michael Klishin wrote:

2014-06-14 20:49 GMT+04:00 gvim gvi...@gmail.com
mailto:gvi...@gmail.com:

Can't think why it's not baked into the library, though, as it must
be a common requirement.


Feel free to submit a pull request and a few tests. The clj-time
maintainers are responsive
and the library is primarily driven by user feedback at this point.
--
MK


I'll have to leave it to the gods as I'm a mere mortal :)

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/d/optout.


Re: clj-commons-exec/sh adding newline to command

2014-06-09 Thread gvim

Then why does this work when executed manually in the shell?

./swetest  -p0123456789t  -fPZl  -b14.10.1960  -ut13:45  -roundmin 
-head  -true  -eswe


gvim


On 09/06/2014 08:21, Ray Miller wrote:

On 9 June 2014 02:03, gvim gvi...@gmail.com wrote:

(ns gh1.tmp
   (:require [clj-commons-exec :as exec]
 [clj-time.core :as t]))



(defn calc [day month year hour min sec zone]
   (let [bin /Users/zephyr/html/astro/bin/swetest
 data (str -p0123456789t -fPZl -b day . month . year  -ut
hour : min)
 flags -roundmin -head -true -eswe]
 (exec/sh [bin data flags])))


gh1.tmp @(calc 31 11 1967 16 45 0 Europe/London)
{:exit 1, :out illegal option -roundmin -head -true -eswe\n, :err nil,
:exception #ExecuteException org.apache.commons.exec.ExecuteException:
Process exited with an error: 1 (Exit value: 1)}


Why has exec/sh added a newline to the command line? How to get rid of it?


It hasn't. That is the output from the command you executed.

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/d/optout.


Re: clj-commons-exec/sh adding newline to command

2014-06-09 Thread gvim

On 09/06/2014 14:04, Ray Miller wrote:


I suspect exec/sh is expecting a list of options. The way you are
calling it, swetest is called with only two arguments (data and
flags). When you type the command at the shell, the shell splits on
whitespace before invoking exec, so it sees 8 arguments.

I would expect this to work:

(exec/sh [/Users/zephyr/html/astro/bin/swetest -p0123456789t
-fPZl  -b14.10.1960  -ut13:45  -roundmin -head  -true
-eswe])

Ray.



Got it. Thanks very much.

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/d/optout.


clj-commons-exec/sh adding newline to command

2014-06-08 Thread gvim

(ns gh1.tmp
  (:require [clj-commons-exec :as exec]
[clj-time.core :as t]))



(defn calc [day month year hour min sec zone]
  (let [bin /Users/zephyr/html/astro/bin/swetest
data (str -p0123456789t -fPZl -b day . month . year  
-ut hour : min)

flags -roundmin -head -true -eswe]
(exec/sh [bin data flags])))


gh1.tmp @(calc 31 11 1967 16 45 0 Europe/London)
{:exit 1, :out illegal option -roundmin -head -true -eswe\n, :err nil, 
:exception #ExecuteException org.apache.commons.exec.ExecuteException: 
Process exited with an error: 1 (Exit value: 1)}



Why has exec/sh added a newline to the command line? How to get rid of it?

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/d/optout.


Re: Eval-ing a map expression in Emacs Live doesn't seem to work

2014-06-07 Thread gvim

On 06/06/2014 17:15, J Irving wrote:

Not sure I follow.

When you eval in the REPL buffer, you just have to type (foo name) and
hit return. When you do this (and you're in the correct namespace, which
you can tell by seeing the namespace in the REPL prompt) it should
evaluate correctly. Is that not happening?

What buffer are you hitting C-x C-e from?

cheers, J



Thanks, that's what I needed. I realise I've muddled C-x C-e with a 
command within Light Table which works with the closing paren of an 
s-expression. In Emacs you have to be on the next line following the 
closing paren. Got it now. The road to Emacs/Clojure enlightenment is 
once more open :)


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/d/optout.


  1   2   >