The function b[c_] has been previously defined. Does that "1" refer to the smallest number of a list?
Asked
Active
Viewed 1,387 times
2 Answers
7
If you just want to know what the double brackets mean, you can highlight them and use help. Or, you can use Information (?), for example:
?[[
Or, you can use Hold with FullForm to figure out what it means:
a /. b[c][[1]] //Hold //FullForm
Hold[ReplaceAll[a,Part[b[c],1]]]
Carl Woll
- 130,679
- 6
- 243
- 355
1
Yes, 1 refers to the first element of the list. "/." is a rule replacement so I presume in this case that function "b" is returning a list of rules, which the line of code intends to use as a replacement operator for a.
Starting list or array notation at "1" is sometimes confusing for people used to "c" starting indices at 0. Note that there is a form of "Mod" that will properly provide the right index so you don't end up with "0" when you try to get a part of a list.
Mark R
- 1,589
- 5
- 10

a[[1]]is the same asFirst[a]. – Somos Jun 14 '19 at 23:49