| Sun Microsystems Laboratories Experimental Stuff | [Fortress-interest] exporting overloaded functions from an API |
This message seems to have been eaten by a mailer glitch.
Begin forwarded message:
> From: Jan-Willem Maessen <JanWillem.Maessen@sun.com>
> Date: January 22, 2007 1:29:50 PM EST
> To: Jan-Willem Maessen <Janwillem.Maessen@sun.com>
> Cc: Mike Atkinson <mike@ladyshot.demon.co.uk>, Fortress-
> interest@www.experimentalstuff.com
> Subject: Re: [Fortress-interest] exporting overloaded functions
> from an API
>
>
> On Jan 21, 2007, at 10:14 PM, Jan-Willem Maessen wrote:
>
>>
>> On Jan 21, 2007, at 12:59 PM, Mike Atkinson wrote:
>>
>>> component Collections
>>> export {MyFn}
>>>
>>> MyFn(a:ZZ):Boolean = false
>>> MyFn(b:Boolean):Boolean = true
>>>
>>> end
>>>
>>>
>>> do both function definitions get exported? Is it possible to
>>> export only one?
>>
>> Actually, that depends on what you've declared in the api MyFn.
>> The export list lists apis, not functions. So if you wrote:
>>
>> api MyFn
>>
>> MyFn(a:ZZ):Boolean
>>
>> end
>>
>> then only the first of the two definitions will be exported.
>
>
> I should clarify at this point that this is looking ahead rather.
> If you read the 1.0alpha spec (Section 22.2 in 1.0alpha, middle of
> p164, says Victor), you'll quickly learn that we are required to
> export the entire function, as in the MyBigFn api:
>
>> api MyBigFn
>>
>> MyFn(a:ZZ):Boolean
>> MyFn(b:Boolean):Boolean
>>
>> end
>
> This avoids some problems which crop up should your api slice your
> multiple-inheritance trait hierarchy in a different direction than
> your overloaded function declarations choose to. My hope is that
> we can address those problems and eventually permit narrower apis
> like the MyFn api above.
>
> That said, the interpreter doesn't implement components and apis
> yet; that's been a big focus of recent attention.
>
> -Jan
>
>
|
This page is: http://www.experimentalstuff.com/pipermail/fortress-interest/2007-January/000096.html Last Modified: Tue, 30 Jan 2007 19:35:03 GMT copyright (c) 2000-2009, Sun Microsystems |