MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

Re: wish lists



On Tue, 23 Jul 1996 dg@dcs.st-and.ac.uk wrote:

> Two things I'd like to see that would make coding much simpler and ehance the 
> OO features of the language are:
> 
> a) allowing verbs to be called with the . operator instead of : operator,
>    i.e. object.verb(args)

Hmm... I don't really think this will simplify the MOO language. Two
different operators ( : and . ) which do the same and at the same time one
operator ( . ) which does two different things is not a good idea imho.
 
> b) a mechanism for encapsulating property references.
> 
> What I mean by (b) is probably easier to explain by example. In IdealMOO(tm), 
> there is the following piece of code:
> 
> 	...
> 	d.number = 5;
> 	...
> 
> Now, d happens to be a large display panel in the square. When the property 
> changes, the number on the front does too. This is done by encapsulating the 
> number property. When the above expression is executed by the server, instead 
> of merely setting the property it calls d:_set_number(5) instead.
> 
> 	d:_set_number():
> 		object.number = arg[1];
> 		object.description = tostr("A display panel with a ",
> 			object.number, " on the front.");
> 		return;
> 
> Likewise, reading d.number would instead return the result of d:_get_number(), 
> which wouldn't be defined in this case.

I don't think this will simplify the MOO language either. It might be a nice
tool for experienced MOO programmers though, but It is not trivial to
implement. The MOO server must not let _set_number() call itself again,
when it tries to set the property. 

The above example is of course easy to implement in the current language, by
making a -c prop, and an verb to change it. At this moment I think it's best
to keep the parser as simple as possible, to keep the language easy to
learn, debug and comprehend.

Sander


References:

Home | Subject Index | Thread Index