roxen.lists.pike.general

Subject Author Date
答复: Suggestion: support '&' in a 郭雪松zZ x <郭雪松zZ x[at]nirgend> 09-10-2009
 =?utf-8?Q?rgument_define?=
Great !

-----邮件原件-----
发件人: Henrik Grubbström [mailto:<grubba[at]roxen.com>] 
发送时间: 2009年10月9日 17:42
收件人: Xuesong Guo
抄送: 'Pike mailinglist'
主题: Re: Suggestion: support '&' in argument define

On Fri, 9 Oct 2009, Xuesong Guo wrote:

> Pike support '|' in argument define:
>
> void look(Char|Room target);
>
> I suggest to support '&':
>
> void look(HasName&HasDesc target);
>
> Because for 'look', anything has a name and description is acceptable.

This syntax suggestion has been on the todo-list for quite a while (the 
concept is actually fully supported by the low-level type-checker, and is 
available to be used by functions implemented in C).

> Current in pike, we must add a new class Lookable{inherit HasName; inherit
> HasDesc;}, that is only for 'look' and not general.
>
> Xuesong Guo

--
Henrik Grubbström					<grubba[at]roxen.com>
Roxen Internet Software AB