a[1] a[1][2, 3][4, 5, 6] a[b[c[d]]].e[f[g], h[i, j]] a(1)[2] a(1)[2] { 3 } a(1) { 2 }[3] a(1) { 2 }[3] { 4 } (1 + 2)[3] foo[:bar] # a #0 foo[ #1 # 2 a, # 3 # 4 b, # 5 # 6 ] # 7 # 8 foo( a, # 1 b, # 2 )[ # 3 c, # 4 # 5 ][ d, # 6 ] { |e| # y } a[1] = 2 a[0, 1] = 2 a[0, b[1], foo(2).bar?, *c, {}] = d a[&b] = nil a[1, 2, &b] = nil a[ # 1 true, # 2 # 3 ] = # 4 false # 5 a[ a, # 1 b, # 2 &c # 3 ] = d v = nil v[] = 1 v[2, 3] = 4 foo( a[1] = 2, # 2 3, ) foo.bar(1, 2)[1] = 2 foo.bar( # 1 1, 2, )[1] = 2 [1].map { |n| n.abs }[0] = 1 [ 1, # 1 ][2].foo(3)[4] { 5 } foo.bar = 1 foo(1, 2)[3].bar(4).baz = 5, 6 a.[] # a a.[](1, 2) a.[] 1, 2 a.[][] a.[](1, 2)[] a.[]= # a a.[]=(1, 2) a.[]= 1, 2 # syntax error: a.[1], a.[1]=