-
Notifications
You must be signed in to change notification settings - Fork 21
Dearth of find
methods
#62
Comments
I'd say that's indeed a much broader issue than regarding As you say, it could make sense to get some language support so that Maybe we should open an issue to discuss this in Julia Base? The trend is to use |
I've just realized that an option to avoid special-casing |
I think it's very unlikely that Julia will ever allow any form of automatic conversion to Bool. |
@johnmyleswhite I do as well, but it's kind of unfortunate that one has to include an entire copy of a function's code just to tweak the conditionals and nothing else. This especially since Julia's multiple dispatch is otherwise so good for extending methods. |
You're probably right. It would be good to discuss this anyway. |
I've filed JuliaLang/julia#13207, please comment if my description is not accurate. |
Thanks, Milan. I do have something to add, which I'll do shortly. |
Currently the only method for
find
that specializes onNullableArray
arguments isfind(X::NullableArray{Bool})
. Users will probably want to be able to do things likefind(x->x==Nullable(1), X)
, but this currently errors:In general, the fact that comparisons of
Nullable
s returnNullable{Bool}
s is the root cause of a lot of unnecessary code reuse. For now I'll just write moreNullableArray
specific methods, but I wonder if there's any chance of getting a more institutional fix for this issue, e.g. language-wide defined behavior forif Nullable{Bool} ...
.The text was updated successfully, but these errors were encountered: