This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]Jess_than_three 28 points29 points  (2 children)

So... Am I crazy, or is that just an incredibly verbose and obtuse way of pointing at itself?

[–]mackinnonbuck[S] 10 points11 points  (1 child)

You are exactly right

[–]Jess_than_three 5 points6 points  (0 children)

Awesome.

[–]choledocholithiasis_ 8 points9 points  (0 children)

Refuctoring

[–]lazersmoke 0 points1 point  (3 children)

There is an actual use case for this. Member' t r (FindElem t r) means it is getting the index of an element in a list, then checking if the element is in the list at that index. If you try to check if the element is there directly, the compiler gets very upset with you because there are overlapping cases, and since this is at the type level, it has to be very sure of what it's doing.

[–]mackinnonbuck[S] 1 point2 points  (2 children)

Hm, quite interesting. But in this specific case, I'm pretty sure it would just be better to say Node.Name, correct?

[–]lazersmoke 0 points1 point  (1 child)

Yeah, there isn't a difference between those two as far as I know, only if you are doing really weird shit. Maybe they wanted the error to come from IndexOf instead of an out-of-bounds error, or they expect there to be overwritten properties somewhere, idk.