|
4 | 4 |
|
5 | 5 | endof(s::AbstractString) = error("you must implement endof(", typeof(s), ")") |
6 | 6 | next(s::AbstractString, i::Int) = error("you must implement next(", typeof(s), ",Int)") |
7 | | -next(s::DirectIndexString, i::Int) = (s[i],i+1) |
8 | 7 | next(s::AbstractString, i::Integer) = next(s,Int(i)) |
9 | 8 |
|
10 | 9 | string() = "" |
@@ -70,8 +69,6 @@ julia> 'j' * "ulia" |
70 | 69 |
|
71 | 70 | one(::Union{T,Type{T}}) where {T<:AbstractString} = convert(T, "") |
72 | 71 |
|
73 | | -length(s::DirectIndexString) = endof(s) |
74 | | - |
75 | 72 | """ |
76 | 73 | length(s::AbstractString) |
77 | 74 |
|
@@ -198,8 +195,6 @@ isless(a::Symbol, b::Symbol) = cmp(a,b) < 0 |
198 | 195 |
|
199 | 196 | ## Generic validation functions ## |
200 | 197 |
|
201 | | -isvalid(s::DirectIndexString, i::Integer) = (start(s) <= i <= endof(s)) |
202 | | - |
203 | 198 | """ |
204 | 199 | isvalid(str::AbstractString, i::Integer) |
205 | 200 |
|
|
237 | 232 |
|
238 | 233 | ## Generic indexing functions ## |
239 | 234 |
|
240 | | -prevind(s::DirectIndexString, i::Integer) = Int(i)-1 |
241 | | -nextind(s::DirectIndexString, i::Integer) = Int(i)+1 |
242 | | - |
243 | | -function prevind(s::DirectIndexString, i::Integer, nchar::Integer) |
244 | | - nchar > 0 || throw(ArgumentError("nchar must be greater than 0")) |
245 | | - Int(i)-nchar |
246 | | -end |
247 | | - |
248 | | -function nextind(s::DirectIndexString, i::Integer, nchar::Integer) |
249 | | - nchar > 0 || throw(ArgumentError("nchar must be greater than 0")) |
250 | | - Int(i)+nchar |
251 | | -end |
252 | | - |
253 | | - |
254 | 235 | """ |
255 | 236 | prevind(str::AbstractString, i::Integer, nchar::Integer=1) |
256 | 237 |
|
@@ -371,9 +352,6 @@ checkbounds(s::AbstractString, r::AbstractRange{<:Integer}) = isempty(r) || (min |
371 | 352 | checkbounds(s::AbstractString, I::AbstractArray{<:Real}) = all(i -> checkbounds(s, i), I) |
372 | 353 | checkbounds(s::AbstractString, I::AbstractArray{<:Integer}) = all(i -> checkbounds(s, i), I) |
373 | 354 |
|
374 | | -ind2chr(s::DirectIndexString, i::Integer) = begin checkbounds(s,i); i end |
375 | | -chr2ind(s::DirectIndexString, i::Integer) = begin checkbounds(s,i); i end |
376 | | - |
377 | 355 |
|
378 | 356 | """ |
379 | 357 | ind2chr(s::AbstractString, i::Integer) |
|
0 commit comments