# Wierd Verb Stuff - Need Help!

Richard Connamacher (phantom@baymoo.sfsu.edu)
Sat, 27 Jan 1996 10:05:42 PST

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

    Chris Jones wrote:
    >
    >         Hi, everyone.  I'm trying to setup a verb on an object which
    > works like this:
    > [Verb code may not work; making this off the top of my head]
    > cmd = "foo";
    > player:cmd();
    > [Could this be setup so that the second line will execute player:foo(),
    > and then if cmd is changed (say to "bar"), that it would execute
    > player:bar()?]

    The form for any verb call is <object>:(<string>)(<arglist>)
    The <object>:verb() form is actually just a shorthand way of saying
    <object>:("verb")().

    cmd = "foo";
    player:(cmd)();

    would call player:foo().

    That's why, in order to call a verb whose name includes a MOO-code keyword, like
    @join, you have to write player:("@join")().

    Phantom