@@ -2090,14 +2090,16 @@ slot(
2090
2090
2091
2091
"""
2092
2092
Base.getindex(
2093
- layout::Record{FIELDS,CONTENTS} ,
2094
- f::Symbol,
2095
- ) where {FIELDS,CONTENTS<:Base.Tuple{Vararg{Content}}}
2093
+ layout::AwkwardArray. Record,
2094
+ f::Symbol,
2095
+ )
2096
2096
"""
2097
2097
Base. getindex (
2098
- layout:: Record{FIELDS,CONTENTS} ,
2099
- f:: Symbol ,
2100
- ) where {FIELDS,CONTENTS<: Base.Tuple{Vararg{Content}} } = layout. array. contents[f][layout. at]
2098
+ layout:: AwkwardArray.Record ,
2099
+ f:: Symbol ,
2100
+ ) = getfield (layout, :array ). contents[f][getfield (layout, :at )]
2101
+
2102
+ Base. getproperty (layout:: Record , f:: Symbol ) = layout[f]
2101
2103
2102
2104
"""
2103
2105
Base.:(==)(
@@ -2388,15 +2390,16 @@ end
2388
2390
2389
2391
"""
2390
2392
Base.getindex(
2391
- layout::SlotRecord{CONTENTS} ,
2393
+ layout::SlotRecord,
2392
2394
f::Int64,
2393
- ) where {CONTENTS<:Base.Tuple{Vararg{Content}}}
2395
+ )
2394
2396
"""
2395
2397
Base. getindex (
2396
- layout:: SlotRecord{CONTENTS} ,
2398
+ layout:: SlotRecord ,
2397
2399
f:: Int64 ,
2398
- ) where {CONTENTS<: Base.Tuple{Vararg{Content}} } =
2399
- layout. array. contents[f][layout. at]
2400
+ ) = getfield (layout, :array ). contents[f][getfield (layout, :at )]
2401
+
2402
+ Base. getproperty (layout:: SlotRecord , f:: Symbol ) = layout[f]
2400
2403
2401
2404
"""
2402
2405
Base.:(==)(
@@ -2445,7 +2448,7 @@ function Base.:(==)(
2445
2448
CONTENTS1<: Base.Tuple{Vararg{Content,N}} ,
2446
2449
CONTENTS2<: Base.Tuple{Vararg{Content,N}} ,
2447
2450
}
2448
- for i in eachindex (layout1. array. contents) # same number of indexes by type constraint
2451
+ for i in eachindex (getfield ( layout1, : array) . contents) # same number of indexes by type constraint
2449
2452
if layout1[i] != layout2[i] # compare tuple items
2450
2453
return false
2451
2454
end
@@ -4002,8 +4005,8 @@ Base.getindex(layout::UnionArray, f::Symbol) =
4002
4005
function Base. push! (special:: Specialization , input)
4003
4006
tmp = length (special. tagged)
4004
4007
push! (special. tagged, input)
4005
- push! (special. array. tags, special. tag - firstindex (special. array. contents))
4006
- push! (special. array. index, tmp)
4008
+ push! (getfield ( special, : array) . tags, special. tag - firstindex (getfield ( special, : array) . contents))
4009
+ push! (getfield ( special, : array) . index, tmp)
4007
4010
special
4008
4011
end
4009
4012
@@ -4023,8 +4026,8 @@ end
4023
4026
function end_list! (special:: Specialization )
4024
4027
tmp = length (special. tagged)
4025
4028
end_list! (special. tagged)
4026
- push! (special. array. tags, special. tag - firstindex (special. array. contents))
4027
- push! (special. array. index, tmp)
4029
+ push! (getfield ( special, : array) . tags, special. tag - firstindex (getfield ( special, : array) . contents))
4030
+ push! (getfield ( special, : array) . index, tmp)
4028
4031
special
4029
4032
end
4030
4033
@@ -4034,8 +4037,8 @@ end
4034
4037
function end_record! (special:: Specialization )
4035
4038
tmp = length (special. tagged)
4036
4039
end_record! (special. tagged)
4037
- push! (special. array. tags, special. tag - firstindex (special. array. contents))
4038
- push! (special. array. index, tmp)
4040
+ push! (getfield ( special, : array) . tags, special. tag - firstindex (getfield ( special, : array) . contents))
4041
+ push! (getfield ( special, : array) . index, tmp)
4039
4042
special
4040
4043
end
4041
4044
@@ -4045,8 +4048,8 @@ end
4045
4048
function end_tuple! (special:: Specialization )
4046
4049
tmp = length (special. tagged)
4047
4050
end_tuple! (special. tagged)
4048
- push! (special. array. tags, special. tag - firstindex (special. array. contents))
4049
- push! (special. array. index, tmp)
4051
+ push! (getfield ( special, : array) . tags, special. tag - firstindex (getfield ( special, : array) . contents))
4052
+ push! (getfield ( special, : array) . index, tmp)
4050
4053
special
4051
4054
end
4052
4055
@@ -4060,8 +4063,8 @@ function push_null!(
4060
4063
) where {ARRAY<: UnionArray ,TAGGED<: OptionType }
4061
4064
tmp = length (special. tagged)
4062
4065
push_null! (special. tagged)
4063
- push! (special. array. tags, special. tag - firstindex (special. array. contents))
4064
- push! (special. array. index, tmp)
4066
+ push! (getfield ( special, : array) . tags, special. tag - firstindex (getfield ( special, : array) . contents))
4067
+ push! (getfield ( special, : array) . index, tmp)
4065
4068
special
4066
4069
end
4067
4070
@@ -4071,8 +4074,8 @@ end
4071
4074
function push_dummy! (special:: Specialization )
4072
4075
tmp = length (special. tagged)
4073
4076
push_dummy! (special. tagged)
4074
- push! (special. array. tags, special. tag - firstindex (special. array. contents))
4075
- push! (special. array. index, tmp)
4077
+ push! (getfield ( special, : array) . tags, special. tag - firstindex (getfield ( special, : array) . contents))
4078
+ push! (getfield ( special, : array) . index, tmp)
4076
4079
special
4077
4080
end
4078
4081
@@ -4236,7 +4239,7 @@ to_vector(
4236
4239
view:: Bool = false ,
4237
4240
na:: Union{Missing,Nothing} = missing ,
4238
4241
) where {FIELDS,CONTENTS<: Base.Tuple{Vararg{Content}} } = NamedTuple {FIELDS} (
4239
- to_vector_or_scalar (record. array. contents[f][record. at], view = view, na = na) for
4242
+ to_vector_or_scalar (getfield ( record, : array) . contents[f][record. at], view = view, na = na) for
4240
4243
f in FIELDS
4241
4244
)
4242
4245
@@ -4253,7 +4256,7 @@ to_vector(
4253
4256
na:: Union{Missing,Nothing} = missing ,
4254
4257
) where {CONTENTS<: Base.Tuple{Vararg{Content}} } = Base. Tuple (
4255
4258
to_vector_or_scalar (content[record. at], view = view, na = na) for
4256
- content in tuple. array. contents
4259
+ content in getfield ( tuple, : array) . contents
4257
4260
)
4258
4261
4259
4262
"""
@@ -4731,7 +4734,7 @@ function _horizontal(data::Any, limit_cols::Int)
4731
4734
limit_cols -= 5 # anticipate the ", ..."
4732
4735
4733
4736
which = 0
4734
- fields = keys (data. array. contents)
4737
+ fields = keys (getfield ( data, : array) . contents)
4735
4738
for field in fields
4736
4739
key = Base. string (field)
4737
4740
@@ -4798,7 +4801,7 @@ function _horizontal(data::Any, limit_cols::Int)
4798
4801
limit_cols -= 5 # anticipate the ", ..."
4799
4802
4800
4803
which = 0
4801
- fields = eachindex (data. array. contents)
4804
+ fields = eachindex (getfield ( data, : array) . contents)
4802
4805
for field in fields
4803
4806
if which == 0
4804
4807
for_comma = 0
@@ -4916,7 +4919,7 @@ function _vertical(data::Union{Content,Record,Tuple}, limit_rows::Int, limit_col
4916
4919
front = Vector {String} ([]) # 1-indexed
4917
4920
4918
4921
which = 0
4919
- fields = keys (data. array. contents)
4922
+ fields = keys (getfield ( data, : array) . contents)
4920
4923
for field in fields
4921
4924
key = Base. string (field)
4922
4925
if occursin (r" ^[A-Za-z_][A-Za-z_0-9]*$" , key)
@@ -4957,7 +4960,7 @@ function _vertical(data::Union{Content,Record,Tuple}, limit_rows::Int, limit_col
4957
4960
front = Vector {String} ([]) # 1-indexed
4958
4961
4959
4962
which = 0
4960
- fields = eachindex (data. array. contents)
4963
+ fields = eachindex (getfield ( data, : array) . contents)
4961
4964
for field in fields
4962
4965
(_, strs) = _horizontal (data[field], limit_cols - 2 )
4963
4966
push! (front, join (strs, " " ))
0 commit comments