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

Re: dynamic vs. static typing



On Fri, Nov 21, 2003 at 01:22:18PM -0500, Joe Marshall wrote:
> Ken Shan <ken@digitas.harvard.edu> writes:
> 
> > I'm sorry but I'm losing your point here.  You have explained what it
> > means to parameterize a type ("list of strings" vs "list of integers"),
> > but not what it means to parameterize a function ("take the length of a
> > string list" vs "take the length of an integer list").  The reason the
> > latter is crucial is because in many statically typed languages these
> > two functions can be the same.
> 
> I was proposing this as a counterexample of your earlier statement:
> 
> > The intuition that I am trying to get at is, -some- part of your program
> > needs to assume -something- about the interface supported by your list
> > elements in order for the program overall to observably operate on the
> > list and its elements.
> 
> There is some value to having a list where *no* part of your program
> assumes *anything* about the interface.

If no part of your program knows anything about the interface, then
reversing or permuting a list doesn't change the one property you do
know about the list: its length.  Some parts of the program, i.e.,
some functions, needn't know anything about it (the ones that
reverse and permute, etc.) but if no part of the program knows
anything about what's in the list, you might as well replace it with
a non-negative integer as Ken proposed earlier; that would retain as
much usable information about the list as keeping the list itself.

- Russ