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

Re: method return values' types



> Date: Mon, 14 Dec 1992 14:03:44 +0100
> From: Jonathan Bachrach <Jonathan.Bachrach@ircam.fr>
> 
> It is quite clear to me that being able to declare the return types of
> method's is very important.  Unfortunately, at present, DYLAN
> provides no mechanism for doing so -- only a future way to declare
> return types of generic-function's.  Of course this is insufficient as
> method's of the same generic-function could have different return
> types.  
> 
> In order to expedite the design of such a feature I propose the
> following syntax:
> 
>   (define-method variable-name parameter-list form-1 form-2 ...)
> 
>   where parameter-list ::=
>   ({required | (required specializer)}*
>    [#next next]
>    [#rest rest]
>    [#key {keyparam | ([keyword] keyparam [default])}*]
>    [#result {result-type | (result-type-1 result-type-2 ...)}]) 
>                 
> I opted to name the return-value token `#result' but other better
> names might be `#return' or more succinctly `#:' or `#=>'.  
> 
> What do people think?

We are working on something much like this.  It isn't ready to publish yet.
I think we all agree that it's important.