New answers tagged assignment
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
Related Tags
assignment × 247evaluation × 38
list-manipulation × 26
function-construction × 20
variable-definitions × 19
functions × 16
programming × 14
replacement × 14
variable × 14
scoping × 12
hold × 12
syntax × 10
associations × 9
matrix × 8
rule × 8
symbolic × 7
core-language × 7
symbols × 7
pattern-matching × 6
options × 6
assumptions × 6
conditional × 6
clear × 6
equation-solving × 5
manipulate × 5