comp.lang.ada
 help / color / mirror / Atom feed
From: Marin David Condic <nobody@noplace.com>
Subject: Re: GNAT parameter passing, C-style?
Date: Fri, 26 Dec 2003 15:07:03 GMT
Date: 2003-12-26T15:07:03+00:00	[thread overview]
Message-ID: <3FEC4E89.2070804@noplace.com> (raw)
In-Reply-To: 1072450300.440355@master.nyc.kbcfp.com

My point is that there isn't such a thing as "Pascal" or "C" in this 
respect. There's only some specific *implementation* of Pascal or C. If 
you had a Pascal interpreter, it might not be doing anything with 
pushing and popping parameters on a stack - at least not in any way that 
the programmer could hope to control. Someone could write a C compiler 
that wrote its parameters out to paper tape starting from the middle and 
alternating left and right - why? Maybe just to prove it could be done. 
Implementations on unusual architectures might do unusual things and it 
is an error in thinking that C or Pascal or Ada passes parameters in any 
specific way when there is nothing in the language definition to give 
one reason to think so.

We often seem to see this kind of misunderstanding - that someone's 
experience with one specific implementation (or even several common 
implementations) starts becoming "Ada does this..." or "C does that..." 
when in reality it is "This particular version of this particular 
compiler for this particular language on this particular platform - does 
this..." There is no rule that I know of that dictates that C, Pascal or 
Ada must evaluate and stack up parameters in some specific order, nor, 
AFAIK, was there ever any validation suite to insure that they did. Any 
presumption that it will be done one way or another is thus quite 
misleading.

MDC


Hyman Rosen wrote:
> 
> In an older, simpler world, Pascal pushed its arguments left-to-right and
> the called routine popped the stack, while C pushed its arguments right-to-
> left and the calling routine popped the stack. The C way allows for easy
> handling of variable sized argument lists, and for the caller not to care
> how many arguments the called routine expects and for the called routine
> not to care how many arguments it was actually called with.
> 


-- 
======================================================================
Marin David Condic
I work for: http://www.belcan.com/
My project is: http://www.jsf.mil/NSFrames.htm

Send Replies To: m   o   d   c @ a   m   o   g
                    c   n   i       c   .   r

     "Face it ladies, its not the dress that makes you look fat.
     Its the FAT that makes you look fat."

         --  Al Bundy

======================================================================




  reply	other threads:[~2003-12-26 15:07 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-26 10:37 GNAT parameter passing, C-style? Luke A. Guest
2003-12-26 14:20 ` Marin David Condic
2003-12-26 14:51   ` Hyman Rosen
2003-12-26 15:07     ` Marin David Condic [this message]
2003-12-26 15:39       ` Luke A. Guest
2003-12-26 17:03         ` Hyman Rosen
2003-12-26 17:08           ` Luke A. Guest
2003-12-26 17:27             ` Luke A. Guest
2003-12-26 18:21               ` Frank J. Lhota
2003-12-26 19:06                 ` Frank J. Lhota
2003-12-31 10:23                 ` Keith Thompson
2003-12-31 14:45                   ` Frank J. Lhota
2003-12-31 15:05                     ` Hyman Rosen
2003-12-31 16:30                       ` Frank J. Lhota
2003-12-31 17:24                         ` Hyman Rosen
2003-12-31 19:05                           ` Frank J. Lhota
2003-12-31 19:38                             ` Hyman Rosen
2003-12-31 20:47                               ` Frank J. Lhota
2003-12-31 21:35                                 ` Hyman Rosen
2004-01-01  2:50                                   ` Frank J. Lhota
2004-01-01  5:20                                     ` Luke A. Guest
2004-01-01 16:06                                       ` Hyman Rosen
2004-01-01 16:32                                         ` Frank J. Lhota
2004-01-01 16:43                                           ` Hyman Rosen
2004-01-02  0:24                                             ` Frank J. Lhota
2004-01-02  4:09                                               ` Hyman Rosen
2004-01-02 13:29                                                 ` Frank J. Lhota
2004-01-01  5:17                                   ` Luke A. Guest
2004-01-01  5:09                                 ` Luke A. Guest
2004-01-02  1:17                                   ` tmoran
2004-01-01 17:18                                 ` Jano
2004-01-02  0:25                                   ` Frank J. Lhota
2004-01-07  6:37                         ` Dave Thompson
2004-01-01  3:38                       ` Marin David Condic
2004-01-01  5:28                         ` Luke A. Guest
2004-01-01 14:17                           ` Marin David Condic
2004-01-01 16:20                             ` Jeff C,
2004-01-02 13:47                               ` Marin David Condic
2004-01-05 21:06                     ` Keith Thompson
2004-01-06  3:42                       ` Robert I. Eachus
2004-01-06 20:54                         ` Keith Thompson
2004-01-06 23:45                           ` Robert I. Eachus
2004-01-06 13:46                       ` Frank J. Lhota
2003-12-27 14:22             ` Marin David Condic
2003-12-26 17:10         ` Martin Krischik
2003-12-26 19:04           ` Frank J. Lhota
2003-12-26 18:01   ` Georg Bauhaus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox