-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make isassigned(A, idx...) the generic way to test if A[idx...] is valid #18843
Comments
|
And it's unclear if we want to support |
Comming from Python, my expectation is that isdefined(object, index::Int) Can't a String be taken either as an object or an array (of Chars)? |
No it will not. That's not what
Please read the document text itself to see what the first signature actually means. |
I've read it again, and it's not that clear (at least to a julia newbie like me), since I don't know yet what a "composite object" is and whether or not a String can be deemed as an "Array" (based on your answer now it's clear that it can't). For closure, is there any analog method that will work for Strings, that will take care of the index "gaps" left by wider characters as illustrated in the |
You can find this in the doc
julia> ""::Array
ERROR: TypeError: typeassert: expected Array{T,N}, got String And this confusion is also why
No, but the closest we have right now is |
Thanks for the precision! Oh, I recall now of a previous test I made, which led me to believe that julia> text = "Light in 日本語 is 光"
"Light in 日本語 is 光"
julia> isdefined(text, 1)
true So |
No, See comments in #18086 for why |
I think what we need here (and in many other places) is a |
Well, on master there's no similarity between the two anymore and on 0.5 it does mention |
What is the "object" in @yuyichao 's sentence? (i) If (i), then Also, from the quote, what is the "single field that is defined" specified (or obtainable) by |
It never does and shouldn't do that.
It's consistent because it does not do anything about indexing for any index values.
And you can find out what |
We aren't going to do this. |
So
text[23]
returns a character, whileisdefined(text, 23)
returns false.(On a side note, light in Japanese (and Chinese) looks like a "JL" — of julia — under the Sun: 光).
I'm running julia-0.5.0, commit 3c9d753 (2016-09-19 18:14 UTC)
The text was updated successfully, but these errors were encountered: