On Tuesday, September 30, 2003, at 03:08 PM, Mike D. wrote:
Subject: Re: Syntax of Extends?
From: "Mars Saxman" <mars at realsoftware dot com>
Date: Tue, 30 Sep 2003 11:01:04 -0700
md03 at xochi dot com wrote:
Do I need to overload the function with both extends and non-extends
definitions?, i.e.
Function Foo extends x() as double) as double
Function Foo x() as double) as double
Yes, exactly.
I think why this seems odd to me is that many of the built-in
functions are already overloaded, so I expected the Extends keyword to
behave the same. E.g. with the Len() function, you can do either:
n = s.len
n = len(s)
So it might be nice to have that built in as the default syntax; i.e.
when you use Extends, it automatically allows either syntax?
However, if you did that, there would be no way to prevent the second
invocation if you really didn't want a user to do it that way...
The question becomes, which is more natural and flexible? Is there
ever a case where you want to allow
n = x.foo
but you have a compelling reason to prevent
n = foo(x)
I think that the way it is now is clear.
Charles Yeomans
- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|