`list turtles` doesn't work, as it just returns a one-item list
containing the value of `turtles`. The recommended style for
turning an agentset into a list is is `[self] of turtles`, as
stated in the link above. There might be other ways to get a list
from an agentset, but they're certainly not going to be faster in
any significant way. No matter what you do within NetLogo, it's
going to be O(n) (at best) to convert that set to a list.
Regarding `[self] of turtles` returning a list (rather than an
agentset), though, I think it makes a good deal of sense when you
think about it. If you want to build a new agentset, you
generally use `with`; if you want to get values out of each agent
in an agentset, you use `of`. With `of`, there's no guarantee
that whatever that reporter block reports is going to evaluate to
an agent for each of the agents in the agentset—in fact, it very
usually doesn't (e.g. `[who] of turtles`)—so it doesn't make much
set for `of` to always return an agentset (since that's
impossible), nor does it make sense for it to sometimes return a
list and sometimes return an agentset. It should return one type
of thing, ideally. Generally speaking, the only thing that we can
know it will return is a collection of
somethings, and the
only structures that NetLogo has for collections of
somethings
are lists. Thus, `of` should return a list.
Jason Bertsche
Senior Software Developer - NetLogo