Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!haven!mimsy!mojo!lbruck From: lbruck@eng.umd.edu (Lewis Bruck) Newsgroups: comp.lang.misc Subject: Re: The search for heterogeneous lists is still on! Keywords: Thrust! Repost! Lunge! Message-ID: <1991Apr17.040927.21608@eng.umd.edu> Date: 17 Apr 91 04:09:27 GMT References: <49591@nigel.ee.udel.edu> <10977:Apr319:27:2891@kramden.acf.nyu.edu> <49726@nigel.ee.udel.edu> Sender: news@eng.umd.edu (C-News) Organization: College of Engineering, Maryversity of Uniland, College Park Lines: 33 In article <49726@nigel.ee.udel.edu> new@ee.udel.edu (Darren New) writes: (...lots of stuff deleted...) > >Still looking for a C function that accepts a hetrogeneous type, how >about, in C, the sizeof "function"? It can accept types and variables >that I have declared in C that the compiler-writers could not have >anticipated me declaring in any important sense. It does not deal in >any way with function pointers. At any time in my program, I can pass >it a variable containing any expressible value, and it will return >the number of bytes that that value requires to be stored. That I can >not pass is an expression, but only a variable, is a restriction >that I don't understand (except on ease-of-compiler-implementation >grounds). > The sizeof "function" is resolved completely at compile time (simple lookup in the type information that the compiler (at whatever pass) has determined to find the physical size). >If you wish to say it doesn't count because it isn't a real function >but rather is built into the compiler, I will merely take this as one >of the advantages of dynamic typing: one doesn't need to kludge >function-like things into the compiler merely because the user cannot >do it him/herself. Would be nice if it occured at run-time, though (makes functions a lot more general :-) > -- Darren > Lewis Bruck lbruck@eng.umd.edu