Closed timholy closed 9 years ago
They are not too late; Jeff is finishing up the text over the next couple of days.
Thanks, this is helpful! I will incorporate all of this feedback.
As you discovered, yes some sections are still incomplete :)
Re predicates: supporting a single known predicate really does make all the difference!
Re predicates: supporting a single known predicate really does make all the difference!
I believe you :smile:. I just wondered if one might make that point more explicitly.
I think I incorporated changes for nearly all of this. See if you like my 2-sentence description of sequent calculus! :)
Very helpful 2 lines. Also the name is googleable, in case I or anyone else has further questions.
I know these may be too late to be useful, but I only just got around to reading chunks of the more complete document.
HEAD at 00194015efe2c17f9a0f0bc143027d5f03ee6987
trunc(y) == y
is a very indirect way of sayingy is an Int
, and that hurts you. However, this wouldn't apply toif isa(y, Int)
. It might clearer to separate out two concepts: difficulty of analysis of functions that have many branch points, and the degree to which numerical behavior is a surrogate for type.isa
function, isn't the main issue that a general predicate dispatch system allows/encourages users to write complex predicates may not be statically decidable? Given that any dynamic dispatch system allows for this already (and Julia can't always infer types as it is), I think the boundary between what Julia currently does and full predicate dispatch is somewhat fuzzy---in a sense we already have a "second level" (only use theisa
function), and that makes it hard to make a strong case against this. Presumably your best argument is that this restriction encourages users to write code for which the large majority of cases are decidable.Tuple{Int..., Real..., Int...}
against(1, 3.2, 4, 7.3, 5)
, you have to decide the point at which to stop matching Real and continue on to Int---the fact that 4 is an Int is a red herring, because the next element 7.3 requires that you stick with Real. Naively, this seems to convert the problem of intersection from being O(n) in the caller arguments to O(m*n) in the caller/declaration arguments. However, I'm guessing this algorithm bears certain similarity with Regex matching, and I have the impression that it's possible to better than the naive algorithm. So maybe it's not as bad as it seems. Hmm, it's worse than just performance: infoo(a::Int..., b::Real...)
, doesfoo(1,2,3.2)
yielda = (1,2), b = (3.2,)
ora = (1,), b = (2,3.2)
? I guess you'd have to introduce a constraint that vararg types must have empty intersection with the argument that follows.