public static function join(Array $pieces, $glue) {
    $s = NULL;
    foreach ($pieces as $key =>$piece) {
      if (is_array($piece)) $piece = 'Array';

      $s .= sprintf($glue, $piece, $key);
    }
    return $s;
  }