MOO-cows Mailing List Archive

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

call_verb() (Re: Use for $call_verb)



At 11:51 -0800 8/2/96, Jefferson M. Dubrule wrote:
>I just thought of a really cool thing that could be done if there existed a
>server->database interface for calling verbs.
>
>The idea would be that a verb call: foo:bar(args) would attempt to call
>#0:call_verb(foo, "bar", {@args}) before making the call by itself.  If the
>verb on #0 did not exist (or was -x), it would proceed with the call normally,
>if the the built-in raised an error, that would be passed on to the calling
>program, otherwise, the server would pass back whatever call_verb returned to
>the caller.
>
>If NO type checking were done in advance of call_verb, it would be possible to
>do something like this:
>
>{2,1,4,3}:sort();
>
>This would call $call_verb({2, 1, 4, 3}, "sort", {}), which would call
>$list_utils:sort({2, 1, 4, 3}), which returns {1,2,3,4} to $call_verb, which
>passes that back to the player.  This seems like a very cool thing to do,
>OOP-wise.
>
>Comments?

Yes, much better design would be that <object>:<verb>(@<args>) be an
implicit call to a (new) call_verb(OBJ <object>, STR/INT <verb>, LIST
<args> [, boolean <call_even_if_!x>]) built-in function that you could
eventually write a wrapper for it.

And yes, such things would allow to implement frobs in-db :)

Janus (hopping that one day people will stop bloating #0)




References:

Home | Subject Index | Thread Index