latest Clojure release is 1.10.0-beta5 btw (yes, that’s confusing)
there have been some mild changes in the error reporting in latest
you can actually simplify that arg check to (<= start end (count s)) I think
gist updated to beta5: https://gist.github.com/borkdude/445868b6941e7c55adb27d616e052587
yes, thanks
what do y’all think of the spec message changes in 1.10?
is there a list of improvements? I’d have to change to 1.9.0 and run this example again 🙂
I think the errors in 1.10 are clearer in this gist. there may be much more I’m not aware of.
there’s a summary in the changelogs https://github.com/clojure/clojure/blob/master/changes.md https://github.com/clojure/spec.alpha/blob/master/CHANGES.md
@alexmiller with the changes you’ve done now, it’s really hard to complain about the error messages.
I think you should run it with 1.9 and compare
the improvement is vast imo
Which really sucks, cause now we’re gonna have to find something else to complain about.
I guess we still have startup time. And the thing with clojure.set 😛
the gist has 1.10 and 1.9 now
But seriously. The improvements are huge!
there are known things to work on
but I think we really made a lot of progress, in a very satisfyingly methodical way
in that we spent a lot of time thinking about it and coming up with guidelines that we can keep returning to
Exactly.
And, even though I haven’t read the diffs carefully, it seems like most of the work has been done in the hammock, not at the keyboard.
Which can be annoying, since the changes seem both easy and small.
that is the work :)
Yeah, but that work is not visible. Unfortunatly
I used to work at a place where we had to estimate each bug fix before it was ready for work.
Most of the time the estimation took weeks, but the fix took five minutes.
@alexmiller there were a few things that we need some answers on spec-wise. I know you’re a busy man, but when you have the time, we’d be happy to have your feedback
well, you weren’t estimating - you were fixing :)
I know. But the business side didn’t quite understand that.
just fyi, I am focusing right now on some big changes in the next version of spec, which is happening at https://github.com/clojure/spec-alpha2
and speculative will be a great set of tests to check things with
@alexmiller great, I’ll wait some more before asking you again 🙂
@alexmiller you just made me very happy!
the current state there actually does contain a non-macro entry point to making specs
although it is very difficult to see without some direction
that will be coming, but have some more things to do first before I am ready to write the explainers
should be api-compatible right now (although surely I broke something here or there)
just give us a word if there’s anything we can do to help.
well, testing speculative with this lib would be super helpful
you should be able to change the dep (will need a git dep) and your require to the new ns
would it make sense to test now? I can make a branch after dinner
fwiw, the questions I was talking about: https://github.com/slipset/speculative/issues/46#issuecomment-435568645
you can test now if you like. there will be some more changes (breaking up some stuff into multiple namespaces) but the api should at this point be stable and I expect every commit to be self-consistent and have tests passing
feel free to @ me on issues in the future too, I’ll get the notifications
looks like I missed that one somehow
@alexmiller wouldn’t we need a deps.edn in clojure.spec.alpha-2 to depend on it via a sha?
hmm, no
@slipset you can do a :local/root
dependency
oh, like just downloading the lib?
yeah
but I’m not sure if that overrides the spec that comes along with clojure 1.10
well, it’s different namespaces, so that doesn’t matter
I’ll also give it a try now
🙂
You can also use it as a git lib, FWIW
$ clj -Sdeps '{:deps {clojure/spec-alpha2 {:git/url "<https://github.com/clojure/spec-alpha2>" :sha "639767ebe1491536ec7404d8b478628ecfe9200b"}}}'
Cloning: <https://github.com/clojure/spec-alpha2>
Checking out: <https://github.com/clojure/spec-alpha2> at 639767ebe1491536ec7404d8b478628ecfe9200b
Clojure 1.10.0-beta5
user=> (require 'clojure.spec-alpha2)
nil
user=> (dir clojure.spec-alpha2)
&
*
*coll-check-limit*
...
For some reason I was unable to get that working.
probably PEBCAK
@slipset can you try again and if it works, push that to the branch?
yeps
meanwhile I’m fixing some macros
@borkdude pushed
I’ve also pushed
I won 🙂
we both won
with branch spec-alpha2
:
$ clj -A:test
Cloning: <https://github.com/clojure/spec-alpha2>
Checking out: <https://github.com/clojure/spec-alpha2> at 639767ebe1491536ec7404d8b478628ecfe9200b
Clojure 1.10.0-beta5
user=> (require '[clojure.spec-alpha2.test :as stest])
nil
user=> (require '[speculative.core.extra])
nil
user=> (doall (stest/check `=))
Execution error (IllegalArgumentException) at clojure.spec_alpha2$spec_STAR_/invokeStatic (spec_alpha2.clj:389).
Symbol must be namespace-qualified
user=>
is there a way to exclude the normal spec dep to ensure it never get loaded?
the line number is probably off because of the in-ns
at line 18. 389 + 18 = 407:
https://github.com/clojure/spec-alpha2/blob/master/src/main/clojure/clojure/spec_alpha2/test.clj#L407
https://github.com/clojure/tools.deps.alpha/blob/master/deps.edn#L18
That seriously broke things 🙂
committing and pushing
604d6861e80c3a1377e78f09db6cf185a950837c is pushed
thanks
I think clojure itself still is requiring clojure.spec.alpha
because of the macro checking. so we have to test with it
cool
I’ll revert it
then just revert that commit
🙂
@alexmiller repro:
$ clj -Srepro -Sdeps '{:deps {clojure/spec-alpha2 {:git/url "<https://github.com/clojure/spec-alpha2>" :sha "639767ebe1491536ec7404d8b478628ecfe9200b"}}}'
Clojure 1.9.0
user=> (require '[clojure.spec-alpha2.test :as stest])
nil
user=> (require '[clojure.spec-alpha2 :as s])
nil
user=> (defn foo [x] true)
#'user/foo
user=> (s/fdef foo :args (s/cat :x int?))
user/foo
user=> (stest/check `foo)
IllegalArgumentException Symbol must be namespace-qualified clojure.lang.Var.find (Var.java:140)
(user=> (stest/check 'user/foo)
IllegalArgumentException Symbol must be namespace-qualified clojure.lang.Var.find (Var.java:140)
when I comment out stuff that uses stest/check
it kind of works:
$ clojure -A:test:clj-tests
Ran 27 tests containing 104 assertions.
0 failures, 0 errors.
is check not working? (wouldn’t surprise me if some gens were messed up)
oh, sorry read back farther
that’s weird, will check on it
Fixed another bunch of tests. The only part not working is around check
(normally we have 120 assertions now in master):
Ran 30 tests containing 116 assertions.
0 failures, 0 errors.
@slipset please don’t merge this branch, it’s hackity hack 🙂
I think it needs to be on a separate ranch for the time being. Nobody’s using alpha-2 yet?
yeah, think so
oh yeah, I would definitely not rely on it yet
@alexmiller about set/union
: https://github.com/slipset/speculative/issues/46#issuecomment-438756807
I think in #clojure-dev you recently told @slipset that not expecting a set is “broken”, but set/union
should be able to accept something not set-like. set-coercible?
(something that can be turned into a set
) would probably describe the args for set operations then.
I think I said not expecting a set return value is broken
yes, sorry, that’s what I meant
here union
is called with two key-seqs: https://github.com/clojure/clojure/blob/9baebd091b1301aecaaac3b5f9c7ede5dcc58f8c/src/clj/clojure/data.clj#L118
it’s never going to return a set, although the result can be coerced to set.
I haven’t looked at it enough to say something good for inputs, and it may not be the same answer on every fn
well, I would start from the assumption that existing code that works shouldn’t violate the spec
ok yes. and when clojure gets coercion of arguments to sets one day, we can rely on the result to be a set
so I’ll go back and just say - I don’t know as I have not worked on it :)
ok 🙂
in the list of things that are important to me, this is really far down the list :)
we’ll figure it out 😉
you can always submit a PR when you strongly disagree 👍
I’ll just file a jira with a patch
😉
As long as you’ve signed the CA ;)
As long as you’ve signed our CA 😉
lol
I find your open source project hostile
actively?
quite
I will now go write a multi-page rant on Medium
“Fuck speculative. There, I said it.“ 😉
too soon
Hah
Rich devs write their code in $peculative
spec-alpha2 branch is building again for all platforms: https://circleci.com/gh/slipset/speculative/tree/spec-alpha2
(stest/check tests still excluded)