ldmud-3.2.9/doc/
ldmud-3.2.9/doc/efun/
ldmud-3.2.9/mud/
ldmud-3.2.9/mud/heaven7/
ldmud-3.2.9/mud/heaven7/lib/
ldmud-3.2.9/mud/lp-245/
ldmud-3.2.9/mud/lp-245/banish/
ldmud-3.2.9/mud/lp-245/doc/
ldmud-3.2.9/mud/lp-245/doc/examples/
ldmud-3.2.9/mud/lp-245/doc/sefun/
ldmud-3.2.9/mud/lp-245/log/
ldmud-3.2.9/mud/lp-245/obj/Go/
ldmud-3.2.9/mud/lp-245/players/lars/
ldmud-3.2.9/mud/lp-245/room/death/
ldmud-3.2.9/mud/lp-245/room/maze1/
ldmud-3.2.9/mud/lp-245/room/sub/
ldmud-3.2.9/mud/lp-245/secure/
ldmud-3.2.9/mud/morgengrauen/
ldmud-3.2.9/mud/morgengrauen/lib/
ldmud-3.2.9/mud/sticklib/
ldmud-3.2.9/mud/sticklib/src/
ldmud-3.2.9/mudlib/uni-crasher/
ldmud-3.2.9/pkg/
ldmud-3.2.9/pkg/debugger/
ldmud-3.2.9/pkg/diff/
ldmud-3.2.9/pkg/misc/
ldmud-3.2.9/src/autoconf/
ldmud-3.2.9/src/bugs/
ldmud-3.2.9/src/bugs/MudCompress/
ldmud-3.2.9/src/bugs/b-020916-files/
ldmud-3.2.9/src/bugs/doomdark/
ldmud-3.2.9/src/bugs/ferrycode/ferry/
ldmud-3.2.9/src/bugs/ferrycode/obj/
ldmud-3.2.9/src/bugs/psql/
ldmud-3.2.9/src/done/
ldmud-3.2.9/src/done/order_alist/
ldmud-3.2.9/src/done/order_alist/obj/
ldmud-3.2.9/src/done/order_alist/room/
ldmud-3.2.9/src/gcc/
ldmud-3.2.9/src/gcc/2.7.0/
ldmud-3.2.9/src/gcc/2.7.1/
ldmud-3.2.9/src/hosts/
ldmud-3.2.9/src/hosts/GnuWin32/
ldmud-3.2.9/src/hosts/amiga/NetIncl/
ldmud-3.2.9/src/hosts/amiga/NetIncl/netinet/
ldmud-3.2.9/src/hosts/amiga/NetIncl/sys/
ldmud-3.2.9/src/hosts/i386/
ldmud-3.2.9/src/hosts/msdos/byacc/
ldmud-3.2.9/src/hosts/msdos/doc/
ldmud-3.2.9/src/hosts/os2/
ldmud-3.2.9/src/hosts/win32/
ldmud-3.2.9/src/util/
ldmud-3.2.9/src/util/erq/
ldmud-3.2.9/src/util/indent/hosts/next/
ldmud-3.2.9/src/util/xerq/
ldmud-3.2.9/src/util/xerq/lpc/
ldmud-3.2.9/src/util/xerq/lpc/www/
Short: New efun m_add()
From: Lars, Rodney
Date: 990310
Type: Feature
State: Done - implemented in 3.2.9

m_add(m, key, data...) in addition to m + ([ ])

> --------------------------------<7>---------------------------------------
> As you can see, adding an empty mapping to a mapping variable when
> using the '+=' operator, does NOT cause the mapping to be copied.
> However, using the same operator for an array does.

True, this behaviour is not overly consistent and partly so for historical
reasons. However, the other part is that arrays and mappings are
fundamentally different entities: if b is an array, and m a mapping

     b + ({ 4 }) not <=> b[0] = 4
but
     m + ([ 0:4 ]) is <=> m[0] = 4

And of course the implementation is completely different.
> 
> This does not seem consistent, especially if consider that when
> you use the '+' operator instead in Routine 1 i.e.
> 
>     b=b+([ ]);      instead of    b+=([ ]);

> 
> the two routines behave the same i.e. the second variable copies the
> contents of the first mapping, and the original contents are unchanged.
> Thus the routine returns as you would expect:
> 
>     ([
>       "c": 3,
>       "a": 1,
>       "b": 2,
>     ])
> 
> Of course, modifying the '+=' operator, so that it extends a copy of the
> contents of the mapping would upset some existing MUDs, not least our own.
> It would also probably take up more processing time and memory, because you
> would have to copy the contents each time, rather than just extend them.
> 
> But perhaps, this is a small price to pay for having a consistent system.
> You could also add an add_mapping() efun to extend a mapping's contents,
> without copying it. You could also add an add_array() efun to extend an
> array, without copying it.