Branch: Tag:

2000-07-12

2000-07-12 13:39:04 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Stricter types.

Rev: lib/modules/Array.pmod:1.43
Rev: lib/modules/Getopt.pmod:1.9
Rev: lib/modules/String.pmod:1.11

5:      /*    * Implode an array of strings to an english 'list' -  * ie. ({"foo","bar","gazonk"}) beomces "foo, bar and gazonk" +  * ie. ({"foo","bar","gazonk"}) becomes "foo, bar and gazonk"    */   string implode_nicely(array(string|int|float) foo, string|void and)   {
14:    switch(sizeof(foo))    {    case 0: return ""; -  case 1: return foo[0]; +  case 1: return ([array(string)]foo)[0];    default: return foo[0..sizeof(foo)-2]*", "+" "+and+" "+foo[-1];    }   }