Re: [BLACKBOX] IN Parameters - Making the design more regular

From: [at]} <CFB>
Date: Tue, 29 Jan 2008 09:58:56 +1030

----boundary-LibPST-iamunique-744001529_-_-
Content-type: text/plain

>-----Original Message-----
>From: BlackBox [mailto:BLACKBOX{([at]})nowhere.xy
>Sent: Tuesday, 29 January 2008 9:07 AM
>To: BLACKBOX{([at]})nowhere.xy
>Subject: Re: [BLACKBOX] IN Parameters - Making the design more regular
>

>I think this is a rather brave suggestion!

I have a couple of others that I dare not mention. This one is relatively
uncontroversial in comparison.

>3 - I disagree that IN variables should (always) be passed by
>value.

I did not say that. Try forgetting what you know already and read it again.

> If you are passing a large RECORD or ARRAY it is much
>more efficient to simply pass 1 address.

Indeed.

> Your comments are
>inconsistent. How can both quotes below be true?
>
> - "Value and input (keyword IN) parameters are local
>variables to which the value of the corresponding actual
>parameter is assigned as an initial value"

>- "The compiler developer is still free to implement efficient

>handling of records and arrays when used as input parameters.
>As is the case currently, such parameters do not need to be
>copied to the stack when the procedure is invoked"
>

A local variable in a procedure is one that cannot be accessed from outside
that procedure. A local variable either has an undefined value at the start
of the procedure (OUT) or a defined value (default, IN and VAR). None of
this *dictates* exactly how this should happen inside the compiler.

>Anyway, I want to know that the compiler writer has
>implemented passing a large IN array efficiently, not just be
>assured that he/she is permitted to do so.
>

I would as well. I would also like to know that they have implemented a CASE
statement using jumps rather than a chain of if-then-elses, or that they
have used registers rather than the stack for passing parameters in leaf
procedures, or all of the many other ways that compiler writers can do their
job properly. Should all of these implementation details also be spelt out
in the language specification?

>
>5 - The biggest question of all is: If we start allowing some
>language changes where do we stop, and how do we control this?
>

I share your reservations concerning language changes. However, I see this
proposal more as a removal of an arbitrary implementation-driven restriction
rather than a language change.

Thanks for the feedback,

Regards,
Chris

Chris Burrows
CFB Software
http://www.cfbsoftware.com/cp


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-744001529_-_-
Content-type: application/rtf
Content-transfer-enc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