Suggestion: support '&' in argument define

View: New views
3 Messages — Rating Filter:   Alert me  

Suggestion: support '&' in argument define

by 郭雪松 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

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.

 

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

 

Xuesong Guo

 


Re: Suggestion: support '&' in argument define

by Henrik Grubbström-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
Roxen Internet Software AB

答复: Suggestion: support '&' in argument define

by 郭雪松 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Great !

-----邮件原件-----
发件人: Henrik Grubbström [mailto:grubba@...]
发送时间: 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@...
Roxen Internet Software AB