Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!wuarchive!udel!ee.udel.edu From: new@ee.udel.edu (Darren New) Newsgroups: comp.object Subject: Re: A Hard Problem for Static Type Systems Message-ID: <51785@nigel.ee.udel.edu> Date: 24 Apr 91 20:22:24 GMT References: <2392@optima.cs.arizona.edu> Sender: usenet@ee.udel.edu Organization: University of Delaware Lines: 33 Nntp-Posting-Host: estelle.ee.udel.edu In article <2392@optima.cs.arizona.edu> gudeman@cs.arizona.edu (David Gudeman) writes: >OK, I give up. What is the difference between dynamic typing and >dynamic binding? How about an example? Hermes gives a declaration (polymorph) and two operations (wrap and unwrap) for dealing with it. You can take a typed value and wrap it into a polymorph. Later, you can take that polymorph and unwrap it into a typed value (with appropriate runtime checks). However, there is nothing else you can do with the polymorph (except ask its type and such) while it is wrapped: specifically, you cannot operate on the wrapped typed value. This feature allows building of hetrogeneous lists, resource managers, dictionaries, and so on. However, it seems to be a pain to build `objects' in Hermes because each capability for sending a message must be unwrapped before use if it is passed in a polymorph and must be predeclared of the right type if it is not a polymorph. Either each "object" will have a dictionary of polymorphs which must be unwrapped or will have a separate declaration for all possible combinations of messages handled (clearly unfeasible). C++ has static typing (in that it is illegal to perform an operation on something that the declared type does not support), but it is possible that the same call will invoke different methods for different values of arguments. This I call dynamic binding. Smalltalk mixes this up because the type of a value *always* determines what method a message will be bound to, and thus people tend to confuse these two properties. -- --- Darren New --- Grad Student --- CIS --- Univ. of Delaware --- ----- Network Protocols, Graphics, Programming Languages, FDTs ----- +=+ Nails work better than screws, when both are driven with hammers +=+