How to resolve the error: ITEM expected input to be a number but got the string "12" instead in NetLogo?

Solution 1:

This looks like a huge workaround, but it works:

report reduce word a_list only reports a string, if a_list is a list with at least to entries. If it is for example [1], it would only report a number (I didn't know this before)

That's why I make sure that a string is created with word reduce word a_list ""

That string is then reported as a number with read-from-string

to-report reduce_list [a_list]
  report read-from-string word reduce word a_list ""
end