Map Keys are functions, why not vector elements?

2017-11-13 Thread Stephen Feyrer
Hi there, This is possibly a silly question (and may have been asked before but I couldn't find earlier examples) so here it goes. We start with a form which we're all familiar with: user=> (:this {:this "is" :the "same"}) "is" Then it's not a stretch to go to: user=> (def the 1) #'user/the u

Re: Map Keys are functions, why not vector elements?

2017-11-13 Thread Alex Miller
Regarding the title, this is incorrect. Map keys are not functions; keywords are functions that take an associative data structure and will look themselves up in it. So, the premise here is not even correct to start. Usually we prefer to work by starting from a problem and consider alternatives

Re: Map Keywords are functions, why not vector elements?

2017-11-13 Thread Stephen Feyrer
Updating subject to make it make more sense, hopefully. On 13 November 2017 at 14:15, Alex Miller wrote: > Regarding the title, this is incorrect. Map keys are not functions; > keywords are functions that take an associative data structure and will > look themselves up in it. So, the premise her

Re: [ANN] Clojure 1.9.0-RC1

2017-11-13 Thread Shantanu Kumar
The coercion (byte \a) works fine in Clojure 1.8, but it fails with `ClassCastException java.lang.Character cannot be cast to java.lang.Number` in 1.9.0-RC1. Is this by design? Shantanu On Monday, 13 November 2017 07:32:00 UTC+5:30, Alex Miller wrote: > > Hi David, > > Clojure 1.9 now depends

ANN: Deps Versions - Add badges to spot when your dependencies are out of date

2017-11-13 Thread Daniel Compton
Hi folks I’m pleased to announce Deps Versions (https://versions.deps.co/). Deps Versions is a service that shows you when your dependencies are outdated. You can add badges to your OSS Clojure/ClojureScript GitHub projects that will check if your dependencies are up to date. I hope to add suppor

Re: [ANN] Clojure 1.9.0-RC1

2017-11-13 Thread Alex Miller
Works for me in 1.9.0-RC1. I don't know of anything that changed in this area. Clojure 1.9.0-RC1 user=> (byte \a) 97 On Mon, Nov 13, 2017 at 1:09 PM, Shantanu Kumar wrote: > The coercion (byte \a) works fine in Clojure 1.8, but it fails with > `ClassCastException java.lang.Character cannot be c

Re: Map Keywords are functions, why not vector elements?

2017-11-13 Thread Alex Miller
On Monday, November 13, 2017 at 11:40:10 AM UTC-6, Stephen Feyrer wrote: > > Updating subject to make it make more sense, hopefully. > > On 13 November 2017 at 14:15, Alex Miller wrote: > >> Regarding the title, this is incorrect. Map keys are not functions; >> keywords are functions that take

Re: Map Keywords are functions, why not vector elements?

2017-11-13 Thread Didier
Yo are looking for indexOf (.indexOf vector value). (.indexOf ["a" "b"] "b") => 1 (.indexOf ["a" "b" "b"] "b") => 1 Note how indexOf searches for the index of the first value which matches value. To do what you ask, is a query over a vector, which requires a search on each element. This will t

Something that has a spec is said to be ???

2017-11-13 Thread Didier
Hey all, I'm facing a naming problem, I can't decide how I want to call something that has a spec. 1. Something that has a spec is said to be *specced.* 2. Something that has a spec is said to be *speced.* 3. Something that has a spec is said to be *specified.* I'm leaning towards

Re: Something that has a spec is said to be ???

2017-11-13 Thread Shawn Rasheed
spec'ed appears to be the term used in the guides, https://clojure.org/guides/spec Cheers On Tue, Nov 14, 2017 at 11:17 AM, Didier wrote: > Hey all, > > I'm facing a naming problem, I can't decide how I want to call something > that has a spec. > > >1. Something that has a spec is said to b

ANN: Clojurists Together - Funding critical Clojure open source projects

2017-11-13 Thread Daniel Compton
Hi folks Today we are incredibly excited to announce Clojurists Together . The goal of Clojurists Together is to support important Clojure projects, by pooling donations from companies and individuals in the Clojure community and then funding project maintainers.

[ANN] data.xml 0.2.0-alpha5

2017-11-13 Thread Herwig Hochleitner
data.xml is a Clojure contrib library that parses and emits XML. Github: https://github.com/clojure/data.xml Changelog: https://github.com/clojure/data.xml/blob/master/CHANGES.md Information on updating the dependency is here . 0.2.0-alpha5 fixes

Re: Something that has a spec is said to be ???

2017-11-13 Thread Robert Levy
Spec'd also seems to be the most conventional past tense form of spec as a verb beyond the narrow context of clojure.spec as well. http://www.dictionary.com/browse/spec-d On Mon, Nov 13, 2017 at 2:23 PM, Shawn Rasheed wrote: > spec'ed appears to be the term used in the guides, > https://clojure

Re: Map Keywords are functions, why not vector elements?

2017-11-13 Thread Stephen Feyrer
Hi Alex, Didier, Thanks for your patience. That covers everything which I can think of and a fair bit more :) I have a bit of reading and thinking to do now. Again, thank you. -- Rule of thumb simple question, complicated answer Stephen. On 13 November 2017 at 22:09, Didier wrote: > Yo ar

Re: [ANN] data.xml 0.2.0-alpha5

2017-11-13 Thread Alan Thompson
I seem to still be getting the JDK 1.9 reflection warning: ~/tupelo > grep data.xml project.clj [org.clojure/data.xml "0.2.0-alpha5"] > lein test lein test tst.tupelo._bootstrap - Clojure 1.9.0-RC1Java 9.0.1

RE: Something that has a spec is said to be ???

2017-11-13 Thread Sean Corfield
Also, is there any plan to later add a predicate for this? And if so, would it be called any of these? Like specified? I want to start and use a common vocabulary. Currently I think you’d have to use s/get-spec to determine whether something is a registered spec or not. I saw s/spec? but that o

RE: Map Keywords are functions, why not vector elements?

2017-11-13 Thread Sean Corfield
I don’t think anyone addressed your question about finding all the indices in a vector where the element matches a given search value? There are a number of ways to tackle that (given it’s going to be a linear search). Since you want the indices, you are either going to need to track them direc

Re: [ANN] Clojure 1.9.0-RC1

2017-11-13 Thread Shantanu Kumar
Sorry, I did not specify the problem completely earlier. The coercion fails only when *uncheked-math* is set to truthy in 1.9.0-RC1. user=> (byte \a) 97 user=> (set! *unchecked-math* true) ; or :warn-on-boxed true user=> (byte \a) ClassCastException java.lang.Character cannot be cast to java.la

Re: [ANN] Clojure 1.9.0-RC1

2017-11-13 Thread Andy Fingerhut
I see the same behavior in Clojure 1.7.0 and 1.8.0 as you see in 1.9.0-RC1. Andy On Mon, Nov 13, 2017 at 9:48 PM, Shantanu Kumar wrote: > Sorry, I did not specify the problem completely earlier. The coercion > fails only when *uncheked-math* is set to truthy in 1.9.0-RC1. > > user=> (byte \a) >

Re: [ANN] Clojure 1.9.0-RC1

2017-11-13 Thread Shantanu Kumar
Sorry, my bad. I can see the same behavior in previous Clojure versions too. I discovered this in the middle of moving to 1.9.0-RC1 in one of the projects and somehow got it all mixed up. Shantanu On Tuesday, 14 November 2017 11:36:30 UTC+5:30, Andy Fingerhut wrote: > > I see the same behavior

RE: Something that has a spec is said to be ???

2017-11-13 Thread James
Great question! The word spec is an informal abbreviation of the word specification. We have a word in English for something that has a specification and that is specified (the C is soft as in species). I have a small library that asserts a namespace is well specified, so I know of at least on