Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zaphod.mps.ohio-state.edu!usc!ucsd!ucbvax!bloom-beacon!eru!hagbard!sunic!news.funet.fi!fuug!tuura!risto From: risto@tuura.UUCP (Risto Lankinen) Newsgroups: comp.lang.c Subject: 'void' arguments (Yet Another Feature Proposal) Message-ID: <943@tuura.UUCP> Date: 22 Jan 91 11:41:38 GMT Distribution: comp Organization: Nokia Data Systems Oy Lines: 35 Hi! Suppose there's function... SetThisMode( int iMode,int iValue1,int iValue2,int iValue3 ); also suppose the documentation says that 'when iMode==, then none of the iValue:s have any effect'. In code you'd then write: SetThisMode( ,0,0,0 ); or SetThisMode( ,, , ); when you could be doing... SetThisMode( ,(int)any,(int)any,(int)any ); where the 'any' is my proposal for a keyword (as promised in the header). It could be any other, too, for that matter - I actually tried some 'void' derivatives, to check out whether there already were a legal way to do so. Why? Because I feel the code would be more readable with this arrangement, and because the compiler will have some more freedom to optimize this kind of function calls (a PUSH 0 would become PUSH , which is smaller and maybe faster too, or a sequence of them would become SUB SP, which definitely is more optimal in both size and speed). I also think that _pascal functions with variable arguments would become much easier to implement (with the cost of added stack usage) by declaring arguments for the 'worst case', and then using only those that are needed. Terveisin: Risto Lankinen -- Risto Lankinen / product specialist *************************************** Nokia Data Systems, Technology Dept * 2 2 * THIS SPACE INTENTIONALLY LEFT BLANK * 2 -1 is PRIME! Now working on 2 +1 * replies: risto@yj.data.nokia.fi ***************************************