New answers tagged

1

This is not an answer. It is a comment that contains an image that can't be put into a comment. I can not reproduce your result. When I execute your code I get the result that I expected which is: I did m y evaluation in V12.1.1 on MacOS 10.13.4. Writing f[x_] := x = x + 1 doesn't really make much sense. The assignment will always fail, but x + 1 will be ...


0

Number of lines in definition: Length@DownValues@f, as suggested by b3m2a1 Number of values stored: remove expressions containing the head Pattern from DownValues. I don't know if there's a better way than this. Note that the duplicates do not cause any trouble. f[0] = 1; f[n_] := f[n] = 2 f[n - 1]; f[m_, n_] := f[m + n]; f[1000]; Position[DownValues@f, ...


Top 50 recent answers are included