/
lib/banish/
lib/d/
lib/doc/
lib/doc/domains/
lib/doc/efun/
lib/doc/examples/
lib/doc/examples/armour/
lib/doc/examples/contain/
lib/doc/examples/food/
lib/doc/examples/magic/
lib/doc/examples/monster/
lib/doc/examples/room/
lib/doc/examples/weapons/
lib/function/
lib/include/
lib/include/fn_specs/
lib/include/skills/
lib/info/
lib/inherit/base/
lib/log/
lib/manuals/312/
lib/news/
lib/obj/party/
lib/objects/components/
lib/open/
lib/open/library/
lib/open/party/
lib/players/
lib/players/zilanthius/
lib/room/
lib/room/city/arena/
lib/room/city/creator/
lib/room/city/garden/monst/
lib/room/city/obj/
lib/room/city/shop/
lib/room/death/
lib/room/registry/
lib/secure/
lib/secure/UDP_CMD_DIR/
lib/skills/
lib/skills/fighter/
lib/skills/thief/
lib/usr/
lib/usr/creators/
lib/usr/players/
Efun Explode:

This efun has undergone a lot of change, exhibiting quite varied
results depending on the driver. Explode, 'explodes' a string
into an array of strings.  The best way to see differences is to
look at some examples.

Amylaar Driver:

  Explode                   Exploded Array

explode("","a")           ({ "", })
explode("a","a")          ({ "", "", })
explode("aa","a")         ({ "", "", "", })
explode("baa","a")        ({ "b", "", "", })
explode("aba","b")        ({ "a", "a", })
explode("abab","b")       ({ "a", "a", "", })
explode("abc","")         ({ "a", "b", "c", })



312 Driver:

explode("","a")           ({ "", })
explode("a","a")          0 /* should use simul_efun fix!!! */
explode("aa","a")         0
explode("baa","a")        ({ "b", "", "", })
explode("aba","b")        ({ "a", "a", })
explode("abab","b")       ({ "a", "a", })
explode("abc","")         ({ "abc", })

Mudos Driver:

explode("","a")           ({ "", })
explode("a","a")          ({ }) /* should use simul_efun fix!!! */
explode("aa","a")         ({ })
explode("baa","a")        ({ "b", "", "", })
explode("aba","b")        ({ "a", "a", })
explode("abab","b")       ({ "a", "a", })
explode("abc","")         ({ "abc", })


Amylaar explode behaviour can be approximated with a simul_efun
fix, and by adding the delimiter to the string. The exception is
using an empty string, "", as a delimiter.

eg.      Amylaar Driver                  312/Mudos
       explode("abab","b")   ==   explode("abab" +"b","b")

The main reason it has been changed is so the following expression
returns true,

  implode(explode(str,delimiter),delimiter) == str

312 fails, whereas the amylaar doesn't. It is better to use the
amylaar behaviour. So that the mudlib can be used on both, the flag OLD_EXPLODE
has been used. When using the explode efun, esp. in the mainmain mudlib,
do the following,

#ifdef OLD_EXPLODE
  txt_list = explode(txt +"\n","\n");
#else
  txt_list = explode(txt,"\n");
#endif /* OLD_EXPLODE */

This will allow the mudlib to be moved between 312 and amylaar.

                    Zilanthius