structured assembler (BASIC) [Really: C builtin functions?]

P. D. Guthrie pdg at ihdev.UUCP
Tue Apr 15 02:11:57 AEST 1986


In article <6584 at utzoo.UUCP> henry at utzoo.UUCP (Henry Spencer) writes:
>> ... but sizeof qualifies as a builtin function, 
>> even though it is a compile-time function vs run-time.   Anyone disagree?
>
>Fraid so.  Sizeof is an *operator*, which can (but does not have to be)
>invoked with a function-like syntax.  If foo is a variable, "sizeof foo"
>(note no parentheses) is legitimate.  The parentheses are necessary for
>syntactic reasons when the operand of sizeof is a type -- and if you
>think this is easy to parse, you should try it sometime! -- but they
>do not make sizeof a function.
>-- 
I admit that you are quite correct.  Infact when I decided to look this
up in the gospel according to K&R,  in the index it is listed
under 'sizeof operator'.  I was thinking of it as a function in a more
mathematical (rather than syntactical) sense,  but I guess all operators
can qualify there (eg. unary minus f(x) = -(x)).  I don't know,  but I
still think that the domain and range of sizeof makes it fit better with
functions than operators,  but the distinction here is getting murkey. 

>Support the International League For The Derision Of User-Friendliness!

Actually,  this is not such a bad idea.  There are many times when user
friendlyness is a curse.  A good example is programs that require a
basis of knowledge about the principles used (for instance object-code
editors) to do anything.  In this example,  it is not good to make it
easy to modify object code as it encourages this sort of thing. 
In general,  certain actions that should be done with care  should not
be made simple for anyone to do.

This time I won't ask if anyone disagrees as I am sure many people will,
 but as always thoughtful followups are encouraged,  but net.lang is
probably not the correct place.
>
>				Henry Spencer @ U of Toronto Zoology
>				{allegra,ihnp4,decvax,pyramid}!utzoo!henry


-- 

Paul Guthrie				`When the going gets weird,
ihnp4!ihdev!pdg				 The weird turn pro'
					  - H. Thompson



More information about the Comp.lang.c mailing list