I am trying to calculate the product of some sines the arguments of which are stored in a list.
Product[Sin[aList[[i]]], {i, 1, Length[aList]}] /. aList -> {1, 1/2}
which outputs this indicating that Product is looping zero times, that is, apparently Length[aList] is evaluating to 0:
1
Similarly,
myList = {1, 1/2};
Product[Sin[aList[[i]]], {i, 1, Length[aList]}] /. aList -> myList
also outputs
1
But pasting myList directly into the line of code, like this
Product[Sin[myList[[i]]], {i, 1, Length[myList]}]
produces the desired result:
Sin[1/2] Sin[1]
What am I doing wrong?