[1200] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next next in chain last in chain last

Re: [COLD] cold stuff ;)

daemon@ATHENA.MIT.EDU (Wed Jan 1 14:49:52 1997 )

Date: Wed, 1 Jan 1997 12:43:30 -0700 (MST)
From: Brandon Gillespie <brandon@glacier.cold.org>
To: Jeff Kesselman <jeffk@ten.net>
cc: coldstuff@cold.org
In-Reply-To: <>

> 1) Did textdump ever get fixed?  Do we have a dumpsplit that works on the
>    new format?

What was wrong with the textdump?

There is an intelligent splitter that works with the new format (not only 
does it split objects, it sorts variables and methods alphabetically for
good use with unix diff), it will be included in the BETA and other cores
with a system for upgrading a database.

> 2) Is it true that user() has no useful or meaningful default before you
>    issue a set_user()??  Wouldn't it make sense for the default value
>    of user() to be the object that is at the top of the current call stack?

Not really.  It all depends upon what user() is for.  It is simply a means
of identifying a 'key' controller object within the call stack, with a
standard interface (i.e. 'tell').  Having it default to an arbitrary
object could potentially break many things assuming that it always returns
a standard class of object (defined within the database).  Having it
return #-1 (as it does now) before it is set allows you to know whether or
not its the 'standard' class of object.  If its a big concern, just call
set_user() in $connection.parse().  Frankly user() breaks encapsulation,
is unnecessary, and you won't find it being used anywhere in the core  8)

> 3) Efficiency question.  If I define a list and then reference it inside of
>    multiple other lists is only 1 copy of the list created? What if I pass
>    such a  reference to a different object? Does it still reference the
>    original list (this would make sense and be good behavior...)

Only one copy exists at all times, until the list is changed.  For

    list = [1, [2, [3, [4, [5]]]]];
    sublist = list[2][2][2];

At this point 'sublist' is simply a 'pointer' to the list-in-list which

    [4, [5]]

No data has been duplicated at this time.  If we call the method 'foo'
with the argument 'sublist' the list is simply referenced once more, still
no data has been duplicated.  However, if 'foo' alters the sublist, either
by adding elements, changing the element's value or some similar function,
a new list is created with each element, as is appropriate (keep in mind
even the new list will still only have references for the data, as is

-Brandon Gillespie