🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #3557

Re: The search for heterogeneous lists is still on!

#3557
From: Lewis Bruck
Date: Wed, 17 Apr 1991 04:09
33 lines
2014 bytes
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
Technical Details
Message-ID: <1991Apr17.040927.21608@eng.umd.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!haven!mimsy!mojo!lbruck
References: <49591@nigel.ee.udel.edu> <10977:Apr319:27:2891@kramden.acf.nyu.edu> <49726@nigel.ee.udel.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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