[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dynamic vs. static typing
[Mike Austin <mike_ekim@yahoo.com>]
>
> There are far more uses for heterogenious lists when the focus in not on the
> program, but on semantics: AI, MUDs, etc.
>
> > room objects = [Sword new, Rock new]
> > room listObjects
> ['sword', 'rock']
> > eat: room.'rock'
> Can't eat rock!
> > eat: room.'sword'
> Are you really sure you want to do that? :)
>
I believe that this is the point that some of us have been trying to
make: you are still not talking about unconstrained heterogeneity. All
of the things in the room have, even at the most abstractly semantic
level, something in common: they are the kinds of things that can be
in rooms. This means that certain operations can be performed on them,
operations like:
"check to see if X is edible"
"check to see if I can pick X up"
"describe X"
...
One might reasonably expect that other kinds of things might not be
allowed in such a list: other rooms, the entire game universe,
operations on objects, other lists of other things, and so on, just to
name a few. This is the kind of thing a type system could check.
Type systems aren't, in principle, supposed to prevent you from
noticing that a Sword and a Rock have something in common. They're
just supposed to help you understand wha that something is, hopefully
in an automatically verifiable way.
The reason I don't think we're seeing any great examples of TRULY
heterogeneous lists of completely abstract, unconstrained values is
that, as has been amply pointed out, such a thing is literally,
exactly and provably no more useful than (and, in fact, equivalent to)
a natural number. I don't know how to make that more clear.
MAtt
--
Matt Hellige matt@immute.net
http://matt.immute.net