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

method return values' types

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

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?

-- Jonathan bachrach

31, rue Saint-Merri
F75004 Paris, France