# Defining a function and order of operations

I feel I have a profound misunderstanding of how Mathematica works. Here's an example that confuses me: Say that for a matrix $$A$$ I want to extract the first $$\mathrm{Tr}(A)$$ normalized eigenvectors (the trace is guaranteed to be an integer). I would write a function

f[A_]= Normalize /@ Part[Part[Eigensystem[A], 2] , Range[Tr[A]]];
v=f[A]


Nevertheless this doesn't work, it just outputs

Normalize[{...}]


and $$...$$ are the unnormalized eigenvectors. Meanwhile, if write

f[A_]= Part[Part[Eigensystem[A], 2] , Range[Tr[A]]];
v=Normalize /@ f[A]


it works perfectly. What is going on here?

• Can you provide an example with a suitable matrix A? – Whelp Dec 17 '19 at 11:02
• I will. By the way, I just solved my problem by replacing f[A_]= ... with f[A_]:= ..., but I don't understand what's the difference between these two.. – user2723984 Dec 17 '19 at 11:04
• @user2723984 See (8829) and links therein. – Mr.Wizard Dec 17 '19 at 14:40