Re: Lym - written by clojurescript and react native is on apple store

2016-09-13 Thread Tienson Qin
Just release that, 
https://github.com/tiensonqin/lymchat

On Monday, August 29, 2016 at 6:28:56 AM UTC+8, Gary Schiltz wrote:
>
> Thanks for making this free! Any chance you are going to release the 
> source?
>
> On Sunday, August 28, 2016 at 3:28:57 AM UTC-5, Tienson Qin wrote:
>>
>> Hi everyone, happy to announce Lym  is on apple 
>> store now! 
>> It's group chat app for learning different cultures, languages, also 
>> support 1-on-1 video chat.
>>
>> Libraries used:
>> [[org.clojure/clojure "1.8.0"]
>>  [org.clojure/clojurescript "1.9.36"]
>>  [org.clojure/core.async "0.2.385"]
>>  [com.taoensso/sente "1.10.0-SNAPSHOT"]
>>  [com.taoensso/encore  "2.64.1"]
>>  [org.clojure/tools.reader "0.10.0"]
>>  [com.taoensso/timbre  "4.6.0"]
>>  [reagent "0.6.0-SNAPSHOT" :exclusions [cljsjs/react 
>> cljsjs/react-dom cljsjs/react-dom-server]]
>>  [re-frame "0.7.0"]
>>  [prismatic/schema "1.0.4"]
>>  [com.andrewmcveigh/cljs-time "0.4.0"]]
>>
>> Thanks for the community, especially David Nolen, Mike Fikes, and 
>> decker405.
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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.


alpha11 clojure.spec validation for fdef

2016-09-13 Thread Alex Miller
instrument only checks the :args spec of the function. The higher order 
function is in the :ret spec so isn't checked.

You can use the check function to generate tests that verify the :ret and :fn 
specs.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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.


alpha11 clojure.spec validation for fdef

2016-09-13 Thread Frank Moyer


I am trying to write a higher order function in clojure.spec 
 with version 1.9.0-alpha12 and have not 
been able to get the validation to execute against the returned function.

Using the example in the *Higher order functions* section of the 
clojure.spec guide, I define an adder form as:


(defn adder [x] #(+ x %))


As described in the guide, I create a spec as:


(s/fdef adder
  :args (s/cat :x number?)
  :ret (s/fspec :args (s/cat :y number?)
:ret number?)
  :fn #(= (-> % :args :x) ((:ret %) 0)))


When I execute it in the repl, an exception is thrown instead of the 
desired spec validation error:


user> (def add2 (adder 2))
#'user/add2
user> (add2 2)
4
user> (add2 "s")
ClassCastException java.lang.String cannot be cast to java.lang.Number  
clojure.lang.Numbers.add (Numbers.java:128) 

  
user> 


I attempted to turn spec'ing on with (stest/instrument `adder). While this 
works for functions, it is not working for *Higher order functions*.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: get function

2016-09-13 Thread Sean Corfield
On 9/13/16, 5:02 AM, "Erik Assum"  wrote:
> you’ll see that `get` accepts an additional argument, the default value, 
> which e.g. the keyword does not.

Just FYI, both the keyword first form and the map first form do accept an 
additional default argument:


boot.user> (:b {:a 1 :b 2} 3)
2
boot.user> (:b {:a 1 :c 3} 2)
2
boot.user> ({:a 1 :b 2} :b 3)
2
boot.user> ({:a 1 :c 3} :b 2)
2
boot.user>

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood



-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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 with 1.9.0-alpha12

2016-09-13 Thread Steve Miner
Filed LOGIC-180 bug with patch.

http://dev.clojure.org/jira/browse/LOGIC-180 


-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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 with 1.9.0-alpha12

2016-09-13 Thread miner
 

It looks like the problem is with the macro -inc.  It should quote the 
internal fn name so that it stays an unqualified symbol during macro 
expansion.  I need to test this a bit as I’m not familiar with this code. 
 I’ll make a patch soon if David doesn’t fix it first.


By the way, spec pointed me to the right place, but I didn’t see the 
problem at first.  Maybe the spec needs to be improved here to test the 
internal name.  I’ll have to look at that later.


If you just want to get going, here the quick fix...


diff --git a/src/main/clojure/clojure/core/logic.clj 
b/src/main/clojure/clojure/core/logic.clj

index 3e98397..2dcb818 100644

--- a/src/main/clojure/clojure/core/logic.clj

+++ b/src/main/clojure/clojure/core/logic.clj

@@ -1075,7 +1075,7 @@

  `(mplus ~e (fn [] (mplus* ~@e-rest)

 

 (defmacro -inc [& rest]

-  `(fn -inc [] ~@rest))

+  `(fn ~'-inc [] ~@rest))

 

On Tuesday, September 13, 2016 at 3:45:18 AM UTC-4, Burt wrote:
>
> Hi,
>
> with "1.9.0-alpha10" and core.logic "0.8.10":
>
> (ns lwb.nd.rules
>   (:refer-clojure :exclude [==])
>   (:require [clojure.core.logic :refer :all]))
> => nil
>
> with "1.9.0-alpha12" and core.logic "0.8.10":
>
> (ns lwb.nd.rules
>   (:refer-clojure :exclude [==])
>   (:require [clojure.core.logic :refer :all]))
> CompilerException clojure.lang.ExceptionInfo: Call to clojure.core/fn did 
> not conform to spec:
> In: [0] val: clojure.core.logic/-inc fails spec: 
> :clojure.core.specs/arg-list at: [:args :bs :arity-1 :args] predicate: 
> vector?
> In: [0] val: clojure.core.logic/-inc fails spec: 
> :clojure.core.specs/args+body at: [:args :bs :arity-n] predicate: (cat 
> :args :clojure.core.specs/arg-list :prepost (? map?) :body (* any?))
> :clojure.spec/args  (clojure.core.logic/-inc [] (bind (this) g))
>  #:clojure.spec{:problems ({:path [:args :bs :arity-1 :args], :pred 
> vector?, :val clojure.core.logic/-inc, :via [:clojure.core.specs/args+body 
> :clojure.core.specs/arg-list :clojure.core.specs/arg-list], :in [0]} {:path 
> [:args :bs :arity-n], :pred (cat :args :clojure.core.specs/arg-list 
> :prepost (? map?) :body (* any?)), :val clojure.core.logic/-inc, :via 
> [:clojure.core.specs/args+body :clojure.core.specs/args+body], :in [0]}), 
> :args (clojure.core.logic/-inc [] (bind (this) g))}, 
> compiling:(clojure/core/logic.clj:1130:5) 
>
> Is there already a fix for this?
>
> Kind regards,
> Burt
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: get function

2016-09-13 Thread Stuart Sierra
The `get` function will accept `nil` as the map argument and return `nil`, 
but invoking `nil` will throw a NullPointerException.

By convention, people use `get` when they don't know what the map argument 
is, since it might be nil. And we use keywords as functions when they are 
literals, like (:foo m).

(let [m (...something that might return a map or nil...)]
  (get m "some key"))  ; returns nil or value

(let [m (...something that might return a map or nil...)]
  (m "some key"))  ; might throw exception

All forms of map lookup support a default argument if the key is not found:

user=> (let [m {:a 1 :b 2}] (m :c "not found"))
"not found"
user=> (let [m {:a 1 :b 2}] (:c m "not found"))
"not found"
user=> (let [m {:a 1 :b 2}] (get m :c "not found"))
"not found"

–S


On Tuesday, September 13, 2016 at 7:58:14 AM UTC-4, Rickesh Bedia wrote:
>
> Hi everyone,
>
> I am new to Clojure and have been playing around with it for a little 
> while. I have seen that (get [3 2 1] 0) and ([[3 2 1] 0) both return the 
> value 3. Similarly (get {:a 0 :b 1} :b) and ({:a 0 :b 1} :b) return 1.
>
> I was wondering if anyone could explain why the get function is useful or 
> maybe an example?
>
> Apologies in advance if this question is due to ignorance and I haven't 
> reached the level where this function is used.
>
> Thanks in advance
>

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


Re: core.logic with 1.9.0-alpha12

2016-09-13 Thread David Nolen
Oops don't think so. If you have a patch, that would be welcome.

David

On Tue, Sep 13, 2016 at 3:45 AM, 'Burt' via Clojure <
clojure@googlegroups.com> wrote:

> Hi,
>
> with "1.9.0-alpha10" and core.logic "0.8.10":
>
> (ns lwb.nd.rules
>   (:refer-clojure :exclude [==])
>   (:require [clojure.core.logic :refer :all]))
> => nil
>
> with "1.9.0-alpha12" and core.logic "0.8.10":
>
> (ns lwb.nd.rules
>   (:refer-clojure :exclude [==])
>   (:require [clojure.core.logic :refer :all]))
> CompilerException clojure.lang.ExceptionInfo: Call to clojure.core/fn did
> not conform to spec:
> In: [0] val: clojure.core.logic/-inc fails spec:
> :clojure.core.specs/arg-list at: [:args :bs :arity-1 :args] predicate:
> vector?
> In: [0] val: clojure.core.logic/-inc fails spec:
> :clojure.core.specs/args+body at: [:args :bs :arity-n] predicate: (cat
> :args :clojure.core.specs/arg-list :prepost (? map?) :body (* any?))
> :clojure.spec/args  (clojure.core.logic/-inc [] (bind (this) g))
>  #:clojure.spec{:problems ({:path [:args :bs :arity-1 :args], :pred
> vector?, :val clojure.core.logic/-inc, :via [:clojure.core.specs/args+body
> :clojure.core.specs/arg-list :clojure.core.specs/arg-list], :in [0]} {:path
> [:args :bs :arity-n], :pred (cat :args :clojure.core.specs/arg-list
> :prepost (? map?) :body (* any?)), :val clojure.core.logic/-inc, :via
> [:clojure.core.specs/args+body :clojure.core.specs/args+body], :in [0]}),
> :args (clojure.core.logic/-inc [] (bind (this) g))},
> compiling:(clojure/core/logic.clj:1130:5)
>
> Is there already a fix for this?
>
> Kind regards,
> Burt
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from 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.


Re: get function

2016-09-13 Thread Erik Assum
From 
https://clojuredocs.org/clojure.core/get

you’ll see that `get` accepts an additional argument, the default value, which 
e.g. the keyword does not.

As for getting stuff out of maps, the idiomatic way is
(def m {:a 1 :b 2})
(:b m)
;; => 2

There is otherwise a nice discussion about the finer points of this here:
http://stackoverflow.com/questions/7034803/idiomatic-clojure-map-lookup-by-keyword

Erik.

> On 13 Sep 2016, at 11:49, 'Rickesh Bedia' via Clojure 
>  wrote:
> 
> Hi everyone,
> 
> I am new to Clojure and have been playing around with it for a little while. 
> I have seen that (get [3 2 1] 0) and ([[3 2 1] 0) both return the value 3. 
> Similarly (get {:a 0 :b 1} :b) and ({:a 0 :b 1} :b) return 1.
> 
> I was wondering if anyone could explain why the get function is useful or 
> maybe an example?
> 
> Apologies in advance if this question is due to ignorance and I haven't 
> reached the level where this function is used.
> 
> Thanks in advance

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


Functional Programming Jobs across the globe! www.functionalworks.com

2016-09-13 Thread alex

Check out our new platform (built in Clojure/Clojurescript), the one stop 
shop for Functional Programming roles across the globe. Check it out .. 
 www.functionalworks.com 

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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.


get function

2016-09-13 Thread 'Rickesh Bedia' via Clojure
Hi everyone,

I am new to Clojure and have been playing around with it for a little 
while. I have seen that (get [3 2 1] 0) and ([[3 2 1] 0) both return the 
value 3. Similarly (get {:a 0 :b 1} :b) and ({:a 0 :b 1} :b) return 1.

I was wondering if anyone could explain why the get function is useful or 
maybe an example?

Apologies in advance if this question is due to ignorance and I haven't 
reached the level where this function is used.

Thanks in advance

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


core.logic with 1.9.0-alpha12

2016-09-13 Thread 'Burt' via Clojure
Hi,

with "1.9.0-alpha10" and core.logic "0.8.10":

(ns lwb.nd.rules
  (:refer-clojure :exclude [==])
  (:require [clojure.core.logic :refer :all]))
=> nil

with "1.9.0-alpha12" and core.logic "0.8.10":

(ns lwb.nd.rules
  (:refer-clojure :exclude [==])
  (:require [clojure.core.logic :refer :all]))
CompilerException clojure.lang.ExceptionInfo: Call to clojure.core/fn did 
not conform to spec:
In: [0] val: clojure.core.logic/-inc fails spec: 
:clojure.core.specs/arg-list at: [:args :bs :arity-1 :args] predicate: 
vector?
In: [0] val: clojure.core.logic/-inc fails spec: 
:clojure.core.specs/args+body at: [:args :bs :arity-n] predicate: (cat 
:args :clojure.core.specs/arg-list :prepost (? map?) :body (* any?))
:clojure.spec/args  (clojure.core.logic/-inc [] (bind (this) g))
 #:clojure.spec{:problems ({:path [:args :bs :arity-1 :args], :pred 
vector?, :val clojure.core.logic/-inc, :via [:clojure.core.specs/args+body 
:clojure.core.specs/arg-list :clojure.core.specs/arg-list], :in [0]} {:path 
[:args :bs :arity-n], :pred (cat :args :clojure.core.specs/arg-list 
:prepost (? map?) :body (* any?)), :val clojure.core.logic/-inc, :via 
[:clojure.core.specs/args+body :clojure.core.specs/args+body], :in [0]}), 
:args (clojure.core.logic/-inc [] (bind (this) g))}, 
compiling:(clojure/core/logic.clj:1130:5) 

Is there already a fix for this?

Kind regards,
Burt

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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.


[JOB] Full Stack Clojure Engineers at Juji

2016-09-13 Thread Huahai Yang
Juji, Inc. is an early stage startup located in the silicon valley. We work 
in the area of artificial intelligence, and our platform in alpha release 
has generated great customer interests, hence we are hiring full stack 
engineers in both senior and entry level to build out the platform to meet 
customer demands. We are a Clojure shop, using Clojure for all back-end 
services and Clojurescript for front-end. Details of the positions can be 
found at https://juji.io/fullstack

Regards,

-huahai   

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Read the code of clj_http ,then I have one questions,#' that mean ?

2016-09-13 Thread 章亮
I read http://clojure.org/reference/reader and 
 
https://yobriefca.se/blog/2014/05/19/the-weird-and-wonderful-characters-of-clojure/
thank you 
#' - Var macro

#' is the var quote. It is the same a the var method,

user=> (def nine 9)#'user/nineuser=> nine9user=> (var nine)#'user/nineuser=> 
#'nine#'user/nine

When used it will attempt to return the referenced var. This is useful when 
you want to talk about the reference/declaration instead of the value it 
represents. See the use of meta in the metadata (^) discussion.


在 2016年9月13日星期二 UTC+8上午10:13:50,章亮写道:
>
> Hi
>Recently Read the code of clj_http, then I have one questions.
>   In the clj_http/client.clj 
> (def ^:dynamic request
>   (wrap-request #'core/request))
> #‘ is very strange.I don't understand #'  that mean after I searched some 
> the books of clojure.
> And I test for eample :
> (defn test1 [x]
>(+ x 2))
> (defn test2 [client]
>(client 3))
> (defn test3 []
>(test2 #'test1))
> (defn test4 []
>(test2 test1))
> exec  test3  test4   the result is same,so I think I need help!
>

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