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

Re: Some Dylan improvements



On Thu, 30 Mar 2000, Jason Trenouth wrote:
> On Thu, 30 Mar 2000 [...], Hugh Greene <q@tardis.ed.ac.uk>
> > On Thu, 30 Mar 2000, Scott McKay wrote:
> > > Eric Gouriou wrote in message <38E1B578.BC05AD4E@cup.hp.com>...
> > > > ... Proposed changes (more comments below) ...
> > > >B) add a way to specify a module interface beyond mere names
> > > 
> > > I think this is a good idea ...  Yes, there is the "two hunks of code"
> > > problem, but ... if this were an optional part of 'define module', it
> > > would be worth trying. 
> > 
> > Yes, absolutely, this should be optional, just like type declarations,
> > sealing etc.  I see no reason why you shouldn't provide type info for some
> > exported names and not for others (in which case they'd effectively have
> > type <object>), specially in incremental development.
> 
> An alternative might be to put the note on the binding definitions:
> 
> 	define exported generic foo () => ();
> 
> This would avoid the redundancy. Modules definitions would then be reduced to
> importing.

Err, no, sorry, because: 

  (a) Eric's (or at least my) idea is that the exported type might be a
supertype of the implementation type, so you can swap implementations
without recompilation;

  (b) you might well want to export the same name from several modules
(maybe with different types), and maybe not at all from the one in which
it's defined (using the "create" clause);

  (c) I'm sure there was a (c) but I've lost my train of thought here :-)

And since (it seems to me) you need separate module definitions for some
of this, you certainly wouldn't want an "exported" definition adjective as
well, or export information would be spread across files!  (Okay, we're
proposing putting type info in two places, but for what seems to me to be
a much better reason.)

Having said that, it really would be nice if there were some way to write
a whole Dylan program in one file, to make things simple for newbies,
rather than needing import/export definitions in a separate file.  This is
one place where the "pay-as-you-go" philosphy of Dylan seems to fail a
bit.

-- Hugh




Follow-Ups: References: