MOO-cows Mailing List Archive

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

Re: Wierd Verb Stuff - Need Help!



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


References:

Home | Subject Index | Thread Index