Article View: comp.lang.misc
Article #3305The search for heterogeneous lists is still on!
From: Dan Bernstein
Date: Sun, 31 Mar 1991 21:32
Date: Sun, 31 Mar 1991 21:32
22 lines
1468 bytes
1468 bytes
So far, people have given lots of examples of lists of union types. Message queues, for instance, are usually union types. The arguments to printf are union types (though they're not typechecked---I think most people consider this a flaw in the interface). Symbolic manipulation routines deal with union types. People have also given the example of ``list of object that understands foo,'' where foo is an operation. In object-oriented languages, such objects are basic types anyway, so these *still* aren't heterogeneous lists. Does anyone have an example of a heterogeneous list---something beyond unions and callback functions---used in a real program? I suspect not. After all, if a module is like printf and understands all the possible types of objects in the list, it's dealing with a union type. If a module does not know all the possible types, it's going to see just a set of function pointers, and it won't even *want* to deal with the object except through those function pointers. If there is a middle case, how would you use it? ---Dan
Technical Details
Message-ID:
<167:Mar3121:32:0891@kramden.acf.nyu.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!rex!ukma!hsdndev!cmcl2!kramden.acf.nyu.edu!brnstndShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!rex!ukma!hsdndev!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.lang.misc Subject: The search for heterogeneous lists is still on! Message-ID: <167:Mar3121:32:0891@kramden.acf.nyu.edu> Date: 31 Mar 91 21:32:08 GMT Organization: IR Lines: 22