How about overloading the LongRightArrow with a special rule for Part[...] as the second argument?
Unprotect[LongRightArrow];
SetAttributes[LongRightArrow, HoldRest]
LongRightArrow[obj_, property_] := obj[ToString[property]];
LongRightArrow[obj_, Part[property_, partspec__]] :=
Part[LongRightArrow[obj, property], partspec];
Protect[LongRightArrow];
obj = <|"a" -> {2, 3}, "b" -> 5|>
obj⟶a
obj⟶a[[1]]
<|"a" -> {2, 3}, "b" -> 5|>
{2, 3}
2
Chip Hurst was quicker than I to show the generalization
LongRightArrow[obj_, head_[f_, args__]] := head[LongRightArrow[obj, f], args]
So I'll just take one more step to handle unary postfix operators, such as ! (Factorial). Trivial by replacing args__ with args___:
LongRightArrow[obj_, head_[f_, args___]] := head[LongRightArrow[obj, f], args]
Now
obj⟶a!
{2, 6}
EDIT
Re the comment:
obj⟶a⟶b
is equivalent to
LongRightArrow[obj, a, b]
while the desired behavior is
LongRightArrow[LongRightArrow[obj, a], b]
Well, obviously, that's exactly what we should tell Mathematica, it can't guess that for us.
LongRightArrow[obj_, a_, b__] := LongRightArrow[LongRightArrow[obj, a], b]
obj⟶a⟶b⟶b⟶b⟶b⟶b
(((((obj⟶a)⟶b)⟶b)⟶b)⟶b)⟶b
LongRightArrowdoesn't have any built in precedence, according to http://reference.wolfram.com/language/tutorial/OperatorInputForms.html. You might be able to use http://reference.wolfram.com/language/ref/PrecedenceForm.html – evanb Mar 21 '17 at 12:37obj-->Part[a,1]do? – george2079 Mar 21 '17 at 12:50obj-->a[[1]]to be interpreted asPart[obj-->a,1]and notobj-->Part[a,1]? Or do you actually wantobj-->Part[a,1]to give2? @george2079 I think if he is talking about precedence he means the first. – rhermans Mar 21 '17 at 13:222fromobj-->Part[a,1]without altering precedence, I would like to learn that too – Neel Basu Mar 21 '17 at 13:30NotationBut that didn't work – Neel Basu Mar 21 '17 at 13:46Partsomehow, or do you want to map to the first argument of any function,obj-->f[x] -> f[obj-->x]– george2079 Mar 21 '17 at 14:05Partis not the only problem, this happens with other operators also,^is one such example – Neel Basu Mar 21 '17 at 14:07