add first/last classes when using theme_menu_link Im building my own menu tree for various reason, but one think i miss is the first / last classes. I dont find anything about it in the API and i do have drupal_attributes($element['#localized_options']['attributes']) set. 

Where and how would the first/last classes be called?

my function in template.php goes something like this (taken direct from the API) 

function theme_menu_link(array $variables) {
  $element = $variables['element'];
  $sub_menu = '';

  if ($element['#below']) {
    $sub_menu = drupal_render($element['#below']);
  }
  $output = l($element['#title'], $element['#href'], $element['#localized_options']);
  return '&lt;li' . drupal_attributes($element['#attributes']) . '&gt;' . $output . $sub_menu . "&lt;/li&gt;\n";
}
Use Menu attributes module and give special ID or classes to your menu items. The module currently allows you to set the following attributes for each menu item:

Id
Name
Target
Rel
Class
Style
Accesskey