home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.compilers      Compiler construction, theory, etc. (Mod      2,753 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,896 of 2,753   
   Marc van Lieshout to All   
   Re: Designing a calling convention for a   
   03 Jun 10 22:10:10   
   
   From: marc@lithia.nl   
      
   > The compiler would translate this call to something like this:   
   > some_function(2, 2, a, b, "name-1", c, "name-2", d);   
      
   Why bother with stdarg?   
      
   Suppose you have a function   
      (defun foo (a b &optional c & key d e &rest f) ...   
      
   A solution would be to compile to   
      
   obj foo(obj a, obj b, obj c, obj d, obj e, list *f)   
      
   and let the compiler insert special values for all arguments not   
   supplied, (eq NIL for unassigned optionals)   
      
   So the compiler sorts out the actual arguments to the call and generates   
   code that:   
   - builds a list for the &rest arguments   
   - fills in defaults for all optional arguments   
   - fills in defaults for all keyword arguments   
   - calls the function with all arguments supplied   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca