Re: Clojure spec keys is considering all key within namespace although it is not defined
:opt specs serve a) as documentation for the spec and b) when using s/keys as a generator. On Wednesday, June 28, 2017 at 2:25:50 PM UTC-5, Dan Burton wrote: > > This design is surprising to me. If this is the case, then I don't > understand the point of `:opt` for s/keys. > > -- Dan Burton > > On Wed, Jun 28, 2017 at 2:17 AM, Max Penetwrote: > >> Hi, >> >> It's by design, as the doc of s/keys states: >> >> In addition, the values of *all* namespace-qualified keys will be validated >> (and possibly destructured) by any registered specs. Note: there is >> no support for inline value specification, by design. >> >> >> >> So if the ns'ed key in your map is registered as a spec it will be >> validated. In theory you could just validate with (s/keys) in your case, >> specifying keys in req is useful to check presence and gen and in the case >> of opt just for gen. The docstring is terse but dense in meaning/information. >> >> >> On Wednesday, June 28, 2017 at 11:04:34 AM UTC+2, Mamun wrote: >>> >>> Hi All, >>> >>> Clojure spec keys is considering all key within namespace although it is >>> not defined. >>> >>> Here is an example >>> >>> (s/def :person/fname string?) >>> (s/def :person/lname string?) >>> (s/def :person/id int?) >>> >>> ;;With only fname and lname >>> (s/def :app/person (s/keys :req [:person/fname :person/lname])) >>> >>> ;;Success >>> (s/explain-str :app/person >>>{:person/lname "Abdullah" >>> :person/fname "Mamun"} ) >>> >>> ;;Success >>> (s/explain-str :app/person >>>{:person/lname "Abdullah" >>> :person/fname "Mamun" >>> :id "123"} ) >>> >>> ;;fail with namespace id >>> (s/explain-str :app/person >>>{:person/lname "Abdullah" >>> :person/fname "Mamun" >>> :person/id "1234"}) >>> >>> >>> Is it bug or am I doing something wrong here? >>> >>> Br, >>> Mamun >>> >> -- >> 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: Clojure spec keys is considering all key within namespace although it is not defined
This design is surprising to me. If this is the case, then I don't understand the point of `:opt` for s/keys. -- Dan Burton On Wed, Jun 28, 2017 at 2:17 AM, Max Penetwrote: > Hi, > > It's by design, as the doc of s/keys states: > > In addition, the values of *all* namespace-qualified keys will be validated > (and possibly destructured) by any registered specs. Note: there is > no support for inline value specification, by design. > > > > So if the ns'ed key in your map is registered as a spec it will be validated. > In theory you could just validate with (s/keys) in your case, specifying keys > in req is useful to check presence and gen and in the case of opt just for > gen. The docstring is terse but dense in meaning/information. > > > On Wednesday, June 28, 2017 at 11:04:34 AM UTC+2, Mamun wrote: >> >> Hi All, >> >> Clojure spec keys is considering all key within namespace although it is >> not defined. >> >> Here is an example >> >> (s/def :person/fname string?) >> (s/def :person/lname string?) >> (s/def :person/id int?) >> >> ;;With only fname and lname >> (s/def :app/person (s/keys :req [:person/fname :person/lname])) >> >> ;;Success >> (s/explain-str :app/person >>{:person/lname "Abdullah" >> :person/fname "Mamun"} ) >> >> ;;Success >> (s/explain-str :app/person >>{:person/lname "Abdullah" >> :person/fname "Mamun" >> :id "123"} ) >> >> ;;fail with namespace id >> (s/explain-str :app/person >>{:person/lname "Abdullah" >> :person/fname "Mamun" >> :person/id "1234"}) >> >> >> Is it bug or am I doing something wrong here? >> >> Br, >> Mamun >> > -- > 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: Clojure android activity?
My impression is that if you want to write Clojure on Android in 2017 you use React Native and write ClojureScript. Re-natal is a good starting point On Fri, Jun 23, 2017, 3:57 PM Mike Meyerwrote: > Is there still any activity in the clojure-android space? The > clojure-android mail list is largely inactive, seems like the developers of > lein-droid haven't done anything in months (1.7.0-r4 is still used in the > templates), and the numerous references If ind for an android-clojure web > site are all dead. > > That said, things do seem to mostly work for stock android. But accessing > API's for android wear seems problematical (see > https://github.com/clojure-android/lein-droid/issues/162 for my bug > report). > > -- > 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.
[ANN] debux(Clojure/ClojureScript debugging library) 0.3.1 is out.
I'm pleased to announce debux version 0.3.1. # Debux is a library for debugging Clojure and ClojureScript. # The new added feature is to show you every evaluated results of a form. https://github.com/philoskim/debux https://clojars.org/philoskim/debux -- 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.
[ANN] debux(Clojure/ClojureScript debugging library) 0.3.1 is out.
I'm pleased to announce debux version 0.3.0. # Debux is a library for debugging Clojure and ClojureScript. # The new added feature is to show you every evaluated results of a form. https://github.com/philoskim/debux https://clojars.org/philoskim/debux -- 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.
[ANN] debux(Clojure/ClojureScript debugging library) 0.3.0 is out.
I'm pleased to announce debux version 0.3.0. # Debux is a library for debugging Clojure and ClojureScript. # The new added feature is to show you every evaluated results of a form. https://github.com/philoskim/debux https://clojars.org/philoskim/debux -- 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.
[ANN] debux 0.3.0 is out.
I'm pleased to announce debux version 0.3.0. # Debux is a library for debugging Clojure and ClojureScript. # The new added feature is to show you every evaluated results of a form. https://github.com/philoskim/debux https://clojars.org/philoskim/debux -- 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 spec keys is considering all key within namespace although it is not defined
Hi, It's by design, as the doc of s/keys states: In addition, the values of *all* namespace-qualified keys will be validated (and possibly destructured) by any registered specs. Note: there is no support for inline value specification, by design. So if the ns'ed key in your map is registered as a spec it will be validated. In theory you could just validate with (s/keys) in your case, specifying keys in req is useful to check presence and gen and in the case of opt just for gen. The docstring is terse but dense in meaning/information. On Wednesday, June 28, 2017 at 11:04:34 AM UTC+2, Mamun wrote: > > Hi All, > > Clojure spec keys is considering all key within namespace although it is > not defined. > > Here is an example > > (s/def :person/fname string?) > (s/def :person/lname string?) > (s/def :person/id int?) > > ;;With only fname and lname > (s/def :app/person (s/keys :req [:person/fname :person/lname])) > > ;;Success > (s/explain-str :app/person >{:person/lname "Abdullah" > :person/fname "Mamun"} ) > > ;;Success > (s/explain-str :app/person >{:person/lname "Abdullah" > :person/fname "Mamun" > :id "123"} ) > > ;;fail with namespace id > (s/explain-str :app/person >{:person/lname "Abdullah" > :person/fname "Mamun" > :person/id "1234"}) > > > Is it bug or am I doing something wrong here? > > Br, > Mamun > -- 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 spec keys is considering all key within namespace although it is not defined
Hi All, Clojure spec keys is considering all key within namespace although it is not defined. Here is an example (s/def :person/fname string?) (s/def :person/lname string?) (s/def :person/id int?) ;;With only fname and lname (s/def :app/person (s/keys :req [:person/fname :person/lname])) ;;Success (s/explain-str :app/person {:person/lname "Abdullah" :person/fname "Mamun"} ) ;;Success (s/explain-str :app/person {:person/lname "Abdullah" :person/fname "Mamun" :id "123"} ) ;;fail with namespace id (s/explain-str :app/person {:person/lname "Abdullah" :person/fname "Mamun" :person/id "1234"}) Is it bug or am I doing something wrong here? Br, Mamun -- 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.