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

From: [at]} <Josef>
Date: Tue, 29 Jan 2008 12:58:10 +0100

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

I agree with Robert that IN (as it is used by BB now)
is not the same as CONST (as it has been proposed by Wirth in Oberon-SA
http://www.cs.inf.ethz.ch/~wirth/Articles/OberonSAReport.pdf).

IN means that you are not allowed to change a VAR-parameter
inside the procedure, however it might be changed
outside the procedure by some side effect. Therefore it is not strictly
constant. It is sufficient for passing string literals by reference, and this
is probably the main application area.

IMHO the two concepts cannot be merged into one without breaking existing code.
Also, the benefit is marginal in my experience.

I doubt that Wirth allows the usage of const parameters in ConstExpression
as for example in the declaration of an array type inside a procedure.
This would sometimes be a useful feature, however, it may put large amounts
of data onto the stack and it is complicated to implement inthe compiler.
Java went the other way and tried to keep the stack small
by requesting to allocate arrays on the heap.

- JT


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-869066916_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEkgYWdyZWUgd2l0aCBSb2JlcnQgdGhhdCBJTiAo
YXMgaXQgaXMgdXNlZCBieSBCQiBub3cpIFxwYXINCmlzIG5vdCB0aGUgc2FtZSBhcyBDT05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ZWZ1bCBmZWF0dXJlLCBo
b3dldmVyLCBpdCBtYXkgcHV0IGxhcmdlIGFtb3VudHNccGFyDQpvZiBkYXRhIG9udG8gdGhlIHN0
YWNrIGFuZCBpdCBpcyBjb21wbGljYXRlZCB0byBpbXBsZW1lbnQgaW50aGUgY29tcGlsZXIuXHBh
cg0KSmF2YSB3ZW50IHRoZSBvdGhlciB3YXkgYW5kIHRyaWVkIHRvIGtlZXAgdGhlIHN0YWNrIHNt
YWxsXHBhcg0KYnkgcmVxdWVzdGluZyB0byBhbGxvY2F0ZSBhcnJheXMgb24gdGhlIGhlYXAuXHBh
cg0KXHBhcg0KLSBKVFxwYXINClxwYXINClxwYXINCi0tLS1ccGFyDQpUbyB1bnN1YnNjcmliZSwg
c2VuZCBhIG1lc3NhZ2Ugd2l0aCBib2R5ICJTSUdOT0ZGIEJMQUNLQk9YIiB0byBMSVNUU0VSVkBM
SVNUUy5PQkVST04uQ0hccGFyDQp9
----boundary-LibPST-iamunique-869066916_-_---
Received on Tue Jan 29 2008 - 12:58:10 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:31:06 UTC