Attempt At Futures

2016-04-08 Thread Chris White
Spoiler alert: I'm really really new to this language so don't expect 
quality code

In an attempt to see how futures work I'm trying to make code that does the 
following:

   1. Take a list of sites
   2. Loop through the sites and retrieve the HEAD content via a future for 
   each individual site
   3. In the main loop once the futures have been created print the HEAD 
   content as each future completes

Now I have this code which I'm getting stuck at:

(ns cjr-http-test.core
  (:require [clj-http.client :as client]))

(defn get-head-response-for-sites
  [sites]
  (map (fn [site] (future (client/head site))) sites))

(doseq [head-data (get-head-response-for-sites '("http://www.google.com; 
"http://www.yahoo.com; "http://www.bing.com;))]
  (println (deref head-data)))

(shutdown-agents)


(Please note I know that the list of sites I'd normally expect to be 
something from a DB/text file. I'm just trying to get it working without 
adding extra things to think about)


So get-head-response-for-sites is where I'm trying to do #2. It gets me a 
list of futures that I can use. Where  I'm having trouble is that the 
current println line, which is where I'm trying to deal with #3, blocks due 
to deref-ing so it's basically not really all that different than if I did 
it non threading.

What I (think) I need is something that keeps looping through all the 
futures, checking their status, and println’ing the result when something 
has come back. This will be repeated until all the futures are done. The 
reason I want this is that for example if the first site takes 3 minutes to 
respond I want the other two sites to print their HEAD content as soon as 
it’s retrieved. Here's what I'm trying to figure out in order of importance:

   1. How do I get a constant loop through the futures, println'ing the 
   HEAD content as they finish, until all futures are finished?
   2. Is there a better way to structure this?
   3. Is there something in Clojure/contrib that's better suited for this?
   4. Is there a 3rd party library better suited for this?

Thanks for any and all response. Once again I apologize for the not so pro 
code but some code is better than nothing I hope.


- Chris White ( @cwgem )

-- 
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: [core.logic] What's the difference between "q" and a fresh LVar? Or: "java.lang.ClassCastException: clojure.core.logic.LVar cannot be cast to java.lang.Number"

2016-04-08 Thread Kevin Downey
Hard to say, the class cast exception will have more information in it
that could cast light on the issue. You also are using :id in one
variation, and :db/id in the other.

On 04/08/2016 05:46 PM, Daniel Ziltener wrote:
> Hi clj,
> 
> I'm trying to do some simple core.logic stuff. My input is a vector of
> maps, which I turn into a source for core.logic using
> |
> (defn make-datamap-rel [datapile]
>   (fn [q]
> (fn [a]
>   (to-stream
>(map #(unify a % q) (flatten datapile))
> |
> 
> Now I have written two variants for solving my problem. The first works
> flawlessly:
> |
> (defn-find-cat-and-tag-id [pile cat]
>   (let [datamap-rel (make-datamap-rel pile)]
> (run*[q]
> (datamap-rel (partial-map {:id q :category cat}))
> )))
> |
> 
> The second variant throws the ClassCastException:
> |
> (defn-find-cat-and-tag-id [pile cat]
>   (let [datamap-rel (make-datamap-rel pile)]
> (run*[q]
>   (fresh [qid]
> (datamap-rel (partial-map {:db/id qid :category cat}))
> (==q qid)
> 
> |
> 
> I have no idea why this fails. It just doesn't make any sense. Any ideas?
> 
> Best regards,
> zilti
> 
> -- 
> 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.


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

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Aleph 0.4.1

2016-04-08 Thread Alan Moore
This is *way* better than my suggestion... thanks Zach!

Alan

On Thursday, April 7, 2016 at 9:20:16 PM UTC-7, Zach Tellman wrote:
>
> This is considerably simpler than the suggestions in this thread, but I've 
> written a very basic statsd client and server in the literate examples: 
> http://aleph.io/aleph/literate.html#aleph.examples.udp.  Feedback is 
> welcome.
>
> On Saturday, April 2, 2016 at 11:44:53 PM UTC-7, Zach Tellman wrote:
>>
>> This release represents a number of incremental improvements to 0.4.0, 
>> which has been handling billions of daily requests for close to a year.  
>>
>> * Documentation can be found at http://aleph.io/
>> * Literate examples of usage can be found at 
>> http://aleph.io/aleph/literate.html
>> * Comparative benchmarks can be found at 
>> https://www.techempower.com/benchmarks/#section=data-r12=peak=plaintext=4,
>>  
>> which may or may not be relevant to your particular use case
>>
>> If anyone has questions, I'm happy to answer them.
>>
>

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

2016-04-08 Thread Daniel Ziltener
Hi Sven,

When you're sure the project depending your library does also has a 
dependency on a third library, it's best to use the ":provided" profile, 
rather than declaring it in the :dev profile. In your case there are two 
possible solutions:
1. the dependency higher up wins. So if you declare the schema dependency 
above the dependency on A, this should work.
2. modify the dependency vector in B's profile.clj so that it's something 
like [A "0.1.0" :exclusions [schema]]. See 
https://github.com/technomancy/leiningen/blob/stable/sample.project.clj#L48 
for an example.

I hope this helps you.
zilti

Am Freitag, 8. April 2016 21:36:50 UTC+2 schrieb Sven Richter:
>
> Hi,
>
> I have a library A that I use in project B. Now, library A makes use of 
> plumatics schema, as well as project B. I wonder what the best practice is 
> here. 
> Include schema in library A's dependencies? Or only declare a 
> dev-dependency on schema in library A?
>
> If I declare a dev-dependency I require every project that depends on 
> library A to include schema as a dependency, otherwise it will not work (I 
> have seen that with database libs for instance). I find that a bit unlucky, 
> because one might end up referring a lot of libs that other libraries 
> depend on.
>
> Or, include it as a direct dependency in library A. But then strange 
> things may happen as I had it with schema. Library A included schema v 
> 1.0.5 and project B schema v 1.0.3. 
> Now when I executed code in project B I had a weird schema error saying 
> that something in the schema is wrong, during compile time. In the end it 
> turned out that I have to require schema v 1.0.5 in project B too to make 
> it work. This is even more troublesome, as I make every project, that 
> depends on my library, depend on a transitive dependency in a specific 
> version.
>
> Looking at gradle for instance there is a configuration called 
> 'providedCompile' which means it is used for compilation of the library, 
> but not a transitive dependency if I include that library. Is there 
> something similar for leiningen?
>
> Best Regards,
> Sven
>

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


[core.logic] What's the difference between "q" and a fresh LVar? Or: "java.lang.ClassCastException: clojure.core.logic.LVar cannot be cast to java.lang.Number"

2016-04-08 Thread Daniel Ziltener
Hi clj,

I'm trying to do some simple core.logic stuff. My input is a vector of 
maps, which I turn into a source for core.logic using 
(defn make-datamap-rel [datapile]
  (fn [q]
(fn [a]
  (to-stream
   (map #(unify a % q) (flatten datapile))

Now I have written two variants for solving my problem. The first works 
flawlessly:
(defn- find-cat-and-tag-id [pile cat]
  (let [datamap-rel (make-datamap-rel pile)]
(run* [q]
(datamap-rel (partial-map {:id q :category cat}))
)))

The second variant throws the ClassCastException:
(defn- find-cat-and-tag-id [pile cat]
  (let [datamap-rel (make-datamap-rel pile)]
(run* [q]
  (fresh [qid]
(datamap-rel (partial-map {:db/id qid :category cat}))
(== q qid)


I have no idea why this fails. It just doesn't make any sense. Any ideas?

Best regards,
zilti

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

2016-04-08 Thread James Reeves
Include it as a dependency.

Maven dependency resolution is rather strange, and Leiningen inherits this
strangeness. Effectively what matters is how "close" the dependency is. So
dependencies in your project file take precedence over the dependencies of
your dependencies, and so forth.

Maven does have a way of providing a version range, but last time this was
looked at the general consensus was that it was too broken to be of use.
Version ranges are not overridable, and open-ended ranges always use the
latest version, even if it's a SNAPSHOT.

- James

On 8 April 2016 at 20:36, 'Sven Richter' via Clojure <
clojure@googlegroups.com> wrote:

> Hi,
>
> I have a library A that I use in project B. Now, library A makes use of
> plumatics schema, as well as project B. I wonder what the best practice is
> here.
> Include schema in library A's dependencies? Or only declare a
> dev-dependency on schema in library A?
>
> If I declare a dev-dependency I require every project that depends on
> library A to include schema as a dependency, otherwise it will not work (I
> have seen that with database libs for instance). I find that a bit unlucky,
> because one might end up referring a lot of libs that other libraries
> depend on.
>
> Or, include it as a direct dependency in library A. But then strange
> things may happen as I had it with schema. Library A included schema v
> 1.0.5 and project B schema v 1.0.3.
> Now when I executed code in project B I had a weird schema error saying
> that something in the schema is wrong, during compile time. In the end it
> turned out that I have to require schema v 1.0.5 in project B too to make
> it work. This is even more troublesome, as I make every project, that
> depends on my library, depend on a transitive dependency in a specific
> version.
>
> Looking at gradle for instance there is a configuration called
> 'providedCompile' which means it is used for compilation of the library,
> but not a transitive dependency if I include that library. Is there
> something similar for leiningen?
>
> Best Regards,
> Sven
>
> --
> 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.
>

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

2016-04-08 Thread 'Sven Richter' via Clojure
Hi,

I have a library A that I use in project B. Now, library A makes use of 
plumatics schema, as well as project B. I wonder what the best practice is 
here. 
Include schema in library A's dependencies? Or only declare a 
dev-dependency on schema in library A?

If I declare a dev-dependency I require every project that depends on 
library A to include schema as a dependency, otherwise it will not work (I 
have seen that with database libs for instance). I find that a bit unlucky, 
because one might end up referring a lot of libs that other libraries 
depend on.

Or, include it as a direct dependency in library A. But then strange things 
may happen as I had it with schema. Library A included schema v 1.0.5 and 
project B schema v 1.0.3. 
Now when I executed code in project B I had a weird schema error saying 
that something in the schema is wrong, during compile time. In the end it 
turned out that I have to require schema v 1.0.5 in project B too to make 
it work. This is even more troublesome, as I make every project, that 
depends on my library, depend on a transitive dependency in a specific 
version.

Looking at gradle for instance there is a configuration called 
'providedCompile' which means it is used for compilation of the library, 
but not a transitive dependency if I include that library. Is there 
something similar for leiningen?

Best Regards,
Sven

-- 
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] components.md

2016-04-08 Thread Brian Platz

>> This is also something that wouldn't be possible with Mount as this 
library seems to promote global state.

As a recent switcher from Component to Mount, and without trying to change 
the thread's topic into a this vs. that -- I'll simply say that I don't 
believe any of these tools promote global state, it is people who code 
global state, and that can be with any of these tools... or likewise 
avoided with any of these tools.

Some tools (i.e. Component) probably make it more difficult to have global 
state, but I think it is heavy handed. For projects with a lot of 
components, I would spend a lot of time backtracking components all feeding 
into each other to figure out where some var was when working in REPL. I'd 
also repeatedly deal with errors when adding new components as I didn't set 
up the dependencies correctly at first... just several interlocking pieces 
that all need to be coordinated, and I sometimes forget one (or two).

Mount probably makes it a little easier to have global state, but that is 
up to the developer - I have no more global state than I had before the 
switch. I find it easier to work in REPL and get access to a var, or conn, 
etc. when I need to eval something, and I think all these components are 
primarily there to make the REPL workflow better. Also, I'm out of the 
business of managing my dependencies, which my challenges might just root 
from an absent-mindedness that I possess. Once it is in production, the 
component stuff matters very little anyhow.

All to say that these tools, assuming they provide the feature needs that 
have been outlined well in this thread, should not make anything 'not 
possible' and can have as much or as little global state as the developer 
chooses to code in. I cringe a bit when I repeatedly see that Mount 
promotes global state, I think that is a falsehood.

-Brian

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


Puzzle solving in Clojure

2016-04-08 Thread Olivier Scalbert
Hello everybody !

I just start learning Clojure and I am a complete newbie !

I have tried to solve this classical small puzzle with Clojure.
Assign one digit from {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} to each letter {o n e 
t h r l v w y} so that
one + one + one + three + three + eleven = twenty

Here is the code:

(defn permutations [s]
  (lazy-seq
   (if (seq (rest s))
 (apply concat (for [x s]
 (map #(cons x %) (permutations (remove #{x} s)
 [s])))

(defn tomap [proposal]
(zipmap [:o :n :e :t :h :r :l :v :w :y] proposal))

(defn one-value [m]
(+ (* 100 (:o m))
   (*  10 (:n m))
  (:e m)))

(defn three-value [m]
(+ (* 1 (:t m))
   (*  1000 (:h m))
   (*   100 (:r m))
   (*10 (:e m))
(:e m)))

(defn eleven-value [m]
(+ (* 10 (:e m))
   (*  1 (:l m))
   (*   1000 (:e m))
   (*100 (:v m))
   (* 10 (:e m))
 (:n m)))

(defn twenty-value [m]
(+ (* 10 (:t m))
   (*  1 (:w m))
   (*   1000 (:e m))
   (*100 (:n m))
   (* 10 (:t m))
 (:y m)))

(defn check? [proposal]
(let [m (tomap proposal)
  one (one-value m)
  three (three-value m)
  eleven (eleven-value m)
  twenty (twenty-value m)]

(= (+ one one one three three eleven)
   twenty)))

(defn print-solution [solution]
(println (tomap solution)))

(doall (map print-solution (filter check? (permutations (range 10)

This program prints the correct solution, but I have some questions !
It seems to consume lot of memory (around 6GB). Do I miss something with 
the lazy evaluation ?
How can I change the code into a more idiomatic one ?

Thanks for your help and time !

Olivier


-- 
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: Pattern matching on lists

2016-04-08 Thread Andy-
That's described here:

https://github.com/clojure/core.match/wiki/Basic-usage#sequential-types

Use: [([1] :seq)]


On Friday, April 8, 2016 at 2:37:37 PM UTC+2, Russell Wallace wrote:
>
> How do you do pattern matching on lists in Clojure? I've tried using 
> core.match but the examples all deal with vectors, and trying to specify a 
> list in the apparently obvious ways gets an error message about invalid 
> list syntax.
>

-- 
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 getting started with concurrency and parallelism in Clojure

2016-04-08 Thread Johannes Staffans
I found the introductory talk on Claypoole pretty informative with regards 
to parallelism in Clojure in general: 
https://www.youtube.com/watch?v=BzKjIk0vgzE

On Thursday, April 7, 2016 at 5:09:39 PM UTC+2, Mars0i wrote:
>
> Niels-- Ah, interesting.  My uses of pmap haven't been I/O bound.  I 
> didn't know about the claypoole library.  Will keep that in mind.
>
> On Thursday, April 7, 2016 at 8:00:39 AM UTC-5, Niels van Klaveren wrote:
>>
>> The biggest problem with pmap I have is ordering, ie. it will process in 
>> batches of (+ 2 (.. Runtime getRuntime availableProcessors)), and only 
>> take a new batch when the slowest of the old batch has been evaluated. With 
>> functions dependent on IO, parallel gains are only a fraction of what they 
>> could be. I used to solve this by creating my own code to process in 
>> futures and delays, but when I found the claypoole library, especially it's 
>> unordered pmap and for, I never had to touch these again.
>>
>> On Wednesday, April 6, 2016 at 3:11:52 PM UTC+2, Mars0i wrote:
>>>
>>> Maybe people forget about pmap 
>>> , pcalls 
>>> , and pvalues 
>>>  because they're just too 
>>> easy.
>>>
>>> On Tuesday, April 5, 2016 at 8:51:59 PM UTC-5, tbc++ wrote:

 If it all seems confusing, do not despair, there's two things that will 
 handle the vast majority of the use cases you may have: 

 1) `future` - spawns a thread that runs the body of the future (
 https://clojuredocs.org/clojure.core/future)
 2) `atom` and `swap!` - Used to store data that needs to be shared 
 between threads and updated concurrently (
 https://clojuredocs.org/clojure.core/atom) these are built on top of 
 CAS, which itself is foundation upon which most of concurrent programming 
 is built. (https://en.wikipedia.org/wiki/Compare-and-swap)

 Those two primitives alone will handle 90% of the use cases you will 
 run into as a new clojure developer. The rest of the stuff (agents, thread 
 pools, refs, vars, cps/core.async) can all come in time, but you will use 
 them much less often than threads and atoms. So read up on those two and 
 feel free to come back with any questions you may have. 

 Timothy


 On Tue, Apr 5, 2016 at 7:24 PM, Chris White  wrote:

> I was doing some reading of code recently to help me get up to speed 
> with Clojure. One of the libraries I randomly came across dealt with 
> parallelism and I had a hard time following along with it. To try and 
> wrap 
> my head around things I did a quick search and found this article:
>
>
> http://www.thattommyhall.com/2014/02/24/concurrency-and-parallelism-in-clojure/
>
> I'm not sure how authoritative this is based on my current experience, 
> but needless to say I was a bit overwhelmed. That said is there any sort 
> of 
> introductory material that list members have used to help get them into 
> how 
> Clojure deals with concurrency and parallelism? I also don't mind 
> anything 
> that's not specifically using Clojure but will at least help me 
> understand 
> the concepts behind how Clojure does it. Thanks again for any and all 
> help!
>
> - Chris White (@cwgem)
>
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient 
> with your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google 
> Groups "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to clojure+u...@googlegroups.com.
> For more options, visit https://groups.google.com/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 

Pattern matching on lists

2016-04-08 Thread Russell Wallace
How do you do pattern matching on lists in Clojure? I've tried using 
core.match but the examples all deal with vectors, and trying to specify a 
list in the apparently obvious ways gets an error message about invalid 
list syntax.

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