How to programmatically list users with a certain role? What is the preferred way of programmatically generating a list of users with a certain role?

(I know how to do it with a database query, but surely there's a higher-level method.)
In Drupal 7, user_load_multiple($uids = array(), $conditions = array(), $reset = FALSE) 
will load the user details for the given user IDs.
In Drupal 6, there isn't that function, but you can use $user = user_load(array('uid' =&gt; $node-&gt;uid));.