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

Re: dynamic vs. static typing

On 2003-11-21T13:22:18-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.

I don't see any observable value in such a program above and beyond
the observable value of a program that simply doesn't bother storing
any of the list elements.  In other words, any program that makes no
assumptions about the list element's supported interfaces can be turned
into or treated as a program that just forgets about the elements
altogether; the two programs have the same observable behavior.

For instance, the output of the list-reverse function is not observable
unless you make an assumption as to how to observe the returned list.
If we promise ourselves that we will never make any such assumption,
then we may as well replace the list with the natural number that is
its length, and have list-reverse just return the same number as it is
given.  No one (who adheres to that promise) will be the wiser.


Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
Pray for Turkey, Northern Ireland, and Britain, please.

Attachment: signature.asc
Description: Digital signature