b = lapply(seq(0, 2*pi, length=100), function(x) sin(x))
a = lapply(seq(0, 2*pi, length=100), function(x) sin)
collapseListOfIdenticalElements(a)
tryCatch( collapseListOfIdenticalElements(b), error=get("("))
Run the code above in your browser using DataLab