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

Re: dynamic vs. static typing



On Mon, 24 Nov 2003, Matt Hellige wrote:

> [Joe Marshall <jrm@ccs.neu.edu>]
> > But if you take the view that certain operations (like intensional
> > equivalence or intensional identity) are independent of the objects,
> > then the notion of heterogeneous lists becomes much more interesting.
> > Permutation, for example, becomes possible.
> >
>
> Can you explain why a designer would want to take this view? Does it
> have some benefits that I've missed?

While I'm not sure I'd argue that a program in its entirety could ever be
completely ignorant of the properties of the objects in a list (though I
can actually come up with a few cases where that's possible) there are
certainly cases where there are practical reasons for parts of programs to
be entirely ignorant of the properties of objects in a list or other
aggregate.

Given the difficulties that people seem to have in writing properly done
randomization code, a single library routine that randomizes the order of
a list of objects seems a very useful thing, as do stack manipulation
operations list permutation operations, and various other "move the
abstract thing around" operations. And yes, you could instantiate
type-specific versions, but then you have issues with mixed-type lists or
code-size issues.

The *whole* program wouldn't be ignorant of the fact that the list was a
list of card objects or experimental victims^W^Wfreshman volunteers, say,
but the shuffling code could be entirely ignorant of the types of the
things in the list.

Not a huge set of cases where type ignorance is bliss, but the set's not
empty.

					Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk