Hi Ingo,

If I'm not mistaken, both your answers touch on documentation issues, not
on function implementation.

I don't see any harm in having a type specifier as part of the function
declaration, which enforces a return type ... as long as it's *optional* ;-).

Something like:

func [ a [any-type!] b [integer!] /local ... /return [any-type!]] [
]

Perhaps with auto-conversion?

At 09:49 PM 4/4/00 +0200, you wrote:
>Those were the words of [EMAIL PROTECTED]:
>> Hi Gisle,
>> 
>> why should return types be defined for functions?
>
>Just some random thoughts on this:
>
>1) it would be easier to guess what a function does, or how
>   to use it:
>
>compare this 
>
>>> help compress                  
>Compresses a string series and returns it.
>Arguments:
>    data -- Data to compress (any-string)
>
>to this
>
>>> help compress                  
>Compresses a string series and returns it.
>Arguments:
>    data -- Data to compress (any-string)
>Returns:
>    binary! -- Maybe with some more explanation here
>
>which carries more information for you? How do you
>use it correctly?
>
>
>2) If you change the function some time later it is 
>more likely that you don't introduce changes which
>would break existing code.
>
>
>regards,
>
>Ingo
>
>--  _     .                                _
>ingo@)|_ /|  _| _  <We ARE all ONE   www._|_o _   _ ._ _  
>www./_|_) |o(_|(/_  We ARE all FREE> ingo@| |(_|o(_)| (_| 
>http://www.2b1.de/Rebol/                     ._|      ._|
>
>
>

;- Elan >> [: - )]

Reply via email to