Xref: utzoo comp.lang.misc:7094 comp.object:2905 Newsgroups: comp.lang.misc,comp.object Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!snorkelwacker.mit.edu!stanford.edu!leland.Stanford.EDU!elaine13.Stanford.EDU!hoelzle From: hoelzle@elaine13.Stanford.EDU (urs hoelzle) Subject: Re: CHALLENGE: heterogeneous collections Message-ID: <1991Mar27.042219.18924@leland.Stanford.EDU> Sender: news@leland.Stanford.EDU (Mr News) Organization: Stanford University - AIR References: <1991Mar22.210725.29448@neon.S <1991Mar25.220525.11087@leland.Stanford.EDU> <26714:Mar2602:52:1891@kramden.acf.nyu.edu> Date: Wed, 27 Mar 91 04:22:19 GMT Lines: 27 > To implement a generic list type in C, you use macros. Nowhere is there > an explicit ``insert'' operation that demands its own prototypes. So if > you do have an operation that works on multiple types, it will work > correctly through a list. > > Maybe one ``object-oriented'' language or another works badly with > lists, but that's not related to static versus dynamic typing. Really. I'm not sure I understand your solution, so could you please post it? Especially (if it is what I think it is), how does it generalize to larger problems? Just write more macros, I guess... Seriously: all programming languages are Turing-equivalent, so I'm sure you can do everything in C. But what about module interfaces (typed, of course), abstraction etc? How do you preserve them with macros? How do handle non-toy examples where the equivalent to "insert" is a complicated piece of code? Do you really want an "inlined" copy of that code at every call site? -Urs -- ------------------------------------------------------------------------------ Urs Hoelzle, CS PhD student hoelzle@cs.stanford.EDU Center for Integrated Systems, CIS 42, Stanford University, Stanford, CA 94305