# Use for $call_verb

Kipp the Kidd (mcmudge@mailbox.syr.edu)
Sun, 4 Aug 1996 19:46:35 PDT

- Messages sorted by:[ date ][ thread ][ subject ][ author ]

    At 12:51 PM 8/2/96 PDT, 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.

    ...I still think that the highest priority should be to optimize the server
    code before allowing some potentially server-intensive 'features'.  Maybe
    there's just a better server way of doing it though.  If this was done
    in-db, $call_verb() would be called excessively, if it was part of the
    server, it would be able to decide what to do with the data type more
    efficently.

    There's one thing I don't really understand though, what's the difference
    between..

    ----- This:
    #666:some_verb():  {4,2,3,1}:sort()
    #0:call_verb():    caller_perms() shit
                       buncha typeof() shit
                       figure out where/what :sort() is and if
                        it uses lists.
                       call $some_util:sort({4,2,3,1});
    ----- And this:
    #666:some_verb():  $some_util:sort({4,2,3,1});
    -----

    For the mentally blind, the difference is somewhere around 100 ticks,
    depending on how many verbs are built into our frobs, and about 15
    characters in #666:some_verb().

    I have a better idea.  In xxx:yyy(zzz), if xxx is not an object, return
    $frobs_utils:yyy(xxx,zzz);  I doubt this will ever make it into a final
    release, but I would REALLY REALLY (please please?) like someone to make a
    patch for this.

    I think we're just getting too lazy.  We want the MOO to figure out what
    $util has what verb and which uses the correct type.  Yes, frobs is pretty
    damn useful and easy, but why can't we just memorize $utils?  And if we
    can't, why not just merge the $utils?

    All the freaky weirdos who are so stupid they can't memorize $utils should
    do some more studying.  As for me, I think frobs is a great idea, those
    $utils are too confusing.

    - Kipp
    PS. paragraph[$]:parse_joke();
    http://radioactivo.com.mx/~paradigm