Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 exptools; site ihdev.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!ihdev!pdg From: pdg@ihdev.UUCP (P. D. Guthrie) Newsgroups: net.lang,net.lang.c Subject: Re: structured assembler (BASIC) [Really: C builtin functions?] Message-ID: <596@ihdev.UUCP> Date: Mon, 14-Apr-86 11:11:57 EST Article-I.D.: ihdev.596 Posted: Mon Apr 14 11:11:57 1986 Date-Received: Sat, 19-Apr-86 14:34:52 EST References: <443@3comvax.UUCP> <7900003@ztivax.UUCP> <584@ihdev.UUCP> <6584@utzoo.UUCP> Reply-To: pdg@ihdev.UUCP (55224-P. D. Guthrie) Organization: AT&T Bell Laboratories Lines: 42 Keywords: BASIC, C Xref: watmath net.lang:2372 net.lang.c:8628 In article <6584@utzoo.UUCP> henry@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