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

Re: Extending Open Generics



My dylan's a bit rusty, but I recall the recommended practice to have 
an interface module that creates the names and then any number of 
implementation modules that will assign definitions to the names.  
Another thought:  a method by itself implicitly defines a generic, if 
the generic definition has not already been seen.  Perhaps you just 
have an ordering problem where the generic has not been seen in 
cocoa-wrappers before the method is seen?

On Tuesday, Dec 3, 2002, at 18:25 US/Eastern, Rob Myers wrote:

> I define an open generic in a module, define a method on that generic, 
> and export the name.
>
> 	define /*exported*/ open generic size( object :: <object> )
> 	=> ( size :: <object> );
>
> 	define /*exported*/ method size( object :: <NSRect> )
> 	=> ( size :: <NSSize> )...
>
> I use the module in another module, and define another method there.
>
> 	define /*exported*/ method size( self :: <NSImageRep> )
> 	=> ( result :: <NSSize>)...
>
> And d2c gives me the error:
>
> 	In Define Module cocoa-wrappers.:
> 	Error: Can't import size from module cocoa-basics into module 
> cocoa-wrappers
> 	because it would clash with size defined inside module cocoa-wrappers.
>
> I thought you could extend open generics in other modules? What am I 
> doing wrong?
>
> - Rob.
>