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

Re: Extending Open Generics



On Tuesday, Dec 3, 2002, at 19:04 US/Eastern, Rob Myers wrote:

> On Tuesday, December 3, 2002, at 11:50 PM, P T Withington wrote:
>
>> 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.
>
> OK, I'll try this. Thanks. I think the Harlequin book has a good 
> section on creating and assigning names.

Yah, I wrote that.  What I wrote is certainly more authoritative that 
what I say (bit rot).

>> 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?
>
> There isn't a generic in cocoa-wrappers, just the method (if I've read 
> your message correctly). Wouldn't defining the generic in the 
> importing module clash with the export, or can you declare a generic 
> as often as you like? The file is generated by a particularly dumb 
> script, I don't want to have to keep track of generics. I can add the 
> definitions for any clashes by hand, though.

I may have confused Dylan with CLOS, but I thought that if you just 
define a method, the compiler implicitly defines a generic.  What I was 
suggesting is that if the compiler does not see the generic first, it 
may get confused.  pp. 214++ in "Dylan Programming" is the place you 
want to be looking, I believe.