Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!haven!ni.umd.edu!uc780.umd.edu!cs450a03 From: cs450a03@uc780.umd.edu Newsgroups: comp.lang.misc Subject: RE: CHALLENGE: heterogeneous collections Message-ID: <27MAR91.22130574@uc780.umd.edu> Date: 27 Mar 91 22:13:05 GMT References: <25MAR91.22422777@uc780.umd.edu> <48913@nigel.ee.udel.edu> <26MAR91.19392004@uc780.umd.edu> <49078@nigel.ee.udel.edu> Sender: usenet@ni.umd.edu (USENET News System) Organization: The University of Maryland University College Lines: 37 Nntp-Posting-Host: uc780.umd.edu Darren New writes: >Well, heck, cowboy. Of course type is a form of information. But is >it information only the compiler has, or is it information that comes >into play at run-time. The question is essentially whether variables >have types or not. If not, then you have dynamic typing. If so, then >you have static typing, because each particular reference (variable, >expression, etc) has a known type at compile time. Variables have types when I assign them values. That information is carried explicitly in interpreted code, and implicitly in compiled code. I don't have to variable declare types for the compiler any more than I have to declare the types of intermediate results. Of course, for ill-conditioned cases, the compiler generates lousy code. The simple solution is don't write bad code. >When you say something is a homogenous collection, you seem to be >saying that every element is a pair and hence is all the >same type. Naturally in a dynamically typed system, the types have to >be carried along with the values in some way. Did I say that? hmm... If I have a bitmap, that's a homogenous collection, and I sure don't carry type information along with each bit. On the other hand, if for some reason I wanted a collection of bitmaps and strings, I'd have a list of pointers to data descriptors. One pointer (and descriptor) for each element of the list. Those data descriptors would carry "type" [and size], etc. But I deal with a homogenous collection: a list of pointers. Personally, if I have bitmaps and strings, I'd prefer to refer to them by separate names (that is, store them in separate variables). And as a general rule, this runs faster (than using indirection). Raul Rockwell