[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SizeOf function

In article <9202252327.AA03543@cambridge.apple.com> bill@cambridge.apple.com (Bill St. Clair) writes:

   From: bill@cambridge.apple.com (Bill St. Clair)
   Date: 25 Feb 92 23:34:57 GMT

   >Is there something analogous in MCL to the SizeOf function that is thrown
   >around so liberally in Inside Mac VI?  In particular I need to get the
   >SizeOf a AEAddressDesc.

   (record-length :AeAddressDesc)

   Record-length is a macro. It returns a constant at compile time.

Another of them Kerns Macro Style Dicta:

Anything that doesn't have to be a macro shouldn't be a macro.

In other words, this should be a function, with a compiler-macro
defined to do the optimization when the argument is constant.